diff options
Diffstat (limited to 'src/rtc.c')
-rw-r--r-- | src/rtc.c | 24 |
1 files changed, 4 insertions, 20 deletions
@@ -1,5 +1,4 @@ #include "global.h" -#include "siirtc.h" #include "rtc.h" #include "string_util.h" #include "text.h" @@ -29,19 +28,6 @@ static const s32 sNumDaysInMonths[12] = 31, }; -void RtcDisableInterrupts(); -void RtcRestoreInterrupts(); -u32 ConvertBcdToBinary(u8 bcd); -bool8 IsLeapYear(u8 year); -u16 ConvertDateToDayCount(u8 year, u8 month, u8 day); -u16 RtcGetDayCount(struct SiiRtcInfo *rtc); -void RtcGetInfo(struct SiiRtcInfo *rtc); -void RtcGetDateTime(struct SiiRtcInfo *rtc); -void RtcGetStatus(struct SiiRtcInfo *rtc); -void RtcGetRawInfo(struct SiiRtcInfo *rtc); -u16 RtcCheckInfo(struct SiiRtcInfo *rtc); -void RtcCalcTimeDifference(struct SiiRtcInfo *rtc, struct Time *result, struct Time *t); - void RtcDisableInterrupts() { sSavedIme = REG_IME; @@ -77,9 +63,8 @@ u16 ConvertDateToDayCount(u8 year, u8 month, u8 day) s32 i; u16 dayCount = 0; -#if (REVISION < 2) - // Revisions 0 and 1 don't add days for the year 2000, - // causing the berry glitch. +#ifndef BUGFIX_BERRY + // The berry glitch was caused by not adding days for the year 2000. for (i = year - 1; i > 0; i--) { dayCount += 365; @@ -88,8 +73,7 @@ u16 ConvertDateToDayCount(u8 year, u8 month, u8 day) dayCount++; } #else - // Revision 2 has "i >= 0" as the condition instead of "i > 0", - // which fixes the issue. + // The fix was to use "i >= 0" as the condition instead of "i > 0". for (i = year - 1; i >= 0; i--) { dayCount += 365; @@ -97,7 +81,7 @@ u16 ConvertDateToDayCount(u8 year, u8 month, u8 day) if (IsLeapYear(i) == TRUE) dayCount++; } -#endif +#endif // BUGFIX_BERRY for (i = 0; i < month - 1; i++) dayCount += sNumDaysInMonths[i]; |