GTK+, Unix: Preserve current joypad state when rewinding.

This commit is contained in:
Brandon Wright 2018-06-16 17:31:41 -05:00
parent de593cbe6f
commit e49dcc0cb2
2 changed files with 18 additions and 0 deletions

View File

@ -352,7 +352,16 @@ S9xIdleFunc (gpointer data)
#endif
if(Settings.Rewinding)
{
uint16 joypads[8];
for (int i = 0; i < 8; i++)
joypads[i] = MovieGetJoypad(i);
Settings.Rewinding = stateMan.pop();
for (int i = 0; i < 8; i++)
MovieSetJoypad (i, joypads[i]);
}
else if(IPPU.TotalEmulatedFrames % gui_config->rewind_granularity == 0)
stateMan.push();

View File

@ -1952,7 +1952,16 @@ int main (int argc, char **argv)
#endif
{
if(rewinding)
{
uint16 joypads[8];
for (int i = 0; i < 8; i++)
joypads[i] = MovieGetJoypad(i);
rewinding = stateMan.pop();
for (int i = 0; i < 8; i++)
MovieSetJoypad (i, joypads[i]);
}
else if(IPPU.TotalEmulatedFrames % unixSettings.rewindGranularity == 0)
stateMan.push();