Skip to content

Difference in RTC behavior between open_agb_firm and mGBA #245

@geoku

Description

@geoku

Hello!

When I start a new save in Pokemon Ruby/Sapphire in open_agb_firm and then load it into PkHex, it shows the "Initial Time" of 1 day. Which apparently means open_agb_firm thinks it's been 1 day since 2000.01.01 when the save was started, despite my 3DS's clock (the internal RTC, not the system offset), is set to the current date.
Image

On the other hand, when I start a new save in mGBA, it has the "Initial Time" of 9326 days, which is the amount of days passed since 2000.01.01 to the current date.
Image

So this makes me wonder which behavior is correct. Does the RTC on an actual cartridge start as soon as there's battery power, even if the game is not inserted, starts ticking time from 2000.01.01 onward, and then writes the amount of days since the battery insertion as the "Initial Time" when the new game is finally started? Which seems to be the mGBA behavior.

I've read in another issue (#82 (comment)) that open_agb_firm forces RTC to correspond to current date and time set on the console, but doesn't the behavior described above contradict it? The save started in open_agb_firm thinks it started 1 day after 2000.01.01, not 9326 days, which would be correct for today's date.

This creates issues when transferring saves between open_agb_firm and mGBA (for Pokemon trading purposes). When the save from open_agb_firm is loaded in mGBA, its "Time Elapsed" immediately gets overwritten to 9325 days, which makes the in-game clock wrong and I'm not sure what additional issues it might cause.
Image

Strangely enough, the other way around is different: if the save is created in mGBA and then loaded in open_agb_firm, everything SEEMS to be fine, although I'm not sure as I didn't do much testing.

Can someone please help me undestand what's going on here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions