From f37cf959c930ae9595f9f71ce0d9b17dcf5421d0 Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 14 Jul 2020 10:21:18 -0400 Subject: Clean up some data, using macros for multiline list entries --- data/tilesets/bike_riding_tilesets.asm | 7 +- data/tilesets/bookshelf_tile_ids.asm | 60 +++++------ data/tilesets/collision_tile_ids.asm | 67 +++++------- data/tilesets/cut_tree_blocks.asm | 2 +- data/tilesets/door_tile_ids.asm | 102 ++++++++++-------- data/tilesets/dungeon_tilesets.asm | 13 ++- data/tilesets/escape_rope_tilesets.asm | 8 +- data/tilesets/ledge_tiles.asm | 20 ++-- data/tilesets/tileset_headers.asm | 1 + data/tilesets/warp_carpet_tile_ids.asm | 32 +++--- data/tilesets/warp_pad_hole_tile_ids.asm | 4 +- data/tilesets/warp_tile_ids.asm | 177 +++++++++++++++++-------------- data/tilesets/water_tilesets.asm | 12 ++- 13 files changed, 270 insertions(+), 235 deletions(-) (limited to 'data/tilesets') diff --git a/data/tilesets/bike_riding_tilesets.asm b/data/tilesets/bike_riding_tilesets.asm index 48c2cee6..b78c7c8c 100755 --- a/data/tilesets/bike_riding_tilesets.asm +++ b/data/tilesets/bike_riding_tilesets.asm @@ -1,2 +1,7 @@ BikeRidingTilesets:: - db OVERWORLD, FOREST, UNDERGROUND, SHIP_PORT, CAVERN, $FF + db OVERWORLD + db FOREST + db UNDERGROUND + db SHIP_PORT + db CAVERN + db -1 ; end diff --git a/data/tilesets/bookshelf_tile_ids.asm b/data/tilesets/bookshelf_tile_ids.asm index 535bf8e9..da340cdf 100644 --- a/data/tilesets/bookshelf_tile_ids.asm +++ b/data/tilesets/bookshelf_tile_ids.asm @@ -1,37 +1,25 @@ -; format: db tileset id, bookshelf tile id, text id +bookshelf_tile: MACRO + db \1, \2 + db_tx_pre \3 +ENDM + BookshelfTileIDs: - db PLATEAU, $30 - db_tx_pre IndigoPlateauStatues - db HOUSE, $3D - db_tx_pre TownMapText - db HOUSE, $1E - db_tx_pre BookOrSculptureText - db MANSION, $32 - db_tx_pre BookOrSculptureText - db REDS_HOUSE_1, $32 - db_tx_pre BookOrSculptureText - db LAB, $28 - db_tx_pre BookOrSculptureText - db LOBBY, $16 - db_tx_pre ElevatorText - db GYM, $1D - db_tx_pre BookOrSculptureText - db DOJO, $1D - db_tx_pre BookOrSculptureText - db GATE, $22 - db_tx_pre BookOrSculptureText - db MART, $54 - db_tx_pre PokemonStuffText - db MART, $55 - db_tx_pre PokemonStuffText - db POKECENTER, $54 - db_tx_pre PokemonStuffText - db POKECENTER, $55 - db_tx_pre PokemonStuffText - db LOBBY, $50 - db_tx_pre PokemonStuffText - db LOBBY, $52 - db_tx_pre PokemonStuffText - db SHIP, $36 - db_tx_pre BookOrSculptureText - db $FF +; tileset id, bookshelf tile id, text id + bookshelf_tile PLATEAU, $30, IndigoPlateauStatues + bookshelf_tile HOUSE, $3D, TownMapText + bookshelf_tile HOUSE, $1E, BookOrSculptureText + bookshelf_tile MANSION, $32, BookOrSculptureText + bookshelf_tile REDS_HOUSE_1, $32, BookOrSculptureText + bookshelf_tile LAB, $28, BookOrSculptureText + bookshelf_tile LOBBY, $16, ElevatorText + bookshelf_tile GYM, $1D, BookOrSculptureText + bookshelf_tile DOJO, $1D, BookOrSculptureText + bookshelf_tile GATE, $22, BookOrSculptureText + bookshelf_tile MART, $54, PokemonStuffText + bookshelf_tile MART, $55, PokemonStuffText + bookshelf_tile POKECENTER, $54, PokemonStuffText + bookshelf_tile POKECENTER, $55, PokemonStuffText + bookshelf_tile LOBBY, $50, PokemonStuffText + bookshelf_tile LOBBY, $52, PokemonStuffText + bookshelf_tile SHIP, $36, BookOrSculptureText + db -1 ; end diff --git a/data/tilesets/collision_tile_ids.asm b/data/tilesets/collision_tile_ids.asm index c18a7e72..d348d5d5 100644 --- a/data/tilesets/collision_tile_ids.asm +++ b/data/tilesets/collision_tile_ids.asm @@ -1,82 +1,71 @@ -Underground_Coll:: - db $0b, $0c, $13, $15, $18 +coll_tiles: MACRO +REPT _NARG + db \1 + shift +ENDR db -1 ; end +ENDM + +Underground_Coll:: + coll_tiles $0b, $0c, $13, $15, $18 Overworld_Coll:: - db $00, $10, $1b, $20, $21, $23, $2c, $2d, $2e, $30, $31, $33, $39, $3c, $3e, $52, $54, $58, $5b - db -1 ; end + coll_tiles $00, $10, $1b, $20, $21, $23, $2c, $2d, $2e, $30, $31, $33, $39, $3c, $3e, $52, $54, $58, $5b RedsHouse1_Coll:: RedsHouse2_Coll:: - db $01, $02, $03, $11, $12, $13, $14, $1c, $1a - db -1 ; end + coll_tiles $01, $02, $03, $11, $12, $13, $14, $1c, $1a Mart_Coll:: Pokecenter_Coll:: - db $11, $1a, $1c, $3c, $5e - db -1 ; end + coll_tiles $11, $1a, $1c, $3c, $5e Dojo_Coll:: Gym_Coll:: - db $11, $16, $19, $2b, $3c, $3d, $3f, $4a, $4c, $4d, $03 - db -1 ; end + coll_tiles $11, $16, $19, $2b, $3c, $3d, $3f, $4a, $4c, $4d, $03 Forest_Coll:: - db $1e, $20, $2e, $30, $34, $37, $39, $3a, $40, $51, $52, $5a, $5c, $5e, $5f - db -1 ; end + coll_tiles $1e, $20, $2e, $30, $34, $37, $39, $3a, $40, $51, $52, $5a, $5c, $5e, $5f House_Coll:: - db $01, $12, $14, $28, $32, $37, $44, $54, $5c - db -1 ; end + coll_tiles $01, $12, $14, $28, $32, $37, $44, $54, $5c ForestGate_Coll:: Museum_Coll:: Gate_Coll:: - db $01, $12, $14, $1a, $1c, $37, $38, $3b, $3c, $5e - db -1 ; end + coll_tiles $01, $12, $14, $1a, $1c, $37, $38, $3b, $3c, $5e Ship_Coll:: - db $04, $0d, $17, $1d, $1e, $23, $34, $37, $39, $4a - db -1 ; end + coll_tiles $04, $0d, $17, $1d, $1e, $23, $34, $37, $39, $4a ShipPort_Coll:: - db $0a, $1a, $32, $3b - db -1 ; end + coll_tiles $0a, $1a, $32, $3b Cemetery_Coll:: - db $01, $10, $13, $1b, $22, $42, $52 - db -1 ; end + coll_tiles $01, $10, $13, $1b, $22, $42, $52 Interior_Coll:: - db $04, $0f, $15, $1f, $3b, $45, $47, $55, $56 - db -1 ; end + coll_tiles $04, $0f, $15, $1f, $3b, $45, $47, $55, $56 Cavern_Coll:: - db $05, $15, $18, $1a, $20, $21, $22, $2a, $2d, $30 - db -1 ; end + coll_tiles $05, $15, $18, $1a, $20, $21, $22, $2a, $2d, $30 - db -1 ; unused + coll_tiles ; unused Lobby_Coll:: - db $14, $17, $1a, $1c, $20, $38, $45 - db -1 ; end + coll_tiles $14, $17, $1a, $1c, $20, $38, $45 Mansion_Coll:: - db $01, $05, $11, $12, $14, $1a, $1c, $2c, $53 - db -1 ; end + coll_tiles $01, $05, $11, $12, $14, $1a, $1c, $2c, $53 Lab_Coll:: - db $0c, $26, $16, $1e, $34, $37 - db -1 ; end + coll_tiles $0c, $26, $16, $1e, $34, $37 Club_Coll:: - db $0f, $1a, $1f, $26, $28, $29, $2c, $2d, $2e, $2f, $41 - db -1 ; end + coll_tiles $0f, $1a, $1f, $26, $28, $29, $2c, $2d, $2e, $2f, $41 Facility_Coll:: - db $01, $10, $11, $13, $1b, $20, $21, $22, $30, $31, $32, $42, $43, $48, $52, $55, $58, $5e - db -1 ; end + coll_tiles $01, $10, $11, $13, $1b, $20, $21, $22, $30, $31, $32, $42, $43, $48, $52, $55, $58, $5e Plateau_Coll:: - db $1b, $23, $2c, $2d, $3b, $45 - db -1 ; end + coll_tiles $1b, $23, $2c, $2d, $3b, $45 diff --git a/data/tilesets/cut_tree_blocks.asm b/data/tilesets/cut_tree_blocks.asm index eb63a712..ce7903a4 100644 --- a/data/tilesets/cut_tree_blocks.asm +++ b/data/tilesets/cut_tree_blocks.asm @@ -10,4 +10,4 @@ CutTreeBlockSwaps: db $3C, $35 db $3F, $35 db $3D, $36 - db $FF ; list terminator + db -1 ; end diff --git a/data/tilesets/door_tile_ids.asm b/data/tilesets/door_tile_ids.asm index 686e418c..c371e92b 100644 --- a/data/tilesets/door_tile_ids.asm +++ b/data/tilesets/door_tile_ids.asm @@ -1,48 +1,56 @@ DoorTileIDPointers: - dbw OVERWORLD, OverworldDoorTileIDs - dbw FOREST, ForestDoorTileIDs - dbw MART, MartDoorTileIDs - dbw HOUSE, HouseDoorTileIDs - dbw FOREST_GATE, TilesetMuseumDoorTileIDs - dbw MUSEUM, TilesetMuseumDoorTileIDs - dbw GATE, TilesetMuseumDoorTileIDs - dbw SHIP, ShipDoorTileIDs - dbw LOBBY, LobbyDoorTileIDs - dbw MANSION, MansionDoorTileIDs - dbw LAB, LabDoorTileIDs - dbw FACILITY, FacilityDoorTileIDs - dbw PLATEAU, PlateauDoorTileIDs - db $ff - -OverworldDoorTileIDs: - db $1B,$58,$00 - -ForestDoorTileIDs: - db $3a,$00 - -MartDoorTileIDs: - db $5e,$00 - -HouseDoorTileIDs: - db $54,$00 - -TilesetMuseumDoorTileIDs: - db $3b,$00 - -ShipDoorTileIDs: - db $1e,$00 - -LobbyDoorTileIDs: - db $1c,$38,$1a,$00 - -MansionDoorTileIDs: - db $1a,$1c,$53,$00 - -LabDoorTileIDs: - db $34,$00 - -FacilityDoorTileIDs: - db $43,$58,$1b,$00 - -PlateauDoorTileIDs: - db $3b,$1b,$00 + dbw OVERWORLD, .OverworldDoorTileIDs + dbw FOREST, .ForestDoorTileIDs + dbw MART, .MartDoorTileIDs + dbw HOUSE, .HouseDoorTileIDs + dbw FOREST_GATE, .TilesetMuseumDoorTileIDs + dbw MUSEUM, .TilesetMuseumDoorTileIDs + dbw GATE, .TilesetMuseumDoorTileIDs + dbw SHIP, .ShipDoorTileIDs + dbw LOBBY, .LobbyDoorTileIDs + dbw MANSION, .MansionDoorTileIDs + dbw LAB, .LabDoorTileIDs + dbw FACILITY, .FacilityDoorTileIDs + dbw PLATEAU, .PlateauDoorTileIDs + db -1 ; end + +door_tiles: MACRO +REPT _NARG + db \1 + shift +ENDR + db 0 ; end +ENDM + +.OverworldDoorTileIDs: + door_tiles $1B, $58 + +.ForestDoorTileIDs: + door_tiles $3a + +.MartDoorTileIDs: + door_tiles $5e + +.HouseDoorTileIDs: + door_tiles $54 + +.TilesetMuseumDoorTileIDs: + door_tiles $3b + +.ShipDoorTileIDs: + door_tiles $1e + +.LobbyDoorTileIDs: + door_tiles $1c, $38, $1a + +.MansionDoorTileIDs: + door_tiles $1a, $1c, $53 + +.LabDoorTileIDs: + door_tiles $34 + +.FacilityDoorTileIDs: + door_tiles $43, $58, $1b + +.PlateauDoorTileIDs: + door_tiles $3b, $1b diff --git a/data/tilesets/dungeon_tilesets.asm b/data/tilesets/dungeon_tilesets.asm index 01e86714..2af36696 100755 --- a/data/tilesets/dungeon_tilesets.asm +++ b/data/tilesets/dungeon_tilesets.asm @@ -1,2 +1,13 @@ DungeonTilesets: - db FOREST, MUSEUM, SHIP, CAVERN, LOBBY, MANSION, GATE, LAB, FACILITY, CEMETERY, GYM, $FF + db FOREST + db MUSEUM + db SHIP + db CAVERN + db LOBBY + db MANSION + db GATE + db LAB + db FACILITY + db CEMETERY + db GYM + db -1 ; end diff --git a/data/tilesets/escape_rope_tilesets.asm b/data/tilesets/escape_rope_tilesets.asm index 6acf8e77..6a40089c 100644 --- a/data/tilesets/escape_rope_tilesets.asm +++ b/data/tilesets/escape_rope_tilesets.asm @@ -1,3 +1,7 @@ EscapeRopeTilesets: - db FOREST, CEMETERY, CAVERN, FACILITY, INTERIOR - db $ff ; terminator + db FOREST + db CEMETERY + db CAVERN + db FACILITY + db INTERIOR + db -1 ; end diff --git a/data/tilesets/ledge_tiles.asm b/data/tilesets/ledge_tiles.asm index b742af1a..db293800 100644 --- a/data/tilesets/ledge_tiles.asm +++ b/data/tilesets/ledge_tiles.asm @@ -1,11 +1,11 @@ LedgeTiles: - ; (player direction) (tile player standing on) (ledge tile) (input required) - db SPRITE_FACING_DOWN, $2C,$37,D_DOWN - db SPRITE_FACING_DOWN, $39,$36,D_DOWN - db SPRITE_FACING_DOWN, $39,$37,D_DOWN - db SPRITE_FACING_LEFT, $2C,$27,D_LEFT - db SPRITE_FACING_LEFT, $39,$27,D_LEFT - db SPRITE_FACING_RIGHT,$2C,$0D,D_RIGHT - db SPRITE_FACING_RIGHT,$2C,$1D,D_RIGHT - db SPRITE_FACING_RIGHT,$39,$0D,D_RIGHT - db $FF + ; player direction, tile player standing on, ledge tile, input required + db SPRITE_FACING_DOWN, $2C, $37, D_DOWN + db SPRITE_FACING_DOWN, $39, $36, D_DOWN + db SPRITE_FACING_DOWN, $39, $37, D_DOWN + db SPRITE_FACING_LEFT, $2C, $27, D_LEFT + db SPRITE_FACING_LEFT, $39, $27, D_LEFT + db SPRITE_FACING_RIGHT, $2C, $0D, D_RIGHT + db SPRITE_FACING_RIGHT, $2C, $1D, D_RIGHT + db SPRITE_FACING_RIGHT, $39, $0D, D_RIGHT + db -1 ; end diff --git a/data/tilesets/tileset_headers.asm b/data/tilesets/tileset_headers.asm index 8f825330..4ba2e629 100755 --- a/data/tilesets/tileset_headers.asm +++ b/data/tilesets/tileset_headers.asm @@ -7,6 +7,7 @@ tileset: MACRO ENDM Tilesets: +; block, gfx, coll, 3 counter tiles, grass tile, permission tileset Overworld_Block, Overworld_GFX, Overworld_Coll, $FF,$FF,$FF, $52, OUTDOOR tileset RedsHouse1_Block, RedsHouse1_GFX, RedsHouse1_Coll, $FF,$FF,$FF, $FF, INDOOR tileset Mart_Block, Mart_GFX, Mart_Coll, $18,$19,$1E, $FF, INDOOR diff --git a/data/tilesets/warp_carpet_tile_ids.asm b/data/tilesets/warp_carpet_tile_ids.asm index 6f312bc7..3929a97c 100644 --- a/data/tilesets/warp_carpet_tile_ids.asm +++ b/data/tilesets/warp_carpet_tile_ids.asm @@ -1,17 +1,25 @@ WarpTileListPointers: - dw .facingDownWarpTiles - dw .facingUpWarpTiles - dw .facingLeftWarpTiles - dw .facingRightWarpTiles + dw .FacingDownWarpTiles + dw .FacingUpWarpTiles + dw .FacingLeftWarpTiles + dw .FacingRightWarpTiles -.facingDownWarpTiles - db $01,$12,$17,$3D,$04,$18,$33,$FF +warp_tiles: MACRO +REPT _NARG + db \1 + shift +ENDR + db -1 ; end +ENDM -.facingUpWarpTiles - db $01,$5C,$FF +.FacingDownWarpTiles: + warp_tiles $01, $12, $17, $3D, $04, $18, $33 -.facingLeftWarpTiles - db $1A,$4B,$FF +.FacingUpWarpTiles: + warp_tiles $01, $5C -.facingRightWarpTiles - db $0F,$4E,$FF +.FacingLeftWarpTiles: + warp_tiles $1A, $4B + +.FacingRightWarpTiles: + warp_tiles $0F, $4E diff --git a/data/tilesets/warp_pad_hole_tile_ids.asm b/data/tilesets/warp_pad_hole_tile_ids.asm index 3e2c1890..c9f0c242 100644 --- a/data/tilesets/warp_pad_hole_tile_ids.asm +++ b/data/tilesets/warp_pad_hole_tile_ids.asm @@ -1,7 +1,7 @@ -; format: db tileset id, tile id, value to be put in [wStandingOnWarpPadOrHole] WarpPadAndHoleData: +; tileset id, tile id, value for [wStandingOnWarpPadOrHole] db FACILITY, $20, 1 ; warp pad db FACILITY, $11, 2 ; hole db CAVERN, $22, 2 ; hole db INTERIOR, $55, 1 ; warp pad - db $FF + db -1 ; end diff --git a/data/tilesets/warp_tile_ids.asm b/data/tilesets/warp_tile_ids.asm index 6fd326cc..bf19090b 100755 --- a/data/tilesets/warp_tile_ids.asm +++ b/data/tilesets/warp_tile_ids.asm @@ -1,85 +1,98 @@ WarpTileIDPointers: - dw OverworldWarpTileIDs - dw RedsHouse1WarpTileIDs - dw MartWarpTileIDs - dw ForestWarpTileIDs - dw RedsHouse2WarpTileIDs - dw DojoWarpTileIDs - dw PokecenterWarpTileIDs - dw GymWarpTileIDs - dw HouseWarpTileIDs - dw ForestGateWarpTileIDs - dw MuseumWarpTileIDs - dw UndergroundWarpTileIDs - dw GateWarpTileIDs - dw ShipWarpTileIDs - dw ShipPortWarpTileIDs - dw CemeteryWarpTileIDs - dw InteriorWarpTileIDs - dw CavernWarpTileIDs - dw LobbyWarpTileIDs - dw MansionWarpTileIDs - dw LabWarpTileIDs - dw ClubWarpTileIDs - dw FacilityWarpTileIDs - dw PlateauWarpTileIDs - -OverworldWarpTileIDs: - db $1B,$58,$FF - -ForestGateWarpTileIDs: -MuseumWarpTileIDs: -GateWarpTileIDs: + dw .OverworldWarpTileIDs + dw .RedsHouse1WarpTileIDs + dw .MartWarpTileIDs + dw .ForestWarpTileIDs + dw .RedsHouse2WarpTileIDs + dw .DojoWarpTileIDs + dw .PokecenterWarpTileIDs + dw .GymWarpTileIDs + dw .HouseWarpTileIDs + dw .ForestGateWarpTileIDs + dw .MuseumWarpTileIDs + dw .UndergroundWarpTileIDs + dw .GateWarpTileIDs + dw .ShipWarpTileIDs + dw .ShipPortWarpTileIDs + dw .CemeteryWarpTileIDs + dw .InteriorWarpTileIDs + dw .CavernWarpTileIDs + dw .LobbyWarpTileIDs + dw .MansionWarpTileIDs + dw .LabWarpTileIDs + dw .ClubWarpTileIDs + dw .FacilityWarpTileIDs + dw .PlateauWarpTileIDs + +.OverworldWarpTileIDs: + db $1B, $58 + db -1 ; end + +.ForestGateWarpTileIDs: +.MuseumWarpTileIDs: +.GateWarpTileIDs: db $3B - -RedsHouse1WarpTileIDs: -RedsHouse2WarpTileIDs: - db $1A,$1C,$FF - -MartWarpTileIDs: -PokecenterWarpTileIDs: - db $5E,$FF - -ForestWarpTileIDs: - db $5A,$5C,$3A,$FF - -DojoWarpTileIDs: -GymWarpTileIDs: - db $4A,$FF - -HouseWarpTileIDs: - db $54,$5C,$32,$FF - -ShipWarpTileIDs: - db $37,$39,$1E,$4A,$FF - -InteriorWarpTileIDs: - db $15,$55,$04,$FF - -CavernWarpTileIDs: - db $18,$1A,$22,$FF - -LobbyWarpTileIDs: - db $1A,$1C,$38,$FF - -MansionWarpTileIDs: - db $1A,$1C,$53,$FF - -LabWarpTileIDs: - db $34,$FF - -FacilityWarpTileIDs: - db $43,$58,$20 - -CemeteryWarpTileIDs: + ; fallthrough +.RedsHouse1WarpTileIDs: +.RedsHouse2WarpTileIDs: + db $1A, $1C + db -1 ; end + +.MartWarpTileIDs: +.PokecenterWarpTileIDs: + db $5E + db -1 ; end + +.ForestWarpTileIDs: + db $5A, $5C, $3A + db -1 ; end + +.DojoWarpTileIDs: +.GymWarpTileIDs: + db $4A + db -1 ; end + +.HouseWarpTileIDs: + db $54, $5C, $32 + db -1 ; end + +.ShipWarpTileIDs: + db $37, $39, $1E, $4A + db -1 ; end + +.InteriorWarpTileIDs: + db $15, $55, $04 + db -1 ; end + +.CavernWarpTileIDs: + db $18, $1A, $22 + db -1 ; end + +.LobbyWarpTileIDs: + db $1A, $1C, $38 + db -1 ; end + +.MansionWarpTileIDs: + db $1A, $1C, $53 + db -1 ; end + +.LabWarpTileIDs: + db $34 + db -1 ; end + +.FacilityWarpTileIDs: + db $43, $58, $20 + ; fallthrough +.CemeteryWarpTileIDs: db $1B - -UndergroundWarpTileIDs: - db $13,$FF - -PlateauWarpTileIDs: - db $1B,$3B - -ShipPortWarpTileIDs: -ClubWarpTileIDs: - db $FF + ; fallthrough +.UndergroundWarpTileIDs: + db $13 + db -1 ; end + +.PlateauWarpTileIDs: + db $1B, $3B + ; fallthrough +.ShipPortWarpTileIDs: +.ClubWarpTileIDs: + db -1 ; end diff --git a/data/tilesets/water_tilesets.asm b/data/tilesets/water_tilesets.asm index 00f0ab1f..8abdce39 100644 --- a/data/tilesets/water_tilesets.asm +++ b/data/tilesets/water_tilesets.asm @@ -1,4 +1,12 @@ ; tilesets with water WaterTilesets: - db OVERWORLD, FOREST, DOJO, GYM, SHIP, SHIP_PORT, CAVERN, FACILITY, PLATEAU - db $ff ; terminator + db OVERWORLD + db FOREST + db DOJO + db GYM + db SHIP + db SHIP_PORT + db CAVERN + db FACILITY + db PLATEAU + db -1 ; end -- cgit v1.3.1-sl0p From fcb573f4ac006b73827b6fc317fc7501e17004ae Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 14 Jul 2020 14:33:16 -0400 Subject: Use a macro for warp tile IDs, like other tile behaviors --- data/tilesets/warp_carpet_tile_ids.asm | 10 +++---- data/tilesets/warp_tile_ids.asm | 49 +++++++++++++++------------------- 2 files changed, 27 insertions(+), 32 deletions(-) (limited to 'data/tilesets') diff --git a/data/tilesets/warp_carpet_tile_ids.asm b/data/tilesets/warp_carpet_tile_ids.asm index 3929a97c..be327599 100644 --- a/data/tilesets/warp_carpet_tile_ids.asm +++ b/data/tilesets/warp_carpet_tile_ids.asm @@ -4,7 +4,7 @@ WarpTileListPointers: dw .FacingLeftWarpTiles dw .FacingRightWarpTiles -warp_tiles: MACRO +warp_carpet_tiles: MACRO REPT _NARG db \1 shift @@ -13,13 +13,13 @@ ENDR ENDM .FacingDownWarpTiles: - warp_tiles $01, $12, $17, $3D, $04, $18, $33 + warp_carpet_tiles $01, $12, $17, $3D, $04, $18, $33 .FacingUpWarpTiles: - warp_tiles $01, $5C + warp_carpet_tiles $01, $5C .FacingLeftWarpTiles: - warp_tiles $1A, $4B + warp_carpet_tiles $1A, $4B .FacingRightWarpTiles: - warp_tiles $0F, $4E + warp_carpet_tiles $0F, $4E diff --git a/data/tilesets/warp_tile_ids.asm b/data/tilesets/warp_tile_ids.asm index bf19090b..db005dcf 100755 --- a/data/tilesets/warp_tile_ids.asm +++ b/data/tilesets/warp_tile_ids.asm @@ -24,9 +24,16 @@ WarpTileIDPointers: dw .FacilityWarpTileIDs dw .PlateauWarpTileIDs -.OverworldWarpTileIDs: - db $1B, $58 +warp_tiles: MACRO +REPT _NARG + db \1 + shift +ENDR db -1 ; end +ENDM + +.OverworldWarpTileIDs: + warp_tiles $1B, $58 .ForestGateWarpTileIDs: .MuseumWarpTileIDs: @@ -35,50 +42,39 @@ WarpTileIDPointers: ; fallthrough .RedsHouse1WarpTileIDs: .RedsHouse2WarpTileIDs: - db $1A, $1C - db -1 ; end + warp_tiles $1A, $1C .MartWarpTileIDs: .PokecenterWarpTileIDs: - db $5E - db -1 ; end + warp_tiles $5E .ForestWarpTileIDs: - db $5A, $5C, $3A - db -1 ; end + warp_tiles $5A, $5C, $3A .DojoWarpTileIDs: .GymWarpTileIDs: - db $4A - db -1 ; end + warp_tiles $4A .HouseWarpTileIDs: - db $54, $5C, $32 - db -1 ; end + warp_tiles $54, $5C, $32 .ShipWarpTileIDs: - db $37, $39, $1E, $4A - db -1 ; end + warp_tiles $37, $39, $1E, $4A .InteriorWarpTileIDs: - db $15, $55, $04 - db -1 ; end + warp_tiles $15, $55, $04 .CavernWarpTileIDs: - db $18, $1A, $22 - db -1 ; end + warp_tiles $18, $1A, $22 .LobbyWarpTileIDs: - db $1A, $1C, $38 - db -1 ; end + warp_tiles $1A, $1C, $38 .MansionWarpTileIDs: - db $1A, $1C, $53 - db -1 ; end + warp_tiles $1A, $1C, $53 .LabWarpTileIDs: - db $34 - db -1 ; end + warp_tiles $34 .FacilityWarpTileIDs: db $43, $58, $20 @@ -87,12 +83,11 @@ WarpTileIDPointers: db $1B ; fallthrough .UndergroundWarpTileIDs: - db $13 - db -1 ; end + warp_tiles $13 .PlateauWarpTileIDs: db $1B, $3B ; fallthrough .ShipPortWarpTileIDs: .ClubWarpTileIDs: - db -1 ; end + warp_tiles ; end -- cgit v1.3.1-sl0p From be326c65652d5e87e353172a4471458822ffd3da Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 14 Jul 2020 15:14:32 -0400 Subject: Factor out spinner tiles from RocketHideoutB2F since they're also used by ViridianGym, and to make their data and code more accessible --- data/tilesets/spinner_tiles.asm | 29 +++++++++++++ engine/overworld/spinners.asm | 65 ++++++++++++++++++++++++++++ scripts/RocketHideoutB2F.asm | 94 +---------------------------------------- 3 files changed, 95 insertions(+), 93 deletions(-) create mode 100644 data/tilesets/spinner_tiles.asm create mode 100644 engine/overworld/spinners.asm (limited to 'data/tilesets') diff --git a/data/tilesets/spinner_tiles.asm b/data/tilesets/spinner_tiles.asm new file mode 100644 index 00000000..82506b6d --- /dev/null +++ b/data/tilesets/spinner_tiles.asm @@ -0,0 +1,29 @@ +spinner: MACRO +; \1: source +; \2: offset (BANK() chokes on literals) +; \3: dest + dw \1 tile \2 + db 1 + db BANK(\1) + dw vTileset tile \3 +ENDM + +FacilitySpinnerArrows: + 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: + 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 diff --git a/engine/overworld/spinners.asm b/engine/overworld/spinners.asm new file mode 100644 index 00000000..0ac6380d --- /dev/null +++ b/engine/overworld/spinners.asm @@ -0,0 +1,65 @@ +LoadSpinnerArrowTiles:: + ld a, [wSpritePlayerStateData1ImageIndex] + srl a + srl a + ld hl, SpinnerPlayerFacingDirections + ld c, a + ld b, $0 + add hl, bc + ld a, [hl] + ld [wSpritePlayerStateData1ImageIndex], a + ld a, [wCurMapTileset] + cp FACILITY + ld hl, FacilitySpinnerArrows + jr z, .asm_44ff6 + ld hl, GymSpinnerArrows +.asm_44ff6 + ld a, [wSimulatedJoypadStatesIndex] + bit 0, a + jr nz, .asm_45001 + ld de, $18 + add hl, de +.asm_45001 + ld a, $4 + ld bc, $0 +.asm_45006 + push af + push hl + push bc + add hl, bc + ld a, [hli] + ld e, a + ld a, [hli] + ld d, a + ld a, [hli] + ld c, a + ld a, [hli] + ld b, a + ld a, [hli] + ld h, [hl] + ld l, a + call CopyVideoData + pop bc + ld a, $6 + add c + ld c, a + pop hl + pop af + dec a + jr nz, .asm_45006 + ret + +INCLUDE "data/tilesets/spinner_tiles.asm" + +SpinnerPlayerFacingDirections: +; This isn't the order of the facing directions. Rather, it's a list of +; the facing directions that come next. For example, when the player is +; facing down (00), the next facing direction is left (08). + db $08 ; down -> left + db $0C ; up -> right + db $04 ; left -> up + db $00 ; right -> down + +; these tiles are the animation for the tiles that push the player in dungeons like Rocket HQ +SpinnerArrowAnimTiles: + INCBIN "gfx/overworld/spinners.2bpp" diff --git a/scripts/RocketHideoutB2F.asm b/scripts/RocketHideoutB2F.asm index 47c0581c..c4cda325 100755 --- a/scripts/RocketHideoutB2F.asm +++ b/scripts/RocketHideoutB2F.asm @@ -313,99 +313,7 @@ RocketHideout2Script3: ld [wCurMapScript], a ret -LoadSpinnerArrowTiles:: - ld a, [wSpritePlayerStateData1ImageIndex] - srl a - srl a - ld hl, SpinnerPlayerFacingDirections - ld c, a - ld b, $0 - add hl, bc - ld a, [hl] - ld [wSpritePlayerStateData1ImageIndex], a - ld a, [wCurMapTileset] - cp FACILITY - ld hl, FacilitySpinnerArrows - jr z, .asm_44ff6 - ld hl, GymSpinnerArrows -.asm_44ff6 - ld a, [wSimulatedJoypadStatesIndex] - bit 0, a - jr nz, .asm_45001 - ld de, $18 - add hl, de -.asm_45001 - ld a, $4 - ld bc, $0 -.asm_45006 - push af - push hl - push bc - add hl, bc - ld a, [hli] - ld e, a - ld a, [hli] - ld d, a - ld a, [hli] - ld c, a - ld a, [hli] - ld b, a - ld a, [hli] - ld h, [hl] - ld l, a - call CopyVideoData - pop bc - ld a, $6 - add c - ld c, a - pop hl - pop af - dec a - jr nz, .asm_45006 - ret - -spinner: MACRO -; \1: source -; \2: offset (BANK() chokes on literals) -; \3: dest - dw \1 tile \2 - db 1 - db BANK(\1) - dw vTileset tile \3 -ENDM - -FacilitySpinnerArrows: - 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: - 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 -; the facing directions that come next. For example, when the player is -; facing down (00), the next facing direction is left (08). - db $08 ; down -> left - db $0C ; up -> right - db $04 ; left -> up - db $00 ; right -> down - -; these tiles are the animation for the tiles that push the player in dungeons like Rocket HQ -SpinnerArrowAnimTiles: - INCBIN "gfx/overworld/spinners.2bpp" +INCLUDE "engine/overworld/spinners.asm" RocketHideoutB2F_TextPointers: dw RocketHideout2Text1 -- cgit v1.3.1-sl0p