• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other] Pokemon Crystal - Finding initial time set in WRAM

UmbraMooh

Elite
  • 4
    Posts
    11
    Years
    Hi everyone,

    I've been helping out with an ESP32-based GBC emulator to add time synchronization using an external hardware RTC chip, primarily focusing on Pokemon Crystal.

    The emulator is based on gnuboy, so directly changing the time values is simple; however, there's an offset based on the time you set at the start of the game (i.e., setting 4:20 AM on Wednesday makes that time correspond to Day 0 at 0:00:00). Because of this, directly setting the time from the RTC chip results in an incorrect in-game time.

    From the Pokemon Crystal decompilation on Github, the values you set at the start of the game are loaded in WRAM (wStartDay, wStartHour, etc.). This would be incredibly helpful for making an algorithm to compensate for the offset. Unfortunately, debugging in bgb and searching for the time values in hex hasn't turned up anything. Does anyone have any experience with how the real time clock works in Crystal and the memory addresses related to it?
     
    Back
    Top