summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine/bank03.asm90
-rw-r--r--src/engine/bank04.asm71
-rw-r--r--src/macros/scripts.asm8
3 files changed, 139 insertions, 30 deletions
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm
index 58367e2..a89ecf9 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
+Show_ChooseDeckToDuelAgainst_MultichoiceTextbox: ; d24c (3:524c)
+ ld hl, .multichoice_menu_args
xor a
- call Func_d28c
+ call ShowMultichoiceTextbox
ld a, [wd695]
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 $d695 ;ram location to return result into
+ dw .text_entries ;location of table containing text entries
-Func_d271: ; d271 (3:5271)
- ld hl, $527b
+.text_entries ;d269
+ tx Text03f6
+ tx Text03f7
+ tx Text03f8
+
+ INCROM $d26f, $d271
+
+
+Show_ChooseStarterDeck_MultichoiceTextbox: ; 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,10 +2843,10 @@ 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
+ call ShowMultichoiceTextbox
ld a, [wd694]
ld c, a
set_flag_value EVENT_FLAG_75
@@ -2820,19 +2855,32 @@ Func_d2f6: ; d2f6 (3:52f6)
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 $d694 ;ram location to return result into
+ dw $0000 ;location of table containing text entries
+
-Func_d317: ; d317 (3:5317)
- ld hl, $532b
+ScriptCommand_ShowSamTutorialMultichoice: ; d317 (s)
+ ld hl, .multichoice_menu_args
ld a, [wd694]
- call Func_d28c
+ call ShowMultichoiceTextbox
ld a, [wd694]
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 $d694 ;ram location to return result into
+ dw $0000 ;location of table containing text entries
+
ScriptCommand_OpenDeckMachine: ; d336 (3:5336)
push bc
@@ -3333,7 +3381,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,7 +3526,7 @@ AfterTutorialBattleScript: ; d834 (3:5834)
run_command ScriptCommand_CloseTextBox
run_command ScriptCommand_PrintTextString
tx Text05f2
- run_command Func_d271
+ run_command Show_ChooseStarterDeck_MultichoiceTextbox
; 0xd860
INCROM $d860, $d880
diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm
index a1e504f..98ed957 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 Show_ChooseDeckToDuelAgainst_MultichoiceTextbox
dw ScriptCommand_OpenDeckMachine
- dw Func_d271
+ dw Show_ChooseStarterDeck_MultichoiceTextbox
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..963d3e9 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 Show_ChooseDeckToDuelAgainst_MultichoiceTextbox_index ; $37
const ScriptCommand_OpenDeckMachine_index ; $38
- const Func_d271_index ; $39
+ const Show_ChooseStarterDeck_MultichoiceTextbox_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