UmbraMooh
Elite
- 4
- Posts
- 12
- Years
- United States
- Seen May 10, 2021
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?
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?