From 1753d21df455858b40be6081a10e4465f66f314b Mon Sep 17 00:00:00 2001 From: drkIIRaziel Date: Fri, 5 Dec 2008 15:18:47 +0000 Subject: [PATCH] --Fixed some problems on the win32 threading code, handle can be NULL, the error value is INVALID_HANDLE_VALUE. --Don't call GS_SETEVENT from CSRwrite, because it calls SetEvent and thats a kernel function that sometimes corrupts the contents of the xmm regs.Since CSRwrite is called directly from the dynarec context without flushing the xmm regs that can lead to register corruption :p.Fixes PAL FFX on my pc [got broken on 376 and up] git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@394 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/GS.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pcsx2/GS.cpp b/pcsx2/GS.cpp index a95854ce0a..263c11556b 100644 --- a/pcsx2/GS.cpp +++ b/pcsx2/GS.cpp @@ -54,12 +54,12 @@ GS_THREADPROC; // forward declaration of the gs threadproc static bool thread_create( thread_t& thread ) { thread = CreateThread(NULL, 0, GSThreadProc, NULL, 0, NULL); - return thread != NULL; + return thread != INVALID_HANDLE_VALUE; } static void thread_close( thread_t& thread ) { - if( thread == NULL ) return; + if( thread == INVALID_HANDLE_VALUE ) return; while( true ) { DWORD status; @@ -68,7 +68,7 @@ static void thread_close( thread_t& thread ) Sleep( 3 ); } CloseHandle( thread ); - thread = NULL; + thread = INVALID_HANDLE_VALUE; } static void event_init( wait_event_t& evt ) @@ -771,7 +771,6 @@ void CSRwrite(u32 value) if( CHECK_MULTIGS ) { GSRingBufSimplePacket( GS_RINGTYPE_WRITECSR, CSRw, 0, 0 ); - GS_SETEVENT(); } else GSwriteCSR(CSRw);