Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make F4 useful #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion gui/Plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions libpcsxcore/plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {}

Expand Down Expand Up @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions libpcsxcore/plugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down
12 changes: 11 additions & 1 deletion win32/gui/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern void LidInterrupt();
HANDLE hThread = 0;
BOOL start = FALSE;
BOOL restart = FALSE;
int speed = 100;

void gpuHidePic()
{
Expand Down Expand Up @@ -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:
Expand Down