File tree Expand file tree Collapse file tree 2 files changed +16
-29
lines changed Expand file tree Collapse file tree 2 files changed +16
-29
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,10 @@ NAME_LENGTH_JAPANESE EQU 6
12
12
const_def 1
13
13
const MON_NAME ; 1
14
14
const MOVE_NAME ; 2
15
- const DUMMY_NAME ; 3
16
- const ITEM_NAME ; 4
17
- const PARTY_OT_NAME ; 5
18
- const ENEMY_OT_NAME ; 6
19
- const TRAINER_NAME ; 7
20
- const MOVE_DESC_NAME_BROKEN ; 8
15
+ const ITEM_NAME ; 3
16
+ const PARTY_OT_NAME ; 4
17
+ const ENEMY_OT_NAME ; 5
18
+ const TRAINER_NAME ; 6
21
19
22
20
; see home/text.asm
23
21
BORDER_WIDTH EQU 2
Original file line number Diff line number Diff line change 1
1
NamesPointers::
2
- ; entries correspond to GetName constants (see constants/text_constants.asm)
3
- dba PokemonNames ; MON_NAME (not used; jumps to GetPokemonName)
2
+ ; entries correspond to GetName constants (see constants/text_constants.asm); MON_NAME is not handled by this table
4
3
dba MoveNames ; MOVE_NAME
5
- dba NULL ; DUMMY_NAME
6
4
dba ItemNames ; ITEM_NAME
7
5
dbw 0 , wPartyMonOT ; PARTY_OT_NAME
8
6
dbw 0 , wOTPartyMonOT ; ENEMY_OT_NAME
9
7
dba TrainerClassNames ; TRAINER_NAME
10
- dbw 4 , MoveDescriptions ; MOVE_DESC_NAME_BROKEN (wrong bank)
11
8
12
9
GetName::
13
10
; Return name wCurSpecies from name list wNamedObjectTypeBuffer in wStringBuffer1.
@@ -19,27 +16,24 @@ GetName::
19
16
push de
20
17
21
18
ld a , [ wNamedObjectTypeBuffer ]
22
- cp MON_NAME
23
- jr nz , .NotPokeName
19
+ dec a
20
+ jr nz , .not_mon_name
24
21
25
22
ld a , [ wCurSpecies ]
26
23
ld [ wNamedObjectIndexBuffer ], a
27
24
call GetPokemonName
28
- ld hl , MON_NAME_LENGTH
29
- add hl , de
30
- ld e , l
31
- ld d , h
32
25
jr .done
33
26
34
- .NotPokeName:
35
- ld a , [ wNamedObjectTypeBuffer ]
27
+ .not_mon_name
36
28
dec a
37
- ld e , a
38
- ld d , 0
39
- ld hl , NamesPointers
40
- add hl , de
41
- add hl , de
42
- add hl , de
29
+ ld l , a
30
+ add a , a
31
+ add a , l
32
+ add a , LOW(NamesPointers)
33
+ ld l , a
34
+ ld a , HIGH(NamesPointers)
35
+ adc 0
36
+ ld h , a
43
37
ld a , [ hli ]
44
38
rst Bankswitch
45
39
ld a , [ hli ]
@@ -55,11 +49,6 @@ GetName::
55
49
call CopyBytes
56
50
57
51
.done
58
- ld a , e
59
- ld [ wUnusedD102 ], a
60
- ld a , d
61
- ld [ wUnusedD102 + 1 ], a
62
-
63
52
pop de
64
53
pop bc
65
54
pop hl
You can’t perform that action at this time.
0 commit comments