Labeled a core time function and vars

This commit is contained in:
chaos-lord 2017-07-12 16:41:58 +01:00
parent cfb351f072
commit 3a675d926f
14 changed files with 51 additions and 51 deletions

View File

@ -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

View File

@ -35,7 +35,7 @@ HandleBallLossMeowthBonus: ; 0xdfe2
.asm_e025
xor a
ld [wd57e], a
ld [wTimeRanOut], a
ld [wTimerActive], a
xor a
ld [wd495], a

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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