-
Notifications
You must be signed in to change notification settings - Fork 991
Menu account
Zumi edited this page Sep 1, 2024
·
1 revision
Generation 2 added an option to display little descriptors for each of the start menu options. Let's try implementing it in Gen 1 for kicks.
Add this at the bottom of engine/menus/draw_start_menu.asm:
; prints a short blurb about the
; current selection, just like in GSC
DrawMenuAccount::
; prepare the background
hlcoord 0, 13
lb bc, 5, 10
call ClearScreenArea
; determine which table to use
ld a, [wStatusFlags4]
bit BIT_LINK_CONNECTED, a
; use the table replacing "SAVE" with "RESET"
ld de, StartMenuDescriptionTable.LinkTable
jr nz, .check_pokedex
; use regular table if we're not in link mode
ld de, StartMenuDescriptionTable
.check_pokedex
CheckEvent EVENT_GOT_POKEDEX
ld a, [wCurrentMenuItem]
jr nz, .got_table
; shift one index forwards to reflect the fact that
; we haven't gotten a dex yet
inc a
.got_table
; select the correct pointer to the entry, and then load
; the entry into the DE register for use as a parameter for PlaceString
add a
ld l, a
ld h, 0
add hl, de
ld e, [hl]
inc hl
ld d, [hl]
; finally, display the string.
hlcoord 0, 14
jp PlaceString
INCLUDE "data/start_menu_descriptions.asm"
Next, write the data/start_menu_descriptions.asm
file, containing:
StartMenuDescriptionTable:
; regular menu descriptions
dw .Pokedex
dw .Pokemon
dw .Item
dw .Player
dw .Save
dw .Option
dw .Exit
.LinkTable:
; descriptions for link mode
dw .Pokedex
dw .Pokemon
dw .Item
dw .Player
dw .Reset ; in place of "SAVE"
dw .Option
dw .Exit
.Pokedex:
db "#MON"
next "database@"
.Pokemon:
db "Party <PKMN>"
next "status@"
.Item:
db "Contains"
next "items@"
.Player:
db "Your own"
next "status@"
.Save:
db "Save your"
next "progress@"
.Reset:
db "Soft-reset"
next "the game@"
.Option:
db "Change"
next "settings@"
.Exit:
db "Close this"
next "menu@"
The code we just added must be called when the start menu is actually updated, the code for that is located somewhere else.
So add this line in home/start_menu.asm:
farcall PrintSafariZoneSteps ; print Safari Zone info, if in Safari Zone
call UpdateSprites
.loop
+ farcall DrawMenuAccount
call HandleMenuInput
ld b, a
.checkIfUpPressed