diff options
| author | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-11-14 15:33:16 +0000 |
|---|---|---|
| committer | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-11-14 15:33:16 +0000 |
| commit | a37e3f092fd84658c67ec537590dd5f4710ee174 (patch) | |
| tree | bb492f45b329ad00dece1d377919d2026518ddd7 /plugins | |
| parent | 7c7fd64d9bf9a403a0aad8d6d172bc14c643dd46 (diff) | |
| download | pcsxr-a37e3f092fd84658c67ec537590dd5f4710ee174.tar.gz | |
peopsgl/xvideo: fixed interlace/frame bit31 toggling. Now X-Men Academies are fine. Obsoletes use of odd/even hack.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@87829 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins')
| -rwxr-xr-x | plugins/dfxvideo/gpu.c | 30 | ||||
| -rwxr-xr-x | plugins/peopsxgl/gpu.c | 33 |
2 files changed, 52 insertions, 11 deletions
diff --git a/plugins/dfxvideo/gpu.c b/plugins/dfxvideo/gpu.c index 25dde9e1..10baf531 100755 --- a/plugins/dfxvideo/gpu.c +++ b/plugins/dfxvideo/gpu.c @@ -140,6 +140,7 @@ static int iFakePrimBusy=0; uint32_t vBlank=0; int iRumbleVal=0; int iRumbleTime=0; +BOOL oddLines; #ifdef _WINDOWS @@ -485,6 +486,7 @@ long CALLBACK GPUinit() // GPU INIT GPUIsReadyForCommands; bDoVSyncUpdate = TRUE; vBlank = 0; + oddLines = FALSE; // Get a handle for kernel32.dll, and access the required export function LoadKernel32(); @@ -938,15 +940,14 @@ void CALLBACK GPUcursor(int iPlayer,int x,int y) void CALLBACK GPUupdateLace(void) // VSYNC { - //if(!(dwActFixes&1)) - //lGPUstatusRet^=0x80000000; // odd/even bit + if(!(dwActFixes&1)) + lGPUstatusRet^=0x80000000; // odd/even bit if(!(dwActFixes&32)) // std fps limitation? CheckFrameRate(); if(PSXDisplay.Interlaced) // interlaced mode? { - lGPUstatusRet^=0x80000000; if(bDoVSyncUpdate && PSXDisplay.DisplayMode.x>0 && PSXDisplay.DisplayMode.y>0) { updateDisplay(); @@ -987,6 +988,15 @@ void CALLBACK GPUupdateLace(void) // VSYNC uint32_t CALLBACK GPUreadStatus(void) // READ STATUS { + if (vBlank || oddLines == FALSE) + { // vblank or even lines + lGPUstatusRet &= ~(0x80000000); + } + else + { // Oddlines and not vblank + lGPUstatusRet |= 0x80000000; + } + if(dwActFixes&1) { static int iNumRead=0; // odd/even hack @@ -1012,7 +1022,7 @@ uint32_t CALLBACK GPUreadStatus(void) // READ STATUS GPUIsReadyForCommands; } } - return lGPUstatusRet | (vBlank ? 0x80000000 : 0 ); + return lGPUstatusRet; } //////////////////////////////////////////////////////////////////////// @@ -2299,7 +2309,17 @@ void CALLBACK GPUsetfix(uint32_t dwFixBits) void CALLBACK GPUvBlank( int val ) { - vBlank = val; + vBlank = val; + oddLines = oddLines ? FALSE : TRUE; // bit changes per frame when not interlaced + //printf("VB %x (%x)\n", oddLines, vBlank); +} + +void CALLBACK GPUhSync( int val ) { + // Interlaced mode - update bit every scanline + if (PSXDisplay.Interlaced) { + oddLines = (val%2 ? FALSE : TRUE); + } + //printf("HS %x (%x)\n", oddLines, vBlank); } void CALLBACK GPUvisualVibration(uint32_t iSmall, uint32_t iBig) diff --git a/plugins/peopsxgl/gpu.c b/plugins/peopsxgl/gpu.c index 1bf52937..5d59782c 100755 --- a/plugins/peopsxgl/gpu.c +++ b/plugins/peopsxgl/gpu.c @@ -181,6 +181,7 @@ int iFakePrimBusy = 0; int iRumbleVal = 0; int iRumbleTime = 0; uint32_t vBlank=0; +BOOL oddLines; //////////////////////////////////////////////////////////////////////// // stuff to make this a true PDK module @@ -578,6 +579,7 @@ long CALLBACK GPUinit() // device initialised already ! //lGPUstatusRet = 0x74000000; vBlank = 0; + oddLines = FALSE; STATUSREG = 0x14802000; GPUIsIdle; @@ -2021,8 +2023,8 @@ static unsigned short usFirstPos=2; void CALLBACK GPUupdateLace(void) { - //if(!(dwActFixes&0x1000)) - // STATUSREG^=0x80000000; // interlaced bit toggle, if the CC game fix is not active (see gpuReadStatus) + if(!(dwActFixes&0x1000)) + STATUSREG^=0x80000000; // interlaced bit toggle, if the CC game fix is not active (see gpuReadStatus) if(!(dwActFixes&128)) // normal frame limit func CheckFrameRate(); @@ -2034,7 +2036,7 @@ void CALLBACK GPUupdateLace(void) if(PSXDisplay.Interlaced) // interlaced mode? { - STATUSREG^=0x80000000; + //STATUSREG^=0x80000000; if(PSXDisplay.DisplayMode.x>0 && PSXDisplay.DisplayMode.y>0) { updateDisplay(); // -> swap buffers (new frame) @@ -2059,7 +2061,16 @@ void CALLBACK GPUupdateLace(void) //////////////////////////////////////////////////////////////////////// uint32_t CALLBACK GPUreadStatus(void) -{ +{ + if (vBlank || oddLines == FALSE) + { // vblank or even lines + STATUSREG &= ~(0x80000000); + } + else + { // Oddlines and not vblank + STATUSREG |= 0x80000000; + } + if(dwActFixes&0x1000) // CC game fix { static int iNumRead=0; @@ -2086,7 +2097,7 @@ uint32_t CALLBACK GPUreadStatus(void) } } - return STATUSREG | (vBlank ? 0x80000000 : 0 );; + return STATUSREG; } //////////////////////////////////////////////////////////////////////// @@ -3590,5 +3601,15 @@ void CALLBACK GPUdisplayFlags(uint32_t dwFlags) void CALLBACK GPUvBlank( int val ) { - vBlank = val; + vBlank = val; + oddLines = oddLines ? FALSE : TRUE; // bit changes per frame when not interlaced + //printf("VB %x (%x)\n", oddLines, vBlank); +} + +void CALLBACK GPUhSync( int val ) { + // Interlaced mode - update bit every scanline + if (PSXDisplay.Interlaced) { + oddLines = (val%2 ? FALSE : TRUE); + } + //printf("HS %x (%x)\n", oddLines, vBlank); } |
