AgonConsole8 / agon-mos

Official AGON QUARK Firmware for Console8: eZ80 MOS
MIT License
25 stars 10 forks source link

Timestamps written on files are incorrect. #68

Open lennart-benschop opened 3 months ago

lennart-benschop commented 3 months ago

Even if one takes the trouble to set the system time using the TIME command, files that are subsequently written get a bogus timestamp.

Like 2001/11/09 12:00 for a file that was written today (2024/05/09 19:26) TIME was set correctly and shows the correct date & time.

dir -l

does show correct timestamps on files written by an external computer. When mounting the SD card in an external computer, it shows the same bogus time stamps as Agon, for those files written on Agon.

lennart-benschop commented 3 months ago

Root cause is: function get_fattime() in src_fatfs/diskio.c returns the time&data info from an 8-byte RTC structure (not packed), while modern VDP versions return a 6-byte packed RTC structure. See for example src/clock.c function rtc_unpack().