From ca4066b2fb81c66a1a478b3c24ef463b6107cefe Mon Sep 17 00:00:00 2001 From: "SND\\edgbla_cp" Date: Wed, 30 Nov 2011 15:46:36 +0000 Subject: git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72730 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- gui/Plugin.c | 1 - libpcsxcore/plugins.c | 19 +++---------------- libpcsxcore/plugins.h | 10 +++------- libpcsxcore/psxcounters.c | 2 ++ libpcsxcore/r3000a.c | 8 -------- macosx/Plugin.c | 18 ++++++++---------- win32/gui/plugin.c | 1 - 7 files changed, 16 insertions(+), 43 deletions(-) diff --git a/gui/Plugin.c b/gui/Plugin.c index 42d9b1d9..1ce533aa 100644 --- a/gui/Plugin.c +++ b/gui/Plugin.c @@ -326,7 +326,6 @@ int _OpenPlugins() { SPU_registerCallback(SPUirq); ret = GPU_open(&gpuDisp, "PCSXR", NULL); if (ret < 0) { SysMessage(_("Error opening GPU plugin!")); return -1; } - GPU_registerCallback(GPUbusy); ret = PAD1_open(&gpuDisp); if (ret < 0) { SysMessage(_("Error opening Controller 1 plugin!")); return -1; } PAD1_registerVibration(GPU_visualVibration); diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index 28c9c327..9db5421b 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -49,9 +49,8 @@ GPUfreeze GPU_freeze; GPUgetScreenPic GPU_getScreenPic; GPUshowScreenPic GPU_showScreenPic; GPUclearDynarec GPU_clearDynarec; +GPUhSync GPU_hSync; GPUvBlank GPU_vBlank; -GPUregisterCallback GPU_registerCallback; -GPUidle GPU_idle; GPUvisualVibration GPU_visualVibration; GPUcursor GPU_cursor; GPUaddVertex GPU_addVertex; @@ -201,16 +200,6 @@ void CALLBACK GPU__displayText(char *pText) { SysPrintf("%s\n", pText); } -void CALLBACK GPUbusy( int ticks ) -{ - //printf( "GPUbusy( %i )\n", ticks ); - //fflush( 0 ); - - psxRegs.interrupt |= (1 << PSXINT_GPUBUSY); - psxRegs.intCycle[PSXINT_GPUBUSY].cycle = ticks; - psxRegs.intCycle[PSXINT_GPUBUSY].sCycle = psxRegs.cycle; -} - long CALLBACK GPU__configure(void) { return 0; } long CALLBACK GPU__test(void) { return 0; } void CALLBACK GPU__about(void) {} @@ -219,9 +208,8 @@ void CALLBACK GPU__keypressed(int key) {} long CALLBACK GPU__getScreenPic(unsigned char *pMem) { return -1; } long CALLBACK GPU__showScreenPic(unsigned char *pMem) { return -1; } void CALLBACK GPU__clearDynarec(void (CALLBACK *callback)(void)) {} +void CALLBACK GPU__hSync(int val) {} void CALLBACK GPU__vBlank(int val) {} -void CALLBACK GPU__registerCallback(void (CALLBACK *callback)(int)) {} -void CALLBACK GPU__idle(void) {} 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) {} @@ -264,9 +252,8 @@ static int LoadGPUplugin(const char *GPUdll) { LoadGpuSym0(getScreenPic, "GPUgetScreenPic"); LoadGpuSym0(showScreenPic, "GPUshowScreenPic"); LoadGpuSym0(clearDynarec, "GPUclearDynarec"); + LoadGpuSym0(hSync, "GPUhSync"); LoadGpuSym0(vBlank, "GPUvBlank"); - LoadGpuSym0(registerCallback, "GPUregisterCallback"); - LoadGpuSym0(idle, "GPUidle"); LoadGpuSym0(visualVibration, "GPUvisualVibration"); LoadGpuSym0(cursor, "GPUcursor"); LoadGpuSym0(addVertex, "GPUaddVertex"); diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h index cf2dbdff..bf55e65f 100644 --- a/libpcsxcore/plugins.h +++ b/libpcsxcore/plugins.h @@ -93,12 +93,11 @@ typedef long (CALLBACK* GPUfreeze)(uint32_t, GPUFreeze_t *); typedef long (CALLBACK* GPUgetScreenPic)(unsigned char *); typedef long (CALLBACK* GPUshowScreenPic)(unsigned char *); typedef void (CALLBACK* GPUclearDynarec)(void (CALLBACK *callback)(void)); +typedef void (CALLBACK* GPUhSync)(int); typedef void (CALLBACK* GPUvBlank)(int); -typedef void (CALLBACK* GPUregisterCallback)(void (CALLBACK *callback)(int)); -typedef void (CALLBACK* GPUidle)(void); 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* GPUaddVertex)(short,short,s64,s64,s64); // GPU function pointers extern GPUupdateLace GPU_updateLace; @@ -123,9 +122,8 @@ extern GPUfreeze GPU_freeze; extern GPUgetScreenPic GPU_getScreenPic; extern GPUshowScreenPic GPU_showScreenPic; extern GPUclearDynarec GPU_clearDynarec; +extern GPUhSync GPU_hSync; extern GPUvBlank GPU_vBlank; -extern GPUregisterCallback GPU_registerCallback; -extern GPUidle GPU_idle; extern GPUvisualVibration GPU_visualVibration; extern GPUcursor GPU_cursor; extern GPUaddVertex GPU_addVertex; @@ -415,8 +413,6 @@ extern SIO1registerCallback SIO1_registerCallback; void CALLBACK clearDynarec(void); -void CALLBACK GPUbusy( int ticks ); - void SetIsoFile(const char *filename); const char *GetIsoFile(void); boolean UsingIso(void); diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c index 51694aa4..8ecb629f 100644 --- a/libpcsxcore/psxcounters.c +++ b/libpcsxcore/psxcounters.c @@ -270,6 +270,8 @@ void psxRcntUpdate() { psxRcntReset( 3 ); + GPU_hSync(hSyncCount); + spuSyncCount++; hSyncCount++; diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c index a44bc369..9a37abe6 100644 --- a/libpcsxcore/r3000a.c +++ b/libpcsxcore/r3000a.c @@ -186,13 +186,6 @@ void psxBranchTest() { spuInterrupt(); } } - if (psxRegs.interrupt & (1 << PSXINT_GPUBUSY)) { // gpu busy - if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_GPUBUSY].sCycle) >= psxRegs.intCycle[PSXINT_GPUBUSY].cycle) { - psxRegs.interrupt &= ~(1 << PSXINT_GPUBUSY); - GPU_idle(); - } - } - if (psxRegs.interrupt & (1 << PSXINT_MDECINDMA)) { // mdec in if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_MDECINDMA].sCycle) >= psxRegs.intCycle[PSXINT_MDECINDMA].cycle) { psxRegs.interrupt &= ~(1 << PSXINT_MDECINDMA); @@ -272,4 +265,3 @@ void psxExecuteBios() { while (psxRegs.pc != 0x80030000) psxCpu->ExecuteBlock(); } - diff --git a/macosx/Plugin.c b/macosx/Plugin.c index 9d1a8d0e..ff5b1c88 100644 --- a/macosx/Plugin.c +++ b/macosx/Plugin.c @@ -80,7 +80,6 @@ int _OpenPlugins() { SPU_registerCallback(SPUirq); ret = GPU_open(&gpuDisp, "PCSXR", NULL); if (ret < 0) { SysMessage(_("Error Opening GPU Plugin")); return -1; } - GPU_registerCallback(GPUbusy); ret = PAD1_open(&gpuDisp); if (ret < 0) { SysMessage(_("Error Opening PAD1 Plugin")); return -1; } PAD1_registerVibration(GPU_visualVibration); @@ -93,7 +92,7 @@ int _OpenPlugins() { if (Config.UseNet && !NetOpened) { netInfo info; char path[MAXPATHLEN]; - + strcpy(info.EmuName, "PCSX " PACKAGE_VERSION); strncpy(info.CdromID, CdromId, 9); strncpy(info.CdromLabel, CdromLabel, 9); @@ -113,19 +112,19 @@ int _OpenPlugins() { sprintf(path, "%s%s", Config.PluginsDir, Config.Cdr); strcpy(info.CDRpath, path); NET_setInfo(&info); - + ret = NET_open(&gpuDisp); if (ret < 0) { if (ret == -2) { // -2 is returned when something in the info // changed and needs to be synced char *ptr; - + PARSEPATH(Config.Bios, info.BIOSpath); PARSEPATH(Config.Gpu, info.GPUpath); PARSEPATH(Config.Spu, info.SPUpath); PARSEPATH(Config.Cdr, info.CDRpath); - + strcpy(Config.Mcd1, info.MCD1path); strcpy(Config.Mcd2, info.MCD2path); return -2; @@ -133,19 +132,19 @@ int _OpenPlugins() { Config.UseNet = FALSE; } } else { - + if (NET_queryPlayer() == 1) { if (SendPcsxInfo() == -1) Config.UseNet = FALSE; } else { if (RecvPcsxInfo() == -1) Config.UseNet = FALSE; } - + } NetOpened = TRUE; } else if (Config.UseNet) { NET_resume(); } - + return 0; } @@ -190,7 +189,7 @@ void ResetPlugins() { PAD1_shutdown(); PAD2_shutdown(); if (Config.UseNet) NET_shutdown(); - + ret = CDR_init(); if (ret < 0) { SysMessage(_("CDRinit error: %d"), ret); return; } ret = GPU_init(); @@ -208,4 +207,3 @@ void ResetPlugins() { NetOpened = FALSE; } - diff --git a/win32/gui/plugin.c b/win32/gui/plugin.c index 3ee3d835..de930234 100644 --- a/win32/gui/plugin.c +++ b/win32/gui/plugin.c @@ -281,7 +281,6 @@ int _OpenPlugins(HWND hWnd) { ret = GPU_open(hWnd); if (ret < 0) { SysMessage (_("Error Opening GPU Plugin (%d)"), ret); return -1; } - GPU_registerCallback(GPUbusy); ret = SPU_open(hWnd); if (ret < 0) { SysMessage (_("Error Opening SPU Plugin (%d)"), ret); return -1; } SPU_registerCallback(SPUirq); -- cgit v1.2.3