2018-03-25 16:24:14 +00:00
|
|
|
RestartClock_GetWraparoundTime: ; 20000 (8:4000)
|
2015-11-10 16:05:26 +00:00
|
|
|
push hl
|
|
|
|
dec a
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
ld hl, .WrapAroundTimes
|
|
|
|
rept 4
|
|
|
|
add hl, de
|
|
|
|
endr
|
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
|
|
|
inc hl
|
|
|
|
ld b, [hl]
|
|
|
|
inc hl
|
|
|
|
ld c, [hl]
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 20015 (8:4015)
|
|
|
|
|
|
|
|
.WrapAroundTimes: ; 20015
|
2018-01-23 22:39:09 +00:00
|
|
|
dw wBuffer4
|
2015-11-10 16:05:26 +00:00
|
|
|
db 7, 4
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
dw wBuffer5
|
2015-11-10 16:05:26 +00:00
|
|
|
db 24, 12
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
dw wBuffer6
|
2015-11-10 16:05:26 +00:00
|
|
|
db 60, 15
|
|
|
|
; 20021
|
|
|
|
|
|
|
|
RestartClock: ; 20021 (8:4021)
|
|
|
|
; If we're here, we had an RTC overflow.
|
|
|
|
ld hl, .Text_ClockTimeMayBeWrong
|
|
|
|
call PrintText
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wOptions
|
2015-11-10 16:05:26 +00:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
set NO_TEXT_SCROLL, [hl]
|
2018-01-23 21:08:43 +00:00
|
|
|
call LoadStandardMenuHeader
|
2015-11-10 16:05:26 +00:00
|
|
|
call ClearTileMap
|
|
|
|
ld hl, .Text_SetWithControlPad
|
|
|
|
call PrintText
|
|
|
|
call .SetClock
|
|
|
|
call ExitMenu
|
|
|
|
pop bc
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wOptions
|
2015-11-10 16:05:26 +00:00
|
|
|
ld [hl], b
|
|
|
|
ld c, a
|
|
|
|
ret
|
|
|
|
; 20047 (8:4047)
|
|
|
|
|
|
|
|
.Text_ClockTimeMayBeWrong: ; 0x20047
|
|
|
|
; The clock's time may be wrong. Please reset the time.
|
|
|
|
text_jump UnknownText_0x1c40e6
|
|
|
|
db "@"
|
|
|
|
; 0x2004c
|
|
|
|
|
|
|
|
.Text_SetWithControlPad: ; 0x2004c
|
|
|
|
; Set with the Control Pad. Confirm: A Button Cancel: B Button
|
|
|
|
text_jump UnknownText_0x1c411c
|
|
|
|
db "@"
|
|
|
|
; 0x20051
|
|
|
|
|
|
|
|
.SetClock: ; 20051 (8:4051)
|
|
|
|
ld a, 1
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wBuffer1], a ; which digit
|
|
|
|
ld [wBuffer2], a
|
2015-11-10 16:05:26 +00:00
|
|
|
ld a, 8
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wBuffer3], a
|
2015-11-10 16:05:26 +00:00
|
|
|
call UpdateTime
|
|
|
|
call GetWeekday
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wBuffer4], a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hHours]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wBuffer5], a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hMinutes]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wBuffer6], a
|
2015-11-10 16:05:26 +00:00
|
|
|
|
|
|
|
.loop
|
|
|
|
call .joy_loop
|
|
|
|
jr nc, .loop
|
|
|
|
and a
|
|
|
|
ret nz
|
|
|
|
call .PrintTime
|
|
|
|
ld hl, .Text_IsThisOK
|
|
|
|
call PrintText
|
|
|
|
call YesNoBox
|
|
|
|
jr c, .cancel
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer4]
|
|
|
|
ld [wStringBuffer2], a
|
|
|
|
ld a, [wBuffer5]
|
|
|
|
ld [wStringBuffer2 + 1], a
|
|
|
|
ld a, [wBuffer6]
|
|
|
|
ld [wStringBuffer2 + 2], a
|
2015-11-10 16:05:26 +00:00
|
|
|
xor a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wStringBuffer2 + 3], a
|
2015-12-19 01:07:09 +00:00
|
|
|
call InitTime
|
2015-11-10 16:05:26 +00:00
|
|
|
call .PrintTime
|
|
|
|
ld hl, .Text_ClockReset
|
|
|
|
call PrintText
|
2015-11-11 04:23:28 +00:00
|
|
|
call WaitPressAorB_BlinkCursor
|
2015-11-10 16:05:26 +00:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.cancel
|
|
|
|
ld a, $1
|
|
|
|
ret
|
|
|
|
; 200b0 (8:40b0)
|
|
|
|
|
|
|
|
.Text_IsThisOK: ; 0x200b0
|
|
|
|
; Is this OK?
|
|
|
|
text_jump UnknownText_0x1c415b
|
|
|
|
db "@"
|
|
|
|
; 0x200b5
|
|
|
|
|
|
|
|
.Text_ClockReset: ; 0x200b5
|
|
|
|
; The clock has been reset.
|
|
|
|
text_jump UnknownText_0x1c4168
|
|
|
|
db "@"
|
|
|
|
; 0x200ba
|
|
|
|
|
|
|
|
.joy_loop
|
2016-05-10 16:31:49 +00:00
|
|
|
call JoyTextDelay_ForcehJoyDown
|
2015-11-10 16:05:26 +00:00
|
|
|
ld c, a
|
|
|
|
push af
|
|
|
|
call .PrintTime
|
|
|
|
pop af
|
|
|
|
bit 0, a
|
|
|
|
jr nz, .press_A
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .press_B
|
|
|
|
bit 6, a
|
|
|
|
jr nz, .pressed_up
|
|
|
|
bit 7, a
|
|
|
|
jr nz, .pressed_down
|
|
|
|
bit 5, a
|
|
|
|
jr nz, .pressed_left
|
|
|
|
bit 4, a
|
|
|
|
jr nz, .pressed_right
|
|
|
|
jr .joy_loop
|
|
|
|
|
|
|
|
.press_A
|
|
|
|
ld a, $0
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.press_B
|
|
|
|
ld a, $1
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.pressed_up
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer1]
|
2018-03-25 16:24:14 +00:00
|
|
|
call RestartClock_GetWraparoundTime
|
2015-11-10 16:05:26 +00:00
|
|
|
ld a, [de]
|
|
|
|
inc a
|
|
|
|
ld [de], a
|
|
|
|
cp b
|
|
|
|
jr c, .done_scroll
|
|
|
|
ld a, $0
|
|
|
|
ld [de], a
|
|
|
|
jr .done_scroll
|
|
|
|
|
|
|
|
.pressed_down
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer1]
|
2018-03-25 16:24:14 +00:00
|
|
|
call RestartClock_GetWraparoundTime
|
2015-11-10 16:05:26 +00:00
|
|
|
ld a, [de]
|
|
|
|
dec a
|
|
|
|
ld [de], a
|
|
|
|
cp -1
|
|
|
|
jr nz, .done_scroll
|
|
|
|
ld a, b
|
|
|
|
dec a
|
|
|
|
ld [de], a
|
|
|
|
jr .done_scroll
|
|
|
|
|
|
|
|
.pressed_left
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wBuffer1
|
2015-11-10 16:05:26 +00:00
|
|
|
dec [hl]
|
|
|
|
jr nz, .done_scroll
|
|
|
|
ld [hl], $3
|
|
|
|
jr .done_scroll
|
|
|
|
|
|
|
|
.pressed_right
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wBuffer1
|
2015-11-10 16:05:26 +00:00
|
|
|
inc [hl]
|
|
|
|
ld a, [hl]
|
|
|
|
cp $4
|
|
|
|
jr c, .done_scroll
|
|
|
|
ld [hl], $1
|
|
|
|
|
|
|
|
.done_scroll
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.PrintTime: ; 2011f (8:411f)
|
|
|
|
hlcoord 0, 5
|
|
|
|
ld b, 5
|
|
|
|
ld c, 18
|
|
|
|
call TextBox
|
|
|
|
decoord 1, 8
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer4]
|
2015-11-10 16:05:26 +00:00
|
|
|
ld b, a
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall PrintDayOfWeek
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer5]
|
2015-11-10 16:05:26 +00:00
|
|
|
ld b, a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer6]
|
2015-11-10 16:05:26 +00:00
|
|
|
ld c, a
|
|
|
|
decoord 11, 8
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall PrintHoursMins
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer2]
|
2015-11-10 16:05:26 +00:00
|
|
|
lb de, " ", " "
|
|
|
|
call .PlaceChars
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer1]
|
2015-11-10 16:05:26 +00:00
|
|
|
lb de, "▲", "▼"
|
|
|
|
call .PlaceChars
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer1]
|
|
|
|
ld [wBuffer2], a
|
2015-11-10 16:05:26 +00:00
|
|
|
ret
|
|
|
|
; 20160 (8:4160)
|
|
|
|
|
2016-04-10 19:01:49 +00:00
|
|
|
.unreferenced ; 20160
|
2018-03-03 00:39:16 +00:00
|
|
|
; unused
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer3]
|
2015-11-10 16:05:26 +00:00
|
|
|
ld b, a
|
2015-11-10 21:53:37 +00:00
|
|
|
call Coord2Tile
|
2015-11-10 16:05:26 +00:00
|
|
|
ret
|
|
|
|
; 20168
|
|
|
|
|
|
|
|
.PlaceChars: ; 20168 (8:4168)
|
|
|
|
push de
|
2018-03-25 16:24:14 +00:00
|
|
|
call RestartClock_GetWraparoundTime
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wBuffer3]
|
2015-11-10 16:05:26 +00:00
|
|
|
dec a
|
|
|
|
ld b, a
|
2015-11-10 21:53:37 +00:00
|
|
|
call Coord2Tile
|
2015-11-10 16:05:26 +00:00
|
|
|
pop de
|
|
|
|
ld [hl], d
|
|
|
|
ld bc, 2 * SCREEN_WIDTH
|
|
|
|
add hl, bc
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
|
|
|
; 2017c (8:417c)
|
|
|
|
|
2018-03-03 00:39:16 +00:00
|
|
|
UnreferencedString_HourJP: ; 2017c
|
|
|
|
; unused
|
2015-11-10 16:05:26 +00:00
|
|
|
db "じ@" ; HR
|
|
|
|
; 2017e
|
|
|
|
|
2018-03-03 00:39:16 +00:00
|
|
|
UnreferencedString_MinuteJP: ; 2017e
|
|
|
|
; unused
|
2015-11-10 16:05:26 +00:00
|
|
|
db "ふん@" ; MIN
|
|
|
|
; 20181
|