diff options
author | Marcus Huderle <huderlem@gmail.com> | 2017-07-03 11:03:23 -0700 |
---|---|---|
committer | Marcus Huderle <huderlem@gmail.com> | 2017-07-03 11:03:23 -0700 |
commit | e9b44a46d027bc0dcb457e6094bd52dad59b0afe (patch) | |
tree | eb4bd1d4e158d46d0b0ed6bb9c35b58d31800030 | |
parent | eaf4a119fa5fab33981c28122a78534583656be7 (diff) |
Label some wram offsets
-rwxr-xr-x | engine/high_scores_screen.asm | 32 | ||||
-rwxr-xr-x | engine/pinball_game/stage_init/init_stages.asm | 2 | ||||
-rwxr-xr-x | home.asm | 16 | ||||
-rwxr-xr-x | main.asm | 28 | ||||
-rwxr-xr-x | wram.asm | 39 |
5 files changed, 64 insertions, 53 deletions
diff --git a/engine/high_scores_screen.asm b/engine/high_scores_screen.asm index bc48dc7..a86209b 100755 --- a/engine/high_scores_screen.asm +++ b/engine/high_scores_screen.asm @@ -10,7 +10,7 @@ HighScoresScreenFunctions: ; 0xca83 dw ExitHighScoresScreen
Func_ca8f: ; 0xca8f
- ld hl, wd473
+ ld hl, wHighScoreId
call GenRandom
ld [hli], a
call GenRandom
@@ -58,13 +58,13 @@ Func_ca8f: ; 0xca8f xor a
ld [wda80], a
inc b
- ld hl, wRedHighScore4Unknown0x09 + 3
- ld de, wRedHighScore5Unknown0x09 + 3
+ ld hl, wRedHighScore4Id + 3
+ ld de, wRedHighScore5Id + 3
ld a, [wHighScoresStage]
and a
jr z, .asm_caeb
- ld hl, wBlueHighScore4Unknown0x09 + 3
- ld de, wBlueHighScore5Unknown0x09 + 3
+ ld hl, wBlueHighScore4Id + 3
+ ld de, wBlueHighScore5Id + 3
.asm_caeb
ld a, $5
.asm_caed
@@ -72,7 +72,7 @@ Func_ca8f: ; 0xca8f jr c, .asm_cb02
push af
jr nz, .asm_caf6
- ld hl, wd473 + $3
+ ld hl, wHighScoreId + $3
.asm_caf6
ld c, $d
.asm_caf8
@@ -134,10 +134,10 @@ Func_cb14: ; 0xcb14 ld [wda82], a
call Func_d211
hlCoord 0, 14, vBGMap
- ld de, wRedHighScore5Unknown0x09 + $3
+ ld de, wRedHighScore5Id + $3
call Func_d2cb
hlCoord 0, 14, vBGWin
- ld de, wBlueHighScore5Unknown0x09 + $3
+ ld de, wBlueHighScore5Id + $3
call Func_d2cb
ld a, [wHighScoresStage]
and a
@@ -350,10 +350,10 @@ Func_ccb6: ; 0xccb6 ld bc, $01c0
call LoadVRAMData
hlCoord 0, 14, vBGMap
- ld de, wRedHighScore5Unknown0x09 + $3
+ ld de, wRedHighScore5Id + $3
call Func_d361
hlCoord 0, 14, vBGWin
- ld de, wBlueHighScore5Unknown0x09 + $3
+ ld de, wBlueHighScore5Id + $3
call Func_d361
ld hl, wRedHighScore1Points
ld de, $a000
@@ -485,7 +485,7 @@ Func_cdce: ; 0xcdce push hl
ld d, h
ld e, l
- ld hl, wRedHighScore5Unknown0x09 + $3
+ ld hl, wRedHighScore5Id + $3
call Func_cfcb
pop hl
pop bc
@@ -504,7 +504,7 @@ Func_cdce: ; 0xcdce push hl
ld d, h
ld e, l
- ld hl, wBlueHighScore5Unknown0x09 + $3
+ ld hl, wBlueHighScore5Id + $3
call Func_cfcb
pop hl
pop bc
@@ -517,10 +517,10 @@ Func_cdce: ; 0xcdce ld [$abf6], a
pop af
hlCoord 0, 14, vBGMap
- ld de, wRedHighScore5Unknown0x09 + $3
+ ld de, wRedHighScore5Id + $3
call Func_d361
hlCoord 0, 14, vBGWin
- ld de, wBlueHighScore5Unknown0x09 + $3
+ ld de, wBlueHighScore5Id + $3
call Func_d361
ld hl, wRedHighScore1Points
ld de, $a000
@@ -829,7 +829,7 @@ Func_d042: ; 0xd042 ld a, [wda86]
bit 2, a
jr z, .asm_d0a2
- ld de, wRedHighScore1Unknown0x09
+ ld de, wRedHighScore1Id
call Func_d107
call Func_d0f5
ret c
@@ -855,7 +855,7 @@ Func_d042: ; 0xd042 ld a, [wda86]
bit 2, a
ret z
- ld de, wBlueHighScore1Unknown0x09
+ ld de, wBlueHighScore1Id
call Func_d107
call Func_d0f5
ret
diff --git a/engine/pinball_game/stage_init/init_stages.asm b/engine/pinball_game/stage_init/init_stages.asm index d59df02..6536ae1 100755 --- a/engine/pinball_game/stage_init/init_stages.asm +++ b/engine/pinball_game/stage_init/init_stages.asm @@ -72,7 +72,7 @@ ResetDataForStageInitialization: ; 0x8388 ld hl, wPartyMons
ld bc, $0170
call ClearData
- ld hl, wd473
+ ld hl, wHighScoreId
ld bc, $0039
call ClearData
ld hl, wd4ad
@@ -3933,10 +3933,10 @@ Func_1ffc: ; 0x1ffc callba Func_3c000 ld a, $1 ld [wd85d], a - ld a, $37 - ld [wd470], a - ld [wd471], a - ld [wd472], a + ld a, $37 ; space character for player high scores name + ld [wPlayerName], a + ld [wPlayerName + 1], a + ld [wPlayerName + 2], a ld a, SCREEN_ERASE_ALL_DATA ld [wCurrentScreen], a .master_loop @@ -5105,7 +5105,7 @@ INCLUDE "text.asm" INCLUDE "home/text.asm" Func_3500: - ld hl, wd464 + ld hl, wScoreToAdd ld a, e ld [hli], a ld a, d @@ -5117,12 +5117,12 @@ Func_3500: xor a ld [hli], a ld [hl], a - ld bc, wd464 + ld bc, wScoreToAdd callba AddBigBCD6FromQueueWithBallMultiplier ret AddBCDEToCurBufferValue: ; 0x351c - ld hl, wd464 + ld hl, wScoreToAdd ld a, e ld [hli], a ld a, d @@ -5134,7 +5134,7 @@ AddBCDEToCurBufferValue: ; 0x351c xor a ld [hli], a ld [hl], a - ld bc, wd464 + ld bc, wScoreToAdd callba AddBigBCD6FromQueue ret @@ -428,9 +428,9 @@ Func_10ba2: ; 0x10ba2 Func_10bea: ; 0x10bea xor a - ld [wd461], a - ld [wd462], a - ld [wd463], a + ld [wCurSelectedPartyMon], a + ld [wCurSelectedPartyMonScrollOffset], a + ld [wPartySelectionCursorCounter], a .asm_10bf4 call Func_10c0c call Func_b2e @@ -448,13 +448,13 @@ Func_10c0c: ; 0x10c0c ld b, a ld a, [wNumPartyMons] ld c, a - ld a, [wd461] + ld a, [wCurSelectedPartyMon] bit 6, b jr z, .asm_10c28 and a ret z dec a - ld [wd461], a + ld [wCurSelectedPartyMon], a lb de, $00, $03 call PlaySoundEffect ret @@ -465,14 +465,14 @@ Func_10c0c: ; 0x10c0c inc a cp c ret z - ld [wd461], a + ld [wCurSelectedPartyMon], a lb de, $00, $03 call PlaySoundEffect ret Func_10c38: ; 0x10c38 - ld a, [wd461] - ld hl, wd462 + ld a, [wCurSelectedPartyMon] + ld hl, wCurSelectedPartyMonScrollOffset sub [hl] jr nc, .asm_10c45 dec [hl] @@ -495,12 +495,12 @@ Func_10c38: ; 0x10c38 call Func_10b8e ld a, [hJoypadState] and a - ld a, [wd463] + ld a, [wPartySelectionCursorCounter] jr z, .asm_10c62 xor a .asm_10c62 inc a - ld [wd463], a + ld [wPartySelectionCursorCounter], a bit 3, a pop bc jr nz, .asm_10c78 @@ -512,13 +512,13 @@ Func_10c38: ; 0x10c38 ld a, $88 ld [hl], a .asm_10c78 - ld a, [wd462] + ld a, [wCurSelectedPartyMonScrollOffset] and a jr z, .asm_10c83 ld a, $8a ld [wBottomMessageText + $11], a .asm_10c83 - ld a, [wd462] + ld a, [wCurSelectedPartyMonScrollOffset] add $7 jr z, .asm_10c96 ld c, a @@ -536,7 +536,7 @@ Func_10c38: ; 0x10c38 ret Func_10ca5: ; 0x10ca5 - ld a, [wd461] + ld a, [wCurSelectedPartyMon] ld c, a ld b, $0 ld hl, wPartyMons @@ -588,7 +588,7 @@ Func_10cb7: ; 0x10cb7 ld [wSpecialMode], a xor a ld [wd54d], a - ld a, [wd461] + ld a, [wCurSelectedPartyMon] ld c, a ld b, $0 ld hl, wPartyMons @@ -77,33 +77,42 @@ wAddScoreQueue:: ; 0xd400 wAddScoreQueueEnd:: ; 0xd460 wNumPartyMons:: ; 0xd460 +; Number of pokemon caught in the current pinball game. ds $1 -wd461:: ; 0xd461 +wCurSelectedPartyMon:: ; 0xd461 +; The index of the selected party pokemon. +; This is mainly used during evolution mode, when the player selects which of their +; caught pokemon to evolve. ds $1 -wd462:: ; 0xd462 +wCurSelectedPartyMonScrollOffset:: ; 0xd462 +; Holds the scrolling offset for the pokemon list when choosing which +; pokemon to evolve. ds $1 -wd463:: ; 0xd463 +wPartySelectionCursorCounter:: ; 0xd463 +; Counter to animate the blinking cursor when choosing a pokemon to evolve. ds $1 -wd464:: ; 0xd464 +wScoreToAdd:: ; 0xd464 +; Holds a 6-byte BCD value to add to the player's score. ds $6 wScore:: ; 0xd46a +; 6-byte BCD value that represents the player's score. ds $6 -wd470:: ; 0xd470 - ds $1 - -wd471:: ; 0xd471 - ds $1 - -wd472:: ; 0xd472 - ds $1 +wPlayerName:: ; 0xd470 +; Player's 3-character name when entering High Scores. + ds $3 -wd473:: ; 0xd473 +wHighScoreId:: ; 0xd473 +; 4 randomly-generated bytes when a high score is achieved. +; These 4 bytes are appended to the high score data structure. +; See the high_scores macro. +; These 4 bytes don't appear to be used by anything. It's possible they're used by the +; "send high scores" capability, but haven't tested it. ds $4 wAddScoreQueueOffset:: ; 0xd477 @@ -116,9 +125,11 @@ wd479:: ; 0xd479 ds $1 wd47a:: ; 0xd47a +; BCD buffer ds $4 wBallType:: ; 0xd47e +; See constants/ball_types.asm ds $1 wBallTypeCounter:: ; 0xd47f @@ -2342,7 +2353,7 @@ wNumPokemonOwned:: ; 0xd9fb high_scores: MACRO \1Points:: ds 6 \1Name:: ds 3 -\1Unknown0x09:: ds 4 +\1Id:: ds 4 ENDM wRedHighScores:: ; 0xd9fd |