DMA timing renovation (#1207)

* make timers usable for measurement shito without being assfuckingly unreliable

* bürp

* Arisotura can you ever clean up your goddamn code

also regroup the timer code instead of having it split weirdly

* make the set-timing functions a tad less hacky

* congrats Arisotura you made an ass-enum

* add timing region tables, and separate timings for ARM9 DMA (exempt of 3c penalty)

* temp work on DMA timings, not finished

also, did you know? 'increment/reload' is also a thing for the source address

* begin work

* add some of the GBA slot/wifi timings

* complete it, I guess

* make some progress

* getting somewhere

* sdsdfs

* see, Arisotura, was it that hard? blarg.
This commit is contained in:
Arisotura
2021-08-31 02:28:34 +02:00
committed by GitHub
parent e1f3fc75ea
commit d20543c119
8 changed files with 786 additions and 217 deletions

View File

@ -129,6 +129,33 @@ struct Timer
u32 CycleShift;
};
enum
{
Mem9_ITCM = 0x00000001,
Mem9_DTCM = 0x00000002,
Mem9_BIOS = 0x00000004,
Mem9_MainRAM = 0x00000008,
Mem9_WRAM = 0x00000010,
Mem9_IO = 0x00000020,
Mem9_Pal = 0x00000040,
Mem9_OAM = 0x00000080,
Mem9_VRAM = 0x00000100,
Mem9_GBAROM = 0x00020000,
Mem9_GBARAM = 0x00040000,
Mem7_BIOS = 0x00000001,
Mem7_MainRAM = 0x00000002,
Mem7_WRAM = 0x00000004,
Mem7_IO = 0x00000008,
Mem7_Wifi0 = 0x00000010,
Mem7_Wifi1 = 0x00000020,
Mem7_VRAM = 0x00000040,
Mem7_GBAROM = 0x00000100,
Mem7_GBARAM = 0x00000200,
// TODO: add DSi regions!
};
struct MemRegion
{
u8* Mem;
@ -138,8 +165,10 @@ struct MemRegion
extern int ConsoleType;
extern int CurCPU;
extern u8 ARM9MemTimings[0x40000][4];
extern u8 ARM9MemTimings[0x40000][8];
extern u32 ARM9Regions[0x40000];
extern u8 ARM7MemTimings[0x20000][4];
extern u32 ARM7Regions[0x20000];
extern u32 NumFrames;
extern u32 NumLagFrames;
@ -191,8 +220,8 @@ void Stop();
bool DoSavestate(Savestate* file);
void SetARM9RegionTimings(u32 addrstart, u32 addrend, int buswidth, int nonseq, int seq);
void SetARM7RegionTimings(u32 addrstart, u32 addrend, int buswidth, int nonseq, int seq);
void SetARM9RegionTimings(u32 addrstart, u32 addrend, u32 region, int buswidth, int nonseq, int seq);
void SetARM7RegionTimings(u32 addrstart, u32 addrend, u32 region, int buswidth, int nonseq, int seq);
// 0=DS 1=DSi
void SetConsoleType(int type);