summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2014-08-07 21:17:44 -0700
committeryenatch <yenatch@gmail.com>2014-08-07 21:17:44 -0700
commit1cf79b6f15761ec95ba1b0f9d6d83781c4240612 (patch)
tree705b9c16082db98d1badd90ad214e433b95f9256
parent8dd46620bc7e17c4c582a391fb95c9e29ef58576 (diff)
Fix static banks passed into GetName.
This appears to be the only other use of wPredefBank. Chances are there are more uncaught banks. Known cases are marked as "hardcoded" or similar.
-rwxr-xr-xengine/battle/4_2.asm2
-rwxr-xr-xengine/battle/core.asm13
-rwxr-xr-xengine/battle/e.asm2
-rwxr-xr-xengine/evos_moves.asm2
-rw-r--r--home.asm8
5 files changed, 15 insertions, 12 deletions
diff --git a/engine/battle/4_2.asm b/engine/battle/4_2.asm
index c5c62796..b53ea6e4 100755
--- a/engine/battle/4_2.asm
+++ b/engine/battle/4_2.asm
@@ -391,7 +391,7 @@ GetTrainerName_: ; 13a58 (4:7a58)
ld [wd0b5], a
ld a, TRAINER_NAME
ld [W_LISTTYPE], a
- ld a, $e
+ ld a, BANK(TrainerNames)
ld [wPredefBank], a
call GetName
ld hl, wcd6d
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index b3495a29..399a8ee7 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -2184,7 +2184,9 @@ asm_3d00e: ; 3d00e (f:500e)
jr Func_3d03c
OldManItemList: ; 3d02d (f:502d)
- db $01, POKE_BALL, 50, $ff
+ db 1 ; # items
+ db POKE_BALL, 50
+ db -1
Func_3d031
ld hl, wNumBagItems ; wNumBagItems
@@ -5471,7 +5473,7 @@ asm_3e70b: ; 3e70b (f:670b)
res 6, [hl] ; no longer invulnerable to typcial attacks
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
ld [wd0b5], a
- ld a, $2c
+ ld a, BANK(MoveNames)
ld [wPredefBank], a
ld a, MOVE_NAME
ld [W_LISTTYPE], a
@@ -5950,10 +5952,11 @@ GetCurrentMove: ; 3eabe (f:6abe)
call AddNTimes
ld a, BANK(Moves)
call FarCopyData
- ld a, $2c
+
+ ld a, BANK(MoveNames)
ld [wPredefBank], a
- ld a, $2
- ld [W_LISTTYPE], a ; list type 2 = move name
+ ld a, MOVE_NAME
+ ld [W_LISTTYPE], a
call GetName
ld de, wcd6d
jp CopyStringToCF4B
diff --git a/engine/battle/e.asm b/engine/battle/e.asm
index 8b0476ca..a0d9d80c 100755
--- a/engine/battle/e.asm
+++ b/engine/battle/e.asm
@@ -587,7 +587,7 @@ Func_39b87: ; 39b87 (e:5b87)
jr z, .asm_39bc1
push hl
ld [wd0b5], a
- ld a, $2c
+ ld a, BANK(MoveNames)
ld [wPredefBank], a
ld a, MOVE_NAME
ld [W_LISTTYPE], a
diff --git a/engine/evos_moves.asm b/engine/evos_moves.asm
index fd93fa14..9869153e 100755
--- a/engine/evos_moves.asm
+++ b/engine/evos_moves.asm
@@ -135,7 +135,7 @@ Func_3ad71: ; 3ad71 (e:6d71)
ld [wHPBarMaxHP + 1], a
ld a, MONSTER_NAME
ld [W_LISTTYPE], a
- ld a, $e
+ ld a, BANK(TrainerNames) ; bank is not used for monster names
ld [wPredefBank], a
call GetName
push hl
diff --git a/home.asm b/home.asm
index dc0b0889..8c8f5c35 100644
--- a/home.asm
+++ b/home.asm
@@ -2044,7 +2044,7 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
.skipGettingQuantity
ld a,[wcf91]
ld [wd0b5],a
- ld a,$01
+ ld a,BANK(ItemNames)
ld [wPredefBank],a
call GetName
jr .storeChosenEntry
@@ -3782,7 +3782,7 @@ GetName:: ; 376b (0:376b)
; returns pointer to name in de
ld a,[wd0b5]
ld [wd11e],a
- cp a,$C4 ;it's TM/HM
+ cp HM_01
jp nc,GetMachineName
ld a,[H_LOADEDROMBANK]
push af
@@ -3858,8 +3858,8 @@ GetItemPrice:: ; 37df (0:37df)
ld a, [H_LOADEDROMBANK]
push af
ld a, [wListMenuID] ; wListMenuID
- cp $1
- ld a, $1 ; hardcoded Bank
+ cp MOVESLISTMENU
+ ld a, BANK(ItemPrices)
jr nz, .asm_37ed
ld a, $f ; hardcoded Bank
.asm_37ed