mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Because we only ever call Pos_ReadDirect (and through that, DataRead<T>)
from JIT generated code, the compiler may not get the heads-up to properly prepare for run-time instantiation of those template functions. Explicitly instantiating Pos_ReadDirect gets around that issue. Also force DataRead* inline as gcc didn't always do that itself when the DataRead functions in turn were called from (other) template functions. I am far from a C++ language lawyer, so I cannot speak learnedly about the correctness of this solution, but it works. Dolphin.app built on OS X 10.6 now actually works on 10.5 as well. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5901 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
2c419382c9
commit
faf586e8f1
@ -264,9 +264,9 @@ if sys.platform == 'darwin':
|
|||||||
env['FRAMEWORKS'] += ['AppKit', 'CoreFoundation', 'CoreServices']
|
env['FRAMEWORKS'] += ['AppKit', 'CoreFoundation', 'CoreServices']
|
||||||
env['FRAMEWORKS'] += ['AudioUnit', 'CoreAudio']
|
env['FRAMEWORKS'] += ['AudioUnit', 'CoreAudio']
|
||||||
env['FRAMEWORKS'] += ['IOBluetooth', 'IOKit', 'OpenGL']
|
env['FRAMEWORKS'] += ['IOBluetooth', 'IOKit', 'OpenGL']
|
||||||
env['LIBS'] += ['gcc_s.10.5', 'iconv']
|
env['LIBS'] += ['iconv']
|
||||||
env['LINKFLAGS'] += ['-arch', 'x86_64', '-arch', 'i386']
|
env['LINKFLAGS'] += ['-arch', 'x86_64', '-arch', 'i386']
|
||||||
# XXX env['LINKFLAGS'] += ['-mmacosx-version-min=10.5']
|
env['LINKFLAGS'] += ['-mmacosx-version-min=10.5']
|
||||||
env['LINKFLAGS'] += ['-Z', '-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib',
|
env['LINKFLAGS'] += ['-Z', '-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib',
|
||||||
'-F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks',
|
'-F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks',
|
||||||
'-F/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks']
|
'-F/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks']
|
||||||
@ -287,6 +287,8 @@ if sys.platform == 'darwin':
|
|||||||
env['FRAMEWORKS'].remove('AudioToolbox')
|
env['FRAMEWORKS'].remove('AudioToolbox')
|
||||||
if env['FRAMEWORKS'].count('Carbon'):
|
if env['FRAMEWORKS'].count('Carbon'):
|
||||||
env['FRAMEWORKS'].remove('Carbon')
|
env['FRAMEWORKS'].remove('Carbon')
|
||||||
|
if env['FRAMEWORKS'].count('System'):
|
||||||
|
env['FRAMEWORKS'].remove('System')
|
||||||
if env['FRAMEWORKS'].count('QuickTime'):
|
if env['FRAMEWORKS'].count('QuickTime'):
|
||||||
env['FRAMEWORKS'].remove('QuickTime')
|
env['FRAMEWORKS'].remove('QuickTime')
|
||||||
env['CPPPATH'] += ['#Externals']
|
env['CPPPATH'] += ['#Externals']
|
||||||
|
@ -11,7 +11,7 @@ files = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
libs = [
|
libs = [
|
||||||
'core', 'lzo2', 'discio', 'bdisasm', 'videocommon',
|
'core', 'lzo2', 'discio', 'bdisasm',
|
||||||
'inputcommon', 'common', 'lua', 'z', 'sfml-network',
|
'inputcommon', 'common', 'lua', 'z', 'sfml-network',
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -45,10 +45,6 @@ if wxenv['HAVE_WX']:
|
|||||||
'NetWindow.cpp',
|
'NetWindow.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
CPPDEFINES = [
|
|
||||||
'wxNEEDS_CHARPP',
|
|
||||||
],
|
|
||||||
|
|
||||||
libs = [ 'debwx', 'debugger_ui_util', 'inputuicommon'] + libs
|
libs = [ 'debwx', 'debugger_ui_util', 'inputuicommon'] + libs
|
||||||
else:
|
else:
|
||||||
files+= [
|
files+= [
|
||||||
|
@ -20,61 +20,59 @@
|
|||||||
|
|
||||||
extern u8* g_pVideoData;
|
extern u8* g_pVideoData;
|
||||||
|
|
||||||
inline void DataSkip(u32 skip)
|
__forceinline void DataSkip(u32 skip)
|
||||||
{
|
{
|
||||||
g_pVideoData += skip;
|
g_pVideoData += skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u8 DataPeek8(int _uOffset)
|
__forceinline u8 DataPeek8(int _uOffset)
|
||||||
{
|
{
|
||||||
return g_pVideoData[_uOffset];
|
return g_pVideoData[_uOffset];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u16 DataPeek16(int _uOffset)
|
__forceinline u16 DataPeek16(int _uOffset)
|
||||||
{
|
{
|
||||||
return Common::swap16(*(u16*)&g_pVideoData[_uOffset]);
|
return Common::swap16(*(u16*)&g_pVideoData[_uOffset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u32 DataPeek32(int _uOffset)
|
__forceinline u32 DataPeek32(int _uOffset)
|
||||||
{
|
{
|
||||||
return Common::swap32(*(u32*)&g_pVideoData[_uOffset]);
|
return Common::swap32(*(u32*)&g_pVideoData[_uOffset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u8 DataReadU8()
|
__forceinline u8 DataReadU8()
|
||||||
{
|
{
|
||||||
return *g_pVideoData++;
|
return *g_pVideoData++;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline s8 DataReadS8()
|
__forceinline s8 DataReadS8()
|
||||||
{
|
{
|
||||||
return (s8)(*g_pVideoData++);
|
return (s8)(*g_pVideoData++);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u16 DataReadU16()
|
__forceinline u16 DataReadU16()
|
||||||
{
|
{
|
||||||
u16 tmp = Common::swap16(*(u16*)g_pVideoData);
|
u16 tmp = Common::swap16(*(u16*)g_pVideoData);
|
||||||
g_pVideoData += 2;
|
g_pVideoData += 2;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u32 DataReadU32()
|
__forceinline u32 DataReadU32()
|
||||||
{
|
{
|
||||||
u32 tmp = Common::swap32(*(u32*)g_pVideoData);
|
u32 tmp = Common::swap32(*(u32*)g_pVideoData);
|
||||||
g_pVideoData += 4;
|
g_pVideoData += 4;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u32 DataReadU32Unswapped()
|
__forceinline u32 DataReadU32Unswapped()
|
||||||
{
|
{
|
||||||
u32 tmp = *(u32*)g_pVideoData;
|
u32 tmp = *(u32*)g_pVideoData;
|
||||||
g_pVideoData += 4;
|
g_pVideoData += 4;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// These are not used yet. If they don't build under Linux, delete them and let me know. -ector
|
|
||||||
template<class T>
|
template<class T>
|
||||||
inline T DataRead()
|
__forceinline T DataRead()
|
||||||
{
|
{
|
||||||
T tmp = *(T*)g_pVideoData;
|
T tmp = *(T*)g_pVideoData;
|
||||||
g_pVideoData += sizeof(T);
|
g_pVideoData += sizeof(T);
|
||||||
@ -82,48 +80,47 @@ inline T DataRead()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
inline u16 DataRead()
|
__forceinline u16 DataRead()
|
||||||
{
|
{
|
||||||
u16 tmp = Common::swap16(*(u16*)g_pVideoData);
|
u16 tmp = Common::swap16(*(u16*)g_pVideoData);
|
||||||
g_pVideoData += 2;
|
g_pVideoData += 2;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
inline s16 DataRead()
|
__forceinline s16 DataRead()
|
||||||
{
|
{
|
||||||
s16 tmp = (s16)Common::swap16(*(u16*)g_pVideoData);
|
s16 tmp = (s16)Common::swap16(*(u16*)g_pVideoData);
|
||||||
g_pVideoData += 2;
|
g_pVideoData += 2;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
inline u32 DataRead()
|
__forceinline u32 DataRead()
|
||||||
{
|
{
|
||||||
u32 tmp = (u32)Common::swap32(*(u32*)g_pVideoData);
|
u32 tmp = (u32)Common::swap32(*(u32*)g_pVideoData);
|
||||||
g_pVideoData += 4;
|
g_pVideoData += 4;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
inline s32 DataRead()
|
__forceinline s32 DataRead()
|
||||||
{
|
{
|
||||||
s32 tmp = (s32)Common::swap32(*(u32*)g_pVideoData);
|
s32 tmp = (s32)Common::swap32(*(u32*)g_pVideoData);
|
||||||
g_pVideoData += 4;
|
g_pVideoData += 4;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__forceinline float DataReadF32()
|
||||||
inline float DataReadF32()
|
|
||||||
{
|
{
|
||||||
union {u32 i; float f;} temp;
|
union {u32 i; float f;} temp;
|
||||||
temp.i = Common::swap32(*(u32*)g_pVideoData);
|
temp.i = Common::swap32(*(u32*)g_pVideoData);
|
||||||
g_pVideoData += 4;
|
g_pVideoData += 4;
|
||||||
float tmp = temp.f;
|
float tmp = temp.f;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline u8* DataGetPosition()
|
__forceinline u8* DataGetPosition()
|
||||||
{
|
{
|
||||||
return g_pVideoData;
|
return g_pVideoData;
|
||||||
}
|
}
|
||||||
|
@ -92,11 +92,21 @@ void Pos_ReadDirect()
|
|||||||
VertexManager::s_pCurBufferPointer += 12;
|
VertexManager::s_pCurBufferPointer += 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Explicitly instantiate these functions to decrease the possibility of
|
||||||
|
// symbol binding problems when (only) calling them from JIT compiled code.
|
||||||
|
template void Pos_ReadDirect<u8, true>();
|
||||||
|
template void Pos_ReadDirect<s8, true>();
|
||||||
|
template void Pos_ReadDirect<u16, true>();
|
||||||
|
template void Pos_ReadDirect<s16, true>();
|
||||||
|
template void Pos_ReadDirect<u8, false>();
|
||||||
|
template void Pos_ReadDirect<s8, false>();
|
||||||
|
template void Pos_ReadDirect<u16, false>();
|
||||||
|
template void Pos_ReadDirect<s16, false>();
|
||||||
|
|
||||||
void LOADERDECL Pos_ReadDirect_UByte3() { Pos_ReadDirect<u8, true>(); }
|
void LOADERDECL Pos_ReadDirect_UByte3() { Pos_ReadDirect<u8, true>(); }
|
||||||
void LOADERDECL Pos_ReadDirect_Byte3() { Pos_ReadDirect<s8, true>(); }
|
void LOADERDECL Pos_ReadDirect_Byte3() { Pos_ReadDirect<s8, true>(); }
|
||||||
void LOADERDECL Pos_ReadDirect_UShort3() { Pos_ReadDirect<u16, true>(); }
|
void LOADERDECL Pos_ReadDirect_UShort3() { Pos_ReadDirect<u16, true>(); }
|
||||||
void LOADERDECL Pos_ReadDirect_Short3() { Pos_ReadDirect<s16, true>(); }
|
void LOADERDECL Pos_ReadDirect_Short3() { Pos_ReadDirect<s16, true>(); }
|
||||||
|
|
||||||
void LOADERDECL Pos_ReadDirect_UByte2() { Pos_ReadDirect<u8, false>(); }
|
void LOADERDECL Pos_ReadDirect_UByte2() { Pos_ReadDirect<u8, false>(); }
|
||||||
void LOADERDECL Pos_ReadDirect_Byte2() { Pos_ReadDirect<s8, false>(); }
|
void LOADERDECL Pos_ReadDirect_Byte2() { Pos_ReadDirect<s8, false>(); }
|
||||||
void LOADERDECL Pos_ReadDirect_UShort2() { Pos_ReadDirect<u16, false>(); }
|
void LOADERDECL Pos_ReadDirect_UShort2() { Pos_ReadDirect<u16, false>(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user