diff options
Diffstat (limited to 'engine/rtc/timeset.asm')
-rw-r--r-- | engine/rtc/timeset.asm | 118 |
1 files changed, 41 insertions, 77 deletions
diff --git a/engine/rtc/timeset.asm b/engine/rtc/timeset.asm index eda3094e1..06f800c45 100644 --- a/engine/rtc/timeset.asm +++ b/engine/rtc/timeset.asm @@ -1,7 +1,7 @@ TIMESET_UP_ARROW EQUS "\"♂\"" ; $ef TIMESET_DOWN_ARROW EQUS "\"♀\"" ; $f5 -InitClock: ; 90672 (24:4672) +InitClock: ; Ask the player to set the time. ld a, [hInMenu] push af @@ -120,7 +120,7 @@ InitClock: ; 90672 (24:4672) ld [hInMenu], a ret -.ClearScreen: ; 90783 (24:4783) +.ClearScreen: xor a ld [hBGMapMode], a hlcoord 0, 0 @@ -131,7 +131,7 @@ InitClock: ; 90672 (24:4672) ld [hBGMapMode], a ret -SetHour: ; 90795 (24:4795) +SetHour: ld a, [hJoyPressed] and A_BUTTON jr nz, .Confirm @@ -183,7 +183,7 @@ SetHour: ; 90795 (24:4795) scf ret -DisplayHourOClock: ; 907de (24:47de) +DisplayHourOClock: push hl ld a, [wInitHourBuffer] ld c, a @@ -195,9 +195,8 @@ DisplayHourOClock: ; 907de (24:47de) call PlaceString pop hl ret -; 907f1 (24:47f1) -UnreferencedFunction907f1: ; 907f1 +UnreferencedFunction907f1: ld h, d ld l, e push hl @@ -222,9 +221,8 @@ UnreferencedFunction907f1: ; 907f1 inc hl inc hl ret -; 90810 -SetMinutes: ; 90810 (24:4810) +SetMinutes: ld a, [hJoyPressed] and A_BUTTON jr nz, .a_button @@ -273,7 +271,7 @@ SetMinutes: ; 90810 (24:4810) scf ret -DisplayMinutesWithMinString: ; 90859 (24:4859) +DisplayMinutesWithMinString: ld de, wInitMinuteBuffer call PrintTwoDigitNumberRightAlign inc hl @@ -281,7 +279,7 @@ DisplayMinutesWithMinString: ; 90859 (24:4859) call PlaceString ret -PrintTwoDigitNumberRightAlign: ; 90867 (24:4867) +PrintTwoDigitNumberRightAlign: push hl ld a, " " ld [hli], a @@ -290,25 +288,21 @@ PrintTwoDigitNumberRightAlign: ; 90867 (24:4867) lb bc, PRINTNUM_RIGHTALIGN | 1, 2 call PrintNum ret -; 90874 (24:4874) -Text_WokeUpOak: ; 0x90874 +Text_WokeUpOak: ; Zzz… Hm? Wha…? You woke me up! Will you check the clock for me? text_jump UnknownText_0x1bc29c db "@" -; 0x90879 -Text_WhatTimeIsIt: ; 0x90879 +Text_WhatTimeIsIt: ; What time is it? text_jump UnknownText_0x1bc2eb db "@" -; 0x9087e String_oclock: db "o'clock@" -; 90886 -Text_WhatHrs: ; 0x90886 +Text_WhatHrs: ; What?@ @ text_jump UnknownText_0x1bc2fd start_asm @@ -316,25 +310,21 @@ Text_WhatHrs: ; 0x90886 call DisplayHourOClock ld hl, .QuestionMark ret -; 90895 (24:4895) -.QuestionMark: ; 0x90895 +.QuestionMark: ; ? text_jump UnknownText_0x1bc305 db "@" -; 0x9089a -Text_HowManyMinutes: ; 0x9089a +Text_HowManyMinutes: ; How many minutes? text_jump UnknownText_0x1bc308 db "@" -; 0x9089f String_min: db "min.@" -; 908a4 -Text_WhoaMins: ; 0x908a4 +Text_WhoaMins: ; Whoa!@ @ text_jump UnknownText_0x1bc31b start_asm @@ -342,15 +332,13 @@ Text_WhoaMins: ; 0x908a4 call DisplayMinutesWithMinString ld hl, .QuestionMark ret -; 908b3 (24:48b3) -.QuestionMark: ; 0x908b3 +.QuestionMark: ; ? text_jump UnknownText_0x1bc323 db "@" -; 0x908b8 -OakText_ResponseToSetTime: ; 0x908b8 +OakText_ResponseToSetTime: start_asm decoord 1, 14 ld a, [wInitHourBuffer] @@ -379,35 +367,30 @@ OakText_ResponseToSetTime: ; 0x908b8 .day: ld hl, .yikes ret -; 908ec (24:48ec) -.overslept ; 0x908ec +.overslept ; ! I overslept! text_jump UnknownText_0x1bc326 db "@" -; 0x908f1 -.yikes ; 0x908f1 +.yikes ; ! Yikes! I over- slept! text_jump UnknownText_0x1bc336 db "@" -; 0x908f6 -.sodark ; 0x908f6 +.sodark ; ! No wonder it's so dark! text_jump UnknownText_0x1bc34f db "@" -; 0x908fb -TimeSetBackgroundGFX: ; 908fb +TimeSetBackgroundGFX: INCBIN "gfx/new_game/timeset_bg.1bpp" -TimeSetUpArrowGFX: ; 90903 +TimeSetUpArrowGFX: INCBIN "gfx/new_game/up_arrow.1bpp" -TimeSetDownArrowGFX: ; 9090b +TimeSetDownArrowGFX: INCBIN "gfx/new_game/down_arrow.1bpp" -; 90913 -SetDayOfWeek: ; 90913 +SetDayOfWeek: ld a, [hInMenu] push af ld a, $1 @@ -459,9 +442,8 @@ SetDayOfWeek: ; 90913 pop af ld [hInMenu], a ret -; 90993 -.GetJoypadAction: ; 90993 +.GetJoypadAction: ld a, [hJoyPressed] and A_BUTTON jr z, .not_A @@ -515,9 +497,8 @@ SetDayOfWeek: ; 90913 call WaitBGMap and a ret -; 909de -.PlaceWeekdayString: ; 909de +.PlaceWeekdayString: push hl ld a, [wTempDayOfWeek] ld e, a @@ -531,9 +512,8 @@ SetDayOfWeek: ; 90913 pop hl call PlaceString ret -; 909f2 -.WeekdayStrings: ; 909f2 +.WeekdayStrings: ; entries correspond to wCurDay constants (see constants/wram_constants.asm) dw .Sunday dw .Monday @@ -552,28 +532,24 @@ SetDayOfWeek: ; 90913 .Friday: db " FRIDAY@" .Saturday: db "SATURDAY@" - -.WhatDayIsItText: ; 0x90a3f +.WhatDayIsItText: ; What day is it? text_jump UnknownText_0x1bc369 db "@" -; 0x90a44 -.ConfirmWeekdayText: ; 0x90a44 +.ConfirmWeekdayText: start_asm hlcoord 1, 14 call .PlaceWeekdayString ld hl, .IsIt ret -; 90a4f (24:4a4f) -.IsIt: ; 0x90a4f +.IsIt: ; , is it? text_jump UnknownText_0x1bc37a db "@" -; 0x90a54 -InitialSetDSTFlag: ; 90a54 +InitialSetDSTFlag: ld a, [wDST] set 7, a ld [wDST], a @@ -583,9 +559,8 @@ InitialSetDSTFlag: ; 90a54 ld hl, .Text call PlaceHLTextAtBC ret -; 90a6c -.Text: ; 90a6c +.Text: start_asm call UpdateTime ld a, [hHours] @@ -596,15 +571,13 @@ InitialSetDSTFlag: ; 90a54 farcall PrintHoursMins ld hl, .DSTIsThatOK ret -; 90a83 (24:4a83) -.DSTIsThatOK: ; 0x90a83 +.DSTIsThatOK: ; DST, is that OK? text_jump Text_DSTIsThatOK db "@" -; 0x90a88 -InitialClearDSTFlag: ; 90a88 +InitialClearDSTFlag: ld a, [wDST] res 7, a ld [wDST], a @@ -614,9 +587,8 @@ InitialClearDSTFlag: ; 90a88 ld hl, .Text call PlaceHLTextAtBC ret -; 90aa0 -.Text: ; 90aa0 +.Text: start_asm call UpdateTime ld a, [hHours] @@ -627,24 +599,21 @@ InitialClearDSTFlag: ; 90a88 farcall PrintHoursMins ld hl, .IsThatOK ret -; 90ab7 -.IsThatOK: ; 0x90ab7 +.IsThatOK: ; , is that OK? text_jump UnknownText_0x1c5ff1 db "@" -; 0x90abc -DebugDisplayTime: ; 90abc +DebugDisplayTime: hlcoord 1, 14 lb bc, 3, SCREEN_WIDTH - 2 call ClearBox ld hl, .Text call PlaceHLTextAtBC ret -; 90acc -.Text: ; 0x90acc +.Text: start_asm call UpdateTime @@ -694,14 +663,12 @@ DebugDisplayTime: ; 90abc .done ld hl, .NowOnDebug ret -; 90b13 -.NowOnDebug: ; 0x90b13 +.NowOnDebug: text "<PARA>Now on DEBUG…" prompt -; 0x90b23 -.PrintTime: ; 90b23 +.PrintTime: lb bc, 1, 3 call PrintNum ld [hl], "." @@ -715,9 +682,8 @@ DebugDisplayTime: ; 90abc lb bc, PRINTNUM_LEADINGZEROS | 1, 2 call PrintNum ret -; 90b3e -PrintHour: ; 90b3e (24:4b3e) +PrintHour: ld l, e ld h, d push bc @@ -733,7 +699,7 @@ PrintHour: ; 90b3e (24:4b3e) call PrintTwoDigitNumberRightAlign ret -GetTimeOfDayString: ; 90b58 (24:4b58) +GetTimeOfDayString: ld a, c cp MORN_HOUR jr c, .nite @@ -750,12 +716,10 @@ GetTimeOfDayString: ; 90b58 (24:4b58) .day ld de, .day_string ret -; 90b71 (24:4b71) .nite_string: db "NITE@" .morn_string: db "MORN@" .day_string: db "DAY@" -; 90b7f AdjustHourForAMorPM: ; Convert the hour stored in c (0-23) to a 1-12 value |