diff --git a/gui/Plugin.c b/gui/Plugin.c index 389f4246..9e6a3d15 100644 --- a/gui/Plugin.c +++ b/gui/Plugin.c @@ -46,6 +46,7 @@ int StatesC = 0; unsigned char loadedOld = FALSE; int speed = 100; extern int UseGui; +static unsigned int fpslimit = 1; void gpuShowPic() { gchar *state_filename; @@ -201,7 +202,10 @@ void PADhandleKey(int key) { gpuShowPic(); break; case XK_F4: - gpuShowPic(); + fpslimit = !fpslimit; + sprintf(Text, "fpslimit: %u", fpslimit); + GPU_displayText(Text); + GPU_setframelimit(fpslimit); break; case XK_section: if (pressed) break; diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index a1175e48..e3db78de 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -59,6 +59,7 @@ GPUvisualVibration GPU_visualVibration; GPUcursor GPU_cursor; GPUaddVertex GPU_addVertex; GPUsetSpeed GPU_setSpeed; +GPUsetframelimit GPU_setframelimit; GPUpgxpMemory GPU_pgxpMemory; GPUpgxpCacheVertex GPU_pgxpCacheVertex; @@ -223,6 +224,7 @@ void CALLBACK GPU__visualVibration(unsigned long iSmall, unsigned long iBig) {} void CALLBACK GPU__cursor(int player, int x, int y) {} void CALLBACK GPU__addVertex(short sx,short sy,s64 fx,s64 fy,s64 fz) {} void CALLBACK GPU__setSpeed(float newSpeed) {} +void CALLBACK GPU__setframelimit(unsigned long option) {} void CALLBACK GPU__pgxpMemory(unsigned int addr, unsigned char* pVRAM) {} void CALLBACK GPU__pgxpCacheVertex(short sx, short sy, const unsigned char* _pVertex) {} @@ -272,6 +274,7 @@ static int LoadGPUplugin(const char *GPUdll) { LoadGpuSym0(cursor, "GPUcursor"); LoadGpuSym0(addVertex, "GPUaddVertex"); LoadGpuSym0(setSpeed, "GPUsetSpeed"); + LoadGpuSym0(setframelimit, "GPUsetframelimit"); LoadGpuSym0(pgxpMemory, "GPUpgxpMemory"); LoadGpuSym0(pgxpCacheVertex, "GPUpgxpCacheVertex"); LoadGpuSym0(configure, "GPUconfigure"); diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h index a9756b7e..d03cb667 100644 --- a/libpcsxcore/plugins.h +++ b/libpcsxcore/plugins.h @@ -98,6 +98,7 @@ typedef void (CALLBACK* GPUvisualVibration)(uint32_t, uint32_t); typedef void (CALLBACK* GPUcursor)(int, int, int); typedef void (CALLBACK* GPUaddVertex)(short,short,s64,s64,s64); typedef void (CALLBACK* GPUsetSpeed)(float); // 1.0 = natural speed +typedef void (CALLBACK* GPUsetframelimit)(unsigned long); typedef void (CALLBACK* GPUpgxpMemory)(unsigned int, unsigned char*); typedef void (CALLBACK* GPUpgxpCacheVertex)(short sx, short sy, const unsigned char* _pVertex); @@ -131,6 +132,7 @@ extern GPUvisualVibration GPU_visualVibration; extern GPUcursor GPU_cursor; extern GPUaddVertex GPU_addVertex; extern GPUsetSpeed GPU_setSpeed; +extern GPUsetframelimit GPU_setframelimit; extern GPUpgxpMemory GPU_pgxpMemory; extern GPUpgxpCacheVertex GPU_pgxpCacheVertex; diff --git a/win32/gui/plugin.c b/win32/gui/plugin.c index 5ae00824..8520b287 100644 --- a/win32/gui/plugin.c +++ b/win32/gui/plugin.c @@ -37,6 +37,7 @@ extern void LidInterrupt(); HANDLE hThread = 0; BOOL start = FALSE; BOOL restart = FALSE; +int speed = 100; void gpuHidePic() { @@ -145,7 +146,16 @@ void PADhandleKey(int key) { break; case VK_F4: - gpuShowPic(); + if (speed == 200) { + speed = 100; + } + else { + speed = 200; + } + sprintf(Text, "Speed: %u", speed); + GPU_displayText(Text); +// GPU_setSpeed(speed / 100.0); + GPU_setframelimit(speed == 100); break; case VK_F5: