summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-07-24 11:49:16 -0700
committerGitHub <noreply@github.com>2017-07-24 11:49:16 -0700
commit6fc877414e4973f533a0745ea210747202fc03fd (patch)
tree399c73158700dded5e27af30caea7923ef5aadf7
parent5d4c2f0304cf5a0784ac691f2355708414243471 (diff)
parent42c14b08922c7feae1f492d6f3612b1514f2027b (diff)
Merge pull request #25 from TwitchPlaysPokemon/chaos_requests
Chaos requests
-rw-r--r--engine/pinball_game/catchem_mode.asm106
-rw-r--r--engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm42
-rw-r--r--engine/pinball_game/catchem_mode/catchem_mode_red_field.asm124
-rw-r--r--engine/pinball_game/draw_sprites/draw_blue_field_sprites.asm2
-rw-r--r--engine/pinball_game/draw_sprites/draw_red_field_sprites.asm2
-rwxr-xr-xengine/pinball_game/evolution_mode.asm2
-rw-r--r--engine/pinball_game/evolution_mode/evolution_mode_red_field.asm8
-rw-r--r--engine/pokedex.asm48
-rw-r--r--main.asm2
-rw-r--r--text/scrolling_text.asm2
-rw-r--r--wram.asm48
11 files changed, 185 insertions, 201 deletions
diff --git a/engine/pinball_game/catchem_mode.asm b/engine/pinball_game/catchem_mode.asm
index b24caab..09192f6 100644
--- a/engine/pinball_game/catchem_mode.asm
+++ b/engine/pinball_game/catchem_mode.asm
@@ -55,24 +55,24 @@ StartCatchEmMode: ; 0x1003f
ld l, c
add hl, bc
add hl, bc ; multiply the evolution line id by 3, add it to pointer to ???
- ld bc, Data_13685 ;mystery data
+ ld bc, CatchSpriteFrameDurations ;mystery data, seems pokedex related too
add hl, bc
ld a, [hli]
- ld [wd5c1], a
- ld [wd5be], a
+ ld [wCurrentCatchMonIdleFrame1Duration], a
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
ld a, [hli]
- ld [wd5c2], a
+ ld [wCurrentCatchMonIdleFrame2Duration], a
ld a, [hli]
- ld [wd5c3], a ;load the 3 bytes into ????
+ ld [wCurrentCatchMonHitFrameDuration], a ;load the 3 bytes into ????
ld hl, wBillboardTilesIlluminationStates
- ld a, [wd5b6]
+ ld a, [wNumberOfCatchModeTilesFlipped]
ld c, a
and a
ld b, $18
- jr z, .asm_100c7 ;if ?? = 0, jump with b = 24 (2 seperate loops?
+ jr z, .asm_100c7 ;if tiles flipped = 0, jump with b = 24 (2 seperate loops?)
.asm_100ba
ld a, $1
- ld [hli], a ;load 1 then 0 into data from wd5b6 C times, where C is the contents of wd5b6
+ ld [hli], a ;load 1 then 0 into data from wNumberOfCatchModeTilesFlipped C times, where C is the contents of wNumberOfCatchModeTilesFlipped
xor a
ld [hli], a
dec b
@@ -81,7 +81,7 @@ StartCatchEmMode: ; 0x1003f
ld a, b ;load 24 - times looped into a, if 0: skip
and a
jr z, .asm_100ce
-.asm_100c7 ;loop 0 then 1 into the rest of the data from wd5b6
+.asm_100c7 ;loop 0 then 1 into the rest of the data from wNumberOfCatchModeTilesFlipped
xor a
ld [hli], a
inc a
@@ -165,7 +165,7 @@ ConcludeCatchEmMode: ; 0x10157
ld [wInSpecialMode], a
ld [wWildMonIsHittable], a
ld [wd5c6], a
- ld [wd5b6], a
+ ld [wNumberOfCatchModeTilesFlipped], a
ld [wNumMonHits], a
call ClearWildMonCollisionMask
callba StopTimer
@@ -179,10 +179,10 @@ CallTable_10178: ; 0x10178
dw Func_109fc ; STAGE_BLUE_FIELD_TOP
dw Func_109fc ; STAGE_BLUE_FIELD_BOTTOM
-Func_10184: ; 0x10184
+Func_10184: ; 0x10184 called by what looks like the "hit voltorb and shellder" handllers and after all tiles are flipped, as well as some evo mode stuff
ld a, [wCurrentStage]
bit 0, a
- ret z
+ ret z ;skip if stage has no flippers
ld a, [wCurrentCatchEmMon]
ld c, a
ld b, $0
@@ -190,18 +190,18 @@ Func_10184: ; 0x10184
rl b
add c
ld c, a
- jr nc, .asm_10199
+ jr nc, .NoOverflow
inc b
-.asm_10199
+.NoOverflow ;double current catch em mon
ld hl, MonBillboardPicPointers
add hl, bc
ld a, [hli]
- ld [$ff8c], a
+ ld [$ff8c], a ;load 3 byte billboard pointer into Hram
ld a, [hli]
ld [$ff8d], a
ld a, [hl]
ld [$ff8e], a
- ld hl, MonBillboardPaletteMapPointers
+ ld hl, MonBillboardPaletteMapPointers ;and the PAL pointers
add hl, bc
ld a, [hli]
ld [$ff8f], a
@@ -212,25 +212,25 @@ Func_10184: ; 0x10184
ld de, wc000
ld hl, wBillboardTilesIlluminationStates
ld c, $0
-.asm_101bb
+.Loop24Times
ld a, [hli]
cp [hl]
- ld [hli], a
- jr z, .asm_101d2
- ld b, a
+ ld [hli], a ;load first byte into next and test it gainst the second byte, if it's the same skip
+ jr z, .NextLoop
+ ld b, a ;else store in b
call nz, Func_101d9
ld a, [hGameBoyColorFlag]
and a
- jr z, .asm_101d2
+ jr z, .NextLoop ;skip if DMG
ld a, [wCurrentStage]
bit 0, a
ld a, b
- call nz, Func_10230
-.asm_101d2
+ call nz, Func_10230 ;if lower stage, run ???
+.NextLoop
inc c
ld a, c
- cp $18
- jr nz, .asm_101bb
+ cp $18 ;run 24 times
+ jr nz, .Loop24Times
ret
Func_101d9: ; 0x101d9
@@ -239,13 +239,13 @@ Func_101d9: ; 0x101d9
push de
push af
ld a, $10
- ld [de], a
+ ld [de], a ;load 16 into de
inc de
ld a, $1
- ld [de], a
+ ld [de], a ;1 into de+1
inc de
ld b, $0
- ld hl, Data_102a4
+ ld hl, Data_102a4 ;retrieve ???? c
add hl, bc
ld c, [hl]
sla c
@@ -255,23 +255,23 @@ Func_101d9: ; 0x101d9
sla c
rl b
sla c
- rl b
- ld hl, vTilesSH tile $10
- add hl, bc
+ rl b ;multiply ??? by 16
+ ld hl, vTilesSH tile $10 ;wut
+ add hl, bc ;add ???*16 to wut (8 2 bit pixels?)
ld a, l
ld [de], a
inc de
ld a, h
ld [de], a
- inc de
- ld a, [$ff8c]
+ inc de ;load result in to de
+ ld a, [$ff8c] ;loaded billboard pointer
ld l, a
ld a, [$ff8d]
ld h, a
- add hl, bc
+ add hl, bc ;add ???*16
pop af
and a
- jr nz, .asm_10215
+ jr nz, .asm_10215 ;if a is 0, add $180 (384)
ld bc, $0180
add hl, bc
.asm_10215
@@ -283,14 +283,14 @@ Func_101d9: ; 0x101d9
inc de
ld a, [$ff8e]
ld [de], a
- inc de
+ inc de ;load adjusted pointer into de, then 0
ld a, $0
ld [de], a
inc de
pop bc
push de
xor a
- ld de, Func_11d2
+ ld de, Func_11d2 ;queue graphics load from the adjusted pointer bank 0 using this func
call QueueGraphicsToLoadWithFunc
pop de
pop hl
@@ -306,13 +306,13 @@ Func_10230: ; 0x10230
ld [de], a
inc de
ld [de], a
- inc de
+ inc de ;load 1 into first 2 bytes from DE
ld b, $0
ld hl, Data_102a4
- add hl, bc
+ add hl, bc ;retrieve entry c from ???
ld c, [hl]
sla c
- ld hl, PointerTable_10274
+ ld hl, PointerTable_10274 ;grab billboard BG position(?) pointer entry c, place in de
add hl, bc
ld a, [hli]
ld [de], a
@@ -321,34 +321,34 @@ Func_10230: ; 0x10230
ld [de], a
inc de
srl c
- ld a, [$ff8f]
+ ld a, [$ff8f];load PAL pointer
ld l, a
ld a, [$ff90]
ld h, a
- add hl, bc
+ add hl, bc ;add the value from Data_102a4
pop af
and a
ld a, [$ff91]
- call ReadByteFromBank
- jr nz, .asm_10261
+ call ReadByteFromBank ;fetch pallete data
+ jr nz, .asm_10261 ;
ld a, $5
.asm_10261
- ld [de], a
+ ld [de], a ;if a's initial place is 0, make it 5 into de, else load the PAL bank
inc de
ld a, $0
- ld [de], a
+ ld [de], a ;then load 0
inc de
pop bc
push de
xor a
- ld de, LoadTileListsBank1
+ ld de, LoadTileListsBank1 ;load pal pointer as graphics?
call QueueGraphicsToLoadWithFunc
pop de
pop hl
pop bc
ret
-PointerTable_10274: ; 0x10274
+PointerTable_10274: ; 0x10274 4x6 area? the billboard's position?
dw $9887
dw $9888
dw $9889
@@ -838,14 +838,14 @@ BallCaptureAnimationData: ; 0x105e4
db $00 ; terminator
Func_10611: ; 0x10611
- and a
+ and a ;if a NZ
ret z
- dec a
+ dec a ;dec a
sla a
ld c, a
ld b, $0
ld hl, Data_1062a
- add hl, bc
+ add hl, bc ;load that graphics data and qeue it up
ld a, [hli]
ld c, a
ld a, [hl]
@@ -918,8 +918,8 @@ ShowAnimatedWildMon: ; 0x10678
ld hl, MonAnimatedSpriteTypes
add hl, bc
ld a, [hl]
- ld [wd5bc], a
- ld [wd5bd], a
+ ld [wCurrentAnimatedMonSpriteType], a
+ ld [wCurrentAnimatedMonSpriteFrame], a
ld a, $1
ld [wWildMonIsHittable], a
xor 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 e1fc228..b990c8d 100644
--- a/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm
+++ b/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm
@@ -28,7 +28,7 @@ PointerTable_202e2: ; 0x202e2
padded_dab Func_2048f
Func_20302: ; 0x20302
- ld a, [wd5b6]
+ ld a, [wNumberOfCatchModeTilesFlipped]
cp $18
jr nz, .asm_2031e
ld a, [wCurrentStage]
@@ -86,13 +86,13 @@ Func_20364: ; 0x20364
ret
Func_20394: ; 0x20394
- ld a, [wd5be]
+ ld a, [wLoopsUntilNextCatchSpriteAnimationChange]
dec a
- ld [wd5be], a
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
jr z, .asm_203a7
- ld a, [wd5c4]
+ ld a, [wCatchModeMonUpdateTimer]
inc a
- ld [wd5c4], a
+ ld [wCatchModeMonUpdateTimer], a
and $3
ret nz
.asm_203a7
@@ -101,10 +101,10 @@ Func_20394: ; 0x20394
jp z, .asm_20428
xor a
ld [wBallHitWildMon], a
- ld a, [wd5c3]
- ld [wd5be], a
+ ld a, [wCurrentCatchMonHitFrameDuration]
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
xor a
- ld [wd5c4], a
+ ld [wCatchModeMonUpdateTimer], a
ld a, [wCurrentCatchEmMon]
cp MEW - 1
jr nz, .notMew
@@ -151,12 +151,12 @@ Func_20394: ; 0x20394
jr .asm_2044b
.asm_20428
- ld a, [wd5be]
+ ld a, [wLoopsUntilNextCatchSpriteAnimationChange]
and a
ret nz
- ld a, [wd5bc]
+ ld a, [wCurrentAnimatedMonSpriteType]
ld c, a
- ld a, [wd5bd]
+ ld a, [wCurrentAnimatedMonSpriteFrame]
sub c
cp $1
ld c, $0
@@ -164,16 +164,16 @@ Func_20394: ; 0x20394
ld c, $1
.asm_2043d
ld b, $0
- ld hl, wd5c1
+ ld hl, wCurrentCatchMonIdleFrame1Duration
add hl, bc
ld a, [hl]
- ld [wd5be], a
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
xor a
- ld [wd5c4], a
+ ld [wCatchModeMonUpdateTimer], a
.asm_2044b
- ld a, [wd5bc]
+ ld a, [wCurrentAnimatedMonSpriteType]
add c
- ld [wd5bd], a
+ ld [wCurrentAnimatedMonSpriteFrame], a
scf
ret
@@ -231,7 +231,7 @@ Func_204b3: ; 0x204b3
ret
Func_204f1: ; 0x204f1
- ld a, [wd5b6]
+ ld a, [wNumberOfCatchModeTilesFlipped]
cp $18
jr z, .asm_2055e
sla a
@@ -245,18 +245,18 @@ Func_204f1: ; 0x204f1
ld [hli], a
inc hl
ld a, l
- cp wd5b6 % $100
+ cp wNumberOfCatchModeTilesFlipped % $100
jr z, .asm_2050f
dec d
jr nz, .asm_20503
.asm_2050f
- ld a, [wd5b6]
+ ld a, [wNumberOfCatchModeTilesFlipped]
add $4
cp $18
jr c, .asm_2051a
ld a, $18
.asm_2051a
- ld [wd5b6], a
+ ld [wNumberOfCatchModeTilesFlipped], a
cp $18
jr nz, .asm_20525
xor a
@@ -272,7 +272,7 @@ Func_204f1: ; 0x204f1
call FillBottomMessageBufferWithBlackTile
call EnableBottomText
ld hl, wStationaryText2
- ld de, Data_2a3d
+ ld de, CatchModeTileFlippedScoreStationaryTextHeader
call LoadScoreTextFromStack
pop de
pop bc
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 3e529f2..e0e4f60 100644
--- a/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm
+++ b/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm
@@ -1,7 +1,7 @@
HandleRedCatchEmCollision: ; 0x20000
ld a, [wSpecialModeCollisionID]
cp SPECIAL_COLLISION_VOLTORB
- jp z, Func_20230 ;if collided with voltorb
+ jp z, HandleCatchModeVoltorbHit ;if collided with voltorb
cp SPECIAL_COLLISION_SPINNER
jp z, Func_202a8
cp SPECIAL_COLLISION_BELLSPROUT
@@ -20,25 +20,25 @@ PointerTable_20021: ; 0x20021
padded_dab Func_2005f
padded_dab Func_2006b
padded_dab Func_200a3
- padded_dab Func_200d3
+ padded_dab CatchEmModeUpdateMonStateRedTable
padded_dab Func_20193
padded_dab CapturePokemonRedStage
padded_dab Func_201ce
Func_20041: ; 0x20041
- ld a, [wd5b6]
- cp $18
- jr nz, .asm_2005d
+ ld a, [wNumberOfCatchModeTilesFlipped]
+ cp $18 ;if not 24 and not on lower stage, ret
+ jr nz, .NotDone
ld a, [wCurrentStage]
bit 0, a
- jr z, .asm_2005d
+ jr z, .NotDone
ld hl, wd54d
- inc [hl]
+ inc [hl] ;else progress catch em mode
ld a, $14
ld [wd54e], a
ld a, $5
ld [wd54f], a
-.asm_2005d
+.NotDone
scf
ret
@@ -83,40 +83,40 @@ Func_200a3: ; 0x200a3
scf
ret
-Func_200d3: ; 0x200d3
- ld a, [wd5be]
+CatchEmModeUpdateMonStateRedTable: ; 0x200d3
+ ld a, [wLoopsUntilNextCatchSpriteAnimationChange] ;dec time until next animation change, if zero jump
dec a
- ld [wd5be], a
- jr z, .asm_200e6
- ld a, [wd5c4]
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
+ jr z, .ChangeAnimation
+ ld a, [wCatchModeMonUpdateTimer] ;load ??? and inc it
inc a
- ld [wd5c4], a
+ ld [wCatchModeMonUpdateTimer], a
and $3
- ret nz
-.asm_200e6
+ ret nz ;only continue every 4 loops?
+.ChangeAnimation
ld a, [wBallHitWildMon]
and a
- jp z, .asm_20167
+ jp z, .BallDidntHitMon ;if no ball hit(?), jump
xor a
- ld [wBallHitWildMon], a
- ld a, [wd5c3]
- ld [wd5be], a
+ ld [wBallHitWildMon], a ;toggle off ball hit
+ ld a, [wCurrentCatchMonHitFrameDuration]
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a ;load byte 3 of mystery data into ??? (cause it to loop X times between a colision check?)
xor a
- ld [wd5c4], a
+ ld [wCatchModeMonUpdateTimer], a ;load 0 into ??? stops double hits?
ld a, [wCurrentCatchEmMon]
cp MEW - 1
jr nz, .notMew
ld a, [wNumMewHitsLow]
inc a
ld [wNumMewHitsLow], a
- jr nz, .asm_20116
+ jr nz, .Not256MewHits
.notMew
ld a, [wNumMonHits]
cp $3
jr z, .hitMonThreeTimes
inc a
ld [wNumMonHits], a
-.asm_20116
+.Not256MewHits
ld bc, ThreeHundredThousandPoints
callba AddBigBCD6FromQueue
ld bc, $0030
@@ -134,44 +134,44 @@ Func_200d3: ; 0x200d3
ld de, HitText
call LoadStationaryTextAndHeader
ld a, [wNumMonHits]
- callba Func_10611
+ callba Func_10611 ;queue up a graphic based on number of mon hits
ld c, $2
- jr .asm_2018a
+ jr .UpdateMonAnimation
.hitMonThreeTimes
xor a
ld [wTimeRanOut], a
ld a, $1
- ld [wPauseTimer], a
- ld hl, wd54d
+ ld [wPauseTimer], a ;pause timer
+ ld hl, wd54d ;inc ??
inc [hl]
ld c, $2
- jr .asm_2018a
+ jr .UpdateMonAnimation
-.asm_20167
- ld a, [wd5be]
+.BallDidntHitMon
+ ld a, [wLoopsUntilNextCatchSpriteAnimationChange]
and a
- ret nz
- ld a, [wd5bc]
+ ret nz ;run if ??? = 0. wLoopsUntilNextCatchSpriteAnimationChange is how many loops apart to run this?
+ ld a, [wCurrentAnimatedMonSpriteType]
ld c, a
- ld a, [wd5bd]
- sub c
+ ld a, [wCurrentAnimatedMonSpriteFrame]
+ sub c ;if ??? - ??? >= 1, make c 1, else make it 0
cp $1
ld c, $0
- jr nc, .asm_2017c
+ jr nc, .SetFrameTo0
ld c, $1
-.asm_2017c
+.SetFrameTo0
ld b, $0
- ld hl, wd5c1
+ ld hl, wCurrentCatchMonIdleFrame1Duration ;add c to ???, place it in ???. the mystery data sets how far apart these checks are
add hl, bc
ld a, [hl]
- ld [wd5be], a
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
xor a
- ld [wd5c4], a
-.asm_2018a
- ld a, [wd5bc]
+ ld [wCatchModeMonUpdateTimer], a; 0 out ???
+.UpdateMonAnimation
+ ld a, [wCurrentAnimatedMonSpriteType] ;add c to first animation type, add to second animation type?
add c
- ld [wd5bd], a
+ ld [wCurrentAnimatedMonSpriteFrame], a
scf
ret
@@ -228,39 +228,39 @@ Func_201f2: ; 0x201f2
callba Func_106a6
ret
-Func_20230: ; 0x20230
- ld a, [wd5b6]
+HandleCatchModeVoltorbHit: ; 0x20230 resolve hitting a voltorb in catch mode?
+ ld a, [wNumberOfCatchModeTilesFlipped]
cp $18
- jr z, .asm_2029d
+ jr z, .AllTilesFlipped ;if FlippedCount is 24, add to jackpot and ret c
sla a
ld c, a
ld b, $0
ld hl, wBillboardTilesIlluminationStates
add hl, bc
ld d, $4
-.asm_20242
+.LoopFlippedStatusInsertion
ld a, $1
ld [hli], a
- inc hl
+ inc hl ;load in 1
ld a, l
- cp wd5b6 % $100
- jr z, .asm_2024e
+ cp wNumberOfCatchModeTilesFlipped % $100
+ jr z, .ExitLoop ;continue until you reach FlippedCount or until 4 spaces are done
dec d
- jr nz, .asm_20242
-.asm_2024e
- ld a, [wd5b6]
- add $4
+ jr nz, .LoopFlippedStatusInsertion
+.ExitLoop
+ ld a, [wNumberOfCatchModeTilesFlipped]
+ add $4 ;then add 4 to FlippedCount, clamp to 24
cp $18
- jr c, .master_loop9
+ jr c, .DontClamp
ld a, $18
-.master_loop9
- ld [wd5b6], a
+.DontClamp
+ ld [wNumberOfCatchModeTilesFlipped], a
cp $18
- jr nz, .asm_20264
+ jr nz, .NotDoneFlipping
xor a
- ld [wIndicatorStates + 9], a
-.asm_20264
- callba Func_10184
+ ld [wIndicatorStates + 9], a ;if 24, unmark voltorb arrow indicator
+.NotDoneFlipping
+ callba Func_10184 ;load billboard graphics?
ld bc, OneHundredThousandPoints
callba AddBigBCD6FromQueue
ld bc, $0010
@@ -270,14 +270,14 @@ Func_20230: ; 0x20230
call FillBottomMessageBufferWithBlackTile
call EnableBottomText
ld hl, wStationaryText2
- ld de, Data_2a3d
+ ld de, CatchModeTileFlippedScoreStationaryTextHeader
call LoadScoreTextFromStack
pop de
pop bc
ld hl, wStationaryText1
ld de, FlippedText
call LoadStationaryTextAndHeader
-.asm_2029d
+.AllTilesFlipped
ld bc, $0001
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 f9d1b86..231eb37 100644
--- a/engine/pinball_game/draw_sprites/draw_blue_field_sprites.asm
+++ b/engine/pinball_game/draw_sprites/draw_blue_field_sprites.asm
@@ -389,7 +389,7 @@ DrawAnimatedMon_BlueStage: ; 0x1f58b
ld hl, hSCY
sub [hl]
ld c, a
- ld a, [wd5bd]
+ ld a, [wCurrentAnimatedMonSpriteFrame]
ld e, a
ld d, $0
ld hl, AnimatedMonOAMIds_BlueStage
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 17f1d2c..d89ca91 100644
--- a/engine/pinball_game/draw_sprites/draw_red_field_sprites.asm
+++ b/engine/pinball_game/draw_sprites/draw_red_field_sprites.asm
@@ -190,7 +190,7 @@ DrawAnimatedMon_RedStage: ; 0x17c96
ld hl, hSCY
sub [hl]
ld c, a
- ld a, [wd5bd]
+ ld a, [wCurrentAnimatedMonSpriteFrame]
ld e, a
ld d, $0
ld hl, AnimatedMonOAMIds_RedStage
diff --git a/engine/pinball_game/evolution_mode.asm b/engine/pinball_game/evolution_mode.asm
index 9fa08d5..164b92b 100755
--- a/engine/pinball_game/evolution_mode.asm
+++ b/engine/pinball_game/evolution_mode.asm
@@ -30,7 +30,7 @@ ConcludeEvolutionMode: ; 0x10ac8
xor a
ld [wInSpecialMode], a
ld [wWildMonIsHittable], a
- ld [wd5b6], a
+ ld [wNumberOfCatchModeTilesFlipped], a
ld [wNumMonHits], a
ld [wd551], a
ld [wd554], a
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 b42c4f8..fab2fa7 100644
--- a/engine/pinball_game/evolution_mode/evolution_mode_red_field.asm
+++ b/engine/pinball_game/evolution_mode/evolution_mode_red_field.asm
@@ -40,7 +40,7 @@ PointerTable_205d4: ; 0x205d4
padded_dab Func_2070b
padded_dab Func_20757
-Func_205e0: ; 0x205e0
+Func_205e0: ; 0x205e0 runs on collecting exp in evo mode?
ld a, [wCurrentStage]
ld b, a
ld a, [wd578]
@@ -271,10 +271,10 @@ Func_2080f: ; 0x2080f
call AddBCDEToJackpot
ld a, [wd551] ;if ??? is not zero, ret c
and a
- jr nz, .asm_20837
+ jr nz, .RetC
ld a, [wIndicatorStates + 9] ;if indicator is z, ret
and a
- jr z, .asm_20837
+ jr z, .RetC
xor a
ld [wIndicatorStates + 9], a
ld a, [wd55c]
@@ -284,7 +284,7 @@ Func_2080f: ; 0x2080f
jp nz, Func_20977
jp Func_209eb
-.asm_20837
+.RetC
scf
ret
diff --git a/engine/pokedex.asm b/engine/pokedex.asm
index be3c15f..d8eea4e 100644
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -1180,35 +1180,35 @@ Func_287e7: ; 0x287e7
call ReadByteFromBank
bit 7, a
ret nz
- ld [wd5bc], a
+ ld [wCurrentAnimatedMonSpriteType], a
call Func_28815
- ld a, [wd5bd]
+ ld a, [wCurrentAnimatedMonSpriteFrame]
add $a5
ld bc, $2030
call LoadOAMData
ret
Func_28815: ; 0x28815
- ld a, [wd5be]
+ ld a, [wLoopsUntilNextCatchSpriteAnimationChange]
dec a
- ld [wd5be], a
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
ret nz
ld a, [wBallHitWildMon]
inc a
and $7
ld [wBallHitWildMon], a
jr nz, .asm_28836
- ld a, [wd5c3]
- ld [wd5be], a
+ ld a, [wCurrentCatchMonHitFrameDuration]
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
xor a
- ld [wd5c4], a
+ ld [wCatchModeMonUpdateTimer], a
ld c, $2
jr .asm_28854
.asm_28836
- ld a, [wd5bc]
+ ld a, [wCurrentAnimatedMonSpriteType]
ld c, a
- ld a, [wd5bd]
+ ld a, [wCurrentAnimatedMonSpriteFrame]
sub c
cp $1
ld c, $0
@@ -1216,16 +1216,16 @@ Func_28815: ; 0x28815
ld c, $1
.asm_28846
ld b, $0
- ld hl, wd5c1
+ ld hl, wCurrentCatchMonIdleFrame1Duration
add hl, bc
ld a, [hl]
- ld [wd5be], a
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
xor a
- ld [wd5c4], a
+ ld [wCatchModeMonUpdateTimer], a
.asm_28854
- ld a, [wd5bc]
+ ld a, [wCurrentAnimatedMonSpriteType]
add c
- ld [wd5bd], a
+ ld [wCurrentAnimatedMonSpriteFrame], a
ret
Func_2885c: ; 0x2885c
@@ -1822,20 +1822,20 @@ Func_28bf5: ; 0x28bf5
jr nc, .asm_28c4b
inc b
.asm_28c4b
- ld hl, Data_13685
+ ld hl, CatchSpriteFrameDurations
add hl, bc
- ld a, Bank(Data_13685)
+ ld a, Bank(CatchSpriteFrameDurations)
call ReadByteFromBank
- ld [wd5c1], a
- ld [wd5be], a
+ ld [wCurrentCatchMonIdleFrame1Duration], a
+ ld [wLoopsUntilNextCatchSpriteAnimationChange], a
inc hl
- ld a, Bank(Data_13685)
+ ld a, Bank(CatchSpriteFrameDurations)
call ReadByteFromBank
- ld [wd5c2], a
+ ld [wCurrentCatchMonIdleFrame2Duration], a
inc hl
- ld a, Bank(Data_13685)
+ ld a, Bank(CatchSpriteFrameDurations)
call ReadByteFromBank
- ld [wd5c3], a
+ ld [wCurrentCatchMonHitFrameDuration], a
ld a, [wCurPokedexIndex]
ld c, a
ld b, $0
@@ -1843,8 +1843,8 @@ Func_28bf5: ; 0x28bf5
add hl, bc
ld a, Bank(MonAnimatedSpriteTypes)
call ReadByteFromBank
- ld [wd5bc], a
- ld [wd5bd], a
+ ld [wCurrentAnimatedMonSpriteType], a
+ ld [wCurrentAnimatedMonSpriteFrame], a
call Func_28cf8
pop bc
ld a, [hGameBoyColorFlag]
diff --git a/main.asm b/main.asm
index d69c889..faa5a1c 100644
--- a/main.asm
+++ b/main.asm
@@ -296,7 +296,7 @@ INCLUDE "data/mon_gfx/mon_gfx_pointers.asm"
INCLUDE "data/mon_animated_sprite_types.asm"
INCLUDE "data/collision/mon_collision_mask_pointers.asm"
-Data_13685: ; 0x13685
+CatchSpriteFrameDurations: ; 0x13685
; Each 3-byte entry is related to an evolution line. Don't know what this is for, yet.
db $12, $12, $10 ; EVOLINE_BULBASAUR
db $10, $10, $10 ; EVOLINE_CHARMANDER
diff --git a/text/scrolling_text.asm b/text/scrolling_text.asm
index 096e026..61179e7 100644
--- a/text/scrolling_text.asm
+++ b/text/scrolling_text.asm
@@ -67,7 +67,7 @@ FlippedText:
db $42, $00, $40, $00
db "FLIPPED @"
-Data_2a3d:
+CatchModeTileFlippedScoreStationaryTextHeader:
db $4a, $10, $40, $00, $00, $00
JackpotText:
diff --git a/wram.asm b/wram.asm
index a88b9a5..973e2b7 100644
--- a/wram.asm
+++ b/wram.asm
@@ -538,7 +538,7 @@ wCollidedAlleyTriggers:: ; 0xd521
ds $6 ; free space
-wIndicatorStates:: ; 0xd52f 0 = evo arrows, 1 = catch arrows, 2 = left small alley, 3 = bellsprout, 4 = slot. bit 7 controls if enabled and flashing, bit 1 and 2 control is solid (set = solid)
+wIndicatorStates:: ; 0xd52f 0 = evo arrows, 1 = catch arrows, 2 = left small alley, 3 = bellsprout, 4 = slot. bit 7 controls if enabled and flashing, bit 1 and 2 control is solid (set = solid), +9 is the arrow pointing to voltorb on red evo mode
ds $13
wLeftAlleyTrigger:: ; 0xd542
@@ -574,32 +574,16 @@ wInSpecialMode:: ; 0xd54b
; Set to 1 if currently in special game mode. See wSpecialMode.
ds $1
-wSpecialModeCollisionID:: ; 0xd54c 10000 sets it to a input, records what the ball has collided with
-;0 nothing hit?
-;1 upper left red trigger (under ditto) | secondary left trigger on blue
-;2 second right trigger
-;3 second staryu ally trigger
-;4 any voltob | any shellder
-;5 bellsprout | N/A
-;6 staryu | N/A
-;7 left diglett | poliwag
-;8 right diglett | psyduck
-;9 hit right railing (33 multiplier)
-;a hit right railing (otherwise)
-;b upper cave lights (ball upgrade)
-;c Spinner
-;d slot hole
-;e N/A | cloyster
-;f N/A | slowpoke
+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 progress?
+wd54d:: ; 0xd54d catch mode current step? used for all 3 special modes.
ds $1
-wd54e:: ; 0xd54e
+wd54e:: ; 0xd54e set to 20 by catch mode when all tiles are flipped and on lower stage
ds $1
-wd54f:: ; 0xd54f
+wd54f:: ; 0xd54f set to 5 by catch mode when all tiles are flipped and on lower stage
ds $1
wSpecialMode:: ; 0xd550
@@ -607,7 +591,7 @@ wSpecialMode:: ; 0xd550
; See SPECIAL_MODE constants.
ds $1
-wd551:: ; 0xd551
+wd551:: ; 0xd551 if non zero, voltobs skip applying experiance gain in evo mode. set to 0 onm collect experiance. set to 1 is pokemon is tired, 0 on recovered. 7 when exp is active for collecting. set to 0 on conclude evo mode. Tracks evo mode state?
ds $1
wCurrentEvolutionMon:: ; 0xd552
@@ -728,20 +712,20 @@ wBillboardTilesIlluminationStates:: ; 0xd586
; Bytes 2 = Previous illumination state. This is used to avoid re-loading the same graphics.
ds $18 * 2
-wd5b6:: ; 0xd5b6 a 24 wide block starts here and is filled before catch mode
+wNumberOfCatchModeTilesFlipped:: ; 0xd5b6 a 24 wide block starts here and is filled before catch mode. first step of catch mode only passes if it is 24. top byte records the number of tiles flipped
ds $5
wWildMonIsHittable:: ; 0xd5bb
; Set to 1 when the wild pokemon is animated and hittable with the pinball.
ds $1
-wd5bc:: ; 0xd5bc
+wCurrentAnimatedMonSpriteType:: ; 0xd5bc
ds $1
-wd5bd:: ; 0xd5bd
+wCurrentAnimatedMonSpriteFrame:: ; 0xd5bd
ds $1
-wd5be:: ; 0xd5be
+wLoopsUntilNextCatchSpriteAnimationChange:: ; 0xd5be
ds $1
wBallHitWildMon:: ; 0xd5bf
@@ -750,16 +734,16 @@ wBallHitWildMon:: ; 0xd5bf
wNumMonHits:: ; 0xd5c0
ds $1
-wd5c1:: ; 0xd5c1
- ds $1
+wCurrentCatchMonIdleFrame1Duration:: ; 0xd5c1 sets wLoopsUntilNextCatchSpriteAnimationChange if wCurrentAnimatedMonSpriteFrame - wCurrentAnimatedMonSpriteType < 1 holds animatedSpriteType
+ ds $1 ;mystery data byte 1
-wd5c2:: ; 0xd5c2
- ds $1
+wCurrentCatchMonIdleFrame2Duration:: ; 0xd5c2 sets wLoopsUntilNextCatchSpriteAnimationChange if wCurrentAnimatedMonSpriteFrame - wCurrentAnimatedMonSpriteType >= 1
+ ds $1 ;mystery data byte 2
-wd5c3:: ; 0xd5c3
+wCurrentCatchMonHitFrameDuration:: ; 0xd5c3
ds $1
-wd5c4:: ; 0xd5c4
+wCatchModeMonUpdateTimer:: ; 0xd5c4 increments while the caught mon is active once per frame(?), ensuring that the code only checks for the mon being hit every 4 frames or when the animation changes....for some reason (performance?)
ds $1
wNumMewHitsLow:: ; 0xd5c5