Skip to content

Commit

Permalink
Merge branch 'kbeckmann:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
olderzeus authored Dec 24, 2021
2 parents 2effeb7 + 5f1dd2b commit 2750269
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nofrendo-go/components/nofrendo/nes/nes.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ INLINE void renderframe()
/* main emulation loop */
void nes_emulate(void)
{
bool first_iteration = true;

// Discard the garbage frames
renderframe();
renderframe();

osd_loadstate();

while (false == nes.poweroff)
{
osd_getinput();
Expand All @@ -107,6 +107,12 @@ void nes_emulate(void)
// osd_submit_audio(apu.buffer, apu.samples_per_frame);

osd_vsync();

// Some games require one emulation iteration to be performed before being able to load properly
if (first_iteration) {
first_iteration = false;
osd_loadstate();
}
}
}

Expand Down

0 comments on commit 2750269

Please sign in to comment.