diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm index 9ba4c22..14c8ae8 100644 --- a/src/engine/bank02.asm +++ b/src/engine/bank02.asm @@ -595,7 +595,7 @@ Func_8f7f: Func_8f8b: .asm_8f8b - ld hl, $4fb1 + ld hl, .MenuParameters call InitializeMenuParameters ldtx hl, PleaseSelectDeckText call DrawWideTextBox_PrintText @@ -611,10 +611,9 @@ Func_8f8b: ret z ld [wCurDeck], a jp Func_903f -; 0x8fb1 - -SECTION "Bank 2@4fb9", ROMX[$4fb9], BANK[$2] +.MenuParameters: + menu_parameters 1, 2, 3, NUM_DECKS, SYM_CURSOR_R, SYM_SPACE, NULL Func_8fb9: ldh a, [hDPadHeld] diff --git a/src/engine/bank07.asm b/src/engine/bank07.asm index 444bb66..e062106 100644 --- a/src/engine/bank07.asm +++ b/src/engine/bank07.asm @@ -5590,8 +5590,8 @@ Func_1e76c: ret Func_1e795: - ld b, $07 - ld hl, $67e0 + ld b, BANK(.menu) + ld hl, .menu lb de, 0, 3 call LoadMenuBoxParams ld a, [wdd07] @@ -5619,7 +5619,17 @@ Func_1e795: call CreateSpriteAnim .asm_1e7df ret -; 0x1e7e0 + +.menu: + menu_box_params TRUE, 20, 10, \ + SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \ + PAD_A, PAD_B, FALSE, 1, NULL, NULL + textitem 3, 2, MinicomDeckSaveMachineText + textitem 3, 4, MinicomMailboxText + textitem 3, 6, MinicomCardAlbumText + textitem 3, 8, PCMenuShutdownText + db $ff +; 0x1e800 SECTION "Bank 7@6808", ROMX[$6808], BANK[$7] diff --git a/src/macros.asm b/src/macros.asm index 796b079..41238c9 100644 --- a/src/macros.asm +++ b/src/macros.asm @@ -4,6 +4,7 @@ INCLUDE "macros/code.asm" INCLUDE "macros/data.asm" INCLUDE "macros/animations.asm" INCLUDE "macros/map.asm" +INCLUDE "macros/menu.asm" INCLUDE "macros/scripts.asm" INCLUDE "macros/text.asm" INCLUDE "macros/wram.asm" diff --git a/src/macros/menu.asm b/src/macros/menu.asm new file mode 100644 index 0000000..739fcdd --- /dev/null +++ b/src/macros/menu.asm @@ -0,0 +1,39 @@ +/* + \1 ; cursor x coordinate - int + \2 ; cursor y coordinate - int + \3 ; y displacement between items - int + \4 ; number of items - int + \5 ; cursor tile number - SYM_*, usually SYM_CURSOR_R + \6 ; tile behind cursor - SYM_*, usually SYM_SPACE + \7 ; function pointer if non-0 - function ptr or NULL + +8 bytes. Used by InitializeMenuParameters. +*/ +MACRO menu_parameters + db \1, \2, \3, \4, \5, \6 + dw \7 +ENDM + +/* + \1 ; skip clear - TRUE or FALSE + \2 ; width - int + \3 ; height - int + \4 ; blink cursor symbol - SYM_*, usually SYM_CURSOR_R + \5 ; space symbol - SYM_*, usually SYM_SPACE + \6 ; default cursor symbol - SYM_*, usually SYM_CURSOR_R + \7 ; selection cursor symbol - SYM_*, usually SYM_CURSOR_R + \8 ; press keys - PAD_*, usually PAD_A + \9 ; held keys - PAD_*, usually PAD_B + \10 ; has horizontal scroll - TRUE or FALSE + \11 ; vertical step - int + \12 ; update function - function ptr or NULL + \13 ; label text ID - text ptr + +15 bytes. Used by LoadMenuBoxParams. +Usually followed by a list of textitem macros, then $ff +*/ +MACRO menu_box_params + db \1, \2, \3, \4, \5, \6, \7, \8, \9, \<10>, \<11> + dw \<12> + tx \<13> +ENDM \ No newline at end of file