Skip to content

Commit

Permalink
more aggressive frameskip
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfloogle committed Dec 14, 2024
1 parent de5dbed commit 3989be8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/3ds/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ int main(void) {
int frame = 0;
int err = 0;
bool on_time = false;
bool just_lagged = false;
PrintConsole main_console;
#if DEBUGLEVEL == 0
PrintConsole debug_console;
Expand Down Expand Up @@ -138,16 +139,15 @@ int main(void) {
if (C3D_FrameBegin(C3D_FRAME_NONBLOCK)) {
guiUpdate(osTickCounterRead(&frameTickCounter), osTickCounterRead(&drcTickCounter));

if (tVIPREG.DPCTRL & 0x0002) {
// if we just had a lagframe on which drawing happened, don't draw
if ((tVIPREG.DPCTRL & 0x0002) && (!on_time || !just_lagged)) {
video_render(alt_buf, on_time);
on_time = true;
} else if (on_time) {
if (tVBOpt.ANTIFLICKER) video_flush(false);
on_time = false;
}
C3D_FrameEnd(0);
} else {
on_time = false;
}
if (tVIPREG.XPCTRL & 0x0002) {
if (tDSPCACHE.DDSPDataState[alt_buf] != GPU_CLEAR) {
Expand Down Expand Up @@ -195,7 +195,8 @@ int main(void) {
osTickCounterUpdate(&frameTickCounter);

if (!tVBOpt.FASTFORWARD) {
if (lag_frames <= 0) {
just_lagged = lag_frames > 0;
if (!just_lagged) {
svcWaitSynchronization(frame_event, 20000000);
lag_frames = 1;
}
Expand Down

0 comments on commit 3989be8

Please sign in to comment.