diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-03-10 11:17:46 -0500 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-03-10 11:17:46 -0500 |
commit | c9f82001883cb3c2828467bee7fc70ba18ce2569 (patch) | |
tree | 12475ba3d99cebff1540252b2a45f466ca96488b | |
parent | bfaa4de6e8abd81cc7e592ad9f4df3750f71c359 (diff) |
through debug_sub_808BDA4
-rw-r--r-- | asm/tomomichi_debug_menu.s | 200 | ||||
-rw-r--r-- | src/debug/tomomichi_debug_menu.c | 93 |
2 files changed, 93 insertions, 200 deletions
diff --git a/asm/tomomichi_debug_menu.s b/asm/tomomichi_debug_menu.s index 8e1be83f9..a32082703 100644 --- a/asm/tomomichi_debug_menu.s +++ b/asm/tomomichi_debug_menu.s @@ -3,206 +3,6 @@ .include "constants/gba_constants.inc" .include "include/macros.inc" - thumb_func_start debug_sub_808BCBC -debug_sub_808BCBC: - push {r4, lr} - bl Menu_ProcessInput - lsl r0, r0, #0x18 - lsr r4, r0, #0x18 - bl Menu_GetCursorPos - lsl r0, r0, #0x18 - asr r0, r0, #0x18 - cmp r0, #0x1 - beq ._39 @cond_branch - cmp r0, #0x1 - bgt ._40 @cond_branch - cmp r0, #0 - beq ._41 @cond_branch - b ._46 -._40: - cmp r0, #0x2 - beq ._43 @cond_branch - b ._46 -._41: - bl debug_sub_808ED0C - b ._46 -._39: - bl debug_sub_808ED9C - b ._46 -._43: - bl debug_sub_808EE9C -._46: - mov r0, #0x1 - bl debug_sub_808EF8C - lsl r0, r4, #0x18 - asr r1, r0, #0x18 - mov r0, #0x2 - neg r0, r0 - cmp r1, r0 - beq ._50 @cond_branch - mov r0, #0x1 - neg r0, r0 - cmp r1, r0 - bne ._48 @cond_branch - bl CloseMenu - mov r0, #0x1 - b ._49 -._48: - cmp r1, #0x3 - bne ._50 @cond_branch - ldr r0, ._51 @ gMenuCallback - ldr r1, ._51 + 4 @ gUnknown_Debug_083C0D83 - ldr r1, [r1, #0x1c] - str r1, [r0] -._50: - mov r0, #0x0 -._49: - pop {r4} - pop {r1} - bx r1 -._52: - .align 2, 0 -._51: - .word gMenuCallback - .word gUnknown_Debug_083C0D83 - - thumb_func_end debug_sub_808BCBC - - thumb_func_start debug_sub_808BD30 -debug_sub_808BD30: - push {r4, lr} - bl Menu_ProcessInput - lsl r0, r0, #0x18 - lsr r4, r0, #0x18 - bl Menu_GetCursorPos - lsl r0, r0, #0x18 - asr r0, r0, #0x18 - cmp r0, #0x1 - beq ._53 @cond_branch - cmp r0, #0x1 - bgt ._54 @cond_branch - cmp r0, #0 - beq ._55 @cond_branch - b ._60 -._54: - cmp r0, #0x2 - beq ._57 @cond_branch - b ._60 -._55: - bl debug_sub_808ED0C - b ._60 -._53: - bl debug_sub_808ED9C - b ._60 -._57: - bl debug_sub_808EF14 -._60: - mov r0, #0x2 - bl debug_sub_808EF8C - lsl r0, r4, #0x18 - asr r1, r0, #0x18 - mov r0, #0x2 - neg r0, r0 - cmp r1, r0 - beq ._64 @cond_branch - mov r0, #0x1 - neg r0, r0 - cmp r1, r0 - bne ._62 @cond_branch - bl CloseMenu - mov r0, #0x1 - b ._63 -._62: - cmp r1, #0x3 - bne ._64 @cond_branch - ldr r0, ._65 @ gMenuCallback - ldr r1, ._65 + 4 @ gUnknown_Debug_083C0DD4 - ldr r1, [r1, #0x1c] - str r1, [r0] -._64: - mov r0, #0x0 -._63: - pop {r4} - pop {r1} - bx r1 -._66: - .align 2, 0 -._65: - .word gMenuCallback - .word gUnknown_Debug_083C0DD4 - - thumb_func_end debug_sub_808BD30 - - thumb_func_start debug_sub_808BDA4 -debug_sub_808BDA4: - push {r4, lr} - ldr r4, ._71 @ gMain - ldrh r1, [r4, #0x2e] - mov r0, #0x40 - and r0, r0, r1 - cmp r0, #0 - beq ._67 @cond_branch - mov r0, #0x5 - bl PlaySE - mov r0, #0x1 - neg r0, r0 - bl Menu_MoveCursor - ldr r1, ._71 + 4 @ gDebug_0300071E - strb r0, [r1] -._67: - ldrh r1, [r4, #0x2e] - mov r0, #0x80 - and r0, r0, r1 - cmp r0, #0 - beq ._68 @cond_branch - mov r0, #0x5 - bl PlaySE - mov r0, #0x1 - bl Menu_MoveCursor - ldr r1, ._71 + 4 @ gDebug_0300071E - strb r0, [r1] -._68: - ldrh r1, [r4, #0x2e] - mov r0, #0x1 - and r0, r0, r1 - cmp r0, #0 - beq ._69 @cond_branch - mov r0, #0x5 - bl PlaySE - ldr r1, ._71 + 8 @ gUnknown_Debug_083C0E15 - ldr r0, ._71 + 4 @ gDebug_0300071E - ldrb r0, [r0] - lsl r0, r0, #0x3 - add r1, r1, #0x4 - add r0, r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - b ._74 -._72: - .align 2, 0 -._71: - .word gMain - .word gDebug_0300071E - .word gUnknown_Debug_083C0E15 -._69: - mov r0, #0xa - and r0, r0, r1 - cmp r0, #0 - bne ._73 @cond_branch - mov r0, #0x0 - b ._74 -._73: - bl CloseMenu - mov r0, #0x1 -._74: - pop {r4} - pop {r1} - bx r1 - - thumb_func_end debug_sub_808BDA4 - thumb_func_start debug_sub_808BE2C debug_sub_808BE2C: push {r4, lr} diff --git a/src/debug/tomomichi_debug_menu.c b/src/debug/tomomichi_debug_menu.c index fef72e4b3..c90364647 100644 --- a/src/debug/tomomichi_debug_menu.c +++ b/src/debug/tomomichi_debug_menu.c @@ -63,6 +63,8 @@ bool8 debug_sub_808DFC0(void); void debug_sub_808ED0C(void); void debug_sub_808ED9C(void); void debug_sub_808EE3C(void); +void debug_sub_808EE9C(void); +void debug_sub_808EF14(void); void debug_sub_808EF8C(u32 a0); const u8 gUnknown_Debug_083C0C54[] = _("Contest graphics"); @@ -342,4 +344,95 @@ bool8 debug_sub_808BC48(void) return FALSE; } +bool8 debug_sub_808BCBC(void) +{ + s8 input = Menu_ProcessInput(); + s8 cursorPos = Menu_GetCursorPos(); + + switch (cursorPos) + { + case 0: + debug_sub_808ED0C(); + break; + case 1: + debug_sub_808ED9C(); + break; + case 2: + debug_sub_808EE9C(); + break; + } + debug_sub_808EF8C(1); + if (input == -2) + return FALSE; + if (input == -1) + { + CloseMenu(); + return TRUE; + } + if (input == 3) + { + gMenuCallback = gUnknown_Debug_083C0D83[3].func; + return FALSE; + } + return FALSE; +} + +bool8 debug_sub_808BD30(void) +{ + s8 input = Menu_ProcessInput(); + s8 cursorPos = Menu_GetCursorPos(); + + switch (cursorPos) + { + case 0: + debug_sub_808ED0C(); + break; + case 1: + debug_sub_808ED9C(); + break; + case 2: + debug_sub_808EF14(); + break; + } + debug_sub_808EF8C(2); + if (input == -2) + return FALSE; + if (input == -1) + { + CloseMenu(); + return TRUE; + } + if (input == 3) + { + gMenuCallback = gUnknown_Debug_083C0DD4[3].func; + return FALSE; + } + return FALSE; +} + +bool8 debug_sub_808BDA4(void) +{ + if (gMain.newKeys & DPAD_UP) + { + PlaySE(SE_SELECT); + gDebug_0300071E = Menu_MoveCursor(-1); + } + if (gMain.newKeys & DPAD_DOWN) + { + PlaySE(SE_SELECT); + gDebug_0300071E = Menu_MoveCursor(+1); + } + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + return gUnknown_Debug_083C0E15[gDebug_0300071E].func(); + } + if (gMain.newKeys & (B_BUTTON | START_BUTTON)) + { + CloseMenu(); + return TRUE; + } + return FALSE; +} + #endif |