diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-07 15:09:54 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-07 16:21:26 -0400 |
commit | 4a7d1513f3135a3c926233d47921b21bf8b1fab4 (patch) | |
tree | 22e14964dcd2e6dae66de392c32caf33e70c964b | |
parent | b945988a0af9de9a37d95be8b117f395bc6e5592 (diff) |
Use 'tile' and 'tiles' macros
30 files changed, 188 insertions, 303 deletions
diff --git a/data/icon_pointers.asm b/data/icon_pointers.asm index b615798e..585a0a29 100644 --- a/data/icon_pointers.asm +++ b/data/icon_pointers.asm @@ -1,140 +1,37 @@ -MonPartySpritePointers: - dw SlowbroSprite + $c0 - db $40 / $10 ; 40 bytes - db BANK(SlowbroSprite) - dw vSprites - - dw BallSprite - db $80 / $10 ; $80 bytes - db BANK(BallSprite) - dw vSprites + $40 - - dw ClefairySprite + $c0 - db $40 / $10 ; $40 bytes - db BANK(ClefairySprite) - dw vSprites + $c0 - - dw BirdSprite + $c0 - db $40 / $10 ; $40 bytes - db BANK(BirdSprite) - dw vSprites + $100 - - dw SeelSprite - db $40 / $10 ; $40 bytes - db BANK(SeelSprite) - dw vSprites + $140 - - dw BugIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame2) - dw vSprites + $180 - - dw BugIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame2) - dw vSprites + $1a0 - - dw PlantIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame2) - dw vSprites + $1c0 - - dw PlantIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame2) - dw vSprites + $1e0 - - dw SnakeIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame1) - dw vSprites + $200 - - dw SnakeIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame1) - dw vSprites + $220 - - dw QuadrupedIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame1) - dw vSprites + $240 - - dw QuadrupedIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame1) - dw vSprites + $260 - - dw TradeBubbleIconGFX - db $40 / $10 ; $40 bytes - db BANK(TradeBubbleIconGFX) - dw vSprites + $380 +mon_icon_header: MACRO + dw \1 tile \2 + db \3 + db BANK(\1) + dw vSprites tile \4 +ENDM - dw SlowbroSprite - db $40 / $10 ; $40 bytes - db BANK(SlowbroSprite) - dw vSprites + $400 - - dw BallSprite - db $80 / $10 ; $80 bytes - db BANK(BallSprite) - dw vSprites + $440 - - dw ClefairySprite - db $40 / $10 ; $40 bytes - db BANK(ClefairySprite) - dw vSprites + $4c0 - - dw BirdSprite - db $40 / $10 ; $40 bytes - db BANK(BirdSprite) - dw vSprites + $500 - - dw SeelSprite + $C0 - db $40 / $10 ; $40 bytes - db BANK(SeelSprite) - dw vSprites + $540 - - dw BugIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame1) - dw vSprites + $580 - - dw BugIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame1) - dw vSprites + $5a0 - - dw PlantIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame1) - dw vSprites + $5c0 - - dw PlantIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame1) - dw vSprites + $5E0 - - dw SnakeIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame2) - dw vSprites + $600 - - dw SnakeIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame2) - dw vSprites + $620 - - dw QuadrupedIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame2) - dw vSprites + $640 - - dw QuadrupedIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame2) - dw vSprites + $660 - - dw TradeBubbleIconGFX + $40 - db $40 / $10 ; $40 bytes - db BANK(TradeBubbleIconGFX) - dw vSprites + $780 +MonPartySpritePointers: +; gfx pointer, gfx tile offset, # tiles, vSprites tile offset + mon_icon_header SlowbroSprite, 12, 4, $00 + mon_icon_header BallSprite, 0, 8, $04 + mon_icon_header ClefairySprite, 12, 4, $0c + mon_icon_header BirdSprite, 12, 4, $10 + mon_icon_header SeelSprite, 0, 4, $14 + mon_icon_header BugIconFrame2, 0, 1, $18 + mon_icon_header BugIconFrame2, 1, 1, $1a + mon_icon_header PlantIconFrame2, 0, 1, $1c + mon_icon_header PlantIconFrame2, 1, 1, $1e + mon_icon_header SnakeIconFrame1, 0, 1, $20 + mon_icon_header SnakeIconFrame1, 1, 1, $22 + mon_icon_header QuadrupedIconFrame1, 0, 1, $24 + mon_icon_header QuadrupedIconFrame1, 1, 1, $26 + mon_icon_header TradeBubbleIconGFX, 0, 4, $38 + mon_icon_header SlowbroSprite, 0, 4, $40 + mon_icon_header BallSprite, 0, 8, $44 + mon_icon_header ClefairySprite, 0, 4, $4c + mon_icon_header BirdSprite, 0, 4, $50 + mon_icon_header SeelSprite, 12, 4, $54 + mon_icon_header BugIconFrame1, 0, 1, $58 + mon_icon_header BugIconFrame1, 1, 1, $5a + mon_icon_header PlantIconFrame1, 0, 1, $5c + mon_icon_header PlantIconFrame1, 1, 1, $5e + mon_icon_header SnakeIconFrame2, 0, 1, $60 + mon_icon_header SnakeIconFrame2, 1, 1, $62 + mon_icon_header QuadrupedIconFrame2, 0, 1, $64 + mon_icon_header QuadrupedIconFrame2, 1, 1, $66 + mon_icon_header TradeBubbleIconGFX, 4, 4, $78 diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 9f7b728a..4e836510 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -341,7 +341,7 @@ LoadAnimationTileset: ld e, a ld a, [hl] ld d, a ; de = address of tileset - ld hl, vSprites + $310 + ld hl, vSprites tile $31 ld b, BANK(AnimationTileset1) ; ROM bank ld a, [wTempTilesetNumTiles] ld c, a ; number of tiles @@ -373,6 +373,7 @@ ENDC IF DEF(_BLUE) INCBIN "gfx/slots/blue_slots_2.2bpp" ENDC +SlotMachineTiles2End: MoveAnimation: push hl diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index e563855d..34b3fbdb 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -154,14 +154,12 @@ GetBattleTransitionID_IsDungeonMap: INCLUDE "data/maps/dungeon_maps.asm" LoadBattleTransitionTile: - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f ld de, BattleTransitionTile - lb bc, BANK(BattleTransitionTile), (BattleTransitionTileEnd - BattleTransitionTile) / $10 + lb bc, BANK(BattleTransitionTile), 1 jp CopyVideoData -BattleTransitionTile: - INCBIN "gfx/overworld/battle_transition.2bpp" -BattleTransitionTileEnd: +BattleTransitionTile: INCBIN "gfx/overworld/battle_transition.2bpp" BattleTransition_BlackScreen: ld a, $ff diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 859f30d5..5cf8a45d 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6610,22 +6610,22 @@ LoadHudTilePatterns: jr c, .lcdEnabled .lcdDisabled ld hl, BattleHudTiles1 - ld de, vChars2 + $6d0 + ld de, vChars2 tile $6d ld bc, BattleHudTiles1End - BattleHudTiles1 ld a, BANK(BattleHudTiles1) call FarCopyDataDouble ld hl, BattleHudTiles2 - ld de, vChars2 + $730 + ld de, vChars2 tile $73 ld bc, BattleHudTiles3End - BattleHudTiles2 ld a, BANK(BattleHudTiles2) jp FarCopyDataDouble .lcdEnabled ld de, BattleHudTiles1 - ld hl, vChars2 + $6d0 + ld hl, vChars2 tile $6d lb bc, BANK(BattleHudTiles1), (BattleHudTiles1End - BattleHudTiles1) / $8 call CopyVideoDataDouble ld de, BattleHudTiles2 - ld hl, vChars2 + $730 + ld hl, vChars2 tile $73 lb bc, BANK(BattleHudTiles2), (BattleHudTiles3End - BattleHudTiles2) / $8 jp CopyVideoDataDouble diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index 8cd9528d..097a0fcc 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -12,7 +12,7 @@ DrawEnemyPokeballs: LoadPartyPokeballGfx: ld de, PokeballTileGraphics - ld hl, vSprites + $310 + ld hl, vSprites tile $31 lb bc, BANK(PokeballTileGraphics), (PokeballTileGraphicsEnd - PokeballTileGraphics) / $10 jp CopyVideoData diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index 3248e152..c282b49b 100755 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -10,7 +10,7 @@ DisplayDiploma:: set 6, [hl] call DisableLCD ld hl, CircleTile - ld de, vChars2 + CIRCLE_TILE_ID * $10 + ld de, vChars2 tile CIRCLE_TILE_ID ld bc, $10 ld a, BANK(CircleTile) call FarCopyData2 diff --git a/engine/events/hidden_objects/museum_fossils.asm b/engine/events/hidden_objects/museum_fossils.asm index 5d7e08fd..27714981 100644 --- a/engine/events/hidden_objects/museum_fossils.asm +++ b/engine/events/hidden_objects/museum_fossils.asm @@ -38,7 +38,7 @@ DisplayMonFrontSpriteInBox: ld a, [wcf91] ld [wd0b5], a call GetMonHeader - ld de, vChars1 + $310 + ld de, vChars1 tile $31 call LoadMonFrontSprite ld a, $80 ldh [hStartTileID], a diff --git a/engine/gfx/load_pokedex_tiles.asm b/engine/gfx/load_pokedex_tiles.asm index 70bcf04d..a3f69171 100755 --- a/engine/gfx/load_pokedex_tiles.asm +++ b/engine/gfx/load_pokedex_tiles.asm @@ -2,10 +2,10 @@ LoadPokedexTilePatterns: call LoadHpBarAndStatusTilePatterns ld de, PokedexTileGraphics - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / $10 call CopyVideoData ld de, PokeballTileGraphics - ld hl, vChars2 + $720 - lb bc, BANK(PokeballTileGraphics), $01 + ld hl, vChars2 tile $72 + lb bc, BANK(PokeballTileGraphics), 1 jp CopyVideoData ; load pokeball tile for marking caught mons diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm index 253fca35..8dd6fe75 100755 --- a/engine/gfx/mon_icons.asm +++ b/engine/gfx/mon_icons.asm @@ -201,11 +201,11 @@ UnusedPartyMonSpriteFunction: ld a, [wcf91] call GetPartyMonSpriteID push af - ld hl, vSprites + ld hl, vSprites tile $00 call .LoadTilePatterns pop af add $54 - ld hl, vSprites + $40 + ld hl, vSprites tile $04 call .LoadTilePatterns xor a ld [wMonPartySpriteSpecies], a diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index db066268..83ea81bf 100755 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -18,7 +18,7 @@ DisplayTownMap: ld de, wTileMapBackup ld bc, $10 call CopyData - ld hl, vSprites + $40 + ld hl, vSprites tile $04 ld de, TownMapCursor lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / $8 call CopyVideoDataDouble @@ -140,11 +140,11 @@ LoadTownMap_Fly:: call LoadPlayerSpriteGraphics call LoadFontTilePatterns ld de, BirdSprite - ld hl, vSprites + $40 - lb bc, BANK(BirdSprite), $c + ld hl, vSprites tile $04 + lb bc, BANK(BirdSprite), 12 call CopyVideoData ld de, TownMapUpArrow - ld hl, vChars1 + $6d0 + ld hl, vChars1 tile $6d lb bc, BANK(TownMapUpArrow), (TownMapUpArrowEnd - TownMapUpArrow) / $8 call CopyVideoDataDouble call BuildFlyLocationsList @@ -284,12 +284,12 @@ LoadTownMap: call TextBoxBorder call DisableLCD ld hl, WorldMapTileGraphics - ld de, vChars2 + $600 + ld de, vChars2 tile $60 ld bc, WorldMapTileGraphicsEnd - WorldMapTileGraphics ld a, BANK(WorldMapTileGraphics) call FarCopyData2 ld hl, MonNestIcon - ld de, vSprites + $40 + ld de, vSprites tile $04 ld bc, MonNestIconEnd - MonNestIcon ld a, BANK(MonNestIcon) call FarCopyDataDouble diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index 42d06846..67c0e471 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -972,6 +972,6 @@ CableClub_DrawHorizontalLine: LoadTrainerInfoTextBoxTiles: ld de, TrainerInfoTextBoxTileGraphics - ld hl, vChars2 + $760 + ld hl, vChars2 tile $76 lb bc, BANK(TrainerInfoTextBoxTileGraphics), (TrainerInfoTextBoxTileGraphicsEnd - TrainerInfoTextBoxTileGraphics) / $10 jp CopyVideoData diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index a16c9501..8ca2ec9b 100755 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -325,7 +325,7 @@ DisplayNamingScreen: LoadEDTile: ld de, ED_Tile - ld hl, vFont + $700 + ld hl, vFont tile $70 ld bc, (ED_TileEnd - ED_Tile) / $8 ; to fix the graphical bug on poor emulators ;lb bc, BANK(ED_Tile), (ED_TileEnd - ED_Tile) / $8 diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 8f1a2d61..a845592f 100755 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -485,39 +485,39 @@ DrawTrainerInfo: call TrainerInfo_DrawVerticalLine hlcoord 1, 2 call TrainerInfo_DrawVerticalLine - ld hl, vChars2 + $70 - ld de, vChars2 - ld bc, $70 * 4 + ld hl, vChars2 tile $07 + ld de, vChars2 tile $00 + ld bc, $1c tiles call CopyData ld hl, TrainerInfoTextBoxTileGraphics ; trainer info text box tile patterns - ld de, vChars2 + $770 - ld bc, $80 + ld de, vChars2 tile $77 + ld bc, 8 tiles push bc call TrainerInfo_FarCopyData ld hl, BlankLeaderNames - ld de, vChars2 + $600 - ld bc, $170 + ld de, vChars2 tile $60 + ld bc, $17 tiles call TrainerInfo_FarCopyData pop bc ld hl, BadgeNumbersTileGraphics ; badge number tile patterns - ld de, vChars1 + $580 + ld de, vChars1 tile $58 call TrainerInfo_FarCopyData ld hl, GymLeaderFaceAndBadgeTileGraphics ; gym leader face and badge tile patterns - ld de, vChars2 + $200 - ld bc, $400 - ld a, $03 + ld de, vChars2 tile $20 + ld bc, 8 * 8 tiles + ld a, BANK(GymLeaderFaceAndBadgeTileGraphics) call FarCopyData2 ld hl, TextBoxGraphics - ld de, $d0 + ld de, 13 tiles add hl, de ; hl = colon tile pattern - ld de, vChars1 + $560 - ld bc, $10 - ld a, $04 + ld de, vChars1 tile $56 + ld bc, 1 tiles + ld a, BANK(TextBoxGraphics) push bc call FarCopyData2 pop bc - ld hl, TrainerInfoTextBoxTileGraphics + $80 ; background tile pattern - ld de, vChars1 + $570 + ld hl, TrainerInfoTextBoxTileGraphics tile 8 ; background tile pattern + ld de, vChars1 tile $57 call TrainerInfo_FarCopyData call EnableLCD ld hl, wTrainerInfoTextBoxWidthPlus1 diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index ae35a2b7..6fb0598e 100755 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -5,14 +5,14 @@ HallOfFamePC: call DelayFrames call DisableLCD ld hl, vFont - ld bc, $800 / 2 + ld bc, ($80 tiles) / 2 call ZeroMemory - ld hl, vChars2 + $600 - ld bc, $200 / 2 + ld hl, vChars2 tile $60 + ld bc, ($20 tiles) / 2 call ZeroMemory - ld hl, vChars2 + $7e0 - ld bc, $10 - ld a, $ff + ld hl, vChars2 tile $7e + ld bc, 1 tiles + ld a, $ff ; solid black call FillMemory hlcoord 0, 0 call FillFourRowsWithBlack @@ -245,7 +245,7 @@ Credits: call FillMiddleOfScreenWithWhite pop de ld de, TheEndGfx - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10 call CopyVideoData hlcoord 4, 8 diff --git a/engine/movie/gamefreak.asm b/engine/movie/gamefreak.asm index d3b5eb88..1463eb4f 100755 --- a/engine/movie/gamefreak.asm +++ b/engine/movie/gamefreak.asm @@ -3,16 +3,16 @@ LoadShootingStarGraphics: ldh [rOBP0], a ld a, $a4 ldh [rOBP1], a - ld de, AnimationTileset2 + $30 ; star tile (top left quadrant) - ld hl, vChars1 + $200 - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 3 ; star tile (top left quadrant) + ld hl, vChars1 tile $20 + lb bc, BANK(AnimationTileset2), 1 call CopyVideoData - ld de, AnimationTileset2 + $130 ; star tile (bottom left quadrant) - ld hl, vChars1 + $210 - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 19 ; star tile (bottom left quadrant) + ld hl, vChars1 tile $21 + lb bc, BANK(AnimationTileset2), 1 call CopyVideoData ld de, FallingStar - ld hl, vChars1 + $220 + ld hl, vChars1 tile $22 lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10 call CopyVideoData ld hl, GameFreakLogoOAMData diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 69838afb..bdb24d6a 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -36,27 +36,27 @@ DisplayTitleScreen: call DisableLCD call LoadFontTilePatterns ld hl, NintendoCopyrightLogoGraphics - ld de, vTitleLogo2 + $100 - ld bc, $50 + ld de, vTitleLogo2 tile 16 + ld bc, 5 tiles ld a, BANK(NintendoCopyrightLogoGraphics) call FarCopyData2 ld hl, GamefreakLogoGraphics - ld de, vTitleLogo2 + $100 + $50 - ld bc, $90 + ld de, vTitleLogo2 tile (16 + 5) + ld bc, 9 tiles ld a, BANK(GamefreakLogoGraphics) call FarCopyData2 ld hl, PokemonLogoGraphics ld de, vTitleLogo - ld bc, $600 + ld bc, $60 tiles ld a, BANK(PokemonLogoGraphics) call FarCopyData2 ; first chunk - ld hl, PokemonLogoGraphics+$600 + ld hl, PokemonLogoGraphics tile $60 ld de, vTitleLogo2 - ld bc, $100 + ld bc, $10 tiles ld a, BANK(PokemonLogoGraphics) call FarCopyData2 ; second chunk ld hl, Version_GFX - ld de, vChars2 + $600 - (Version_GFXEnd - Version_GFX - $50) + ld de, vChars2 tile $60 + (10 tiles - (Version_GFXEnd - Version_GFX) * 2) / 2 ld bc, Version_GFXEnd - Version_GFX ld a, BANK(Version_GFX) call FarCopyDataDouble @@ -369,7 +369,7 @@ LoadCopyrightAndTextBoxTiles: LoadCopyrightTiles: ld de, NintendoCopyrightLogoGraphics - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(NintendoCopyrightLogoGraphics), (GamefreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10 call CopyVideoData hlcoord 2, 7 diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index 3883c362..fc2da9bd 100755 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -157,12 +157,12 @@ LoadTradingGFXAndMonNames: call Trade_ClearTileMap call DisableLCD ld hl, TradingAnimationGraphics - ld de, vChars2 + $310 + ld de, vChars2 tile $31 ld bc, TradingAnimationGraphicsEnd - TradingAnimationGraphics ld a, BANK(TradingAnimationGraphics) call FarCopyData2 ld hl, TradingAnimationGraphics2 - ld de, vSprites + $7c0 + ld de, vSprites tile $7c ld bc, TradingAnimationGraphics2End - TradingAnimationGraphics2 ld a, BANK(TradingAnimationGraphics2) call FarCopyData2 diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 97842079..07039e03 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -80,23 +80,23 @@ InitCutAnimOAM: cp $52 jr z, .grass ; tree - ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row - ld hl, vChars1 + $7c0 - lb bc, BANK(Overworld_GFX), $02 + ld de, Overworld_GFX tile $2d ; cuttable tree sprite top row + ld hl, vChars1 tile $7c + lb bc, BANK(Overworld_GFX), 2 call CopyVideoData - ld de, Overworld_GFX + $3d0 ; cuttable tree sprite bottom row - ld hl, vChars1 + $7e0 - lb bc, BANK(Overworld_GFX), $02 + ld de, Overworld_GFX tile $3d ; cuttable tree sprite bottom row + ld hl, vChars1 tile $7e + lb bc, BANK(Overworld_GFX), 2 call CopyVideoData jr WriteCutOrBoulderDustAnimationOAMBlock .grass - ld hl, vChars1 + $7c0 + ld hl, vChars1 tile $7c call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7d0 + ld hl, vChars1 tile $7d call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7e0 + ld hl, vChars1 tile $7e call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f call LoadCutGrassAnimationTilePattern call WriteCutOrBoulderDustAnimationOAMBlock ld hl, wOAMBuffer + $93 @@ -112,8 +112,8 @@ InitCutAnimOAM: ret LoadCutGrassAnimationTilePattern: - ld de, AnimationTileset2 + $60 ; tile depicting a leaf - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 6 ; tile depicting a leaf + lb bc, BANK(AnimationTileset2), 1 jp CopyVideoData WriteCutOrBoulderDustAnimationOAMBlock: diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm index 09a71a18..a20a0591 100755 --- a/engine/overworld/dust_smoke.asm +++ b/engine/overworld/dust_smoke.asm @@ -69,14 +69,14 @@ MoveBoulderDustFunctionPointerTable: dw AdjustOAMBlockXPos LoadSmokeTileFourTimes:: - ld hl, vChars1 + $7c0 - ld c, $4 + ld hl, vChars1 tile $7c + ld c, 4 .loop push bc push hl call LoadSmokeTile pop hl - ld bc, $10 + ld bc, 1 tiles add hl, bc pop bc dec c diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index 1ac07b80..298858a2 100755 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -8,8 +8,8 @@ EmotionBubble: ld e, [hl] inc hl ld d, [hl] - ld hl, vChars1 + $780 - lb bc, BANK(EmotionBubbles), $04 + ld hl, vChars1 tile $78 + lb bc, BANK(EmotionBubbles), 4 call CopyVideoData ld a, [wUpdateSpritesEnabled] push af diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index 062ef7ea..eaa396d0 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -1,7 +1,7 @@ AnimateHealingMachine: ld de, PokeCenterFlashingMonitorAndHealBall - ld hl, vChars0 + $7c0 - lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 ; loads one too many tiles + ld hl, vChars0 tile $7c + lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), 3 ; should be 2 call CopyVideoData ld hl, wUpdateSpritesEnabled ld a, [hl] diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index 254680a5..0e006c5e 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -57,7 +57,7 @@ HandleLedges:: INCLUDE "data/tilesets/ledge_tiles.asm" LoadHoppingShadowOAM: - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f ld de, LedgeHoppingShadow lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8 call CopyVideoDataDouble diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index 4a68169a..8f1f3931 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -130,25 +130,25 @@ LoadMapSpriteTilePatterns: push de push bc ld hl, vNPCSprites ; VRAM base address - ld bc, $c0 ; number of bytes per VRAM slot + ld bc, 12 tiles ; number of bytes per VRAM slot ldh a, [hVRAMSlot] cp 11 ; is it a 4-tile sprite? jr nc, .fourTileSpriteVRAMAddr ld d, a dec d -; hl = vSprites + [hVRAMSlot] * $C0 (the number of bytes in 12 tiles) +; hl = vSprites + [hVRAMSlot] * 12 tiles .calculateVRAMAddrLoop add hl, bc dec d jr nz, .calculateVRAMAddrLoop jr .loadStillTilePattern .fourTileSpriteVRAMAddr - ld hl, vSprites + $7c0 ; address for second 4-tile sprite + ld hl, vSprites tile $7c ; address for second 4-tile sprite ldh a, [hFourTileSpriteCount] and a jr nz, .loadStillTilePattern ; if it's the first 4-tile sprite - ld hl, vSprites + $780 ; address for first 4-tile sprite + ld hl, vSprites tile $78 ; address for first 4-tile sprite inc a ldh [hFourTileSpriteCount], a .loadStillTilePattern diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index 69c1eefc..9e9b4073 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -250,11 +250,11 @@ DoFlyAnimation: LoadBirdSpriteGraphics: ld de, BirdSprite ld hl, vNPCSprites - lb bc, BANK(BirdSprite), $0c + lb bc, BANK(BirdSprite), 12 call CopyVideoData - ld de, BirdSprite + $c0 ; moving animation sprite + ld de, BirdSprite tile 12 ; moving animation sprite ld hl, vNPCSprites2 - lb bc, BANK(BirdSprite), $0c + lb bc, BANK(BirdSprite), 12 jp CopyVideoData InitFacingDirectionList: @@ -381,8 +381,8 @@ FishingAnim: ld hl, wd736 set 6, [hl] ; reserve the last 4 OAM entries ld de, RedSprite - ld hl, vNPCSprites - lb bc, BANK(RedSprite), $c + ld hl, vNPCSprites tile $00 + lb bc, BANK(RedSprite), 12 call CopyVideoData ld a, $4 ld hl, RedFishingTiles @@ -479,22 +479,18 @@ FishingRodOAM: db $50, $40, $FE, $00 ; player facing left db $50, $58, $FE, $20 ; player facing right ($20 means "horizontally flip the tile") -RedFishingTiles: - dw RedFishingTilesFront - db 2, BANK(RedFishingTilesFront) - dw vNPCSprites + $20 +fishing_gfx: MACRO + dw \1 + db \2 + db BANK(\1) + dw vNPCSprites tile \3 +ENDM - dw RedFishingTilesBack - db 2, BANK(RedFishingTilesBack) - dw vNPCSprites + $60 - - dw RedFishingTilesSide - db 2, BANK(RedFishingTilesSide) - dw vNPCSprites + $a0 - - dw RedFishingRodTiles - db 3, BANK(RedFishingRodTiles) - dw vNPCSprites2 + $7d0 +RedFishingTiles: + fishing_gfx RedFishingTilesFront, 2, $02 + fishing_gfx RedFishingTilesBack, 2, $06 + fishing_gfx RedFishingTilesSide, 2, $0a + fishing_gfx RedFishingRodTiles, 3, $fd _HandleMidJump:: ld a, [wPlayerJumpingYScreenCoordsIndex] diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 0b514111..df02a496 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -114,9 +114,9 @@ BillsPC_:: BillsPCMenu: ld a, [wParentMenuItem] ld [wCurrentMenuItem], a - ld hl, vChars2 + $780 + ld hl, vChars2 tile $78 ld de, PokeballTileGraphics - lb bc, BANK(PokeballTileGraphics), $01 + lb bc, BANK(PokeballTileGraphics), 1 call CopyVideoData call LoadScreenTilesFromBuffer2DisableBGTransfer hlcoord 0, 0 diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index 83d33fe5..d4a4e59a 100755 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -86,21 +86,21 @@ StatusScreen: call UpdateSprites call LoadHpBarAndStatusTilePatterns ld de, BattleHudTiles1 ; source - ld hl, vChars2 + $6d0 ; dest - lb bc, BANK(BattleHudTiles1), $03 + ld hl, vChars2 tile $6d ; dest + lb bc, BANK(BattleHudTiles1), 3 call CopyVideoDataDouble ; ·│ :L and halfarrow line end ld de, BattleHudTiles2 - ld hl, vChars2 + $780 - lb bc, BANK(BattleHudTiles2), $01 + ld hl, vChars2 tile $78 + lb bc, BANK(BattleHudTiles2), 1 call CopyVideoDataDouble ; │ ld de, BattleHudTiles3 - ld hl, vChars2 + $760 - lb bc, BANK(BattleHudTiles3), $02 - call CopyVideoDataDouble ; ─┘ + ld hl, vChars2 tile $76 + lb bc, BANK(BattleHudTiles3), 2 + call CopyVideoDataDouble ; ─ ┘ ld de, PTile - ld hl, vChars2 + $720 - lb bc, BANK(PTile), (PTileEnd - PTile) / $8 - call CopyVideoDataDouble ; P (for PP), inline + ld hl, vChars2 tile $72 + lb bc, BANK(PTile), 1 + call CopyVideoDataDouble ; bold P (for PP) ldh a, [hTilesetType] push af xor a @@ -244,9 +244,7 @@ DrawLineBox: ld [hl], $6f ; ← (halfarrow ending) ret -PTile: - INCBIN "gfx/font/P.1bpp" -PTileEnd: +PTile: INCBIN "gfx/font/P.1bpp" PrintStatsBox: ld a, d diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index a1326240..9af17a81 100755 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -850,17 +850,17 @@ LoadSlotMachineTiles: call DisableLCD ld hl, SlotMachineTiles2 ld de, vChars0 - ld bc, $1c0 + ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineTiles1 ld de, vChars2 - ld bc, $250 + ld bc, SlotMachineTiles1End - SlotMachineTiles1 ld a, BANK(SlotMachineTiles1) call FarCopyData2 ld hl, SlotMachineTiles2 - ld de, vChars2 + $250 - ld bc, $1c0 + ld de, vChars2 tile $25 + ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineMap @@ -890,3 +890,4 @@ ENDC IF DEF(_BLUE) INCBIN "gfx/slots/blue_slots_1.2bpp" ENDC +SlotMachineTiles1End: @@ -820,13 +820,13 @@ LoadTextBoxTilePatterns:: jr nz, .on .off ld hl, TextBoxGraphics - ld de, vChars2 + $600 + ld de, vChars2 tile $60 ld bc, TextBoxGraphicsEnd - TextBoxGraphics ld a, BANK(TextBoxGraphics) jp FarCopyData2 ; if LCD is off, transfer all at once .on ld de, TextBoxGraphics - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(TextBoxGraphics), (TextBoxGraphicsEnd - TextBoxGraphics) / $10 jp CopyVideoData ; if LCD is on, transfer during V-blank @@ -836,13 +836,13 @@ LoadHpBarAndStatusTilePatterns:: jr nz, .on .off ld hl, HpBarAndStatusGraphics - ld de, vChars2 + $620 + ld de, vChars2 tile $62 ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics ld a, BANK(HpBarAndStatusGraphics) jp FarCopyData2 ; if LCD is off, transfer all at once .on ld de, HpBarAndStatusGraphics - ld hl, vChars2 + $620 + ld hl, vChars2 tile $62 lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10 jp CopyVideoData ; if LCD is on, transfer during V-blank diff --git a/home/vcopy.asm b/home/vcopy.asm index 1a7863e9..458fa610 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -393,7 +393,7 @@ UpdateMovingBgTiles:: ; water - ld hl, vTileset + $14 * $10 + ld hl, vTileset tile $14 ld c, $10 ld a, [wMovingBGTilesCounter2] @@ -438,7 +438,7 @@ UpdateMovingBgTiles:: jr z, .copy ld hl, FlowerTile3 .copy - ld de, vTileset + $3 * $10 + ld de, vTileset tile $03 ld c, $10 .loop ld a, [hli] diff --git a/scripts/RocketHideoutB2F.asm b/scripts/RocketHideoutB2F.asm index 95d8b0d2..47c0581c 100755 --- a/scripts/RocketHideoutB2F.asm +++ b/scripts/RocketHideoutB2F.asm @@ -367,38 +367,32 @@ LoadSpinnerArrowTiles:: spinner: MACRO ; \1: source ; \2: offset (BANK() chokes on literals) -; \3: length -; \4: dest - dw \1 + \2 - db \3, BANK(\1) - dw \4 +; \3: dest + dw \1 tile \2 + db 1 + db BANK(\1) + dw vTileset tile \3 ENDM FacilitySpinnerArrows: -FACILITY_SPINNER EQU $20 * $10 -vFacilitySpinner EQUS "vTileset + FACILITY_SPINNER" - - spinner SpinnerArrowAnimTiles, $00, 1, vFacilitySpinner - spinner SpinnerArrowAnimTiles, $10, 1, vFacilitySpinner + $10 - spinner SpinnerArrowAnimTiles, $20, 1, vFacilitySpinner + $100 - spinner SpinnerArrowAnimTiles, $30, 1, vFacilitySpinner + $110 - spinner Facility_GFX, FACILITY_SPINNER + $000, 1, vFacilitySpinner - spinner Facility_GFX, FACILITY_SPINNER + $010, 1, vFacilitySpinner + $10 - spinner Facility_GFX, FACILITY_SPINNER + $100, 1, vFacilitySpinner + $100 - spinner Facility_GFX, FACILITY_SPINNER + $110, 1, vFacilitySpinner + $110 + spinner SpinnerArrowAnimTiles, 0, $20 + spinner SpinnerArrowAnimTiles, 1, $21 + spinner SpinnerArrowAnimTiles, 2, $30 + spinner SpinnerArrowAnimTiles, 3, $31 + spinner Facility_GFX, $20, $20 + spinner Facility_GFX, $21, $21 + spinner Facility_GFX, $30, $30 + spinner Facility_GFX, $31, $31 GymSpinnerArrows: -GYM_SPINNER EQU $3c * $10 -vGymSpinner EQUS "vTileset + GYM_SPINNER" - - spinner SpinnerArrowAnimTiles, $10, 1, vGymSpinner - spinner SpinnerArrowAnimTiles, $30, 1, vGymSpinner + $10 - spinner SpinnerArrowAnimTiles, $00, 1, vGymSpinner + $100 - spinner SpinnerArrowAnimTiles, $20, 1, vGymSpinner + $110 - spinner Gym_GFX, GYM_SPINNER + $000, 1, vGymSpinner - spinner Gym_GFX, GYM_SPINNER + $010, 1, vGymSpinner + $10 - spinner Gym_GFX, GYM_SPINNER + $100, 1, vGymSpinner + $100 - spinner Gym_GFX, GYM_SPINNER + $110, 1, vGymSpinner + $110 + spinner SpinnerArrowAnimTiles, 1, $3c + spinner SpinnerArrowAnimTiles, 3, $3d + spinner SpinnerArrowAnimTiles, 0, $4c + spinner SpinnerArrowAnimTiles, 2, $4d + spinner Gym_GFX, $3c, $3c + spinner Gym_GFX, $3d, $3d + spinner Gym_GFX, $4c, $4c + spinner Gym_GFX, $4d, $4d SpinnerPlayerFacingDirections: ; This isn't the order of the facing directions. Rather, it's a list of |