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

View File

@ -405,7 +405,7 @@ UpdateGradeDMGT::
; Did we have line clears?
.checklineclears
ldh a, [hLineClearCt]
cp a, 0
or a, a
jp z, DrawGradeProgressDMGT
; Bail if we're already GM.
@ -637,7 +637,7 @@ UpdateGradeDMGT::
DecayGradeDMGT::
; Bail if the gauge is empty.
ld a, [wGradeGauge]
cp a, 0
or a, a
jp z, DrawGradeProgressDMGT
; Bail if we're already GM.
@ -691,7 +691,7 @@ UpdateGradeTGM1:
; Bail if we didn't make the 999 check.
ld a, [wTGM1level999RequirementMet]
cp a, 0
or a, a
ret nz
; Skip to GM check if already S9.
@ -770,7 +770,7 @@ UpdateGradeTGM1:
; Have we judged the requirement before?
ld a, [wTGM1level300RequirementMet]
cp a, 0
or a, a
jr nz, .check500
; Rank?
@ -804,7 +804,7 @@ UpdateGradeTGM1:
; Have we judged the requirement before?
ld a, [wTGM1level500RequirementMet]
cp a, 0
or a, a
jr nz, .check999
; Rank?
@ -844,7 +844,7 @@ UpdateGradeTGM1:
; Have we judged the requirement before?
ld a, [wTGM1level999RequirementMet]
cp a, 0
or a, a
ret nz
; Did both other checks succeed?
@ -988,7 +988,7 @@ UpdateGradeSHIR:
; We don't give out a grade until level 100.
ldh a, [hCLevel+CLEVEL_HUNDREDS] ; Level, hundreds digit.
cp a, 0
or a, a
ret z
; 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.
.copyupper
ld a, [wInsertTarget]
cp a, 0
or a, a
jr z, .findrow
ld hl, 0
ld bc, HISCORE_ENTRY_SIZE
@ -267,7 +267,7 @@ InsertHiScore::
ld hl, wWorkingCopy
ld bc, HISCORE_ENTRY_SIZE
ld a, [wInsertTarget]
cp a, 0
or a, a
jr z, .insert
: add hl, bc
dec a
@ -350,7 +350,7 @@ GetHiScoreEntry::
ld h, a
ld bc, HISCORE_ENTRY_SIZE
ld a, [wWorkingIdx]
cp a, 0
or a, a
jr z, .store
: add hl, bc
dec a

View File

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

View File

@ -493,7 +493,7 @@ AdjustSpeedCurveForced:
; Do we want to force 20G?
ld a, [wAlways20GState]
cp a, 0
or a, a
jr z, .continue
ld a, 20
ldh [hCurrentIntegerGravity], a
@ -511,7 +511,7 @@ AdjustSpeedCurveForced:
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.
ld a, [wSkippedSectionsBCD]
cp a, 0
or a, a
ret z
; Otherwise, to the thing.

View File

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

View File

@ -226,7 +226,7 @@ ApplyNext::
ld hl, sPieceXOffsets
ld de, sPieceYOffsets
.postoffsets
cp 0
or a, a
jr z, .skipoffn
.getoffn
inc hl
@ -369,7 +369,7 @@ ApplyHold::
ld a, b
jr z, .show
ldh a, [hEvenFrame]
cp a, 0
or a, a
ld a, b
jr z, .show
@ -405,7 +405,7 @@ ApplyHold::
ld hl, sPieceXOffsets
ld de, sPieceYOffsets
.postoffsets
cp 0
or a, a
jr z, .skipoffh
.getoffh
inc hl
@ -607,7 +607,7 @@ ApplyNumbers8::
ld bc, 4
ld a, [de]
cp a, 0
or a, a
jr nz, .one
ld a, TILE_BLANK
ld [hl], a
@ -615,7 +615,7 @@ ApplyNumbers8::
inc de
ld a, [de]
cp a, 0
or a, a
jr nz, .two
ld a, TILE_BLANK
ld [hl], a
@ -623,7 +623,7 @@ ApplyNumbers8::
inc de
ld a, [de]
cp a, 0
or a, a
jr nz, .three
ld a, TILE_BLANK
ld [hl], a
@ -631,7 +631,7 @@ ApplyNumbers8::
inc de
ld a, [de]
cp a, 0
or a, a
jr nz, .four
ld a, TILE_BLANK
ld [hl], a
@ -639,7 +639,7 @@ ApplyNumbers8::
inc de
ld a, [de]
cp a, 0
or a, a
jr nz, .five
ld a, TILE_BLANK
ld [hl], a
@ -647,7 +647,7 @@ ApplyNumbers8::
inc de
ld a, [de]
cp a, 0
or a, a
jr nz, .six
ld a, TILE_BLANK
ld [hl], a
@ -655,7 +655,7 @@ ApplyNumbers8::
inc de
ld a, [de]
cp a, 0
or a, a
jr nz, .seven
ld a, TILE_BLANK
ld [hl], a
@ -729,7 +729,7 @@ ApplyNumbers4::
ld bc, 4
ld a, [de]
cp a, 0
or a, a
jr nz, .one
ld a, TILE_BLANK
ld [hl], a
@ -737,7 +737,7 @@ ApplyNumbers4::
inc de
ld a, [de]
cp a, 0
or a, a
jr nz, .two
ld a, TILE_BLANK
ld [hl], a
@ -745,7 +745,7 @@ ApplyNumbers4::
inc de
ld a, [de]
cp a, 0
or a, a
jr nz, .three
ld a, TILE_BLANK
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.
ldh a, [hFrameCtr]
cp a, 0
or a, a
jr z, .noeffect
ld a, [wEffectTimer]
cp a, 0
or a, a
jr z, .noeffect
dec a
ld [wEffectTimer], a

View File

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

View File

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

View File

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

View File

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