diff --git a/engine/board/menu.asm b/engine/board/menu.asm index 843700a91..c52d5090e 100755 --- a/engine/board/menu.asm +++ b/engine/board/menu.asm @@ -41,6 +41,7 @@ BoardMenuScript:: sjump .display_menu .exit: + wait 300 exitoverworld $00 .ConfirmExitText: diff --git a/engine/menus/game_menu.asm b/engine/menus/game_menu.asm index 979fe139f..ddf71be9d 100755 --- a/engine/menus/game_menu.asm +++ b/engine/menus/game_menu.asm @@ -92,6 +92,22 @@ GameMenu_WorldMap: and a jr z, .not_in_overworld + ld a, MAPSETUP_CONTINUE + jr .SpawnToMap + +.not_in_overworld + farcall LevelSelectionMenu + ret nc ; if pressed B, go back to Game Menu + + farcall ClearSpriteAnims + call ClearSprites + ld a, PLAYER_NORMAL + ld [wPlayerState], a ; this may need to be set on a per-level basis (e.g. if specific level starts with player in surf state) + ld a, MAPSETUP_ENTERLEVEL +; jr .SpawnToMap + +.SpawnToMap: + ldh [hMapEntryMethod], a ld a, $8 ld [wMusicFade], a ld a, LOW(MUSIC_NONE) @@ -103,18 +119,16 @@ GameMenu_WorldMap: ld c, 20 call DelayFrames farcall JumpRoamMons - ld a, MAPSETUP_CONTINUE - ldh [hMapEntryMethod], a xor a - ld [wDontPlayMapMusicOnReload], a + ld [wDontPlayMapMusicOnReload], a ; play map music ld [wLinkMode], a ld hl, wGameTimerPaused - set GAME_TIMER_COUNTING_F, [hl] + set GAME_TIMER_COUNTING_F, [hl] ; start game timer counter farcall OverworldLoop - jp GameMenu -.not_in_overworld - farcall LevelSelectionMenu +; return from overworld loop + call ClearBGPalettes + call ClearSprites ret GameMenu_Shop: diff --git a/engine/menus/level_selection_menu.asm b/engine/menus/level_selection_menu.asm index 3afe27495..4c648db40 100755 --- a/engine/menus/level_selection_menu.asm +++ b/engine/menus/level_selection_menu.asm @@ -119,39 +119,15 @@ LevelSelectionMenu:: jr .main_loop .enter_level + ld a, [wLevelSelectionMenuCurrentLandmark] + call LevelSelectionMenu_GetLandmarkSpawnPoint + ld [wDefaultSpawnpoint], a call LevelSelectionMenu_Delay10Frames ld de, SFX_WARP_TO call PlaySFX call LevelSelectionMenu_Delay10Frames call .EnterLevelFadeOut - ld a, $8 - ld [wMusicFade], a - ld a, LOW(MUSIC_NONE) - ld [wMusicFadeID], a - ld a, HIGH(MUSIC_NONE) - ld [wMusicFadeID + 1], a - call ClearBGPalettes - call ClearTilemap - farcall ClearSpriteAnims - call ClearSprites - xor a - ld [wVramState], a - ld c, 20 - call DelayFrames - - ld a, [wLevelSelectionMenuCurrentLandmark] - call LevelSelectionMenu_GetLandmarkSpawnPoint - ld [wDefaultSpawnpoint], a - ld a, MAPSETUP_ENTERLEVEL - ld [hMapEntryMethod], a - xor a - ld [wDontPlayMapMusicOnReload], a ; play map music - ld [wLinkMode], a - ld a, PLAYER_NORMAL - ld [wPlayerState], a ; this may need to be set on a per-level basis (e.g. if specific level starts with player in surf state) - ld hl, wGameTimerPaused - set GAME_TIMER_COUNTING_F, [hl] ; start game timer counter - farcall OverworldLoop + scf ret .EnterLevelFadeOut: @@ -166,7 +142,7 @@ LevelSelectionMenu:: call ClearSprites xor a ld [wVramState], a - ret + ret ; nc LevelSelectionMenu_LoadGFX: ; load gfx for the background tiles, and for the player and directional arrow sprites diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm index 9efe98c02..c72744b7c 100644 --- a/macros/scripts/events.asm +++ b/macros/scripts/events.asm @@ -1057,7 +1057,7 @@ ENDM const wait_command ; $a8 MACRO wait db wait_command - db \1 ; duration + db \1 / 100 ; duration (ms) ENDM const checksave_command ; $a9