Darwin/OSX ifdef __APPLE__ or __WXMAC__ cases.

OSX comment about __WXMAC__ usage
This commit is contained in:
Juha Laukkanen 2015-11-17 20:59:53 +02:00
parent 592aacb25a
commit 4fa8834de4
4 changed files with 69 additions and 13 deletions

View File

@ -335,6 +335,14 @@ extern void __Log( const char* fmt, ... );
# define SysTraceActive(trace) (false)
#endif
#ifdef __WXMAC__
// Not available on OSX, apparently always double buffered window.
# define SetDoubleBuffered(x)
// TODO OSX OsxKeyCodes.cpp pending
# define NewPipeRedir(x) NULL
#endif
#define macTrace(trace) SysTraceActive(trace) && SysTrace.trace.Write
#define SIF_LOG macTrace(SIF)

View File

@ -58,7 +58,13 @@ void yuv2rgb_reference(void)
}
}
#ifdef _M_X86_32
// TODO OSX optimize me
#ifdef __APPLE__
void yuv2rgb_sse2() {
yuv2rgb_reference();
}
#elif defined(_M_X86_32)
// Everything below is bit accurate to the IPU specification (except maybe rounding).
// Know the specification before you touch it.
#define SSE_BYTES(x) {x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x}

View File

@ -50,6 +50,19 @@
#include <gtk/gtk.h>
#endif
// Safe to remove these lines when this is handled properly.
#ifdef __WXMAC__
// Great joy....
#undef EBP
#undef ESP
#undef EDI
#undef ESI
#undef EDX
#undef EAX
#undef EBX
#undef ECX
#include <wx/osx/private.h> // needed to implement the app!
#endif
IMPLEMENT_APP(Pcsx2App)
@ -277,6 +290,8 @@ void Pcsx2App::PadKeyDispatch( const keyEvent& ev )
//returns 0 for normal keys and a WXK_* value for special keys
#ifdef __WXMSW__
const int vkey = TranslateVKToWXK(ev.key);
#elif defined( __WXMAC__ )
const int vkey = wxCharCodeWXToOSX( (wxKeyCode) ev.key );
#elif defined( __WXGTK__ )
const int vkey = TranslateGDKtoWXK( ev.key );
#else
@ -415,7 +430,7 @@ public:
return Path::Combine( GetDataDir(), L"Langs" );
}
#ifdef __linux__
#ifdef __POSIX__
wxString GetUserLocalDataDir() const
{
// I got memory corruption inside wxGetEnv when I heavily toggle the GS renderer (F9). It seems wxGetEnv

View File

@ -1,7 +1,34 @@
// iVUzerorec.cpp assembly routines
// zerofrog(@gmail.com)
.intel_syntax noprefix
#ifdef __APPLE__
#define svudispfntemp _svudispfntemp
#define s_TotalVUCycles _s_TotalVUCycles
#define s_callstack _s_callstack
#define s_vu1ebp _s_vu1ebp
#define s_vu1esp _s_vu1esp
#define s_vu1esi _s_vu1esi
#define s_vuedi _s_vuedi
#define s_vuebx _s_vuebx
#define s_saveebx _s_saveebx
#define s_saveecx _s_saveecx
#define s_saveedx _s_saveedx
#define s_saveesi _s_saveesi
#define s_saveedi _s_saveedi
#define s_saveebp _s_saveebp
#define s_writeQ _s_writeQ
#define s_writeP _s_writeP
#define g_curdebugvu _g_curdebugvu
#define SuperVUGetProgram _SuperVUGetProgram
#define SuperVUCleanupProgram _SuperVUCleanupProgram
#define SuperVUExecuteProgram _SuperVUExecuteProgram
#define SuperVUEndProgram _SuperVUEndProgram
#define g_sseVUMXCSR _g_sseVUMXCSR
#define g_sseMXCSR _g_sseMXCSR
#endif
.intel_syntax noprefix
.extern s_TotalVUCycles
.extern s_callstack
.extern s_vu1esp
@ -26,7 +53,7 @@ SuperVUExecuteProgram:
mov s_vuebx, ebx
mov s_vu1esp, esp
and esp, -16 // align stack for GCC compilance
and esp, -16 // align stack for GCC compilance
ldmxcsr g_sseVUMXCSR
mov dword ptr s_writeQ, 0xffffffff
@ -35,17 +62,17 @@ SuperVUExecuteProgram:
.globl SuperVUEndProgram
SuperVUEndProgram:
// restore cpu state
ldmxcsr g_sseMXCSR
mov esi, s_vu1esi
mov edi, s_vuedi
mov ebx, s_vuebx
// restore cpu state
ldmxcsr g_sseMXCSR
mov esi, s_vu1esi
mov edi, s_vuedi
mov ebx, s_vuebx
mov esp, s_vu1esp
call SuperVUCleanupProgram
jmp [s_callstack] // so returns correctly
call SuperVUCleanupProgram
jmp [s_callstack] // so returns correctly
#if defined(__linux__) && defined(__ELF__)
#if defined(__POSIX__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif