mirror of https://github.com/PCSX2/pcsx2.git
Fixed a foopah in r451 that caused most games to run at PAL framerates and timings. Oops, heh.
Squashed another race condition in the MTGS; this one when hitting escape to close the GS window (very rare). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@453 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
9f454da8d6
commit
27af6983c7
|
@ -234,6 +234,7 @@ void gsClose()
|
|||
|
||||
if( mtgsThread != NULL )
|
||||
{
|
||||
mtgsThread->Close();
|
||||
safe_delete( mtgsThread );
|
||||
}
|
||||
else
|
||||
|
@ -373,7 +374,7 @@ __forceinline void _gsSMODEwrite( u32 mem, u32 value )
|
|||
switch (mem)
|
||||
{
|
||||
case GS_SMODE1:
|
||||
gsSetVideoRegionType( !!(value & 0x6000) );
|
||||
gsSetVideoRegionType( (value & 0x6000) == 0x6000 );
|
||||
break;
|
||||
|
||||
case GS_SMODE2:
|
||||
|
|
|
@ -137,6 +137,7 @@ enum GS_RINGTYPE
|
|||
, GS_RINGTYPE_WRITECSR
|
||||
, GS_RINGTYPE_MODECHANGE // for issued mode changes.
|
||||
, GS_RINGTYPE_STARTTIME // special case for min==max fps frameskip settings
|
||||
, GS_RINGTYPE_QUIT
|
||||
};
|
||||
|
||||
class mtgsThreadObject : public Threading::Thread
|
||||
|
@ -181,9 +182,7 @@ protected:
|
|||
#endif
|
||||
|
||||
// the MTGS "dummy" GIFtag info!
|
||||
// 16 byte alignment isn't "critical" here, so if GCC ignores the aignment directive
|
||||
// it shouldn't cause any issues.
|
||||
PCSX2_ALIGNED16( GIFPath m_path[3] );
|
||||
GIFPath m_path[3];
|
||||
|
||||
// contains aligned memory allocations for gs and Ringbuffer.
|
||||
SafeAlignedArray<u128,16> m_RingBuffer;
|
||||
|
@ -196,6 +195,7 @@ public:
|
|||
mtgsThreadObject();
|
||||
virtual ~mtgsThreadObject();
|
||||
|
||||
void Close();
|
||||
void Reset();
|
||||
void GIFSoftReset( int mask );
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ only recv2 & dataout influences padman
|
|||
|
||||
|
||||
void sio2Reset() {
|
||||
SysPrintf("Sio2 init\n");
|
||||
DevCon::Status( "Sio2 Reset" );
|
||||
memzero_obj(sio2);
|
||||
sio2.packet.recvVal1 = 0x1D100; // Nothing is connected at start
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ void sio2_serialIn(u8 value){
|
|||
sioWrite8(value);
|
||||
|
||||
if (sio2.packet.sendSize > BUFSIZE) {//asadr
|
||||
SysPrintf("*PCSX2*: sendSize >= %d\n", BUFSIZE);
|
||||
Console::Notice("*PCSX2*: sendSize >= %d", params BUFSIZE);
|
||||
} else {
|
||||
sio2.buf[sio2.packet.sendSize] = sioRead8();
|
||||
sio2.packet.sendSize++;
|
||||
|
@ -199,11 +199,16 @@ u8 sio2_fifoOut(){
|
|||
//PAD_LOG("READING %x\n",sio2.buf[sio2.recvIndex]);
|
||||
return sio2.buf[sio2.recvIndex++];
|
||||
} else {
|
||||
SysPrintf("*PCSX2*: buffer overrun\n");
|
||||
Console::Error( "*PCSX2*: buffer overrun" );
|
||||
}
|
||||
return 0; // No Data
|
||||
}
|
||||
|
||||
void SaveState::sio2Freeze()
|
||||
{
|
||||
Freeze(sio2);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////// DMA
|
||||
/////////////////////////////////////////////////
|
||||
|
@ -264,7 +269,3 @@ void psxDMA12Interrupt()
|
|||
psxDmaInterrupt2(5);
|
||||
}
|
||||
|
||||
void SaveState::sio2Freeze() {
|
||||
Freeze(sio2);
|
||||
}
|
||||
|
||||
|
|
|
@ -219,10 +219,14 @@ mtgsThreadObject::mtgsThreadObject() :
|
|||
|
||||
mtgsThreadObject::~mtgsThreadObject()
|
||||
{
|
||||
Console::WriteLn( "MTGS > Closing GS thread..." );
|
||||
SetEvent();
|
||||
}
|
||||
|
||||
// rest of the cleanup will be handled by the inherited object destructors...
|
||||
void mtgsThreadObject::Close()
|
||||
{
|
||||
Console::WriteLn( "MTGS > Closing GS thread..." );
|
||||
SendSimplePacket( GS_RINGTYPE_QUIT, 0, 0, 0 );
|
||||
SetEvent();
|
||||
pthread_join( m_thread, NULL );
|
||||
}
|
||||
|
||||
void mtgsThreadObject::Reset()
|
||||
|
@ -452,10 +456,9 @@ int mtgsThreadObject::Callback()
|
|||
PacketTagType prevCmd;
|
||||
#endif
|
||||
|
||||
while( !m_sigterm )
|
||||
while( true )
|
||||
{
|
||||
m_post_event.Wait();
|
||||
//if( m_sigterm ) break;
|
||||
|
||||
AtomicExchange( m_RingBufferIsBusy, 1 );
|
||||
|
||||
|
@ -592,6 +595,10 @@ int mtgsThreadObject::Callback()
|
|||
m_iSlowStart += tag.data[0];
|
||||
break;
|
||||
|
||||
case GS_RINGTYPE_QUIT:
|
||||
GSclose();
|
||||
return 0;
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
default:
|
||||
Console::Error("GSThreadProc, bad packet (%x) at m_RingPos: %x, m_WritePos: %x", params tag.command, m_RingPos, m_WritePos);
|
||||
|
@ -611,9 +618,6 @@ int mtgsThreadObject::Callback()
|
|||
}
|
||||
AtomicExchange( m_RingBufferIsBusy, 0 );
|
||||
}
|
||||
|
||||
GSclose();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Waits for the GS to empty out the entire ring buffer contents.
|
||||
|
|
|
@ -27,7 +27,6 @@ namespace Threading
|
|||
m_thread()
|
||||
, m_returncode( 0 )
|
||||
, m_terminated( false )
|
||||
, m_sigterm( 0 )
|
||||
, m_post_event()
|
||||
{
|
||||
if( pthread_create( &m_thread, NULL, _internal_callback, this ) != 0 )
|
||||
|
@ -41,8 +40,7 @@ namespace Threading
|
|||
|
||||
void Thread::Close()
|
||||
{
|
||||
AtomicExchange( m_sigterm, 1 );
|
||||
m_post_event.Post();
|
||||
pthread_cancel( m_thread );
|
||||
pthread_join( m_thread, NULL );
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ namespace Threading
|
|||
pthread_t m_thread;
|
||||
int m_returncode; // value returned from the thread on close.
|
||||
bool m_terminated; // set true after the thread has been closed.
|
||||
u32 m_sigterm; // set to true(1) when the thread has been requested to exit.
|
||||
Semaphore m_post_event; // general wait event that's needed by most threads.
|
||||
|
||||
public:
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32_PTHREADS"
|
||||
PreprocessorDefinitions="WIN32_PTHREADS;__CLEANUP_SEH"
|
||||
MinimalRebuild="true"
|
||||
ExceptionHandling="2"
|
||||
SmallerTypeCheck="false"
|
||||
|
@ -135,7 +135,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="NDEBUG;WIN32_PTHREADS"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32_PTHREADS;__CLEANUP_SEH"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="2"
|
||||
SmallerTypeCheck="false"
|
||||
|
@ -220,7 +220,7 @@
|
|||
Optimization="3"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="NDEBUG,WIN32_PTHREADS"
|
||||
PreprocessorDefinitions="NDEBUG,WIN32_PTHREADS;__CLEANUP_SEH"
|
||||
ExceptionHandling="2"
|
||||
SmallerTypeCheck="false"
|
||||
BufferSecurityCheck="false"
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(InputDir)""
|
||||
PreprocessorDefinitions="PTW32_STATIC_LIB;WIN32;_DEBUG;_LIB"
|
||||
PreprocessorDefinitions="PTW32_STATIC_LIB;__CLEANUP_SEH;WIN32;_DEBUG;_LIB"
|
||||
MinimalRebuild="true"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="3"
|
||||
|
@ -115,7 +115,7 @@
|
|||
FavorSizeOrSpeed="1"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories=""$(InputDir)""
|
||||
PreprocessorDefinitions="PTW32_STATIC_LIB;PTW32_BUILD_INLINED;WIN32;NDEBUG;_LIB"
|
||||
PreprocessorDefinitions="PTW32_STATIC_LIB;PTW32_BUILD_INLINED;__CLEANUP_SEH;WIN32;NDEBUG;_LIB"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="2"
|
||||
RuntimeLibrary="0"
|
||||
|
|
Loading…
Reference in New Issue