Swordfish90 / Lemuroid

All in one emulator on Android!
GNU General Public License v3.0
2.7k stars 166 forks source link

RTC doesn't work with Gambatte Core #573

Open Helfexen opened 2 years ago

Helfexen commented 2 years ago

Describe the bug Real time clock in Game Boy Color games doesn't work.

To Reproduce Steps to reproduce the behavior:

  1. Open a game with real time clock feature, for this example I'll use Pokémon Crystal.
  2. Create a new game and set the time to anything you want.
  3. Save the game and close it.
  4. After waiting for a couple minutes open the game and you'll see that the time didn't go further, in some cases it goes back one minute but I don't know how to reproduce it.

Expected behavior Clock must keep ticking even when game is closed.

Additional context It's related to how Gambatte Core works I believe. I have tested GBA games with real time clock features and they are working fine with mGBA core in Lemuroid.

I have tested the same game in Libretro on macOS and Windows 10 and time keeps ticking, Gambatte Core creates a gamaname.rtc file in the save folder, I don't know how Lemuroid takes care of it.

Suggestion I recommend switching to the SameBoy Core for more accuracy and MBC30 support, hacking communities using SameBoy and BGB for debugging and gameplay testing. I think SameBoy saves RTC in .sav file just like mGBA and BGB so it's a little bit more convenient than keeping .srm and .rtc as separate files.

Smartphone: I asked my friends to test it on their devices so there are more than 10 devices experienced the same thing.

ledufff commented 2 years ago

I think this is related to this https://github.com/Swordfish90/Lemuroid/issues/400

It would be better if mGBA core was an alternative to Gambatte.

Edit: I tried copying the .rtc file from libretro, and it keeps the time, but it is mostly bugged when using save states

Helfexen commented 2 years ago

Edit: I tried copying the .rtc file from libretro, and it keeps the time, but it is mostly bugged when using save states

Can you also try to bring your Libretro save file to Lemuroid to see if it's recognized in Lemuroid? I just noticed it's not recognized even after changing file extension to .srm.

ledufff commented 2 years ago

Edit: I tried copying the .rtc file from libretro, and it keeps the time, but it is mostly bugged when using save states

Can you also try to bring your Libretro save file to Lemuroid to see if it's recognized in Lemuroid? I just noticed it's not recognized even after changing file extension to .srm.

I assume you have a .sav file from libretro?

try this tool, the output file has to be the 32kb one. I am still testing this, is still very unstable.

Helfexen commented 2 years ago

Renaming .sav to .srm was working fine in the past, a couple updates before the current version something went wrong with Lemuroid and it did stop recognizing them. It doesn't recognize any of my GBC saves but GBA saves are still recognized.

I have tried to reinstall almost all old versions via F-Droid but it didn't help, I think it's related to core updates.