Board menu: implement preliminary Party, Bag, Pokegear, and Exit submenus (#11)

This commit is contained in:
xCrystal
2023-09-22 23:12:05 +02:00
parent c11c53e0d7
commit ca919cdf98
19 changed files with 275 additions and 59 deletions

View File

@@ -11,6 +11,9 @@ OverworldLoop::
cp MAPSTATUS_DONE
jr nz, .loop
.done
call DisableOverworldHUD
ld hl, wGameTimerPaused
res GAME_TIMER_PAUSED_F, [hl] ; stop game timer counter
ret
.Jumptable:
@@ -105,6 +108,8 @@ StartMap:
call ByteFill
farcall InitCallReceiveDelay
call ClearJoypad
ld a, BOARDEVENT_DISPLAY_MENU
ld [hCurBoardEvent], a
EnterMap:
xor a
ld [wXYComparePointer], a
@@ -238,6 +243,9 @@ PlayerEvents:
and a
ret nz
call CheckBoardEvent
jr c, .ok
call CheckTrainerBattle_GetPlayerEvent
jr c, .ok
@@ -269,6 +277,28 @@ PlayerEvents:
scf
ret
CheckBoardEvent:
jumptable .Jumptable, hCurBoardEvent
.Jumptable:
table_width 2, .Jumptable
dw .none
dw .menu
assert_table_length NUM_BOARD_EVENTS + 1
.none
xor a
ret
.menu
ld a, BANK(BoardMenuScript)
ld hl, BoardMenuScript
call CallScript
xor a
ld [hCurBoardEvent], a
scf
ret
CheckTrainerBattle_GetPlayerEvent:
call CheckTrainerBattle
jr nc, .nope

View File

@@ -234,6 +234,7 @@ ScriptCommandTable:
dw Script_getname ; a7
dw Script_wait ; a8
dw Script_checksave ; a9
dw Script_exitoverworld ; aa
assert_table_length NUM_EVENT_COMMANDS
StartScript:
@@ -2329,6 +2330,14 @@ ReturnFromCredits:
call StopScript
ret
Script_exitoverworld:
call GetScriptByte
call Script_endall
ld a, MAPSTATUS_DONE
call LoadMapStatus
call StopScript
ret
Script_wait:
push bc
call GetScriptByte