2018-06-24 07:09:41 -07:00
|
|
|
BankOfMom:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hInMenu]
|
2015-10-11 09:15:03 -07:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2015-10-11 09:15:03 -07:00
|
|
|
xor a
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-12-18 17:07:09 -08:00
|
|
|
.loop
|
2015-10-24 16:49:19 -07:00
|
|
|
ld a, [wJumptableIndex]
|
2015-10-11 09:15:03 -07:00
|
|
|
bit 7, a
|
2015-12-18 17:07:09 -08:00
|
|
|
jr nz, .done
|
|
|
|
call .RunJumptable
|
|
|
|
jr .loop
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2015-12-18 17:07:09 -08:00
|
|
|
.done
|
2015-10-11 09:15:03 -07:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.RunJumptable:
|
2020-07-01 10:13:49 -07:00
|
|
|
jumptable .dw, wJumptableIndex
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.dw
|
2015-12-26 18:59:03 -08:00
|
|
|
dw .CheckIfBankInitialized
|
|
|
|
dw .InitializeBank
|
2023-09-02 14:16:35 -07:00
|
|
|
dw .IsThisAboutYourCoins
|
2015-12-26 18:59:03 -08:00
|
|
|
dw .AccessBankOfMom
|
2023-09-02 14:16:35 -07:00
|
|
|
dw .StoreCoins
|
|
|
|
dw .TakeCoins
|
|
|
|
dw .StopOrStartSavingCoins
|
2015-12-26 18:59:03 -08:00
|
|
|
dw .JustDoWhatYouCan
|
2019-10-20 15:24:17 -07:00
|
|
|
dw .AskDST
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.CheckIfBankInitialized:
|
2023-09-02 14:16:35 -07:00
|
|
|
ld a, [wMomSavingCoins]
|
2018-01-22 10:57:44 -08:00
|
|
|
bit MOM_ACTIVE_F, a
|
2023-09-02 14:16:35 -07:00
|
|
|
jr nz, .savingcoinsalready
|
2018-01-22 10:57:44 -08:00
|
|
|
set MOM_ACTIVE_F, a
|
2023-09-02 14:16:35 -07:00
|
|
|
ld [wMomSavingCoins], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $1
|
2015-10-19 13:49:29 -07:00
|
|
|
jr .done_0
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
.savingcoinsalready
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $2
|
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.done_0
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.InitializeBank:
|
2019-10-20 15:24:17 -07:00
|
|
|
ld hl, MomLeavingText1
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
call YesNoBox
|
2023-09-02 14:16:35 -07:00
|
|
|
jr c, .DontSaveCoins
|
2019-10-20 15:24:17 -07:00
|
|
|
ld hl, MomLeavingText2
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2023-09-02 14:16:35 -07:00
|
|
|
ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_COINS_F)
|
2015-10-19 13:49:29 -07:00
|
|
|
jr .done_1
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
.DontSaveCoins:
|
2018-01-22 10:57:44 -08:00
|
|
|
ld a, 1 << MOM_ACTIVE_F
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.done_1
|
2023-09-02 14:16:35 -07:00
|
|
|
ld [wMomSavingCoins], a
|
2019-10-20 15:24:17 -07:00
|
|
|
ld hl, MomLeavingText3
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $8
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
.IsThisAboutYourCoins:
|
|
|
|
ld hl, MomIsThisAboutYourCoinsText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
call YesNoBox
|
2015-10-19 13:49:29 -07:00
|
|
|
jr c, .nope
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $3
|
2015-10-19 13:49:29 -07:00
|
|
|
jr .done_2
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.nope
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $7
|
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.done_2
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.AccessBankOfMom:
|
2019-10-20 15:24:17 -07:00
|
|
|
ld hl, MomBankWhatDoYouWantToDoText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2018-01-23 13:08:43 -08:00
|
|
|
call LoadStandardMenuHeader
|
2020-07-01 10:13:49 -07:00
|
|
|
ld hl, BankOfMom_MenuHeader
|
2018-01-23 13:08:43 -08:00
|
|
|
call CopyMenuHeader
|
2015-12-15 15:59:49 -08:00
|
|
|
call VerticalMenu
|
2015-12-24 19:58:42 -08:00
|
|
|
call CloseWindow
|
2015-10-19 13:49:29 -07:00
|
|
|
jr c, .cancel
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-10-11 09:15:03 -07:00
|
|
|
cp $1
|
2015-10-19 13:49:29 -07:00
|
|
|
jr z, .withdraw
|
2015-10-11 09:15:03 -07:00
|
|
|
cp $2
|
2015-10-19 13:49:29 -07:00
|
|
|
jr z, .deposit
|
2015-10-11 09:15:03 -07:00
|
|
|
cp $3
|
2015-10-19 13:49:29 -07:00
|
|
|
jr z, .stopsaving
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.cancel
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $7
|
2015-10-19 13:49:29 -07:00
|
|
|
jr .done_3
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.withdraw
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $5
|
2015-10-19 13:49:29 -07:00
|
|
|
jr .done_3
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.deposit
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $4
|
2015-10-19 13:49:29 -07:00
|
|
|
jr .done_3
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.stopsaving
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $6
|
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.done_3
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
.StoreCoins:
|
|
|
|
ld hl, MomStoreCoinsText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2
|
2015-10-11 09:15:03 -07:00
|
|
|
ld [hli], a
|
2016-05-04 08:46:23 -07:00
|
|
|
ld [hli], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ld [hl], a
|
2018-01-22 10:57:44 -08:00
|
|
|
ld a, 5
|
2018-01-11 12:36:11 -08:00
|
|
|
ld [wMomBankDigitCursorPosition], a
|
2018-01-23 13:08:43 -08:00
|
|
|
call LoadStandardMenuHeader
|
2016-05-10 09:59:34 -07:00
|
|
|
call Mom_SetUpDepositMenu
|
|
|
|
call Mom_Wait10Frames
|
|
|
|
call Mom_WithdrawDepositMenuJoypad
|
2015-12-24 19:58:42 -08:00
|
|
|
call CloseWindow
|
2015-10-19 13:49:29 -07:00
|
|
|
jr c, .CancelDeposit
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, [hli]
|
|
|
|
or [hl]
|
|
|
|
inc hl
|
|
|
|
or [hl]
|
2015-10-19 13:49:29 -07:00
|
|
|
jr z, .CancelDeposit
|
2023-09-02 14:16:35 -07:00
|
|
|
ld de, wCoins
|
2018-01-23 14:39:09 -08:00
|
|
|
ld bc, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
farcall CompareCoins
|
2019-10-20 15:24:17 -07:00
|
|
|
jr c, .InsufficientFundsInWallet
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2
|
|
|
|
ld de, wStringBuffer2 + 3
|
2015-10-19 13:49:29 -07:00
|
|
|
ld bc, 3
|
2015-10-11 09:15:03 -07:00
|
|
|
call CopyBytes
|
2023-09-02 14:16:35 -07:00
|
|
|
ld bc, wMomsCoins
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
farcall GiveCoins
|
2019-10-20 15:24:17 -07:00
|
|
|
jr c, .NotEnoughRoomInBank
|
2018-01-23 14:39:09 -08:00
|
|
|
ld bc, wStringBuffer2 + 3
|
2023-09-02 14:16:35 -07:00
|
|
|
ld de, wCoins
|
|
|
|
farcall TakeCoins
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
ld de, wMomsCoins
|
2015-10-19 13:49:29 -07:00
|
|
|
ld bc, 3
|
2015-10-11 09:15:03 -07:00
|
|
|
call CopyBytes
|
|
|
|
ld de, SFX_TRANSACTION
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
2023-09-02 14:16:35 -07:00
|
|
|
ld hl, MomStoredCoinsText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $8
|
2015-10-19 13:49:29 -07:00
|
|
|
jr .done_4
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
.InsufficientFundsInWallet:
|
|
|
|
ld hl, MomInsufficientFundsInWalletText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
.NotEnoughRoomInBank:
|
|
|
|
ld hl, MomNotEnoughRoomInBankText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.CancelDeposit:
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $7
|
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.done_4
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
.TakeCoins:
|
|
|
|
ld hl, MomTakeCoinsText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2
|
2015-10-11 09:15:03 -07:00
|
|
|
ld [hli], a
|
2016-05-04 08:46:23 -07:00
|
|
|
ld [hli], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ld [hl], a
|
2018-01-22 10:57:44 -08:00
|
|
|
ld a, 5
|
2018-01-11 12:36:11 -08:00
|
|
|
ld [wMomBankDigitCursorPosition], a
|
2018-01-23 13:08:43 -08:00
|
|
|
call LoadStandardMenuHeader
|
2016-05-10 09:59:34 -07:00
|
|
|
call Mom_SetUpWithdrawMenu
|
|
|
|
call Mom_Wait10Frames
|
|
|
|
call Mom_WithdrawDepositMenuJoypad
|
2015-12-24 19:58:42 -08:00
|
|
|
call CloseWindow
|
2015-10-19 13:49:29 -07:00
|
|
|
jr c, .CancelWithdraw
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, [hli]
|
|
|
|
or [hl]
|
|
|
|
inc hl
|
|
|
|
or [hl]
|
2015-10-19 13:49:29 -07:00
|
|
|
jr z, .CancelWithdraw
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2
|
|
|
|
ld de, wStringBuffer2 + 3
|
2015-10-11 09:15:03 -07:00
|
|
|
ld bc, 3
|
|
|
|
call CopyBytes
|
2023-09-02 14:16:35 -07:00
|
|
|
ld de, wMomsCoins
|
2018-01-23 14:39:09 -08:00
|
|
|
ld bc, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
farcall CompareCoins
|
2015-10-19 13:49:29 -07:00
|
|
|
jr c, .InsufficientFundsInBank
|
2023-09-02 14:16:35 -07:00
|
|
|
ld bc, wCoins
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
farcall GiveCoins
|
2015-10-19 13:49:29 -07:00
|
|
|
jr c, .NotEnoughRoomInWallet
|
2018-01-23 14:39:09 -08:00
|
|
|
ld bc, wStringBuffer2 + 3
|
2023-09-02 14:16:35 -07:00
|
|
|
ld de, wMomsCoins
|
|
|
|
farcall TakeCoins
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
ld de, wCoins
|
2015-10-11 09:15:03 -07:00
|
|
|
ld bc, 3
|
|
|
|
call CopyBytes
|
|
|
|
ld de, SFX_TRANSACTION
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
2023-09-02 14:16:35 -07:00
|
|
|
ld hl, MomTakenCoinsText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $8
|
2015-10-19 13:49:29 -07:00
|
|
|
jr .done_5
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.InsufficientFundsInBank:
|
2019-10-20 15:24:17 -07:00
|
|
|
ld hl, MomHaventSavedThatMuchText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.NotEnoughRoomInWallet:
|
2019-10-20 15:24:17 -07:00
|
|
|
ld hl, MomNotEnoughRoomInWalletText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.CancelWithdraw:
|
2015-10-19 13:49:29 -07:00
|
|
|
ld a, $7
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2015-10-19 13:49:29 -07:00
|
|
|
.done_5
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
.StopOrStartSavingCoins:
|
|
|
|
ld hl, MomSaveCoinsText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
call YesNoBox
|
2023-09-02 14:16:35 -07:00
|
|
|
jr c, .StopSavingCoins
|
|
|
|
ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_COINS_F)
|
|
|
|
ld [wMomSavingCoins], a
|
|
|
|
ld hl, MomStartSavingCoinsText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $8
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
.StopSavingCoins:
|
2018-01-22 10:57:44 -08:00
|
|
|
ld a, 1 << MOM_ACTIVE_F
|
2023-09-02 14:16:35 -07:00
|
|
|
ld [wMomSavingCoins], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, $7
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
.JustDoWhatYouCan:
|
|
|
|
ld hl, MomJustDoWhatYouCanText
|
2023-08-11 03:28:14 -07:00
|
|
|
call PrintText1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
.AskDST:
|
2015-10-24 16:49:19 -07:00
|
|
|
ld hl, wJumptableIndex
|
2015-10-11 09:15:03 -07:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mom_SetUpWithdrawMenu:
|
2016-05-10 09:59:34 -07:00
|
|
|
ld de, Mon_WithdrawString
|
|
|
|
jr Mom_ContinueMenuSetup
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mom_SetUpDepositMenu:
|
2016-05-10 09:59:34 -07:00
|
|
|
ld de, Mom_DepositString
|
2018-06-24 07:09:41 -07:00
|
|
|
Mom_ContinueMenuSetup:
|
2015-10-11 09:15:03 -07:00
|
|
|
push de
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-10-11 09:15:03 -07:00
|
|
|
hlcoord 0, 0
|
|
|
|
lb bc, 6, 18
|
2023-08-11 03:28:14 -07:00
|
|
|
call Textbox1bpp
|
2015-10-11 09:15:03 -07:00
|
|
|
hlcoord 1, 2
|
2016-05-10 09:59:34 -07:00
|
|
|
ld de, Mom_SavedString
|
2015-10-11 09:15:03 -07:00
|
|
|
call PlaceString
|
|
|
|
hlcoord 12, 2
|
2023-09-02 14:16:35 -07:00
|
|
|
ld de, wMomsCoins
|
|
|
|
lb bc, PRINTNUM_COINS | 3, 6
|
2015-10-11 09:15:03 -07:00
|
|
|
call PrintNum
|
|
|
|
hlcoord 1, 4
|
2016-05-10 09:59:34 -07:00
|
|
|
ld de, Mom_HeldString
|
2015-10-11 09:15:03 -07:00
|
|
|
call PlaceString
|
|
|
|
hlcoord 12, 4
|
2023-09-02 14:16:35 -07:00
|
|
|
ld de, wCoins
|
|
|
|
lb bc, PRINTNUM_COINS | 3, 6
|
2015-10-11 09:15:03 -07:00
|
|
|
call PrintNum
|
|
|
|
hlcoord 1, 6
|
|
|
|
pop de
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 12, 6
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
lb bc, PRINTNUM_COINS | PRINTNUM_LEADINGZEROS | 3, 6
|
2015-10-11 09:15:03 -07:00
|
|
|
call PrintNum
|
|
|
|
call UpdateSprites
|
2023-07-26 05:29:16 -07:00
|
|
|
call CopyTilemapAtOnce
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mom_Wait10Frames:
|
2015-10-11 09:15:03 -07:00
|
|
|
ld c, 10
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mom_WithdrawDepositMenuJoypad:
|
2015-10-11 09:15:03 -07:00
|
|
|
.loop
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyTextDelay
|
2015-10-11 09:15:03 -07:00
|
|
|
ld hl, hJoyPressed
|
|
|
|
ld a, [hl]
|
|
|
|
and B_BUTTON
|
|
|
|
jr nz, .pressedB
|
|
|
|
ld a, [hl]
|
|
|
|
and A_BUTTON
|
|
|
|
jr nz, .pressedA
|
|
|
|
call .dpadaction
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-10-11 09:15:03 -07:00
|
|
|
hlcoord 12, 6
|
|
|
|
ld bc, 7
|
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
hlcoord 12, 6
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
lb bc, PRINTNUM_COINS | PRINTNUM_LEADINGZEROS | 3, 6
|
2015-10-11 09:15:03 -07:00
|
|
|
call PrintNum
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hVBlankCounter]
|
2015-10-11 09:15:03 -07:00
|
|
|
and $10
|
|
|
|
jr nz, .skip
|
|
|
|
hlcoord 13, 6
|
|
|
|
ld a, [wMomBankDigitCursorPosition]
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
add hl, bc
|
|
|
|
ld [hl], " "
|
|
|
|
|
|
|
|
.skip
|
|
|
|
call WaitBGMap
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
.pressedB
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.pressedA
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-05-10 09:59:34 -07:00
|
|
|
.dpadaction
|
2015-10-11 09:15:03 -07:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
|
|
|
jr nz, .incrementdigit
|
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
|
|
|
jr nz, .decrementdigit
|
|
|
|
ld a, [hl]
|
|
|
|
and D_LEFT
|
|
|
|
jr nz, .movecursorleft
|
|
|
|
ld a, [hl]
|
|
|
|
and D_RIGHT
|
|
|
|
jr nz, .movecursorright
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.movecursorleft
|
|
|
|
ld hl, wMomBankDigitCursorPosition
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.movecursorright
|
|
|
|
ld hl, wMomBankDigitCursorPosition
|
|
|
|
ld a, [hl]
|
|
|
|
cp 5
|
|
|
|
ret nc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.incrementdigit
|
|
|
|
ld hl, .DigitQuantities
|
|
|
|
call .getdigitquantity
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
farcall GiveCoins
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
|
|
|
.decrementdigit
|
|
|
|
ld hl, .DigitQuantities
|
|
|
|
call .getdigitquantity
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer2
|
2023-09-02 14:16:35 -07:00
|
|
|
farcall TakeCoins
|
2015-10-11 09:15:03 -07:00
|
|
|
ret
|
|
|
|
|
2016-05-10 09:59:34 -07:00
|
|
|
.getdigitquantity
|
2015-10-11 09:15:03 -07:00
|
|
|
ld a, [wMomBankDigitCursorPosition]
|
|
|
|
push de
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
add hl, de
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, de
|
|
|
|
add hl, de
|
2015-10-11 09:15:03 -07:00
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.DigitQuantities:
|
2015-10-11 09:15:03 -07:00
|
|
|
dt 100000
|
|
|
|
dt 10000
|
|
|
|
dt 1000
|
|
|
|
dt 100
|
|
|
|
dt 10
|
|
|
|
dt 1
|
|
|
|
|
|
|
|
dt 100000
|
|
|
|
dt 10000
|
|
|
|
dt 1000
|
|
|
|
dt 100
|
|
|
|
dt 10
|
|
|
|
dt 1
|
|
|
|
|
|
|
|
dt 900000
|
|
|
|
dt 90000
|
|
|
|
dt 9000
|
|
|
|
dt 900
|
|
|
|
dt 90
|
|
|
|
dt 9
|
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
MomLeavingText1:
|
2019-03-10 17:43:34 -07:00
|
|
|
text_far _MomLeavingText1
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
MomLeavingText2:
|
2019-03-10 17:43:34 -07:00
|
|
|
text_far _MomLeavingText2
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
MomLeavingText3:
|
2019-03-10 17:43:34 -07:00
|
|
|
text_far _MomLeavingText3
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
MomIsThisAboutYourCoinsText:
|
|
|
|
text_far _MomIsThisAboutYourCoinsText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
MomBankWhatDoYouWantToDoText:
|
|
|
|
text_far _MomBankWhatDoYouWantToDoText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
MomStoreCoinsText:
|
|
|
|
text_far _MomStoreCoinsText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
MomTakeCoinsText:
|
|
|
|
text_far _MomTakeCoinsText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
MomSaveCoinsText:
|
|
|
|
text_far _MomSaveCoinsText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
MomHaventSavedThatMuchText:
|
|
|
|
text_far _MomHaventSavedThatMuchText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
MomNotEnoughRoomInWalletText:
|
|
|
|
text_far _MomNotEnoughRoomInWalletText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
MomInsufficientFundsInWalletText:
|
|
|
|
text_far _MomInsufficientFundsInWalletText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
MomNotEnoughRoomInBankText:
|
|
|
|
text_far _MomNotEnoughRoomInBankText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
MomStartSavingCoinsText:
|
|
|
|
text_far _MomStartSavingCoinsText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
MomStoredCoinsText:
|
|
|
|
text_far _MomStoredCoinsText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2023-09-02 14:16:35 -07:00
|
|
|
MomTakenCoinsText:
|
|
|
|
text_far _MomTakenCoinsText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
MomJustDoWhatYouCanText:
|
|
|
|
text_far _MomJustDoWhatYouCanText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-10-11 09:15:03 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mom_SavedString:
|
2015-10-11 09:15:03 -07:00
|
|
|
db "SAVED@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mon_WithdrawString:
|
2015-10-11 09:15:03 -07:00
|
|
|
db "WITHDRAW@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mom_DepositString:
|
2015-10-11 09:15:03 -07:00
|
|
|
db "DEPOSIT@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mom_HeldString:
|
2015-10-11 09:15:03 -07:00
|
|
|
db "HELD@"
|
|
|
|
|
2020-07-01 10:13:49 -07:00
|
|
|
BankOfMom_MenuHeader:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 0, 0, 10, 10
|
2020-07-01 10:13:49 -07:00
|
|
|
dw .MenuData
|
2015-10-11 09:15:03 -07:00
|
|
|
db 1 ; default option
|
|
|
|
|
2020-07-01 10:13:49 -07:00
|
|
|
.MenuData:
|
2018-01-14 02:59:56 -08:00
|
|
|
db STATICMENU_CURSOR ; flags
|
2015-10-11 09:15:03 -07:00
|
|
|
db 4 ; items
|
|
|
|
db "GET@"
|
|
|
|
db "SAVE@"
|
|
|
|
db "CHANGE@"
|
|
|
|
db "CANCEL@"
|