Optimizations: cp 0 -> or a; and mask cp mask -> or ~mask inc a

This commit is contained in:
Randy Thiemann 2023-11-13 03:05:39 +01:00
parent fd5b4fd26e
commit 304a5f739b
16 changed files with 4995 additions and 4995 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -96,15 +96,15 @@ BlitField::
.waitendvbloop .waitendvbloop
ldh a, [rLY] ldh a, [rLY]
cp a, 0 or a, a
jr nz, .waitendvbloop jr nz, .waitendvbloop
; The last 6 rows need some care. ; The last 6 rows need some care.
REPT 7 REPT 7
; Wait until start of drawing, then insert nops. ; Wait until start of drawing, then insert nops.
: ldh a, [rSTAT] : ldh a, [rSTAT]
and a, STATF_LCD or a, ~STATF_LCD
cp a, STATF_LCD inc a
jr nz, :- jr nz, :-
REPT 40 REPT 40
nop nop
@ -153,15 +153,15 @@ BigBlitField::
.waitendvbloop .waitendvbloop
ldh a, [rLY] ldh a, [rLY]
cp a, 0 or a, a
jr nz, .waitendvbloop jr nz, .waitendvbloop
; The last 6 rows need some care. ; The last 6 rows need some care.
REPT 7 REPT 7
; Wait until start of drawing, then insert nops. ; Wait until start of drawing, then insert nops.
: ldh a, [rSTAT] : ldh a, [rSTAT]
and a, STATF_LCD or a, ~STATF_LCD
cp a, STATF_LCD inc a
jr nz, :- jr nz, :-
REPT 40 REPT 40
nop nop
@ -709,7 +709,7 @@ TrySpawnPiece::
; If we didn't try to IRS in the first place, too bad. Game over. ; If we didn't try to IRS in the first place, too bad. Game over.
ldh a, [hCurrentPieceRotationState] ldh a, [hCurrentPieceRotationState]
cp a, 0 or a, a
ret z ret z
; Try rotation state 0. ; Try rotation state 0.
@ -918,7 +918,7 @@ FieldProcess::
; Is this the first frame of the piece? ; Is this the first frame of the piece?
.firstframe .firstframe
ldh a, [hStalePiece] ldh a, [hStalePiece]
cp a, 0 or a, a
jr nz, .handleselect jr nz, .handleselect
ld a, $FF ld a, $FF
ldh [hStalePiece], a ldh [hStalePiece], a
@ -942,7 +942,7 @@ FieldProcess::
; Want rotate CCW? ; Want rotate CCW?
.wantrotccw .wantrotccw
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .ldb1 jr z, .ldb1
.lda1 .lda1
ldh a, [hAState] ldh a, [hAState]
@ -961,7 +961,7 @@ FieldProcess::
; Want rotate CW? ; Want rotate CW?
.wantrotcw .wantrotcw
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .lda2 jr z, .lda2
.ldb2 .ldb2
ldh a, [hBState] ldh a, [hBState]
@ -1099,7 +1099,7 @@ FieldProcess::
ldh a, [hCurrentPieceY] ldh a, [hCurrentPieceY]
ld b, a ld b, a
ldh a, [hCurrentPieceX] ldh a, [hCurrentPieceX]
cp a, 0 or a, a
jr z, .maybetgm3rot jr z, .maybetgm3rot
dec a dec a
call XYToSFieldPtr call XYToSFieldPtr
@ -1177,7 +1177,7 @@ FieldProcess::
ldh [hCurrentPieceRotationState], a ldh [hCurrentPieceRotationState], a
call SetPieceDataOffset call SetPieceDataOffset
ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0. ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0.
cp a, 0 or a, a
jr nz, .tkickupalreadysetforce jr nz, .tkickupalreadysetforce
inc a inc a
ldh [hLockDelayForce], a ldh [hLockDelayForce], a
@ -1204,7 +1204,7 @@ FieldProcess::
; Are we grounded? Don't kick if we aren't. ; Are we grounded? Don't kick if we aren't.
ldh a, [hActualG] ldh a, [hActualG]
cp a, 0 or a, a
jp nz, .norot jp nz, .norot
; Try up once. ; Try up once.
@ -1239,7 +1239,7 @@ FieldProcess::
ldh [hCurrentPieceRotationState], a ldh [hCurrentPieceRotationState], a
call SetPieceDataOffset call SetPieceDataOffset
ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0. ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0.
cp a, 0 or a, a
jr nz, .ikickup1alreadysetforce jr nz, .ikickup1alreadysetforce
inc a inc a
ldh [hLockDelayForce], a ldh [hLockDelayForce], a
@ -1285,7 +1285,7 @@ FieldProcess::
ldh [hCurrentPieceRotationState], a ldh [hCurrentPieceRotationState], a
call SetPieceDataOffset call SetPieceDataOffset
ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0. ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0.
cp a, 0 or a, a
jr nz, .ikickup2alreadysetforce jr nz, .ikickup2alreadysetforce
inc a inc a
ldh [hLockDelayForce], a ldh [hLockDelayForce], a
@ -1346,12 +1346,12 @@ FieldProcess::
.wantleft .wantleft
ldh a, [hCurrentPieceX] ldh a, [hCurrentPieceX]
cp a, 0 or a, a
jr z, .precheckright jr z, .precheckright
ldh a, [hLeftState] ; Check if held for 1 frame. If so we move. ldh a, [hLeftState] ; Check if held for 1 frame. If so we move.
cp a, 1 cp a, 1
jr z, .doleft jr z, .doleft
cp a, 0 ; We never want to move if the button wasn't held. or a, a ; We never want to move if the button wasn't held.
jr z, .wantright jr z, .wantright
ld b, a ld b, a
.checkdasleft .checkdasleft
@ -1368,7 +1368,7 @@ FieldProcess::
.precheckright .precheckright
ldh a, [hRightState] ldh a, [hRightState]
cp a, 0 or a, a
jr z, .nomove jr z, .nomove
; Do we want to move right? ; Do we want to move right?
@ -1376,7 +1376,7 @@ FieldProcess::
ldh a, [hRightState] ; Check if held for 1 frame. If so we move. ldh a, [hRightState] ; Check if held for 1 frame. If so we move.
cp a, 1 cp a, 1
jr z, .doright jr z, .doright
cp a, 0 ; We never want to move if the button wasn't held. or a, a ; We never want to move if the button wasn't held.
jr z, .noeffect jr z, .noeffect
ld b, a ld b, a
.checkdasright .checkdasright
@ -1410,7 +1410,7 @@ FieldProcess::
.nomove .nomove
ld a, [wMovementLastFrame] ld a, [wMovementLastFrame]
cp a, 0 or a, a
jr z, .noeffect jr z, .noeffect
; We moved last frame but couldn't move this frame. That means we slammed into a wall. ; We moved last frame but couldn't move this frame. That means we slammed into a wall.
@ -1517,7 +1517,7 @@ FieldProcess::
; If we press down, we want to do a soft drop. ; If we press down, we want to do a soft drop.
.postdrop .postdrop
ldh a, [hDownState] ldh a, [hDownState]
cp a, 0 or a, a
jr z, .checkregulargravity jr z, .checkregulargravity
ldh a, [hDownFrames] ldh a, [hDownFrames]
inc a inc a
@ -1607,7 +1607,7 @@ FieldProcess::
cp a, b cp a, b
jr z, .postcheckforfirmdropsound ; Never play the sound if we didn't change rows. jr z, .postcheckforfirmdropsound ; Never play the sound if we didn't change rows.
ldh a, [hDownState] ldh a, [hDownState]
cp a, 0 or a, a
jr nz, .postcheckforfirmdropsound ; Don't play the sound if we're holding down. jr nz, .postcheckforfirmdropsound ; Don't play the sound if we're holding down.
; Play the firm drop sound. ; Play the firm drop sound.
@ -1618,7 +1618,7 @@ FieldProcess::
; If the down button is held, lock. ; If the down button is held, lock.
.postcheckforfirmdropsound .postcheckforfirmdropsound
ldh a, [hDownState] ldh a, [hDownState]
cp a, 0 or a, a
jr z, .neutralcheck jr z, .neutralcheck
; Don't lock on down for hard drop mode immediately. ; Don't lock on down for hard drop mode immediately.
@ -1644,18 +1644,18 @@ FieldProcess::
; If the down button is not held, check if we're neutral and if that should lock. ; If the down button is not held, check if we're neutral and if that should lock.
.neutralcheck .neutralcheck
ldh a, [hShouldLockIfGrounded] ldh a, [hShouldLockIfGrounded]
cp a, 0 or a, a
jr z, .dontforcelock jr z, .dontforcelock
; Check for neutral. ; Check for neutral.
ldh a, [hUpState] ldh a, [hUpState]
cp a, 0 or a, a
jr nz, .dontforcelock jr nz, .dontforcelock
ldh a, [hLeftState] ldh a, [hLeftState]
cp a, 0 or a, a
jr nz, .dontforcelock jr nz, .dontforcelock
ldh a, [hRightState] ldh a, [hRightState]
cp a, 0 or a, a
jr nz, .dontforcelock jr nz, .dontforcelock
; Lock on neutral for a few modes. ; Lock on neutral for a few modes.
@ -1681,7 +1681,7 @@ FieldProcess::
; Are we out of lock delay? ; Are we out of lock delay?
.checklockdelay .checklockdelay
cp a, 0 or a, a
jr nz, .checkfortgm3lockexception ; If not, check if the TGM3 exception applies. jr nz, .checkfortgm3lockexception ; If not, check if the TGM3 exception applies.
jr .dolock ; Otherwise, lock! jr .dolock ; Otherwise, lock!
@ -1711,7 +1711,7 @@ FieldProcess::
.draw .draw
; If the piece is locked, skip the ghost piece. ; If the piece is locked, skip the ghost piece.
ldh a, [hCurrentLockDelayRemaining] ldh a, [hCurrentLockDelayRemaining]
cp a, 0 or a, a
jr z, .postghost jr z, .postghost
; If the gravity is <= 1G, draw a ghost piece. ; If the gravity is <= 1G, draw a ghost piece.
@ -1757,7 +1757,7 @@ FieldProcess::
cp a, $FF cp a, $FF
jr nz, .drawpiece jr nz, .drawpiece
ldh a, [hCurrentLockDelayRemaining] ldh a, [hCurrentLockDelayRemaining]
cp a, 0 or a, a
jr nz, .drawpiece jr nz, .drawpiece
; Then bones are made invis. ; Then bones are made invis.
@ -1787,7 +1787,7 @@ FieldProcess::
add a, 7 add a, 7
ldh [hWantedTile], a ldh [hWantedTile], a
ldh a, [hCurrentLockDelayRemaining] ldh a, [hCurrentLockDelayRemaining]
cp a, 0 or a, a
jr nz, .notlocked jr nz, .notlocked
; This might be invisible! ; This might be invisible!
@ -1946,14 +1946,14 @@ FieldDelay::
; In delay state, DAS increments double speed. ; In delay state, DAS increments double speed.
.incl .incl
ldh a, [hLeftState] ldh a, [hLeftState]
cp a, 0 or a, a
jr z, .incr jr z, .incr
inc a inc a
ldh [hLeftState], a ldh [hLeftState], a
.incr .incr
ldh a, [hRightState] ldh a, [hRightState]
cp a, 0 or a, a
jr z, .noinc jr z, .noinc
inc a inc a
ldh [hRightState], a ldh [hRightState], a
@ -2025,7 +2025,7 @@ FieldDelay::
ld [wDelayState], a ld [wDelayState], a
ldh a, [hLineClearCt] ldh a, [hLineClearCt]
cp a, 0 or a, a
jr z, .lineclear ; If not, just skip the phase. jr z, .lineclear ; If not, just skip the phase.
; There were line clears! Clear the level counter breakpoint. ; There were line clears! Clear the level counter breakpoint.
@ -2089,7 +2089,7 @@ FieldDelay::
; Do we have a bravo? x4 if so. ; Do we have a bravo? x4 if so.
.bravo .bravo
ldh a, [hBravo] ldh a, [hBravo]
cp a, 0 or a, a
jr nz, .lineclears jr nz, .lineclears
add hl, bc add hl, bc
jr c, .forcemax jr c, .forcemax
@ -2154,7 +2154,7 @@ FieldDelay::
ldh a, [hRemainingDelay] ldh a, [hRemainingDelay]
dec a dec a
ldh [hRemainingDelay], a ldh [hRemainingDelay], a
cp a, 0 or a, a
ret nz ret nz
call ClearLines call ClearLines
@ -2177,7 +2177,7 @@ FieldDelay::
; Don't do anything if there were line clears ; Don't do anything if there were line clears
ldh a, [hLineClearCt] ldh a, [hLineClearCt]
cp a, 0 or a, a
jr nz, .are jr nz, .are
; Otherwise, reset the combo. ; Otherwise, reset the combo.
@ -2190,7 +2190,7 @@ FieldDelay::
ldh a, [hRemainingDelay] ldh a, [hRemainingDelay]
dec a dec a
ldh [hRemainingDelay], a ldh [hRemainingDelay], a
cp a, 0 or a, a
ret nz ret nz
; Add one level if we're not at a breakpoint and not in MYCO speed curve. ; Add one level if we're not at a breakpoint and not in MYCO speed curve.
@ -2958,7 +2958,7 @@ BigTrySpawnPiece::
; If we didn't try to IRS in the first place, too bad. Game over. ; If we didn't try to IRS in the first place, too bad. Game over.
ldh a, [hCurrentPieceRotationState] ldh a, [hCurrentPieceRotationState]
cp a, 0 or a, a
ret z ret z
; Try rotation state 0. ; Try rotation state 0.
@ -3167,7 +3167,7 @@ BigFieldProcess::
; Is this the first frame of the piece? ; Is this the first frame of the piece?
.firstframe .firstframe
ldh a, [hStalePiece] ldh a, [hStalePiece]
cp a, 0 or a, a
jr nz, .handleselect jr nz, .handleselect
ld a, $FF ld a, $FF
ldh [hStalePiece], a ldh [hStalePiece], a
@ -3191,7 +3191,7 @@ BigFieldProcess::
; Want rotate CCW? ; Want rotate CCW?
.wantrotccw .wantrotccw
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .ldb1 jr z, .ldb1
.lda1 .lda1
ldh a, [hAState] ldh a, [hAState]
@ -3210,7 +3210,7 @@ BigFieldProcess::
; Want rotate CW? ; Want rotate CW?
.wantrotcw .wantrotcw
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .lda2 jr z, .lda2
.ldb2 .ldb2
ldh a, [hBState] ldh a, [hBState]
@ -3348,7 +3348,7 @@ BigFieldProcess::
ldh a, [hCurrentPieceY] ldh a, [hCurrentPieceY]
ld b, a ld b, a
ldh a, [hCurrentPieceX] ldh a, [hCurrentPieceX]
cp a, 0 or a, a
jr z, .maybetgm3rot jr z, .maybetgm3rot
dec a dec a
call BigXYToSFieldPtr call BigXYToSFieldPtr
@ -3426,7 +3426,7 @@ BigFieldProcess::
ldh [hCurrentPieceRotationState], a ldh [hCurrentPieceRotationState], a
call BigSetPieceDataOffset call BigSetPieceDataOffset
ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0. ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0.
cp a, 0 or a, a
jr nz, .tkickupalreadysetforce jr nz, .tkickupalreadysetforce
inc a inc a
ldh [hLockDelayForce], a ldh [hLockDelayForce], a
@ -3452,7 +3452,7 @@ BigFieldProcess::
; Are we grounded? Don't kick if we aren't. ; Are we grounded? Don't kick if we aren't.
ldh a, [hActualG] ldh a, [hActualG]
cp a, 0 or a, a
jp nz, .norot jp nz, .norot
; Try up once. ; Try up once.
@ -3487,7 +3487,7 @@ BigFieldProcess::
ldh [hCurrentPieceRotationState], a ldh [hCurrentPieceRotationState], a
call BigSetPieceDataOffset call BigSetPieceDataOffset
ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0. ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0.
cp a, 0 or a, a
jr nz, .ikick1upalreadysetforce jr nz, .ikick1upalreadysetforce
inc a inc a
ldh [hLockDelayForce], a ldh [hLockDelayForce], a
@ -3533,7 +3533,7 @@ BigFieldProcess::
ldh [hCurrentPieceRotationState], a ldh [hCurrentPieceRotationState], a
call BigSetPieceDataOffset call BigSetPieceDataOffset
ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0. ldh a, [hLockDelayForce] ; Set lock delay forcing to 1 if it's 0.
cp a, 0 or a, a
jr nz, .ikick2upalreadysetforce jr nz, .ikick2upalreadysetforce
inc a inc a
ldh [hLockDelayForce], a ldh [hLockDelayForce], a
@ -3594,12 +3594,12 @@ BigFieldProcess::
.wantleft .wantleft
ldh a, [hCurrentPieceX] ldh a, [hCurrentPieceX]
cp a, 0 or a, a
jr z, .precheckright jr z, .precheckright
ldh a, [hLeftState] ; Check if held for 1 frame. If so we move. ldh a, [hLeftState] ; Check if held for 1 frame. If so we move.
cp a, 1 cp a, 1
jr z, .doleft jr z, .doleft
cp a, 0 ; We never want to move if the button wasn't held. or a, a ; We never want to move if the button wasn't held.
jr z, .wantright jr z, .wantright
ld b, a ld b, a
.checkdasleft .checkdasleft
@ -3616,7 +3616,7 @@ BigFieldProcess::
.precheckright .precheckright
ldh a, [hRightState] ldh a, [hRightState]
cp a, 0 or a, a
jr z, .nomove jr z, .nomove
; Do we want to move right? ; Do we want to move right?
@ -3624,7 +3624,7 @@ BigFieldProcess::
ldh a, [hRightState] ; Check if held for 1 frame. If so we move. ldh a, [hRightState] ; Check if held for 1 frame. If so we move.
cp a, 1 cp a, 1
jr z, .doright jr z, .doright
cp a, 0 ; We never want to move if the button wasn't held. or a, a ; We never want to move if the button wasn't held.
jr z, .noeffect jr z, .noeffect
ld b, a ld b, a
.checkdasright .checkdasright
@ -3658,7 +3658,7 @@ BigFieldProcess::
.nomove .nomove
ld a, [wMovementLastFrame] ld a, [wMovementLastFrame]
cp a, 0 or a, a
jr z, .noeffect jr z, .noeffect
; We moved last frame but couldn't move this frame. That means we slammed into a wall. ; We moved last frame but couldn't move this frame. That means we slammed into a wall.
@ -3765,7 +3765,7 @@ BigFieldProcess::
; If we press down, we want to do a soft drop. ; If we press down, we want to do a soft drop.
.postdrop .postdrop
ldh a, [hDownState] ldh a, [hDownState]
cp a, 0 or a, a
jr z, .checkregulargravity jr z, .checkregulargravity
ldh a, [hDownFrames] ldh a, [hDownFrames]
inc a inc a
@ -3855,7 +3855,7 @@ BigFieldProcess::
cp a, b cp a, b
jr z, .postcheckforfirmdropsound ; Never play the sound if we didn't change rows. jr z, .postcheckforfirmdropsound ; Never play the sound if we didn't change rows.
ldh a, [hDownState] ldh a, [hDownState]
cp a, 0 or a, a
jr nz, .postcheckforfirmdropsound ; Don't play the sound if we're holding down. jr nz, .postcheckforfirmdropsound ; Don't play the sound if we're holding down.
; Play the firm drop sound. ; Play the firm drop sound.
@ -3866,7 +3866,7 @@ BigFieldProcess::
; If the down button is held, lock. ; If the down button is held, lock.
.postcheckforfirmdropsound .postcheckforfirmdropsound
ldh a, [hDownState] ldh a, [hDownState]
cp a, 0 or a, a
jr z, .neutralcheck jr z, .neutralcheck
; Don't lock on down for hard drop mode immediately. ; Don't lock on down for hard drop mode immediately.
@ -3892,18 +3892,18 @@ BigFieldProcess::
; If the down button is not held, check if we're neutral and if that should lock. ; If the down button is not held, check if we're neutral and if that should lock.
.neutralcheck .neutralcheck
ldh a, [hShouldLockIfGrounded] ldh a, [hShouldLockIfGrounded]
cp a, 0 or a, a
jr z, .dontforcelock jr z, .dontforcelock
; Check for neutral. ; Check for neutral.
ldh a, [hUpState] ldh a, [hUpState]
cp a, 0 or a, a
jr nz, .dontforcelock jr nz, .dontforcelock
ldh a, [hLeftState] ldh a, [hLeftState]
cp a, 0 or a, a
jr nz, .dontforcelock jr nz, .dontforcelock
ldh a, [hRightState] ldh a, [hRightState]
cp a, 0 or a, a
jr nz, .dontforcelock jr nz, .dontforcelock
; Lock on neutral for a few modes. ; Lock on neutral for a few modes.
@ -3929,7 +3929,7 @@ BigFieldProcess::
; Are we out of lock delay? ; Are we out of lock delay?
.checklockdelay .checklockdelay
cp a, 0 or a, a
jr nz, .checkfortgm3lockexception ; If not, check if the TGM3 exception applies. jr nz, .checkfortgm3lockexception ; If not, check if the TGM3 exception applies.
jr .dolock ; Otherwise, lock! jr .dolock ; Otherwise, lock!
@ -3959,7 +3959,7 @@ BigFieldProcess::
.draw .draw
; If the piece is locked, skip the ghost piece. ; If the piece is locked, skip the ghost piece.
ldh a, [hCurrentLockDelayRemaining] ldh a, [hCurrentLockDelayRemaining]
cp a, 0 or a, a
jr z, .postghost jr z, .postghost
; If the gravity is <= 1G, draw a ghost piece. ; If the gravity is <= 1G, draw a ghost piece.
@ -4005,7 +4005,7 @@ BigFieldProcess::
cp a, $FF cp a, $FF
jr nz, .drawpiece jr nz, .drawpiece
ldh a, [hCurrentLockDelayRemaining] ldh a, [hCurrentLockDelayRemaining]
cp a, 0 or a, a
jr nz, .drawpiece jr nz, .drawpiece
; Then bones are made invis. ; Then bones are made invis.
@ -4035,7 +4035,7 @@ BigFieldProcess::
add a, 7 add a, 7
ldh [hWantedTile], a ldh [hWantedTile], a
ldh a, [hCurrentLockDelayRemaining] ldh a, [hCurrentLockDelayRemaining]
cp a, 0 or a, a
jr nz, .notlocked jr nz, .notlocked
; This might be invisible! ; This might be invisible!
@ -4195,14 +4195,14 @@ BigFieldDelay::
; In delay state, DAS increments double speed. ; In delay state, DAS increments double speed.
.incl .incl
ldh a, [hLeftState] ldh a, [hLeftState]
cp a, 0 or a, a
jr z, .incr jr z, .incr
inc a inc a
ldh [hLeftState], a ldh [hLeftState], a
.incr .incr
ldh a, [hRightState] ldh a, [hRightState]
cp a, 0 or a, a
jr z, .noinc jr z, .noinc
inc a inc a
ldh [hRightState], a ldh [hRightState], a
@ -4275,7 +4275,7 @@ BigFieldDelay::
ld [wDelayState], a ld [wDelayState], a
ldh a, [hLineClearCt] ldh a, [hLineClearCt]
cp a, 0 or a, a
jr z, .lineclear ; If not, just skip the phase. jr z, .lineclear ; If not, just skip the phase.
; There were line clears! Clear the level counter breakpoint. ; There were line clears! Clear the level counter breakpoint.
@ -4339,7 +4339,7 @@ BigFieldDelay::
; Do we have a bravo? x4 if so. ; Do we have a bravo? x4 if so.
.bravo .bravo
ldh a, [hBravo] ldh a, [hBravo]
cp a, 0 or a, a
jr nz, .lineclears jr nz, .lineclears
add hl, bc add hl, bc
jr c, .forcemax jr c, .forcemax
@ -4404,7 +4404,7 @@ BigFieldDelay::
ldh a, [hRemainingDelay] ldh a, [hRemainingDelay]
dec a dec a
ldh [hRemainingDelay], a ldh [hRemainingDelay], a
cp a, 0 or a, a
jp nz, BigWidenField jp nz, BigWidenField
call BigClearLines call BigClearLines
@ -4428,7 +4428,7 @@ BigFieldDelay::
; Don't do anything if there were line clears ; Don't do anything if there were line clears
ldh a, [hLineClearCt] ldh a, [hLineClearCt]
cp a, 0 or a, a
jr nz, .are jr nz, .are
; Otherwise, reset the combo. ; Otherwise, reset the combo.
@ -4441,7 +4441,7 @@ BigFieldDelay::
ldh a, [hRemainingDelay] ldh a, [hRemainingDelay]
dec a dec a
ldh [hRemainingDelay], a ldh [hRemainingDelay], a
cp a, 0 or a, a
jp nz, BigWidenField jp nz, BigWidenField
; Add one level if we're not at a breakpoint and not in MYCO speed curve. ; Add one level if we're not at a breakpoint and not in MYCO speed curve.

View File

@ -461,7 +461,7 @@ GBCGameplayProcess::
ld d, a ld d, a
jr .colorfield jr .colorfield
: ldh a, [hCurrentFractionalGravity] : ldh a, [hCurrentFractionalGravity]
cp a, 0 or a, a
jr nz, .colorfield jr nz, .colorfield
ld a, $05 ld a, $05
ld d, a ld d, a
@ -677,7 +677,7 @@ GBCBigGameplayProcess::
ld d, a ld d, a
jr .colorfield jr .colorfield
: ldh a, [hCurrentFractionalGravity] : ldh a, [hCurrentFractionalGravity]
cp a, 0 or a, a
jr nz, .colorfield jr nz, .colorfield
ld a, $05 ld a, $05
ld d, a ld d, a

View File

@ -405,7 +405,7 @@ UpdateGradeDMGT::
; Did we have line clears? ; Did we have line clears?
.checklineclears .checklineclears
ldh a, [hLineClearCt] ldh a, [hLineClearCt]
cp a, 0 or a, a
jp z, DrawGradeProgressDMGT jp z, DrawGradeProgressDMGT
; Bail if we're already GM. ; Bail if we're already GM.
@ -637,7 +637,7 @@ UpdateGradeDMGT::
DecayGradeDMGT:: DecayGradeDMGT::
; Bail if the gauge is empty. ; Bail if the gauge is empty.
ld a, [wGradeGauge] ld a, [wGradeGauge]
cp a, 0 or a, a
jp z, DrawGradeProgressDMGT jp z, DrawGradeProgressDMGT
; Bail if we're already GM. ; Bail if we're already GM.
@ -691,7 +691,7 @@ UpdateGradeTGM1:
; Bail if we didn't make the 999 check. ; Bail if we didn't make the 999 check.
ld a, [wTGM1level999RequirementMet] ld a, [wTGM1level999RequirementMet]
cp a, 0 or a, a
ret nz ret nz
; Skip to GM check if already S9. ; Skip to GM check if already S9.
@ -770,7 +770,7 @@ UpdateGradeTGM1:
; Have we judged the requirement before? ; Have we judged the requirement before?
ld a, [wTGM1level300RequirementMet] ld a, [wTGM1level300RequirementMet]
cp a, 0 or a, a
jr nz, .check500 jr nz, .check500
; Rank? ; Rank?
@ -804,7 +804,7 @@ UpdateGradeTGM1:
; Have we judged the requirement before? ; Have we judged the requirement before?
ld a, [wTGM1level500RequirementMet] ld a, [wTGM1level500RequirementMet]
cp a, 0 or a, a
jr nz, .check999 jr nz, .check999
; Rank? ; Rank?
@ -844,7 +844,7 @@ UpdateGradeTGM1:
; Have we judged the requirement before? ; Have we judged the requirement before?
ld a, [wTGM1level999RequirementMet] ld a, [wTGM1level999RequirementMet]
cp a, 0 or a, a
ret nz ret nz
; Did both other checks succeed? ; Did both other checks succeed?
@ -988,7 +988,7 @@ UpdateGradeSHIR:
; We don't give out a grade until level 100. ; We don't give out a grade until level 100.
ldh a, [hCLevel+CLEVEL_HUNDREDS] ; Level, hundreds digit. ldh a, [hCLevel+CLEVEL_HUNDREDS] ; Level, hundreds digit.
cp a, 0 or a, a
ret z ret z
; Get the hundreds and thousands of the level as a hex number. ; Get the hundreds and thousands of the level as a hex number.

View File

@ -246,7 +246,7 @@ InsertHiScore::
; Copy the top rows to the working data. ; Copy the top rows to the working data.
.copyupper .copyupper
ld a, [wInsertTarget] ld a, [wInsertTarget]
cp a, 0 or a, a
jr z, .findrow jr z, .findrow
ld hl, 0 ld hl, 0
ld bc, HISCORE_ENTRY_SIZE ld bc, HISCORE_ENTRY_SIZE
@ -267,7 +267,7 @@ InsertHiScore::
ld hl, wWorkingCopy ld hl, wWorkingCopy
ld bc, HISCORE_ENTRY_SIZE ld bc, HISCORE_ENTRY_SIZE
ld a, [wInsertTarget] ld a, [wInsertTarget]
cp a, 0 or a, a
jr z, .insert jr z, .insert
: add hl, bc : add hl, bc
dec a dec a
@ -350,7 +350,7 @@ GetHiScoreEntry::
ld h, a ld h, a
ld bc, HISCORE_ENTRY_SIZE ld bc, HISCORE_ENTRY_SIZE
ld a, [wWorkingIdx] ld a, [wWorkingIdx]
cp a, 0 or a, a
jr z, .store jr z, .store
: add hl, bc : add hl, bc
dec a dec a

View File

@ -215,45 +215,45 @@ GetInput::
.dlru .dlru
ldh a, [hDownState] ldh a, [hDownState]
cp a, 0 or a, a
jr nz, .zerolru jr nz, .zerolru
ldh a, [hLeftState] ldh a, [hLeftState]
cp a, 0 or a, a
jr nz, .zeroud jr nz, .zeroud
ldh a, [hRightState] ldh a, [hRightState]
cp a, 0 or a, a
ret z ret z
jr .zeroud jr .zeroud
.ulrd .ulrd
ldh a, [hUpState] ldh a, [hUpState]
cp a, 0 or a, a
jr nz, .zerolrd jr nz, .zerolrd
ldh a, [hLeftState] ldh a, [hLeftState]
cp a, 0 or a, a
jr nz, .zeroud jr nz, .zeroud
ldh a, [hRightState] ldh a, [hRightState]
cp a, 0 or a, a
ret z ret z
jr .zeroud jr .zeroud
.lrud .lrud
ldh a, [hRightState] ldh a, [hRightState]
cp a, 0 or a, a
jr nz, .zeroud jr nz, .zeroud
ldh a, [hLeftState] ldh a, [hLeftState]
cp a, 0 or a, a
ret z ret z
jr .zeroud jr .zeroud
.udlr .udlr
ldh a, [hUpState] ldh a, [hUpState]
cp a, 0 or a, a
jr nz, .zerolr jr nz, .zerolr
ldh a, [hLeftState] ldh a, [hLeftState]
cp a, 0 or a, a
ret z ret z
jr .zerolr jr .zerolr

View File

@ -493,7 +493,7 @@ AdjustSpeedCurveForced:
; Do we want to force 20G? ; Do we want to force 20G?
ld a, [wAlways20GState] ld a, [wAlways20GState]
cp a, 0 or a, a
jr z, .continue jr z, .continue
ld a, 20 ld a, 20
ldh [hCurrentIntegerGravity], a ldh [hCurrentIntegerGravity], a
@ -511,7 +511,7 @@ AdjustSpeedCurveForced:
BuildTrueCLevel: BuildTrueCLevel:
; Except in TGM3 mode, this will always just be the same as the real level, so check for the most common case and bail. ; Except in TGM3 mode, this will always just be the same as the real level, so check for the most common case and bail.
ld a, [wSkippedSectionsBCD] ld a, [wSkippedSectionsBCD]
cp a, 0 or a, a
ret z ret z
; Otherwise, to the thing. ; Otherwise, to the thing.

View File

@ -253,7 +253,7 @@ SECTION "Progress Functions", ROM0
; Progress in A, 0-32. ; Progress in A, 0-32.
SetProgress:: SetProgress::
ld hl, sProgressData ld hl, sProgressData
cp a, 0 or a, a
jr z, .correct jr z, .correct
ld b, a ld b, a
ld de, 10 ld de, 10

View File

@ -226,7 +226,7 @@ ApplyNext::
ld hl, sPieceXOffsets ld hl, sPieceXOffsets
ld de, sPieceYOffsets ld de, sPieceYOffsets
.postoffsets .postoffsets
cp 0 or a, a
jr z, .skipoffn jr z, .skipoffn
.getoffn .getoffn
inc hl inc hl
@ -369,7 +369,7 @@ ApplyHold::
ld a, b ld a, b
jr z, .show jr z, .show
ldh a, [hEvenFrame] ldh a, [hEvenFrame]
cp a, 0 or a, a
ld a, b ld a, b
jr z, .show jr z, .show
@ -405,7 +405,7 @@ ApplyHold::
ld hl, sPieceXOffsets ld hl, sPieceXOffsets
ld de, sPieceYOffsets ld de, sPieceYOffsets
.postoffsets .postoffsets
cp 0 or a, a
jr z, .skipoffh jr z, .skipoffh
.getoffh .getoffh
inc hl inc hl
@ -607,7 +607,7 @@ ApplyNumbers8::
ld bc, 4 ld bc, 4
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .one jr nz, .one
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -615,7 +615,7 @@ ApplyNumbers8::
inc de inc de
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .two jr nz, .two
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -623,7 +623,7 @@ ApplyNumbers8::
inc de inc de
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .three jr nz, .three
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -631,7 +631,7 @@ ApplyNumbers8::
inc de inc de
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .four jr nz, .four
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -639,7 +639,7 @@ ApplyNumbers8::
inc de inc de
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .five jr nz, .five
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -647,7 +647,7 @@ ApplyNumbers8::
inc de inc de
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .six jr nz, .six
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -655,7 +655,7 @@ ApplyNumbers8::
inc de inc de
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .seven jr nz, .seven
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -729,7 +729,7 @@ ApplyNumbers4::
ld bc, 4 ld bc, 4
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .one jr nz, .one
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -737,7 +737,7 @@ ApplyNumbers4::
inc de inc de
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .two jr nz, .two
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -745,7 +745,7 @@ ApplyNumbers4::
inc de inc de
ld a, [de] ld a, [de]
cp a, 0 or a, a
jr nz, .three jr nz, .three
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl], a
@ -1008,10 +1008,10 @@ GradeRendering::
; If the effect timer is greater than 0 and on even frames, decrement it and do some palette magic. ; If the effect timer is greater than 0 and on even frames, decrement it and do some palette magic.
ldh a, [hFrameCtr] ldh a, [hFrameCtr]
cp a, 0 or a, a
jr z, .noeffect jr z, .noeffect
ld a, [wEffectTimer] ld a, [wEffectTimer]
cp a, 0 or a, a
jr z, .noeffect jr z, .noeffect
dec a dec a
ld [wEffectTimer], a ld [wEffectTimer], a

View File

@ -97,7 +97,7 @@ RestoreSRAM::
cp a, "T" cp a, "T"
jp nz, InitializeSRAM jp nz, InitializeSRAM
ld a, [rCheck+4] ld a, [rCheck+4]
cp a, 0 or a, a
jp nz, InitializeSRAM jp nz, InitializeSRAM
ld a, [rCheck+5] ld a, [rCheck+5]
cp a, 4 cp a, 4
@ -446,7 +446,7 @@ ChangeProfile::
.backup .backup
ld [wTarget], a ld [wTarget], a
ld a, [rLastProfile] ld a, [rLastProfile]
cp a, 0 or a, a
jr z, .first jr z, .first
cp a, 1 cp a, 1
jr z, .second jr z, .second
@ -541,7 +541,7 @@ ChangeProfile::
.restore .restore
ld a, [wTarget] ld a, [wTarget]
ld [rLastProfile], a ld [rLastProfile], a
cp a, 0 or a, a
jr z, .lfirst jr z, .lfirst
cp a, 1 cp a, 1
jr z, .lsecond jr z, .lsecond

View File

@ -290,7 +290,7 @@ GamePlayEventLoopHandlerB::
; Apply the hold if so. ; Apply the hold if so.
.checkIHS .checkIHS
ldh a, [hSelectState] ldh a, [hSelectState]
cp a, 0 or a, a
jr z, .loaddefaultjingle jr z, .loaddefaultjingle
call DoHold call DoHold
jr .postjingle jr .postjingle
@ -304,18 +304,18 @@ GamePlayEventLoopHandlerB::
; Apply the rotation if so. ; Apply the rotation if so.
.checkIRSA .checkIRSA
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .lda1 jr z, .lda1
.ldb1 .ldb1
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .checkIRSB jr z, .checkIRSB
ld a, $FF ld a, $FF
ldh [hBState], a ldh [hBState], a
jr .cp1 jr .cp1
.lda1 .lda1
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .checkIRSB jr z, .checkIRSB
ld a, $FF ld a, $FF
ldh [hAState], a ldh [hAState], a
@ -331,18 +331,18 @@ GamePlayEventLoopHandlerB::
.checkIRSB .checkIRSB
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .ldb2 jr z, .ldb2
.lda2 .lda2
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .postjingle jr z, .postjingle
ld a, $FF ld a, $FF
ldh [hAState], a ldh [hAState], a
jr .cp2 jr .cp2
.ldb2 .ldb2
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .postjingle jr z, .postjingle
ld a, $FF ld a, $FF
ldh [hBState], a ldh [hBState], a
@ -421,7 +421,7 @@ GamePlayEventLoopHandlerB::
; Do we go into delay state? ; Do we go into delay state?
.nohold .nohold
ldh a, [hCurrentLockDelayRemaining] ldh a, [hCurrentLockDelayRemaining]
cp a, 0 or a, a
jp nz, .drawStaticInfo jp nz, .drawStaticInfo
ld a, MODE_DELAY ld a, MODE_DELAY
ldh [hMode], a ldh [hMode], a
@ -445,7 +445,7 @@ GamePlayEventLoopHandlerB::
call FieldDelay call FieldDelay
ldh a, [hRemainingDelay] ldh a, [hRemainingDelay]
cp a, 0 or a, a
jp nz, .drawStaticInfo jp nz, .drawStaticInfo
ld a, [wInStaffRoll] ld a, [wInStaffRoll]
cp a, $FF cp a, $FF
@ -619,14 +619,14 @@ GamePlayEventLoopHandlerB::
.gameOverMode .gameOverMode
; Wait for A and B to not be held down. ; Wait for A and B to not be held down.
ld a, [wGameOverIgnoreInput] ld a, [wGameOverIgnoreInput]
cp a, 0 or a, a
jr z, .checkretry jr z, .checkretry
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jp nz, .drawStaticInfo jp nz, .drawStaticInfo
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jp nz, .drawStaticInfo jp nz, .drawStaticInfo
xor a, a xor a, a
@ -665,13 +665,13 @@ GamePlayEventLoopHandlerB::
.pauseMode .pauseMode
; Quick reset. ; Quick reset.
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .noqr jr z, .noqr
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .noqr jr z, .noqr
ldh a, [hSelectState] ldh a, [hSelectState]
cp a, 0 or a, a
jr z, .noqr jr z, .noqr
jp SwitchToTitle jp SwitchToTitle
@ -807,18 +807,18 @@ DoHold:
; Apply the rotation if so. ; Apply the rotation if so.
.checkIRSA .checkIRSA
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .lda3 jr z, .lda3
.ldb3 .ldb3
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .checkIRSB jr z, .checkIRSB
ld a, $FF ld a, $FF
ldh [hBState], a ldh [hBState], a
jr .cp3 jr .cp3
.lda3 .lda3
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .checkIRSB jr z, .checkIRSB
ld a, $FF ld a, $FF
ldh [hAState], a ldh [hAState], a
@ -832,18 +832,18 @@ DoHold:
.checkIRSB .checkIRSB
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .ldb4 jr z, .ldb4
.lda4 .lda4
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .noRotation jr z, .noRotation
ld a, $FF ld a, $FF
ldh [hAState], a ldh [hAState], a
jr .cp4 jr .cp4
.ldb4 .ldb4
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .noRotation jr z, .noRotation
ld a, $FF ld a, $FF
ldh [hBState], a ldh [hBState], a
@ -1087,7 +1087,7 @@ GamePlayBigEventLoopHandlerB:
; Apply the hold if so. ; Apply the hold if so.
.checkIHS .checkIHS
ldh a, [hSelectState] ldh a, [hSelectState]
cp a, 0 or a, a
jr z, .loaddefaultjingle jr z, .loaddefaultjingle
call BigDoHold call BigDoHold
jr .postjingle jr .postjingle
@ -1101,18 +1101,18 @@ GamePlayBigEventLoopHandlerB:
; Apply the rotation if so. ; Apply the rotation if so.
.checkIRSA .checkIRSA
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .lda1 jr z, .lda1
.ldb1 .ldb1
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .checkIRSB jr z, .checkIRSB
ld a, $FF ld a, $FF
ldh [hBState], a ldh [hBState], a
jr .cp1 jr .cp1
.lda1 .lda1
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .checkIRSB jr z, .checkIRSB
ld a, $FF ld a, $FF
ldh [hAState], a ldh [hAState], a
@ -1128,18 +1128,18 @@ GamePlayBigEventLoopHandlerB:
.checkIRSB .checkIRSB
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .ldb2 jr z, .ldb2
.lda2 .lda2
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .postjingle jr z, .postjingle
ld a, $FF ld a, $FF
ldh [hAState], a ldh [hAState], a
jr .cp2 jr .cp2
.ldb2 .ldb2
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .postjingle jr z, .postjingle
ld a, $FF ld a, $FF
ldh [hBState], a ldh [hBState], a
@ -1218,7 +1218,7 @@ GamePlayBigEventLoopHandlerB:
; Do we go into delay state? ; Do we go into delay state?
.nohold .nohold
ldh a, [hCurrentLockDelayRemaining] ldh a, [hCurrentLockDelayRemaining]
cp a, 0 or a, a
jp nz, .drawStaticInfo jp nz, .drawStaticInfo
ld a, MODE_DELAY ld a, MODE_DELAY
ldh [hMode], a ldh [hMode], a
@ -1240,7 +1240,7 @@ GamePlayBigEventLoopHandlerB:
call BigFieldDelay call BigFieldDelay
ldh a, [hRemainingDelay] ldh a, [hRemainingDelay]
cp a, 0 or a, a
jp nz, .drawStaticInfo jp nz, .drawStaticInfo
ld a, [wInStaffRoll] ld a, [wInStaffRoll]
cp a, $FF cp a, $FF
@ -1415,14 +1415,14 @@ GamePlayBigEventLoopHandlerB:
.gameOverMode .gameOverMode
; Wait for A and B to not be held down. ; Wait for A and B to not be held down.
ld a, [wGameOverIgnoreInput] ld a, [wGameOverIgnoreInput]
cp a, 0 or a, a
jr z, .checkretry jr z, .checkretry
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jp nz, .drawStaticInfo jp nz, .drawStaticInfo
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jp nz, .drawStaticInfo jp nz, .drawStaticInfo
xor a, a xor a, a
@ -1481,13 +1481,13 @@ GamePlayBigEventLoopHandlerB:
.pauseMode .pauseMode
; Quick reset. ; Quick reset.
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .noqr jr z, .noqr
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .noqr jr z, .noqr
ldh a, [hSelectState] ldh a, [hSelectState]
cp a, 0 or a, a
jr z, .noqr jr z, .noqr
jp SwitchToTitle jp SwitchToTitle
@ -1618,18 +1618,18 @@ BigDoHold:
; Apply the rotation if so. ; Apply the rotation if so.
.checkIRSA .checkIRSA
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .lda3 jr z, .lda3
.ldb3 .ldb3
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .checkIRSB jr z, .checkIRSB
ld a, $FF ld a, $FF
ldh [hBState], a ldh [hBState], a
jr .cp3 jr .cp3
.lda3 .lda3
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .checkIRSB jr z, .checkIRSB
ld a, $FF ld a, $FF
ldh [hAState], a ldh [hAState], a
@ -1643,18 +1643,18 @@ BigDoHold:
.checkIRSB .checkIRSB
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, .ldb4 jr z, .ldb4
.lda4 .lda4
ldh a, [hAState] ldh a, [hAState]
cp a, 0 or a, a
jr z, .noRotation jr z, .noRotation
ld a, $FF ld a, $FF
ldh [hAState], a ldh [hAState], a
jr .cp4 jr .cp4
.ldb4 .ldb4
ldh a, [hBState] ldh a, [hBState]
cp a, 0 or a, a
jr z, .noRotation jr z, .noRotation
ld a, $FF ld a, $FF
ldh [hBState], a ldh [hBState], a

View File

@ -899,7 +899,7 @@ TitleVBlankHandlerB:
ld a, [wSelected] ld a, [wSelected]
ld hl, sTetryButtons ld hl, sTetryButtons
ld bc, 64 ld bc, 64
: cp a, 0 : or a, a
jr z, .donetetry jr z, .donetetry
dec a dec a
add hl, bc add hl, bc
@ -925,7 +925,7 @@ TitleVBlankHandlerB:
ld b, TITLE_RECORDS_RESET_BASE ld b, TITLE_RECORDS_RESET_BASE
ld [hl], b ld [hl], b
ldh a, [hSelectState] ldh a, [hSelectState]
cp a, 0 or a, a
ret z ret z
inc b inc b
ld [hl], b ld [hl], b
@ -1005,7 +1005,7 @@ MainHandleA:
MainHandleUp: MainHandleUp:
ld a, [wSelected] ld a, [wSelected]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wSelected], a ld [wSelected], a
@ -1055,7 +1055,7 @@ SettingsHandleDown:
SettingsHandleUp: SettingsHandleUp:
ld a, [wSelected] ld a, [wSelected]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wSelected], a ld [wSelected], a
@ -1092,7 +1092,7 @@ SettingsHandleLeft:
.buttons .buttons
ld a, [wSwapABState] ld a, [wSwapABState]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wSwapABState], a ld [wSwapABState], a
@ -1105,7 +1105,7 @@ SettingsHandleLeft:
.rng .rng
ld a, [wRNGModeState] ld a, [wRNGModeState]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wRNGModeState], a ld [wRNGModeState], a
@ -1118,7 +1118,7 @@ SettingsHandleLeft:
.rot .rot
ld a, [wRotModeState] ld a, [wRotModeState]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wRotModeState], a ld [wRotModeState], a
@ -1131,7 +1131,7 @@ SettingsHandleLeft:
.drop .drop
ld a, [wDropModeState] ld a, [wDropModeState]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wDropModeState], a ld [wDropModeState], a
@ -1144,7 +1144,7 @@ SettingsHandleLeft:
.curve .curve
ld a, [wSpeedCurveState] ld a, [wSpeedCurveState]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wSpeedCurveState], a ld [wSpeedCurveState], a
@ -1159,7 +1159,7 @@ SettingsHandleLeft:
.hig .hig
ld a, [wAlways20GState] ld a, [wAlways20GState]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wAlways20GState], a ld [wAlways20GState], a
@ -1172,7 +1172,7 @@ SettingsHandleLeft:
.filter .filter
ldh a, [hFilterMode] ldh a, [hFilterMode]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ldh [hFilterMode], a ldh [hFilterMode], a
@ -1462,7 +1462,7 @@ ProfileHandleDown:
ProfileHandleUp: ProfileHandleUp:
ld a, [wSelected] ld a, [wSelected]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wSelected], a ld [wSelected], a
@ -1627,7 +1627,7 @@ RecordsHandleLeft:
ld [wDisplayingScoreMode], a ld [wDisplayingScoreMode], a
ld [wScoreFlipTimer], a ld [wScoreFlipTimer], a
ld a, [wSelected] ld a, [wSelected]
cp a, 0 or a, a
jr z, :+ jr z, :+
dec a dec a
ld [wSelected], a ld [wSelected], a

View File

@ -110,7 +110,7 @@ CheckTorikan::
; Okay if frames are exactly 0. ; Okay if frames are exactly 0.
ld a, [wFrames] ld a, [wFrames]
cp a, 0 or a, a
jr z, .success jr z, .success
.failure .failure