MEGA65 / mega65-core

MEGA65 FPGA core
Other
240 stars 85 forks source link

Setting the date when onboarding ends up inconsistent with date in BASIC #540

Closed mindrail closed 1 year ago

mindrail commented 2 years ago

Setting the date in onboarding makes the date one day too far ahead when booted and displaying date in basic.

Note. If you then CONFIGURE the MEGA65 and set the date that way, it retains the correct date and stays consistent.

Using ROM V920349

lydon42 commented 2 years ago

There seems to be a plus minus one problem going on. RTC is set to 11.05.2022. Rebooting into Onboarding shows 10.05.2022. Setting to 11.05.2022 in onboarding. Reboot into configure. Configure shows 12.05.2022.

So this has to be fixed in the onboarding part.

lydon42 commented 2 years ago

The +/-1 is actually in mega65-libc time.c getrtc/setrtc. This is used by onboard.c

mega65_config.s doesn't do this and the closed ROM neither. The close rom even skips the rest of date decoding if the day is zero (if I read correctly), so a day of 1 set in onboard, will give another kind of error.

Now the question is: which is correct?

lydon42 commented 2 years ago

fixed in mega65-libc and updated with commit 82723e7dc48c7c7c0a0074053f7acf5c49ed789f