GS: Correct CSR behaviour on mode change

This commit is contained in:
refractionpcsx2 2023-01-31 09:59:27 +00:00
parent c1bd1fcbd4
commit 4b49c8bd6e
2 changed files with 10 additions and 11 deletions

View File

@ -445,6 +445,10 @@ u32 UpdateVSyncRate()
if (vSyncInfo.Framerate != frames_per_second || vSyncInfo.VideoMode != gsVideoMode) if (vSyncInfo.Framerate != frames_per_second || vSyncInfo.VideoMode != gsVideoMode)
{ {
// NBA Jam 2004 PAL will fail to display 3D on the menu if this value isn't correct on reset.
if (video_mode_initialized && vSyncInfo.VideoMode != gsVideoMode)
CSRreg.FIELD = 1;
vSyncInfo.VideoMode = gsVideoMode; vSyncInfo.VideoMode = gsVideoMode;
vSyncInfoCalc(&vSyncInfo, frames_per_second, total_scanlines); vSyncInfoCalc(&vSyncInfo, frames_per_second, total_scanlines);

View File

@ -32,19 +32,15 @@ void gsSetVideoMode(GS_VideoMode mode)
{ {
gsVideoMode = mode; gsVideoMode = mode;
UpdateVSyncRate(); UpdateVSyncRate();
CSRreg.FIELD = 1;
} }
// Make sure framelimiter options are in sync with GS capabilities. // Make sure framelimiter options are in sync with GS capabilities.
void gsReset() void gsReset()
{ {
GetMTGS().ResetGS(true); GetMTGS().ResetGS(true);
gsVideoMode = GS_VideoMode::Uninitialized;
UpdateVSyncRate();
memzero(g_RealGSMem); memzero(g_RealGSMem);
UpdateVSyncRate();
CSRreg.Reset();
GSIMR.reset();
} }
void gsUpdateFrequency(Pcsx2Config& config) void gsUpdateFrequency(Pcsx2Config& config)
@ -85,13 +81,12 @@ static __fi void gsCSRwrite( const tGS_CSR& csr )
//Console.Warning( "csr.RESET" ); //Console.Warning( "csr.RESET" );
//gifUnit.Reset(true); // Don't think gif should be reset... //gifUnit.Reset(true); // Don't think gif should be reset...
gifUnit.gsSIGNAL.queued = false; gifUnit.gsSIGNAL.queued = false;
gifUnit.gsFINISH.gsFINISHFired = true;
// Privilage registers also reset. // Privilage registers also reset.
memset(PS2MEM_GS, 0, sizeof(PS2MEM_GS)); memzero(g_RealGSMem);
gsVideoMode = GS_VideoMode::Uninitialized;
UpdateVSyncRate();
GetMTGS().SendSimplePacket(GS_RINGTYPE_RESET, 0, 0, 0); GetMTGS().SendSimplePacket(GS_RINGTYPE_RESET, 0, 0, 0);
const u32 field = CSRreg.FIELD;
CSRreg.Reset();
GSIMR.reset();
CSRreg.FIELD = field;
} }
if(csr.FLUSH) if(csr.FLUSH)