1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
; formats a string at wMovesString that lists the moves at wMoves
FormatMovesString: ; 39b87 (e:5b87)
ld hl, wMoves
ld de, wMovesString
ld b, $0
.printMoveNameLoop
ld a, [hli]
and a ; end of move list?
jr z, .printDashLoop ; print dashes when no moves are left
push hl
ld [wd0b5], a
ld a, BANK(MoveNames)
ld [wPredefBank], a
ld a, MOVE_NAME
ld [wNameListType], a
call GetName
ld hl, wcd6d
.copyNameLoop
ld a, [hli]
cp $50
jr z, .doneCopyingName
ld [de], a
inc de
jr .copyNameLoop
.doneCopyingName
ld a, b
ld [wNumMovesMinusOne], a
inc b
ld a, $4e ; line break
ld [de], a
inc de
pop hl
ld a, b
cp NUM_MOVES
jr z, .done
jr .printMoveNameLoop
.printDashLoop
ld a, "-"
ld [de], a
inc de
inc b
ld a, b
cp NUM_MOVES
jr z, .done
ld a, $4e ; line break
ld [de], a
inc de
jr .printDashLoop
.done
ld a, "@"
ld [de], a
ret
; XXX this is called in a few places, but it doesn't appear to do anything useful
InitList: ; 39bd5 (e:5bd5)
ld a, [wInitListType]
cp INIT_ENEMYOT_LIST
jr nz, .notEnemy
ld hl, wEnemyPartyCount
ld de, wEnemyMonOT
ld a, ENEMYOT_NAME
jr .done
.notEnemy
cp INIT_PLAYEROT_LIST
jr nz, .notPlayer
ld hl, wPartyCount
ld de, wPartyMonOT
ld a, PLAYEROT_NAME
jr .done
.notPlayer
cp INIT_MON_LIST
jr nz, .notMonster
ld hl, wItemList
ld de, MonsterNames
ld a, MONSTER_NAME
jr .done
.notMonster
cp INIT_BAG_ITEM_LIST
jr nz, .notBag
ld hl, wNumBagItems
ld de, ItemNames
ld a, ITEM_NAME
jr .done
.notBag
ld hl, wItemList
ld de, ItemNames
ld a, ITEM_NAME
.done
ld [wNameListType], a
ld a, l
ld [wListPointer], a
ld a, h
ld [wListPointer + 1], a
ld a, e
ld [wUnusedCF8D], a
ld a, d
ld [wUnusedCF8D + 1], a
ld bc, ItemPrices
ld a, c
ld [wItemPrices], a
ld a, b
ld [wItemPrices + 1], a
ret
; get species of mon e in list [wMonDataLocation] for LoadMonData
GetMonSpecies: ; 39c37 (e:5c37)
ld hl, wPartySpecies
ld a, [wMonDataLocation]
and a
jr z, .getSpecies
dec a
jr z, .enemyParty
ld hl, wBoxSpecies
jr .getSpecies
.enemyParty
ld hl, wEnemyPartyMons
.getSpecies
ld d, 0
add hl, de
ld a, [hl]
ld [wcf91], a
ret
|