Optimizations: ld a, 0 -> xor a, a

This commit is contained in:
Randy Thiemann 2023-11-13 03:35:09 +01:00
parent 932666b5bb
commit 7503937b22
10 changed files with 2081 additions and 2081 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

@ -4667,7 +4667,7 @@ BigClearLines:
ld [hl+], a
ld [hl+], a
ld [hl+], a
ld a, 0
xor a, a
ld [hl+], a
ld [hl+], a
ld [hl+], a

View File

@ -109,7 +109,7 @@ ToATTR::
ldh [rHDMA4], a
ld a, 41
ldh [rHDMA5], a
ld a, 0
xor a, a
ldh [rVBK], a
ret
@ -268,7 +268,7 @@ GBCTitleProcess::
inc a
cp a, $07
jr c, .nores
ld a, $00
xor a, a
.nores
ld [wTitlePal], a
.noinc
@ -303,7 +303,7 @@ GBCTitleProcess::
inc a
cp a, $07
jr c, .nores3
ld a, $00
xor a, a
.nores3
ld [wTitlePal], a
.noinc3
@ -338,7 +338,7 @@ GBCTitleProcess::
inc a
cp a, $07
jr c, .nores1
ld a, $00
xor a, a
.nores1
ld [wTitlePal], a
.noinc1
@ -373,7 +373,7 @@ GBCTitleProcess::
inc a
cp a, $07
jr c, .nores4
ld a, $00
xor a, a
.nores4
ld [wTitlePal], a
.noinc4
@ -395,7 +395,7 @@ GBCTitleProcess::
inc a
cp a, $07
jr c, .nores2
ld a, $00
xor a, a
.nores2
ld [wTitlePal], a
.noinc2
@ -429,11 +429,11 @@ GBCGameplayProcess::
jr z, .goverride
ld a, [wSpeedCurveState]
cp a, SCURVE_DEAT
ld a, $00 ;Red
xor a, a ;Red
jr z, .goverride
ld a, [wSpeedCurveState]
cp a, SCURVE_SHIR
ld a, $00 ;Red
xor a, a ;Red
jr z, .goverride ;Always red
ld a, [wSpeedCurveState]
cp a, SCURVE_CHIL
@ -447,7 +447,7 @@ GBCGameplayProcess::
ldh a, [hCurrentIntegerGravity]
cp a, 20
jr c, :+
ld a, $00
xor a, a
ld d, a
jr .colorfield
: cp a, 3
@ -645,11 +645,11 @@ GBCBigGameplayProcess::
jr z, .goverride
ld a, [wSpeedCurveState]
cp a, SCURVE_DEAT
ld a, $00 ;Red
xor a, a ;Red
jr z, .goverride
ld a, [wSpeedCurveState]
cp a, SCURVE_SHIR
ld a, $00 ;Red
xor a, a ;Red
jr z, .goverride ;Always red
ld a, [wSpeedCurveState]
cp a, SCURVE_CHIL
@ -663,7 +663,7 @@ GBCBigGameplayProcess::
ldh a, [hCurrentIntegerGravity]
cp a, 20
jr c, :+
ld a, $00
xor a, a
ld d, a
jr .colorfield
: cp a, 3
@ -860,7 +860,7 @@ ToVRAM::
ldh [rHDMA5], a
; Bank 0
ld a, 0
xor a, a
ldh [rVBK], a
ld a, HIGH(wShadowTilemap)
ldh [rHDMA1], a

View File

@ -497,7 +497,7 @@ AdjustSpeedCurveForced:
jr z, .continue
ld a, 20
ldh [hCurrentIntegerGravity], a
ld a, $00
xor a, a
ldh [hCurrentFractionalGravity], a
.continue

View File

@ -331,7 +331,7 @@ GetNextTGM3Piece:
jr z, :+ ; Same.
jr c, :+ ; Nope.
ld e, a
ld a, 0
xor a, a
ld [wTGM3WorstDroughtIdx], a
; Is idx 1 worse?

View File

@ -163,7 +163,7 @@ ApplyTells::
ld [wSPRModeRot+3], a
ld a, 4
ld [wSPRModeDrop+3], a
ld a, 0
xor a, a
ld [wSPRModeHiG+3], a
ret

View File

@ -230,7 +230,7 @@ InitializeSRAM:
ld [rCheck+2], a
ld a, "T"
ld [rCheck+3], a
ld a, 0
xor a, a
ld [rCheck+4], a
ld a, 4
ld [rCheck+5], a