Commit: c25847a00f196569bc4f0e664ddaeff28ce1af2c Parent: 09cf146528c9104baa77650dee2df54b868cd452 Author: Vi Grey Date: 2022-08-26 00:57 UTC Summary: Fix Year 3 AM on Jewish Calendar CHANGELOG.md | 4 ++++ README.md | 27 +++++++++++++++++++++++---- SHA256SUMS.txt | 10 +++++----- bin/calendar_dot_exe.nes | Bin 24592 -> 24592 bytes src/jewish.asm | 2 +- src/start.asm | 2 +- 6 files changed, 34 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dcba91..b0e70d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log All notable changes to this project will be documented in this file. +## 0.0.6 - 2022-06-25 +### Fixed +- Jewish calendar year 3 AM starting 1 day too late for year 2 AM to work + ## 0.0.5 - 2022-06-24 ### Changed - Default year in start screen to 2023 diff --git a/README.md b/README.md index d2ffd02..d801b67 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ Chalakim = 1 / 1080 of an hour * If era is -AM * For every month before the Molad Tishrei of 2 AM, subtract 29 days 12 hours 793 chalakim * Set Tishrei 1 to the Molad Tishrei - * If era is AM and year is greater than or equal to 3 + * If era is AM and year is greater than 3 * If the Molad Tishrei is on or after 18 hours 0 chalakim, postpone Tishrei 1 by 1 day * If Tishrei 1 is now on a Sunday, Wednesday, or Friday, postpone Tishrei 1 by 1 day * If the Molad Tishrei is on a Sunday, Wednesday, or Friday, postpone Tishrei 1 by 1 day @@ -142,6 +142,7 @@ Chalakim = 1 / 1080 of an hour * If the Molad Tishrei is on or after 18 hours 0 chalakim, postpone Tishrei 1 by 1 day * If era is -AM * If the Molad Tishrei is on or after 18 hours 0 chalakim, postpone Tishrei 1 by 1 day + * If era is AM and year is 3, postpone Tishrei by 1 day * Find Tishrei 1 of the year after the current year (same steps as above, but for the year after the current year) * If current year is a Leap Year * If next year's Tishrei 1 is the same weekday as this year's Tishrei 1, both Cheshvan and Kislev with have 30 days @@ -152,13 +153,31 @@ Chalakim = 1 / 1080 of an hour * If next year's Tishrei 1 is 3 weekdays before this year's Tishrei 1, Cheshvan will have 29 days and Kislev with have 30 days * All other cases result in both Cheshvan and Kislev having 29 days +#### Jewish Calendar Rules Written in a More Human Readable Format: +1. If the molad Tishrei occurs on a Sunday, Wednesday, or Friday, postpone Tishrei 1 by 1 day. +2. If the molad Tishrei occurs on or after 18 hours 0 chalakim, postpone Tishrei 1 by 1 day. If this causes Tishrei 1 to land on a Sunday, Wednesday, or Friday, postpone Tishrei 1 by a second day. +3. If the molad Tishrei on a year that is not a leap year occurs on Tuesday at or after 9 hours 204 chalakim, postpone Tishrei 1 by 2 days. +4. If the molad Tishrei on a year immediately after a leap year occurs on Monday at or after 15 hours 589 chalakim, postpone Tishrei 1 by 1 day. + +Rule 1 exists to prevent Yom Kippur from landing on a Friday or Sunday and to prevent Hoshana Rabbah from landing on a Saturday (Shabbat). If Yom Kippur landed on a Friday, then fasting would be followed by a day where meals cannot be prepared. If Yom Kippur landed on a Sunday, then a meal could not be prepared to break the fast on Yom Kippur the day before Yom Kippur. Hoshana Rabbah has a tradition involving beating willow twigs, which would be considered work and could not be done on Shabbat. + +Rule 2 exists in order for the crescent moon to be visible on Tishrei 1. + +Rule 3 exists because the molad Tishrei of the following previous would have occurred on Saturday on or after 18 hours 0 chalakim, which would postpone Tishrei 1 of that year to Sunday, which would cause it to be postponed 1 more day into Monday. That would cause the year before the next year to be 356 days, which is too long. + +Rule 4 exists because the molad Tishrei of the previous year would have occurred on Tuesday on or after 18 hours 0 chalakim, which would have postponed Tishrei 1 of that year to Wednesday, which would cause it to be postponed 1 more day into Thursday. That would cause the previous year to be 382 days, which is too short. + #### **WARNING - BRIEF THEOLOGICAL CONTENT FOR CONTEXT** -The rule about Tishrei 1 being postponed if it would have landed on a Sunday, Wednesday, or Friday is to prevent Yom Kippur from landing on a Friday or Sunday and to prevent Hoshana Rabbah from landing on a Saturday (Shabbat). If Yom Kippur landed on a Friday, then fasting would be followed by a day where meals cannot be prepared. If Yom Kippur landed on a Sunday, then a meal could not be prepared to break the fast on Yom Kippur the day before Yom Kippur. Hoshana Rabbah has a tradition involving beating willow twigs, which would be considered work and could not be done on Shabbat. +Year 2 AM ignores rules 1, 3, and 4. Year 2's Molad Tishrei is Friday 14 Hours 0 Chalakim, which is set at the creation time of Adam. Being on a Friday would push Tishrei 1, even though Tishrei 1 on year 2 AM is specified as the day Adam was made. This would normally cause an issue, but the only reason Tishrei 1 is postponed is when the Molad Tishrei is Friday or Sunday is because Yom Kippur involves a fast due to attone for the sins of the previous year. Because Adam and Eve were not around in year 1, there would be no reason to observe Yom Kippur in year 2. Because Yom Kippur wouldn't have been observed that year, there wouldn't be a reason to postpone Tishrei 1 by 1 day, which allows Tishrei 1 of 2 AM to be a Friday and match with the creation of Adam. + +Year 1 AM and all -AM years ignore rules 1, 3, and 4 for the same reason as year 2 AM, due to Yom Kippur not being observed those years. Year 1 AM and all -AM years also ignore the Wednesday part of rule 1 as well because Hoshana Rabbah is a holiday that involves judgement for sins, which wouldn't have been committed yet. + +Year 3 AM is forced to ignore rules 1, 3, and 4, otherwise year 2 AM would be 356 days, which is too long. -Year 2 AM ignores the Sunday and Friday part of that rule. Year 2's Molad Tishrei is Friday 14 Hours 0 Chalakim, which is set at the creation time of Adam. Being on a Friday would push Tishrei 1, even though Tishrei 1 on year 2 AM is specified as the day Adam was made. This would normally cause an issue, but the only reason Tishrei 1 is postponed is when the Molad Tishrei is Friday or Sunday is because Yom Kippur involves a fast due to attone for the sins of the previous year. Because Adam and Eve were not around in year 1, there would be no reason to observe Yom Kippur in year 2. Because Yom Kippur wouldn't have been observed that year, there wouldn't be a reason to postpone Tishrei 1 by 1 day, which allows Tishrei 1 of 2 AM to be a Friday and match with the creation of Adam. +That means all of the rules apply to years 4 AM and above and only rule 2 applies to years before 4 AM. -Year 1 AM and all -AM years ignore the Sunday and Friday part of the rule for the same reason as year 2 AM, due to Yom Kippur not being observed those years. Year 1 AM and all -AM years also ignore the Wednesday part of the rule because Hoshana Rabbah is a holiday that involves judgement for sins, which wouldn't have been committed yet. +Rule 4 wouldn't actually apply to year 4 AM, due to Tishrei 1 of year 3 AM not being on a Thursday. Rule 1 would still apply to year 4 AM though, which would cause Tishrei 1 of year 4 AM to be postponed by 1 year anyways. Had the molad Tishrei of year 4 AM been on or after 15 hours 589 chalakim and before 18 hours 0 chalakim, an argument could easily be made that Tishrei 1 of year 4 AM should be on Monday instead of Tuesday. Thankfully we can avoid that argument because of rule 1. #### **WARNING (FINISHED) - BRIEF THEOLOGICAL CONTENT FOR CONTEXT** diff --git a/SHA256SUMS.txt b/SHA256SUMS.txt index 60bfb34..065237e 100644 --- a/SHA256SUMS.txt +++ b/SHA256SUMS.txt @@ -1,9 +1,9 @@ 1dee9843850467e11e6498d5cdb038db3c9566c00afc7afa2ce82f67f145b75a .gitignore -3e68f7b6b75eca3b7f0db3bd39130a7d39d4a71d56fb5adc0fc2bd21b1673b9e CHANGELOG.md +634088d9c8fa8dae7249bb0c24593c6a8c8410bb96572698d5b96f2b75a15996 CHANGELOG.md f0c473d84741402de3824c616e1e3663e49d352c192f4f09b6e43b7f8bd8da88 LICENSE 047b195f25381e5db79e1015c7cb3633c122d215d166f85fb91e882694358aa0 Makefile -6e222d60222e345adc8ac0b708f9d3db612743b6f6e545966a15cced8d32a5c5 README.md -94db0d1455ac347551492583fa929e894b53dfc96451eaf15b682d12781fbe98 bin/calendar_dot_exe.nes +369f059e81ad7d02f959533030cc1ae1e0d33ae769867450371dd42810185b16 README.md +67ab2404d9bac67a7ebc6dcd8a40816964f30539074517894333627f4491f310 bin/calendar_dot_exe.nes 1e024cbc90486bb8bf0fdc258110ddb88344080c456551357fc86cd28ed53696 src/alphanum.asm e6fae483791b3eec96ec1bfa75916a9bf4179e525a10c5455036668fd31dcc16 src/calendar_dot_exe.asm 3daef5d60334da623839ea92cbc68c051a7f7bda7de569635e40d5f46f249780 src/calendars.asm @@ -15,7 +15,7 @@ f01e0a01ff1d3dba0eed8fb7019726ebef36490a733d84c1fcfab52d8600fbc7 src/defs.asm 8a2a8611e2d8f292331822d88bd8762060a599c9bc8607f4bc329121ed58c5c1 src/frames.asm 4f60fa82d38d963476fc93d66de82f9892261d64b084af4889447e9c76f5faec src/graphics.asm be8a1d5421b479eac2d5a256e0d1ea2a2fdee4a320e65cb0311f0df46d277cf3 src/gregorian.asm -775005969a2033dcdd1833a6df142a95a7541b72c01ef04c74dae1e3eaffde72 src/jewish.asm +0d2d9aba56bae1efaec6b8a4adbc75b512e86a13d7815f22b16eb31dce3f92bf src/jewish.asm 6515ea8ad2d5759fb629610a7b02266fb3598868f23bd339e18321412769b93a src/julian.asm da6a76822f22e0fef23a5f0a45c13a6be9510da8474035688d251db348b8afde src/leap-year.asm f29d90c19806e9e6a942db7c09b27dcbb2213b599b11bd01a6a87e58ad43959d src/macrobius.asm @@ -25,7 +25,7 @@ dae0ed60bea19c6f58e6105e1a212c8656fc21aab31c0ae0ace32d6fd3415bc0 src/months.asm 2da05cfa9841b88b0a3731df315d5e8cbe7ae158bedc921ac495c9f7d206642a src/parkera.asm 5c7b0e519bca4c85b450b4f9cb44502e6a57be22c7a3a33eb68b8e025b1aa3d8 src/prg.asm d485f77129d0affef09f34321d841428b77e8ac296b949dc9b8ac0d17bc9a75b src/ram.asm -a59dba2a87cdf73690010920aef7fda484fee317485f3db91b6303485eed1552 src/start.asm +0e466c7e5a7c091c5f00826de142a48832cd36d9d852e86cef4ecdbecc89ca21 src/start.asm 388794b398b954961b30de77e390d36431ad1b056f7484bff881b94466f45be6 src/year.asm fc56c6164d414129d0341bb6c4092e39e536118f982f12102f3e46010212ddd1 src/graphics/calendar.nam e84832e79458c59ddf17ff23ae3003f8fca4e4417c3b84e2aef09e33b260a9f5 src/graphics/palettes.pal diff --git a/bin/calendar_dot_exe.nes b/bin/calendar_dot_exe.nes index b25c58c..b53f784 100644 Binary files a/bin/calendar_dot_exe.nes and b/bin/calendar_dot_exe.nes differ diff --git a/src/jewish.asm b/src/jewish.asm index 7c97122..1d888de 100644 --- a/src/jewish.asm +++ b/src/jewish.asm @@ -798,7 +798,7 @@ GetTishriPostponeHour18Done: lda (year + 4) bne GetTishriPostponeCheckDay035 lda (year + 5) - cmp #$03 + cmp #$04 bcs GetTishriPostponeCheckDay035 GetTishriPostponeBefore2AM: ; tishriePostpone = $09 diff --git a/src/start.asm b/src/start.asm index 7964eea..3e3d88a 100644 --- a/src/start.asm +++ b/src/start.asm @@ -33,7 +33,7 @@ StartMenuTitle: .byte "CALENDAR[DOT[EXE" StartMenuVersion: - .byte " v0.0.5" + .byte " v0.0.6" StartMenuTitleBoxTop: .byte $C0, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C1, $C3, $00, $00