Added gpu busy interface.

git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@56084 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
SND\edgbla_cp 2010-08-13 21:58:00 +00:00
parent 3e945aaa36
commit d310056a1a
8 changed files with 44 additions and 2 deletions

View File

@ -1,3 +1,13 @@
August 14, 2010 edgbla <edgbla@yandex.ru>
* gui/Plugin.c: Added gpu busy interface.
* macosx/Plugin.c: Likewise.
* win32/gui/plugin.c: Likewise.
* libpcsxcore/r3000a.c: Likewise.
* libpcsxcore/r3000a.h: Likewise.
* libpcsxcore/plugins.c: Likewise.
* libpcsxcore/plugins.h: Likewise.
August 13, 2010 Wei Mingzhi <whistler_wmz@users.sf.net>
* plugins/dfxvideo/cfg.h: Readded Windows support.

View File

@ -315,6 +315,7 @@ int _OpenPlugins() {
SPU_registerCallback(SPUirq);
ret = GPU_open(&gpuDisp, "PCSX", 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; }
ret = PAD2_open(&gpuDisp);

View File

@ -50,6 +50,8 @@ GPUgetScreenPic GPU_getScreenPic;
GPUshowScreenPic GPU_showScreenPic;
GPUclearDynarec GPU_clearDynarec;
GPUvBlank GPU_vBlank;
GPUregisterCallback GPU_registerCallback;
GPUidle GPU_idle;
CDRinit CDR_init;
CDRshutdown CDR_shutdown;
@ -192,6 +194,16 @@ 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) {}
@ -201,6 +213,8 @@ 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__vBlank(int val) {}
void CALLBACK GPU__registerCallback(void (CALLBACK *callback)(int)) {};
void CALLBACK GPU__idle(void) {}
#define LoadGpuSym1(dest, name) \
LoadSym(GPU_##dest, GPU##dest, name, TRUE);
@ -241,6 +255,8 @@ static int LoadGPUplugin(const char *GPUdll) {
LoadGpuSym0(showScreenPic, "GPUshowScreenPic");
LoadGpuSym0(clearDynarec, "GPUclearDynarec");
LoadGpuSym0(vBlank, "GPUvBlank");
LoadGpuSym0(registerCallback, "GPUregisterCallback");
LoadGpuSym0(idle, "GPUidle");
LoadGpuSym0(configure, "GPUconfigure");
LoadGpuSym0(test, "GPUtest");
LoadGpuSym0(about, "GPUabout");

View File

@ -94,6 +94,8 @@ typedef long (CALLBACK* GPUgetScreenPic)(unsigned char *);
typedef long (CALLBACK* GPUshowScreenPic)(unsigned char *);
typedef void (CALLBACK* GPUclearDynarec)(void (CALLBACK *callback)(void));
typedef void (CALLBACK* GPUvBlank)(int);
typedef void (CALLBACK* GPUregisterCallback)(void (CALLBACK *callback)(int));
typedef void (CALLBACK* GPUidle)(void);
// GPU function pointers
extern GPUupdateLace GPU_updateLace;
@ -119,6 +121,8 @@ extern GPUgetScreenPic GPU_getScreenPic;
extern GPUshowScreenPic GPU_showScreenPic;
extern GPUclearDynarec GPU_clearDynarec;
extern GPUvBlank GPU_vBlank;
extern GPUregisterCallback GPU_registerCallback;
extern GPUidle GPU_idle;
// CD-ROM Functions
typedef long (CALLBACK* CDRinit)(void);
@ -150,7 +154,7 @@ struct SubQ {
unsigned char IndexNumber;
unsigned char TrackRelativeAddress[3];
unsigned char Filler;
unsigned char AbsoluteAddress[3];
unsigned char AbsoluteAddress[3];
unsigned char CRC[2];
char res1[72];
};
@ -400,6 +404,8 @@ 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);

View File

@ -151,6 +151,12 @@ 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 (psxHu32(0x1070) & psxHu32(0x1074)) {

View File

@ -151,7 +151,8 @@ enum {
PSXINT_CDREAD,
PSXINT_GPUDMA,
PSXINT_MDECOUTDMA,
PSXINT_SPUDMA
PSXINT_SPUDMA,
PSXINT_GPUBUSY
};
typedef struct {

View File

@ -89,6 +89,7 @@ int _OpenPlugins() {
SPU_registerCallback(SPUirq);
ret = GPU_open(&gpuDisp, "PCSX", /*pathUrl ? path :*/ 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; }
ret = PAD2_open(&gpuDisp);

View File

@ -275,6 +275,7 @@ 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);