Save game and clear board menu cursor position during game menu (#17)

This commit is contained in:
xCrystal 2023-10-07 19:08:54 +02:00
parent da956ed7e4
commit 917db30e98
10 changed files with 13 additions and 13 deletions

View File

@ -95,7 +95,7 @@ endc
; wSwarmFlags ; wSwarmFlags
const ENGINE_BUENAS_PASSWORD_2 const ENGINE_BUENAS_PASSWORD_2
const ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON const ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
; wGameTimerPaused ; wGameTimer
const ENGINE_62 const ENGINE_62
; wPlayerGender ; wPlayerGender
const ENGINE_PLAYER_IS_FEMALE const ENGINE_PLAYER_IS_FEMALE

View File

@ -27,7 +27,7 @@ DEF AUTO_INPUT EQU $ff
const TEMPMON ; 3 const TEMPMON ; 3
const WILDMON ; 4 const WILDMON ; 4
; wGameTimerPaused:: ; wGameTimer::
DEF GAME_TIMER_COUNTING_F EQU 0 DEF GAME_TIMER_COUNTING_F EQU 0
; wJoypadDisable:: ; wJoypadDisable::

View File

@ -106,7 +106,7 @@ endc
engine_flag wSwarmFlags, SWARMFLAGS_BUENAS_PASSWORD_F engine_flag wSwarmFlags, SWARMFLAGS_BUENAS_PASSWORD_F
engine_flag wSwarmFlags, SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F engine_flag wSwarmFlags, SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F
engine_flag wGameTimerPaused, 7 ; unused engine_flag wGameTimer, 7 ; unused
engine_flag wPlayerGender, PLAYERGENDER_FEMALE_F engine_flag wPlayerGender, PLAYERGENDER_FEMALE_F

View File

@ -698,7 +698,7 @@ LoadMapPals:
ld a, BANK(wOBPals1) ld a, BANK(wOBPals1)
ld de, wOBPals1 ld de, wOBPals1
ld hl, MapObjectDarknessPals ld hl, MapObjectDarknessPals
ld bc, 7 palettes ld bc, 7 palettes ; all but PAL_OW_MISC
jp FarCopyWRAM jp FarCopyWRAM
.not_darkness .not_darkness
@ -708,7 +708,7 @@ LoadMapPals:
ld hl, MapObjectPals ld hl, MapObjectPals
call AddNTimes call AddNTimes
ld de, wOBPals1 ld de, wOBPals1
ld bc, 7 palettes ld bc, 7 palettes ; all but PAL_OW_MISC
ld a, BANK(wOBPals1) ld a, BANK(wOBPals1)
call FarCopyWRAM call FarCopyWRAM

View File

@ -122,13 +122,15 @@ GameMenu_WorldMap:
xor a xor a
ld [wDontPlayMapMusicOnReload], a ; play map music ld [wDontPlayMapMusicOnReload], a ; play map music
ld [wLinkMode], a ld [wLinkMode], a
ld hl, wGameTimerPaused ld [wBoardMenuLastCursorPosition], a
ld hl, wGameTimer
set GAME_TIMER_COUNTING_F, [hl] ; start game timer counter set GAME_TIMER_COUNTING_F, [hl] ; start game timer counter
farcall OverworldLoop farcall OverworldLoop
; return from overworld loop ; return from overworld loop
call ClearBGPalettes call ClearBGPalettes
call ClearSprites call ClearSprites
farcall AutoSaveGameOutsideOverworld
ret ret
GameMenu_Shop: GameMenu_Shop:

View File

@ -21,8 +21,6 @@ MainMenu:
ld b, CGB_DIPLOMA ld b, CGB_DIPLOMA
call GetCGBLayout call GetCGBLayout
call SetPalettes call SetPalettes
ld hl, wGameTimerPaused
res GAME_TIMER_COUNTING_F, [hl]
call MainMenu_GetWhichMenu call MainMenu_GetWhichMenu
ld [wWhichIndexSet], a ld [wWhichIndexSet], a
call MainMenu_PrintCurrentTimeAndDay call MainMenu_PrintCurrentTimeAndDay

View File

@ -12,7 +12,7 @@ OverworldLoop::
jr nz, .loop jr nz, .loop
.done .done
call DisableOverworldHUD call DisableOverworldHUD
ld hl, wGameTimerPaused ld hl, wGameTimer
res GAME_TIMER_COUNTING_F, [hl] ; stop game timer counter res GAME_TIMER_COUNTING_F, [hl] ; stop game timer counter
ld a, FALSE ld a, FALSE
ld [wText2bpp], a ld [wText2bpp], a

View File

@ -2314,10 +2314,10 @@ Script_endall:
ret ret
Script_halloffame: Script_halloffame:
ld hl, wGameTimerPaused ld hl, wGameTimer
res GAME_TIMER_COUNTING_F, [hl] res GAME_TIMER_COUNTING_F, [hl]
farcall HallOfFame farcall HallOfFame
ld hl, wGameTimerPaused ld hl, wGameTimer
set GAME_TIMER_COUNTING_F, [hl] set GAME_TIMER_COUNTING_F, [hl]
jr ReturnFromCredits jr ReturnFromCredits

View File

@ -32,7 +32,7 @@ GameTimer::
ret nz ret nz
; Is the timer paused? ; Is the timer paused?
ld hl, wGameTimerPaused ld hl, wGameTimer
bit GAME_TIMER_COUNTING_F, [hl] bit GAME_TIMER_COUNTING_F, [hl]
ret z ret z

View File

@ -1200,7 +1200,7 @@ wPredefHL:: dw
wPredefAddress:: dw wPredefAddress:: dw
wFarCallBC:: dw wFarCallBC:: dw
wGameTimerPaused:: wGameTimer::
; bit 0: game timer paused ; bit 0: game timer paused
; bit 7: something mobile ; bit 7: something mobile
db db