shithub: pokecrystal

Download patch

ref: 7d3ea88611efbc2f9b903063e2816b1cae1bad35
parent: f773fd1dd89782eb1e92b850c7409a8d8be37651
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sat Jan 9 10:16:05 EST 2021

Rename GetFarHalfword to GetFarWord

Fixes #796

--- a/docs/design_flaws.md
+++ b/docs/design_flaws.md
@@ -586,7 +586,7 @@
 +	push af
 +	inc hl
  	ld a, BANK(PokedexDataPointerTable)
- 	call GetFarHalfword
+ 	call GetFarWord
 +	pop de
  
  .SkipText:
@@ -602,7 +602,7 @@
  	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 @@
 +	inc hl
 +	; hl = address
  	ld a, BANK(PokedexDataPointerTable)
- 	call GetFarHalfword
+ 	call GetFarWord
 -	call PokedexShow_GetDexEntryBank
 +	ld a, b
  	push af
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -47,7 +47,7 @@
 	add hl, bc
 	add hl, bc
 	ld a, BANK(MoveEffectsPointers)
-	call GetFarHalfword
+	call GetFarWord
 
 	ld de, wBattleScriptBuffer
 
@@ -98,7 +98,7 @@
 	pop bc
 
 	ld a, BANK(BattleCommandPointers)
-	call GetFarHalfword
+	call GetFarWord
 
 	call .DoMoveEffectCommand
 
@@ -6731,7 +6731,7 @@
 	ld a, ITEMATTR_STRUCT_LENGTH
 	call AddNTimes
 	ld a, BANK(ItemAttributes)
-	call GetFarHalfword
+	call GetFarWord
 	ld b, l
 	ld c, h
 	pop hl
--- a/engine/events/checkforhiddenitems.asm
+++ b/engine/events/checkforhiddenitems.asm
@@ -46,9 +46,9 @@
 	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
--- a/engine/gfx/load_pics.asm
+++ b/engine/gfx/load_pics.asm
@@ -125,7 +125,7 @@
 	push af
 	inc hl
 	ld a, d
-	call GetFarHalfword
+	call GetFarWord
 	pop bc
 	ret
 
@@ -228,7 +228,7 @@
 	push af
 	inc hl
 	ld a, d
-	call GetFarHalfword
+	call GetFarWord
 	ld de, wDecompressScratch
 	pop af
 	call FarDecompress
@@ -301,7 +301,7 @@
 	push af
 	inc hl
 	ld a, BANK(PokemonPicPointers)
-	call GetFarHalfword
+	call GetFarWord
 	pop af
 	pop de
 	call FarDecompress
@@ -332,7 +332,7 @@
 	push af
 	inc hl
 	ld a, BANK(TrainerPicPointers)
-	call GetFarHalfword
+	call GetFarWord
 	pop af
 	ld de, wDecompressScratch
 	call FarDecompress
--- a/engine/gfx/pic_animation.asm
+++ b/engine/gfx/pic_animation.asm
@@ -474,7 +474,7 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	add hl, de
 	add hl, de
 	ld a, [wPokeAnimBitmaskBank]
-	call GetFarHalfword
+	call GetFarWord
 	ld a, l
 	ld [wPokeAnimBitmaskAddr], a
 	ld a, h
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -784,7 +784,7 @@
 	add hl, de
 	add hl, de
 	ld a, BANK(PokedexDataPointerTable)
-	call GetFarHalfword
+	call GetFarWord
 
 .SkipText:
 	call GetPokedexEntryBank
@@ -797,7 +797,7 @@
 	push bc
 	inc hl
 	inc hl
-	call GetFarHalfword
+	call GetFarWord
 
 	srl h
 	rr l
@@ -901,7 +901,7 @@
 	add hl, bc
 	add hl, bc
 	ld a, BANK(EvosAttacksPointers)
-	call GetFarHalfword
+	call GetFarWord
 	pop bc
 
 	push bc
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -422,7 +422,7 @@
 endr
 
 	call GetMapScriptsBank
-	call GetFarHalfword
+	call GetFarWord
 	call GetMapScriptsBank
 	call CallScript
 
@@ -722,7 +722,7 @@
 	inc hl
 	inc hl
 	call GetMapScriptsBank
-	call GetFarHalfword
+	call GetFarWord
 	call GetMapScriptsBank
 	call CallScript
 	scf
@@ -739,7 +739,7 @@
 	ld l, a
 	push hl
 	call GetMapScriptsBank
-	call GetFarHalfword
+	call GetFarWord
 	ld e, l
 	ld d, h
 	ld b, CHECK_FLAG
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -1369,7 +1369,7 @@
 	ld b, a
 	inc hl
 	ld a, BANK(StdScripts)
-	call GetFarHalfword
+	call GetFarWord
 	ret
 
 SkipTwoScriptBytes:
--- a/engine/overworld/wildmons.asm
+++ b/engine/overworld/wildmons.asm
@@ -889,7 +889,7 @@
 	add hl, bc
 	add hl, bc
 	ld a, BANK(TrainerGroups)
-	call GetFarHalfword
+	call GetFarWord
 
 .skip_trainer
 	dec e
--- a/engine/pokedex/pokedex_2.asm
+++ b/engine/pokedex/pokedex_2.asm
@@ -113,7 +113,7 @@
 	ld a, b
 	push af
 	push hl
-	call GetFarHalfword
+	call GetFarWord
 	ld d, l
 	ld e, h
 	pop hl
@@ -143,7 +143,7 @@
 	inc hl
 	push hl
 	dec hl
-	call GetFarHalfword
+	call GetFarWord
 	ld d, l
 	ld e, h
 	ld a, e
--- a/engine/pokegear/radio.asm
+++ b/engine/pokegear/radio.asm
@@ -689,7 +689,7 @@
 	add hl, bc
 	add hl, bc
 	ld a, BANK(PokedexDataPointerTable)
-	call GetFarHalfword
+	call GetFarWord
 	call PokedexShow_GetDexEntryBank
 	push af
 	push hl
--- a/engine/pokemon/breeding.asm
+++ b/engine/pokemon/breeding.asm
@@ -428,7 +428,7 @@
 	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 @@
 	add hl, bc
 	add hl, bc
 	ld a, BANK(EvosAttacksPointers)
-	call GetFarHalfword
+	call GetFarWord
 .loop3
 	ld a, BANK("Evolutions and Attacks")
 	call GetFarByte
--- a/engine/pokemon/move_mon.asm
+++ b/engine/pokemon/move_mon.asm
@@ -1687,7 +1687,7 @@
 	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 @@
 	inc hl
 	inc hl
 	ld a, [wScriptBank]
-	call GetFarHalfword
+	call GetFarWord
 	pop bc
 	ld a, b
 	and a
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -27,7 +27,7 @@
 	ld bc, BASE_DATA_SIZE
 	call AddNTimes
 	ld a, BANK(BaseData)
-	call GetFarHalfword
+	call GetFarWord
 	ld b, l
 	ld c, h
 	pop hl
--- a/home/copy.asm
+++ b/home/copy.asm
@@ -72,8 +72,8 @@
 	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 @@
 	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
--- a/home/text.asm
+++ b/home/text.asm
@@ -1008,7 +1008,7 @@
 	add hl, de
 	add hl, de
 	ld a, BANK(StringBufferPointers)
-	call GetFarHalfword
+	call GetFarWord
 	ld d, h
 	ld e, l
 	ld h, b
--- a/home/trainers.asm
+++ b/home/trainers.asm
@@ -116,7 +116,7 @@
 	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 @@
 	ld h, [hl]
 	ld l, a
 	call GetMapScriptsBank
-	call GetFarHalfword
+	call GetFarWord
 	ld d, h
 	ld e, l
 	push de
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -117,7 +117,7 @@
 	add hl, de
 	add hl, de
 	ld a, [wcd22]
-	call GetFarHalfword
+	call GetFarWord
 	ld a, [wcd22]
 	rst FarCall