Organize the engine/ directory, take 3

Renamed `title` to `movies`.
Moved some functions from `engine/routines/` to their fitting
directories, and cleaned up the base `engine/` directory.
Moved `engine/pokemon/tmhm.asm` back to `engine/items/`.

Made a new subdirectory:
* engine/tilesets: Contains all map-related graphics routines.
This commit is contained in:
mid-kid
2018-03-25 16:18:33 +02:00
parent 60e21a8663
commit 0d9241889f
36 changed files with 648 additions and 648 deletions

View File

@@ -203,7 +203,7 @@ Function49496: ; 49496
ret
; 494ac
INCLUDE "engine/gfx/tileset_palettes.asm"
INCLUDE "engine/tilesets/tileset_palettes.asm"
MG_Mobile_Layout02: ; 49706
ld hl, .Palette_49732

626
engine/gfx/dma_transfer.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -1,368 +0,0 @@
EvolutionAnimation: ; 4e5e1
push hl
push de
push bc
ld a, [wCurSpecies]
push af
ld a, [rOBP0]
push af
ld a, [wBaseDexNo]
push af
call .EvolutionAnimation
pop af
ld [wBaseDexNo], a
pop af
ld [rOBP0], a
pop af
ld [wCurSpecies], a
pop bc
pop de
pop hl
ld a, [wEvolutionCanceled]
and a
ret z
scf
ret
; 4e607
.EvolutionAnimation: ; 4e607
ld a, %11100100
ld [rOBP0], a
ld de, MUSIC_NONE
call PlayMusic
farcall ClearSpriteAnims
ld de, .GFX
ld hl, vTiles0
lb bc, BANK(.GFX), 8
call Request2bpp
xor a
ld [wLowHealthAlarm], a
call WaitBGMap
xor a
ld [hBGMapMode], a
ld a, [wEvolutionOldSpecies]
ld [wPlayerHPPal], a
ld c, $0
call .GetSGBLayout
ld a, [wEvolutionOldSpecies]
ld [wCurPartySpecies], a
ld [wCurSpecies], a
call .PlaceFrontpic
ld de, vTiles2
ld hl, vTiles2 tile $31
ld bc, 7 * 7
call Request2bpp
ld a, 7 * 7
ld [wEvolutionPicOffset], a
call .ReplaceFrontpic
ld a, [wEvolutionNewSpecies]
ld [wCurPartySpecies], a
ld [wCurSpecies], a
call .LoadFrontpic
ld a, [wEvolutionOldSpecies]
ld [wCurPartySpecies], a
ld [wCurSpecies], a
ld a, $1
ld [hBGMapMode], a
call .check_statused
jr c, .skip_cry
ld a, [wEvolutionOldSpecies]
call PlayMonCry
.skip_cry
ld de, MUSIC_EVOLUTION
call PlayMusic
ld c, 80
call DelayFrames
ld c, $1
call .GetSGBLayout
call .AnimationSequence
jr c, .cancel_evo
ld a, -7 * 7
ld [wEvolutionPicOffset], a
call .ReplaceFrontpic
xor a
ld [wEvolutionCanceled], a
ld a, [wEvolutionNewSpecies]
ld [wPlayerHPPal], a
ld c, $0
call .GetSGBLayout
call .PlayEvolvedSFX
farcall ClearSpriteAnims
call .check_statused
jr c, .no_anim
ld a, [wBoxAlignment]
push af
ld a, $1
ld [wBoxAlignment], a
ld a, [wCurPartySpecies]
push af
ld a, [wPlayerHPPal]
ld [wCurPartySpecies], a
hlcoord 7, 2
ld d, $0
ld e, ANIM_MON_EVOLVE
predef AnimateFrontpic
pop af
ld [wCurPartySpecies], a
pop af
ld [wBoxAlignment], a
ret
.no_anim
ret
.cancel_evo
ld a, $1
ld [wEvolutionCanceled], a
ld a, [wEvolutionOldSpecies]
ld [wPlayerHPPal], a
ld c, $0
call .GetSGBLayout
call .PlayEvolvedSFX
farcall ClearSpriteAnims
call .check_statused
ret c
ld a, [wPlayerHPPal]
call PlayMonCry
ret
; 4e703
.GetSGBLayout: ; 4e703
ld b, SCGB_EVOLUTION
jp GetSGBLayout
; 4e708
.PlaceFrontpic: ; 4e708
call GetBaseData
hlcoord 7, 2
jp PrepMonFrontpic
; 4e711
.LoadFrontpic: ; 4e711
call GetBaseData
ld a, $1
ld [wBoxAlignment], a
ld de, vTiles2
predef GetAnimatedFrontpic
xor a
ld [wBoxAlignment], a
ret
; 4e726
.AnimationSequence: ; 4e726
call ClearJoypad
lb bc, 1, 2 * 7 ; flash b times, wait c frames in between
.loop
push bc
call .WaitFrames_CheckPressedB
pop bc
jr c, .exit_sequence
push bc
call .Flash
pop bc
inc b
dec c
dec c
jr nz, .loop
and a
ret
.exit_sequence
scf
ret
; 4e741
.Flash: ; 4e741
ld a, -7 * 7 ; new stage
ld [wEvolutionPicOffset], a
call .ReplaceFrontpic
ld a, 7 * 7 ; previous stage
ld [wEvolutionPicOffset], a
call .ReplaceFrontpic
dec b
jr nz, .Flash
ret
; 4e755
.ReplaceFrontpic: ; 4e755
push bc
xor a
ld [hBGMapMode], a
hlcoord 7, 2
lb bc, 7, 7
ld de, SCREEN_WIDTH - 7
.loop1
push bc
.loop2
ld a, [wEvolutionPicOffset]
add [hl]
ld [hli], a
dec c
jr nz, .loop2
pop bc
add hl, de
dec b
jr nz, .loop1
ld a, $1
ld [hBGMapMode], a
call WaitBGMap
pop bc
ret
; 4e779
.WaitFrames_CheckPressedB: ; 4e779
call DelayFrame
push bc
call JoyTextDelay
ld a, [hJoyDown]
pop bc
and B_BUTTON
jr nz, .pressed_b
.loop3
dec c
jr nz, .WaitFrames_CheckPressedB
and a
ret
.pressed_b
ld a, [wForceEvolution]
and a
jr nz, .loop3
scf
ret
; 4e794
.check_statused ; 4e794
ld a, [wCurPartyMon]
ld hl, wPartyMon1Species
call GetPartyLocation
ld b, h
ld c, l
farcall CheckFaintedFrzSlp
ret
; 4e7a6
.PlayEvolvedSFX: ; 4e7a6
ld a, [wEvolutionCanceled]
and a
ret nz
ld de, SFX_EVOLVED
call PlaySFX
ld hl, wJumptableIndex
ld a, [hl]
push af
ld [hl], $0
.loop4
call .balls_of_light
jr nc, .done
call .AnimateBallsOfLight
jr .loop4
.done
ld c, 32
.loop5
call .AnimateBallsOfLight
dec c
jr nz, .loop5
pop af
ld [wJumptableIndex], a
ret
; 4e7cf
.balls_of_light ; 4e7cf
ld hl, wJumptableIndex
ld a, [hl]
cp 32
ret nc
ld d, a
inc [hl]
and $1
jr nz, .done_balls
ld e, $0
call .GenerateBallOfLight
ld e, $10
call .GenerateBallOfLight
.done_balls
scf
ret
; 4e7e8
.GenerateBallOfLight: ; 4e7e8
push de
depixel 9, 11
ld a, SPRITE_ANIM_INDEX_EVOLUTION_BALL_OF_LIGHT
call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
ld a, [wJumptableIndex]
and %1110
sla a
pop de
add e
ld [hl], a
ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc
ld [hl], $0
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld [hl], $10
ret
; 4e80c
.AnimateBallsOfLight: ; 4e80c
push bc
callfar PlaySpriteAnimations
; a = (([hVBlankCounter] + 4) / 2) % NUM_PALETTES
ld a, [hVBlankCounter]
and %1110
srl a
inc a
inc a
and $7
ld b, a
ld hl, wVirtualOAMSprite00Attributes
ld c, NUM_SPRITE_OAM_STRUCTS
.loop6
ld a, [hl]
or b
ld [hli], a ; attributes
rept SPRITEOAMSTRUCT_LENGTH + -1
inc hl
endr
dec c
jr nz, .loop6
pop bc
call DelayFrame
ret
; 4e831
.GFX:
INCBIN "gfx/evo/bubble_large.2bpp"
INCBIN "gfx/evo/bubble.2bpp"

View File

@@ -1,149 +0,0 @@
GBCOnlyScreen: ; 4ea82
ld a, [hCGB]
and a
ret nz
ld de, MUSIC_NONE
call PlayMusic
call ClearTileMap
ld hl, GBCOnlyGFX
ld de, wGBCOnlyDecompressBuffer
ld a, [rSVBK]
push af
ld a, 0 ; this has the same effect as selecting bank 1
ld [rSVBK], a
call Decompress
pop af
ld [rSVBK], a
ld de, wGBCOnlyDecompressBuffer
ld hl, vTiles2
lb bc, BANK(GBCOnlyGFX), 84
call Get2bpp
ld de, Font
ld hl, vTiles1
lb bc, BANK(Font), $80
call Get1bpp
call DrawGBCOnlyScreen
call WaitBGMap
; better luck next time
.loop
call DelayFrame
jr .loop
; 4eac5
DrawGBCOnlyScreen: ; 4eac5
call DrawGBCOnlyBorder
; Pokemon
hlcoord 3, 2
ld b, 14
ld c, 4
ld a, $8
call DrawGBCOnlyGraphic
; Crystal
hlcoord 5, 6
ld b, 10
ld c, 2
ld a, $40
call DrawGBCOnlyGraphic
ld de, GBCOnlyString
hlcoord 1, 10
call PlaceString
ret
; 4eaea
DrawGBCOnlyBorder: ; 4eaea
hlcoord 0, 0
ld [hl], 0 ; top-left
inc hl
ld a, 1 ; top
call .FillRow
ld [hl], 2 ; top-right
hlcoord 0, 1
ld a, 3 ; left
call .FillColumn
hlcoord 19, 1
ld a, 4 ; right
call .FillColumn
hlcoord 0, 17
ld [hl], 5 ; bottom-left
inc hl
ld a, 6 ; bottom
call .FillRow
ld [hl], 7 ; bottom-right
ret
; 4eb15
.FillRow: ; 4eb15
ld c, SCREEN_WIDTH - 2
.next_column
ld [hli], a
dec c
jr nz, .next_column
ret
; 4eb1c
.FillColumn: ; 4eb1c
ld de, SCREEN_WIDTH
ld c, SCREEN_HEIGHT - 2
.next_row
ld [hl], a
add hl, de
dec c
jr nz, .next_row
ret
; 4eb27
DrawGBCOnlyGraphic: ; 4eb27
ld de, SCREEN_WIDTH
.y
push bc
push hl
.x
ld [hli], a
inc a
dec b
jr nz, .x
pop hl
add hl, de
pop bc
dec c
jr nz, .y
ret
; 4eb38
GBCOnlyString: ; 4eb38
db "This Game Pak is"
next "designed only for"
next "use on the"
next "Game Boy Color.@"
; 4eb76
GBCOnlyGFX: ; 4eb76
INCBIN "gfx/sgb/gbc_only.2bpp.lz"
; 4f0bc

View File

@@ -0,0 +1,21 @@
WriteOAMDMACodeToHRAM:: ; 4031
ld c, hTransferVirtualOAM - $ff00
ld b, .PushOAMEnd - .PushOAM
ld hl, .PushOAM
.loop
ld a, [hli]
ld [$ff00+c], a
inc c
dec b
jr nz, .loop
ret
.PushOAM: ; 403f
ld a, HIGH(wVirtualOAM)
ld [rDMA], a
ld a, NUM_SPRITE_OAM_STRUCTS
.pushoam_loop
dec a
jr nz, .pushoam_loop
ret
.PushOAMEnd

View File

@@ -1,86 +0,0 @@
SwapTextboxPalettes:: ; 4c000
hlcoord 0, 0
decoord 0, 0, wAttrMap
ld b, SCREEN_HEIGHT
.loop
push bc
ld c, SCREEN_WIDTH
.innerloop
ld a, [hl]
push hl
srl a
jr c, .UpperNybble
ld hl, wTilesetPalettes
add [hl]
ld l, a
ld a, [wTilesetPalettes + 1]
adc 0
ld h, a
ld a, [hl]
and $f
jr .next
.UpperNybble:
ld hl, wTilesetPalettes
add [hl]
ld l, a
ld a, [wTilesetPalettes + 1]
adc 0
ld h, a
ld a, [hl]
swap a
and $f
.next
pop hl
ld [de], a
res 7, [hl]
inc hl
inc de
dec c
jr nz, .innerloop
pop bc
dec b
jr nz, .loop
ret
ScrollBGMapPalettes:: ; 4c03f
ld hl, wBGMapBuffer
ld de, wBGMapPalBuffer
.loop
ld a, [hl]
push hl
srl a
jr c, .UpperNybble
; .LowerNybble
ld hl, wTilesetPalettes
add [hl]
ld l, a
ld a, [wTilesetPalettes + 1]
adc 0
ld h, a
ld a, [hl]
and $f
jr .next
.UpperNybble:
ld hl, wTilesetPalettes
add [hl]
ld l, a
ld a, [wTilesetPalettes + 1]
adc 0
ld h, a
ld a, [hl]
swap a
and $f
.next
pop hl
ld [de], a
res 7, [hl]
inc hl
inc de
dec c
jr nz, .loop
ret

View File

@@ -1,20 +0,0 @@
LoadMapGroupRoof:: ; 1c000
ld a, [wMapGroup]
ld e, a
ld d, 0
ld hl, MapGroupRoofs
add hl, de
ld a, [hl]
cp -1
ret z
ld hl, Roofs
ld bc, 9 tiles
call AddNTimes
ld de, vTiles2 tile $0a
ld bc, 9 tiles
call CopyBytes
ret
; 1c021
INCLUDE "data/maps/roofs.asm"

File diff suppressed because it is too large Load Diff

View File

@@ -1,151 +0,0 @@
LoadSpecialMapPalette: ; 494ac
ld a, [wMapTileset]
cp TILESET_POKECOM_CENTER
jr z, .pokecom_2f
cp TILESET_BATTLE_TOWER
jr z, .battle_tower
cp TILESET_ICE_PATH
jr z, .ice_path
cp TILESET_HOUSE
jr z, .house
cp TILESET_RADIO_TOWER
jr z, .radio_tower
cp TILESET_MANSION
jr z, .mansion_mobile
jr .do_nothing
.pokecom_2f
call LoadPokeComPalette
scf
ret
.battle_tower
call LoadBattleTowerPalette
scf
ret
.ice_path
ld a, [wEnvironment]
and $7
cp INDOOR ; Hall of Fame
jr z, .do_nothing
call LoadIcePathPalette
scf
ret
.house
call LoadHousePalette
scf
ret
.radio_tower
call LoadRadioTowerPalette
scf
ret
.mansion_mobile
call LoadMansionPalette
scf
ret
.do_nothing
and a
ret
; 494f2
LoadPokeComPalette: ; 494f2
ld a, BANK(wBGPals1)
ld de, wBGPals1
ld hl, PokeComPalette
ld bc, 8 palettes
call FarCopyWRAM
ret
; 49501
PokeComPalette: ; 49501
INCLUDE "gfx/tilesets/pokecom_center.pal"
; 49541
LoadBattleTowerPalette: ; 49541
ld a, BANK(wBGPals1)
ld de, wBGPals1
ld hl, BattleTowerPalette
ld bc, 8 palettes
call FarCopyWRAM
ret
; 49550
BattleTowerPalette: ; 49550
INCLUDE "gfx/tilesets/battle_tower.pal"
; 49590
LoadIcePathPalette: ; 49590
ld a, BANK(wBGPals1)
ld de, wBGPals1
ld hl, IcePathPalette
ld bc, 8 palettes
call FarCopyWRAM
ret
; 4959f
IcePathPalette: ; 4959f
INCLUDE "gfx/tilesets/ice_path.pal"
; 495df
LoadHousePalette: ; 495df
ld a, BANK(wBGPals1)
ld de, wBGPals1
ld hl, HousePalette
ld bc, 8 palettes
call FarCopyWRAM
ret
; 495ee
HousePalette: ; 495ee
INCLUDE "gfx/tilesets/house.pal"
; 4962e
LoadRadioTowerPalette: ; 4962e
ld a, BANK(wBGPals1)
ld de, wBGPals1
ld hl, RadioTowerPalette
ld bc, 8 palettes
call FarCopyWRAM
ret
; 4963d
RadioTowerPalette: ; 4963d
INCLUDE "gfx/tilesets/radio_tower.pal"
; 4967d
MansionPalette1: ; 4967d
INCLUDE "gfx/tilesets/mansion_1.pal"
; 496c5
LoadMansionPalette: ; 496c5
ld a, BANK(wBGPals1)
ld de, wBGPals1
ld hl, MansionPalette1
ld bc, 8 palettes
call FarCopyWRAM
ld a, BANK(wBGPals1)
ld de, wBGPals1 palette PAL_BG_YELLOW
ld hl, MansionPalette2
ld bc, 1 palettes
call FarCopyWRAM
ld a, BANK(wBGPals1)
ld de, wBGPals1 palette PAL_BG_WATER
ld hl, MansionPalette1 + 6 palettes
ld bc, 1 palettes
call FarCopyWRAM
ld a, BANK(wBGPals1)
ld de, wBGPals1 palette PAL_BG_ROOF
ld hl, MansionPalette1 + 8 palettes
ld bc, 1 palettes
call FarCopyWRAM
ret
; 496fe
MansionPalette2: ; 496fe
INCLUDE "gfx/tilesets/mansion_2.pal"
; 49706

View File

@@ -1,415 +0,0 @@
DummyPredef35: ; 8c000
DummyPredef36:
ret
UpdateTimeOfDayPal:: ; 8c001
call UpdateTime
ld a, [wTimeOfDay]
ld [wCurTimeOfDay], a
call GetTimePalette
ld [wTimeOfDayPal], a
ret
; 8c011
_TimeOfDayPals:: ; 8c011
; return carry if pals are changed
; forced pals?
ld hl, wTimeOfDayPalFlags
bit 7, [hl]
jr nz, .dontchange
; do we need to bother updating?
ld a, [wTimeOfDay]
ld hl, wCurTimeOfDay
cp [hl]
jr z, .dontchange
; if so, the time of day has changed
ld a, [wTimeOfDay]
ld [wCurTimeOfDay], a
; get palette id
call GetTimePalette
; same palette as before?
ld hl, wTimeOfDayPal
cp [hl]
jr z, .dontchange
; update palette id
ld [wTimeOfDayPal], a
; save bg palette 7
ld hl, wBGPals1 palette PAL_BG_TEXT
; save wram bank
ld a, [rSVBK]
ld b, a
ld a, BANK(wBGPals1)
ld [rSVBK], a
; push palette
ld c, NUM_PAL_COLORS
.push
ld d, [hl]
inc hl
ld e, [hl]
inc hl
push de
dec c
jr nz, .push
; restore wram bank
ld a, b
ld [rSVBK], a
; update sgb pals
ld b, SCGB_MAPPALS
call GetSGBLayout
; restore bg palette 7
ld hl, wOBPals1 - 1 ; last byte in wBGPals1
; save wram bank
ld a, [rSVBK]
ld d, a
ld a, BANK(wOBPals1)
ld [rSVBK], a
; pop palette
ld e, NUM_PAL_COLORS
.pop
pop bc
ld [hl], c
dec hl
ld [hl], b
dec hl
dec e
jr nz, .pop
; restore wram bank
ld a, d
ld [rSVBK], a
; update palettes
call _UpdateTimePals
call DelayFrame
; successful change
scf
ret
.dontchange
; no change occurred
and a
ret
; 8c070
_UpdateTimePals:: ; 8c070
ld c, $9 ; normal
call GetTimePalFade
call DmgToCgbTimePals
ret
; 8c079
FadeInPalettes:: ; 8c079
ld c, $12
call GetTimePalFade
ld b, $4
call ConvertTimePalsDecHL
ret
; 8c084
FadeOutPalettes:: ; 8c084
call FillWhiteBGColor
ld c, $9
call GetTimePalFade
ld b, $4
call ConvertTimePalsIncHL
ret
; 8c092
BattleTowerFade: ; 8c092
call FillWhiteBGColor
ld c, $9
call GetTimePalFade
ld b, $4
.asm_8c09c
call DmgToCgbTimePals
inc hl
inc hl
inc hl
ld c, $7
call DelayFrames
dec b
jr nz, .asm_8c09c
ret
; 8c0ab
FadeInQuickly: ; 8c0ab
ld c, $0
call GetTimePalFade
ld b, $4
call ConvertTimePalsIncHL
ret
; 8c0b6
FadeBlackQuickly: ; 8c0b6
ld c, $9
call GetTimePalFade
ld b, $4
call ConvertTimePalsDecHL
ret
; 8c0c1
FillWhiteBGColor: ; 8c0c1
ld a, [rSVBK]
push af
ld a, BANK(wBGPals1)
ld [rSVBK], a
ld hl, wBGPals1
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
ld hl, wBGPals1 + 1 palettes
ld c, 6
.loop
ld a, e
ld [hli], a
ld a, d
ld [hli], a
rept 6
inc hl
endr
dec c
jr nz, .loop
pop af
ld [rSVBK], a
ret
; 8c0e5
ReplaceTimeOfDayPals: ; 8c0e5
ld hl, .BrightnessLevels
ld a, [wMapTimeOfDay]
cp $4 ; Dark cave, needs Flash
jr z, .DarkCave
and $7
add l
ld l, a
ld a, $0
adc h
ld h, a
ld a, [hl]
ld [wTimeOfDayPalset], a
ret
.DarkCave:
ld a, [wStatusFlags]
bit STATUSFLAGS_FLASH_F, a
jr nz, .UsedFlash
ld a, %11111111 ; 3, 3, 3, 3
ld [wTimeOfDayPalset], a
ret
.UsedFlash:
ld a, %10101010 ; 2, 2, 2, 2
ld [wTimeOfDayPalset], a
ret
; 8c10f (23:410f)
.BrightnessLevels: ; 8c10f
dc 3, 2, 1, 0
dc 1, 1, 1, 1
dc 2, 2, 2, 2
dc 0, 0, 0, 0
dc 3, 3, 3, 3
dc 3, 2, 1, 0
dc 3, 2, 1, 0
dc 3, 2, 1, 0
; 8c117
GetTimePalette: ; 8c117
ld a, [wTimeOfDay]
ld e, a
ld d, 0
ld hl, .TimePalettes
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
jp hl
; 8c126
.TimePalettes:
dw .MorningPalette
dw .DayPalette
dw .NitePalette
dw .DarknessPalette
.MorningPalette:
ld a, [wTimeOfDayPalset]
and %00000011 ; 0
ret
.DayPalette:
ld a, [wTimeOfDayPalset]
and %00001100 ; 1
srl a
srl a
ret
.NitePalette:
ld a, [wTimeOfDayPalset]
and %00110000 ; 2
swap a
ret
.DarknessPalette:
ld a, [wTimeOfDayPalset]
and %11000000 ; 3
rlca
rlca
ret
; 8c14e
DmgToCgbTimePals: ; 8c14e
push hl
push de
ld a, [hli]
call DmgToCgbBGPals
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
call DmgToCgbObjPals
pop de
pop hl
ret
; 8c15e
ConvertTimePalsIncHL: ; 8c15e
.loop
call DmgToCgbTimePals
inc hl
inc hl
inc hl
ld c, 2
call DelayFrames
dec b
jr nz, .loop
ret
; 8c16d
ConvertTimePalsDecHL: ; 8c16d
.loop
call DmgToCgbTimePals
dec hl
dec hl
dec hl
ld c, 2
call DelayFrames
dec b
jr nz, .loop
ret
; 8c17c
GetTimePalFade: ; 8c17c
; check cgb
ld 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
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111110
db %11111001, %11100100, %11100100
db %11100100, %11010000, %11010000
db %10010000, %10000000, %10000000
db %01000000, %01000000, %01000000
db %00000000, %00000000, %00000000
.day
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111110
db %11111001, %11100100, %11100100
db %11100100, %11010000, %11010000
db %10010000, %10000000, %10000000
db %01000000, %01000000, %01000000
db %00000000, %00000000, %00000000
.nite
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111110
db %11111001, %11100100, %11100100
db %11101001, %11010000, %11010000
db %10010000, %10000000, %10000000
db %01000000, %01000000, %01000000
db %00000000, %00000000, %00000000
.darkness
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111111
db %11111110, %11100100, %11111111
db %11111101, %11010000, %11111111
db %11111101, %10000000, %11111111
db %00000000, %01000000, %00000000
db %00000000, %00000000, %00000000
.cgbfade
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111110
db %11111001, %11111001, %11111001
db %11100100, %11100100, %11100100
db %10010000, %10010000, %10010000
db %01000000, %01000000, %01000000
db %00000000, %00000000, %00000000
; 8c20f

File diff suppressed because it is too large Load Diff