picodrive: Only honor reset and power buttons on leading edge. Works around bug where resetting every frame broke the emu

This commit is contained in:
nattthebear 2017-07-13 18:06:09 -04:00
parent a105f29d04
commit 05299c618f
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -201,16 +201,18 @@ static void Blit(void)
}
}
static uint32_t PrevButtons;
ECL_EXPORT void FrameAdvance(MyFrameInfo *f)
{
current_frame = f;
PicoInputWasRead = 0;
PicoPad[0] = f->Buttons & 0xfff;
PicoPad[1] = f->Buttons >> 12 & 0xfff;
if (f->Buttons & 0x1000000)
if ((f->Buttons & 0x1000000) > (PrevButtons & 0x1000000))
PicoPower();
if (f->Buttons & 0x2000000)
if ((f->Buttons & 0x2000000) > (PrevButtons & 0x2000000))
PicoReset();
PrevButtons = f->Buttons;
PicoFrame();
Blit();