sy2002 / MiSTer2MEGA65

Framework to simplify porting MiSTer (and other) cores to the MEGA65
GNU General Public License v3.0
34 stars 8 forks source link

Add support for RTC in M2M: Firmware #30

Open sy2002 opened 8 months ago

sy2002 commented 8 months ago

As soon as we support the RTC in hardware (https://github.com/sy2002/MiSTer2MEGA65/issues/29) then we can start tackling it in the firmware.

One obvious idea what the firmware can do with an RTC is:

Files on the SD card (FAT32) that are written to/changed, for example disk images, can showing the updated date/time in future.

Maybe there are even more ideas.

The firmware part is not a low hanging fruit for the R4/R5 surge.

MJoergen commented 8 months ago

What kind of interface (with the QNICE) should we agree on? I'm thinking about reserving a page in sys_info, where basically the entire register map of the RTC is mirrored. In other words, setting page to C_SYS_RTC, and then reading from 0x7001 to 0x7007 would give the current date/time.

However, this exposes the register map of the particular device, and therefore the firmware must know and distinguish between the different types.

The other option is to have this logic entirely within the VHDL code. Then we would instead just present to the firmware a generic date/time value, e.g. a 32-bit value "seconds since 1970" like in Unix.