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 [hl+], a
ld [hl+], a ld [hl+], a
ld a, 0 xor a, a
ld [hl+], a ld [hl+], a
ld [hl+], a ld [hl+], a
ld [hl+], a ld [hl+], a

View File

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

View File

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

View File

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

View File

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

View File

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