summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-09-09 16:33:12 -0700
committerMarcus Huderle <huderlem@gmail.com>2017-09-09 16:33:12 -0700
commit6f3015b8721b9149e9cc5c536ab66df83bf9f1c7 (patch)
treee51e197b1014bee297ae62d234f35341d87532cd
parentbd89e966c639c1322695fb5d992e323e81a78be1 (diff)
More labeling for special modes and draw_sprites
-rw-r--r--engine/pinball_game/ball_loss/ball_loss_blue_field.asm14
-rw-r--r--engine/pinball_game/ball_loss/ball_loss_red_field.asm20
-rw-r--r--engine/pinball_game/catchem_mode.asm10
-rw-r--r--engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm72
-rw-r--r--engine/pinball_game/catchem_mode/catchem_mode_red_field.asm66
-rw-r--r--engine/pinball_game/draw_sprites/draw_blue_field_sprites.asm68
-rwxr-xr-xengine/pinball_game/draw_sprites/draw_pinball.asm62
-rw-r--r--engine/pinball_game/draw_sprites/draw_red_field_sprites.asm320
-rwxr-xr-xengine/pinball_game/draw_sprites/draw_timer.asm128
-rwxr-xr-xengine/pinball_game/draw_sprites/draw_wild_mon.asm47
-rwxr-xr-xengine/pinball_game/evolution_mode.asm2
-rw-r--r--engine/pinball_game/evolution_mode/evolution_mode_blue_field.asm6
-rw-r--r--engine/pinball_game/evolution_mode/evolution_mode_red_field.asm6
-rw-r--r--engine/pinball_game/load_stage_data/load_blue_field.asm2
-rw-r--r--engine/pinball_game/load_stage_data/load_red_field.asm2
-rwxr-xr-xengine/pinball_game/map_move.asm32
-rw-r--r--wram.asm3
17 files changed, 429 insertions, 431 deletions
diff --git a/engine/pinball_game/ball_loss/ball_loss_blue_field.asm b/engine/pinball_game/ball_loss/ball_loss_blue_field.asm
index 4991af3..e3b2dc3 100644
--- a/engine/pinball_game/ball_loss/ball_loss_blue_field.asm
+++ b/engine/pinball_game/ball_loss/ball_loss_blue_field.asm
@@ -34,7 +34,7 @@ HandleBallLossBlueField: ; 0xde4f
xor a
ld [wPinballLaunched], a
ld [wd4df], a
- call Func_ded6
+ call ConcludeSpecialMode_BlueField
ld a, [wCurBonusMultiplierFromFieldEvents]
and a
jr z, .noExtraBall
@@ -64,19 +64,19 @@ HandleBallLossBlueField: ; 0xde4f
ld [wGameOver], a
ret
-Func_ded6: ; 0xded6
+ConcludeSpecialMode_BlueField: ; 0xded6
ld a, [wInSpecialMode]
and a
ret z
ld a, [wSpecialMode]
and a
- jr nz, .asm_deec
+ jr nz, .notCatchEmMode
callba ConcludeCatchEmMode
ret
-.asm_deec
+.notCatchEmMode
cp SPECIAL_MODE_EVOLUTION
- jr nz, .asm_df05
+ jr nz, .notEvolutionMode
ld a, $0
ld [wSlotIsOpen], a
ld a, $1e
@@ -84,10 +84,10 @@ Func_ded6: ; 0xded6
callba ConcludeEvolutionMode
ret
-.asm_df05
+.notEvolutionMode
ld a, $0
ld [wSlotIsOpen], a
ld a, $1e
ld [wFramesUntilSlotCaveOpens], a
- callba Func_3022b
+ callba ConcludeMapMoveMode
ret
diff --git a/engine/pinball_game/ball_loss/ball_loss_red_field.asm b/engine/pinball_game/ball_loss/ball_loss_red_field.asm
index ff03310..7983fb8 100644
--- a/engine/pinball_game/ball_loss/ball_loss_red_field.asm
+++ b/engine/pinball_game/ball_loss/ball_loss_red_field.asm
@@ -34,7 +34,7 @@ HandleBallLossRedField: ; 0xdd76
xor a
ld [wPinballLaunched], a
ld [wd4df], a
- call Func_ddfd
+ call ConcludeSpecialMode_RedField
ld a, [wCurBonusMultiplierFromFieldEvents]
and a
jr z, .asm_dddd
@@ -64,33 +64,33 @@ HandleBallLossRedField: ; 0xdd76
ld [wGameOver], a
ret
-Func_ddfd: ; 0xddfd
+ConcludeSpecialMode_RedField: ; 0xddfd
ld a, [wInSpecialMode]
and a
ret z
ld a, [wSpecialMode]
and a
- jr nz, .asm_de14
+ jr nz, .notCatchEmMode
callba ConcludeCatchEmMode
- jr .asm_de40
+ jr .setCollisionState
-.asm_de14
+.notCatchEmMode
cp SPECIAL_MODE_EVOLUTION
- jr nz, .asm_de2d
+ jr nz, .notEvolutionMode
xor a
ld [wSlotIsOpen], a
ld a, $1e
ld [wFramesUntilSlotCaveOpens], a
callba ConcludeEvolutionMode
- jr .asm_de40
+ jr .setCollisionState
-.asm_de2d
+.notEvolutionMode
xor a
ld [wSlotIsOpen], a
ld a, $1e
ld [wFramesUntilSlotCaveOpens], a
- callba Func_3022b
-.asm_de40
+ callba ConcludeMapMoveMode
+.setCollisionState
ld a, [wd7ad]
ld c, a
ld a, [wStageCollisionState]
diff --git a/engine/pinball_game/catchem_mode.asm b/engine/pinball_game/catchem_mode.asm
index 1d7fc58..cec2dbe 100644
--- a/engine/pinball_game/catchem_mode.asm
+++ b/engine/pinball_game/catchem_mode.asm
@@ -32,7 +32,7 @@ StartCatchEmMode: ; 0x1003f
ld [wInSpecialMode], a ; set special mode flag
xor a
ld [wSpecialMode], a
- ld [wd54d], a ;set ??? to 0
+ ld [wSpecialModeState], a
ld a, [wCurrentStage]
sla a
ld c, a ;store twice current stage to use a pointer offset
@@ -762,7 +762,7 @@ LoadShakeBallGfx: ; 0x104e2
call LoadVRAMData
ret
-CapturePokemon: ; 0x1052d
+CapturePokemonAnimation: ; 0x1052d
ld a, [wBallCaptureAnimationFrame]
cp $c
jr nz, .asm_10541
@@ -932,7 +932,7 @@ Func_10648: ; 0x10648
dec a
ld [wd54f], a
jr nz, .asm_10677
- ld hl, wd54d
+ ld hl, wSpecialModeState
inc [hl]
.asm_10677
ret
@@ -969,7 +969,7 @@ Func_106a6: ; 0x106a6
call LoadScrollingText
ret
-Func_106b6: ; 0x106b6
+ShowCapturedPokemonText: ; 0x106b6
ld a, [wCurrentCatchEmMon]
ld c, a
ld b, $0
@@ -1041,7 +1041,7 @@ Func_106b6: ; 0x106b6
ld [wScrollingText2StopOffset], a
ret
-Func_10732: ; 0x10732
+PlayCatchemPokemonCry: ; 0x10732
ld a, [wCurrentCatchEmMon]
inc a
ld e, a
diff --git a/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm b/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm
index 1d3fadc..a5aa4df 100644
--- a/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm
+++ b/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm
@@ -1,31 +1,31 @@
HandleBlueCatchEmCollision: ; 0x202bc
ld a, [wSpecialModeCollisionID]
cp SPECIAL_COLLISION_SHELLDER
- jp z, Func_204f1
+ jp z, HandleShellderCollision_CatchemMode
cp SPECIAL_COLLISION_SPINNER
- jp z, Func_20569
+ jp z, HandleSpinnerCollision_CatchemMode_BlueField
cp SPECIAL_COLLISION_SLOWPOKE
- jp z, Func_20573
+ jp z, HandleSlowpokeCollision_CatchemMode
cp SPECIAL_COLLISION_CLOYSTER
- jp z, Func_2057a
+ jp z, HandleCloysterCollision_CatchemMode
cp SPECIAL_COLLISION_NOTHING
- jr z, .asm_202d9
+ jr z, .noCollision
scf
ret
-.asm_202d9
- call Func_204b3
- ld a, [wd54d]
+.noCollision
+ call CheckIfCatchemModeTimerExpired_BlueField
+ ld a, [wSpecialModeState]
call CallInFollowingTable
-PointerTable_202e2: ; 0x202e2
+CatchemModeCallTable_BlueField: ; 0x202e2
padded_dab Func_20302
padded_dab Func_20320
padded_dab Func_2032c
- padded_dab Func_20364
- padded_dab Func_20394
- padded_dab Func_20454
- padded_dab CapturePokemonBlueStage
- padded_dab Func_2048f
+ padded_dab ShowAnimatedCatchemPokemon_BlueField
+ padded_dab UpdateMonState_CatchemMode_BlueField
+ padded_dab CatchPokemon_BlueField
+ padded_dab CapturePokemonAnimation_BlueField
+ padded_dab ConcludeCatchemMode_BlueField
Func_20302: ; 0x20302
ld a, [wNumberOfCatchModeTilesFlipped]
@@ -34,7 +34,7 @@ Func_20302: ; 0x20302
ld a, [wCurrentStage]
bit 0, a
jr z, .asm_2031e
- ld hl, wd54d
+ ld hl, wSpecialModeState
inc [hl]
ld a, $14
ld [wd54e], a
@@ -63,13 +63,13 @@ Func_2032c: ; 0x2032c
.asm_20333
ld a, $1
ld [wd5c6], a
- ld hl, wd54d
+ ld hl, wSpecialModeState
inc [hl]
.asm_20362
scf
ret
-Func_20364: ; 0x20364
+ShowAnimatedCatchemPokemon_BlueField: ; 0x20364
ld a, [wCurrentStage]
bit 0, a
jr z, .asm_20370
@@ -77,15 +77,15 @@ Func_20364: ; 0x20364
jr nz, .asm_20392
.asm_20370
callba ShowAnimatedWildMon
- callba Func_10732
+ callba PlayCatchemPokemonCry
callba LoadWildMonCollisionMask
- ld hl, wd54d
+ ld hl, wSpecialModeState
inc [hl]
.asm_20392
scf
ret
-Func_20394: ; 0x20394
+UpdateMonState_CatchemMode_BlueField: ; 0x20394
ld a, [wLoopsUntilNextCatchSpriteAnimationChange]
dec a
ld [wLoopsUntilNextCatchSpriteAnimationChange], a
@@ -145,7 +145,7 @@ Func_20394: ; 0x20394
ld [wTimeRanOut], a
ld a, $1
ld [wPauseTimer], a
- ld hl, wd54d
+ ld hl, wSpecialModeState
inc [hl]
ld c, $2
jr .asm_2044b
@@ -177,7 +177,7 @@ Func_20394: ; 0x20394
scf
ret
-Func_20454: ; 0x20454
+CatchPokemon_BlueField: ; 0x20454
ld a, [wd580]
and a
jr z, .asm_2045f
@@ -187,19 +187,19 @@ Func_20454: ; 0x20454
.asm_2045f
callba BallCaptureInit
- ld hl, wd54d
+ ld hl, wSpecialModeState
inc [hl]
- callba Func_106b6
+ callba ShowCapturedPokemonText
callba AddCaughtPokemonToParty
scf
ret
-CapturePokemonBlueStage: ; 0x20483
- callba CapturePokemon
+CapturePokemonAnimation_BlueField: ; 0x20483
+ callba CapturePokemonAnimation
scf
ret
-Func_2048f: ; 0x2048f
+ConcludeCatchemMode_BlueField: ; 0x2048f
ld a, [wBottomTextEnabled]
and a
ret nz
@@ -211,7 +211,7 @@ Func_2048f: ; 0x2048f
scf
ret
-Func_204b3: ; 0x204b3
+CheckIfCatchemModeTimerExpired_BlueField: ; 0x204b3
callba PlayLowTimeSfx
ld a, [wTimeRanOut]
and a
@@ -219,7 +219,7 @@ Func_204b3: ; 0x204b3
xor a
ld [wTimeRanOut], a
ld a, $7
- ld [wd54d], a
+ ld [wSpecialModeState], a
; Automatically set Mew as caught, since you can't possibly catch it
ld a, [wCurrentCatchEmMon]
cp MEW - 1
@@ -230,10 +230,10 @@ Func_204b3: ; 0x204b3
callba Func_106a6
ret
-Func_204f1: ; 0x204f1
+HandleShellderCollision_CatchemMode: ; 0x204f1
ld a, [wNumberOfCatchModeTilesFlipped]
- cp $18
- jr z, .asm_2055e
+ cp 24
+ jr z, .allTilesFlipped
sla a
ld c, a
ld b, $0
@@ -279,25 +279,25 @@ Func_204f1: ; 0x204f1
ld hl, wStationaryText1
ld de, FlippedText
call LoadStationaryTextAndHeader
-.asm_2055e
+.allTilesFlipped
ld bc, $0001
ld de, $0000
call AddBCDEToJackpot
scf
ret
-Func_20569: ; 0x20569
+HandleSpinnerCollision_CatchemMode_BlueField: ; 0x20569
ld bc, $0000
ld de, $1000
call AddBCDEToJackpot
ret
-Func_20573: ; 0x20573
+HandleSlowpokeCollision_CatchemMode: ; 0x20573
ld bc, $0005
ld de, $0000
ret
-Func_2057a: ; 0x2057a
+HandleCloysterCollision_CatchemMode: ; 0x2057a
ld bc, $0005
ld de, $0000
ret
diff --git a/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm b/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm
index 8290ce4..6b6d32e 100644
--- a/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm
+++ b/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm
@@ -1,39 +1,39 @@
HandleRedCatchEmCollision: ; 0x20000
ld a, [wSpecialModeCollisionID]
cp SPECIAL_COLLISION_VOLTORB
- jp z, HandleCatchModeVoltorbHit ;if collided with voltorb
+ jp z, HandleVoltorbCollision_CatchemMode
cp SPECIAL_COLLISION_SPINNER
- jp z, Func_202a8
+ jp z, HandleSpinnerCollision_CatchemMode_RedField
cp SPECIAL_COLLISION_BELLSPROUT
- jp z, Func_202b2 ;bellsprout
+ jp z, HandleBellsproutCollision_CatchemMode
cp SPECIAL_COLLISION_NOTHING
- jr z, .asm_20018
+ jr z, .noCollision
scf
ret
-.asm_20018
- call Func_201f2
- ld a, [wd54d]
+.noCollision
+ call CheckIfCatchemModeTimerExpired_RedField
+ ld a, [wSpecialModeState]
call CallInFollowingTable
-PointerTable_20021: ; 0x20021
+CatchemModeCallTable_RedField: ; 0x20021
padded_dab Func_20041
padded_dab Func_2005f
padded_dab Func_2006b
- padded_dab Func_200a3
- padded_dab CatchEmModeUpdateMonStateRedTable
- padded_dab Func_20193
- padded_dab CapturePokemonRedStage
- padded_dab Func_201ce
+ padded_dab ShowAnimatedCatchemPokemon_RedField
+ padded_dab UpdateMonState_CatchemMode_RedField
+ padded_dab CatchPokemon_RedField
+ padded_dab CapturePokemonAnimation_RedField
+ padded_dab ConcludeCatchemMode_RedField
Func_20041: ; 0x20041
ld a, [wNumberOfCatchModeTilesFlipped]
- cp $18 ;if not 24 and not on lower stage, ret
+ cp $18
jr nz, .NotDone
ld a, [wCurrentStage]
bit 0, a
jr z, .NotDone
- ld hl, wd54d
- inc [hl] ;else progress catch em mode
+ ld hl, wSpecialModeState
+ inc [hl]
ld a, $14
ld [wd54e], a
ld a, $5
@@ -61,13 +61,13 @@ Func_2006b: ; 0x2006b
.asm_20098
ld a, $1
ld [wd5c6], a
- ld hl, wd54d
+ ld hl, wSpecialModeState
inc [hl]
.asm_200a1
scf
ret
-Func_200a3: ; 0x200a3
+ShowAnimatedCatchemPokemon_RedField: ; 0x200a3
ld a, [wCurrentStage]
bit 0, a
jr z, .asm_200af
@@ -75,15 +75,15 @@ Func_200a3: ; 0x200a3
jr nz, .asm_200d1
.asm_200af
callba ShowAnimatedWildMon
- callba Func_10732
+ callba PlayCatchemPokemonCry
callba LoadWildMonCollisionMask
- ld hl, wd54d
+ ld hl, wSpecialModeState
inc [hl]
.asm_200d1
scf
ret
-CatchEmModeUpdateMonStateRedTable: ; 0x200d3
+UpdateMonState_CatchemMode_RedField: ; 0x200d3
ld a, [wLoopsUntilNextCatchSpriteAnimationChange] ;dec time until next animation change, if zero jump
dec a
ld [wLoopsUntilNextCatchSpriteAnimationChange], a
@@ -143,7 +143,7 @@ CatchEmModeUpdateMonStateRedTable: ; 0x200d3
ld [wTimeRanOut], a
ld a, $1
ld [wPauseTimer], a ;pause timer
- ld hl, wd54d ;inc ??
+ ld hl, wSpecialModeState ;inc ??
inc [hl]
ld c, $2
jr .UpdateMonAnimation
@@ -175,7 +175,7 @@ CatchEmModeUpdateMonStateRedTable: ; 0x200d3
scf
ret
-Func_20193: ; 0x20193
+CatchPokemon_RedField: ; 0x20193
ld a, [wd580]
and a
jr z, .asm_2019e
@@ -185,19 +185,19 @@ Func_20193: ; 0x20193
.asm_2019e
callba BallCaptureInit
- ld hl, wd54d
+ ld hl, wSpecialModeState
inc [hl]
- callba Func_106b6
+ callba ShowCapturedPokemonText
callba AddCaughtPokemonToParty
scf
ret
-CapturePokemonRedStage: ; 0x201c2
- callba CapturePokemon
+CapturePokemonAnimation_RedField: ; 0x201c2
+ callba CapturePokemonAnimation
scf
ret
-Func_201ce: ; 0x201ce
+ConcludeCatchemMode_RedField: ; 0x201ce
ld a, [wBottomTextEnabled]
and a
ret nz
@@ -209,7 +209,7 @@ Func_201ce: ; 0x201ce
scf
ret
-Func_201f2: ; 0x201f2
+CheckIfCatchemModeTimerExpired_RedField: ; 0x201f2
callba PlayLowTimeSfx
ld a, [wTimeRanOut]
and a
@@ -217,7 +217,7 @@ Func_201f2: ; 0x201f2
xor a
ld [wTimeRanOut], a
ld a, $7
- ld [wd54d], a
+ ld [wSpecialModeState], a
; Automatically set Mew as caught, since you can't possibly catch it
ld a, [wCurrentCatchEmMon]
cp MEW - 1
@@ -228,7 +228,7 @@ Func_201f2: ; 0x201f2
callba Func_106a6
ret
-HandleCatchModeVoltorbHit: ; 0x20230 resolve hitting a voltorb in catch mode?
+HandleVoltorbCollision_CatchemMode: ; 0x20230 resolve hitting a voltorb in catch mode?
ld a, [wNumberOfCatchModeTilesFlipped]
cp $18
jr z, .AllTilesFlipped ;if FlippedCount is 24, add to jackpot and ret c
@@ -284,13 +284,13 @@ HandleCatchModeVoltorbHit: ; 0x20230 resolve hitting a voltorb in catch mode?
scf
ret
-Func_202a8: ; 0x202a8
+HandleSpinnerCollision_CatchemMode_RedField: ; 0x202a8
ld bc, $0000
ld de, $1000
call AddBCDEToJackpot
ret
-Func_202b2: ; 0x202b2
+HandleBellsproutCollision_CatchemMode: ; 0x202b2
ld bc, $0005
ld de, $0000
call AddBCDEToJackpot
diff --git a/engine/pinball_game/draw_sprites/draw_blue_field_sprites.asm b/engine/pinball_game/draw_sprites/draw_blue_field_sprites.asm
index 231eb37..72b0eb4 100644
--- a/engine/pinball_game/draw_sprites/draw_blue_field_sprites.asm
+++ b/engine/pinball_game/draw_sprites/draw_blue_field_sprites.asm
@@ -2,12 +2,12 @@ DrawSpritesBlueFieldTop: ; 0x1f330
ld bc, $7f00
callba DrawTimer
call DrawShellderSprites
- call Func_1f3e1
- call Func_1f408
- call Func_1f428
+ call DrawSpinner_BlueField
+ call DrawSlowpoke
+ call DrawCloyster
callba DrawPinball
- call Func_1f48f
- call Func_1f4f8
+ call DrawEvolutionIndicatorArrows_BlueFieldTop
+ call DrawEvolutionTrinket_BlueFieldTop
ret
DrawSpritesBlueFieldBottom: ; 0x1f35a
@@ -18,8 +18,8 @@ DrawSpritesBlueFieldBottom: ; 0x1f35a
call DrawPikachuSavers_BlueStage
callba DrawFlippers
callba DrawPinball
- call Func_1f4a3
- call Func_1f509
+ call DrawEvolutionIndicatorArrows_BlueFieldBottom
+ call DrawEvolutionTrinket_BlueFieldBottom
call DrawSlotGlow_BlueField
ret
@@ -77,7 +77,7 @@ Data_1f3db:
db $02
db $E0, $E1, $E0 ; OAM ids
-Func_1f3e1: ; 0x1f3e1
+DrawSpinner_BlueField: ; 0x1f3e1
ld a, $8a
ld hl, hSCX
sub [hl]
@@ -91,16 +91,16 @@ Func_1f3e1: ; 0x1f3e1
srl a
ld e, a
ld d, $0
- ld hl, OAMIds_1f402
+ ld hl, SpinnerOAMIds_BlueField
add hl, de
ld a, [hl]
call LoadOAMData
ret
-OAMIds_1f402:
+SpinnerOAMIds_BlueField:
db $E8, $E9, $EA, $EB, $EC, $ED
-Func_1f408: ; 0x1f408
+DrawSlowpoke: ; 0x1f408
ld a, $18
ld hl, hSCX
sub [hl]
@@ -112,16 +112,16 @@ Func_1f408: ; 0x1f408
ld a, [wSlowpokeAnimationFrame]
ld e, a
ld d, $0
- ld hl, OAMIds_1f425
+ ld hl, SlowpokeOAMIds
add hl, de
ld a, [hl]
call LoadOAMData
ret
-OAMIds_1f425:
+SlowpokeOAMIds:
db $E2, $E3, $E4
-Func_1f428: ; 0x1f428
+DrawCloyster: ; 0x1f428
ld a, $70
ld hl, hSCX
sub [hl]
@@ -133,13 +133,13 @@ Func_1f428: ; 0x1f428
ld a, [wCloysterAnimationFrame]
ld e, a
ld d, $0
- ld hl, OAMIds_1f445
+ ld hl, CloysterOAMIds
add hl, de
ld a, [hl]
call LoadOAMData
ret
-OAMIds_1f445:
+CloysterOAMIds:
db $E5, $E6, $E7
DrawPikachuSavers_BlueStage: ; 0x1f448
@@ -188,7 +188,7 @@ PikachuSaverOAMOffsets_BlueStage:
dw $7E0F
dw $7E92
-Func_1f48f: ; 0x1f48f
+DrawEvolutionIndicatorArrows_BlueFieldTop: ; 0x1f48f
ld a, [wd551]
and a
ret nz
@@ -196,11 +196,11 @@ Func_1f48f: ; 0x1f48f
bit 4, a
ret z
ld de, wIndicatorStates + 5
- ld hl, OAMDataTable_1f4ce
+ ld hl, EvolutionIndicatorArrowsOAM_BlueFieldTop
ld b, $6
- jr asm_1f4b5
+ jr DrawEvolutionIndicatorArrows_BlueField
-Func_1f4a3: ; 0x1f4a3
+DrawEvolutionIndicatorArrows_BlueFieldBottom: ; 0x1f4a3
ld a, [wd551]
and a
ret nz
@@ -208,9 +208,9 @@ Func_1f4a3: ; 0x1f4a3
bit 4, a
ret z
ld de, wIndicatorStates + 11
- ld hl, OAMDataTable_1f4e0
+ ld hl, EvolutionIndicatorArrowsOAM_BlueFieldBottom
ld b, $8
-asm_1f4b5:
+DrawEvolutionIndicatorArrows_BlueField:
push bc
ld a, [hSCX]
ld b, a
@@ -229,10 +229,10 @@ asm_1f4b5:
pop bc
inc de
dec b
- jr nz, asm_1f4b5
+ jr nz, DrawEvolutionIndicatorArrows_BlueField
ret
-OAMDataTable_1f4ce: ; 0x1f4ce
+EvolutionIndicatorArrowsOAM_BlueFieldTop: ; 0x1f4ce
; Each entry is:
; [OAM x/y Offsets],[OAM Id]
db $0D, $37
@@ -253,7 +253,7 @@ OAMDataTable_1f4ce: ; 0x1f4ce
db $61, $64
db $F0
-OAMDataTable_1f4e0: ; 0x1f4e0
+EvolutionIndicatorArrowsOAM_BlueFieldBottom: ; 0x1f4e0
; Each entry is 3 bytes:
; [OAM x/y Offsets],[OAM Id]
db $2D, $13
@@ -280,25 +280,25 @@ OAMDataTable_1f4e0: ; 0x1f4e0
db $89, $40
db $37
-Func_1f4f8: ; 0x1f4f8
+DrawEvolutionTrinket_BlueFieldTop: ; 0x1f4f8
ld a, [wd551]
and a
ret z
ld de, wd566
- ld hl, OAMOffsetsTable_1f53a
+ ld hl, EvolutionTrinketOAMOffsets_BlueFieldTop
ld b, $c
ld c, $47
- jr asm_1f518
+ jr DrawEvolutionTrinket_BlueField
-Func_1f509: ; 0x1f509
+DrawEvolutionTrinket_BlueFieldBottom: ; 0x1f509
ld a, [wd551]
and a
ret z
ld de, wd572
- ld hl, OAMOffsetsTable_1f552
+ ld hl, EvolutionTrinketOAMOffsets_BlueFieldBottom
ld b, $6
ld c, $40
-asm_1f518: ; 0x1f518
+DrawEvolutionTrinket_BlueField: ; 0x1f518
push bc
ld a, [de]
add c
@@ -324,10 +324,10 @@ asm_1f518: ; 0x1f518
pop bc
inc de
dec b
- jr nz, asm_1f518
+ jr nz, DrawEvolutionTrinket_BlueField
ret
-OAMOffsetsTable_1f53a: ; 0x1f53a
+EvolutionTrinketOAMOffsets_BlueFieldTop: ; 0x1f53a
; OAM data x, y offsets
db $4C, $08
db $2B, $12
@@ -342,7 +342,7 @@ OAMOffsetsTable_1f53a: ; 0x1f53a
db $61, $7F
db $8D, $65
-OAMOffsetsTable_1f552: ; 0x1f552
+EvolutionTrinketOAMOffsets_BlueFieldBottom: ; 0x1f552
; OAM data x, y offsets
db $3B, $12
db $5D, $12
diff --git a/engine/pinball_game/draw_sprites/draw_pinball.asm b/engine/pinball_game/draw_sprites/draw_pinball.asm
new file mode 100755
index 0000000..15adcab
--- /dev/null
+++ b/engine/pinball_game/draw_sprites/draw_pinball.asm
@@ -0,0 +1,62 @@
+DrawPinball: ; 0x17e81
+ ld a, [wPinballIsVisible]
+ and a
+ ret z
+ ld hl, wBallSpin
+ ld a, [wBallRotation]
+ add [hl]
+ ld [wBallRotation], a
+ ld a, [wBallXPos + 1]
+ inc a
+ ld hl, hSCX
+ sub [hl]
+ ld b, a
+ ld a, [wBallYPos + 1]
+ inc a
+ sub $10
+ ld hl, hSCY
+ sub [hl]
+ ld c, a
+ ld a, [wBallRotation]
+ srl a
+ srl a
+ srl a ; divide wBallRotation by 8 because
+ srl a ; there are 8 frames of the ball spinning
+ and $7
+ add $0
+ call LoadOAMData
+ ld a, [hGameBoyColorFlag]
+ and a
+ ret nz
+ ld a, [hGameBoyColorFlag]
+ and a
+ ret nz
+ ld a, [hSGBFlag]
+ and a
+ ret nz
+ ld a, [wd4c5]
+ inc a
+ ld hl, hSCX
+ sub [hl]
+ ld b, a
+ ld a, [wd4c6]
+ inc a
+ sub $10
+ ld hl, hSCY
+ sub [hl]
+ ld c, a
+ ld a, [wd4c7]
+ srl a
+ srl a
+ srl a
+ srl a
+ and $7
+ add $0
+ call LoadOAMData
+ ld a, [wBallXPos + 1]
+ ld [wd4c5], a
+ ld a, [wBallYPos + 1]
+ ld [wd4c6], a
+ ld a, [wBallRotation]
+ ld [wd4c7], a
+ ret
diff --git a/engine/pinball_game/draw_sprites/draw_red_field_sprites.asm b/engine/pinball_game/draw_sprites/draw_red_field_sprites.asm
index d89ca91..2ddf83a 100644
--- a/engine/pinball_game/draw_sprites/draw_red_field_sprites.asm
+++ b/engine/pinball_game/draw_sprites/draw_red_field_sprites.asm
@@ -2,14 +2,14 @@ DrawSpritesRedFieldTop: ; 0x1755c
ld bc, $7f00
call DrawTimer
call DrawVoltorbSprites
- call Func_17d34
- call Func_17d59
- call Func_17d7a
- call Func_17d92
- call Func_17de1
+ call DrawDitto
+ call DrawBellsproutHead
+ call DrawBellsproutBody
+ call DrawStaryu
+ call DrawSpinner_RedField
call DrawPinball
- call Func_17efb
- call Func_17f64
+ call DrawEvolutionIndicatorArrows_RedFieldTop
+ call DrawEvolutionTrinket_RedFieldTop
ret
DrawSpritesRedFieldBottom: ; 0x1757e
@@ -20,187 +20,13 @@ DrawSpritesRedFieldBottom: ; 0x1757e
call DrawPikachuSavers_RedStage
callba DrawFlippers
call DrawPinball
- call Func_17f0f
- call Func_17f75
+ call DrawEvolutionIndicatorArrows_RedFieldBottom
+ call DrawEvolutionTrinket_RedFieldBottom
call DrawSlotGlow_RedField
ret
-DrawTimer: ; 0x175a4
- ld a, [wTimerActive]
- and a
- ret z
- ld a, [hGameBoyColorFlag]
- and a
- jr nz, DrawTimer_GameBoyColor
- ld a, [wd580]
- and a
- ret z
- ld a, [wd581]
- and a
- jr z, .DrawTimer_GameBoy
- dec a
- ld [wd581], a
- ret
-
-.DrawTimer_GameBoy
- call Func_1762f
- ld hl, wTimerDigits
- ld a, [wTimerMinutes]
- and $f
- call LoadTimerDigitTiles
- ld a, [wTimerSeconds]
- swap a
- and $f
- call LoadTimerDigitTiles
- ld a, [wTimerSeconds]
- and $f
- call LoadTimerDigitTiles
- ld d, $0
- ld hl, TimerOAMIds
- add hl, de
- ld a, [hli]
- call DrawTimerDigit
- ld a, [hli]
- call DrawTimerDigit
- ld a, [hli]
- call DrawTimerDigit
- ld a, [hli]
- call DrawTimerDigit
- ret
-
-DrawTimer_GameBoyColor: ; 0x175f5
-; Loads the OAM data for the timer in the top-right corner of the screen.
- ld a, [wTimerMinutes]
- and $f
- call DrawTimerDigit_GameBoyColor
- ld a, $a ; colon
- call DrawTimerDigit_GameBoyColor
- ld a, [wTimerSeconds]
- swap a
- and $f
- call DrawTimerDigit_GameBoyColor ; tens digit of the minutes
- ld a, [wTimerSeconds]
- and $f
- call DrawTimerDigit_GameBoyColor ; ones digit of the minutes
- ret
-
-TimerOAMIds:
- db $d7, $da, $d8, $d9
- db $dc, $df, $dd, $de
- db $dc, $db, $dd, $de
- db $f5, $f8, $f6, $f7
-
-DrawTimerDigit_GameBoyColor: ; 0x17625
- add $b1 ; the timer digits' OAM ids start at $b1
-DrawTimerDigit: ; 0x17627
- call LoadOAMData
- ld a, b
- add $8
- ld b, a
- ret
-
-Func_1762f: ; 0x1762f
- lb de, $60, $0c
- ld a, [wCurrentStage]
- cp FIRST_BONUS_STAGE
- ret nc
- lb de, $00, $00
- bit 0, a
- ret z
- lb de, $30, $04
- ld a, [wInSpecialMode]
- and a
- ret z
- ld a, [wSpecialMode]
- and a
- ret nz
- lb de, $30, $08
- ret
-
-LoadTimerDigitTiles: ; 0x1764f
- push bc
- push de
- cp [hl]
- jr z, .skip
- push af
- push hl
- add d
- call Func_17665
- pop hl
- pop af
- ld [hl], a
-.skip
- inc hl
- pop de
- ld a, d
- add $10
- ld d, a
- pop bc
- ret
-
-Func_17665: ; 0x17665
- ld c, a
- ld b, $0
- sla c
- rl b
- ld hl, TimerDigitsTileData
- add hl, bc
- ld a, [hli]
- ld h, [hl]
- ld l, a
- ld a, Bank(TimerDigitsTileData)
- call QueueGraphicsToLoad
- ret
-
-INCLUDE "data/timer_digits_tiledata.asm"
-
-DrawMonCaptureAnimation: ; 0x17c67
- ld a, [wCapturingMon]
- and a
- ret z
- ld a, $50
- ld hl, hSCX
- sub [hl]
- ld b, a
- ld a, $38
- ld hl, hSCY
- sub [hl]
- ld c, a
- ld a, [wBallCaptureAnimationFrame]
- ld e, a
- ld d, $0
- ld hl, BallCaptureAnimationOAMIds
- add hl, de
- ld a, [hl]
- call LoadOAMData
- ret
-
-BallCaptureAnimationOAMIds:
- db $19, $1A, $1B, $1C, $1D, $1E, $1F, $20, $21, $22, $23, $24, $25
-
-DrawAnimatedMon_RedStage: ; 0x17c96
- ld a, [wWildMonIsHittable]
- and a
- ret z
- ld a, $50
- ld hl, hSCX
- sub [hl]
- ld b, a
- ld a, $3e
- ld hl, hSCY
- sub [hl]
- ld c, a
- ld a, [wCurrentAnimatedMonSpriteFrame]
- ld e, a
- ld d, $0
- ld hl, AnimatedMonOAMIds_RedStage
- add hl, de
- ld a, [hl]
- call LoadOAMData
- ret
-
-AnimatedMonOAMIds_RedStage:
- db $26, $27, $28, $29, $2A, $2B, $2C, $2D, $2E, $2F, $30, $31
+INCLUDE "engine/pinball_game/draw_sprites/draw_timer.asm"
+INCLUDE "engine/pinball_game/draw_sprites/draw_wild_mon.asm"
DrawVoltorbSprites: ; 0x17cc4
ld de, wVoltorb1Animation
@@ -281,7 +107,7 @@ AnimationData_17d27:
db $02, $02
db $00 ; terminator
-Func_17d34: ; 0x17d34
+DrawDitto: ; 0x17d34
ld a, $0
ld hl, hSCX
sub [hl]
@@ -309,7 +135,7 @@ OAMIds_17d51:
db $CA
db $CA
-Func_17d59: ; 0x17d59
+DrawBellsproutHead: ; 0x17d59
ld a, $74
ld hl, hSCX
sub [hl]
@@ -321,19 +147,19 @@ Func_17d59: ; 0x17d59
ld a, [wBellsproutAnimationFrame]
ld e, a
ld d, $0
- ld hl, BellsproutAnimationOAMIds
+ ld hl, BellsproutHeadAnimationOAMIds
add hl, de
ld a, [hl]
call LoadOAMData
ret
-BellsproutAnimationOAMIds: ; 0x17d76
+BellsproutHeadAnimationOAMIds: ; 0x17d76
db $BE
db $BF
db $C0
db $C1
-Func_17d7a: ; 0x17d7a
+DrawBellsproutBody: ; 0x17d7a
ld a, [hGameBoyColorFlag]
and a
ret z
@@ -349,7 +175,7 @@ Func_17d7a: ; 0x17d7a
call LoadOAMData
ret
-Func_17d92: ; 0x17d92
+DrawStaryu: ; 0x17d92
ld a, [hGameBoyColorFlag]
and a
ret z
@@ -398,7 +224,7 @@ AnimationData_17dd0:
db $13, $01
db $0 ; terminator
-Func_17de1: ; 0x17de1
+DrawSpinner_RedField: ; 0x17de1
ld a, $88
ld hl, hSCX
sub [hl]
@@ -412,19 +238,14 @@ Func_17de1: ; 0x17de1
srl a
ld e, a
ld d, $0
- ld hl, OAMIds_17e02
+ ld hl, SpinnerOAMIds_RedField
add hl, de
ld a, [hl]
call LoadOAMData
ret
-OAMIds_17e02: ; 0x17e02
- db $C2
- db $C3
- db $C4
- db $C5
- db $C6
- db $C7
+SpinnerOAMIds_RedField: ; 0x17e02
+ db $C2, $C3, $C4, $C5, $C6, $C7
DrawPikachuSavers_RedStage: ; 0x17e08
ld a, [hSCX]
@@ -511,70 +332,9 @@ Func_17e5e: ; 0x17e5e
call nz, LoadOAMData
jr .asm_17e64
-DrawPinball: ; 0x17e81
- ld a, [wPinballIsVisible]
- and a
- ret z
- ld hl, wBallSpin
- ld a, [wBallRotation]
- add [hl]
- ld [wBallRotation], a
- ld a, [wBallXPos + 1]
- inc a
- ld hl, hSCX
- sub [hl]
- ld b, a
- ld a, [wBallYPos + 1]
- inc a
- sub $10
- ld hl, hSCY
- sub [hl]
- ld c, a
- ld a, [wBallRotation]
- srl a
- srl a
- srl a ; divide wBallRotation by 8 because
- srl a ; there are 8 frames of the ball spinning
- and $7
- add $0
- call LoadOAMData
- ld a, [hGameBoyColorFlag]
- and a
- ret nz
- ld a, [hGameBoyColorFlag]
- and a
- ret nz
- ld a, [hSGBFlag]
- and a
- ret nz
- ld a, [wd4c5]
- inc a
- ld hl, hSCX
- sub [hl]
- ld b, a
- ld a, [wd4c6]
- inc a
- sub $10
- ld hl, hSCY
- sub [hl]
- ld c, a
- ld a, [wd4c7]
- srl a
- srl a
- srl a
- srl a
- and $7
- add $0
- call LoadOAMData
- ld a, [wBallXPos + 1]
- ld [wd4c5], a
- ld a, [wBallYPos + 1]
- ld [wd4c6], a
- ld a, [wBallRotation]
- ld [wd4c7], a
- ret
+INCLUDE "engine/pinball_game/draw_sprites/draw_pinball.asm"
-Func_17efb: ; 0x17efb
+DrawEvolutionIndicatorArrows_RedFieldTop: ; 0x17efb
ld a, [wd551]
and a
ret nz
@@ -582,11 +342,11 @@ Func_17efb: ; 0x17efb
bit 4, a
ret z
ld de, wIndicatorStates + 5
- ld hl, OAMData_17f3a
+ ld hl, EvolutionIndicatorArrowsOAM_RedFieldTop
ld b, $6
- jr asm_17f21
+ jr DrawEvolutionIndicatorArrows_RedField
-Func_17f0f: ; 0x17f0f
+DrawEvolutionIndicatorArrows_RedFieldBottom: ; 0x17f0f
ld a, [wd551]
and a
ret nz
@@ -594,9 +354,9 @@ Func_17f0f: ; 0x17f0f
bit 4, a
ret z
ld de, wIndicatorStates + 11
- ld hl, OAMData_17f4c
+ ld hl, EvolutionIndicatorArrowsOAM_RedFieldBottom
ld b, $8
-asm_17f21: ; 0x17f21
+DrawEvolutionIndicatorArrows_RedField: ; 0x17f21
push bc
ld a, [hSCX]
ld b, a
@@ -615,10 +375,10 @@ asm_17f21: ; 0x17f21
pop bc
inc de
dec b
- jr nz, asm_17f21
+ jr nz, DrawEvolutionIndicatorArrows_RedField
ret
-OAMData_17f3a:
+EvolutionIndicatorArrowsOAM_RedFieldTop:
db $0D, $37 ; x, y offsets
db $D1 ; oam id
@@ -637,7 +397,7 @@ OAMData_17f3a:
db $73, $74 ; x, y offsets
db $D4 ; oam id
-OAMData_17f4c:
+EvolutionIndicatorArrowsOAM_RedFieldBottom:
db $2D, $13 ; x, y offsets
db $32 ; oam id
@@ -662,25 +422,25 @@ OAMData_17f4c:
db $89, $40 ; x, y offsets
db $37 ; oam id
-Func_17f64: ; 0x17f64
+DrawEvolutionTrinket_RedFieldTop: ; 0x17f64
ld a, [wd551]
and a
ret z
ld de, wd566
- ld hl, OAMOffsets_17fa6
+ ld hl, EvolutionTrinketOAMOffsets_RedFieldTop
ld b, $c
ld c, $39
- jr asm_17f84
+ jr DrawEvolutionTrinket_RedField
-Func_17f75: ; 0x17f75
+DrawEvolutionTrinket_RedFieldBottom: ; 0x17f75
ld a, [wd551]
and a
ret z
ld de, wd572
- ld hl, OAMOffsets_17fbe
+ ld hl, EvolutionTrinketOAMOffsets_RedFieldBottom
ld b, $6
ld c, $40
-asm_17f84: ; 0x17f84
+DrawEvolutionTrinket_RedField: ; 0x17f84
push bc
ld a, [de]
add c
@@ -706,10 +466,10 @@ asm_17f84: ; 0x17f84
pop bc
inc de
dec b
- jr nz, asm_17f84
+ jr nz, DrawEvolutionTrinket_RedField
ret
-OAMOffsets_17fa6:
+EvolutionTrinketOAMOffsets_RedFieldTop:
; x, y offsets
db $4C, $0C
db $32, $12
@@ -724,7 +484,7 @@ OAMOffsets_17fa6:
db $59, $7A
db $71, $7A
-OAMOffsets_17fbe:
+EvolutionTrinketOAMOffsets_RedFieldBottom
; x, y offsets
db $3D, $13
db $5B, $13
diff --git a/engine/pinball_game/draw_sprites/draw_timer.asm b/engine/pinball_game/draw_sprites/draw_timer.asm
new file mode 100755
index 0000000..e360294
--- /dev/null
+++ b/engine/pinball_game/draw_sprites/draw_timer.asm
@@ -0,0 +1,128 @@
+DrawTimer: ; 0x175a4
+ ld a, [wTimerActive]
+ and a
+ ret z
+ ld a, [hGameBoyColorFlag]
+ and a
+ jr nz, DrawTimer_GameBoyColor
+ ld a, [wd580]
+ and a
+ ret z
+ ld a, [wd581]
+ and a
+ jr z, .DrawTimer_GameBoy
+ dec a
+ ld [wd581], a
+ ret
+
+.DrawTimer_GameBoy
+ call Func_1762f
+ ld hl, wTimerDigits
+ ld a, [wTimerMinutes]
+ and $f
+ call LoadTimerDigitTiles
+ ld a, [wTimerSeconds]
+ swap a
+ and $f
+ call LoadTimerDigitTiles
+ ld a, [wTimerSeconds]
+ and $f
+ call LoadTimerDigitTiles
+ ld d, $0
+ ld hl, TimerOAMIds
+ add hl, de
+ ld a, [hli]
+ call DrawTimerDigit
+ ld a, [hli]
+ call DrawTimerDigit
+ ld a, [hli]
+ call DrawTimerDigit
+ ld a, [hli]
+ call DrawTimerDigit
+ ret
+
+DrawTimer_GameBoyColor: ; 0x175f5
+; Loads the OAM data for the timer in the top-right corner of the screen.
+ ld a, [wTimerMinutes]
+ and $f
+ call DrawTimerDigit_GameBoyColor
+ ld a, $a ; colon
+ call DrawTimerDigit_GameBoyColor
+ ld a, [wTimerSeconds]
+ swap a
+ and $f
+ call DrawTimerDigit_GameBoyColor ; tens digit of the minutes
+ ld a, [wTimerSeconds]
+ and $f
+ call DrawTimerDigit_GameBoyColor ; ones digit of the minutes
+ ret
+
+TimerOAMIds:
+ db $d7, $da, $d8, $d9
+ db $dc, $df, $dd, $de
+ db $dc, $db, $dd, $de
+ db $f5, $f8, $f6, $f7
+
+DrawTimerDigit_GameBoyColor: ; 0x17625
+ add $b1 ; the timer digits' OAM ids start at $b1
+DrawTimerDigit: ; 0x17627
+ call LoadOAMData
+ ld a, b
+ add $8
+ ld b, a
+ ret
+
+Func_1762f: ; 0x1762f
+ lb de, $60, $0c
+ ld a, [wCurrentStage]
+ cp FIRST_BONUS_STAGE
+ ret nc
+ lb de, $00, $00
+ bit 0, a
+ ret z
+ lb de, $30, $04
+ ld a, [wInSpecialMode]
+ and a
+ ret z
+ ld a, [wSpecialMode]
+ and a
+ ret nz
+ lb de, $30, $08
+ ret
+
+LoadTimerDigitTiles: ; 0x1764f
+ push bc
+ push de
+ cp [hl]
+ jr z, .skip
+ push af
+ push hl
+ add d
+ call Func_17665
+ pop hl
+ pop af
+ ld [hl], a
+.skip
+ inc hl
+ pop de
+ ld a, d
+ add $10
+ ld d, a
+ pop bc
+ ret
+
+Func_17665: ; 0x17665
+ ld c, a
+ ld b, $0
+ sla c
+ rl b
+ ld hl, TimerDigitsTileData
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, Bank(TimerDigitsTileData)
+ call QueueGraphicsToLoad
+ ret
+
+INCLUDE "data/timer_digits_tiledata.asm"
diff --git a/engine/pinball_game/draw_sprites/draw_wild_mon.asm b/engine/pinball_game/draw_sprites/draw_wild_mon.asm
new file mode 100755
index 0000000..bbcf088
--- /dev/null
+++ b/engine/pinball_game/draw_sprites/draw_wild_mon.asm
@@ -0,0 +1,47 @@
+DrawMonCaptureAnimation: ; 0x17c67
+ ld a, [wCapturingMon]
+ and a
+ ret z
+ ld a, $50
+ ld hl, hSCX
+ sub [hl]
+ ld b, a
+ ld a, $38
+ ld hl, hSCY
+ sub [hl]
+ ld c, a
+ ld a, [wBallCaptureAnimationFrame]
+ ld e, a
+ ld d, $0
+ ld hl, BallCaptureAnimationOAMIds
+ add hl, de
+ ld a, [hl]
+ call LoadOAMData
+ ret
+
+BallCaptureAnimationOAMIds:
+ db $19, $1A, $1B, $1C, $1D, $1E, $1F, $20, $21, $22, $23, $24, $25
+
+DrawAnimatedMon_RedStage: ; 0x17c96
+ ld a, [wWildMonIsHittable]
+ and a
+ ret z
+ ld a, $50
+ ld hl, hSCX
+ sub [hl]
+ ld b, a
+ ld a, $3e
+ ld hl, hSCY
+ sub [hl]
+ ld c, a
+ ld a, [wCurrentAnimatedMonSpriteFrame]
+ ld e, a
+ ld d, $0
+ ld hl, AnimatedMonOAMIds_RedStage
+ add hl, de
+ ld a, [hl]
+ call LoadOAMData
+ ret
+
+AnimatedMonOAMIds_RedStage:
+ db $26, $27, $28, $29, $2A, $2B, $2C, $2D, $2E, $2F, $30, $31
diff --git a/engine/pinball_game/evolution_mode.asm b/engine/pinball_game/evolution_mode.asm
index 08fb05b..705bcd8 100755
--- a/engine/pinball_game/evolution_mode.asm
+++ b/engine/pinball_game/evolution_mode.asm
@@ -366,7 +366,7 @@ SelectPokemonToEvolve: ; 0x10cb7
ld [wInSpecialMode], a
ld [wSpecialMode], a
xor a
- ld [wd54d], a
+ ld [wSpecialModeState], a
ld a, [wCurSelectedPartyMon]
ld c, a
ld b, $0
diff --git a/engine/pinball_game/evolution_mode/evolution_mode_blue_field.asm b/engine/pinball_game/evolution_mode/evolution_mode_blue_field.asm
index 1563e7d..7c19ff1 100644
--- a/engine/pinball_game/evolution_mode/evolution_mode_blue_field.asm
+++ b/engine/pinball_game/evolution_mode/evolution_mode_blue_field.asm
@@ -31,7 +31,7 @@ HandleBlueEvoModeCollision: ; 0x20bae
.asm_20bf3
call Func_20da0
- ld a, [wd54d]
+ ld a, [wSpecialModeState]
call CallInFollowingTable
PointerTable_20bfc: ; 0x20bfc
padded_dab Func_20c08
@@ -229,7 +229,7 @@ Func_20da0: ; 0x20da0
xor a
ld [wTimeRanOut], a
ld a, $2
- ld [wd54d], a
+ ld [wSpecialModeState], a
xor a
ld [wSlotIsOpen], a
ld hl, wIndicatorStates
@@ -724,6 +724,6 @@ Func_2112a: ; 0x2112a
callba ShowJackpotText
call MainLoopUntilTextIsClear
ld a, $1
- ld [wd54d], a
+ ld [wSpecialModeState], a
scf
ret
diff --git a/engine/pinball_game/evolution_mode/evolution_mode_red_field.asm b/engine/pinball_game/evolution_mode/evolution_mode_red_field.asm
index 8be3abe..30794e0 100644
--- a/engine/pinball_game/evolution_mode/evolution_mode_red_field.asm
+++ b/engine/pinball_game/evolution_mode/evolution_mode_red_field.asm
@@ -33,7 +33,7 @@ HandleRedEvoModeCollision: ; 0x20581
.asm_205cb
call Func_2077b
- ld a, [wd54d]
+ ld a, [wSpecialModeState]
call CallInFollowingTable
PointerTable_205d4: ; 0x205d4
padded_dab Func_205e0
@@ -232,7 +232,7 @@ Func_2077b: ; 0x2077b
xor a
ld [wTimeRanOut], a
ld a, $2
- ld [wd54d], a
+ ld [wSpecialModeState], a
xor a
ld [wSlotIsOpen], a
ld hl, wIndicatorStates
@@ -726,6 +726,6 @@ Func_20b02: ; 0x20b02
callba ShowJackpotText
call MainLoopUntilTextIsClear
ld a, $1
- ld [wd54d], a
+ ld [wSpecialModeState], a
scf
ret
diff --git a/engine/pinball_game/load_stage_data/load_blue_field.asm b/engine/pinball_game/load_stage_data/load_blue_field.asm
index a2b8bc9..8109d6a 100644
--- a/engine/pinball_game/load_stage_data/load_blue_field.asm
+++ b/engine/pinball_game/load_stage_data/load_blue_field.asm
@@ -456,7 +456,7 @@ Func_1c4b6: ; 0x1c4b6
ld a, [wSpecialMode]
cp SPECIAL_MODE_MAP_MOVE
ret nz
- ld a, [wd54d]
+ ld a, [wSpecialModeState]
cp $3
jr nz, .asm_1c508
callba LoadMapBillboardTileData
diff --git a/engine/pinball_game/load_stage_data/load_red_field.asm b/engine/pinball_game/load_stage_data/load_red_field.asm
index 5252602..a7c606e 100644
--- a/engine/pinball_game/load_stage_data/load_red_field.asm
+++ b/engine/pinball_game/load_stage_data/load_red_field.asm
@@ -462,7 +462,7 @@ Func_14377: ; 0x14377
ld a, [wSpecialMode]
cp SPECIAL_MODE_MAP_MOVE
ret nz
- ld a, [wd54d]
+ ld a, [wSpecialModeState]
cp $3
jr nz, .asm_143c9
callba LoadMapBillboardTileData
diff --git a/engine/pinball_game/map_move.asm b/engine/pinball_game/map_move.asm
index 37f7f42..8e08960 100755
--- a/engine/pinball_game/map_move.asm
+++ b/engine/pinball_game/map_move.asm
@@ -18,7 +18,7 @@ StartMapMoveMode: ; 0x301ec
ld a, SPECIAL_MODE_MAP_MOVE
ld [wSpecialMode], a
xor a
- ld [wd54d], a
+ ld [wSpecialModeState], a
ld bc, $0030 ; 30 seconds
callba StartTimer
ld a, [wCurrentStage]
@@ -38,7 +38,7 @@ CallTable_3021f: ; 0x3021f
dw Func_31326 ; STAGE_BLUE_FIELD_TOP
dw Func_31326 ; STAGE_BLUE_FIELD_BOTTOM
-Func_3022b: ; 0x3022b
+ConcludeMapMoveMode: ; 0x3022b
xor a
ld [wBottomTextEnabled], a ;turn text off
call FillBottomMessageBufferWithBlackTile ;clear text
@@ -447,7 +447,7 @@ HandleRedMapModeCollision: ; 0x314ae
.asm_314d6
call UpdateMapMove_RedField
- ld a, [wd54d]
+ ld a, [wSpecialModeState]
call CallInFollowingTable
PointerTable_314df: ; 0xd13df
padded_dab Func_314ef
@@ -464,7 +464,7 @@ Func_314f1: ; 0x314f1
ret
Func_314f3: ; 0x314f3
- callba Func_3022b
+ callba ConcludeMapMoveMode
ld de, MUSIC_BLUE_FIELD ; Either MUSIC_BLUE_FIELD or MUSIC_RED_FIELD. They have the same id in their respective audio Banks.
call PlaySong
scf
@@ -475,7 +475,7 @@ Func_31505: ; 0x31505
and a
ret nz
call FillBottomMessageBufferWithBlackTile
- callba Func_3022b
+ callba ConcludeMapMoveMode
ld de, MUSIC_BLUE_FIELD ; Either MUSIC_BLUE_FIELD or MUSIC_RED_FIELD. They have the same id in their respective audio Banks.
call PlaySong
scf
@@ -492,7 +492,7 @@ UpdateMapMove_RedField: ; 0x3151f handle map move timer and fail when it expires
xor a
ld [wTimeRanOut], a
ld a, $3
- ld [wd54d], a
+ ld [wSpecialModeState], a
xor a
ld [wSlotIsOpen], a ;close slot and indicators
ld [wIndicatorStates], a
@@ -529,7 +529,7 @@ OpenRedMapMoveSlotFromLeft: ; 0x31591
ld [wIndicatorStates + 4], a
ld a, $1
ld [wSlotIsOpen], a
- ld [wd54d], a
+ ld [wSpecialModeState], a
.NotApplicibleOrCompleted
scf
ret
@@ -548,7 +548,7 @@ OpenRedMapMoveSlotFromRight: ; 0x315b3
ld [wIndicatorStates + 4], a
ld a, $1
ld [wSlotIsOpen], a
- ld [wd54d], a
+ ld [wSpecialModeState], a
.NotApplicibleOrCompleted
scf
ret
@@ -570,7 +570,7 @@ ResolveSucsessfulRedMapMove: ; 0x315d5
and a
jr nz, .asm_31603
ld a, $2
- ld [wd54d], a
+ ld [wSpecialModeState], a
scf
ret
@@ -597,7 +597,7 @@ HandleBlueMapModeCollision: ; 0x3161b
.asm_31643
call UpdateMapMove_BlueField
- ld a, [wd54d]
+ ld a, [wSpecialModeState]
call CallInFollowingTable
PointerTable_3164c: ; 0x3164c
padded_dab Func_3165c
@@ -614,7 +614,7 @@ Func_3165e: ; 0x3165e
ret
Func_31660: ; 0x31660
- callba Func_3022b
+ callba ConcludeMapMoveMode
ld de, MUSIC_BLUE_FIELD ; Either MUSIC_BLUE_FIELD or MUSIC_RED_FIELD. They have the same id in their respective audio Banks.
call PlaySong
scf
@@ -625,7 +625,7 @@ Func_31672: ; 0x31672
and a
ret nz
call FillBottomMessageBufferWithBlackTile
- callba Func_3022b
+ callba ConcludeMapMoveMode
ld de, MUSIC_BLUE_FIELD ; Either MUSIC_BLUE_FIELD or MUSIC_RED_FIELD. They have the same id in their respective audio Banks.
call PlaySong
scf
@@ -646,7 +646,7 @@ UpdateMapMove_BlueField: ; 0x3168c
xor a
ld [wTimeRanOut], a
ld a, $3
- ld [wd54d], a
+ ld [wSpecialModeState], a
xor a
ld [wSlotIsOpen], a
ld [wIndicatorStates], a
@@ -683,7 +683,7 @@ Func_31708: ; 0x31708
ld [wIndicatorStates + 4], a
ld a, $1
ld [wSlotIsOpen], a
- ld [wd54d], a
+ ld [wSpecialModeState], a
.asm_31728
scf
ret
@@ -702,7 +702,7 @@ Func_3172a: ; 0x3172a
ld [wIndicatorStates + 4], a
ld a, $1
ld [wSlotIsOpen], a
- ld [wd54d], a
+ ld [wSpecialModeState], a
.asm_3174a
scf
ret
@@ -724,6 +724,6 @@ Func_3174c: ; 0x3174c
and a
jr nz, .asm_3177a
ld a, $2
- ld [wd54d], a
+ ld [wSpecialModeState], a
scf
ret
diff --git a/wram.asm b/wram.asm
index e487179..53d1459 100644
--- a/wram.asm
+++ b/wram.asm
@@ -589,7 +589,8 @@ wInSpecialMode:: ; 0xd54b
wSpecialModeCollisionID:: ; 0xd54c 10000 sets it to a input, records what the ball has collided with see constants/special_collision_constants.asm for more info
ds $1
-wd54d:: ; 0xd54d catch mode current step? used for all 3 special modes.
+wSpecialModeState:: ; 0xd54d
+; Tracks the current state of special modes (catchem, evolution, map move)
ds $1
wd54e:: ; 0xd54e set to 20 by catch mode when all tiles are flipped and on lower stage