summaryrefslogtreecommitdiff
path: root/home/names2.asm
diff options
context:
space:
mode:
Diffstat (limited to 'home/names2.asm')
-rw-r--r--home/names2.asm24
1 files changed, 15 insertions, 9 deletions
diff --git a/home/names2.asm b/home/names2.asm
index 39ba1f55..cb53154c 100644
--- a/home/names2.asm
+++ b/home/names2.asm
@@ -20,6 +20,12 @@ GetName::
; TM names are separate from item names.
; BUG: This applies to all names instead of just items.
+ assert NUM_POKEMON_INDEXES < HM01, \
+ "A bug in GetName will get TM/HM names for Pokémon above ${x:HM01}."
+ assert NUM_ATTACKS < HM01, \
+ "A bug in GetName will get TM/HM names for moves above ${x:HM01}."
+ assert NUM_TRAINERS < HM01, \
+ "A bug in GetName will get TM/HM names for trainers above ${x:HM01}."
cp HM01
jp nc, GetMachineName
@@ -28,10 +34,10 @@ GetName::
push hl
push bc
push de
- ld a, [wNameListType] ;List3759_entrySelector
+ ld a, [wNameListType]
dec a
jr nz, .otherEntries
- ;1 = MON_NAMES
+ ; 1 = MONSTER_NAME
call GetMonName
ld hl, NAME_LENGTH
add hl, de
@@ -39,11 +45,11 @@ GetName::
ld d, h
jr .gotPtr
.otherEntries
- ;2-7 = OTHER ENTRIES
+ ; 2-7 = other names
ld a, [wPredefBank]
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
- ld a, [wNameListType] ;VariousNames' entryID
+ ld a, [wNameListType]
dec a
add a
ld d, 0
@@ -62,8 +68,8 @@ GetName::
ldh a, [hSwapTemp + 1]
ld l, a
ld a, [wd0b5]
- ld b, a
- ld c, 0
+ ld b, a ; wanted entry
+ ld c, 0 ; entry counter
.nextName
ld d, h
ld e, l
@@ -71,14 +77,14 @@ GetName::
ld a, [hli]
cp "@"
jr nz, .nextChar
- inc c ;entry counter
- ld a, b ;wanted entry
+ inc c
+ ld a, b
cp c
jr nz, .nextName
ld h, d
ld l, e
ld de, wcd6d
- ld bc, $14
+ ld bc, NAME_BUFFER_LENGTH
call CopyData
.gotPtr
ld a, e