Update aurora & fixes for OS header changes

This commit is contained in:
Luke Street
2026-04-06 21:25:50 -06:00
parent bdf648008d
commit 8fac510140
6 changed files with 26 additions and 13 deletions
+1 -1
@@ -101,6 +101,9 @@ JUTException* JUTException::create(JUTDirectPrint* directPrint) {
OSMessage JUTException::sMessageBuffer[1] = {0};
void* JUTException::run() {
#ifdef TARGET_PC
return NULL;
#else
u32 msr = PPCMfmsr();
msr &= ~0x0900;
PPCMtmsr(msr);
@@ -132,6 +135,7 @@ void* JUTException::run() {
sErrorManager->mDirectPrint->changeFrameBuffer(mFrameMemory);
sErrorManager->printContext(error, context, r24, r23);
}
#endif
}
void* JUTException::sConsoleBuffer;
@@ -145,6 +149,7 @@ u32 JUTException::msr;
u32 JUTException::fpscr;
void JUTException::errorHandler(OSError error, OSContext* context, u32 param_3, u32 param_4) {
#ifndef TARGET_PC
msr = PPCMfmsr();
fpscr = context->fpscr;
OSFillFPUContext(context);
@@ -165,6 +170,7 @@ void JUTException::errorHandler(OSError error, OSContext* context, u32 param_3,
OSSendMessage(&sMessageQueue, &exCallbackObject, OS_MESSAGE_BLOCK);
OSEnableScheduler();
OSYieldThread();
#endif
}
void JUTException::panic_f_va(char const* file, int line, char const* format, va_list args) {
@@ -234,6 +240,7 @@ void JUTException::showFloatSub(int index, f32 value) {
}
void JUTException::showFloat(OSContext* context) {
#ifndef TARGET_PC
if (!sConsole) {
return;
}
@@ -251,6 +258,7 @@ void JUTException::showFloat(OSContext* context) {
sConsole->print(" ");
showFloatSub(21, context->fpr[21]);
sConsole->print("\n");
#endif
}
bool JUTException::searchPartialModule(u32 address, u32* module_id, u32* section_id,
@@ -333,6 +341,7 @@ void JUTException::showStack(OSContext* context) {
}
void JUTException::showMainInfo(u16 error, OSContext* context, u32 dsisr, u32 dar) {
#ifndef TARGET_PC
if (!sConsole) {
return;
}
@@ -391,9 +400,11 @@ void JUTException::showMainInfo(u16 error, OSContext* context, u32 dsisr, u32 da
}
sConsole->print_f("SRR0: %08XH SRR1:%08XH\n", context->srr0, context->srr1);
sConsole->print_f("DSISR: %08XH DAR: %08XH\n", dsisr, dar);
#endif
}
void JUTException::showGPR(OSContext* context) {
#ifndef TARGET_PC
if (!sConsole) {
return;
}
@@ -404,6 +415,7 @@ void JUTException::showGPR(OSContext* context) {
context->gpr[i + 11], i + 22, context->gpr[i + 22]);
}
sConsole->print_f("R%02d:%08XH R%02d:%08XH\n", 10, context->gpr[10], 21, context->gpr[21]);
#endif
}
bool JUTException::showMapInfo_subroutine(u32 address, bool begin_with_newline) {
@@ -454,6 +466,7 @@ bool JUTException::showMapInfo_subroutine(u32 address, bool begin_with_newline)
}
void JUTException::showGPRMap(OSContext* context) {
#ifndef TARGET_PC
if (!sConsole) {
return;
}
@@ -480,9 +493,11 @@ void JUTException::showGPRMap(OSContext* context) {
if (!found_address_register) {
sConsole->print(" no register which seem to address.\n");
}
#endif
}
void JUTException::showSRR0Map(OSContext* context) {
#ifndef TARGET_PC
if (!sConsole) {
return;
}
@@ -497,6 +512,7 @@ void JUTException::showSRR0Map(OSContext* context) {
}
JUTConsoleManager::getManager()->drawDirect(true);
}
#endif
}
void JUTException::printDebugInfo(JUTException::EInfoPage page, OSError error, OSContext* context,
+2 -7
View File
@@ -23,16 +23,11 @@ void OSSetCurrentContext(OSContext* context) {
}
void OSClearContext(OSContext* context) {
if (!context) return;
context->mode = 0;
context->state = 0;
// No-op on PC
}
void OSInitContext(OSContext* context, u32 pc, u32 newsp) {
if (!context) return;
memset(context, 0, sizeof(OSContext));
context->srr0 = pc;
context->gpr[1] = newsp;
// No-op on PC
}
void OSDumpContext(OSContext* context) {
+3 -3
View File
@@ -101,7 +101,7 @@ static thread_local OSThread* tls_currentThread = nullptr;
static OSThread sDefaultThread;
static u8 sDefaultStack[64 * 1024];
static u32 sDefaultStackEnd = OS_THREAD_STACK_MAGIC;
static u8 sDefaultStackEnd = OS_THREAD_STACK_MAGIC;
// Global interrupt mutex (coarse-grained lock replacing interrupt disable)
// Lazy-initialized to avoid DLL static init crashes
@@ -237,7 +237,7 @@ int OSCreateThread(OSThread* thread, void* (*func)(void*), void* param,
// Stack (stack points to TOP on GameCube)
thread->stackBase = (u8*)stack;
thread->stackEnd = (u32*)((uintptr_t)stack - stackSize);
thread->stackEnd = (u8*)((uintptr_t)stack - stackSize);
*thread->stackEnd = OS_THREAD_STACK_MAGIC;
OSClearContext(&thread->context);
@@ -496,7 +496,7 @@ void OSDetachThread(OSThread* thread) {
OSWakeupThread(&thread->queueJoin);
}
int OSJoinThread(OSThread* thread, void* val) {
BOOL OSJoinThread(OSThread* thread, void** val) {
if (!thread) return 0;
if (!(thread->attr & OS_THREAD_ATTR_DETACH)) {
+2 -2
View File
@@ -94,7 +94,7 @@ static void ClearMsgQueueMap() {
map.clear();
}
void OSInitMessageQueue(OSMessageQueue* mq, void* msgArray, s32 msgCount) {
void OSInitMessageQueue(OSMessageQueue* mq, OSMessage* msgArray, s32 msgCount) {
if (!mq) return;
mq->queueSend.head = mq->queueSend.tail = nullptr;
mq->queueReceive.head = mq->queueReceive.tail = nullptr;
@@ -128,7 +128,7 @@ int OSSendMessage(OSMessageQueue* mq, void* msg, s32 flags) {
return 1;
}
int OSReceiveMessage(OSMessageQueue* mq, void* msg, s32 flags) {
BOOL OSReceiveMessage(OSMessageQueue* mq, OSMessage* msg, s32 flags) {
if (!mq) return 0;
PCMessageQueueData& data = GetMsgQueueData(mq);
+2
View File
@@ -592,6 +592,7 @@ void myExceptionCallback(u16, OSContext*, u32, u32) {
VIFlush();
}
#ifndef TARGET_PC
static void fault_callback_scroll(u16, OSContext* p_context, u32, u32) {
JUTException* manager = JUTException::getManager();
JUTConsole* exConsole = manager->getConsole();
@@ -714,6 +715,7 @@ static void fault_callback_scroll(u16, OSContext* p_context, u32, u32) {
} while (true);
} while (true);
}
#endif
static void dummy_string() {
DEAD_STRING("\x1B[32m%-24s = size=%d KB\n\x1B[m");