From 1ea127cb37f05037fd1c12afc177ba8fba650867 Mon Sep 17 00:00:00 2001 From: muff1nOS <19197077+muff1n1634@users.noreply.github.com> Date: Sat, 21 Sep 2024 20:49:10 -0700 Subject: [PATCH] match `DBInitInterrupts` without asm Not sure why this works --- libs/NdevExi2A/src/DebuggerDriver.c | 32 +++++------------------------ 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/libs/NdevExi2A/src/DebuggerDriver.c b/libs/NdevExi2A/src/DebuggerDriver.c index 6c19f8e4..4e71ec3d 100644 --- a/libs/NdevExi2A/src/DebuggerDriver.c +++ b/libs/NdevExi2A/src/DebuggerDriver.c @@ -57,8 +57,9 @@ void DBInitComm(u8** flagOut, OSInterruptHandler handler) { OSRestoreInterrupts(enabled); } -#if NON_MATCHING -//https://decomp.me/scratch/YjmTr +#pragma push +#pragma optimization_level 0 + void DBInitInterrupts(void) { __OSMaskInterrupts(OS_INTR_MASK(OS_INTR_EXI_2_EXI) | OS_INTR_MASK(OS_INTR_EXI_2_TC)); @@ -67,31 +68,8 @@ void DBInitInterrupts(void) { __OSSetInterruptHandler(OS_INTR_PI_DEBUG, __DBIntrHandler); __OSUnmaskInterrupts(OS_INTR_MASK(OS_INTR_PI_DEBUG)); } -#else -asm void DBInitInterrupts(void){ - stwu r1, -0x10(r1) - mflr r0 - lis r3, 2 - stw r0, 0x14(r1) - addi r3, r3, -0x8000 - bl __OSMaskInterrupts - li r3, 0x40 - bl __OSMaskInterrupts - lis r3, __DBMtrHandler@ha - lis r4, __DBIntrHandler@ha - addi r3, r3, __DBMtrHandler@l - stw r3, __DBDbgCallback - addi r4, r4, __DBIntrHandler@l - li r3, 0x19 - bl __OSSetInterruptHandler - li r3, 0x40 - bl __OSUnmaskInterrupts - lwz r0, 0x14(r1) - mtlr r0 - addi r1, r1, 0x10 - blr -} -#endif + +#pragma pop u32 DBQueryData(void) { __DBEXIInputFlag = FALSE;