diff --git a/asm/rtc.s b/asm/rtc.s index b1cfe0678..2dcc895e3 100644 --- a/asm/rtc.s +++ b/asm/rtc.s @@ -123,7 +123,7 @@ GameFreakRTC_ConvertYearMonthDayToNumDays: ; 802F154 subs r0, r6, 0x1 cmp r0, 0 ble @0802F1AA - ldr r1, =gUnknown_082FECCC + ldr r1, =gDaysInEachMonth adds r4, r0, 0 @0802F19C: ldm r1!, {r0} @@ -259,7 +259,7 @@ GameFreakRTC_GetRTCDateTime: ; 802F288 cmp r0, 0 beq @0802F2AC adds r1, r2, 0 - ldr r0, =gUnknown_082FECC0 + ldr r0, =gDefaultRTCInfo ldm r0!, {r2-r4} stm r1!, {r2-r4} b @0802F2B2 @@ -381,14 +381,14 @@ GameFreakRTC_TestForErrors: ; 802F2FC bl GameFreakRTC_IsLeapYear lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_082FECCC + ldr r1, =gDaysInEachMonth ldr r1, [r1, 0x4] adds r0, r1 b @0802F38E .align 2, 0 .pool @0802F384: - ldr r0, =gUnknown_082FECCC + ldr r0, =gDaysInEachMonth subs r1, r6, 0x1 lsls r1, 2 adds r1, r0 diff --git a/data/data2.s b/data/data2.s index 2c93284ec..ea412697c 100644 --- a/data/data2.s +++ b/data/data2.s @@ -1288,11 +1288,8 @@ gUnknown_082FEC90: ; 82FEC90 gUnknown_082FECA8: ; 82FECA8 .incbin "base_emerald.gba", 0x2feca8, 0x18 -gUnknown_082FECC0: ; 82FECC0 - .incbin "base_emerald.gba", 0x2fecc0, 0xc - -gUnknown_082FECCC: ; 82FECCC - .incbin "base_emerald.gba", 0x2feccc, 0x30 +; 82FECC0 + .include "data/rtc.s" gUnknown_082FECFC: ; 82FECFC .incbin "base_emerald.gba", 0x2fecfc, 0x40 diff --git a/data/rtc.s b/data/rtc.s new file mode 100644 index 000000000..2131bc325 --- /dev/null +++ b/data/rtc.s @@ -0,0 +1,30 @@ + .align 2, 0 + +gDefaultRTCInfo: ; 82FECC0 + .byte 0 ; year + .byte 1 ; month + .byte 1 ; day of month + .byte 0 ; day of week + .byte 0 ; hour + .byte 0 ; minute + .byte 0 ; second + .byte 0 ; control register value + .byte 0 ; unknown 1 + .byte 0 ; unknown 2 + .2byte 0 ; padding + + .align 2, 0 + +gDaysInEachMonth: ; 82FECCC + .4byte 31 ; January + .4byte 28 ; February + .4byte 31 ; March + .4byte 30 ; April + .4byte 31 ; May + .4byte 30 ; June + .4byte 31 ; July + .4byte 31 ; August + .4byte 30 ; September + .4byte 31 ; October + .4byte 30 ; November + .4byte 31 ; December