From bcac59ee4fa391015fc79e8fe160a977df86806d Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 31 Aug 2010 05:47:54 +0000 Subject: [PATCH] Linux/GCC fixes. :) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3705 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Pcsx2Types.h | 15 ++++++++++----- pcsx2/CMakeLists.txt | 2 +- pcsx2/HwRead.cpp | 4 +++- pcsx2/HwWrite.cpp | 5 +++-- pcsx2/ps2/Iop/IopHw_Internal.h | 2 +- pcsx2/ps2/eeHwTraceLog.inl | 2 +- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/common/include/Pcsx2Types.h b/common/include/Pcsx2Types.h index 76147eed84..11c316ac51 100644 --- a/common/include/Pcsx2Types.h +++ b/common/include/Pcsx2Types.h @@ -134,20 +134,25 @@ union u128 // Explicit conversion from u64. Zero-extends the source through 128 bits. static u128 From64( u64 src ) { - u128 retval = { src, 0 }; + u128 retval; + retval.lo = src; + retval.hi = 0; return retval; } // Explicit conversion from u32. Zero-extends the source through 128 bits. static u128 From32( u32 src ) { - u128 retval = { src, 0 }; + u128 retval; + retval._u32[0] = src; + retval._u32[1] = 0; + retval.hi = 0; return retval; } - operator u32() const { return (u32)lo; } - operator u16() const { return (u16)lo; } - operator u8() const { return (u8)lo; } + operator u32() const { return _u32[0]; } + operator u16() const { return _u16[0]; } + operator u8() const { return _u8[0]; } bool operator==( const u128& right ) const { diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 1100543b52..0c4a375ca4 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -402,7 +402,7 @@ set(pcsx2ps2Sources set(pcsx2ps2Headers ps2/BiosTools.h ps2/eeHwTraceLog.inl - ps2/HwInternal.inl + ps2/HwInternal.h ps2/Iop/IopHw_Internal.h) # RDebug sources diff --git a/pcsx2/HwRead.cpp b/pcsx2/HwRead.cpp index 143ecc5a56..3b1813da29 100644 --- a/pcsx2/HwRead.cpp +++ b/pcsx2/HwRead.cpp @@ -34,6 +34,8 @@ static __fi void IntCHackCheck() static const uint HwF_VerboseConLog = 1<<0; static const uint HwF_IntcStatHack = 1<<1; // used for Reads only. +template< uint page > void __fastcall _hwRead128(u32 mem, mem128_t* result ); + template< uint page, bool intcstathack > mem32_t __fastcall _hwRead32(u32 mem) { @@ -68,7 +70,7 @@ mem32_t __fastcall _hwRead32(u32 mem) DevCon.WriteLn( Color_Cyan, "Reading 32-bit FIFO data" ); u128 out128; - hwRead128(mem, &out128); + _hwRead128(mem, &out128); return out128._u32[(mem >> 2) & 0x3]; } break; diff --git a/pcsx2/HwWrite.cpp b/pcsx2/HwWrite.cpp index 0c3e795ba3..2a5fedd3a8 100644 --- a/pcsx2/HwWrite.cpp +++ b/pcsx2/HwWrite.cpp @@ -29,8 +29,9 @@ using namespace R5900; #define HELPSWITCH(m) (((m)>>4) & 0xff) #define mcase(src) case HELPSWITCH(src) -template< uint page > void __fastcall hwWrite8(u32 mem, u8 value); -template< uint page > void __fastcall hwWrite16(u32 mem, u8 value); +template< uint page > void __fastcall _hwWrite8(u32 mem, u8 value); +template< uint page > void __fastcall _hwWrite16(u32 mem, u8 value); +template< uint page > void __fastcall _hwWrite128(u32 mem, u8 value); template diff --git a/pcsx2/ps2/Iop/IopHw_Internal.h b/pcsx2/ps2/Iop/IopHw_Internal.h index 48c953a509..9308205169 100644 --- a/pcsx2/ps2/Iop/IopHw_Internal.h +++ b/pcsx2/ps2/Iop/IopHw_Internal.h @@ -209,7 +209,7 @@ static __ri void IopHwTraceLog( u32 addr, T val, bool mode ) FastFormatAscii labelStr; labelStr.Write("Hw%s%u", mode ? "Read" : "Write", sizeof (T) * 8); - switch( sizeof T ) + switch( sizeof (T) ) { case 1: valStr.Write("0x%02x", val); break; case 2: valStr.Write("0x%04x", val); break; diff --git a/pcsx2/ps2/eeHwTraceLog.inl b/pcsx2/ps2/eeHwTraceLog.inl index ffd02e7902..388d40378a 100644 --- a/pcsx2/ps2/eeHwTraceLog.inl +++ b/pcsx2/ps2/eeHwTraceLog.inl @@ -249,7 +249,7 @@ static __ri void eeHwTraceLog( u32 addr, T val, bool mode ) FastFormatAscii labelStr; labelStr.Write("Hw%s%u", mode ? "Read" : "Write", sizeof (T) * 8); - switch( sizeof T ) + switch( sizeof(T) ) { case 1: valStr.Write("0x%02x", val); break; case 2: valStr.Write("0x%04x", val); break;