2018-06-24 17:10:37 -07:00
|
|
|
|
PlaceMenuItemName:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
push de
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wMenuSelection]
|
2020-12-23 13:29:30 -08:00
|
|
|
|
ld [wNamedObjectIndex], a
|
2017-12-15 17:10:54 -08:00
|
|
|
|
call GetItemName
|
|
|
|
|
pop hl
|
|
|
|
|
call PlaceString
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
|
PlaceMenuItemQuantity:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
push de
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wMenuSelection]
|
|
|
|
|
ld [wCurItem], a
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall _CheckTossableItem
|
2020-12-23 13:29:30 -08:00
|
|
|
|
ld a, [wItemAttributeValue]
|
2017-12-15 17:10:54 -08:00
|
|
|
|
pop hl
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .done
|
|
|
|
|
ld de, $15
|
|
|
|
|
add hl, de
|
|
|
|
|
ld [hl], "×"
|
|
|
|
|
inc hl
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld de, wMenuSelectionQuantity
|
2017-12-15 17:10:54 -08:00
|
|
|
|
lb bc, 1, 2
|
|
|
|
|
call PrintNum
|
|
|
|
|
|
|
|
|
|
.done
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
PlaceMoneyTopRight:
|
2020-10-04 16:43:28 -07:00
|
|
|
|
ld hl, MoneyTopRightMenuHeader
|
2018-01-23 13:08:43 -08:00
|
|
|
|
call CopyMenuHeader
|
2019-04-08 05:15:10 -07:00
|
|
|
|
jr PlaceMoneyTextbox
|
2017-12-15 17:10:54 -08:00
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
PlaceMoneyBottomLeft:
|
2020-10-04 16:43:28 -07:00
|
|
|
|
ld hl, MoneyBottomLeftMenuHeader
|
2018-01-23 13:08:43 -08:00
|
|
|
|
call CopyMenuHeader
|
2019-04-08 05:15:10 -07:00
|
|
|
|
jr PlaceMoneyTextbox
|
2017-12-15 17:10:54 -08:00
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
PlaceMoneyAtTopLeftOfTextbox:
|
2020-10-04 16:43:28 -07:00
|
|
|
|
ld hl, MoneyTopRightMenuHeader
|
2017-12-15 17:10:54 -08:00
|
|
|
|
lb de, 0, 11
|
2018-01-23 13:08:43 -08:00
|
|
|
|
call OffsetMenuHeader
|
2017-12-15 17:10:54 -08:00
|
|
|
|
|
2019-04-08 05:15:10 -07:00
|
|
|
|
PlaceMoneyTextbox:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
call MenuBox
|
|
|
|
|
call MenuBoxCoord2Tile
|
|
|
|
|
ld de, SCREEN_WIDTH + 1
|
|
|
|
|
add hl, de
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld de, wMoney
|
2017-12-15 17:10:54 -08:00
|
|
|
|
lb bc, PRINTNUM_MONEY | 3, 6
|
|
|
|
|
call PrintNum
|
|
|
|
|
ret
|
|
|
|
|
|
2020-10-04 16:43:28 -07:00
|
|
|
|
MoneyTopRightMenuHeader:
|
2018-01-14 02:59:56 -08:00
|
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
|
menu_coords 11, 0, SCREEN_WIDTH - 1, 2
|
2017-12-15 17:10:54 -08:00
|
|
|
|
dw NULL
|
|
|
|
|
db 1 ; default option
|
|
|
|
|
|
2020-10-04 16:43:28 -07:00
|
|
|
|
MoneyBottomLeftMenuHeader:
|
2018-01-14 02:59:56 -08:00
|
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
|
menu_coords 0, 11, 8, 13
|
2017-12-15 17:10:54 -08:00
|
|
|
|
dw NULL
|
|
|
|
|
db 1 ; default option
|
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
DisplayCoinCaseBalance:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
; Place a text box of size 1x7 at 11, 0.
|
|
|
|
|
hlcoord 11, 0
|
|
|
|
|
ld b, 1
|
|
|
|
|
ld c, 7
|
2019-04-08 05:15:10 -07:00
|
|
|
|
call Textbox
|
2017-12-15 17:10:54 -08:00
|
|
|
|
hlcoord 12, 0
|
|
|
|
|
ld de, CoinString
|
|
|
|
|
call PlaceString
|
|
|
|
|
hlcoord 17, 1
|
|
|
|
|
ld de, ShowMoney_TerminatorString
|
|
|
|
|
call PlaceString
|
2018-01-23 13:45:34 -08:00
|
|
|
|
ld de, wCoins
|
2017-12-15 17:10:54 -08:00
|
|
|
|
lb bc, 2, 4
|
|
|
|
|
hlcoord 13, 1
|
|
|
|
|
call PrintNum
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
DisplayMoneyAndCoinBalance:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
hlcoord 5, 0
|
|
|
|
|
ld b, 3
|
|
|
|
|
ld c, 13
|
2019-04-08 05:15:10 -07:00
|
|
|
|
call Textbox
|
2017-12-15 17:10:54 -08:00
|
|
|
|
hlcoord 6, 1
|
|
|
|
|
ld de, MoneyString
|
|
|
|
|
call PlaceString
|
|
|
|
|
hlcoord 12, 1
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld de, wMoney
|
2017-12-15 17:10:54 -08:00
|
|
|
|
lb bc, PRINTNUM_MONEY | 3, 6
|
|
|
|
|
call PrintNum
|
|
|
|
|
hlcoord 6, 3
|
|
|
|
|
ld de, CoinString
|
|
|
|
|
call PlaceString
|
|
|
|
|
hlcoord 15, 3
|
2018-01-23 13:45:34 -08:00
|
|
|
|
ld de, wCoins
|
2017-12-15 17:10:54 -08:00
|
|
|
|
lb bc, 2, 4
|
|
|
|
|
call PrintNum
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
MoneyString:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
db "MONEY@"
|
2018-06-24 07:09:41 -07:00
|
|
|
|
CoinString:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
db "COIN@"
|
2018-06-24 07:09:41 -07:00
|
|
|
|
ShowMoney_TerminatorString:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
db "@"
|
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
|
StartMenu_PrintSafariGameStatus: ; unreferenced
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld hl, wOptions
|
2017-12-15 17:10:54 -08:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
set NO_TEXT_SCROLL, [hl]
|
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
ld b, 3
|
|
|
|
|
ld c, 7
|
2019-04-08 05:15:10 -07:00
|
|
|
|
call Textbox
|
2017-12-15 17:10:54 -08:00
|
|
|
|
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
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld [wOptions], a
|
2017-12-15 17:10:54 -08:00
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
.slash_500
|
2018-01-19 18:49:16 -08:00
|
|
|
|
db "/500@"
|
2018-06-24 07:09:41 -07:00
|
|
|
|
.booru_ko
|
2018-01-19 18:49:16 -08:00
|
|
|
|
db "ボール こ@"
|
2017-12-15 17:10:54 -08:00
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
StartMenu_DrawBugContestStatusBox:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
hlcoord 0, 0
|
|
|
|
|
ld b, 5
|
|
|
|
|
ld c, 17
|
2019-04-08 05:15:10 -07:00
|
|
|
|
call Textbox
|
2017-12-15 17:10:54 -08:00
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
StartMenu_PrintBugContestStatus:
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld hl, wOptions
|
2017-12-15 17:10:54 -08:00
|
|
|
|
ld a, [hl]
|
|
|
|
|
push af
|
|
|
|
|
set NO_TEXT_SCROLL, [hl]
|
|
|
|
|
call StartMenu_DrawBugContestStatusBox
|
|
|
|
|
hlcoord 1, 5
|
2020-10-26 12:45:57 -07:00
|
|
|
|
ld de, .BallsString
|
2017-12-15 17:10:54 -08:00
|
|
|
|
call PlaceString
|
|
|
|
|
hlcoord 8, 5
|
|
|
|
|
ld de, wParkBallsRemaining
|
2019-11-03 17:17:04 -08:00
|
|
|
|
lb bc, PRINTNUM_LEFTALIGN | 1, 2
|
2017-12-15 17:10:54 -08:00
|
|
|
|
call PrintNum
|
|
|
|
|
hlcoord 1, 1
|
2020-10-26 12:45:57 -07:00
|
|
|
|
ld de, .CaughtString
|
2017-12-15 17:10:54 -08:00
|
|
|
|
call PlaceString
|
|
|
|
|
ld a, [wContestMon]
|
|
|
|
|
and a
|
2020-10-26 12:45:57 -07:00
|
|
|
|
ld de, .NoneString
|
2017-12-15 17:10:54 -08:00
|
|
|
|
jr z, .no_contest_mon
|
2020-12-23 13:29:30 -08:00
|
|
|
|
ld [wNamedObjectIndex], a
|
2017-12-15 17:10:54 -08:00
|
|
|
|
call GetPokemonName
|
|
|
|
|
|
|
|
|
|
.no_contest_mon
|
|
|
|
|
hlcoord 8, 1
|
|
|
|
|
call PlaceString
|
|
|
|
|
ld a, [wContestMon]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .skip_level
|
|
|
|
|
hlcoord 1, 3
|
2020-10-26 12:45:57 -07:00
|
|
|
|
ld de, .LevelString
|
2017-12-15 17:10:54 -08:00
|
|
|
|
call PlaceString
|
|
|
|
|
ld a, [wContestMonLevel]
|
|
|
|
|
ld h, b
|
|
|
|
|
ld l, c
|
|
|
|
|
inc hl
|
|
|
|
|
ld c, 3
|
2019-11-03 17:17:04 -08:00
|
|
|
|
call Print8BitNumLeftAlign
|
2017-12-15 17:10:54 -08:00
|
|
|
|
|
|
|
|
|
.skip_level
|
|
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld [wOptions], a
|
2017-12-15 17:10:54 -08:00
|
|
|
|
ret
|
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
|
.BallsJPString: ; unreferenced
|
2018-01-19 18:49:16 -08:00
|
|
|
|
db "ボール こ@"
|
2020-10-26 12:45:57 -07:00
|
|
|
|
.CaughtString:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
db "CAUGHT@"
|
2020-10-26 12:45:57 -07:00
|
|
|
|
.BallsString:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
db "BALLS:@"
|
2020-10-26 12:45:57 -07:00
|
|
|
|
.NoneString:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
db "None@"
|
2020-10-26 12:45:57 -07:00
|
|
|
|
.LevelString:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
db "LEVEL@"
|
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
|
FindApricornsInBag:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
; Checks the bag for Apricorns.
|
2020-11-03 16:53:07 -08:00
|
|
|
|
ld hl, wKurtApricornCount
|
2017-12-15 17:10:54 -08:00
|
|
|
|
xor a
|
|
|
|
|
ld [hli], a
|
2020-11-03 16:53:07 -08:00
|
|
|
|
assert wKurtApricornCount + 1 == wKurtApricornItems
|
2017-12-15 17:10:54 -08:00
|
|
|
|
dec a
|
|
|
|
|
ld bc, 10
|
|
|
|
|
call ByteFill
|
|
|
|
|
|
2018-01-10 22:45:27 -08:00
|
|
|
|
ld hl, ApricornBalls
|
2017-12-15 17:10:54 -08:00
|
|
|
|
.loop
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
cp -1
|
|
|
|
|
jr z, .done
|
|
|
|
|
push hl
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld [wCurItem], a
|
|
|
|
|
ld hl, wNumItems
|
2017-12-15 17:10:54 -08:00
|
|
|
|
call CheckItem
|
|
|
|
|
pop hl
|
|
|
|
|
jr nc, .nope
|
|
|
|
|
ld a, [hl]
|
|
|
|
|
call .addtobuffer
|
|
|
|
|
.nope
|
|
|
|
|
inc hl
|
|
|
|
|
inc hl
|
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
|
|
.done
|
2020-11-03 16:53:07 -08:00
|
|
|
|
ld a, [wKurtApricornCount]
|
2017-12-15 17:10:54 -08:00
|
|
|
|
and a
|
|
|
|
|
ret nz
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2020-11-03 16:53:07 -08:00
|
|
|
|
.addtobuffer:
|
2017-12-15 17:10:54 -08:00
|
|
|
|
push hl
|
2020-11-03 16:53:07 -08:00
|
|
|
|
ld hl, wKurtApricornCount
|
2017-12-15 17:10:54 -08:00
|
|
|
|
inc [hl]
|
|
|
|
|
ld e, [hl]
|
|
|
|
|
ld d, 0
|
|
|
|
|
add hl, de
|
|
|
|
|
ld [hl], a
|
|
|
|
|
pop hl
|
|
|
|
|
ret
|
|
|
|
|
|
2018-01-10 22:45:27 -08:00
|
|
|
|
INCLUDE "data/items/apricorn_balls.asm"
|