From 7d3ea88611efbc2f9b903063e2816b1cae1bad35 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 9 Jan 2021 15:16:05 -0500 Subject: [PATCH] Rename GetFarHalfword to GetFarWord Fixes #796 --- docs/design_flaws.md | 6 +++--- engine/battle/effect_commands.asm | 6 +++--- engine/events/checkforhiddenitems.asm | 4 ++-- engine/gfx/load_pics.asm | 8 ++++---- engine/gfx/pic_animation.asm | 10 +++++----- engine/items/item_effects.asm | 6 +++--- engine/overworld/events.asm | 6 +++--- engine/overworld/scripting.asm | 2 +- engine/overworld/wildmons.asm | 2 +- engine/pokedex/pokedex_2.asm | 4 ++-- engine/pokegear/radio.asm | 2 +- engine/pokemon/breeding.asm | 4 ++-- engine/pokemon/move_mon.asm | 4 ++-- home/battle.asm | 2 +- home/copy.asm | 6 +++--- home/text.asm | 2 +- home/trainers.asm | 4 ++-- mobile/mobile_40.asm | 2 +- 18 files changed, 40 insertions(+), 40 deletions(-) diff --git a/docs/design_flaws.md b/docs/design_flaws.md index 620e5b8af..f01385948 100644 --- a/docs/design_flaws.md +++ b/docs/design_flaws.md @@ -586,7 +586,7 @@ Edit [engine/items/item_effects.asm](https://github.com/pret/pokecrystal/blob/ma + push af + inc hl ld a, BANK(PokedexDataPointerTable) - call GetFarHalfword + call GetFarWord + pop de .SkipText: @@ -602,7 +602,7 @@ Edit [engine/items/item_effects.asm](https://github.com/pret/pokecrystal/blob/ma push bc inc hl inc hl - call GetFarHalfword + call GetFarWord ``` And edit [engine/pokegear/radio.asm](https://github.com/pret/pokecrystal/blob/master/engine/pokegear/radio.asm): @@ -624,7 +624,7 @@ And edit [engine/pokegear/radio.asm](https://github.com/pret/pokecrystal/blob/ma + inc hl + ; hl = address ld a, BANK(PokedexDataPointerTable) - call GetFarHalfword + call GetFarWord - call PokedexShow_GetDexEntryBank + ld a, b push af diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 8015eab4c..e1c3ac364 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -47,7 +47,7 @@ DoMove: add hl, bc add hl, bc ld a, BANK(MoveEffectsPointers) - call GetFarHalfword + call GetFarWord ld de, wBattleScriptBuffer @@ -98,7 +98,7 @@ DoMove: pop bc ld a, BANK(BattleCommandPointers) - call GetFarHalfword + call GetFarWord call .DoMoveEffectCommand @@ -6731,7 +6731,7 @@ GetItemHeldEffect: ld a, ITEMATTR_STRUCT_LENGTH call AddNTimes ld a, BANK(ItemAttributes) - call GetFarHalfword + call GetFarWord ld b, l ld c, h pop hl diff --git a/engine/events/checkforhiddenitems.asm b/engine/events/checkforhiddenitems.asm index 0e0e282c9..4eafef5ba 100644 --- a/engine/events/checkforhiddenitems.asm +++ b/engine/events/checkforhiddenitems.asm @@ -46,9 +46,9 @@ CheckForHiddenItems: jr nz, .next ; Has this item already been found? If not, set off the Itemfinder. ld a, [wCurMapScriptBank] - call GetFarHalfword + call GetFarWord ld a, [wCurMapScriptBank] - call GetFarHalfword + call GetFarWord ld d, h ld e, l ld b, CHECK_FLAG diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm index 98dbdc17b..9b540d86b 100644 --- a/engine/gfx/load_pics.asm +++ b/engine/gfx/load_pics.asm @@ -125,7 +125,7 @@ GetFrontpicPointer: push af inc hl ld a, d - call GetFarHalfword + call GetFarWord pop bc ret @@ -228,7 +228,7 @@ GetMonBackpic: push af inc hl ld a, d - call GetFarHalfword + call GetFarWord ld de, wDecompressScratch pop af call FarDecompress @@ -301,7 +301,7 @@ GSIntro_GetMonFrontpic: ; unreferenced push af inc hl ld a, BANK(PokemonPicPointers) - call GetFarHalfword + call GetFarWord pop af pop de call FarDecompress @@ -332,7 +332,7 @@ GetTrainerPic: push af inc hl ld a, BANK(TrainerPicPointers) - call GetFarHalfword + call GetFarWord pop af ld de, wDecompressScratch call FarDecompress diff --git a/engine/gfx/pic_animation.asm b/engine/gfx/pic_animation.asm index 36faf9b7c..62d9ad6d7 100644 --- a/engine/gfx/pic_animation.asm +++ b/engine/gfx/pic_animation.asm @@ -474,7 +474,7 @@ PokeAnim_GetPointer: add hl, de add hl, de ld a, [wPokeAnimPointerBank] - call GetFarHalfword + call GetFarWord ld a, l ld [wPokeAnimCommand], a ld a, h @@ -496,7 +496,7 @@ PokeAnim_GetBitmaskIndex: add hl, bc add hl, bc ld a, [wPokeAnimFramesBank] - call GetFarHalfword + call GetFarWord ld a, [wPokeAnimFramesBank] call GetFarByte ld [wPokeAnimCurBitmask], a @@ -915,7 +915,7 @@ GetMonAnimPointer: add hl, de ld a, c ld [wPokeAnimPointerBank], a - call GetFarHalfword + call GetFarWord ld a, l ld [wPokeAnimPointerAddr], a ld a, h @@ -982,7 +982,7 @@ GetMonFramesPointer: add hl, de add hl, de ld a, b - call GetFarHalfword + call GetFarWord ld a, l ld [wPokeAnimFramesAddr], a ld a, h @@ -1020,7 +1020,7 @@ GetMonBitmaskPointer: add hl, de add hl, de ld a, [wPokeAnimBitmaskBank] - call GetFarHalfword + call GetFarWord ld a, l ld [wPokeAnimBitmaskAddr], a ld a, h diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index eaff68fc2..d4a969c24 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -784,7 +784,7 @@ HeavyBallMultiplier: add hl, de add hl, de ld a, BANK(PokedexDataPointerTable) - call GetFarHalfword + call GetFarWord .SkipText: call GetPokedexEntryBank @@ -797,7 +797,7 @@ HeavyBallMultiplier: push bc inc hl inc hl - call GetFarHalfword + call GetFarWord srl h rr l @@ -901,7 +901,7 @@ MoonBallMultiplier: add hl, bc add hl, bc ld a, BANK(EvosAttacksPointers) - call GetFarHalfword + call GetFarWord pop bc push bc diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index c0a77ed20..257e75a15 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -422,7 +422,7 @@ rept SCENE_SCRIPT_SIZE endr call GetMapScriptsBank - call GetFarHalfword + call GetFarWord call GetMapScriptsBank call CallScript @@ -722,7 +722,7 @@ TryBGEvent: inc hl inc hl call GetMapScriptsBank - call GetFarHalfword + call GetFarWord call GetMapScriptsBank call CallScript scf @@ -739,7 +739,7 @@ CheckBGEventFlag: ld l, a push hl call GetMapScriptsBank - call GetFarHalfword + call GetFarWord ld e, l ld d, h ld b, CHECK_FLAG diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index ca2306aee..0470247d4 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -1369,7 +1369,7 @@ StdScript: ld b, a inc hl ld a, BANK(StdScripts) - call GetFarHalfword + call GetFarWord ret SkipTwoScriptBytes: diff --git a/engine/overworld/wildmons.asm b/engine/overworld/wildmons.asm index ed103bfc3..33146fbaa 100644 --- a/engine/overworld/wildmons.asm +++ b/engine/overworld/wildmons.asm @@ -889,7 +889,7 @@ RandomPhoneMon: add hl, bc add hl, bc ld a, BANK(TrainerGroups) - call GetFarHalfword + call GetFarWord .skip_trainer dec e diff --git a/engine/pokedex/pokedex_2.asm b/engine/pokedex/pokedex_2.asm index 354ddfaba..808a2fa93 100644 --- a/engine/pokedex/pokedex_2.asm +++ b/engine/pokedex/pokedex_2.asm @@ -113,7 +113,7 @@ DisplayDexEntry: ld a, b push af push hl - call GetFarHalfword + call GetFarWord ld d, l ld e, h pop hl @@ -143,7 +143,7 @@ DisplayDexEntry: inc hl push hl dec hl - call GetFarHalfword + call GetFarWord ld d, l ld e, h ld a, e diff --git a/engine/pokegear/radio.asm b/engine/pokegear/radio.asm index 313f23189..8257ff565 100644 --- a/engine/pokegear/radio.asm +++ b/engine/pokegear/radio.asm @@ -689,7 +689,7 @@ PokedexShow2: add hl, bc add hl, bc ld a, BANK(PokedexDataPointerTable) - call GetFarHalfword + call GetFarWord call PokedexShow_GetDexEntryBank push af push hl diff --git a/engine/pokemon/breeding.asm b/engine/pokemon/breeding.asm index d6ffde4fd..bcf5322e2 100644 --- a/engine/pokemon/breeding.asm +++ b/engine/pokemon/breeding.asm @@ -428,7 +428,7 @@ GetEggMove: add hl, bc add hl, bc ld a, BANK(EggMovePointers) - call GetFarHalfword + call GetFarWord .loop ld a, BANK("Egg Moves") call GetFarByte @@ -462,7 +462,7 @@ GetEggMove: add hl, bc add hl, bc ld a, BANK(EvosAttacksPointers) - call GetFarHalfword + call GetFarWord .loop3 ld a, BANK("Evolutions and Attacks") call GetFarByte diff --git a/engine/pokemon/move_mon.asm b/engine/pokemon/move_mon.asm index fd01ba375..e51bbfe0a 100644 --- a/engine/pokemon/move_mon.asm +++ b/engine/pokemon/move_mon.asm @@ -1687,7 +1687,7 @@ GivePoke:: push bc push hl ld a, [wScriptBank] - call GetFarHalfword + call GetFarWord ld bc, MON_NAME_LENGTH ld a, [wScriptBank] call FarCopyBytes @@ -1695,7 +1695,7 @@ GivePoke:: inc hl inc hl ld a, [wScriptBank] - call GetFarHalfword + call GetFarWord pop bc ld a, b and a diff --git a/home/battle.asm b/home/battle.asm index 0fb077c90..21998983c 100644 --- a/home/battle.asm +++ b/home/battle.asm @@ -27,7 +27,7 @@ GetDexNumber:: ; unreferenced ld bc, BASE_DATA_SIZE call AddNTimes ld a, BANK(BaseData) - call GetFarHalfword + call GetFarWord ld b, l ld c, h pop hl diff --git a/home/copy.asm b/home/copy.asm index 4972045ae..a4ca21f7f 100644 --- a/home/copy.asm +++ b/home/copy.asm @@ -72,8 +72,8 @@ GetFarByte:: ldh a, [hFarByte] ret -GetFarHalfword:: -; retrieve a halfword from a:hl, and return it in hl. +GetFarWord:: +; retrieve a word from a:hl, and return it in hl. ; bankswitch to new bank ldh [hTempBank], a ldh a, [hROMBank] @@ -81,7 +81,7 @@ GetFarHalfword:: ldh a, [hTempBank] rst Bankswitch - ; get halfword from new bank, put it in hl + ; get word from new bank, put it in hl ld a, [hli] ld h, [hl] ld l, a diff --git a/home/text.asm b/home/text.asm index a871a4a82..6b9960df5 100644 --- a/home/text.asm +++ b/home/text.asm @@ -1008,7 +1008,7 @@ TextCommand_STRINGBUFFER:: add hl, de add hl, de ld a, BANK(StringBufferPointers) - call GetFarHalfword + call GetFarWord ld d, h ld e, l ld h, b diff --git a/home/trainers.asm b/home/trainers.asm index 87f82cf0a..ec9ddd3ca 100644 --- a/home/trainers.asm +++ b/home/trainers.asm @@ -116,7 +116,7 @@ LoadTrainer_continue:: ld hl, MAPOBJECT_SCRIPT_POINTER add hl, bc ld a, [wSeenTrainerBank] - call GetFarHalfword + call GetFarWord ld de, wTempTrainer ld bc, wTempTrainerEnd - wTempTrainer ld a, [wSeenTrainerBank] @@ -215,7 +215,7 @@ CheckTrainerFlag:: ; unreferenced ld h, [hl] ld l, a call GetMapScriptsBank - call GetFarHalfword + call GetFarWord ld d, h ld e, l push de diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm index f7b3c698f..38b8aab6c 100644 --- a/mobile/mobile_40.asm +++ b/mobile/mobile_40.asm @@ -117,7 +117,7 @@ Function1000ba: add hl, de add hl, de ld a, [wcd22] - call GetFarHalfword + call GetFarWord ld a, [wcd22] rst FarCall