pokecrystal-board/engine/menus/menu_2.asm

252 lines
3.8 KiB
NASM
Raw Normal View History

PlaceMenuItemName:
push de
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
ld [wNamedObjectIndex], a
call GetItemName
pop hl
call PlaceString
ret
PlaceMenuItemQuantity:
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
ld a, [wItemAttributeValue]
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
lb bc, 1, 2
call PrintNum
.done
ret
PlaceCoinsTopRight:
ld hl, CoinsTopRightMenuHeader
call CopyMenuHeader
jr PlaceCoinsTextbox
PlaceCoinsBottomLeft:
ld hl, CoinsBottomLeftMenuHeader
call CopyMenuHeader
jr PlaceCoinsTextbox
PlaceCoinsAtTopLeftOfTextbox:
ld hl, CoinsTopRightMenuHeader
lb de, 0, 11
call OffsetMenuHeader
PlaceCoinsTextbox:
call MenuBox
call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH + 1
add hl, de
ld de, wCoins
lb bc, PRINTNUM_COINS | 3, 6
call PrintNum
ret
CoinsTopRightMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 11, 0, SCREEN_WIDTH - 1, 2
dw NULL
db 1 ; default option
CoinsBottomLeftMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 11, 8, 13
dw NULL
db 1 ; default option
DisplayChipCaseBalance:
; Place a text box of size 1x7 at 11, 0.
hlcoord 11, 0
ld b, 1
ld c, 7
call Textbox1bpp
hlcoord 12, 0
ld de, ChipString
call PlaceString
hlcoord 17, 1
ld de, ShowCoins_TerminatorString
call PlaceString
ld de, wChips
lb bc, 2, 4
hlcoord 13, 1
call PrintNum
ret
DisplayCoinsAndChipBalance:
hlcoord 5, 0
ld b, 3
ld c, 13
call Textbox1bpp
hlcoord 6, 1
ld de, CoinsString
call PlaceString
hlcoord 12, 1
ld de, wCoins
lb bc, PRINTNUM_COINS | 3, 6
call PrintNum
hlcoord 6, 3
ld de, ChipString
call PlaceString
hlcoord 15, 3
ld de, wChips
lb bc, 2, 4
call PrintNum
ret
CoinsString:
db "COINS@"
ChipString:
db "CHIP@"
ShowCoins_TerminatorString:
db "@"
StartMenu_PrintSafariGameStatus: ; unreferenced
2018-01-23 14:39:09 -08:00
ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
hlcoord 0, 0
ld b, 3
ld c, 7
call Textbox1bpp
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, .ball
call PlaceString
hlcoord 6, 3
ld de, wSafariBallsRemaining
lb bc, 1, 2
call PrintNum
pop af
2018-01-23 14:39:09 -08:00
ld [wOptions], a
ret
2018-06-24 07:09:41 -07:00
.slash_500
db "/500@"
.ball
db "BALL@"
2018-06-24 07:09:41 -07:00
StartMenu_DrawBugContestStatusBox:
hlcoord 0, 0
ld b, 5
ld c, 17
call Textbox1bpp
ret
2018-06-24 07:09:41 -07:00
StartMenu_PrintBugContestStatus:
2018-01-23 14:39:09 -08:00
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
2019-11-03 17:17:04 -08:00
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
2019-11-03 17:17:04 -08:00
call Print8BitNumLeftAlign
.skip_level
pop af
2018-01-23 14:39:09 -08:00
ld [wOptions], a
ret
.CaughtString:
db "CAUGHT@"
.BallsString:
db "BALLS:@"
.NoneString:
db "None@"
.LevelString:
db "LEVEL@"
2018-06-24 07:09:41 -07:00
FindApricornsInBag:
; Checks the bag for Apricorns.
2020-11-03 16:53:07 -08:00
ld hl, wKurtApricornCount
xor a
ld [hli], a
2020-11-03 16:53:07 -08:00
assert wKurtApricornCount + 1 == wKurtApricornItems
dec a
ld bc, 10
call ByteFill
2018-01-10 22:45:27 -08:00
ld hl, ApricornBalls
.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
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]
and a
ret nz
scf
ret
2020-11-03 16:53:07 -08:00
.addtobuffer:
push hl
2020-11-03 16:53:07 -08:00
ld hl, wKurtApricornCount
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"