Gameboy/GBC Real-Time Clock Support

User avatar
Moondandy
Top Contributor
Posts: 535
Joined: Mon May 25, 2020 2:14 am
Location: Edinburgh, Scotland
Has thanked: 32 times
Been thanked: 97 times

Gameboy/GBC Real-Time Clock Support

Unread post by Moondandy »

Following on from a discussion on the discord, I thought I would make a post here and raise a ticket so it's not forgotten about again.

Currently the GB/GBC core does not have RTC support, although the work was done in branch awhile back (but it may no longer be compatible) the work need to be done to save RTC bytes to the SD card.

The following games would benefit from the RTC:

Real-Time Clock: Games using the MBC3 mapper and a crystal oscillator to keep an accurate clock even with the game boy off.

Barcode Taisen Bardigun
Bokujo Monogatari GB / Harvest Moon GB
Cardcaptor Sakura - Itsumo Sakura-chan to Issho
E.T. - The Extra-Terrestrial - Digital Companion
The Great Battle Pocket
Itsudemo! Nyan to Wonderful
Kandzume Monsters
Keitai Denjuu Telefang - Power/Speed Version
Mary-Kate and Ashley - Pocket Planner
Nikkan Berutomo Club
Pokemon Gold/Silver/Crystal (All regions, all versions)
Tottoko Hamtaro - Tomodachi Daisakusen Dechu
Trade & Battle Card Hero

https://github.com/MiSTer-devel/Gameboy ... issues/131
FPGAzumSpass
Core Developer
Posts: 380
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 38 times
Been thanked: 383 times

Re: Gameboy/GBC Real-Time Clock Support

Unread post by FPGAzumSpass »

I made the RTC implementation last year.
Here are the changes:

https://github.com/RobertPeip/Gameboy_M ... 4b21d65ec0

Testroms(with code) i used to verify it is attached.


Completing it is probably not that hard, it just needs to save some additional bytes to sdcard, together with the savegame, like the GBA version does.(Rysha did the saving part for GBA)
Still understanding how the framework works and a lot of testing is required, so existing saves don't get corrupted.
If someone wants to dig into, i can support.
Attachments
mbc3_rtc_prelim.zip
(73.06 KiB) Downloaded 377 times
FPGAzumSpass
Core Developer
Posts: 380
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 38 times
Been thanked: 383 times

Re: Gameboy/GBC Real-Time Clock Support

Unread post by FPGAzumSpass »

I implemented this one now with saving to sdcard.
You can try with this testversion attached.

In case you are worried about bugs, please backup the savegames of the games you try.

Will do a pull request the next days in case noone reports problems.
User avatar
Moondandy
Top Contributor
Posts: 535
Joined: Mon May 25, 2020 2:14 am
Location: Edinburgh, Scotland
Has thanked: 32 times
Been thanked: 97 times

Re: Gameboy/GBC Real-Time Clock Support

Unread post by Moondandy »

Live in the core now, thanks for adding this!
Post Reply