Remove unnecessary DMG and SGB checking (#7)

This commit is contained in:
xCrystal
2023-07-26 14:29:16 +02:00
parent 15f452ff26
commit acd022d765
30 changed files with 10 additions and 713 deletions

View File

@@ -670,12 +670,7 @@ AnimateFlowerTile:
; A cycle of 2 frames, updating every other tick
ld a, [wTileAnimationTimer]
and %10
; CGB has different tile graphics for flowers
ld e, a
ldh a, [hCGB]
and 1
add e
srl a
; hl = .FlowerTileFrames + a * 16
swap a
@@ -690,9 +685,7 @@ AnimateFlowerTile:
jp WriteTile
.FlowerTileFrames:
INCBIN "gfx/tilesets/flower/dmg_1.2bpp"
INCBIN "gfx/tilesets/flower/cgb_1.2bpp"
INCBIN "gfx/tilesets/flower/dmg_2.2bpp"
INCBIN "gfx/tilesets/flower/cgb_2.2bpp"
AnimateLavaBubbleTile1:
@@ -905,11 +898,6 @@ endr
AnimateWaterPalette:
; Transition between color values 0-2 for color 0 in palette 3.
; Don't update the palette on DMG
ldh a, [hCGB]
and a
ret z
; Don't update a non-standard palette order
ldh a, [rBGP]
cp %11100100
@@ -968,11 +956,6 @@ AnimateWaterPalette:
ret
FlickeringCaveEntrancePalette:
; Don't update the palette on DMG
ldh a, [hCGB]
and a
ret z
; Don't update a non-standard palette order
ldh a, [rBGP]
cp %11100100

View File

@@ -298,82 +298,11 @@ ConvertTimePalsDecHL:
ret
GetTimePalFade:
; check cgb
ldh a, [hCGB]
and a
jr nz, .cgb
; else: dmg
; index
ld a, [wTimeOfDayPal]
and %11
; get fade table
push bc
ld c, a
ld b, 0
ld hl, .dmgfades
add hl, bc
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
pop bc
; get place in fade table
ld b, 0
add hl, bc
ret
.cgb
ld hl, .cgbfade
ld b, 0
add hl, bc
ret
.dmgfades
dw .morn
dw .day
dw .nite
dw .darkness
.morn
dc 3,3,3,3, 3,3,3,3, 3,3,3,3
dc 3,3,3,2, 3,3,3,2, 3,3,3,2
dc 3,3,2,1, 3,2,1,0, 3,2,1,0
dc 3,2,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