Save 8 bytes in the CGB boot ROM

This commit is contained in:
Jakub Kądziołka 2020-05-03 22:41:56 +02:00
parent bb37f8d2f0
commit 19126df7f4
No known key found for this signature in database
GPG Key ID: E315A75846131564

View File

@ -984,14 +984,13 @@ BrightenColor:
and $1F and $1F
cp $1F cp $1F
jr nz, .blueNotMaxed jr nz, .blueNotMaxed
res 0, c dec c
.blueNotMaxed .blueNotMaxed
; Is green maxed? ; Is green maxed?
ld a, e ld a, e
and $E0
cp $E0 cp $E0
jr nz, .greenNotMaxed jr c, .greenNotMaxed
ld a, d ld a, d
and $3 and $3
cp $3 cp $3
@ -1007,18 +1006,13 @@ BrightenColor:
res 2, b res 2, b
.redNotMaxed .redNotMaxed
; Add de to bc ; add de, bc
push hl ; ld [hli], de
ld h, d
ld l, e
add hl, bc
ld d, h
ld e, l
pop hl
ld a, e ld a, e
add c
ld [hli], a ld [hli], a
ld a, d ld a, d
adc b
ld [hli], a ld [hli], a
ret ret