-
Notifications
You must be signed in to change notification settings - Fork 817
/
menu_2.asm
253 lines (230 loc) · 3.83 KB
/
menu_2.asm
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
PlaceMenuItemName:
push de
ld a, [wMenuSelection]
ld [wNamedObjectIndex], a
call GetItemName
pop hl
call PlaceString
ret
PlaceMenuItemQuantity:
push de
ld a, [wMenuSelection]
ld [wCurItem], a
farcall _CheckTossableItem
ld a, [wItemAttributeValue]
pop hl
and a
jr nz, .done
ld de, $15
add hl, de
ld [hl], "×"
inc hl
ld de, wMenuSelectionQuantity
lb bc, 1, 2
call PrintNum
.done
ret
PlaceMoneyTopRight:
ld hl, MoneyTopRightMenuHeader
call CopyMenuHeader
jr PlaceMoneyTextbox
PlaceMoneyBottomLeft:
ld hl, MoneyBottomLeftMenuHeader
call CopyMenuHeader
jr PlaceMoneyTextbox
PlaceMoneyAtTopLeftOfTextbox:
ld hl, MoneyTopRightMenuHeader
lb de, 0, 11
call OffsetMenuHeader
PlaceMoneyTextbox:
call MenuBox
call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH + 1
add hl, de
ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
call PrintNum
ret
MoneyTopRightMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 11, 0, SCREEN_WIDTH - 1, 2
dw NULL
db 1 ; default option
MoneyBottomLeftMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 11, 8, 13
dw NULL
db 1 ; default option
DisplayCoinCaseBalance:
; Place a text box of size 1x7 at 11, 0.
hlcoord 11, 0
ld b, 1
ld c, 7
call Textbox
hlcoord 12, 0
ld de, CoinString
call PlaceString
hlcoord 17, 1
ld de, ShowMoney_TerminatorString
call PlaceString
ld de, wCoins
lb bc, 2, 4
hlcoord 13, 1
call PrintNum
ret
DisplayMoneyAndCoinBalance:
hlcoord 5, 0
ld b, 3
ld c, 13
call Textbox
hlcoord 6, 1
ld de, MoneyString
call PlaceString
hlcoord 12, 1
ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
call PrintNum
hlcoord 6, 3
ld de, CoinString
call PlaceString
hlcoord 15, 3
ld de, wCoins
lb bc, 2, 4
call PrintNum
ret
MoneyString:
db "MONEY@"
CoinString:
db "COIN@"
ShowMoney_TerminatorString:
db "@"
StartMenu_PrintSafariGameStatus: ; unreferenced
ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
hlcoord 0, 0
ld b, 3
ld c, 7
call Textbox
hlcoord 1, 1
ld de, wSafariTimeRemaining
lb bc, 2, 3
call PrintNum
hlcoord 4, 1
ld de, .slash_500
call PlaceString
hlcoord 1, 3
ld de, .booru_ko
call PlaceString
hlcoord 5, 3
ld de, wSafariBallsRemaining
lb bc, 1, 2
call PrintNum
pop af
ld [wOptions], a
ret
.slash_500
db "/500@"
.booru_ko
db "ボール こ@"
StartMenu_DrawBugContestStatusBox:
hlcoord 0, 0
ld b, 5
ld c, 17
call Textbox
ret
StartMenu_PrintBugContestStatus:
ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
call StartMenu_DrawBugContestStatusBox
hlcoord 1, 5
ld de, .BallsString
call PlaceString
hlcoord 8, 5
ld de, wParkBallsRemaining
lb bc, PRINTNUM_LEFTALIGN | 1, 2
call PrintNum
hlcoord 1, 1
ld de, .CaughtString
call PlaceString
ld a, [wContestMon]
and a
ld de, .NoneString
jr z, .no_contest_mon
ld [wNamedObjectIndex], a
call GetPokemonName
.no_contest_mon
hlcoord 8, 1
call PlaceString
ld a, [wContestMon]
and a
jr z, .skip_level
hlcoord 1, 3
ld de, .LevelString
call PlaceString
ld a, [wContestMonLevel]
ld h, b
ld l, c
inc hl
ld c, 3
call Print8BitNumLeftAlign
.skip_level
pop af
ld [wOptions], a
ret
.BallsJPString: ; unreferenced
db "ボール こ@"
.CaughtString:
db "CAUGHT@"
.BallsString:
db "BALLS:@"
.NoneString:
db "None@"
.LevelString:
db "LEVEL@"
FindApricornsInBag:
; Checks the bag for Apricorns.
ld hl, wKurtApricornCount
xor a
ld [hli], a
assert wKurtApricornCount + 1 == wKurtApricornItems
dec a
ld bc, 10
call ByteFill
ld hl, ApricornBalls
.loop
ld a, [hl]
cp -1
jr z, .done
push hl
ld [wCurItem], a
ld hl, wNumItems
call CheckItem
pop hl
jr nc, .nope
ld a, [hl]
call .addtobuffer
.nope
inc hl
inc hl
jr .loop
.done
ld a, [wKurtApricornCount]
and a
ret nz
scf
ret
.addtobuffer:
push hl
ld hl, wKurtApricornCount
inc [hl]
ld e, [hl]
ld d, 0
add hl, de
ld [hl], a
pop hl
ret
INCLUDE "data/items/apricorn_balls.asm"