diff options
-rw-r--r-- | asm/nohara_debug_menu.s | 416 | ||||
-rw-r--r-- | data/debug_menu_nohara.s | 167 | ||||
-rw-r--r-- | include/field_specials.h | 1 | ||||
-rw-r--r-- | ld_script.txt | 1 | ||||
-rw-r--r-- | src/debug/nohara_debug_menu.c | 305 | ||||
-rw-r--r-- | src/field_specials.c | 2 |
6 files changed, 307 insertions, 585 deletions
diff --git a/asm/nohara_debug_menu.s b/asm/nohara_debug_menu.s index 1bc077b90..eca535f89 100644 --- a/asm/nohara_debug_menu.s +++ b/asm/nohara_debug_menu.s @@ -5,422 +5,6 @@ .text - thumb_func_start InitNoharaDebugMenu -InitNoharaDebugMenu: - push {lr} - add sp, sp, #0xfffffff8 - bl Menu_EraseScreen - mov r0, #0x0 - mov r1, #0x0 - mov r2, #0x13 - mov r3, #0x13 - bl Menu_DrawStdWindowFrame - ldr r3, ._1 @ gUnknown_Debug_083C4938 - mov r0, #0x1 - mov r1, #0x1 - mov r2, #0x9 - bl Menu_PrintItems - mov r0, #0x0 - str r0, [sp] - mov r0, #0x12 - str r0, [sp, #0x4] - mov r0, #0x0 - mov r1, #0x1 - mov r2, #0x1 - mov r3, #0x9 - bl InitMenu - ldr r1, ._1 + 4 @ gMenuCallback - ldr r0, ._1 + 8 @ debug_sub_808F414 - str r0, [r1] - mov r0, #0x0 - add sp, sp, #0x8 - pop {r1} - bx r1 -._2: - .align 2, 0 -._1: - .word gUnknown_Debug_083C4938 - .word gMenuCallback - .word debug_sub_808F414+1 - - thumb_func_end InitNoharaDebugMenu - - thumb_func_start debug_sub_808F414 -debug_sub_808F414: - push {lr} - bl Menu_ProcessInput - lsl r0, r0, #0x18 - asr r1, r0, #0x18 - mov r0, #0x2 - neg r0, r0 - cmp r1, r0 - beq ._3 @cond_branch - add r0, r0, #0x1 - cmp r1, r0 - beq ._4 @cond_branch - ldr r2, ._6 @ gMenuCallback - ldr r0, ._6 + 4 @ gUnknown_Debug_083C4938 - lsl r1, r1, #0x3 - add r0, r0, #0x4 - add r1, r1, r0 - ldr r0, [r1] - str r0, [r2] -._3: - mov r0, #0x0 - b ._5 -._7: - .align 2, 0 -._6: - .word gMenuCallback - .word gUnknown_Debug_083C4938 -._4: - bl CloseMenu - mov r0, #0x1 -._5: - pop {r1} - bx r1 - - thumb_func_end debug_sub_808F414 - - thumb_func_start NoharaDebugMenu_TV -NoharaDebugMenu_TV: - push {lr} - add sp, sp, #0xfffffff8 - ldr r1, ._8 @ gDebug_03000726 - mov r0, #0x0 - strb r0, [r1] - bl Menu_EraseScreen - mov r0, #0x0 - mov r1, #0x0 - mov r2, #0xa - mov r3, #0x13 - bl Menu_DrawStdWindowFrame - ldr r3, ._8 + 4 @ gUnknown_Debug_083C4B8C - mov r0, #0x1 - mov r1, #0x1 - mov r2, #0x9 - bl Menu_PrintItems - mov r0, #0x0 - str r0, [sp] - mov r0, #0x9 - str r0, [sp, #0x4] - mov r0, #0x0 - mov r1, #0x1 - mov r2, #0x1 - mov r3, #0x9 - bl InitMenu - ldr r1, ._8 + 8 @ gMenuCallback - ldr r0, ._8 + 12 @ debug_sub_808F4AC - str r0, [r1] - mov r0, #0x0 - add sp, sp, #0x8 - pop {r1} - bx r1 -._9: - .align 2, 0 -._8: - .word gDebug_03000726 - .word gUnknown_Debug_083C4B8C - .word gMenuCallback - .word debug_sub_808F4AC+1 - - thumb_func_end NoharaDebugMenu_TV - - thumb_func_start debug_sub_808F4AC -debug_sub_808F4AC: - push {lr} - bl Menu_ProcessInput - lsl r0, r0, #0x18 - asr r1, r0, #0x18 - mov r0, #0x2 - neg r0, r0 - cmp r1, r0 - beq ._10 @cond_branch - add r0, r0, #0x1 - cmp r1, r0 - beq ._11 @cond_branch - ldr r2, ._13 @ gMenuCallback - ldr r0, ._13 + 4 @ gUnknown_Debug_083C4B8C - lsl r1, r1, #0x3 - add r0, r0, #0x4 - add r1, r1, r0 - ldr r0, [r1] - str r0, [r2] -._10: - mov r0, #0x0 - b ._12 -._14: - .align 2, 0 -._13: - .word gMenuCallback - .word gUnknown_Debug_083C4B8C -._11: - bl CloseMenu - mov r0, #0x1 -._12: - pop {r1} - bx r1 - - thumb_func_end debug_sub_808F4AC - - thumb_func_start debug_sub_808F4EC -debug_sub_808F4EC: - push {lr} - bl debug_sub_808F6BC - ldr r0, ._15 @ gUnknown_Debug_083C4980 - bl sub_8071F40 - mov r0, #0x3 - mov r1, #0x3 - mov r2, #0x1 - bl DisplayYesNoMenu - ldr r1, ._15 + 4 @ gMenuCallback - ldr r0, ._15 + 8 @ debug_sub_808F648 - str r0, [r1] - pop {r0} - bx r0 -._16: - .align 2, 0 -._15: - .word gUnknown_Debug_083C4980 - .word gMenuCallback - .word debug_sub_808F648+1 - - thumb_func_end debug_sub_808F4EC - - thumb_func_start debug_sub_808F518 -debug_sub_808F518: - push {r4, lr} - mov r2, #0x0 - ldr r4, ._20 @ gSaveBlock1 - ldr r3, ._20 + 4 @ 0x2738 -._19: - lsl r0, r2, #0x3 - add r0, r0, r2 - lsl r0, r0, #0x2 - add r1, r0, r4 - add r0, r1, r3 - ldrb r0, [r0] - sub r0, r0, #0x15 - lsl r0, r0, #0x18 - lsr r0, r0, #0x18 - cmp r0, #0x13 - bhi ._18 @cond_branch - ldr r0, ._20 + 8 @ 0x2739 - add r1, r1, r0 - ldrb r0, [r1] - cmp r0, #0 - bne ._18 @cond_branch - mov r0, #0x1 - strb r0, [r1] -._18: - add r0, r2, #1 - lsl r0, r0, #0x18 - lsr r2, r0, #0x18 - cmp r2, #0x17 - bls ._19 @cond_branch - pop {r4} - pop {r0} - bx r0 -._21: - .align 2, 0 -._20: - .word gSaveBlock1 - .word 0x2738 - .word 0x2739 - - thumb_func_end debug_sub_808F518 - - thumb_func_start debug_sub_808F560 -debug_sub_808F560: - push {r4, lr} - mov r1, #0x0 - ldr r4, ._23 @ gSaveBlock1 - ldr r3, ._23 + 4 @ 0x2739 - mov r2, #0x0 -._22: - lsl r0, r1, #0x3 - add r0, r0, r1 - lsl r0, r0, #0x2 - add r0, r0, r4 - add r0, r0, r3 - strb r2, [r0] - add r0, r1, #1 - lsl r0, r0, #0x18 - lsr r1, r0, #0x18 - cmp r1, #0x17 - bls ._22 @cond_branch - bl CloseMenu - mov r0, #0x1 - pop {r4} - pop {r1} - bx r1 -._24: - .align 2, 0 -._23: - .word gSaveBlock1 - .word 0x2739 - - thumb_func_end debug_sub_808F560 - - thumb_func_start debug_sub_808F594 -debug_sub_808F594: - push {r4, r5, r6, lr} - mov r2, #0x0 - ldr r6, ._27 @ gSaveBlock1 - ldr r5, ._27 + 4 @ 0x2738 - ldr r4, ._27 + 8 @ 0x2739 - mov r3, #0x1 -._26: - lsl r0, r2, #0x3 - add r0, r0, r2 - lsl r0, r0, #0x2 - add r1, r0, r6 - add r0, r1, r5 - ldrb r0, [r0] - cmp r0, #0 - beq ._25 @cond_branch - add r0, r1, r4 - strb r3, [r0] -._25: - add r0, r2, #1 - lsl r0, r0, #0x18 - lsr r2, r0, #0x18 - cmp r2, #0x17 - bls ._26 @cond_branch - bl CloseMenu - mov r0, #0x1 - pop {r4, r5, r6} - pop {r1} - bx r1 -._28: - .align 2, 0 -._27: - .word gSaveBlock1 - .word 0x2738 - .word 0x2739 - - thumb_func_end debug_sub_808F594 - - thumb_func_start debug_sub_808F5D8 -debug_sub_808F5D8: - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - mov r4, #0x0 - ldr r6, ._30 @ gStringVar1 - ldr r7, ._30 + 4 @ gUnknown_Debug_083C4BD4 - add r0, r7, #1 - mov r8, r0 -._29: - ldr r5, ._30 + 8 @ gSpecialVar_0x8004 - strh r4, [r5] - bl GetSlotMachineId - add r1, r0, #0 - lsl r1, r1, #0x10 - lsr r1, r1, #0x10 - add r0, r6, #0 - mov r2, #0x0 - mov r3, #0x1 - bl ConvertIntToDecimalStringN - lsl r0, r4, #0x1 - add r0, r0, r4 - lsl r0, r0, #0x2 - add r1, r0, r7 - ldrb r1, [r1] - add r0, r0, r8 - ldrb r2, [r0] - add r0, r6, #0 - bl Menu_PrintText - add r0, r4, #1 - lsl r0, r0, #0x18 - lsr r4, r0, #0x18 - cmp r4, #0xb - bls ._29 @cond_branch - mov r0, #0x0 - strh r0, [r5] - ldr r1, ._30 + 12 @ gMenuCallback - ldr r0, ._30 + 16 @ debug_sub_8090278 - str r0, [r1] - mov r0, #0x0 - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7} - pop {r1} - bx r1 -._31: - .align 2, 0 -._30: - .word gStringVar1 - .word gUnknown_Debug_083C4BD4 - .word gSpecialVar_0x8004 - .word gMenuCallback - .word debug_sub_8090278+1 - - thumb_func_end debug_sub_808F5D8 - - thumb_func_start debug_sub_808F648 -debug_sub_808F648: - push {lr} - ldr r0, ._35 @ gMain - ldrh r1, [r0, #0x2e] - mov r0, #0x20 - and r0, r0, r1 - cmp r0, #0 - beq ._32 @cond_branch - mov r0, #0xa - mov r1, #0x0 - mov r2, #0x1d - mov r3, #0xd - bl Menu_EraseWindowRect - ldr r0, ._35 + 4 @ gDebug_03000726 - ldrb r1, [r0] - mov r2, #0x1 - eor r1, r1, r2 - strb r1, [r0] - cmp r1, #0 - beq ._33 @cond_branch - bl debug_sub_808F7B4 - b ._40 -._36: - .align 2, 0 -._35: - .word gMain - .word gDebug_03000726 -._33: - bl debug_sub_808F6BC - b ._40 -._32: - bl Menu_ProcessInputNoWrap_ - lsl r0, r0, #0x18 - asr r1, r0, #0x18 - mov r0, #0x1 - neg r0, r0 - cmp r1, r0 - beq ._43 @cond_branch - cmp r1, r0 - bgt ._39 @cond_branch - sub r0, r0, #0x1 - cmp r1, r0 - beq ._40 @cond_branch - b ._43 -._39: - cmp r1, #0 - beq ._42 @cond_branch - b ._43 -._40: - mov r0, #0x0 - b ._44 -._42: - bl debug_sub_808F518 -._43: - bl CloseMenu - mov r0, #0x1 -._44: - pop {r1} - bx r1 - - thumb_func_end debug_sub_808F648 - thumb_func_start debug_sub_808F6BC debug_sub_808F6BC: push {r4, r5, r6, lr} diff --git a/data/debug_menu_nohara.s b/data/debug_menu_nohara.s index 8556d0ff4..859c63e6d 100644 --- a/data/debug_menu_nohara.s +++ b/data/debug_menu_nohara.s @@ -6,173 +6,6 @@ .if DEBUG .align 2 -gUnknown_Debug_083C48C4:: @ 0x83C48C4 - .string "TV$" - -gUnknown_Debug_083C48C7:: @ 0x83C48C7 - .string "Fan$" - -gUnknown_Debug_083C48CB:: @ 0x83C48CB - .string "Battle (vs Dad)$" - -gUnknown_Debug_083C48DB:: @ 0x83C48DB - .string "Dad after battle$" - -gUnknown_Debug_083C48EC:: @ 0x83C48EC - .string "SOOTOPOLIS CITY$" - -gUnknown_Debug_083C48FC:: @ 0x83C48FC - .string "Embark$" - -gUnknown_Debug_083C4903:: @ 0x83C4903 - .string "Yes 9999$" - -gUnknown_Debug_083C490C:: @ 0x83C490C - .string "Legends flag ON$" - -gUnknown_Debug_083C491C:: @ 0x83C491C - .string "Add num of winning streaks$" - - .align 2 -gUnknown_Debug_083C4938:: @ 0x83C4938 - .4byte gUnknown_Debug_083C48C4, NoharaDebugMenu_TV+1 - .4byte gUnknown_Debug_083C48C7, NoharaDebugMenu_Fan+1 - .4byte gUnknown_Debug_083C48CB, NoharaDebugMenu_BattleVSDad+1 - .4byte gUnknown_Debug_083C48DB, NoharaDebugMenu_DadAfterBattle+1 - .4byte gUnknown_Debug_083C48EC, NoharaDebugMenu_SootopolisCity+1 - .4byte gUnknown_Debug_083C48FC, NoharaDebugMenu_Embark+1 - .4byte gUnknown_Debug_083C4903, NoharaDebugMenu_Yes9999+1 - .4byte gUnknown_Debug_083C490C, NoharaDebugMenu_LegendsFlagOn+1 - .4byte gUnknown_Debug_083C491C, NoharaDebugMenu_AddNumWinningStreaks+1 - -gUnknown_Debug_083C4980:: @ 0x83C4980 - .string "Want to change data type{CLEAR_TO 143}Press Left\n" - .string "to see secret type now?{CLEAR_TO 143}to switch$" - -gUnknown_Debug_083C49CA:: @ 0x83C49CA - .string "Choose the TV data you wish to\n" - .string "create to check a transmission。$" - -gUnknown_Debug_083C4A09:: @ 0x83C4A09 - .string "ほうそうの はっせいりつを セット\n" - .string "してください ?ぶんの1に なります$" - -gUnknown_Debug_083C4A2E:: @ 0x83C4A2E - .string "SURVEY$" - -gUnknown_Debug_083C4A35:: @ 0x83C4A35 - .string "RECENT HAPPENINGS$" - -gUnknown_Debug_083C4A47:: @ 0x83C4A47 - .string "POKひMON FAN CLUB$" - -gUnknown_Debug_083C4A58:: @ 0x83C4A58 - .string "ジム$" - -gUnknown_Debug_083C4A5B:: @ 0x83C4A5B - .string "OUTBREAKS$" - -gUnknown_Debug_083C4A65:: @ 0x83C4A65 - .string "NAME RATER$" - -gUnknown_Debug_083C4A70:: @ 0x83C4A70 - .string "CONTEST$" - -gUnknown_Debug_083C4A78:: @ 0x83C4A78 - .string "INTRODUCTION$" - -gUnknown_Debug_083C4A85:: @ 0x83C4A85 - .string "SHOPPING$" - -gUnknown_Debug_083C4A8E:: @ 0x83C4A8E - .string "MISFORTUNE$" - -gUnknown_Debug_083C4A99:: @ 0x83C4A99 - .string "FISHING$" - -gUnknown_Debug_083C4AA1:: @ 0x83C4AA1 - .string "MEMORABLE DAY$" - -gUnknown_Debug_083C4AAF:: @ 0x83C4AAF - .string "BRAVO TRAINER$" - -gUnknown_Debug_083C4ABD:: @ 0x83C4ABD - .byte 1, 2, 3, 41, 5, 6, 21, 22, 23, 24, 25, 7, 0 - - .align 2 -gUnknown_Debug_083C4ACC:: - .4byte gUnknown_Debug_083C4A2E - .4byte gUnknown_Debug_083C4A35 - .4byte gUnknown_Debug_083C4A47 - .4byte gUnknown_Debug_083C4A5B - .4byte gUnknown_Debug_083C4A65 - .4byte gUnknown_Debug_083C4A70 - .4byte gUnknown_Debug_083C4A78 - .4byte gUnknown_Debug_083C4A85 - .4byte gUnknown_Debug_083C4A8E - .4byte gUnknown_Debug_083C4A99 - .4byte gUnknown_Debug_083C4AA1 - .4byte gUnknown_Debug_083C4AAF - -gDebugText_BigSale: - .string "BIG SALE$" - -gUnknown_Debug_083C4B05:: @ 0x83C4B05 - .string "SERVICE DAY$" - -gUnknown_Debug_083C4B11:: @ 0x83C4B11 - .string "CLEARーOUT SALE$" - -gUnknown_Debug_083C4B20:: @ 0x83C4B20 - .byte 1, 2, 3, 0 - - .align 2 -gUnknown_Debug_083C4B24:: - .4byte gDebugText_BigSale - .4byte gUnknown_Debug_083C4B05 - .4byte gUnknown_Debug_083C4B11 - -gUnknown_Debug_083C4B30:: @ 0x83C4B30 - .string "Secret type$" - -gUnknown_Debug_083C4B3C:: @ 0x83C4B3C - .string "Start$" - -gUnknown_Debug_083C4B42:: @ 0x83C4B42 - .string "Create TV$" - -gUnknown_Debug_083C4B4C:: @ 0x83C4B4C - .string "All clear$" - -gUnknown_Debug_083C4B56:: @ 0x83C4B56 - .string "All seen$" - -gUnknown_Debug_083C4B5F:: @ 0x83C4B5F - .string "Create CM$" - -gUnknown_Debug_083C4B69:: @ 0x83C4B69 - .string "Not yet seen$" - -gUnknown_Debug_083C4B76:: @ 0x83C4B76 - .string "Hit Table$" - -gUnknown_Debug_083C4B80:: @ 0x83C4B80 - .string "Set full$" - - .align 2 -gUnknown_Debug_083C4B8C:: @ 0x83C4B8C - .4byte gUnknown_Debug_083C4B30, debug_sub_808F4EC+1 - .4byte gUnknown_Debug_083C4B3C, debug_sub_808F8AC+1 - .4byte gUnknown_Debug_083C4B42, debug_sub_808F8CC+1 - .4byte gUnknown_Debug_083C4B4C, debug_sub_808FEBC+1 - .4byte gUnknown_Debug_083C4B56, debug_sub_808F560+1 - .4byte gUnknown_Debug_083C4B5F, debug_sub_808FECC+1 - .4byte gUnknown_Debug_083C4B69, debug_sub_808F594+1 - .4byte gUnknown_Debug_083C4B76, debug_sub_808F5D8+1 - .4byte gUnknown_Debug_083C4B80, debug_sub_80900AC+1 - -gUnknown_Debug_083C4BD4:: @ 0x83C4BD4 - .byte 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 gUnknown_Debug_083C4C64:: @ 0x83C4C64 .string "TERUKUN$" diff --git a/include/field_specials.h b/include/field_specials.h index a8e8d3da7..245e20407 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -27,5 +27,6 @@ u8 GetLeadMonIndex(void); void ResetFanClub(void); u8 sub_810FB10(u8 a0); void sub_810FEFC(void); +u16 GetSlotMachineId(void); #endif // GUARD_FIELD_SPECIALS_H diff --git a/ld_script.txt b/ld_script.txt index 0bacb1d50..518267bb5 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -560,6 +560,7 @@ SECTIONS { src/battle/battle_setup.o(.rodata); src/cable_club.o(.rodata); src/debug/tomomichi_debug_menu.o(.rodata); + src/debug/nohara_debug_menu.o(.rodata); data/debug_menu_nohara.o(.rodata); src/debug/mori_debug_menu.o(.rodata); data/debug_menu_taya.o(.rodata); diff --git a/src/debug/nohara_debug_menu.c b/src/debug/nohara_debug_menu.c index b3885ff76..dbe79dc72 100644 --- a/src/debug/nohara_debug_menu.c +++ b/src/debug/nohara_debug_menu.c @@ -1,12 +1,315 @@ #if DEBUG #include "global.h" +#include "main.h" +#include "menu.h" +#include "start_menu.h" +#include "tv.h" +#include "event_data.h" +#include "string_util.h" +#include "field_specials.h" __attribute__((unused)) static u8 gDebug_03000724; __attribute__((unused)) static u8 gDebug_03000725; -__attribute__((unused)) static u8 gDebug_03000726; +static u8 gDebug_03000726; asm(".global gDebug_03000724"); asm(".global gDebug_03000725"); asm(".global gDebug_03000726"); +bool8 debug_sub_808F414(void); +bool8 NoharaDebugMenu_TV(void); +bool8 debug_sub_808F4AC(void); +void debug_sub_808F4EC(void); +bool8 debug_sub_808F560(void); +bool8 debug_sub_808F594(void); +bool8 debug_sub_808F5D8(void); +bool8 debug_sub_808F648(void); +bool8 debug_sub_808F7B4(void); +bool8 debug_sub_8090278(void); +bool8 NoharaDebugMenu_Fan(void); +bool8 NoharaDebugMenu_BattleVSDad(void); +bool8 NoharaDebugMenu_DadAfterBattle(void); +bool8 NoharaDebugMenu_SootopolisCity(void); +bool8 NoharaDebugMenu_Embark(void); +bool8 NoharaDebugMenu_Yes9999(void); +bool8 NoharaDebugMenu_LegendsFlagOn(void); +bool8 NoharaDebugMenu_AddNumWinningStreaks(void); +void debug_sub_808F6BC(void); +void debug_sub_808F8AC(void); +void debug_sub_808F8CC(void); +void debug_sub_808FEBC(void); +void debug_sub_808FECC(void); +void debug_sub_80900AC(void); + +const u8 gUnknown_Debug_083C48C4[] = _("TV"); +const u8 gUnknown_Debug_083C48C7[] = _("Fan"); +const u8 gUnknown_Debug_083C48CB[] = _("Battle (vs Dad)"); +const u8 gUnknown_Debug_083C48DB[] = _("Dad after battle"); +const u8 gUnknown_Debug_083C48EC[] = _("SOOTOPOLIS CITY"); +const u8 gUnknown_Debug_083C48FC[] = _("Embark"); +const u8 gUnknown_Debug_083C4903[] = _("Yes 9999"); +const u8 gUnknown_Debug_083C490C[] = _("Legends flag ON"); +const u8 gUnknown_Debug_083C491C[] = _("Add num of winning streaks"); + +const struct MenuAction gUnknown_Debug_083C4938[] = { + {gUnknown_Debug_083C48C4, NoharaDebugMenu_TV}, + {gUnknown_Debug_083C48C7, NoharaDebugMenu_Fan}, + {gUnknown_Debug_083C48CB, NoharaDebugMenu_BattleVSDad}, + {gUnknown_Debug_083C48DB, NoharaDebugMenu_DadAfterBattle}, + {gUnknown_Debug_083C48EC, NoharaDebugMenu_SootopolisCity}, + {gUnknown_Debug_083C48FC, NoharaDebugMenu_Embark}, + {gUnknown_Debug_083C4903, NoharaDebugMenu_Yes9999}, + {gUnknown_Debug_083C490C, NoharaDebugMenu_LegendsFlagOn}, + {gUnknown_Debug_083C491C, NoharaDebugMenu_AddNumWinningStreaks} +}; + +bool8 InitNoharaDebugMenu(void) +{ + Menu_EraseScreen(); + Menu_DrawStdWindowFrame(0, 0, 19, 19); + Menu_PrintItems(1, 1, ARRAY_COUNT(gUnknown_Debug_083C4938), gUnknown_Debug_083C4938); + InitMenu(0, 1, 1, ARRAY_COUNT(gUnknown_Debug_083C4938), 0, 18); + gMenuCallback = debug_sub_808F414; + return FALSE; +} + +bool8 debug_sub_808F414(void) +{ + s8 input = Menu_ProcessInput(); + switch (input) + { + default: + gMenuCallback = gUnknown_Debug_083C4938[input].func; + return FALSE; + case -2: + return FALSE; + case -1: + CloseMenu(); + return TRUE; + } +} + +const u8 gUnknown_Debug_083C4980[] = _("Want to change data type{CLEAR_TO 143}Press Left\n" + "to see secret type now?{CLEAR_TO 143}to switch"); + +const u8 gUnknown_Debug_083C49CA[] = _("Choose the TV data you wish to\n" + "create to check a transmission。"); + +const u8 gUnknown_Debug_083C4A09[] = _("ほうそうの はっせいりつを セット\n" + "してください ?ぶんの1に なります"); + +const u8 gUnknown_Debug_083C4A2E[] = _("SURVEY"); +const u8 gUnknown_Debug_083C4A35[] = _("RECENT HAPPENINGS"); +const u8 gUnknown_Debug_083C4A47[] = _("POKひMON FAN CLUB"); +const u8 gUnknown_Debug_083C4A58[] = _("ジム"); +const u8 gUnknown_Debug_083C4A5B[] = _("OUTBREAKS"); +const u8 gUnknown_Debug_083C4A65[] = _("NAME RATER"); +const u8 gUnknown_Debug_083C4A70[] = _("CONTEST"); +const u8 gUnknown_Debug_083C4A78[] = _("INTRODUCTION"); +const u8 gUnknown_Debug_083C4A85[] = _("SHOPPING"); +const u8 gUnknown_Debug_083C4A8E[] = _("MISFORTUNE"); +const u8 gUnknown_Debug_083C4A99[] = _("FISHING"); +const u8 gUnknown_Debug_083C4AA1[] = _("MEMORABLE DAY"); +const u8 gUnknown_Debug_083C4AAF[] = _("BRAVO TRAINER"); + +const u8 gUnknown_Debug_083C4ABD[] = { + TVSHOW_FAN_CLUB_LETTER, + TVSHOW_RECENT_HAPPENINGS, + TVSHOW_PKMN_FAN_CLUB_OPINIONS, + TVSHOW_MASS_OUTBREAK, + TVSHOW_NAME_RATER_SHOW, + TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE, + TVSHOW_POKEMON_TODAY_CAUGHT, + TVSHOW_SMART_SHOPPER, + TVSHOW_POKEMON_TODAY_FAILED, + TVSHOW_FISHING_ADVICE, + TVSHOW_WORLD_OF_MASTERS, + TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE +}; + +const u8 *const gUnknown_Debug_083C4ACC[] = { + gUnknown_Debug_083C4A2E, + gUnknown_Debug_083C4A35, + gUnknown_Debug_083C4A47, + gUnknown_Debug_083C4A5B, + gUnknown_Debug_083C4A65, + gUnknown_Debug_083C4A70, + gUnknown_Debug_083C4A78, + gUnknown_Debug_083C4A85, + gUnknown_Debug_083C4A8E, + gUnknown_Debug_083C4A99, + gUnknown_Debug_083C4AA1, + gUnknown_Debug_083C4AAF +}; + +const u8 gDebugText_BigSale[] = _("BIG SALE"); + +const u8 gUnknown_Debug_083C4B05[] = _("SERVICE DAY"); +const u8 gUnknown_Debug_083C4B11[] = _("CLEARーOUT SALE"); +const u8 gUnknown_Debug_083C4B20[] = {1, 2, 3}; + +const u8 *const gUnknown_Debug_083C4B24[] = { + gDebugText_BigSale, + gUnknown_Debug_083C4B05, + gUnknown_Debug_083C4B11 +}; + +const u8 gUnknown_Debug_083C4B30[] = _("Secret type"); +const u8 gUnknown_Debug_083C4B3C[] = _("Start"); +const u8 gUnknown_Debug_083C4B42[] = _("Create TV"); +const u8 gUnknown_Debug_083C4B4C[] = _("All clear"); +const u8 gUnknown_Debug_083C4B56[] = _("All seen"); +const u8 gUnknown_Debug_083C4B5F[] = _("Create CM"); +const u8 gUnknown_Debug_083C4B69[] = _("Not yet seen"); +const u8 gUnknown_Debug_083C4B76[] = _("Hit Table"); +const u8 gUnknown_Debug_083C4B80[] = _("Set full"); + +// Normaly these would be struct MenuAction, but the prototype of +// member .func is not consistent. +const struct { + const u8 * text; + void *func; +} gUnknown_Debug_083C4B8C[] = { + {gUnknown_Debug_083C4B30, debug_sub_808F4EC}, + {gUnknown_Debug_083C4B3C, debug_sub_808F8AC}, + {gUnknown_Debug_083C4B42, debug_sub_808F8CC}, + {gUnknown_Debug_083C4B4C, debug_sub_808FEBC}, + {gUnknown_Debug_083C4B56, debug_sub_808F560}, + {gUnknown_Debug_083C4B5F, debug_sub_808FECC}, + {gUnknown_Debug_083C4B69, debug_sub_808F594}, + {gUnknown_Debug_083C4B76, debug_sub_808F5D8}, + {gUnknown_Debug_083C4B80, debug_sub_80900AC} +}; + +bool8 NoharaDebugMenu_TV(void) +{ + gDebug_03000726 = 0; + Menu_EraseScreen(); + Menu_DrawStdWindowFrame(0, 0, 10, 19); + Menu_PrintItems(1, 1, ARRAY_COUNT(gUnknown_Debug_083C4B8C), gUnknown_Debug_083C4B8C); + InitMenu(0, 1, 1, ARRAY_COUNT(gUnknown_Debug_083C4B8C), 0, 9); + gMenuCallback = debug_sub_808F4AC; + return FALSE; +} + +bool8 debug_sub_808F4AC(void) +{ + s8 input = Menu_ProcessInput(); + switch (input) + { + default: + gMenuCallback = (MenuFunc)gUnknown_Debug_083C4B8C[input].func; + return FALSE; + case -2: + return FALSE; + case -1: + CloseMenu(); + return TRUE; + } +} + +void debug_sub_808F4EC(void) +{ + debug_sub_808F6BC(); + sub_8071F40(gUnknown_Debug_083C4980); + DisplayYesNoMenu(3, 3, 1); + gMenuCallback = debug_sub_808F648; +} + +void debug_sub_808F518(void) +{ + u8 i; + + for (i = 0; i < 24; i++) + { + if (gSaveBlock1.tvShows[i].common.kind >= TVSHOW_POKEMON_TODAY_CAUGHT && + gSaveBlock1.tvShows[i].common.kind < TVSHOW_MASS_OUTBREAK && + !gSaveBlock1.tvShows[i].common.active) + gSaveBlock1.tvShows[i].common.active = TRUE; + } +} + +bool8 debug_sub_808F560(void) +{ + u8 i; + + for (i = 0; i < 24; i++) + gSaveBlock1.tvShows[i].common.active = FALSE; + CloseMenu(); + return TRUE; +} + +bool8 debug_sub_808F594(void) +{ + u8 i; + + for (i = 0; i < 24; i++) + { + if (gSaveBlock1.tvShows[i].common.kind != 0) + gSaveBlock1.tvShows[i].common.active = TRUE; + } + CloseMenu(); + return TRUE; +} + +const u8 gUnknown_Debug_083C4BD4[][12] = { + {0x0C, 0x04}, + {0x0C, 0x08}, + {0x0C, 0x0A}, + {0x0E, 0x06}, + {0x0E, 0x08}, + {0x0E, 0x0A}, + {0x10, 0x04}, + {0x10, 0x06}, + {0x10, 0x0A}, + {0x12, 0x04}, + {0x12, 0x06}, + {0x12, 0x0A} +}; + +bool8 debug_sub_808F5D8(void) +{ + u8 i; + + for (i = 0; i < 12; i++) + { + gSpecialVar_0x8004 = i; + ConvertIntToDecimalStringN(gStringVar1, GetSlotMachineId(), STR_CONV_MODE_LEFT_ALIGN, 1); + Menu_PrintText(gStringVar1, gUnknown_Debug_083C4BD4[i][0], gUnknown_Debug_083C4BD4[i][1]); + } + gSpecialVar_0x8004 = 0; + gMenuCallback = debug_sub_8090278; + return FALSE; +} + +bool8 debug_sub_808F648(void) +{ + if (gMain.newKeys & DPAD_LEFT) + { + Menu_EraseWindowRect(10, 0, 29, 13); + gDebug_03000726 ^= 1; + if (gDebug_03000726) + debug_sub_808F7B4(); + else + debug_sub_808F6BC(); + return FALSE; + } + else + { + s8 input = Menu_ProcessInputNoWrap_(); + switch (input) + { + case -2: + return FALSE; + case 0: + debug_sub_808F518(); + // fallthrough + case -1: + default: + CloseMenu(); + return TRUE; + } + } +} + #endif diff --git a/src/field_specials.c b/src/field_specials.c index eff623548..a4b891dbe 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1793,7 +1793,7 @@ const u8 gUnknown_083F83E0[] = {12, 2, 4, 5, 1, 8, 7, 11, 3, 10, 9, 6}; const u8 gUnknown_083F83EC[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5}; const u8 gUnknown_083F83F8[] = {3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5}; -u8 GetSlotMachineId(void) +u16 GetSlotMachineId(void) { u32 v0 = gSaveBlock1.easyChatPairs[0].unk0_0 + gSaveBlock1.easyChatPairs[0].unk2 + gUnknown_083F83E0[gSpecialVar_0x8004]; if (GetPriceReduction(2)) |