summaryrefslogtreecommitdiff
path: root/src/rtc.c
diff options
context:
space:
mode:
authorJaceCearK1 <JaceCearK1@users.noreply.github.com>2017-07-01 21:04:18 +0200
committerGitHub <noreply@github.com>2017-07-01 21:04:18 +0200
commit0dd804a99e5455a0eac8ff6ed87d9de16c7380b7 (patch)
tree7b3567978b63ee6548a7b945e075ea8ba37bef51 /src/rtc.c
parentf1344efd2aff92292f58f7323bd9297a38fe9b02 (diff)
parent8d82578d3a101b06f9d2ced31738021007c4e533 (diff)
Merge pull request #1 from pret/master
Update fork to match main fork.
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];