summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/tomomichi_debug_menu.s394
-rw-r--r--src/debug/tomomichi_debug_menu.c135
2 files changed, 135 insertions, 394 deletions
diff --git a/asm/tomomichi_debug_menu.s b/asm/tomomichi_debug_menu.s
index 4cd97de65..9ee4d88c3 100644
--- a/asm/tomomichi_debug_menu.s
+++ b/asm/tomomichi_debug_menu.s
@@ -3,400 +3,6 @@
.include "constants/gba_constants.inc"
.include "include/macros.inc"
- thumb_func_start debug_sub_808ED0C
-debug_sub_808ED0C:
- push {lr}
- ldr r2, ._590 @ gMain
- ldrh r1, [r2, #0x30]
- mov r0, #0x20
- and r0, r0, r1
- cmp r0, #0
- beq ._584 @cond_branch
- ldr r1, ._590 + 4 @ gDebug_03000700
- ldrh r0, [r1]
- cmp r0, #0x1
- beq ._584 @cond_branch
- sub r0, r0, #0x1
- strh r0, [r1]
-._584:
- ldrh r1, [r2, #0x30]
- mov r0, #0x10
- and r0, r0, r1
- cmp r0, #0
- beq ._586 @cond_branch
- ldr r3, ._590 + 4 @ gDebug_03000700
- ldrh r1, [r3]
- ldr r0, ._590 + 8 @ 0x19b
- cmp r1, r0
- beq ._586 @cond_branch
- add r0, r1, #1
- strh r0, [r3]
-._586:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x2
- and r0, r0, r1
- cmp r0, #0
- beq ._587 @cond_branch
- ldr r1, ._590 + 4 @ gDebug_03000700
- ldrh r0, [r1]
- cmp r0, #0xa
- bls ._588 @cond_branch
- sub r0, r0, #0xa
- b ._589
-._591:
- .align 2, 0
-._590:
- .word gMain
- .word gDebug_03000700
- .word 0x19b
-._588:
- mov r0, #0x1
-._589:
- strh r0, [r1]
-._587:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x1
- and r0, r0, r1
- cmp r0, #0
- beq ._592 @cond_branch
- ldr r2, ._595 @ gDebug_03000700
- ldrh r1, [r2]
- ldr r0, ._595 + 4 @ 0x191
- cmp r1, r0
- bhi ._593 @cond_branch
- add r0, r1, #0
- add r0, r0, #0xa
- b ._594
-._596:
- .align 2, 0
-._595:
- .word gDebug_03000700
- .word 0x191
-._593:
- ldr r1, ._597 @ 0x19b
- add r0, r1, #0
-._594:
- strh r0, [r2]
-._592:
- pop {r0}
- bx r0
-._598:
- .align 2, 0
-._597:
- .word 0x19b
-
- thumb_func_end debug_sub_808ED0C
-
- thumb_func_start debug_sub_808ED9C
-debug_sub_808ED9C:
- push {lr}
- ldr r2, ._606 @ gMain
- ldrh r1, [r2, #0x30]
- mov r0, #0x20
- and r0, r0, r1
- cmp r0, #0
- beq ._600 @cond_branch
- ldr r1, ._606 + 4 @ gDebug_03000708
- ldr r0, [r1]
- cmp r0, #0
- beq ._600 @cond_branch
- sub r0, r0, #0x1
- str r0, [r1]
-._600:
- ldrh r1, [r2, #0x30]
- mov r0, #0x10
- and r0, r0, r1
- cmp r0, #0
- beq ._602 @cond_branch
- ldr r3, ._606 + 4 @ gDebug_03000708
- ldr r1, [r3]
- mov r0, #0x1
- neg r0, r0
- cmp r1, r0
- beq ._602 @cond_branch
- add r0, r1, #1
- str r0, [r3]
-._602:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x2
- and r0, r0, r1
- cmp r0, #0
- beq ._603 @cond_branch
- ldr r1, ._606 + 4 @ gDebug_03000708
- ldr r0, [r1]
- cmp r0, #0xf
- bls ._604 @cond_branch
- sub r0, r0, #0x10
- b ._605
-._607:
- .align 2, 0
-._606:
- .word gMain
- .word gDebug_03000708
-._604:
- mov r0, #0x0
-._605:
- str r0, [r1]
-._603:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x1
- and r0, r0, r1
- cmp r0, #0
- beq ._608 @cond_branch
- ldr r3, ._611 @ gDebug_03000708
- ldr r1, [r3]
- mov r0, #0x11
- neg r0, r0
- cmp r1, r0
- bhi ._609 @cond_branch
- add r0, r1, #0
- add r0, r0, #0x10
- b ._610
-._612:
- .align 2, 0
-._611:
- .word gDebug_03000708
-._609:
- mov r0, #0x1
- neg r0, r0
-._610:
- str r0, [r3]
-._608:
- ldrh r2, [r2, #0x2e]
- mov r1, #0xc0
- lsl r1, r1, #0x2
- add r0, r1, #0
- and r0, r0, r2
- cmp r0, r1
- bne ._613 @cond_branch
- ldr r1, ._614 @ gDebug_03000708
- mov r0, #0x1
- neg r0, r0
- str r0, [r1]
-._613:
- pop {r0}
- bx r0
-._615:
- .align 2, 0
-._614:
- .word gDebug_03000708
-
- thumb_func_end debug_sub_808ED9C
-
- thumb_func_start debug_sub_808EE3C
-debug_sub_808EE3C:
- push {lr}
- ldr r2, ._622 @ gMain
- ldrh r1, [r2, #0x30]
- mov r0, #0x20
- and r0, r0, r1
- cmp r0, #0
- beq ._617 @cond_branch
- ldr r1, ._622 + 4 @ gDebug_0300070C
- ldrb r0, [r1]
- cmp r0, #0x1
- beq ._617 @cond_branch
- sub r0, r0, #0x1
- strb r0, [r1]
-._617:
- ldrh r1, [r2, #0x30]
- mov r0, #0x10
- and r0, r0, r1
- cmp r0, #0
- beq ._619 @cond_branch
- ldr r1, ._622 + 4 @ gDebug_0300070C
- ldrb r0, [r1]
- cmp r0, #0x5
- beq ._619 @cond_branch
- add r0, r0, #0x1
- strb r0, [r1]
-._619:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x2
- and r0, r0, r1
- cmp r0, #0
- beq ._620 @cond_branch
- ldr r1, ._622 + 4 @ gDebug_0300070C
- mov r0, #0x1
- strb r0, [r1]
-._620:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x1
- and r0, r0, r1
- cmp r0, #0
- beq ._621 @cond_branch
- ldr r1, ._622 + 4 @ gDebug_0300070C
- mov r0, #0x5
- strb r0, [r1]
-._621:
- pop {r0}
- bx r0
-._623:
- .align 2, 0
-._622:
- .word gMain
- .word gDebug_0300070C
-
- thumb_func_end debug_sub_808EE3C
-
- thumb_func_start debug_sub_808EE9C
-debug_sub_808EE9C:
- push {lr}
- ldr r2, ._631 @ gMain
- ldrh r1, [r2, #0x30]
- mov r0, #0x20
- and r0, r0, r1
- cmp r0, #0
- beq ._625 @cond_branch
- ldr r1, ._631 + 4 @ gDebug_0300070D
- ldrb r0, [r1]
- cmp r0, #0x1
- beq ._625 @cond_branch
- sub r0, r0, #0x1
- strb r0, [r1]
-._625:
- ldrh r1, [r2, #0x30]
- mov r0, #0x10
- and r0, r0, r1
- cmp r0, #0
- beq ._627 @cond_branch
- ldr r1, ._631 + 4 @ gDebug_0300070D
- ldrb r0, [r1]
- cmp r0, #0xf
- beq ._627 @cond_branch
- add r0, r0, #0x1
- strb r0, [r1]
-._627:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x2
- and r0, r0, r1
- cmp r0, #0
- beq ._628 @cond_branch
- ldr r1, ._631 + 4 @ gDebug_0300070D
- ldrb r0, [r1]
- cmp r0, #0xa
- bls ._629 @cond_branch
- sub r0, r0, #0xa
- b ._630
-._632:
- .align 2, 0
-._631:
- .word gMain
- .word gDebug_0300070D
-._629:
- mov r0, #0x0
-._630:
- strb r0, [r1]
-._628:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x1
- and r0, r0, r1
- cmp r0, #0
- beq ._633 @cond_branch
- ldr r1, ._636 @ gDebug_0300070D
- ldrb r0, [r1]
- cmp r0, #0x5
- bhi ._634 @cond_branch
- add r0, r0, #0xa
- b ._635
-._637:
- .align 2, 0
-._636:
- .word gDebug_0300070D
-._634:
- mov r0, #0xf
-._635:
- strb r0, [r1]
-._633:
- pop {r0}
- bx r0
-
- thumb_func_end debug_sub_808EE9C
-
- thumb_func_start debug_sub_808EF14
-debug_sub_808EF14:
- push {lr}
- ldr r2, ._645 @ gMain
- ldrh r1, [r2, #0x30]
- mov r0, #0x20
- and r0, r0, r1
- cmp r0, #0
- beq ._639 @cond_branch
- ldr r1, ._645 + 4 @ gDebug_0300070E
- ldrb r0, [r1]
- cmp r0, #0x1
- beq ._639 @cond_branch
- sub r0, r0, #0x1
- strb r0, [r1]
-._639:
- ldrh r1, [r2, #0x30]
- mov r0, #0x10
- and r0, r0, r1
- cmp r0, #0
- beq ._641 @cond_branch
- ldr r1, ._645 + 4 @ gDebug_0300070E
- ldrb r0, [r1]
- cmp r0, #0xf
- beq ._641 @cond_branch
- add r0, r0, #0x1
- strb r0, [r1]
-._641:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x2
- and r0, r0, r1
- cmp r0, #0
- beq ._642 @cond_branch
- ldr r1, ._645 + 4 @ gDebug_0300070E
- ldrb r0, [r1]
- cmp r0, #0xa
- bls ._643 @cond_branch
- sub r0, r0, #0xa
- b ._644
-._646:
- .align 2, 0
-._645:
- .word gMain
- .word gDebug_0300070E
-._643:
- mov r0, #0x0
-._644:
- strb r0, [r1]
-._642:
- ldrh r1, [r2, #0x30]
- mov r0, #0x80
- lsl r0, r0, #0x1
- and r0, r0, r1
- cmp r0, #0
- beq ._647 @cond_branch
- ldr r1, ._650 @ gDebug_0300070E
- ldrb r0, [r1]
- cmp r0, #0x5
- bhi ._648 @cond_branch
- add r0, r0, #0xa
- b ._649
-._651:
- .align 2, 0
-._650:
- .word gDebug_0300070E
-._648:
- mov r0, #0xf
-._649:
- strb r0, [r1]
-._647:
- pop {r0}
- bx r0
-
- thumb_func_end debug_sub_808EF14
-
thumb_func_start debug_sub_808EF8C
debug_sub_808EF8C:
push {r4, r5, r6, r7, lr}
diff --git a/src/debug/tomomichi_debug_menu.c b/src/debug/tomomichi_debug_menu.c
index fe3b37f34..68fdc9bd1 100644
--- a/src/debug/tomomichi_debug_menu.c
+++ b/src/debug/tomomichi_debug_menu.c
@@ -4,6 +4,7 @@
#include "event_data.h"
#include "constants/flags.h"
#include "constants/songs.h"
+#include "constants/species.h"
#include "overworld.h"
#include "script.h"
#include "menu.h"
@@ -3947,4 +3948,138 @@ bool8 TomomichiDebugMenu_Config(void)
return FALSE;
}
+void debug_sub_808ED0C(void)
+{
+ if (gMain.newAndRepeatedKeys & DPAD_LEFT)
+ {
+ if (gDebug_03000700 != SPECIES_BULBASAUR)
+ gDebug_03000700--;
+ }
+ if (gMain.newAndRepeatedKeys & DPAD_RIGHT)
+ {
+ if (gDebug_03000700 != SPECIES_CHIMECHO)
+ gDebug_03000700++;
+ }
+ if (gMain.newAndRepeatedKeys & L_BUTTON)
+ {
+ if (gDebug_03000700 >= SPECIES_BULBASAUR + 10)
+ gDebug_03000700 -= 10;
+ else
+ gDebug_03000700 = SPECIES_BULBASAUR;
+ }
+ if (gMain.newAndRepeatedKeys & R_BUTTON)
+ {
+ if (gDebug_03000700 <= SPECIES_CHIMECHO - 10)
+ gDebug_03000700 += 10;
+ else
+ gDebug_03000700 = SPECIES_CHIMECHO;
+ }
+}
+
+void debug_sub_808ED9C(void)
+{
+ if (gMain.newAndRepeatedKeys & DPAD_LEFT)
+ {
+ if (gDebug_03000708 != 0)
+ gDebug_03000708--;
+ }
+ if (gMain.newAndRepeatedKeys & DPAD_RIGHT)
+ {
+ if (gDebug_03000708 != UINT32_MAX)
+ gDebug_03000708++;
+ }
+ if (gMain.newAndRepeatedKeys & L_BUTTON)
+ {
+ if (gDebug_03000708 >= 0x10)
+ gDebug_03000708 -= 0x10;
+ else
+ gDebug_03000708 = 0;
+ }
+ if (gMain.newAndRepeatedKeys & R_BUTTON)
+ {
+ if (gDebug_03000708 <= UINT32_MAX - 0x10)
+ gDebug_03000708 += 0x10;
+ else
+ gDebug_03000708 = UINT32_MAX;
+ }
+ if ((gMain.newKeys & (L_BUTTON | R_BUTTON)) == (L_BUTTON | R_BUTTON))
+ {
+ gDebug_03000708 = UINT32_MAX;
+ }
+}
+
+void debug_sub_808EE3C(void)
+{
+ if (gMain.newAndRepeatedKeys & DPAD_LEFT)
+ {
+ if (gDebug_0300070C != 1)
+ gDebug_0300070C--;
+ }
+ if (gMain.newAndRepeatedKeys & DPAD_RIGHT)
+ {
+ if (gDebug_0300070C != 5)
+ gDebug_0300070C++;
+ }
+ if (gMain.newAndRepeatedKeys & L_BUTTON)
+ gDebug_0300070C = 1;
+ if (gMain.newAndRepeatedKeys & R_BUTTON)
+ gDebug_0300070C = 5;
+}
+
+void debug_sub_808EE9C(void)
+{
+ if (gMain.newAndRepeatedKeys & DPAD_LEFT)
+ {
+ if (gDebug_0300070D != 1)
+ gDebug_0300070D--;
+ }
+ if (gMain.newAndRepeatedKeys & DPAD_RIGHT)
+ {
+ if (gDebug_0300070D != 15)
+ gDebug_0300070D++;
+ }
+ if (gMain.newAndRepeatedKeys & L_BUTTON)
+ {
+ if (gDebug_0300070D >= 11)
+ gDebug_0300070D -= 10;
+ else
+ gDebug_0300070D = 0; // Causes underflow when pressing left on the dpad shortly thereafter.
+ }
+ if (gMain.newAndRepeatedKeys & R_BUTTON)
+ {
+ if (gDebug_0300070D <= 5)
+ gDebug_0300070D += 10;
+ else
+ gDebug_0300070D = 15;
+ }
+}
+
+void debug_sub_808EF14(void)
+{
+ if (gMain.newAndRepeatedKeys & DPAD_LEFT)
+ {
+ if (gDebug_0300070E != 1)
+ gDebug_0300070E--;
+ }
+ if (gMain.newAndRepeatedKeys & DPAD_RIGHT)
+ {
+ if (gDebug_0300070E != 15)
+ gDebug_0300070E++;
+ }
+ if (gMain.newAndRepeatedKeys & L_BUTTON)
+ {
+ if (gDebug_0300070E >= 11)
+ gDebug_0300070E -= 10;
+ else
+ gDebug_0300070E = 0; // Causes underflow when pressing left on the dpad shortly thereafter.
+ }
+ if (gMain.newAndRepeatedKeys & R_BUTTON)
+ {
+ if (gDebug_0300070E <= 5)
+ gDebug_0300070E += 10;
+ else
+ gDebug_0300070E = 15;
+ }
+}
+
#endif