From 139a28ff9906d728a6820fe678a2a616eb309421 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 4 Jul 2020 17:09:35 -0400 Subject: Port pokecrystal's formatting of text commands and special characters --- engine/overworld/cut.asm | 8 ++++---- engine/overworld/field_move_messages.asm | 16 ++++++++-------- engine/overworld/map_sprites.asm | 2 +- engine/overworld/player_animations.asm | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index c75fbbb6..fa28a751 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -22,8 +22,8 @@ UsedCut: jp PrintText .NothingToCutText - TX_FAR _NothingToCutText - db "@" + text_far _NothingToCutText + text_end .canCut ld [wCutTile], a @@ -68,8 +68,8 @@ UsedCut: jp RedrawMapView UsedCutText: - TX_FAR _UsedCutText - db "@" + text_far _UsedCutText + text_end InitCutAnimOAM: xor a diff --git a/engine/overworld/field_move_messages.asm b/engine/overworld/field_move_messages.asm index b1506742..8e849e46 100644 --- a/engine/overworld/field_move_messages.asm +++ b/engine/overworld/field_move_messages.asm @@ -7,16 +7,16 @@ PrintStrengthTxt: jp PrintText UsedStrengthText: - TX_FAR _UsedStrengthText - TX_ASM + text_far _UsedStrengthText + text_asm ld a, [wcf91] call PlayCry call Delay3 jp TextScriptEnd CanMoveBouldersText: - TX_FAR _CanMoveBouldersText - db "@" + text_far _CanMoveBouldersText + text_end IsSurfingAllowed: ; Returns whether surfing is allowed in bit 1 of wd728. @@ -49,9 +49,9 @@ CoordsData_cdf7: db $0B,$07,$FF CurrentTooFastText: - TX_FAR _CurrentTooFastText - db "@" + text_far _CurrentTooFastText + text_end CyclingIsFunText: - TX_FAR _CyclingIsFunText - db "@" + text_far _CyclingIsFunText + text_end diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index 904e9b04..00981b51 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -133,7 +133,7 @@ LoadMapSpriteTilePatterns: jr nc, .fourTileSpriteVRAMAddr ld d, a dec d -; vSprites += [hVRAMSlot] * $C0 (the number of bytes in 12 tiles) +; hl = vSprites + [hVRAMSlot] * $C0 (the number of bytes in 12 tiles) .calculateVRAMAddrLoop add hl, bc dec d diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index a3f6e051..c1c15ccf 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -457,16 +457,16 @@ FishingAnim: ret NoNibbleText: - TX_FAR _NoNibbleText - db "@" + text_far _NoNibbleText + text_end NothingHereText: - TX_FAR _NothingHereText - db "@" + text_far _NothingHereText + text_end ItsABiteText: - TX_FAR _ItsABiteText - db "@" + text_far _ItsABiteText + text_end FishingRodOAM: ; specifies how the fishing rod should be drawn on the screen -- cgit v1.3.1-sl0p From d9db3d74957c5a96d369db39bd3fa72ba5792d82 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 5 Jul 2020 14:38:08 -0400 Subject: Update map hide/show data labels Fixes #235 --- constants/hide_show_constants.asm | 3 + data/maps/hide_show_data.asm | 1129 ++++++++++++++++----------------- engine/overworld/missable_objects.asm | 14 +- 3 files changed, 568 insertions(+), 578 deletions(-) (limited to 'engine/overworld') diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm index 1aeb9149..21c83644 100755 --- a/constants/hide_show_constants.asm +++ b/constants/hide_show_constants.asm @@ -1,3 +1,6 @@ +HIDE EQU $11 +SHOW EQU $15 + ; this is a list of the sprites that can be enabled/disabled during the game ; sprites marked with an X are constants that are never used ; because those sprites are not (de)activated in a map's script diff --git a/data/maps/hide_show_data.asm b/data/maps/hide_show_data.asm index bc89d600..4203e90a 100755 --- a/data/maps/hide_show_data.asm +++ b/data/maps/hide_show_data.asm @@ -1,577 +1,564 @@ -; data for default hidden/shown -; objects for each map ($00-$F8) +; default hidden/shown objects for each map -; Table of 2-Byte pointers, one pointer per map, -; goes up to Map_F7, ends with -1. -; points to table listing all missable object in the area MapHSPointers: - dw MapHS00 - dw MapHS01 - dw MapHS02 - dw MapHS03 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS0A - dw MapHSXX - dw MapHSXX - dw MapHS0D - dw MapHSXX - dw MapHS0F - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS14 - dw MapHSXX - dw MapHSXX - dw MapHS17 - dw MapHSXX - dw MapHSXX - dw MapHS1A - dw MapHS1B - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS21 - dw MapHSXX - dw MapHS23 - dw MapHS24 - dw MapHSXX - dw MapHSXX - dw MapHS27 - dw MapHS28 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS2D - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS33 - dw MapHS34 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS3B - dw MapHSXX - dw MapHS3D - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS53 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS58 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS60 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS66 - dw MapHS67 - dw MapHS68 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS6C - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS78 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS84 - dw MapHSXX - dw MapHSXX - dw MapHS87 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS8F - dw MapHS90 - dw MapHS91 - dw MapHS92 - dw MapHS93 - dw MapHS94 - dw MapHS95 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS9B - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHS9F - dw MapHSA0 - dw MapHSA1 - dw MapHSA2 - dw MapHSXX - dw MapHSXX - dw MapHSA5 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSB1 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSB5 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSC0 - dw MapHSXX - dw MapHSC2 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSC6 - dw MapHSC7 - dw MapHSC8 - dw MapHSC9 - dw MapHSCA - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSCF - dw MapHSD0 - dw MapHSD1 - dw MapHSD2 - dw MapHSD3 - dw MapHSD4 - dw MapHSD5 - dw MapHSD6 - dw MapHSD7 - dw MapHSD8 - dw MapHSD9 - dw MapHSDA - dw MapHSDB - dw MapHSDC - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSE2 - dw MapHSE3 - dw MapHSE4 - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSE9 - dw MapHSEA - dw MapHSEB - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSXX - dw MapHSF4 - dw MapHSXX - dw MapHSXX - dw MapHSXX +; entries correspond to map ids + dw PalletTownHS + dw ViridianCityHS + dw PewterCityHS + dw CeruleanCityHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw SaffronCityHS + dw NoHS + dw NoHS + dw Route2HS + dw NoHS + dw Route4HS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw Route9HS + dw NoHS + dw NoHS + dw Route12HS + dw NoHS + dw NoHS + dw Route15HS + dw Rout16eHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw Route22HS + dw NoHS + dw Route24HS + dw Route25HS + dw NoHS + dw NoHS + dw BluesHouseHS + dw OaksLabHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw ViridianGymHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw ViridianForestHS + dw Museum1FHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw MtMoon1FHS + dw NoHS + dw MtMoonB2FHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw PowerPlantHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw BillsHouseHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw SSAnne2FHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw SSAnne1FRoomsHS + dw SSAnne2FRoomsHS + dw SSAnneB1FRoomsHS + dw NoHS + dw NoHS + dw NoHS + dw VictoryRoad1FHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw ChampionsRoomHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw CeladonMansionRoofHouseHS + dw NoHS + dw NoHS + dw GameCornerHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw PokemonTower2FHS + dw PokemonTower3FHS + dw PokemonTower4FHS + dw PokemonTower5FHS + dw PokemonTower6FHS + dw PokemonTower7FHS + dw MrFujisHouseHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw WardensHouseHS + dw NoHS + dw NoHS + dw NoHS + dw SeafoamIslandsB1FHS + dw SeafoamIslandsB2FHS + dw SeafoamIslandsB3FHS + dw SeafoamIslandsB4FHS + dw NoHS + dw NoHS + dw PokemonMansion1FHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw FightingDojoHS + dw NoHS + dw NoHS + dw NoHS + dw SilphCo1FHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw SeafoamIslands1FHS + dw NoHS + dw VictoryRoad2FHS + dw NoHS + dw NoHS + dw NoHS + dw VictoryRoad3FHS + dw RocketHideoutB1FHS + dw RocketHideoutB2FHS + dw RocketHideoutB3FHS + dw RocketHideoutB4FHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw SilphCo2FHS + dw SilphCo3FHS + dw SilphCo4FHS + dw SilphCo5FHS + dw SilphCo6FHS + dw SilphCo7FHS + dw SilphCo8FHS + dw PokemonMansion2FHS + dw PokemonMansion3FHS + dw PokemonMansionB1FHS + dw SafariZoneEastHS + dw SafariZoneNorthHS + dw SafariZoneWestHS + dw SafariZoneCenterHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw CeruleanCave2FHS + dw CeruleanCaveB1FHS + dw CeruleanCaveHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw SilphCo9FHS + dw SilphCo10FHS + dw SilphCo11FHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw NoHS + dw UnusedMapF4HS + dw NoHS + dw NoHS + dw NoHS dw -1 ; end -; Structure: -; 3 bytes per object -; [Map_ID][Object_ID][H/S] -; -; Program stops reading when either: -; a) Map_ID = $FF -; b) Map_ID ≠ currentMapID -; -; This Data is loaded into RAM at wd5ce-$D5F?. (wMissableObjectList) +NoHS: + db $FF, $FF, $FF -; These constants come from the bytes for Predef functions: -Hide equ $11 -Show equ $15 +MissableObjects: +; entries correspond to HS_* constants +; format: map id, object id, HIDE/SHOW -MapHSXX: - db $FF,$FF,$FF -MapHS00: - db PALLET_TOWN,$01,Hide -MapHS01: - db VIRIDIAN_CITY,$05,Show - db VIRIDIAN_CITY,$07,Hide -MapHS02: - db PEWTER_CITY,$03,Show - db PEWTER_CITY,$05,Show -MapHS03: - db CERULEAN_CITY,$01,Hide - db CERULEAN_CITY,$02,Show - db CERULEAN_CITY,$06,Hide - db CERULEAN_CITY,$0A,Show - db CERULEAN_CITY,$0B,Show -MapHS0A: - db SAFFRON_CITY,$01,Show - db SAFFRON_CITY,$02,Show - db SAFFRON_CITY,$03,Show - db SAFFRON_CITY,$04,Show - db SAFFRON_CITY,$05,Show - db SAFFRON_CITY,$06,Show - db SAFFRON_CITY,$07,Show - db SAFFRON_CITY,$08,Hide - db SAFFRON_CITY,$09,Hide - db SAFFRON_CITY,$0A,Hide - db SAFFRON_CITY,$0B,Hide - db SAFFRON_CITY,$0C,Hide - db SAFFRON_CITY,$0D,Hide - db SAFFRON_CITY,$0E,Show - db SAFFRON_CITY,$0F,Hide -MapHS0D: - db ROUTE_2,$01,Show - db ROUTE_2,$02,Show -MapHS0F: - db ROUTE_4,$03,Show -MapHS14: - db ROUTE_9,$0A,Show -MapHS17: - db ROUTE_12,$01,Show - db ROUTE_12,$09,Show - db ROUTE_12,$0A,Show -MapHS1A: - db ROUTE_15,$0B,Show -MapHS1B: - db ROUTE_16,$07,Show -MapHS21: - db ROUTE_22,$01,Hide - db ROUTE_22,$02,Hide -MapHS23: - db ROUTE_24,$01,Show - db ROUTE_24,$08,Show -MapHS24: - db ROUTE_25,$0A,Show -MapHS27: - db BLUES_HOUSE,$01,Show - db BLUES_HOUSE,$02,Hide - db BLUES_HOUSE,$03,Show -MapHS28: - db OAKS_LAB,$01,Show - db OAKS_LAB,$02,Show - db OAKS_LAB,$03,Show - db OAKS_LAB,$04,Show - db OAKS_LAB,$05,Hide - db OAKS_LAB,$06,Show - db OAKS_LAB,$07,Show - db OAKS_LAB,$08,Hide -MapHS2D: - db VIRIDIAN_GYM,$01,Show - db VIRIDIAN_GYM,$0B,Show -MapHS34: - db MUSEUM_1F,$05,Show -MapHSE4: - db CERULEAN_CAVE_1F,$01,Show - db CERULEAN_CAVE_1F,$02,Show - db CERULEAN_CAVE_1F,$03,Show -MapHS8F: - db POKEMON_TOWER_2F,$01,Show -MapHS90: - db POKEMON_TOWER_3F,$04,Show -MapHS91: - db POKEMON_TOWER_4F,$04,Show - db POKEMON_TOWER_4F,$05,Show - db POKEMON_TOWER_4F,$06,Show -MapHS92: - db POKEMON_TOWER_5F,$06,Show -MapHS93: - db POKEMON_TOWER_6F,$04,Show - db POKEMON_TOWER_6F,$05,Show -MapHS94: - db POKEMON_TOWER_7F,$01,Show - db POKEMON_TOWER_7F,$02,Show - db POKEMON_TOWER_7F,$03,Show - db POKEMON_TOWER_7F,$04,Show -MapHS95: - db MR_FUJIS_HOUSE,$05,Hide -MapHS84: - db CELADON_MANSION_ROOF_HOUSE,$02,Show -MapHS87: - db GAME_CORNER,$0B,Show -MapHS9B: - db WARDENS_HOUSE,$02,Show -MapHSA5: - db POKEMON_MANSION_1F,$02,Show - db POKEMON_MANSION_1F,$03,Show -MapHSB1: - db FIGHTING_DOJO,$06,Show - db FIGHTING_DOJO,$07,Show -MapHSB5: - db SILPH_CO_1F,$01,Hide -MapHS53: - db POWER_PLANT,$01,Show - db POWER_PLANT,$02,Show - db POWER_PLANT,$03,Show - db POWER_PLANT,$04,Show - db POWER_PLANT,$05,Show - db POWER_PLANT,$06,Show - db POWER_PLANT,$07,Show - db POWER_PLANT,$08,Show - db POWER_PLANT,$09,Show - db POWER_PLANT,$0A,Show - db POWER_PLANT,$0B,Show - db POWER_PLANT,$0C,Show - db POWER_PLANT,$0D,Show - db POWER_PLANT,$0E,Show -MapHSC2: - db VICTORY_ROAD_2F,$06,Show - db VICTORY_ROAD_2F,$07,Show - db VICTORY_ROAD_2F,$08,Show - db VICTORY_ROAD_2F,$09,Show - db VICTORY_ROAD_2F,$0A,Show - db VICTORY_ROAD_2F,$0D,Show -MapHS58: - db BILLS_HOUSE,$01,Show - db BILLS_HOUSE,$02,Hide - db BILLS_HOUSE,$03,Hide -MapHS33: - db VIRIDIAN_FOREST,$05,Show - db VIRIDIAN_FOREST,$06,Show - db VIRIDIAN_FOREST,$07,Show -MapHS3B: - db MT_MOON_1F,$08,Show - db MT_MOON_1F,$09,Show - db MT_MOON_1F,$0A,Show - db MT_MOON_1F,$0B,Show - db MT_MOON_1F,$0C,Show - db MT_MOON_1F,$0D,Show -MapHS3D: - db MT_MOON_B2F,$06,Show - db MT_MOON_B2F,$07,Show - db MT_MOON_B2F,$08,Show - db MT_MOON_B2F,$09,Show -MapHS60: - db SS_ANNE_2F,$02,Hide -MapHS66: - db SS_ANNE_1F_ROOMS,$0A,Show -MapHS67: - db SS_ANNE_2F_ROOMS,$06,Show - db SS_ANNE_2F_ROOMS,$09,Show -MapHS68: - db SS_ANNE_B1F_ROOMS,$09,Show - db SS_ANNE_B1F_ROOMS,$0A,Show - db SS_ANNE_B1F_ROOMS,$0B,Show -MapHSC6: - db VICTORY_ROAD_3F,$05,Show - db VICTORY_ROAD_3F,$06,Show - db VICTORY_ROAD_3F,$0A,Show -MapHSC7: - db ROCKET_HIDEOUT_B1F,$06,Show - db ROCKET_HIDEOUT_B1F,$07,Show -MapHSC8: - db ROCKET_HIDEOUT_B2F,$02,Show - db ROCKET_HIDEOUT_B2F,$03,Show - db ROCKET_HIDEOUT_B2F,$04,Show - db ROCKET_HIDEOUT_B2F,$05,Show -MapHSC9: - db ROCKET_HIDEOUT_B3F,$03,Show - db ROCKET_HIDEOUT_B3F,$04,Show -MapHSCA: - db ROCKET_HIDEOUT_B4F,$01,Show - db ROCKET_HIDEOUT_B4F,$05,Show - db ROCKET_HIDEOUT_B4F,$06,Show - db ROCKET_HIDEOUT_B4F,$07,Show - db ROCKET_HIDEOUT_B4F,$08,Hide - db ROCKET_HIDEOUT_B4F,$09,Hide -MapHSCF: - db SILPH_CO_2F,$01,Show - db SILPH_CO_2F,$02,Show - db SILPH_CO_2F,$03,Show - db SILPH_CO_2F,$04,Show - db SILPH_CO_2F,$05,Show -MapHSD0: - db SILPH_CO_3F,$02,Show - db SILPH_CO_3F,$03,Show - db SILPH_CO_3F,$04,Show -MapHSD1: - db SILPH_CO_4F,$02,Show - db SILPH_CO_4F,$03,Show - db SILPH_CO_4F,$04,Show - db SILPH_CO_4F,$05,Show - db SILPH_CO_4F,$06,Show - db SILPH_CO_4F,$07,Show -MapHSD2: - db SILPH_CO_5F,$02,Show - db SILPH_CO_5F,$03,Show - db SILPH_CO_5F,$04,Show - db SILPH_CO_5F,$05,Show - db SILPH_CO_5F,$06,Show - db SILPH_CO_5F,$07,Show - db SILPH_CO_5F,$08,Show -MapHSD3: - db SILPH_CO_6F,$06,Show - db SILPH_CO_6F,$07,Show - db SILPH_CO_6F,$08,Show - db SILPH_CO_6F,$09,Show - db SILPH_CO_6F,$0A,Show -MapHSD4: - db SILPH_CO_7F,$05,Show - db SILPH_CO_7F,$06,Show - db SILPH_CO_7F,$07,Show - db SILPH_CO_7F,$08,Show - db SILPH_CO_7F,$09,Show - db SILPH_CO_7F,$0A,Show - db SILPH_CO_7F,$0B,Show - db SILPH_CO_7F,$0C,Show -MapHSD5: - db SILPH_CO_8F,$02,Show - db SILPH_CO_8F,$03,Show - db SILPH_CO_8F,$04,Show -MapHSE9: - db SILPH_CO_9F,$02,Show - db SILPH_CO_9F,$03,Show - db SILPH_CO_9F,$04,Show -MapHSEA: - db SILPH_CO_10F,$01,Show - db SILPH_CO_10F,$02,Show - db SILPH_CO_10F,$03,Show - db SILPH_CO_10F,$04,Show - db SILPH_CO_10F,$05,Show - db SILPH_CO_10F,$06,Show -MapHSEB: - db SILPH_CO_11F,$03,Show - db SILPH_CO_11F,$04,Show - db SILPH_CO_11F,$05,Show -MapHSF4: - db UNUSED_MAP_F4,$02,Show -MapHSD6: - db POKEMON_MANSION_2F,$02,Show -MapHSD7: - db POKEMON_MANSION_3F,$03,Show - db POKEMON_MANSION_3F,$04,Show -MapHSD8: - db POKEMON_MANSION_B1F,$03,Show - db POKEMON_MANSION_B1F,$04,Show - db POKEMON_MANSION_B1F,$05,Show - db POKEMON_MANSION_B1F,$06,Show - db POKEMON_MANSION_B1F,$08,Show -MapHSD9: - db SAFARI_ZONE_EAST,$01,Show - db SAFARI_ZONE_EAST,$02,Show - db SAFARI_ZONE_EAST,$03,Show - db SAFARI_ZONE_EAST,$04,Show -MapHSDA: - db SAFARI_ZONE_NORTH,$01,Show - db SAFARI_ZONE_NORTH,$02,Show -MapHSDB: - db SAFARI_ZONE_WEST,$01,Show - db SAFARI_ZONE_WEST,$02,Show - db SAFARI_ZONE_WEST,$03,Show - db SAFARI_ZONE_WEST,$04,Show -MapHSDC: - db SAFARI_ZONE_CENTER,$01,Show -MapHSE2: - db CERULEAN_CAVE_2F,$01,Show - db CERULEAN_CAVE_2F,$02,Show - db CERULEAN_CAVE_2F,$03,Show -MapHSE3: - db CERULEAN_CAVE_B1F,$01,Show - db CERULEAN_CAVE_B1F,$02,Show - db CERULEAN_CAVE_B1F,$03,Show -MapHS6C: - db VICTORY_ROAD_1F,$03,Show - db VICTORY_ROAD_1F,$04,Show -MapHS78: - db CHAMPIONS_ROOM,$02,Hide -MapHSC0: - db SEAFOAM_ISLANDS_1F,$01,Show - db SEAFOAM_ISLANDS_1F,$02,Show -MapHS9F: - db SEAFOAM_ISLANDS_B1F,$01,Hide - db SEAFOAM_ISLANDS_B1F,$02,Hide -MapHSA0: - db SEAFOAM_ISLANDS_B2F,$01,Hide - db SEAFOAM_ISLANDS_B2F,$02,Hide -MapHSA1: - db SEAFOAM_ISLANDS_B3F,$02,Show - db SEAFOAM_ISLANDS_B3F,$03,Show - db SEAFOAM_ISLANDS_B3F,$05,Hide - db SEAFOAM_ISLANDS_B3F,$06,Hide -MapHSA2: - db SEAFOAM_ISLANDS_B4F,$01,Hide - db SEAFOAM_ISLANDS_B4F,$02,Hide - db SEAFOAM_ISLANDS_B4F,$03,Show - - db $FF,$01,Show +PalletTownHS: + db PALLET_TOWN, $01, HIDE +ViridianCityHS: + db VIRIDIAN_CITY, $05, SHOW + db VIRIDIAN_CITY, $07, HIDE +PewterCityHS: + db PEWTER_CITY, $03, SHOW + db PEWTER_CITY, $05, SHOW +CeruleanCityHS: + db CERULEAN_CITY, $01, HIDE + db CERULEAN_CITY, $02, SHOW + db CERULEAN_CITY, $06, HIDE + db CERULEAN_CITY, $0A, SHOW + db CERULEAN_CITY, $0B, SHOW +SaffronCityHS: + db SAFFRON_CITY, $01, SHOW + db SAFFRON_CITY, $02, SHOW + db SAFFRON_CITY, $03, SHOW + db SAFFRON_CITY, $04, SHOW + db SAFFRON_CITY, $05, SHOW + db SAFFRON_CITY, $06, SHOW + db SAFFRON_CITY, $07, SHOW + db SAFFRON_CITY, $08, HIDE + db SAFFRON_CITY, $09, HIDE + db SAFFRON_CITY, $0A, HIDE + db SAFFRON_CITY, $0B, HIDE + db SAFFRON_CITY, $0C, HIDE + db SAFFRON_CITY, $0D, HIDE + db SAFFRON_CITY, $0E, SHOW + db SAFFRON_CITY, $0F, HIDE +Route2HS: + db ROUTE_2, $01, SHOW + db ROUTE_2, $02, SHOW +Route4HS: + db ROUTE_4, $03, SHOW +Route9HS: + db ROUTE_9, $0A, SHOW +Route12HS: + db ROUTE_12, $01, SHOW + db ROUTE_12, $09, SHOW + db ROUTE_12, $0A, SHOW +Route15HS: + db ROUTE_15, $0B, SHOW +Rout16eHS: + db ROUTE_16, $07, SHOW +Route22HS: + db ROUTE_22, $01, HIDE + db ROUTE_22, $02, HIDE +Route24HS: + db ROUTE_24, $01, SHOW + db ROUTE_24, $08, SHOW +Route25HS: + db ROUTE_25, $0A, SHOW +BluesHouseHS: + db BLUES_HOUSE, $01, SHOW + db BLUES_HOUSE, $02, HIDE + db BLUES_HOUSE, $03, SHOW +OaksLabHS: + db OAKS_LAB, $01, SHOW + db OAKS_LAB, $02, SHOW + db OAKS_LAB, $03, SHOW + db OAKS_LAB, $04, SHOW + db OAKS_LAB, $05, HIDE + db OAKS_LAB, $06, SHOW + db OAKS_LAB, $07, SHOW + db OAKS_LAB, $08, HIDE +ViridianGymHS: + db VIRIDIAN_GYM, $01, SHOW + db VIRIDIAN_GYM, $0B, SHOW +Museum1FHS: + db MUSEUM_1F, $05, SHOW +CeruleanCaveHS: + db CERULEAN_CAVE_1F, $01, SHOW + db CERULEAN_CAVE_1F, $02, SHOW + db CERULEAN_CAVE_1F, $03, SHOW +PokemonTower2FHS: + db POKEMON_TOWER_2F, $01, SHOW +PokemonTower3FHS: + db POKEMON_TOWER_3F, $04, SHOW +PokemonTower4FHS: + db POKEMON_TOWER_4F, $04, SHOW + db POKEMON_TOWER_4F, $05, SHOW + db POKEMON_TOWER_4F, $06, SHOW +PokemonTower5FHS: + db POKEMON_TOWER_5F, $06, SHOW +PokemonTower6FHS: + db POKEMON_TOWER_6F, $04, SHOW + db POKEMON_TOWER_6F, $05, SHOW +PokemonTower7FHS: + db POKEMON_TOWER_7F, $01, SHOW + db POKEMON_TOWER_7F, $02, SHOW + db POKEMON_TOWER_7F, $03, SHOW + db POKEMON_TOWER_7F, $04, SHOW +MrFujisHouseHS: + db MR_FUJIS_HOUSE, $05, HIDE +CeladonMansionRoofHouseHS: + db CELADON_MANSION_ROOF_HOUSE, $02, SHOW +GameCornerHS: + db GAME_CORNER, $0B, SHOW +WardensHouseHS: + db WARDENS_HOUSE, $02, SHOW +PokemonMansion1FHS: + db POKEMON_MANSION_1F, $02, SHOW + db POKEMON_MANSION_1F, $03, SHOW +FightingDojoHS: + db FIGHTING_DOJO, $06, SHOW + db FIGHTING_DOJO, $07, SHOW +SilphCo1FHS: + db SILPH_CO_1F, $01, HIDE +PowerPlantHS: + db POWER_PLANT, $01, SHOW + db POWER_PLANT, $02, SHOW + db POWER_PLANT, $03, SHOW + db POWER_PLANT, $04, SHOW + db POWER_PLANT, $05, SHOW + db POWER_PLANT, $06, SHOW + db POWER_PLANT, $07, SHOW + db POWER_PLANT, $08, SHOW + db POWER_PLANT, $09, SHOW + db POWER_PLANT, $0A, SHOW + db POWER_PLANT, $0B, SHOW + db POWER_PLANT, $0C, SHOW + db POWER_PLANT, $0D, SHOW + db POWER_PLANT, $0E, SHOW +VictoryRoad2FHS: + db VICTORY_ROAD_2F, $06, SHOW + db VICTORY_ROAD_2F, $07, SHOW + db VICTORY_ROAD_2F, $08, SHOW + db VICTORY_ROAD_2F, $09, SHOW + db VICTORY_ROAD_2F, $0A, SHOW + db VICTORY_ROAD_2F, $0D, SHOW +BillsHouseHS: + db BILLS_HOUSE, $01, SHOW + db BILLS_HOUSE, $02, HIDE + db BILLS_HOUSE, $03, HIDE +ViridianForestHS: + db VIRIDIAN_FOREST, $05, SHOW + db VIRIDIAN_FOREST, $06, SHOW + db VIRIDIAN_FOREST, $07, SHOW +MtMoon1FHS: + db MT_MOON_1F, $08, SHOW + db MT_MOON_1F, $09, SHOW + db MT_MOON_1F, $0A, SHOW + db MT_MOON_1F, $0B, SHOW + db MT_MOON_1F, $0C, SHOW + db MT_MOON_1F, $0D, SHOW +MtMoonB2FHS: + db MT_MOON_B2F, $06, SHOW + db MT_MOON_B2F, $07, SHOW + db MT_MOON_B2F, $08, SHOW + db MT_MOON_B2F, $09, SHOW +SSAnne2FHS: + db SS_ANNE_2F, $02, HIDE +SSAnne1FRoomsHS: + db SS_ANNE_1F_ROOMS, $0A, SHOW +SSAnne2FRoomsHS: + db SS_ANNE_2F_ROOMS, $06, SHOW + db SS_ANNE_2F_ROOMS, $09, SHOW +SSAnneB1FRoomsHS: + db SS_ANNE_B1F_ROOMS, $09, SHOW + db SS_ANNE_B1F_ROOMS, $0A, SHOW + db SS_ANNE_B1F_ROOMS, $0B, SHOW +VictoryRoad3FHS: + db VICTORY_ROAD_3F, $05, SHOW + db VICTORY_ROAD_3F, $06, SHOW + db VICTORY_ROAD_3F, $0A, SHOW +RocketHideoutB1FHS: + db ROCKET_HIDEOUT_B1F, $06, SHOW + db ROCKET_HIDEOUT_B1F, $07, SHOW +RocketHideoutB2FHS: + db ROCKET_HIDEOUT_B2F, $02, SHOW + db ROCKET_HIDEOUT_B2F, $03, SHOW + db ROCKET_HIDEOUT_B2F, $04, SHOW + db ROCKET_HIDEOUT_B2F, $05, SHOW +RocketHideoutB3FHS: + db ROCKET_HIDEOUT_B3F, $03, SHOW + db ROCKET_HIDEOUT_B3F, $04, SHOW +RocketHideoutB4FHS: + db ROCKET_HIDEOUT_B4F, $01, SHOW + db ROCKET_HIDEOUT_B4F, $05, SHOW + db ROCKET_HIDEOUT_B4F, $06, SHOW + db ROCKET_HIDEOUT_B4F, $07, SHOW + db ROCKET_HIDEOUT_B4F, $08, HIDE + db ROCKET_HIDEOUT_B4F, $09, HIDE +SilphCo2FHS: + db SILPH_CO_2F, $01, SHOW + db SILPH_CO_2F, $02, SHOW + db SILPH_CO_2F, $03, SHOW + db SILPH_CO_2F, $04, SHOW + db SILPH_CO_2F, $05, SHOW +SilphCo3FHS: + db SILPH_CO_3F, $02, SHOW + db SILPH_CO_3F, $03, SHOW + db SILPH_CO_3F, $04, SHOW +SilphCo4FHS: + db SILPH_CO_4F, $02, SHOW + db SILPH_CO_4F, $03, SHOW + db SILPH_CO_4F, $04, SHOW + db SILPH_CO_4F, $05, SHOW + db SILPH_CO_4F, $06, SHOW + db SILPH_CO_4F, $07, SHOW +SilphCo5FHS: + db SILPH_CO_5F, $02, SHOW + db SILPH_CO_5F, $03, SHOW + db SILPH_CO_5F, $04, SHOW + db SILPH_CO_5F, $05, SHOW + db SILPH_CO_5F, $06, SHOW + db SILPH_CO_5F, $07, SHOW + db SILPH_CO_5F, $08, SHOW +SilphCo6FHS: + db SILPH_CO_6F, $06, SHOW + db SILPH_CO_6F, $07, SHOW + db SILPH_CO_6F, $08, SHOW + db SILPH_CO_6F, $09, SHOW + db SILPH_CO_6F, $0A, SHOW +SilphCo7FHS: + db SILPH_CO_7F, $05, SHOW + db SILPH_CO_7F, $06, SHOW + db SILPH_CO_7F, $07, SHOW + db SILPH_CO_7F, $08, SHOW + db SILPH_CO_7F, $09, SHOW + db SILPH_CO_7F, $0A, SHOW + db SILPH_CO_7F, $0B, SHOW + db SILPH_CO_7F, $0C, SHOW +SilphCo8FHS: + db SILPH_CO_8F, $02, SHOW + db SILPH_CO_8F, $03, SHOW + db SILPH_CO_8F, $04, SHOW +SilphCo9FHS: + db SILPH_CO_9F, $02, SHOW + db SILPH_CO_9F, $03, SHOW + db SILPH_CO_9F, $04, SHOW +SilphCo10FHS: + db SILPH_CO_10F, $01, SHOW + db SILPH_CO_10F, $02, SHOW + db SILPH_CO_10F, $03, SHOW + db SILPH_CO_10F, $04, SHOW + db SILPH_CO_10F, $05, SHOW + db SILPH_CO_10F, $06, SHOW +SilphCo11FHS: + db SILPH_CO_11F, $03, SHOW + db SILPH_CO_11F, $04, SHOW + db SILPH_CO_11F, $05, SHOW +UnusedMapF4HS: + db UNUSED_MAP_F4, $02, SHOW +PokemonMansion2FHS: + db POKEMON_MANSION_2F, $02, SHOW +PokemonMansion3FHS: + db POKEMON_MANSION_3F, $03, SHOW + db POKEMON_MANSION_3F, $04, SHOW +PokemonMansionB1FHS: + db POKEMON_MANSION_B1F, $03, SHOW + db POKEMON_MANSION_B1F, $04, SHOW + db POKEMON_MANSION_B1F, $05, SHOW + db POKEMON_MANSION_B1F, $06, SHOW + db POKEMON_MANSION_B1F, $08, SHOW +SafariZoneEastHS: + db SAFARI_ZONE_EAST, $01, SHOW + db SAFARI_ZONE_EAST, $02, SHOW + db SAFARI_ZONE_EAST, $03, SHOW + db SAFARI_ZONE_EAST, $04, SHOW +SafariZoneNorthHS: + db SAFARI_ZONE_NORTH, $01, SHOW + db SAFARI_ZONE_NORTH, $02, SHOW +SafariZoneWestHS: + db SAFARI_ZONE_WEST, $01, SHOW + db SAFARI_ZONE_WEST, $02, SHOW + db SAFARI_ZONE_WEST, $03, SHOW + db SAFARI_ZONE_WEST, $04, SHOW +SafariZoneCenterHS: + db SAFARI_ZONE_CENTER, $01, SHOW +CeruleanCave2FHS: + db CERULEAN_CAVE_2F, $01, SHOW + db CERULEAN_CAVE_2F, $02, SHOW + db CERULEAN_CAVE_2F, $03, SHOW +CeruleanCaveB1FHS: + db CERULEAN_CAVE_B1F, $01, SHOW + db CERULEAN_CAVE_B1F, $02, SHOW + db CERULEAN_CAVE_B1F, $03, SHOW +VictoryRoad1FHS: + db VICTORY_ROAD_1F, $03, SHOW + db VICTORY_ROAD_1F, $04, SHOW +ChampionsRoomHS: + db CHAMPIONS_ROOM, $02, HIDE +SeafoamIslands1FHS: + db SEAFOAM_ISLANDS_1F, $01, SHOW + db SEAFOAM_ISLANDS_1F, $02, SHOW +SeafoamIslandsB1FHS: + db SEAFOAM_ISLANDS_B1F, $01, HIDE + db SEAFOAM_ISLANDS_B1F, $02, HIDE +SeafoamIslandsB2FHS: + db SEAFOAM_ISLANDS_B2F, $01, HIDE + db SEAFOAM_ISLANDS_B2F, $02, HIDE +SeafoamIslandsB3FHS: + db SEAFOAM_ISLANDS_B3F, $02, SHOW + db SEAFOAM_ISLANDS_B3F, $03, SHOW + db SEAFOAM_ISLANDS_B3F, $05, HIDE + db SEAFOAM_ISLANDS_B3F, $06, HIDE +SeafoamIslandsB4FHS: + db SEAFOAM_ISLANDS_B4F, $01, HIDE + db SEAFOAM_ISLANDS_B4F, $02, HIDE + db SEAFOAM_ISLANDS_B4F, $03, SHOW + db $FF, $01, SHOW ; end diff --git a/engine/overworld/missable_objects.asm b/engine/overworld/missable_objects.asm index a89fcb54..1ebe8064 100644 --- a/engine/overworld/missable_objects.asm +++ b/engine/overworld/missable_objects.asm @@ -20,7 +20,7 @@ MarkTownVisitedAndLoadMissableObjects:: LoadMissableObjects: ld l, a push hl - ld de, MapHS00 ; calculate difference between out pointer and the base pointer + ld de, MissableObjects ; calculate difference between out pointer and the base pointer ld a, l sub e jr nc, .asm_f13c @@ -49,7 +49,7 @@ LoadMissableObjects: pop hl .writeMissableObjectsListLoop ld a, [hli] - cp $ff + cp -1 jr z, .done ; end of list cp b jr nz, .done ; not for current map anymore @@ -63,7 +63,7 @@ LoadMissableObjects: inc de jr .writeMissableObjectsListLoop .done - ld a, $ff + ld a, -1 ld [de], a ; write sentinel ret @@ -72,17 +72,17 @@ InitializeMissableObjectsFlags: ld bc, wMissableObjectFlagsEnd - wMissableObjectFlags xor a call FillMemory ; clear missable objects flags - ld hl, MapHS00 + ld hl, MissableObjects xor a ld [wMissableObjectCounter], a .missableObjectsLoop ld a, [hli] - cp $ff ; end of list + cp -1 ; end of list ret z push hl inc hl ld a, [hl] - cp Hide + cp HIDE jr nz, .skip ld hl, wMissableObjectFlags ld a, [wMissableObjectCounter] @@ -105,7 +105,7 @@ IsObjectHidden: ld hl, wMissableObjectList .loop ld a, [hli] - cp $ff + cp -1 jr z, .notHidden ; not missable -> not hidden cp b ld a, [hli] -- cgit v1.3.1-sl0p From a77999f7f151567a47dd69affe9a29378f298ff4 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 5 Jul 2020 16:15:01 -0400 Subject: Logical spacing in data/sgb/sgb_palettes.asm --- constants/gfx_constants.asm | 21 ++-- data/sgb/sgb_palettes.asm | 210 +++++++---------------------------- engine/battle/animations.asm | 8 +- engine/movie/intro.asm | 6 +- engine/movie/title.asm | 2 +- engine/overworld/clear_variables.asm | 2 +- engine/overworld/cut.asm | 2 +- macros.asm | 1 + macros/data.asm | 4 - macros/gfx.asm | 17 +++ 10 files changed, 84 insertions(+), 189 deletions(-) create mode 100644 macros/gfx.asm (limited to 'engine/overworld') diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 04671ecb..0cc0d98d 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -1,15 +1,20 @@ -SCREEN_WIDTH EQU 20 -SCREEN_HEIGHT EQU 18 +TILE_WIDTH EQU 8 ; pixels +LEN_1BPP_TILE EQU 1 * TILE_WIDTH ; bytes +LEN_2BPP_TILE EQU 2 * TILE_WIDTH ; bytes -SCREEN_WIDTH_PIXELS EQU SCREEN_WIDTH * 8 -SCREEN_HEIGHT_PIXELS EQU SCREEN_HEIGHT * 8 +NUM_PAL_COLORS EQU 4 +PAL_COLOR_SIZE EQU 2 +PALETTE_SIZE EQU NUM_PAL_COLORS * PAL_COLOR_SIZE -BYTES_PER_TILE EQU 16 +SCREEN_WIDTH EQU 20 +SCREEN_HEIGHT EQU 18 +SCREEN_WIDTH_PX EQU SCREEN_WIDTH * TILE_WIDTH ; pixels +SCREEN_HEIGHT_PX EQU SCREEN_HEIGHT * TILE_WIDTH ; pixels -BG_MAP_WIDTH EQU 32 -BG_MAP_HEIGHT EQU 32 +BG_MAP_WIDTH EQU 32 ; tiles +BG_MAP_HEIGHT EQU 32 ; tiles -SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile) +SPRITEBUFFERSIZE EQU 7 * 7 * LEN_1BPP_TILE ; HP bar HP_BAR_GREEN EQU 0 diff --git a/data/sgb/sgb_palettes.asm b/data/sgb/sgb_palettes.asm index 97f1d8ec..056ac8b9 100755 --- a/data/sgb/sgb_palettes.asm +++ b/data/sgb/sgb_palettes.asm @@ -1,174 +1,50 @@ -; palettes for overworlds, title screen, monsters SuperPalettes: - RGB 31,29,31 ; PAL_ROUTE - RGB 21,28,11 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_PALLET - RGB 25,28,27 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_VIRIDIAN - RGB 17,26,3 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_PEWTER - RGB 23,25,16 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CERULEAN - RGB 17,20,30 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_LAVENDER - RGB 27,20,27 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_VERMILION - RGB 30,18,0 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CELADON - RGB 16,30,22 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_FUCHSIA - RGB 31,15,22 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CINNABAR - RGB 26,10,6 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_INDIGO - RGB 22,14,24 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_SAFFRON - RGB 27,27,3 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_TOWNMAP - RGB 20,26,31 - RGB 17,23,10 - RGB 3,2,2 + RGB 31,29,31, 21,28,11, 20,26,31, 03,02,02 ; PAL_ROUTE + RGB 31,29,31, 25,28,27, 20,26,31, 03,02,02 ; PAL_PALLET + RGB 31,29,31, 17,26,03, 20,26,31, 03,02,02 ; PAL_VIRIDIAN + RGB 31,29,31, 23,25,16, 20,26,31, 03,02,02 ; PAL_PEWTER + RGB 31,29,31, 17,20,30, 20,26,31, 03,02,02 ; PAL_CERULEAN + RGB 31,29,31, 27,20,27, 20,26,31, 03,02,02 ; PAL_LAVENDER + RGB 31,29,31, 30,18,00, 20,26,31, 03,02,02 ; PAL_VERMILION + RGB 31,29,31, 16,30,22, 20,26,31, 03,02,02 ; PAL_CELADON + RGB 31,29,31, 31,15,22, 20,26,31, 03,02,02 ; PAL_FUCHSIA + RGB 31,29,31, 26,10,06, 20,26,31, 03,02,02 ; PAL_CINNABAR + RGB 31,29,31, 22,14,24, 20,26,31, 03,02,02 ; PAL_INDIGO + RGB 31,29,31, 27,27,03, 20,26,31, 03,02,02 ; PAL_SAFFRON + RGB 31,29,31, 20,26,31, 17,23,10, 03,02,02 ; PAL_TOWNMAP IF DEF(_RED) - RGB 31,29,31 ; PAL_LOGO1 - RGB 30,30,17 - RGB 17,23,10 - RGB 21,0,4 + RGB 31,29,31, 30,30,17, 17,23,10, 21,00,04 ; PAL_LOGO1 ENDC IF DEF(_BLUE) - RGB 31,29,31 ; PAL_LOGO1 - RGB 30,30,17 - RGB 21,0,4 - RGB 14,19,29 -ENDC - RGB 31,29,31 ; PAL_LOGO2 - RGB 30,30,17 - RGB 18,18,24 - RGB 7,7,16 - RGB 31,29,31 ; PAL_0F - RGB 24,20,30 - RGB 11,20,30 - RGB 3,2,2 - RGB 31,29,31 ; PAL_MEWMON - RGB 30,22,17 - RGB 16,14,19 - RGB 3,2,2 - RGB 31,29,31 ; PAL_BLUEMON - RGB 18,20,27 - RGB 11,15,23 - RGB 3,2,2 - RGB 31,29,31 ; PAL_REDMON - RGB 31,20,10 - RGB 26,10,6 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CYANMON - RGB 21,25,29 - RGB 14,19,25 - RGB 3,2,2 - RGB 31,29,31 ; PAL_PURPLEMON - RGB 27,22,24 - RGB 21,15,23 - RGB 3,2,2 - RGB 31,29,31 ; PAL_BROWNMON - RGB 28,20,15 - RGB 21,14,9 - RGB 3,2,2 - RGB 31,29,31 ; PAL_GREENMON - RGB 20,26,16 - RGB 9,20,11 - RGB 3,2,2 - RGB 31,29,31 ; PAL_PINKMON - RGB 30,22,24 - RGB 28,15,21 - RGB 3,2,2 - RGB 31,29,31 ; PAL_YELLOWMON - RGB 31,28,14 - RGB 26,20,0 - RGB 3,2,2 - RGB 31,29,31 ; PAL_GREYMON - RGB 26,21,22 - RGB 15,15,18 - RGB 3,2,2 - RGB 31,29,31 ; PAL_SLOTS1 - RGB 26,21,22 - RGB 27,20,6 - RGB 3,2,2 - RGB 31,29,31 ; PAL_SLOTS2 - RGB 31,31,17 -IF DEF(_RED) - RGB 25,17,21 -ENDC -IF DEF(_BLUE) - RGB 16,19,29 -ENDC - RGB 3,2,2 - RGB 31,29,31 ; PAL_SLOTS3 - RGB 22,31,16 + RGB 31,29,31, 30,30,17, 21,00,04, 14,19,29 ; PAL_LOGO1 +ENDC + RGB 31,29,31, 30,30,17, 18,18,24, 07,07,16 ; PAL_LOGO2 + RGB 31,29,31, 24,20,30, 11,20,30, 03,02,02 ; PAL_0F + RGB 31,29,31, 30,22,17, 16,14,19, 03,02,02 ; PAL_MEWMON + RGB 31,29,31, 18,20,27, 11,15,23, 03,02,02 ; PAL_BLUEMON + RGB 31,29,31, 31,20,10, 26,10,06, 03,02,02 ; PAL_REDMON + RGB 31,29,31, 21,25,29, 14,19,25, 03,02,02 ; PAL_CYANMON + RGB 31,29,31, 27,22,24, 21,15,23, 03,02,02 ; PAL_PURPLEMON + RGB 31,29,31, 28,20,15, 21,14,09, 03,02,02 ; PAL_BROWNMON + RGB 31,29,31, 20,26,16, 09,20,11, 03,02,02 ; PAL_GREENMON + RGB 31,29,31, 30,22,24, 28,15,21, 03,02,02 ; PAL_PINKMON + RGB 31,29,31, 31,28,14, 26,20,00, 03,02,02 ; PAL_YELLOWMON + RGB 31,29,31, 26,21,22, 15,15,18, 03,02,02 ; PAL_GREYMON + RGB 31,29,31, 26,21,22, 27,20,06, 03,02,02 ; PAL_SLOTS1 IF DEF(_RED) - RGB 25,17,21 + RGB 31,29,31, 31,31,17, 25,17,21, 03,02,02 ; PAL_SLOTS2 + RGB 31,29,31, 22,31,16, 25,17,21, 03,02,02 ; PAL_SLOTS3 + RGB 31,29,31, 16,19,29, 25,17,21, 03,02,02 ; PAL_SLOTS4 ENDC IF DEF(_BLUE) - RGB 16,19,29 -ENDC - RGB 3,2,2 - RGB 31,29,31 ; PAL_SLOTS4 -IF DEF(_RED) - RGB 16,19,29 - RGB 25,17,21 -ENDC -IF DEF(_BLUE) - RGB 25,17,21 - RGB 16,19,29 -ENDC - RGB 3,2,2 - RGB 31,29,31 ; PAL_BLACK - RGB 7,7,7 - RGB 2,3,3 - RGB 3,2,2 - RGB 31,29,31 ; PAL_GREENBAR - RGB 30,26,15 - RGB 9,20,11 - RGB 3,2,2 - RGB 31,29,31 ; PAL_YELLOWBAR - RGB 30,26,15 - RGB 26,20,0 - RGB 3,2,2 - RGB 31,29,31 ; PAL_REDBAR - RGB 30,26,15 - RGB 26,10,6 - RGB 3,2,2 - RGB 31,29,31 ; PAL_BADGE - RGB 30,22,17 - RGB 11,15,23 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CAVE - RGB 21,14,9 - RGB 18,24,22 - RGB 3,2,2 - RGB 31,29,31 ; PAL_GAMEFREAK - RGB 31,28,14 - RGB 24,20,10 - RGB 3,2,2 + RGB 31,29,31, 31,31,17, 16,19,29, 03,02,02 ; PAL_SLOTS2 + RGB 31,29,31, 22,31,16, 16,19,29, 03,02,02 ; PAL_SLOTS3 + RGB 31,29,31, 25,17,21, 16,19,29, 03,02,02 ; PAL_SLOTS4 +ENDC + RGB 31,29,31, 07,07,07, 02,03,03, 03,02,02 ; PAL_BLACK + RGB 31,29,31, 30,26,15, 09,20,11, 03,02,02 ; PAL_GREENBAR + RGB 31,29,31, 30,26,15, 26,20,00, 03,02,02 ; PAL_YELLOWBAR + RGB 31,29,31, 30,26,15, 26,10,06, 03,02,02 ; PAL_REDBAR + RGB 31,29,31, 30,22,17, 11,15,23, 03,02,02 ; PAL_BADGE + RGB 31,29,31, 21,14,09, 18,24,22, 03,02,02 ; PAL_CAVE + RGB 31,29,31, 31,28,14, 24,20,10, 03,02,02 ; PAL_GAMEFREAK diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index ee476ce9..78301b2e 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -1838,10 +1838,10 @@ AnimationWavyScreen: call Delay3 xor a ld [hAutoBGTransferEnabled], a - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ld d, $80 ; terminator - ld e, SCREEN_HEIGHT_PIXELS - 1 + ld e, SCREEN_HEIGHT_PX - 1 ld c, $ff ld hl, WavyScreenLineOffsets .loop @@ -2538,7 +2538,7 @@ AnimationShakeEnemyHUD: ; Now that the regular BG is showing the same thing the window was, move the ; window off the screen so that we can modify its contents below. - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ; Copy wTileMap to VRAM such that the row below the enemy HUD (in wTileMap) is @@ -2575,7 +2575,7 @@ AnimationShakeEnemyHUD: ; Restore the original graphics. call AnimationShowMonPic call ClearSprites - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ld hl, vBGMap1 call BattleAnimCopyTileMapToVRAM diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index a8151ab4..21f1a885 100755 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -97,7 +97,7 @@ PlayIntroScene: ; hip ld a, SFX_INTRO_HIP call PlaySound - ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / BYTES_PER_TILE + ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / LEN_2BPP_TILE ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation3 call AnimateIntroNidorino @@ -129,7 +129,7 @@ PlayIntroScene: call CheckForUserInterruption ret c - ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / BYTES_PER_TILE + ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / LEN_2BPP_TILE ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation6 call AnimateIntroNidorino @@ -140,7 +140,7 @@ PlayIntroScene: ; lunge ld a, SFX_INTRO_LUNGE call PlaySound - ld a, (FightIntroFrontMon3 - FightIntroFrontMon) / BYTES_PER_TILE + ld a, (FightIntroFrontMon3 - FightIntroFrontMon) / LEN_2BPP_TILE ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation7 jp AnimateIntroNidorino diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 9cbe5494..5ee9b77f 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -189,7 +189,7 @@ ENDC ; scroll game version in from the right call PrintGameVersionOnTitleScreen - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ld d, 144 .scrollTitleScreenGameVersionLoop diff --git a/engine/overworld/clear_variables.asm b/engine/overworld/clear_variables.asm index b5a1f4a0..9b735495 100644 --- a/engine/overworld/clear_variables.asm +++ b/engine/overworld/clear_variables.asm @@ -1,5 +1,5 @@ ClearVariablesOnEnterMap:: - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ld [rWY], a xor a diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index fa28a751..dd9b7c1a 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -37,7 +37,7 @@ UsedCut: call GBPalWhiteOutWithDelay3 call ClearSprites call RestoreScreenTilesAndReloadTilePatterns - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a call Delay3 call LoadGBPal diff --git a/macros.asm b/macros.asm index a092d25c..a20160c0 100644 --- a/macros.asm +++ b/macros.asm @@ -3,6 +3,7 @@ INCLUDE "macros/predef.asm" INCLUDE "macros/farcall.asm" INCLUDE "macros/data.asm" INCLUDE "macros/code.asm" +INCLUDE "macros/gfx.asm" INCLUDE "macros/coords.asm" INCLUDE "macros/scripts/audio.asm" diff --git a/macros/data.asm b/macros/data.asm index 54d1d561..46fb866d 100755 --- a/macros/data.asm +++ b/macros/data.asm @@ -16,10 +16,6 @@ ENDM coins equs "bcd2" money equs "bcd3" -RGB: MACRO - dw (\3 << 10 | \2 << 5 | \1) -ENDM - tmlearn: MACRO x = 0 REPT _NARG diff --git a/macros/gfx.asm b/macros/gfx.asm new file mode 100644 index 00000000..bad051ad --- /dev/null +++ b/macros/gfx.asm @@ -0,0 +1,17 @@ +RGB: MACRO +rept _NARG / 3 + dw palred (\1) + palgreen (\2) + palblue (\3) + shift 3 +endr +ENDM + +palred EQUS "(1 << 0) *" +palgreen EQUS "(1 << 5) *" +palblue EQUS "(1 << 10) *" + +palettes EQUS "* PALETTE_SIZE" +palette EQUS "+ PALETTE_SIZE *" +color EQUS "+ PAL_COLOR_SIZE *" + +tiles EQUS "* LEN_2BPP_TILE" +tile EQUS "+ LEN_2BPP_TILE *" -- cgit v1.3.1-sl0p From b0aa4cb14a602bc2acf15bc0f2591a94a30487a2 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 5 Jul 2020 16:35:06 -0400 Subject: Port two HRAM labels from pokeyellow --- engine/overworld/hidden_objects.asm | 10 +++++----- home.asm | 4 ++-- home/overworld.asm | 2 +- hram.asm | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm index a19694e0..d4a0a2bd 100755 --- a/engine/overworld/hidden_objects.asm +++ b/engine/overworld/hidden_objects.asm @@ -14,14 +14,14 @@ IsPlayerOnDungeonWarp:: set 4, [hl] ret -; if a hidden object was found, stores $00 in [hFoundHiddenObject], else stores $ff +; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff CheckForHiddenObject:: - ld hl, hFoundHiddenObjectOrBookshelf + ld hl, hItemAlreadyFound xor a - ld [hli], a ; [hFoundHiddenObjectOrBookshelf] + ld [hli], a ; [hItemAlreadyFound] ld [hli], a ; [hSavedMapTextPtr] ld [hli], a ; [hSavedMapTextPtr + 1] - ld [hl], a ; [hFoundHiddenObject] + ld [hl], a ; [hDidntFindAnyHiddenObject] ld de, $0 ld hl, HiddenObjectMaps .hiddenMapLoop @@ -81,7 +81,7 @@ CheckForHiddenObject:: ret .noMatch ld a, $ff - ld [hFoundHiddenObject], a + ld [hDidntFindAnyHiddenObject], a ret ; checks if the coordinates in front of the player's sprite match Y in b and X in c diff --git a/home.asm b/home.asm index 811c544f..0e977d11 100644 --- a/home.asm +++ b/home.asm @@ -1752,7 +1752,7 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ld [MBC1RomBank], a ld [hLoadedROMBank], a call CheckForHiddenObject - ld a, [hFoundHiddenObject] + ld a, [hDidntFindAnyHiddenObject] and a jr nz, .hiddenObjectNotFound ld a, [wHiddenObjectFunctionRomBank] @@ -1772,7 +1772,7 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: .nothingFound ld a, $ff .done - ld [hFoundHiddenObjectOrBookshelf], a + ld [hItemAlreadyFound], a pop af ld [MBC1RomBank], a ld [hLoadedROMBank], a diff --git a/home/overworld.asm b/home/overworld.asm index c16c121c..b17208c7 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -88,7 +88,7 @@ OverworldLoopLessDelay:: call IsPlayerCharacterBeingControlledByGame jr nz, .checkForOpponent call CheckForHiddenObjectOrBookshelfOrCardKeyDoor - ld a, [hFoundHiddenObjectOrBookshelf] + ld a, [hItemAlreadyFound] and a jp z, OverworldLoop ; jump if a hidden object or bookshelf was found, but not if a card key door was found call IsSpriteOrSignInFrontOfPlayer diff --git a/hram.asm b/hram.asm index ab18b8c9..ee557050 100644 --- a/hram.asm +++ b/hram.asm @@ -350,8 +350,8 @@ hSpriteScreenXCoord EQU $FFEC hSpriteMapYCoord EQU $FFED hSpriteMapXCoord EQU $FFEE -hFoundHiddenObjectOrBookshelf EQU $FFEB -hFoundHiddenObject EQU $FFEE +hItemAlreadyFound EQU $FFEB +hDidntFindAnyHiddenObject EQU $FFEE hSavedMapTextPtr EQU $FFEC -- cgit v1.3.1-sl0p From 2b2ed54bbf017943ba2343cd6c1dbe88b8f34a4e Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 5 Jul 2020 17:29:11 -0400 Subject: Identify wSpriteStateData1 and wSpriteStateData2 offsets, like pokeyellow --- engine/battle/battle_transitions.asm | 2 +- engine/events/card_key.asm | 2 +- engine/events/hidden_objects/bench_guys.asm | 2 +- engine/events/hidden_objects/bills_house_pc.asm | 2 +- engine/events/hidden_objects/bookshelves.asm | 2 +- engine/events/hidden_objects/cinnabar_gym_quiz.asm | 2 +- engine/events/hidden_objects/gym_statues.asm | 2 +- engine/events/hidden_objects/indigo_plateau_hq.asm | 2 +- engine/events/hidden_objects/oaks_lab_email.asm | 2 +- engine/events/hidden_objects/pokecenter_pc.asm | 4 +- .../events/hidden_objects/route_15_binoculars.asm | 2 +- engine/events/pokecenter.asm | 4 +- engine/menus/display_text_id_init.asm | 4 +- engine/movie/oak_speech/oak_speech.asm | 4 +- engine/overworld/auto_movement.asm | 6 +-- engine/overworld/cut.asm | 4 +- engine/overworld/dust_smoke.asm | 2 +- engine/overworld/emotion_bubbles.asm | 2 +- engine/overworld/hidden_objects.asm | 2 +- engine/overworld/ledges.asm | 2 +- engine/overworld/map_sprites.asm | 20 ++++----- engine/overworld/movement.asm | 50 +++++++++++----------- engine/overworld/pathfinding.asm | 6 +-- engine/overworld/player_animations.asm | 36 ++++++++-------- engine/overworld/player_state.asm | 12 +++--- engine/overworld/push_boulder.asm | 4 +- engine/overworld/sprite_collisions.asm | 6 +-- engine/overworld/trainer_sight.asm | 28 ++++++------ engine/pokemon/bills_pc.asm | 6 +-- engine/slots/game_corner_slots2.asm | 2 +- home.asm | 10 ++--- home/overworld.asm | 42 +++++++++--------- home/text_script.asm | 2 +- macros/wram.asm | 7 ++- scripts/BillsHouse.asm | 2 +- scripts/CeruleanCity.asm | 2 +- scripts/CinnabarIsland.asm | 2 +- scripts/CopycatsHouse2F.asm | 2 +- scripts/OaksLab.asm | 6 +-- scripts/PalletTown.asm | 2 +- scripts/PokemonMansion1F.asm | 2 +- scripts/PokemonMansion2F.asm | 2 +- scripts/PokemonMansion3F.asm | 2 +- scripts/PokemonMansionB1F.asm | 2 +- scripts/PokemonTower6F.asm | 2 +- scripts/PokemonTower7F.asm | 2 +- scripts/RedsHouse1F.asm | 2 +- scripts/RocketHideoutB2F.asm | 4 +- scripts/Route11Gate2F.asm | 2 +- scripts/Route12Gate2F.asm | 2 +- scripts/Route22.asm | 2 +- scripts/Route22Gate.asm | 2 +- scripts/Route23.asm | 2 +- scripts/Route6Gate.asm | 2 +- scripts/Route7Gate.asm | 2 +- scripts/Route8Gate.asm | 2 +- scripts/SafariZoneGate.asm | 6 +-- scripts/SeafoamIslandsB3F.asm | 2 +- scripts/TradeCenter.asm | 8 ++-- scripts/VermilionCity.asm | 4 +- scripts/VermilionDock.asm | 4 +- scripts/ViridianCity.asm | 2 +- 62 files changed, 182 insertions(+), 179 deletions(-) (limited to 'engine/overworld') diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 98e87dc0..548e85fb 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -10,7 +10,7 @@ BattleTransition: ; Determine which OAM block is being used by the enemy trainer sprite (if there ; is one). - ld hl, wSpriteStateData1 + 2 + ld hl, wSpritePlayerStateData1ImageIndex ld a, [hSpriteIndexOrTextID] ; enemy trainer sprite index (0 if wild battle) ld c, a ld b, 0 diff --git a/engine/events/card_key.asm b/engine/events/card_key.asm index cc641893..a37a1f27 100755 --- a/engine/events/card_key.asm +++ b/engine/events/card_key.asm @@ -88,7 +88,7 @@ GetCoordsInFrontOfPlayer: ld d, a ld a, [wXCoord] ld e, a - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] and a jr nz, .notFacingDown ; facing down diff --git a/engine/events/hidden_objects/bench_guys.asm b/engine/events/hidden_objects/bench_guys.asm index a6db73b9..d5db99ec 100644 --- a/engine/events/hidden_objects/bench_guys.asm +++ b/engine/events/hidden_objects/bench_guys.asm @@ -15,7 +15,7 @@ PrintBenchGuyText: .match ld a, [hli] ld b, a - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp b jr nz, .loop ; player isn't facing left at the bench guy ld a, [hl] diff --git a/engine/events/hidden_objects/bills_house_pc.asm b/engine/events/hidden_objects/bills_house_pc.asm index d6e9c19a..92679d66 100644 --- a/engine/events/hidden_objects/bills_house_pc.asm +++ b/engine/events/hidden_objects/bills_house_pc.asm @@ -1,6 +1,6 @@ BillsHousePC: call EnableAutoTextBoxDrawing - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING diff --git a/engine/events/hidden_objects/bookshelves.asm b/engine/events/hidden_objects/bookshelves.asm index eaf744ff..9cdd037a 100644 --- a/engine/events/hidden_objects/bookshelves.asm +++ b/engine/events/hidden_objects/bookshelves.asm @@ -1,6 +1,6 @@ ; prints text for bookshelves in buildings without sign events PrintBookshelfText:: - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP jr nz, .noMatch ; facing up diff --git a/engine/events/hidden_objects/cinnabar_gym_quiz.asm b/engine/events/hidden_objects/cinnabar_gym_quiz.asm index 9412ee45..da309f87 100644 --- a/engine/events/hidden_objects/cinnabar_gym_quiz.asm +++ b/engine/events/hidden_objects/cinnabar_gym_quiz.asm @@ -1,5 +1,5 @@ PrintCinnabarQuiz: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing diff --git a/engine/events/hidden_objects/gym_statues.asm b/engine/events/hidden_objects/gym_statues.asm index 3a17557f..1f592f2f 100644 --- a/engine/events/hidden_objects/gym_statues.asm +++ b/engine/events/hidden_objects/gym_statues.asm @@ -3,7 +3,7 @@ GymStatues: ; if in a gym and don’t have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID ; else ret call EnableAutoTextBoxDrawing - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz ld hl, .BadgeFlags diff --git a/engine/events/hidden_objects/indigo_plateau_hq.asm b/engine/events/hidden_objects/indigo_plateau_hq.asm index 840c114d..e8fd0220 100644 --- a/engine/events/hidden_objects/indigo_plateau_hq.asm +++ b/engine/events/hidden_objects/indigo_plateau_hq.asm @@ -1,5 +1,5 @@ PrintIndigoPlateauHQText: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing diff --git a/engine/events/hidden_objects/oaks_lab_email.asm b/engine/events/hidden_objects/oaks_lab_email.asm index cf3b2c9e..b66babe0 100644 --- a/engine/events/hidden_objects/oaks_lab_email.asm +++ b/engine/events/hidden_objects/oaks_lab_email.asm @@ -1,5 +1,5 @@ DisplayOakLabEmailText: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing diff --git a/engine/events/hidden_objects/pokecenter_pc.asm b/engine/events/hidden_objects/pokecenter_pc.asm index 9a2ab064..9ae7d41c 100644 --- a/engine/events/hidden_objects/pokecenter_pc.asm +++ b/engine/events/hidden_objects/pokecenter_pc.asm @@ -1,6 +1,6 @@ OpenPokemonCenterPC: - ld a, [wSpriteStateData1 + 9] - cp SPRITE_FACING_UP ; check to see if player is facing up + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing ld a, $1 diff --git a/engine/events/hidden_objects/route_15_binoculars.asm b/engine/events/hidden_objects/route_15_binoculars.asm index 028ea30d..ce047c2f 100644 --- a/engine/events/hidden_objects/route_15_binoculars.asm +++ b/engine/events/hidden_objects/route_15_binoculars.asm @@ -1,5 +1,5 @@ Route15GateLeftBinoculars: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing diff --git a/engine/events/pokecenter.asm b/engine/events/pokecenter.asm index f6ec6491..030c333f 100755 --- a/engine/events/pokecenter.asm +++ b/engine/events/pokecenter.asm @@ -19,7 +19,7 @@ DisplayPokemonCenterDialogue_:: ld hl, NeedYourPokemonText call PrintText ld a, $18 - ld [wSpriteStateData1 + $12], a ; make the nurse turn to face the machine + ld [wSprite01StateData1ImageIndex], a ; make the nurse turn to face the machine call Delay3 predef HealParty callba AnimateHealingMachine ; do the healing machine animation @@ -34,7 +34,7 @@ DisplayPokemonCenterDialogue_:: ld hl, PokemonFightingFitText call PrintText ld a, $14 - ld [wSpriteStateData1 + $12], a ; make the nurse bow + ld [wSprite01StateData1ImageIndex], a ; make the nurse bow ld c, a call DelayFrames jr .done diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm index 45c76f9c..c02e5bbc 100644 --- a/engine/menus/display_text_id_init.asm +++ b/engine/menus/display_text_id_init.asm @@ -41,7 +41,7 @@ DisplayTextIDInit:: ; loop to copy C1X9 (direction the sprite is facing) to C2X9 for each sprite ; this is done because when you talk to an NPC, they turn to look your way ; the original direction they were facing must be restored after the dialogue is over - ld hl, wSpriteStateData1 + $19 + ld hl, wSprite01StateData1FacingDirection ld c, $0f ld de, $10 .spriteFacingDirectionCopyLoop @@ -54,7 +54,7 @@ DisplayTextIDInit:: jr nz, .spriteFacingDirectionCopyLoop ; loop to force all the sprites in the middle of animation to stand still ; (so that they don't like they're frozen mid-step during the dialogue) - ld hl, wSpriteStateData1 + 2 + ld hl, wSpritePlayerStateData1ImageIndex ld de, $10 ld c, e .spriteStandStillLoop diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm index e6087012..0dd0c2dc 100755 --- a/engine/movie/oak_speech/oak_speech.asm +++ b/engine/movie/oak_speech/oak_speech.asm @@ -9,8 +9,8 @@ SetDefaultNames: ld bc, wBoxDataEnd - wPlayerName xor a call FillMemory - ld hl, wSpriteStateData1 - ld bc, $200 + ld hl, wSpriteDataStart + ld bc, wSpriteDataEnd - wSpriteDataStart xor a call FillMemory pop af diff --git a/engine/overworld/auto_movement.asm b/engine/overworld/auto_movement.asm index 421e3180..5e70ab8c 100755 --- a/engine/overworld/auto_movement.asm +++ b/engine/overworld/auto_movement.asm @@ -12,7 +12,7 @@ PlayerStepOutFromDoor:: ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a xor a - ld [wSpriteStateData1 + 2], a + ld [wSpritePlayerStateData1ImageIndex], a call StartSimulatingJoypadStates ret .notStandingOnDoor @@ -110,7 +110,7 @@ PalletMovementScript_WalkToLab: swap a ld [wNPCMovementScriptSpriteOffset], a xor a - ld [wSpriteStateData2 + $06], a + ld [wSpritePlayerStateData2MovementByte1], a ld hl, wSimulatedJoypadStatesEnd ld de, RLEList_PlayerWalkToLab call DecodeRLEList @@ -228,7 +228,7 @@ PewterMovementScript_WalkToGym: swap a ld [wNPCMovementScriptSpriteOffset], a xor a - ld [wSpriteStateData2 + $06], a + ld [wSpritePlayerStateData2MovementByte1], a ld hl, wSimulatedJoypadStatesEnd ld de, RLEList_PewterGymPlayer call DecodeRLEList diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index dd9b7c1a..f99bf323 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -127,7 +127,7 @@ CutOrBoulderDustAnimationTilesAndAttributes: db $FE,$10,$FF,$10 GetCutOrBoulderDustAnimationOffsets: - ld hl, wSpriteStateData1 + 4 + ld hl, wSpritePlayerStateData1YPixels ld a, [hli] ; player's sprite screen Y position ld b, a inc hl @@ -187,7 +187,7 @@ ReplaceTreeTileBlock: ld h, [hl] ld l, a add hl, bc - ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction + ld a, [wSpritePlayerStateData1FacingDirection] and a jr z, .down cp SPRITE_FACING_UP diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm index 6c26b712..2dc6882e 100755 --- a/engine/overworld/dust_smoke.asm +++ b/engine/overworld/dust_smoke.asm @@ -30,7 +30,7 @@ AnimateBoulderDust: jp LoadPlayerSpriteGraphics GetMoveBoulderDustFunctionPointer: - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] ld hl, MoveBoulderDustFunctionPointerTable ld c, a ld b, $0 diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index 20309fc1..1ac07b80 100755 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -38,7 +38,7 @@ EmotionBubble: jr nz, .loop ; get the screen coordinates of the sprite the bubble is to be displayed above - ld hl, wSpriteStateData1 + 4 + ld hl, wSpritePlayerStateData1YPixels ld a, [wEmotionBubbleSpriteIndex] swap a ld c, a diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm index d4a0a2bd..5ce7f3cb 100755 --- a/engine/overworld/hidden_objects.asm +++ b/engine/overworld/hidden_objects.asm @@ -87,7 +87,7 @@ CheckForHiddenObject:: ; checks if the coordinates in front of the player's sprite match Y in b and X in c ; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match CheckIfCoordsInFrontOfPlayerMatch: - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP jr z, .facingUp cp SPRITE_FACING_LEFT diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index c56914f6..0f135fb6 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -6,7 +6,7 @@ HandleLedges:: and a ; OVERWORLD ret nz predef GetTileAndCoordsInFrontOfPlayer - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] ld b, a aCoord 8, 9 ld c, a diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index 00981b51..0de1befd 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -12,8 +12,8 @@ InitMapSprites:: call InitOutsideMapSprites ret c ; return if the map is an outside map (already handled by above call) ; if the map is an inside map (i.e. mapID >= $25) - ld hl, wSpriteStateData1 - ld de, wSpriteStateData2 + $0d + ld hl, wSpritePlayerStateData1PictureID + ld de, wSpritePlayerStateData2PictureID ; Loop to copy picture ID's from $C1X0 to $C2XD for LoadMapSpriteTilePatterns. .copyPictureIDLoop ld a, [hl] ; $C1X0 (picture ID) @@ -37,7 +37,7 @@ LoadMapSpriteTilePatterns: .spritesExist ld c, a ; c = [wNumSprites] ld b, $10 ; number of sprite slots - ld hl, wSpriteStateData2 + $0d + ld hl, wSpritePlayerStateData2PictureID xor a ld [hFourTileSpriteCount], a .copyPictureIDLoop ; loop to copy picture ID from $C2XD to $C2XE @@ -48,9 +48,9 @@ LoadMapSpriteTilePatterns: ld l, a dec b jr nz, .copyPictureIDLoop - ld hl, wSpriteStateData2 + $1e + ld hl, wSprite01StateData2ImageBaseOffset .loadTilePatternLoop - ld de, wSpriteStateData2 + $1d + ld de, wSprite01StateData2PictureID ; Check if the current picture ID has already had its tile patterns loaded. ; This done by looping through the previous sprite slots and seeing if any of ; their picture ID's match that of the current sprite slot. @@ -70,7 +70,7 @@ LoadMapSpriteTilePatterns: ld e, a jr .checkIfAlreadyLoadedLoop .notAlreadyLoaded - ld de, wSpriteStateData2 + $0e + ld de, wSpritePlayerStateData2ImageBaseOffset ld b, $01 ; loop to find the highest tile pattern VRAM slot (among the first 10 slots) used by a previous sprite slot ; this is done in order to find the first free VRAM slot available @@ -215,7 +215,7 @@ LoadMapSpriteTilePatterns: ld l, a dec c jp nz, .loadTilePatternLoop - ld hl, wSpriteStateData2 + $0d + ld hl, wSpritePlayerStateData2PictureID ld b, $10 ; the pictures ID's stored at $C2XD are no longer needed, so zero them .zeroStoredPictureIDLoop @@ -287,7 +287,7 @@ InitOutsideMapSprites: jr nc, .noCarry2 inc d .noCarry2 - ld hl, wSpriteStateData2 + $0d + ld hl, wSpritePlayerStateData2PictureID ld a, SPRITE_RED ld [hl], a ld bc, wSpriteSet @@ -323,7 +323,7 @@ InitOutsideMapSprites: call LoadMapSpriteTilePatterns pop af ld [wNumSprites], a ; restore number of sprites - ld hl, wSpriteStateData2 + $1e + ld hl, wSprite01StateData2ImageBaseOffset ld b, $0f ; The VRAM tile pattern slots that LoadMapSpriteTilePatterns set are in the ; order of the map's sprite set, not the order of the actual sprites loaded @@ -337,7 +337,7 @@ InitOutsideMapSprites: dec b jr nz, .zeroVRAMSlotsLoop .skipLoadingSpriteSet - ld hl, wSpriteStateData1 + $10 + ld hl, wSprite01StateData1 ; This loop stores the correct VRAM tile pattern slots according the sprite ; data from the map's header. Since the VRAM tile pattern slots are filled in ; the order of the sprite set, in order to find the VRAM tile pattern slot diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 6c354779..d27ccb4b 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -1,13 +1,13 @@ MAP_TILESET_SIZE EQU $60 UpdatePlayerSprite: - ld a, [wSpriteStateData2] + ld a, [wSpritePlayerStateData2WalkAnimationCounter] and a jr z, .checkIfTextBoxInFrontOfSprite cp $ff jr z, .disableSprite dec a - ld [wSpriteStateData2], a + ld [wSpritePlayerStateData2WalkAnimationCounter], a jr .disableSprite ; check if a text box is in front of the sprite by checking if the lower left ; background tile the sprite is standing on is greater than $5F, which is @@ -19,7 +19,7 @@ UpdatePlayerSprite: jr c, .lowerLeftTileIsMapTile .disableSprite ld a, $ff - ld [wSpriteStateData1 + 2], a + ld [wSpritePlayerStateData1ImageIndex], a ret .lowerLeftTileIsMapTile call DetectCollisionBetweenSprites @@ -51,11 +51,11 @@ UpdatePlayerSprite: .notMoving ; zero the animation counters xor a - ld [wSpriteStateData1 + 7], a - ld [wSpriteStateData1 + 8], a + ld [wSpritePlayerStateData1IntraAnimFrameCounter], a + ld [wSpritePlayerStateData1AnimFrameCounter], a jr .calcImageIndex .next - ld [wSpriteStateData1 + 9], a ; facing direction + ld [wSpritePlayerStateData1FacingDirection], a ld a, [wFontLoaded] bit 0, a jr nz, .notMoving @@ -79,11 +79,11 @@ UpdatePlayerSprite: and $3 ld [hl], a .calcImageIndex - ld a, [wSpriteStateData1 + 8] + ld a, [wSpritePlayerStateData1AnimFrameCounter] ld b, a - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] add b - ld [wSpriteStateData1 + 2], a + ld [wSpritePlayerStateData1ImageIndex], a .skipSpriteAnim ; If the player is standing on a grass tile, make the player's sprite have ; lower priority than the background so that it's partially obscured by the @@ -97,7 +97,7 @@ UpdatePlayerSprite: jr nz, .next2 ld a, $80 .next2 - ld [wSpriteStateData2 + 7], a + ld [wSpritePlayerStateData2GrassPriority], a ret UnusedReadSpriteDataFunction: @@ -397,7 +397,7 @@ UpdateSpriteMovementDelay: notYetMoving: ld h, wSpriteStateData1 / $100 ld a, [hCurrentSpriteOffset] - add $8 + add wSpritePlayerStateData1AnimFrameCounter - wSpritePlayerStateData1 ld l, a ld [hl], $0 ; c1x8 = 0 (walk animation frame) jp UpdateSpriteImage @@ -452,7 +452,7 @@ InitializeSpriteStatus: InitializeSpriteScreenPosition: ld h, wSpriteStateData2 / $100 ld a, [hCurrentSpriteOffset] - add $4 + add wSpritePlayerStateData2MapY - wSpritePlayerStateData2 ld l, a ld a, [wYCoord] ld b, a @@ -480,13 +480,13 @@ CheckSpriteAvailability: jp nz, .spriteInvisible ld h, wSpriteStateData2 / $100 ld a, [hCurrentSpriteOffset] - add $6 + add wSpritePlayerStateData2MovementByte1 - wSpritePlayerStateData2 ld l, a ld a, [hl] ; c2x6: movement byte 1 cp $fe jr c, .skipXVisibilityTest ; movement byte 1 < $fe (i.e. the sprite's movement is scripted) ld a, [hCurrentSpriteOffset] - add $4 + add wSpritePlayerStateData2MapY - wSpritePlayerStateData2 ld l, a ld b, [hl] ; c2x4: Y pos (+4) ld a, [wYCoord] @@ -528,7 +528,7 @@ CheckSpriteAvailability: .spriteInvisible ld h, wSpriteStateData1 / $100 ld a, [hCurrentSpriteOffset] - add $2 + add wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1 ld l, a ld [hl], $ff ; c1x2 scf @@ -582,7 +582,7 @@ UpdateSpriteImage: CanWalkOntoTile: ld h, wSpriteStateData2 / $100 ld a, [hCurrentSpriteOffset] - add $6 + add wSpritePlayerStateData2MovementByte1 - wSpritePlayerStateData2 ld l, a ld a, [hl] ; c2x6 (movement byte 1) cp $fe @@ -610,7 +610,7 @@ CanWalkOntoTile: jr z, .impassable ; if $ff, no movement allowed (however, changing direction is) ld h, wSpriteStateData1 / $100 ld a, [hCurrentSpriteOffset] - add $4 + add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld l, a ld a, [hli] ; c1x4 (screen Y pos) add $4 ; align to blocks (Y pos is always 4 pixels off) @@ -636,7 +636,7 @@ CanWalkOntoTile: jr nz, .impassable ; collision between sprites, don't go there ld h, wSpriteStateData2 / $100 ld a, [hCurrentSpriteOffset] - add $2 + add wSpritePlayerStateData2YDisplacement - wSpritePlayerStateData2 ld l, a ld a, [hli] ; c2x2 (sprite Y displacement, initialized at $8, keep track of where a sprite did go) bit 7, d ; check if going upwards (d=$ff) @@ -665,7 +665,7 @@ CanWalkOntoTile: and a ; clear carry (marking success) ret .impassable - ld h, $c1 + ld h, wSpriteStateData1 / $100 ld a, [hCurrentSpriteOffset] inc a ld l, a @@ -693,7 +693,7 @@ CanWalkOntoTile: GetTileSpriteStandsOn: ld h, wSpriteStateData1 / $100 ld a, [hCurrentSpriteOffset] - add $4 + add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld l, a ld a, [hli] ; c1x4: screen Y position add $4 ; align to 2*2 tile blocks (Y position is always off 4 pixels to the top) @@ -807,12 +807,12 @@ InitScriptedNPCMovement: jp AnimScriptedNPCMovement GetSpriteScreenYPointer: - ld a, $4 + ld a, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld b, a jr GetSpriteScreenXYPointerCommon GetSpriteScreenXPointer: - ld a, $6 + ld a, wSpritePlayerStateData1XPixels - wSpritePlayerStateData1 ld b, a GetSpriteScreenXYPointerCommon: @@ -826,7 +826,7 @@ GetSpriteScreenXYPointerCommon: AnimScriptedNPCMovement: ld hl, wSpriteStateData2 ld a, [hCurrentSpriteOffset] - add $e + add wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData2 ld l, a ld a, [hl] ; VRAM slot dec a @@ -834,7 +834,7 @@ AnimScriptedNPCMovement: ld b, a ld hl, wSpriteStateData1 ld a, [hCurrentSpriteOffset] - add $9 + add wSpritePlayerStateData1FacingDirection - wSpritePlayerStateData1 ld l, a ld a, [hl] ; facing direction cp SPRITE_FACING_DOWN @@ -853,7 +853,7 @@ AnimScriptedNPCMovement: call AdvanceScriptedNPCAnimFrameCounter ld hl, wSpriteStateData1 ld a, [hCurrentSpriteOffset] - add $2 + add wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1 ld l, a ld a, [hSpriteVRAMSlotAndFacing] ld b, a diff --git a/engine/overworld/pathfinding.asm b/engine/overworld/pathfinding.asm index ba052d38..7251759c 100644 --- a/engine/overworld/pathfinding.asm +++ b/engine/overworld/pathfinding.asm @@ -77,14 +77,14 @@ FindPathToPlayer: CalcPositionOfPlayerRelativeToNPC: xor a ld [hNPCPlayerRelativePosFlags], a - ld a, [wSpriteStateData1 + 4] ; player's sprite screen Y position in pixels + ld a, [wSpritePlayerStateData1YPixels] ld d, a - ld a, [wSpriteStateData1 + 6] ; player's sprite screen X position in pixels + ld a, [wSpritePlayerStateData1XPixels] ld e, a ld hl, wSpriteStateData1 ld a, [hNPCSpriteOffset] add l - add $4 + add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld l, a jr nc, .noCarry inc h diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index c1c15ccf..cfd6cc8d 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -1,7 +1,7 @@ EnterMapAnim:: call InitFacingDirectionList ld a, $ec - ld [wSpriteStateData1 + 4], a ; player's sprite Y screen position + ld [wSpritePlayerStateData1YPixels], a call Delay3 push hl call GBFadeInFromWhite @@ -227,19 +227,19 @@ DoFlyAnimation: ld a, [wFlyAnimBirdSpriteImageIndex] xor $1 ; make the bird flap its wings ld [wFlyAnimBirdSpriteImageIndex], a - ld [wSpriteStateData1 + 2], a + ld [wSpritePlayerStateData1ImageIndex], a call Delay3 ld a, [wFlyAnimUsingCoordList] cp $ff jr z, .skipCopyingCoords ; if the bird is flapping its wings in place - ld hl, wSpriteStateData1 + 4 + ld hl, wSpritePlayerStateData1YPixels ld a, [de] inc de - ld [hli], a + ld [hli], a ; y inc hl ld a, [de] inc de - ld [hl], a + ld [hl], a ; x .skipCopyingCoords ld a, [wFlyAnimCounter] dec a @@ -258,15 +258,15 @@ LoadBirdSpriteGraphics: jp CopyVideoData InitFacingDirectionList: - ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images) + ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images) ld [wSavedPlayerFacingDirection], a - ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position + ld a, [wSpritePlayerStateData1YPixels] ld [wSavedPlayerScreenY], a ld hl, PlayerSpinningFacingOrder ld de, wFacingDirectionList ld bc, 4 call CopyData - ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images) + ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images) ld hl, wFacingDirectionList ; find the place in the list that matches the current facing direction .loop @@ -284,7 +284,7 @@ PlayerSpinningFacingOrder: SpinPlayerSprite: ; copy the current value from the list into the sprite data and rotate the list ld a, [hl] - ld [wSpriteStateData1 + 2], a ; player's sprite facing direction (image index is locked to standing images) + ld [wSpritePlayerStateData1ImageIndex], a ; (image index is locked to standing images) push hl ld hl, wFacingDirectionList ld de, wFacingDirectionList - 1 @@ -320,9 +320,9 @@ PlayerSpinWhileMovingUpOrDown: call SpinPlayerSprite ld a, [wPlayerSpinWhileMovingUpOrDownAnimDeltaY] ld c, a - ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position + ld a, [wSpritePlayerStateData1YPixels] add c - ld [wSpriteStateData1 + 4], a + ld [wSpritePlayerStateData1YPixels], a ld c, a ld a, [wPlayerSpinWhileMovingUpOrDownAnimMaxY] cp c @@ -334,9 +334,9 @@ PlayerSpinWhileMovingUpOrDown: RestoreFacingDirectionAndYScreenPos: ld a, [wSavedPlayerScreenY] - ld [wSpriteStateData1 + 4], a + ld [wSpritePlayerStateData1YPixels], a ld a, [wSavedPlayerFacingDirection] - ld [wSpriteStateData1 + 2], a + ld [wSpritePlayerStateData1ImageIndex], a ; (image index is locked to standing images) ret ; if SGB, 2 frames, else 3 frames @@ -387,7 +387,7 @@ FishingAnim: ld a, $4 ld hl, RedFishingTiles call LoadAnimSpriteGfx - ld a, [wSpriteStateData1 + 2] + ld a, [wSpritePlayerStateData1ImageIndex] ld c, a ld b, $0 ld hl, FishingRodOAM @@ -410,7 +410,7 @@ FishingAnim: ; shake the player's sprite vertically ld b, 10 .loop - ld hl, wSpriteStateData1 + 4 ; player's sprite Y screen position + ld hl, wSpritePlayerStateData1YPixels call .ShakePlayerSprite ld hl, wOAMBuffer + $9c call .ShakePlayerSprite @@ -420,7 +420,7 @@ FishingAnim: ; If the player is facing up, hide the fishing rod so it doesn't overlap with ; the exclamation bubble that will be shown next. - ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images) cp SPRITE_FACING_UP jr nz, .skipHidingFishingRod ld a, $a0 @@ -434,7 +434,7 @@ FishingAnim: predef EmotionBubble ; If the player is facing up, unhide the fishing rod. - ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images) cp SPRITE_FACING_UP jr nz, .skipUnhidingFishingRod ld a, $44 @@ -507,7 +507,7 @@ _HandleMidJump:: ld hl, PlayerJumpingYScreenCoords add hl, bc ld a, [hl] - ld [wSpriteStateData1 + 4], a ; player's sprite y coordinate + ld [wSpritePlayerStateData1YPixels], a ret .finishedJump ld a, [wWalkCounter] diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm index ea24fdc1..9ff67df8 100644 --- a/engine/overworld/player_state.asm +++ b/engine/overworld/player_state.asm @@ -88,7 +88,7 @@ IsPlayerFacingEdgeOfMap:: push hl push de push bc - ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction + ld a, [wSpritePlayerStateData1FacingDirection] srl a ld c, a ld b, $0 @@ -158,7 +158,7 @@ IsWarpTileInFrontOfPlayer:: ld a, [wCurMap] cp SS_ANNE_BOW jr z, IsSSAnneBowWarpTileInFrontOfPlayer - ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction + ld a, [wSpritePlayerStateData1FacingDirection] srl a ld c, a ld b, 0 @@ -263,7 +263,7 @@ _GetTileAndCoordsInFrontOfPlayer: ld d, a ld a, [wXCoord] ld e, a - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] and a ; cp SPRITE_FACING_DOWN jr nz, .notFacingDown ; facing down @@ -302,7 +302,7 @@ GetTileTwoStepsInFrontOfPlayer: ld a, [hli] ld d, a ld e, [hl] - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] and a ; cp SPRITE_FACING_DOWN jr nz, .notFacingDown ; facing down @@ -375,7 +375,7 @@ CheckForBoulderCollisionWithSprites: swap a ld d, 0 ld e, a - ld hl, wSpriteStateData2 + $14 + ld hl, wSprite01StateData2MapY add hl, de ld a, [hli] ; map Y position ld [hPlayerYCoord], a @@ -384,7 +384,7 @@ CheckForBoulderCollisionWithSprites: ld a, [wNumSprites] ld c, a ld de, $f - ld hl, wSpriteStateData2 + $14 + ld hl, wSprite01StateData2MapY ld a, [hPlayerFacing] and $3 ; facing up or down? jr z, .pushingHorizontallyLoop diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm index e4dd91cf..da1c6dee 100644 --- a/engine/overworld/push_boulder.asm +++ b/engine/overworld/push_boulder.asm @@ -12,7 +12,7 @@ TryPushingBoulder:: ld [wBoulderSpriteIndex], a and a jp z, ResetBoulderPushFlags - ld hl, wSpriteStateData1 + 1 + ld hl, wSpritePlayerStateData1MovementStatus ld d, $0 ld a, [hSpriteIndexOrTextID] swap a @@ -36,7 +36,7 @@ TryPushingBoulder:: jp nz, ResetBoulderPushFlags ld a, [hJoyHeld] ld b, a - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP jr z, .pushBoulderUp cp SPRITE_FACING_LEFT diff --git a/engine/overworld/sprite_collisions.asm b/engine/overworld/sprite_collisions.asm index c5ff8ebb..48cd95b9 100644 --- a/engine/overworld/sprite_collisions.asm +++ b/engine/overworld/sprite_collisions.asm @@ -1,10 +1,10 @@ _UpdateSprites:: ld h, $c1 inc h - ld a, $e ; wSpriteStateData2 + $0e + ld a, wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData2 .spriteLoop ld l, a - sub $e + sub wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData2 ld c, a ld [hCurrentSpriteOffset], a ld a, [hl] @@ -20,7 +20,7 @@ _UpdateSprites:: .skipSprite ld a, l add $10 ; move to next sprite - cp $e ; test for overflow (back at $0e) + cp wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData2 ; test for overflow (back at beginning) jr nz, .spriteLoop ret .updateCurrentSprite diff --git a/engine/overworld/trainer_sight.asm b/engine/overworld/trainer_sight.asm index 81978c35..c12c064b 100755 --- a/engine/overworld/trainer_sight.asm +++ b/engine/overworld/trainer_sight.asm @@ -1,6 +1,6 @@ _GetSpritePosition1:: ld hl, wSpriteStateData1 - ld de, $4 + ld de, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld a, [wSpriteIndex] ld [hSpriteIndex], a call GetSpriteDataPointer @@ -9,7 +9,7 @@ _GetSpritePosition1:: inc hl ld a, [hl] ; c1x6 (screen X pos) ld [hSpriteScreenXCoord], a - ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6) + ld de, wSpritePlayerStateData2MapY - wSpritePlayerStateData1XPixels add hl, de ld a, [hli] ; c2x4 (map Y pos) ld [hSpriteMapYCoord], a @@ -19,7 +19,7 @@ _GetSpritePosition1:: _GetSpritePosition2:: ld hl, wSpriteStateData1 - ld de, $4 + ld de, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld a, [wSpriteIndex] ld [hSpriteIndex], a call GetSpriteDataPointer @@ -28,7 +28,7 @@ _GetSpritePosition2:: inc hl ld a, [hl] ; c1x6 (screen X pos) ld [wSavedSpriteScreenX], a - ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6) + ld de, wSpritePlayerStateData2MapY - wSpritePlayerStateData1XPixels add hl, de ld a, [hli] ; c2x4 (map Y pos) ld [wSavedSpriteMapY], a @@ -38,7 +38,7 @@ _GetSpritePosition2:: _SetSpritePosition1:: ld hl, wSpriteStateData1 - ld de, $4 + ld de, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld a, [wSpriteIndex] ld [hSpriteIndex], a call GetSpriteDataPointer @@ -47,7 +47,7 @@ _SetSpritePosition1:: inc hl ld a, [hSpriteScreenXCoord] ; c1x6 (screen X pos) ld [hl], a - ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6) + ld de, wSpritePlayerStateData2MapY - wSpritePlayerStateData1XPixels add hl, de ld a, [hSpriteMapYCoord] ; c2x4 (map Y pos) ld [hli], a @@ -57,7 +57,7 @@ _SetSpritePosition1:: _SetSpritePosition2:: ld hl, wSpriteStateData1 - ld de, 4 + ld de, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld a, [wSpriteIndex] ld [hSpriteIndex], a call GetSpriteDataPointer @@ -66,7 +66,7 @@ _SetSpritePosition2:: inc hl ld a, [wSavedSpriteScreenX] ld [hl], a ; c1x6 (screen X pos) - ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6) + ld de, wSpritePlayerStateData2MapY - wSpritePlayerStateData1XPixels add hl, de ld a, [wSavedSpriteMapY] ld [hli], a ; c2x4 (map Y pos) @@ -165,7 +165,7 @@ TrainerEngage: push hl push de ld a, [wTrainerSpriteOffset] - add $2 + add wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1 ld d, $0 ld e, a ld hl, wSpriteStateData1 @@ -176,7 +176,7 @@ TrainerEngage: jp .noEngage .spriteOnScreen ld a, [wTrainerSpriteOffset] - add $9 + add wSpritePlayerStateData1FacingDirection - wSpritePlayerStateData1 ld d, $0 ld e, a ld hl, wSpriteStateData1 @@ -234,7 +234,7 @@ TrainerEngage: ; reads trainer's Y position to wTrainerScreenY and X position to wTrainerScreenX ReadTrainerScreenPosition: ld a, [wTrainerSpriteOffset] - add $4 + add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld d, $0 ld e, a ld hl, wSpriteStateData1 @@ -242,7 +242,7 @@ ReadTrainerScreenPosition: ld a, [hl] ; c1x4 (sprite Y pos) ld [wTrainerScreenY], a ld a, [wTrainerSpriteOffset] - add $6 + add wSpritePlayerStateData1XPixels - wSpritePlayerStateData1 ld d, $0 ld e, a ld hl, wSpriteStateData1 @@ -295,7 +295,7 @@ CheckPlayerIsInFrontOfSprite: cp POWER_PLANT jp z, .engage ; bypass this for power plant to get voltorb fake items to work ld a, [wTrainerSpriteOffset] - add $4 + add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld d, $0 ld e, a ld hl, wSpriteStateData1 @@ -307,7 +307,7 @@ CheckPlayerIsInFrontOfSprite: .notOnTopmostTile ld [wTrainerScreenY], a ld a, [wTrainerSpriteOffset] - add $6 + add wSpritePlayerStateData1XPixels - wSpritePlayerStateData1 ld d, $0 ld e, a ld hl, wSpriteStateData1 diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 05271e40..7877ada1 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -504,7 +504,7 @@ CableClubLeftGameboy:: ld a, [hSerialConnectionStatus] cp USING_EXTERNAL_CLOCK ret z - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_RIGHT ret nz ld a, [wCurMap] @@ -521,7 +521,7 @@ CableClubRightGameboy:: ld a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK ret z - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_LEFT ret nz ld a, [wCurMap] @@ -538,7 +538,7 @@ JustAMomentText:: text_far _JustAMomentText text_end - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing diff --git a/engine/slots/game_corner_slots2.asm b/engine/slots/game_corner_slots2.asm index f0fba746..a4ba4ec1 100755 --- a/engine/slots/game_corner_slots2.asm +++ b/engine/slots/game_corner_slots2.asm @@ -1,5 +1,5 @@ AbleToPlaySlotsCheck: - ld a, [wSpriteStateData1 + 2] + ld a, [wSpritePlayerStateData1ImageIndex] and $8 jr z, .done ; not able ld b, COIN_CASE diff --git a/home.asm b/home.asm index 0e977d11..c33ab449 100644 --- a/home.asm +++ b/home.asm @@ -111,9 +111,9 @@ ResetPlayerSpriteData:: ld hl, wSpriteStateData2 call ResetPlayerSpriteData_ClearSpriteData ld a, $1 - ld [wSpriteStateData1], a - ld [wSpriteStateData2 + $0e], a - ld hl, wSpriteStateData1 + 4 + ld [wSpritePlayerStateData1PictureID], a + ld [wSpritePlayerStateData2ImageBaseOffset], a + ld hl, wSpritePlayerStateData1YPixels ld [hl], $3c ; set Y screen pos inc hl inc hl @@ -485,7 +485,7 @@ TextScript_PokemonCenterPC:: StartSimulatingJoypadStates:: xor a ld [wOverrideSimulatedJoypadStatesMask], a - ld [wSpriteStateData2 + $06], a ; player's sprite movement byte 1 + ld [wSpritePlayerStateData2MovementByte1], a ld hl, wd730 set 7, [hl] ret @@ -572,7 +572,7 @@ CheckCoords:: ; sets carry if the coordinates are in the array, clears carry if not CheckBoulderCoords:: push hl - ld hl, wSpriteStateData2 + $04 + ld hl, wSpritePlayerStateData2MapY ld a, [hSpriteIndex] swap a ld d, $0 diff --git a/home/overworld.asm b/home/overworld.asm index b17208c7..be4af6ee 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -149,7 +149,7 @@ OverworldLoopLessDelay:: bit 7, a ; down button jr z, .checkIfUpButtonIsPressed ld a, 1 - ld [wSpriteStateData1 + 3], a ; delta Y + ld [wSpritePlayerStateData1YStepVector], a ld a, PLAYER_DIR_DOWN jr .handleDirectionButtonPress @@ -157,7 +157,7 @@ OverworldLoopLessDelay:: bit 6, a ; up button jr z, .checkIfLeftButtonIsPressed ld a, -1 - ld [wSpriteStateData1 + 3], a ; delta Y + ld [wSpritePlayerStateData1YStepVector], a ld a, PLAYER_DIR_UP jr .handleDirectionButtonPress @@ -165,7 +165,7 @@ OverworldLoopLessDelay:: bit 5, a ; left button jr z, .checkIfRightButtonIsPressed ld a, -1 - ld [wSpriteStateData1 + 5], a ; delta X + ld [wSpritePlayerStateData1XStepVector], a ld a, PLAYER_DIR_LEFT jr .handleDirectionButtonPress @@ -173,7 +173,7 @@ OverworldLoopLessDelay:: bit 4, a ; right button jr z, .noDirectionButtonsPressed ld a, 1 - ld [wSpriteStateData1 + 5], a ; delta X + ld [wSpritePlayerStateData1XStepVector], a .handleDirectionButtonPress @@ -1133,7 +1133,7 @@ IsSpriteInFrontOfPlayer:: ld d, $10 ; talking range in pixels (normal range) IsSpriteInFrontOfPlayer2:: lb bc, $3c, $40 ; Y and X position of player sprite - ld a, [wSpriteStateData1 + 9] ; direction the player is facing + ld a, [wSpritePlayerStateData1FacingDirection] .checkIfPlayerFacingUp cp SPRITE_FACING_UP jr nz, .checkIfPlayerFacingDown @@ -1176,7 +1176,7 @@ IsSpriteInFrontOfPlayer2:: and a ret z ; if there are sprites - ld hl, wSpriteStateData1 + $10 + ld hl, wSprite01StateData1 ld d, a ld e, $01 .spriteLoop @@ -1228,7 +1228,7 @@ CollisionCheckOnLand:: jr nz, .noCollision ; no collisions when the player's movements are being controlled by the game ld a, [wPlayerDirection] ; the direction that the player is trying to go in ld d, a - ld a, [wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code) + ld a, [wSpritePlayerStateData1CollisionData] and d ; check if a sprite is in the direction the player is trying to go jr nz, .collision xor a @@ -1462,9 +1462,9 @@ LoadCurrentMapView:: ret AdvancePlayerSprite:: - ld a, [wSpriteStateData1 + 3] ; delta Y + ld a, [wSpritePlayerStateData1YStepVector] ld b, a - ld a, [wSpriteStateData1 + 5] ; delta X + ld a, [wSpritePlayerStateData1XStepVector] ld c, a ld hl, wWalkCounter ; walking animation counter dec [hl] @@ -1596,7 +1596,7 @@ AdvancePlayerSprite:: call MoveTileBlockMapPointerNorth .updateMapView call LoadCurrentMapView - ld a, [wSpriteStateData1 + 3] ; delta Y + ld a, [wSpritePlayerStateData1YStepVector] cp $01 jr nz, .checkIfMovingNorth2 ; if moving south @@ -1609,7 +1609,7 @@ AdvancePlayerSprite:: call ScheduleNorthRowRedraw jr .scrollBackgroundAndSprites .checkIfMovingEast2 - ld a, [wSpriteStateData1 + 5] ; delta X + ld a, [wSpritePlayerStateData1XStepVector] cp $01 jr nz, .checkIfMovingWest2 ; if moving east @@ -1621,9 +1621,9 @@ AdvancePlayerSprite:: ; if moving west call ScheduleWestColumnRedraw .scrollBackgroundAndSprites - ld a, [wSpriteStateData1 + 3] ; delta Y + ld a, [wSpritePlayerStateData1YStepVector] ld b, a - ld a, [wSpriteStateData1 + 5] ; delta X + ld a, [wSpritePlayerStateData1XStepVector] ld c, a sla b sla c @@ -1635,7 +1635,7 @@ AdvancePlayerSprite:: ld [hSCX], a ; update background scroll X ; shift all the sprites in the direction opposite of the player's motion ; so that the player appears to move relative to them - ld hl, wSpriteStateData1 + $14 + ld hl, wSprite01StateData1YPixels ld a, [wNumSprites] ; number of sprites and a ; are there any sprites? jr z, .done @@ -1845,8 +1845,8 @@ DrawTileBlock:: ; function to update joypad state and simulate button presses JoypadOverworld:: xor a - ld [wSpriteStateData1 + 3], a - ld [wSpriteStateData1 + 5], a + ld [wSpritePlayerStateData1YStepVector], a + ld [wSpritePlayerStateData1XStepVector], a call RunMapScript call Joypad ld a, [wFlags_D733] @@ -1920,7 +1920,7 @@ CollisionCheckOnWater:: jp nz, .noCollision ; return and clear carry if button presses are being simulated ld a, [wPlayerDirection] ; the direction that the player is trying to go in ld d, a - ld a, [wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code) + ld a, [wSpritePlayerStateData1CollisionData] and d ; check if a sprite is in the direction the player is trying to go jr nz, .checkIfNextTileIsPassable ; bug? ld hl, TilePairCollisionsWater @@ -2168,8 +2168,8 @@ LoadMapHeader:: ld [wNumSprites], a ; save the number of sprites push hl ; zero C110-C1FF and C210-C2FF - ld hl, wSpriteStateData1 + $10 - ld de, wSpriteStateData2 + $10 + ld hl, wSprite01StateData1 + ld de, wSprite01StateData2 xor a ld b, $f0 .zeroSpriteDataLoop @@ -2179,7 +2179,7 @@ LoadMapHeader:: dec b jr nz, .zeroSpriteDataLoop ; initialize all C100-C1FF sprite entries to disabled (other than player's) - ld hl, wSpriteStateData1 + $12 + ld hl, wSprite01StateData1ImageIndex ld de, $10 ld c, $0f .disableSpriteEntriesLoop @@ -2188,7 +2188,7 @@ LoadMapHeader:: dec c jr nz, .disableSpriteEntriesLoop pop hl - ld de, wSpriteStateData1 + $10 + ld de, wSprite01StateData1 ld a, [wNumSprites] ; number of sprites and a ; are there any sprites? jp z, .finishUp ; if there are no sprites, skip the rest diff --git a/home/text_script.asm b/home/text_script.asm index 8bfe0927..2dd2dbde 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -111,7 +111,7 @@ CloseTextDisplay:: xor a ld [hAutoBGTransferEnabled], a ; disable continuous WRAM to VRAM transfer each V-blank ; loop to make sprites face the directions they originally faced before the dialogue - ld hl, wSpriteStateData2 + $19 + ld hl, wSprite01StateData2 + 9 ; should be wSprite01StateData1FacingDirection? ld c, $0f ld de, $10 .restoreSpriteFacingDirectionLoop diff --git a/macros/wram.asm b/macros/wram.asm index 7a9b4a6a..62464543 100644 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -71,7 +71,9 @@ spritestatedata1: MACRO \1IntraAnimFrameCounter:: db \1AnimFrameCounter:: db \1FacingDirection:: db - ds 6 + ds 2 +\1CollisionData:: db + ds 3 \1End:: ENDM @@ -85,7 +87,8 @@ spritestatedata2: MACRO \1MovementByte1:: db \1GrassPriority:: db \1MovementDelay:: db - ds 5 + ds 4 +\1PictureID:: db \1ImageBaseOffset:: db ds 1 \1End:: diff --git a/scripts/BillsHouse.asm b/scripts/BillsHouse.asm index c1948ae4..3601c0b6 100755 --- a/scripts/BillsHouse.asm +++ b/scripts/BillsHouse.asm @@ -16,7 +16,7 @@ BillsHouseScript0: ret BillsHouseScript1: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] and a ; cp SPRITE_FACING_DOWN ld de, MovementData_1e79c jr nz, .notDown diff --git a/scripts/CeruleanCity.asm b/scripts/CeruleanCity.asm index 410ed485..0c3e10cf 100755 --- a/scripts/CeruleanCity.asm +++ b/scripts/CeruleanCity.asm @@ -50,7 +50,7 @@ CeruleanCityScript0: .asm_194e6 ld [wPlayerMovingDirection], a ld a, b - ld [wSpriteStateData1 + 2 * $10 + $9], a + ld [wSprite02StateData1FacingDirection], a call Delay3 ld a, $2 ld [hSpriteIndexOrTextID], a diff --git a/scripts/CinnabarIsland.asm b/scripts/CinnabarIsland.asm index 9934d06f..54bbe1d8 100755 --- a/scripts/CinnabarIsland.asm +++ b/scripts/CinnabarIsland.asm @@ -35,7 +35,7 @@ CinnabarIslandScript0: ld [wSimulatedJoypadStatesEnd], a call StartSimulatingJoypadStates xor a - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a ld [wJoyIgnore], a ld a, $1 ld [wCinnabarIslandCurScript], a diff --git a/scripts/CopycatsHouse2F.asm b/scripts/CopycatsHouse2F.asm index 959aa249..9f28496a 100755 --- a/scripts/CopycatsHouse2F.asm +++ b/scripts/CopycatsHouse2F.asm @@ -84,7 +84,7 @@ CopycatsHouse2FText6: CopycatsHouse2FText7: text_asm - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ld hl, CopycatsHouse2FText_5cd1c jr nz, .notUp diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm index a890f44e..01196d7c 100755 --- a/scripts/OaksLab.asm +++ b/scripts/OaksLab.asm @@ -492,17 +492,17 @@ OaksLabScript14: cp $4 jr nz, .turnPlayerLeft ld a, SPRITE_FACING_RIGHT - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a jr .done .turnPlayerLeft ld a, SPRITE_FACING_LEFT - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a jr .done .turnPlayerDown cp $4 ret nz xor a ; ld a, SPRITE_FACING_DOWN - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a .done ret diff --git a/scripts/PalletTown.asm b/scripts/PalletTown.asm index 579e8cd8..e063e0c8 100755 --- a/scripts/PalletTown.asm +++ b/scripts/PalletTown.asm @@ -94,7 +94,7 @@ PalletTownScript3: bit 0, a ret nz xor a ; ld a, SPRITE_FACING_DOWN - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a ld a, 1 ld [wcf0d], a ld a, $FC diff --git a/scripts/PokemonMansion1F.asm b/scripts/PokemonMansion1F.asm index d369e992..d8f3728c 100755 --- a/scripts/PokemonMansion1F.asm +++ b/scripts/PokemonMansion1F.asm @@ -46,7 +46,7 @@ Mansion1ReplaceBlock: ret Mansion1Script_Switches:: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz xor a diff --git a/scripts/PokemonMansion2F.asm b/scripts/PokemonMansion2F.asm index 3ddc28a5..e560d6bd 100755 --- a/scripts/PokemonMansion2F.asm +++ b/scripts/PokemonMansion2F.asm @@ -42,7 +42,7 @@ Mansion2Script_5202f: predef_jump ReplaceTileBlock Mansion2Script_Switches:: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz xor a diff --git a/scripts/PokemonMansion3F.asm b/scripts/PokemonMansion3F.asm index a04c3b1f..ad346702 100755 --- a/scripts/PokemonMansion3F.asm +++ b/scripts/PokemonMansion3F.asm @@ -73,7 +73,7 @@ Mansion3Script_5225b: ret Mansion3Script_Switches:: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz xor a diff --git a/scripts/PokemonMansionB1F.asm b/scripts/PokemonMansionB1F.asm index 99e866d8..aa7123f0 100755 --- a/scripts/PokemonMansionB1F.asm +++ b/scripts/PokemonMansionB1F.asm @@ -44,7 +44,7 @@ Mansion4Script_523cf: ret Mansion4Script_Switches:: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ret nz xor a diff --git a/scripts/PokemonTower6F.asm b/scripts/PokemonTower6F.asm index 2590e70f..a6ae22ec 100755 --- a/scripts/PokemonTower6F.asm +++ b/scripts/PokemonTower6F.asm @@ -75,7 +75,7 @@ PokemonTower6Script4: ld a, $10 ld [wSimulatedJoypadStatesEnd], a xor a - ld [wSpriteStateData2 + $06], a + ld [wSpritePlayerStateData2MovementByte1], a ld [wOverrideSimulatedJoypadStatesMask], a ld hl, wd730 set 7, [hl] diff --git a/scripts/PokemonTower7F.asm b/scripts/PokemonTower7F.asm index 498b8c8f..3f16ca92 100755 --- a/scripts/PokemonTower7F.asm +++ b/scripts/PokemonTower7F.asm @@ -70,7 +70,7 @@ PokemonTower7Script4: ld [wMissableObjectIndex], a predef HideObject ld a, SPRITE_FACING_UP - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a ld a, MR_FUJIS_HOUSE ld [hWarpDestinationMap], a ld a, $1 diff --git a/scripts/RedsHouse1F.asm b/scripts/RedsHouse1F.asm index cb071537..9f45a760 100755 --- a/scripts/RedsHouse1F.asm +++ b/scripts/RedsHouse1F.asm @@ -51,7 +51,7 @@ MomHealText2: RedsHouse1FText2: ; TV text_asm - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ld hl, TVWrongSideText jr nz, .notUp diff --git a/scripts/RocketHideoutB2F.asm b/scripts/RocketHideoutB2F.asm index 23eca790..7a43e90e 100755 --- a/scripts/RocketHideoutB2F.asm +++ b/scripts/RocketHideoutB2F.asm @@ -314,7 +314,7 @@ RocketHideout2Script3: ret LoadSpinnerArrowTiles:: - ld a, [wSpriteStateData1 + 2] + ld a, [wSpritePlayerStateData1ImageIndex] srl a srl a ld hl, SpinnerPlayerFacingDirections @@ -322,7 +322,7 @@ LoadSpinnerArrowTiles:: ld b, $0 add hl, bc ld a, [hl] - ld [wSpriteStateData1 + 2], a + ld [wSpritePlayerStateData1ImageIndex], a ld a, [wCurMapTileset] cp FACILITY ld hl, FacilitySpinnerArrows diff --git a/scripts/Route11Gate2F.asm b/scripts/Route11Gate2F.asm index f888d72f..1fefc824 100755 --- a/scripts/Route11Gate2F.asm +++ b/scripts/Route11Gate2F.asm @@ -47,7 +47,7 @@ Route11GateUpstairsText_494a3: Route11GateUpstairsText3: text_asm - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP jp nz, GateUpstairsScript_PrintIfFacingUp CheckEvent EVENT_BEAT_ROUTE12_SNORLAX diff --git a/scripts/Route12Gate2F.asm b/scripts/Route12Gate2F.asm index 6409a24b..ff4bf2b2 100755 --- a/scripts/Route12Gate2F.asm +++ b/scripts/Route12Gate2F.asm @@ -65,7 +65,7 @@ Route12GateUpstairsText_495c4: text_end GateUpstairsScript_PrintIfFacingUp: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP jr z, .up ld a, $1 diff --git a/scripts/Route22.asm b/scripts/Route22.asm index 8771ad0e..b6970ef0 100755 --- a/scripts/Route22.asm +++ b/scripts/Route22.asm @@ -149,7 +149,7 @@ Route22Script2: ld a, [wIsInBattle] cp $ff jp z, Route22Script_50ece - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] and a ; cp SPRITE_FACING_DOWN jr nz, .notDown ld a, SPRITE_FACING_UP diff --git a/scripts/Route22Gate.asm b/scripts/Route22Gate.asm index b7fcc8f5..e2311b95 100755 --- a/scripts/Route22Gate.asm +++ b/scripts/Route22Gate.asm @@ -37,7 +37,7 @@ Route22GateScript_1e6ba: ld [wSimulatedJoypadStatesIndex], a ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a ld [wJoyIgnore], a jp StartSimulatingJoypadStates diff --git a/scripts/Route23.asm b/scripts/Route23.asm index e8bc5475..b617992b 100755 --- a/scripts/Route23.asm +++ b/scripts/Route23.asm @@ -118,7 +118,7 @@ Route23Script_512d8: ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a xor a - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a ld [wJoyIgnore], a jp StartSimulatingJoypadStates diff --git a/scripts/Route6Gate.asm b/scripts/Route6Gate.asm index 6b00eddb..6e9dd4b3 100755 --- a/scripts/Route6Gate.asm +++ b/scripts/Route6Gate.asm @@ -60,7 +60,7 @@ Route6GateScript_1e0a1: ld a, $1 ld [wSimulatedJoypadStatesIndex], a xor a - ld [wSpriteStateData2 + $06], a + ld [wSpritePlayerStateData2MovementByte1], a ld [wOverrideSimulatedJoypadStatesMask], a ret diff --git a/scripts/Route7Gate.asm b/scripts/Route7Gate.asm index 06c5c91b..00d7472f 100755 --- a/scripts/Route7Gate.asm +++ b/scripts/Route7Gate.asm @@ -17,7 +17,7 @@ Route7GateScript_1e111: ld a, $1 ld [wSimulatedJoypadStatesIndex], a xor a - ld [wSpriteStateData2 + $06], a + ld [wSpritePlayerStateData2MovementByte1], a ld [wOverrideSimulatedJoypadStatesMask], a ret diff --git a/scripts/Route8Gate.asm b/scripts/Route8Gate.asm index 80b8b9a4..d3003c4d 100755 --- a/scripts/Route8Gate.asm +++ b/scripts/Route8Gate.asm @@ -16,7 +16,7 @@ Route8GateScript_1e1d7: ld a, $1 ld [wSimulatedJoypadStatesIndex], a xor a - ld [wSpriteStateData2 + $06], a + ld [wSpritePlayerStateData2MovementByte1], a ld [wOverrideSimulatedJoypadStatesMask], a ret diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm index 6f8299fc..76f4faa6 100755 --- a/scripts/SafariZoneGate.asm +++ b/scripts/SafariZoneGate.asm @@ -25,7 +25,7 @@ SafariZoneGate_ScriptPointers: xor a ld [hJoyHeld], a ld a, SPRITE_FACING_RIGHT - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a ld a, [wCoordIndex] cp $1 jr z, .asm_7520f @@ -231,7 +231,7 @@ SafariZoneGate_TextPointers: ld hl, .SafariZoneEntranceText_753bb call PrintText xor a - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a ld a, D_DOWN ld c, $3 call SafariZoneEntranceAutoWalk @@ -243,7 +243,7 @@ SafariZoneGate_TextPointers: ld hl, .SafariZoneEntranceText_753c0 call PrintText ld a, SPRITE_FACING_UP - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a ld a, D_UP ld c, $1 call SafariZoneEntranceAutoWalk diff --git a/scripts/SeafoamIslandsB3F.asm b/scripts/SeafoamIslandsB3F.asm index c8fec338..7d0e032b 100755 --- a/scripts/SeafoamIslandsB3F.asm +++ b/scripts/SeafoamIslandsB3F.asm @@ -109,7 +109,7 @@ SeafoamIslands4Script2: dec a ld [wSimulatedJoypadStatesIndex], a xor a - ld [wSpriteStateData2 + $06], a + ld [wSpritePlayerStateData2MovementByte1], a ld hl, wd730 set 7, [hl] ld hl, wFlags_D733 diff --git a/scripts/TradeCenter.asm b/scripts/TradeCenter.asm index 3a1a10f3..e7fa8ac8 100755 --- a/scripts/TradeCenter.asm +++ b/scripts/TradeCenter.asm @@ -14,20 +14,20 @@ TradeCenter_Script: bit 0, [hl] set 0, [hl] ret nz - ld hl, wSpriteStateData2 + $14 + ld hl, wSprite01StateData2MapY ld a, $8 ld [hli], a ld a, $a ld [hl], a ld a, SPRITE_FACING_LEFT - ld [wSpriteStateData1 + $19], a + ld [wSprite01StateData1FacingDirection], a ld a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK ret z ld a, $7 - ld [wSpriteStateData2 + $15], a + ld [wSprite01StateData2MapX], a ld a, SPRITE_FACING_RIGHT - ld [wSpriteStateData1 + $19], a + ld [wSprite01StateData1FacingDirection], a ret TradeCenter_TextPointers: diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm index 9f0e8139..127ee16a 100755 --- a/scripts/VermilionCity.asm +++ b/scripts/VermilionCity.asm @@ -38,7 +38,7 @@ VermilionCity_ScriptPointers: dw VermilionCityScript4 VermilionCityScript0: - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] and a ; cp SPRITE_FACING_DOWN ret nz ld hl, SSAnneTicketCheckCoords @@ -157,7 +157,7 @@ VermilionCityText3: text_asm CheckEvent EVENT_SS_ANNE_LEFT jr nz, .shipHasDeparted - ld a, [wSpriteStateData1 + 9] + ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_RIGHT jr z, .greetPlayer ld hl, .inFrontOfOrBehindGuardCoords diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm index 3f520cfb..2c39bdb8 100755 --- a/scripts/VermilionDock.asm +++ b/scripts/VermilionDock.asm @@ -21,7 +21,7 @@ VermilionDock_Script: ld a, $3 ld [wSimulatedJoypadStatesIndex], a xor a - ld [wSpriteStateData2 + $06], a + ld [wSpritePlayerStateData2MovementByte1], a ld [wOverrideSimulatedJoypadStatesMask], a dec a ld [wJoyIgnore], a @@ -47,7 +47,7 @@ VermilionDock_1db9b: call PlayMusic callba LoadSmokeTileFourTimes xor a - ld [wSpriteStateData1 + 2], a + ld [wSpritePlayerStateData1ImageIndex], a ld c, 120 call DelayFrames ld b, $9c diff --git a/scripts/ViridianCity.asm b/scripts/ViridianCity.asm index 7c4d9c97..20594974 100755 --- a/scripts/ViridianCity.asm +++ b/scripts/ViridianCity.asm @@ -120,7 +120,7 @@ ViridianCityScript_190cf: ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a xor a - ld [wSpriteStateData1 + 9], a + ld [wSpritePlayerStateData1FacingDirection], a ld [wJoyIgnore], a ret -- cgit v1.3.1-sl0p