Import gx, PadClamp, rest of mtx, TRK 2.6 and MSL (#525)
* Match mtx and Padclamp.c * Match the rest of GX * Import TRK 2.6 * Import MSL headers and files * Merge some MSL headers into ours
This commit is contained in:
parent
a79294aac0
commit
cdb1d1fc37
113 changed files with 11219 additions and 394 deletions
70
src/TRK_MINNOW_DOLPHIN/mainloop.c
Normal file
70
src/TRK_MINNOW_DOLPHIN/mainloop.c
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/serpoll.h"
|
||||
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/msgbuf.h"
|
||||
#include "TRK_MINNOW_DOLPHIN/MetroTRK/Portable/dispatch.h"
|
||||
#include "TRK_MINNOW_DOLPHIN/Os/dolphin/targcont.h"
|
||||
#include "TRK_MINNOW_DOLPHIN/ppc/Generic/targimpl.h"
|
||||
|
||||
void TRKHandleRequestEvent(TRKEvent* event)
|
||||
{
|
||||
TRKBuffer* buffer = TRKGetBuffer(event->msgBufID);
|
||||
TRKDispatchMessage(buffer);
|
||||
}
|
||||
|
||||
void TRKHandleSupportEvent(TRKEvent* event) { TRKTargetSupportRequest(); }
|
||||
|
||||
void TRKIdle()
|
||||
{
|
||||
if (TRKTargetStopped() == FALSE) {
|
||||
TRKTargetContinue();
|
||||
}
|
||||
}
|
||||
|
||||
void TRKNubMainLoop(void)
|
||||
{
|
||||
void* msg;
|
||||
TRKEvent event;
|
||||
BOOL isShutdownRequested;
|
||||
BOOL isNewInput;
|
||||
|
||||
isShutdownRequested = FALSE;
|
||||
isNewInput = FALSE;
|
||||
while (isShutdownRequested == FALSE) {
|
||||
if (TRKGetNextEvent(&event) != FALSE) {
|
||||
isNewInput = FALSE;
|
||||
|
||||
switch (event.eventType) {
|
||||
case NUBEVENT_Null:
|
||||
break;
|
||||
|
||||
case NUBEVENT_Request:
|
||||
TRKHandleRequestEvent(&event);
|
||||
break;
|
||||
|
||||
case NUBEVENT_Shutdown:
|
||||
isShutdownRequested = TRUE;
|
||||
break;
|
||||
|
||||
case NUBEVENT_Breakpoint:
|
||||
case NUBEVENT_Exception:
|
||||
TRKTargetInterrupt(&event);
|
||||
break;
|
||||
|
||||
case NUBEVENT_Support:
|
||||
TRKHandleSupportEvent(&event);
|
||||
break;
|
||||
}
|
||||
|
||||
TRKDestructEvent(&event);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((isNewInput == FALSE) || (*(u8*)gTRKInputPendingPtr != '\0')) {
|
||||
isNewInput = TRUE;
|
||||
TRKGetInput();
|
||||
continue;
|
||||
}
|
||||
|
||||
TRKIdle();
|
||||
isNewInput = FALSE;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue