Skip to content

Commit

Permalink
RTC revamp (melonDS-emu#1867)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Arisotura authored Oct 30, 2023
1 parent 21590b0 commit 9a450f5
Show file tree
Hide file tree
Showing 21 changed files with 1,452 additions and 196 deletions.
8 changes: 4 additions & 4 deletions src/DSi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,10 +959,10 @@ void RunNDMAs(u32 cpu)
{
if (NDS::ARM9Timestamp >= NDS::ARM9Target) return;

if (!(NDS::CPUStop & 0x80000000)) NDMAs[0]->Run();
if (!(NDS::CPUStop & 0x80000000)) NDMAs[1]->Run();
if (!(NDS::CPUStop & 0x80000000)) NDMAs[2]->Run();
if (!(NDS::CPUStop & 0x80000000)) NDMAs[3]->Run();
if (!(NDS::CPUStop & NDS::CPUStop_GXStall)) NDMAs[0]->Run();
if (!(NDS::CPUStop & NDS::CPUStop_GXStall)) NDMAs[1]->Run();
if (!(NDS::CPUStop & NDS::CPUStop_GXStall)) NDMAs[2]->Run();
if (!(NDS::CPUStop & NDS::CPUStop_GXStall)) NDMAs[3]->Run();
}
else
{
Expand Down
18 changes: 18 additions & 0 deletions src/GPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,24 @@ void FinishFrame(u32 lines)
}
}

void BlankFrame()
{
int backbuf = FrontBuffer ? 0 : 1;
int fbsize;
if (GPU3D::CurrentRenderer->Accelerated)
fbsize = (256*3 + 1) * 192;
else
fbsize = 256 * 192;

memset(Framebuffer[backbuf][0], 0, fbsize*4);
memset(Framebuffer[backbuf][1], 0, fbsize*4);

FrontBuffer = backbuf;
AssignFramebuffers();

TotalScanlines = 263;
}

void StartScanline(u32 line)
{
if (line == 0)
Expand Down
1 change: 1 addition & 0 deletions src/GPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ void SetPowerCnt(u32 val);

void StartFrame();
void FinishFrame(u32 lines);
void BlankFrame();
void StartScanline(u32 line);
void StartHBlank(u32 line);

Expand Down
Loading

0 comments on commit 9a450f5

Please sign in to comment.