diff options
author | chaos-lord <dd4791.mariokarter@hotmail.co.uk> | 2017-07-12 16:41:58 +0100 |
---|---|---|
committer | chaos-lord <dd4791.mariokarter@hotmail.co.uk> | 2017-07-12 16:41:58 +0100 |
commit | 3a675d926fd28eebd44887e8646ba5f24b098347 (patch) | |
tree | 02446ef5bf11b350bc40c7c88de3bdc475e346d2 | |
parent | cfb351f0729f832aa0cc90594d0e3cdececbe082 (diff) |
Labeled a core time function and vars
14 files changed, 51 insertions, 51 deletions
diff --git a/engine/pinball_game.asm b/engine/pinball_game.asm index 81fdde7..66ff1de 100644 --- a/engine/pinball_game.asm +++ b/engine/pinball_game.asm @@ -158,7 +158,7 @@ GameScreenFunction_HandleBallPhysics: ; 0xd909 .skipDrawingScoreboard
ld a, [wTimerActive]
and a
- callba nz, Func_86a4
+ callba nz, DecrementTimer
ld a, [wMoveToNextScreenState]
and a
ret z
diff --git a/engine/pinball_game/ball_loss/ball_loss_meowth_bonus.asm b/engine/pinball_game/ball_loss/ball_loss_meowth_bonus.asm index cf84910..1bc7035 100644 --- a/engine/pinball_game/ball_loss/ball_loss_meowth_bonus.asm +++ b/engine/pinball_game/ball_loss/ball_loss_meowth_bonus.asm @@ -35,7 +35,7 @@ HandleBallLossMeowthBonus: ; 0xdfe2 .asm_e025
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld [wTimerActive], a
xor a
ld [wd495], 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 897bafe..10a9fc3 100644 --- a/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm +++ b/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm @@ -142,9 +142,9 @@ Func_20394: ; 0x20394 .asm_20417
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $1
- ld [wd57f], a
+ ld [wPauseTimer], a
ld hl, wd54d
inc [hl]
ld c, $2
@@ -213,11 +213,11 @@ Func_2048f: ; 0x2048f Func_204b3: ; 0x204b3
callba PlayLowTimeSfx
- ld a, [wd57e]
+ ld a, [wTimeRanOut]
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $7
ld [wd54d], a
; Automatically set Mew as caught, since you can't possibly catch it
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 ee2c5ef..4bdeda1 100644 --- a/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm +++ b/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm @@ -1,11 +1,11 @@ Func_20000: ; 0x20000
ld a, [wd54c]
cp $4
- jp z, Func_20230
+ jp z, Func_20230 ;if collided with voltorb
cp $c
jp z, Func_202a8
cp $5
- jp z, Func_202b2
+ jp z, Func_202b2 ;bellsprout
cp $0
jr z, .asm_20018
scf
@@ -140,9 +140,9 @@ Func_200d3: ; 0x200d3 .hitMonThreeTimes
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $1
- ld [wd57f], a
+ ld [wPauseTimer], a
ld hl, wd54d
inc [hl]
ld c, $2
@@ -211,11 +211,11 @@ Func_201ce: ; 0x201ce Func_201f2: ; 0x201f2
callba PlayLowTimeSfx
- ld a, [wd57e]
+ ld a, [wTimeRanOut]
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $7
ld [wd54d], a
; Automatically set Mew as caught, since you can't possibly catch it
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 bb5042f..128ea12 100644 --- a/engine/pinball_game/evolution_mode/evolution_mode_blue_field.asm +++ b/engine/pinball_game/evolution_mode/evolution_mode_blue_field.asm @@ -223,11 +223,11 @@ Func_20da0: ; 0x20da0 call Func_21079
.asm_20db3
callba PlayLowTimeSfx
- ld a, [wd57e]
+ ld a, [wTimeRanOut]
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $2
ld [wd54d], a
xor 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 e21d09f..a78ceae 100644 --- a/engine/pinball_game/evolution_mode/evolution_mode_red_field.asm +++ b/engine/pinball_game/evolution_mode/evolution_mode_red_field.asm @@ -226,11 +226,11 @@ Func_2077b: ; 0x2077b call Func_20a55
.asm_2078e
callba PlayLowTimeSfx
- ld a, [wd57e]
+ ld a, [wTimeRanOut]
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $2
ld [wd54d], a
xor a
diff --git a/engine/pinball_game/map_move.asm b/engine/pinball_game/map_move.asm index 4c27b29..30973fa 100755 --- a/engine/pinball_game/map_move.asm +++ b/engine/pinball_game/map_move.asm @@ -486,11 +486,11 @@ UpdateMapMove_RedField: ; 0x3151f handle map move timer and fail when it expires ld [wLeftDiglettAnimationController], a
ld [wRightDiglettAnimationController], a
callba PlayLowTimeSfx
- ld a, [wd57e] ;if ??? is 0, quit, else make it zero (this only truns once per something?) and handle a failed map move
+ ld a, [wTimeRanOut] ;if ??? is 0, quit, else make it zero (this only truns once per something?) and handle a failed map move
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $3
ld [wd54d], a
xor a
@@ -640,11 +640,11 @@ UpdateMapMove_BlueField: ; 0x3168c ld a, $1
ld [wPoliwagState], a
callba PlayLowTimeSfx
- ld a, [wd57e]
+ ld a, [wTimeRanOut]
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $3
ld [wd54d], a
xor a
diff --git a/engine/pinball_game/object_collision/gengar_bonus_resolve_collision.asm b/engine/pinball_game/object_collision/gengar_bonus_resolve_collision.asm index a343bf4..10afcd3 100644 --- a/engine/pinball_game/object_collision/gengar_bonus_resolve_collision.asm +++ b/engine/pinball_game/object_collision/gengar_bonus_resolve_collision.asm @@ -5,11 +5,11 @@ ResolveGengarBonusGameObjectCollisions: ; 0x18377 call Func_18d34
call Func_183b7
callba PlayLowTimeSfx
- ld a, [wd57e]
+ ld a, [wTimeRanOut]
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $1
ld [wd7be], a
call Func_2862
diff --git a/engine/pinball_game/object_collision/meowth_bonus_resolve_collision.asm b/engine/pinball_game/object_collision/meowth_bonus_resolve_collision.asm index 8f0766d..85b4598 100644 --- a/engine/pinball_game/object_collision/meowth_bonus_resolve_collision.asm +++ b/engine/pinball_game/object_collision/meowth_bonus_resolve_collision.asm @@ -224,11 +224,11 @@ ResolveMeowthBonusGameObjectCollisions: ; 0x2442a jr z, .asm_244c1
callba PlayLowTimeSfx
.asm_244c1
- ld a, [wd57e]
+ ld a, [wTimeRanOut]
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $1
ld [wd7be], a
call Func_2862
diff --git a/engine/pinball_game/object_collision/mewtwo_bonus_resolve_collision.asm b/engine/pinball_game/object_collision/mewtwo_bonus_resolve_collision.asm index 0a2192b..17e0b0b 100644 --- a/engine/pinball_game/object_collision/mewtwo_bonus_resolve_collision.asm +++ b/engine/pinball_game/object_collision/mewtwo_bonus_resolve_collision.asm @@ -3,11 +3,11 @@ ResolveMewtwoBonusGameObjectCollisions: ; 0x19451 call Func_19701
call Func_1948b
callba PlayLowTimeSfx
- ld a, [wd57e]
+ ld a, [wTimeRanOut]
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $1
ld [wd7be], a
call Func_2862
diff --git a/engine/pinball_game/object_collision/seel_bonus_resolve_collision.asm b/engine/pinball_game/object_collision/seel_bonus_resolve_collision.asm index 83d48db..39e8044 100644 --- a/engine/pinball_game/object_collision/seel_bonus_resolve_collision.asm +++ b/engine/pinball_game/object_collision/seel_bonus_resolve_collision.asm @@ -39,11 +39,11 @@ ResolveSeelBonusGameObjectCollisions: ; 0x25c5a jr z, .asm_25cc1
callba PlayLowTimeSfx
.asm_25cc1
- ld a, [wd57e]
+ ld a, [wTimeRanOut]
and a
ret z
xor a
- ld [wd57e], a
+ ld [wTimeRanOut], a
ld a, $1
ld [wd7be], a
call Func_2862
diff --git a/engine/pinball_game/timer.asm b/engine/pinball_game/timer.asm index cbfe9ad..2e1dc6b 100644 --- a/engine/pinball_game/timer.asm +++ b/engine/pinball_game/timer.asm @@ -9,8 +9,8 @@ StartTimer: ; 0x867d ld [wTimerMinutes], a
xor a
ld [wTimerFrames], a
- ld [wd57e], a
- ld [wd57f], a
+ ld [wTimeRanOut], a
+ ld [wPauseTimer], a
ld a, $1
ld [wTimerActive], a
ld a, $1
@@ -18,36 +18,36 @@ StartTimer: ; 0x867d callba LoadTimerGraphics
ret
-Func_86a4: ; 0x86a4
- ld a, [wd57f]
+DecrementTimer: ; 0x86a4
+ ld a, [wPauseTimer] ;quit unless ??? is 0
and a
ret nz
ld a, [wTimerFrames]
inc a
- cp $3c
- jr c, .asm_86b2
+ cp 60
+ jr c, .IfSecondHasNotPassed ;if frames +1 >= 60, reset it
xor a
-.asm_86b2
- ld [wTimerFrames], a
- ret c
+.IfSecondHasNotPassed
+ ld [wTimerFrames], a ;inc frames
+ ret c ;done if there was no reset
ld hl, wTimerMinutes
ld a, [hld]
or [hl]
- jr nz, .asm_86c3
+ jr nz, .IfTimeLeft ;if minutes or seconds is non-zero, jump, else ret marking that time ran out
ld a, $1
- ld [wd57e], a
+ ld [wTimeRanOut], a
ret
-.asm_86c3
+.IfTimeLeft
ld a, [hl]
sub $1
- daa
- jr nc, .asm_86cb
+ daa ;take 1 from seconds
+ jr nc, .IfMinuteHasNotPassed ; if < 0, set to 59
ld a, $59
-.asm_86cb
+.IfMinuteHasNotPassed
ld [hli], a
ld a, [hl]
- sbc $0
+ sbc $0 ;sub minutes by 1 only if carry is set from the seconds sub
daa
ld [hl], a
ret
@@ -102,7 +102,7 @@ INCLUDE "engine/pinball_game/end_of_ball_bonus.asm" SECTION "bank4", ROMX -Func_10000: ; 0x10000 set to 4 b +Func_10000: ; 0x10000 ld c, a ld a, [wInSpecialMode] ;special mode in c and a @@ -395,7 +395,7 @@ wWhichPsyduckPoliwagId:: wLeftDiglettAnimationController:: ; 0xd4ef $50 = in and pained look. 0 = normal state ds $1 -wLeftMapMoveCounter:: ; 0xd4f0 WARNING, diglet identifying code relies on this being 2 bytes before right map move counter +wLeftMapMoveCounter:: ; 0xd4f0 WARNING, diglet identifying code relies on this being 2 bytes before right map move counter and 1 byte after that digletts animation controller ds $1 wRightDiglettAnimationController:: ; 0xd4f1 $50 = in and pained look. 0 = normal state @@ -427,7 +427,7 @@ wLeftMapMoveCounterFramesUntilDecrease:: ; 0xd4f7 wRightMapMoveCounterFramesUntilDecrease:: ; 0xd4f9 ; Holds the number of frames remaining until the wRightMapMoveCounter -; counter will decrease by 1. +; counter will decrease by 1. WARNING: red tables diglett function relies on this being immediatly after wLeftMapMoveCounterFramesUntilDecrease ds $2 wBellsproutCollision:: ; 0xd4fb @@ -566,10 +566,10 @@ wInSpecialMode:: ; 0xd54b ; Set to 1 if currently in special game mode. See wSpecialMode. ds $1 -wd54c:: ; 0xd54c 10000 sets it to a input. 7 and 8 from the digletts +wd54c:: ; 0xd54c 10000 sets it to a input, records what the ball has collided with. 7 and 8 from the digletts, 4 from voltorb, b = upper cave lights?, 1 is upper left red trigger, 2 is a right trigger, 5 is bellsprout, d = slot, 6 = staryu, 9/a = right railing multiplier?, ds $1 -wd54d:: ; 0xd54d +wd54d:: ; 0xd54d catch mode progress? ds $1 wd54e:: ; 0xd54e @@ -673,10 +673,10 @@ wTimerActive:: ; 0xd57d ; Set to 1 when the Timer is displayed and counting down. ds $1 -wd57e:: ; 0xd57e when map mode fails by time, toggled to off from on +wTimeRanOut:: ; 0xd57e set to 1 when the timer reaches 0 ds $1 -wd57f:: ; 0xd57f +wPauseTimer:: ; 0xd57f If set to nz, timer pauses ds $1 wd580:: ; 0xd580 |