2014-05-22 22:13:20 +00:00
|
|
|
PlayerPC: ; 78e6 (1:78e6)
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl, wd730
|
2014-05-22 22:13:20 +00:00
|
|
|
set 6, [hl]
|
|
|
|
ld a, ITEM_NAME
|
2015-02-08 09:44:41 +00:00
|
|
|
ld [wNameListType], a
|
2014-05-22 22:13:20 +00:00
|
|
|
call SaveScreenTilesToBuffer1
|
|
|
|
xor a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcc2c], a
|
|
|
|
ld [wccd3], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, [wFlags_0xcd60]
|
|
|
|
bit 3, a
|
|
|
|
jr nz, Func_790c
|
|
|
|
ld a, (SFX_02_45 - SFX_Headers_02) / 3
|
|
|
|
call PlaySound
|
|
|
|
ld hl, TurnedOnPC2Text
|
|
|
|
call PrintText
|
|
|
|
|
|
|
|
Func_790c: ; 790c (1:790c)
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wccd3]
|
2015-02-08 06:18:42 +00:00
|
|
|
ld [wCurrentMenuItem], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld hl, wFlags_0xcd60
|
|
|
|
set 5, [hl]
|
|
|
|
call LoadScreenTilesFromBuffer2
|
|
|
|
ld hl, wTileMap
|
|
|
|
ld b, $8
|
|
|
|
ld c, $e
|
|
|
|
call TextBoxBorder
|
|
|
|
call UpdateSprites
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 2, 2
|
2015-02-08 06:18:42 +00:00
|
|
|
ld de, PlayersPCMenuEntries
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaceString
|
2015-02-08 06:18:42 +00:00
|
|
|
ld hl, wTopMenuItemY
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, $2
|
|
|
|
ld [hli], a
|
|
|
|
dec a
|
|
|
|
ld [hli], a
|
|
|
|
inc hl
|
|
|
|
inc hl
|
|
|
|
ld a, $3
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $3
|
|
|
|
ld [hli], a
|
|
|
|
xor a
|
|
|
|
ld [hl], a
|
2015-02-08 06:18:42 +00:00
|
|
|
ld hl, wListScrollOffset
|
2014-05-22 22:13:20 +00:00
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
2015-02-08 06:18:42 +00:00
|
|
|
ld [wPlayerMonNumber], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld hl, WhatDoYouWantText
|
|
|
|
call PrintText
|
|
|
|
call HandleMenuInput
|
|
|
|
bit 1, a
|
|
|
|
jp nz, Func_796d
|
|
|
|
call PlaceUnfilledArrowMenuCursor
|
2015-02-08 06:18:42 +00:00
|
|
|
ld a, [wCurrentMenuItem]
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wccd3], a
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jp z, Func_7a12
|
|
|
|
dec a
|
|
|
|
jp z, Func_7995
|
|
|
|
dec a
|
|
|
|
jp z, Func_7a8f
|
|
|
|
|
|
|
|
Func_796d: ; 796d (1:796d)
|
|
|
|
ld a, [wFlags_0xcd60]
|
|
|
|
bit 3, a
|
|
|
|
jr nz, .asm_797c
|
|
|
|
ld a, (SFX_02_46 - SFX_Headers_02) / 3
|
|
|
|
call PlaySound
|
|
|
|
call WaitForSoundToFinish
|
|
|
|
.asm_797c
|
|
|
|
ld hl, wFlags_0xcd60
|
|
|
|
res 5, [hl]
|
|
|
|
call LoadScreenTilesFromBuffer2
|
|
|
|
xor a
|
2015-02-08 06:18:42 +00:00
|
|
|
ld [wListScrollOffset], a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcc2c], a
|
|
|
|
ld hl, wd730
|
2014-05-22 22:13:20 +00:00
|
|
|
res 6, [hl]
|
|
|
|
xor a
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Func_7995: ; 7995 (1:7995)
|
|
|
|
xor a
|
2015-02-08 06:18:42 +00:00
|
|
|
ld [wCurrentMenuItem], a
|
|
|
|
ld [wListScrollOffset], a
|
|
|
|
ld a, [wNumBagItems]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jr nz, Func_79ab
|
|
|
|
ld hl, NothingToDepositText
|
|
|
|
call PrintText
|
|
|
|
jp Func_790c
|
|
|
|
|
|
|
|
Func_79ab: ; 79ab (1:79ab)
|
|
|
|
ld hl, WhatToDepositText
|
|
|
|
call PrintText
|
2015-02-08 06:18:42 +00:00
|
|
|
ld hl, wNumBagItems
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, l
|
2015-02-08 02:37:40 +00:00
|
|
|
ld [wList], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, h
|
2015-02-08 02:37:40 +00:00
|
|
|
ld [wList + 1], a
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf93], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, $3
|
2015-02-08 06:18:42 +00:00
|
|
|
ld [wListMenuID], a
|
2014-05-22 22:13:20 +00:00
|
|
|
call DisplayListMenuID
|
|
|
|
jp c, Func_790c
|
|
|
|
call IsKeyItem
|
|
|
|
ld a, $1
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf96], a
|
|
|
|
ld a, [wd124]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jr nz, .asm_79e7
|
|
|
|
ld hl, DepositHowManyText
|
|
|
|
call PrintText
|
|
|
|
call DisplayChooseQuantityMenu
|
|
|
|
cp $ff
|
|
|
|
jp z, Func_79ab
|
|
|
|
.asm_79e7
|
2015-02-08 06:18:42 +00:00
|
|
|
ld hl, wNumBoxItems
|
2014-05-22 22:13:20 +00:00
|
|
|
call AddItemToInventory
|
|
|
|
jr c, .asm_79f8
|
|
|
|
ld hl, NoRoomToStoreText
|
|
|
|
call PrintText
|
|
|
|
jp Func_79ab
|
|
|
|
.asm_79f8
|
2015-02-08 06:18:42 +00:00
|
|
|
ld hl, wNumBagItems
|
2014-05-22 22:13:20 +00:00
|
|
|
call RemoveItemFromInventory
|
|
|
|
call WaitForSoundToFinish
|
|
|
|
ld a, (SFX_02_55 - SFX_Headers_02) / 3
|
|
|
|
call PlaySound
|
|
|
|
call WaitForSoundToFinish
|
|
|
|
ld hl, ItemWasStoredText
|
|
|
|
call PrintText
|
|
|
|
jp Func_79ab
|
|
|
|
|
|
|
|
Func_7a12: ; 7a12 (1:7a12)
|
|
|
|
xor a
|
2015-02-08 06:18:42 +00:00
|
|
|
ld [wCurrentMenuItem], a
|
|
|
|
ld [wListScrollOffset], a
|
|
|
|
ld a, [wNumBoxItems]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jr nz, Func_7a28
|
|
|
|
ld hl, NothingStoredText
|
|
|
|
call PrintText
|
|
|
|
jp Func_790c
|
|
|
|
|
|
|
|
Func_7a28: ; 7a28 (1:7a28)
|
|
|
|
ld hl, WhatToWithdrawText
|
|
|
|
call PrintText
|
2015-02-08 06:18:42 +00:00
|
|
|
ld hl, wNumBoxItems
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, l
|
2015-02-08 02:37:40 +00:00
|
|
|
ld [wList], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, h
|
2015-02-08 02:37:40 +00:00
|
|
|
ld [wList + 1], a
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf93], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, $3
|
2015-02-08 06:18:42 +00:00
|
|
|
ld [wListMenuID], a
|
2014-05-22 22:13:20 +00:00
|
|
|
call DisplayListMenuID
|
|
|
|
jp c, Func_790c
|
|
|
|
call IsKeyItem
|
|
|
|
ld a, $1
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf96], a
|
|
|
|
ld a, [wd124]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jr nz, .asm_7a64
|
|
|
|
ld hl, WithdrawHowManyText
|
|
|
|
call PrintText
|
|
|
|
call DisplayChooseQuantityMenu
|
|
|
|
cp $ff
|
|
|
|
jp z, Func_7a28
|
|
|
|
.asm_7a64
|
2015-02-08 06:18:42 +00:00
|
|
|
ld hl, wNumBagItems
|
2014-05-22 22:13:20 +00:00
|
|
|
call AddItemToInventory
|
|
|
|
jr c, .asm_7a75
|
|
|
|
ld hl, CantCarryMoreText
|
|
|
|
call PrintText
|
|
|
|
jp Func_7a28
|
|
|
|
.asm_7a75
|
2015-02-08 06:18:42 +00:00
|
|
|
ld hl, wNumBoxItems
|
2014-05-22 22:13:20 +00:00
|
|
|
call RemoveItemFromInventory
|
|
|
|
call WaitForSoundToFinish
|
|
|
|
ld a, (SFX_02_55 - SFX_Headers_02) / 3
|
|
|
|
call PlaySound
|
|
|
|
call WaitForSoundToFinish
|
|
|
|
ld hl, WithdrewItemText
|
|
|
|
call PrintText
|
|
|
|
jp Func_7a28
|
|
|
|
|
|
|
|
Func_7a8f: ; 7a8f (1:7a8f)
|
|
|
|
xor a
|
2015-02-08 06:18:42 +00:00
|
|
|
ld [wCurrentMenuItem], a
|
|
|
|
ld [wListScrollOffset], a
|
|
|
|
ld a, [wNumBoxItems]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jr nz, Func_7aa5
|
|
|
|
ld hl, NothingStoredText
|
|
|
|
call PrintText
|
|
|
|
jp Func_790c
|
|
|
|
|
|
|
|
Func_7aa5: ; 7aa5 (1:7aa5)
|
|
|
|
ld hl, WhatToTossText
|
|
|
|
call PrintText
|
2015-02-08 06:18:42 +00:00
|
|
|
ld hl, wNumBoxItems
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, l
|
2015-02-08 02:37:40 +00:00
|
|
|
ld [wList], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, h
|
2015-02-08 02:37:40 +00:00
|
|
|
ld [wList + 1], a
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf93], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, $3
|
2015-02-08 06:18:42 +00:00
|
|
|
ld [wListMenuID], a
|
2014-05-22 22:13:20 +00:00
|
|
|
push hl
|
|
|
|
call DisplayListMenuID
|
|
|
|
pop hl
|
|
|
|
jp c, Func_790c
|
|
|
|
push hl
|
|
|
|
call IsKeyItem
|
|
|
|
pop hl
|
|
|
|
ld a, $1
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf96], a
|
|
|
|
ld a, [wd124]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jr nz, .asm_7aef
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wcf91]
|
2014-05-22 22:13:20 +00:00
|
|
|
call IsItemHM
|
|
|
|
jr c, .asm_7aef
|
|
|
|
push hl
|
|
|
|
ld hl, TossHowManyText
|
|
|
|
call PrintText
|
|
|
|
call DisplayChooseQuantityMenu
|
|
|
|
pop hl
|
|
|
|
cp $ff
|
|
|
|
jp z, Func_7aa5
|
|
|
|
.asm_7aef
|
|
|
|
call TossItem
|
|
|
|
jp Func_7aa5
|
|
|
|
|
|
|
|
PlayersPCMenuEntries: ; 7af5 (1:7af5)
|
|
|
|
db "WITHDRAW ITEM"
|
|
|
|
next "DEPOSIT ITEM"
|
|
|
|
next "TOSS ITEM"
|
|
|
|
next "LOG OFF@"
|
|
|
|
|
|
|
|
TurnedOnPC2Text: ; 7b22 (1:7b22)
|
|
|
|
TX_FAR _TurnedOnPC2Text
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
WhatDoYouWantText: ; 7b27 (1:7b27)
|
|
|
|
TX_FAR _WhatDoYouWantText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
WhatToDepositText: ; 7b2c (1:7b2c)
|
|
|
|
TX_FAR _WhatToDepositText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
DepositHowManyText: ; 7b31 (1:7b31)
|
|
|
|
TX_FAR _DepositHowManyText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
ItemWasStoredText: ; 7b36 (1:7b36)
|
|
|
|
TX_FAR _ItemWasStoredText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
NothingToDepositText: ; 7b3b (1:7b3b)
|
|
|
|
TX_FAR _NothingToDepositText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
NoRoomToStoreText: ; 7b40 (1:7b40)
|
|
|
|
TX_FAR _NoRoomToStoreText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
WhatToWithdrawText: ; 7b45 (1:7b45)
|
|
|
|
TX_FAR _WhatToWithdrawText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
WithdrawHowManyText: ; 7b4a (1:7b4a)
|
|
|
|
TX_FAR _WithdrawHowManyText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
WithdrewItemText: ; 7b4f (1:7b4f)
|
|
|
|
TX_FAR _WithdrewItemText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
NothingStoredText: ; 7b54 (1:7b54)
|
|
|
|
TX_FAR _NothingStoredText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
CantCarryMoreText: ; 7b59 (1:7b59)
|
|
|
|
TX_FAR _CantCarryMoreText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
WhatToTossText: ; 7b5e (1:7b5e)
|
|
|
|
TX_FAR _WhatToTossText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
TossHowManyText: ; 7b63 (1:7b63)
|
|
|
|
TX_FAR _TossHowManyText
|
|
|
|
db "@"
|