From 772fcc7588a4e1fbe146a02b429cf64282c81dcb Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 6 Jul 2020 19:03:05 -0400 Subject: Specify the ldh instruction, don't turn ld into ldh --- scripts/AgathasRoom.asm | 8 +-- scripts/BikeShop.asm | 2 +- scripts/BillsHouse.asm | 14 ++--- scripts/BrunosRoom.asm | 8 +-- scripts/CeladonGym.asm | 8 +-- scripts/CeladonMartRoof.asm | 6 +- scripts/CeruleanCity.asm | 32 +++++------ scripts/CeruleanGym.asm | 10 ++-- scripts/ChampionsRoom.asm | 38 ++++++------- scripts/CinnabarGym.asm | 18 +++--- scripts/CinnabarIsland.asm | 4 +- scripts/CopycatsHouse2F.asm | 2 +- scripts/Daycare.asm | 12 ++-- scripts/FightingDojo.asm | 16 +++--- scripts/FuchsiaGym.asm | 10 ++-- scripts/GameCorner.asm | 56 +++++++++---------- scripts/HallOfFame.asm | 6 +- scripts/LancesRoom.asm | 6 +- scripts/LoreleisRoom.asm | 8 +-- scripts/MtMoonB2F.asm | 12 ++-- scripts/MtMoonPokecenter.asm | 6 +- scripts/Museum1F.asm | 12 ++-- scripts/OaksLab.asm | 126 +++++++++++++++++++++--------------------- scripts/PalletTown.asm | 18 +++--- scripts/PewterCity.asm | 48 ++++++++-------- scripts/PewterGym.asm | 10 ++-- scripts/PokemonMansion1F.asm | 4 +- scripts/PokemonMansion2F.asm | 4 +- scripts/PokemonMansion3F.asm | 4 +- scripts/PokemonMansionB1F.asm | 4 +- scripts/PokemonTower2F.asm | 14 ++--- scripts/PokemonTower5F.asm | 4 +- scripts/PokemonTower6F.asm | 6 +- scripts/PokemonTower7F.asm | 6 +- scripts/RedsHouse2F.asm | 2 +- scripts/RocketHideoutB4F.asm | 6 +- scripts/Route11Gate2F.asm | 6 +- scripts/Route12.asm | 4 +- scripts/Route15Gate2F.asm | 6 +- scripts/Route16.asm | 4 +- scripts/Route16Gate1F.asm | 6 +- scripts/Route18Gate1F.asm | 6 +- scripts/Route22.asm | 36 ++++++------ scripts/Route22Gate.asm | 4 +- scripts/Route23.asm | 4 +- scripts/Route24.asm | 10 ++-- scripts/Route2Gate.asm | 6 +- scripts/Route5Gate.asm | 10 ++-- scripts/Route6Gate.asm | 8 +-- scripts/Route7Gate.asm | 8 +-- scripts/Route8Gate.asm | 8 +-- scripts/SSAnne2F.asm | 20 +++---- scripts/SSAnneKitchen.asm | 2 +- scripts/SafariZoneGate.asm | 18 +++--- scripts/SaffronGym.asm | 8 +-- scripts/SilphCo10F.asm | 2 +- scripts/SilphCo11F.asm | 22 ++++---- scripts/SilphCo2F.asm | 6 +- scripts/SilphCo3F.asm | 2 +- scripts/SilphCo4F.asm | 6 +- scripts/SilphCo5F.asm | 2 +- scripts/SilphCo6F.asm | 2 +- scripts/SilphCo7F.asm | 24 ++++---- scripts/SilphCo8F.asm | 6 +- scripts/SilphCo9F.asm | 6 +- scripts/TradeCenter.asm | 8 +-- scripts/VermilionCity.asm | 8 +-- scripts/VermilionDock.asm | 18 +++--- scripts/VermilionGym.asm | 10 ++-- scripts/ViridianCity.asm | 26 ++++----- scripts/ViridianGym.asm | 8 +-- scripts/ViridianMart.asm | 4 +- scripts/WardensHouse.asm | 4 +- 73 files changed, 444 insertions(+), 444 deletions(-) (limited to 'scripts') diff --git a/scripts/AgathasRoom.asm b/scripts/AgathasRoom.asm index 6d304de8..b49b2a2b 100755 --- a/scripts/AgathasRoom.asm +++ b/scripts/AgathasRoom.asm @@ -63,8 +63,8 @@ AgathaScript0: call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [hJoyPressed], a - ld [hJoyHeld], a + ldh [hJoyPressed], a + ldh [hJoyHeld], a ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesIndex], a ld a, [wCoordIndex] @@ -74,7 +74,7 @@ AgathaScript0: jr z, AgathaScriptWalkIntoRoom .stopPlayerFromLeaving ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ; "Don't run away!" ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -110,7 +110,7 @@ AgathaScript2: cp $ff jp z, ResetAgathaScript ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [wChampionsRoomCurScript], a diff --git a/scripts/BikeShop.asm b/scripts/BikeShop.asm index 07e96c1b..338381e9 100755 --- a/scripts/BikeShop.asm +++ b/scripts/BikeShop.asm @@ -23,7 +23,7 @@ BikeShopText1: call GiveItem jr nc, .BagFull ld a, BIKE_VOUCHER - ld [hItemToRemoveID], a + ldh [hItemToRemoveID], a callba RemoveItemByID SetEvent EVENT_GOT_BICYCLE ld hl, BikeShopText_1d824 diff --git a/scripts/BillsHouse.asm b/scripts/BillsHouse.asm index 3601c0b6..3edfdf5b 100755 --- a/scripts/BillsHouse.asm +++ b/scripts/BillsHouse.asm @@ -23,7 +23,7 @@ BillsHouseScript1: ld de, MovementData_1e7a0 .notDown ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $2 ld [wBillsHouseCurScript], a @@ -66,13 +66,13 @@ BillsHouseScript3: ld a, $2 ld [wSpriteIndex], a ld a, $c - ld [hSpriteScreenYCoord], a + ldh [hSpriteScreenYCoord], a ld a, $40 - ld [hSpriteScreenXCoord], a + ldh [hSpriteScreenXCoord], a ld a, $6 - ld [hSpriteMapYCoord], a + ldh [hSpriteMapYCoord], a ld a, $5 - ld [hSpriteMapXCoord], a + ldh [hSpriteMapXCoord], a call SetSpritePosition1 ld a, HS_BILL_1 ld [wMissableObjectIndex], a @@ -80,7 +80,7 @@ BillsHouseScript3: ld c, 8 call DelayFrames ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld de, MovementData_1e807 call MoveSprite ld a, $4 @@ -109,7 +109,7 @@ BillsHouseScript4: BillsHouseScript5: ld a, $4 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $0 ld [wBillsHouseCurScript], a diff --git a/scripts/BrunosRoom.asm b/scripts/BrunosRoom.asm index 85cd86af..d7254c97 100755 --- a/scripts/BrunosRoom.asm +++ b/scripts/BrunosRoom.asm @@ -63,8 +63,8 @@ BrunoScript0: call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [hJoyPressed], a - ld [hJoyHeld], a + ldh [hJoyPressed], a + ldh [hJoyHeld], a ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesIndex], a ld a, [wCoordIndex] @@ -74,7 +74,7 @@ BrunoScript0: jr z, BrunoScriptWalkIntoRoom .stopPlayerFromLeaving ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ; "Don't run away!" ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -110,7 +110,7 @@ BrunoScript2: cp $ff jp z, ResetBrunoScript ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID BrunosRoom_TextPointers: diff --git a/scripts/CeladonGym.asm b/scripts/CeladonGym.asm index 4af9d146..21ba65d9 100755 --- a/scripts/CeladonGym.asm +++ b/scripts/CeladonGym.asm @@ -44,20 +44,20 @@ CeladonGymScript3: CeladonGymText_48963: ld a, $9 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_ERIKA lb bc, TM_MEGA_DRAIN, 1 call GiveItem jr nc, .BagFull ld a, $a - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_TM21 jr .gymVictory .BagFull ld a, $b - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges @@ -170,7 +170,7 @@ CeladonGymText1: ld hl, CeladonGymText_48a63 ld de, CeladonGymText_48a63 call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/CeladonMartRoof.asm b/scripts/CeladonMartRoof.asm index f38bb984..06a8390a 100755 --- a/scripts/CeladonMartRoof.asm +++ b/scripts/CeladonMartRoof.asm @@ -79,7 +79,7 @@ CeladonMartRoofScript_GiveDrinkToGirl: ld e, a add hl, de ld a, [hl] - ld [hItemToRemoveID], a + ldh [hItemToRemoveID], a cp FRESH_WATER jr z, .gaveFreshWater cp SODA_POP @@ -186,7 +186,7 @@ CeladonMartRoofText_4852c: CeladonMartRoofScript_PrintDrinksInBag: ld hl, wFilteredBagItems xor a - ld [hItemCounter], a + ldh [hItemCounter], a .loop ld a, [hli] cp $ff @@ -195,7 +195,7 @@ CeladonMartRoofScript_PrintDrinksInBag: ld [wd11e], a call GetItemName coord hl, 2, 2 - ld a, [hItemCounter] + ldh a, [hItemCounter] ld bc, SCREEN_WIDTH * 2 call AddNTimes ld de, wcd6d diff --git a/scripts/CeruleanCity.asm b/scripts/CeruleanCity.asm index bda53667..656c3a4d 100755 --- a/scripts/CeruleanCity.asm +++ b/scripts/CeruleanCity.asm @@ -27,7 +27,7 @@ CeruleanCityScript4: ld [wJoyIgnore], a SetEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -53,7 +53,7 @@ CeruleanCityScript0: ld [wSprite02StateData1FacingDirection], a call Delay3 ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID .asm_194f7 CheckEvent EVENT_BEAT_CERULEAN_RIVAL @@ -72,16 +72,16 @@ CeruleanCityScript0: ld a, MUSIC_MEET_RIVAL call PlayMusic xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $f0 ld [wJoyIgnore], a ld a, [wXCoord] cp $14 jr z, .asm_19535 ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, $5 - ld [hSpriteDataOffset], a + ldh [hSpriteDataOffset], a call GetPointerWithinSpriteStateData2 ld [hl], $19 .asm_19535 @@ -90,7 +90,7 @@ CeruleanCityScript0: predef ShowObject ld de, CeruleanCityMovement1 ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $1 ld [wCeruleanCityCurScript], a @@ -114,9 +114,9 @@ CeruleanCityMovement1: CeruleanCityScript_1955d: ld a, 1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a ; SPRITE_FACING_DOWN - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a jp SetSpriteFacingDirectionAndDelay ; face object CeruleanCityScript1: @@ -126,7 +126,7 @@ CeruleanCityScript1: xor a ld [wJoyIgnore], a ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd72d set 6, [hl] @@ -154,7 +154,7 @@ CeruleanCityScript1: ld [wTrainerNo], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a call CeruleanCityScript_1955d ld a, $2 ld [wCeruleanCityCurScript], a @@ -169,14 +169,14 @@ CeruleanCityScript2: ld [wJoyIgnore], a SetEvent EVENT_BEAT_CERULEAN_RIVAL ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound callba Music_RivalAlternateStart ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld a, [wXCoord] cp $14 @@ -187,7 +187,7 @@ CeruleanCityScript2: ld de, CeruleanCityMovement3 .asm_195f3 ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $3 ld [wCeruleanCityCurScript], a @@ -289,7 +289,7 @@ CeruleanCityText2: ld hl, CeruleanCityText_196ee ld de, CeruleanCityText_196ee call SaveEndBattleTextPointers - ld a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndexOrTextID] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters @@ -356,7 +356,7 @@ CeruleanCityText6: CeruleanCityText7: text_asm - ld a, [hRandomAdd] + ldh a, [hRandomAdd] cp 180 jr c, .asm_e9fc9 ld hl, CeruleanCityText_19730 @@ -388,7 +388,7 @@ CeruleanCityText_1973a: CeruleanCityText8: text_asm - ld a, [hRandomAdd] + ldh a, [hRandomAdd] cp 180 jr c, .asm_e28da ld hl, CeruleanCityText_1976f diff --git a/scripts/CeruleanGym.asm b/scripts/CeruleanGym.asm index 14363066..ef3c96f5 100755 --- a/scripts/CeruleanGym.asm +++ b/scripts/CeruleanGym.asm @@ -44,20 +44,20 @@ CeruleanGymScript3: CeruleanGymScript_5c70d: ld a, $5 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_MISTY lb bc, TM_BUBBLEBEAM, 1 call GiveItem jr nc, .BagFull ld a, $6 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_TM11 jr .gymVictory .BagFull ld a, $7 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges @@ -121,14 +121,14 @@ CeruleanGymText1: ld hl, CeruleanGymText_5c7d8 ld de, CeruleanGymText_5c7d8 call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $2 ld [wGymLeaderNo], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $3 ld [wCeruleanGymCurScript], a .done diff --git a/scripts/ChampionsRoom.asm b/scripts/ChampionsRoom.asm index ef6ff8fb..53dd9d4e 100755 --- a/scripts/ChampionsRoom.asm +++ b/scripts/ChampionsRoom.asm @@ -55,7 +55,7 @@ GaryScript2: ld hl, wOptions res 7, [hl] ; Turn on battle animations to make the battle feel more epic. ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld hl, wd72d @@ -84,7 +84,7 @@ GaryScript2: ld [wTrainerNo], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $3 ld [wChampionsRoomCurScript], a ret @@ -98,10 +98,10 @@ GaryScript3: ld a, $f0 ld [wJoyIgnore], a ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call GaryScript_760c8 ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld a, $4 ld [wChampionsRoomCurScript], a @@ -110,14 +110,14 @@ GaryScript3: GaryScript4: callba Music_Cities1AlternateTempo ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call GaryScript_760c8 ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld de, OakEntranceAfterVictoryMovement ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, HS_CHAMPIONS_ROOM_OAK ld [wMissableObjectIndex], a @@ -141,17 +141,17 @@ GaryScript5: ld a, PLAYER_DIR_LEFT ld [wPlayerMovingDirection], a ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_LEFT - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a ; SPRITE_FACING_DOWN - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call GaryScript_760c8 ld a, $6 ld [wChampionsRoomCurScript], a @@ -159,12 +159,12 @@ GaryScript5: GaryScript6: ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_RIGHT - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $4 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call GaryScript_760c8 ld a, $7 ld [wChampionsRoomCurScript], a @@ -172,16 +172,16 @@ GaryScript6: GaryScript7: ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a ; SPRITE_FACING_DOWN - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $5 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call GaryScript_760c8 ld de, OakExitGaryRoomMovement ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $8 ld [wChampionsRoomCurScript], a diff --git a/scripts/CinnabarGym.asm b/scripts/CinnabarGym.asm index 2aa61135..9318c775 100755 --- a/scripts/CinnabarGym.asm +++ b/scripts/CinnabarGym.asm @@ -36,7 +36,7 @@ CinnabarGymScript_75792: ret CinnabarGymScript_757a0: - ld a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndexOrTextID] ld [wTrainerHeaderFlagBit], a ret @@ -50,7 +50,7 @@ CinnabarGymScript0: ld a, [wOpponentAfterWrongAnswer] and a ret z - ld [hSpriteIndex], a + ldh [hSpriteIndex], a cp $4 jr nz, .asm_757c3 ld a, PLAYER_DIR_DOWN @@ -85,7 +85,7 @@ CinnabarGymScript1: ld [wJoyIgnore], a ld a, [wOpponentAfterWrongAnswer] ld [wTrainerHeaderFlagBit], a - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID CinnabarGymFlagAction: @@ -96,7 +96,7 @@ CinnabarGymScript2: cp $ff jp z, CinnabarGymScript_75792 ld a, [wTrainerHeaderFlagBit] - ld [hGymGateIndex], a + ldh [hGymGateIndex], a AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 ld c, a ld b, FLAG_TEST @@ -111,7 +111,7 @@ CinnabarGymScript2: call WaitForSoundToFinish .asm_7581b ld a, [wTrainerHeaderFlagBit] - ld [hGymGateIndex], a + ldh [hGymGateIndex], a AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 ld c, a ld b, FLAG_SET @@ -141,20 +141,20 @@ CinnabarGymScript3: ld [wJoyIgnore], a CinnabarGymScript3_75857: ld a, $a - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_BLAINE lb bc, TM_FIRE_BLAST, 1 call GiveItem jr nc, .BagFull ld a, $b - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_TM38 jr .gymVictory .BagFull ld a, $c - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges @@ -185,7 +185,7 @@ CinnabarGym_TextPointers: dw TM38NoRoomText CinnabarGymScript_758b7: - ld a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndexOrTextID] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/CinnabarIsland.asm b/scripts/CinnabarIsland.asm index 54bbe1d8..f74890e8 100755 --- a/scripts/CinnabarIsland.asm +++ b/scripts/CinnabarIsland.asm @@ -25,10 +25,10 @@ CinnabarIslandScript0: ld a, PLAYER_DIR_UP ld [wPlayerMovingDirection], a ld a, $8 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $1 ld [wSimulatedJoypadStatesIndex], a ld a, D_DOWN diff --git a/scripts/CopycatsHouse2F.asm b/scripts/CopycatsHouse2F.asm index 580d9b11..b885baab 100755 --- a/scripts/CopycatsHouse2F.asm +++ b/scripts/CopycatsHouse2F.asm @@ -29,7 +29,7 @@ CopycatsHouse2FText1: ld hl, ReceivedTM31Text call PrintText ld a, POKE_DOLL - ld [hItemToRemoveID], a + ldh [hItemToRemoveID], a callba RemoveItemByID SetEvent EVENT_GOT_TM31 jr .asm_62ecd diff --git a/scripts/Daycare.asm b/scripts/Daycare.asm index 4c9e2a85..9fc8f3c4 100755 --- a/scripts/Daycare.asm +++ b/scripts/Daycare.asm @@ -73,11 +73,11 @@ DayCareMText1: ld d, MAX_LEVEL callab CalcExperience ld hl, wDayCareMonExp - ld a, [hExperience] + ldh a, [hExperience] ld [hli], a - ld a, [hExperience + 1] + ldh a, [hExperience + 1] ld [hli], a - ld a, [hExperience + 2] + ldh a, [hExperience + 2] ld [hl], a ld d, MAX_LEVEL @@ -138,11 +138,11 @@ DayCareMText1: and a jp nz, .leaveMonInDayCare ld hl, wDayCareTotalCost - ld [hMoney], a + ldh [hMoney], a ld a, [hli] - ld [hMoney + 1], a + ldh [hMoney + 1], a ld a, [hl] - ld [hMoney + 2], a + ldh [hMoney + 2], a call HasEnoughMoney jr nc, .enoughMoney ld hl, DayCareNotEnoughMoneyText diff --git a/scripts/FightingDojo.asm b/scripts/FightingDojo.asm index eb1e3d55..a5844c14 100755 --- a/scripts/FightingDojo.asm +++ b/scripts/FightingDojo.asm @@ -30,7 +30,7 @@ FightingDojoScript1: CheckEvent EVENT_BEAT_KARATE_MASTER ret nz xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld [wcf0d], a ld a, [wYCoord] cp $3 @@ -43,12 +43,12 @@ FightingDojoScript1: ld a, PLAYER_DIR_RIGHT ld [wPlayerMovingDirection], a ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_LEFT - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ret @@ -62,9 +62,9 @@ FightingDojoScript3: ld a, PLAYER_DIR_RIGHT ld [wPlayerMovingDirection], a ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_LEFT - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay .asm_5cde4 @@ -72,7 +72,7 @@ FightingDojoScript3: ld [wJoyIgnore], a SetEventRange EVENT_BEAT_KARATE_MASTER, EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 ld a, $8 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -142,7 +142,7 @@ FightingDojoText1: ld hl, FightingDojoText_5ce93 ld de, FightingDojoText_5ce93 call SaveEndBattleTextPointers - ld a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndexOrTextID] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/FuchsiaGym.asm b/scripts/FuchsiaGym.asm index 6fa569a0..ccde6106 100755 --- a/scripts/FuchsiaGym.asm +++ b/scripts/FuchsiaGym.asm @@ -44,20 +44,20 @@ FuchsiaGymScript3: ld [wJoyIgnore], a FuchsiaGymScript3_75497: ld a, $9 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_KOGA lb bc, TM_TOXIC, 1 call GiveItem jr nc, .BagFull ld a, $a - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_TM06 jr .gymVictory .BagFull ld a, $b - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges @@ -161,14 +161,14 @@ FuchsiaGymText1: ld hl, KogaAfterBattleText ld de, KogaAfterBattleText call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $5 ld [wGymLeaderNo], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $3 ld [wFuchsiaGymCurScript], a .done diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm index 551caa78..d5f43e6b 100755 --- a/scripts/GameCorner.asm +++ b/scripts/GameCorner.asm @@ -12,7 +12,7 @@ CeladonGameCornerScript_48bcf: res 6, [hl] ret z call Random - ld a, [hRandomAdd] + ldh a, [hRandomAdd] cp $7 jr nc, .asm_48be2 ld a, $8 @@ -57,10 +57,10 @@ CeladonGameCornerScript1: ld a, $f0 ld [wJoyIgnore], a ld a, $d - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $b - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld de, MovementData_48c5a ld a, [wYCoord] @@ -75,7 +75,7 @@ CeladonGameCornerScript1: ld de, MovementData_48c63 .asm_48c4d ld a, $b - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $2 ld [wGameCornerCurScript], a @@ -150,29 +150,29 @@ CeladonGameCornerText2: call Has9990Coins jr nc, .asm_48d14 xor a - ld [hMoney], a - ld [hMoney + 2], a + ldh [hMoney], a + ldh [hMoney + 2], a ld a, $10 - ld [hMoney + 1], a + ldh [hMoney + 1], a call HasEnoughMoney jr nc, .asm_48cdb ld hl, CeladonGameCornerText_48d31 jr .asm_48d1c .asm_48cdb xor a - ld [hMoney], a - ld [hMoney + 2], a + ldh [hMoney], a + ldh [hMoney + 2], a ld a, $10 - ld [hMoney + 1], a + ldh [hMoney + 1], a ld hl, hMoney + 2 ld de, wPlayerMoney + 2 ld c, $3 predef SubBCDPredef xor a - ld [hUnusedCoinsByte], a - ld [hCoins], a + ldh [hUnusedCoinsByte], a + ldh [hCoins], a ld a, $50 - ld [hCoins + 1], a + ldh [hCoins + 1], a ld de, wPlayerCoins + 1 ld hl, hCoins + 1 ld c, $2 @@ -236,10 +236,10 @@ CeladonGameCornerText5: call Has9990Coins jr nc, .asm_48d8e xor a - ld [hUnusedCoinsByte], a - ld [hCoins], a + ldh [hUnusedCoinsByte], a + ldh [hCoins], a ld a, $10 - ld [hCoins + 1], a + ldh [hCoins + 1], a ld de, wPlayerCoins + 1 ld hl, hCoins + 1 ld c, $2 @@ -316,10 +316,10 @@ CeladonGameCornerText9: call Has9990Coins jr nc, .asm_48e18 xor a - ld [hUnusedCoinsByte], a - ld [hCoins], a + ldh [hUnusedCoinsByte], a + ldh [hCoins], a ld a, $20 - ld [hCoins + 1], a + ldh [hCoins + 1], a ld de, wPlayerCoins + 1 ld hl, hCoins + 1 ld c, $2 @@ -368,10 +368,10 @@ CeladonGameCornerText10: call Has9990Coins jr z, .asm_48e7a xor a - ld [hUnusedCoinsByte], a - ld [hCoins], a + ldh [hUnusedCoinsByte], a + ldh [hCoins], a ld a, $20 - ld [hCoins + 1], a + ldh [hCoins + 1], a ld de, wPlayerCoins + 1 ld hl, hCoins + 1 ld c, $2 @@ -418,14 +418,14 @@ CeladonGameCornerText11: ld hl, CeladonGameCornerText_48ed3 ld de, CeladonGameCornerText_48ed3 call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters xor a - ld [hJoyHeld], a - ld [hJoyPressed], a - ld [hJoyReleased], a + ldh [hJoyHeld], a + ldh [hJoyPressed], a + ldh [hJoyReleased], a ld a, $1 ld [wGameCornerCurScript], a jp TextScriptEnd @@ -521,7 +521,7 @@ GameCornerBlankText2: Has9990Coins: ld a, $99 - ld [hCoins], a + ldh [hCoins], a ld a, $90 - ld [hCoins + 1], a + ldh [hCoins + 1], a jp HasEnoughCoins diff --git a/scripts/HallOfFame.asm b/scripts/HallOfFame.asm index ef3ed128..cdfb2f17 100755 --- a/scripts/HallOfFame.asm +++ b/scripts/HallOfFame.asm @@ -79,10 +79,10 @@ HallofFameRoomScript1: ld a, PLAYER_DIR_RIGHT ld [wPlayerMovingDirection], a ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld a, SPRITE_FACING_LEFT - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call Delay3 xor a @@ -90,7 +90,7 @@ HallofFameRoomScript1: inc a ; PLAYER_DIR_RIGHT ld [wPlayerMovingDirection], a ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wJoyIgnore], a diff --git a/scripts/LancesRoom.asm b/scripts/LancesRoom.asm index 712972e8..5087dda8 100755 --- a/scripts/LancesRoom.asm +++ b/scripts/LancesRoom.asm @@ -59,12 +59,12 @@ LanceScript0: call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, [wCoordIndex] cp $3 ; Is player standing next to Lance's sprite? jr nc, .notStandingNextToLance ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID .notStandingNextToLance cp $5 ; Is player standing on the entrance staircase? @@ -91,7 +91,7 @@ LanceScript2: cp $ff jp z, ResetLanceScript ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID WalkToLance: diff --git a/scripts/LoreleisRoom.asm b/scripts/LoreleisRoom.asm index c03d1161..f2cdfb45 100755 --- a/scripts/LoreleisRoom.asm +++ b/scripts/LoreleisRoom.asm @@ -65,8 +65,8 @@ LoreleiScript0: call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [hJoyPressed], a - ld [hJoyHeld], a + ldh [hJoyPressed], a + ldh [hJoyHeld], a ld [wSimulatedJoypadStatesEnd], a ld [wSimulatedJoypadStatesIndex], a ld a, [wCoordIndex] @@ -76,7 +76,7 @@ LoreleiScript0: jr z, LoreleiScriptWalkIntoRoom .stopPlayerFromLeaving ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ; "Don't run away!" ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -112,7 +112,7 @@ LoreleiScript2: cp $ff jp z, ResetLoreleiScript ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID LoreleisRoom_TextPointers: diff --git a/scripts/MtMoonB2F.asm b/scripts/MtMoonB2F.asm index 50620f23..a70967e4 100755 --- a/scripts/MtMoonB2F.asm +++ b/scripts/MtMoonB2F.asm @@ -62,9 +62,9 @@ MtMoon3Script0: cp $d jp nz, MtMoon3Script_49d91 xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID MtMoon3Script_49d91: @@ -88,7 +88,7 @@ MtMoon3Script3: MtMoon3Script4: ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld hl, CoordsData_49dea call ArePlayerCoordsInArray @@ -102,7 +102,7 @@ MtMoon3Script4: ld de, MovementData_49df8 .asm_49dda ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $5 ld [wMtMoonB2FCurScript], a @@ -136,7 +136,7 @@ MtMoon3Script5: ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld a, $a - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID CheckEvent EVENT_GOT_DOME_FOSSIL jr z, .asm_49e1d @@ -222,7 +222,7 @@ MtMoon3Text1: ld hl, MtMoon3Text_49f8a ld de, MtMoon3Text_49f8a call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/MtMoonPokecenter.asm b/scripts/MtMoonPokecenter.asm index bcc540a3..3dafd780 100755 --- a/scripts/MtMoonPokecenter.asm +++ b/scripts/MtMoonPokecenter.asm @@ -34,10 +34,10 @@ MagikarpSalesmanText: ld a, [wCurrentMenuItem] and a jp nz, .choseNo - ld [hMoney], a - ld [hMoney + 2], a + ldh [hMoney], a + ldh [hMoney + 2], a ld a, $5 - ld [hMoney + 1], a + ldh [hMoney + 1], a call HasEnoughMoney jr nc, .enoughMoney ld hl, .NoMoneyText diff --git a/scripts/Museum1F.asm b/scripts/Museum1F.asm index a8a609ff..caec03be 100755 --- a/scripts/Museum1F.asm +++ b/scripts/Museum1F.asm @@ -23,9 +23,9 @@ Museum1FScript0: ret nz .asm_5c120 xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID Museum1FScript1: @@ -71,7 +71,7 @@ Museum1FText1: ld [wTextBoxID], a call DisplayTextBoxID xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld hl, Museum1FText_5c21f call PrintText call YesNoChoice @@ -79,10 +79,10 @@ Museum1FText1: and a jr nz, .asm_de133 xor a - ld [hMoney], a - ld [hMoney + 1], a + ldh [hMoney], a + ldh [hMoney + 1], a ld a, $50 - ld [hMoney + 2], a + ldh [hMoney + 2], a call HasEnoughMoney jr nc, .asm_0f3e3 ld hl, Museum1FText_5c229 diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm index 01196d7c..49017440 100755 --- a/scripts/OaksLab.asm +++ b/scripts/OaksLab.asm @@ -48,7 +48,7 @@ OaksLabScript0: OaksLabScript1: ld a, $8 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld de, OakEntryMovement call MoveSprite @@ -86,14 +86,14 @@ OaksLabScript3: ld [wSimulatedJoypadStatesIndex], a call StartSimulatingJoypadStates ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $5 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $4 @@ -111,9 +111,9 @@ OaksLabScript4: SetEvent EVENT_FOLLOWED_OAK_INTO_LAB SetEvent EVENT_FOLLOWED_OAK_INTO_LAB_2 ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_UP - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call UpdateSprites ld hl, wFlags_D733 @@ -128,19 +128,19 @@ OaksLabScript5: ld a, $fc ld [wJoyIgnore], a ld a, $11 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, $12 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, $13 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, $14 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_OAK_ASKED_TO_CHOOSE_MON xor a @@ -155,18 +155,18 @@ OaksLabScript6: cp $6 ret nz ld a, $5 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a ; SPRITE_FACING_DOWN - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call UpdateSprites ld a, $c - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [wSimulatedJoypadStatesIndex], a @@ -254,9 +254,9 @@ OaksLabScript8: jr nz, .moveBlue push hl ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, $4 - ld [hSpriteDataOffset], a + ldh [hSpriteDataOffset], a call GetPointerWithinSpriteStateData1 push hl ld [hl], $4c @@ -281,7 +281,7 @@ OaksLabScript8: .moveBlue ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $9 @@ -295,12 +295,12 @@ OaksLabScript9: ld a, $fc ld [wJoyIgnore], a ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_UP - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $d - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, [wRivalStarterBallSpriteIndex] cp $2 @@ -324,12 +324,12 @@ OaksLabScript9: ld [wd11e], a call GetMonName ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_UP - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $e - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_STARTER xor a @@ -344,9 +344,9 @@ OaksLabScript10: cp $6 ret nz ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a ; SPRITE_FACING_DOWN - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, PLAYER_DIR_UP ld [wPlayerMovingDirection], a @@ -354,21 +354,21 @@ OaksLabScript10: ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, $f - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 - ld [hNPCPlayerRelativePosPerspective], a + ldh [hNPCPlayerRelativePosPerspective], a ld a, $1 swap a - ld [hNPCSpriteOffset], a + ldh [hNPCSpriteOffset], a predef CalcPositionOfPlayerRelativeToNPC - ld a, [hNPCPlayerYDistance] + ldh a, [hNPCPlayerYDistance] dec a - ld [hNPCPlayerYDistance], a + ldh [hNPCPlayerYDistance], a predef FindPathToPlayer ld de, wNPCMovementDirections2 ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $b @@ -424,9 +424,9 @@ OaksLabScript12: ld [wSpriteIndex], a call SetSpritePosition1 ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a ; SPRITE_FACING_DOWN - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay predef HealParty SetEvent EVENT_BATTLED_RIVAL_IN_OAKS_LAB @@ -439,11 +439,11 @@ OaksLabScript13: ld c, 20 call DelayFrames ld a, $10 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID callba Music_RivalAlternateStart ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld de, .RivalExitMovement call MoveSprite ld a, [wXCoord] @@ -508,14 +508,14 @@ OaksLabScript14: OaksLabScript15: xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a call EnableAutoTextBoxDrawing ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound callba Music_RivalAlternateStart ld a, $15 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call OaksLabScript_1d02b ld a, HS_OAKS_LAB_RIVAL @@ -530,7 +530,7 @@ OaksLabScript15: call FillMemory ld [hl], $ff ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld de, wNPCMovementDirections2 call MoveSprite @@ -540,14 +540,14 @@ OaksLabScript15: OaksLabScript_1cefd: ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_UP - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $8 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a xor a ; SPRITE_FACING_DOWN - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a jp SetSpriteFacingDirectionAndDelay OaksLabScript16: @@ -560,21 +560,21 @@ OaksLabScript16: ld [wJoyIgnore], a call OaksLabScript_1cefd ld a, $16 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call DelayFrame call OaksLabScript_1cefd ld a, $17 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call DelayFrame call OaksLabScript_1cefd ld a, $18 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call DelayFrame ld a, $19 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, HS_POKEDEX_1 @@ -585,16 +585,16 @@ OaksLabScript16: predef HideObject call OaksLabScript_1cefd ld a, $1a - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_RIGHT - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call Delay3 ld a, $1b - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_POKEDEX SetEvent EVENT_OAK_GOT_PARCEL @@ -616,7 +616,7 @@ OaksLabScript16: call PlaySound callba Music_RivalAlternateStart ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld de, wNPCMovementDirections2 call MoveSprite @@ -672,9 +672,9 @@ OaksLabScript_RemoveParcel: OaksLabScript_1d02b: ld a, $7c - ld [hSpriteScreenYCoord], a + ldh [hSpriteScreenYCoord], a ld a, $8 - ld [hSpriteMapXCoord], a + ldh [hSpriteMapXCoord], a ld a, [wYCoord] cp $3 jr nz, .asm_1d045 @@ -703,9 +703,9 @@ OaksLabScript_1d02b: .asm_1d066 ld a, $20 .asm_1d068 - ld [hSpriteScreenXCoord], a + ldh [hSpriteScreenXCoord], a ld a, b - ld [hSpriteMapYCoord], a + ldh [hSpriteMapYCoord], a ld a, $1 ld [wSpriteIndex], a call SetSpritePosition1 @@ -840,15 +840,15 @@ OaksLabText39: OaksLabScript_1d157: ld a, $5 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, $9 - ld [hSpriteDataOffset], a + ldh [hSpriteDataOffset], a call GetPointerWithinSpriteStateData1 ld [hl], SPRITE_FACING_DOWN ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, $9 - ld [hSpriteDataOffset], a + ldh [hSpriteDataOffset], a call GetPointerWithinSpriteStateData1 ld [hl], SPRITE_FACING_RIGHT ld hl, wd730 @@ -947,9 +947,9 @@ OaksLabReceivedMonText: OaksLabScript_1d22d: ld a, $5 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, $9 - ld [hSpriteDataOffset], a + ldh [hSpriteDataOffset], a call GetPointerWithinSpriteStateData1 ld [hl], $0 ld hl, OaksLabLastMonText diff --git a/scripts/PalletTown.asm b/scripts/PalletTown.asm index e063e0c8..5c4c4de8 100755 --- a/scripts/PalletTown.asm +++ b/scripts/PalletTown.asm @@ -24,7 +24,7 @@ PalletTownScript0: cp 1 ; is player near north exit? ret nz xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, PLAYER_DIR_DOWN ld [wPlayerMovingDirection], a ld a, SFX_STOP_ALL_MUSIC @@ -46,7 +46,7 @@ PalletTownScript1: xor a ld [wcf0d], a ld a, 1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $FF ld [wJoyIgnore], a @@ -61,25 +61,25 @@ PalletTownScript1: PalletTownScript2: ld a, 1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_UP - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call Delay3 ld a, 1 ld [wYCoord], a ld a, 1 - ld [hNPCPlayerRelativePosPerspective], a + ldh [hNPCPlayerRelativePosPerspective], a ld a, 1 swap a - ld [hNPCSpriteOffset], a + ldh [hNPCSpriteOffset], a predef CalcPositionOfPlayerRelativeToNPC ld hl, hNPCPlayerYDistance dec [hl] predef FindPathToPlayer ; load Oak’s movement into wNPCMovementDirections2 ld de, wNPCMovementDirections2 ld a, 1 ; oak - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $FF ld [wJoyIgnore], a @@ -100,7 +100,7 @@ PalletTownScript3: ld a, $FC ld [wJoyIgnore], a ld a, 1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ; set up movement script that causes the player to follow Oak to his lab ld a, $FF @@ -111,7 +111,7 @@ PalletTownScript3: ld [wNPCMovementScriptFunctionNum], a ld a, 1 ld [wNPCMovementScriptPointerTableNum], a - ld a, [hLoadedROMBank] + ldh a, [hLoadedROMBank] ld [wNPCMovementScriptBank], a ; trigger the next script diff --git a/scripts/PewterCity.asm b/scripts/PewterCity.asm index a082d5eb..e3d39dae 100755 --- a/scripts/PewterCity.asm +++ b/scripts/PewterCity.asm @@ -29,7 +29,7 @@ PewterCityScript_1925e: ld a, $f0 ld [wJoyIgnore], a ld a, $5 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID CoordsData_19277: @@ -44,32 +44,32 @@ PewterCityScript1: and a ret nz ld a, $3 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_UP - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, ($3 << 4) | SPRITE_FACING_UP - ld [hSpriteImageIndex], a + ldh [hSpriteImageIndex], a call SetSpriteImageIndexAfterSettingFacingDirection call PlayDefaultMusic ld hl, wFlags_0xcd60 set 4, [hl] ld a, $d - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $3c - ld [hSpriteScreenYCoord], a + ldh [hSpriteScreenYCoord], a ld a, $30 - ld [hSpriteScreenXCoord], a + ldh [hSpriteScreenXCoord], a ld a, $c - ld [hSpriteMapYCoord], a + ldh [hSpriteMapYCoord], a ld a, $11 - ld [hSpriteMapXCoord], a + ldh [hSpriteMapXCoord], a ld a, $3 ld [wSpriteIndex], a call SetSpritePosition1 ld a, $3 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld de, MovementData_PewterMuseumGuyExit call MoveSprite ld a, $2 @@ -112,32 +112,32 @@ PewterCityScript4: and a ret nz ld a, $5 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_LEFT - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, ($1 << 4) | SPRITE_FACING_LEFT - ld [hSpriteImageIndex], a + ldh [hSpriteImageIndex], a call SetSpriteImageIndexAfterSettingFacingDirection call PlayDefaultMusic ld hl, wFlags_0xcd60 set 4, [hl] ld a, $e - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $3c - ld [hSpriteScreenYCoord], a + ldh [hSpriteScreenYCoord], a ld a, $40 - ld [hSpriteScreenXCoord], a + ldh [hSpriteScreenXCoord], a ld a, $16 - ld [hSpriteMapYCoord], a + ldh [hSpriteMapYCoord], a ld a, $10 - ld [hSpriteMapXCoord], a + ldh [hSpriteMapXCoord], a ld a, $5 ld [wSpriteIndex], a call SetSpritePosition1 ld a, $5 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld de, MovementData_PewterGymGuyExit call MoveSprite ld a, $5 @@ -215,12 +215,12 @@ PewterCityText3: ld hl, PewterCityText_193fb call PrintText xor a - ld [hJoyPressed], a - ld [hJoyHeld], a + ldh [hJoyPressed], a + ldh [hJoyHeld], a ld [wNPCMovementScriptFunctionNum], a ld a, $2 ld [wNPCMovementScriptPointerTableNum], a - ld a, [hLoadedROMBank] + ldh a, [hLoadedROMBank] ld [wNPCMovementScriptBank], a ld a, $3 ld [wSpriteIndex], a @@ -280,11 +280,11 @@ PewterCityText5: ld hl, PewterCityText_1945d call PrintText xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld [wNPCMovementScriptFunctionNum], a ld a, $3 ld [wNPCMovementScriptPointerTableNum], a - ld a, [hLoadedROMBank] + ldh a, [hLoadedROMBank] ld [wNPCMovementScriptBank], a ld a, $5 ld [wSpriteIndex], a diff --git a/scripts/PewterGym.asm b/scripts/PewterGym.asm index 7215e095..94364043 100755 --- a/scripts/PewterGym.asm +++ b/scripts/PewterGym.asm @@ -44,20 +44,20 @@ PewterGymScript3: PewterGymScript_5c3df: ld a, $4 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_BROCK lb bc, TM_BIDE, 1 call GiveItem jr nc, .BagFull ld a, $5 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_TM34 jr .gymVictory .BagFull ld a, $6 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges @@ -120,14 +120,14 @@ PewterGymText1: ld hl, PewterGymText_5c4bc ld de, PewterGymText_5c4bc call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $1 ld [wGymLeaderNo], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $3 ld [wPewterGymCurScript], a ld [wCurMapScript], a diff --git a/scripts/PokemonMansion1F.asm b/scripts/PokemonMansion1F.asm index d8f3728c..a68b8928 100755 --- a/scripts/PokemonMansion1F.asm +++ b/scripts/PokemonMansion1F.asm @@ -50,9 +50,9 @@ Mansion1Script_Switches:: cp SPRITE_FACING_UP ret nz xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $4 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID PokemonMansion1F_ScriptPointers: diff --git a/scripts/PokemonMansion2F.asm b/scripts/PokemonMansion2F.asm index e560d6bd..16f0dff5 100755 --- a/scripts/PokemonMansion2F.asm +++ b/scripts/PokemonMansion2F.asm @@ -46,9 +46,9 @@ Mansion2Script_Switches:: cp SPRITE_FACING_UP ret nz xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $5 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID PokemonMansion2F_ScriptPointers: diff --git a/scripts/PokemonMansion3F.asm b/scripts/PokemonMansion3F.asm index ad346702..f4612b0d 100755 --- a/scripts/PokemonMansion3F.asm +++ b/scripts/PokemonMansion3F.asm @@ -77,9 +77,9 @@ Mansion3Script_Switches:: cp SPRITE_FACING_UP ret nz xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $6 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID PokemonMansion3F_TextPointers: diff --git a/scripts/PokemonMansionB1F.asm b/scripts/PokemonMansionB1F.asm index aa7123f0..7b295f7e 100755 --- a/scripts/PokemonMansionB1F.asm +++ b/scripts/PokemonMansionB1F.asm @@ -48,9 +48,9 @@ Mansion4Script_Switches:: cp SPRITE_FACING_UP ret nz xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $9 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID PokemonMansionB1F_ScriptPointers: diff --git a/scripts/PokemonTower2F.asm b/scripts/PokemonTower2F.asm index 4cf308b5..86a60579 100755 --- a/scripts/PokemonTower2F.asm +++ b/scripts/PokemonTower2F.asm @@ -41,16 +41,16 @@ PokemonTower2Script0: .asm_60544 ld [wPlayerMovingDirection], a ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, b - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a - ld [hJoyHeld], a - ld [hJoyPressed], a + ldh [hJoyHeld], a + ldh [hJoyPressed], a ret CoordsData_6055e: @@ -66,7 +66,7 @@ PokemonTower2Script1: ld [wJoyIgnore], a SetEvent EVENT_BEAT_POKEMON_TOWER_RIVAL ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld de, MovementData_605b2 CheckEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT @@ -74,7 +74,7 @@ PokemonTower2Script1: ld de, MovementData_605a9 .asm_60589 ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a diff --git a/scripts/PokemonTower5F.asm b/scripts/PokemonTower5F.asm index de09ec49..8cd9f5d1 100755 --- a/scripts/PokemonTower5F.asm +++ b/scripts/PokemonTower5F.asm @@ -24,7 +24,7 @@ PokemonTower5Script0: CheckAndSetEvent EVENT_IN_PURIFIED_ZONE ret nz xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $f0 ld [wJoyIgnore], a ld hl, wd72e @@ -35,7 +35,7 @@ PokemonTower5Script0: call Delay3 call GBFadeInFromWhite ld a, $7 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a diff --git a/scripts/PokemonTower6F.asm b/scripts/PokemonTower6F.asm index a6ae22ec..9ed36a7b 100755 --- a/scripts/PokemonTower6F.asm +++ b/scripts/PokemonTower6F.asm @@ -28,9 +28,9 @@ PokemonTower6Script0: call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $6 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, MAROWAK ld [wCurOpponent], a @@ -61,7 +61,7 @@ PokemonTower6Script4: jr nz, .asm_60b82 SetEvent EVENT_BEAT_GHOST_MAROWAK ld a, $7 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a diff --git a/scripts/PokemonTower7F.asm b/scripts/PokemonTower7F.asm index 3f16ca92..f32e1a7c 100755 --- a/scripts/PokemonTower7F.asm +++ b/scripts/PokemonTower7F.asm @@ -31,7 +31,7 @@ PokemonTower7Script2: ld a, $f0 ld [wJoyIgnore], a ld a, [wSpriteIndex] - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call PokemonTower7Script_60db6 ld a, $3 @@ -72,7 +72,7 @@ PokemonTower7Script4: ld a, SPRITE_FACING_UP ld [wSpritePlayerStateData1FacingDirection], a ld a, MR_FUJIS_HOUSE - ld [hWarpDestinationMap], a + ldh [hWarpDestinationMap], a ld a, $1 ld [wDestinationWarpID], a ld a, LAVENDER_TOWN @@ -107,7 +107,7 @@ PokemonTower7Script_60db6: ld d, [hl] ld e, a ld a, [wSpriteIndex] - ld [hSpriteIndex], a + ldh [hSpriteIndex], a jp MoveSprite .asm_60dde inc hl diff --git a/scripts/RedsHouse2F.asm b/scripts/RedsHouse2F.asm index 69a62f81..2e3463ee 100755 --- a/scripts/RedsHouse2F.asm +++ b/scripts/RedsHouse2F.asm @@ -10,7 +10,7 @@ RedsHouse2F_ScriptPointers: RedsHouse2FScript0: xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, PLAYER_DIR_UP ld [wPlayerMovingDirection], a ld a, 1 diff --git a/scripts/RocketHideoutB4F.asm b/scripts/RocketHideoutB4F.asm index 81762a8f..f33ef6e2 100755 --- a/scripts/RocketHideoutB4F.asm +++ b/scripts/RocketHideoutB4F.asm @@ -52,7 +52,7 @@ RocketHideout4Script3: ld [wJoyIgnore], a SetEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI ld a, $a - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call GBFadeOutToBlack ld a, HS_ROCKET_HIDEOUT_B4F_GIOVANNI @@ -125,12 +125,12 @@ RocketHideout4Text1: ld hl, RocketHideout4Text_4557f ld de, RocketHideout4Text_4557f call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $3 ld [wRocketHideoutB4FCurScript], a ld [wCurMapScript], a diff --git a/scripts/Route11Gate2F.asm b/scripts/Route11Gate2F.asm index 1fefc824..1797c540 100755 --- a/scripts/Route11Gate2F.asm +++ b/scripts/Route11Gate2F.asm @@ -20,9 +20,9 @@ Route11GateUpstairsText2: CheckEvent EVENT_GOT_ITEMFINDER, 1 jr c, .asm_4949b ld a, 30 ; pokemon needed - ld [hOaksAideRequirement], a + ldh [hOaksAideRequirement], a ld a, ITEMFINDER ; oak's aide reward - ld [hOaksAideRewardItem], a + ldh [hOaksAideRewardItem], a ld [wd11e], a call GetItemName ld h, d @@ -31,7 +31,7 @@ Route11GateUpstairsText2: ld bc, ITEM_NAME_LENGTH call CopyData predef OaksAideScript - ld a, [hOaksAideResult] + ldh a, [hOaksAideResult] dec a jr nz, .asm_494a1 SetEvent EVENT_GOT_ITEMFINDER diff --git a/scripts/Route12.asm b/scripts/Route12.asm index 1033e495..87052fd6 100755 --- a/scripts/Route12.asm +++ b/scripts/Route12.asm @@ -27,7 +27,7 @@ Route12Script0: ResetEventReuseHL EVENT_FIGHT_ROUTE12_SNORLAX jp z, CheckFightingMapTrainers ld a, $d - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, SNORLAX ld [wCurOpponent], a @@ -50,7 +50,7 @@ Route12Script3: cp $2 jr z, .asm_59664 ld a, $e - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .asm_59664 SetEvent EVENT_BEAT_ROUTE12_SNORLAX diff --git a/scripts/Route15Gate2F.asm b/scripts/Route15Gate2F.asm index a0535949..9887fbc1 100755 --- a/scripts/Route15Gate2F.asm +++ b/scripts/Route15Gate2F.asm @@ -10,9 +10,9 @@ Route15GateUpstairsText1: CheckEvent EVENT_GOT_EXP_ALL jr nz, .asm_49683 ld a, 50 ; pokemon needed - ld [hOaksAideRequirement], a + ldh [hOaksAideRequirement], a ld a, EXP_ALL ; oak's aide reward - ld [hOaksAideRewardItem], a + ldh [hOaksAideRewardItem], a ld [wd11e], a call GetItemName ld hl, wcd6d @@ -20,7 +20,7 @@ Route15GateUpstairsText1: ld bc, ITEM_NAME_LENGTH call CopyData predef OaksAideScript - ld a, [hOaksAideResult] + ldh a, [hOaksAideResult] cp $1 jr nz, .asm_49689 SetEvent EVENT_GOT_EXP_ALL diff --git a/scripts/Route16.asm b/scripts/Route16.asm index f813b4e5..bd80a918 100755 --- a/scripts/Route16.asm +++ b/scripts/Route16.asm @@ -27,7 +27,7 @@ Route16Script0: ResetEventReuseHL EVENT_FIGHT_ROUTE16_SNORLAX jp z, CheckFightingMapTrainers ld a, $a - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, SNORLAX ld [wCurOpponent], a @@ -51,7 +51,7 @@ Route16Script3: cp $2 jr z, .asm_599a8 ld a, $b - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .asm_599a8 SetEvent EVENT_BEAT_ROUTE16_SNORLAX diff --git a/scripts/Route16Gate1F.asm b/scripts/Route16Gate1F.asm index af84bab0..5bb77075 100755 --- a/scripts/Route16Gate1F.asm +++ b/scripts/Route16Gate1F.asm @@ -19,10 +19,10 @@ Route16GateScript0: call ArePlayerCoordsInArray ret nc ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, [wCoordIndex] cp $1 jr z, .asm_4970e @@ -59,7 +59,7 @@ Route16GateScript1: Route16GateScript2: ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [wSimulatedJoypadStatesIndex], a diff --git a/scripts/Route18Gate1F.asm b/scripts/Route18Gate1F.asm index ad876e15..ea8783df 100755 --- a/scripts/Route18Gate1F.asm +++ b/scripts/Route18Gate1F.asm @@ -19,10 +19,10 @@ Route18GateScript0: call ArePlayerCoordsInArray ret nc ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, [wCoordIndex] cp $1 jr z, .asm_498c6 @@ -59,7 +59,7 @@ Route18GateScript1: Route18GateScript2: ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [wSimulatedJoypadStatesIndex], a diff --git a/scripts/Route22.asm b/scripts/Route22.asm index b6970ef0..fd566ff0 100755 --- a/scripts/Route22.asm +++ b/scripts/Route22.asm @@ -44,7 +44,7 @@ Route22MoveRivalSprite: .asm_50ef1 call MoveSprite ld a, SPRITE_FACING_RIGHT - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a jp SetSpriteFacingDirectionAndDelay Route22RivalMovementData: @@ -63,7 +63,7 @@ Route22Script0: ld a, [wCoordIndex] ld [wcf0d], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $f0 ld [wJoyIgnore], a ld a, PLAYER_DIR_LEFT @@ -96,7 +96,7 @@ Route22Script0: ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call Route22MoveRivalSprite ld a, $1 ld [wRoute22CurScript], a @@ -116,14 +116,14 @@ Route22Script1: .asm_50f78 ld a, SPRITE_FACING_RIGHT .asm_50f7a - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteFacingDirectionAndDelay xor a ld [wJoyIgnore], a ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd72d set 6, [hl] @@ -157,15 +157,15 @@ Route22Script2: .notDown ld a, SPRITE_FACING_RIGHT .done - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a SetEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_BATTLE ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a @@ -191,7 +191,7 @@ Route22Script_5100d: ld de, Route22RivalExitMovementData2 Route22MoveRival1: ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a jp MoveSprite Route22RivalExitMovementData1: @@ -250,7 +250,7 @@ Route22Script_5104e: call PlaySound callba Music_RivalAlternateTempo ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call Route22MoveRivalSprite ld a, $4 ld [wRoute22CurScript], a @@ -261,7 +261,7 @@ Route22Script4: bit 0, a ret nz ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, [wcf0d] cp $1 jr nz, .asm_510a1 @@ -274,12 +274,12 @@ Route22Script4: ld [wPlayerMovingDirection], a ld a, SPRITE_FACING_RIGHT .asm_510a8 - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay xor a ld [wJoyIgnore], a ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd72d set 6, [hl] @@ -305,7 +305,7 @@ Route22Script5: cp $ff jp z, Route22Script_50ece ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, [wcf0d] cp $1 jr nz, .asm_510fb @@ -318,13 +318,13 @@ Route22Script5: ld [wPlayerMovingDirection], a ld a, SPRITE_FACING_RIGHT .asm_51102 - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a SetEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_BATTLE ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a @@ -350,7 +350,7 @@ Route22Script_51142: ld de, MovementData_5114d Route22MoveRival2: ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a jp MoveSprite MovementData_5114c: diff --git a/scripts/Route22Gate.asm b/scripts/Route22Gate.asm index e2311b95..59b7d7a2 100755 --- a/scripts/Route22Gate.asm +++ b/scripts/Route22Gate.asm @@ -22,9 +22,9 @@ Route22GateScript0: call ArePlayerCoordsInArray ret nc xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID Route22GateScriptCoords: diff --git a/scripts/Route23.asm b/scripts/Route23.asm index b617992b..f4d65266 100755 --- a/scripts/Route23.asm +++ b/scripts/Route23.asm @@ -45,7 +45,7 @@ Route23Script0: ret nc .asm_51237 ld a, e - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a ld a, c ld [wWhichBadge], a ld b, FLAG_TEST @@ -57,7 +57,7 @@ Route23Script0: call Route23Script_5125d call DisplayTextID xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ret YCoordsData_51255: diff --git a/scripts/Route24.asm b/scripts/Route24.asm index f04a43cf..22ef9aab 100755 --- a/scripts/Route24.asm +++ b/scripts/Route24.asm @@ -28,9 +28,9 @@ Route24Script0: call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID CheckAndResetEvent EVENT_NUGGET_REWARD_AVAILABLE ret z @@ -66,7 +66,7 @@ Route24Script3: ld [wJoyIgnore], a SetEvent EVENT_BEAT_ROUTE24_ROCKET ld a, $1 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -162,12 +162,12 @@ Route24Text1: ld hl, Route24Text_5152b ld de, Route24Text_5152b call SaveEndBattleTextPointers - ld a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndexOrTextID] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $3 ld [wRoute24CurScript], a ld [wCurMapScript], a diff --git a/scripts/Route2Gate.asm b/scripts/Route2Gate.asm index 27da0909..d9d30218 100755 --- a/scripts/Route2Gate.asm +++ b/scripts/Route2Gate.asm @@ -10,9 +10,9 @@ Route2GateText1: CheckEvent EVENT_GOT_HM05 jr nz, .asm_5d60d ld a, 10 ; pokemon needed - ld [hOaksAideRequirement], a + ldh [hOaksAideRequirement], a ld a, HM_FLASH ; oak's aide reward - ld [hOaksAideRewardItem], a + ldh [hOaksAideRewardItem], a ld [wd11e], a call GetItemName ld hl, wcd6d @@ -20,7 +20,7 @@ Route2GateText1: ld bc, ITEM_NAME_LENGTH call CopyData predef OaksAideScript - ld a, [hOaksAideResult] + ldh a, [hOaksAideResult] cp $1 jr nz, .asm_5d613 SetEvent EVENT_GOT_HM05 diff --git a/scripts/Route5Gate.asm b/scripts/Route5Gate.asm index 0bd896f1..0b66efa6 100755 --- a/scripts/Route5Gate.asm +++ b/scripts/Route5Gate.asm @@ -25,13 +25,13 @@ Route5GateScript0: ld a, PLAYER_DIR_LEFT ld [wPlayerMovingDirection], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a callba RemoveGuardDrink - ld a, [hItemToRemoveID] + ldh a, [hItemToRemoveID] and a jr nz, .asm_1df82 ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Route5GateScript_1df43 ld a, $1 @@ -39,7 +39,7 @@ Route5GateScript0: ret .asm_1df82 ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd728 set 6, [hl] @@ -74,7 +74,7 @@ Route5GateText1: bit 6, a jr nz, .asm_88856 callba RemoveGuardDrink - ld a, [hItemToRemoveID] + ldh a, [hItemToRemoveID] and a jr nz, .asm_768a2 ld hl, Route5GateText2 diff --git a/scripts/Route6Gate.asm b/scripts/Route6Gate.asm index 6e9dd4b3..7d135498 100755 --- a/scripts/Route6Gate.asm +++ b/scripts/Route6Gate.asm @@ -19,13 +19,13 @@ Route6GateScript0: ld a, PLAYER_DIR_RIGHT ld [wPlayerMovingDirection], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a callba RemoveGuardDrink - ld a, [hItemToRemoveID] + ldh a, [hItemToRemoveID] and a jr nz, .asm_1e080 ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Route6GateScript_1e0a1 ld a, $1 @@ -35,7 +35,7 @@ Route6GateScript0: ld hl, wd728 set 6, [hl] ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID CoordsData_1e08c: diff --git a/scripts/Route7Gate.asm b/scripts/Route7Gate.asm index 00d7472f..041d6c6a 100755 --- a/scripts/Route7Gate.asm +++ b/scripts/Route7Gate.asm @@ -31,13 +31,13 @@ Route7GateScript0: ld a, PLAYER_DIR_UP ld [wPlayerMovingDirection], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a callba RemoveGuardDrink - ld a, [hItemToRemoveID] + ldh a, [hItemToRemoveID] and a jr nz, .asm_1e15a ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Route7GateScript_1e111 ld a, $1 @@ -45,7 +45,7 @@ Route7GateScript0: ret .asm_1e15a ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd728 set 6, [hl] diff --git a/scripts/Route8Gate.asm b/scripts/Route8Gate.asm index d3003c4d..3bdd6070 100755 --- a/scripts/Route8Gate.asm +++ b/scripts/Route8Gate.asm @@ -30,13 +30,13 @@ Route8GateScript0: ld a, PLAYER_DIR_LEFT ld [wPlayerMovingDirection], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a callba RemoveGuardDrink - ld a, [hItemToRemoveID] + ldh a, [hItemToRemoveID] and a jr nz, .asm_1e220 ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Route8GateScript_1e1d7 ld a, $1 @@ -46,7 +46,7 @@ Route8GateScript0: ld hl, wd728 set 6, [hl] ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a jp DisplayTextID CoordsData_1e22c: diff --git a/scripts/SSAnne2F.asm b/scripts/SSAnne2F.asm index 98d4f197..45e8f283 100755 --- a/scripts/SSAnne2F.asm +++ b/scripts/SSAnne2F.asm @@ -31,19 +31,19 @@ SSAnne2Script0: ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, [wCoordIndex] - ld [hSavedCoordIndex], a + ldh [hSavedCoordIndex], a ld a, HS_SS_ANNE_2F_RIVAL ld [wMissableObjectIndex], a predef ShowObject call Delay3 ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $f0 ld [wJoyIgnore], a - ld a, [hSavedCoordIndex] + ldh a, [hSavedCoordIndex] cp $2 jr nz, .asm_61400 ld de, MovementData_6140c @@ -81,9 +81,9 @@ SSAnne2Script_61416: .asm_61426 xor a ; SPRITE_FACING_DOWN .asm_61427 - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a jp SetSpriteFacingDirectionAndDelay SSAnne2Script1: @@ -94,7 +94,7 @@ SSAnne2Script1: xor a ld [wJoyIgnore], a ld a, $2 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld a, OPP_SONY2 @@ -129,10 +129,10 @@ SSAnne2Script2: ld a, $f0 ld [wJoyIgnore], a ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld a, [wXCoord] cp $25 @@ -143,7 +143,7 @@ SSAnne2Script2: ld de, MovementData_614b7 .asm_6149a ld a, $2 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a diff --git a/scripts/SSAnneKitchen.asm b/scripts/SSAnneKitchen.asm index 7334cc69..969c6b7f 100755 --- a/scripts/SSAnneKitchen.asm +++ b/scripts/SSAnneKitchen.asm @@ -39,7 +39,7 @@ SSAnne6Text7: text_asm ld hl, SSAnne6Text_61807 call PrintText - ld a, [hRandomAdd] + ldh a, [hRandomAdd] bit 7, a jr z, .asm_93eb1 ld hl, SSAnne6Text_6180c diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm index 76f4faa6..eb49ba8d 100755 --- a/scripts/SafariZoneGate.asm +++ b/scripts/SafariZoneGate.asm @@ -18,12 +18,12 @@ SafariZoneGate_ScriptPointers: call ArePlayerCoordsInArray ret nc ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wJoyIgnore], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, SPRITE_FACING_RIGHT ld [wSpritePlayerStateData1FacingDirection], a ld a, [wCoordIndex] @@ -52,11 +52,11 @@ SafariZoneGate_ScriptPointers: ret nz .SafariZoneEntranceScript2 xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld [wJoyIgnore], a call UpdateSprites ld a, $4 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wJoyIgnore], a @@ -81,7 +81,7 @@ SafariZoneGate_ScriptPointers: ld a, $f0 ld [wJoyIgnore], a ld a, $6 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wNumSafariBalls], a @@ -93,7 +93,7 @@ SafariZoneGate_ScriptPointers: jr .asm_75286 .asm_7527f ld a, $5 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .asm_75286 ret @@ -153,11 +153,11 @@ SafariZoneGate_TextPointers: and a jp nz, .PleaseComeAgain xor a - ld [hMoney], a + ldh [hMoney], a ld a, $05 - ld [hMoney + 1], a + ldh [hMoney + 1], a ld a, $00 - ld [hMoney + 2], a + ldh [hMoney + 2], a call HasEnoughMoney jr nc, .success ld hl, .NotEnoughMoneyText diff --git a/scripts/SaffronGym.asm b/scripts/SaffronGym.asm index 88a76253..5f4045ac 100755 --- a/scripts/SaffronGym.asm +++ b/scripts/SaffronGym.asm @@ -44,20 +44,20 @@ SaffronGymScript3: SaffronGymText_5d068: ld a, $a - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_SABRINA lb bc, TM_PSYWAVE, 1 call GiveItem jr nc, .BagFull ld a, $b - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_TM46 jr .gymVictory .BagFull ld a, $c - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges @@ -171,7 +171,7 @@ SaffronGymText1: ld hl, SaffronGymText_5d167 ld de, SaffronGymText_5d167 call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/SilphCo10F.asm b/scripts/SilphCo10F.asm index 140584f1..8fa53319 100755 --- a/scripts/SilphCo10F.asm +++ b/scripts/SilphCo10F.asm @@ -28,7 +28,7 @@ SilphCo10GateCoords: db $FF SilphCo10Text_5a176: - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z SetEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR diff --git a/scripts/SilphCo11F.asm b/scripts/SilphCo11F.asm index a2c540fe..4b54bf48 100755 --- a/scripts/SilphCo11F.asm +++ b/scripts/SilphCo11F.asm @@ -35,7 +35,7 @@ SilphCo11Script_62137: ld a, [hl] ld c, a xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a pop hl .asm_62143 ld a, [hli] @@ -60,11 +60,11 @@ SilphCo11Script_62137: ret .asm_6215f xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a ret SilphCo11Script_62163: - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z SetEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR @@ -171,14 +171,14 @@ SilphCo11Script0: ld a, [wCoordIndex] ld [wcf0d], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $f0 ld [wJoyIgnore], a ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $3 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld de, MovementData_62216 call MoveSprite @@ -199,9 +199,9 @@ MovementData_62216: SilphCo11Script_6221a: ld [wPlayerMovingDirection], a ld a, $3 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, b - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a jp SetSpriteFacingDirectionAndDelay SilphCo11Script5: @@ -222,7 +222,7 @@ SilphCo11Script5: ld a, $f0 ld [wJoyIgnore], a ld a, $6 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call GBFadeOutToBlack call SilphCo11Script_6216d @@ -239,7 +239,7 @@ SilphCo11Script3: bit 0, a ret nz ld a, $3 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld a, [wcf0d] cp $1 @@ -263,7 +263,7 @@ SilphCo11Script4: ld hl, SilphCo10Text_62330 ld de, SilphCo10Text_62330 call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/SilphCo2F.asm b/scripts/SilphCo2F.asm index 212d0b90..42e5a7e6 100755 --- a/scripts/SilphCo2F.asm +++ b/scripts/SilphCo2F.asm @@ -45,7 +45,7 @@ SilphCo2Script_59d43: ld a, [hl] ld c, a xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a pop hl .asm_59d4f ld a, [hli] @@ -70,12 +70,12 @@ SilphCo2Script_59d43: ret .asm_59d6b xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a ret SilphCo2Script_59d6f: EventFlagAddress hl, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z cp $1 diff --git a/scripts/SilphCo3F.asm b/scripts/SilphCo3F.asm index ddd40048..2a086708 100755 --- a/scripts/SilphCo3F.asm +++ b/scripts/SilphCo3F.asm @@ -39,7 +39,7 @@ SilphCo3GateCoords: SilphCo3Script_59fad: EventFlagAddress hl, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z cp $1 diff --git a/scripts/SilphCo4F.asm b/scripts/SilphCo4F.asm index 523336c0..e148447b 100755 --- a/scripts/SilphCo4F.asm +++ b/scripts/SilphCo4F.asm @@ -45,7 +45,7 @@ SilphCo4Script_19d5d: ld a, [hl] ld c, a xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a pop hl .asm_19d69 ld a, [hli] @@ -70,12 +70,12 @@ SilphCo4Script_19d5d: ret .asm_19d85 xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a ret SilphCo4Script_19d89: EventFlagAddress hl, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z cp $1 diff --git a/scripts/SilphCo5F.asm b/scripts/SilphCo5F.asm index 653390c7..4d4f6ab6 100755 --- a/scripts/SilphCo5F.asm +++ b/scripts/SilphCo5F.asm @@ -49,7 +49,7 @@ SilphCo5GateCoords: SilphCo5Script_19f9e: EventFlagAddress hl, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z cp $1 diff --git a/scripts/SilphCo6F.asm b/scripts/SilphCo6F.asm index 0d393b6e..30a0d83e 100755 --- a/scripts/SilphCo6F.asm +++ b/scripts/SilphCo6F.asm @@ -28,7 +28,7 @@ SilphCo6GateCoords: db $FF SilphCo6Script_1a1e6: - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z SetEvent EVENT_SILPH_CO_6_UNLOCKED_DOOR diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm index 966a18d9..e7032760 100755 --- a/scripts/SilphCo7F.asm +++ b/scripts/SilphCo7F.asm @@ -55,7 +55,7 @@ SilphCo7Text_51bc8: ld a, [hl] ld c, a xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a pop hl .asm_51bd4 ld a, [hli] @@ -80,12 +80,12 @@ SilphCo7Text_51bc8: ret .asm_51bf0 xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a ret SilphCo7Text_51bf4: EventFlagAddress hl, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z cp $1 @@ -125,7 +125,7 @@ SilphCo7Script0: call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $f0 ld [wJoyIgnore], a ld a, PLAYER_DIR_DOWN @@ -137,10 +137,10 @@ SilphCo7Script0: ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, $9 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, $9 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF ld de, MovementData_51c7d ld a, [wCoordIndex] @@ -150,7 +150,7 @@ SilphCo7Script0: inc de .asm_51c6c ld a, $9 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $3 jp SilphCo7Text_51c10 @@ -174,7 +174,7 @@ SilphCo7Script3: xor a ld [wJoyIgnore], a ld a, $d - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 ld hl, wd72d @@ -212,12 +212,12 @@ SilphCo7Script4: ld a, PLAYER_DIR_DOWN ld [wPlayerMovingDirection], a ld a, $9 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a ld a, SPRITE_FACING_UP - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $f - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a @@ -230,7 +230,7 @@ SilphCo7Script4: ld de, MovementData_51d1a .asm_51d0e ld a, $9 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call MoveSprite ld a, $5 jp SilphCo7Text_51c10 diff --git a/scripts/SilphCo8F.asm b/scripts/SilphCo8F.asm index 71e529a6..0a10781e 100755 --- a/scripts/SilphCo8F.asm +++ b/scripts/SilphCo8F.asm @@ -35,7 +35,7 @@ SilphCo8Script_56541: ld a, [hl] ld c, a xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a pop hl .asm_5654d ld a, [hli] @@ -60,11 +60,11 @@ SilphCo8Script_56541: ret .asm_56569 xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a ret SilphCo8Script_5656d: - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z SetEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR diff --git a/scripts/SilphCo9F.asm b/scripts/SilphCo9F.asm index e1676bf2..7889e8f7 100755 --- a/scripts/SilphCo9F.asm +++ b/scripts/SilphCo9F.asm @@ -65,7 +65,7 @@ SilphCo9Script_5d837: ld a, [hl] ld c, a xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a pop hl .asm_5d843 ld a, [hli] @@ -90,12 +90,12 @@ SilphCo9Script_5d837: ret .asm_5d85f xor a - ld [hUnlockedSilphCoDoors], a + ldh [hUnlockedSilphCoDoors], a ret SilphCo9Script_5d863: EventFlagAddress hl, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 - ld a, [hUnlockedSilphCoDoors] + ldh a, [hUnlockedSilphCoDoors] and a ret z cp $1 diff --git a/scripts/TradeCenter.asm b/scripts/TradeCenter.asm index e7fa8ac8..b91996e0 100755 --- a/scripts/TradeCenter.asm +++ b/scripts/TradeCenter.asm @@ -1,14 +1,14 @@ TradeCenter_Script: call EnableAutoTextBoxDrawing - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK ld a, SPRITE_FACING_LEFT jr z, .next ld a, SPRITE_FACING_RIGHT .next - ld [hSpriteFacingDirection], a + ldh [hSpriteFacingDirection], a ld a, $1 - ld [hSpriteIndex], a + ldh [hSpriteIndex], a call SetSpriteFacingDirection ld hl, wd72d bit 0, [hl] @@ -21,7 +21,7 @@ TradeCenter_Script: ld [hl], a ld a, SPRITE_FACING_LEFT ld [wSprite01StateData1FacingDirection], a - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK ret z ld a, $7 diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm index 127ee16a..9178cd65 100755 --- a/scripts/VermilionCity.asm +++ b/scripts/VermilionCity.asm @@ -15,7 +15,7 @@ VermilionCity_Script: .setFirstLockTrashCanIndex call Random - ld a, [hRandomSub] + ldh a, [hRandomSub] and $e ld [wFirstLockTrashCanIndex], a ret @@ -45,10 +45,10 @@ VermilionCityScript0: call ArePlayerCoordsInArray ret nc xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld [wcf0d], a ld a, $3 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID CheckEvent EVENT_SS_ANNE_LEFT jr nz, .shipHasDeparted @@ -98,7 +98,7 @@ VermilionCityScript3: ret nz xor a ld [wJoyIgnore], a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $0 ld [wVermilionCityCurScript], a ret diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm index 2c39bdb8..d1a60988 100755 --- a/scripts/VermilionDock.asm +++ b/scripts/VermilionDock.asm @@ -57,12 +57,12 @@ VermilionDock_1db9b: ld a, $14 ; water tile call FillMemory ld a, 1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call Delay3 xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld [wSSAnneSmokeDriftAmount], a - ld [rOBP1], a + ldh [rOBP1], a ld a, 88 ld [wSSAnneSmokeX], a ld hl, wMapViewVRAMPointer @@ -104,11 +104,11 @@ VermilionDock_1db9b: dec e jr nz, .asm_1dbfa xor a - ld [rWY], a - ld [hWY], a + ldh [rWY], a + ldh [hWY], a call VermilionDock_EraseSSAnne ld a, $90 - ld [hWY], a + ldh [hWY], a ld a, $1 ld [wUpdateSpritesEnabled], a pop hl @@ -167,13 +167,13 @@ VermilionDock_1dc7c: ld h, $0 ld l, $80 .asm_1dc86 - ld a, [rLY] + ldh a, [rLY] cp l jr nz, .asm_1dc86 ld a, h - ld [rSCX], a + ldh [rSCX], a .asm_1dc8e - ld a, [rLY] + ldh a, [rLY] cp h jr z, .asm_1dc8e ret diff --git a/scripts/VermilionGym.asm b/scripts/VermilionGym.asm index 10967cbe..45b200e2 100755 --- a/scripts/VermilionGym.asm +++ b/scripts/VermilionGym.asm @@ -63,20 +63,20 @@ VermilionGymLTSurgePostBattle: VermilionGymReceiveTM24: ld a, $6 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_LT_SURGE lb bc, TM_THUNDERBOLT, 1 call GiveItem jr nc, .BagFull ld a, $7 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_TM24 jr .gymVictory .BagFull ld a, $8 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges @@ -150,14 +150,14 @@ LTSurgeText: ld hl, ReceivedThunderbadgeText ld de, ReceivedThunderbadgeText call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $3 ld [wGymLeaderNo], a xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a ld a, $3 ; set script index to LT Surge post-battle script ld [wVermilionGymCurScript], a ld [wCurMapScript], a diff --git a/scripts/ViridianCity.asm b/scripts/ViridianCity.asm index 2a86374e..62d98c4c 100755 --- a/scripts/ViridianCity.asm +++ b/scripts/ViridianCity.asm @@ -30,10 +30,10 @@ ViridianCityScript_1900b: cp $20 ret nz ld a, $e - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a call ViridianCityScript_190cf ld a, $3 ld [wViridianCityCurScript], a @@ -49,10 +49,10 @@ ViridianCityScript_1903d: cp $13 ret nz ld a, $5 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a - ld [hJoyHeld], a + ldh [hJoyHeld], a call ViridianCityScript_190cf ld a, $3 ld [wViridianCityCurScript], a @@ -60,13 +60,13 @@ ViridianCityScript_1903d: ViridianCityScript1: ld a, [wSprite03StateData1YPixels] - ld [hSpriteScreenYCoord], a + ldh [hSpriteScreenYCoord], a ld a, [wSprite03StateData1XPixels] - ld [hSpriteScreenXCoord], a + ldh [hSpriteScreenXCoord], a ld a, [wSprite03StateData2MapY] - ld [hSpriteMapYCoord], a + ldh [hSpriteMapYCoord], a ld a, [wSprite03StateData2MapX] - ld [hSpriteMapXCoord], a + ldh [hSpriteMapXCoord], a xor a ld [wListScrollOffset], a @@ -82,20 +82,20 @@ ViridianCityScript1: ret ViridianCityScript2: - ld a, [hSpriteScreenYCoord] + ldh a, [hSpriteScreenYCoord] ld [wSprite03StateData1YPixels], a - ld a, [hSpriteScreenXCoord] + ldh a, [hSpriteScreenXCoord] ld [wSprite03StateData1XPixels], a - ld a, [hSpriteMapYCoord] + ldh a, [hSpriteMapYCoord] ld [wSprite03StateData2MapY], a - ld a, [hSpriteMapXCoord] + ldh a, [hSpriteMapXCoord] ld [wSprite03StateData2MapX], a call UpdateSprites call Delay3 xor a ld [wJoyIgnore], a ld a, $f - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wBattleType], a diff --git a/scripts/ViridianGym.asm b/scripts/ViridianGym.asm index 05430332..fafc6388 100755 --- a/scripts/ViridianGym.asm +++ b/scripts/ViridianGym.asm @@ -138,20 +138,20 @@ ViridianGymScript3: ld [wJoyIgnore], a ViridianGymScript3_74995: ld a, $c - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI lb bc, TM_FISSURE, 1 call GiveItem jr nc, .BagFull ld a, $d - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_TM27 jr .gymVictory .BagFull ld a, $e - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges @@ -289,7 +289,7 @@ ViridianGymText1: ld hl, ViridianGymText_74ad3 ld de, ViridianGymText_74ad3 call SaveEndBattleTextPointers - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/ViridianMart.asm b/scripts/ViridianMart.asm index 09ddfda9..ea1c373f 100755 --- a/scripts/ViridianMart.asm +++ b/scripts/ViridianMart.asm @@ -27,7 +27,7 @@ ViridianMart_ScriptPointers: ViridianMartScript0: call UpdateSprites ld a, $4 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wSimulatedJoypadStatesEnd ld de, RLEMovement1d4bb @@ -50,7 +50,7 @@ ViridianMartScript1: ret nz call Delay3 ld a, $5 - ld [hSpriteIndexOrTextID], a + ldh [hSpriteIndexOrTextID], a call DisplayTextID lb bc, OAKS_PARCEL, 1 call GiveItem diff --git a/scripts/WardensHouse.asm b/scripts/WardensHouse.asm index 474ba320..1cb68cf9 100755 --- a/scripts/WardensHouse.asm +++ b/scripts/WardensHouse.asm @@ -32,7 +32,7 @@ FuchsiaHouse2Text1: ld hl, WardenTeethText1 call PrintText ld a, GOLD_TEETH - ld [hItemToRemoveID], a + ldh [hItemToRemoveID], a callba RemoveItemByID SetEvent EVENT_GAVE_GOLD_TEETH .asm_60cba @@ -95,7 +95,7 @@ HM04NoRoomText: FuchsiaHouse2Text5: FuchsiaHouse2Text4: text_asm - ld a, [hSpriteIndex] + ldh a, [hSpriteIndex] cp $4 ld hl, FuchsiaHouse2Text_7517b jr nz, .asm_4c9a2 -- cgit v1.3.1-sl0p From dd08b8dd6b526cb191e921ba5a7b0b64d04d911f Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 6 Jul 2020 21:13:17 -0400 Subject: Use labels for HRAM and VRAM --- constants.asm | 3 - constants/gfx_constants.asm | 9 + hram.asm | 526 +++++++++++++++++++++++-------------------- layout.link | 6 + scripts/RocketHideoutB2F.asm | 4 +- vram.asm | 44 ++-- wram.asm | 5 + 7 files changed, 329 insertions(+), 268 deletions(-) (limited to 'scripts') diff --git a/constants.asm b/constants.asm index f52af60d..3d428283 100644 --- a/constants.asm +++ b/constants.asm @@ -2,9 +2,6 @@ INCLUDE "charmap.asm" INCLUDE "macros.asm" -INCLUDE "hram.asm" -INCLUDE "vram.asm" - INCLUDE "constants/hardware_constants.asm" INCLUDE "constants/oam_constants.asm" INCLUDE "constants/misc_constants.asm" diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 0cc0d98d..6446a51f 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -20,3 +20,12 @@ SPRITEBUFFERSIZE EQU 7 * 7 * LEN_1BPP_TILE HP_BAR_GREEN EQU 0 HP_BAR_YELLOW EQU 1 HP_BAR_RED EQU 2 + +; hAutoBGTransferEnabled +TRANSFERTOP EQU 0 +TRANSFERMIDDLE EQU 1 +TRANSFERBOTTOM EQU 2 + +; hRedrawRowOrColumnMode +REDRAW_COL EQU 1 +REDRAW_ROW EQU 2 diff --git a/hram.asm b/hram.asm index ee557050..59bf7780 100644 --- a/hram.asm +++ b/hram.asm @@ -1,370 +1,404 @@ -hDMARoutine EQU $FF80 +SECTION "HRAM", HRAM + +hDMARoutine:: ds 10 -hSoftReset EQU $FF8A ; Initialized to 16. ; Decremented each input iteration if the player ; presses the reset sequence (A+B+SEL+START). ; Soft reset when 0 is reached. +hSoftReset:: db -; base tile ID to which offsets are added -hBaseTileID EQU $FF8B - -; 3-byte BCD number -hItemPrice EQU $FF8B - -hDexWeight EQU $FF8B - -hWarpDestinationMap EQU $FF8B - -hOAMTile EQU $FF8B - -hROMBankTemp EQU $FF8B - -hPreviousTileset EQU $FF8B - -hEastWestConnectedMapWidth EQU $FF8B - -hSlideAmount EQU $FF8B +UNION +hBaseTileID:: ; base tile ID to which offsets are added +hDexWeight:: +hWarpDestinationMap:: +hOAMTile:: +hROMBankTemp:: +hPreviousTileset:: +hRLEByteValue:: + db -hRLEByteValue EQU $FF8B +hSpriteIndexOrTextID:: ; DisplayTextID's argument +hPartyMonIndex:: + db -hSpriteWidth EQU $FF8B ; in tiles -hSpriteInterlaceCounter EQU $FF8B -hSpriteHeight EQU $FF8C ; in tiles -hSpriteOffset EQU $FF8D +hVRAMSlot:: + db -; counters for blinking down arrow -hDownArrowBlinkCount1 EQU $FF8B -hDownArrowBlinkCount2 EQU $FF8C - -hSpriteDataOffset EQU $FF8B -hSpriteIndex EQU $FF8C - -hMapStride EQU $FF8B -hMapWidth EQU $FF8C +hFourTileSpriteCount:: +hHalveItemPrices:: + db -hNorthSouthConnectionStripWidth EQU $FF8B -hNorthSouthConnectedMapWidth EQU $FF8C +NEXTU +hItemPrice:: ds 3 ; BCD number -; DisplayTextID's argument -hSpriteIndexOrTextID EQU $FF8C - -hPartyMonIndex EQU $FF8C +NEXTU +hSlideAmount:: db ; the total number of tiles being shifted each time the pic slides by one tile -hSlidingRegionSize EQU $FF8C - -; 2 bytes -hEnemySpeed EQU $FF8D - -hVRAMSlot EQU $FF8D - -hFourTileSpriteCount EQU $FF8E +hSlidingRegionSize:: db ; -1 = left ; 0 = right -hSlideDirection EQU $FF8D - -hSpriteFacingDirection EQU $FF8D - -hSpriteMovementByte2 EQU $FF8D - -hSpriteImageIndex EQU $FF8D - -hLoadSpriteTemp1 EQU $FF8D -hLoadSpriteTemp2 EQU $FF8E - -hHalveItemPrices EQU $FF8E - -hSpriteOffset2 EQU $FF8F - -hOAMBufferOffset EQU $FF90 - -hSpriteScreenX EQU $FF91 -hSpriteScreenY EQU $FF92 - -hFF8F EQU $FF8F -hFF90 EQU $FF90 -hFF91 EQU $FF91 -hFF92 EQU $FF92 - -hTilePlayerStandingOn EQU $FF93 - -hSpritePriority EQU $FF94 - -; 2 bytes -hSignCoordPointer EQU $FF95 - -hNPCMovementDirections2Index EQU $FF95 - -hSwapItemID EQU $FF95 -hSwapItemQuantity EQU $FF96 - -; CalcPositionOfPlayerRelativeToNPC -hNPCSpriteOffset EQU $FF95 - -; temp value used when swapping bytes or words -hSwapTemp EQU $FF95 - -hExperience EQU $FF96 ; 3 bytes, big endian - -hMutateWY EQU $FF96 -hMutateWX EQU $FF97 - -; Multiplication and division variables are meant -; to overlap for back-to-back usage. Big endian. +hSlideDirection:: db -hMultiplicand EQU $FF96 ; 3 bytes -hMultiplier EQU $FF99 ; 1 byte -hProduct EQU $FF95 ; 4 bytes - -hDividend EQU $FF95 ; 4 bytes -hDivisor EQU $FF99 ; 1 byte -hQuotient EQU $FF95 ; 4 bytes -hRemainder EQU $FF99 ; 1 byte - -hDivideBuffer EQU $FF9A - -hMultiplyBuffer EQU $FF9B +NEXTU +hSpriteInterlaceCounter:: +hSpriteWidth:: db ; in tiles +hSpriteHeight:: db ; in tiles +hSpriteOffset:: db +NEXTU +; counters for blinking down arrow +hDownArrowBlinkCount1:: db +hDownArrowBlinkCount2:: db + +NEXTU +hMapStride:: +hEastWestConnectedMapWidth:: +hNorthSouthConnectionStripWidth:: + db +hMapWidth:: +hNorthSouthConnectedMapWidth:: + db + +NEXTU +hSpriteDataOffset:: db +hSpriteIndex:: db +hSpriteImageIndex:: +hSpriteFacingDirection:: +hSpriteMovementByte2:: + db + +NEXTU + ds 2 +hLoadSpriteTemp1:: db +hLoadSpriteTemp2:: db + +NEXTU + ds 2 +hEnemySpeed:: dw +ENDU + +UNION +hSpriteOffset2:: db +hOAMBufferOffset:: db +hSpriteScreenX:: db +hSpriteScreenY:: db + +NEXTU +hFF8F:: db +hFF90:: db +hFF91:: db +hFF92:: db +ENDU + +hTilePlayerStandingOn:: db + +hSpritePriority:: db + +UNION +;; Multiplication and division variables are meant +;; to overlap for back-to-back usage. Big endian. +UNION + ds 1 +hMultiplicand:: ds 3 +hMultiplier:: db + ds 1 +hMultiplyBuffer:: ds 4 +NEXTU +hProduct:: ds 4 +NEXTU +hDividend:: ds 4 +hDivisor:: db +hDivideBuffer:: ds 5 +NEXTU +hQuotient:: ds 4 +hRemainder:: db +ENDU + +NEXTU ; PrintNumber (big endian). -hPastLeadingZeros EQU $FF95 ; last char printed -hNumToPrint EQU $FF96 ; 3 bytes -hPowerOf10 EQU $FF99 ; 3 bytes -hSavedNumToPrint EQU $FF9C ; 3 bytes - +hPastLeadingZeros:: db ; last char printed +hNumToPrint:: ds 3 +hPowerOf10:: ds 3 +hSavedNumToPrint:: ds 3 + +NEXTU +hNPCMovementDirections2Index:: +hNPCSpriteOffset:: ; distance in steps between NPC and player -hNPCPlayerYDistance EQU $FF95 -hNPCPlayerXDistance EQU $FF96 - -hFindPathNumSteps EQU $FF97 - +hNPCPlayerYDistance:: + db +hNPCPlayerXDistance:: + db +hFindPathNumSteps:: db ; bit 0: set when the end of the path's Y coordinate matches the target's ; bit 1: set when the end of the path's X coordinate matches the target's ; When both bits are set, the end of the path is at the target's position ; (i.e. the path has been found). -hFindPathFlags EQU $FF98 - -hFindPathYProgress EQU $FF99 -hFindPathXProgress EQU $FF9A - +hFindPathFlags:: db +hFindPathYProgress:: db +hFindPathXProgress:: db ; 0 = from player to NPC ; 1 = from NPC to player -hNPCPlayerRelativePosPerspective EQU $FF9B - +hNPCPlayerRelativePosPerspective:: db + ds 1 ; bit 0: ; 0 = target is to the south or aligned ; 1 = target is to the north ; bit 1: ; 0 = target is to the east or aligned ; 1 = target is to the west -hNPCPlayerRelativePosFlags EQU $FF9D - -; some code zeroes this for no reason when writing a coin amount -hUnusedCoinsByte EQU $FF9F - -hMoney EQU $FF9F ; 3-byte BCD number -hCoins EQU $FFA0 ; 2-byte BCD number - -hDivideBCDDivisor EQU $FFA2 ; 3-byte BCD number -hDivideBCDQuotient EQU $FFA2 ; 3-byte BCD number -hDivideBCDBuffer EQU $FFA5 ; 3-byte BCD number +hNPCPlayerRelativePosFlags:: db -hSerialReceivedNewData EQU $FFA9 - -; $01 = using external clock -; $02 = using internal clock -; $ff = establishing connection -hSerialConnectionStatus EQU $FFAA +NEXTU +hSwapItemID:: db +hSwapItemQuantity:: db -hSerialIgnoringInitialData EQU $FFAB +NEXTU +hSignCoordPointer:: dw -hSerialSendData EQU $FFAC +NEXTU + ds 1 +hMutateWY:: db +hMutateWX:: db -hSerialReceiveData EQU $FFAD +NEXTU +; temp value used when swapping bytes or words +hSwapTemp:: db +hExperience:: ds 3 ; big endian +ENDU -; these values are copied to SCX, SCY, and WY during V-blank -hSCX EQU $FFAE -hSCY EQU $FFAF -hWY EQU $FFB0 +UNION +hMoney:: ds 3 ; BCD number +NEXTU +; some code zeroes this for no reason when writing a coin amount +hUnusedCoinsByte:: db +hCoins:: ds 2 ; BCD number +ENDU -hJoyLast EQU $FFB1 -hJoyReleased EQU $FFB2 -hJoyPressed EQU $FFB3 -hJoyHeld EQU $FFB4 -hJoy5 EQU $FFB5 -hJoy6 EQU $FFB6 -hJoy7 EQU $FFB7 +hDivideBCDDivisor:: +hDivideBCDQuotient:: + ds 3 ; BCD number +hDivideBCDBuffer:: + ds 3 ; BCD number -hLoadedROMBank EQU $FFB8 + ds 1 -hSavedROMBank EQU $FFB9 +hSerialReceivedNewData:: db +; $01 = using external clock +; $02 = using internal clock +; $ff = establishing connection +hSerialConnectionStatus:: db +hSerialIgnoringInitialData:: db +hSerialSendData:: db +hSerialReceiveData:: db + +; these values are copied to rSCX, rSCY, and rWY during V-blank +hSCX:: db +hSCY:: db +hWY:: db + +hJoyLast:: db +hJoyReleased:: db +hJoyPressed:: db +hJoyHeld:: db +hJoy5:: db +hJoy6:: db +hJoy7:: db + +hLoadedROMBank:: db +hSavedROMBank:: db ; is automatic background transfer during V-blank enabled? ; if nonzero, yes ; if zero, no -hAutoBGTransferEnabled EQU $FFBA - -TRANSFERTOP EQU 0 -TRANSFERMIDDLE EQU 1 -TRANSFERBOTTOM EQU 2 +hAutoBGTransferEnabled:: db ; 00 = top third of background ; 01 = middle third of background ; 02 = bottom third of background -hAutoBGTransferPortion EQU $FFBB +hAutoBGTransferPortion:: db ; the destination address of the automatic background transfer -hAutoBGTransferDest EQU $FFBC ; 2 bytes +hAutoBGTransferDest:: dw -hRedrawMapViewRowOffset EQU $FFBE +hRedrawMapViewRowOffset:: db ; temporary storage for stack pointer during memory transfers that use pop ; to increase speed -hSPTemp EQU $FFBF ; 2 bytes +hSPTemp:: dw ; source address for VBlankCopyBgMap function ; the first byte doubles as the byte that enabled the transfer. ; if it is 0, the transfer is disabled ; if it is not 0, the transfer is enabled ; this means that XX00 is not a valid source address -hVBlankCopyBGSource EQU $FFC1 ; 2 bytes +hVBlankCopyBGSource:: dw ; destination address for VBlankCopyBgMap function -hVBlankCopyBGDest EQU $FFC3 ; 2 bytes +hVBlankCopyBGDest:: dw ; number of rows for VBlankCopyBgMap to copy -hVBlankCopyBGNumRows EQU $FFC5 +hVBlankCopyBGNumRows:: db ; size of VBlankCopy transfer in 16-byte units -hVBlankCopySize EQU $FFC6 +hVBlankCopySize:: db ; source address for VBlankCopy function -hVBlankCopySource EQU $FFC7 +hVBlankCopySource:: dw ; destination address for VBlankCopy function -hVBlankCopyDest EQU $FFC9 +hVBlankCopyDest:: dw ; size of source data for VBlankCopyDouble in 8-byte units -hVBlankCopyDoubleSize EQU $FFCB +hVBlankCopyDoubleSize:: db ; source address for VBlankCopyDouble function -hVBlankCopyDoubleSource EQU $FFCC +hVBlankCopyDoubleSource:: dw ; destination address for VBlankCopyDouble function -hVBlankCopyDoubleDest EQU $FFCE +hVBlankCopyDoubleDest:: dw ; controls whether a row or column of 2x2 tile blocks is redrawn in V-blank ; 00 = no redraw ; 01 = redraw column ; 02 = redraw row -hRedrawRowOrColumnMode EQU $FFD0 - -REDRAW_COL EQU 1 -REDRAW_ROW EQU 2 +hRedrawRowOrColumnMode:: db -hRedrawRowOrColumnDest EQU $FFD1 +hRedrawRowOrColumnDest:: dw -hRandomAdd EQU $FFD3 -hRandomSub EQU $FFD4 +hRandomAdd:: db +hRandomSub:: db -hFrameCounter EQU $FFD5 ; decremented every V-blank (used for delays) +hFrameCounter:: db ; decremented every V-blank (used for delays) ; V-blank sets this to 0 each time it runs. ; So, by setting it to a nonzero value and waiting for it to become 0 again, ; you can detect that the V-blank handler has run since then. -hVBlankOccurred EQU $FFD6 +hVBlankOccurred:: db ; 00 = indoor ; 01 = cave ; 02 = outdoor ; this is often set to 00 in order to turn off water and flower BG tile animations -hTilesetType EQU $FFD7 +hTilesetType:: db -hMovingBGTilesCounter1 EQU $FFD8 +hMovingBGTilesCounter1:: db -hCurrentSpriteOffset EQU $FFDA ; multiple of $10 + ds 1 -hItemCounter EQU $FFDB +hCurrentSpriteOffset:: db ; multiple of $10 -hGymGateIndex EQU $FFDB -hGymGateAnswer EQU $FFDC +UNION +hPlayerFacing:: db +hPlayerYCoord:: db +hPlayerXCoord:: db -hGymTrashCanRandNumMask EQU $FFDB - -hDexRatingNumMonsSeen EQU $FFDB -hDexRatingNumMonsOwned EQU $FFDC +NEXTU ; $00 = bag full ; $01 = got item ; $80 = didn't meet required number of owned mons ; $FF = player cancelled -hOaksAideResult EQU $FFDB - -hSavedCoordIndex EQU $FFDB +hOaksAideResult:: +hOaksAideRequirement:: ; required number of owned mons + db +hOaksAideRewardItem:: db +hOaksAideNumMonsOwned:: db + +NEXTU +hVendingMachineItem:: db +hVendingMachinePrice:: ds 3 ; BCD number + +NEXTU +hGymGateIndex:: db +hGymGateAnswer:: db + +NEXTU +hDexRatingNumMonsSeen:: db +hDexRatingNumMonsOwned:: db + +NEXTU +hItemToRemoveID:: db +hItemToRemoveIndex:: db + +NEXTU +hItemCounter:: +hSavedCoordIndex:: +hMissableObjectIndex:: +hGymTrashCanRandNumMask:: + db + +NEXTU +hFFDB:: db +hFFDC:: db +ENDU + + ds 1 + +hBackupGymGateIndex:: +hUnlockedSilphCoDoors:: + db -hOaksAideRequirement EQU $FFDB ; required number of owned mons -hOaksAideRewardItem EQU $FFDC -hOaksAideNumMonsOwned EQU $FFDD - -hPlayerFacing EQU $FFDB -hPlayerYCoord EQU $FFDC -hPlayerXCoord EQU $FFDD - -hMissableObjectIndex EQU $FFDB - -hItemToRemoveID EQU $FFDB -hItemToRemoveIndex EQU $FFDC - -hVendingMachineItem EQU $FFDB -hVendingMachinePrice EQU $FFDC ; 3-byte BCD number - -hFFDB EQU $FFDB -hFFDC EQU $FFDC - -hBackupGymGateIndex EQU $FFE0 +; the first tile ID in a sequence of tile IDs that increase by 1 each step +hStartTileID:: db -hUnlockedSilphCoDoors EQU $FFE0 + ds 2 -; the first tile ID in a sequence of tile IDs that increase by 1 each step -hStartTileID EQU $FFE1 +hNewPartyLength:: db -hNewPartyLength EQU $FFE4 +UNION +hDividend2:: db +hDivisor2:: db +hQuotient2:: db -hIsHiddenMissableObject EQU $FFE5 +NEXTU +hIsHiddenMissableObject:: db +ENDU -hDividend2 EQU $FFE5 -hDivisor2 EQU $FFE6 -hQuotient2 EQU $FFE7 +hMapROMBank:: db -hMapROMBank EQU $FFE8 +hSpriteVRAMSlotAndFacing:: db -hSpriteVRAMSlotAndFacing EQU $FFE9 +hCoordsInFrontOfPlayerMatch:: +hSpriteAnimFrameCounter:: + db -hCoordsInFrontOfPlayerMatch EQU $FFEA +UNION +hSpriteScreenYCoord:: db +hSpriteScreenXCoord:: db +hSpriteMapYCoord:: db +hSpriteMapXCoord:: db -hSpriteAnimFrameCounter EQU $FFEA +NEXTU +hItemAlreadyFound:: db + ds 2 +hDidntFindAnyHiddenObject:: db -hSpriteScreenYCoord EQU $FFEB -hSpriteScreenXCoord EQU $FFEC -hSpriteMapYCoord EQU $FFED -hSpriteMapXCoord EQU $FFEE +NEXTU + ds 1 +hSavedMapTextPtr:: dw + ds 1 +ENDU -hItemAlreadyFound EQU $FFEB -hDidntFindAnyHiddenObject EQU $FFEE + ds 4 -hSavedMapTextPtr EQU $FFEC +hWhoseTurn:: db ; 0 on player's turn, 1 on enemy's turn -hWhoseTurn EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn +hClearLetterPrintingDelayFlags:: db -hClearLetterPrintingDelayFlags EQU $FFF4 + ds 1 ; bit 0: draw HP fraction to the right of bar instead of below (for party menu) ; bit 1: menu is double spaced -hFlagsFFF6 EQU $FFF6 +hFlagsFFF6:: db + +hFieldMoveMonMenuTopMenuItemX:: db -hFieldMoveMonMenuTopMenuItemX EQU $FFF7 +hJoyInput:: db -hDisableJoypadPolling EQU $FFF9 +hDisableJoypadPolling:: db -hJoyInput EQU $FFF8 + ds 5 diff --git a/layout.link b/layout.link index d4473435..d56a7886 100644 --- a/layout.link +++ b/layout.link @@ -228,6 +228,9 @@ WRAM0 org $dfff "Stack" +VRAM + "VRAM" + SRAM $0 "Sprite Buffers" @@ -239,3 +242,6 @@ SRAM $2 SRAM $3 "Saved Boxes 2" + +HRAM + "HRAM" diff --git a/scripts/RocketHideoutB2F.asm b/scripts/RocketHideoutB2F.asm index 7a43e90e..95d8b0d2 100755 --- a/scripts/RocketHideoutB2F.asm +++ b/scripts/RocketHideoutB2F.asm @@ -376,7 +376,7 @@ ENDM FacilitySpinnerArrows: FACILITY_SPINNER EQU $20 * $10 -vFacilitySpinner EQU vTileset + FACILITY_SPINNER +vFacilitySpinner EQUS "vTileset + FACILITY_SPINNER" spinner SpinnerArrowAnimTiles, $00, 1, vFacilitySpinner spinner SpinnerArrowAnimTiles, $10, 1, vFacilitySpinner + $10 @@ -389,7 +389,7 @@ vFacilitySpinner EQU vTileset + FACILITY_SPINNER GymSpinnerArrows: GYM_SPINNER EQU $3c * $10 -vGymSpinner EQU vTileset + GYM_SPINNER +vGymSpinner EQUS "vTileset + GYM_SPINNER" spinner SpinnerArrowAnimTiles, $10, 1, vGymSpinner spinner SpinnerArrowAnimTiles, $30, 1, vGymSpinner + $10 diff --git a/vram.asm b/vram.asm index 05f3199e..d69d3f44 100644 --- a/vram.asm +++ b/vram.asm @@ -1,21 +1,31 @@ -vChars0 EQU $8000 -vChars1 EQU $8800 -vChars2 EQU $9000 -vBGMap0 EQU $9800 -vBGMap1 EQU $9c00 +SECTION "VRAM", VRAM -; Battle/Menu -vSprites EQU vChars0 -vFont EQU vChars1 -vFrontPic EQU vChars2 -vBackPic EQU vFrontPic + 7 * 7 * $10 +UNION +; generic +vChars0:: ds $800 +vChars1:: ds $800 +vChars2:: ds $800 +vBGMap0:: ds $400 +vBGMap1:: ds $400 -; Overworld -vNPCSprites EQU vChars0 -vNPCSprites2 EQU vChars1 -vTileset EQU vChars2 +NEXTU +; battle/menu +vSprites:: ds $800 +vFont:: ds $800 +vFrontPic:: ds 7 * 7 * $10 +vBackPic:: ds 7 * 7 * $10 -; Title -vTitleLogo EQU vChars1 -vTitleLogo2 EQU vFrontPic + 7 * 7 * $10 +NEXTU +; overworld +vNPCSprites:: ds $800 +vNPCSprites2:: ds $800 +vTileset:: ds $800 +NEXTU +; title + ds $800 +vTitleLogo:: ds $800 + ds 7 * 7 * $10 +vTitleLogo2:: ds $1e0 + +ENDU diff --git a/wram.asm b/wram.asm index c216a08c..36ea5d0b 100755 --- a/wram.asm +++ b/wram.asm @@ -3,6 +3,9 @@ INCLUDE "constants.asm" INCLUDE "macros/wram.asm" +INCLUDE "vram.asm" + + SECTION "WRAM Bank 0", WRAM0 wUnusedC000:: @@ -3112,3 +3115,5 @@ wStack:: INCLUDE "sram.asm" + +INCLUDE "hram.asm" -- cgit v1.3.1-sl0p From 77ed5f3820301f9f301f12bf2f201d9bdab9e7e1 Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 6 Jul 2020 21:15:12 -0400 Subject: Use ASCII quotes in comments --- engine/battle/animations.asm | 2 +- engine/battle/core.asm | 4 ++-- engine/events/hidden_objects/gym_statues.asm | 2 +- scripts/PalletTown.asm | 8 ++++---- wram.asm | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index c9f53961..f19f1f4f 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -425,7 +425,7 @@ ShareMoveAnimations: and a ret z - ; opponent’s turn + ; opponent's turn ld a, [wAnimationID] diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 24ae8dfc..8cb3cd0a 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -3255,14 +3255,14 @@ PrintGhostText: ldh a, [hWhoseTurn] and a jr nz, .Ghost - ld a, [wBattleMonStatus] ; player’s turn + ld a, [wBattleMonStatus] ; player's turn and SLP | (1 << FRZ) ret nz ld hl, ScaredText call PrintText xor a ret -.Ghost ; ghost’s turn +.Ghost ; ghost's turn ld hl, GetOutText call PrintText xor a diff --git a/engine/events/hidden_objects/gym_statues.asm b/engine/events/hidden_objects/gym_statues.asm index 1f592f2f..97b01a3a 100644 --- a/engine/events/hidden_objects/gym_statues.asm +++ b/engine/events/hidden_objects/gym_statues.asm @@ -1,6 +1,6 @@ GymStatues: ; if in a gym and have the corresponding badge, a = GymStatueText2_id and jp PrintPredefTextID -; if in a gym and don’t have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID +; if in a gym and don't have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID ; else ret call EnableAutoTextBoxDrawing ld a, [wSpritePlayerStateData1FacingDirection] diff --git a/scripts/PalletTown.asm b/scripts/PalletTown.asm index 5c4c4de8..5c26fc55 100755 --- a/scripts/PalletTown.asm +++ b/scripts/PalletTown.asm @@ -31,7 +31,7 @@ PalletTownScript0: call PlaySound ld a, BANK(Music_MeetProfOak) ld c, a - ld a, MUSIC_MEET_PROF_OAK ; “oak appears” music + ld a, MUSIC_MEET_PROF_OAK ; "oak appears" music call PlayMusic ld a, $FC ld [wJoyIgnore], a @@ -76,7 +76,7 @@ PalletTownScript2: predef CalcPositionOfPlayerRelativeToNPC ld hl, hNPCPlayerYDistance dec [hl] - predef FindPathToPlayer ; load Oak’s movement into wNPCMovementDirections2 + predef FindPathToPlayer ; load Oak's movement into wNPCMovementDirections2 ld de, wNPCMovementDirections2 ld a, 1 ; oak ldh [hSpriteIndex], a @@ -205,10 +205,10 @@ PalletTownText5: ; sign by fence text_far _PalletTownText5 text_end -PalletTownText6: ; sign by Red’s house +PalletTownText6: ; sign by Red's house text_far _PalletTownText6 text_end -PalletTownText7: ; sign by Blue’s house +PalletTownText7: ; sign by Blue's house text_far _PalletTownText7 text_end diff --git a/wram.asm b/wram.asm index 36ea5d0b..ab0d25d2 100755 --- a/wram.asm +++ b/wram.asm @@ -2295,7 +2295,7 @@ wCurrentTileBlockMapViewPointer:: ds 2 wYCoord:: -; player’s position on the current map +; player's position on the current map ds 1 wXCoord:: -- cgit v1.3.1-sl0p From 06db7ec55bbc87ed18db72a53fb20fa7b4da9b29 Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 6 Jul 2020 21:18:22 -0400 Subject: callba/callab -> farcall/callfar; jpba/jpab -> farjp/jpfar --- engine/battle/common_text.asm | 8 ++-- engine/battle/core.asm | 58 ++++++++++++++-------------- engine/battle/effects.asm | 28 +++++++------- engine/battle/end_of_battle.asm | 2 +- engine/battle/experience.asm | 16 ++++---- engine/battle/ghost_marowak_anim.asm | 2 +- engine/battle/init_battle_variables.asm | 2 +- engine/battle/link_battle_versus_text.asm | 2 +- engine/battle/move_effects/drain_hp.asm | 2 +- engine/battle/move_effects/focus_energy.asm | 4 +- engine/battle/move_effects/leech_seed.asm | 4 +- engine/battle/move_effects/mist.asm | 4 +- engine/battle/move_effects/paralyze.asm | 12 +++--- engine/battle/move_effects/substitute.asm | 2 +- engine/battle/scroll_draw_trainer_pic.asm | 2 +- engine/battle/trainer_ai.asm | 6 +-- engine/battle/wild_encounters.asm | 4 +- engine/events/cinnabar_lab.asm | 2 +- engine/events/diploma.asm | 4 +- engine/events/evolve_trade.asm | 2 +- engine/events/give_pokemon.asm | 4 +- engine/events/hidden_objects/bookshelves.asm | 2 +- engine/events/hidden_objects/town_map.asm | 2 +- engine/events/in_game_trades.asm | 6 +-- engine/events/pokecenter.asm | 2 +- engine/events/pokedex_rating.asm | 2 +- engine/events/pokemart.asm | 4 +- engine/events/saffron_guards.asm | 2 +- engine/items/item_effects.asm | 28 +++++++------- engine/items/town_map.asm | 2 +- engine/link/cable_club.asm | 10 ++--- engine/link/cable_club_npc.asm | 4 +- engine/menus/league_pc.asm | 4 +- engine/menus/naming_screen.asm | 8 ++-- engine/menus/party_menu.asm | 6 +-- engine/menus/pc.asm | 10 ++--- engine/menus/pokedex.asm | 4 +- engine/menus/save.asm | 2 +- engine/menus/start_sub_menus.asm | 4 +- engine/movie/credits.asm | 4 +- engine/movie/intro.asm | 4 +- engine/movie/oak_speech/clear_save.asm | 2 +- engine/movie/title.asm | 8 ++-- engine/movie/trade.asm | 4 +- engine/overworld/cut.asm | 2 +- engine/overworld/dust_smoke.asm | 2 +- engine/overworld/player_state.asm | 2 +- engine/overworld/push_boulder.asm | 2 +- engine/pokemon/add_mon.asm | 4 +- engine/pokemon/bills_pc.asm | 2 +- engine/pokemon/evos_moves.asm | 2 +- engine/pokemon/learn_move.asm | 2 +- engine/pokemon/load_mon_data.asm | 2 +- engine/pokemon/status_screen.asm | 6 +-- engine/slots/game_corner_slots.asm | 2 +- home.asm | 30 +++++++------- home/move_mon.asm | 4 +- home/overworld.asm | 40 +++++++++---------- home/pokemon.asm | 6 +-- home/serial.asm | 2 +- home/start_menu.asm | 4 +- home/text_script.asm | 10 ++--- home/trainers.asm | 6 +-- home/vblank.asm | 2 +- macros/farcall.asm | 10 ++--- scripts/BikeShop.asm | 2 +- scripts/CeladonMansion3F.asm | 2 +- scripts/CeladonMartElevator.asm | 2 +- scripts/CeladonMartRoof.asm | 2 +- scripts/CeruleanCity.asm | 4 +- scripts/ChampionsRoom.asm | 2 +- scripts/CinnabarLabFossilRoom.asm | 4 +- scripts/CopycatsHouse2F.asm | 2 +- scripts/Daycare.asm | 6 +-- scripts/HallOfFame.asm | 2 +- scripts/NameRatersHouse.asm | 2 +- scripts/OaksLab.asm | 6 +-- scripts/PokemonTower2F.asm | 2 +- scripts/RocketHideoutElevator.asm | 2 +- scripts/Route22.asm | 6 +-- scripts/Route5Gate.asm | 4 +- scripts/Route6Gate.asm | 2 +- scripts/Route7Gate.asm | 2 +- scripts/Route8Gate.asm | 2 +- scripts/SSAnne2F.asm | 2 +- scripts/SilphCo7F.asm | 2 +- scripts/SilphCoElevator.asm | 2 +- scripts/VermilionDock.asm | 2 +- scripts/ViridianGym.asm | 2 +- scripts/WardensHouse.asm | 2 +- 90 files changed, 251 insertions(+), 253 deletions(-) (limited to 'scripts') diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm index b65bb84b..9f6f90b6 100644 --- a/engine/battle/common_text.asm +++ b/engine/battle/common_text.asm @@ -24,7 +24,7 @@ PrintBeginningBattleText: ld hl, TrainerWantsToFightText .wildBattle push hl - callab DrawAllPokeballs + callfar DrawAllPokeballs pop hl call PrintText jr .done @@ -38,7 +38,7 @@ PrintBeginningBattleText: ld a, b and a jr z, .noSilphScope - callab LoadEnemyMonData + callfar LoadEnemyMonData jr .notPokemonTower .noSilphScope ld hl, EnemyAppearedText @@ -54,8 +54,8 @@ PrintBeginningBattleText: call PrintText ld hl, UnveiledGhostText call PrintText - callab LoadEnemyMonData - callab MarowakAnim + callfar LoadEnemyMonData + callfar MarowakAnim ld hl, WildMonAppearedText call PrintText diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 8cb3cd0a..4d999d2a 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -97,7 +97,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ld b, SET_PAL_BATTLE call RunPaletteCommand call HideSprites - jpab PrintBeginningBattleText + jpfar PrintBeginningBattleText ; when a battle is starting, silhouettes of the player's pic and the enemy's pic are slid onto the screen ; the lower of the player's pic (his body) is part of the background, but his head is a sprite @@ -178,7 +178,7 @@ StartBattle: ld hl, .outOfSafariBallsText jp PrintText .notOutOfSafariBalls - callab PrintSafariZoneBattleText + callfar PrintSafariZoneBattleText ld a, [wEnemyMonSpeed + 1] add a ld b, a ; init b (which is later compared with random value) to (enemy speed % 256) * 2 @@ -267,7 +267,7 @@ EnemyRan: call PlaySoundWaitForCurrent xor a ldh [hWhoseTurn], a - jpab AnimationSlideEnemyMonOff + jpfar AnimationSlideEnemyMonOff WildRanText: text_far _WildRanText @@ -365,7 +365,7 @@ MainInBattleLoop: jr nz, .specialMoveNotUsed ld [wPlayerSelectedMove], a .specialMoveNotUsed - callab SwitchEnemyMon + callfar SwitchEnemyMon .noLinkBattle ld a, [wPlayerSelectedMove] cp QUICK_ATTACK @@ -413,7 +413,7 @@ MainInBattleLoop: .enemyMovesFirst ld a, $1 ldh [hWhoseTurn], a - callab TrainerAI + callfar TrainerAI jr c, .AIActionUsedEnemyFirst call ExecuteEnemyMove ld a, [wEscapedFromBattle] @@ -451,7 +451,7 @@ MainInBattleLoop: call DrawHUDsAndHPBars ld a, $1 ldh [hWhoseTurn], a - callab TrainerAI + callfar TrainerAI jr c, .AIActionUsedPlayerFirst call ExecuteEnemyMove ld a, [wEscapedFromBattle] @@ -837,7 +837,7 @@ FaintEnemyPokemon: .giveExpToMonsThatFought xor a ld [wBoostExpByExpAll], a - callab GainExperience + callfar GainExperience pop af ret z ; return if no exp all @@ -855,7 +855,7 @@ FaintEnemyPokemon: jr nz, .gainExpFlagsLoop ld a, b ld [wPartyGainExpFlags], a - jpab GainExperience + jpfar GainExperience EnemyMonFaintedText: text_far _EnemyMonFaintedText @@ -893,7 +893,7 @@ ReplaceFaintedEnemyMon: ld hl, wEnemyHPBarColor ld e, $30 call GetBattleHealthBarColor - callab DrawEnemyPokeballs + callfar DrawEnemyPokeballs ld a, [wLinkState] cp LINK_STATE_BATTLING jr nz, .notLinkBattle @@ -1720,7 +1720,7 @@ LoadEnemyMonFromParty: ret SendOutMon: - callab PrintSendOutMonMessage + callfar PrintSendOutMonMessage ld hl, wEnemyMonHP ld a, [hli] or [hl] ; is enemy mon HP zero? @@ -1816,7 +1816,7 @@ DrawPlayerHUDAndHPBar: coord hl, 9, 7 lb bc, 5, 11 call ClearScreenArea - callab PlacePlayerHUDTiles + callfar PlacePlayerHUDTiles coord hl, 18, 9 ld [hl], $73 ld de, wBattleMonNick @@ -1877,7 +1877,7 @@ DrawEnemyHUDAndHPBar: coord hl, 0, 0 lb bc, 4, 12 call ClearScreenArea - callab PlaceEnemyHUDTiles + callfar PlaceEnemyHUDTiles ld de, wEnemyMonNick coord hl, 1, 0 call CenterMonName @@ -2411,7 +2411,7 @@ PartyMenuOrRockOrRun: ; fall through to SwitchPlayerMon SwitchPlayerMon: - callab RetreatMon + callfar RetreatMon ld c, 50 call DelayFrames call AnimateRetreatingPlayerMon @@ -2464,7 +2464,7 @@ MoveSelectionMenu: ld de, wMoves ld bc, NUM_MOVES call CopyData - callab FormatMovesString + callfar FormatMovesString ret .writemoves @@ -2860,7 +2860,7 @@ PrintMenuItem: ld [wWhichPokemon], a ld a, BATTLE_MON_DATA ld [wMonDataLocation], a - callab GetMaxPP + callfar GetMaxPP ld hl, wCurrentMenuItem ld c, [hl] inc [hl] @@ -2955,7 +2955,7 @@ SelectEnemyMove: ld a, [wIsInBattle] dec a jr z, .chooseRandomMove ; wild encounter - callab AIEnemyTrainerChooseMoves + callfar AIEnemyTrainerChooseMoves .chooseRandomMove push hl call BattleRandom @@ -3020,7 +3020,7 @@ LinkBattleExchangeData: ld a, b .doExchange ld [wSerialExchangeNybbleSendData], a - callab PrintWaitingText + callfar PrintWaitingText .syncLoop1 call Serial_ExchangeNybble call DelayFrame @@ -3196,7 +3196,7 @@ MirrorMoveCheck: .moveDidNotMiss call ApplyAttackToEnemyPokemon call PrintCriticalOHKOText - callab DisplayEffectiveness + callfar DisplayEffectiveness ld a, 1 ld [wMoveDidntMiss], a .notDone @@ -4988,7 +4988,7 @@ AttackSubstitute: ldh a, [hWhoseTurn] xor $01 ldh [hWhoseTurn], a - callab HideSubstituteShowMonAnim ; animate the substitute breaking + callfar HideSubstituteShowMonAnim ; animate the substitute breaking ; flip the turn back to the way it was ldh a, [hWhoseTurn] xor $01 @@ -5726,7 +5726,7 @@ EnemyCheckIfMirrorMoveEffect: .moveDidNotMiss call ApplyAttackToPlayerPokemon call PrintCriticalOHKOText - callab DisplayEffectiveness + callfar DisplayEffectiveness ld a, 1 ld [wMoveDidntMiss], a .handleExplosionMiss @@ -6254,14 +6254,14 @@ DoBattleTransitionAndInitBattleVariables: ; link battle xor a ld [wMenuJoypadPollCount], a - callab DisplayLinkBattleVersusTextBox + callfar DisplayLinkBattleVersusTextBox ld a, $1 ld [wUpdateSpritesEnabled], a call ClearScreen .next call DelayFrame predef BattleTransition - callab LoadHudAndHpBarAndStatusTilePatterns + callfar LoadHudAndHpBarAndStatusTilePatterns ld a, $1 ldh [hAutoBGTransferEnabled], a ld a, $ff @@ -6359,11 +6359,11 @@ LoadPlayerBackPic: ; does nothing since no stats are ever selected (barring glitches) DoubleOrHalveSelectedStats: - callab DoubleSelectedStats - jpab HalveSelectedStats + callfar DoubleSelectedStats + jpfar HalveSelectedStats ScrollTrainerPicAfterBattle: - jpab _ScrollTrainerPicAfterBattle + jpfar _ScrollTrainerPicAfterBattle ApplyBurnAndParalysisPenaltiesToPlayer: ld a, $1 @@ -6747,7 +6747,7 @@ DetermineWildOpponent: ld a, [wNumberOfNoRandomBattleStepsLeft] and a ret nz - callab TryDoWildEncounter + callfar TryDoWildEncounter ret nz InitBattleCommon: ld a, [wMapPalOffset] @@ -6756,13 +6756,13 @@ InitBattleCommon: ld a, [hl] push af res 1, [hl] - callab InitBattleVariables + callfar InitBattleVariables ld a, [wEnemyMonSpecies2] sub OPP_ID_OFFSET jp c, InitWildBattle ld [wTrainerClass], a call GetTrainerInformation - callab ReadTrainer + callfar ReadTrainer call DoBattleTransitionAndInitBattleVariables call _LoadTrainerPic xor a @@ -6857,7 +6857,7 @@ _InitBattleCommon: dec a ; is it a wild battle? call z, DrawEnemyHUDAndHPBar ; draw enemy HUD and HP bar if it's a wild battle call StartBattle - callab EndOfBattle + callfar EndOfBattle pop af ld [wLetterPrintingDelayFlags], a pop af diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index c3a2a213..fe050937 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -170,7 +170,7 @@ BadlyPoisonedText: text_end DrainHPEffect: - jpab DrainHPEffect_ + jpfar DrainHPEffect_ ExplodeEffect: ld hl, wBattleMonHP @@ -987,7 +987,7 @@ FlinchSideEffect: ret OneHitKOEffect: - jpab OneHitKOEffect_ + jpfar OneHitKOEffect_ ChargeEffect: ld hl, wPlayerBattleStatus1 @@ -1097,13 +1097,13 @@ TrappingEffect: ret MistEffect: - jpab MistEffect_ + jpfar MistEffect_ FocusEnergyEffect: - jpab FocusEnergyEffect_ + jpfar FocusEnergyEffect_ RecoilEffect: - jpab RecoilEffect_ + jpfar RecoilEffect_ ConfusionSideEffect: call BattleRandom @@ -1157,10 +1157,10 @@ ConfusionEffectFailed: jp ConditionalPrintButItFailed ParalyzeEffect: - jpab ParalyzeEffect_ + jpfar ParalyzeEffect_ SubstituteEffect: - jpab SubstituteEffect_ + jpfar SubstituteEffect_ HyperBeamEffect: ld hl, wPlayerBattleStatus2 @@ -1271,7 +1271,7 @@ MimicLearnedMoveText: text_end LeechSeedEffect: - jpab LeechSeedEffect_ + jpfar LeechSeedEffect_ SplashEffect: call PlayCurrentMoveAnimation @@ -1365,22 +1365,22 @@ MoveWasDisabledText: text_end PayDayEffect: - jpab PayDayEffect_ + jpfar PayDayEffect_ ConversionEffect: - jpab ConversionEffect_ + jpfar ConversionEffect_ HazeEffect: - jpab HazeEffect_ + jpfar HazeEffect_ HealEffect: - jpab HealEffect_ + jpfar HealEffect_ TransformEffect: - jpab TransformEffect_ + jpfar TransformEffect_ ReflectLightScreenEffect: - jpab ReflectLightScreenEffect_ + jpfar ReflectLightScreenEffect_ NothingHappenedText: text_far _NothingHappenedText diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm index f490c34d..aa96f31d 100755 --- a/engine/battle/end_of_battle.asm +++ b/engine/battle/end_of_battle.asm @@ -10,7 +10,7 @@ EndOfBattle: ld a, [wEnemyMonStatus] ld [hl], a call ClearScreen - callab DisplayLinkBattleVersusTextBox + callfar DisplayLinkBattleVersusTextBox ld a, [wBattleResult] cp $1 ld de, YouWinText diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm index 2e21d874..0eab6e08 100644 --- a/engine/battle/experience.asm +++ b/engine/battle/experience.asm @@ -117,7 +117,7 @@ GainExperience: ld [wd0b5], a call GetMonHeader ld d, MAX_LEVEL - callab CalcExperience ; get max exp + callfar CalcExperience ; get max exp ; compare max exp with current exp ldh a, [hExperience] ld b, a @@ -155,7 +155,7 @@ GainExperience: ld bc, wPartyMon1Level - wPartyMon1Exp add hl, bc push hl - callba CalcLevelFromExperience + farcall CalcLevelFromExperience pop hl ld a, [hl] ; current level cp d @@ -233,11 +233,11 @@ GainExperience: .recalcStatChanges xor a ; battle mon ld [wCalculateWhoseStats], a - callab CalculateModifiedStats - callab ApplyBurnAndParalysisPenaltiesToPlayer - callab ApplyBadgeStatBoosts - callab DrawPlayerHUDAndHPBar - callab PrintEmptyString + callfar CalculateModifiedStats + callfar ApplyBurnAndParalysisPenaltiesToPlayer + callfar ApplyBadgeStatBoosts + callfar DrawPlayerHUDAndHPBar + callfar PrintEmptyString call SaveScreenTilesToBuffer1 .printGrewLevelText ld hl, GrewLevelText @@ -246,7 +246,7 @@ GainExperience: ld [wMonDataLocation], a call LoadMonData ld d, $1 - callab PrintStatsBox + callfar PrintStatsBox call WaitForTextScrollButtonPress call LoadScreenTilesFromBuffer1 xor a ; PLAYER_PARTY_DATA diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index bef680fe..9c47fd53 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -15,7 +15,7 @@ MarowakAnim: ld [wChangeMonPicEnemyTurnSpecies], a ld a, $1 ldh [hWhoseTurn], a - callab ChangeMonPic + callfar ChangeMonPic ; alternate between black and light grey 8 times. ; this makes the ghost's body appear to flash ld d, $80 diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index d670319c..0d403b55 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -35,4 +35,4 @@ InitBattleVariables: ld a, BATTLE_TYPE_SAFARI ld [wBattleType], a .notSafariBattle - jpab PlayBattleMusic + jpfar PlayBattleMusic diff --git a/engine/battle/link_battle_versus_text.asm b/engine/battle/link_battle_versus_text.asm index 76559117..22fec0f3 100644 --- a/engine/battle/link_battle_versus_text.asm +++ b/engine/battle/link_battle_versus_text.asm @@ -18,6 +18,6 @@ DisplayLinkBattleVersusTextBox: ld [hl], $6a xor a ld [wUpdateSpritesEnabled], a - callab SetupPlayerAndEnemyPokeballs + callfar SetupPlayerAndEnemyPokeballs ld c, 150 jp DelayFrames diff --git a/engine/battle/move_effects/drain_hp.asm b/engine/battle/move_effects/drain_hp.asm index 74e5d376..e7b241f6 100644 --- a/engine/battle/move_effects/drain_hp.asm +++ b/engine/battle/move_effects/drain_hp.asm @@ -81,7 +81,7 @@ DrainHPEffect_: predef UpdateHPBar2 predef DrawPlayerHUDAndHPBar predef DrawEnemyHUDAndHPBar - callab ReadPlayerMonCurHPAndStatus + callfar ReadPlayerMonCurHPAndStatus ld hl, SuckedHealthText ldh a, [hWhoseTurn] and a diff --git a/engine/battle/move_effects/focus_energy.asm b/engine/battle/move_effects/focus_energy.asm index fd04e024..1fafe920 100644 --- a/engine/battle/move_effects/focus_energy.asm +++ b/engine/battle/move_effects/focus_energy.asm @@ -8,13 +8,13 @@ FocusEnergyEffect_: bit GETTING_PUMPED, [hl] ; is mon already using focus energy? jr nz, .alreadyUsing set GETTING_PUMPED, [hl] ; mon is now using focus energy - callab PlayCurrentMoveAnimation + callfar PlayCurrentMoveAnimation ld hl, GettingPumpedText jp PrintText .alreadyUsing ld c, 50 call DelayFrames - jpab PrintButItFailedText_ + jpfar PrintButItFailedText_ GettingPumpedText: text_pause diff --git a/engine/battle/move_effects/leech_seed.asm b/engine/battle/move_effects/leech_seed.asm index 061c0073..61bd982a 100644 --- a/engine/battle/move_effects/leech_seed.asm +++ b/engine/battle/move_effects/leech_seed.asm @@ -1,5 +1,5 @@ LeechSeedEffect_: - callab MoveHitTest + callfar MoveHitTest ld a, [wMoveMissed] and a jr nz, .moveMissed @@ -22,7 +22,7 @@ LeechSeedEffect_: bit SEEDED, [hl] jr nz, .moveMissed set SEEDED, [hl] - callab PlayCurrentMoveAnimation + callfar PlayCurrentMoveAnimation ld hl, WasSeededText jp PrintText .moveMissed diff --git a/engine/battle/move_effects/mist.asm b/engine/battle/move_effects/mist.asm index a9cb21b8..163d386f 100644 --- a/engine/battle/move_effects/mist.asm +++ b/engine/battle/move_effects/mist.asm @@ -8,11 +8,11 @@ MistEffect_: bit PROTECTED_BY_MIST, [hl] ; is mon protected by mist? jr nz, .mistAlreadyInUse set PROTECTED_BY_MIST, [hl] ; mon is now protected by mist - callab PlayCurrentMoveAnimation + callfar PlayCurrentMoveAnimation ld hl, ShroudedInMistText jp PrintText .mistAlreadyInUse - jpab PrintButItFailedText_ + jpfar PrintButItFailedText_ ShroudedInMistText: text_far _ShroudedInMistText diff --git a/engine/battle/move_effects/paralyze.asm b/engine/battle/move_effects/paralyze.asm index d828e333..dbaa0fb8 100644 --- a/engine/battle/move_effects/paralyze.asm +++ b/engine/battle/move_effects/paralyze.asm @@ -26,22 +26,22 @@ ParalyzeEffect_: jr z, .doesntAffect .hitTest push hl - callab MoveHitTest + callfar MoveHitTest pop hl ld a, [wMoveMissed] and a jr nz, .didntAffect set PAR, [hl] - callab QuarterSpeedDueToParalysis + callfar QuarterSpeedDueToParalysis ld c, 30 call DelayFrames - callab PlayCurrentMoveAnimation - jpab PrintMayNotAttackText + callfar PlayCurrentMoveAnimation + jpfar PrintMayNotAttackText .didntAffect ld c, 50 call DelayFrames - jpab PrintDidntAffectText + jpfar PrintDidntAffectText .doesntAffect ld c, 50 call DelayFrames - jpab PrintDoesntAffectText + jpfar PrintDoesntAffectText diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm index eb6d0e89..860b76b6 100644 --- a/engine/battle/move_effects/substitute.asm +++ b/engine/battle/move_effects/substitute.asm @@ -55,7 +55,7 @@ SubstituteEffect_: call Bankswitch ; jump to routine depending on animation setting ld hl, SubstituteText call PrintText - jpab DrawHUDsAndHPBars + jpfar DrawHUDsAndHPBars .alreadyHasSubstitute ld hl, HasSubstituteText jr .printText diff --git a/engine/battle/scroll_draw_trainer_pic.asm b/engine/battle/scroll_draw_trainer_pic.asm index 98893dcf..978fb71a 100644 --- a/engine/battle/scroll_draw_trainer_pic.asm +++ b/engine/battle/scroll_draw_trainer_pic.asm @@ -5,7 +5,7 @@ _ScrollTrainerPicAfterBattle: ld [wEnemyMonSpecies2], a ld b, SET_PAL_BATTLE call RunPaletteCommand - callab _LoadTrainerPic + callfar _LoadTrainerPic coord hl, 19, 0 ld c, $0 .scrollLoop diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index 3e444f8b..ea476538 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -204,7 +204,7 @@ AIMoveChoiceModification3: push hl push bc push de - callab AIGetTypeEffectiveness + callfar AIGetTypeEffectiveness pop de pop bc pop hl @@ -599,7 +599,7 @@ SwitchEnemyMon: ; switching in a new mon in response to this switch. ld a, 1 ld [wFirstMonsNotOutYet], a - callab EnemySendOut + callfar EnemySendOut xor a ld [wFirstMonsNotOutYet], a @@ -713,7 +713,7 @@ AIIncreaseStat: ld a, ANIM_AF ld [hli], a ld [hl], b - callab StatModifierUpEffect + callfar StatModifierUpEffect pop hl pop af ld [hli], a diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 9b637f97..3d0eb556 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -7,14 +7,14 @@ TryDoWildEncounter: ld a, [wd736] and a ret nz - callab IsPlayerStandingOnDoorTileOrWarpTile + callfar IsPlayerStandingOnDoorTileOrWarpTile jr nc, .notStandingOnDoorOrWarpTile .CantEncounter ld a, $1 and a ret .notStandingOnDoorOrWarpTile - callab IsPlayerJustOutsideMap + callfar IsPlayerJustOutsideMap jr z, .CantEncounter ld a, [wRepelRemainingSteps] and a diff --git a/engine/events/cinnabar_lab.asm b/engine/events/cinnabar_lab.asm index 0e0af0bb..aaa0428e 100755 --- a/engine/events/cinnabar_lab.asm +++ b/engine/events/cinnabar_lab.asm @@ -62,7 +62,7 @@ GiveFossilToCinnabarLab:: call PrintText ld a, [wFossilItem] ldh [hItemToRemoveID], a - callba RemoveItemByID + farcall RemoveItemByID ld hl, LabFossil_610b8 call PrintText SetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index 9e9da9a5..95dabab3 100755 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -38,7 +38,7 @@ DisplayDiploma:: coord hl, 10, 4 ld de, wPlayerName call PlaceString - callba DrawPlayerCharacter + farcall DrawPlayerCharacter ; Move the player 33 pixels right and set the priority bit so he appears ; behind the background layer. @@ -56,7 +56,7 @@ DisplayDiploma:: jr nz, .adjustPlayerGfxLoop call EnableLCD - callba LoadTrainerInfoTextBoxTiles + farcall LoadTrainerInfoTextBoxTiles ld b, SET_PAL_GENERIC call RunPaletteCommand call Delay3 diff --git a/engine/events/evolve_trade.asm b/engine/events/evolve_trade.asm index e17fc05c..56069fac 100755 --- a/engine/events/evolve_trade.asm +++ b/engine/events/evolve_trade.asm @@ -38,7 +38,7 @@ EvolveTradeMon: ld [wForceEvolution], a ld a, LINK_STATE_TRADING ld [wLinkState], a - callab TryEvolvingMon + callfar TryEvolvingMon xor a ; LINK_STATE_NONE ld [wLinkState], a jp PlayDefaultMusic diff --git a/engine/events/give_pokemon.asm b/engine/events/give_pokemon.asm index 041b9fb0..ef01ef99 100755 --- a/engine/events/give_pokemon.asm +++ b/engine/events/give_pokemon.asm @@ -15,9 +15,9 @@ _GivePokemon:: ld [wEnemyBattleStatus3], a ld a, [wcf91] ld [wEnemyMonSpecies2], a - callab LoadEnemyMonData + callfar LoadEnemyMonData call SetPokedexOwnedFlag - callab SendNewMonToBox + callfar SendNewMonToBox ld hl, wcf4b ld a, [wCurrentBoxNum] and $7f diff --git a/engine/events/hidden_objects/bookshelves.asm b/engine/events/hidden_objects/bookshelves.asm index daa8205d..23c087cc 100644 --- a/engine/events/hidden_objects/bookshelves.asm +++ b/engine/events/hidden_objects/bookshelves.asm @@ -34,6 +34,6 @@ PrintBookshelfText:: .noMatch ld a, $ff ldh [hFFDB], a - jpba PrintCardKeyText + farjp PrintCardKeyText INCLUDE "data/tilesets/bookshelf_tile_ids.asm" diff --git a/engine/events/hidden_objects/town_map.asm b/engine/events/hidden_objects/town_map.asm index 866d38c8..4284214f 100644 --- a/engine/events/hidden_objects/town_map.asm +++ b/engine/events/hidden_objects/town_map.asm @@ -12,7 +12,7 @@ TownMapText:: inc a ldh [hAutoBGTransferEnabled], a call LoadFontTilePatterns - callba DisplayTownMap + farcall DisplayTownMap ld hl, wd730 res 6, [hl] ld de, TextScriptEnd diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm index a25abe0b..8a29d6a4 100755 --- a/engine/events/in_game_trades.asm +++ b/engine/events/in_game_trades.asm @@ -137,10 +137,10 @@ InGameTrade_DoTrade: ld [wMonDataLocation], a call AddPartyMon call InGameTrade_CopyDataToReceivedMon - callab EvolveTradeMon + callfar EvolveTradeMon call ClearScreen call InGameTrade_RestoreScreen - callba RedrawMapView + farcall RedrawMapView and a ld a, $3 jr .tradeSucceeded @@ -159,7 +159,7 @@ InGameTrade_RestoreScreen: call LoadGBPal ld c, 10 call DelayFrames - jpba LoadWildData + farjp LoadWildData InGameTrade_PrepareTradeData: ld hl, wTradedPlayerMonSpecies diff --git a/engine/events/pokecenter.asm b/engine/events/pokecenter.asm index 030c333f..97dbcd53 100755 --- a/engine/events/pokecenter.asm +++ b/engine/events/pokecenter.asm @@ -22,7 +22,7 @@ DisplayPokemonCenterDialogue_:: ld [wSprite01StateData1ImageIndex], a ; make the nurse turn to face the machine call Delay3 predef HealParty - callba AnimateHealingMachine ; do the healing machine animation + farcall AnimateHealingMachine ; do the healing machine animation xor a ld [wAudioFadeOutControl], a ld a, [wAudioSavedROMBank] diff --git a/engine/events/pokedex_rating.asm b/engine/events/pokedex_rating.asm index f17f7b17..490ae05a 100755 --- a/engine/events/pokedex_rating.asm +++ b/engine/events/pokedex_rating.asm @@ -30,7 +30,7 @@ DisplayDexRating: call PrintText pop hl call PrintText - callba PlayPokedexRatingSfx + farcall PlayPokedexRatingSfx jp WaitForTextScrollButtonPress .hallOfFame ld de, wDexRatingNumMonsSeen diff --git a/engine/events/pokemart.asm b/engine/events/pokemart.asm index 0c71e4de..3345f540 100755 --- a/engine/events/pokemart.asm +++ b/engine/events/pokemart.asm @@ -42,7 +42,7 @@ DisplayPokemartDialogue_:: ld [wPrintItemPrices], a ld a, INIT_BAG_ITEM_LIST ld [wInitListType], a - callab InitList + callfar InitList ld a, [wNumBagItems] and a @@ -126,7 +126,7 @@ DisplayPokemartDialogue_:: ld [wPrintItemPrices], a ld a, INIT_OTHER_ITEM_LIST ld [wInitListType], a - callab InitList + callfar InitList ld hl, PokemartBuyingGreetingText call PrintText diff --git a/engine/events/saffron_guards.asm b/engine/events/saffron_guards.asm index cd008394..bf30b8c5 100755 --- a/engine/events/saffron_guards.asm +++ b/engine/events/saffron_guards.asm @@ -10,6 +10,6 @@ RemoveGuardDrink:: call IsItemInBag pop hl jr z, .drinkLoop - jpba RemoveItemByID + farjp RemoveItemByID INCLUDE "data/items/guard_drink_items.asm" diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 3668dd74..b2901615 100755 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -147,7 +147,7 @@ ItemUseBall: ; If the player is fighting an unidentified ghost, set the value that indicates ; the Pokémon can't be caught and skip the capture calculations. - callab IsGhostBattle + callfar IsGhostBattle ld b, $10 ; can't be caught value jp z, .setAnimData @@ -495,7 +495,7 @@ ItemUseBall: ld [wcf91], a ld a, [wEnemyMonLevel] ld [wCurEnemyLVL], a - callab LoadEnemyMonData + callfar LoadEnemyMonData pop af ld [wcf91], a pop hl @@ -632,7 +632,7 @@ ItemUseTownMap: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime - jpba DisplayTownMap + farjp DisplayTownMap ItemUseBicycle: ld a, [wIsInBattle] @@ -778,7 +778,7 @@ ItemUseEvoStone: ld a, SFX_HEAL_AILMENT call PlaySoundWaitForCurrent call WaitForSoundToFinish - callab TryEvolvingMon ; try to evolve pokemon + callfar TryEvolvingMon ; try to evolve pokemon ld a, [wEvolutionOccurred] and a jr z, .noEffect @@ -1341,7 +1341,7 @@ ItemUseMedicine: push hl push de ld d, a - callab CalcExperience ; calculate experience for next level and store it at hExperience + callfar CalcExperience ; calculate experience for next level and store it at hExperience pop de pop hl ld bc, wPartyMon1Exp - wPartyMon1Level @@ -1400,14 +1400,14 @@ ItemUseMedicine: ld [wMonDataLocation], a call LoadMonData ld d, $01 - callab PrintStatsBox ; display new stats text box + callfar PrintStatsBox ; display new stats text box call WaitForTextScrollButtonPress ; wait for button press xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a predef LearnMoveFromLevelUp ; learn level up move, if any xor a ld [wForceEvolution], a - callab TryEvolvingMon ; evolve pokemon, if appropriate + callfar TryEvolvingMon ; evolve pokemon, if appropriate ld a, $01 ld [wUpdateSpritesEnabled], a pop af @@ -1699,7 +1699,7 @@ ItemUseXStat: call Delay3 xor a ldh [hWhoseTurn], a ; set turn to player's turn - callba StatModifierUpEffect ; do stat increase move + farcall StatModifierUpEffect ; do stat increase move pop hl pop af ld [hld], a ; restore [wPlayerMoveEffect] @@ -1775,7 +1775,7 @@ ItemUsePokeflute: and $80 jr nz, .skipMusic call WaitForSoundToFinish ; wait for sound to end - callba Music_PokeFluteInBattle ; play in-battle pokeflute music + farcall Music_PokeFluteInBattle ; play in-battle pokeflute music .musicWaitLoop ; wait for music to finish playing ld a, [wChannelSoundIDs + Ch7] and a ; music off? @@ -1927,7 +1927,7 @@ RodResponse: push af push hl ld [hl], 0 - callba FishingAnim + farcall FishingAnim pop hl pop af ld [hl], a @@ -1968,7 +1968,7 @@ ItemUseItemfinder: and a jp nz, ItemUseNotTime call ItemUseReloadOverworldData - callba HiddenItemNear ; check for hidden items + farcall HiddenItemNear ; check for hidden items ld hl, ItemfinderFoundNothingText jr nc, .printText ; if no hidden items ld c, 4 @@ -2024,7 +2024,7 @@ ItemUsePPRestore: call PrintText xor a ld [wPlayerMoveListIndex], a - callab MoveSelectionMenu ; move selection menu + callfar MoveSelectionMenu ; move selection menu ld a, 0 ld [wPlayerMoveListIndex], a jr nz, .chooseMon @@ -2278,7 +2278,7 @@ ItemUseTMHM: call PrintText jr .chooseMon .checkIfAlreadyLearnedMove - callab CheckIfMoveIsKnown ; check if the pokemon already knows the move + callfar CheckIfMoveIsKnown ; check if the pokemon already knows the move jr c, .chooseMon predef LearnMove ; teach move pop af @@ -2820,7 +2820,7 @@ SendNewMonToBox: push de ld a, [wCurEnemyLVL] ld d, a - callab CalcExperience + callfar CalcExperience pop de ldh a, [hExperience] ld [de], a diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index 3f6d4fa5..3cff630b 100755 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -366,7 +366,7 @@ DrawPlayerOrBirdSprite: jp CopyData DisplayWildLocations: - callba FindWildLocationsOfMon + farcall FindWildLocationsOfMon call ZeroOutDuplicatesInList ld hl, wOAMBuffer ld de, wTownMapCoords diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index abb88cc0..03e1c50a 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -359,7 +359,7 @@ TradeCenter_SelectMon: .displayEnemyMonStats ld a, INIT_ENEMYOT_LIST ld [wInitListType], a - callab InitList ; the list isn't used + callfar InitList ; the list isn't used ld hl, wEnemyMons call TradeCenter_DisplayStats jp .getNewInput @@ -418,7 +418,7 @@ TradeCenter_SelectMon: ; unreachable code ld a, INIT_PLAYEROT_LIST ld [wInitListType], a - callab InitList ; the list isn't used + callfar InitList ; the list isn't used call TradeCenter_DisplayStats jp .getNewInput .playerMonMenu_ANotPressed @@ -513,7 +513,7 @@ TradeCenter_SelectMon: ld [wCurrentMenuItem], a ld a, INIT_PLAYEROT_LIST ld [wInitListType], a - callab InitList ; the list isn't used + callfar InitList ; the list isn't used call TradeCenter_DisplayStats call LoadScreenTilesFromBuffer1 jp .playerMonMenu @@ -588,7 +588,7 @@ ReturnToCableClubRoom: dec a ld [wDestinationWarpID], a call LoadMapData - callba ClearVariablesOnEnterMap + farcall ClearVariablesOnEnterMap pop hl pop af ld [hl], a @@ -845,7 +845,7 @@ TradeCenter_Trade: .usingExternalClock predef ExternalClockTradeAnim .tradeCompleted - callab TryEvolvingMon + callfar TryEvolvingMon call ClearScreen call LoadTrainerInfoTextBoxTiles call Serial_PrintWaitingTextAndSyncAndExchangeNybble diff --git a/engine/link/cable_club_npc.asm b/engine/link/cable_club_npc.asm index 16c62f9e..594adf08 100755 --- a/engine/link/cable_club_npc.asm +++ b/engine/link/cable_club_npc.asm @@ -54,7 +54,7 @@ CableClubNPC:: ld a, [wCurrentMenuItem] and a jr nz, .choseNo - callab SaveSAVtoSRAM + callfar SaveSAVtoSRAM call WaitForSoundToFinish ld a, SFX_SAVE call PlaySoundWaitForCurrent @@ -107,7 +107,7 @@ CableClubNPC:: xor a ld [hld], a ld [hl], a - jpab LinkMenu + jpfar LinkMenu CableClubNPCAreaReservedFor2FriendsLinkedByCableText: text_far _CableClubNPCAreaReservedFor2FriendsLinkedByCableText diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm index 7bf0458d..d930e42f 100755 --- a/engine/menus/league_pc.asm +++ b/engine/menus/league_pc.asm @@ -29,7 +29,7 @@ PKMNLeaguePC: push bc ld a, [wHoFTeamIndex2] ld [wHoFTeamIndex], a - callba LoadHallOfFameTeams + farcall LoadHallOfFameTeams call LeaguePCShowTeam pop bc jr c, .doneShowingTeams @@ -110,7 +110,7 @@ LeaguePCShowMon: ld de, wHoFTeamNo lb bc, 1, 3 call PrintNumber - jpba HoFDisplayMonInfo + farjp HoFDisplayMonInfo HallOfFameNoText: db "HALL OF FAME No @" diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index 170e778a..e6886c98 100755 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -92,7 +92,7 @@ DisplayNamingScreen: call RunPaletteCommand call LoadHpBarAndStatusTilePatterns call LoadEDTile - callba LoadMonPartySpriteGfx + farcall LoadMonPartySpriteGfx coord hl, 0, 4 ld b, 9 ld c, 18 @@ -128,7 +128,7 @@ DisplayNamingScreen: .inputLoop ld a, [wCurrentMenuItem] push af - callba AnimatePartyMon_ForceSpeed1 + farcall AnimatePartyMon_ForceSpeed1 pop af ld [wCurrentMenuItem], a call JoypadLowSensitivity @@ -172,7 +172,7 @@ DisplayNamingScreen: ld a, [wIsInBattle] and a jp z, LoadTextBoxTilePatterns - jpab LoadHudTilePatterns + jpfar LoadHudTilePatterns .namingScreenButtonFunctions dw .dPadReturnPoint @@ -461,7 +461,7 @@ PrintNamingText: ld a, [wcf91] ld [wMonPartySpriteSpecies], a push af - callba WriteMonPartySpriteOAMBySpecies + farcall WriteMonPartySpriteOAMBySpecies pop af ld [wd11e], a call GetMonName diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm index f46b3994..4eeb0ed8 100755 --- a/engine/menus/party_menu.asm +++ b/engine/menus/party_menu.asm @@ -22,14 +22,14 @@ DrawPartyMenu_:: ldh [hAutoBGTransferEnabled], a call ClearScreen call UpdateSprites - callba LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics + farcall LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics RedrawPartyMenu_:: ld a, [wPartyMenuTypeOrMessageID] cp SWAP_MONS_PARTY_MENU jp z, .printMessage call ErasePartyMenuCursors - callba InitPartyMenuBlkPacket + farcall InitPartyMenuBlkPacket coord hl, 3, 0 ld de, wPartySpecies xor a @@ -49,7 +49,7 @@ RedrawPartyMenu_:: call GetPartyMonName pop hl call PlaceString ; print the pokemon's name - callba WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon + farcall WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon ldh a, [hPartyMonIndex] ld [wWhichPokemon], a inc a diff --git a/engine/menus/pc.asm b/engine/menus/pc.asm index 1006cbbe..4c340e7b 100755 --- a/engine/menus/pc.asm +++ b/engine/menus/pc.asm @@ -10,7 +10,7 @@ ActivatePC:: call LoadScreenTilesFromBuffer2 call Delay3 PCMainMenu: - callba DisplayPCMainMenu + farcall DisplayPCMainMenu ld hl, wFlags_0xcd60 set 5, [hl] call HandleMenuInput @@ -56,19 +56,19 @@ PCMainMenu: call WaitForSoundToFinish ld hl, AccessedMyPCText call PrintText - callba PlayerPC + farcall PlayerPC jr ReloadMainMenu OaksPC: ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - callba OpenOaksPC + farcall OpenOaksPC jr ReloadMainMenu PKMNLeague: ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - callba PKMNLeaguePC + farcall PKMNLeaguePC jr ReloadMainMenu BillsPC: ld a, SFX_ENTER_PC @@ -82,7 +82,7 @@ BillsPC: ld hl, AccessedBillsPCText .printText call PrintText - callba BillsPC_ + farcall BillsPC_ ReloadMainMenu: xor a ld [wDoNotWaitForButtonPressAfterDisplayingText], a diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm index d0ef3e31..a2a55bfd 100755 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -14,7 +14,7 @@ ShowPokedexMenu: .setUpGraphics ld b, SET_PAL_GENERIC call RunPaletteCommand - callab LoadPokedexTilePatterns + callfar LoadPokedexTilePatterns .doPokemonListMenu ld hl, wTopMenuItemY ld a, 3 @@ -393,7 +393,7 @@ ShowPokedexData: call GBPalWhiteOutWithDelay3 call ClearScreen call UpdateSprites - callab LoadPokedexTilePatterns ; load pokedex tiles + callfar LoadPokedexTilePatterns ; load pokedex tiles ; function to display pokedex data from inside the pokedex ShowPokedexDataInternal: diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 34fa9142..2941a07e 100755 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -138,7 +138,7 @@ LoadSAVIgnoreBadCheckSum: jp LoadSAV2 SaveSAV: - callba PrintSaveScreenText + farcall PrintSaveScreenText ld hl, WouldYouLikeToSaveText call SaveSAVConfirm and a ;|0 = Yes|1 = No| diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index acc6bda8..33d504b8 100755 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -160,7 +160,7 @@ StartMenu_Pokemon:: .surf bit 4, a ; does the player have the Soul Badge? jp z, .newBadgeRequired - callba IsSurfingAllowed + farcall IsSurfingAllowed ld hl, wd728 bit 1, [hl] res 1, [hl] @@ -651,7 +651,7 @@ StartMenu_Option:: ldh [hAutoBGTransferEnabled], a call ClearScreen call UpdateSprites - callab DisplayOptionMenu + callfar DisplayOptionMenu call LoadScreenTilesFromBuffer2 ; restore saved screen call LoadTextBoxTilePatterns call UpdateSprites diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index caf62852..42b8e0cc 100755 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -1,5 +1,5 @@ HallOfFamePC: - callba AnimateHallOfFame + farcall AnimateHallOfFame call ClearScreen ld c, 100 call DelayFrames @@ -235,7 +235,7 @@ Credits: jr .nextCreditsScreen .showCopyrightText push de - callba LoadCopyrightTiles + farcall LoadCopyrightTiles pop de pop de jr .nextCreditsCommand diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index 1aba3408..08b6ed8b 100755 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -311,7 +311,7 @@ LoadIntroGraphics: PlayShootingStar: ld b, SET_PAL_GAME_FREAK_INTRO call RunPaletteCommand - callba LoadCopyrightAndTextBoxTiles + farcall LoadCopyrightAndTextBoxTiles ldPal a, BLACK, DARK_GRAY, LIGHT_GRAY, WHITE ldh [rBGP], a ld c, 180 @@ -328,7 +328,7 @@ PlayShootingStar: set 3, [hl] ld c, 64 call DelayFrames - callba AnimateShootingStar + farcall AnimateShootingStar push af pop af jr c, .next ; skip the delay if the user interrupted the animation diff --git a/engine/movie/oak_speech/clear_save.asm b/engine/movie/oak_speech/clear_save.asm index b214ec32..c423fb0b 100755 --- a/engine/movie/oak_speech/clear_save.asm +++ b/engine/movie/oak_speech/clear_save.asm @@ -15,7 +15,7 @@ DoClearSaveDialogue: ld a, [wCurrentMenuItem] and a jp z, Init - callba ClearSAV + farcall ClearSAV jp Init ClearSaveDataText: diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 62eb37d0..efdf2f07 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -226,7 +226,7 @@ ENDC ld c, 1 call CheckForUserInterruption jr c, .finishedWaiting - callba TitleScreenAnimateBallIfStarterOut + farcall TitleScreenAnimateBallIfStarterOut call TitleScreenPickNewMon jr .awaitUserInterruptionLoop @@ -255,7 +255,7 @@ ENDC jp MainMenu .doClearSaveDialogue - jpba DoClearSaveDialogue + farjp DoClearSaveDialogue TitleScreenPickNewMon: ld a, vBGMap0 / $100 @@ -282,12 +282,12 @@ TitleScreenPickNewMon: ld a, $90 ldh [hWY], a ld d, 1 ; scroll out - callba TitleScroll + farcall TitleScroll ret TitleScreenScrollInMon: ld d, 0 ; scroll in - callba TitleScroll + farcall TitleScroll xor a ldh [hWY], a ret diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index c8005b93..518742aa 100755 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -199,7 +199,7 @@ LoadTradingGFXAndMonNames: Trade_LoadMonPartySpriteGfx: ld a, %11010000 ldh [rOBP1], a - jpba LoadMonPartySpriteGfx + farjp LoadMonPartySpriteGfx Trade_SwapNames: ld hl, wPlayerName @@ -615,7 +615,7 @@ Trade_AnimCircledMon: ret Trade_WriteCircledMonOAM: - callba WriteMonPartySpriteOAMBySpecies + farcall WriteMonPartySpriteOAMBySpecies call Trade_WriteCircleOAM Trade_AddOffsetsToOAMCoords: diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index fc5fb578..97842079 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -57,7 +57,7 @@ UsedCut: ld de, CutTreeBlockSwaps call ReplaceTreeTileBlock call RedrawMapView - callba AnimCut + farcall AnimCut ld a, $1 ld [wUpdateSpritesEnabled], a ld a, SFX_CUT diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm index 3d87e25a..09a71a18 100755 --- a/engine/overworld/dust_smoke.asm +++ b/engine/overworld/dust_smoke.asm @@ -8,7 +8,7 @@ AnimateBoulderDust: ld a, %11100100 ldh [rOBP1], a call LoadSmokeTileFourTimes - callba WriteCutOrBoulderDustAnimationOAMBlock + farcall WriteCutOrBoulderDustAnimationOAMBlock ld c, 8 ; number of steps in animation .loop push bc diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm index f2e74683..39c8f756 100644 --- a/engine/overworld/player_state.asm +++ b/engine/overworld/player_state.asm @@ -192,7 +192,7 @@ IsPlayerStandingOnDoorTileOrWarpTile:: push hl push de push bc - callba IsPlayerStandingOnDoorTile + farcall IsPlayerStandingOnDoorTile jr c, .done ld a, [wCurMapTileset] add a diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm index fb4d06aa..4cef8b64 100644 --- a/engine/overworld/push_boulder.asm +++ b/engine/overworld/push_boulder.asm @@ -86,7 +86,7 @@ DoBoulderDustAnimation:: ld a, [wd730] bit 0, a ret nz - callab AnimateBoulderDust + callfar AnimateBoulderDust call DiscardButtonPresses ld [wJoyIgnore], a call ResetBoulderPushFlags diff --git a/engine/pokemon/add_mon.asm b/engine/pokemon/add_mon.asm index eeef40b0..0c72ff5b 100644 --- a/engine/pokemon/add_mon.asm +++ b/engine/pokemon/add_mon.asm @@ -201,7 +201,7 @@ _AddPartyMon:: push de ld a, [wCurEnemyLVL] ld d, a - callab CalcExperience + callfar CalcExperience pop de inc de ldh a, [hExperience] ; write experience @@ -498,7 +498,7 @@ _MoveMon:: add $2 ld [wMonDataLocation], a call LoadMonData - callba CalcLevelFromExperience + farcall CalcLevelFromExperience ld a, d ld [wCurEnemyLVL], a pop hl diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 80739de4..0a760a27 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -318,7 +318,7 @@ BillsPCRelease: jp BillsPCMenu BillsPCChangeBox: - callba ChangeBox + farcall ChangeBox jp BillsPCMenu DisplayMonListMenu: diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index c54bf7c7..564a8557 100755 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -129,7 +129,7 @@ Evolution_PartyMonLoop: ; loop over party mons ld a, $ff ld [wUpdateSpritesEnabled], a call ClearSprites - callab EvolveMon + callfar EvolveMon jp c, CancelledEvolution ld hl, EvolvedText call PrintText diff --git a/engine/pokemon/learn_move.asm b/engine/pokemon/learn_move.asm index 510300cd..e7b907d5 100755 --- a/engine/pokemon/learn_move.asm +++ b/engine/pokemon/learn_move.asm @@ -114,7 +114,7 @@ TryingToLearn: ld de, wMoves ld bc, NUM_MOVES call CopyData - callab FormatMovesString + callfar FormatMovesString pop hl .loop push hl diff --git a/engine/pokemon/load_mon_data.asm b/engine/pokemon/load_mon_data.asm index 480ab1ca..c5e2041a 100644 --- a/engine/pokemon/load_mon_data.asm +++ b/engine/pokemon/load_mon_data.asm @@ -15,7 +15,7 @@ LoadMonData_:: ld a, [wWhichPokemon] ld e, a - callab GetMonSpecies + callfar GetMonSpecies .GetMonHeader ld a, [wcf91] diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index e46adae4..c2abeedd 100755 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -310,7 +310,7 @@ StatusScreen2: ld de, wMoves ld bc, NUM_MOVES call CopyData - callab FormatMovesString + callfar FormatMovesString coord hl, 9, 2 lb bc, 5, 10 call ClearScreenArea ; Clear under name @@ -356,7 +356,7 @@ StatusScreen2: ld a, b ld [hl], a push hl - callab GetMaxPP + callfar GetMaxPP pop hl pop af ld [hl], a @@ -445,7 +445,7 @@ CalcExpToLevelUp: jr z, .atMaxLevel inc a ld d, a - callab CalcExperience + callfar CalcExperience ld hl, wLoadedMonExp + 2 ldh a, [hExperience + 2] sub [hl] diff --git a/engine/slots/game_corner_slots.asm b/engine/slots/game_corner_slots.asm index 797c381c..c233b0e6 100755 --- a/engine/slots/game_corner_slots.asm +++ b/engine/slots/game_corner_slots.asm @@ -6,7 +6,7 @@ StartSlotMachine: jr z, .printOutToLunch cp $ff jr z, .printSomeonesKeys - callba AbleToPlaySlotsCheck + farcall AbleToPlaySlotsCheck ld a, [wCanPlaySlots] and a ret z diff --git a/home.asm b/home.asm index 779a2e0c..62594b43 100644 --- a/home.asm +++ b/home.asm @@ -206,7 +206,7 @@ CountSetBits:: ; subtracts the amount the player paid from their money ; OUTPUT: carry = 0(success) or 1(fail because there is not enough money) SubtractAmountPaidFromMoney:: - jpba SubtractAmountPaidFromMoney_ + farjp SubtractAmountPaidFromMoney_ ; adds the amount the player sold to their money AddAmountSoldToMoney:: @@ -296,7 +296,7 @@ ReloadTilesetTilePatterns:: ChooseFlyDestination:: ld hl, wd72e res 4, [hl] - jpba LoadTownMap_Fly + farjp LoadTownMap_Fly ; causes the text box to close without waiting for a button press after displaying text DisableWaitingAfterTextDisplay:: @@ -314,7 +314,7 @@ DisableWaitingAfterTextDisplay:: ; 01: successful ; 02: not able to be used right now, no extra menu displayed (only certain items use this) UseItem:: - jpba UseItem_ + farjp UseItem_ ; confirms the item toss and then tosses the item ; INPUT: @@ -348,7 +348,7 @@ IsKeyItem:: push hl push de push bc - callba IsKeyItem_ + farcall IsKeyItem_ pop bc pop de pop hl @@ -418,10 +418,10 @@ RunNPCMovementScript:: dw PewterMuseumGuyMovementScriptPointerTable dw PewterGymGuyMovementScriptPointerTable .playerStepOutFromDoor - jpba PlayerStepOutFromDoor + farjp PlayerStepOutFromDoor EndNPCMovementScript:: - jpba _EndNPCMovementScript + farjp _EndNPCMovementScript EmptyFunc2:: ret @@ -502,7 +502,7 @@ IsItemInBag:: DisplayPokedex:: ld [wd11e], a - jpba _DisplayPokedex + farjp _DisplayPokedex SetSpriteFacingDirectionAndDelay:: call SetSpriteFacingDirection @@ -711,7 +711,7 @@ GetTrainerInformation:: ret GetTrainerName:: - jpba GetTrainerName_ + farjp GetTrainerName_ HasEnoughMoney:: ; Check if the player has at least as much @@ -1107,7 +1107,7 @@ ManualTextScroll:: Multiply:: push hl push bc - callab _Multiply + callfar _Multiply pop bc pop hl ret @@ -1296,7 +1296,7 @@ HandleMenuInput_:: ld a, [wPartyMenuAnimMonEnabled] and a ; is it a pokemon selection menu? jr z, .getJoypadState - callba AnimatePartyMon ; shake mini sprite of selected pokemon + farcall AnimatePartyMon ; shake mini sprite of selected pokemon .getJoypadState pop hl call JoypadLowSensitivity @@ -1687,7 +1687,7 @@ ReloadMapSpriteTilePatterns:: xor a ld [wSpriteSetID], a call DisableLCD - callba InitMapSprites + farcall InitMapSprites call EnableLCD pop hl pop af @@ -1721,7 +1721,7 @@ GivePokemon:: ld [wCurEnemyLVL], a xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a - jpba _GivePokemon + farjp _GivePokemon Random:: ; Return a random number in a. @@ -1729,7 +1729,7 @@ Random:: push hl push de push bc - callba Random_ + farcall Random_ ldh a, [hRandomAdd] pop bc pop de @@ -1739,7 +1739,7 @@ Random:: INCLUDE "home/predef.asm" UpdateCinnabarGymGateTileBlocks:: - jpba UpdateCinnabarGymGateTileBlocks_ + farjp UpdateCinnabarGymGateTileBlocks_ CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ldh a, [hLoadedROMBank] @@ -1765,7 +1765,7 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: xor a jr .done .hiddenObjectNotFound - callba PrintBookshelfText + farcall PrintBookshelfText ldh a, [hFFDB] and a jr z, .done diff --git a/home/move_mon.asm b/home/move_mon.asm index 7be8eaf5..9fe7b067 100644 --- a/home/move_mon.asm +++ b/home/move_mon.asm @@ -3,13 +3,13 @@ ; [wRemoveMonFromBox] == 0 specifies the party. ; [wRemoveMonFromBox] != 0 specifies the current box. RemovePokemon:: - jpab _RemovePokemon + jpfar _RemovePokemon AddPartyMon:: push hl push de push bc - callba _AddPartyMon + farcall _AddPartyMon pop bc pop de pop hl diff --git a/home/overworld.asm b/home/overworld.asm index 18c7977e..557efa2d 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1,14 +1,14 @@ HandleMidJump:: ; Handle the player jumping down ; a ledge in the overworld. - jpba _HandleMidJump + farjp _HandleMidJump EnterMap:: ; Load a new map. ld a, $ff ld [wJoyIgnore], a call LoadMapData - callba ClearVariablesOnEnterMap + farcall ClearVariablesOnEnterMap ld hl, wd72c bit 0, [hl] ; has the player already made 3 steps since the last battle? jr z, .skipGivingThreeStepsOfNoRandomBattles @@ -25,10 +25,10 @@ EnterMap:: and 1 << 4 | 1 << 3 ; fly warp or dungeon warp jr z, .didNotEnterUsingFlyWarpOrDungeonWarp res 3, [hl] - callba EnterMapAnim + farcall EnterMapAnim call UpdateSprites .didNotEnterUsingFlyWarpOrDungeonWarp - callba CheckForceBikeOrSurf ; handle currents in SF islands and forced bike riding in cycling road + farcall CheckForceBikeOrSurf ; handle currents in SF islands and forced bike riding in cycling road ld hl, wd72d res 5, [hl] call UpdateSprites @@ -50,7 +50,7 @@ OverworldLoopLessDelay:: and a jp nz, .moveAhead ; if the player sprite has not yet completed the walking animation call JoypadOverworld ; get joypad state (which is possibly simulated) - callba SafariZoneCheck + farcall SafariZoneCheck ld a, [wSafariZoneGameOver] and a jp nz, WarpFound2 @@ -269,7 +269,7 @@ OverworldLoopLessDelay:: ld a, [wd736] bit 7, a jr z, .noSpinning - callba LoadSpinnerArrowTiles + farcall LoadSpinnerArrowTiles .noSpinning call UpdateSprites @@ -306,7 +306,7 @@ OverworldLoopLessDelay:: .doneStepCounting CheckEvent EVENT_IN_SAFARI_ZONE jr z, .notSafariZone - callba SafariZoneCheckSteps + farcall SafariZoneCheckSteps ld a, [wSafariZoneGameOver] and a jp nz, WarpFound2 @@ -343,7 +343,7 @@ OverworldLoopLessDelay:: ld a, [wCurMap] cp OAKS_LAB jp z, .noFaintCheck ; no blacking out if the player lost to the rival in Oak's lab - callab AnyPartyAlive + callfar AnyPartyAlive ld a, d and a jr z, .allPokemonFainted @@ -368,7 +368,7 @@ NewBattle:: ld a, [wd72e] bit 4, a jr nz, .noBattle - jpba InitBattle + farjp InitBattle .noBattle and a ret @@ -412,7 +412,7 @@ CheckWarpsNoCollisionLoop:: push bc ld hl, wd736 set 2, [hl] ; standing on warp flag - callba IsPlayerStandingOnDoorTileOrWarpTile + farcall IsPlayerStandingOnDoorTileOrWarpTile pop bc pop hl jr c, WarpFound1 ; jump if standing on door or warp @@ -511,7 +511,7 @@ WarpFound2:: jr z, .goBackOutside ; if not going back to the previous map ld [wCurMap], a - callba IsPlayerStandingOnWarpPadOrHole + farcall IsPlayerStandingOnWarpPadOrHole ld a, [wStandingOnWarpPadOrHole] dec a ; is the player on a warp pad? jr nz, .notWarpPad @@ -679,7 +679,7 @@ CheckMapConnections:: call RunPaletteCommand ; Since the sprite set shouldn't change, this will just update VRAM slots at ; $C2XE without loading any tile patterns. - callba InitMapSprites + farcall InitMapSprites call LoadTileBlockMap jp OverworldLoopLessDelay @@ -747,7 +747,7 @@ ExtraWarpCheck:: jp Bankswitch MapEntryAfterBattle:: - callba IsPlayerStandingOnWarp ; for enabling warp testing after collisions + farcall IsPlayerStandingOnWarp ; for enabling warp testing after collisions ld a, [wMapPalOffset] and a jp z, GBFadeInFromWhite @@ -800,7 +800,7 @@ HandleFlyWarpOrDungeonWarp:: jp SpecialEnterMap LeaveMapAnim:: - jpba _LeaveMapAnim + farjp _LeaveMapAnim LoadPlayerSpriteGraphics:: ; Load sprite graphics based on whether the player is standing, biking, or surfing. @@ -1286,7 +1286,7 @@ CheckForJumpingAndTilePairCollisions:: predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player push de push bc - callba HandleLedges ; check if the player is trying to jump a ledge + farcall HandleLedges ; check if the player is trying to jump a ledge pop bc pop de pop hl @@ -1977,11 +1977,11 @@ RunMapScript:: push hl push de push bc - callba TryPushingBoulder + farcall TryPushingBoulder ld a, [wFlags_0xcd60] bit 1, a ; play boulder dust animation jr z, .afterBoulderEffect - callba DoBoulderDustAnimation + farcall DoBoulderDustAnimation .afterBoulderEffect pop bc pop de @@ -2032,7 +2032,7 @@ LoadPlayerSpriteGraphicsCommon:: ; function to load data from the map header LoadMapHeader:: - callba MarkTownVisitedAndLoadMissableObjects + farcall MarkTownVisitedAndLoadMissableObjects ld a, [wCurMapTileset] ld [wUnusedD119], a ld a, [wCurMap] @@ -2280,7 +2280,7 @@ LoadMapHeader:: jp nz, .loadSpriteLoop .finishUp predef LoadTilesetHeader - callab LoadWildData + callfar LoadWildData pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose) ld a, [wCurMapHeight] ; map height in 4x4 tile blocks add a ; double it @@ -2337,7 +2337,7 @@ LoadMapData:: ld [wSpriteSetID], a call LoadTextBoxTilePatterns call LoadMapHeader - callba InitMapSprites ; load tile pattern data for sprites + farcall InitMapSprites ; load tile pattern data for sprites call LoadTileBlockMap call LoadTilesetTilePatternData call LoadCurrentMapView diff --git a/home/pokemon.asm b/home/pokemon.asm index 6c5442c4..d018843e 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -81,7 +81,7 @@ DrawHPBar:: ; wLoadedMon = base address of pokemon data ; wMonHeader = base address of base stats LoadMonData:: - jpab LoadMonData_ + jpfar LoadMonData_ OverwritewMoves:: ; Write c to [wMoves + b]. Unused. @@ -277,7 +277,7 @@ HandlePartyMenuInput:: bit 1, b ; was the B button pressed? jr z, .handleSwap ; if not, handle swapping the pokemon .cancelSwap ; if the B button was pressed - callba ErasePartyMenuCursors + farcall ErasePartyMenuCursors xor a ld [wMenuItemToSwap], a ld [wPartyMenuTypeOrMessageID], a @@ -286,7 +286,7 @@ HandlePartyMenuInput:: .handleSwap ld a, [wCurrentMenuItem] ld [wWhichPokemon], a - callba SwitchPartyMon + farcall SwitchPartyMon jr HandlePartyMenuInput DrawPartyMenu:: diff --git a/home/serial.asm b/home/serial.asm index 27ac97d4..bd984d4f 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -225,7 +225,7 @@ Serial_ExchangeLinkMenuSelection:: Serial_PrintWaitingTextAndSyncAndExchangeNybble:: call SaveScreenTilesToBuffer1 - callab PrintWaitingText + callfar PrintWaitingText call Serial_SyncAndExchangeNybble jp LoadScreenTilesFromBuffer1 diff --git a/home/start_menu.asm b/home/start_menu.asm index a692f007..5b29f67a 100755 --- a/home/start_menu.asm +++ b/home/start_menu.asm @@ -8,8 +8,8 @@ DisplayStartMenu:: call PlaySound RedisplayStartMenu:: - callba DrawStartMenu - callba PrintSafariZoneSteps ; print Safari Zone info, if in Safari Zone + farcall DrawStartMenu + farcall PrintSafariZoneSteps ; print Safari Zone info, if in Safari Zone call UpdateSprites .loop call HandleMenuInput diff --git a/home/text_script.asm b/home/text_script.asm index 89f4d286..1baa3d64 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -3,7 +3,7 @@ DisplayTextID:: ldh a, [hLoadedROMBank] push af - callba DisplayTextIDInit ; initialization + farcall DisplayTextIDInit ; initialization ld hl, wTextPredefFlag bit 0, [hl] res 0, [hl] @@ -38,7 +38,7 @@ DisplayTextID:: push hl push de push bc - callba UpdateSpriteFacingOffsetAndDelayMovement ; update the graphics of the sprite the player is talking to (to face the right direction) + farcall UpdateSpriteFacingOffsetAndDelayMovement ; update the graphics of the sprite the player is talking to (to face the right direction) pop bc pop de ld hl, wMapSpriteData ; NPC text entries @@ -79,9 +79,9 @@ ENDM dict TX_SCRIPT_PLAYERS_PC, TextScript_ItemStoragePC dict TX_SCRIPT_BILLS_PC, TextScript_BillsPC dict TX_SCRIPT_POKECENTER_PC, TextScript_PokemonCenterPC - dict2 TX_SCRIPT_VENDING_MACHINE, callba VendingMachineMenu + dict2 TX_SCRIPT_VENDING_MACHINE, farcall VendingMachineMenu dict TX_SCRIPT_PRIZE_VENDOR, TextScript_GameCornerPrizeMenu - dict2 TX_SCRIPT_CABLE_CLUB_RECEPTIONIST, callab CableClubNPC + dict2 TX_SCRIPT_CABLE_CLUB_RECEPTIONIST, callfar CableClubNPC call PrintText_NoCreatingTextBox ; display the text ld a, [wDoNotWaitForButtonPressAfterDisplayingText] @@ -197,7 +197,7 @@ DisplayPokemonCenterDialogue:: jp AfterDisplayingTextID DisplaySafariGameOverText:: - callab PrintSafariGameOverText + callfar PrintSafariGameOverText jp AfterDisplayingTextID DisplayPokemonFaintedText:: diff --git a/home/trainers.asm b/home/trainers.asm index 66108af6..039c4ec8 100644 --- a/home/trainers.asm +++ b/home/trainers.asm @@ -219,7 +219,7 @@ ResetButtonPressedAndMapScript:: ; calls TrainerWalkUpToPlayer TrainerWalkUpToPlayer_Bank0:: - jpba TrainerWalkUpToPlayer + farjp TrainerWalkUpToPlayer ; sets opponent type and mon set/lvl based on the engaging trainer data InitBattleEnemyParameters:: @@ -343,14 +343,14 @@ PrintEndBattleText:: ldh [hLoadedROMBank], a ld [MBC1RomBank], a push hl - callba SaveTrainerName + farcall SaveTrainerName ld hl, TrainerEndBattleText call PrintText pop hl pop af ldh [hLoadedROMBank], a ld [MBC1RomBank], a - callba FreezeEnemyTrainerSprite + farcall FreezeEnemyTrainerSprite jp WaitForSoundToFinish GetSavedEndBattleTextPointer:: diff --git a/home/vblank.asm b/home/vblank.asm index 06b45b82..4c7abc20 100644 --- a/home/vblank.asm +++ b/home/vblank.asm @@ -72,7 +72,7 @@ VBlank:: call Audio3_UpdateMusic .afterMusic - callba TrackPlayTime ; keep track of time played + farcall TrackPlayTime ; keep track of time played ldh a, [hDisableJoypadPolling] and a diff --git a/macros/farcall.asm b/macros/farcall.asm index 85c2dc9f..122e5207 100644 --- a/macros/farcall.asm +++ b/macros/farcall.asm @@ -1,24 +1,22 @@ -farcall EQUS "callba" - -callba: MACRO +farcall: MACRO ld b, BANK(\1) ld hl, \1 call Bankswitch ENDM -callab: MACRO +callfar: MACRO ld hl, \1 ld b, BANK(\1) call Bankswitch ENDM -jpba: MACRO +farjp: MACRO ld b, BANK(\1) ld hl, \1 jp Bankswitch ENDM -jpab: MACRO +jpfar: MACRO ld hl, \1 ld b, BANK(\1) jp Bankswitch diff --git a/scripts/BikeShop.asm b/scripts/BikeShop.asm index 338381e9..8ff581a3 100755 --- a/scripts/BikeShop.asm +++ b/scripts/BikeShop.asm @@ -24,7 +24,7 @@ BikeShopText1: jr nc, .BagFull ld a, BIKE_VOUCHER ldh [hItemToRemoveID], a - callba RemoveItemByID + farcall RemoveItemByID SetEvent EVENT_GOT_BICYCLE ld hl, BikeShopText_1d824 call PrintText diff --git a/scripts/CeladonMansion3F.asm b/scripts/CeladonMansion3F.asm index c9085b32..b2d40b44 100755 --- a/scripts/CeladonMansion3F.asm +++ b/scripts/CeladonMansion3F.asm @@ -49,7 +49,7 @@ DirectorText: text_far _CompletedDexText text_promptbutton text_asm - callab DisplayDiploma + callfar DisplayDiploma ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a jp TextScriptEnd diff --git a/scripts/CeladonMartElevator.asm b/scripts/CeladonMartElevator.asm index bcac0d14..e58c88f0 100755 --- a/scripts/CeladonMartElevator.asm +++ b/scripts/CeladonMartElevator.asm @@ -60,7 +60,7 @@ CeladonMartElevatorWarpMaps: CeladonMartElevatorWarpMapsEnd: CeladonMartElevatorScript_48654: - jpba ShakeElevator + farjp ShakeElevator CeladonMartElevator_TextPointers: dw CeladonMartElevatorText1 diff --git a/scripts/CeladonMartRoof.asm b/scripts/CeladonMartRoof.asm index 06a8390a..e880211b 100755 --- a/scripts/CeladonMartRoof.asm +++ b/scripts/CeladonMartRoof.asm @@ -131,7 +131,7 @@ CeladonMartRoofScript_GiveDrinkToGirl: jp PrintText RemoveItemByIDBank12: - jpba RemoveItemByID + farjp RemoveItemByID CeladonMartRoofText_484ee: text_far _CeladonMartRoofText_484ee diff --git a/scripts/CeruleanCity.asm b/scripts/CeruleanCity.asm index 656c3a4d..070120b7 100755 --- a/scripts/CeruleanCity.asm +++ b/scripts/CeruleanCity.asm @@ -174,7 +174,7 @@ CeruleanCityScript2: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $1 ldh [hSpriteIndex], a call SetSpriteMovementBytesToFF @@ -310,7 +310,7 @@ CeruleanCityText2: ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, ReceivedTM28Text call PrintText - callba CeruleanHideRocket + farcall CeruleanHideRocket .Done jp TextScriptEnd diff --git a/scripts/ChampionsRoom.asm b/scripts/ChampionsRoom.asm index 53dd9d4e..e57048c5 100755 --- a/scripts/ChampionsRoom.asm +++ b/scripts/ChampionsRoom.asm @@ -108,7 +108,7 @@ GaryScript3: ret GaryScript4: - callba Music_Cities1AlternateTempo + farcall Music_Cities1AlternateTempo ld a, $2 ldh [hSpriteIndexOrTextID], a call GaryScript_760c8 diff --git a/scripts/CinnabarLabFossilRoom.asm b/scripts/CinnabarLabFossilRoom.asm index ac33e6ee..4bdb8a36 100755 --- a/scripts/CinnabarLabFossilRoom.asm +++ b/scripts/CinnabarLabFossilRoom.asm @@ -56,7 +56,7 @@ Lab4Text1: ld a, [wFilteredBagItemsCount] and a jr z, .asm_75d8d - callba GiveFossilToCinnabarLab + farcall GiveFossilToCinnabarLab jr .asm_75d93 .asm_75d8d ld hl, Lab4Text_75dcb @@ -106,4 +106,4 @@ Lab4Text2: jp TextScriptEnd LoadFossilItemAndMonNameBank1D: - jpba LoadFossilItemAndMonName + farjp LoadFossilItemAndMonName diff --git a/scripts/CopycatsHouse2F.asm b/scripts/CopycatsHouse2F.asm index b885baab..c27043e6 100755 --- a/scripts/CopycatsHouse2F.asm +++ b/scripts/CopycatsHouse2F.asm @@ -30,7 +30,7 @@ CopycatsHouse2FText1: call PrintText ld a, POKE_DOLL ldh [hItemToRemoveID], a - callba RemoveItemByID + farcall RemoveItemByID SetEvent EVENT_GOT_TM31 jr .asm_62ecd .BagFull diff --git a/scripts/Daycare.asm b/scripts/Daycare.asm index 9fc8f3c4..481d7e14 100755 --- a/scripts/Daycare.asm +++ b/scripts/Daycare.asm @@ -35,7 +35,7 @@ DayCareMText1: pop af ld hl, DayCareAllRightThenText jp c, .done - callab KnowsHMMove + callfar KnowsHMMove ld hl, DayCareCantAcceptMonWithHMText jp c, .done xor a @@ -65,13 +65,13 @@ DayCareMText1: ld a, DAYCARE_DATA ld [wMonDataLocation], a call LoadMonData - callab CalcLevelFromExperience + callfar CalcLevelFromExperience ld a, d cp MAX_LEVEL jr c, .skipCalcExp ld d, MAX_LEVEL - callab CalcExperience + callfar CalcExperience ld hl, wDayCareMonExp ldh a, [hExperience] ld [hli], a diff --git a/scripts/HallOfFame.asm b/scripts/HallOfFame.asm index cdfb2f17..35ad9fd8 100755 --- a/scripts/HallOfFame.asm +++ b/scripts/HallOfFame.asm @@ -45,7 +45,7 @@ HallofFameRoomScript2: ld [wHallOfFameCurScript], a ld a, PALLET_TOWN ld [wLastBlackoutMap], a - callba SaveSAVtoSRAM + farcall SaveSAVtoSRAM ld b, 5 .delayLoop ld c, 600 / 5 diff --git a/scripts/NameRatersHouse.asm b/scripts/NameRatersHouse.asm index 7694e92b..cecf97e7 100755 --- a/scripts/NameRatersHouse.asm +++ b/scripts/NameRatersHouse.asm @@ -68,7 +68,7 @@ NameRaterText1: jr nz, .asm_1daae ld hl, NameRaterText_1dac2 call PrintText - callba DisplayNameRaterScreen + farcall DisplayNameRaterScreen jr c, .asm_1daae ld hl, NameRaterText_1dac7 .asm_1daa8 diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm index 49017440..a2e0bfe8 100755 --- a/scripts/OaksLab.asm +++ b/scripts/OaksLab.asm @@ -441,7 +441,7 @@ OaksLabScript13: ld a, $10 ldh [hSpriteIndexOrTextID], a call DisplayTextID - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $1 ldh [hSpriteIndex], a ld de, .RivalExitMovement @@ -513,7 +513,7 @@ OaksLabScript15: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $15 ldh [hSpriteIndexOrTextID], a call DisplayTextID @@ -614,7 +614,7 @@ OaksLabScript16: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $1 ldh [hSpriteIndex], a ld de, wNPCMovementDirections2 diff --git a/scripts/PokemonTower2F.asm b/scripts/PokemonTower2F.asm index 86a60579..cddebfa8 100755 --- a/scripts/PokemonTower2F.asm +++ b/scripts/PokemonTower2F.asm @@ -79,7 +79,7 @@ PokemonTower2Script1: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $2 ld [wPokemonTower2FCurScript], a ld [wCurMapScript], a diff --git a/scripts/RocketHideoutElevator.asm b/scripts/RocketHideoutElevator.asm index 6b1294b3..45b27e3b 100755 --- a/scripts/RocketHideoutElevator.asm +++ b/scripts/RocketHideoutElevator.asm @@ -58,7 +58,7 @@ RocketHideoutElevatorWarpMapsEnd: RocketHideoutElevatorScript_4575f: call Delay3 - callba ShakeElevator + farcall ShakeElevator ret RocketHideoutElevator_TextPointers: diff --git a/scripts/Route22.asm b/scripts/Route22.asm index fd566ff0..57dc934e 100755 --- a/scripts/Route22.asm +++ b/scripts/Route22.asm @@ -170,7 +170,7 @@ Route22Script2: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, [wcf0d] cp $1 jr nz, .asm_50fff @@ -248,7 +248,7 @@ Route22Script_5104e: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateTempo + farcall Music_RivalAlternateTempo ld a, $2 ldh [hSpriteIndex], a call Route22MoveRivalSprite @@ -329,7 +329,7 @@ Route22Script5: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStartAndTempo + farcall Music_RivalAlternateStartAndTempo ld a, [wcf0d] cp $1 jr nz, .asm_51134 diff --git a/scripts/Route5Gate.asm b/scripts/Route5Gate.asm index 0b66efa6..f2d45112 100755 --- a/scripts/Route5Gate.asm +++ b/scripts/Route5Gate.asm @@ -26,7 +26,7 @@ Route5GateScript0: ld [wPlayerMovingDirection], a xor a ldh [hJoyHeld], a - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_1df82 @@ -73,7 +73,7 @@ Route5GateText1: ld a, [wd728] bit 6, a jr nz, .asm_88856 - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_768a2 diff --git a/scripts/Route6Gate.asm b/scripts/Route6Gate.asm index 7d135498..22d40fd3 100755 --- a/scripts/Route6Gate.asm +++ b/scripts/Route6Gate.asm @@ -20,7 +20,7 @@ Route6GateScript0: ld [wPlayerMovingDirection], a xor a ldh [hJoyHeld], a - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_1e080 diff --git a/scripts/Route7Gate.asm b/scripts/Route7Gate.asm index 041d6c6a..182dedab 100755 --- a/scripts/Route7Gate.asm +++ b/scripts/Route7Gate.asm @@ -32,7 +32,7 @@ Route7GateScript0: ld [wPlayerMovingDirection], a xor a ldh [hJoyHeld], a - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_1e15a diff --git a/scripts/Route8Gate.asm b/scripts/Route8Gate.asm index 3bdd6070..9ddaf601 100755 --- a/scripts/Route8Gate.asm +++ b/scripts/Route8Gate.asm @@ -31,7 +31,7 @@ Route8GateScript0: ld [wPlayerMovingDirection], a xor a ldh [hJoyHeld], a - callba RemoveGuardDrink + farcall RemoveGuardDrink ldh a, [hItemToRemoveID] and a jr nz, .asm_1e220 diff --git a/scripts/SSAnne2F.asm b/scripts/SSAnne2F.asm index 45e8f283..5060f1e1 100755 --- a/scripts/SSAnne2F.asm +++ b/scripts/SSAnne2F.asm @@ -148,7 +148,7 @@ SSAnne2Script2: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld a, $3 ld [wSSAnne2FCurScript], a ret diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm index e7032760..dae0f96b 100755 --- a/scripts/SilphCo7F.asm +++ b/scripts/SilphCo7F.asm @@ -222,7 +222,7 @@ SilphCo7Script4: ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a call PlaySound - callba Music_RivalAlternateStart + farcall Music_RivalAlternateStart ld de, MovementData_51d1d ld a, [wcf0d] cp $1 diff --git a/scripts/SilphCoElevator.asm b/scripts/SilphCoElevator.asm index 3ff507c7..e660cd0f 100755 --- a/scripts/SilphCoElevator.asm +++ b/scripts/SilphCoElevator.asm @@ -74,7 +74,7 @@ SilphCoElevatorWarpMapsEnd: SilphCoElevatorScript_45827: call Delay3 - callba ShakeElevator + farcall ShakeElevator ret SilphCoElevator_TextPointers: diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm index d1a60988..5af5e5a2 100755 --- a/scripts/VermilionDock.asm +++ b/scripts/VermilionDock.asm @@ -45,7 +45,7 @@ VermilionDock_1db9b: ld c, BANK(Music_Surfing) ld a, MUSIC_SURFING call PlayMusic - callba LoadSmokeTileFourTimes + farcall LoadSmokeTileFourTimes xor a ld [wSpritePlayerStateData1ImageIndex], a ld c, 120 diff --git a/scripts/ViridianGym.asm b/scripts/ViridianGym.asm index fafc6388..80f19f3a 100755 --- a/scripts/ViridianGym.asm +++ b/scripts/ViridianGym.asm @@ -128,7 +128,7 @@ ViridianGymScript4: ld [wCurMapScript], a ret .asm_74980 - jpba LoadSpinnerArrowTiles + farjp LoadSpinnerArrowTiles ViridianGymScript3: ld a, [wIsInBattle] diff --git a/scripts/WardensHouse.asm b/scripts/WardensHouse.asm index 1cb68cf9..6705a450 100755 --- a/scripts/WardensHouse.asm +++ b/scripts/WardensHouse.asm @@ -33,7 +33,7 @@ FuchsiaHouse2Text1: call PrintText ld a, GOLD_TEETH ldh [hItemToRemoveID], a - callba RemoveItemByID + farcall RemoveItemByID SetEvent EVENT_GAVE_GOLD_TEETH .asm_60cba ld hl, WardenThankYouText -- cgit v1.3.1-sl0p From 45ed05decf330faab4503fe8fecadc54698c9724 Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 7 Jul 2020 11:10:29 -0400 Subject: Use HIGH() and LOW() --- constants/audio_constants.asm | 8 ++--- constants/battle_constants.asm | 2 ++ engine/battle/core.asm | 44 ++++++++++++++-------------- engine/battle/effects.asm | 15 +++++----- engine/gfx/mon_icons.asm | 2 +- engine/gfx/oam_dma.asm | 4 +-- engine/gfx/sprite_oam.asm | 8 ++--- engine/items/inventory.asm | 4 +-- engine/link/cable_club.asm | 4 +-- engine/movie/oak_speech/init_player_data.asm | 4 +-- engine/movie/title.asm | 12 ++++---- engine/movie/trade.asm | 4 +-- engine/overworld/elevator.asm | 2 +- engine/overworld/movement.asm | 22 +++++++------- engine/overworld/sprite_collisions.asm | 4 +-- engine/slots/slot_machine.asm | 10 +++---- home.asm | 2 +- home/init.asm | 4 +-- home/move_mon.asm | 10 +++---- home/uncompress.asm | 4 +-- macros/scripts/audio.asm | 3 +- scripts/SafariZoneGate.asm | 4 +-- 22 files changed, 89 insertions(+), 87 deletions(-) (limited to 'scripts') diff --git a/constants/audio_constants.asm b/constants/audio_constants.asm index 38719f92..3a1a8f5b 100644 --- a/constants/audio_constants.asm +++ b/constants/audio_constants.asm @@ -25,10 +25,10 @@ const Ch8 ; 7 ; HW sound channel register base addresses -HW_CH1_BASE EQU (rNR10 % $100) -HW_CH2_BASE EQU ((rNR21 % $100) - 1) -HW_CH3_BASE EQU (rNR30 % $100) -HW_CH4_BASE EQU ((rNR41 % $100) - 1) +HW_CH1_BASE EQU LOW(rNR10) +HW_CH2_BASE EQU LOW(rNR21) - 1 +HW_CH3_BASE EQU LOW(rNR30) +HW_CH4_BASE EQU LOW(rNR41) - 1 ; HW sound channel enable bit masks HW_CH1_ENABLE_MASK EQU %00010001 diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index ba5d6c68..bdd03e8a 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -35,6 +35,8 @@ BRN EQU 4 FRZ EQU 5 PAR EQU 6 +MAX_STAT_VALUE EQU 999 + ; volatile statuses 1 STORING_ENERGY EQU 0 ; Bide THRASHING_ABOUT EQU 1 ; e.g. Thrash diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 4d999d2a..9a66265c 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -4182,8 +4182,8 @@ GetDamageVarsForPlayerAttack: ; if the enemy has used Light Screen, double the enemy's special sla c rl b -; reflect and light screen boosts do not cap the stat at 999, so weird things will happen during stats scaling if -; a Pokemon with 512 or more Defense has used Reflect, or if a Pokemon with 512 or more Special has used Light Screen +; reflect and light screen boosts do not cap the stat at MAX_STAT_VALUE, so weird things will happen during stats scaling +; if a Pokemon with 512 or more Defense has used Reflect, or if a Pokemon with 512 or more Special has used Light Screen .specialAttackCritCheck ld hl, wBattleMonSpecial ld a, [wCriticalHitOrOHKO] @@ -4295,8 +4295,8 @@ GetDamageVarsForEnemyAttack: ; if the player has used Light Screen, double the player's special sla c rl b -; reflect and light screen boosts do not cap the stat at 999, so weird things will happen during stats scaling if -; a Pokemon with 512 or more Defense has used Reflect, or if a Pokemon with 512 or more Special has used Light Screen +; reflect and light screen boosts do not cap the stat at MAX_STAT_VALUE, so weird things will happen during stats scaling +; if a Pokemon with 512 or more Defense has used Reflect, or if a Pokemon with 512 or more Special has used Light Screen .specialAttackCritCheck ld hl, wEnemyMonSpecial ld a, [wCriticalHitOrOHKO] @@ -4508,14 +4508,14 @@ CalculateDamage: jr nz, .cap ldh a, [hQuotient + 2] - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + cp HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) jr c, .dont_cap_2 - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + 1 + cp HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) + 1 jr nc, .cap ldh a, [hQuotient + 3] - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) % $100 + cp LOW(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) jr nc, .cap .dont_cap_2 @@ -4533,21 +4533,21 @@ CalculateDamage: jr c, .cap ld a, [hl] - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + cp HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) jr c, .dont_cap_3 - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) / $100 + 1 + cp HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) + 1 jr nc, .cap inc hl ld a, [hld] - cp (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) % $100 + cp LOW(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE + 1) jr c, .dont_cap_3 .cap - ld a, (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) / $100 + ld a, HIGH(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) ld [hli], a - ld a, (MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) % $100 + ld a, LOW(MAX_NEUTRAL_DAMAGE - MIN_NEUTRAL_DAMAGE) ld [hld], a .dont_cap_3 @@ -6526,14 +6526,14 @@ CalculateModifiedStat: call Divide pop hl ldh a, [hDividend + 3] - sub 999 % $100 + sub LOW(MAX_STAT_VALUE) ldh a, [hDividend + 2] - sbc 999 / $100 + sbc HIGH(MAX_STAT_VALUE) jp c, .storeNewStatValue -; cap the stat at 999 - ld a, 999 / $100 +; cap the stat at MAX_STAT_VALUE (999) + ld a, HIGH(MAX_STAT_VALUE) ldh [hDividend + 2], a - ld a, 999 % $100 + ld a, LOW(MAX_STAT_VALUE) ldh [hDividend + 3], a .storeNewStatValue ldh a, [hDividend + 2] @@ -6573,7 +6573,7 @@ ApplyBadgeStatBoosts: ret ; multiply stat at hl by 1.125 -; cap stat at 999 +; cap stat at MAX_STAT_VALUE .applyBoostToStat ld a, [hli] ld d, a @@ -6591,13 +6591,13 @@ ApplyBadgeStatBoosts: adc d ld [hli], a ld a, [hld] - sub 999 % $100 + sub LOW(MAX_STAT_VALUE) ld a, [hl] - sbc 999 / $100 + sbc HIGH(MAX_STAT_VALUE) ret c - ld a, 999 / $100 + ld a, HIGH(MAX_STAT_VALUE) ld [hli], a - ld a, 999 % $100 + ld a, LOW(MAX_STAT_VALUE) ld [hld], a ret diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index fe050937..441d6c1c 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -399,11 +399,12 @@ StatModifierUpEffect: inc d ; de = unmodified (original) stat .checkIf999 pop bc + ; check if stat is already 999 ld a, [hld] - sub 999 % $100 ; check if stat is already 999 + sub LOW(MAX_STAT_VALUE) jr nz, .recalculateStat ld a, [hl] - sbc 999 / $100 + sbc HIGH(MAX_STAT_VALUE) jp z, RestoreOriginalStatModifier .recalculateStat ; recalculate affected stat ; paralysis and burn penalties, as well as badge boosts are ignored @@ -431,15 +432,15 @@ StatModifierUpEffect: ld b, $4 call Divide pop hl -; cap at 999 +; cap at MAX_STAT_VALUE (999) ldh a, [hProduct + 3] - sub 999 % $100 + sub LOW(MAX_STAT_VALUE) ldh a, [hProduct + 2] - sbc 999 / $100 + sbc HIGH(MAX_STAT_VALUE) jp c, UpdateStat - ld a, 999 / $100 + ld a, HIGH(MAX_STAT_VALUE) ldh [hMultiplicand + 1], a - ld a, 999 % $100 + ld a, LOW(MAX_STAT_VALUE) ldh [hMultiplicand + 2], a UpdateStat: diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm index 19008c05..253fca35 100755 --- a/engine/gfx/mon_icons.asm +++ b/engine/gfx/mon_icons.asm @@ -236,7 +236,7 @@ WriteMonPartySpriteOAM: ; make a copy at wMonPartySpritesSavedOAM. push af ld c, $10 - ld h, wOAMBuffer / $100 + ld h, HIGH(wOAMBuffer) ldh a, [hPartyMonIndex] swap a ld l, a diff --git a/engine/gfx/oam_dma.asm b/engine/gfx/oam_dma.asm index d8d8839a..84bb4b5c 100644 --- a/engine/gfx/oam_dma.asm +++ b/engine/gfx/oam_dma.asm @@ -1,7 +1,7 @@ WriteDMACodeToHRAM:: ; Since no other memory is available during OAM DMA, ; DMARoutine is copied to HRAM and executed there. - ld c, hDMARoutine % $100 + ld c, LOW(hDMARoutine) ld b, DMARoutineEnd - DMARoutine ld hl, DMARoutine .copy @@ -14,7 +14,7 @@ WriteDMACodeToHRAM:: DMARoutine: ; initiate DMA - ld a, wOAMBuffer / $100 + ld a, HIGH(wOAMBuffer) ldh [rDMA], a ; wait for DMA to finish diff --git a/engine/gfx/sprite_oam.asm b/engine/gfx/sprite_oam.asm index 1a96286d..7e9bf739 100644 --- a/engine/gfx/sprite_oam.asm +++ b/engine/gfx/sprite_oam.asm @@ -18,7 +18,7 @@ PrepareOAMData:: .spriteLoop ldh [hSpriteOffset2], a - ld d, wSpriteStateData1 / $100 + ld d, HIGH(wSpriteStateData1) ldh a, [hSpriteOffset2] ld e, a ld a, [de] ; c1x0 @@ -79,7 +79,7 @@ PrepareOAMData:: ldh a, [hOAMBufferOffset] ld e, a - ld d, wOAMBuffer / $100 + ld d, HIGH(wOAMBuffer) .tileLoop ldh a, [hSpriteScreenY] ; temp for sprite Y position @@ -141,13 +141,13 @@ PrepareOAMData:: .nextSprite ldh a, [hSpriteOffset2] add $10 - cp $100 % $100 + cp LOW($100) jp nz, .spriteLoop ; Clear unused OAM. ldh a, [hOAMBufferOffset] ld l, a - ld h, wOAMBuffer / $100 + ld h, HIGH(wOAMBuffer) ld de, $4 ld b, $a0 ld a, [wd736] diff --git a/engine/items/inventory.asm b/engine/items/inventory.asm index 7ce61cb9..bf433175 100644 --- a/engine/items/inventory.asm +++ b/engine/items/inventory.asm @@ -12,10 +12,10 @@ AddItemToInventory_:: push hl push hl ld d, PC_ITEM_CAPACITY ; how many items the PC can hold - ld a, wNumBagItems & $FF + ld a, LOW(wNumBagItems) cp l jr nz, .checkIfInventoryFull - ld a, wNumBagItems >> 8 + ld a, HIGH(wNumBagItems) cp h jr nz, .checkIfInventoryFull ; if the destination is the bag diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index 03e1c50a..dd93ebba 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -255,9 +255,9 @@ CableClub_DoBattleOrTradeAgain: ld hl, wEnemyMons + (SERIAL_PREAMBLE_BYTE - 1) dec c jr nz, .unpatchEnemyMonsLoop - ld a, wEnemyMonOT % $100 + ld a, LOW(wEnemyMonOT) ld [wUnusedCF8D], a - ld a, wEnemyMonOT / $100 + ld a, HIGH(wEnemyMonOT) ld [wUnusedCF8D + 1], a xor a ld [wTradeCenterPointerTableIndex], a diff --git a/engine/movie/oak_speech/init_player_data.asm b/engine/movie/oak_speech/init_player_data.asm index bd181bbd..53ca24f3 100644 --- a/engine/movie/oak_speech/init_player_data.asm +++ b/engine/movie/oak_speech/init_player_data.asm @@ -23,9 +23,9 @@ InitPlayerData2: START_MONEY EQU $3000 ld hl, wPlayerMoney + 1 - ld a, START_MONEY / $100 + ld a, HIGH(START_MONEY) ld [hld], a - xor a + xor a ; LOW(START_MONEY) ld [hli], a inc hl ld [hl], a diff --git a/engine/movie/title.asm b/engine/movie/title.asm index efdf2f07..00e639ae 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -126,13 +126,13 @@ ENDC ld [wTitleMonSpecies], a call LoadTitleMonSprite - ld a, (vBGMap0 + $300) / $100 + ld a, HIGH(vBGMap0 + $300) call TitleScreenCopyTileMapToVRAM call SaveScreenTilesToBuffer1 ld a, $40 ldh [hWY], a call LoadScreenTilesFromBuffer2 - ld a, vBGMap0 / $100 + ld a, HIGH(vBGMap0) call TitleScreenCopyTileMapToVRAM ld b, SET_PAL_TITLE_SCREEN call RunPaletteCommand @@ -205,7 +205,7 @@ ENDC and a jr nz, .scrollTitleScreenGameVersionLoop - ld a, vBGMap1 / $100 + ld a, HIGH(vBGMap1) call TitleScreenCopyTileMapToVRAM call LoadScreenTilesFromBuffer2 call PrintGameVersionOnTitleScreen @@ -241,9 +241,9 @@ ENDC inc a ldh [hAutoBGTransferEnabled], a call ClearScreen - ld a, vBGMap0 / $100 + ld a, HIGH(vBGMap0) call TitleScreenCopyTileMapToVRAM - ld a, vBGMap1 / $100 + ld a, HIGH(vBGMap1) call TitleScreenCopyTileMapToVRAM call Delay3 call LoadGBPal @@ -258,7 +258,7 @@ ENDC farjp DoClearSaveDialogue TitleScreenPickNewMon: - ld a, vBGMap0 / $100 + ld a, HIGH(vBGMap0) call TitleScreenCopyTileMapToVRAM .loop diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index 518742aa..6aac7e23 100755 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -237,7 +237,7 @@ Trade_ShowPlayerMon: ld c, 10 call TextBoxBorder call Trade_PrintPlayerMonInfoText - ld b, vBGMap0 / $100 + ld b, HIGH(vBGMap0) call CopyScreenTileBufferToVRAM call ClearScreen ld a, [wTradedPlayerMonSpecies] @@ -266,7 +266,7 @@ Trade_ShowPlayerMon: Trade_DrawOpenEndOfLinkCable: call Trade_ClearTileMap - ld b, vBGMap0 / $100 + ld b, HIGH(vBGMap0) call CopyScreenTileBufferToVRAM ld b, SET_PAL_GENERIC call RunPaletteCommand diff --git a/engine/overworld/elevator.asm b/engine/overworld/elevator.asm index 7a6aca85..fa404602 100755 --- a/engine/overworld/elevator.asm +++ b/engine/overworld/elevator.asm @@ -56,7 +56,7 @@ ShakeElevatorRedrawRow: add hl, de ld a, h and $3 - or vBGMap0 / $100 + or HIGH(vBGMap0) ld d, a ld a, l pop hl diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index ac7e1b46..a20b3174 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -23,7 +23,7 @@ UpdatePlayerSprite: ret .lowerLeftTileIsMapTile call DetectCollisionBetweenSprites - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ld a, [wWalkCounter] and a jr nz, .moving @@ -395,7 +395,7 @@ UpdateSpriteMovementDelay: ld l, a ld [hl], $1 ; c1x1 = 1 (mark as ready to move) notYetMoving: - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData1AnimFrameCounter - wSpritePlayerStateData1 ld l, a @@ -450,7 +450,7 @@ InitializeSpriteStatus: ; calculates the sprite's screen position form its map position and the player position InitializeSpriteScreenPosition: - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData2MapY - wSpritePlayerStateData2 ld l, a @@ -478,7 +478,7 @@ CheckSpriteAvailability: ldh a, [hIsHiddenMissableObject] and a jp nz, .spriteInvisible - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData2MovementByte1 - wSpritePlayerStateData2 ld l, a @@ -526,7 +526,7 @@ CheckSpriteAvailability: cp d jr c, .spriteVisible ; standing on tile with ID >=MAP_TILESET_SIZE (top right tile) .spriteInvisible - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1 ld l, a @@ -580,7 +580,7 @@ UpdateSpriteImage: ; e: X movement delta (-1, 0 or 1) ; set carry on failure, clears carry on success CanWalkOntoTile: - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData2MovementByte1 - wSpritePlayerStateData2 ld l, a @@ -608,7 +608,7 @@ CanWalkOntoTile: ld a, [hl] ; $c2x6 (movement byte 1) inc a jr z, .impassable ; if $ff, no movement allowed (however, changing direction is) - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld l, a @@ -627,14 +627,14 @@ CanWalkOntoTile: call DetectCollisionBetweenSprites pop bc pop de - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add $c ld l, a ld a, [hl] ; c1xc (directions in which sprite collision would occur) and b ; check against chosen direction (1,2,4 or 8) jr nz, .impassable ; collision between sprites, don't go there - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData2YDisplacement - wSpritePlayerStateData2 ld l, a @@ -665,7 +665,7 @@ CanWalkOntoTile: and a ; clear carry (marking success) ret .impassable - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] inc a ld l, a @@ -691,7 +691,7 @@ CanWalkOntoTile: ; this is always the lower left tile of the 2x2 tile blocks all sprites are snapped to ; hl: output pointer GetTileSpriteStandsOn: - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePlayerStateData1YPixels - wSpritePlayerStateData1 ld l, a diff --git a/engine/overworld/sprite_collisions.asm b/engine/overworld/sprite_collisions.asm index e6c415ab..6f8e3c2c 100644 --- a/engine/overworld/sprite_collisions.asm +++ b/engine/overworld/sprite_collisions.asm @@ -53,9 +53,9 @@ UpdateNonPlayerSprite: DetectCollisionBetweenSprites: nop - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] - add wSpriteStateData1 % $100 + add LOW(wSpriteStateData1) ld l, a ld a, [hl] ; a = [$c1i0] (picture) (0 if slot is unused) diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index b6eda6d1..64c14997 100755 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -294,7 +294,7 @@ SlotMachine_StopWheel1Early: ; Stop early if the middle symbol is not a cherry. inc hl ld a, [hl] - cp SLOTSCHERRY >> 8 + cp HIGH(SLOTSCHERRY) jr nz, .stopWheel ret ; It looks like this was intended to make the wheel stop when a 7 symbol was @@ -303,7 +303,7 @@ SlotMachine_StopWheel1Early: ld c, $3 .loop ld a, [hli] - cp SLOTS7 >> 8 + cp HIGH(SLOTS7) jr c, .stopWheel ; condition never true dec c jr nz, .loop @@ -330,7 +330,7 @@ SlotMachine_StopWheel2Early: .sevenAndBarMode call SlotMachine_FindWheel1Wheel2Matches ld a, [de] - cp (SLOTSBAR >> 8) + 1 + cp HIGH(SLOTSBAR) + 1 ret nc .stopWheel xor a @@ -427,7 +427,7 @@ SlotMachine_CheckForMatches: jr nz, .acceptMatch ; if 7/bar matches aren't enabled and the match was a 7/bar symbol, roll wheel ld a, [hl] - cp (SLOTSBAR >> 8) + 1 + cp HIGH(SLOTSBAR) + 1 jr c, .rollWheel3DownByOneSymbol .acceptMatch ld a, [hl] @@ -702,7 +702,7 @@ SlotMachine_PayCoinsToPlayer: .skip1 ld [wAnimCounter], a ld a, [wSlotMachineWinningSymbol] - cp (SLOTSBAR >> 8) + 1 + cp HIGH(SLOTSBAR) + 1 ld c, 8 jr nc, .skip2 srl c ; c = 4 (make the the coins transfer faster if the symbol was 7 or bar) diff --git a/home.asm b/home.asm index 62594b43..3e465cdf 100644 --- a/home.asm +++ b/home.asm @@ -1242,7 +1242,7 @@ StringCmp:: ; c = X coordinate of upper left corner of sprite ; de = base address of 4 tile number and attribute pairs WriteOAMBlock:: - ld h, wOAMBuffer / $100 + ld h, HIGH(wOAMBuffer) swap a ; multiply by 16 ld l, a call .writeOneEntry ; upper left diff --git a/home/init.asm b/home/init.asm index f18216ff..e3f5fdd4 100644 --- a/home/init.asm +++ b/home/init.asm @@ -82,9 +82,9 @@ rLCDC_DEFAULT EQU %11100011 ld a, CONNECTION_NOT_ESTABLISHED ldh [hSerialConnectionStatus], a - ld h, vBGMap0 / $100 + ld h, HIGH(vBGMap0) call ClearBgMap - ld h, vBGMap1 / $100 + ld h, HIGH(vBGMap1) call ClearBgMap ld a, rLCDC_DEFAULT diff --git a/home/move_mon.asm b/home/move_mon.asm index 9fe7b067..cf7213b1 100644 --- a/home/move_mon.asm +++ b/home/move_mon.asm @@ -197,17 +197,17 @@ CalcStat:: ldh [hMultiplicand+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level + 10 .noCarry4 ldh a, [hMultiplicand+1] ; check for overflow (>999) - cp 999 / $100 + 1 + cp HIGH(MAX_STAT_VALUE) + 1 jr nc, .overflow - cp 999 / $100 + cp HIGH(MAX_STAT_VALUE) jr c, .noOverflow ldh a, [hMultiplicand+2] - cp 999 % $100 + 1 + cp LOW(MAX_STAT_VALUE) + 1 jr c, .noOverflow .overflow - ld a, 999 / $100 ; overflow: cap at 999 + ld a, HIGH(MAX_STAT_VALUE) ; overflow: cap at 999 ldh [hMultiplicand+1], a - ld a, 999 % $100 + ld a, LOW(MAX_STAT_VALUE) ldh [hMultiplicand+2], a .noOverflow pop bc diff --git a/home/uncompress.asm b/home/uncompress.asm index 69d94cb0..9d08aa60 100644 --- a/home/uncompress.asm +++ b/home/uncompress.asm @@ -20,8 +20,8 @@ UncompressSpriteData:: ; initializes necessary data to load a sprite and runs UncompressSpriteDataLoop _UncompressSpriteData:: ld hl, sSpriteBuffer1 - ld c, (2*SPRITEBUFFERSIZE) % $100 - ld b, (2*SPRITEBUFFERSIZE) / $100 + ld c, LOW(2 * SPRITEBUFFERSIZE) + ld b, HIGH(2 * SPRITEBUFFERSIZE) xor a call FillMemory ; clear sprite buffer 1 and 2 ld a, $1 diff --git a/macros/scripts/audio.asm b/macros/scripts/audio.asm index 8a250c63..4f4d084c 100755 --- a/macros/scripts/audio.asm +++ b/macros/scripts/audio.asm @@ -141,8 +141,7 @@ ENDM ; stored in big endian tempo: MACRO db $ED - db \1 / $100 - db \1 % $100 + db HIGH(\1), LOW(\1) ENDM ; arguments: left output enable mask, right output enable mask diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm index eb49ba8d..a15a5630 100755 --- a/scripts/SafariZoneGate.asm +++ b/scripts/SafariZoneGate.asm @@ -182,9 +182,9 @@ SafariZoneGate_TextPointers: call PrintText ld a, 30 ld [wNumSafariBalls], a - ld a, 502 / $100 + ld a, HIGH(502) ld [wSafariSteps], a - ld a, 502 % $100 + ld a, LOW(502) ld [wSafariSteps + 1], a ld a, D_UP ld c, 3 -- cgit v1.3.1-sl0p From 13129459f11e73df8c556f0c02cd4fca7266a346 Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 7 Jul 2020 11:30:10 -0400 Subject: Sync coordinate macros with pokecrystal --- engine/battle/animations.asm | 46 +++---- engine/battle/battle_transitions.asm | 84 ++++++------ engine/battle/core.asm | 144 ++++++++++----------- engine/battle/draw_hud_pokeball_gfx.asm | 4 +- engine/battle/end_of_battle.asm | 2 +- engine/battle/ghost_marowak_anim.asm | 2 +- engine/battle/link_battle_versus_text.asm | 8 +- engine/battle/move_effects/drain_hp.asm | 4 +- engine/battle/move_effects/heal.asm | 4 +- engine/battle/move_effects/recoil.asm | 4 +- engine/battle/scroll_draw_trainer_pic.asm | 2 +- engine/battle/trainer_ai.asm | 2 +- engine/battle/wild_encounters.asm | 4 +- engine/events/cinnabar_lab.asm | 4 +- engine/events/diploma.asm | 14 +- engine/events/hidden_objects/bills_house_pc.asm | 4 +- engine/events/hidden_objects/book_or_sculpture.asm | 2 +- engine/events/hidden_objects/bookshelves.asm | 2 +- engine/events/hidden_objects/museum_fossils.asm | 2 +- engine/events/hidden_objects/school_blackboard.asm | 10 +- engine/events/pokemart.asm | 4 +- engine/events/prize_menu.asm | 30 ++--- engine/events/vending_machine.asm | 6 +- engine/items/item_effects.asm | 6 +- engine/items/town_map.asm | 32 ++--- engine/link/cable_club.asm | 58 ++++----- engine/link/print_waiting_text.asm | 4 +- engine/menus/display_text_id_init.asm | 6 +- engine/menus/draw_badges.asm | 4 +- engine/menus/draw_start_menu.asm | 6 +- engine/menus/league_pc.asm | 8 +- engine/menus/main_menu.asm | 64 ++++----- engine/menus/naming_screen.asm | 22 ++-- engine/menus/party_menu.asm | 2 +- engine/menus/players_pc.asm | 4 +- engine/menus/pokedex.asm | 66 +++++----- engine/menus/save.asm | 20 +-- engine/menus/start_sub_menus.asm | 34 ++--- engine/menus/text_box.asm | 16 +-- engine/movie/credits.asm | 14 +- engine/movie/evolution.asm | 4 +- engine/movie/hall_of_fame.asm | 32 ++--- engine/movie/intro.asm | 10 +- engine/movie/oak_speech/clear_save.asm | 2 +- engine/movie/oak_speech/oak_speech.asm | 8 +- engine/movie/oak_speech/oak_speech2.asm | 12 +- engine/movie/title.asm | 12 +- engine/movie/trade.asm | 32 ++--- engine/movie/trade2.asm | 20 +-- engine/overworld/doors.asm | 2 +- engine/overworld/ledges.asm | 2 +- engine/overworld/movement.asm | 4 +- engine/overworld/player_animations.asm | 2 +- engine/overworld/player_state.asm | 30 ++--- engine/pokemon/bills_pc.asm | 40 +++--- engine/pokemon/evos_moves.asm | 2 +- engine/pokemon/learn_move.asm | 8 +- engine/pokemon/status_screen.asm | 62 ++++----- engine/slots/slot_machine.asm | 26 ++-- home.asm | 16 +-- home/copy2.asm | 8 +- home/list_menu.asm | 24 ++-- home/overworld.asm | 18 +-- home/text.asm | 40 +++--- home/vcopy.asm | 6 +- home/yes_no.asm | 6 +- macros/coords.asm | 96 ++++++++------ macros/data.asm | 2 +- macros/gfx.asm | 2 +- macros/scripts/events.asm | 4 +- macros/scripts/text.asm | 2 +- scripts/BikeShop.asm | 6 +- scripts/CeladonMartRoof.asm | 4 +- scripts/GameCorner.asm | 16 +-- scripts/VermilionDock.asm | 6 +- 75 files changed, 667 insertions(+), 653 deletions(-) (limited to 'scripts') diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index f19f1f4f..9f7b728a 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -682,7 +682,7 @@ DoBallTossSpecialEffects: cp 1 ret nz .moveGhostMarowakLeft - coord hl, 17, 0 + hlcoord 17, 0 ld de, 20 lb bc, 7, 7 .loop @@ -781,7 +781,7 @@ DoExplodeSpecialEffects: cp 1 ; is it the end of the subanimation? jr nz, FlashScreenEveryFourFrameBlocks ; if it's the end of the subanimation, make the attacking pokemon disappear - coord hl, 1, 5 + hlcoord 1, 5 jp AnimationHideMonPic ; make pokemon disappear ; flashes the screen when subanimation counter is 1 modulo 4 @@ -1135,12 +1135,12 @@ AnimationSlideMonUp: ld c, 7 ldh a, [hWhoseTurn] and a - coord hl, 1, 6 - coord de, 1, 5 + hlcoord 1, 6 + decoord 1, 5 ld a, $30 jr z, .next - coord hl, 12, 1 - coord de, 12, 0 + hlcoord 12, 1 + decoord 12, 0 ld a, $ff .next ld [wSlideMonUpBottomRowLeftTile], a @@ -1203,9 +1203,9 @@ _AnimationSlideMonUp: ; Fill in the bottom row of the mon pic with the next row's tile IDs. ldh a, [hWhoseTurn] and a - coord hl, 1, 11 + hlcoord 1, 11 jr z, .next - coord hl, 12, 6 + hlcoord 12, 6 .next ld a, [wSlideMonUpBottomRowLeftTile] inc a @@ -1372,11 +1372,11 @@ AnimationShakeBackAndForth: ; The mon's sprite disappears after this animation. ldh a, [hWhoseTurn] and a - coord hl, 0, 5 - coord de, 2, 5 + hlcoord 0, 5 + decoord 2, 5 jr z, .next - coord hl, 11, 0 - coord de, 13, 0 + hlcoord 11, 0 + decoord 13, 0 .next xor a @@ -1420,9 +1420,9 @@ AnimationMoveMonHorizontally: call AnimationHideMonPic ldh a, [hWhoseTurn] and a - coord hl, 2, 5 + hlcoord 2, 5 jr z, .next - coord hl, 11, 0 + hlcoord 11, 0 .next xor a push hl @@ -1533,12 +1533,12 @@ AnimationSquishMonPic: ldh a, [hWhoseTurn] and a jr z, .playerTurn - coord hl, 16, 0 - coord de, 14, 0 + hlcoord 16, 0 + decoord 14, 0 jr .next .playerTurn - coord hl, 5, 5 - coord de, 3, 5 + hlcoord 5, 5 + decoord 3, 5 .next push de xor a ; left @@ -1746,10 +1746,10 @@ _AnimationSlideMonOff: ldh a, [hWhoseTurn] and a jr z, .playerTurn - coord hl, 12, 0 + hlcoord 12, 0 jr .next .playerTurn - coord hl, 0, 5 + hlcoord 0, 5 .next ld d, 8 ; d's value is unused .slideLoop ; iterates once for each time the pic slides by one tile @@ -1996,7 +1996,7 @@ ChangeMonPic: xor a ld [wSpriteFlipped], a call GetMonHeader - coord hl, 12, 0 + hlcoord 12, 0 call LoadFrontSpriteByMonIndex jr .done .playerTurn @@ -2064,7 +2064,7 @@ ClearMonPicFromTileMap: push bc ld e, a ld d, 0 - coord hl, 0, 0 + hlcoord 0, 0 add hl, de lb bc, 7, 7 call ClearScreenArea @@ -2086,7 +2086,7 @@ GetMonSpriteTileMapPointerFromRowCount: .enemyTurn ld a, 12 .next - coord hl, 0, 0 + hlcoord 0, 0 ld e, a ld d, 0 add hl, de diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 8a22e70f..e563855d 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -181,7 +181,7 @@ BattleTransition_Spiral: call BattleTransition_InwardSpiral jr .done .outwardSpiral - coord hl, 10, 10 + hlcoord 10, 10 ld a, $3 ld [wOutwardSpiralCurrentDirection], a ld a, l @@ -210,7 +210,7 @@ BattleTransition_Spiral: BattleTransition_InwardSpiral: ld a, 7 ld [wInwardSpiralUpdateScreenCounter], a - coord hl, 0, 0 + hlcoord 0, 0 ld c, SCREEN_HEIGHT - 1 ld de, SCREEN_WIDTH call BattleTransition_InwardSpiral_ @@ -350,20 +350,20 @@ BattleTransition_Shrink: push bc xor a ldh [hAutoBGTransferEnabled], a - coord hl, 0, 7 - coord de, 0, 8 + hlcoord 0, 7 + decoord 0, 8 ld bc, -SCREEN_WIDTH * 2 call BattleTransition_CopyTiles1 - coord hl, 0, 10 - coord de, 0, 9 + hlcoord 0, 10 + decoord 0, 9 ld bc, SCREEN_WIDTH * 2 call BattleTransition_CopyTiles1 - coord hl, 8, 0 - coord de, 9, 0 + hlcoord 8, 0 + decoord 9, 0 ld bc, -2 call BattleTransition_CopyTiles2 - coord hl, 11, 0 - coord de, 10, 0 + hlcoord 11, 0 + decoord 10, 0 ld bc, 2 call BattleTransition_CopyTiles2 ld a, $1 @@ -384,20 +384,20 @@ BattleTransition_Split: ldh [hAutoBGTransferEnabled], a .loop push bc - coord hl, 0, 16 - coord de, 0, 17 + hlcoord 0, 16 + decoord 0, 17 ld bc, -SCREEN_WIDTH * 2 call BattleTransition_CopyTiles1 - coord hl, 0, 1 - coord de, 0, 0 + hlcoord 0, 1 + decoord 0, 0 ld bc, SCREEN_WIDTH * 2 call BattleTransition_CopyTiles1 - coord hl, 18, 0 - coord de, 19, 0 + hlcoord 18, 0 + decoord 19, 0 ld bc, -2 call BattleTransition_CopyTiles2 - coord hl, 1, 0 - coord de, 0, 0 + hlcoord 1, 0 + decoord 0, 0 ld bc, 2 call BattleTransition_CopyTiles2 call BattleTransition_TransferDelay3 @@ -493,8 +493,8 @@ BattleTransition_CopyTiles2: ; used for high level wild dungeon battles BattleTransition_VerticalStripes: ld c, SCREEN_HEIGHT - coord hl, 0, 0 - coord de, 1, 17 + hlcoord 0, 0 + decoord 1, 17 xor a ldh [hAutoBGTransferEnabled], a .loop @@ -532,8 +532,8 @@ BattleTransition_VerticalStripes_: ; used for low level wild dungeon battles BattleTransition_HorizontalStripes: ld c, SCREEN_WIDTH - coord hl, 0, 0 - coord de, 19, 1 + hlcoord 0, 0 + decoord 19, 1 xor a ldh [hAutoBGTransferEnabled], a .loop @@ -654,84 +654,84 @@ BattleTransition_Circle_Sub2: BattleTransition_HalfCircle1: db $01 dw BattleTransition_CircleData1 - dwCoord 18, 6 + dwcoord 18, 6 db $01 dw BattleTransition_CircleData2 - dwCoord 19, 3 + dwcoord 19, 3 db $01 dw BattleTransition_CircleData3 - dwCoord 18, 0 + dwcoord 18, 0 db $01 dw BattleTransition_CircleData4 - dwCoord 14, 0 + dwcoord 14, 0 db $01 dw BattleTransition_CircleData5 - dwCoord 10, 0 + dwcoord 10, 0 db $00 dw BattleTransition_CircleData5 - dwCoord 9, 0 + dwcoord 9, 0 db $00 dw BattleTransition_CircleData4 - dwCoord 5, 0 + dwcoord 5, 0 db $00 dw BattleTransition_CircleData3 - dwCoord 1, 0 + dwcoord 1, 0 db $00 dw BattleTransition_CircleData2 - dwCoord 0, 3 + dwcoord 0, 3 db $00 dw BattleTransition_CircleData1 - dwCoord 1, 6 + dwcoord 1, 6 BattleTransition_HalfCircle2: db $00 dw BattleTransition_CircleData1 - dwCoord 1, 11 + dwcoord 1, 11 db $00 dw BattleTransition_CircleData2 - dwCoord 0, 14 + dwcoord 0, 14 db $00 dw BattleTransition_CircleData3 - dwCoord 1, 17 + dwcoord 1, 17 db $00 dw BattleTransition_CircleData4 - dwCoord 5, 17 + dwcoord 5, 17 db $00 dw BattleTransition_CircleData5 - dwCoord 9, 17 + dwcoord 9, 17 db $01 dw BattleTransition_CircleData5 - dwCoord 10, 17 + dwcoord 10, 17 db $01 dw BattleTransition_CircleData4 - dwCoord 14, 17 + dwcoord 14, 17 db $01 dw BattleTransition_CircleData3 - dwCoord 18, 17 + dwcoord 18, 17 db $01 dw BattleTransition_CircleData2 - dwCoord 19, 14 + dwcoord 19, 14 db $01 dw BattleTransition_CircleData1 - dwCoord 18, 11 + dwcoord 18, 11 BattleTransition_Circle_Sub3: push hl diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 9a66265c..859f30d5 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -11,7 +11,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ld a, MESSAGE_BOX ; the usual text box at the bottom of the screen ld [wTextBoxID], a call DisplayTextBoxID - coord hl, 1, 5 + hlcoord 1, 5 lb bc, 3, 7 call ClearScreenArea call DisableLCD @@ -27,7 +27,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: or c jr nz, .clearBackgroundLoop ; copy the work RAM tile map to VRAM - coord hl, 0, 0 + hlcoord 0, 0 ld de, vBGMap0 ld b, 18 ; number of rows .copyRowLoop @@ -86,7 +86,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ldh [hAutoBGTransferEnabled], a ld a, $31 ldh [hStartTileID], a - coord hl, 1, 5 + hlcoord 1, 5 predef CopyUncompressedPicToTilemap xor a ldh [hWY], a @@ -232,7 +232,7 @@ StartBattle: ld [wcf91], a ld [wBattleMonSpecies2], a call LoadScreenTilesFromBuffer1 - coord hl, 1, 5 + hlcoord 1, 5 ld a, $9 call SlideTrainerPicOffScreen call SaveScreenTilesToBuffer1 @@ -666,12 +666,12 @@ HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ret UpdateCurMonHPBar: - coord hl, 10, 9 ; tile pointer to player HP bar + hlcoord 10, 9 ; tile pointer to player HP bar ldh a, [hWhoseTurn] and a ld a, $1 jr z, .playersTurn - coord hl, 2, 2 ; tile pointer to enemy HP bar + hlcoord 2, 2 ; tile pointer to enemy HP bar xor a .playersTurn push bc @@ -767,10 +767,10 @@ FaintEnemyPokemon: ld hl, wPlayerUsedMove ld [hli], a ld [hl], a - coord hl, 12, 5 - coord de, 12, 6 + hlcoord 12, 5 + decoord 12, 6 call SlideDownFaintedMonPic - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 4, 11 call ClearScreenArea ld a, [wIsInBattle] @@ -1021,11 +1021,11 @@ RemoveFaintedPlayerMon: ld [hl], a ld [wBattleMonStatus], a call ReadPlayerMonCurHPAndStatus - coord hl, 9, 7 + hlcoord 9, 7 lb bc, 5, 11 call ClearScreenArea - coord hl, 1, 10 - coord de, 1, 11 + hlcoord 1, 10 + decoord 1, 11 call SlideDownFaintedMonPic ld a, $1 ld [wBattleResult], a @@ -1059,7 +1059,7 @@ DoUseNextMonDialogue: ld hl, UseNextMonText call PrintText .displayYesNoBox - coord hl, 13, 9 + hlcoord 13, 9 lb bc, 10, 14 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -1136,7 +1136,7 @@ HandlePlayerBlackOut: ld a, [wCurOpponent] cp OPP_SONY1 jr nz, .notSony1Battle - coord hl, 0, 0 ; sony 1 battle + hlcoord 0, 0 ; sony 1 battle lb bc, 8, 21 call ClearScreenArea call ScrollTrainerPicAfterBattle @@ -1306,7 +1306,7 @@ EnemySendOutFirstMon: ld [wAICount], a ld hl, wPlayerBattleStatus1 res 5, [hl] - coord hl, 18, 0 + hlcoord 18, 0 ld a, 8 call SlideTrainerPicOffScreen call PrintEmptyString @@ -1376,7 +1376,7 @@ EnemySendOutFirstMon: jr nz, .next4 ld hl, TrainerAboutToUseText call PrintText - coord hl, 0, 7 + hlcoord 0, 7 lb bc, 8, 1 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -1411,7 +1411,7 @@ EnemySendOutFirstMon: call LoadScreenTilesFromBuffer1 .next4 call ClearSprites - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 4, 11 call ClearScreenArea ld b, SET_PAL_BATTLE @@ -1427,7 +1427,7 @@ EnemySendOutFirstMon: call LoadMonFrontSprite ld a, -$31 ldh [hStartTileID], a - coord hl, 15, 6 + hlcoord 15, 6 predef AnimateSendingOutMon ld a, [wEnemyMonSpecies2] call PlayCry @@ -1757,7 +1757,7 @@ SendOutMon: ldh [hWhoseTurn], a ld a, POOF_ANIM call PlayMoveAnimation - coord hl, 4, 11 + hlcoord 4, 11 predef AnimateSendingOutMon ld a, [wcf91] call PlayCry @@ -1766,10 +1766,10 @@ SendOutMon: ; show 2 stages of the player mon getting smaller before disappearing AnimateRetreatingPlayerMon: - coord hl, 1, 5 + hlcoord 1, 5 lb bc, 7, 7 call ClearScreenArea - coord hl, 3, 7 + hlcoord 3, 7 lb bc, 5, 5 xor a ld [wDownscaledMonSize], a @@ -1778,7 +1778,7 @@ AnimateRetreatingPlayerMon: ld c, 4 call DelayFrames call .clearScreenArea - coord hl, 4, 9 + hlcoord 4, 9 lb bc, 3, 3 ld a, 1 ld [wDownscaledMonSize], a @@ -1788,9 +1788,9 @@ AnimateRetreatingPlayerMon: call Delay3 call .clearScreenArea ld a, $4c - Coorda 5, 11 + ldcoord_a 5, 11 .clearScreenArea - coord hl, 1, 5 + hlcoord 1, 5 lb bc, 7, 7 jp ClearScreenArea @@ -1813,14 +1813,14 @@ DrawHUDsAndHPBars: DrawPlayerHUDAndHPBar: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 9, 7 + hlcoord 9, 7 lb bc, 5, 11 call ClearScreenArea callfar PlacePlayerHUDTiles - coord hl, 18, 9 + hlcoord 18, 9 ld [hl], $73 ld de, wBattleMonNick - coord hl, 10, 7 + hlcoord 10, 7 call CenterMonName call PlaceString ld hl, wBattleMonSpecies @@ -1831,7 +1831,7 @@ DrawPlayerHUDAndHPBar: ld de, wLoadedMonLevel ld bc, wBattleMonPP - wBattleMonLevel call CopyData - coord hl, 14, 8 + hlcoord 14, 8 push hl inc hl ld de, wLoadedMonStatus @@ -1842,7 +1842,7 @@ DrawPlayerHUDAndHPBar: .doNotPrintLevel ld a, [wLoadedMonSpecies] ld [wcf91], a - coord hl, 10, 9 + hlcoord 10, 9 predef DrawHP ld a, $1 ldh [hAutoBGTransferEnabled], a @@ -1874,15 +1874,15 @@ DrawPlayerHUDAndHPBar: DrawEnemyHUDAndHPBar: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 4, 12 call ClearScreenArea callfar PlaceEnemyHUDTiles ld de, wEnemyMonNick - coord hl, 1, 0 + hlcoord 1, 0 call CenterMonName call PlaceString - coord hl, 4, 1 + hlcoord 4, 1 push hl inc hl ld de, wEnemyMonStatus @@ -1955,7 +1955,7 @@ DrawEnemyHUDAndHPBar: .drawHPBar xor a ld [wHPBarType], a - coord hl, 2, 2 + hlcoord 2, 2 call DrawHPBar ld a, $1 ldh [hAutoBGTransferEnabled], a @@ -2030,12 +2030,12 @@ DisplayBattleMenu:: ld bc, NAME_LENGTH call CopyData ; the following simulates the keystrokes by drawing menus on screen - coord hl, 9, 14 + hlcoord 9, 14 ld [hl], "▶" ld c, 80 call DelayFrames ld [hl], " " - coord hl, 9, 16 + hlcoord 9, 16 ld [hl], "▶" ld c, 50 call DelayFrames @@ -2060,14 +2060,14 @@ DisplayBattleMenu:: ld a, " " jr z, .safariLeftColumn ; put cursor in left column for normal battle menu (i.e. when it's not a Safari battle) - Coorda 15, 14 ; clear upper cursor position in right column - Coorda 15, 16 ; clear lower cursor position in right column + ldcoord_a 15, 14 ; clear upper cursor position in right column + ldcoord_a 15, 16 ; clear lower cursor position in right column ld b, $9 ; top menu item X jr .leftColumn_WaitForInput .safariLeftColumn - Coorda 13, 14 - Coorda 13, 16 - coord hl, 7, 14 + ldcoord_a 13, 14 + ldcoord_a 13, 16 + hlcoord 7, 14 ld de, wNumSafariBalls lb bc, 1, 2 call PrintNumber @@ -2093,14 +2093,14 @@ DisplayBattleMenu:: ld a, " " jr z, .safariRightColumn ; put cursor in right column for normal battle menu (i.e. when it's not a Safari battle) - Coorda 9, 14 ; clear upper cursor position in left column - Coorda 9, 16 ; clear lower cursor position in left column + ldcoord_a 9, 14 ; clear upper cursor position in left column + ldcoord_a 9, 16 ; clear lower cursor position in left column ld b, $f ; top menu item X jr .rightColumn_WaitForInput .safariRightColumn - Coorda 1, 14 ; clear upper cursor position in left column - Coorda 1, 16 ; clear lower cursor position in left column - coord hl, 7, 14 + ldcoord_a 1, 14 ; clear upper cursor position in left column + ldcoord_a 1, 16 ; clear lower cursor position in left column + hlcoord 7, 14 ld de, wNumSafariBalls lb bc, 1, 2 call PrintNumber @@ -2321,7 +2321,7 @@ PartyMenuOrRockOrRun: call GBPalNormal jp DisplayBattleMenu .partyMonDeselected - coord hl, 11, 11 + hlcoord 11, 11 ld bc, 6 * SCREEN_WIDTH + 9 ld a, " " call FillMemory @@ -2483,18 +2483,18 @@ MoveSelectionMenu: ret z ld hl, wBattleMonMoves call .loadmoves - coord hl, 4, 12 + hlcoord 4, 12 ld b, 4 ld c, 14 di ; out of pure coincidence, it is possible for vblank to occur between the di and ei ; so it is necessary to put the di ei block to not cause tearing call TextBoxBorder - coord hl, 4, 12 + hlcoord 4, 12 ld [hl], $7a - coord hl, 10, 12 + hlcoord 10, 12 ld [hl], $7e ei - coord hl, 6, 13 + hlcoord 6, 13 call .writemoves ld b, $5 ld a, $c @@ -2502,11 +2502,11 @@ MoveSelectionMenu: .mimicmenu ld hl, wEnemyMonMoves call .loadmoves - coord hl, 0, 7 + hlcoord 0, 7 ld b, 4 ld c, 14 call TextBoxBorder - coord hl, 2, 8 + hlcoord 2, 8 call .writemoves ld b, $1 ld a, $7 @@ -2517,11 +2517,11 @@ MoveSelectionMenu: ld bc, wPartyMon2 - wPartyMon1 call AddNTimes call .loadmoves - coord hl, 4, 7 + hlcoord 4, 7 ld b, 4 ld c, 14 call TextBoxBorder - coord hl, 6, 8 + hlcoord 6, 8 call .writemoves ld b, $5 ld a, $7 @@ -2577,7 +2577,7 @@ SelectMenuItem: jr z, .battleselect dec a jr nz, .select - coord hl, 1, 14 + hlcoord 1, 14 ld de, WhichTechniqueString call PlaceString jr .select @@ -2589,7 +2589,7 @@ SelectMenuItem: ld a, [wMenuItemToSwap] and a jr z, .select - coord hl, 5, 13 + hlcoord 5, 13 dec a ld bc, SCREEN_WIDTH call AddNTimes @@ -2826,7 +2826,7 @@ SwapMovesInMenu: PrintMenuItem: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 0, 8 + hlcoord 0, 8 ld b, 3 ld c, 9 call TextBoxBorder @@ -2839,7 +2839,7 @@ PrintMenuItem: ld a, [wCurrentMenuItem] cp b jr nz, .notDisabled - coord hl, 1, 10 + hlcoord 1, 10 ld de, DisabledText call PlaceString jr .moveDisabled @@ -2871,23 +2871,23 @@ PrintMenuItem: and $3f ld [wcd6d], a ; print TYPE/ and / - coord hl, 1, 9 + hlcoord 1, 9 ld de, TypeText call PlaceString - coord hl, 7, 11 + hlcoord 7, 11 ld [hl], "/" - coord hl, 5, 9 + hlcoord 5, 9 ld [hl], "/" - coord hl, 5, 11 + hlcoord 5, 11 ld de, wcd6d lb bc, 1, 2 call PrintNumber - coord hl, 8, 11 + hlcoord 8, 11 ld de, wMaxPP lb bc, 1, 2 call PrintNumber call GetCurrentMove - coord hl, 2, 10 + hlcoord 2, 10 predef PrintMoveType .moveDisabled ld a, $1 @@ -4822,7 +4822,7 @@ ApplyDamageToEnemyPokemon: ld [wHPBarNewHP+1], a ld a, [hl] ld [wHPBarNewHP], a - coord hl, 2, 2 + hlcoord 2, 2 xor a ld [wHPBarType], a predef UpdateHPBar2 ; animate the HP bar shortening @@ -4940,7 +4940,7 @@ ApplyDamageToPlayerPokemon: ld [wHPBarMaxHP+1], a ld a, [hl] ld [wHPBarMaxHP], a - coord hl, 10, 9 + hlcoord 10, 9 ld a, $01 ld [wHPBarType], a predef UpdateHPBar2 ; animate the HP bar shortening @@ -6354,7 +6354,7 @@ LoadPlayerBackPic: ld [MBC1SRamEnable], a ld a, $31 ldh [hStartTileID], a - coord hl, 1, 5 + hlcoord 1, 5 predef_jump CopyUncompressedPicToTilemap ; does nothing since no stats are ever selected (barring glitches) @@ -6770,7 +6770,7 @@ InitBattleCommon: ldh [hStartTileID], a dec a ld [wAICount], a - coord hl, 12, 0 + hlcoord 12, 0 predef CopyUncompressedPicToTilemap ld a, $ff ld [wEnemyMonPartyPos], a @@ -6824,7 +6824,7 @@ InitWildBattle: xor a ld [wTrainerClass], a ldh [hStartTileID], a - coord hl, 12, 0 + hlcoord 12, 0 predef CopyUncompressedPicToTilemap ; common code that executes after init battle code specific to trainer or wild battles @@ -6846,10 +6846,10 @@ _InitBattleCommon: ld a, $9c ldh [hAutoBGTransferDest + 1], a call LoadScreenTilesFromBuffer1 - coord hl, 9, 7 + hlcoord 9, 7 lb bc, 5, 10 call ClearScreenArea - coord hl, 1, 0 + hlcoord 1, 0 lb bc, 4, 10 call ClearScreenArea call ClearSprites @@ -6993,7 +6993,7 @@ LoadMonBackPic: ; been loaded with GetMonHeader. ld a, [wBattleMonSpecies2] ld [wcf91], a - coord hl, 1, 5 + hlcoord 1, 5 ld b, 7 ld c, 8 call ClearScreenArea diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index c0a91949..8cd9528d 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -121,7 +121,7 @@ PlacePlayerHUDTiles: ld de, wHUDGraphicsTiles ld bc, $3 call CopyData - coord hl, 18, 10 + hlcoord 18, 10 ld de, -1 jr PlaceHUDTiles @@ -136,7 +136,7 @@ PlaceEnemyHUDTiles: ld de, wHUDGraphicsTiles ld bc, $3 call CopyData - coord hl, 1, 2 + hlcoord 1, 2 ld de, $1 jr PlaceHUDTiles diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm index aa96f31d..bd4a1901 100755 --- a/engine/battle/end_of_battle.asm +++ b/engine/battle/end_of_battle.asm @@ -19,7 +19,7 @@ EndOfBattle: jr z, .placeWinOrLoseString ld de, DrawText .placeWinOrLoseString - coord hl, 6, 8 + hlcoord 6, 8 call PlaceString ld c, 200 call DelayFrames diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index 9c47fd53..7405c40b 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -4,7 +4,7 @@ MarowakAnim: ldh [rOBP1], a call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same ; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap - coord hl, 12, 0 + hlcoord 12, 0 lb bc, 7, 7 call ClearScreenArea call Delay3 diff --git a/engine/battle/link_battle_versus_text.asm b/engine/battle/link_battle_versus_text.asm index 22fec0f3..29c11356 100644 --- a/engine/battle/link_battle_versus_text.asm +++ b/engine/battle/link_battle_versus_text.asm @@ -1,18 +1,18 @@ ; display "[player] VS [enemy]" text box with pokeballs representing their parties next to the names DisplayLinkBattleVersusTextBox: call LoadTextBoxTilePatterns - coord hl, 3, 4 + hlcoord 3, 4 ld b, 7 ld c, 12 call TextBoxBorder - coord hl, 4, 5 + hlcoord 4, 5 ld de, wPlayerName call PlaceString - coord hl, 4, 10 + hlcoord 4, 10 ld de, wLinkEnemyTrainerName call PlaceString ; place bold "VS" tiles between the names - coord hl, 9, 8 + hlcoord 9, 8 ld a, $69 ld [hli], a ld [hl], $6a diff --git a/engine/battle/move_effects/drain_hp.asm b/engine/battle/move_effects/drain_hp.asm index e7b241f6..04a585cc 100644 --- a/engine/battle/move_effects/drain_hp.asm +++ b/engine/battle/move_effects/drain_hp.asm @@ -71,10 +71,10 @@ DrainHPEffect_: .next ldh a, [hWhoseTurn] and a - coord hl, 10, 9 + hlcoord 10, 9 ld a, $1 jr z, .next2 - coord hl, 2, 2 + hlcoord 2, 2 xor a .next2 ld [wHPBarType], a diff --git a/engine/battle/move_effects/heal.asm b/engine/battle/move_effects/heal.asm index d12b1ea4..e9fb62a7 100644 --- a/engine/battle/move_effects/heal.asm +++ b/engine/battle/move_effects/heal.asm @@ -89,10 +89,10 @@ HealEffect_: call BankswitchEtoF ldh a, [hWhoseTurn] and a - coord hl, 10, 9 + hlcoord 10, 9 ld a, $1 jr z, .updateHPBar - coord hl, 2, 2 + hlcoord 2, 2 xor a .updateHPBar ld [wHPBarType], a diff --git a/engine/battle/move_effects/recoil.asm b/engine/battle/move_effects/recoil.asm index aa2a3fed..85110d50 100644 --- a/engine/battle/move_effects/recoil.asm +++ b/engine/battle/move_effects/recoil.asm @@ -53,12 +53,12 @@ RecoilEffect_: ld [hli], a ld [hl], a .getHPBarCoords - coord hl, 10, 9 + hlcoord 10, 9 ldh a, [hWhoseTurn] and a ld a, $1 jr z, .updateHPBar - coord hl, 2, 2 + hlcoord 2, 2 xor a .updateHPBar ld [wHPBarType], a diff --git a/engine/battle/scroll_draw_trainer_pic.asm b/engine/battle/scroll_draw_trainer_pic.asm index 978fb71a..e19d681a 100644 --- a/engine/battle/scroll_draw_trainer_pic.asm +++ b/engine/battle/scroll_draw_trainer_pic.asm @@ -6,7 +6,7 @@ _ScrollTrainerPicAfterBattle: ld b, SET_PAL_BATTLE call RunPaletteCommand callfar _LoadTrainerPic - coord hl, 19, 0 + hlcoord 19, 0 ld c, $0 .scrollLoop inc c diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index ea476538..87bec842 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -542,7 +542,7 @@ AIRecoverHP: AIPrintItemUseAndUpdateHPBar: call AIPrintItemUse_ - coord hl, 2, 2 + hlcoord 2, 2 xor a ld [wHPBarType], a predef UpdateHPBar2 diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 3d0eb556..e24f9632 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -25,7 +25,7 @@ TryDoWildEncounter: .next ; determine if wild pokemon can appear in the half-block we're standing in ; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile? - coord hl, 9, 9 + hlcoord 9, 9 ld c, [hl] ld a, [wGrassTile] cp c @@ -64,7 +64,7 @@ TryDoWildEncounter: ; determine which wild pokemon (grass or water) can appear in the half-block we're standing in ld c, [hl] ld hl, wGrassMons - aCoord 8, 9 + lda_coord 8, 9 cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile? jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default ld hl, wWaterMons diff --git a/engine/events/cinnabar_lab.asm b/engine/events/cinnabar_lab.asm index aaa0428e..bccc95d1 100755 --- a/engine/events/cinnabar_lab.asm +++ b/engine/events/cinnabar_lab.asm @@ -20,7 +20,7 @@ GiveFossilToCinnabarLab:: dec l ld b, l ld c, $d - coord hl, 0, 0 + hlcoord 0, 0 call TextBoxBorder call UpdateSprites call PrintFossilsInBag @@ -100,7 +100,7 @@ PrintFossilsInBag: push hl ld [wd11e], a call GetItemName - coord hl, 2, 2 + hlcoord 2, 2 ldh a, [hItemCounter] ld bc, SCREEN_WIDTH * 2 call AddNTimes diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index 95dabab3..3248e152 100755 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -14,7 +14,7 @@ DisplayDiploma:: ld bc, $10 ld a, BANK(CircleTile) call FarCopyData2 - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 16, 18 predef Diploma_TextBoxBorder ld hl, DiplomaTextPointersAndCoords @@ -35,7 +35,7 @@ DisplayDiploma:: pop bc dec c jr nz, .asm_56715 - coord hl, 10, 4 + hlcoord 10, 4 ld de, wPlayerName call PlaceString farcall DrawPlayerCharacter @@ -85,15 +85,15 @@ UnusedPlayerNameLengthFunc: DiplomaTextPointersAndCoords: dw DiplomaText - dwCoord 5, 2 + dwcoord 5, 2 dw DiplomaPlayer - dwCoord 3, 4 + dwcoord 3, 4 dw DiplomaEmptyText - dwCoord 15, 4 + dwcoord 15, 4 dw DiplomaCongrats - dwCoord 2, 6 + dwcoord 2, 6 dw DiplomaGameFreak - dwCoord 9, 16 + dwcoord 9, 16 DiplomaText: db CIRCLE_TILE_ID, "Diploma", CIRCLE_TILE_ID, "@" diff --git a/engine/events/hidden_objects/bills_house_pc.asm b/engine/events/hidden_objects/bills_house_pc.asm index 92679d66..a73596b4 100644 --- a/engine/events/hidden_objects/bills_house_pc.asm +++ b/engine/events/hidden_objects/bills_house_pc.asm @@ -84,11 +84,11 @@ BillsHousePokemonList:: .billsPokemonLoop ld hl, wd730 set 6, [hl] - coord hl, 0, 0 + hlcoord 0, 0 ld b, 10 ld c, 9 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, BillsMonListText call PlaceString ld hl, BillsHousePokemonListText2 diff --git a/engine/events/hidden_objects/book_or_sculpture.asm b/engine/events/hidden_objects/book_or_sculpture.asm index 2f3334b8..e04f4047 100644 --- a/engine/events/hidden_objects/book_or_sculpture.asm +++ b/engine/events/hidden_objects/book_or_sculpture.asm @@ -4,7 +4,7 @@ BookOrSculptureText:: ld a, [wCurMapTileset] cp MANSION ; Celadon Mansion tileset jr nz, .ok - aCoord 8, 6 + lda_coord 8, 6 cp $38 jr nz, .ok ld hl, DiglettSculptureText diff --git a/engine/events/hidden_objects/bookshelves.asm b/engine/events/hidden_objects/bookshelves.asm index 23c087cc..b58444af 100644 --- a/engine/events/hidden_objects/bookshelves.asm +++ b/engine/events/hidden_objects/bookshelves.asm @@ -6,7 +6,7 @@ PrintBookshelfText:: ; facing up ld a, [wCurMapTileset] ld b, a - aCoord 8, 7 + lda_coord 8, 7 ld c, a ld hl, BookshelfTileIDs .loop diff --git a/engine/events/hidden_objects/museum_fossils.asm b/engine/events/hidden_objects/museum_fossils.asm index ef53ed89..5d7e08fd 100644 --- a/engine/events/hidden_objects/museum_fossils.asm +++ b/engine/events/hidden_objects/museum_fossils.asm @@ -42,7 +42,7 @@ DisplayMonFrontSpriteInBox: call LoadMonFrontSprite ld a, $80 ldh [hStartTileID], a - coord hl, 10, 11 + hlcoord 10, 11 predef AnimateSendingOutMon call WaitForTextScrollButtonPress call LoadScreenTilesFromBuffer1 diff --git a/engine/events/hidden_objects/school_blackboard.asm b/engine/events/hidden_objects/school_blackboard.asm index 48b97d73..de4700d4 100644 --- a/engine/events/hidden_objects/school_blackboard.asm +++ b/engine/events/hidden_objects/school_blackboard.asm @@ -26,11 +26,11 @@ LinkCableHelp:: .linkHelpLoop ld hl, wd730 set 6, [hl] - coord hl, 0, 0 + hlcoord 0, 0 ld b, 8 ld c, 13 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, HowToLinkText call PlaceString ld hl, LinkCableHelpText2 @@ -110,13 +110,13 @@ ViridianSchoolBlackboard:: .blackboardLoop ld hl, wd730 set 6, [hl] - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 6, 10 call TextBoxBorder - coord hl, 1, 2 + hlcoord 1, 2 ld de, StatusAilmentText1 call PlaceString - coord hl, 6, 2 + hlcoord 6, 2 ld de, StatusAilmentText2 call PlaceString ld hl, ViridianSchoolBlackboardText2 diff --git a/engine/events/pokemart.asm b/engine/events/pokemart.asm index 3345f540..c7cb8115 100755 --- a/engine/events/pokemart.asm +++ b/engine/events/pokemart.asm @@ -84,7 +84,7 @@ DisplayPokemartDialogue_:: ld hl, PokemartTellSellPriceText lb bc, 14, 1 ; location that PrintText always prints to, this is useless call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -162,7 +162,7 @@ DisplayPokemartDialogue_:: call CopyStringToCF4B ; copy name to wcf4b ld hl, PokemartTellBuyPriceText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm index 2d8bde90..d9320fe7 100755 --- a/engine/events/prize_menu.asm +++ b/engine/events/prize_menu.asm @@ -22,7 +22,7 @@ CeladonPrizeMenu:: ld a, $01 ld [wTopMenuItemX], a call PrintPrizePrice - coord hl, 0, 2 + hlcoord 0, 2 ld b, 8 ld c, 16 call TextBoxBorder @@ -93,71 +93,71 @@ GetPrizeMenuId: ld a, [wPrize1] ld [wd11e], a call GetItemName - coord hl, 2, 4 + hlcoord 2, 4 call PlaceString ld a, [wPrize2] ld [wd11e], a call GetItemName - coord hl, 2, 6 + hlcoord 2, 6 call PlaceString ld a, [wPrize3] ld [wd11e], a call GetItemName - coord hl, 2, 8 + hlcoord 2, 8 call PlaceString jr .putNoThanksText .putMonName ld a, [wPrize1] ld [wd11e], a call GetMonName - coord hl, 2, 4 + hlcoord 2, 4 call PlaceString ld a, [wPrize2] ld [wd11e], a call GetMonName - coord hl, 2, 6 + hlcoord 2, 6 call PlaceString ld a, [wPrize3] ld [wd11e], a call GetMonName - coord hl, 2, 8 + hlcoord 2, 8 call PlaceString .putNoThanksText - coord hl, 2, 10 + hlcoord 2, 10 ld de, NoThanksText call PlaceString ; put prices on the right side of the textbox ld de, wPrize1Price - coord hl, 13, 5 + hlcoord 13, 5 ; reg. c: ; [low nybble] number of bytes ; [bits 765 = %100] space-padding (not zero-padding) ld c, (1 << 7 | 2) call PrintBCDNumber ld de, wPrize2Price - coord hl, 13, 7 + hlcoord 13, 7 ld c, (1 << 7 | 2) call PrintBCDNumber ld de, wPrize3Price - coord hl, 13, 9 + hlcoord 13, 9 ld c, (1 << 7 | 2) jp PrintBCDNumber INCLUDE "data/events/prizes.asm" PrintPrizePrice: - coord hl, 11, 0 + hlcoord 11, 0 ld b, 1 ld c, 7 call TextBoxBorder call UpdateSprites - coord hl, 12, 0 + hlcoord 12, 0 ld de, .CoinString call PlaceString - coord hl, 13, 1 + hlcoord 13, 1 ld de, .SixSpacesString call PlaceString - coord hl, 13, 1 + hlcoord 13, 1 ld de, wPlayerCoins ld c, %10000010 call PrintBCDNumber diff --git a/engine/events/vending_machine.asm b/engine/events/vending_machine.asm index 7bda91b0..a67f1c07 100755 --- a/engine/events/vending_machine.asm +++ b/engine/events/vending_machine.asm @@ -17,15 +17,15 @@ VendingMachineMenu:: ld [wTopMenuItemX], a ld hl, wd730 set 6, [hl] - coord hl, 0, 3 + hlcoord 0, 3 ld b, 8 ld c, 12 call TextBoxBorder call UpdateSprites - coord hl, 2, 5 + hlcoord 2, 5 ld de, DrinkText call PlaceString - coord hl, 9, 6 + hlcoord 9, 6 ld de, DrinkPriceText call PlaceString ld hl, wd730 diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index b2901615..b04f11fb 100755 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -1044,7 +1044,7 @@ ItemUseMedicine: sbc b ld [hl], a ld [wHPBarNewHP+1], a - coord hl, 4, 1 + hlcoord 4, 1 ld a, [wWhichPokemon] ld bc, 2 * SCREEN_WIDTH call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled @@ -2221,7 +2221,7 @@ ItemUseTMHM: call PrintText ld hl, TeachMachineMoveText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -2607,7 +2607,7 @@ TossItem_:: call CopyStringToCF4B ; copy name to wcf4b ld hl, IsItOKToTossItemText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index 3cff630b..db066268 100755 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -11,7 +11,7 @@ DisplayTownMap: push af ld b, $0 call DrawPlayerOrBirdSprite ; player sprite - coord hl, 1, 0 + hlcoord 1, 0 ld de, wcd6d call PlaceString ld hl, wOAMBuffer @@ -28,7 +28,7 @@ DisplayTownMap: jr .enterLoop .townMapLoop - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 1, 20 call ClearScreenArea ld hl, TownMapOrder @@ -55,7 +55,7 @@ DisplayTownMap: inc de cp $50 jr nz, .copyMapName - coord hl, 1, 0 + hlcoord 1, 0 ld de, wcd6d call PlaceString ld hl, wOAMBuffer + $10 @@ -118,7 +118,7 @@ LoadTownMap_Nest: push hl call DisplayWildLocations call GetMonName - coord hl, 1, 0 + hlcoord 1, 0 call PlaceString ld h, b ld l, c @@ -153,34 +153,34 @@ LoadTownMap_Fly:: push af ld [hl], $ff push hl - coord hl, 0, 0 + hlcoord 0, 0 ld de, ToText call PlaceString ld a, [wCurMap] ld b, $0 call DrawPlayerOrBirdSprite ld hl, wFlyLocationsList - coord de, 18, 0 + decoord 18, 0 .townMapFlyLoop ld a, " " ld [de], a push hl push hl - coord hl, 3, 0 + hlcoord 3, 0 lb bc, 1, 15 call ClearScreenArea pop hl ld a, [hl] ld b, $4 call DrawPlayerOrBirdSprite ; draw bird sprite - coord hl, 3, 0 + hlcoord 3, 0 ld de, wcd6d call PlaceString ld c, 15 call DelayFrames - coord hl, 18, 0 + hlcoord 18, 0 ld [hl], "▲" - coord hl, 19, 0 + hlcoord 19, 0 ld [hl], "▼" pop hl .inputLoop @@ -219,7 +219,7 @@ LoadTownMap_Fly:: ld [hl], a ret .pressedUp - coord de, 18, 0 + decoord 18, 0 inc hl ld a, [hl] cp $ff @@ -231,7 +231,7 @@ LoadTownMap_Fly:: ld hl, wFlyLocationsList jp .townMapFlyLoop .pressedDown - coord de, 19, 0 + decoord 19, 0 dec hl ld a, [hl] cp $ff @@ -278,7 +278,7 @@ LoadTownMap: call GBPalWhiteOutWithDelay3 call ClearScreen call UpdateSprites - coord hl, 0, 0 + hlcoord 0, 0 ld b, $12 ld c, $12 call TextBoxBorder @@ -293,7 +293,7 @@ LoadTownMap: ld bc, MonNestIconEnd - MonNestIcon ld a, BANK(MonNestIcon) call FarCopyDataDouble - coord hl, 0, 0 + hlcoord 0, 0 ld de, CompressedMap .nextTile ld a, [de] @@ -395,11 +395,11 @@ DisplayWildLocations: and a ; were any OAM entries written? jr nz, .drawPlayerSprite ; if no OAM entries were written, print area unknown text - coord hl, 1, 7 + hlcoord 1, 7 ld b, 2 ld c, 15 call TextBoxBorder - coord hl, 2, 9 + hlcoord 2, 9 ld de, AreaUnknownText call PlaceString jr .done diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index dd93ebba..42d06846 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -9,11 +9,11 @@ CableClub_DoBattleOrTrade: call LoadFontTilePatterns call LoadHpBarAndStatusTilePatterns call LoadTrainerInfoTextBoxTiles - coord hl, 3, 8 + hlcoord 3, 8 ld b, 2 ld c, 12 call CableClub_TextBoxBorder - coord hl, 4, 10 + hlcoord 4, 10 ld de, PleaseWaitString call PlaceString ld hl, wPlayerNumHits @@ -399,7 +399,7 @@ TradeCenter_SelectMon: ld [wTopMenuItemY], a ld a, 1 ld [wTopMenuItemX], a - coord hl, 1, 1 + hlcoord 1, 1 lb bc, 6, 1 call ClearScreenArea .playerMonMenu_HandleInput @@ -464,11 +464,11 @@ TradeCenter_SelectMon: dec a .displayStatsTradeMenu push af - coord hl, 0, 14 + hlcoord 0, 14 ld b, 2 ld c, 18 call CableClub_TextBoxBorder - coord hl, 2, 16 + hlcoord 2, 16 ld de, .statsTrade call PlaceString xor a @@ -480,7 +480,7 @@ TradeCenter_SelectMon: ld [wTopMenuItemY], a .selectStatsMenuItem ld a, " " - Coorda 11, 16 + ldcoord_a 11, 16 ld a, D_RIGHT | B_BUTTON | A_BUTTON ld [wMenuWatchedKeys], a ld a, 1 @@ -497,7 +497,7 @@ TradeCenter_SelectMon: jp .playerMonMenu .selectTradeMenuItem ld a, " " - Coorda 1, 16 + ldcoord_a 1, 16 ld a, D_LEFT | B_BUTTON | A_BUTTON ld [wMenuWatchedKeys], a ld a, 11 @@ -548,7 +548,7 @@ TradeCenter_SelectMon: ld [hl], a .cancelMenuItem_Loop ld a, "▶" ; filled arrow cursor - Coorda 1, 16 + ldcoord_a 1, 16 .cancelMenuItem_JoypadLoop call JoypadLowSensitivity ldh a, [hJoy5] @@ -560,14 +560,14 @@ TradeCenter_SelectMon: jr z, .cancelMenuItem_JoypadLoop ; if Up pressed ld a, " " - Coorda 1, 16 + ldcoord_a 1, 16 ld a, [wPartyCount] dec a ld [wCurrentMenuItem], a jp .playerMonMenu .cancelMenuItem_APressed ld a, "▷" ; unfilled arrow cursor - Coorda 1, 16 + ldcoord_a 1, 16 ld a, $f ld [wSerialExchangeNybbleSendData], a call Serial_PrintWaitingTextAndSyncAndExchangeNybble @@ -596,15 +596,15 @@ ReturnToCableClubRoom: ret TradeCenter_DrawCancelBox: - coord hl, 11, 15 + hlcoord 11, 15 ld a, $7e ld bc, 2 * SCREEN_WIDTH + 9 call FillMemory - coord hl, 0, 15 + hlcoord 0, 15 ld b, 1 ld c, 9 call CableClub_TextBoxBorder - coord hl, 2, 16 + hlcoord 2, 16 ld de, CancelTextString jp PlaceString @@ -613,7 +613,7 @@ CancelTextString: TradeCenter_PlaceSelectedEnemyMonMenuCursor: ld a, [wSerialSyncAndExchangeNybbleReceiveData] - coord hl, 1, 9 + hlcoord 1, 9 ld bc, SCREEN_WIDTH call AddNTimes ld [hl], "▷" ; cursor @@ -630,24 +630,24 @@ TradeCenter_DisplayStats: jp TradeCenter_DrawCancelBox TradeCenter_DrawPartyLists: - coord hl, 0, 0 + hlcoord 0, 0 ld b, 6 ld c, 18 call CableClub_TextBoxBorder - coord hl, 0, 8 + hlcoord 0, 8 ld b, 6 ld c, 18 call CableClub_TextBoxBorder - coord hl, 5, 0 + hlcoord 5, 0 ld de, wPlayerName call PlaceString - coord hl, 5, 8 + hlcoord 5, 8 ld de, wLinkEnemyTrainerName call PlaceString - coord hl, 2, 1 + hlcoord 2, 1 ld de, wPartySpecies call TradeCenter_PrintPartyListNames - coord hl, 2, 9 + hlcoord 2, 9 ld de, wEnemyPartyMons ; fall through @@ -684,7 +684,7 @@ TradeCenter_Trade: ld [wSerialExchangeNybbleReceiveData], a ld [wMenuWatchMovingOutOfBounds], a ld [wMenuJoypadPollCount], a - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder @@ -709,10 +709,10 @@ TradeCenter_Trade: ld [wd11e], a call GetMonName ld hl, WillBeTradedText - coord bc, 1, 14 + bccoord 1, 14 call TextCommandProcessor call SaveScreenTilesToBuffer1 - coord hl, 10, 7 + hlcoord 10, 7 lb bc, 8, 11 ld a, TRADE_CANCEL_MENU ld [wTwoOptionMenuID], a @@ -726,11 +726,11 @@ TradeCenter_Trade: ; if trade cancelled ld a, $1 ld [wSerialExchangeNybbleSendData], a - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder - coord hl, 1, 14 + hlcoord 1, 14 ld de, TradeCanceled call PlaceString call Serial_PrintWaitingTextAndSyncAndExchangeNybble @@ -743,11 +743,11 @@ TradeCenter_Trade: dec a ; did the other person cancel? jr nz, .doTrade ; if the other person cancelled - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder - coord hl, 1, 14 + hlcoord 1, 14 ld de, TradeCanceled call PlaceString jp .tradeCancelled @@ -851,11 +851,11 @@ TradeCenter_Trade: call Serial_PrintWaitingTextAndSyncAndExchangeNybble ld c, 40 call DelayFrames - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder - coord hl, 1, 14 + hlcoord 1, 14 ld de, TradeCompleted call PlaceString predef SaveSAVtoSRAM2 diff --git a/engine/link/print_waiting_text.asm b/engine/link/print_waiting_text.asm index c48459d3..d74d635f 100644 --- a/engine/link/print_waiting_text.asm +++ b/engine/link/print_waiting_text.asm @@ -1,5 +1,5 @@ PrintWaitingText:: - coord hl, 3, 10 + hlcoord 3, 10 ld b, $1 ld c, $b ld a, [wIsInBattle] @@ -10,7 +10,7 @@ PrintWaitingText:: .asm_4c17 call CableClub_TextBoxBorder .asm_4c1a - coord hl, 4, 11 + hlcoord 4, 11 ld de, WaitingText call PlaceString ld c, 50 diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm index fd1d3960..c030e7c9 100644 --- a/engine/menus/display_text_id_init.asm +++ b/engine/menus/display_text_id_init.asm @@ -13,18 +13,18 @@ DisplayTextIDInit:: ; below this, so this seems unnecessary. CheckEvent EVENT_GOT_POKEDEX ; start menu with pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0e ld c, $08 jr nz, .drawTextBoxBorder ; start menu without pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0c ld c, $08 jr .drawTextBoxBorder ; if text ID is not 0 (i.e. not the start menu) then do a standard dialogue text box .notStartMenu - coord hl, 0, 12 + hlcoord 0, 12 ld b, $04 ld c, $12 .drawTextBoxBorder diff --git a/engine/menus/draw_badges.asm b/engine/menus/draw_badges.asm index 1888e32f..a74497c1 100644 --- a/engine/menus/draw_badges.asm +++ b/engine/menus/draw_badges.asm @@ -43,11 +43,11 @@ DrawBadges: ld [hli], a ld [hl], $60 ; First name - coord hl, 2, 11 + hlcoord 2, 11 ld de, wTempObtainedBadgesBooleans call .DrawBadgeRow - coord hl, 2, 14 + hlcoord 2, 14 ld de, wTempObtainedBadgesBooleans + 4 ; call .DrawBadgeRow ; ret diff --git a/engine/menus/draw_start_menu.asm b/engine/menus/draw_start_menu.asm index 21e444e9..00d385bc 100644 --- a/engine/menus/draw_start_menu.asm +++ b/engine/menus/draw_start_menu.asm @@ -2,12 +2,12 @@ DrawStartMenu:: CheckEvent EVENT_GOT_POKEDEX ; menu with pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0e ld c, $08 jr nz, .drawTextBoxBorder ; shorter menu if the player doesn't have the pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0c ld c, $08 .drawTextBoxBorder @@ -25,7 +25,7 @@ DrawStartMenu:: ld [wMenuWatchMovingOutOfBounds], a ld hl, wd730 set 6, [hl] ; no pauses between printing each letter - coord hl, 12, 2 + hlcoord 12, 2 CheckEvent EVENT_GOT_POKEDEX ; case for not having pokedex ld a, $06 diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm index d930e42f..f2107c49 100755 --- a/engine/menus/league_pc.asm +++ b/engine/menus/league_pc.asm @@ -95,18 +95,18 @@ LeaguePCShowMon: ld b, SET_PAL_POKEMON_WHOLE_SCREEN ld c, 0 call RunPaletteCommand - coord hl, 12, 5 + hlcoord 12, 5 call GetMonHeader call LoadFrontSpriteByMonIndex call GBPalNormal - coord hl, 0, 13 + hlcoord 0, 13 ld b, 2 ld c, $12 call TextBoxBorder - coord hl, 1, 15 + hlcoord 1, 15 ld de, HallOfFameNoText call PlaceString - coord hl, 16, 15 + hlcoord 16, 15 ld de, wHoFTeamNo lb bc, 1, 3 call PrintNumber diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 44aeccca..d2776240 100755 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -33,20 +33,20 @@ MainMenu: cp 1 jr z, .noSaveFile ; there's a save file - coord hl, 0, 0 + hlcoord 0, 0 ld b, 6 ld c, 13 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, ContinueText call PlaceString jr .next2 .noSaveFile - coord hl, 0, 0 + hlcoord 0, 0 ld b, 4 ld c, 13 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, NewGameText call PlaceString .next2 @@ -141,12 +141,12 @@ LinkMenu: call SaveScreenTilesToBuffer1 ld hl, WhereWouldYouLikeText call PrintText - coord hl, 5, 5 + hlcoord 5, 5 ld b, $6 ld c, $d call TextBoxBorder call UpdateSprites - coord hl, 7, 7 + hlcoord 7, 7 ld de, CableClubOptionsText call PlaceString xor a @@ -240,11 +240,11 @@ LinkMenu: ld c, d .updateCursorPosition ld a, b - Coorda 6, 7 + ldcoord_a 6, 7 ld a, c - Coorda 6, 9 + ldcoord_a 6, 9 ld a, d - Coorda 6, 11 + ldcoord_a 6, 11 ld c, 40 call DelayFrames call LoadScreenTilesFromBuffer1 @@ -345,21 +345,21 @@ CableClubOptionsText: DisplayContinueGameInfo: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 4, 7 + hlcoord 4, 7 ld b, 8 ld c, 14 call TextBoxBorder - coord hl, 5, 9 + hlcoord 5, 9 ld de, SaveScreenInfoText call PlaceString - coord hl, 12, 9 + hlcoord 12, 9 ld de, wPlayerName call PlaceString - coord hl, 17, 11 + hlcoord 17, 11 call PrintNumBadges - coord hl, 16, 13 + hlcoord 16, 13 call PrintNumOwnedMons - coord hl, 13, 15 + hlcoord 13, 15 call PrintPlayTime ld a, 1 ldh [hAutoBGTransferEnabled], a @@ -369,23 +369,23 @@ DisplayContinueGameInfo: PrintSaveScreenText: xor a ldh [hAutoBGTransferEnabled], a - coord hl, 4, 0 + hlcoord 4, 0 ld b, $8 ld c, $e call TextBoxBorder call LoadTextBoxTilePatterns call UpdateSprites - coord hl, 5, 2 + hlcoord 5, 2 ld de, SaveScreenInfoText call PlaceString - coord hl, 12, 2 + hlcoord 12, 2 ld de, wPlayerName call PlaceString - coord hl, 17, 4 + hlcoord 17, 4 call PrintNumBadges - coord hl, 16, 6 + hlcoord 16, 6 call PrintNumOwnedMons - coord hl, 13, 8 + hlcoord 13, 8 call PrintPlayTime ld a, $1 ldh [hAutoBGTransferEnabled], a @@ -429,28 +429,28 @@ SaveScreenInfoText: next "TIME@" DisplayOptionMenu: - coord hl, 0, 0 + hlcoord 0, 0 ld b, 3 ld c, 18 call TextBoxBorder - coord hl, 0, 5 + hlcoord 0, 5 ld b, 3 ld c, 18 call TextBoxBorder - coord hl, 0, 10 + hlcoord 0, 10 ld b, 3 ld c, 18 call TextBoxBorder - coord hl, 1, 1 + hlcoord 1, 1 ld de, TextSpeedOptionText call PlaceString - coord hl, 1, 6 + hlcoord 1, 6 ld de, BattleAnimationOptionText call PlaceString - coord hl, 1, 11 + hlcoord 1, 11 ld de, BattleStyleOptionText call PlaceString - coord hl, 2, 16 + hlcoord 2, 16 ld de, OptionMenuCancelText call PlaceString xor a @@ -644,7 +644,7 @@ SetCursorPositionsFromOptions: dec hl ld a, [hl] ld [wOptionsTextSpeedCursorX], a ; text speed cursor X coordinate - coord hl, 0, 3 + hlcoord 0, 3 call .placeUnfilledRightArrow sla c ld a, 1 ; On @@ -652,7 +652,7 @@ SetCursorPositionsFromOptions: ld a, 10 ; Off .storeBattleAnimationCursorX ld [wOptionsBattleAnimCursorX], a ; battle animation cursor X coordinate - coord hl, 0, 8 + hlcoord 0, 8 call .placeUnfilledRightArrow sla c ld a, 1 @@ -660,10 +660,10 @@ SetCursorPositionsFromOptions: ld a, 10 .storeBattleStyleCursorX ld [wOptionsBattleStyleCursorX], a ; battle style cursor X coordinate - coord hl, 0, 13 + hlcoord 0, 13 call .placeUnfilledRightArrow ; cursor in front of Cancel - coord hl, 0, 16 + hlcoord 0, 16 ld a, 1 .placeUnfilledRightArrow ld e, a diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index e6886c98..a16c9501 100755 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -4,7 +4,7 @@ AskName: push hl ld a, [wIsInBattle] dec a - coord hl, 0, 0 + hlcoord 0, 0 ld b, 4 ld c, 11 call z, ClearScreenArea ; only if in wild battle @@ -13,7 +13,7 @@ AskName: call GetMonName ld hl, DoYouWantToNicknameText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -93,7 +93,7 @@ DisplayNamingScreen: call LoadHpBarAndStatusTilePatterns call LoadEDTile farcall LoadMonPartySpriteGfx - coord hl, 0, 4 + hlcoord 0, 4 ld b, 9 ld c, 18 call TextBoxBorder @@ -344,7 +344,7 @@ PrintAlphabet: jr nz, .lowercase ld de, UpperCaseAlphabet .lowercase - coord hl, 2, 5 + hlcoord 2, 5 lb bc, 5, 9 ; 5 rows, 9 columns .outerLoop push bc @@ -371,13 +371,13 @@ PrintNicknameAndUnderscores: call CalcStringLength ld a, c ld [wNamingScreenNameLength], a - coord hl, 10, 2 + hlcoord 10, 2 lb bc, 1, 10 call ClearScreenArea - coord hl, 10, 2 + hlcoord 10, 2 ld de, wcf4b call PlaceString - coord hl, 10, 3 + hlcoord 10, 3 ld a, [wNamingScreenType] cp NAME_MON_SCREEN jr nc, .pokemon1 @@ -416,7 +416,7 @@ PrintNicknameAndUnderscores: .emptySpacesRemaining ld c, a ld b, $0 - coord hl, 10, 3 + hlcoord 10, 3 add hl, bc ld [hl], $77 ; raised underscore tile id ret @@ -450,7 +450,7 @@ CalcStringLength: jr .loop PrintNamingText: - coord hl, 0, 1 + hlcoord 0, 1 ld a, [wNamingScreenType] ld de, YourTextString and a @@ -465,12 +465,12 @@ PrintNamingText: pop af ld [wd11e], a call GetMonName - coord hl, 4, 1 + hlcoord 4, 1 call PlaceString ld hl, $1 add hl, bc ld [hl], $c9 - coord hl, 1, 3 + hlcoord 1, 3 ld de, NicknameTextString jr .placeString .notNickname diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm index 4eeb0ed8..14216b64 100755 --- a/engine/menus/party_menu.asm +++ b/engine/menus/party_menu.asm @@ -30,7 +30,7 @@ RedrawPartyMenu_:: jp z, .printMessage call ErasePartyMenuCursors farcall InitPartyMenuBlkPacket - coord hl, 3, 0 + hlcoord 3, 0 ld de, wPartySpecies xor a ld c, a diff --git a/engine/menus/players_pc.asm b/engine/menus/players_pc.asm index ebaacd52..5461be51 100755 --- a/engine/menus/players_pc.asm +++ b/engine/menus/players_pc.asm @@ -22,12 +22,12 @@ PlayerPCMenu: ld hl, wFlags_0xcd60 set 5, [hl] call LoadScreenTilesFromBuffer2 - coord hl, 0, 0 + hlcoord 0, 0 ld b, $8 ld c, $e call TextBoxBorder call UpdateSprites - coord hl, 2, 2 + hlcoord 2, 2 ld de, PlayersPCMenuEntries call PlaceString ld hl, wTopMenuItemY diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm index a2a55bfd..53719712 100755 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -119,7 +119,7 @@ HandlePokedexSideMenu: pop af ld [wCurrentMenuItem], a push bc - coord hl, 0, 3 + hlcoord 0, 3 ld de, 20 lb bc, " ", 13 call DrawTileLine ; cover up the menu cursor in the pokemon list @@ -128,7 +128,7 @@ HandlePokedexSideMenu: .buttonBPressed push bc - coord hl, 15, 10 + hlcoord 15, 10 ld de, 20 lb bc, " ", 7 call DrawTileLine ; cover up the menu cursor in the side menu @@ -158,43 +158,43 @@ HandlePokedexListMenu: xor a ldh [hAutoBGTransferEnabled], a ; draw the horizontal line separating the seen and owned amounts from the menu - coord hl, 15, 8 + hlcoord 15, 8 ld a, "─" ld [hli], a ld [hli], a ld [hli], a ld [hli], a ld [hli], a - coord hl, 14, 0 + hlcoord 14, 0 ld [hl], $71 ; vertical line tile - coord hl, 14, 1 + hlcoord 14, 1 call DrawPokedexVerticalLine - coord hl, 14, 9 + hlcoord 14, 9 call DrawPokedexVerticalLine ld hl, wPokedexSeen ld b, wPokedexSeenEnd - wPokedexSeen call CountSetBits ld de, wNumSetBits - coord hl, 16, 3 + hlcoord 16, 3 lb bc, 1, 3 call PrintNumber ; print number of seen pokemon ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits ld de, wNumSetBits - coord hl, 16, 6 + hlcoord 16, 6 lb bc, 1, 3 call PrintNumber ; print number of owned pokemon - coord hl, 16, 2 + hlcoord 16, 2 ld de, PokedexSeenText call PlaceString - coord hl, 16, 5 + hlcoord 16, 5 ld de, PokedexOwnText call PlaceString - coord hl, 1, 1 + hlcoord 1, 1 ld de, PokedexContentsText call PlaceString - coord hl, 16, 10 + hlcoord 16, 10 ld de, PokedexMenuItemsText call PlaceString ; find the highest pokedex number among the pokemon the player has seen @@ -217,10 +217,10 @@ HandlePokedexListMenu: .loop xor a ldh [hAutoBGTransferEnabled], a - coord hl, 4, 2 + hlcoord 4, 2 lb bc, 14, 10 call ClearScreenArea - coord hl, 1, 3 + hlcoord 1, 3 ld a, [wListScrollOffset] ld [wd11e], a ld d, 7 @@ -415,43 +415,43 @@ ShowPokedexDataInternal: xor a ldh [hTilesetType], a - coord hl, 0, 0 + hlcoord 0, 0 ld de, 1 lb bc, $64, SCREEN_WIDTH call DrawTileLine ; draw top border - coord hl, 0, 17 + hlcoord 0, 17 ld b, $6f call DrawTileLine ; draw bottom border - coord hl, 0, 1 + hlcoord 0, 1 ld de, 20 lb bc, $66, $10 call DrawTileLine ; draw left border - coord hl, 19, 1 + hlcoord 19, 1 ld b, $67 call DrawTileLine ; draw right border ld a, $63 ; upper left corner tile - Coorda 0, 0 + ldcoord_a 0, 0 ld a, $65 ; upper right corner tile - Coorda 19, 0 + ldcoord_a 19, 0 ld a, $6c ; lower left corner tile - Coorda 0, 17 + ldcoord_a 0, 17 ld a, $6e ; lower right corner tile - Coorda 19, 17 + ldcoord_a 19, 17 - coord hl, 0, 9 + hlcoord 0, 9 ld de, PokedexDataDividerLine call PlaceString ; draw horizontal divider line - coord hl, 9, 6 + hlcoord 9, 6 ld de, HeightWeightText call PlaceString call GetMonName - coord hl, 9, 2 + hlcoord 9, 2 call PlaceString ld hl, PokedexEntryPointers @@ -465,7 +465,7 @@ ShowPokedexDataInternal: ld e, a ld d, [hl] ; de = address of pokedex entry - coord hl, 9, 4 + hlcoord 9, 4 call PlaceString ; print species name ld h, b @@ -475,7 +475,7 @@ ShowPokedexDataInternal: push af call IndexToPokedex - coord hl, 2, 8 + hlcoord 2, 8 ld a, "№" ld [hli], a ld a, "" @@ -500,7 +500,7 @@ ShowPokedexDataInternal: call Delay3 call GBPalNormal call GetMonHeader ; load pokemon picture location - coord hl, 1, 1 + hlcoord 1, 1 call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture ld a, [wcf91] call PlayCry ; play pokemon cry @@ -515,14 +515,14 @@ ShowPokedexDataInternal: jp z, .waitForButtonPress ; if the pokemon has not been owned, don't print the height, weight, or description inc de ; de = address of feet (height) ld a, [de] ; reads feet, but a is overwritten without being used - coord hl, 12, 6 + hlcoord 12, 6 lb bc, 1, 2 call PrintNumber ; print feet (height) ld a, "′" ld [hl], a inc de inc de ; de = address of inches (height) - coord hl, 15, 6 + hlcoord 15, 6 lb bc, LEADING_ZEROES | 1, 2 call PrintNumber ; print inches (height) ld a, "″" @@ -544,10 +544,10 @@ ShowPokedexDataInternal: ld a, [de] ; a = lower byte of weight ld [hl], a ; store lower byte of weight in [hDexWeight + 1] ld de, hDexWeight - coord hl, 11, 8 + hlcoord 11, 8 lb bc, 2, 5 ; 2 bytes, 5 digits call PrintNumber ; print weight - coord hl, 14, 8 + hlcoord 14, 8 ldh a, [hDexWeight + 1] sub 10 ldh a, [hDexWeight] @@ -565,7 +565,7 @@ ShowPokedexDataInternal: ldh [hDexWeight], a ; restore original value of [hDexWeight] pop hl inc hl ; hl = address of pokedex description text - coord bc, 1, 11 + bccoord 1, 11 ld a, %10 ldh [hClearLetterPrintingDelayFlags], a call TextCommandProcessor ; print pokedex description text diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 2941a07e..45fed8a6 100755 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -154,10 +154,10 @@ SaveSAV: ret nz .save call SaveSAVtoSRAM - coord hl, 1, 13 + hlcoord 1, 13 lb bc, 4, 18 call ClearScreenArea - coord hl, 1, 14 + hlcoord 1, 14 ld de, NowSavingString call PlaceString ld c, 120 @@ -175,7 +175,7 @@ NowSavingString: SaveSAVConfirm: call PrintText - coord hl, 0, 7 + hlcoord 0, 7 lb bc, 8, 1 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -435,20 +435,20 @@ DisplayChangeBoxMenu: and $7f ld [wCurrentMenuItem], a ld [wLastMenuItem], a - coord hl, 0, 0 + hlcoord 0, 0 ld b, 2 ld c, 9 call TextBoxBorder ld hl, ChooseABoxText call PrintText - coord hl, 11, 0 + hlcoord 11, 0 ld b, 12 ld c, 7 call TextBoxBorder ld hl, hFlagsFFF6 set 2, [hl] ld de, BoxNames - coord hl, 13, 1 + hlcoord 13, 1 call PlaceString ld hl, hFlagsFFF6 res 2, [hl] @@ -457,19 +457,19 @@ DisplayChangeBoxMenu: cp 9 jr c, .singleDigitBoxNum sub 9 - coord hl, 8, 2 + hlcoord 8, 2 ld [hl], "1" add "0" jr .next .singleDigitBoxNum add "1" .next - Coorda 9, 2 - coord hl, 1, 2 + ldcoord_a 9, 2 + hlcoord 1, 2 ld de, BoxNoText call PlaceString call GetMonCountsForAllBoxes - coord hl, 18, 1 + hlcoord 18, 1 ld de, wBoxMonCounts ld bc, SCREEN_WIDTH ld a, $c diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 33d504b8..8f1a2d61 100755 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -285,7 +285,7 @@ StartMenu_Pokemon:: ; writes a blank tile to all possible menu cursor positions on the party menu ErasePartyMenuCursors:: - coord hl, 0, 1 + hlcoord 0, 1 ld bc, 2 * 20 ; menu cursor positions are 2 rows apart ld a, 6 ; 6 menu cursor positions .loop @@ -330,10 +330,10 @@ StartMenu_Item:: .choseItem ; erase menu cursor (blank each tile in front of an item name) ld a, " " - Coorda 5, 4 - Coorda 5, 6 - Coorda 5, 8 - Coorda 5, 10 + ldcoord_a 5, 4 + ldcoord_a 5, 6 + ldcoord_a 5, 8 + ldcoord_a 5, 10 call PlaceUnfilledArrowMenuCursor xor a ld [wMenuItemToSwap], a @@ -480,10 +480,10 @@ DrawTrainerInfo: lb bc, BANK(RedPicFront), $01 predef DisplayPicCenteredOrUpperRight call DisableLCD - coord hl, 0, 2 + hlcoord 0, 2 ld a, " " call TrainerInfo_DrawVerticalLine - coord hl, 1, 2 + hlcoord 1, 2 call TrainerInfo_DrawVerticalLine ld hl, vChars2 + $70 ld de, vChars2 @@ -526,7 +526,7 @@ DrawTrainerInfo: dec a ld [hli], a ld [hl], 1 - coord hl, 0, 0 + hlcoord 0, 0 call TrainerInfo_DrawTextBox ld hl, wTrainerInfoTextBoxWidthPlus1 ld a, 16 + 1 @@ -534,27 +534,27 @@ DrawTrainerInfo: dec a ld [hli], a ld [hl], 3 - coord hl, 1, 10 + hlcoord 1, 10 call TrainerInfo_DrawTextBox - coord hl, 0, 10 + hlcoord 0, 10 ld a, $d7 call TrainerInfo_DrawVerticalLine - coord hl, 19, 10 + hlcoord 19, 10 call TrainerInfo_DrawVerticalLine - coord hl, 6, 9 + hlcoord 6, 9 ld de, TrainerInfo_BadgesText call PlaceString - coord hl, 2, 2 + hlcoord 2, 2 ld de, TrainerInfo_NameMoneyTimeText call PlaceString - coord hl, 7, 2 + hlcoord 7, 2 ld de, wPlayerName call PlaceString - coord hl, 8, 4 + hlcoord 8, 4 ld de, wPlayerMoney ld c, $e3 call PrintBCDNumber - coord hl, 9, 6 + hlcoord 9, 6 ld de, wPlayTimeHours ; hours lb bc, LEFT_ALIGN | 1, 3 call PrintNumber @@ -667,7 +667,7 @@ SwitchPartyMon:: SwitchPartyMon_ClearGfx: push af - coord hl, 0, 0 + hlcoord 0, 0 ld bc, SCREEN_WIDTH * 2 call AddNTimes ld c, SCREEN_WIDTH * 2 diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm index 51339ec2..2e69c5a4 100644 --- a/engine/menus/text_box.asm +++ b/engine/menus/text_box.asm @@ -111,7 +111,7 @@ GetTextBoxIDText: ; hl = address of upper left corner of text box GetAddressOfScreenCoords: push bc - coord hl, 0, 0 + hlcoord 0, 0 ld bc, 20 .loop ; loop to add d rows to the base address ld a, d @@ -274,11 +274,11 @@ DisplayMoneyBox: ld a, MONEY_BOX_TEMPLATE ld [wTextBoxID], a call DisplayTextBoxID - coord hl, 13, 1 + hlcoord 13, 1 ld b, 1 ld c, 6 call ClearScreenArea - coord hl, 12, 1 + hlcoord 12, 1 ld de, wPlayerMoney ld c, $a3 call PrintBCDNumber @@ -578,14 +578,14 @@ DisplayFieldMoveMonMenu: jr nz, .fieldMovesExist ; no field moves - coord hl, 11, 11 + hlcoord 11, 11 ld b, 5 ld c, 7 call TextBoxBorder call UpdateSprites ld a, 12 ldh [hFieldMoveMonMenuTopMenuItemX], a - coord hl, 13, 12 + hlcoord 13, 12 ld de, PokemonMenuEntries jp PlaceString @@ -594,7 +594,7 @@ DisplayFieldMoveMonMenu: ; Calculate the text box position and dimensions based on the leftmost X coord ; of the field move names before adjusting for the number of field moves. - coord hl, 0, 11 + hlcoord 0, 11 ld a, [wFieldMovesLeftmostXCoord] dec a ld e, a @@ -625,7 +625,7 @@ DisplayFieldMoveMonMenu: call UpdateSprites ; Calculate the position of the first field move name to print. - coord hl, 0, 12 + hlcoord 0, 12 ld a, [wFieldMovesLeftmostXCoord] inc a ld e, a @@ -674,7 +674,7 @@ DisplayFieldMoveMonMenu: pop hl ld a, [wFieldMovesLeftmostXCoord] ldh [hFieldMoveMonMenuTopMenuItemX], a - coord hl, 0, 12 + hlcoord 0, 12 ld a, [wFieldMovesLeftmostXCoord] inc a ld e, a diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index 42b8e0cc..ae35a2b7 100755 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -14,9 +14,9 @@ HallOfFamePC: ld bc, $10 ld a, $ff call FillMemory - coord hl, 0, 0 + hlcoord 0, 0 call FillFourRowsWithBlack - coord hl, 0, 14 + hlcoord 0, 14 call FillFourRowsWithBlack ld a, %11000000 ldh [rBGP], a @@ -61,7 +61,7 @@ DisplayCreditsMon: ld a, [hl] ld [wcf91], a ld [wd0b5], a - coord hl, 8, 6 + hlcoord 8, 6 call GetMonHeader call LoadFrontSpriteByMonIndex ld hl, vBGMap0 + $c @@ -162,7 +162,7 @@ FillFourRowsWithBlack: jp FillMemory FillMiddleOfScreenWithWhite: - coord hl, 0, 4 + hlcoord 0, 4 ld bc, SCREEN_WIDTH * 10 ld a, " " jp FillMemory @@ -172,7 +172,7 @@ Credits: push de .nextCreditsScreen pop de - coord hl, 9, 6 + hlcoord 9, 6 push hl call FillMiddleOfScreenWithWhite pop hl @@ -248,10 +248,10 @@ Credits: ld hl, vChars2 + $600 lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10 call CopyVideoData - coord hl, 4, 8 + hlcoord 4, 8 ld de, TheEndTextString call PlaceString - coord hl, 4, 9 + hlcoord 4, 9 inc de call PlaceString jp FadeInCreditsText diff --git a/engine/movie/evolution.asm b/engine/movie/evolution.asm index b006dea6..cabe7254 100755 --- a/engine/movie/evolution.asm +++ b/engine/movie/evolution.asm @@ -99,7 +99,7 @@ EvolutionSetWholeScreenPalette: Evolution_LoadPic: call GetMonHeader - coord hl, 7, 2 + hlcoord 7, 2 jp LoadFlippedFrontSpriteByMonIndex Evolution_BackAndForthAnim: @@ -118,7 +118,7 @@ Evolution_ChangeMonPic: push bc xor a ldh [hAutoBGTransferEnabled], a - coord hl, 7, 2 + hlcoord 7, 2 lb bc, 7, 7 ld de, SCREEN_WIDTH - 7 .loop diff --git a/engine/movie/hall_of_fame.asm b/engine/movie/hall_of_fame.asm index 355a3f4f..071e7ca1 100755 --- a/engine/movie/hall_of_fame.asm +++ b/engine/movie/hall_of_fame.asm @@ -57,11 +57,11 @@ AnimateHallOfFame: call HoFDisplayAndRecordMonInfo ld c, 80 call DelayFrames - coord hl, 2, 13 + hlcoord 2, 13 ld b, 3 ld c, 14 call TextBoxBorder - coord hl, 4, 15 + hlcoord 4, 15 ld de, HallOfFameText call PlaceString ld c, 180 @@ -112,7 +112,7 @@ HoFShowMonOrPlayer: call HoFLoadPlayerPics jr .next1 .showMon - coord hl, 12, 5 + hlcoord 12, 5 call GetMonHeader call LoadFrontSpriteByMonIndex predef LoadMonBackPic @@ -157,22 +157,22 @@ HoFDisplayAndRecordMonInfo: jp HoFRecordMonInfo HoFDisplayMonInfo: - coord hl, 0, 2 + hlcoord 0, 2 ld b, 9 ld c, 10 call TextBoxBorder - coord hl, 2, 6 + hlcoord 2, 6 ld de, HoFMonInfoText call PlaceString - coord hl, 1, 4 + hlcoord 1, 4 ld de, wcd6d call PlaceString ld a, [wHoFMonLevel] - coord hl, 8, 7 + hlcoord 8, 7 call PrintLevelCommon ld a, [wHoFMonSpecies] ld [wd0b5], a - coord hl, 3, 9 + hlcoord 3, 9 predef PrintMonType ld a, [wHoFMonSpecies] jp PlayCry @@ -203,27 +203,27 @@ HoFLoadPlayerPics: HoFLoadMonPlayerPicTileIDs: ; c = base tile ID ld b, 0 - coord hl, 12, 5 + hlcoord 12, 5 predef_jump CopyTileIDsFromList HoFDisplayPlayerStats: SetEvent EVENT_HALL_OF_FAME_DEX_RATING predef DisplayDexRating - coord hl, 0, 4 + hlcoord 0, 4 ld b, 6 ld c, 10 call TextBoxBorder - coord hl, 5, 0 + hlcoord 5, 0 ld b, 2 ld c, 9 call TextBoxBorder - coord hl, 7, 2 + hlcoord 7, 2 ld de, wPlayerName call PlaceString - coord hl, 1, 6 + hlcoord 1, 6 ld de, HoFPlayTimeText call PlaceString - coord hl, 5, 7 + hlcoord 5, 7 ld de, wPlayTimeHours lb bc, 1, 3 call PrintNumber @@ -232,10 +232,10 @@ HoFDisplayPlayerStats: ld de, wPlayTimeMinutes lb bc, LEADING_ZEROES | 1, 2 call PrintNumber - coord hl, 1, 9 + hlcoord 1, 9 ld de, HoFMoneyText call PlaceString - coord hl, 4, 10 + hlcoord 4, 10 ld de, wPlayerMoney ld c, $a3 call PrintBCDNumber diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index 08b6ed8b..fc404b82 100755 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -217,7 +217,7 @@ IntroClearScreen: IntroClearMiddleOfScreen: ; clear the area of the tile map between the black bars on the top and bottom - coord hl, 0, 4 + hlcoord 0, 4 ld bc, SCREEN_WIDTH * 10 IntroClearCommon: @@ -274,7 +274,7 @@ IntroMoveMon: ret IntroCopyTiles: - coord hl, 13, 7 + hlcoord 13, 7 CopyTileIDsFromList_ZeroBaseTileID: ld c, 0 @@ -348,16 +348,16 @@ PlayShootingStar: IntroDrawBlackBars: ; clear the screen and draw black bars on the top and bottom call IntroClearScreen - coord hl, 0, 0 + hlcoord 0, 0 ld c, SCREEN_WIDTH * 4 call IntroPlaceBlackTiles - coord hl, 0, 14 + hlcoord 0, 14 ld c, SCREEN_WIDTH * 4 call IntroPlaceBlackTiles ld hl, vBGMap1 ld c, BG_MAP_WIDTH * 4 call IntroPlaceBlackTiles - ld hl, vBGMap1 + BG_MAP_WIDTH * 14 + hlbgcoord 0, 14, vBGMap1 ld c, BG_MAP_WIDTH * 4 jp IntroPlaceBlackTiles diff --git a/engine/movie/oak_speech/clear_save.asm b/engine/movie/oak_speech/clear_save.asm index c423fb0b..d5c04e6e 100755 --- a/engine/movie/oak_speech/clear_save.asm +++ b/engine/movie/oak_speech/clear_save.asm @@ -5,7 +5,7 @@ DoClearSaveDialogue: call LoadTextBoxTilePatterns ld hl, ClearSaveDataText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, NO_YES_MENU ld [wTwoOptionMenuID], a diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm index 2328e3ab..4b64f20d 100755 --- a/engine/movie/oak_speech/oak_speech.asm +++ b/engine/movie/oak_speech/oak_speech.asm @@ -68,7 +68,7 @@ OakSpeech: ld [wd0b5], a ld [wcf91], a call GetMonHeader - coord hl, 6, 4 + hlcoord 6, 4 call LoadFlippedFrontSpriteByMonIndex call MovePicLeft ld hl, OakSpeechText2 @@ -141,7 +141,7 @@ OakSpeech: ld [MBC1RomBank], a ld c, 20 call DelayFrames - coord hl, 6, 5 + hlcoord 6, 5 ld b, 7 ld c, 7 call ClearScreenArea @@ -224,9 +224,9 @@ IntroDisplayPicCenteredOrUpperRight: pop bc ld a, c and a - coord hl, 15, 1 + hlcoord 15, 1 jr nz, .next - coord hl, 6, 4 + hlcoord 6, 4 .next xor a ldh [hStartTileID], a diff --git a/engine/movie/oak_speech/oak_speech2.asm b/engine/movie/oak_speech/oak_speech2.asm index 5ee0a871..28208ddc 100755 --- a/engine/movie/oak_speech/oak_speech2.asm +++ b/engine/movie/oak_speech/oak_speech2.asm @@ -66,7 +66,7 @@ HisNameIsText: OakSpeechSlidePicLeft: push de - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 12, 11 call ClearScreenArea ; clear the name list text box ld c, 10 @@ -76,13 +76,13 @@ OakSpeechSlidePicLeft: ld bc, NAME_LENGTH call CopyData call Delay3 - coord hl, 12, 4 + hlcoord 12, 4 lb de, 6, 6 * SCREEN_WIDTH + 5 ld a, $ff jr OakSpeechSlidePicCommon OakSpeechSlidePicRight: - coord hl, 5, 4 + hlcoord 5, 4 lb de, 6, 6 * SCREEN_WIDTH + 5 xor a @@ -161,15 +161,15 @@ OakSpeechSlidePicCommon: DisplayIntroNameTextBox: push de - coord hl, 0, 0 + hlcoord 0, 0 ld b, $a ld c, $9 call TextBoxBorder - coord hl, 3, 0 + hlcoord 3, 0 ld de, .namestring call PlaceString pop de - coord hl, 2, 2 + hlcoord 2, 2 call PlaceString call UpdateSprites xor a diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 00e639ae..69838afb 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -63,7 +63,7 @@ DisplayTitleScreen: call ClearBothBGMaps ; place tiles for pokemon logo (except for the last row) - coord hl, 2, 1 + hlcoord 2, 1 ld a, $80 ld de, SCREEN_WIDTH ld c, 6 @@ -81,7 +81,7 @@ DisplayTitleScreen: jr nz, .pokemonLogoTileLoop ; place tiles for the last row of the pokemon logo - coord hl, 2, 7 + hlcoord 2, 7 ld a, $31 ld b, $10 .pokemonLogoLastTileRowLoop @@ -98,7 +98,7 @@ DisplayTitleScreen: ld [hl], a ; place tiles for title screen copyright - coord hl, 2, 17 + hlcoord 2, 17 ld de, .tileScreenCopyrightTiles ld b, $10 .tileScreenCopyrightTilesLoop @@ -353,7 +353,7 @@ ClearBothBGMaps: LoadTitleMonSprite: ld [wcf91], a ld [wd0b5], a - coord hl, 5, 10 + hlcoord 5, 10 call GetMonHeader jp LoadFrontSpriteByMonIndex @@ -372,7 +372,7 @@ LoadCopyrightTiles: ld hl, vChars2 + $600 lb bc, BANK(NintendoCopyrightLogoGraphics), (GamefreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10 call CopyVideoData - coord hl, 2, 7 + hlcoord 2, 7 ld de, CopyrightTextString jp PlaceString @@ -386,7 +386,7 @@ INCLUDE "data/pokemon/title_mons.asm" ; prints version text (red, blue) PrintGameVersionOnTitleScreen: - coord hl, 7, 8 + hlcoord 7, 8 ld de, VersionOnTitleScreenText jp PlaceString diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index 6aac7e23..3883c362 100755 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -148,7 +148,7 @@ Trade_Delay80: jp DelayFrames Trade_ClearTileMap: - coord hl, 0, 0 + hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, " " jp FillMemory @@ -232,7 +232,7 @@ Trade_ShowPlayerMon: ldh [hSCX], a xor a ldh [hAutoBGTransferEnabled], a - coord hl, 4, 0 + hlcoord 4, 0 ld b, 6 ld c, 10 call TextBoxBorder @@ -281,7 +281,7 @@ Trade_DrawOpenEndOfLinkCable: call DelayFrame ld a, %10001011 ldh [rLCDC], a - coord hl, 6, 2 + hlcoord 6, 2 ld b, $7 ; open end of link cable tile ID list index call CopyTileIDsFromList_ZeroBaseTileID call Trade_CopyTileMapToVRAM @@ -353,7 +353,7 @@ Trade_ShowEnemyMon: ld a, TRADE_BALL_TILT_ANIM call Trade_ShowAnimation call Trade_ShowClearedWindow - coord hl, 4, 10 + hlcoord 4, 10 ld b, 6 ld c, 10 call TextBoxBorder @@ -370,7 +370,7 @@ Trade_ShowEnemyMon: ld a, [wTradedEnemyMonSpecies] call PlayCry call Trade_Delay100 - coord hl, 4, 10 + hlcoord 4, 10 lb bc, 8, 12 call ClearScreenArea jp PrintTradeTakeCareText @@ -462,7 +462,7 @@ Trade_DrawLeftGameboy: call Trade_ClearTileMap ; draw link cable - coord hl, 11, 4 + hlcoord 11, 4 ld a, $5d ld [hli], a ld a, $5e @@ -473,16 +473,16 @@ Trade_DrawLeftGameboy: jr nz, .loop ; draw gameboy pic - coord hl, 5, 3 + hlcoord 5, 3 ld b, $6 call CopyTileIDsFromList_ZeroBaseTileID ; draw text box with player name below gameboy pic - coord hl, 4, 12 + hlcoord 4, 12 ld b, 2 ld c, 7 call TextBoxBorder - coord hl, 5, 14 + hlcoord 5, 14 ld de, wPlayerName call PlaceString @@ -492,7 +492,7 @@ Trade_DrawRightGameboy: call Trade_ClearTileMap ; draw horizontal segment of link cable - coord hl, 0, 4 + hlcoord 0, 4 ld a, $5e ld c, $e .loop @@ -520,16 +520,16 @@ Trade_DrawRightGameboy: ld [hl], a ; draw gameboy pic - coord hl, 7, 8 + hlcoord 7, 8 ld b, $6 call CopyTileIDsFromList_ZeroBaseTileID ; draw text box with enemy name above link cable - coord hl, 6, 0 + hlcoord 6, 0 ld b, 2 ld c, 7 call TextBoxBorder - coord hl, 7, 2 + hlcoord 7, 2 ld de, wLinkEnemyTrainerName call PlaceString @@ -538,7 +538,7 @@ Trade_DrawRightGameboy: Trade_DrawCableAcrossScreen: ; Draws the link cable across the screen. call Trade_ClearTileMap - coord hl, 0, 4 + hlcoord 0, 4 ld a, $5e ld c, SCREEN_WIDTH .loop @@ -551,7 +551,7 @@ Trade_CopyCableTilesOffScreen: ; This is used to copy the link cable tiles off screen so that the cable ; continues when the screen is scrolled. push hl - coord hl, 0, 4 + hlcoord 0, 4 call CopyToRedrawRowOrColumnSrcTiles pop hl ld a, h @@ -735,7 +735,7 @@ Trade_LoadMonSprite: xor $1 ldh [hAutoBGTransferEnabled], a call GetMonHeader - coord hl, 7, 2 + hlcoord 7, 2 call LoadFlippedFrontSpriteByMonIndex ld c, 10 jp DelayFrames diff --git a/engine/movie/trade2.asm b/engine/movie/trade2.asm index 6b744fd8..f0d91846 100755 --- a/engine/movie/trade2.asm +++ b/engine/movie/trade2.asm @@ -1,43 +1,43 @@ Trade_PrintPlayerMonInfoText: - coord hl, 5, 0 + hlcoord 5, 0 ld de, Trade_MonInfoText call PlaceString ld a, [wTradedPlayerMonSpecies] ld [wd11e], a predef IndexToPokedex - coord hl, 9, 0 + hlcoord 9, 0 ld de, wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber - coord hl, 5, 2 + hlcoord 5, 2 ld de, wcf4b call PlaceString - coord hl, 8, 4 + hlcoord 8, 4 ld de, wTradedPlayerMonOT call PlaceString - coord hl, 8, 6 + hlcoord 8, 6 ld de, wTradedPlayerMonOTID lb bc, LEADING_ZEROES | 2, 5 jp PrintNumber Trade_PrintEnemyMonInfoText: - coord hl, 5, 10 + hlcoord 5, 10 ld de, Trade_MonInfoText call PlaceString ld a, [wTradedEnemyMonSpecies] ld [wd11e], a predef IndexToPokedex - coord hl, 9, 10 + hlcoord 9, 10 ld de, wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber - coord hl, 5, 12 + hlcoord 5, 12 ld de, wcd6d call PlaceString - coord hl, 8, 14 + hlcoord 8, 14 ld de, wTradedEnemyMonOT call PlaceString - coord hl, 8, 16 + hlcoord 8, 16 ld de, wTradedEnemyMonOTID lb bc, LEADING_ZEROES | 2, 5 jp PrintNumber diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm index ed893773..d38818fa 100755 --- a/engine/overworld/doors.asm +++ b/engine/overworld/doors.asm @@ -11,7 +11,7 @@ IsPlayerStandingOnDoorTile: ld a, [hli] ld h, [hl] ld l, a - aCoord 8, 9 ; a = lower left background tile under player's sprite + lda_coord 8, 9 ; a = lower left background tile under player's sprite ld b, a .loop ld a, [hli] diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index cba544f6..254680a5 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -8,7 +8,7 @@ HandleLedges:: predef GetTileAndCoordsInFrontOfPlayer ld a, [wSpritePlayerStateData1FacingDirection] ld b, a - aCoord 8, 9 + lda_coord 8, 9 ld c, a ld a, [wTileInFrontOfPlayer] ld d, a diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index a20b3174..a2930993 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -13,7 +13,7 @@ UpdatePlayerSprite: ; background tile the sprite is standing on is greater than $5F, which is ; the maximum number for map tiles .checkIfTextBoxInFrontOfSprite - aCoord 8, 9 + lda_coord 8, 9 ldh [hTilePlayerStandingOn], a cp MAP_TILESET_SIZE jr c, .lowerLeftTileIsMapTile @@ -709,7 +709,7 @@ GetTileSpriteStandsOn: add SCREEN_WIDTH ; screen X tile + 20 ld d, $0 ld e, a - coord hl, 0, 0 + hlcoord 0, 0 add hl, bc add hl, bc add hl, bc diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index fec10daf..69c1eefc 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -358,7 +358,7 @@ IsPlayerStandingOnWarpPadOrHole:: jr z, .done cp c jr nz, .nextEntry - aCoord 8, 9 + lda_coord 8, 9 cp [hl] jr z, .foundMatch .nextEntry diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm index 39c8f756..70326754 100644 --- a/engine/overworld/player_state.asm +++ b/engine/overworld/player_state.asm @@ -204,7 +204,7 @@ IsPlayerStandingOnDoorTileOrWarpTile:: ld h, [hl] ld l, a ld de, $1 - aCoord 8, 9 + lda_coord 8, 9 call IsInArray jr nc, .done ld hl, wd736 @@ -223,28 +223,28 @@ PrintSafariZoneSteps:: ret c cp CERULEAN_CAVE_2F ret nc - coord hl, 0, 0 + hlcoord 0, 0 ld b, 3 ld c, 7 call TextBoxBorder - coord hl, 1, 1 + hlcoord 1, 1 ld de, wSafariSteps lb bc, 2, 3 call PrintNumber - coord hl, 4, 1 + hlcoord 4, 1 ld de, SafariSteps call PlaceString - coord hl, 1, 3 + hlcoord 1, 3 ld de, SafariBallText call PlaceString ld a, [wNumSafariBalls] cp 10 jr nc, .asm_c56d - coord hl, 5, 3 + hlcoord 5, 3 ld a, " " ld [hl], a .asm_c56d - coord hl, 6, 3 + hlcoord 6, 3 ld de, wNumSafariBalls lb bc, 1, 2 jp PrintNumber @@ -267,28 +267,28 @@ _GetTileAndCoordsInFrontOfPlayer: and a ; cp SPRITE_FACING_DOWN jr nz, .notFacingDown ; facing down - aCoord 8, 11 + lda_coord 8, 11 inc d jr .storeTile .notFacingDown cp SPRITE_FACING_UP jr nz, .notFacingUp ; facing up - aCoord 8, 7 + lda_coord 8, 7 dec d jr .storeTile .notFacingUp cp SPRITE_FACING_LEFT jr nz, .notFacingLeft ; facing left - aCoord 6, 9 + lda_coord 6, 9 dec e jr .storeTile .notFacingLeft cp SPRITE_FACING_RIGHT jr nz, .storeTile ; facing right - aCoord 10, 9 + lda_coord 10, 9 inc e .storeTile ld c, a @@ -308,7 +308,7 @@ GetTileTwoStepsInFrontOfPlayer: ; facing down ld hl, hPlayerFacing set 0, [hl] - aCoord 8, 13 + lda_coord 8, 13 inc d jr .storeTile .notFacingDown @@ -317,7 +317,7 @@ GetTileTwoStepsInFrontOfPlayer: ; facing up ld hl, hPlayerFacing set 1, [hl] - aCoord 8, 5 + lda_coord 8, 5 dec d jr .storeTile .notFacingUp @@ -326,7 +326,7 @@ GetTileTwoStepsInFrontOfPlayer: ; facing left ld hl, hPlayerFacing set 2, [hl] - aCoord 4, 9 + lda_coord 4, 9 dec e jr .storeTile .notFacingLeft @@ -335,7 +335,7 @@ GetTileTwoStepsInFrontOfPlayer: ; facing right ld hl, hPlayerFacing set 3, [hl] - aCoord 12, 9 + lda_coord 12, 9 inc e .storeTile ld c, a diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 0a760a27..0b514111 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -10,17 +10,17 @@ DisplayPCMainMenu:: ld a, [wNumHoFTeams] and a jr nz, .leaguePCAvailable - coord hl, 0, 0 + hlcoord 0, 0 ld b, 8 ld c, 14 jr .next .noOaksPC - coord hl, 0, 0 + hlcoord 0, 0 ld b, 6 ld c, 14 jr .next .leaguePCAvailable - coord hl, 0, 0 + hlcoord 0, 0 ld b, 10 ld c, 14 .next @@ -30,15 +30,15 @@ DisplayPCMainMenu:: ld [wMaxMenuItem], a CheckEvent EVENT_MET_BILL jr nz, .metBill - coord hl, 2, 2 + hlcoord 2, 2 ld de, SomeonesPCText jr .next2 .metBill - coord hl, 2, 2 + hlcoord 2, 2 ld de, BillsPCText .next2 call PlaceString - coord hl, 2, 4 + hlcoord 2, 4 ld de, wPlayerName call PlaceString ld l, c @@ -47,7 +47,7 @@ DisplayPCMainMenu:: call PlaceString CheckEvent EVENT_GOT_POKEDEX jr z, .noOaksPC2 - coord hl, 2, 6 + hlcoord 2, 6 ld de, OaksPCText call PlaceString ld a, [wNumHoFTeams] @@ -55,20 +55,20 @@ DisplayPCMainMenu:: jr z, .noLeaguePC ld a, 4 ld [wMaxMenuItem], a - coord hl, 2, 8 + hlcoord 2, 8 ld de, PKMNLeaguePCText call PlaceString - coord hl, 2, 10 + hlcoord 2, 10 ld de, LogOffPCText jr .next3 .noLeaguePC - coord hl, 2, 8 + hlcoord 2, 8 ld de, LogOffPCText jr .next3 .noOaksPC2 ld a, $2 ld [wMaxMenuItem], a - coord hl, 2, 6 + hlcoord 2, 6 ld de, LogOffPCText .next3 call PlaceString @@ -119,11 +119,11 @@ BillsPCMenu: lb bc, BANK(PokeballTileGraphics), $01 call CopyVideoData call LoadScreenTilesFromBuffer2DisableBGTransfer - coord hl, 0, 0 + hlcoord 0, 0 ld b, 10 ld c, 12 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, BillsPCMenuText call PlaceString ld hl, wTopMenuItemY @@ -146,7 +146,7 @@ BillsPCMenu: ld [wPlayerMonNumber], a ld hl, WhatText call PrintText - coord hl, 9, 14 + hlcoord 9, 14 ld b, 2 ld c, 9 call TextBoxBorder @@ -156,15 +156,15 @@ BillsPCMenu: jr c, .singleDigitBoxNum ; two digit box num sub 9 - coord hl, 17, 16 + hlcoord 17, 16 ld [hl], "1" add "0" jr .next .singleDigitBoxNum add "1" .next - Coorda 18, 16 - coord hl, 10, 16 + ldcoord_a 18, 16 + hlcoord 10, 16 ld de, BoxNoPCText call PlaceString ld a, 1 @@ -380,7 +380,7 @@ HMMoveArray: INCLUDE "data/moves/hm_moves.asm" DisplayDepositWithdrawMenu: - coord hl, 9, 10 + hlcoord 9, 10 ld b, 6 ld c, 9 call TextBoxBorder @@ -390,9 +390,9 @@ DisplayDepositWithdrawMenu: jr nz, .next ld de, WithdrawPCText .next - coord hl, 11, 12 + hlcoord 11, 12 call PlaceString - coord hl, 11, 14 + hlcoord 11, 14 ld de, StatsCancelPCText call PlaceString ld hl, wTopMenuItemY diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index 564a8557..ed44f9a6 100755 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -121,7 +121,7 @@ Evolution_PartyMonLoop: ; loop over party mons call DelayFrames xor a ldh [hAutoBGTransferEnabled], a - coord hl, 0, 0 + hlcoord 0, 0 lb bc, 12, 20 call ClearScreenArea ld a, $1 diff --git a/engine/pokemon/learn_move.asm b/engine/pokemon/learn_move.asm index e7b907d5..8e852fd4 100755 --- a/engine/pokemon/learn_move.asm +++ b/engine/pokemon/learn_move.asm @@ -76,7 +76,7 @@ DontAbandonLearning: AbandonLearning: ld hl, AbandonLearningText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -99,7 +99,7 @@ TryingToLearn: push hl ld hl, TryingToLearnText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -120,11 +120,11 @@ TryingToLearn: push hl ld hl, WhichMoveToForgetText call PrintText - coord hl, 4, 7 + hlcoord 4, 7 ld b, 4 ld c, 14 call TextBoxBorder - coord hl, 6, 8 + hlcoord 6, 8 ld de, wMovesString ldh a, [hFlagsFFF6] set 2, a diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index c2abeedd..83d33fe5 100755 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -105,7 +105,7 @@ StatusScreen: push af xor a ldh [hTilesetType], a - coord hl, 19, 1 + hlcoord 19, 1 lb bc, 6, 10 call DrawLineBox ; Draws the box around name, HP and status ld de, -6 @@ -113,54 +113,54 @@ StatusScreen: ld [hl], "" dec hl ld [hl], "№" - coord hl, 19, 9 + hlcoord 19, 9 lb bc, 8, 6 call DrawLineBox ; Draws the box around types, ID No. and OT - coord hl, 10, 9 + hlcoord 10, 9 ld de, Type1Text call PlaceString ; "TYPE1/" - coord hl, 11, 3 + hlcoord 11, 3 predef DrawHP ld hl, wStatusScreenHPBarColor call GetHealthBarColor ld b, SET_PAL_STATUS_SCREEN call RunPaletteCommand - coord hl, 16, 6 + hlcoord 16, 6 ld de, wLoadedMonStatus call PrintStatusCondition jr nz, .StatusWritten - coord hl, 16, 6 + hlcoord 16, 6 ld de, OKText call PlaceString ; "OK" .StatusWritten - coord hl, 9, 6 + hlcoord 9, 6 ld de, StatusText call PlaceString ; "STATUS/" - coord hl, 14, 2 + hlcoord 14, 2 call PrintLevel ; Pokémon level ld a, [wMonHIndex] ld [wd11e], a ld [wd0b5], a predef IndexToPokedex - coord hl, 3, 7 + hlcoord 3, 7 ld de, wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber ; Pokémon no. - coord hl, 11, 10 + hlcoord 11, 10 predef PrintMonType ld hl, NamePointers2 call .GetStringPointer ld d, h ld e, l - coord hl, 9, 1 + hlcoord 9, 1 call PlaceString ; Pokémon name ld hl, OTPointers call .GetStringPointer ld d, h ld e, l - coord hl, 12, 16 + hlcoord 12, 16 call PlaceString ; OT - coord hl, 12, 14 + hlcoord 12, 14 ld de, wLoadedMonOTID lb bc, LEADING_ZEROES | 2, 5 call PrintNumber ; ID Number @@ -168,7 +168,7 @@ StatusScreen: call PrintStatsBox call Delay3 call GBPalNormal - coord hl, 1, 0 + hlcoord 1, 0 call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture ld a, [wcf91] call PlayCry ; play Pokémon cry @@ -252,19 +252,19 @@ PrintStatsBox: ld a, d and a ; a is 0 from the status screen jr nz, .DifferentBox - coord hl, 0, 8 + hlcoord 0, 8 ld b, 8 ld c, 8 call TextBoxBorder ; Draws the box - coord hl, 1, 9 ; Start printing stats from here + hlcoord 1, 9 ; Start printing stats from here ld bc, $19 ; Number offset jr .PrintStats .DifferentBox - coord hl, 9, 2 + hlcoord 9, 2 ld b, 8 ld c, 9 call TextBoxBorder - coord hl, 11, 3 + hlcoord 11, 3 ld bc, $18 .PrintStats push bc @@ -311,16 +311,16 @@ StatusScreen2: ld bc, NUM_MOVES call CopyData callfar FormatMovesString - coord hl, 9, 2 + hlcoord 9, 2 lb bc, 5, 10 call ClearScreenArea ; Clear under name - coord hl, 19, 3 + hlcoord 19, 3 ld [hl], $78 - coord hl, 0, 8 + hlcoord 0, 8 ld b, 8 ld c, 18 call TextBoxBorder ; Draw move container - coord hl, 2, 9 + hlcoord 2, 9 ld de, wMovesString call PlaceString ; Print moves ld a, [wNumMovesMinusOne] @@ -329,7 +329,7 @@ StatusScreen2: ld a, $4 sub c ld b, a ; Number of moves ? - coord hl, 11, 10 + hlcoord 11, 10 ld de, SCREEN_WIDTH * 2 ld a, "" call StatusScreen_PrintPP ; Print "PP" @@ -341,7 +341,7 @@ StatusScreen2: call StatusScreen_PrintPP ; Fill the rest with -- .InitPP ld hl, wLoadedMonMoves - coord de, 14, 10 + decoord 14, 10 ld b, 0 .PrintPP ld a, [hli] @@ -391,7 +391,7 @@ StatusScreen2: cp $4 jr nz, .PrintPP .PPDone - coord hl, 9, 3 + hlcoord 9, 3 ld de, StatusScreenExpText call PlaceString ld a, [wLoadedMonLevel] @@ -401,7 +401,7 @@ StatusScreen2: inc a ld [wLoadedMonLevel], a ; Increase temporarily if not 100 .Level100 - coord hl, 14, 6 + hlcoord 14, 6 ld [hl], "" inc hl inc hl @@ -409,22 +409,22 @@ StatusScreen2: pop af ld [wLoadedMonLevel], a ld de, wLoadedMonExp - coord hl, 12, 4 + hlcoord 12, 4 lb bc, 3, 7 call PrintNumber ; exp call CalcExpToLevelUp ld de, wLoadedMonExp - coord hl, 7, 6 + hlcoord 7, 6 lb bc, 3, 7 call PrintNumber ; exp needed to level up - coord hl, 9, 0 + hlcoord 9, 0 call StatusScreen_ClearName - coord hl, 9, 1 + hlcoord 9, 1 call StatusScreen_ClearName ld a, [wMonHIndex] ld [wd11e], a call GetMonName - coord hl, 9, 1 + hlcoord 9, 1 call PlaceString ld a, $1 ldh [hAutoBGTransferEnabled], a diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index 64c14997..a1326240 100755 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -79,11 +79,11 @@ MainSlotMachineLoop: ld [wCurrentMenuItem], a ld [wLastMenuItem], a ld [wMenuWatchMovingOutOfBounds], a - coord hl, 14, 11 + hlcoord 14, 11 ld b, 5 ld c, 4 call TextBoxBorder - coord hl, 16, 12 + hlcoord 16, 12 ld de, CoinMultiplierSlotMachineText call PlaceString call HandleMenuInput @@ -133,7 +133,7 @@ MainSlotMachineLoop: .skip2 ld hl, OneMoreGoSlotMachineText call PrintText - coord hl, 14, 12 + hlcoord 14, 12 lb bc, 13, 15 xor a ; YES_NO_MENU ld [wTwoOptionMenuID], a @@ -615,7 +615,7 @@ YeahText: SlotMachine_PrintWinningSymbol: ; prints winning symbol and down arrow in text box - coord hl, 2, 14 + hlcoord 2, 14 ld a, [wSlotMachineWinningSymbol] add $25 ld [hli], a @@ -627,7 +627,7 @@ SlotMachine_PrintWinningSymbol: ld [hli], a inc a ld [hl], a - coord hl, 18, 16 + hlcoord 18, 16 ld [hl], "▼" ret @@ -642,13 +642,13 @@ SlotMachine_SubtractBetFromPlayerCoins: predef SubBCDPredef SlotMachine_PrintCreditCoins: - coord hl, 5, 1 + hlcoord 5, 1 ld de, wPlayerCoins ld c, $2 jp PrintBCDNumber SlotMachine_PrintPayoutCoins: - coord hl, 11, 1 + hlcoord 11, 1 ld de, wPayoutCoins lb bc, LEADING_ZEROES | 2, 4 ; 2 bytes, 4 digits jp PrintNumber @@ -725,19 +725,19 @@ SlotMachine_LightBalls: jr z, SlotMachine_UpdateTwoCoinBallTiles SlotMachine_UpdateThreeCoinBallTiles: - coord hl, 3, 2 + hlcoord 3, 2 call SlotMachine_UpdateBallTiles - coord hl, 3, 10 + hlcoord 3, 10 call SlotMachine_UpdateBallTiles SlotMachine_UpdateTwoCoinBallTiles: - coord hl, 3, 4 + hlcoord 3, 4 call SlotMachine_UpdateBallTiles - coord hl, 3, 8 + hlcoord 3, 8 call SlotMachine_UpdateBallTiles SlotMachine_UpdateOneCoinBallTiles: - coord hl, 3, 6 + hlcoord 3, 6 SlotMachine_UpdateBallTiles: ld a, [wNewSlotMachineBallTile] @@ -864,7 +864,7 @@ LoadSlotMachineTiles: ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineMap - coord de, 0, 0 + decoord 0, 0 ld bc, SlotMachineMapEnd - SlotMachineMap call CopyData call EnableLCD diff --git a/home.asm b/home.asm index 3e465cdf..037a3444 100644 --- a/home.asm +++ b/home.asm @@ -869,7 +869,7 @@ UncompressSpriteFromDE:: jp UncompressSpriteData SaveScreenTilesToBuffer2:: - coord hl, 0, 0 + hlcoord 0, 0 ld de, wTileMapBackup2 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call CopyData @@ -886,13 +886,13 @@ LoadScreenTilesFromBuffer2DisableBGTransfer:: xor a ldh [hAutoBGTransferEnabled], a ld hl, wTileMapBackup2 - coord de, 0, 0 + decoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call CopyData ret SaveScreenTilesToBuffer1:: - coord hl, 0, 0 + hlcoord 0, 0 ld de, wTileMapBackup ld bc, SCREEN_WIDTH * SCREEN_HEIGHT jp CopyData @@ -901,7 +901,7 @@ LoadScreenTilesFromBuffer1:: xor a ldh [hAutoBGTransferEnabled], a ld hl, wTileMapBackup - coord de, 0, 0 + decoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call CopyData ld a, 1 @@ -1071,7 +1071,7 @@ WaitForTextScrollButtonPress:: jr z, .skipAnimation call TownMapSpriteBlinkingAnimation .skipAnimation - coord hl, 18, 16 + hlcoord 18, 16 call HandleDownArrowBlinkTiming pop hl call JoypadLowSensitivity @@ -1304,7 +1304,7 @@ HandleMenuInput_:: and a ; was a key pressed? jr nz, .keyPressed push hl - coord hl, 18, 11 ; coordinates of blinking down arrow in some menus + hlcoord 18, 11 ; coordinates of blinking down arrow in some menus call HandleDownArrowBlinkTiming ; blink down arrow (if any) pop hl ld a, [wMenuJoypadPollCount] @@ -1395,7 +1395,7 @@ PlaceMenuCursor:: ld a, [wTopMenuItemY] and a ; is the y coordinate 0? jr z, .adjustForXCoord - coord hl, 0, 0 + hlcoord 0, 0 ld bc, SCREEN_WIDTH .topMenuItemLoop add hl, bc @@ -1565,7 +1565,7 @@ PrintText:: call Delay3 pop hl PrintText_NoCreatingTextBox:: - coord bc, 1, 14 + bccoord 1, 14 jp TextCommandProcessor INCLUDE "home/print_num.asm" diff --git a/home/copy2.asm b/home/copy2.asm index 01417201..1c9a56f3 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -184,17 +184,17 @@ CopyScreenTileBufferToVRAM:: ld c, 6 ld hl, $600 * 0 - coord de, 0, 6 * 0 + decoord 0, 6 * 0 call .setup call DelayFrame ld hl, $600 * 1 - coord de, 0, 6 * 1 + decoord 0, 6 * 1 call .setup call DelayFrame ld hl, $600 * 2 - coord de, 0, 6 * 2 + decoord 0, 6 * 2 call .setup jp DelayFrame @@ -217,7 +217,7 @@ ClearScreen:: ; for the bg map to update. ld bc, 20 * 18 inc b - coord hl, 0, 0 + hlcoord 0, 0 ld a, " " .loop ld [hli], a diff --git a/home/list_menu.asm b/home/list_menu.asm index 9c567d0d..ec775331 100644 --- a/home/list_menu.asm +++ b/home/list_menu.asm @@ -31,7 +31,7 @@ DisplayListMenuID:: call DisplayTextBoxID ; draw the menu text box call UpdateSprites ; disable sprites behind the text box ; the code up to .skipMovingSprites appears to be useless - coord hl, 4, 2 ; coordinates of upper left corner of menu text box + hlcoord 4, 2 ; coordinates of upper left corner of menu text box lb de, 9, 14 ; height and width of menu text box ld a, [wListMenuID] and a ; is it a PC pokemon list? @@ -67,12 +67,12 @@ DisplayListMenuIDLoop:: jr z, .notOldManBattle .oldManBattle ld a, "▶" - Coorda 5, 4 ; place menu cursor in front of first menu entry + ldcoord_a 5, 4 ; place menu cursor in front of first menu entry ld c, 80 call DelayFrames xor a ld [wCurrentMenuItem], a - coord hl, 5, 4 + hlcoord 5, 4 ld a, l ld [wMenuCursorLocation], a ld a, h @@ -194,23 +194,23 @@ DisplayListMenuIDLoop:: DisplayChooseQuantityMenu:: ; text box dimensions/coordinates for just quantity - coord hl, 15, 9 + hlcoord 15, 9 ld b, 1 ; height ld c, 3 ; width ld a, [wListMenuID] cp PRICEDITEMLISTMENU jr nz, .drawTextBox ; text box dimensions/coordinates for quantity and price - coord hl, 7, 9 + hlcoord 7, 9 ld b, 1 ; height ld c, 11 ; width .drawTextBox call TextBoxBorder - coord hl, 16, 10 + hlcoord 16, 10 ld a, [wListMenuID] cp PRICEDITEMLISTMENU jr nz, .printInitialQuantity - coord hl, 8, 10 + hlcoord 8, 10 .printInitialQuantity ld de, InitialQuantityText call PlaceString @@ -250,7 +250,7 @@ DisplayChooseQuantityMenu:: ld a, [wMaxItemQuantity] ld [hl], a .handleNewQuantity - coord hl, 17, 10 + hlcoord 17, 10 ld a, [wListMenuID] cp PRICEDITEMLISTMENU jr nz, .printQuantity @@ -289,13 +289,13 @@ DisplayChooseQuantityMenu:: ldh a, [hDivideBCDQuotient + 2] ldh [hMoney + 2], a .skipHalvingPrice - coord hl, 12, 10 + hlcoord 12, 10 ld de, SpacesBetweenQuantityAndPriceText call PlaceString ld de, hMoney ; total price ld c, $a3 call PrintBCDNumber - coord hl, 9, 10 + hlcoord 9, 10 .printQuantity ld de, wItemQuantity ; current quantity lb bc, LEADING_ZEROES | 1, 2 ; 1 byte, 2 digits @@ -334,7 +334,7 @@ ExitListMenu:: ret PrintListMenuEntries:: - coord hl, 5, 3 + hlcoord 5, 3 ld b, 9 ld c, 14 call ClearScreenArea @@ -359,7 +359,7 @@ PrintListMenuEntries:: jr nc, .noCarry inc d .noCarry - coord hl, 6, 4 ; coordinates of first list entry name + hlcoord 6, 4 ; coordinates of first list entry name ld b, 4 ; print 4 names .loop ld a, b diff --git a/home/overworld.asm b/home/overworld.asm index 557efa2d..af2a79b2 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -103,7 +103,7 @@ OverworldLoopLessDelay:: jr nz, .checkForOpponent bit 0, a jr nz, .checkForOpponent - aCoord 8, 9 + lda_coord 8, 9 ld [wTilePlayerStandingOn], a ; unused? call DisplayTextID ; display either the start menu or the NPC/sign text ld a, [wEnteringCableClub] @@ -688,7 +688,7 @@ CheckMapConnections:: ; function to play a sound when changing maps PlayMapChangeSound:: - aCoord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on + lda_coord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on cp $0b ; door tile in tileset 0 jr nz, .didNotGoThroughDoor ld a, SFX_GO_INSIDE @@ -1297,7 +1297,7 @@ CheckForJumpingAndTilePairCollisions:: ; if not jumping CheckForTilePairCollisions2:: - aCoord 8, 9 ; tile the player is on + lda_coord 8, 9 ; tile the player is on ld [wTilePlayerStandingOn], a CheckForTilePairCollisions:: @@ -1438,7 +1438,7 @@ LoadCurrentMapView:: ld bc, $2 add hl, bc .copyToVisibleAreaBuffer - coord de, 0, 0 ; base address for the tiles that are directly transferred to VRAM during V-blank + decoord 0, 0 ; base address for the tiles that are directly transferred to VRAM during V-blank ld b, SCREEN_HEIGHT .rowLoop2 ld c, SCREEN_WIDTH @@ -1711,7 +1711,7 @@ MoveTileBlockMapPointerNorth:: ; the portion of the map that was newly exposed due to the player's movement ScheduleNorthRowRedraw:: - coord hl, 0, 0 + hlcoord 0, 0 call CopyToRedrawRowOrColumnSrcTiles ld a, [wMapViewVRAMPointer] ldh [hRedrawRowOrColumnDest], a @@ -1733,7 +1733,7 @@ CopyToRedrawRowOrColumnSrcTiles:: ret ScheduleSouthRowRedraw:: - coord hl, 0, 16 + hlcoord 0, 16 call CopyToRedrawRowOrColumnSrcTiles ld a, [wMapViewVRAMPointer] ld l, a @@ -1752,7 +1752,7 @@ ScheduleSouthRowRedraw:: ret ScheduleEastColumnRedraw:: - coord hl, 18, 0 + hlcoord 18, 0 call ScheduleColumnRedrawHelper ld a, [wMapViewVRAMPointer] ld c, a @@ -1790,7 +1790,7 @@ ScheduleColumnRedrawHelper:: ret ScheduleWestColumnRedraw:: - coord hl, 0, 0 + hlcoord 0, 0 call ScheduleColumnRedrawHelper ld a, [wMapViewVRAMPointer] ldh [hRedrawRowOrColumnDest], a @@ -2342,7 +2342,7 @@ LoadMapData:: call LoadTilesetTilePatternData call LoadCurrentMapView ; copy current map view to VRAM - coord hl, 0, 0 + hlcoord 0, 0 ld de, vBGMap0 ld b, 18 .vramCopyLoop diff --git a/home/text.asm b/home/text.asm index 5bbad00b..bdd871cb 100644 --- a/home/text.asm +++ b/home/text.asm @@ -76,7 +76,7 @@ PlaceNextChar:: cp "" jr nz, .NotLine pop hl - coord hl, 1, 16 + hlcoord 1, 16 push hl jp NextChar @@ -207,12 +207,12 @@ PromptText:: cp LINK_STATE_BATTLING jp z, .ok ld a, "▼" - Coorda 18, 16 + ldcoord_a 18, 16 .ok call ProtectedDelay3 call ManualTextScroll ld a, " " - Coorda 18, 16 + ldcoord_a 18, 16 DoneText:: pop hl @@ -226,49 +226,49 @@ DoneText:: Paragraph:: push de ld a, "▼" - Coorda 18, 16 + ldcoord_a 18, 16 call ProtectedDelay3 call ManualTextScroll - coord hl, 1, 13 + hlcoord 1, 13 lb bc, 4, 18 call ClearScreenArea ld c, 20 call DelayFrames pop de - coord hl, 1, 14 + hlcoord 1, 14 jp NextChar PageChar:: push de ld a, "▼" - Coorda 18, 16 + ldcoord_a 18, 16 call ProtectedDelay3 call ManualTextScroll - coord hl, 1, 10 + hlcoord 1, 10 lb bc, 7, 18 call ClearScreenArea ld c, 20 call DelayFrames pop de pop hl - coord hl, 1, 11 + hlcoord 1, 11 push hl jp NextChar _ContText:: ld a, "▼" - Coorda 18, 16 + ldcoord_a 18, 16 call ProtectedDelay3 push de call ManualTextScroll pop de ld a, " " - Coorda 18, 16 + ldcoord_a 18, 16 _ContTextNoPause:: push de call ScrollTextUpOneLine call ScrollTextUpOneLine - coord hl, 1, 16 + hlcoord 1, 16 pop de jp NextChar @@ -277,8 +277,8 @@ _ContTextNoPause:: ; first time, copy the two rows of text to the "in between" rows that are usually emtpy ; second time, copy the bottom row of text into the top row of text ScrollTextUpOneLine:: - coord hl, 0, 14 ; top row of text - coord de, 0, 13 ; empty line above text + hlcoord 0, 14 ; top row of text + decoord 0, 13 ; empty line above text ld b, SCREEN_WIDTH * 3 .copyText ld a, [hli] @@ -286,7 +286,7 @@ ScrollTextUpOneLine:: inc de dec b jr nz, .copyText - coord hl, 1, 16 + hlcoord 1, 16 ld a, " " ld b, SCREEN_WIDTH - 2 .clearText @@ -424,7 +424,7 @@ TextCommand_MOVE:: TextCommand_LOW:: ; write text at (1,16) pop hl - coord bc, 1, 16 ; second line of dialogue text box + bccoord 1, 16 ; second line of dialogue text box jp NextTextCommand TextCommand_PROMPT_BUTTON:: @@ -433,12 +433,12 @@ TextCommand_PROMPT_BUTTON:: cp LINK_STATE_BATTLING jp z, TextCommand_WAIT_BUTTON ld a, "▼" - Coorda 18, 16 ; place down arrow in lower right corner of dialogue text box + ldcoord_a 18, 16 ; place down arrow in lower right corner of dialogue text box push bc call ManualTextScroll ; blink arrow and wait for A or B to be pressed pop bc ld a, " " - Coorda 18, 16 ; overwrite down arrow with blank space + ldcoord_a 18, 16 ; overwrite down arrow with blank space pop hl jp NextTextCommand @@ -446,11 +446,11 @@ TextCommand_SCROLL:: ; pushes text up two lines and sets the BC cursor to the border tile ; below the first character column of the text box. ld a, " " - Coorda 18, 16 ; place blank space in lower right corner of dialogue text box + ldcoord_a 18, 16 ; place blank space in lower right corner of dialogue text box call ScrollTextUpOneLine call ScrollTextUpOneLine pop hl - coord bc, 1, 16 ; second line of dialogue text box + bccoord 1, 16 ; second line of dialogue text box jp NextTextCommand TextCommand_START_ASM:: diff --git a/home/vcopy.asm b/home/vcopy.asm index d2340b7c..1a7863e9 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -134,7 +134,7 @@ AutoBgMapTransfer:: dec a jr z, .transferMiddleThird .transferBottomThird - coord hl, 0, 12 + hlcoord 0, 12 ld sp, hl ldh a, [hAutoBGTransferDest + 1] ld h, a @@ -145,7 +145,7 @@ AutoBgMapTransfer:: xor a ; TRANSFERTOP jr .doTransfer .transferTopThird - coord hl, 0, 0 + hlcoord 0, 0 ld sp, hl ldh a, [hAutoBGTransferDest + 1] ld h, a @@ -154,7 +154,7 @@ AutoBgMapTransfer:: ld a, TRANSFERMIDDLE jr .doTransfer .transferMiddleThird - coord hl, 0, 6 + hlcoord 0, 6 ld sp, hl ldh a, [hAutoBGTransferDest + 1] ld h, a diff --git a/home/yes_no.asm b/home/yes_no.asm index 61aa1390..aae27f86 100644 --- a/home/yes_no.asm +++ b/home/yes_no.asm @@ -14,7 +14,7 @@ Func_35f4:: InitYesNoTextBoxParameters:: xor a ; YES_NO_MENU ld [wTwoOptionMenuID], a - coord hl, 14, 7 + hlcoord 14, 7 ld bc, $80f ret @@ -22,7 +22,7 @@ YesNoChoicePokeCenter:: call SaveScreenTilesToBuffer1 ld a, HEAL_CANCEL_MENU ld [wTwoOptionMenuID], a - coord hl, 11, 6 + hlcoord 11, 6 lb bc, 8, 12 jr DisplayYesNoChoice @@ -30,7 +30,7 @@ WideYesNoChoice:: ; unused call SaveScreenTilesToBuffer1 ld a, WIDE_YES_NO_MENU ld [wTwoOptionMenuID], a - coord hl, 12, 7 + hlcoord 12, 7 lb bc, 8, 13 DisplayYesNoChoice:: diff --git a/macros/coords.asm b/macros/coords.asm index 302260d7..94808ba5 100644 --- a/macros/coords.asm +++ b/macros/coords.asm @@ -1,65 +1,79 @@ -validateCoords: MACRO - IF \1 >= SCREEN_WIDTH - fail "x coord out of range" - ENDC - IF \2 >= SCREEN_HEIGHT - fail "y coord out of range" +validate_coords: MACRO + IF _NARG >= 4 + IF \1 >= \3 + fail "x coord out of range" + ENDC + IF \2 >= \4 + fail "y coord out of range" + ENDC + ELSE + validate_coords \1, \2, SCREEN_WIDTH, SCREEN_HEIGHT ENDC ENDM -;\1 = r -;\2 = X -;\3 = Y -;\4 = which tilemap (optional) +hlcoord EQUS "coord hl," +bccoord EQUS "coord bc," +decoord EQUS "coord de," + coord: MACRO - validateCoords \2, \3 +; register, x, y[, origin] + validate_coords \2, \3 IF _NARG >= 4 - ld \1, \4 + SCREEN_WIDTH * \3 + \2 + ld \1, (\3) * SCREEN_WIDTH + (\2) + \4 ELSE - ld \1, wTileMap + SCREEN_WIDTH * \3 + \2 + ld \1, (\3) * SCREEN_WIDTH + (\2) + wTileMap ENDC ENDM -;\1 = X -;\2 = Y -;\3 = which tilemap (optional) -aCoord: MACRO - validateCoords \1, \2 - IF _NARG >= 3 - ld a, [\3 + SCREEN_WIDTH * \2 + \1] +hlbgcoord EQUS "bgcoord hl," +bcbgcoord EQUS "bgcoord bc," +debgcoord EQUS "bgcoord de," + +bgcoord: MACRO +; register, x, y[, origin] + validate_coords \2, \3, BG_MAP_WIDTH, BG_MAP_HEIGHT + IF _NARG >= 4 + ld \1, (\3) * BG_MAP_WIDTH + (\2) + \4 ELSE - ld a, [wTileMap + SCREEN_WIDTH * \2 + \1] + ld \1, (\3) * BG_MAP_WIDTH + (\2) + vBGMap0 ENDC ENDM -;\1 = X -;\2 = Y -;\3 = which tilemap (optional) -Coorda: MACRO - validateCoords \1, \2 +hlowcoord EQUS "owcoord hl," +bcowcoord EQUS "owcoord bc," +deowcoord EQUS "owcoord de," + +owcoord: MACRO +; register, x, y, map width + ld \1, wOverworldMap + ((\2) + 3) + (((\3) + 3) * ((\4) + (3 * 2))) +ENDM + +dwcoord: MACRO +; x, y + validate_coords \1, \2 IF _NARG >= 3 - ld [\3 + SCREEN_WIDTH * \2 + \1], a + dw (\2) * SCREEN_WIDTH + (\1) + \3 ELSE - ld [wTileMap + SCREEN_WIDTH * \2 + \1], a + dw (\2) * SCREEN_WIDTH + (\1) + wTileMap ENDC ENDM -;\1 = X -;\2 = Y -;\3 = which tilemap (optional) -dwCoord: MACRO - validateCoords \1, \2 +ldcoord_a: MACRO +; x, y[, origin] + validate_coords \1, \2 IF _NARG >= 3 - dw \3 + SCREEN_WIDTH * \2 + \1 + ld [(\2) * SCREEN_WIDTH + (\1) + \3], a ELSE - dw wTileMap + SCREEN_WIDTH * \2 + \1 + ld [(\2) * SCREEN_WIDTH + (\1) + wTileMap], a ENDC ENDM -;\1 = r -;\2 = X -;\3 = Y -;\4 = map width -overworldMapCoord: MACRO - ld \1, wOverworldMap + ((\2) + 3) + (((\3) + 3) * ((\4) + (3 * 2))) +lda_coord: MACRO +; x, y[, origin] + validate_coords \1, \2 + IF _NARG >= 3 + ld a, [(\2) * SCREEN_WIDTH + (\1) + \3] + ELSE + ld a, [(\2) * SCREEN_WIDTH + (\1) + wTileMap] + ENDC ENDM diff --git a/macros/data.asm b/macros/data.asm index 7a813529..16742d53 100755 --- a/macros/data.asm +++ b/macros/data.asm @@ -33,7 +33,7 @@ _tms3 = _tms3 | (1 << ((\1_TMNUM) - 1 - 48)) else fail "\1 is not a TM or HM move" ENDC - shift + SHIFT ENDR REPT 3 ; TM01-TM24 (24/24) db _tms1 & $ff diff --git a/macros/gfx.asm b/macros/gfx.asm index 950daee1..8803dad2 100644 --- a/macros/gfx.asm +++ b/macros/gfx.asm @@ -1,7 +1,7 @@ RGB: MACRO REPT _NARG / 3 dw palred (\1) + palgreen (\2) + palblue (\3) - shift 3 + SHIFT 3 ENDR ENDM diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm index 9e84ec62..8087c5c2 100755 --- a/macros/scripts/events.asm +++ b/macros/scripts/events.asm @@ -185,7 +185,7 @@ SetEvents: MACRO SetEvent \1 REPT _NARG - 1 SetEventReuseHL \2 - shift + SHIFT ENDR ENDM @@ -237,7 +237,7 @@ ResetEvents: MACRO ResetEvent \1 REPT _NARG - 1 ResetEventReuseHL \2 - shift + SHIFT ENDR ENDM diff --git a/macros/scripts/text.asm b/macros/scripts/text.asm index efecdd1c..261ab5f4 100755 --- a/macros/scripts/text.asm +++ b/macros/scripts/text.asm @@ -200,7 +200,7 @@ script_mart: MACRO db _NARG ; number of items REPT _NARG db \1 ; item id - shift + SHIFT ENDR db -1 ; end ENDM diff --git a/scripts/BikeShop.asm b/scripts/BikeShop.asm index 8ff581a3..7b290f31 100755 --- a/scripts/BikeShop.asm +++ b/scripts/BikeShop.asm @@ -49,15 +49,15 @@ BikeShopText1: ld [wTopMenuItemX], a ld hl, wd730 set 6, [hl] - coord hl, 0, 0 + hlcoord 0, 0 ld b, $4 ld c, $f call TextBoxBorder call UpdateSprites - coord hl, 2, 2 + hlcoord 2, 2 ld de, BikeShopMenuText call PlaceString - coord hl, 8, 3 + hlcoord 8, 3 ld de, BikeShopMenuPrice call PlaceString ld hl, BikeShopText_1d815 diff --git a/scripts/CeladonMartRoof.asm b/scripts/CeladonMartRoof.asm index e880211b..b1f6a8a3 100755 --- a/scripts/CeladonMartRoof.asm +++ b/scripts/CeladonMartRoof.asm @@ -64,7 +64,7 @@ CeladonMartRoofScript_GiveDrinkToGirl: dec l ld b, l ld c, 12 - coord hl, 0, 0 + hlcoord 0, 0 call TextBoxBorder call UpdateSprites call CeladonMartRoofScript_PrintDrinksInBag @@ -194,7 +194,7 @@ CeladonMartRoofScript_PrintDrinksInBag: push hl ld [wd11e], a call GetItemName - coord hl, 2, 2 + hlcoord 2, 2 ldh a, [hItemCounter] ld bc, SCREEN_WIDTH * 2 call AddNTimes diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm index d5f43e6b..ded5854f 100755 --- a/scripts/GameCorner.asm +++ b/scripts/GameCorner.asm @@ -474,32 +474,32 @@ CeladonGameCornerText_48f19: CeladonGameCornerScript_48f1e: ld hl, wd730 set 6, [hl] - coord hl, 11, 0 + hlcoord 11, 0 ld b, $5 ld c, $7 call TextBoxBorder call UpdateSprites - coord hl, 12, 1 + hlcoord 12, 1 ld b, 4 ld c, 7 call ClearScreenArea - coord hl, 12, 2 + hlcoord 12, 2 ld de, GameCornerMoneyText call PlaceString - coord hl, 12, 3 + hlcoord 12, 3 ld de, GameCornerBlankText1 call PlaceString - coord hl, 12, 3 + hlcoord 12, 3 ld de, wPlayerMoney ld c, $a3 call PrintBCDNumber - coord hl, 12, 4 + hlcoord 12, 4 ld de, GameCornerCoinText call PlaceString - coord hl, 12, 5 + hlcoord 12, 5 ld de, GameCornerBlankText2 call PlaceString - coord hl, 15, 5 + hlcoord 15, 5 ld de, wPlayerCoins ld c, $82 call PrintBCDNumber diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm index 5af5e5a2..9dc4b2b9 100755 --- a/scripts/VermilionDock.asm +++ b/scripts/VermilionDock.asm @@ -52,7 +52,7 @@ VermilionDock_1db9b: call DelayFrames ld b, $9c call CopyScreenTileBufferToVRAM - coord hl, 0, 10 + hlcoord 0, 10 ld bc, SCREEN_WIDTH * 6 ld a, $14 ; water tile call FillMemory @@ -184,7 +184,7 @@ VermilionDock_EraseSSAnne: ld bc, (5 * BG_MAP_WIDTH) + SCREEN_WIDTH ld a, $14 ; water tile call FillMemory - ld hl, vBGMap0 + 10 * BG_MAP_WIDTH + hlbgcoord 0, 10 ld de, wVermilionDockTileMapBuffer ld bc, (6 * BG_MAP_WIDTH) / 16 call CopyVideoData @@ -194,7 +194,7 @@ VermilionDock_EraseSSAnne: ; the blocks is unnecessary because the blocks the ship occupies are south of ; the player and won't be redrawn when the player automatically walks north and ; exits the map. This code could be removed without affecting anything. - overworldMapCoord hl, 5, 2, VERMILION_DOCK_WIDTH + hlowcoord 5, 2, VERMILION_DOCK_WIDTH ld a, $d ; water block ld [hli], a ld [hli], a -- cgit v1.3.1-sl0p From 4a7d1513f3135a3c926233d47921b21bf8b1fab4 Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 7 Jul 2020 15:09:54 -0400 Subject: Use 'tile' and 'tiles' macros --- data/icon_pointers.asm | 175 +++++------------------- engine/battle/animations.asm | 3 +- engine/battle/battle_transitions.asm | 8 +- engine/battle/core.asm | 8 +- engine/battle/draw_hud_pokeball_gfx.asm | 2 +- engine/events/diploma.asm | 2 +- engine/events/hidden_objects/museum_fossils.asm | 2 +- engine/gfx/load_pokedex_tiles.asm | 6 +- engine/gfx/mon_icons.asm | 4 +- engine/items/town_map.asm | 12 +- engine/link/cable_club.asm | 2 +- engine/menus/naming_screen.asm | 2 +- engine/menus/start_sub_menus.asm | 34 ++--- engine/movie/credits.asm | 14 +- engine/movie/gamefreak.asm | 14 +- engine/movie/title.asm | 18 +-- engine/movie/trade.asm | 4 +- engine/overworld/cut.asm | 24 ++-- engine/overworld/dust_smoke.asm | 6 +- engine/overworld/emotion_bubbles.asm | 4 +- engine/overworld/healing_machine.asm | 4 +- engine/overworld/ledges.asm | 2 +- engine/overworld/map_sprites.asm | 8 +- engine/overworld/player_animations.asm | 36 +++-- engine/pokemon/bills_pc.asm | 4 +- engine/pokemon/status_screen.asm | 24 ++-- engine/slots/slot_machine.asm | 9 +- home.asm | 8 +- home/vcopy.asm | 4 +- scripts/RocketHideoutB2F.asm | 48 +++---- 30 files changed, 188 insertions(+), 303 deletions(-) (limited to 'scripts') diff --git a/data/icon_pointers.asm b/data/icon_pointers.asm index b615798e..585a0a29 100644 --- a/data/icon_pointers.asm +++ b/data/icon_pointers.asm @@ -1,140 +1,37 @@ -MonPartySpritePointers: - dw SlowbroSprite + $c0 - db $40 / $10 ; 40 bytes - db BANK(SlowbroSprite) - dw vSprites - - dw BallSprite - db $80 / $10 ; $80 bytes - db BANK(BallSprite) - dw vSprites + $40 - - dw ClefairySprite + $c0 - db $40 / $10 ; $40 bytes - db BANK(ClefairySprite) - dw vSprites + $c0 - - dw BirdSprite + $c0 - db $40 / $10 ; $40 bytes - db BANK(BirdSprite) - dw vSprites + $100 - - dw SeelSprite - db $40 / $10 ; $40 bytes - db BANK(SeelSprite) - dw vSprites + $140 - - dw BugIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame2) - dw vSprites + $180 - - dw BugIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame2) - dw vSprites + $1a0 - - dw PlantIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame2) - dw vSprites + $1c0 - - dw PlantIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame2) - dw vSprites + $1e0 - - dw SnakeIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame1) - dw vSprites + $200 - - dw SnakeIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame1) - dw vSprites + $220 - - dw QuadrupedIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame1) - dw vSprites + $240 - - dw QuadrupedIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame1) - dw vSprites + $260 - - dw TradeBubbleIconGFX - db $40 / $10 ; $40 bytes - db BANK(TradeBubbleIconGFX) - dw vSprites + $380 +mon_icon_header: MACRO + dw \1 tile \2 + db \3 + db BANK(\1) + dw vSprites tile \4 +ENDM - dw SlowbroSprite - db $40 / $10 ; $40 bytes - db BANK(SlowbroSprite) - dw vSprites + $400 - - dw BallSprite - db $80 / $10 ; $80 bytes - db BANK(BallSprite) - dw vSprites + $440 - - dw ClefairySprite - db $40 / $10 ; $40 bytes - db BANK(ClefairySprite) - dw vSprites + $4c0 - - dw BirdSprite - db $40 / $10 ; $40 bytes - db BANK(BirdSprite) - dw vSprites + $500 - - dw SeelSprite + $C0 - db $40 / $10 ; $40 bytes - db BANK(SeelSprite) - dw vSprites + $540 - - dw BugIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame1) - dw vSprites + $580 - - dw BugIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(BugIconFrame1) - dw vSprites + $5a0 - - dw PlantIconFrame1 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame1) - dw vSprites + $5c0 - - dw PlantIconFrame1 + $10 - db $10 / $10 ; $10 bytes - db BANK(PlantIconFrame1) - dw vSprites + $5E0 - - dw SnakeIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame2) - dw vSprites + $600 - - dw SnakeIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(SnakeIconFrame2) - dw vSprites + $620 - - dw QuadrupedIconFrame2 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame2) - dw vSprites + $640 - - dw QuadrupedIconFrame2 + $10 - db $10 / $10 ; $10 bytes - db BANK(QuadrupedIconFrame2) - dw vSprites + $660 - - dw TradeBubbleIconGFX + $40 - db $40 / $10 ; $40 bytes - db BANK(TradeBubbleIconGFX) - dw vSprites + $780 +MonPartySpritePointers: +; gfx pointer, gfx tile offset, # tiles, vSprites tile offset + mon_icon_header SlowbroSprite, 12, 4, $00 + mon_icon_header BallSprite, 0, 8, $04 + mon_icon_header ClefairySprite, 12, 4, $0c + mon_icon_header BirdSprite, 12, 4, $10 + mon_icon_header SeelSprite, 0, 4, $14 + mon_icon_header BugIconFrame2, 0, 1, $18 + mon_icon_header BugIconFrame2, 1, 1, $1a + mon_icon_header PlantIconFrame2, 0, 1, $1c + mon_icon_header PlantIconFrame2, 1, 1, $1e + mon_icon_header SnakeIconFrame1, 0, 1, $20 + mon_icon_header SnakeIconFrame1, 1, 1, $22 + mon_icon_header QuadrupedIconFrame1, 0, 1, $24 + mon_icon_header QuadrupedIconFrame1, 1, 1, $26 + mon_icon_header TradeBubbleIconGFX, 0, 4, $38 + mon_icon_header SlowbroSprite, 0, 4, $40 + mon_icon_header BallSprite, 0, 8, $44 + mon_icon_header ClefairySprite, 0, 4, $4c + mon_icon_header BirdSprite, 0, 4, $50 + mon_icon_header SeelSprite, 12, 4, $54 + mon_icon_header BugIconFrame1, 0, 1, $58 + mon_icon_header BugIconFrame1, 1, 1, $5a + mon_icon_header PlantIconFrame1, 0, 1, $5c + mon_icon_header PlantIconFrame1, 1, 1, $5e + mon_icon_header SnakeIconFrame2, 0, 1, $60 + mon_icon_header SnakeIconFrame2, 1, 1, $62 + mon_icon_header QuadrupedIconFrame2, 0, 1, $64 + mon_icon_header QuadrupedIconFrame2, 1, 1, $66 + mon_icon_header TradeBubbleIconGFX, 4, 4, $78 diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 9f7b728a..4e836510 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -341,7 +341,7 @@ LoadAnimationTileset: ld e, a ld a, [hl] ld d, a ; de = address of tileset - ld hl, vSprites + $310 + ld hl, vSprites tile $31 ld b, BANK(AnimationTileset1) ; ROM bank ld a, [wTempTilesetNumTiles] ld c, a ; number of tiles @@ -373,6 +373,7 @@ ENDC IF DEF(_BLUE) INCBIN "gfx/slots/blue_slots_2.2bpp" ENDC +SlotMachineTiles2End: MoveAnimation: push hl diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index e563855d..34b3fbdb 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -154,14 +154,12 @@ GetBattleTransitionID_IsDungeonMap: INCLUDE "data/maps/dungeon_maps.asm" LoadBattleTransitionTile: - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f ld de, BattleTransitionTile - lb bc, BANK(BattleTransitionTile), (BattleTransitionTileEnd - BattleTransitionTile) / $10 + lb bc, BANK(BattleTransitionTile), 1 jp CopyVideoData -BattleTransitionTile: - INCBIN "gfx/overworld/battle_transition.2bpp" -BattleTransitionTileEnd: +BattleTransitionTile: INCBIN "gfx/overworld/battle_transition.2bpp" BattleTransition_BlackScreen: ld a, $ff diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 859f30d5..5cf8a45d 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6610,22 +6610,22 @@ LoadHudTilePatterns: jr c, .lcdEnabled .lcdDisabled ld hl, BattleHudTiles1 - ld de, vChars2 + $6d0 + ld de, vChars2 tile $6d ld bc, BattleHudTiles1End - BattleHudTiles1 ld a, BANK(BattleHudTiles1) call FarCopyDataDouble ld hl, BattleHudTiles2 - ld de, vChars2 + $730 + ld de, vChars2 tile $73 ld bc, BattleHudTiles3End - BattleHudTiles2 ld a, BANK(BattleHudTiles2) jp FarCopyDataDouble .lcdEnabled ld de, BattleHudTiles1 - ld hl, vChars2 + $6d0 + ld hl, vChars2 tile $6d lb bc, BANK(BattleHudTiles1), (BattleHudTiles1End - BattleHudTiles1) / $8 call CopyVideoDataDouble ld de, BattleHudTiles2 - ld hl, vChars2 + $730 + ld hl, vChars2 tile $73 lb bc, BANK(BattleHudTiles2), (BattleHudTiles3End - BattleHudTiles2) / $8 jp CopyVideoDataDouble diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index 8cd9528d..097a0fcc 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -12,7 +12,7 @@ DrawEnemyPokeballs: LoadPartyPokeballGfx: ld de, PokeballTileGraphics - ld hl, vSprites + $310 + ld hl, vSprites tile $31 lb bc, BANK(PokeballTileGraphics), (PokeballTileGraphicsEnd - PokeballTileGraphics) / $10 jp CopyVideoData diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index 3248e152..c282b49b 100755 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -10,7 +10,7 @@ DisplayDiploma:: set 6, [hl] call DisableLCD ld hl, CircleTile - ld de, vChars2 + CIRCLE_TILE_ID * $10 + ld de, vChars2 tile CIRCLE_TILE_ID ld bc, $10 ld a, BANK(CircleTile) call FarCopyData2 diff --git a/engine/events/hidden_objects/museum_fossils.asm b/engine/events/hidden_objects/museum_fossils.asm index 5d7e08fd..27714981 100644 --- a/engine/events/hidden_objects/museum_fossils.asm +++ b/engine/events/hidden_objects/museum_fossils.asm @@ -38,7 +38,7 @@ DisplayMonFrontSpriteInBox: ld a, [wcf91] ld [wd0b5], a call GetMonHeader - ld de, vChars1 + $310 + ld de, vChars1 tile $31 call LoadMonFrontSprite ld a, $80 ldh [hStartTileID], a diff --git a/engine/gfx/load_pokedex_tiles.asm b/engine/gfx/load_pokedex_tiles.asm index 70bcf04d..a3f69171 100755 --- a/engine/gfx/load_pokedex_tiles.asm +++ b/engine/gfx/load_pokedex_tiles.asm @@ -2,10 +2,10 @@ LoadPokedexTilePatterns: call LoadHpBarAndStatusTilePatterns ld de, PokedexTileGraphics - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / $10 call CopyVideoData ld de, PokeballTileGraphics - ld hl, vChars2 + $720 - lb bc, BANK(PokeballTileGraphics), $01 + ld hl, vChars2 tile $72 + lb bc, BANK(PokeballTileGraphics), 1 jp CopyVideoData ; load pokeball tile for marking caught mons diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm index 253fca35..8dd6fe75 100755 --- a/engine/gfx/mon_icons.asm +++ b/engine/gfx/mon_icons.asm @@ -201,11 +201,11 @@ UnusedPartyMonSpriteFunction: ld a, [wcf91] call GetPartyMonSpriteID push af - ld hl, vSprites + ld hl, vSprites tile $00 call .LoadTilePatterns pop af add $54 - ld hl, vSprites + $40 + ld hl, vSprites tile $04 call .LoadTilePatterns xor a ld [wMonPartySpriteSpecies], a diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index db066268..83ea81bf 100755 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -18,7 +18,7 @@ DisplayTownMap: ld de, wTileMapBackup ld bc, $10 call CopyData - ld hl, vSprites + $40 + ld hl, vSprites tile $04 ld de, TownMapCursor lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / $8 call CopyVideoDataDouble @@ -140,11 +140,11 @@ LoadTownMap_Fly:: call LoadPlayerSpriteGraphics call LoadFontTilePatterns ld de, BirdSprite - ld hl, vSprites + $40 - lb bc, BANK(BirdSprite), $c + ld hl, vSprites tile $04 + lb bc, BANK(BirdSprite), 12 call CopyVideoData ld de, TownMapUpArrow - ld hl, vChars1 + $6d0 + ld hl, vChars1 tile $6d lb bc, BANK(TownMapUpArrow), (TownMapUpArrowEnd - TownMapUpArrow) / $8 call CopyVideoDataDouble call BuildFlyLocationsList @@ -284,12 +284,12 @@ LoadTownMap: call TextBoxBorder call DisableLCD ld hl, WorldMapTileGraphics - ld de, vChars2 + $600 + ld de, vChars2 tile $60 ld bc, WorldMapTileGraphicsEnd - WorldMapTileGraphics ld a, BANK(WorldMapTileGraphics) call FarCopyData2 ld hl, MonNestIcon - ld de, vSprites + $40 + ld de, vSprites tile $04 ld bc, MonNestIconEnd - MonNestIcon ld a, BANK(MonNestIcon) call FarCopyDataDouble diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index 42d06846..67c0e471 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -972,6 +972,6 @@ CableClub_DrawHorizontalLine: LoadTrainerInfoTextBoxTiles: ld de, TrainerInfoTextBoxTileGraphics - ld hl, vChars2 + $760 + ld hl, vChars2 tile $76 lb bc, BANK(TrainerInfoTextBoxTileGraphics), (TrainerInfoTextBoxTileGraphicsEnd - TrainerInfoTextBoxTileGraphics) / $10 jp CopyVideoData diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index a16c9501..8ca2ec9b 100755 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -325,7 +325,7 @@ DisplayNamingScreen: LoadEDTile: ld de, ED_Tile - ld hl, vFont + $700 + ld hl, vFont tile $70 ld bc, (ED_TileEnd - ED_Tile) / $8 ; to fix the graphical bug on poor emulators ;lb bc, BANK(ED_Tile), (ED_TileEnd - ED_Tile) / $8 diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 8f1a2d61..a845592f 100755 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -485,39 +485,39 @@ DrawTrainerInfo: call TrainerInfo_DrawVerticalLine hlcoord 1, 2 call TrainerInfo_DrawVerticalLine - ld hl, vChars2 + $70 - ld de, vChars2 - ld bc, $70 * 4 + ld hl, vChars2 tile $07 + ld de, vChars2 tile $00 + ld bc, $1c tiles call CopyData ld hl, TrainerInfoTextBoxTileGraphics ; trainer info text box tile patterns - ld de, vChars2 + $770 - ld bc, $80 + ld de, vChars2 tile $77 + ld bc, 8 tiles push bc call TrainerInfo_FarCopyData ld hl, BlankLeaderNames - ld de, vChars2 + $600 - ld bc, $170 + ld de, vChars2 tile $60 + ld bc, $17 tiles call TrainerInfo_FarCopyData pop bc ld hl, BadgeNumbersTileGraphics ; badge number tile patterns - ld de, vChars1 + $580 + ld de, vChars1 tile $58 call TrainerInfo_FarCopyData ld hl, GymLeaderFaceAndBadgeTileGraphics ; gym leader face and badge tile patterns - ld de, vChars2 + $200 - ld bc, $400 - ld a, $03 + ld de, vChars2 tile $20 + ld bc, 8 * 8 tiles + ld a, BANK(GymLeaderFaceAndBadgeTileGraphics) call FarCopyData2 ld hl, TextBoxGraphics - ld de, $d0 + ld de, 13 tiles add hl, de ; hl = colon tile pattern - ld de, vChars1 + $560 - ld bc, $10 - ld a, $04 + ld de, vChars1 tile $56 + ld bc, 1 tiles + ld a, BANK(TextBoxGraphics) push bc call FarCopyData2 pop bc - ld hl, TrainerInfoTextBoxTileGraphics + $80 ; background tile pattern - ld de, vChars1 + $570 + ld hl, TrainerInfoTextBoxTileGraphics tile 8 ; background tile pattern + ld de, vChars1 tile $57 call TrainerInfo_FarCopyData call EnableLCD ld hl, wTrainerInfoTextBoxWidthPlus1 diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index ae35a2b7..6fb0598e 100755 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -5,14 +5,14 @@ HallOfFamePC: call DelayFrames call DisableLCD ld hl, vFont - ld bc, $800 / 2 + ld bc, ($80 tiles) / 2 call ZeroMemory - ld hl, vChars2 + $600 - ld bc, $200 / 2 + ld hl, vChars2 tile $60 + ld bc, ($20 tiles) / 2 call ZeroMemory - ld hl, vChars2 + $7e0 - ld bc, $10 - ld a, $ff + ld hl, vChars2 tile $7e + ld bc, 1 tiles + ld a, $ff ; solid black call FillMemory hlcoord 0, 0 call FillFourRowsWithBlack @@ -245,7 +245,7 @@ Credits: call FillMiddleOfScreenWithWhite pop de ld de, TheEndGfx - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10 call CopyVideoData hlcoord 4, 8 diff --git a/engine/movie/gamefreak.asm b/engine/movie/gamefreak.asm index d3b5eb88..1463eb4f 100755 --- a/engine/movie/gamefreak.asm +++ b/engine/movie/gamefreak.asm @@ -3,16 +3,16 @@ LoadShootingStarGraphics: ldh [rOBP0], a ld a, $a4 ldh [rOBP1], a - ld de, AnimationTileset2 + $30 ; star tile (top left quadrant) - ld hl, vChars1 + $200 - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 3 ; star tile (top left quadrant) + ld hl, vChars1 tile $20 + lb bc, BANK(AnimationTileset2), 1 call CopyVideoData - ld de, AnimationTileset2 + $130 ; star tile (bottom left quadrant) - ld hl, vChars1 + $210 - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 19 ; star tile (bottom left quadrant) + ld hl, vChars1 tile $21 + lb bc, BANK(AnimationTileset2), 1 call CopyVideoData ld de, FallingStar - ld hl, vChars1 + $220 + ld hl, vChars1 tile $22 lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10 call CopyVideoData ld hl, GameFreakLogoOAMData diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 69838afb..bdb24d6a 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -36,27 +36,27 @@ DisplayTitleScreen: call DisableLCD call LoadFontTilePatterns ld hl, NintendoCopyrightLogoGraphics - ld de, vTitleLogo2 + $100 - ld bc, $50 + ld de, vTitleLogo2 tile 16 + ld bc, 5 tiles ld a, BANK(NintendoCopyrightLogoGraphics) call FarCopyData2 ld hl, GamefreakLogoGraphics - ld de, vTitleLogo2 + $100 + $50 - ld bc, $90 + ld de, vTitleLogo2 tile (16 + 5) + ld bc, 9 tiles ld a, BANK(GamefreakLogoGraphics) call FarCopyData2 ld hl, PokemonLogoGraphics ld de, vTitleLogo - ld bc, $600 + ld bc, $60 tiles ld a, BANK(PokemonLogoGraphics) call FarCopyData2 ; first chunk - ld hl, PokemonLogoGraphics+$600 + ld hl, PokemonLogoGraphics tile $60 ld de, vTitleLogo2 - ld bc, $100 + ld bc, $10 tiles ld a, BANK(PokemonLogoGraphics) call FarCopyData2 ; second chunk ld hl, Version_GFX - ld de, vChars2 + $600 - (Version_GFXEnd - Version_GFX - $50) + ld de, vChars2 tile $60 + (10 tiles - (Version_GFXEnd - Version_GFX) * 2) / 2 ld bc, Version_GFXEnd - Version_GFX ld a, BANK(Version_GFX) call FarCopyDataDouble @@ -369,7 +369,7 @@ LoadCopyrightAndTextBoxTiles: LoadCopyrightTiles: ld de, NintendoCopyrightLogoGraphics - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(NintendoCopyrightLogoGraphics), (GamefreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10 call CopyVideoData hlcoord 2, 7 diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index 3883c362..fc2da9bd 100755 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -157,12 +157,12 @@ LoadTradingGFXAndMonNames: call Trade_ClearTileMap call DisableLCD ld hl, TradingAnimationGraphics - ld de, vChars2 + $310 + ld de, vChars2 tile $31 ld bc, TradingAnimationGraphicsEnd - TradingAnimationGraphics ld a, BANK(TradingAnimationGraphics) call FarCopyData2 ld hl, TradingAnimationGraphics2 - ld de, vSprites + $7c0 + ld de, vSprites tile $7c ld bc, TradingAnimationGraphics2End - TradingAnimationGraphics2 ld a, BANK(TradingAnimationGraphics2) call FarCopyData2 diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 97842079..07039e03 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -80,23 +80,23 @@ InitCutAnimOAM: cp $52 jr z, .grass ; tree - ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row - ld hl, vChars1 + $7c0 - lb bc, BANK(Overworld_GFX), $02 + ld de, Overworld_GFX tile $2d ; cuttable tree sprite top row + ld hl, vChars1 tile $7c + lb bc, BANK(Overworld_GFX), 2 call CopyVideoData - ld de, Overworld_GFX + $3d0 ; cuttable tree sprite bottom row - ld hl, vChars1 + $7e0 - lb bc, BANK(Overworld_GFX), $02 + ld de, Overworld_GFX tile $3d ; cuttable tree sprite bottom row + ld hl, vChars1 tile $7e + lb bc, BANK(Overworld_GFX), 2 call CopyVideoData jr WriteCutOrBoulderDustAnimationOAMBlock .grass - ld hl, vChars1 + $7c0 + ld hl, vChars1 tile $7c call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7d0 + ld hl, vChars1 tile $7d call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7e0 + ld hl, vChars1 tile $7e call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f call LoadCutGrassAnimationTilePattern call WriteCutOrBoulderDustAnimationOAMBlock ld hl, wOAMBuffer + $93 @@ -112,8 +112,8 @@ InitCutAnimOAM: ret LoadCutGrassAnimationTilePattern: - ld de, AnimationTileset2 + $60 ; tile depicting a leaf - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 6 ; tile depicting a leaf + lb bc, BANK(AnimationTileset2), 1 jp CopyVideoData WriteCutOrBoulderDustAnimationOAMBlock: diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm index 09a71a18..a20a0591 100755 --- a/engine/overworld/dust_smoke.asm +++ b/engine/overworld/dust_smoke.asm @@ -69,14 +69,14 @@ MoveBoulderDustFunctionPointerTable: dw AdjustOAMBlockXPos LoadSmokeTileFourTimes:: - ld hl, vChars1 + $7c0 - ld c, $4 + ld hl, vChars1 tile $7c + ld c, 4 .loop push bc push hl call LoadSmokeTile pop hl - ld bc, $10 + ld bc, 1 tiles add hl, bc pop bc dec c diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index 1ac07b80..298858a2 100755 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -8,8 +8,8 @@ EmotionBubble: ld e, [hl] inc hl ld d, [hl] - ld hl, vChars1 + $780 - lb bc, BANK(EmotionBubbles), $04 + ld hl, vChars1 tile $78 + lb bc, BANK(EmotionBubbles), 4 call CopyVideoData ld a, [wUpdateSpritesEnabled] push af diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index 062ef7ea..eaa396d0 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -1,7 +1,7 @@ AnimateHealingMachine: ld de, PokeCenterFlashingMonitorAndHealBall - ld hl, vChars0 + $7c0 - lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 ; loads one too many tiles + ld hl, vChars0 tile $7c + lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), 3 ; should be 2 call CopyVideoData ld hl, wUpdateSpritesEnabled ld a, [hl] diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index 254680a5..0e006c5e 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -57,7 +57,7 @@ HandleLedges:: INCLUDE "data/tilesets/ledge_tiles.asm" LoadHoppingShadowOAM: - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f ld de, LedgeHoppingShadow lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8 call CopyVideoDataDouble diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index 4a68169a..8f1f3931 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -130,25 +130,25 @@ LoadMapSpriteTilePatterns: push de push bc ld hl, vNPCSprites ; VRAM base address - ld bc, $c0 ; number of bytes per VRAM slot + ld bc, 12 tiles ; number of bytes per VRAM slot ldh a, [hVRAMSlot] cp 11 ; is it a 4-tile sprite? jr nc, .fourTileSpriteVRAMAddr ld d, a dec d -; hl = vSprites + [hVRAMSlot] * $C0 (the number of bytes in 12 tiles) +; hl = vSprites + [hVRAMSlot] * 12 tiles .calculateVRAMAddrLoop add hl, bc dec d jr nz, .calculateVRAMAddrLoop jr .loadStillTilePattern .fourTileSpriteVRAMAddr - ld hl, vSprites + $7c0 ; address for second 4-tile sprite + ld hl, vSprites tile $7c ; address for second 4-tile sprite ldh a, [hFourTileSpriteCount] and a jr nz, .loadStillTilePattern ; if it's the first 4-tile sprite - ld hl, vSprites + $780 ; address for first 4-tile sprite + ld hl, vSprites tile $78 ; address for first 4-tile sprite inc a ldh [hFourTileSpriteCount], a .loadStillTilePattern diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index 69c1eefc..9e9b4073 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -250,11 +250,11 @@ DoFlyAnimation: LoadBirdSpriteGraphics: ld de, BirdSprite ld hl, vNPCSprites - lb bc, BANK(BirdSprite), $0c + lb bc, BANK(BirdSprite), 12 call CopyVideoData - ld de, BirdSprite + $c0 ; moving animation sprite + ld de, BirdSprite tile 12 ; moving animation sprite ld hl, vNPCSprites2 - lb bc, BANK(BirdSprite), $0c + lb bc, BANK(BirdSprite), 12 jp CopyVideoData InitFacingDirectionList: @@ -381,8 +381,8 @@ FishingAnim: ld hl, wd736 set 6, [hl] ; reserve the last 4 OAM entries ld de, RedSprite - ld hl, vNPCSprites - lb bc, BANK(RedSprite), $c + ld hl, vNPCSprites tile $00 + lb bc, BANK(RedSprite), 12 call CopyVideoData ld a, $4 ld hl, RedFishingTiles @@ -479,22 +479,18 @@ FishingRodOAM: db $50, $40, $FE, $00 ; player facing left db $50, $58, $FE, $20 ; player facing right ($20 means "horizontally flip the tile") -RedFishingTiles: - dw RedFishingTilesFront - db 2, BANK(RedFishingTilesFront) - dw vNPCSprites + $20 +fishing_gfx: MACRO + dw \1 + db \2 + db BANK(\1) + dw vNPCSprites tile \3 +ENDM - dw RedFishingTilesBack - db 2, BANK(RedFishingTilesBack) - dw vNPCSprites + $60 - - dw RedFishingTilesSide - db 2, BANK(RedFishingTilesSide) - dw vNPCSprites + $a0 - - dw RedFishingRodTiles - db 3, BANK(RedFishingRodTiles) - dw vNPCSprites2 + $7d0 +RedFishingTiles: + fishing_gfx RedFishingTilesFront, 2, $02 + fishing_gfx RedFishingTilesBack, 2, $06 + fishing_gfx RedFishingTilesSide, 2, $0a + fishing_gfx RedFishingRodTiles, 3, $fd _HandleMidJump:: ld a, [wPlayerJumpingYScreenCoordsIndex] diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 0b514111..df02a496 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -114,9 +114,9 @@ BillsPC_:: BillsPCMenu: ld a, [wParentMenuItem] ld [wCurrentMenuItem], a - ld hl, vChars2 + $780 + ld hl, vChars2 tile $78 ld de, PokeballTileGraphics - lb bc, BANK(PokeballTileGraphics), $01 + lb bc, BANK(PokeballTileGraphics), 1 call CopyVideoData call LoadScreenTilesFromBuffer2DisableBGTransfer hlcoord 0, 0 diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index 83d33fe5..d4a4e59a 100755 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -86,21 +86,21 @@ StatusScreen: call UpdateSprites call LoadHpBarAndStatusTilePatterns ld de, BattleHudTiles1 ; source - ld hl, vChars2 + $6d0 ; dest - lb bc, BANK(BattleHudTiles1), $03 + ld hl, vChars2 tile $6d ; dest + lb bc, BANK(BattleHudTiles1), 3 call CopyVideoDataDouble ; ·│ :L and halfarrow line end ld de, BattleHudTiles2 - ld hl, vChars2 + $780 - lb bc, BANK(BattleHudTiles2), $01 + ld hl, vChars2 tile $78 + lb bc, BANK(BattleHudTiles2), 1 call CopyVideoDataDouble ; │ ld de, BattleHudTiles3 - ld hl, vChars2 + $760 - lb bc, BANK(BattleHudTiles3), $02 - call CopyVideoDataDouble ; ─┘ + ld hl, vChars2 tile $76 + lb bc, BANK(BattleHudTiles3), 2 + call CopyVideoDataDouble ; ─ ┘ ld de, PTile - ld hl, vChars2 + $720 - lb bc, BANK(PTile), (PTileEnd - PTile) / $8 - call CopyVideoDataDouble ; P (for PP), inline + ld hl, vChars2 tile $72 + lb bc, BANK(PTile), 1 + call CopyVideoDataDouble ; bold P (for PP) ldh a, [hTilesetType] push af xor a @@ -244,9 +244,7 @@ DrawLineBox: ld [hl], $6f ; ← (halfarrow ending) ret -PTile: - INCBIN "gfx/font/P.1bpp" -PTileEnd: +PTile: INCBIN "gfx/font/P.1bpp" PrintStatsBox: ld a, d diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index a1326240..9af17a81 100755 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -850,17 +850,17 @@ LoadSlotMachineTiles: call DisableLCD ld hl, SlotMachineTiles2 ld de, vChars0 - ld bc, $1c0 + ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineTiles1 ld de, vChars2 - ld bc, $250 + ld bc, SlotMachineTiles1End - SlotMachineTiles1 ld a, BANK(SlotMachineTiles1) call FarCopyData2 ld hl, SlotMachineTiles2 - ld de, vChars2 + $250 - ld bc, $1c0 + ld de, vChars2 tile $25 + ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineMap @@ -890,3 +890,4 @@ ENDC IF DEF(_BLUE) INCBIN "gfx/slots/blue_slots_1.2bpp" ENDC +SlotMachineTiles1End: diff --git a/home.asm b/home.asm index 037a3444..6735e23c 100644 --- a/home.asm +++ b/home.asm @@ -820,13 +820,13 @@ LoadTextBoxTilePatterns:: jr nz, .on .off ld hl, TextBoxGraphics - ld de, vChars2 + $600 + ld de, vChars2 tile $60 ld bc, TextBoxGraphicsEnd - TextBoxGraphics ld a, BANK(TextBoxGraphics) jp FarCopyData2 ; if LCD is off, transfer all at once .on ld de, TextBoxGraphics - ld hl, vChars2 + $600 + ld hl, vChars2 tile $60 lb bc, BANK(TextBoxGraphics), (TextBoxGraphicsEnd - TextBoxGraphics) / $10 jp CopyVideoData ; if LCD is on, transfer during V-blank @@ -836,13 +836,13 @@ LoadHpBarAndStatusTilePatterns:: jr nz, .on .off ld hl, HpBarAndStatusGraphics - ld de, vChars2 + $620 + ld de, vChars2 tile $62 ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics ld a, BANK(HpBarAndStatusGraphics) jp FarCopyData2 ; if LCD is off, transfer all at once .on ld de, HpBarAndStatusGraphics - ld hl, vChars2 + $620 + ld hl, vChars2 tile $62 lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10 jp CopyVideoData ; if LCD is on, transfer during V-blank diff --git a/home/vcopy.asm b/home/vcopy.asm index 1a7863e9..458fa610 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -393,7 +393,7 @@ UpdateMovingBgTiles:: ; water - ld hl, vTileset + $14 * $10 + ld hl, vTileset tile $14 ld c, $10 ld a, [wMovingBGTilesCounter2] @@ -438,7 +438,7 @@ UpdateMovingBgTiles:: jr z, .copy ld hl, FlowerTile3 .copy - ld de, vTileset + $3 * $10 + ld de, vTileset tile $03 ld c, $10 .loop ld a, [hli] diff --git a/scripts/RocketHideoutB2F.asm b/scripts/RocketHideoutB2F.asm index 95d8b0d2..47c0581c 100755 --- a/scripts/RocketHideoutB2F.asm +++ b/scripts/RocketHideoutB2F.asm @@ -367,38 +367,32 @@ LoadSpinnerArrowTiles:: spinner: MACRO ; \1: source ; \2: offset (BANK() chokes on literals) -; \3: length -; \4: dest - dw \1 + \2 - db \3, BANK(\1) - dw \4 +; \3: dest + dw \1 tile \2 + db 1 + db BANK(\1) + dw vTileset tile \3 ENDM FacilitySpinnerArrows: -FACILITY_SPINNER EQU $20 * $10 -vFacilitySpinner EQUS "vTileset + FACILITY_SPINNER" - - spinner SpinnerArrowAnimTiles, $00, 1, vFacilitySpinner - spinner SpinnerArrowAnimTiles, $10, 1, vFacilitySpinner + $10 - spinner SpinnerArrowAnimTiles, $20, 1, vFacilitySpinner + $100 - spinner SpinnerArrowAnimTiles, $30, 1, vFacilitySpinner + $110 - spinner Facility_GFX, FACILITY_SPINNER + $000, 1, vFacilitySpinner - spinner Facility_GFX, FACILITY_SPINNER + $010, 1, vFacilitySpinner + $10 - spinner Facility_GFX, FACILITY_SPINNER + $100, 1, vFacilitySpinner + $100 - spinner Facility_GFX, FACILITY_SPINNER + $110, 1, vFacilitySpinner + $110 + spinner SpinnerArrowAnimTiles, 0, $20 + spinner SpinnerArrowAnimTiles, 1, $21 + spinner SpinnerArrowAnimTiles, 2, $30 + spinner SpinnerArrowAnimTiles, 3, $31 + spinner Facility_GFX, $20, $20 + spinner Facility_GFX, $21, $21 + spinner Facility_GFX, $30, $30 + spinner Facility_GFX, $31, $31 GymSpinnerArrows: -GYM_SPINNER EQU $3c * $10 -vGymSpinner EQUS "vTileset + GYM_SPINNER" - - spinner SpinnerArrowAnimTiles, $10, 1, vGymSpinner - spinner SpinnerArrowAnimTiles, $30, 1, vGymSpinner + $10 - spinner SpinnerArrowAnimTiles, $00, 1, vGymSpinner + $100 - spinner SpinnerArrowAnimTiles, $20, 1, vGymSpinner + $110 - spinner Gym_GFX, GYM_SPINNER + $000, 1, vGymSpinner - spinner Gym_GFX, GYM_SPINNER + $010, 1, vGymSpinner + $10 - spinner Gym_GFX, GYM_SPINNER + $100, 1, vGymSpinner + $100 - spinner Gym_GFX, GYM_SPINNER + $110, 1, vGymSpinner + $110 + spinner SpinnerArrowAnimTiles, 1, $3c + spinner SpinnerArrowAnimTiles, 3, $3d + spinner SpinnerArrowAnimTiles, 0, $4c + spinner SpinnerArrowAnimTiles, 2, $4d + spinner Gym_GFX, $3c, $3c + spinner Gym_GFX, $3d, $3d + spinner Gym_GFX, $4c, $4c + spinner Gym_GFX, $4d, $4d SpinnerPlayerFacingDirections: ; This isn't the order of the facing directions. Rather, it's a list of -- cgit v1.3.1-sl0p