diff options
Diffstat (limited to 'engine/tilesets')
-rw-r--r-- | engine/tilesets/map_palettes.asm | 4 | ||||
-rw-r--r-- | engine/tilesets/mapgroup_roofs.asm | 3 | ||||
-rw-r--r-- | engine/tilesets/tileset_anims.asm | 100 | ||||
-rw-r--r-- | engine/tilesets/tileset_palettes.asm | 42 | ||||
-rw-r--r-- | engine/tilesets/timeofday_pals.asm | 51 |
5 files changed, 67 insertions, 133 deletions
diff --git a/engine/tilesets/map_palettes.asm b/engine/tilesets/map_palettes.asm index a9d2b382f..5f943795a 100644 --- a/engine/tilesets/map_palettes.asm +++ b/engine/tilesets/map_palettes.asm @@ -1,4 +1,4 @@ -SwapTextboxPalettes:: ; 4c000 +SwapTextboxPalettes:: hlcoord 0, 0 decoord 0, 0, wAttrMap ld b, SCREEN_HEIGHT @@ -44,7 +44,7 @@ SwapTextboxPalettes:: ; 4c000 jr nz, .loop ret -ScrollBGMapPalettes:: ; 4c03f +ScrollBGMapPalettes:: ld hl, wBGMapBuffer ld de, wBGMapPalBuffer .loop diff --git a/engine/tilesets/mapgroup_roofs.asm b/engine/tilesets/mapgroup_roofs.asm index 58e5e7cfe..8262f57b1 100644 --- a/engine/tilesets/mapgroup_roofs.asm +++ b/engine/tilesets/mapgroup_roofs.asm @@ -1,4 +1,4 @@ -LoadMapGroupRoof:: ; 1c000 +LoadMapGroupRoof:: ld a, [wMapGroup] ld e, a ld d, 0 @@ -14,7 +14,6 @@ LoadMapGroupRoof:: ; 1c000 ld bc, 9 tiles call CopyBytes ret -; 1c021 INCLUDE "data/maps/roofs.asm" diff --git a/engine/tilesets/tileset_anims.asm b/engine/tilesets/tileset_anims.asm index bf0037e65..ce3510e92 100644 --- a/engine/tilesets/tileset_anims.asm +++ b/engine/tilesets/tileset_anims.asm @@ -1,4 +1,4 @@ -_AnimateTileset:: ; fc000 +_AnimateTileset:: ; Iterate over a given pointer array of ; animation functions (one per frame). @@ -32,7 +32,6 @@ _AnimateTileset:: ; fc000 ld l, a jp hl -; fc01b Tileset0Anim: ; 0xfc01b TilesetJohtoModernAnim: ; 0xfc01b @@ -290,26 +289,24 @@ TilesetAerodactylWordRoomAnim: ; 0xfc2e7 dw NULL, DoneTileAnimation ; 0xfc2fb -DoneTileAnimation: ; fc2fb +DoneTileAnimation: ; Reset the animation command loop. xor a ld [hTileAnimFrame], a -WaitTileAnimation: ; fc2fe +WaitTileAnimation: ; Do nothing this frame. ret -; fc2ff -StandingTileFrame8: ; fc2ff +StandingTileFrame8: ld a, [wTileAnimationTimer] inc a and %111 ld [wTileAnimationTimer], a ret -; fc309 -ScrollTileRightLeft: ; fc309 +ScrollTileRightLeft: ; Scroll right for 4 ticks, then left for 4 ticks. ld a, [wTileAnimationTimer] inc a @@ -318,9 +315,8 @@ ScrollTileRightLeft: ; fc309 and %100 jr nz, ScrollTileLeft jr ScrollTileRight -; fc318 -ScrollTileUpDown: ; fc318 +ScrollTileUpDown: ; Scroll up for 4 ticks, then down for 4 ticks. ld a, [wTileAnimationTimer] inc a @@ -329,9 +325,8 @@ ScrollTileUpDown: ; fc318 and %100 jr nz, ScrollTileDown jr ScrollTileUp -; fc327 -ScrollTileLeft: ; fc327 +ScrollTileLeft: ld h, d ld l, e ld c, 4 @@ -344,9 +339,8 @@ endr dec c jr nz, .loop ret -; fc33b -ScrollTileRight: ; fc33b +ScrollTileRight: ld h, d ld l, e ld c, 4 @@ -359,9 +353,8 @@ endr dec c jr nz, .loop ret -; fc34f -ScrollTileUp: ; fc34f +ScrollTileUp: ld h, d ld l, e ld d, [hl] @@ -386,9 +379,8 @@ ScrollTileUp: ; fc34f dec a jr nz, .loop ret -; fc36a -ScrollTileDown: ; fc36a +ScrollTileDown: ld h, d ld l, e ld de, TILE_WIDTH * 2 - 2 @@ -415,10 +407,9 @@ ScrollTileDown: ; fc36a dec a jr nz, .loop ret -; fc387 -AnimateFountain: ; fc387 +AnimateFountain: ld hl, sp+0 ld b, h ld c, l @@ -454,10 +445,9 @@ AnimateFountain: ; fc387 .frame3 INCBIN "gfx/tilesets/fountain/3.2bpp" .frame4 INCBIN "gfx/tilesets/fountain/4.2bpp" .frame5 INCBIN "gfx/tilesets/fountain/5.2bpp" -; fc402 -AnimateWaterTile: ; fc402 +AnimateWaterTile: ; Draw a water tile for the current frame in VRAM tile at de. ; Save sp in bc (see WriteTile). @@ -488,14 +478,12 @@ AnimateWaterTile: ; fc402 ld h, d jp WriteTile -; fc41c -WaterTileFrames: ; fc41c +WaterTileFrames: INCBIN "gfx/tilesets/water/water.2bpp" -; fc45c -ForestTreeLeftAnimation: ; fc45c +ForestTreeLeftAnimation: ld hl, sp+0 ld b, h ld c, l @@ -523,21 +511,18 @@ ForestTreeLeftAnimation: ; fc45c ld sp, hl ld hl, vTiles2 tile $0c jp WriteTile -; fc484 -ForestTreeLeftFrames: ; fc484 +ForestTreeLeftFrames: INCBIN "gfx/tilesets/forest-tree/1.2bpp" INCBIN "gfx/tilesets/forest-tree/2.2bpp" -; fc4a4 -ForestTreeRightFrames: ; fc4a4 +ForestTreeRightFrames: INCBIN "gfx/tilesets/forest-tree/3.2bpp" INCBIN "gfx/tilesets/forest-tree/4.2bpp" -; fc4c4 -ForestTreeRightAnimation: ; fc4c4 +ForestTreeRightAnimation: ld hl, sp+0 ld b, h ld c, l @@ -569,10 +554,9 @@ ForestTreeRightAnimation: ; fc4c4 ld sp, hl ld hl, vTiles2 tile $0f jp WriteTile -; fc4f2 -ForestTreeLeftAnimation2: ; fc4f2 +ForestTreeLeftAnimation2: ld hl, sp+0 ld b, h ld c, l @@ -601,10 +585,9 @@ ForestTreeLeftAnimation2: ; fc4f2 ld sp, hl ld hl, vTiles2 tile $0c jp WriteTile -; fc51c -ForestTreeRightAnimation2: ; fc51c +ForestTreeRightAnimation2: ld hl, sp+0 ld b, h ld c, l @@ -637,10 +620,9 @@ ForestTreeRightAnimation2: ; fc51c ld sp, hl ld hl, vTiles2 tile $0f jp WriteTile -; fc54c -GetForestTreeFrame: ; fc54c +GetForestTreeFrame: ; Return 0 if a is even, or 2 if odd. and a jr z, .even @@ -663,10 +645,9 @@ GetForestTreeFrame: ; fc54c .even xor a ret -; fc56d -AnimateFlowerTile: ; fc56d +AnimateFlowerTile: ; No parameters. ; Save sp in bc (see WriteTile). @@ -694,17 +675,15 @@ AnimateFlowerTile: ; fc56d ld hl, vTiles2 tile $03 jp WriteTile -; fc58c -FlowerTileFrames: ; fc58c +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" -; fc5cc -LavaBubbleAnim1: ; fc5cc +LavaBubbleAnim1: ; Splash in the bottom-right corner of the fountain. ld hl, sp+0 ld b, h @@ -723,10 +702,9 @@ LavaBubbleAnim1: ; fc5cc ld sp, hl ld hl, vTiles2 tile $5b jp WriteTile -; fc5eb -LavaBubbleAnim2: ; fc5eb +LavaBubbleAnim2: ; Splash in the top-left corner of the fountain. ld hl, sp+0 ld b, h @@ -743,18 +721,16 @@ LavaBubbleAnim2: ; fc5eb ld sp, hl ld hl, vTiles2 tile $38 jp WriteTile -; fc605 -LavaBubbleFrames: ; fc605 +LavaBubbleFrames: INCBIN "gfx/tilesets/lava/1.2bpp" INCBIN "gfx/tilesets/lava/2.2bpp" INCBIN "gfx/tilesets/lava/3.2bpp" INCBIN "gfx/tilesets/lava/4.2bpp" -; fc645 -AnimateTowerPillarTile: ; fc645 +AnimateTowerPillarTile: ; Read from struct at de: ; Destination (VRAM) ; Address of the first tile in the frame array @@ -799,17 +775,15 @@ AnimateTowerPillarTile: ; fc645 .frames db $00, $10, $20, $30, $40, $30, $20, $10 -; fc673 -StandingTileFrame: ; fc673 +StandingTileFrame: ld hl, wTileAnimationTimer inc [hl] ret -; fc678 -AnimateWhirlpoolTile: ; fc678 +AnimateWhirlpoolTile: ; Update whirlpool tile using struct at de. ; Struct: @@ -852,10 +826,9 @@ AnimateWhirlpoolTile: ; fc678 ld h, d jr WriteTile -; fc696 -WriteTileFromBuffer: ; fc696 +WriteTileFromBuffer: ; Write tiledata at wTileAnimBuffer to de. ; wTileAnimBuffer is loaded to sp for WriteTile. @@ -869,10 +842,9 @@ WriteTileFromBuffer: ; fc696 ld h, d ld l, e jr WriteTile -; fc6a2 -WriteTileToBuffer: ; fc6a2 +WriteTileToBuffer: ; Write tiledata de to wTileAnimBuffer. ; de is loaded to sp for WriteTile. @@ -888,7 +860,7 @@ WriteTileToBuffer: ; fc6a2 ; fallthrough -WriteTile: ; fc6ac +WriteTile: ; Write one 8x8 tile ($10 bytes) from sp to hl. ; Warning: sp is saved in bc so we can abuse pop. @@ -912,10 +884,9 @@ endr ld l, c ld sp, hl ret -; fc6d7 -TileAnimationPalette: ; fc6d7 +TileAnimationPalette: ; Transition between color values 0-2 for color 0 in palette 3. ; No palette changes on DMG. @@ -978,10 +949,9 @@ TileAnimationPalette: ; fc6d7 pop af ld [rSVBK], a ret -; fc71e -FlickeringCaveEntrancePalette: ; fc71e +FlickeringCaveEntrancePalette: ; No palette changes on DMG. ld a, [hCGB] and a @@ -1020,7 +990,6 @@ FlickeringCaveEntrancePalette: ; fc71e pop af ld [rSVBK], a ret -; fc750 TowerPillarTilePointer1: dw vTiles2 tile $2d, TowerPillarTile1 @@ -1044,17 +1013,14 @@ TowerPillarTile7: INCBIN "gfx/tilesets/tower-pillar/7.2bpp" TowerPillarTile8: INCBIN "gfx/tilesets/tower-pillar/8.2bpp" TowerPillarTile9: INCBIN "gfx/tilesets/tower-pillar/9.2bpp" TowerPillarTile10: INCBIN "gfx/tilesets/tower-pillar/10.2bpp" -; fca98 WhirlpoolFrames1: dw vTiles2 tile $32, WhirlpoolTiles1 WhirlpoolFrames2: dw vTiles2 tile $33, WhirlpoolTiles2 WhirlpoolFrames3: dw vTiles2 tile $42, WhirlpoolTiles3 WhirlpoolFrames4: dw vTiles2 tile $43, WhirlpoolTiles4 -; fcaa8 WhirlpoolTiles1: INCBIN "gfx/tilesets/whirlpool/1.2bpp" WhirlpoolTiles2: INCBIN "gfx/tilesets/whirlpool/2.2bpp" WhirlpoolTiles3: INCBIN "gfx/tilesets/whirlpool/3.2bpp" WhirlpoolTiles4: INCBIN "gfx/tilesets/whirlpool/4.2bpp" -; fcba8 diff --git a/engine/tilesets/tileset_palettes.asm b/engine/tilesets/tileset_palettes.asm index e2c39c0ab..1e433b158 100644 --- a/engine/tilesets/tileset_palettes.asm +++ b/engine/tilesets/tileset_palettes.asm @@ -1,4 +1,4 @@ -LoadSpecialMapPalette: ; 494ac +LoadSpecialMapPalette: ld a, [wMapTileset] cp TILESET_POKECOM_CENTER jr z, .pokecom_2f @@ -51,78 +51,66 @@ LoadSpecialMapPalette: ; 494ac .do_nothing and a ret -; 494f2 -LoadPokeComPalette: ; 494f2 +LoadPokeComPalette: ld a, BANK(wBGPals1) ld de, wBGPals1 ld hl, PokeComPalette ld bc, 8 palettes call FarCopyWRAM ret -; 49501 -PokeComPalette: ; 49501 +PokeComPalette: INCLUDE "gfx/tilesets/pokecom_center.pal" -; 49541 -LoadBattleTowerPalette: ; 49541 +LoadBattleTowerPalette: ld a, BANK(wBGPals1) ld de, wBGPals1 ld hl, BattleTowerPalette ld bc, 8 palettes call FarCopyWRAM ret -; 49550 -BattleTowerPalette: ; 49550 +BattleTowerPalette: INCLUDE "gfx/tilesets/battle_tower.pal" -; 49590 -LoadIcePathPalette: ; 49590 +LoadIcePathPalette: ld a, BANK(wBGPals1) ld de, wBGPals1 ld hl, IcePathPalette ld bc, 8 palettes call FarCopyWRAM ret -; 4959f -IcePathPalette: ; 4959f +IcePathPalette: INCLUDE "gfx/tilesets/ice_path.pal" -; 495df -LoadHousePalette: ; 495df +LoadHousePalette: ld a, BANK(wBGPals1) ld de, wBGPals1 ld hl, HousePalette ld bc, 8 palettes call FarCopyWRAM ret -; 495ee -HousePalette: ; 495ee +HousePalette: INCLUDE "gfx/tilesets/house.pal" -; 4962e -LoadRadioTowerPalette: ; 4962e +LoadRadioTowerPalette: ld a, BANK(wBGPals1) ld de, wBGPals1 ld hl, RadioTowerPalette ld bc, 8 palettes call FarCopyWRAM ret -; 4963d -RadioTowerPalette: ; 4963d +RadioTowerPalette: INCLUDE "gfx/tilesets/radio_tower.pal" -; 4967d -MansionPalette1: ; 4967d +MansionPalette1: INCLUDE "gfx/tilesets/mansion_1.pal" -; 496c5 -LoadMansionPalette: ; 496c5 +LoadMansionPalette: ld a, BANK(wBGPals1) ld de, wBGPals1 ld hl, MansionPalette1 @@ -144,8 +132,6 @@ LoadMansionPalette: ; 496c5 ld bc, 1 palettes call FarCopyWRAM ret -; 496fe -MansionPalette2: ; 496fe +MansionPalette2: INCLUDE "gfx/tilesets/mansion_2.pal" -; 49706 diff --git a/engine/tilesets/timeofday_pals.asm b/engine/tilesets/timeofday_pals.asm index b8d43d252..cda6e1e0d 100644 --- a/engine/tilesets/timeofday_pals.asm +++ b/engine/tilesets/timeofday_pals.asm @@ -1,18 +1,17 @@ -DummyPredef35: ; 8c000 +DummyPredef35: DummyPredef36: ret -UpdateTimeOfDayPal:: ; 8c001 +UpdateTimeOfDayPal:: call UpdateTime ld a, [wTimeOfDay] ld [wCurTimeOfDay], a call GetTimePalette ld [wTimeOfDayPal], a ret -; 8c011 -_TimeOfDayPals:: ; 8c011 +_TimeOfDayPals:: ; return carry if pals are changed ; forced pals? @@ -109,34 +108,30 @@ _TimeOfDayPals:: ; 8c011 ; no change occurred and a ret -; 8c070 -_UpdateTimePals:: ; 8c070 +_UpdateTimePals:: ld c, $9 ; normal call GetTimePalFade call DmgToCgbTimePals ret -; 8c079 -FadeInPalettes:: ; 8c079 +FadeInPalettes:: ld c, $12 call GetTimePalFade ld b, $4 call ConvertTimePalsDecHL ret -; 8c084 -FadeOutPalettes:: ; 8c084 +FadeOutPalettes:: call FillWhiteBGColor ld c, $9 call GetTimePalFade ld b, $4 call ConvertTimePalsIncHL ret -; 8c092 -BattleTowerFade: ; 8c092 +BattleTowerFade: call FillWhiteBGColor ld c, $9 call GetTimePalFade @@ -151,26 +146,23 @@ BattleTowerFade: ; 8c092 dec b jr nz, .asm_8c09c ret -; 8c0ab -FadeInQuickly: ; 8c0ab +FadeInQuickly: ld c, $0 call GetTimePalFade ld b, $4 call ConvertTimePalsIncHL ret -; 8c0b6 -FadeBlackQuickly: ; 8c0b6 +FadeBlackQuickly: ld c, $9 call GetTimePalFade ld b, $4 call ConvertTimePalsDecHL ret -; 8c0c1 -FillWhiteBGColor: ; 8c0c1 +FillWhiteBGColor: ld a, [rSVBK] push af ld a, BANK(wBGPals1) @@ -197,9 +189,8 @@ endr pop af ld [rSVBK], a ret -; 8c0e5 -ReplaceTimeOfDayPals: ; 8c0e5 +ReplaceTimeOfDayPals: ld hl, .BrightnessLevels ld a, [wMapTimeOfDay] cp $4 ; Dark cave, needs Flash @@ -226,9 +217,8 @@ ReplaceTimeOfDayPals: ; 8c0e5 ld a, %10101010 ; 2, 2, 2, 2 ld [wTimeOfDayPalset], a ret -; 8c10f (23:410f) -.BrightnessLevels: ; 8c10f +.BrightnessLevels: dc 3, 2, 1, 0 dc 1, 1, 1, 1 dc 2, 2, 2, 2 @@ -237,9 +227,8 @@ ReplaceTimeOfDayPals: ; 8c0e5 dc 3, 2, 1, 0 dc 3, 2, 1, 0 dc 3, 2, 1, 0 -; 8c117 -GetTimePalette: ; 8c117 +GetTimePalette: ld a, [wTimeOfDay] ld e, a ld d, 0 @@ -250,7 +239,6 @@ GetTimePalette: ; 8c117 ld h, [hl] ld l, a jp hl -; 8c126 .TimePalettes: dw .MorningPalette @@ -282,10 +270,9 @@ GetTimePalette: ; 8c117 rlca rlca ret -; 8c14e -DmgToCgbTimePals: ; 8c14e +DmgToCgbTimePals: push hl push de ld a, [hli] @@ -298,9 +285,8 @@ DmgToCgbTimePals: ; 8c14e pop de pop hl ret -; 8c15e -ConvertTimePalsIncHL: ; 8c15e +ConvertTimePalsIncHL: .loop call DmgToCgbTimePals inc hl @@ -311,9 +297,8 @@ ConvertTimePalsIncHL: ; 8c15e dec b jr nz, .loop ret -; 8c16d -ConvertTimePalsDecHL: ; 8c16d +ConvertTimePalsDecHL: .loop call DmgToCgbTimePals dec hl @@ -324,10 +309,9 @@ ConvertTimePalsDecHL: ; 8c16d dec b jr nz, .loop ret -; 8c17c -GetTimePalFade: ; 8c17c +GetTimePalFade: ; check cgb ld a, [hCGB] and a @@ -412,4 +396,3 @@ GetTimePalFade: ; 8c17c db %10010000, %10010000, %10010000 db %01000000, %01000000, %01000000 db %00000000, %00000000, %00000000 -; 8c20f |