New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GBA] Enable writing RTC state/saving in save file #240
Comments
Strange, it seems to work on my end. Which version of mGBA are you running, and on what OS? |
I'm using mGBA 0.4.0 on Windows 7 64bit |
I won't have a chance to test on that OS until tonight, but in the meantime, make sure you have a clean ROM and not one patched for any reason. |
I recently tried a nightly of mGBA (0.5-3783-9eb8faf) and I am still having the issue. My ROM is not patched (CRC32: a646601b). While you can use the emulator options to tweak the RTC time or manually change your windows time, you cannot set the time using the in-game menu option. Also, the game time seems to be off from the sensor time by 6 hours when set to "Fixed time" and "Start time at". However, "System time" is not off by 6 hours |
I'm guessing you're in EST? Timezones might be screwing this up. As for the actual timer issue, I misunderstood your request. mGBA does not save the value stored back into the RTC by the game, which does in fact cause some issues on the GB games that use the RTC. Right now, the best way to work around this is to use the "start time at" setting every time you load the game. This will keep the time incrementing properly, but you get to set what time the game thinks it is when you boot it. I'll see if I can improve this behavior in the future. |
Partially fixed by ffa7e9b, but to save the value you set the RTC to would require changes to the savegame format. |
Retargeting this bug report for adding RTC writeback (which is not what the Pokemon games use for some reason), since the other stuff seems to have been fixed by now. |
@lesserkuma I personally think saving the RTC as offset would be easier to work with. |
@profi200 |
I thought the Pokémon games reset the RTC to 2000.1.1 00:00 each time you start a new game? But yeah, these games don't use the day of week counter. I have not pushed it yet but i implemented the weekday stuff (0 = sunday like most RTCs). https://gist.github.com/profi200/8c617f3ea4366474cb3ffcb54e41393a |
Just re-tested it with a retail Pokémon Ruby cartridge! Just starting a new game keeps the old RTC values, but when pushing SELECT+UP+B on the title screen, deleting everything and then starting a new game, this will reset the RTC back to 2000/1/1 00:00:00 @ Sunday. When synchronizing/forward-adjusting the RTC values in software, one could count the days passed since the timestamp and then do |
Yeah, that should work. I guess we will go with that format then. Annoying for me since i have to convert back and forth multiple times. I only have BCD and that weird offset in hardware. No unix like timestamps. As for embedding the RTC data in save files i'm still not sure but it's probably the most compatible and (from an end user perspective) the easiest. |
In Rockman EXE 4.5 Real Operation there is a menu option for setting the RTC time. On console, when you start a new game it asks you to set the time. You can then go back at anytime to the main menu and change the time at the cost of in-game money and removal from on-going story events. However in mGBA (and every other GBA emulator I have tested) setting the RTC through "New Game" and the mentioned menu option does nothing, regardless of "Gamepack sensors" settings.
How to recreate:
Due to all the events in the game being based on the RTC, it gets really annoying to mess with your system time (often causing issues with other programs that rely on it). I'd really like to see an emulator support it as it works on console.
(Not sure this will help but when testing the game in VBA-RR, setting the RTC through "New game" and main menu causes an "Unknown RTC command 64" error.)
The text was updated successfully, but these errors were encountered: