mirror of
https://github.com/risingPhil/libpokemegb.git
synced 2026-04-26 02:02:32 -05:00
Merge remote-tracking branch 'origin/feature/add-support-for-localized-versions' into feature/add-japanese-distribution-pokemon
This commit is contained in:
commit
3aab06c977
|
|
@ -229,6 +229,12 @@ public:
|
|||
* Don't forget to call finishSave() after using this function!
|
||||
*/
|
||||
void setEventFlag(uint16_t flagNumber, bool enabled);
|
||||
|
||||
/**
|
||||
* @brief This function will change an SRAM field to let gen 2 games prompt you
|
||||
* to reconfigure the game clock
|
||||
*/
|
||||
void resetRTC();
|
||||
protected:
|
||||
private:
|
||||
IRomReader &romReader_;
|
||||
|
|
|
|||
|
|
@ -863,4 +863,18 @@ void Gen2GameReader::setEventFlag(uint16_t flagNumber, bool enabled)
|
|||
}
|
||||
|
||||
saveManager_.writeByte(resultVal);
|
||||
}
|
||||
|
||||
void Gen2GameReader::resetRTC()
|
||||
{
|
||||
// The game checks bit 7 on the sRTCStatusFlags field in SRAM
|
||||
// this is set when the game detects wrong RTC register values.
|
||||
// In order to let the game prompt to reconfigure the RTC clock, we just have to set this bit
|
||||
// Based on sRTCStatusFlags, RecordRTCStatus, .set_bit_7 in
|
||||
// https://github.com/pret/pokecrystal
|
||||
// https://github.com/pret/pokegold
|
||||
const uint8_t rtcStatusFieldValue = 0xC0;
|
||||
|
||||
saveManager_.seekToBankOffset(0, 0xC60);
|
||||
saveManager_.writeByte(rtcStatusFieldValue);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user