diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/bank03.asm | 133 | ||||
-rw-r--r-- | src/engine/bank04.asm | 71 | ||||
-rw-r--r-- | src/macros/scripts.asm | 8 | ||||
-rw-r--r-- | src/wram.asm | 13 |
4 files changed, 187 insertions, 38 deletions
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm index 58367e2..4e53dfd 100644 --- a/src/engine/bank03.asm +++ b/src/engine/bank03.asm @@ -2712,27 +2712,62 @@ Func_d244: ; d244 (3:5244) farcall Func_80ba4 jp IncreaseScriptPointerBy2 -Func_d24c: ; d24c (3:524c) - ld hl, $525e +ScriptCommand_ShowMultichoiceTextbox_ChooseDeckToDuelAgainst: ; d24c (3:524c) + ld hl, .multichoice_menu_args xor a - call Func_d28c - ld a, [wd695] + call ShowMultichoiceTextbox + ld a, [wMultichoiceTextboxResult_ChooseDeckToDuelAgainst] ld c, a set_flag_value EVENT_FLAG_76 jp IncreaseScriptPointerBy1 - INCROM $d25e, $d271 +.multichoice_menu_args ;d25e + dw $0000 ; NPC title for textbox under menu + tx Text03f9 ; text for textbox under menu + dw MultichoiceTextbox_ConfigTable_ChooseDeckToDuelAgainst ; location of table configuration in bank 4 + db $03 ; the value to return when b is pressed + dw wMultichoiceTextboxResult_ChooseDeckToDuelAgainst ; ram location to return result into + dw .text_entries ; location of table containing text entries + +.text_entries ;d269 + tx Text03f6 + tx Text03f7 + tx Text03f8 + + INCROM $d26f, $d271 -Func_d271: ; d271 (3:5271) - ld hl, $527b + +ScriptCommand_ShowMultichoiceTextbox_ChooseStarterDeck: ; d271 (3:5271) + ld hl, .multichoice_menu_args xor a - call Func_d28c + call ShowMultichoiceTextbox jp IncreaseScriptPointerBy1 ; 0xd27b - INCROM $d27b, $d28c - -Func_d28c: ; d28c (3:528c) +.multichoice_menu_args ;d27b + dw $0000 ; NPC title for textbox under menu + tx Text03fd ; text for textbox under menu + dw MultichoiceTextbox_ConfigTable_ChooseDeckStarterDeck ; location of table configuration in bank 4 + db $00 ; the value to return when b is pressed + dw $d693 ; ram location to return result into + dw .text_entries ; location of table containing text entries + +.text_entries + tx Text03fa + tx Text03fb + tx Text03fc + + +;displays a textbox with multiple choices and a cursor. +;takes as an argument in h1 a pointer to a table +; dw text id for NPC title for textbox under menu +; dw text id for textbox under menu +; dw location of table configuration in bank 4 +; db the value to return when b is pressed +; dw ram location to return result into +; dw location of table containing text entries (optional) + +ShowMultichoiceTextbox: ; d28c (3:528c) ld [wd416], a push hl call Func_c241 @@ -2808,31 +2843,44 @@ Func_d28c: ; d28c (3:528c) .asm_d2f5 ret -Func_d2f6: ; d2f6 (3:52f6) - ld hl, $530c +ScriptCommand_ShowSamNormalMultichoice: ; d2f6 (3:52f6) + ld hl, .multichoice_menu_args xor a - call Func_d28c - ld a, [wd694] + call ShowMultichoiceTextbox + ld a, [wMultichoiceTextboxResult_Sam] ld c, a set_flag_value EVENT_FLAG_75 xor a - ld [wd694], a + ld [wMultichoiceTextboxResult_Sam], a jp IncreaseScriptPointerBy1 ; 0xd30c - INCROM $d30c, $d317 +.multichoice_menu_args ;d30c + tx SamNPCName ; NPC title for textbox under menu + tx Text03fe ; text for textbox under menu + dw SamNormalMultichoice_ConfigurationTable ; location of table configuration in bank 4 + db $03 ; the value to return when b is pressed + dw wMultichoiceTextboxResult_Sam ; ram location to return result into + dw $0000 ; location of table containing text entries -Func_d317: ; d317 (3:5317) - ld hl, $532b - ld a, [wd694] - call Func_d28c - ld a, [wd694] + +ScriptCommand_ShowSamTutorialMultichoice: ; d317 (3:5317) + ld hl, .multichoice_menu_args + ld a, [wMultichoiceTextboxResult_Sam] + call ShowMultichoiceTextbox + ld a, [wMultichoiceTextboxResult_Sam] ld c, a set_flag_value EVENT_FLAG_75 jp IncreaseScriptPointerBy1 -Unknown_d32b: ; d32b (3:532b) - INCROM $d32b, $d336 +.multichoice_menu_args ;d32b + dw $0000 ; NPC title for textbox under menu + dw $0000 ; text for textbox under menu + dw SamTutorialMultichoice_ConfigurationTable ; location of table configuration in bank 4 + db $07 ; the value to return when b is pressed + dw wMultichoiceTextboxResult_Sam ; ram location to return result into + dw $0000 ; location of table containing text entries + ScriptCommand_OpenDeckMachine: ; d336 (3:5336) push bc @@ -2930,6 +2978,7 @@ Func_d3d4: ; d3d4 (3:53d4) INCROM $d3dd, $d3e0 + Func_d3e0: ; d3e0 (3:53e0) ld a, $1 ld [wd32e], a @@ -3333,7 +3382,7 @@ Script_d794: ; d794 (3:5794) .ows_d7bc run_command ScriptCommand_CloseTextBox - run_command Func_d317 + run_command ScriptCommand_ShowSamTutorialMultichoice run_command ScriptCommand_CloseTextBox run_command ScriptCommand_JumpIfFlagEqual db EVENT_FLAG_75 @@ -3478,10 +3527,38 @@ AfterTutorialBattleScript: ; d834 (3:5834) run_command ScriptCommand_CloseTextBox run_command ScriptCommand_PrintTextString tx Text05f2 - run_command Func_d271 -; 0xd860 +.ows_d85f + run_command ScriptCommand_ShowMultichoiceTextbox_ChooseStarterDeck + run_command ScriptCommand_CloseTextBox + run_command ScriptCommand_AskQuestionJump + tx Text05f3 + dw .ows_d869 + run_command ScriptCommand_Jump + dw .ows_d85f +; 0xd869 +.ows_d869 + run_command ScriptCommand_PrintTextString + tx Text05f4 + run_command ScriptCommand_CloseTextBox + run_command ScriptCommand_PauseSong + run_command Func_d40f + run_command ScriptCommand_TryGiveMedalPCPacks + run_command Func_ccdc + tx Text05f5 + run_command ScriptCommand_WaitForSongToFinish + run_command ScriptCommand_ResumeSong + run_command ScriptCommand_CloseTextBox + run_command ScriptCommand_SetFlagValue + db EVENT_FLAG_3E + db $03 + run_command Func_d3d4 + run_command ScriptCommand_PrintTextString + tx Text05f6 + run_command Func_d396 + db $00 + run_command ScriptCommand_QuitScriptFully +; 0xd880 - INCROM $d860, $d880 NPCMovement_d880: ; d880 (3:5880) db EAST diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm index a1e504f..8e62188 100644 --- a/src/engine/bank04.asm +++ b/src/engine/bank04.asm @@ -1023,9 +1023,9 @@ OverworldScriptTable: ; 1217b (4:617b) dw Func_d1b3 dw ScriptCommand_QuitScriptFully dw Func_d244 - dw Func_d24c + dw ScriptCommand_ShowMultichoiceTextbox_ChooseDeckToDuelAgainst dw ScriptCommand_OpenDeckMachine - dw Func_d271 + dw ScriptCommand_ShowMultichoiceTextbox_ChooseStarterDeck dw ScriptCommand_EnterMap dw ScriptCommand_MoveArbitraryNPC dw Func_d209 @@ -1048,8 +1048,8 @@ OverworldScriptTable: ; 1217b (4:617b) dw ScriptCommand_WaitForSongToFinish dw Func_d435 dw ScriptCommand_AskQuestionJumpDefaultYes - dw Func_d2f6 - dw Func_d317 + dw ScriptCommand_ShowSamNormalMultichoice + dw ScriptCommand_ShowSamTutorialMultichoice dw Func_d43d dw ScriptCommand_EndScriptLoop2 dw ScriptCommand_EndScriptLoop3 @@ -1073,7 +1073,68 @@ OverworldScriptTable: ; 1217b (4:617b) dw ScriptCommand_EndScriptLoop9 dw ScriptCommand_EndScriptLoop10 - INCROM $1224b, $1229f + +MultichoiceTextbox_ConfigTable_ChooseDeckToDuelAgainst: ;1224b + db $04, $00 ; x, y to start drawing box + db $10, $08 ; width, height of box + db $06, $02 ; x, y coordinate to start printing next text + tx Text03f6 ; text id to print next + db $06, $04 ; x, y coordinate to start printing next text + tx Text03f7 ; text id to print next + db $06, $06 ; x, y coordinate to start printing next text + tx Text03f8 ; text id to print next + db $ff ; marker byte -- end text entries + db $05, $02 ; cursor starting x, y + db $02 ; number of tiles the cursor moves per toggle + db $03 ; cursor max index + db $0f ; curor image + + db $00, $00, $00 ; marker bytes -- end of config table + +MultichoiceTextbox_ConfigTable_ChooseDeckStarterDeck: ;12264 + db $04, $00 ; x, y to start drawing box + db $10, $08 ; width, height of box + db $06, $02 ; x, y coordinate to start printing next text + tx Text03fa ; text id to print next + db $06, $04 ; x, y coordinate to start printing next text + tx Text03fb ; text id to print next + db $06, $06 ; x, y coordinate to start printing next text + tx Text03fc ; text id to print next + db $ff ; marker byte -- end text entries + db $05, $02 ; cursor starting x, y + db $02 ; number of tiles the cursor moves per toggle + db $03 ; cursor max index + db $0f ; curor image + + db $00, $00, $00 ; marker bytes -- end of config table + +SamNormalMultichoice_ConfigurationTable: ;1227d + db $0A, $00 ; x, y to start drawing box + db $0A, $0A ; width, height of box + db $0C, $02 ; x, y coordinate to start printing next text + tx Text03ff ; text id to print next + db $ff ; marker byte -- end text entries + db $0b, $02 ; cursor starting x, y + db $02 ; number of tiles the cursor moves per toggle + db $04 ; cursor max index + db $0f ; curor image + + db $00, $00, $00 ; marker bytes -- end of config table + +SamTutorialMultichoice_ConfigurationTable: ;1228e + db $06, $00 ; x, y to start drawing box + db $0E, $12 ; width, height of box + db $08, $02 ; x coordinate to start printing text + tx Text0400 ; text id to print next + db $ff ; marker byte -- end text entries + db $07, $02 ; cursor starting x, y + db $02 ; number of tiles the cursor moves per toggle + db $08 ; cursor max index + db $0f ; curor image + + db $00, $00, $00 ; marker bytes -- end of config table + + Unknown_1229f: ; 1229f (4:629f) INCROM $1229f, $126d1 diff --git a/src/macros/scripts.asm b/src/macros/scripts.asm index ed7b30d..85f8764 100644 --- a/src/macros/scripts.asm +++ b/src/macros/scripts.asm @@ -69,9 +69,9 @@ ENDM const Func_d1b3_index ; $34 const ScriptCommand_QuitScriptFully_index ; $35 const Func_d244_index ; $36 - const Func_d24c_index ; $37 + const ScriptCommand_ShowMultichoiceTextbox_ChooseDeckToDuelAgainst_index ; $37 const ScriptCommand_OpenDeckMachine_index ; $38 - const Func_d271_index ; $39 + const ScriptCommand_ShowMultichoiceTextbox_ChooseStarterDeck_index ; $39 const ScriptCommand_EnterMap_index ; $3a const ScriptCommand_MoveArbitraryNPC_index ; $3b const Func_d209_index ; $3c @@ -94,8 +94,8 @@ ENDM const ScriptCommand_WaitForSongToFinish_index ; $4d const Func_d435_index ; $4e const ScriptCommand_AskQuestionJumpDefaultYes_index ; $4f - const Func_d2f6_index ; $50 - const Func_d317_index ; $51 + const ScriptCommand_ShowSamNormalMultichoice_index ; $50 + const ScriptCommand_ShowSamTutorialMultichoice_index ; $51 const Func_d43d_index ; $52 const ScriptCommand_EndScriptLoop2_index ; $53 const ScriptCommand_EndScriptLoop3_index ; $54 diff --git a/src/wram.asm b/src/wram.asm index 761aab1..e67c587 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -2616,12 +2616,23 @@ wBoosterData_TypeChances:: ; d689 wd693:: ; d693 ds $1 -wd694:: ; d694 +wMultichoiceTextboxResult_Sam:: ; d694 ds $1 + +UNION + +wMultichoiceTextboxResult_ChooseDeckToDuelAgainst:: ; d695 + ds $1 + +NEXTU wd695:: ; d695 ds $1 +ENDU + + + wd696:: ; d696 ds $1 |