summaryrefslogtreecommitdiff
path: root/src/rtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtc.c')
-rw-r--r--src/rtc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rtc.c b/src/rtc.c
index 3d24253b9..d73f943d2 100644
--- a/src/rtc.c
+++ b/src/rtc.c
@@ -63,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;
@@ -74,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;
@@ -83,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];