summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/watanabe_debug_menu.s137
-rw-r--r--ld_script.txt1
-rw-r--r--src/debug/watanabe_debug_menu.c47
3 files changed, 48 insertions, 137 deletions
diff --git a/asm/watanabe_debug_menu.s b/asm/watanabe_debug_menu.s
index 892c2262d..8c482e10a 100644
--- a/asm/watanabe_debug_menu.s
+++ b/asm/watanabe_debug_menu.s
@@ -5,143 +5,6 @@
.text
- thumb_func_start debug_69
-debug_69:
- bx lr
-
- thumb_func_end debug_69
-
- thumb_func_start debug_80C35DC
-debug_80C35DC:
- push {r4, r5, r6, r7, lr}
- mov r7, r8
- push {r7}
- add sp, sp, #0xfffffff8
- mov r0, #0x0
- bl SetVBlankCallback
- mov r0, #0x80
- lsl r0, r0, #0x13
- mov r1, #0x0
- strh r1, [r0]
- add r0, r0, #0xe
- strh r1, [r0]
- sub r0, r0, #0x2
- strh r1, [r0]
- sub r0, r0, #0x2
- strh r1, [r0]
- sub r0, r0, #0x2
- strh r1, [r0]
- add r0, r0, #0x14
- strh r1, [r0]
- add r0, r0, #0x2
- strh r1, [r0]
- sub r0, r0, #0x6
- strh r1, [r0]
- add r0, r0, #0x2
- strh r1, [r0]
- sub r0, r0, #0x6
- strh r1, [r0]
- add r0, r0, #0x2
- strh r1, [r0]
- sub r0, r0, #0x6
- strh r1, [r0]
- add r0, r0, #0x2
- strh r1, [r0]
- mov r3, #0xc0
- lsl r3, r3, #0x13
- mov r4, #0xc0
- lsl r4, r4, #0x9
- add r0, sp, #0x4
- mov r8, r0
- mov r2, sp
- mov r6, #0x0
- ldr r1, ._2 @ 0x40000d4
- mov r5, #0x80
- lsl r5, r5, #0x5
- ldr r7, ._2 + 4 @ 0x81000800
- mov r0, #0x81
- lsl r0, r0, #0x18
- mov ip, r0
-._1:
- strh r6, [r2]
- mov r0, sp
- str r0, [r1]
- str r3, [r1, #0x4]
- str r7, [r1, #0x8]
- ldr r0, [r1, #0x8]
- add r3, r3, r5
- sub r4, r4, r5
- cmp r4, r5
- bhi ._1 @cond_branch
- strh r6, [r2]
- mov r2, sp
- str r2, [r1]
- str r3, [r1, #0x4]
- lsr r0, r4, #0x1
- mov r2, ip
- orr r0, r0, r2
- str r0, [r1, #0x8]
- ldr r0, [r1, #0x8]
- mov r0, #0xe0
- lsl r0, r0, #0x13
- mov r3, #0x80
- lsl r3, r3, #0x3
- mov r4, #0x0
- str r4, [sp, #0x4]
- ldr r2, ._2 @ 0x40000d4
- mov r1, r8
- str r1, [r2]
- str r0, [r2, #0x4]
- lsr r0, r3, #0x2
- mov r1, #0x85
- lsl r1, r1, #0x18
- orr r0, r0, r1
- str r0, [r2, #0x8]
- ldr r0, [r2, #0x8]
- mov r1, #0xa0
- lsl r1, r1, #0x13
- mov r0, sp
- strh r4, [r0]
- str r0, [r2]
- str r1, [r2, #0x4]
- lsr r3, r3, #0x1
- mov r0, #0x81
- lsl r0, r0, #0x18
- orr r3, r3, r0
- str r3, [r2, #0x8]
- ldr r0, [r2, #0x8]
- bl ResetPaletteFade
- bl ScanlineEffect_Stop
- bl ResetTasks
- bl ResetSpriteData
- bl ResetPaletteFade
- bl FreeAllSpritePalettes
- ldr r0, ._2 + 8 @ stru_83F8828
- bl LoadSpriteSheet
- ldr r0, ._2 + 12 @ stru_83F8838
- bl LoadSpritePalette
- ldr r0, ._2 + 16 @ gWindowTemplate_81E6C3C
- bl Text_LoadWindowTemplate
- ldr r0, ._2 + 20 @ gWindowTemplate_81E6CE4
- bl InitMenuWindow
- add sp, sp, #0x8
- pop {r3}
- mov r8, r3
- pop {r4, r5, r6, r7}
- pop {r0}
- bx r0
-._3:
- .align 2, 0
-._2:
- .word 0x40000d4
- .word 0x81000800
- .word stru_83F8828
- .word stru_83F8838
- .word gWindowTemplate_81E6C3C
- .word gWindowTemplate_81E6CE4
-
- thumb_func_end debug_80C35DC
-
thumb_func_start debug_80C36F4
debug_80C36F4:
push {lr}
diff --git a/ld_script.txt b/ld_script.txt
index 2c861fdb7..e45408439 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -587,6 +587,7 @@ SECTIONS {
src/shop.o(.rodata);
src/fldeff_escalator.o(.rodata);
src/berry.o(.rodata);
+ src/debug/watanabe_debug_menu.o(.rodata);
data/debug_menu_watanabe.o(.rodata);
src/script_menu.o(.rodata);
src/naming_screen.o(.rodata);
diff --git a/src/debug/watanabe_debug_menu.c b/src/debug/watanabe_debug_menu.c
index 6c94b0466..8423ba685 100644
--- a/src/debug/watanabe_debug_menu.c
+++ b/src/debug/watanabe_debug_menu.c
@@ -1,5 +1,13 @@
#if DEBUG
#include "global.h"
+#include "debug.h"
+#include "palette.h"
+#include "scanline_effect.h"
+#include "main.h"
+#include "task.h"
+#include "sprite.h"
+#include "text.h"
+#include "menu.h"
EWRAM_DATA u8 gUnknown_Debug_20389EC[0x20] = { 0 };
EWRAM_DATA u8 gUnknown_Debug_2038A0C[0x10] = { 0 };
@@ -8,4 +16,43 @@ EWRAM_DATA u8 gUnknown_Debug_2038A20[4] = { 0 };
u8 byte_3005E30[0x20];
+extern const struct SpriteSheet stru_83F8828[2];
+extern const struct SpritePalette stru_83F8838[2];
+
+void debug_69(struct Sprite *sprite)
+{
+
+}
+
+void debug_80C35DC(void)
+{
+ SetVBlankCallback(NULL);
+ REG_DISPCNT = 0;
+ REG_BG3CNT = 0;
+ REG_BG2CNT = 0;
+ REG_BG1CNT = 0;
+ REG_BG0CNT = 0;
+ REG_BG3HOFS = 0;
+ REG_BG3VOFS = 0;
+ REG_BG2HOFS = 0;
+ REG_BG2VOFS = 0;
+ REG_BG1HOFS = 0;
+ REG_BG1VOFS = 0;
+ REG_BG0HOFS = 0;
+ REG_BG0VOFS = 0;
+ DmaFill16Large(3, 0, VRAM, VRAM_SIZE, 0x1000);
+ DmaFill32Defvars(3, 0, OAM, OAM_SIZE);
+ DmaFill16Defvars(3, 0, PLTT, PLTT_SIZE);
+ ResetPaletteFade();
+ ScanlineEffect_Stop();
+ ResetTasks();
+ ResetSpriteData();
+ ResetPaletteFade(); // I really don't want palette fade here
+ FreeAllSpritePalettes();
+ LoadSpriteSheet(stru_83F8828);
+ LoadSpritePalette(stru_83F8838);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
+ InitMenuWindow(&gWindowTemplate_81E6CE4);
+}
+
#endif