win32: use rewinding setting in core

This commit is contained in:
OV2 2018-05-20 15:34:48 +02:00
parent 870b6fd77f
commit 94f90fc94b
4 changed files with 10 additions and 9 deletions

View File

@ -191,6 +191,7 @@
#include "CD3DCG.h" #include "CD3DCG.h"
#include "wsnes9x.h" #include "wsnes9x.h"
#include "win32_display.h" #include "win32_display.h"
#include "snes9x.h"
#include <Dxerr.h> #include <Dxerr.h>
#include <png.h> #include <png.h>
#include "CDirect3D.h" #include "CDirect3D.h"
@ -714,7 +715,7 @@ void CD3DCG::setShaderVars(int pass)
if(shaderPasses[pass].frameCounterMod) if(shaderPasses[pass].frameCounterMod)
shaderFrameCnt = (float)(frameCnt % shaderPasses[pass].frameCounterMod); shaderFrameCnt = (float)(frameCnt % shaderPasses[pass].frameCounterMod);
setProgramUniform(pass,"IN.frame_count",&shaderFrameCnt); setProgramUniform(pass,"IN.frame_count",&shaderFrameCnt);
float frameDirection = GUI.rewinding?-1.0f:1.0f; float frameDirection = Settings.Rewinding?-1.0f:1.0f;
setProgramUniform(pass,"IN.frame_direction",&frameDirection); setProgramUniform(pass,"IN.frame_direction",&frameDirection);
/* ORIG parameter /* ORIG parameter

View File

@ -191,6 +191,7 @@
#include "CGLCG.h" #include "CGLCG.h"
#include "wsnes9x.h" #include "wsnes9x.h"
#include "win32_display.h" #include "win32_display.h"
#include "snes9x.h"
#include <png.h> #include <png.h>
#ifndef max #ifndef max
@ -688,7 +689,7 @@ void CGLCG::setShaderVars(int pass)
if(shaderPasses[pass].frameCounterMod) if(shaderPasses[pass].frameCounterMod)
shaderFrameCnt %= shaderPasses[pass].frameCounterMod; shaderFrameCnt %= shaderPasses[pass].frameCounterMod;
setProgram1f(pass,"IN.frame_count",(float)shaderFrameCnt); setProgram1f(pass,"IN.frame_count",(float)shaderFrameCnt);
setProgram1f(pass,"IN.frame_direction",GUI.rewinding?-1.0f:1.0f); setProgram1f(pass,"IN.frame_direction",Settings.Rewinding?-1.0f:1.0f);
/* ORIG parameter /* ORIG parameter
*/ */

View File

@ -1300,9 +1300,9 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam)
if(wParam == CustomKeys.Rewind.key if(wParam == CustomKeys.Rewind.key
&& modifiers == CustomKeys.Rewind.modifiers) && modifiers == CustomKeys.Rewind.modifiers)
{ {
if(!GUI.rewinding) if(!Settings.Rewinding)
S9xMessage (S9X_INFO, 0, GUI.rewindBufferSize?WINPROC_REWINDING_TEXT:WINPROC_REWINDING_DISABLED); S9xMessage (S9X_INFO, 0, GUI.rewindBufferSize?WINPROC_REWINDING_TEXT:WINPROC_REWINDING_DISABLED);
GUI.rewinding = true; Settings.Rewinding = true;
hitHotKey = true; hitHotKey = true;
} }
@ -1644,7 +1644,7 @@ LRESULT CALLBACK WinProc(
if(wParam == CustomKeys.Rewind.key if(wParam == CustomKeys.Rewind.key
&& modifiers == CustomKeys.Rewind.modifiers) && modifiers == CustomKeys.Rewind.modifiers)
{ {
GUI.rewinding = false; Settings.Rewinding = false;
} }
} }
@ -3429,7 +3429,7 @@ int WINAPI WinMain(
InitRenderFilters(); InitRenderFilters();
GUI.ControlForced = 0xff; GUI.ControlForced = 0xff;
GUI.rewinding = false; Settings.Rewinding = false;
S9xSetRecentGames (); S9xSetRecentGames ();
@ -3629,8 +3629,8 @@ int WINAPI WinMain(
&&!Settings.NetPlay &&!Settings.NetPlay
#endif #endif
) { ) {
if(GUI.rewinding) { if(Settings.Rewinding) {
GUI.rewinding = stateMan.pop(); Settings.Rewinding = stateMan.pop();
} else { } else {
if(IPPU.TotalEmulatedFrames % GUI.rewindGranularity == 0) if(IPPU.TotalEmulatedFrames % GUI.rewindGranularity == 0)
stateMan.push(); stateMan.push();

View File

@ -421,7 +421,6 @@ struct sGUI {
unsigned long IdleCount; unsigned long IdleCount;
// rewinding // rewinding
bool rewinding;
unsigned int rewindBufferSize; unsigned int rewindBufferSize;
unsigned int rewindGranularity; unsigned int rewindGranularity;
}; };