From 59ebdf3e602535f41d807ca479fbcd1c9873ba68 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Mon, 13 Sep 2010 22:52:04 +0000 Subject: [PATCH] GCC compilation fixes. (note to devs: a sure-fire fix for GCC's templated function problems is to typecast the templated function to itself explicitly -- works nicely for all versions of GCC and the ?: operator as well). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3763 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Vif_Codes.cpp | 1 - pcsx2/Vif_Unpack.cpp | 10 +++++----- pcsx2/Vif_Unpack.h | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pcsx2/Vif_Codes.cpp b/pcsx2/Vif_Codes.cpp index 5171b4c4b5..aa91c777bf 100644 --- a/pcsx2/Vif_Codes.cpp +++ b/pcsx2/Vif_Codes.cpp @@ -38,7 +38,6 @@ static __fi void vifFlush(int idx) { } static __fi void vuExecMicro(int idx, u32 addr) { - VURegs& VU = vuRegs[idx]; VIFregisters& vifRegs = vifXRegs; int startcycles = 0; //vifFlush(idx); diff --git a/pcsx2/Vif_Unpack.cpp b/pcsx2/Vif_Unpack.cpp index 9fb513dece..76bc1f60fa 100644 --- a/pcsx2/Vif_Unpack.cpp +++ b/pcsx2/Vif_Unpack.cpp @@ -33,7 +33,7 @@ static __fi u32 setVifRow(vifStruct& vif, u32 reg, u32 data) { // cycle derives from vif.cl // mode derives from vifRegs.mode template< uint idx, uint mode, bool doMask > -static __ri void writeXYZW(u32 offnum, u32 &dest, u32 data, bool isV4_5 = false) { +static __ri void writeXYZW(u32 offnum, u32 &dest, u32 data) { int n = 0; vifStruct& vif = GetVifX; @@ -110,10 +110,10 @@ static void __fastcall UNPACK_V4_5(u32 *dest, const u32* src) { u32 data = *src; - writeXYZW(OFFSET_X, *(dest+0), ((data & 0x001f) << 3), true); - writeXYZW(OFFSET_Y, *(dest+1), ((data & 0x03e0) >> 2), true); - writeXYZW(OFFSET_Z, *(dest+2), ((data & 0x7c00) >> 7), true); - writeXYZW(OFFSET_W, *(dest+3), ((data & 0x8000) >> 8), true); + writeXYZW(OFFSET_X, *(dest+0), ((data & 0x001f) << 3)); + writeXYZW(OFFSET_Y, *(dest+1), ((data & 0x03e0) >> 2)); + writeXYZW(OFFSET_Z, *(dest+2), ((data & 0x7c00) >> 7)); + writeXYZW(OFFSET_W, *(dest+3), ((data & 0x8000) >> 8)); } // ===================================================================================================== diff --git a/pcsx2/Vif_Unpack.h b/pcsx2/Vif_Unpack.h index b4056cfd97..a2b41b3ce5 100644 --- a/pcsx2/Vif_Unpack.h +++ b/pcsx2/Vif_Unpack.h @@ -19,8 +19,8 @@ struct vifStruct; typedef void (__fastcall *UNPACKFUNCTYPE)(void* dest, const void* src); -#define create_unpack_u_type(bits) typedef void (__fastcall *UNPACKFUNCTYPE_u##bits)(u32* dest); -#define create_unpack_s_type(bits) typedef void (__fastcall *UNPACKFUNCTYPE_s##bits)(u32* dest); +#define create_unpack_u_type(bits) typedef void (__fastcall *UNPACKFUNCTYPE_u##bits)(u32* dest, const u##bits* src); +#define create_unpack_s_type(bits) typedef void (__fastcall *UNPACKFUNCTYPE_s##bits)(u32* dest, const s##bits* src); #define create_some_unpacks(bits) \ create_unpack_u_type(bits); \