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:
Arisotura
2023-10-30 18:37:49 +01:00
committed by GitHub
parent 21590b0709
commit 9a450f5f28
21 changed files with 1470 additions and 214 deletions

View File

@ -37,6 +37,7 @@ enum
Event_LCD = 0,
Event_SPU,
Event_Wifi,
Event_RTC,
Event_DisplayFIFO,
Event_ROMTransfer,
@ -122,6 +123,33 @@ enum
IRQ2_DSi_MicExt
};
enum
{
CPUStop_DMA9_0 = (1<<0),
CPUStop_DMA9_1 = (1<<1),
CPUStop_DMA9_2 = (1<<2),
CPUStop_DMA9_3 = (1<<3),
CPUStop_NDMA9_0 = (1<<4),
CPUStop_NDMA9_1 = (1<<5),
CPUStop_NDMA9_2 = (1<<6),
CPUStop_NDMA9_3 = (1<<7),
CPUStop_DMA9 = 0xFFF,
CPUStop_DMA7_0 = (1<<16),
CPUStop_DMA7_1 = (1<<17),
CPUStop_DMA7_2 = (1<<18),
CPUStop_DMA7_3 = (1<<19),
CPUStop_NDMA7_0 = (1<<20),
CPUStop_NDMA7_1 = (1<<21),
CPUStop_NDMA7_2 = (1<<22),
CPUStop_NDMA7_3 = (1<<23),
CPUStop_DMA7 = (0xFFF<<16),
CPUStop_Wakeup = (1<<29),
CPUStop_Sleep = (1<<30),
CPUStop_GXStall = (1<<31),
};
struct Timer
{
u16 Reload;
@ -219,6 +247,7 @@ extern MemRegion SWRAM_ARM9;
extern MemRegion SWRAM_ARM7;
extern u32 KeyInput;
extern u16 RCnt;
const u32 ARM7WRAMSize = 0x10000;
extern u8* ARM7WRAM;