mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Persist level selection menu landmark when coming back (#12)
This commit is contained in:
parent
2e9e298d64
commit
533f7c259e
@ -83,7 +83,6 @@
|
|||||||
- **wSpacesLeft**
|
- **wSpacesLeft**
|
||||||
|
|
||||||
- Addresses within *wCurMapData* ~ *wCurMapDataEnd*: preserved on save. Initialized when entering a level (in StartMap), and updated accordingly throughout the level. Includes:
|
- Addresses within *wCurMapData* ~ *wCurMapDataEnd*: preserved on save. Initialized when entering a level (in StartMap), and updated accordingly throughout the level. Includes:
|
||||||
- **wCurLevel**: this one is not initialized in StartMap, but in LevelSelectionMenu (where it is also used), and stays static during the level.
|
|
||||||
- **wCurTurn**
|
- **wCurTurn**
|
||||||
- **wCurSpace**
|
- **wCurSpace**
|
||||||
- **wCurLevelCoins**
|
- **wCurLevelCoins**
|
||||||
@ -98,6 +97,8 @@
|
|||||||
- **wUnlockedLevels**: flag array that tracks progression regarding which levels have been unlocked.
|
- **wUnlockedLevels**: flag array that tracks progression regarding which levels have been unlocked.
|
||||||
- **wClearedLevelsStage<N>**: flag array that tracks progression regarding which levels have been cleared. Each level can have up to four clearable endings (N).
|
- **wClearedLevelsStage<N>**: flag array that tracks progression regarding which levels have been cleared. Each level can have up to four clearable endings (N).
|
||||||
- **wUnlockedTechniques**: flag array that tracks progression regarding which techniques have been unlocked.
|
- **wUnlockedTechniques**: flag array that tracks progression regarding which techniques have been unlocked.
|
||||||
|
- **wCurLevel**: initialized in LevelSelectionMenu (where it is also used), and stays static during the level.
|
||||||
|
- **wDefaultLevelSelectionMenuLandmark**: used to know in which landmark to place the player when entering level selection menu.
|
||||||
- **wCurOverworldMiscPal**
|
- **wCurOverworldMiscPal**
|
||||||
|
|
||||||
- These addresses share memory region with string buffers from *wStringBuffer3* onwards. They are placed in memory in the following order.
|
- These addresses share memory region with string buffers from *wStringBuffer3* onwards. They are placed in memory in the following order.
|
||||||
|
@ -26,6 +26,8 @@ if DEF(_DEBUG)
|
|||||||
ld a, -1
|
ld a, -1
|
||||||
ld [wUnlockedLevels], a ; debug
|
ld [wUnlockedLevels], a ; debug
|
||||||
endc
|
endc
|
||||||
|
xor a ; LANDMARK_LEVEL_1
|
||||||
|
ld [wDefaultLevelSelectionMenuLandmark], a
|
||||||
farcall AutoSaveGameOutsideOverworld
|
farcall AutoSaveGameOutsideOverworld
|
||||||
jp GameMenu
|
jp GameMenu
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ LevelSelectionMenu::
|
|||||||
ld a, LCDC_DEFAULT
|
ld a, LCDC_DEFAULT
|
||||||
ldh [rLCDC], a
|
ldh [rLCDC], a
|
||||||
|
|
||||||
xor a
|
ld a, [wDefaultLevelSelectionMenuLandmark]
|
||||||
ld [wLevelSelectionMenuCurrentLandmark], a
|
ld [wLevelSelectionMenuCurrentLandmark], a
|
||||||
call LevelSelectionMenu_GetLandmarkPage
|
call LevelSelectionMenu_GetLandmarkPage
|
||||||
ld [wLevelSelectionMenuCurrentPage], a
|
ld [wLevelSelectionMenuCurrentPage], a
|
||||||
@ -1002,6 +1002,7 @@ _LevelSelectionMenuHandleTransition:
|
|||||||
; set new landmark
|
; set new landmark
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
ld [wLevelSelectionMenuCurrentLandmark], a
|
ld [wLevelSelectionMenuCurrentLandmark], a
|
||||||
|
ld [wDefaultLevelSelectionMenuLandmark], a
|
||||||
; make the player sprite face down as the default state
|
; make the player sprite face down as the default state
|
||||||
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
|
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
@ -2543,6 +2543,8 @@ wRepelEffect:: db ; If a Repel is in use, it contains the nr of steps it's still
|
|||||||
wBikeStep:: dw
|
wBikeStep:: dw
|
||||||
wKurtApricornQuantity:: db
|
wKurtApricornQuantity:: db
|
||||||
|
|
||||||
|
wCurLevel:: db
|
||||||
|
wDefaultLevelSelectionMenuLandmark:: db
|
||||||
wCurOverworldMiscPal:: db
|
wCurOverworldMiscPal:: db
|
||||||
|
|
||||||
wPlayerDataEnd::
|
wPlayerDataEnd::
|
||||||
@ -2571,7 +2573,6 @@ wYCoord:: db
|
|||||||
wXCoord:: db
|
wXCoord:: db
|
||||||
wScreenSave:: ds SCREEN_META_WIDTH * SCREEN_META_HEIGHT
|
wScreenSave:: ds SCREEN_META_WIDTH * SCREEN_META_HEIGHT
|
||||||
|
|
||||||
wCurLevel:: db
|
|
||||||
wCurTurn:: dw
|
wCurTurn:: dw
|
||||||
wCurSpace:: db
|
wCurSpace:: db
|
||||||
wCurLevelCoins:: ds 3
|
wCurLevelCoins:: ds 3
|
||||||
|
Loading…
Reference in New Issue
Block a user