Use 'tile' and 'tiles' macros

This commit is contained in:
Rangi 2020-07-07 15:09:54 -04:00
parent b945988a0a
commit 4a7d1513f3
30 changed files with 188 additions and 303 deletions

View file

@ -1,140 +1,37 @@
mon_icon_header: MACRO
dw \1 tile \2
db \3
db BANK(\1)
dw vSprites tile \4
ENDM
MonPartySpritePointers: MonPartySpritePointers:
dw SlowbroSprite + $c0 ; gfx pointer, gfx tile offset, # tiles, vSprites tile offset
db $40 / $10 ; 40 bytes mon_icon_header SlowbroSprite, 12, 4, $00
db BANK(SlowbroSprite) mon_icon_header BallSprite, 0, 8, $04
dw vSprites mon_icon_header ClefairySprite, 12, 4, $0c
mon_icon_header BirdSprite, 12, 4, $10
dw BallSprite mon_icon_header SeelSprite, 0, 4, $14
db $80 / $10 ; $80 bytes mon_icon_header BugIconFrame2, 0, 1, $18
db BANK(BallSprite) mon_icon_header BugIconFrame2, 1, 1, $1a
dw vSprites + $40 mon_icon_header PlantIconFrame2, 0, 1, $1c
mon_icon_header PlantIconFrame2, 1, 1, $1e
dw ClefairySprite + $c0 mon_icon_header SnakeIconFrame1, 0, 1, $20
db $40 / $10 ; $40 bytes mon_icon_header SnakeIconFrame1, 1, 1, $22
db BANK(ClefairySprite) mon_icon_header QuadrupedIconFrame1, 0, 1, $24
dw vSprites + $c0 mon_icon_header QuadrupedIconFrame1, 1, 1, $26
mon_icon_header TradeBubbleIconGFX, 0, 4, $38
dw BirdSprite + $c0 mon_icon_header SlowbroSprite, 0, 4, $40
db $40 / $10 ; $40 bytes mon_icon_header BallSprite, 0, 8, $44
db BANK(BirdSprite) mon_icon_header ClefairySprite, 0, 4, $4c
dw vSprites + $100 mon_icon_header BirdSprite, 0, 4, $50
mon_icon_header SeelSprite, 12, 4, $54
dw SeelSprite mon_icon_header BugIconFrame1, 0, 1, $58
db $40 / $10 ; $40 bytes mon_icon_header BugIconFrame1, 1, 1, $5a
db BANK(SeelSprite) mon_icon_header PlantIconFrame1, 0, 1, $5c
dw vSprites + $140 mon_icon_header PlantIconFrame1, 1, 1, $5e
mon_icon_header SnakeIconFrame2, 0, 1, $60
dw BugIconFrame2 mon_icon_header SnakeIconFrame2, 1, 1, $62
db $10 / $10 ; $10 bytes mon_icon_header QuadrupedIconFrame2, 0, 1, $64
db BANK(BugIconFrame2) mon_icon_header QuadrupedIconFrame2, 1, 1, $66
dw vSprites + $180 mon_icon_header TradeBubbleIconGFX, 4, 4, $78
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
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

View file

@ -341,7 +341,7 @@ LoadAnimationTileset:
ld e, a ld e, a
ld a, [hl] ld a, [hl]
ld d, a ; de = address of tileset ld d, a ; de = address of tileset
ld hl, vSprites + $310 ld hl, vSprites tile $31
ld b, BANK(AnimationTileset1) ; ROM bank ld b, BANK(AnimationTileset1) ; ROM bank
ld a, [wTempTilesetNumTiles] ld a, [wTempTilesetNumTiles]
ld c, a ; number of tiles ld c, a ; number of tiles
@ -373,6 +373,7 @@ ENDC
IF DEF(_BLUE) IF DEF(_BLUE)
INCBIN "gfx/slots/blue_slots_2.2bpp" INCBIN "gfx/slots/blue_slots_2.2bpp"
ENDC ENDC
SlotMachineTiles2End:
MoveAnimation: MoveAnimation:
push hl push hl

View file

@ -154,14 +154,12 @@ GetBattleTransitionID_IsDungeonMap:
INCLUDE "data/maps/dungeon_maps.asm" INCLUDE "data/maps/dungeon_maps.asm"
LoadBattleTransitionTile: LoadBattleTransitionTile:
ld hl, vChars1 + $7f0 ld hl, vChars1 tile $7f
ld de, BattleTransitionTile ld de, BattleTransitionTile
lb bc, BANK(BattleTransitionTile), (BattleTransitionTileEnd - BattleTransitionTile) / $10 lb bc, BANK(BattleTransitionTile), 1
jp CopyVideoData jp CopyVideoData
BattleTransitionTile: BattleTransitionTile: INCBIN "gfx/overworld/battle_transition.2bpp"
INCBIN "gfx/overworld/battle_transition.2bpp"
BattleTransitionTileEnd:
BattleTransition_BlackScreen: BattleTransition_BlackScreen:
ld a, $ff ld a, $ff

View file

@ -6610,22 +6610,22 @@ LoadHudTilePatterns:
jr c, .lcdEnabled jr c, .lcdEnabled
.lcdDisabled .lcdDisabled
ld hl, BattleHudTiles1 ld hl, BattleHudTiles1
ld de, vChars2 + $6d0 ld de, vChars2 tile $6d
ld bc, BattleHudTiles1End - BattleHudTiles1 ld bc, BattleHudTiles1End - BattleHudTiles1
ld a, BANK(BattleHudTiles1) ld a, BANK(BattleHudTiles1)
call FarCopyDataDouble call FarCopyDataDouble
ld hl, BattleHudTiles2 ld hl, BattleHudTiles2
ld de, vChars2 + $730 ld de, vChars2 tile $73
ld bc, BattleHudTiles3End - BattleHudTiles2 ld bc, BattleHudTiles3End - BattleHudTiles2
ld a, BANK(BattleHudTiles2) ld a, BANK(BattleHudTiles2)
jp FarCopyDataDouble jp FarCopyDataDouble
.lcdEnabled .lcdEnabled
ld de, BattleHudTiles1 ld de, BattleHudTiles1
ld hl, vChars2 + $6d0 ld hl, vChars2 tile $6d
lb bc, BANK(BattleHudTiles1), (BattleHudTiles1End - BattleHudTiles1) / $8 lb bc, BANK(BattleHudTiles1), (BattleHudTiles1End - BattleHudTiles1) / $8
call CopyVideoDataDouble call CopyVideoDataDouble
ld de, BattleHudTiles2 ld de, BattleHudTiles2
ld hl, vChars2 + $730 ld hl, vChars2 tile $73
lb bc, BANK(BattleHudTiles2), (BattleHudTiles3End - BattleHudTiles2) / $8 lb bc, BANK(BattleHudTiles2), (BattleHudTiles3End - BattleHudTiles2) / $8
jp CopyVideoDataDouble jp CopyVideoDataDouble

View file

@ -12,7 +12,7 @@ DrawEnemyPokeballs:
LoadPartyPokeballGfx: LoadPartyPokeballGfx:
ld de, PokeballTileGraphics ld de, PokeballTileGraphics
ld hl, vSprites + $310 ld hl, vSprites tile $31
lb bc, BANK(PokeballTileGraphics), (PokeballTileGraphicsEnd - PokeballTileGraphics) / $10 lb bc, BANK(PokeballTileGraphics), (PokeballTileGraphicsEnd - PokeballTileGraphics) / $10
jp CopyVideoData jp CopyVideoData

View file

@ -10,7 +10,7 @@ DisplayDiploma::
set 6, [hl] set 6, [hl]
call DisableLCD call DisableLCD
ld hl, CircleTile ld hl, CircleTile
ld de, vChars2 + CIRCLE_TILE_ID * $10 ld de, vChars2 tile CIRCLE_TILE_ID
ld bc, $10 ld bc, $10
ld a, BANK(CircleTile) ld a, BANK(CircleTile)
call FarCopyData2 call FarCopyData2

View file

@ -38,7 +38,7 @@ DisplayMonFrontSpriteInBox:
ld a, [wcf91] ld a, [wcf91]
ld [wd0b5], a ld [wd0b5], a
call GetMonHeader call GetMonHeader
ld de, vChars1 + $310 ld de, vChars1 tile $31
call LoadMonFrontSprite call LoadMonFrontSprite
ld a, $80 ld a, $80
ldh [hStartTileID], a ldh [hStartTileID], a

View file

@ -2,10 +2,10 @@
LoadPokedexTilePatterns: LoadPokedexTilePatterns:
call LoadHpBarAndStatusTilePatterns call LoadHpBarAndStatusTilePatterns
ld de, PokedexTileGraphics ld de, PokedexTileGraphics
ld hl, vChars2 + $600 ld hl, vChars2 tile $60
lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / $10 lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / $10
call CopyVideoData call CopyVideoData
ld de, PokeballTileGraphics ld de, PokeballTileGraphics
ld hl, vChars2 + $720 ld hl, vChars2 tile $72
lb bc, BANK(PokeballTileGraphics), $01 lb bc, BANK(PokeballTileGraphics), 1
jp CopyVideoData ; load pokeball tile for marking caught mons jp CopyVideoData ; load pokeball tile for marking caught mons

View file

@ -201,11 +201,11 @@ UnusedPartyMonSpriteFunction:
ld a, [wcf91] ld a, [wcf91]
call GetPartyMonSpriteID call GetPartyMonSpriteID
push af push af
ld hl, vSprites ld hl, vSprites tile $00
call .LoadTilePatterns call .LoadTilePatterns
pop af pop af
add $54 add $54
ld hl, vSprites + $40 ld hl, vSprites tile $04
call .LoadTilePatterns call .LoadTilePatterns
xor a xor a
ld [wMonPartySpriteSpecies], a ld [wMonPartySpriteSpecies], a

View file

@ -18,7 +18,7 @@ DisplayTownMap:
ld de, wTileMapBackup ld de, wTileMapBackup
ld bc, $10 ld bc, $10
call CopyData call CopyData
ld hl, vSprites + $40 ld hl, vSprites tile $04
ld de, TownMapCursor ld de, TownMapCursor
lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / $8 lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / $8
call CopyVideoDataDouble call CopyVideoDataDouble
@ -140,11 +140,11 @@ LoadTownMap_Fly::
call LoadPlayerSpriteGraphics call LoadPlayerSpriteGraphics
call LoadFontTilePatterns call LoadFontTilePatterns
ld de, BirdSprite ld de, BirdSprite
ld hl, vSprites + $40 ld hl, vSprites tile $04
lb bc, BANK(BirdSprite), $c lb bc, BANK(BirdSprite), 12
call CopyVideoData call CopyVideoData
ld de, TownMapUpArrow ld de, TownMapUpArrow
ld hl, vChars1 + $6d0 ld hl, vChars1 tile $6d
lb bc, BANK(TownMapUpArrow), (TownMapUpArrowEnd - TownMapUpArrow) / $8 lb bc, BANK(TownMapUpArrow), (TownMapUpArrowEnd - TownMapUpArrow) / $8
call CopyVideoDataDouble call CopyVideoDataDouble
call BuildFlyLocationsList call BuildFlyLocationsList
@ -284,12 +284,12 @@ LoadTownMap:
call TextBoxBorder call TextBoxBorder
call DisableLCD call DisableLCD
ld hl, WorldMapTileGraphics ld hl, WorldMapTileGraphics
ld de, vChars2 + $600 ld de, vChars2 tile $60
ld bc, WorldMapTileGraphicsEnd - WorldMapTileGraphics ld bc, WorldMapTileGraphicsEnd - WorldMapTileGraphics
ld a, BANK(WorldMapTileGraphics) ld a, BANK(WorldMapTileGraphics)
call FarCopyData2 call FarCopyData2
ld hl, MonNestIcon ld hl, MonNestIcon
ld de, vSprites + $40 ld de, vSprites tile $04
ld bc, MonNestIconEnd - MonNestIcon ld bc, MonNestIconEnd - MonNestIcon
ld a, BANK(MonNestIcon) ld a, BANK(MonNestIcon)
call FarCopyDataDouble call FarCopyDataDouble

View file

@ -972,6 +972,6 @@ CableClub_DrawHorizontalLine:
LoadTrainerInfoTextBoxTiles: LoadTrainerInfoTextBoxTiles:
ld de, TrainerInfoTextBoxTileGraphics ld de, TrainerInfoTextBoxTileGraphics
ld hl, vChars2 + $760 ld hl, vChars2 tile $76
lb bc, BANK(TrainerInfoTextBoxTileGraphics), (TrainerInfoTextBoxTileGraphicsEnd - TrainerInfoTextBoxTileGraphics) / $10 lb bc, BANK(TrainerInfoTextBoxTileGraphics), (TrainerInfoTextBoxTileGraphicsEnd - TrainerInfoTextBoxTileGraphics) / $10
jp CopyVideoData jp CopyVideoData

View file

@ -325,7 +325,7 @@ DisplayNamingScreen:
LoadEDTile: LoadEDTile:
ld de, ED_Tile ld de, ED_Tile
ld hl, vFont + $700 ld hl, vFont tile $70
ld bc, (ED_TileEnd - ED_Tile) / $8 ld bc, (ED_TileEnd - ED_Tile) / $8
; to fix the graphical bug on poor emulators ; to fix the graphical bug on poor emulators
;lb bc, BANK(ED_Tile), (ED_TileEnd - ED_Tile) / $8 ;lb bc, BANK(ED_Tile), (ED_TileEnd - ED_Tile) / $8

View file

@ -485,39 +485,39 @@ DrawTrainerInfo:
call TrainerInfo_DrawVerticalLine call TrainerInfo_DrawVerticalLine
hlcoord 1, 2 hlcoord 1, 2
call TrainerInfo_DrawVerticalLine call TrainerInfo_DrawVerticalLine
ld hl, vChars2 + $70 ld hl, vChars2 tile $07
ld de, vChars2 ld de, vChars2 tile $00
ld bc, $70 * 4 ld bc, $1c tiles
call CopyData call CopyData
ld hl, TrainerInfoTextBoxTileGraphics ; trainer info text box tile patterns ld hl, TrainerInfoTextBoxTileGraphics ; trainer info text box tile patterns
ld de, vChars2 + $770 ld de, vChars2 tile $77
ld bc, $80 ld bc, 8 tiles
push bc push bc
call TrainerInfo_FarCopyData call TrainerInfo_FarCopyData
ld hl, BlankLeaderNames ld hl, BlankLeaderNames
ld de, vChars2 + $600 ld de, vChars2 tile $60
ld bc, $170 ld bc, $17 tiles
call TrainerInfo_FarCopyData call TrainerInfo_FarCopyData
pop bc pop bc
ld hl, BadgeNumbersTileGraphics ; badge number tile patterns ld hl, BadgeNumbersTileGraphics ; badge number tile patterns
ld de, vChars1 + $580 ld de, vChars1 tile $58
call TrainerInfo_FarCopyData call TrainerInfo_FarCopyData
ld hl, GymLeaderFaceAndBadgeTileGraphics ; gym leader face and badge tile patterns ld hl, GymLeaderFaceAndBadgeTileGraphics ; gym leader face and badge tile patterns
ld de, vChars2 + $200 ld de, vChars2 tile $20
ld bc, $400 ld bc, 8 * 8 tiles
ld a, $03 ld a, BANK(GymLeaderFaceAndBadgeTileGraphics)
call FarCopyData2 call FarCopyData2
ld hl, TextBoxGraphics ld hl, TextBoxGraphics
ld de, $d0 ld de, 13 tiles
add hl, de ; hl = colon tile pattern add hl, de ; hl = colon tile pattern
ld de, vChars1 + $560 ld de, vChars1 tile $56
ld bc, $10 ld bc, 1 tiles
ld a, $04 ld a, BANK(TextBoxGraphics)
push bc push bc
call FarCopyData2 call FarCopyData2
pop bc pop bc
ld hl, TrainerInfoTextBoxTileGraphics + $80 ; background tile pattern ld hl, TrainerInfoTextBoxTileGraphics tile 8 ; background tile pattern
ld de, vChars1 + $570 ld de, vChars1 tile $57
call TrainerInfo_FarCopyData call TrainerInfo_FarCopyData
call EnableLCD call EnableLCD
ld hl, wTrainerInfoTextBoxWidthPlus1 ld hl, wTrainerInfoTextBoxWidthPlus1

View file

@ -5,14 +5,14 @@ HallOfFamePC:
call DelayFrames call DelayFrames
call DisableLCD call DisableLCD
ld hl, vFont ld hl, vFont
ld bc, $800 / 2 ld bc, ($80 tiles) / 2
call ZeroMemory call ZeroMemory
ld hl, vChars2 + $600 ld hl, vChars2 tile $60
ld bc, $200 / 2 ld bc, ($20 tiles) / 2
call ZeroMemory call ZeroMemory
ld hl, vChars2 + $7e0 ld hl, vChars2 tile $7e
ld bc, $10 ld bc, 1 tiles
ld a, $ff ld a, $ff ; solid black
call FillMemory call FillMemory
hlcoord 0, 0 hlcoord 0, 0
call FillFourRowsWithBlack call FillFourRowsWithBlack
@ -245,7 +245,7 @@ Credits:
call FillMiddleOfScreenWithWhite call FillMiddleOfScreenWithWhite
pop de pop de
ld de, TheEndGfx ld de, TheEndGfx
ld hl, vChars2 + $600 ld hl, vChars2 tile $60
lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10 lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10
call CopyVideoData call CopyVideoData
hlcoord 4, 8 hlcoord 4, 8

View file

@ -3,16 +3,16 @@ LoadShootingStarGraphics:
ldh [rOBP0], a ldh [rOBP0], a
ld a, $a4 ld a, $a4
ldh [rOBP1], a ldh [rOBP1], a
ld de, AnimationTileset2 + $30 ; star tile (top left quadrant) ld de, AnimationTileset2 tile 3 ; star tile (top left quadrant)
ld hl, vChars1 + $200 ld hl, vChars1 tile $20
lb bc, BANK(AnimationTileset2), $01 lb bc, BANK(AnimationTileset2), 1
call CopyVideoData call CopyVideoData
ld de, AnimationTileset2 + $130 ; star tile (bottom left quadrant) ld de, AnimationTileset2 tile 19 ; star tile (bottom left quadrant)
ld hl, vChars1 + $210 ld hl, vChars1 tile $21
lb bc, BANK(AnimationTileset2), $01 lb bc, BANK(AnimationTileset2), 1
call CopyVideoData call CopyVideoData
ld de, FallingStar ld de, FallingStar
ld hl, vChars1 + $220 ld hl, vChars1 tile $22
lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10 lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10
call CopyVideoData call CopyVideoData
ld hl, GameFreakLogoOAMData ld hl, GameFreakLogoOAMData

View file

@ -36,27 +36,27 @@ DisplayTitleScreen:
call DisableLCD call DisableLCD
call LoadFontTilePatterns call LoadFontTilePatterns
ld hl, NintendoCopyrightLogoGraphics ld hl, NintendoCopyrightLogoGraphics
ld de, vTitleLogo2 + $100 ld de, vTitleLogo2 tile 16
ld bc, $50 ld bc, 5 tiles
ld a, BANK(NintendoCopyrightLogoGraphics) ld a, BANK(NintendoCopyrightLogoGraphics)
call FarCopyData2 call FarCopyData2
ld hl, GamefreakLogoGraphics ld hl, GamefreakLogoGraphics
ld de, vTitleLogo2 + $100 + $50 ld de, vTitleLogo2 tile (16 + 5)
ld bc, $90 ld bc, 9 tiles
ld a, BANK(GamefreakLogoGraphics) ld a, BANK(GamefreakLogoGraphics)
call FarCopyData2 call FarCopyData2
ld hl, PokemonLogoGraphics ld hl, PokemonLogoGraphics
ld de, vTitleLogo ld de, vTitleLogo
ld bc, $600 ld bc, $60 tiles
ld a, BANK(PokemonLogoGraphics) ld a, BANK(PokemonLogoGraphics)
call FarCopyData2 ; first chunk call FarCopyData2 ; first chunk
ld hl, PokemonLogoGraphics+$600 ld hl, PokemonLogoGraphics tile $60
ld de, vTitleLogo2 ld de, vTitleLogo2
ld bc, $100 ld bc, $10 tiles
ld a, BANK(PokemonLogoGraphics) ld a, BANK(PokemonLogoGraphics)
call FarCopyData2 ; second chunk call FarCopyData2 ; second chunk
ld hl, Version_GFX 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 bc, Version_GFXEnd - Version_GFX
ld a, BANK(Version_GFX) ld a, BANK(Version_GFX)
call FarCopyDataDouble call FarCopyDataDouble
@ -369,7 +369,7 @@ LoadCopyrightAndTextBoxTiles:
LoadCopyrightTiles: LoadCopyrightTiles:
ld de, NintendoCopyrightLogoGraphics ld de, NintendoCopyrightLogoGraphics
ld hl, vChars2 + $600 ld hl, vChars2 tile $60
lb bc, BANK(NintendoCopyrightLogoGraphics), (GamefreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10 lb bc, BANK(NintendoCopyrightLogoGraphics), (GamefreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10
call CopyVideoData call CopyVideoData
hlcoord 2, 7 hlcoord 2, 7

View file

@ -157,12 +157,12 @@ LoadTradingGFXAndMonNames:
call Trade_ClearTileMap call Trade_ClearTileMap
call DisableLCD call DisableLCD
ld hl, TradingAnimationGraphics ld hl, TradingAnimationGraphics
ld de, vChars2 + $310 ld de, vChars2 tile $31
ld bc, TradingAnimationGraphicsEnd - TradingAnimationGraphics ld bc, TradingAnimationGraphicsEnd - TradingAnimationGraphics
ld a, BANK(TradingAnimationGraphics) ld a, BANK(TradingAnimationGraphics)
call FarCopyData2 call FarCopyData2
ld hl, TradingAnimationGraphics2 ld hl, TradingAnimationGraphics2
ld de, vSprites + $7c0 ld de, vSprites tile $7c
ld bc, TradingAnimationGraphics2End - TradingAnimationGraphics2 ld bc, TradingAnimationGraphics2End - TradingAnimationGraphics2
ld a, BANK(TradingAnimationGraphics2) ld a, BANK(TradingAnimationGraphics2)
call FarCopyData2 call FarCopyData2

View file

@ -80,23 +80,23 @@ InitCutAnimOAM:
cp $52 cp $52
jr z, .grass jr z, .grass
; tree ; tree
ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row ld de, Overworld_GFX tile $2d ; cuttable tree sprite top row
ld hl, vChars1 + $7c0 ld hl, vChars1 tile $7c
lb bc, BANK(Overworld_GFX), $02 lb bc, BANK(Overworld_GFX), 2
call CopyVideoData call CopyVideoData
ld de, Overworld_GFX + $3d0 ; cuttable tree sprite bottom row ld de, Overworld_GFX tile $3d ; cuttable tree sprite bottom row
ld hl, vChars1 + $7e0 ld hl, vChars1 tile $7e
lb bc, BANK(Overworld_GFX), $02 lb bc, BANK(Overworld_GFX), 2
call CopyVideoData call CopyVideoData
jr WriteCutOrBoulderDustAnimationOAMBlock jr WriteCutOrBoulderDustAnimationOAMBlock
.grass .grass
ld hl, vChars1 + $7c0 ld hl, vChars1 tile $7c
call LoadCutGrassAnimationTilePattern call LoadCutGrassAnimationTilePattern
ld hl, vChars1 + $7d0 ld hl, vChars1 tile $7d
call LoadCutGrassAnimationTilePattern call LoadCutGrassAnimationTilePattern
ld hl, vChars1 + $7e0 ld hl, vChars1 tile $7e
call LoadCutGrassAnimationTilePattern call LoadCutGrassAnimationTilePattern
ld hl, vChars1 + $7f0 ld hl, vChars1 tile $7f
call LoadCutGrassAnimationTilePattern call LoadCutGrassAnimationTilePattern
call WriteCutOrBoulderDustAnimationOAMBlock call WriteCutOrBoulderDustAnimationOAMBlock
ld hl, wOAMBuffer + $93 ld hl, wOAMBuffer + $93
@ -112,8 +112,8 @@ InitCutAnimOAM:
ret ret
LoadCutGrassAnimationTilePattern: LoadCutGrassAnimationTilePattern:
ld de, AnimationTileset2 + $60 ; tile depicting a leaf ld de, AnimationTileset2 tile 6 ; tile depicting a leaf
lb bc, BANK(AnimationTileset2), $01 lb bc, BANK(AnimationTileset2), 1
jp CopyVideoData jp CopyVideoData
WriteCutOrBoulderDustAnimationOAMBlock: WriteCutOrBoulderDustAnimationOAMBlock:

View file

@ -69,14 +69,14 @@ MoveBoulderDustFunctionPointerTable:
dw AdjustOAMBlockXPos dw AdjustOAMBlockXPos
LoadSmokeTileFourTimes:: LoadSmokeTileFourTimes::
ld hl, vChars1 + $7c0 ld hl, vChars1 tile $7c
ld c, $4 ld c, 4
.loop .loop
push bc push bc
push hl push hl
call LoadSmokeTile call LoadSmokeTile
pop hl pop hl
ld bc, $10 ld bc, 1 tiles
add hl, bc add hl, bc
pop bc pop bc
dec c dec c

View file

@ -8,8 +8,8 @@ EmotionBubble:
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
ld hl, vChars1 + $780 ld hl, vChars1 tile $78
lb bc, BANK(EmotionBubbles), $04 lb bc, BANK(EmotionBubbles), 4
call CopyVideoData call CopyVideoData
ld a, [wUpdateSpritesEnabled] ld a, [wUpdateSpritesEnabled]
push af push af

View file

@ -1,7 +1,7 @@
AnimateHealingMachine: AnimateHealingMachine:
ld de, PokeCenterFlashingMonitorAndHealBall ld de, PokeCenterFlashingMonitorAndHealBall
ld hl, vChars0 + $7c0 ld hl, vChars0 tile $7c
lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 ; loads one too many tiles lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), 3 ; should be 2
call CopyVideoData call CopyVideoData
ld hl, wUpdateSpritesEnabled ld hl, wUpdateSpritesEnabled
ld a, [hl] ld a, [hl]

View file

@ -57,7 +57,7 @@ HandleLedges::
INCLUDE "data/tilesets/ledge_tiles.asm" INCLUDE "data/tilesets/ledge_tiles.asm"
LoadHoppingShadowOAM: LoadHoppingShadowOAM:
ld hl, vChars1 + $7f0 ld hl, vChars1 tile $7f
ld de, LedgeHoppingShadow ld de, LedgeHoppingShadow
lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8 lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8
call CopyVideoDataDouble call CopyVideoDataDouble

View file

@ -130,25 +130,25 @@ LoadMapSpriteTilePatterns:
push de push de
push bc push bc
ld hl, vNPCSprites ; VRAM base address 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] ldh a, [hVRAMSlot]
cp 11 ; is it a 4-tile sprite? cp 11 ; is it a 4-tile sprite?
jr nc, .fourTileSpriteVRAMAddr jr nc, .fourTileSpriteVRAMAddr
ld d, a ld d, a
dec d dec d
; hl = vSprites + [hVRAMSlot] * $C0 (the number of bytes in 12 tiles) ; hl = vSprites + [hVRAMSlot] * 12 tiles
.calculateVRAMAddrLoop .calculateVRAMAddrLoop
add hl, bc add hl, bc
dec d dec d
jr nz, .calculateVRAMAddrLoop jr nz, .calculateVRAMAddrLoop
jr .loadStillTilePattern jr .loadStillTilePattern
.fourTileSpriteVRAMAddr .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] ldh a, [hFourTileSpriteCount]
and a and a
jr nz, .loadStillTilePattern jr nz, .loadStillTilePattern
; if it's the first 4-tile sprite ; 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 inc a
ldh [hFourTileSpriteCount], a ldh [hFourTileSpriteCount], a
.loadStillTilePattern .loadStillTilePattern

View file

@ -250,11 +250,11 @@ DoFlyAnimation:
LoadBirdSpriteGraphics: LoadBirdSpriteGraphics:
ld de, BirdSprite ld de, BirdSprite
ld hl, vNPCSprites ld hl, vNPCSprites
lb bc, BANK(BirdSprite), $0c lb bc, BANK(BirdSprite), 12
call CopyVideoData call CopyVideoData
ld de, BirdSprite + $c0 ; moving animation sprite ld de, BirdSprite tile 12 ; moving animation sprite
ld hl, vNPCSprites2 ld hl, vNPCSprites2
lb bc, BANK(BirdSprite), $0c lb bc, BANK(BirdSprite), 12
jp CopyVideoData jp CopyVideoData
InitFacingDirectionList: InitFacingDirectionList:
@ -381,8 +381,8 @@ FishingAnim:
ld hl, wd736 ld hl, wd736
set 6, [hl] ; reserve the last 4 OAM entries set 6, [hl] ; reserve the last 4 OAM entries
ld de, RedSprite ld de, RedSprite
ld hl, vNPCSprites ld hl, vNPCSprites tile $00
lb bc, BANK(RedSprite), $c lb bc, BANK(RedSprite), 12
call CopyVideoData call CopyVideoData
ld a, $4 ld a, $4
ld hl, RedFishingTiles ld hl, RedFishingTiles
@ -479,22 +479,18 @@ FishingRodOAM:
db $50, $40, $FE, $00 ; player facing left db $50, $40, $FE, $00 ; player facing left
db $50, $58, $FE, $20 ; player facing right ($20 means "horizontally flip the tile") db $50, $58, $FE, $20 ; player facing right ($20 means "horizontally flip the tile")
fishing_gfx: MACRO
dw \1
db \2
db BANK(\1)
dw vNPCSprites tile \3
ENDM
RedFishingTiles: RedFishingTiles:
dw RedFishingTilesFront fishing_gfx RedFishingTilesFront, 2, $02
db 2, BANK(RedFishingTilesFront) fishing_gfx RedFishingTilesBack, 2, $06
dw vNPCSprites + $20 fishing_gfx RedFishingTilesSide, 2, $0a
fishing_gfx RedFishingRodTiles, 3, $fd
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
_HandleMidJump:: _HandleMidJump::
ld a, [wPlayerJumpingYScreenCoordsIndex] ld a, [wPlayerJumpingYScreenCoordsIndex]

View file

@ -114,9 +114,9 @@ BillsPC_::
BillsPCMenu: BillsPCMenu:
ld a, [wParentMenuItem] ld a, [wParentMenuItem]
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld hl, vChars2 + $780 ld hl, vChars2 tile $78
ld de, PokeballTileGraphics ld de, PokeballTileGraphics
lb bc, BANK(PokeballTileGraphics), $01 lb bc, BANK(PokeballTileGraphics), 1
call CopyVideoData call CopyVideoData
call LoadScreenTilesFromBuffer2DisableBGTransfer call LoadScreenTilesFromBuffer2DisableBGTransfer
hlcoord 0, 0 hlcoord 0, 0

View file

@ -86,21 +86,21 @@ StatusScreen:
call UpdateSprites call UpdateSprites
call LoadHpBarAndStatusTilePatterns call LoadHpBarAndStatusTilePatterns
ld de, BattleHudTiles1 ; source ld de, BattleHudTiles1 ; source
ld hl, vChars2 + $6d0 ; dest ld hl, vChars2 tile $6d ; dest
lb bc, BANK(BattleHudTiles1), $03 lb bc, BANK(BattleHudTiles1), 3
call CopyVideoDataDouble ; ·│ :L and halfarrow line end call CopyVideoDataDouble ; ·│ :L and halfarrow line end
ld de, BattleHudTiles2 ld de, BattleHudTiles2
ld hl, vChars2 + $780 ld hl, vChars2 tile $78
lb bc, BANK(BattleHudTiles2), $01 lb bc, BANK(BattleHudTiles2), 1
call CopyVideoDataDouble ; │ call CopyVideoDataDouble ; │
ld de, BattleHudTiles3 ld de, BattleHudTiles3
ld hl, vChars2 + $760 ld hl, vChars2 tile $76
lb bc, BANK(BattleHudTiles3), $02 lb bc, BANK(BattleHudTiles3), 2
call CopyVideoDataDouble ; ─ call CopyVideoDataDouble ; ─
ld de, PTile ld de, PTile
ld hl, vChars2 + $720 ld hl, vChars2 tile $72
lb bc, BANK(PTile), (PTileEnd - PTile) / $8 lb bc, BANK(PTile), 1
call CopyVideoDataDouble ; P (for PP), inline call CopyVideoDataDouble ; bold P (for PP)
ldh a, [hTilesetType] ldh a, [hTilesetType]
push af push af
xor a xor a
@ -244,9 +244,7 @@ DrawLineBox:
ld [hl], $6f ; ← (halfarrow ending) ld [hl], $6f ; ← (halfarrow ending)
ret ret
PTile: PTile: INCBIN "gfx/font/P.1bpp"
INCBIN "gfx/font/P.1bpp"
PTileEnd:
PrintStatsBox: PrintStatsBox:
ld a, d ld a, d

View file

@ -850,17 +850,17 @@ LoadSlotMachineTiles:
call DisableLCD call DisableLCD
ld hl, SlotMachineTiles2 ld hl, SlotMachineTiles2
ld de, vChars0 ld de, vChars0
ld bc, $1c0 ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles
ld a, BANK(SlotMachineTiles2) ld a, BANK(SlotMachineTiles2)
call FarCopyData2 call FarCopyData2
ld hl, SlotMachineTiles1 ld hl, SlotMachineTiles1
ld de, vChars2 ld de, vChars2
ld bc, $250 ld bc, SlotMachineTiles1End - SlotMachineTiles1
ld a, BANK(SlotMachineTiles1) ld a, BANK(SlotMachineTiles1)
call FarCopyData2 call FarCopyData2
ld hl, SlotMachineTiles2 ld hl, SlotMachineTiles2
ld de, vChars2 + $250 ld de, vChars2 tile $25
ld bc, $1c0 ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles
ld a, BANK(SlotMachineTiles2) ld a, BANK(SlotMachineTiles2)
call FarCopyData2 call FarCopyData2
ld hl, SlotMachineMap ld hl, SlotMachineMap
@ -890,3 +890,4 @@ ENDC
IF DEF(_BLUE) IF DEF(_BLUE)
INCBIN "gfx/slots/blue_slots_1.2bpp" INCBIN "gfx/slots/blue_slots_1.2bpp"
ENDC ENDC
SlotMachineTiles1End:

View file

@ -820,13 +820,13 @@ LoadTextBoxTilePatterns::
jr nz, .on jr nz, .on
.off .off
ld hl, TextBoxGraphics ld hl, TextBoxGraphics
ld de, vChars2 + $600 ld de, vChars2 tile $60
ld bc, TextBoxGraphicsEnd - TextBoxGraphics ld bc, TextBoxGraphicsEnd - TextBoxGraphics
ld a, BANK(TextBoxGraphics) ld a, BANK(TextBoxGraphics)
jp FarCopyData2 ; if LCD is off, transfer all at once jp FarCopyData2 ; if LCD is off, transfer all at once
.on .on
ld de, TextBoxGraphics ld de, TextBoxGraphics
ld hl, vChars2 + $600 ld hl, vChars2 tile $60
lb bc, BANK(TextBoxGraphics), (TextBoxGraphicsEnd - TextBoxGraphics) / $10 lb bc, BANK(TextBoxGraphics), (TextBoxGraphicsEnd - TextBoxGraphics) / $10
jp CopyVideoData ; if LCD is on, transfer during V-blank jp CopyVideoData ; if LCD is on, transfer during V-blank
@ -836,13 +836,13 @@ LoadHpBarAndStatusTilePatterns::
jr nz, .on jr nz, .on
.off .off
ld hl, HpBarAndStatusGraphics ld hl, HpBarAndStatusGraphics
ld de, vChars2 + $620 ld de, vChars2 tile $62
ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics
ld a, BANK(HpBarAndStatusGraphics) ld a, BANK(HpBarAndStatusGraphics)
jp FarCopyData2 ; if LCD is off, transfer all at once jp FarCopyData2 ; if LCD is off, transfer all at once
.on .on
ld de, HpBarAndStatusGraphics ld de, HpBarAndStatusGraphics
ld hl, vChars2 + $620 ld hl, vChars2 tile $62
lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10 lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10
jp CopyVideoData ; if LCD is on, transfer during V-blank jp CopyVideoData ; if LCD is on, transfer during V-blank

View file

@ -393,7 +393,7 @@ UpdateMovingBgTiles::
; water ; water
ld hl, vTileset + $14 * $10 ld hl, vTileset tile $14
ld c, $10 ld c, $10
ld a, [wMovingBGTilesCounter2] ld a, [wMovingBGTilesCounter2]
@ -438,7 +438,7 @@ UpdateMovingBgTiles::
jr z, .copy jr z, .copy
ld hl, FlowerTile3 ld hl, FlowerTile3
.copy .copy
ld de, vTileset + $3 * $10 ld de, vTileset tile $03
ld c, $10 ld c, $10
.loop .loop
ld a, [hli] ld a, [hli]

View file

@ -367,38 +367,32 @@ LoadSpinnerArrowTiles::
spinner: MACRO spinner: MACRO
; \1: source ; \1: source
; \2: offset (BANK() chokes on literals) ; \2: offset (BANK() chokes on literals)
; \3: length ; \3: dest
; \4: dest dw \1 tile \2
dw \1 + \2 db 1
db \3, BANK(\1) db BANK(\1)
dw \4 dw vTileset tile \3
ENDM ENDM
FacilitySpinnerArrows: FacilitySpinnerArrows:
FACILITY_SPINNER EQU $20 * $10 spinner SpinnerArrowAnimTiles, 0, $20
vFacilitySpinner EQUS "vTileset + FACILITY_SPINNER" spinner SpinnerArrowAnimTiles, 1, $21
spinner SpinnerArrowAnimTiles, 2, $30
spinner SpinnerArrowAnimTiles, $00, 1, vFacilitySpinner spinner SpinnerArrowAnimTiles, 3, $31
spinner SpinnerArrowAnimTiles, $10, 1, vFacilitySpinner + $10 spinner Facility_GFX, $20, $20
spinner SpinnerArrowAnimTiles, $20, 1, vFacilitySpinner + $100 spinner Facility_GFX, $21, $21
spinner SpinnerArrowAnimTiles, $30, 1, vFacilitySpinner + $110 spinner Facility_GFX, $30, $30
spinner Facility_GFX, FACILITY_SPINNER + $000, 1, vFacilitySpinner spinner Facility_GFX, $31, $31
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
GymSpinnerArrows: GymSpinnerArrows:
GYM_SPINNER EQU $3c * $10 spinner SpinnerArrowAnimTiles, 1, $3c
vGymSpinner EQUS "vTileset + GYM_SPINNER" spinner SpinnerArrowAnimTiles, 3, $3d
spinner SpinnerArrowAnimTiles, 0, $4c
spinner SpinnerArrowAnimTiles, $10, 1, vGymSpinner spinner SpinnerArrowAnimTiles, 2, $4d
spinner SpinnerArrowAnimTiles, $30, 1, vGymSpinner + $10 spinner Gym_GFX, $3c, $3c
spinner SpinnerArrowAnimTiles, $00, 1, vGymSpinner + $100 spinner Gym_GFX, $3d, $3d
spinner SpinnerArrowAnimTiles, $20, 1, vGymSpinner + $110 spinner Gym_GFX, $4c, $4c
spinner Gym_GFX, GYM_SPINNER + $000, 1, vGymSpinner spinner Gym_GFX, $4d, $4d
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
SpinnerPlayerFacingDirections: SpinnerPlayerFacingDirections:
; This isn't the order of the facing directions. Rather, it's a list of ; This isn't the order of the facing directions. Rather, it's a list of