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:
2015-10-24 16:49:19 -07:00
ld a , [ wJumptableIndex ]
2015-10-11 09:15:03 -07:00
ld e , a
ld d , 0
2015-12-26 18:59:03 -08:00
ld hl , .dw
2015-10-11 09:15:03 -07:00
add hl , de
2016-05-04 08:46:23 -07:00
add hl , de
2015-10-11 09:15:03 -07:00
ld a , [ hli ]
ld h , [ hl ]
ld l , a
2017-06-09 14:01:10 -07:00
jp hl
2015-10-11 09:15:03 -07:00
2018-06-24 07:09:41 -07:00
.dw
2016-04-10 11:42:14 -07:00
2015-12-26 18:59:03 -08:00
dw .CheckIfBankInitialized
dw .InitializeBank
dw .IsThisAboutYourMoney
dw .AccessBankOfMom
dw .StoreMoney
dw .TakeMoney
dw .StopOrStartSavingMoney
dw .AskDST
dw .JustDoWhatYouCan
2015-10-11 09:15:03 -07:00
2018-06-24 07:09:41 -07:00
.CheckIfBankInitialized:
2015-11-12 21:49:27 -08:00
ld a , [ wMomSavingMoney ]
2018-01-22 10:57:44 -08:00
bit MOM_ACTIVE_F , a
2015-10-19 13:49:29 -07:00
jr nz , .savingmoneyalready
2018-01-22 10:57:44 -08:00
set MOM_ACTIVE_F , a
2015-11-12 21:49:27 -08:00
ld [ wMomSavingMoney ], 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
2015-10-19 13:49:29 -07:00
.savingmoneyalready
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:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16649
call PrintText
call YesNoBox
2015-10-19 13:49:29 -07:00
jr c , .DontSaveMoney
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x1664e
call PrintText
2018-01-22 10:57:44 -08:00
ld a , ( 1 << MOM_ACTIVE_F ) | ( 1 << MOM_SAVING_SOME_MONEY_F )
2015-10-19 13:49:29 -07:00
jr .done_1
2015-10-11 09:15:03 -07:00
2016-04-10 11:42:14 -07:00
.DontSaveMoney:
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
2015-11-12 21:49:27 -08:00
ld [ wMomSavingMoney ], a
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16653
call PrintText
ld a , $ 8
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
.IsThisAboutYourMoney:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16658
call PrintText
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
call DS TChecks
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:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x1665d
call PrintText
2018-01-23 13:08:43 -08:00
call LoadStandardMenuHeader
ld hl , MenuHeader_0x166b5
call CopyMenuHeader
2015-12-15 15:59:49 -08:00
call VerticalMenu
2015-12-24 19:58:42 -08:00
call Cl oseWindow
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
2018-06-24 07:09:41 -07:00
.StoreMoney:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16662
call PrintText
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 Cl oseWindow
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
2018-01-23 14:39:09 -08:00
ld de , wMoney
ld bc , wStringBuffer2
2017-12-24 09:47:30 -08:00
farcall CompareMoney
2015-10-19 13:49:29 -07:00
jr c , .DontHaveThatMuchToDeposit
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
2015-11-12 21:49:27 -08:00
ld bc , wMomsMoney
2018-01-23 14:39:09 -08:00
ld de , wStringBuffer2
2017-12-24 09:47:30 -08:00
farcall GiveMoney
2015-10-19 13:49:29 -07:00
jr c , .CantDepositThatMuch
2018-01-23 14:39:09 -08:00
ld bc , wStringBuffer2 + 3
ld de , wMoney
2017-12-24 09:47:30 -08:00
farcall TakeMoney
2018-01-23 14:39:09 -08:00
ld hl , wStringBuffer2
2015-11-12 21:49:27 -08:00
ld de , wMomsMoney
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
ld hl , UnknownText_0x1668a
call PrintText
ld a , $ 8
2015-10-19 13:49:29 -07:00
jr .done_4
2015-10-11 09:15:03 -07:00
2016-04-10 11:42:14 -07:00
.DontHaveThatMuchToDeposit:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x1667b
call PrintText
ret
2016-04-10 11:42:14 -07:00
.CantDepositThatMuch:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16680
call PrintText
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
2018-06-24 07:09:41 -07:00
.TakeMoney:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16667
call PrintText
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 Cl oseWindow
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
2015-11-12 21:49:27 -08:00
ld de , wMomsMoney
2018-01-23 14:39:09 -08:00
ld bc , wStringBuffer2
2017-12-24 09:47:30 -08:00
farcall CompareMoney
2015-10-19 13:49:29 -07:00
jr c , .InsufficientFundsInBank
2018-01-23 14:39:09 -08:00
ld bc , wMoney
ld de , wStringBuffer2
2017-12-24 09:47:30 -08:00
farcall GiveMoney
2015-10-19 13:49:29 -07:00
jr c , .NotEnoughRoomInWallet
2018-01-23 14:39:09 -08:00
ld bc , wStringBuffer2 + 3
2015-11-12 21:49:27 -08:00
ld de , wMomsMoney
2017-12-24 09:47:30 -08:00
farcall TakeMoney
2018-01-23 14:39:09 -08:00
ld hl , wStringBuffer2
ld de , wMoney
2015-10-11 09:15:03 -07:00
ld bc , 3
call CopyBytes
ld de , SFX_TRANSACTION
call PlaySFX
call WaitSFX
ld hl , UnknownText_0x1668f
call PrintText
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:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16671
call PrintText
ret
2016-04-10 11:42:14 -07:00
.NotEnoughRoomInWallet:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16676
call PrintText
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
2018-06-24 07:09:41 -07:00
.StopOrStartSavingMoney:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x1666c
call PrintText
call YesNoBox
2015-10-19 13:49:29 -07:00
jr c , .StopSavingMoney
2018-01-22 10:57:44 -08:00
ld a , ( 1 << MOM_ACTIVE_F ) | ( 1 << MOM_SAVING_SOME_MONEY_F )
2015-11-12 21:49:27 -08:00
ld [ wMomSavingMoney ], a
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16685
call PrintText
ld a , $ 8
2015-10-24 16:49:19 -07:00
ld [ wJumptableIndex ], a
2015-10-11 09:15:03 -07:00
ret
2016-04-10 11:42:14 -07:00
.StopSavingMoney:
2018-01-22 10:57:44 -08:00
ld a , 1 << MOM_ACTIVE_F
2015-11-12 21:49:27 -08:00
ld [ wMomSavingMoney ], 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
2018-06-24 07:09:41 -07:00
.AskDST:
2015-10-11 09:15:03 -07:00
ld hl , UnknownText_0x16694
call PrintText
2018-06-24 07:09:41 -07:00
.JustDoWhatYouCan:
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
DSTChecks:
2015-10-11 09:15:03 -07:00
; check the time; avoid changing DST if doing so would change the current day
ld a , [ wDST ]
bit 7 , a
2018-08-25 11:28:22 -07:00
ldh a , [ hHours ]
2015-12-18 17:07:09 -08:00
jr z , .NotDST
2015-10-11 09:15:03 -07:00
and a ; within one hour of 00:00?
jr z , .LostBooklet
jr .loop
2016-04-10 11:42:14 -07:00
.NotDST:
2015-10-11 09:15:03 -07:00
cp 23 ; within one hour of 23:00?
jr nz , .loop
; fallthrough
2016-04-10 11:42:14 -07:00
.LostBooklet:
2015-12-18 17:07:09 -08:00
call .ClearBox
2015-10-11 09:15:03 -07:00
bccoord 1 , 14
2015-12-18 17:07:09 -08:00
ld hl , .Text_AdjustClock
2016-05-08 11:11:24 -07:00
call PlaceHLTextAtBC
2015-10-11 09:15:03 -07:00
call YesNoBox
ret c
2015-12-18 17:07:09 -08:00
call .ClearBox
2015-10-11 09:15:03 -07:00
bccoord 1 , 14
2015-12-18 17:07:09 -08:00
ld hl , .Text_LostInstructionBooklet
2016-05-08 11:11:24 -07:00
call PlaceHLTextAtBC
2015-10-11 09:15:03 -07:00
ret
.loop
2015-12-18 17:07:09 -08:00
call .ClearBox
2015-10-11 09:15:03 -07:00
bccoord 1 , 14
ld a , [ wDST ]
bit 7 , a
2015-12-18 17:07:09 -08:00
jr z , .SetDST
ld hl , .Text_IsDSTOver
2016-05-08 11:11:24 -07:00
call PlaceHLTextAtBC
2015-10-11 09:15:03 -07:00
call YesNoBox
ret c
ld a , [ wDST ]
res 7 , a
ld [ wDST ], a
2015-12-18 17:07:09 -08:00
call .SetClockBack
call .ClearBox
2015-10-11 09:15:03 -07:00
bccoord 1 , 14
2015-12-18 17:07:09 -08:00
ld hl , .Text_SetClockBack
2016-05-08 11:11:24 -07:00
call PlaceHLTextAtBC
2015-10-11 09:15:03 -07:00
ret
2016-04-10 11:42:14 -07:00
.SetDST:
2015-12-18 17:07:09 -08:00
ld hl , .Text_SwitchToDST
2016-05-08 11:11:24 -07:00
call PlaceHLTextAtBC
2015-10-11 09:15:03 -07:00
call YesNoBox
ret c
ld a , [ wDST ]
set 7 , a
ld [ wDST ], a
2015-12-18 17:07:09 -08:00
call .SetClockForward
call .ClearBox
2015-10-11 09:15:03 -07:00
bccoord 1 , 14
2015-12-18 17:07:09 -08:00
ld hl , .Text_SetClockForward
2016-05-08 11:11:24 -07:00
call PlaceHLTextAtBC
2015-10-11 09:15:03 -07:00
ret
2018-06-24 07:09:41 -07:00
.SetClockForward:
2018-01-23 14:39:09 -08:00
ld a , [ wStartHour ]
2015-10-11 09:15:03 -07:00
add 1
sub 24
2015-12-18 17:07:09 -08:00
jr nc , .DontLoopHourForward
2015-10-11 09:15:03 -07:00
add 24
2016-04-10 11:42:14 -07:00
.DontLoopHourForward:
2018-01-23 14:39:09 -08:00
ld [ wStartHour ], a
2015-10-11 09:15:03 -07:00
ccf
2018-01-23 14:39:09 -08:00
ld a , [ wStartDay ]
2015-10-11 09:15:03 -07:00
adc 0
2018-01-23 14:39:09 -08:00
ld [ wStartDay ], a
2015-10-11 09:15:03 -07:00
ret
2018-06-24 07:09:41 -07:00
.SetClockBack:
2018-01-23 14:39:09 -08:00
ld a , [ wStartHour ]
2015-10-11 09:15:03 -07:00
sub 1
2015-12-18 17:07:09 -08:00
jr nc , .DontLoopHourBack
2015-10-11 09:15:03 -07:00
add 24
2016-04-10 11:42:14 -07:00
.DontLoopHourBack:
2018-01-23 14:39:09 -08:00
ld [ wStartHour ], a
ld a , [ wStartDay ]
2015-10-11 09:15:03 -07:00
sbc 0
2015-12-18 17:07:09 -08:00
jr nc , .DontLoopDayBack
2015-10-11 09:15:03 -07:00
add 7
2016-04-10 11:42:14 -07:00
.DontLoopDayBack:
2018-01-23 14:39:09 -08:00
ld [ wStartDay ], a
2015-10-11 09:15:03 -07:00
ret
2018-06-24 07:09:41 -07:00
.ClearBox:
2015-10-11 09:15:03 -07:00
hlcoord 1 , 14
2015-11-01 06:38:48 -08:00
lb bc , 3 , 18
2015-10-11 09:15:03 -07:00
call Cl earBox
ret
2018-06-24 17:10:37 -07:00
.Text_AdjustClock:
2015-10-11 09:15:03 -07:00
; Do you want to adjust your clock for Daylight Saving Time?
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1c6095
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
.Text_LostInstructionBooklet:
2015-10-11 09:15:03 -07:00
; I lost the instruction booklet for the POKéGEAR.
; Come back again in a while.
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1c60d1
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
.Text_SwitchToDST:
2015-10-11 09:15:03 -07:00
; Do you want to switch to Daylight Saving Time?
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1c6000
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
.Text_SetClockForward:
2015-10-11 09:15:03 -07:00
; I set the clock forward by one hour.
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1c6030
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
.Text_IsDSTOver:
2015-10-11 09:15:03 -07:00
; Is Daylight Saving Time over?
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1c6056
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
.Text_SetClockBack:
2015-10-11 09:15:03 -07:00
; I put the clock back one hour.
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1c6075
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_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
call TextBox
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
2015-11-12 21:49:27 -08:00
ld de , wMomsMoney
2015-10-11 09:15:03 -07:00
lb bc , PRINTNUM_MONEY | 3 , 6
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
2018-01-23 14:39:09 -08:00
ld de , wMoney
2015-10-11 09:15:03 -07:00
lb bc , PRINTNUM_MONEY | 3 , 6
call PrintNum
hlcoord 1 , 6
pop de
call PlaceString
hlcoord 12 , 6
2018-01-23 14:39:09 -08:00
ld de , wStringBuffer2
2015-10-11 09:15:03 -07:00
lb bc , PRINTNUM_MONEY | PRINTNUM_LEADINGZEROS | 3 , 6
call PrintNum
call UpdateSprites
2017-12-24 15:11:17 -08:00
call CGBOnly_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 Byte Fill
hlcoord 12 , 6
2018-01-23 14:39:09 -08:00
ld de , wStringBuffer2
2015-10-11 09:15:03 -07:00
lb bc , PRINTNUM_MONEY | PRINTNUM_LEADINGZEROS | 3 , 6
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
2017-12-24 09:47:30 -08:00
farcall GiveMoney
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
2017-12-24 09:47:30 -08:00
farcall TakeMoney
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
2018-06-24 17:10:37 -07:00
UnknownText_0x16649:
2015-10-11 09:15:03 -07:00
; Wow, that's a cute #MON. Where did you get it? … So, you're leaving on an adventure… OK! I'll help too. But what can I do for you? I know! I'll save money for you. On a long journey, money's important. Do you want me to save your money?
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd77f
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x1664e:
2015-10-11 09:15:03 -07:00
; OK, I'll take care of your money.
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd868
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x16653:
2015-10-11 09:15:03 -07:00
; Be careful. #MON are your friends. You need to work as a team. Now, go on!
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd88e
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x16658:
2015-10-11 09:15:03 -07:00
; Hi! Welcome home! You're trying very hard, I see. I've kept your room tidy. Or is this about your money?
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd8da
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x1665d:
2015-10-11 09:15:03 -07:00
; What do you want to do?
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd942
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x16662:
2015-10-11 09:15:03 -07:00
; How much do you want to save?
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd95b
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x16667:
2015-10-11 09:15:03 -07:00
; How much do you want to take?
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd97a
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x1666c:
2015-10-11 09:15:03 -07:00
; Do you want to save some money?
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd999
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x16671:
2015-10-11 09:15:03 -07:00
; You haven't saved that much.
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd9ba
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x16676:
2015-10-11 09:15:03 -07:00
; You can't take that much.
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd9d7
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x1667b:
2015-10-11 09:15:03 -07:00
; You don't have that much.
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bd9f1
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x16680:
2015-10-11 09:15:03 -07:00
; You can't save that much.
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bda0b
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x16685:
2015-10-11 09:15:03 -07:00
; OK, I'll save your money. Trust me! , stick with it!
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bda25
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x1668a:
2015-10-11 09:15:03 -07:00
; Your money's safe here! Get going!
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bda5b
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x1668f:
2015-10-11 09:15:03 -07:00
; , don't give up!
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bda7e
2018-11-17 10:33:03 -08:00
text_end
2015-10-11 09:15:03 -07:00
2018-06-24 17:10:37 -07:00
UnknownText_0x16694:
2015-10-11 09:15:03 -07:00
; Just do what you can.
2018-10-28 09:16:55 -07:00
text_far UnknownText_0x1bda90
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@"
2018-06-24 17:10:37 -07:00
MenuHeader_0x166b5:
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
2018-01-23 13:08:43 -08:00
dw MenuData_0x166bd
2015-10-11 09:15:03 -07:00
db 1 ; default option
2018-06-24 17:10:37 -07:00
MenuData_0x166bd:
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@"