mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 07:10:00 -06:00
RTC revamp (#1867)
* get this started * implement DSi RTC commands * set up RTC clock timer. lay down basic idea of a clock. * make the date/time registers writable * move RTC state to its own structure, to make it easier to deal with * more RTC work lay base for date/time dialog * get the bulk of the RTC functionality going * much simpler design for RTC stuff * aha, that is what it is * start working on the RTC IRQ * implement all types of RTC IRQ * start refining sleep mode. code still kinda sucks. * implement keypad IRQ * refine it some more * shut the fuck uuuuuupppppppppppppp
This commit is contained in:
29
src/RTC.h
29
src/RTC.h
@ -25,11 +25,40 @@
|
||||
namespace RTC
|
||||
{
|
||||
|
||||
struct StateData
|
||||
{
|
||||
u8 StatusReg1;
|
||||
u8 StatusReg2;
|
||||
u8 DateTime[7];
|
||||
u8 Alarm1[3];
|
||||
u8 Alarm2[3];
|
||||
u8 ClockAdjust;
|
||||
u8 FreeReg;
|
||||
|
||||
u8 IRQFlag;
|
||||
|
||||
// DSi registers
|
||||
u32 MinuteCount;
|
||||
u8 FOUT1;
|
||||
u8 FOUT2;
|
||||
u8 AlarmDate1[3];
|
||||
u8 AlarmDate2[3];
|
||||
};
|
||||
|
||||
bool Init();
|
||||
void DeInit();
|
||||
void Reset();
|
||||
void DoSavestate(Savestate* file);
|
||||
|
||||
void GetState(StateData& state);
|
||||
void SetState(StateData& state);
|
||||
void GetDateTime(int& year, int& month, int& day, int& hour, int& minute, int& second);
|
||||
void SetDateTime(int year, int month, int day, int hour, int minute, int second);
|
||||
void ResetState();
|
||||
|
||||
void ScheduleTimer(bool first);
|
||||
void ClockTimer(u32 param);
|
||||
|
||||
u16 Read();
|
||||
void Write(u16 val, bool byte);
|
||||
|
||||
|
Reference in New Issue
Block a user