From 95c2cce3d5ccb8709e4bebafc541491c0bf234f9 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 10 Mar 2009 11:45:20 +0000 Subject: [PATCH 01/77] Folder Structure change: Renamed the 'Win32' folder to 'Windows' for several plugins. It's technically more correct and alleviates some confusion with the Win32 target/build folders generated by MSVC. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@733 96395faa-99c1-11dd-bbfe-3dabce05a288 --- 3rdparty/3rdparty.vsprops | 4 ++-- pcsx2_suite_2008.sln | 12 ++++++------ plugins/CDVDiso/src/{Win32 => Windows}/CDVDiso.def | 0 plugins/CDVDiso/src/{Win32 => Windows}/CDVDiso.rc | 0 .../src/{Win32 => Windows}/CDVDiso_vs2008.vcproj | 0 plugins/CDVDiso/src/{Win32 => Windows}/Config.c | 0 plugins/CDVDiso/src/{Win32 => Windows}/Config.h | 0 plugins/CDVDiso/src/{Win32 => Windows}/Makefile | 0 plugins/CDVDiso/src/{Win32 => Windows}/Win32.c | 0 plugins/CDVDiso/src/{Win32 => Windows}/resource.h | 0 plugins/FWnull/{Win32 => Windows}/Config.c | 0 .../FWnull/{Win32 => Windows}/FWnull_vc2008.vcproj | 0 plugins/FWnull/{Win32 => Windows}/FireWireNull.def | 0 plugins/FWnull/{Win32 => Windows}/FireWireNull.rc | 0 plugins/FWnull/{Win32 => Windows}/Makefile | 0 .../{Win32 => Windows}/ProjectRootDir.vsprops | 0 plugins/FWnull/{Win32 => Windows}/Win32.c | 0 plugins/FWnull/{Win32 => Windows}/resource.h | 0 plugins/USBnull/{Win32 => Windows}/Config.c | 0 plugins/USBnull/{Win32 => Windows}/Makefile | 0 .../{Win32 => Windows}/ProjectRootDir.vsprops | 0 plugins/USBnull/{Win32 => Windows}/USBnull.def | 0 plugins/USBnull/{Win32 => Windows}/USBnull.rc | 0 .../{Win32 => Windows}/USBnull_vc2008.vcproj | 0 plugins/USBnull/{Win32 => Windows}/Win32.c | 0 plugins/USBnull/{Win32 => Windows}/resource.h | 0 plugins/spu2-x/src/{Win32 => Windows}/AboutBox.cpp | 0 .../spu2-x/src/{Win32 => Windows}/CfgHelpers.cpp | 0 plugins/spu2-x/src/{Win32 => Windows}/Config.cpp | 0 plugins/spu2-x/src/{Win32 => Windows}/Config.h | 0 .../spu2-x/src/{Win32 => Windows}/ConfigDebug.cpp | 0 .../src/{Win32 => Windows}/ConfigSoundtouch.cpp | 0 plugins/spu2-x/src/{Win32 => Windows}/Dialogs.h | 0 plugins/spu2-x/src/{Win32 => Windows}/Dsound51.cpp | 0 .../spu2-x/src/{Win32 => Windows}/Hyperlinks.cpp | 0 plugins/spu2-x/src/{Win32 => Windows}/Hyperlinks.h | 0 .../src/{Win32 => Windows}/RealtimeDebugger.cpp | 0 .../spu2-x/src/{Win32 => Windows}/SndOut_DSound.cpp | 0 .../src/{Win32 => Windows}/SndOut_XAudio2.cpp | 0 .../src/{Win32 => Windows}/SndOut_waveOut.cpp | 0 plugins/spu2-x/src/{Win32 => Windows}/Spu2-X.def | 0 plugins/spu2-x/src/{Win32 => Windows}/Spu2-X.rc | 0 .../src/{Win32 => Windows}/Spu2-X_vs2008.vcproj | 0 plugins/spu2-x/src/{Win32 => Windows}/UIHelpers.cpp | 0 plugins/spu2-x/src/{Win32 => Windows}/dsp.cpp | 0 plugins/spu2-x/src/{Win32 => Windows}/dsp.h | 0 plugins/spu2-x/src/{Win32 => Windows}/resource.h | 0 plugins/zerogs/dx/{Win32 => Windows}/Conf.cpp | 0 plugins/zerogs/dx/{Win32 => Windows}/GSsoftdx.def | 0 plugins/zerogs/dx/{Win32 => Windows}/Win32.cpp | 0 plugins/zerogs/dx/{Win32 => Windows}/Win32.h | 0 plugins/zerogs/dx/{Win32 => Windows}/aviUtil.h | 0 .../dx/{Win32 => Windows}/pcsxrootdir.vsprops | 0 plugins/zerogs/dx/{Win32 => Windows}/plugin.def | 0 plugins/zerogs/dx/{Win32 => Windows}/ps2fx.dat | Bin plugins/zerogs/dx/{Win32 => Windows}/resource.h | 0 plugins/zerogs/dx/{Win32 => Windows}/resrc1.h | 0 plugins/zerogs/dx/{Win32 => Windows}/zerogs.bmp | Bin plugins/zerogs/dx/{Win32 => Windows}/zerogs.rc | 0 .../zerogs/dx/{Win32 => Windows}/zerogs_2008.vcproj | 0 .../{Win32 => Windows}/ProjectRootDir.vsprops | 0 plugins/zerospu2/{Win32 => Windows}/Win32.cpp | 0 plugins/zerospu2/{Win32 => Windows}/ZeroSPU2.def | 0 plugins/zerospu2/{Win32 => Windows}/ZeroSPU2.rc | 0 .../{Win32 => Windows}/ZeroSPU2_2008.vcproj | 0 plugins/zerospu2/{Win32 => Windows}/dsound51.cpp | 0 plugins/zerospu2/{Win32 => Windows}/resource.h | 0 67 files changed, 8 insertions(+), 8 deletions(-) rename plugins/CDVDiso/src/{Win32 => Windows}/CDVDiso.def (100%) rename plugins/CDVDiso/src/{Win32 => Windows}/CDVDiso.rc (100%) rename plugins/CDVDiso/src/{Win32 => Windows}/CDVDiso_vs2008.vcproj (100%) rename plugins/CDVDiso/src/{Win32 => Windows}/Config.c (100%) rename plugins/CDVDiso/src/{Win32 => Windows}/Config.h (100%) rename plugins/CDVDiso/src/{Win32 => Windows}/Makefile (100%) rename plugins/CDVDiso/src/{Win32 => Windows}/Win32.c (100%) rename plugins/CDVDiso/src/{Win32 => Windows}/resource.h (100%) rename plugins/FWnull/{Win32 => Windows}/Config.c (100%) rename plugins/FWnull/{Win32 => Windows}/FWnull_vc2008.vcproj (100%) rename plugins/FWnull/{Win32 => Windows}/FireWireNull.def (100%) rename plugins/FWnull/{Win32 => Windows}/FireWireNull.rc (100%) rename plugins/FWnull/{Win32 => Windows}/Makefile (100%) rename plugins/FWnull/{Win32 => Windows}/ProjectRootDir.vsprops (100%) rename plugins/FWnull/{Win32 => Windows}/Win32.c (100%) rename plugins/FWnull/{Win32 => Windows}/resource.h (100%) rename plugins/USBnull/{Win32 => Windows}/Config.c (100%) rename plugins/USBnull/{Win32 => Windows}/Makefile (100%) rename plugins/USBnull/{Win32 => Windows}/ProjectRootDir.vsprops (100%) rename plugins/USBnull/{Win32 => Windows}/USBnull.def (100%) rename plugins/USBnull/{Win32 => Windows}/USBnull.rc (100%) rename plugins/USBnull/{Win32 => Windows}/USBnull_vc2008.vcproj (100%) rename plugins/USBnull/{Win32 => Windows}/Win32.c (100%) rename plugins/USBnull/{Win32 => Windows}/resource.h (100%) rename plugins/spu2-x/src/{Win32 => Windows}/AboutBox.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/CfgHelpers.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/Config.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/Config.h (100%) rename plugins/spu2-x/src/{Win32 => Windows}/ConfigDebug.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/ConfigSoundtouch.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/Dialogs.h (100%) rename plugins/spu2-x/src/{Win32 => Windows}/Dsound51.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/Hyperlinks.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/Hyperlinks.h (100%) rename plugins/spu2-x/src/{Win32 => Windows}/RealtimeDebugger.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/SndOut_DSound.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/SndOut_XAudio2.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/SndOut_waveOut.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/Spu2-X.def (100%) rename plugins/spu2-x/src/{Win32 => Windows}/Spu2-X.rc (100%) rename plugins/spu2-x/src/{Win32 => Windows}/Spu2-X_vs2008.vcproj (100%) rename plugins/spu2-x/src/{Win32 => Windows}/UIHelpers.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/dsp.cpp (100%) rename plugins/spu2-x/src/{Win32 => Windows}/dsp.h (100%) rename plugins/spu2-x/src/{Win32 => Windows}/resource.h (100%) rename plugins/zerogs/dx/{Win32 => Windows}/Conf.cpp (100%) rename plugins/zerogs/dx/{Win32 => Windows}/GSsoftdx.def (100%) rename plugins/zerogs/dx/{Win32 => Windows}/Win32.cpp (100%) rename plugins/zerogs/dx/{Win32 => Windows}/Win32.h (100%) rename plugins/zerogs/dx/{Win32 => Windows}/aviUtil.h (100%) rename plugins/zerogs/dx/{Win32 => Windows}/pcsxrootdir.vsprops (100%) rename plugins/zerogs/dx/{Win32 => Windows}/plugin.def (100%) rename plugins/zerogs/dx/{Win32 => Windows}/ps2fx.dat (100%) rename plugins/zerogs/dx/{Win32 => Windows}/resource.h (100%) rename plugins/zerogs/dx/{Win32 => Windows}/resrc1.h (100%) rename plugins/zerogs/dx/{Win32 => Windows}/zerogs.bmp (100%) rename plugins/zerogs/dx/{Win32 => Windows}/zerogs.rc (100%) rename plugins/zerogs/dx/{Win32 => Windows}/zerogs_2008.vcproj (100%) rename plugins/zerospu2/{Win32 => Windows}/ProjectRootDir.vsprops (100%) rename plugins/zerospu2/{Win32 => Windows}/Win32.cpp (100%) rename plugins/zerospu2/{Win32 => Windows}/ZeroSPU2.def (100%) rename plugins/zerospu2/{Win32 => Windows}/ZeroSPU2.rc (100%) rename plugins/zerospu2/{Win32 => Windows}/ZeroSPU2_2008.vcproj (100%) rename plugins/zerospu2/{Win32 => Windows}/dsound51.cpp (100%) rename plugins/zerospu2/{Win32 => Windows}/resource.h (100%) diff --git a/3rdparty/3rdparty.vsprops b/3rdparty/3rdparty.vsprops index b5d789323f..1a107abb2c 100644 --- a/3rdparty/3rdparty.vsprops +++ b/3rdparty/3rdparty.vsprops @@ -3,8 +3,8 @@ ProjectType="Visual C++" Version="8.00" Name="3rdparty" - OutputDirectory="$(ProjectDir)..\..\deps\$(PlatformName)\$(ConfigurationName)" - IntermediateDirectory="$(ProjectDir)\$(PlatformName)\$(ConfigurationName)" + OutputDirectory="..\..\deps\$(PlatformName)\$(ConfigurationName)" + IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" > Date: Tue, 10 Mar 2009 12:25:45 +0000 Subject: [PATCH 02/77] Fix the yuv2rgb.cpp issues, per Zeydlitz's patch in issue 100. fast_memcpy works in Linux now as of r727, so I'll leave it enabled for a while, and if it seems stable, I'll remove the switch for it, and have it permanently enabled. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@735 96395faa-99c1-11dd-bbfe-3dabce05a288 --- build.sh | 6 +++--- pcsx2/IPU/yuv2rgb.cpp | 34 ++++++++++++++++++++-------------- pcsx2/x86/fast_routines.S | 2 +- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/build.sh b/build.sh index ca1c11b69d..ae2ca97abe 100644 --- a/build.sh +++ b/build.sh @@ -9,13 +9,13 @@ #export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --prefix `pwd`" #Optimized, but a devbuild -export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --enable-devbuild --prefix `pwd`" +#export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --enable-devbuild --prefix `pwd`" #Debug / Devbuild version #export PCSX2OPTIONS="--enable-debug --enable-devbuild --enable-sse3 --prefix `pwd`" -#Optimized, but a devbuild - with memcpy_fast_ enabled. - BROKEN! -#export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --enable-devbuild --enable-memcpyfast --prefix `pwd`" +#Optimized, but a devbuild - with memcpy_fast_ enabled. - EXPERIMENTAL +export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --enable-devbuild --enable-memcpyfast --prefix `pwd`" #ZeroGS Normal mode export ZEROGSOPTIONS="--enable-sse2" diff --git a/pcsx2/IPU/yuv2rgb.cpp b/pcsx2/IPU/yuv2rgb.cpp index 48896cbeef..312ff8b845 100644 --- a/pcsx2/IPU/yuv2rgb.cpp +++ b/pcsx2/IPU/yuv2rgb.cpp @@ -58,7 +58,7 @@ enum BCb_COEFF = 0x40 }; -static PCSX2_ALIGNED16(const SSE2_Tables sse2_tables) = +static volatile PCSX2_ALIGNED16(const SSE2_Tables sse2_tables) = { {0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000}, // c_bias {16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16}, // y_bias @@ -223,8 +223,8 @@ ihatemsvc: // Use ecx and edx as base pointers, to allow for Mod/RM form on memOps. // This saves 2-3 bytes per instruction where these are used. :) - "mov ecx, offset yuv2rgb_temp\n" - "mov edx, offset sse2_tables+64\n" + "mov ecx, offset %c[yuv2rgb_temp]\n" + "mov edx, offset %c[sse2_tables]+64\n" ".align 16\n" "tworows:\n" @@ -240,15 +240,15 @@ ihatemsvc: // unfortunately I don't think this will matter despite being // technically potentially a little faster, but this is // equivalent to an add or sub - "pxor xmm2, xmmword ptr [edx-0x40]\n" // xmm2 <-- 8 x (Cb - 128) << 8 - "pxor xmm0, xmmword ptr [edx-0x40]\n" // xmm0 <-- 8 x (Cr - 128) << 8 + "pxor xmm2, xmmword ptr [edx+%c[C_BIAS]]\n" // xmm2 <-- 8 x (Cb - 128) << 8 + "pxor xmm0, xmmword ptr [edx+%c[C_BIAS]]\n" // xmm0 <-- 8 x (Cr - 128) << 8 "movaps xmm1, xmm0\n" "movaps xmm3, xmm2\n" - "pmulhw xmm1, xmmword ptr [edx+0x10]\n" - "pmulhw xmm3, xmmword ptr [edx+0x20]\n" - "pmulhw xmm0, xmmword ptr [edx+0x30]\n" - "pmulhw xmm2, xmmword ptr [edx+0x40]\n" + "pmulhw xmm1, xmmword ptr [edx+%c[GCr_COEFF]]\n" + "pmulhw xmm3, xmmword ptr [edx+%c[GCb_COEFF]]\n" + "pmulhw xmm0, xmmword ptr [edx+%c[RCr_COEFF]]\n" + "pmulhw xmm2, xmmword ptr [edx+%c[BCb_COEFF]]\n" "paddsw xmm1, xmm3\n" // store for the next line; looking at the code above // compared to the code below, I have to wonder whether @@ -270,13 +270,13 @@ ihatemsvc: "movaps xmm5, xmm2\n" "movaps xmm6, xmmword ptr [mb8+edi]\n" - "psubusb xmm6, xmmword ptr [edx-0x30]\n" + "psubusb xmm6, xmmword ptr [edx+%c[Y_BIAS]]\n" "movaps xmm7, xmm6\n" "psllw xmm6, 8\n" // xmm6 <- Y << 8 for pixels 0,2,4,6,8,10,12,14 - "pand xmm7, xmmword ptr [edx+Y_MASK]\n" // xmm7 <- Y << 8 for pixels 1,3,5,7,9,11,13,15 + "pand xmm7, xmmword ptr [edx+%c[Y_MASK]]\n" // xmm7 <- Y << 8 for pixels 1,3,5,7,9,11,13,15 - "pmulhuw xmm6, xmmword ptr [edx+0x00]\n" - "pmulhuw xmm7, xmmword ptr [edx+0x00]\n" + "pmulhuw xmm6, xmmword ptr [edx+%c[Y_COEFF]]\n" + "pmulhuw xmm7, xmmword ptr [edx+%c[Y_COEFF]]\n" "paddsw xmm0, xmm6\n" "paddsw xmm3, xmm7\n" @@ -286,7 +286,7 @@ ihatemsvc: "paddsw xmm5, xmm7\n" // round - "movaps xmm6, xmmword ptr [edx-0x10]\n" + "movaps xmm6, xmmword ptr [edx+%c[ROUND_1BIT]]\n" "paddw xmm0, xmm6\n" "paddw xmm1, xmm6\n" "paddw xmm2, xmm6\n" @@ -342,6 +342,12 @@ ihatemsvc: "cmp esi, 64\n" "jne tworows\n" ".att_syntax\n" + : + :[C_BIAS]"i"(C_BIAS), [Y_BIAS]"i"(Y_BIAS), [Y_MASK]"i"(Y_MASK), + [ROUND_1BIT]"i"(ROUND_1BIT), [Y_COEFF]"i"(Y_COEFF), [GCr_COEFF]"i"(GCr_COEFF), + [GCb_COEFF]"i"(GCb_COEFF), [RCr_COEFF]"i"(RCr_COEFF), [BCb_COEFF]"i"(BCb_COEFF), + [yuv2rgb_temp]"i"(yuv2rgb_temp), [sse2_tables]"i"(&sse2_tables) + : ); #else #error Unsupported compiler diff --git a/pcsx2/x86/fast_routines.S b/pcsx2/x86/fast_routines.S index 0cdfcbc0fc..c38669d08b 100644 --- a/pcsx2/x86/fast_routines.S +++ b/pcsx2/x86/fast_routines.S @@ -381,7 +381,7 @@ $memcpy_align_done: // destination is dword aligned shr eax, 6 // get 64-byte block count jz $memcpy_ic_2 // finish the last few bytes - mov edx, offset _mmx_backup ; will probably need this to save/restore mmx + mov edx, offset _mmx_backup // will probably need this to save/restore mmx cmp eax, IN_CACHE_COPY/64 // too big 4 cache? use uncached copy jae $memcpy_uc_test From 15901551b4f10d5a5f976a5945141d6b03bd9a0d Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 10 Mar 2009 19:21:54 +0000 Subject: [PATCH 03/77] Improved PCR/TIMR support -- fixed a case where games would try and read from the PCR multiple times in the same recompiled block, reuslting in bogus values, and fixed some sign extension errors on the interpreted version of MFC0. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@738 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/COP0.cpp | 146 +++++++++++++++++++++++++++++++------------- pcsx2/COP0.h | 14 +++-- pcsx2/R5900.cpp | 18 ++---- pcsx2/x86/iCOP0.cpp | 142 ++++++++++++++++++++++-------------------- 4 files changed, 194 insertions(+), 126 deletions(-) diff --git a/pcsx2/COP0.cpp b/pcsx2/COP0.cpp index ae6540f9ee..80c23137f9 100644 --- a/pcsx2/COP0.cpp +++ b/pcsx2/COP0.cpp @@ -144,79 +144,137 @@ void WriteTLB(int i) MapTLB(i); } +////////////////////////////////////////////////////////////////////////////////////////// +// Note regarding updates of PERF and TIMR registers: never allow increment to be 0. +// That happens when a game loads the MFC0 twice in the same recompiled block (before the +// cpuRegs.cycles update), and can cause games to lock up since it's an unexpected result. + +__forceinline void COP0_UpdatePCR0() +{ + if((cpuRegs.PERF.n.pccr & 0x800003E0) == 0x80000020) + { + u32 incr = cpuRegs.cycle-s_iLastPERFCycle[0]; + if( incr == 0 ) incr++; + + cpuRegs.PERF.n.pcr0 += incr; + s_iLastPERFCycle[0] = cpuRegs.cycle; + } +} + +__forceinline void COP0_UpdatePCR1() +{ + if((cpuRegs.PERF.n.pccr & 0x800F8000) == 0x80008000) + { + u32 incr = cpuRegs.cycle-s_iLastPERFCycle[1]; + if( incr == 0 ) incr++; + + cpuRegs.PERF.n.pcr1 += incr; + s_iLastPERFCycle[1] = cpuRegs.cycle; + } +} + + namespace R5900 { namespace Interpreter { namespace OpcodeImpl { namespace COP0 { -void MFC0() { - if (!_Rt_) return; - if (_Rd_ != 9) { COP0_LOG("%s\n", disR5900Current.getCString() ); } +void MFC0() +{ + // Note on _Rd_ Condition 9: CP0.Count should be updated even if _Rt_ is 0. + if( (_Rd_ != 9) && !_Rt_ ) return; + if(_Rd_ != 9) { COP0_LOG("%s\n", disR5900Current.getCString() ); } //if(bExecBIOS == FALSE && _Rd_ == 25) SysPrintf("MFC0 _Rd_ %x = %x\n", _Rd_, cpuRegs.CP0.r[_Rd_]); - switch (_Rd_) { + switch (_Rd_) + { - case 12: cpuRegs.GPR.r[_Rt_].UD[0] = (s64)(cpuRegs.CP0.r[_Rd_] & 0xf0c79c1f); break; + case 12: + cpuRegs.GPR.r[_Rt_].SD[0] = (s32)(cpuRegs.CP0.r[_Rd_] & 0xf0c79c1f); + break; + case 25: - switch(_Imm_ & 0x3F){ - case 0: cpuRegs.GPR.r[_Rt_].UD[0] = (s64)cpuRegs.PERF.n.pccr; break; - case 1: - if((cpuRegs.PERF.n.pccr & 0x800003E0) == 0x80000020) { - cpuRegs.PERF.n.pcr0 += cpuRegs.cycle-s_iLastPERFCycle[0]; - s_iLastPERFCycle[0] = cpuRegs.cycle; - } - - cpuRegs.GPR.r[_Rt_].UD[0] = (s64)cpuRegs.PERF.n.pcr0; - break; - case 3: - if((cpuRegs.PERF.n.pccr & 0x800F8000) == 0x80008000) { - cpuRegs.PERF.n.pcr1 += cpuRegs.cycle-s_iLastPERFCycle[1]; - s_iLastPERFCycle[1] = cpuRegs.cycle; - } - cpuRegs.GPR.r[_Rt_].UD[0] = (s64)cpuRegs.PERF.n.pcr1; - break; + switch(_Imm_ & 0x3F) + { + case 0: // MFPS [LSB is clear] + cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pccr; + break; + + case 1: // MFPC [LSB is set] - read PCR0 + COP0_UpdatePCR0(); + cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pcr0; + break; + + case 3: // MFPC [LSB is set] - read PCR1 + COP0_UpdatePCR1(); + cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pcr1; + break; } /*SysPrintf("MFC0 PCCR = %x PCR0 = %x PCR1 = %x IMM= %x\n", cpuRegs.PERF.n.pccr, cpuRegs.PERF.n.pcr0, cpuRegs.PERF.n.pcr1, _Imm_ & 0x3F);*/ - break; + break; + case 24: - SysPrintf("MFC0 Breakpoint debug Registers code = %x\n", cpuRegs.code & 0x3FF); - break; + Console::WriteLn("MFC0 Breakpoint debug Registers code = %x", params cpuRegs.code & 0x3FF); + break; + case 9: - // update - cpuRegs.CP0.n.Count += cpuRegs.cycle-s_iLastCOP0Cycle; + { + u32 incr = cpuRegs.cycle-s_iLastCOP0Cycle; + if( incr == 0 ) incr++; + cpuRegs.CP0.n.Count += incr; s_iLastCOP0Cycle = cpuRegs.cycle; - default: cpuRegs.GPR.r[_Rt_].UD[0] = (s64)cpuRegs.CP0.r[_Rd_]; + if( !_Rt_ ) break; + } + + default: + cpuRegs.GPR.r[_Rt_].UD[0] = (s64)cpuRegs.CP0.r[_Rd_]; } } -void MTC0() { +void MTC0() +{ COP0_LOG("%s\n", disR5900Current.getCString()); //if(bExecBIOS == FALSE && _Rd_ == 25) SysPrintf("MTC0 _Rd_ %x = %x\n", _Rd_, cpuRegs.CP0.r[_Rd_]); - switch (_Rd_) { + switch (_Rd_) + { case 25: /*if(bExecBIOS == FALSE && _Rd_ == 25) SysPrintf("MTC0 PCCR = %x PCR0 = %x PCR1 = %x IMM= %x\n", cpuRegs.PERF.n.pccr, cpuRegs.PERF.n.pcr0, cpuRegs.PERF.n.pcr1, _Imm_ & 0x3F);*/ - switch(_Imm_ & 0x3F){ - case 0: - if((cpuRegs.PERF.n.pccr & 0x800003E0) == 0x80000020) - cpuRegs.PERF.n.pcr0 += cpuRegs.cycle-s_iLastPERFCycle[0]; - if((cpuRegs.PERF.n.pccr & 0x800F8000) == 0x80008000) - cpuRegs.PERF.n.pcr1 += cpuRegs.cycle-s_iLastPERFCycle[1]; + switch(_Imm_ & 0x3F) + { + case 0: // MTPS [LSB is clear] + // Updates PCRs and sets the PCCR. + COP0_UpdatePCR0(); + COP0_UpdatePCR1(); cpuRegs.PERF.n.pccr = cpuRegs.GPR.r[_Rt_].UL[0]; + break; + + case 1: // MTPC [LSB is set] - set PCR0 + cpuRegs.PERF.n.pcr0 = cpuRegs.GPR.r[_Rt_].UL[0]; s_iLastPERFCycle[0] = cpuRegs.cycle; + break; + + case 3: // MTPC [LSB is set] - set PCR0 + cpuRegs.PERF.n.pcr1 = cpuRegs.GPR.r[_Rt_].UL[0]; s_iLastPERFCycle[1] = cpuRegs.cycle; - break; - case 1: cpuRegs.PERF.n.pcr0 = cpuRegs.GPR.r[_Rt_].UL[0]; s_iLastPERFCycle[0] = cpuRegs.cycle; break; - case 3: cpuRegs.PERF.n.pcr1 = cpuRegs.GPR.r[_Rt_].UL[0]; s_iLastPERFCycle[1] = cpuRegs.cycle; break; + break; } - break; + break; + case 24: - SysPrintf("MTC0 Breakpoint debug Registers code = %x\n", cpuRegs.code & 0x3FF); - break; + Console::WriteLn("MTC0 Breakpoint debug Registers code = %x", params cpuRegs.code & 0x3FF); + break; + case 12: WriteCP0Status(cpuRegs.GPR.r[_Rt_].UL[0]); break; - case 9: s_iLastCOP0Cycle = cpuRegs.cycle; cpuRegs.CP0.r[9] = cpuRegs.GPR.r[_Rt_].UL[0]; break; - default: cpuRegs.CP0.r[_Rd_] = cpuRegs.GPR.r[_Rt_].UL[0]; break; + case 9: + s_iLastCOP0Cycle = cpuRegs.cycle; + cpuRegs.CP0.r[9] = cpuRegs.GPR.r[_Rt_].UL[0]; + break; + + default: + cpuRegs.CP0.r[_Rd_] = cpuRegs.GPR.r[_Rt_].UL[0]; + break; } } diff --git a/pcsx2/COP0.h b/pcsx2/COP0.h index 6fb2a200d0..f8b0e4e6e1 100644 --- a/pcsx2/COP0.h +++ b/pcsx2/COP0.h @@ -19,10 +19,14 @@ #ifndef __COP0_H__ #define __COP0_H__ -void WriteCP0Status(u32 value); -void UpdateCP0Status(); -void WriteTLB(int i); -void UnmapTLB(int i); -void MapTLB(int i); +extern void WriteCP0Status(u32 value); +extern void UpdateCP0Status(); +extern void WriteTLB(int i); +extern void UnmapTLB(int i); +extern void MapTLB(int i); + +extern void COP0_UpdatePCR0(); +extern void COP0_UpdatePCR1(); + #endif /* __COP0_H__ */ diff --git a/pcsx2/R5900.cpp b/pcsx2/R5900.cpp index fffa793c05..82dcd8b6b8 100644 --- a/pcsx2/R5900.cpp +++ b/pcsx2/R5900.cpp @@ -387,19 +387,13 @@ static __forceinline void _cpuTestTIMR() static __forceinline void _cpuTestPERF() { - // fixme - The interpreter and recompiler both re-calculate these values - // whenever they are read, so updating them at regular intervals *should be* - // merely a common courtesy. But when I set them up to be called less - // frequently some games would crash. I'd like to figure out why someday. [Air] + // Perfs are updated when read by games (COP0's MFC0/MTC0 instructions), so we need + // only update them at semi-regular intervals to keep cpuRegs.cycle from wrapping + // around twice on us btween updates. Hence this function is called from the cpu's + // Counters update. - if((cpuRegs.PERF.n.pccr & 0x800003E0) == 0x80000020) { - cpuRegs.PERF.n.pcr0 += cpuRegs.cycle-s_iLastPERFCycle[0]; - s_iLastPERFCycle[0] = cpuRegs.cycle; - } - if((cpuRegs.PERF.n.pccr & 0x800F8000) == 0x80008000) { - cpuRegs.PERF.n.pcr1 += cpuRegs.cycle-s_iLastPERFCycle[1]; - s_iLastPERFCycle[1] = cpuRegs.cycle; - } + COP0_UpdatePCR0(); + COP0_UpdatePCR1(); } // Checks the COP0.Status for exception enablings. diff --git a/pcsx2/x86/iCOP0.cpp b/pcsx2/x86/iCOP0.cpp index f53c527fbc..7bb3eca220 100644 --- a/pcsx2/x86/iCOP0.cpp +++ b/pcsx2/x86/iCOP0.cpp @@ -128,16 +128,21 @@ void recMFC0( void ) { int mmreg; - if ( ! _Rt_ ) return; - - if( _Rd_ == 9 ) { + if( _Rd_ == 9 ) + { + // This case needs to be handled even if the write-back is ignored (_Rt_ == 0 ) MOV32MtoR(ECX, (uptr)&cpuRegs.cycle); - MOV32RtoR(EAX,ECX); + MOV32RtoR(EAX, ECX); SUB32MtoR(EAX, (uptr)&s_iLastCOP0Cycle); + u8* skipInc = JNZ8( 0 ); + INC32R(EAX); + x86SetJ8( skipInc ); ADD32RtoM((uptr)&cpuRegs.CP0.n.Count, EAX); MOV32RtoM((uptr)&s_iLastCOP0Cycle, ECX); MOV32MtoR( EAX, (uptr)&cpuRegs.CP0.r[ _Rd_ ] ); - + + if( !_Rt_ ) return; + _deleteEEreg(_Rt_, 0); MOV32RtoM((uptr)&cpuRegs.GPR.r[_Rt_].UL[0],EAX); @@ -148,34 +153,37 @@ void recMFC0( void ) else EEINST_RESETHASLIVE1(_Rt_); return; } - if( _Rd_ == 25 ) { - - _deleteEEreg(_Rt_, 0); - switch(_Imm_ & 0x3F){ + + if ( !_Rt_ ) return; + + if( _Rd_ == 25 ) + { + switch(_Imm_ & 0x3F) + { case 0: MOV32MtoR(EAX, (uptr)&cpuRegs.PERF.n.pccr); - break; + break; case 1: - // check if needs to be incremented - MOV32MtoR(ECX, (uptr)&cpuRegs.PERF.n.pccr); + /*MOV32MtoR(ECX, (uptr)&cpuRegs.PERF.n.pccr); MOV32MtoR(EAX, (uptr)&cpuRegs.PERF.n.pcr0); AND32ItoR(ECX, 0x800003E0); CMP32ItoR(ECX, 0x80000020); j8Ptr[0] = JNE8(0); - + MOV32MtoR(EDX, (uptr)&cpuRegs.cycle); SUB32MtoR(EAX, (uptr)&s_iLastPERFCycle[0]); ADD32RtoR(EAX, EDX); MOV32RtoM((uptr)&s_iLastPERFCycle[0], EDX); MOV32RtoM((uptr)&cpuRegs.PERF.n.pcr0, EAX); - x86SetJ8(j8Ptr[0]); + x86SetJ8(j8Ptr[0]);*/ + + CALLFunc( (uptr)COP0_UpdatePCR0 ); break; case 3: - // check if needs to be incremented - MOV32MtoR(ECX, (uptr)&cpuRegs.PERF.n.pccr); + /*MOV32MtoR(ECX, (uptr)&cpuRegs.PERF.n.pccr); MOV32MtoR(EAX, (uptr)&cpuRegs.PERF.n.pcr1); AND32ItoR(ECX, 0x800F8000); @@ -188,12 +196,13 @@ void recMFC0( void ) MOV32RtoM((uptr)&s_iLastPERFCycle[1], EDX); MOV32RtoM((uptr)&cpuRegs.PERF.n.pcr1, EAX); - x86SetJ8(j8Ptr[0]); - + x86SetJ8(j8Ptr[0]);*/ + + CALLFunc( (uptr)COP0_UpdatePCR1 ); break; } - - MOV32RtoM((uptr)&cpuRegs.GPR.r[_Rt_].UL[0],EAX); + _deleteEEreg(_Rt_, 0); + MOV32RtoM((uptr)&cpuRegs.GPR.r[_Rt_].UL[0],EAX); if(EEINST_ISLIVE1(_Rt_)) { CDQ(); @@ -201,10 +210,6 @@ void recMFC0( void ) } else EEINST_RESETHASLIVE1(_Rt_); -#ifdef PCSX2_DEVBUILD - COP0_LOG("MFC0 PCCR = %x PCR0 = %x PCR1 = %x IMM= %x\n", - cpuRegs.PERF.n.pccr, cpuRegs.PERF.n.pcr0, cpuRegs.PERF.n.pcr1, _Imm_ & 0x3F); -#endif return; } else if( _Rd_ == 24){ @@ -283,93 +288,100 @@ void updatePCCR() void recMTC0() { - if( GPR_IS_CONST1(_Rt_) ) { - switch (_Rd_) { + if( GPR_IS_CONST1(_Rt_) ) + { + switch (_Rd_) + { case 12: iFlushCall(FLUSH_NODESTROY); //_flushCachedRegs(); //NOTE: necessary? _callFunctionArg1((uptr)WriteCP0Status, MEM_CONSTTAG, g_cpuConstRegs[_Rt_].UL[0]); - break; + break; + case 9: MOV32MtoR(ECX, (uptr)&cpuRegs.cycle); MOV32RtoM((uptr)&s_iLastCOP0Cycle, ECX); MOV32ItoM((uptr)&cpuRegs.CP0.r[9], g_cpuConstRegs[_Rt_].UL[0]); - break; - case 25: - COP0_LOG("MTC0 PCCR = %x PCR0 = %x PCR1 = %x IMM= %x\n", - cpuRegs.PERF.n.pccr, cpuRegs.PERF.n.pcr0, cpuRegs.PERF.n.pcr1, _Imm_ & 0x3F); - switch(_Imm_ & 0x3F){ - case 0: - - updatePCCR(); - MOV32ItoM((uptr)&cpuRegs.PERF.n.pccr, g_cpuConstRegs[_Rt_].UL[0]); + break; + + case 25: + switch(_Imm_ & 0x3F) + { + case 0: + CALLFunc( (uptr)COP0_UpdatePCR0 ); + CALLFunc( (uptr)COP0_UpdatePCR1 ); + MOV32ItoM((uptr)&cpuRegs.PERF.n.pccr, g_cpuConstRegs[_Rt_].UL[0]); + break; - // update the cycles - MOV32RtoM((uptr)&s_iLastPERFCycle[0], ECX); - MOV32RtoM((uptr)&s_iLastPERFCycle[1], ECX); - break; case 1: MOV32MtoR(EAX, (uptr)&cpuRegs.cycle); MOV32ItoM((uptr)&cpuRegs.PERF.n.pcr0, g_cpuConstRegs[_Rt_].UL[0]); MOV32RtoM((uptr)&s_iLastPERFCycle[0], EAX); - break; + break; + case 3: MOV32MtoR(EAX, (uptr)&cpuRegs.cycle); MOV32ItoM((uptr)&cpuRegs.PERF.n.pcr1, g_cpuConstRegs[_Rt_].UL[0]); MOV32RtoM((uptr)&s_iLastPERFCycle[1], EAX); - break; + break; } - break; + break; + case 24: COP0_LOG("MTC0 Breakpoint debug Registers code = %x\n", cpuRegs.code & 0x3FF); - break; + break; + default: MOV32ItoM((uptr)&cpuRegs.CP0.r[_Rd_], g_cpuConstRegs[_Rt_].UL[0]); - break; + break; } } - else { - switch (_Rd_) { + else + { + switch (_Rd_) + { case 12: iFlushCall(FLUSH_NODESTROY); //_flushCachedRegs(); //NOTE: necessary? _callFunctionArg1((uptr)WriteCP0Status, MEM_GPRTAG|_Rt_, 0); - break; + break; + case 9: MOV32MtoR(ECX, (uptr)&cpuRegs.cycle); _eeMoveGPRtoM((uptr)&cpuRegs.CP0.r[9], _Rt_); MOV32RtoM((uptr)&s_iLastCOP0Cycle, ECX); - break; - case 25: - COP0_LOG("MTC0 PCCR = %x PCR0 = %x PCR1 = %x IMM= %x\n", - cpuRegs.PERF.n.pccr, cpuRegs.PERF.n.pcr0, cpuRegs.PERF.n.pcr1, _Imm_ & 0x3F); - switch(_Imm_ & 0x3F){ - case 0: - updatePCCR(); - _eeMoveGPRtoM((uptr)&cpuRegs.PERF.n.pccr, _Rt_); + break; + + case 25: + switch(_Imm_ & 0x3F) + { + case 0: + CALLFunc( (uptr)COP0_UpdatePCR0 ); + CALLFunc( (uptr)COP0_UpdatePCR1 ); + _eeMoveGPRtoM((uptr)&cpuRegs.PERF.n.pccr, _Rt_); + break; - // update the cycles - MOV32RtoM((uptr)&s_iLastPERFCycle[0], ECX); - MOV32RtoM((uptr)&s_iLastPERFCycle[1], ECX); - break; case 1: MOV32MtoR(ECX, (uptr)&cpuRegs.cycle); _eeMoveGPRtoM((uptr)&cpuRegs.PERF.n.pcr0, _Rt_); MOV32RtoM((uptr)&s_iLastPERFCycle[0], ECX); - break; + break; + case 3: MOV32MtoR(ECX, (uptr)&cpuRegs.cycle); _eeMoveGPRtoM((uptr)&cpuRegs.PERF.n.pcr1, _Rt_); MOV32RtoM((uptr)&s_iLastPERFCycle[1], ECX); - break; + break; } - break; + break; + case 24: COP0_LOG("MTC0 Breakpoint debug Registers code = %x\n", cpuRegs.code & 0x3FF); - break; + break; + default: _eeMoveGPRtoM((uptr)&cpuRegs.CP0.r[_Rd_], _Rt_); - break; + break; } } } From 7425f1bb6e1c074f028af334b142ebfe140df81e Mon Sep 17 00:00:00 2001 From: tmkkmac Date: Tue, 10 Mar 2009 19:44:32 +0000 Subject: [PATCH 04/77] Fixed a problem in the new VU clip flag code that a history of the flag is cleared wrongly in a certain situation. Unfortunately the problem in GoW is still there :( MMI: Optimizations for some opcodes. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@739 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/iMMI.cpp | 309 ++++++++++++++++------------------- pcsx2/x86/iVUzerorec.cpp | 1 - pcsx2/x86/ix86/ix86_macros.h | 4 + pcsx2/x86/ix86/ix86_sse.inl | 32 ++++ 4 files changed, 177 insertions(+), 169 deletions(-) diff --git a/pcsx2/x86/iMMI.cpp b/pcsx2/x86/iMMI.cpp index 077a119d40..92bcff30d3 100644 --- a/pcsx2/x86/iMMI.cpp +++ b/pcsx2/x86/iMMI.cpp @@ -1023,99 +1023,46 @@ CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) int t0reg = _allocTempXMMreg(XMMT_INT, -1); int t1reg = _allocTempXMMreg(XMMT_INT, -1); int t2reg = _allocTempXMMreg(XMMT_INT, -1); - int t3reg = _allocTempXMMreg(XMMT_INT, -1); - if ( cpucaps.hasStreamingSIMD4Extensions ) { - SSE4_PMOVSXDQ_XMM_to_XMM(t0reg, EEREC_S); - SSE4_PMOVSXDQ_XMM_to_XMM(t1reg, EEREC_T); - SSE2_PADDQ_XMM_to_XMM(t0reg, t1reg); - SSE2_PSHUFD_XMM_to_XMM(t1reg, EEREC_S, 0x0e); - SSE2_PSHUFD_XMM_to_XMM(t2reg, EEREC_T, 0x0e); - SSE4_PMOVSXDQ_XMM_to_XMM(t1reg, t1reg); - SSE4_PMOVSXDQ_XMM_to_XMM(t2reg, t2reg); - } - else { - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_S); - SSEX_MOVDQA_XMM_to_XMM(t1reg, EEREC_T); - SSE2_PXOR_XMM_to_XMM(t2reg, t2reg); - SSE2_PXOR_XMM_to_XMM(t3reg, t3reg); - SSE2_PCMPGTD_XMM_to_XMM(t2reg, t0reg); - SSE2_PCMPGTD_XMM_to_XMM(t3reg, t1reg); - SSE2_PUNPCKLDQ_XMM_to_XMM(t0reg, t2reg); - SSE2_PUNPCKLDQ_XMM_to_XMM(t1reg, t3reg); - SSE2_PADDQ_XMM_to_XMM(t0reg, t1reg); - SSEX_MOVDQA_XMM_to_XMM(t1reg, EEREC_S); - SSE2_PUNPCKHDQ_XMM_to_XMM(t1reg, t2reg); - SSEX_MOVDQA_XMM_to_XMM(t2reg, EEREC_T); - SSE2_PUNPCKHDQ_XMM_to_XMM(t2reg, t3reg); - } - SSE2_PADDQ_XMM_to_XMM(t1reg, t2reg); - /* - t0reg = { Rs[0]+Rt[0], Rs[1]+Rt[1] } - t1reg = { Rs[2]+Rt[2], Rs[3]+Rt[3] } - */ + // The idea is: + // s = x + y; (wrap-arounded) + // if Sign(x) == Sign(y) && Sign(s) != Sign(x) && Sign(x) == 0 then positive overflow (clamp with 0x7fffffff) + // if Sign(x) == Sign(y) && Sign(s) != Sign(x) && Sign(x) == 1 then negative overflow (clamp with 0x80000000) - SSEX_MOVDQA_XMM_to_XMM(t2reg, t0reg); - SSE_SHUFPS_XMM_to_XMM(t2reg, t1reg, 0xdd); - SSE2_PSRAD_I8_to_XMM(t2reg, 31); - /* - t2reg = { (Rs[0]+Rt[0]) < 0 ? 0xFFFFFFFF : 0, - (Rs[1]+Rt[1]) < 0 ? 0xFFFFFFFF : 0, - (Rs[2]+Rt[2]) < 0 ? 0xFFFFFFFF : 0, - (Rs[3]+Rt[3]) < 0 ? 0xFFFFFFFF : 0 } - */ + // get sign bit + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_S); + SSEX_MOVDQA_XMM_to_XMM(t1reg, EEREC_T); + SSE2_PSRLD_I8_to_XMM(t0reg, 31); + SSE2_PSRLD_I8_to_XMM(t1reg, 31); - SSE2_PSHUFD_XMM_to_XMM(t3reg, t2reg, 0x50); - SSE2_PXOR_XMM_to_XMM(t0reg, t3reg); - SSE2_PSRLQ_I8_to_XMM(t3reg, 63); - SSE2_PADDQ_XMM_to_XMM(t0reg, t3reg); - /* - t0reg = { abs(Rs[0]+Rt[0]), abs(Rs[1]+Rt[1]) } - */ - SSE2_PSHUFD_XMM_to_XMM(t3reg, t2reg, 0xfa); - SSE2_PXOR_XMM_to_XMM(t1reg, t3reg); - SSE2_PSRLQ_I8_to_XMM(t3reg, 63); - SSE2_PADDQ_XMM_to_XMM(t1reg, t3reg); - /* - t1reg = { abs(Rs[2]+Rt[2]), abs(Rs[3]+Rt[3]) } - */ - SSE2_PSLLQ_I8_to_XMM(t0reg, 1); - SSE2_PSLLQ_I8_to_XMM(t1reg, 1); - SSE2_PCMPEQB_XMM_to_XMM(t3reg, t3reg); - SSE2_PSRLD_I8_to_XMM(t3reg, 1); - SSE2_PXOR_XMM_to_XMM(t2reg, t3reg); - SSE_SHUFPS_XMM_to_XMM(t0reg, t1reg, 0xdd); - SSE2_PXOR_XMM_to_XMM(t1reg, t1reg); - SSE2_PCMPEQD_XMM_to_XMM(t1reg, t0reg); - /* - t1reg = { abs(Rs[0]+Rt[0]) > 0x7FFFFFFF ? 0 : 0xFFFFFFFF, - abs(Rs[1]+Rt[1]) > 0x7FFFFFFF ? 0 : 0xFFFFFFFF, - abs(Rs[2]+Rt[2]) > 0x7FFFFFFF ? 0 : 0xFFFFFFFF, - abs(Rs[3]+Rt[3]) > 0x7FFFFFFF ? 0 : 0xFFFFFFFF } - t2reg = { (Rs[0]+Rt[0]) < 0 ? 0x80000000 : 0x7FFFFFFF, - (Rs[1]+Rt[1]) < 0 ? 0x80000000 : 0x7FFFFFFF, - (Rs[2]+Rt[2]) < 0 ? 0x80000000 : 0x7FFFFFFF, - (Rs[3]+Rt[3]) < 0 ? 0x80000000 : 0x7FFFFFFF } - */ + // normal addition if( EEREC_D == EEREC_S ) SSE2_PADDD_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) SSE2_PADDD_XMM_to_XMM(EEREC_D, EEREC_S); else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); SSE2_PADDD_XMM_to_XMM(EEREC_D, EEREC_T); } - SSE2_PAND_XMM_to_XMM(EEREC_D, t1reg); - SSE2_PANDN_XMM_to_XMM(t1reg, t2reg); - SSE2_POR_XMM_to_XMM(EEREC_D, t1reg); - /* - Rd = { t1reg[0] ? Rs[0]+Rt[0] : t2reg[0], - t1reg[1] ? Rs[1]+Rt[1] : t2reg[1], - t1reg[2] ? Rs[2]+Rt[2] : t2reg[2], - t1reg[3] ? Rs[3]+Rt[3] : t2reg[3] } - */ + + // overflow check + // t2reg = 0xffffffff if overflow, else 0 + SSEX_MOVDQA_XMM_to_XMM(t2reg, EEREC_D); + SSE2_PSRLD_I8_to_XMM(t2reg, 31); + SSE2_PCMPEQD_XMM_to_XMM(t1reg, t0reg); // Sign(Rs) == Sign(Rt) + SSE2_PCMPEQD_XMM_to_XMM(t2reg, t0reg); // Sign(Rs) == Sign(Rd) + SSE2_PANDN_XMM_to_XMM(t2reg, t1reg); // (Sign(Rs) == Sign(Rt)) & ~(Sign(Rs) == Sign(Rd)) + SSE2_PCMPEQD_XMM_to_XMM(t1reg, t1reg); + SSE2_PSRLD_I8_to_XMM(t1reg, 1); // 0x7fffffff + SSE2_PADDD_XMM_to_XMM(t1reg, t0reg); // t1reg = (Rs < 0) ? 0x80000000 : 0x7fffffff + + // saturation + SSE2_PAND_XMM_to_XMM(t1reg, t2reg); + SSE2_PANDN_XMM_to_XMM(t2reg, EEREC_D); + SSE2_POR_XMM_to_XMM(t1reg, t2reg); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, t1reg); + _freeXMMreg(t0reg); _freeXMMreg(t1reg); _freeXMMreg(t2reg); - _freeXMMreg(t3reg); CPU_SSE_XMMCACHE_END if( _Rd_ ) _deleteEEreg(_Rd_, 0); @@ -1136,11 +1083,17 @@ void recPSUBSB( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBSB_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBSB_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); + if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { + SSSE3_PSIGNB_XMM_to_XMM(EEREC_D, EEREC_D); + SSE2_PADDSB_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs + } + else { + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBSB_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); + } } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1172,11 +1125,17 @@ void recPSUBSH( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBSW_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBSW_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); + if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { + SSSE3_PSIGNW_XMM_to_XMM(EEREC_D, EEREC_D); + SSE2_PADDSW_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs + } + else { + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBSW_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); + } } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1210,71 +1169,55 @@ CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) int t0reg = _allocTempXMMreg(XMMT_INT, -1); int t1reg = _allocTempXMMreg(XMMT_INT, -1); int t2reg = _allocTempXMMreg(XMMT_INT, -1); - int t3reg = _allocTempXMMreg(XMMT_INT, -1); - if ( cpucaps.hasStreamingSIMD4Extensions ) { - SSE4_PMOVSXDQ_XMM_to_XMM(t0reg, EEREC_S); - SSE4_PMOVSXDQ_XMM_to_XMM(t1reg, EEREC_T); - SSE2_PSUBQ_XMM_to_XMM(t0reg, t1reg); - SSE2_PSHUFD_XMM_to_XMM(t1reg, EEREC_S, 0x0e); - SSE2_PSHUFD_XMM_to_XMM(t2reg, EEREC_T, 0x0e); - SSE4_PMOVSXDQ_XMM_to_XMM(t1reg, t1reg); - SSE4_PMOVSXDQ_XMM_to_XMM(t2reg, t2reg); - } - else { - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_S); - SSEX_MOVDQA_XMM_to_XMM(t1reg, EEREC_T); - SSE2_PXOR_XMM_to_XMM(t2reg, t2reg); - SSE2_PXOR_XMM_to_XMM(t3reg, t3reg); - SSE2_PCMPGTD_XMM_to_XMM(t2reg, t0reg); - SSE2_PCMPGTD_XMM_to_XMM(t3reg, t1reg); - SSE2_PUNPCKLDQ_XMM_to_XMM(t0reg, t2reg); - SSE2_PUNPCKLDQ_XMM_to_XMM(t1reg, t3reg); - SSE2_PSUBQ_XMM_to_XMM(t0reg, t1reg); - SSEX_MOVDQA_XMM_to_XMM(t1reg, EEREC_S); - SSE2_PUNPCKHDQ_XMM_to_XMM(t1reg, t2reg); - SSEX_MOVDQA_XMM_to_XMM(t2reg, EEREC_T); - SSE2_PUNPCKHDQ_XMM_to_XMM(t2reg, t3reg); - } - SSE2_PSUBQ_XMM_to_XMM(t1reg, t2reg); + // The idea is: + // s = x - y; (wrap-arounded) + // if Sign(x) != Sign(y) && Sign(s) != Sign(x) && Sign(x) == 0 then positive overflow (clamp with 0x7fffffff) + // if Sign(x) != Sign(y) && Sign(s) != Sign(x) && Sign(x) == 1 then negative overflow (clamp with 0x80000000) - SSEX_MOVDQA_XMM_to_XMM(t2reg, t0reg); - SSE_SHUFPS_XMM_to_XMM(t2reg, t1reg, 0xdd); - SSE2_PSRAD_I8_to_XMM(t2reg, 31); + // get sign bit + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_S); + SSEX_MOVDQA_XMM_to_XMM(t1reg, EEREC_T); + SSE2_PSRLD_I8_to_XMM(t0reg, 31); + SSE2_PSRLD_I8_to_XMM(t1reg, 31); - SSE2_PSHUFD_XMM_to_XMM(t3reg, t2reg, 0x50); - SSE2_PXOR_XMM_to_XMM(t0reg, t3reg); - SSE2_PSRLQ_I8_to_XMM(t3reg, 63); - SSE2_PADDQ_XMM_to_XMM(t0reg, t3reg); - SSE2_PSHUFD_XMM_to_XMM(t3reg, t2reg, 0xfa); - SSE2_PXOR_XMM_to_XMM(t1reg, t3reg); - SSE2_PSRLQ_I8_to_XMM(t3reg, 63); - SSE2_PADDQ_XMM_to_XMM(t1reg, t3reg); - SSE2_PSLLQ_I8_to_XMM(t0reg, 1); - SSE2_PSLLQ_I8_to_XMM(t1reg, 1); - SSE2_PCMPEQB_XMM_to_XMM(t3reg, t3reg); - SSE2_PSRLD_I8_to_XMM(t3reg, 1); - SSE2_PXOR_XMM_to_XMM(t2reg, t3reg); - SSE_SHUFPS_XMM_to_XMM(t0reg, t1reg, 0xdd); - SSE2_PXOR_XMM_to_XMM(t1reg, t1reg); - SSE2_PCMPEQD_XMM_to_XMM(t1reg, t0reg); + // normal subtraction if( EEREC_D == EEREC_S ) SSE2_PSUBD_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBD_XMM_to_XMM(EEREC_D, t0reg); + if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { + SSSE3_PSIGND_XMM_to_XMM(EEREC_D, EEREC_D); + SSE2_PADDD_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs + } + else { + SSEX_MOVDQA_XMM_to_XMM(t2reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBD_XMM_to_XMM(EEREC_D, t2reg); + } } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); SSE2_PSUBD_XMM_to_XMM(EEREC_D, EEREC_T); } - SSE2_PAND_XMM_to_XMM(EEREC_D, t1reg); - SSE2_PANDN_XMM_to_XMM(t1reg, t2reg); - SSE2_POR_XMM_to_XMM(EEREC_D, t1reg); + + // overflow check + // t2reg = 0xffffffff if NOT overflow, else 0 + SSEX_MOVDQA_XMM_to_XMM(t2reg, EEREC_D); + SSE2_PSRLD_I8_to_XMM(t2reg, 31); + SSE2_PCMPEQD_XMM_to_XMM(t1reg, t0reg); // Sign(Rs) == Sign(Rt) + SSE2_PCMPEQD_XMM_to_XMM(t2reg, t0reg); // Sign(Rs) == Sign(Rd) + SSE2_POR_XMM_to_XMM(t2reg, t1reg); // (Sign(Rs) == Sign(Rt)) | (Sign(Rs) == Sign(Rd)) + SSE2_PCMPEQD_XMM_to_XMM(t1reg, t1reg); + SSE2_PSRLD_I8_to_XMM(t1reg, 1); // 0x7fffffff + SSE2_PADDD_XMM_to_XMM(t1reg, t0reg); // t1reg = (Rs < 0) ? 0x80000000 : 0x7fffffff + + // saturation + SSE2_PAND_XMM_to_XMM(EEREC_D, t2reg); + SSE2_PANDN_XMM_to_XMM(t2reg, t1reg); + SSE2_POR_XMM_to_XMM(EEREC_D, t2reg); + _freeXMMreg(t0reg); _freeXMMreg(t1reg); _freeXMMreg(t2reg); - _freeXMMreg(t3reg); CPU_SSE_XMMCACHE_END if( _Rd_ ) _deleteEEreg(_Rd_, 0); @@ -1403,11 +1346,17 @@ void recPSUBB( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBB_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBB_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); + if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { + SSSE3_PSIGNB_XMM_to_XMM(EEREC_D, EEREC_D); + SSE2_PADDB_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs + } + else { + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBB_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); + } } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1439,11 +1388,17 @@ void recPSUBH( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBW_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBW_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); + if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { + SSSE3_PSIGNW_XMM_to_XMM(EEREC_D, EEREC_D); + SSE2_PADDW_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs + } + else { + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBW_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); + } } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1475,11 +1430,17 @@ void recPSUBW( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBD_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBD_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); + if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { + SSSE3_PSIGND_XMM_to_XMM(EEREC_D, EEREC_D); + SSE2_PADDD_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs + } + else { + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBD_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); + } } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1899,11 +1860,17 @@ void recPSUBUB() CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBUSB_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBUSB_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); + if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { + SSSE3_PSIGNB_XMM_to_XMM(EEREC_D, EEREC_D); + SSE2_PADDUSB_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs + } + else { + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBUSB_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); + } } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1922,11 +1889,17 @@ void recPSUBUH() CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBUSW_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBUSW_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); + if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { + SSSE3_PSIGNW_XMM_to_XMM(EEREC_D, EEREC_D); + SSE2_PADDUSW_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs + } + else { + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBUSW_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); + } } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index 1ea2e87c1b..14116b9665 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -3022,7 +3022,6 @@ void VuInstruction::Recompile(list::iterator& itinst, u32 vuxyz) CMP32ItoM((uptr)&g_nLastBlockExecuted, nParentCheckForExecution); u8* jptr = JNE8(0); MOV32MtoR(EAX, pparentinst->pClipWrite); - MOV32ItoM(pparentinst->pClipWrite, 0); MOV32RtoM(s_ClipRead, EAX); x86SetJ8(jptr); } diff --git a/pcsx2/x86/ix86/ix86_macros.h b/pcsx2/x86/ix86/ix86_macros.h index 8265141040..ea37192104 100644 --- a/pcsx2/x86/ix86/ix86_macros.h +++ b/pcsx2/x86/ix86/ix86_macros.h @@ -950,6 +950,9 @@ #define SSSE3_PABSW_XMM_to_XMM eSSSE3_PABSW_XMM_to_XMM<_EmitterId_> #define SSSE3_PABSD_XMM_to_XMM eSSSE3_PABSD_XMM_to_XMM<_EmitterId_> #define SSSE3_PALIGNR_XMM_to_XMM eSSSE3_PALIGNR_XMM_to_XMM<_EmitterId_> +#define SSSE3_PSIGNB_XMM_to_XMM eSSSE3_PSIGNB_XMM_to_XMM<_EmitterId_> +#define SSSE3_PSIGNW_XMM_to_XMM eSSSE3_PSIGNW_XMM_to_XMM<_EmitterId_> +#define SSSE3_PSIGND_XMM_to_XMM eSSSE3_PSIGND_XMM_to_XMM<_EmitterId_> //------------------------------------------------------------------ //------------------------------------------------------------------ @@ -963,6 +966,7 @@ #define SSE4_BLENDVPS_XMM_to_XMM eSSE4_BLENDVPS_XMM_to_XMM<_EmitterId_> #define SSE4_BLENDVPS_M128_to_XMM eSSE4_BLENDVPS_M128_to_XMM<_EmitterId_> #define SSE4_PMOVSXDQ_XMM_to_XMM eSSE4_PMOVSXDQ_XMM_to_XMM<_EmitterId_> +#define SSE4_PMOVZXDQ_XMM_to_XMM eSSE4_PMOVZXDQ_XMM_to_XMM<_EmitterId_> #define SSE4_PINSRD_R32_to_XMM eSSE4_PINSRD_R32_to_XMM<_EmitterId_> #define SSE4_PMAXSD_XMM_to_XMM eSSE4_PMAXSD_XMM_to_XMM<_EmitterId_> #define SSE4_PMINSD_XMM_to_XMM eSSE4_PMINSD_XMM_to_XMM<_EmitterId_> diff --git a/pcsx2/x86/ix86/ix86_sse.inl b/pcsx2/x86/ix86/ix86_sse.inl index 87c2c6d764..971a33af17 100644 --- a/pcsx2/x86/ix86/ix86_sse.inl +++ b/pcsx2/x86/ix86/ix86_sse.inl @@ -1224,6 +1224,30 @@ emitterT void eSSSE3_PALIGNR_XMM_to_XMM(x86SSERegType to, x86SSERegType from, u8 write8(imm8); } +emitterT void eSSSE3_PSIGNB_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +{ + write8(0x66); + RexRB(0, to, from); + write24(0x08380F); + ModRM(3, to, from); +} + +emitterT void eSSSE3_PSIGNW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +{ + write8(0x66); + RexRB(0, to, from); + write24(0x09380F); + ModRM(3, to, from); +} + +emitterT void eSSSE3_PSIGND_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +{ + write8(0x66); + RexRB(0, to, from); + write24(0x0A380F); + ModRM(3, to, from); +} + // SSE4.1 emitterT void eSSE4_DPPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from, u8 imm8) @@ -1295,6 +1319,14 @@ emitterT void eSSE4_PMOVSXDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) ModRM(3, to, from); } +emitterT void eSSE4_PMOVZXDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +{ + write8(0x66); + RexRB(0, to, from); + write24(0x35380F); + ModRM(3, to, from); +} + emitterT void eSSE4_PINSRD_R32_to_XMM(x86SSERegType to, x86IntRegType from, u8 imm8) { write8(0x66); From 03a6406ff0cb1041d4bf8353a2d31268c375dc9e Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 10 Mar 2009 20:03:49 +0000 Subject: [PATCH 05/77] Added some preliminary exception handler code to the PCR's. No point in finishing it right now since the rest of the EE's exception handler is still in flux, but at least it's ready for a quick upgrade now. :) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@740 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/COP0.cpp | 24 ++++++++++++++++++++++++ pcsx2/x86/ix86-32/iR5900-32.cpp | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/pcsx2/COP0.cpp b/pcsx2/COP0.cpp index 80c23137f9..67f5b4847c 100644 --- a/pcsx2/COP0.cpp +++ b/pcsx2/COP0.cpp @@ -149,6 +149,10 @@ void WriteTLB(int i) // That happens when a game loads the MFC0 twice in the same recompiled block (before the // cpuRegs.cycles update), and can cause games to lock up since it's an unexpected result. +// PERF Overflow exceptions: The exception is raised when the MSB of the Performance +// Counter Register is set (basic arithmetic overflow, which means it does *not* include +// when the bit is later cleared). + __forceinline void COP0_UpdatePCR0() { if((cpuRegs.PERF.n.pccr & 0x800003E0) == 0x80000020) @@ -156,8 +160,18 @@ __forceinline void COP0_UpdatePCR0() u32 incr = cpuRegs.cycle-s_iLastPERFCycle[0]; if( incr == 0 ) incr++; + u32 prev = cpuRegs.PERF.n.pcr0; cpuRegs.PERF.n.pcr0 += incr; s_iLastPERFCycle[0] = cpuRegs.cycle; + + if( cpuRegs.PERF.n.pccr & (1UL<<31) ) // MSB is the overflow enable bit. + { + prev ^= (1UL<<31); // XOR is fun! + if( (prev & cpuRegs.PERF.n.pcr0) & (1UL<<31) ) + { + // TODO: Vector to the appropriate exception here. + } + } } } @@ -168,8 +182,18 @@ __forceinline void COP0_UpdatePCR1() u32 incr = cpuRegs.cycle-s_iLastPERFCycle[1]; if( incr == 0 ) incr++; + u32 prev = cpuRegs.PERF.n.pcr1; cpuRegs.PERF.n.pcr1 += incr; s_iLastPERFCycle[1] = cpuRegs.cycle; + + if( cpuRegs.PERF.n.pccr & (1UL<<31) ) // MSB is the overflow enable bit. + { + prev ^= (1UL<<31); // XOR? I don't even know OR! Harhar! + if( (prev & cpuRegs.PERF.n.pcr1) & (1UL<<31) ) + { + // TODO: Vector to the appropriate exception here. + } + } } } diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 89db8a8f41..c19a468c19 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -1198,11 +1198,11 @@ u32 eeScaleBlockCycles() jNO_DEFAULT } - s_nBlockCycles *= + const u32 temp = s_nBlockCycles * (s_nBlockCycles <= (10<<3)) ? scalarLow : ((s_nBlockCycles > (21<<3)) ? scalarHigh : scalarMid ); - return s_nBlockCycles >> (3+2); + return temp >> (3+2); } // Generates dynarec code for Event tests followed by a block dispatch (branch). From 68ec2f25a8fa0f116e23337c7f83d9cdc16ac789 Mon Sep 17 00:00:00 2001 From: tmkkmac Date: Tue, 10 Mar 2009 20:16:13 +0000 Subject: [PATCH 06/77] Fixed my stupid mistakes in the previous commit. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@741 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/iMMI.cpp | 124 ++++++++++++++------------------------------- 1 file changed, 38 insertions(+), 86 deletions(-) diff --git a/pcsx2/x86/iMMI.cpp b/pcsx2/x86/iMMI.cpp index 92bcff30d3..2ffd8f789e 100644 --- a/pcsx2/x86/iMMI.cpp +++ b/pcsx2/x86/iMMI.cpp @@ -1083,17 +1083,11 @@ void recPSUBSB( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBSB_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { - SSSE3_PSIGNB_XMM_to_XMM(EEREC_D, EEREC_D); - SSE2_PADDSB_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs - } - else { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBSB_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); - } + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBSB_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1125,17 +1119,11 @@ void recPSUBSH( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBSW_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { - SSSE3_PSIGNW_XMM_to_XMM(EEREC_D, EEREC_D); - SSE2_PADDSW_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs - } - else { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBSW_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); - } + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBSW_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1184,15 +1172,9 @@ CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) // normal subtraction if( EEREC_D == EEREC_S ) SSE2_PSUBD_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { - SSSE3_PSIGND_XMM_to_XMM(EEREC_D, EEREC_D); - SSE2_PADDD_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs - } - else { - SSEX_MOVDQA_XMM_to_XMM(t2reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBD_XMM_to_XMM(EEREC_D, t2reg); - } + SSEX_MOVDQA_XMM_to_XMM(t2reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBD_XMM_to_XMM(EEREC_D, t2reg); } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1346,17 +1328,11 @@ void recPSUBB( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBB_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { - SSSE3_PSIGNB_XMM_to_XMM(EEREC_D, EEREC_D); - SSE2_PADDB_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs - } - else { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBB_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); - } + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBB_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1388,17 +1364,11 @@ void recPSUBH( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBW_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { - SSSE3_PSIGNW_XMM_to_XMM(EEREC_D, EEREC_D); - SSE2_PADDW_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs - } - else { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBW_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); - } + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBW_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1430,17 +1400,11 @@ void recPSUBW( void ) CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBD_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { - SSSE3_PSIGND_XMM_to_XMM(EEREC_D, EEREC_D); - SSE2_PADDD_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs - } - else { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBD_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); - } + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBD_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1860,17 +1824,11 @@ void recPSUBUB() CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBUSB_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { - SSSE3_PSIGNB_XMM_to_XMM(EEREC_D, EEREC_D); - SSE2_PADDUSB_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs - } - else { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBUSB_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); - } + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBUSB_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); @@ -1889,17 +1847,11 @@ void recPSUBUH() CPU_SSE2_XMMCACHE_START(XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED) if( EEREC_D == EEREC_S ) SSE2_PSUBUSW_XMM_to_XMM(EEREC_D, EEREC_T); else if( EEREC_D == EEREC_T ) { - if ( cpucaps.hasSupplementalStreamingSIMD3Extensions ) { - SSSE3_PSIGNW_XMM_to_XMM(EEREC_D, EEREC_D); - SSE2_PADDUSW_XMM_to_XMM(EEREC_D, EEREC_S); // -Rt + Rs - } - else { - int t0reg = _allocTempXMMreg(XMMT_INT, -1); - SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); - SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); - SSE2_PSUBUSW_XMM_to_XMM(EEREC_D, t0reg); - _freeXMMreg(t0reg); - } + int t0reg = _allocTempXMMreg(XMMT_INT, -1); + SSEX_MOVDQA_XMM_to_XMM(t0reg, EEREC_T); + SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); + SSE2_PSUBUSW_XMM_to_XMM(EEREC_D, t0reg); + _freeXMMreg(t0reg); } else { SSEX_MOVDQA_XMM_to_XMM(EEREC_D, EEREC_S); From 4620f4c5aaba29f4fa7dc06a50c1355e2e193e62 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Tue, 10 Mar 2009 21:02:44 +0000 Subject: [PATCH 07/77] cleaned up some code (knocked off 100+ lines in Alloc.inl), and implemented 'ESUM' opcode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cotton2: write more helpful logs kthx ;p doesn't matter, no-one cares what i write since it doesn't effect anything for now cotton, stop posting those useless commit comments XD no no, please continue. they're fun, i look forward to read them from time to time :°D lol :D Please spend more time making them more amusing. cotton2: it does matter dwarg: yeah i know! drk||Raz: Why? They're useless for reversion testing i have to think of good stuff to write :O when the next vu coders (if any, ever ;p) want to look at your code .. and the history is full of crap that won't be much useful ;p there won't be a next vu coder! Comments in the actual code would be more useful, wouldn't they? my code is perfect! lol >.> <.< but seriously i don't think it can get better unless like Rather than going back and comparing SVN comments to changes made way back when you want to support AVX or w/e intel's new SSE thing is called and anyway AVX is like 3 years away in that timeline pcsx2 i think will be stabilized :°D yeah cotton2: just log kthx implemented y,x,z :> thats what the diffs are for! and anyway really its useless for this stage yea i know until microVU is active and used by PCSX2 i'm just implementing different opcodes though, its not like i'm chaning features you can tell anything from the code -- no comments or changelog needed.Right ? ;p then every change should be documented for regression testing drk: yup! well its not like i'm changing stuff i'm just implementing things that havn't been coded so theres nothing to regress to yep git-svn-id: http://pcsx2.googlecode.com/svn/trunk@742 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU_Alloc.inl | 293 ++++++++++-------------------------- pcsx2/x86/microVU_Lower.inl | 15 +- pcsx2/x86/microVU_Upper.inl | 51 ++++--- 3 files changed, 118 insertions(+), 241 deletions(-) diff --git a/pcsx2/x86/microVU_Alloc.inl b/pcsx2/x86/microVU_Alloc.inl index af260661be..b2ff61451d 100644 --- a/pcsx2/x86/microVU_Alloc.inl +++ b/pcsx2/x86/microVU_Alloc.inl @@ -36,14 +36,14 @@ if (CHECK_VU_EXTRA_OVERFLOW) mVUclamp2(reg, xmmT1, _X_Y_Z_W); \ } -#define getZeroSS(reg) { \ +#define getZero(reg) { \ if (_W) { mVUloadReg(reg, (uptr)&mVU->regs->VF[0].UL[0], _X_Y_Z_W); } \ else { SSE_XORPS_XMM_to_XMM(reg, reg); } \ } -#define getZero(reg) { \ - if (_W) { mVUloadReg(reg, (uptr)&mVU->regs->VF[0].UL[0], _X_Y_Z_W); } \ - else { SSE_XORPS_XMM_to_XMM(reg, reg); } \ +#define getReg6(reg, _reg_) { \ + if (!_reg_) { getZero(reg); } \ + else { getReg(reg, _reg_); } \ } microVUt(void) mVUallocFMAC1a(int& Fd, int& Fs, int& Ft) { @@ -51,26 +51,9 @@ microVUt(void) mVUallocFMAC1a(int& Fd, int& Fs, int& Ft) { Fs = xmmFs; Ft = xmmFt; Fd = xmmFs; - if (_XYZW_SS) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - - if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZeroSS(Ft); } - else { getReg(Ft, _Ft_); } - } - } - else { - if (!_Fs_) { getZero(Fs); } - else { getReg(Fs, _Fs_); } - - if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZero(Ft); } - else { getReg(Ft, _Ft_); } - } - } + getReg6(Fs, _Fs_); + if (_Ft_ == _Fs_) { Ft = Fs; } + else { getReg6(Ft, _Ft_); } } microVUt(void) mVUallocFMAC1b(int& Fd) { @@ -88,14 +71,7 @@ microVUt(void) mVUallocFMAC2a(int& Fs, int& Ft) { microVU* mVU = mVUx; Fs = xmmFs; Ft = xmmFs; - if (_XYZW_SS) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero(Fs); } - else { getReg(Fs, _Fs_); } - } + getReg6(Fs, _Fs_); } microVUt(void) mVUallocFMAC2b(int& Ft) { @@ -139,21 +115,15 @@ microVUt(void) mVUallocFMAC3a(int& Fd, int& Fs, int& Ft) { Ft = xmmFt; Fd = xmmFs; if (_XYZW_SS) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - + getReg6(Fs, _Fs_); if ( (_Ft_ == _Fs_) && ((_X && _bc_x) || (_Y && _bc_y) || (_Z && _bc_w) || (_W && _bc_w)) ) { Ft = Fs; } - else { - if (!_Ft_) { getZero3SS(Ft); } - else { getReg3SS(Ft, _Ft_); } - } + else if (!_Ft_) { getZero3SS(Ft); } + else { getReg3SS(Ft, _Ft_); } } else { - if (!_Fs_) { getZero(Fs); } - else { getReg(Fs, _Fs_); } - + getReg6(Fs, _Fs_); if (!_Ft_) { getZero3(Ft); } else { getReg3(Ft, _Ft_); } } @@ -188,24 +158,17 @@ microVUt(void) mVUallocFMAC4a(int& ACC, int& Fs, int& Ft) { Ft = xmmFt; getACC(ACC); if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - + getReg6(Fs, _Fs_); if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZeroSS(Ft); } - else { getReg(Ft, _Ft_); } - } + else { getReg6(Ft, _Ft_); } } else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } + if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZero4(Ft); } - else { getReg4(Ft, _Ft_); } - } + else if (!_Ft_) { getZero4(Ft); } + else { getReg4(Ft, _Ft_); } } } @@ -225,16 +188,10 @@ microVUt(void) mVUallocFMAC5a(int& ACC, int& Fs, int& Ft) { Ft = xmmFt; getACC(ACC); if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - - if ( (_Ft_ == _Fs_) && _bc_x) { - Ft = Fs; - } - else { - if (!_Ft_) { getZero3SS(Ft); } - else { getReg3SS(Ft, _Ft_); } - } + getReg6(Fs, _Fs_); + if ((_Ft_ == _Fs_) && _bc_x) { Ft = Fs; } + else if (!_Ft_) { getZero3SS(Ft); } + else { getReg3SS(Ft, _Ft_); } } else { if (!_Fs_) { getZero4(Fs); } @@ -266,14 +223,7 @@ microVUt(void) mVUallocFMAC6a(int& Fd, int& Fs, int& Ft) { Ft = xmmFt; Fd = xmmFs; getIreg(Ft); - if (_XYZW_SS) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero(Fs); } - else { getReg(Fs, _Fs_); } - } + getReg6(Fs, _Fs_); } microVUt(void) mVUallocFMAC6b(int& Fd) { @@ -290,14 +240,9 @@ microVUt(void) mVUallocFMAC7a(int& ACC, int& Fs, int& Ft) { Ft = xmmFt; getACC(ACC); getIreg(Ft); - if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } - } + if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + else if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } } microVUt(void) mVUallocFMAC7b(int& ACC, int& Fs) { @@ -315,24 +260,17 @@ microVUt(void) mVUallocFMAC8a(int& Fd, int&ACC, int& Fs, int& Ft) { Fd = xmmFs; ACC = xmmACC0 + readACC; if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - + getReg6(Fs, _Fs_); if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZeroSS(Ft); } - else { getReg(Ft, _Ft_); } - } + else { getReg6(Ft, _Ft_); } } else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } + if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZero4(Ft); } - else { getReg4(Ft, _Ft_); } - } + else if (!_Ft_) { getZero4(Ft); } + else { getReg4(Ft, _Ft_); } } } @@ -355,24 +293,17 @@ microVUt(void) mVUallocFMAC9a(int& Fd, int&ACC, int& Fs, int& Ft) { ACC = xmmT1; SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC0 + readACC); if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - + getReg6(Fs, _Fs_); if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZeroSS(Ft); } - else { getReg(Ft, _Ft_); } - } + else { getReg6(Ft, _Ft_); } } else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } + if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZero4(Ft); } - else { getReg4(Ft, _Ft_); } - } + else if (!_Ft_) { getZero4(Ft); } + else { getReg4(Ft, _Ft_); } } } @@ -394,16 +325,10 @@ microVUt(void) mVUallocFMAC10a(int& Fd, int& ACC, int& Fs, int& Ft) { Fd = xmmFs; ACC = xmmACC0 + readACC; if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - - if ( (_Ft_ == _Fs_) && _bc_x) { - Ft = Fs; - } - else { - if (!_Ft_) { getZero3SS(Ft); } - else { getReg3SS(Ft, _Ft_); } - } + getReg6(Fs, _Fs_); + if ( (_Ft_ == _Fs_) && _bc_x) { Ft = Fs; } + else if (!_Ft_) { getZero3SS(Ft); } + else { getReg3SS(Ft, _Ft_); } } else { if (!_Fs_) { getZero4(Fs); } @@ -430,16 +355,10 @@ microVUt(void) mVUallocFMAC11a(int& Fd, int& ACC, int& Fs, int& Ft) { ACC = xmmT1; SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC0 + readACC); if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - - if ( (_Ft_ == _Fs_) && _bc_x) { - Ft = Fs; - } - else { - if (!_Ft_) { getZero3SS(Ft); } - else { getReg3SS(Ft, _Ft_); } - } + getReg6(Fs, _Fs_); + if ( (_Ft_ == _Fs_) && _bc_x) { Ft = Fs; } + else if (!_Ft_) { getZero3SS(Ft); } + else { getReg3SS(Ft, _Ft_); } } else { if (!_Fs_) { getZero4(Fs); } @@ -465,14 +384,9 @@ microVUt(void) mVUallocFMAC12a(int& Fd, int&ACC, int& Fs, int& Ft) { Fd = xmmFs; ACC = xmmACC0 + readACC; getIreg(Ft); - if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } - } + if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + else if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } } microVUt(void) mVUallocFMAC12b(int& Fd) { @@ -491,14 +405,9 @@ microVUt(void) mVUallocFMAC13a(int& Fd, int&ACC, int& Fs, int& Ft) { ACC = xmmT1; SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC0 + readACC); getIreg(Ft); - if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } - } + if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + else if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } } microVUt(void) mVUallocFMAC13b(int& Fd) { @@ -516,24 +425,17 @@ microVUt(void) mVUallocFMAC14a(int& ACCw, int&ACCr, int& Fs, int& Ft) { Ft = xmmFt; ACCr = xmmACC0 + readACC; if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - + getReg6(Fs, _Fs_); if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZeroSS(Ft); } - else { getReg(Ft, _Ft_); } - } + else { getReg6(Ft, _Ft_); } } else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } + if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } if (_Ft_ == _Fs_) { Ft = Fs; } - else { - if (!_Ft_) { getZero4(Ft); } - else { getReg4(Ft, _Ft_); } - } + else if (!_Ft_) { getZero4(Ft); } + else { getReg4(Ft, _Ft_); } } } @@ -570,16 +472,10 @@ microVUt(void) mVUallocFMAC16a(int& ACCw, int&ACCr, int& Fs, int& Ft) { Ft = xmmFt; ACCr = xmmACC0 + readACC; if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - - if ( (_Ft_ == _Fs_) && _bc_x) { - Ft = Fs; - } - else { - if (!_Ft_) { getZero3SS(Ft); } - else { getReg3SS(Ft, _Ft_); } - } + getReg6(Fs, _Fs_); + if ((_Ft_ == _Fs_) && _bc_x) { Ft = Fs; } + else if (!_Ft_) { getZero3SS(Ft); } + else { getReg3SS(Ft, _Ft_); } } else { if (!_Fs_) { getZero4(Fs); } @@ -669,14 +565,9 @@ microVUt(void) mVUallocFMAC20a(int& ACCw, int&ACCr, int& Fs, int& Ft) { Ft = xmmFt; ACCr = xmmACC0 + readACC; getIreg(Ft); - if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } - } + if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + else if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } } microVUt(void) mVUallocFMAC20b(int& ACCw, int& Fs) { @@ -712,14 +603,7 @@ microVUt(void) mVUallocFMAC22a(int& Fd, int& Fs, int& Ft) { Ft = xmmFt; Fd = xmmFs; getQreg(Ft); - if (_XYZW_SS) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero(Fs); } - else { getReg(Fs, _Fs_); } - } + getReg6(Fs, _Fs_); } microVUt(void) mVUallocFMAC22b(int& Fd) { @@ -736,21 +620,15 @@ microVUt(void) mVUallocFMAC23a(int& ACC, int& Fs, int& Ft) { Ft = xmmFt; getACC(ACC); getQreg(Ft); - if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } - } + if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + else if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } } microVUt(void) mVUallocFMAC23b(int& ACC, int& Fs) { mVUallocFMAC4b(ACC, Fs); } - //------------------------------------------------------------------ // FMAC24 - MADD FMAC Opcode Storing Result to Fd (Q Reg) //------------------------------------------------------------------ @@ -762,14 +640,9 @@ microVUt(void) mVUallocFMAC24a(int& Fd, int&ACC, int& Fs, int& Ft) { Fd = xmmFs; ACC = xmmACC0 + readACC; getQreg(Ft); - if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } - } + if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + else if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } } microVUt(void) mVUallocFMAC24b(int& Fd) { @@ -788,14 +661,9 @@ microVUt(void) mVUallocFMAC25a(int& Fd, int&ACC, int& Fs, int& Ft) { ACC = xmmT1; SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC0 + readACC); getQreg(Ft); - if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } - } + if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + else if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } } microVUt(void) mVUallocFMAC25b(int& Fd) { @@ -813,14 +681,9 @@ microVUt(void) mVUallocFMAC26a(int& ACCw, int&ACCr, int& Fs, int& Ft) { Ft = xmmFt; ACCr = xmmACC0 + readACC; getQreg(Ft); - if (_XYZW_SS && _X) { - if (!_Fs_) { getZeroSS(Fs); } - else { getReg(Fs, _Fs_); } - } - else { - if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } - } + if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + else if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } } microVUt(void) mVUallocFMAC26b(int& ACCw, int& Fs) { diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 43ae6e8d80..5ff2a4b495 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -217,7 +217,20 @@ microVUf(void) mVU_ERSQRT() {} microVUf(void) mVU_ESADD() {} microVUf(void) mVU_ESIN() {} microVUf(void) mVU_ESQRT() {} -microVUf(void) mVU_ESUM() {} +microVUf(void) mVU_ESUM() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg6(xmmFs, _Fs_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmFt, xmmFs, 0x1b); + SSE_ADDPS_XMM_to_XMM(xmmFs, xmmFt); + SSE2_PSHUFD_XMM_to_XMM(xmmFt, xmmFs, 0x01); + SSE_ADDSS_XMM_to_XMM(xmmFs, xmmFt); + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} microVUf(void) mVU_FCAND() {} microVUf(void) mVU_FCEQ() {} diff --git a/pcsx2/x86/microVU_Upper.inl b/pcsx2/x86/microVU_Upper.inl index 9b5e3a5090..f0336aa081 100644 --- a/pcsx2/x86/microVU_Upper.inl +++ b/pcsx2/x86/microVU_Upper.inl @@ -78,6 +78,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX // Helper Macros //------------------------------------------------------------------ +// FMAC1 - Normal FMAC Opcodes #define mVU_FMAC1(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -91,7 +92,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC1b(Fd); \ } \ } - +// FMAC3 - BC(xyzw) FMAC Opcodes #define mVU_FMAC3(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -105,7 +106,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC3b(Fd); \ } \ } - +// FMAC4 - FMAC Opcodes Storing Result to ACC #define mVU_FMAC4(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -119,7 +120,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC4b(ACC, Fs); \ } \ } - +// FMAC5 - FMAC BC(xyzw) Opcodes Storing Result to ACC #define mVU_FMAC5(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -133,7 +134,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC5b(ACC, Fs); \ } \ } - +// FMAC6 - Normal FMAC Opcodes (I Reg) #define mVU_FMAC6(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -147,7 +148,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC6b(Fd); \ } \ } - +// FMAC7 - FMAC Opcodes Storing Result to ACC (I Reg) #define mVU_FMAC7(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -161,7 +162,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC7b(ACC, Fs); \ } \ } - +// FMAC8 - MADD FMAC Opcode Storing Result to Fd #define mVU_FMAC8(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -181,7 +182,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC8b(Fd); \ } \ } - +// FMAC9 - MSUB FMAC Opcode Storing Result to Fd #define mVU_FMAC9(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -201,7 +202,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC9b(Fd); \ } \ } - +// FMAC10 - MADD FMAC BC(xyzw) Opcode Storing Result to Fd #define mVU_FMAC10(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -221,7 +222,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC10b(Fd); \ } \ } - +// FMAC11 - MSUB FMAC BC(xyzw) Opcode Storing Result to Fd #define mVU_FMAC11(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -241,7 +242,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC11b(Fd); \ } \ } - +// FMAC12 - MADD FMAC Opcode Storing Result to Fd (I Reg) #define mVU_FMAC12(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -261,7 +262,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC12b(Fd); \ } \ } - +// FMAC13 - MSUB FMAC Opcode Storing Result to Fd (I Reg) #define mVU_FMAC13(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -281,7 +282,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC13b(Fd); \ } \ } - +// FMAC14 - MADDA FMAC Opcode #define mVU_FMAC14(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -301,7 +302,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC14b(ACCw, Fs); \ } \ } - +// FMAC15 - MSUBA FMAC Opcode #define mVU_FMAC15(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -321,7 +322,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC15b(ACCw, ACCr); \ } \ } - +// FMAC16 - MADDA BC(xyzw) FMAC Opcode #define mVU_FMAC16(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -341,7 +342,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC16b(ACCw, Fs); \ } \ } - +// FMAC17 - MSUBA BC(xyzw) FMAC Opcode #define mVU_FMAC17(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -361,7 +362,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC17b(ACCw, ACCr); \ } \ } - +// FMAC18 - OPMULA FMAC Opcode #define mVU_FMAC18(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -374,7 +375,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC18b(ACC, Fs); \ } \ } - +// FMAC19 - OPMULA FMAC Opcode #define mVU_FMAC19(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -388,7 +389,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC19b(Fd); \ } \ } - +// FMAC20 - MADDA FMAC Opcode (I Reg) #define mVU_FMAC20(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -408,7 +409,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC20b(ACCw, Fs); \ } \ } - +// FMAC21 - MSUBA FMAC Opcode (I Reg) #define mVU_FMAC21(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -428,7 +429,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC21b(ACCw, ACCr); \ } \ } - +// FMAC22 - Normal FMAC Opcodes (Q Reg) #define mVU_FMAC22(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -442,7 +443,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC22b(Fd); \ } \ } - +// FMAC23 - FMAC Opcodes Storing Result to ACC (Q Reg) #define mVU_FMAC23(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -456,7 +457,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC23b(ACC, Fs); \ } \ } - +// FMAC24 - MADD FMAC Opcode Storing Result to Fd (Q Reg) #define mVU_FMAC24(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -476,7 +477,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC24b(Fd); \ } \ } - +// FMAC25 - MSUB FMAC Opcode Storing Result to Fd (Q Reg) #define mVU_FMAC25(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -496,7 +497,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC25b(Fd); \ } \ } - +// FMAC26 - MADDA FMAC Opcode (Q Reg) #define mVU_FMAC26(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ @@ -516,7 +517,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC26b(ACCw, Fs); \ } \ } - +// FMAC27 - MSUBA FMAC Opcode (Q Reg) #define mVU_FMAC27(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ From 022fdf1bf399a16eca661b1bdda38b0f4c5b8af0 Mon Sep 17 00:00:00 2001 From: bigianb Date: Tue, 10 Mar 2009 23:05:35 +0000 Subject: [PATCH 08/77] FPS2BIOS. Small changes to makefile to enable code to compile out of the box. Fix to romdir.c to avoid uninitialised data being written to output. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@743 96395faa-99c1-11dd-bbfe-3dabce05a288 --- fps2bios/Makefile | 7 ++----- fps2bios/romdir.c | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fps2bios/Makefile b/fps2bios/Makefile index d591c80da7..b4f9102335 100644 --- a/fps2bios/Makefile +++ b/fps2bios/Makefile @@ -13,12 +13,10 @@ STRIP = strip OPTIMIZE = -O2 -fomit-frame-pointer -finline-functions -ffast-math CFLAGS = -Wall ${OPTIMIZE} -I. DIRS = kernel intro loader -FILES = RESET ROMDIR EXTINFO ROMVER IOPBOOT EELOAD \ +FILES = RESET ROMDIR ROMVER IOPBOOT EELOAD \ SYSMEM LOADCORE EXCEPMAN INTRMAN SSBUSC DMACMAN \ TIMRMAN SYSCLIB HEAPLIB THREADMAN VBLANK STDIO \ - SIFMAN SIFCMD SIO2MAN LOADER INTRO IOPBTCONF FP2BLOGO \ - IOMAN MODLOAD ROMDRV IGREETING REBOOT LOADFILE CDVDMAN \ - CDVDFSV SIFINIT FILEIO SECRMAN EESYNC + SIFMAN SIFCMD SIO2MAN LOADER INTRO IOPBTCONF FP2BLOGO ps2romgen_exe: ps2romgen.o ${CC} ${CFLAGS} ps2romgen.o -o build/ps2romgen_exe @@ -33,7 +31,6 @@ fps2bios: for i in $(DIRS); do \ (cd $$i; make; cd ..) \ done; - cp -f used/* build cp -f FP2BLOGO build cp -f IOPBTCONF build/ (cd build; \ diff --git a/fps2bios/romdir.c b/fps2bios/romdir.c index 193ee09d33..4e2ccf5d5d 100644 --- a/fps2bios/romdir.c +++ b/fps2bios/romdir.c @@ -43,6 +43,7 @@ int main(int argc, char *argv[]) { } for (i=1; i Date: Tue, 10 Mar 2009 23:50:17 +0000 Subject: [PATCH 09/77] nneeve fixed min/max FPU opcodes to be more precise when running in "Full" clamp mode. he also cleaned up some other stuff in iFPUd.cpp git-svn-id: http://pcsx2.googlecode.com/svn/trunk@744 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/iFPUd.cpp | 361 +++++--------------------------------------- 1 file changed, 38 insertions(+), 323 deletions(-) diff --git a/pcsx2/x86/iFPUd.cpp b/pcsx2/x86/iFPUd.cpp index 641d601ebe..12b887fbe0 100644 --- a/pcsx2/x86/iFPUd.cpp +++ b/pcsx2/x86/iFPUd.cpp @@ -25,17 +25,19 @@ #include "iFPU.h" /* Version of the FPU that emulates an exponent of 0xff and overflow/underflow flags */ + +/* Can be made faster by not converting stuff back and forth between instructions. */ //set overflow flag (set only if FPU_RESULT is 1) #define FPU_FLAGS_OVERFLOW 1 //set underflow flag (set only if FPU_RESULT is 1) #define FPU_FLAGS_UNDERFLOW 1 -//if 1, result is not clamped (MORE correct, +//if 1, result is not clamped (Gives correct results as in PS2, //but can cause problems due to insuffecient clamping levels in the VUs) #define FPU_RESULT 1 -//also impacts other aspects of DIV/R/SQRT correctness +//set I&D flags. also impacts other aspects of DIV/R/SQRT correctness #define FPU_FLAGS_ID 1 //------------------------------------------------------------------ @@ -126,270 +128,8 @@ static u32 PCSX2_ALIGNED16(s_pos[4]) = { 0x7fffffff, 0xffffffff, 0xffffffff, 0xf //------------------------------------------------------------------ // *FPU Opcodes!* -//------------------------------------------------------------------ - - -//------------------------------------------------------------------ -// CFC1 / CTC1 -//------------------------------------------------------------------ -void recCFC1(void) -{ - if ( !_Rt_ || ( (_Fs_ != 0) && (_Fs_ != 31) ) ) return; - - _eeOnWriteReg(_Rt_, 1); - - MOV32MtoR( EAX, (uptr)&fpuRegs.fprc[ _Fs_ ] ); - _deleteEEreg(_Rt_, 0); - - if (_Fs_ == 31) - { - AND32ItoR(EAX, 0x0083c078); //remove always-zero bits - OR32ItoR(EAX, 0x01000001); //set always-one bits - } - - if(EEINST_ISLIVE1(_Rt_)) - { - CDQ( ); - MOV32RtoM( (uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ], EAX ); - MOV32RtoM( (uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 1 ], EDX ); - } - else - { - EEINST_RESETHASLIVE1(_Rt_); - MOV32RtoM( (uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ], EAX ); - } - -} - -void recCTC1( void ) -{ - if ( _Fs_ != 31 ) return; - - if ( GPR_IS_CONST1(_Rt_) ) - { - MOV32ItoM((uptr)&fpuRegs.fprc[ _Fs_ ], g_cpuConstRegs[_Rt_].UL[0]); - } - else - { - int mmreg = _checkXMMreg(XMMTYPE_GPRREG, _Rt_, MODE_READ); - - if( mmreg >= 0 ) - { - SSEX_MOVD_XMM_to_M32((uptr)&fpuRegs.fprc[ _Fs_ ], mmreg); - } - - else - { - mmreg = _checkMMXreg(MMX_GPR+_Rt_, MODE_READ); - - if ( mmreg >= 0 ) - { - MOVDMMXtoM((uptr)&fpuRegs.fprc[ _Fs_ ], mmreg); - SetMMXstate(); - } - else - { - _deleteGPRtoXMMreg(_Rt_, 1); - _deleteMMXreg(MMX_GPR+_Rt_, 1); - - MOV32MtoR( EAX, (uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ] ); - MOV32RtoM( (uptr)&fpuRegs.fprc[ _Fs_ ], EAX ); - } - } - } -} -//------------------------------------------------------------------ - - -//------------------------------------------------------------------ -// MFC1 -//------------------------------------------------------------------ - -void recMFC1(void) -{ - int regt, regs; - if ( ! _Rt_ ) return; - - _eeOnWriteReg(_Rt_, 1); - - regs = _checkXMMreg(XMMTYPE_FPREG, _Fs_, MODE_READ); - - if( regs >= 0 ) - { - _deleteGPRtoXMMreg(_Rt_, 2); - regt = _allocCheckGPRtoMMX(g_pCurInstInfo, _Rt_, MODE_WRITE); - - if( regt >= 0 ) - { - SSE2_MOVDQ2Q_XMM_to_MM(regt, regs); - - if(EEINST_ISLIVE1(_Rt_)) - _signExtendGPRtoMMX(regt, _Rt_, 0); - else - EEINST_RESETHASLIVE1(_Rt_); - } - else - { - if(EEINST_ISLIVE1(_Rt_)) - { - _signExtendXMMtoM((uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ], regs, 0); - } - else - { - EEINST_RESETHASLIVE1(_Rt_); - SSE_MOVSS_XMM_to_M32((uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ], regs); - } - } - } - else - { - regs = _checkMMXreg(MMX_FPU+_Fs_, MODE_READ); - - if( regs >= 0 ) - { - // convert to mmx reg - mmxregs[regs].reg = MMX_GPR+_Rt_; - mmxregs[regs].mode |= MODE_READ|MODE_WRITE; - _signExtendGPRtoMMX(regs, _Rt_, 0); - } - else - { - regt = _checkXMMreg(XMMTYPE_GPRREG, _Rt_, MODE_READ); - - if( regt >= 0 ) - { - if( xmmregs[regt].mode & MODE_WRITE ) - { - SSE_MOVHPS_XMM_to_M64((uptr)&cpuRegs.GPR.r[_Rt_].UL[2], regt); - } - xmmregs[regt].inuse = 0; - } - - _deleteEEreg(_Rt_, 0); - MOV32MtoR( EAX, (uptr)&fpuRegs.fpr[ _Fs_ ].UL ); - - if(EEINST_ISLIVE1(_Rt_)) - { - CDQ( ); - MOV32RtoM( (uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ], EAX ); - MOV32RtoM( (uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 1 ], EDX ); - } - else - { - EEINST_RESETHASLIVE1(_Rt_); - MOV32RtoM( (uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ], EAX ); - } - } - } -} - -//------------------------------------------------------------------ - - -//------------------------------------------------------------------ -// MTC1 -//------------------------------------------------------------------ -void recMTC1(void) -{ - if( GPR_IS_CONST1(_Rt_) ) - { - _deleteFPtoXMMreg(_Fs_, 0); - MOV32ItoM((uptr)&fpuRegs.fpr[ _Fs_ ].UL, g_cpuConstRegs[_Rt_].UL[0]); - } - else - { - int mmreg = _checkXMMreg(XMMTYPE_GPRREG, _Rt_, MODE_READ); - - if( mmreg >= 0 ) - { - if( g_pCurInstInfo->regs[_Rt_] & EEINST_LASTUSE ) - { - // transfer the reg directly - _deleteGPRtoXMMreg(_Rt_, 2); - _deleteFPtoXMMreg(_Fs_, 2); - _allocFPtoXMMreg(mmreg, _Fs_, MODE_WRITE); - } - else - { - int mmreg2 = _allocCheckFPUtoXMM(g_pCurInstInfo, _Fs_, MODE_WRITE); - - if( mmreg2 >= 0 ) - SSE_MOVSS_XMM_to_XMM(mmreg2, mmreg); - else - SSE_MOVSS_XMM_to_M32((uptr)&fpuRegs.fpr[ _Fs_ ].UL, mmreg); - } - } - else - { - int mmreg2; - - mmreg = _checkMMXreg(MMX_GPR+_Rt_, MODE_READ); - mmreg2 = _allocCheckFPUtoXMM(g_pCurInstInfo, _Fs_, MODE_WRITE); - - if( mmreg >= 0 ) - { - if( mmreg2 >= 0 ) - { - SetMMXstate(); - SSE2_MOVQ2DQ_MM_to_XMM(mmreg2, mmreg); - } - else - { - SetMMXstate(); - MOVDMMXtoM((uptr)&fpuRegs.fpr[ _Fs_ ].UL, mmreg); - } - } - else - { - if( mmreg2 >= 0 ) - { - SSE_MOVSS_M32_to_XMM(mmreg2, (uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ]); - } - else - { - MOV32MtoR(EAX, (uptr)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ]); - MOV32RtoM((uptr)&fpuRegs.fpr[ _Fs_ ].UL, EAX); - } - } - } - } -} -//------------------------------------------------------------------ - - -/*#ifndef FPU_RECOMPILE // If FPU_RECOMPILE is not defined, then use the interpreter opcodes. (CFC1, CTC1, MFC1, and MTC1 are special because they work specifically with the EE rec so they're defined above) - -REC_FPUFUNC(ABS_S); -REC_FPUFUNC(ADD_S); -REC_FPUFUNC(ADDA_S); -REC_FPUBRANCH(BC1F); -REC_FPUBRANCH(BC1T); -REC_FPUBRANCH(BC1FL); -REC_FPUBRANCH(BC1TL); -REC_FPUFUNC(C_EQ); -REC_FPUFUNC(C_F); -REC_FPUFUNC(C_LE); -REC_FPUFUNC(C_LT); -REC_FPUFUNC(CVT_S); -REC_FPUFUNC(CVT_W); -REC_FPUFUNC(DIV_S); -REC_FPUFUNC(MAX_S); -REC_FPUFUNC(MIN_S); -REC_FPUFUNC(MADD_S); -REC_FPUFUNC(MADDA_S); -REC_FPUFUNC(MOV_S); -REC_FPUFUNC(MSUB_S); -REC_FPUFUNC(MSUBA_S); -REC_FPUFUNC(MUL_S); -REC_FPUFUNC(MULA_S); -REC_FPUFUNC(NEG_S); -REC_FPUFUNC(SUB_S); -REC_FPUFUNC(SUBA_S); -REC_FPUFUNC(SQRT_S); -REC_FPUFUNC(RSQRT_S); - -#else // FPU_RECOMPILE*/ - +//------------------------------------------------------------------ + //------------------------------------------------------------------ // PS2 -> DOUBLE //------------------------------------------------------------------ @@ -678,7 +418,7 @@ void FPU_MUL(int info, int regd, int sreg, int treg, bool acc) // CommutativeOp XMM (used for ADD, MUL, MAX, MIN and SUB opcodes) //------------------------------------------------------------------ static void (*recFPUOpXMM_to_XMM[] )(x86SSERegType, x86SSERegType) = { - SSE2_ADDSD_XMM_to_XMM, NULL, SSE2_MAXSD_XMM_to_XMM, SSE2_MINSD_XMM_to_XMM, SSE2_SUBSD_XMM_to_XMM }; + SSE2_ADDSD_XMM_to_XMM, NULL, NULL, NULL, SSE2_SUBSD_XMM_to_XMM }; void recFPUOp(int info, int regd, int op, bool acc) { @@ -718,48 +458,6 @@ void recADDA_S_xmm(int info) FPURECOMPILE_CONSTCODE(ADDA_S, XMMINFO_WRITEACC|XMMINFO_READS|XMMINFO_READT); //------------------------------------------------------------------ -//------------------------------------------------------------------ -// BC1x XMM -//------------------------------------------------------------------ - /* -static void _setupBranchTest() -{ - _eeFlushAllUnused(); - - // COP1 branch conditionals are based on the following equation: - // (fpuRegs.fprc[31] & 0x00800000) - // BC2F checks if the statement is false, BC2T checks if the statement is true. - - MOV32MtoR(EAX, (uptr)&fpuRegs.fprc[31]); - TEST32ItoR(EAX, FPUflagC); -} - -void recBC1F( void ) -{ - _setupBranchTest(); - recDoBranchImm(JNZ32(0)); -} - -void recBC1T( void ) -{ - _setupBranchTest(); - recDoBranchImm(JZ32(0)); -} - -void recBC1FL( void ) -{ - _setupBranchTest(); - recDoBranchImm_Likely(JNZ32(0)); -} - -void recBC1TL( void ) -{ - _setupBranchTest(); - recDoBranchImm_Likely(JZ32(0)); -}*/ -//------------------------------------------------------------------ - -//TOKNOW : how does C.??.S behave with denormals? void recCMP(int info) { int sreg, treg; @@ -787,12 +485,7 @@ void recC_EQ_xmm(int info) } FPURECOMPILE_CONSTCODE(C_EQ, XMMINFO_READS|XMMINFO_READT); - -/*void recC_F() -{ - AND32ItoM( (uptr)&fpuRegs.fprc[31], ~FPUflagC ); -}*/ - + void recC_LE_xmm(int info ) { recCMP(info); @@ -806,7 +499,6 @@ void recC_LE_xmm(int info ) } FPURECOMPILE_CONSTCODE(C_LE, XMMINFO_READS|XMMINFO_READT); -//REC_FPUFUNC(C_LE); void recC_LT_xmm(int info) { @@ -821,7 +513,6 @@ void recC_LT_xmm(int info) } FPURECOMPILE_CONSTCODE(C_LT, XMMINFO_READS|XMMINFO_READT); -//REC_FPUFUNC(C_LT); //------------------------------------------------------------------ @@ -840,7 +531,7 @@ void recCVT_S_xmm(int info) FPURECOMPILE_CONSTCODE(CVT_S, XMMINFO_WRITED|XMMINFO_READS); -void recCVT_W() +void recCVT_W() //called from iFPU.cpp's recCVT_W { int regs = _checkXMMreg(XMMTYPE_FPREG, _Fs_, MODE_READ); @@ -1052,17 +743,42 @@ FPURECOMPILE_CONSTCODE(MADDA_S, XMMINFO_WRITEACC|XMMINFO_READACC|XMMINFO_READS|X // MAX / MIN XMM //------------------------------------------------------------------ -//TOKNOW : handles denormals like VU, maybe? +static const u32 PCSX2_ALIGNED16(minmax_mask[4]) = {0xffffffff, 0x80000000, 0, 0}; +static const u32 PCSX2_ALIGNED16(minmax_mask2[4]) = {0, 0x40000000, 0, 0}; +// FPU's MAX/MIN work with all numbers (including "denormals"). Check VU's logical min max for more info. +void recMINMAX(int info, bool ismin) +{ + int sreg, treg; + ALLOC_S(sreg); ALLOC_T(treg); + + CLEAR_OU_FLAGS; + + SSE2_PSHUFD_XMM_to_XMM(sreg, sreg, 0x00); + SSE2_PAND_M128_to_XMM(sreg, (uptr)minmax_mask); + SSE2_POR_M128_to_XMM(sreg, (uptr)minmax_mask2); + SSE2_PSHUFD_XMM_to_XMM(treg, treg, 0x00); + SSE2_PAND_M128_to_XMM(treg, (uptr)minmax_mask); + SSE2_POR_M128_to_XMM(treg, (uptr)minmax_mask2); + if (ismin) + SSE2_MINSD_XMM_to_XMM(sreg, treg); + else + SSE2_MAXSD_XMM_to_XMM(sreg, treg); + + SSE_MOVSS_XMM_to_XMM(EEREC_D, sreg); + + _freeXMMreg(sreg); _freeXMMreg(treg); +} + void recMAX_S_xmm(int info) { - recFPUOp(info, EEREC_D, 2, false); + recMINMAX(info, false); } FPURECOMPILE_CONSTCODE(MAX_S, XMMINFO_WRITED|XMMINFO_READS|XMMINFO_READT); void recMIN_S_xmm(int info) { - recFPUOp(info, EEREC_D, 3, false); + recMINMAX(info, true); } FPURECOMPILE_CONSTCODE(MIN_S, XMMINFO_WRITED|XMMINFO_READS|XMMINFO_READT); @@ -1322,6 +1038,5 @@ void recRSQRT_S_xmm(int info) FPURECOMPILE_CONSTCODE(RSQRT_S, XMMINFO_WRITED|XMMINFO_READS|XMMINFO_READT); -//#endif // FPU_RECOMPILE -} } } } } \ No newline at end of file +} } } } } From dc3d9f4bfcaab73af4c53983cd115158e2cabe94 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 11 Mar 2009 07:40:23 +0000 Subject: [PATCH 10/77] Fixed the bug in r740 that broke speedhacks; and improved the PERF support a bit more using bitfields and more correct mode tests. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@745 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/COP0.cpp | 106 ++++++++++++++++++++++---------- pcsx2/COP0.h | 3 +- pcsx2/R5900.cpp | 3 +- pcsx2/R5900.h | 31 +++++++++- pcsx2/x86/iCOP0.cpp | 45 ++------------ pcsx2/x86/ix86-32/iR5900-32.cpp | 5 +- 6 files changed, 115 insertions(+), 78 deletions(-) diff --git a/pcsx2/COP0.cpp b/pcsx2/COP0.cpp index 67f5b4847c..c13da57caf 100644 --- a/pcsx2/COP0.cpp +++ b/pcsx2/COP0.cpp @@ -145,59 +145,104 @@ void WriteTLB(int i) } ////////////////////////////////////////////////////////////////////////////////////////// +// Performance Counters Update Stuff! +// // Note regarding updates of PERF and TIMR registers: never allow increment to be 0. // That happens when a game loads the MFC0 twice in the same recompiled block (before the // cpuRegs.cycles update), and can cause games to lock up since it's an unexpected result. - +// // PERF Overflow exceptions: The exception is raised when the MSB of the Performance -// Counter Register is set (basic arithmetic overflow, which means it does *not* include -// when the bit is later cleared). +// Counter Register is set. I'm assuming the exception continues to re-raise until the +// app clears the bit manually (needs testing). +// +// PERF Events: +// * Event 0 on PCR 0 is unused (counter disable) +// * Event 15 is usable as a specific counter disable bit (since CTE affects both counters) +// * Events 16-31 are reserved (act as counter disable) +// +// Most event mode aren't supported, and issue a warning and do a standard instruction +// count. But only mode 1 (instruction counter) has been found to be used by games thus far. +// -__forceinline void COP0_UpdatePCR0() +__forceinline void COP0_UpdatePCR() { - if((cpuRegs.PERF.n.pccr & 0x800003E0) == 0x80000020) + if( cpuRegs.CP0.n.Status.b.ERL || !cpuRegs.PERF.n.pccr.b.CTE ) return; + + // TODO : Implement memory mode checks here (kernel/super/user) + // For now we just assume user mode. + + if( cpuRegs.PERF.n.pccr.b.U0 && (cpuRegs.PERF.n.pccr.b.Event0 != 0 && cpuRegs.PERF.n.pccr.b.Event0 < 15) ) { - u32 incr = cpuRegs.cycle-s_iLastPERFCycle[0]; + // ---------------------------------- + // Update Performance Counter 0 + // ---------------------------------- + + if( cpuRegs.PERF.n.pccr.b.Event0 != 1 ) + Console::Notice( "COP0 - PCR0 Unsupported Update Event Mode = 0x%x", params cpuRegs.PERF.n.pccr.b.Event0 ); + + u32 incr = cpuRegs.cycle - s_iLastPERFCycle[0]; if( incr == 0 ) incr++; - u32 prev = cpuRegs.PERF.n.pcr0; + // use prev/XOR method for one-time exceptions (but likely less correct) + //u32 prev = cpuRegs.PERF.n.pcr0; cpuRegs.PERF.n.pcr0 += incr; s_iLastPERFCycle[0] = cpuRegs.cycle; - if( cpuRegs.PERF.n.pccr & (1UL<<31) ) // MSB is the overflow enable bit. + //prev ^= (1UL<<31); // XOR is fun! + //if( (prev & cpuRegs.PERF.n.pcr0) & (1UL<<31) ) + if( cpuRegs.PERF.n.pcr0 & 0x80000000 ) { - prev ^= (1UL<<31); // XOR is fun! - if( (prev & cpuRegs.PERF.n.pcr0) & (1UL<<31) ) + // TODO: Vector to the appropriate exception here. + // This code *should* be correct, but is untested (and other parts of the emu are + // not prepared to handle proper Level 2 exception vectors yet) + + /*if( delay_slot ) { - // TODO: Vector to the appropriate exception here. + cpuRegs.CP0.ErrorEPC = cpuRegs.pc - 4; + cpuRegs.CP0.Cause.BD2 = 1; } + else + { + cpuRegs.CP0.ErrorEPC = cpuRegs.pc; + cpuRegs.CP0.Cause.BD2 = 0; + } + + if( cpuRegs.CP0.Status.DEV ) + { + // Bootstrap vector + cpuRegs.pc = 0xbfc00280; + } + else + { + cpuRegs.pc = 0x80000080; + } + cpuRegs.CP0.Status.ERL = 1; + cpuRegs.CP0.Cause.EXC2 = 2;*/ } } -} - -__forceinline void COP0_UpdatePCR1() -{ - if((cpuRegs.PERF.n.pccr & 0x800F8000) == 0x80008000) + + if( cpuRegs.PERF.n.pccr.b.U1 && cpuRegs.PERF.n.pccr.b.Event1 < 15) { - u32 incr = cpuRegs.cycle-s_iLastPERFCycle[1]; + // ---------------------------------- + // Update Performance Counter 1 + // ---------------------------------- + + if( cpuRegs.PERF.n.pccr.b.Event1 != 1 ) + Console::Notice( "COP0 - PCR1 Unsupported Update Event Mode = 0x%x", params cpuRegs.PERF.n.pccr.b.Event1 ); + + u32 incr = cpuRegs.cycle - s_iLastPERFCycle[1]; if( incr == 0 ) incr++; - u32 prev = cpuRegs.PERF.n.pcr1; cpuRegs.PERF.n.pcr1 += incr; s_iLastPERFCycle[1] = cpuRegs.cycle; - if( cpuRegs.PERF.n.pccr & (1UL<<31) ) // MSB is the overflow enable bit. + if( cpuRegs.PERF.n.pcr1 & 0x80000000 ) { - prev ^= (1UL<<31); // XOR? I don't even know OR! Harhar! - if( (prev & cpuRegs.PERF.n.pcr1) & (1UL<<31) ) - { - // TODO: Vector to the appropriate exception here. - } + // See PCR0 comments for notes on exceptions } } } - namespace R5900 { namespace Interpreter { namespace OpcodeImpl { @@ -221,16 +266,16 @@ void MFC0() switch(_Imm_ & 0x3F) { case 0: // MFPS [LSB is clear] - cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pccr; + cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pccr.val; break; case 1: // MFPC [LSB is set] - read PCR0 - COP0_UpdatePCR0(); + COP0_UpdatePCR(); cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pcr0; break; case 3: // MFPC [LSB is set] - read PCR1 - COP0_UpdatePCR1(); + COP0_UpdatePCR(); cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pcr1; break; } @@ -269,9 +314,8 @@ void MTC0() { case 0: // MTPS [LSB is clear] // Updates PCRs and sets the PCCR. - COP0_UpdatePCR0(); - COP0_UpdatePCR1(); - cpuRegs.PERF.n.pccr = cpuRegs.GPR.r[_Rt_].UL[0]; + COP0_UpdatePCR(); + cpuRegs.PERF.n.pccr.val = cpuRegs.GPR.r[_Rt_].UL[0]; break; case 1: // MTPC [LSB is set] - set PCR0 diff --git a/pcsx2/COP0.h b/pcsx2/COP0.h index f8b0e4e6e1..d669a49a73 100644 --- a/pcsx2/COP0.h +++ b/pcsx2/COP0.h @@ -25,8 +25,7 @@ extern void WriteTLB(int i); extern void UnmapTLB(int i); extern void MapTLB(int i); -extern void COP0_UpdatePCR0(); -extern void COP0_UpdatePCR1(); +extern void COP0_UpdatePCR(); #endif /* __COP0_H__ */ diff --git a/pcsx2/R5900.cpp b/pcsx2/R5900.cpp index 82dcd8b6b8..06fc4b1976 100644 --- a/pcsx2/R5900.cpp +++ b/pcsx2/R5900.cpp @@ -392,8 +392,7 @@ static __forceinline void _cpuTestPERF() // around twice on us btween updates. Hence this function is called from the cpu's // Counters update. - COP0_UpdatePCR0(); - COP0_UpdatePCR1(); + COP0_UpdatePCR(); } // Checks the COP0.Status for exception enablings. diff --git a/pcsx2/R5900.h b/pcsx2/R5900.h index 0117b1d8af..900142b2ea 100644 --- a/pcsx2/R5900.h +++ b/pcsx2/R5900.h @@ -52,8 +52,35 @@ union GPRregs { }; union PERFregs { - struct { - u32 pccr, pcr0, pcr1, pad; + struct + { + union + { + struct + { + u32 pad0:1; // LSB should always be zero (or undefined) + u32 EXL0:1; // enable PCR0 during Level 1 exception handling + u32 K0:1; // enable PCR0 during Kernel Mode execution + u32 S0:1; // enable PCR0 during Supervisor mode execution + u32 U0:1; // enable PCR0 during User-mode execution + u32 Event0:5; // PCR0 event counter (all values except 1 ignored at this time) + + u32 pad1:1; // more zero/undefined padding [bit 10] + + u32 EXL1:1; // enable PCR1 during Level 1 exception handling + u32 K1:1; // enable PCR1 during Kernel Mode execution + u32 S1:1; // enable PCR1 during Supervisor mode execution + u32 U1:1; // enable PCR1 during User-mode execution + u32 Event1:5; // PCR1 event counter (all values except 1 ignored at this time) + + u32 Reserved:11; + u32 CTE:1; // Counter enable bit, no counting if set to zero. + } b; + + u32 val; + } pccr; + + u32 pcr0, pcr1, pad; } n; u32 r[4]; }; diff --git a/pcsx2/x86/iCOP0.cpp b/pcsx2/x86/iCOP0.cpp index 7bb3eca220..10b2df00f3 100644 --- a/pcsx2/x86/iCOP0.cpp +++ b/pcsx2/x86/iCOP0.cpp @@ -162,44 +162,13 @@ void recMFC0( void ) { case 0: MOV32MtoR(EAX, (uptr)&cpuRegs.PERF.n.pccr); + break; - break; case 1: - /*MOV32MtoR(ECX, (uptr)&cpuRegs.PERF.n.pccr); - MOV32MtoR(EAX, (uptr)&cpuRegs.PERF.n.pcr0); - AND32ItoR(ECX, 0x800003E0); - - CMP32ItoR(ECX, 0x80000020); - j8Ptr[0] = JNE8(0); - - MOV32MtoR(EDX, (uptr)&cpuRegs.cycle); - SUB32MtoR(EAX, (uptr)&s_iLastPERFCycle[0]); - ADD32RtoR(EAX, EDX); - MOV32RtoM((uptr)&s_iLastPERFCycle[0], EDX); - MOV32RtoM((uptr)&cpuRegs.PERF.n.pcr0, EAX); - - x86SetJ8(j8Ptr[0]);*/ - - CALLFunc( (uptr)COP0_UpdatePCR0 ); - break; case 3: - /*MOV32MtoR(ECX, (uptr)&cpuRegs.PERF.n.pccr); - MOV32MtoR(EAX, (uptr)&cpuRegs.PERF.n.pcr1); - AND32ItoR(ECX, 0x800F8000); - - CMP32ItoR(ECX, 0x80008000); - j8Ptr[0] = JNE8(0); - - MOV32MtoR(EDX, (uptr)&cpuRegs.cycle); - SUB32MtoR(EAX, (uptr)&s_iLastPERFCycle[1]); - ADD32RtoR(EAX, EDX); - MOV32RtoM((uptr)&s_iLastPERFCycle[1], EDX); - MOV32RtoM((uptr)&cpuRegs.PERF.n.pcr1, EAX); - - x86SetJ8(j8Ptr[0]);*/ - - CALLFunc( (uptr)COP0_UpdatePCR1 ); - break; + CALLFunc( (uptr)COP0_UpdatePCR ); + CALLFunc( (uptr)COP0_UpdatePCR ); + break; } _deleteEEreg(_Rt_, 0); MOV32RtoM((uptr)&cpuRegs.GPR.r[_Rt_].UL[0],EAX); @@ -308,8 +277,7 @@ void recMTC0() switch(_Imm_ & 0x3F) { case 0: - CALLFunc( (uptr)COP0_UpdatePCR0 ); - CALLFunc( (uptr)COP0_UpdatePCR1 ); + CALLFunc( (uptr)COP0_UpdatePCR ); MOV32ItoM((uptr)&cpuRegs.PERF.n.pccr, g_cpuConstRegs[_Rt_].UL[0]); break; @@ -356,8 +324,7 @@ void recMTC0() switch(_Imm_ & 0x3F) { case 0: - CALLFunc( (uptr)COP0_UpdatePCR0 ); - CALLFunc( (uptr)COP0_UpdatePCR1 ); + CALLFunc( (uptr)COP0_UpdatePCR ); _eeMoveGPRtoM((uptr)&cpuRegs.PERF.n.pccr, _Rt_); break; diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index c19a468c19..95931a0061 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -1198,9 +1198,10 @@ u32 eeScaleBlockCycles() jNO_DEFAULT } - const u32 temp = s_nBlockCycles * + const u32 temp = s_nBlockCycles * ( (s_nBlockCycles <= (10<<3)) ? scalarLow : - ((s_nBlockCycles > (21<<3)) ? scalarHigh : scalarMid ); + ((s_nBlockCycles > (21<<3)) ? scalarHigh : scalarMid ) + ); return temp >> (3+2); } From 90263a17d6875d9bd6ebe18ce7edbd5c9cd4ee94 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 11 Mar 2009 14:09:43 +0000 Subject: [PATCH 11/77] More work on the PERF counters. Counters now selectively count or don't count depending on mode (which should keep some games happier which might try and use them, if still not being totally accurate or correct). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@746 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/COP0.cpp | 144 +++++++++++++++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 52 deletions(-) diff --git a/pcsx2/COP0.cpp b/pcsx2/COP0.cpp index c13da57caf..162c8e78cc 100644 --- a/pcsx2/COP0.cpp +++ b/pcsx2/COP0.cpp @@ -157,13 +157,53 @@ void WriteTLB(int i) // // PERF Events: // * Event 0 on PCR 0 is unused (counter disable) -// * Event 15 is usable as a specific counter disable bit (since CTE affects both counters) -// * Events 16-31 are reserved (act as counter disable) +// * Event 16 is usable as a specific counter disable bit (since CTE affects both counters) +// * Events 17-31 are reserved (act as counter disable) // // Most event mode aren't supported, and issue a warning and do a standard instruction // count. But only mode 1 (instruction counter) has been found to be used by games thus far. // +__forceinline bool PERF_ShouldCountEvent( uint evt ) +{ + switch( evt ) + { + // This is a rough table of actions for various PCR modes. Some of these + // can be implemented more accurately later. Others (WBBs in particular) + // probably cannot without some severe complications. + + // left sides are PCR0 / right sides are PCR1 + + case 1: // cpu cycle counter. + case 2: // single/dual instruction issued + case 3: // Branch issued / Branch mispredicated + return true; + + case 4: // BTAC/TLB miss + case 5: // ITLB/DTLB miss + case 6: // Data/Instruction cache miss + return false; + + case 7: // Access to DTLB / WBB single request fail + case 8: // Non-blocking load / WBB burst request fail + case 9: + case 10: + Console::Notice( "COP0 - PCR0 Unsupported Update Event Mode = 0x%x\n\t(Nneeve says this should probably never happen!)", params cpuRegs.PERF.n.pccr.b.Event0 ); + return false; + + case 11: // CPU address bus busy / CPU data bus busy + return false; + + case 12: // Instruction completed + case 13: // non-delayslot instruction completed + case 14: // COP2/COP1 instruction complete + case 15: // Load/Store completed + return true; + } + + return false; +} + __forceinline void COP0_UpdatePCR() { if( cpuRegs.CP0.n.Status.b.ERL || !cpuRegs.PERF.n.pccr.b.CTE ) return; @@ -171,74 +211,74 @@ __forceinline void COP0_UpdatePCR() // TODO : Implement memory mode checks here (kernel/super/user) // For now we just assume user mode. - if( cpuRegs.PERF.n.pccr.b.U0 && (cpuRegs.PERF.n.pccr.b.Event0 != 0 && cpuRegs.PERF.n.pccr.b.Event0 < 15) ) + if( cpuRegs.PERF.n.pccr.b.U0 ) { // ---------------------------------- // Update Performance Counter 0 // ---------------------------------- - if( cpuRegs.PERF.n.pccr.b.Event0 != 1 ) - Console::Notice( "COP0 - PCR0 Unsupported Update Event Mode = 0x%x", params cpuRegs.PERF.n.pccr.b.Event0 ); - - u32 incr = cpuRegs.cycle - s_iLastPERFCycle[0]; - if( incr == 0 ) incr++; - - // use prev/XOR method for one-time exceptions (but likely less correct) - //u32 prev = cpuRegs.PERF.n.pcr0; - cpuRegs.PERF.n.pcr0 += incr; - s_iLastPERFCycle[0] = cpuRegs.cycle; - - //prev ^= (1UL<<31); // XOR is fun! - //if( (prev & cpuRegs.PERF.n.pcr0) & (1UL<<31) ) - if( cpuRegs.PERF.n.pcr0 & 0x80000000 ) + if( PERF_ShouldCountEvent( cpuRegs.PERF.n.pccr.b.Event0 ) ) { - // TODO: Vector to the appropriate exception here. - // This code *should* be correct, but is untested (and other parts of the emu are - // not prepared to handle proper Level 2 exception vectors yet) + u32 incr = cpuRegs.cycle - s_iLastPERFCycle[0]; + if( incr == 0 ) incr++; + + // use prev/XOR method for one-time exceptions (but likely less correct) + //u32 prev = cpuRegs.PERF.n.pcr0; + cpuRegs.PERF.n.pcr0 += incr; + s_iLastPERFCycle[0] = cpuRegs.cycle; - /*if( delay_slot ) + //prev ^= (1UL<<31); // XOR is fun! + //if( (prev & cpuRegs.PERF.n.pcr0) & (1UL<<31) ) + if( cpuRegs.PERF.n.pcr0 & 0x80000000 ) { - cpuRegs.CP0.ErrorEPC = cpuRegs.pc - 4; - cpuRegs.CP0.Cause.BD2 = 1; + // TODO: Vector to the appropriate exception here. + // This code *should* be correct, but is untested (and other parts of the emu are + // not prepared to handle proper Level 2 exception vectors yet) + + /*if( delay_slot ) + { + cpuRegs.CP0.ErrorEPC = cpuRegs.pc - 4; + cpuRegs.CP0.Cause.BD2 = 1; + } + else + { + cpuRegs.CP0.ErrorEPC = cpuRegs.pc; + cpuRegs.CP0.Cause.BD2 = 0; + } + + if( cpuRegs.CP0.Status.DEV ) + { + // Bootstrap vector + cpuRegs.pc = 0xbfc00280; + } + else + { + cpuRegs.pc = 0x80000080; + } + cpuRegs.CP0.Status.ERL = 1; + cpuRegs.CP0.Cause.EXC2 = 2;*/ } - else - { - cpuRegs.CP0.ErrorEPC = cpuRegs.pc; - cpuRegs.CP0.Cause.BD2 = 0; - } - - if( cpuRegs.CP0.Status.DEV ) - { - // Bootstrap vector - cpuRegs.pc = 0xbfc00280; - } - else - { - cpuRegs.pc = 0x80000080; - } - cpuRegs.CP0.Status.ERL = 1; - cpuRegs.CP0.Cause.EXC2 = 2;*/ } } - if( cpuRegs.PERF.n.pccr.b.U1 && cpuRegs.PERF.n.pccr.b.Event1 < 15) + if( cpuRegs.PERF.n.pccr.b.U1 ) { // ---------------------------------- // Update Performance Counter 1 // ---------------------------------- - if( cpuRegs.PERF.n.pccr.b.Event1 != 1 ) - Console::Notice( "COP0 - PCR1 Unsupported Update Event Mode = 0x%x", params cpuRegs.PERF.n.pccr.b.Event1 ); - - u32 incr = cpuRegs.cycle - s_iLastPERFCycle[1]; - if( incr == 0 ) incr++; - - cpuRegs.PERF.n.pcr1 += incr; - s_iLastPERFCycle[1] = cpuRegs.cycle; - - if( cpuRegs.PERF.n.pcr1 & 0x80000000 ) + if( PERF_ShouldCountEvent( cpuRegs.PERF.n.pccr.b.Event1 ) ) { - // See PCR0 comments for notes on exceptions + u32 incr = cpuRegs.cycle - s_iLastPERFCycle[1]; + if( incr == 0 ) incr++; + + cpuRegs.PERF.n.pcr1 += incr; + s_iLastPERFCycle[1] = cpuRegs.cycle; + + if( cpuRegs.PERF.n.pcr1 & 0x80000000 ) + { + // See PCR0 comments for notes on exceptions + } } } } From 004d5596780a3b9131bf17cce5714b96d20a1c4a Mon Sep 17 00:00:00 2001 From: mattmenke Date: Wed, 11 Mar 2009 17:25:51 +0000 Subject: [PATCH 12/77] Added option to control PCSX2 volume only with volume keys, instead of global windows volume. Release shift, control, and alt on deactivate. Fix for changing skip mode on alt-F4 (Accidentally removed the old fix for it in 0.9.5) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@747 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/LilyPad/Config.cpp | 41 +++++++++++++++++++++++++++++++- plugins/LilyPad/Config.h | 8 +++++++ plugins/LilyPad/DirectInput.cpp | 3 ++- plugins/LilyPad/InputManager.cpp | 4 +++- plugins/LilyPad/KeyboardHook.cpp | 10 ++++++++ plugins/LilyPad/LilyPad.cpp | 36 ++++++++++++++++++++-------- plugins/LilyPad/LilyPad.rc | 15 ++++++------ plugins/LilyPad/resource.h | 6 +++-- 8 files changed, 101 insertions(+), 22 deletions(-) diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index 21d3855697..7c08d2097d 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -576,7 +576,21 @@ int WritePrivateProfileInt(wchar_t *s1, wchar_t *s2, int v, wchar_t *ini) { return WritePrivateProfileStringW(s1, s2, temp, ini); } -int SaveSettings(wchar_t *file = 0) { +void SetVolume(int volume) { + if (volume > 100) volume = 100; + if (volume < 0) volume = 0; + config.volume = volume; + unsigned int val = 0xFFFF * volume/100; + val = val | (val<<16); + for (int i=waveOutGetNumDevs()-1; i>=0; i--) { + waveOutSetVolume((HWAVEOUT)i, val); + } + wchar_t ini[MAX_PATH+20]; + GetSettingsFileName(ini); + WritePrivateProfileInt(L"General Settings", L"Volume", config.volume, ini); +} + +int SaveSettings(wchar_t *file=0) { wchar_t ini[MAX_PATH+20]; // Need this either way for saving path. @@ -620,6 +634,9 @@ int SaveSettings(wchar_t *file = 0) { WritePrivateProfileInt(L"General Settings", L"Save State in Title", config.saveStateTitle, file); + WritePrivateProfileInt(L"General Settings", L"Vista Volume", config.vistaVolume, file); + WritePrivateProfileInt(L"General Settings", L"Volume", config.volume, file); + WritePrivateProfileInt(L"Pad1", L"Guitar", config.guitar[0], file); WritePrivateProfileInt(L"Pad2", L"Guitar", config.guitar[1], file); WritePrivateProfileInt(L"Pad1", L"Auto Analog", config.AutoAnalog[0], file); @@ -735,6 +752,18 @@ int LoadSettings(int force, wchar_t *file) { config.saveStateTitle = GetPrivateProfileBool(L"General Settings", L"Save State in Title", 1, file); + config.vistaVolume = GetPrivateProfileBool(L"General Settings", L"Vista Volume", 1, file); + config.volume = GetPrivateProfileInt(L"General Settings", L"Volume", 100, file); + OSVERSIONINFO os; + os.dwOSVersionInfoSize = sizeof(os); + config.osVersion = 0; + if (GetVersionEx(&os)) { + config.osVersion = os.dwMajorVersion; + } + if (config.osVersion < 6) config.vistaVolume = 0; + if (!config.vistaVolume) config.volume = 100; + if (config.vistaVolume) SetVolume(config.volume); + if (!InitializeRawInput()) { if (config.keyboardApi == RAW) config.keyboardApi = WM; if (config.mouseApi == RAW) config.mouseApi = WM; @@ -1517,6 +1546,9 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L CheckDlgButton(hWnd, IDC_GH2_HACK, BST_CHECKED * config.GH2); CheckDlgButton(hWnd, IDC_SAVE_STATE_TITLE, BST_CHECKED * config.saveStateTitle); + CheckDlgButton(hWnd, IDC_VISTA_VOLUME, BST_CHECKED * config.vistaVolume); + if (config.osVersion < 6) EnableWindow(GetDlgItem(hWnd, IDC_VISTA_VOLUME), 0); + CheckDlgButton(hWnd, IDC_GUITAR1, BST_CHECKED * config.guitar[0]); CheckDlgButton(hWnd, IDC_GUITAR2, BST_CHECKED * config.guitar[1]); CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_CHECKED * config.AutoAnalog[0]); @@ -1608,6 +1640,13 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L config.GH2 = (IsDlgButtonChecked(hWnd, IDC_GH2_HACK) == BST_CHECKED); config.saveStateTitle = (IsDlgButtonChecked(hWnd, IDC_SAVE_STATE_TITLE) == BST_CHECKED); + u8 newVistaVolume = (IsDlgButtonChecked(hWnd, IDC_VISTA_VOLUME) == BST_CHECKED); + if (config.vistaVolume != newVistaVolume) { + config.vistaVolume = newVistaVolume; + SetVolume(100); + } + + unsigned int needUpdate = 0; unsigned int disablePad1New = (IsDlgButtonChecked(hWnd, IDC_DISABLE_PAD1) == BST_CHECKED); unsigned int disablePad2New = (IsDlgButtonChecked(hWnd, IDC_DISABLE_PAD2) == BST_CHECKED); diff --git a/plugins/LilyPad/Config.h b/plugins/LilyPad/Config.h index 24ded457f7..8e711a6b5a 100644 --- a/plugins/LilyPad/Config.h +++ b/plugins/LilyPad/Config.h @@ -38,6 +38,12 @@ public: u8 saveStateTitle; + u8 vistaVolume; + int volume; + + // Unlike the others, not a changeable value. + DWORD osVersion; + wchar_t lastSaveConfigPath[MAX_PATH+1]; wchar_t lastSaveConfigFileName[MAX_PATH+1]; }; @@ -48,6 +54,8 @@ void UnloadConfigs(); void AddIgnore(LPARAM k); +void SetVolume(int volume); + int LoadSettings(int force = 0, wchar_t *file = 0); void CALLBACK PADconfigure(); diff --git a/plugins/LilyPad/DirectInput.cpp b/plugins/LilyPad/DirectInput.cpp index 108205606c..6a945d737f 100644 --- a/plugins/LilyPad/DirectInput.cpp +++ b/plugins/LilyPad/DirectInput.cpp @@ -20,7 +20,7 @@ inline static u32 flipLong(u32 l) { static void GUIDtoString(wchar_t *data, const GUID *pg) { wsprintfW(data, L"%08X-%04X-%04X-%04X-%04X%08X", pg->Data1, (u32)pg->Data2, (u32)pg->Data3, - flipShort(((u16*)pg->Data4)[0]), + flipShort(((u16*)pg->Data4)[0]), flipShort(((u16*)pg->Data4)[1]), flipLong(((u32*)pg->Data4)[1])); } @@ -320,6 +320,7 @@ public: did->Unacquire(); did->Release(); ReleaseDirectInput(); + did = 0; active = 0; } } diff --git a/plugins/LilyPad/InputManager.cpp b/plugins/LilyPad/InputManager.cpp index bb3c5cacbf..aec8e777d2 100644 --- a/plugins/LilyPad/InputManager.cpp +++ b/plugins/LilyPad/InputManager.cpp @@ -428,7 +428,9 @@ void InputDeviceManager::DisableAllDevices() { void InputDeviceManager::DisableDevice(int index) { devices[index]->enabled = 0; - if (devices[index]->active) devices[index]->Deactivate(); + if (devices[index]->active) { + devices[index]->Deactivate(); + } } ForceFeedbackEffectType *Device::GetForcefeedbackEffect(wchar_t *id) { diff --git a/plugins/LilyPad/KeyboardHook.cpp b/plugins/LilyPad/KeyboardHook.cpp index 28599fa96c..a8f25bd133 100644 --- a/plugins/LilyPad/KeyboardHook.cpp +++ b/plugins/LilyPad/KeyboardHook.cpp @@ -97,6 +97,16 @@ LRESULT CALLBACK IgnoreKeyboardHook(int code, WPARAM wParam, LPARAM lParam) { return 1; } } + if (config.vistaVolume) { + if (key->vkCode == VK_VOLUME_DOWN) { + SetVolume(config.volume-3); + return 1; + } + if (key->vkCode == VK_VOLUME_UP) { + SetVolume(config.volume+3); + return 1; + } + } } else if (wParam == WM_KEYUP || wParam == WM_SYSKEYUP) { KBDLLHOOKSTRUCT* key = (KBDLLHOOKSTRUCT*) lParam; diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 7d45affd31..6b17a92c8b 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -132,10 +132,14 @@ u8 Cap (int i) { return (u8) i; } - -// Just like RefreshEnabledDevices(), but takes into account -// mouse and focus state and which devices have bindings for -// enabled pads. Also releases keyboards if window is not focused. +// RefreshEnabledDevices() enables everything that can potentially +// be bound to, as well as the "Ignore keyboard" device. +// +// This enables everything that input should be read from while the +// emulator is running. Takes into account mouse and focus state +// and which devices have bindings for enabled pads. Releases +// keyboards if window is not focused. Releases game devices if +// background monitoring is not checked. // And releases games if not focused and config.background is not set. void UpdateEnabledDevices(int updateList = 0) { // Enable all devices I might want. Can ignore the rest. @@ -156,7 +160,7 @@ void UpdateEnabledDevices(int updateList = 0) { // Disable ignore keyboard if don't have focus or there are no keys to ignore. if (dev->api == IGNORE_KEYBOARD) { - if (config.keyboardApi == NO_API || !activeWindow || !dev->pads[0].numBindings) { + if ((!config.vistaVolume && (config.keyboardApi == NO_API || !dev->pads[0].numBindings)) || !activeWindow) { dm->DisableDevice(i); } continue; @@ -629,6 +633,8 @@ struct QueryInfo { int saveStateIndex = 0; +// Implements a couple of the hacks, also responsible for monitoring device addition/removal and focus +// changes. ExtraWndProcResult HackWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *output) { switch (uMsg) { case WM_SETTEXT: @@ -659,6 +665,12 @@ ExtraWndProcResult HackWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara } break; case WM_ACTIVATEAPP: + // Release any buttons PCSX2 may think are down when + // losing/gaining focus. + QueueKeyEvent(VK_SHIFT, KEYRELEASE); + QueueKeyEvent(VK_MENU, KEYRELEASE); + QueueKeyEvent(VK_CONTROL, KEYRELEASE); + // Need to do this when not reading input from gs thread. // Checking for that case not worth the effort. EnterCriticalSection(&readInputCriticalSection); @@ -1112,6 +1124,7 @@ keyEvent* CALLBACK PADkeyEvent() { Update(2); } static char shiftDown = 0; + static char altDown = 0; static keyEvent ev; if (!GetQueuedKeyEvent(&ev)) return 0; if ((ev.key == VK_ESCAPE || (int)ev.key == -2) && ev.evt == KEYPRESS && config.escapeFullscreenHack) { @@ -1145,18 +1158,21 @@ keyEvent* CALLBACK PADkeyEvent() { } } + // So don't change skip mode on alt-F4. + if (ev.key == VK_F4 && altDown) { + return 0; + } + if (ev.key == VK_LSHIFT || ev.key == VK_RSHIFT || ev.key == VK_SHIFT) { ev.key = VK_SHIFT; - if (ev.evt == KEYPRESS) - shiftDown = 1; - else - shiftDown = 0; + shiftDown = (ev.evt == KEYPRESS); } else if (ev.key == VK_LCONTROL || ev.key == VK_RCONTROL) { ev.key = VK_CONTROL; } - else if (ev.key == VK_LMENU || ev.key == VK_RMENU) { + else if (ev.key == VK_LMENU || ev.key == VK_RMENU || ev.key == VK_SHIFT) { ev.key = VK_MENU; + altDown = (ev.evt == KEYPRESS); } return &ev; } diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index 7056ddda7d..df317def7d 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -265,12 +265,13 @@ BEGIN CONTROL "Send escape on window close",IDC_CLOSE_HACK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,223,113,10 CONTROL "Exit emulator on window close",IDC_CLOSE_HACK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,235,112,10 CONTROL "Disable screensaver",IDC_DISABLE_SCREENSAVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,247,80,10 - CONTROL "Safe fullscreen exit on escape (For GSDX+DX10)",IDC_ESCAPE_FULLSCREEN_HACK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,259,171,10 + CONTROL "Safe fullscreen exit on escape",IDC_ESCAPE_FULLSCREEN_HACK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,259,112,10 CONTROL "Use GS thread (Recommended)",IDC_GS_THREAD_INPUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,271,116,10 CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,223,71,10 CONTROL "Save state # in title",IDC_SAVE_STATE_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,235,79,10 - CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,76,10 + CONTROL "App Local Volume",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,71,10 + CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,259,76,10 GROUPBOX "Debugging",IDC_STATIC,216,285,79,25 CONTROL "Enable logging",IDC_DEBUG_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,296,63,10 PUSHBUTTON "Load",ID_LOAD,313,295,48,15 @@ -302,7 +303,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_CONFIG, DIALOG BEGIN diff --git a/plugins/LilyPad/resource.h b/plugins/LilyPad/resource.h index c539c96b96..1d5010151c 100644 --- a/plugins/LilyPad/resource.h +++ b/plugins/LilyPad/resource.h @@ -42,6 +42,8 @@ #define IDC_FORCE_HIDE2 1125 #define IDC_GH2_HACK 1125 #define IDC_FORCEFEEDBACK_HACK1 1126 +#define IDC_GH2_HACK2 1126 +#define IDC_VISTA_VOLUME 1126 #define IDC_DISABLE_SCREENSAVER4 1127 #define IDC_FORCEFEEDBACK_HACK2 1127 #define IDC_GS_THREAD_INPUT 1128 @@ -115,7 +117,7 @@ #define IDC_FF_MOTOR 0x1303 #define ID_FF 0x1304 #define IDC_FF_EFFECT 0x1305 -#define IDC_VERSION 0x1306 +#define IDC_VERSION 0x1306 #define IDC_FF_AXIS1_ENABLED 0x1310 #define IDC_FF_AXIS1 0x1311 #define IDC_FF_AXIS1_FLIP 0x1312 @@ -150,7 +152,7 @@ #define IDC_FF_AXIS8_SCALE 0x1383 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 112 From 5d93b6bbe977e8350f3f7d5e97c6bc7d0edb25b2 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 11 Mar 2009 19:08:08 +0000 Subject: [PATCH 13/77] Minor PERF fixups -- moved the diagnostic msg to a less spamming-like area (on PCCR assignment, rather than on PCR update). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@748 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/COP0.cpp | 28 +++++++++++++++++++++------- pcsx2/COP0.h | 3 ++- pcsx2/R5900.cpp | 2 +- pcsx2/x86/iCOP0.cpp | 33 +++++---------------------------- 4 files changed, 29 insertions(+), 37 deletions(-) diff --git a/pcsx2/COP0.cpp b/pcsx2/COP0.cpp index 162c8e78cc..75c5cf30e1 100644 --- a/pcsx2/COP0.cpp +++ b/pcsx2/COP0.cpp @@ -164,7 +164,7 @@ void WriteTLB(int i) // count. But only mode 1 (instruction counter) has been found to be used by games thus far. // -__forceinline bool PERF_ShouldCountEvent( uint evt ) +static __forceinline bool PERF_ShouldCountEvent( uint evt ) { switch( evt ) { @@ -188,7 +188,6 @@ __forceinline bool PERF_ShouldCountEvent( uint evt ) case 8: // Non-blocking load / WBB burst request fail case 9: case 10: - Console::Notice( "COP0 - PCR0 Unsupported Update Event Mode = 0x%x\n\t(Nneeve says this should probably never happen!)", params cpuRegs.PERF.n.pccr.b.Event0 ); return false; case 11: // CPU address bus busy / CPU data bus busy @@ -204,7 +203,19 @@ __forceinline bool PERF_ShouldCountEvent( uint evt ) return false; } -__forceinline void COP0_UpdatePCR() +// Diagnostics for event modes that we just ignore for now. Using these perf units could +// cause compat issues in some very odd/rare games, so if this msg comes up who knows, +// might save some debugging effort. :) +void COP0_DiagnosticPCCR() +{ + if( cpuRegs.PERF.n.pccr.b.Event0 >= 7 && cpuRegs.PERF.n.pccr.b.Event0 <= 10 ) + Console::Notice( "PERF/PCR0 Unsupported Update Event Mode = 0x%x", params cpuRegs.PERF.n.pccr.b.Event0 ); + + if( cpuRegs.PERF.n.pccr.b.Event1 >= 7 && cpuRegs.PERF.n.pccr.b.Event1 <= 10 ) + Console::Notice( "PERF/PCR1 Unsupported Update Event Mode = 0x%x", params cpuRegs.PERF.n.pccr.b.Event1 ); +} + +__forceinline void COP0_UpdatePCCR() { if( cpuRegs.CP0.n.Status.b.ERL || !cpuRegs.PERF.n.pccr.b.CTE ) return; @@ -283,6 +294,9 @@ __forceinline void COP0_UpdatePCR() } } +////////////////////////////////////////////////////////////////////////////////////////// +// + namespace R5900 { namespace Interpreter { namespace OpcodeImpl { @@ -297,7 +311,6 @@ void MFC0() //if(bExecBIOS == FALSE && _Rd_ == 25) SysPrintf("MFC0 _Rd_ %x = %x\n", _Rd_, cpuRegs.CP0.r[_Rd_]); switch (_Rd_) { - case 12: cpuRegs.GPR.r[_Rt_].SD[0] = (s32)(cpuRegs.CP0.r[_Rd_] & 0xf0c79c1f); break; @@ -310,12 +323,12 @@ void MFC0() break; case 1: // MFPC [LSB is set] - read PCR0 - COP0_UpdatePCR(); + COP0_UpdatePCCR(); cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pcr0; break; case 3: // MFPC [LSB is set] - read PCR1 - COP0_UpdatePCR(); + COP0_UpdatePCCR(); cpuRegs.GPR.r[_Rt_].SD[0] = (s32)cpuRegs.PERF.n.pcr1; break; } @@ -354,8 +367,9 @@ void MTC0() { case 0: // MTPS [LSB is clear] // Updates PCRs and sets the PCCR. - COP0_UpdatePCR(); + COP0_UpdatePCCR(); cpuRegs.PERF.n.pccr.val = cpuRegs.GPR.r[_Rt_].UL[0]; + COP0_DiagnosticPCCR(); break; case 1: // MTPC [LSB is set] - set PCR0 diff --git a/pcsx2/COP0.h b/pcsx2/COP0.h index d669a49a73..308dc5646f 100644 --- a/pcsx2/COP0.h +++ b/pcsx2/COP0.h @@ -25,7 +25,8 @@ extern void WriteTLB(int i); extern void UnmapTLB(int i); extern void MapTLB(int i); -extern void COP0_UpdatePCR(); +extern void COP0_UpdatePCCR(); +extern void COP0_DiagnosticPCCR(); #endif /* __COP0_H__ */ diff --git a/pcsx2/R5900.cpp b/pcsx2/R5900.cpp index 06fc4b1976..78ad012144 100644 --- a/pcsx2/R5900.cpp +++ b/pcsx2/R5900.cpp @@ -392,7 +392,7 @@ static __forceinline void _cpuTestPERF() // around twice on us btween updates. Hence this function is called from the cpu's // Counters update. - COP0_UpdatePCR(); + COP0_UpdatePCCR(); } // Checks the COP0.Status for exception enablings. diff --git a/pcsx2/x86/iCOP0.cpp b/pcsx2/x86/iCOP0.cpp index 10b2df00f3..e4885568cf 100644 --- a/pcsx2/x86/iCOP0.cpp +++ b/pcsx2/x86/iCOP0.cpp @@ -166,8 +166,7 @@ void recMFC0( void ) case 1: case 3: - CALLFunc( (uptr)COP0_UpdatePCR ); - CALLFunc( (uptr)COP0_UpdatePCR ); + CALLFunc( (uptr)COP0_UpdatePCCR ); break; } _deleteEEreg(_Rt_, 0); @@ -231,30 +230,6 @@ void recMFC0( void ) } } -void updatePCCR() -{ - // read the old pccr and update pcr0/1 - MOV32MtoR(EAX, (uptr)&cpuRegs.PERF.n.pccr); - MOV32RtoR(EDX, EAX); - MOV32MtoR(ECX, (uptr)&cpuRegs.cycle); - - AND32ItoR(EAX, 0x800003E0); - CMP32ItoR(EAX, 0x80000020); - j8Ptr[0] = JNE8(0); - MOV32MtoR(EAX, (uptr)&s_iLastPERFCycle[0]); - ADD32RtoM((uptr)&cpuRegs.PERF.n.pcr0, ECX); - SUB32RtoM((uptr)&cpuRegs.PERF.n.pcr0, EAX); - x86SetJ8(j8Ptr[0]); - - AND32ItoR(EDX, 0x800F8000); - CMP32ItoR(EDX, 0x80008000); - j8Ptr[0] = JNE8(0); - MOV32MtoR(EAX, (uptr)&s_iLastPERFCycle[1]); - ADD32RtoM((uptr)&cpuRegs.PERF.n.pcr1, ECX); - SUB32RtoM((uptr)&cpuRegs.PERF.n.pcr1, EAX); - x86SetJ8(j8Ptr[0]); -} - void recMTC0() { if( GPR_IS_CONST1(_Rt_) ) @@ -277,8 +252,9 @@ void recMTC0() switch(_Imm_ & 0x3F) { case 0: - CALLFunc( (uptr)COP0_UpdatePCR ); + CALLFunc( (uptr)COP0_UpdatePCCR ); MOV32ItoM((uptr)&cpuRegs.PERF.n.pccr, g_cpuConstRegs[_Rt_].UL[0]); + CALLFunc( (uptr)COP0_DiagnosticPCCR ); break; case 1: @@ -324,8 +300,9 @@ void recMTC0() switch(_Imm_ & 0x3F) { case 0: - CALLFunc( (uptr)COP0_UpdatePCR ); + CALLFunc( (uptr)COP0_UpdatePCCR ); _eeMoveGPRtoM((uptr)&cpuRegs.PERF.n.pccr, _Rt_); + CALLFunc( (uptr)COP0_DiagnosticPCCR ); break; case 1: From 93b85af339a5a400dc6132bdd31a2e882668ba8b Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Wed, 11 Mar 2009 23:49:39 +0000 Subject: [PATCH 14/77] optimized some stuff, and implemented all EFU opcodes. note: most of the microVU EFU opcodes are implemented with completely different algorithms than zerorecs. this might prove to be more accurate, but i mainly did it to avoid using x87 FPU instructions (since i'm using mmx regs for storage). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@749 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU.cpp | 11 ++ pcsx2/x86/microVU_Alloc.inl | 14 ++- pcsx2/x86/microVU_Lower.inl | 205 ++++++++++++++++++++++++++++++++---- pcsx2/x86/microVU_Misc.h | 15 +++ pcsx2/x86/microVU_Upper.inl | 29 ----- 5 files changed, 218 insertions(+), 56 deletions(-) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index eaeeadd90e..3171b7e2a4 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -43,6 +43,17 @@ PCSX2_ALIGNED16(const u32 mVU_T6[4]) = {0xbd6501c4, 0xbd6501c4, 0xbd6501c4, 0xb PCSX2_ALIGNED16(const u32 mVU_T7[4]) = {0x3cb31652, 0x3cb31652, 0x3cb31652, 0x3cb31652}; PCSX2_ALIGNED16(const u32 mVU_T8[4]) = {0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7}; PCSX2_ALIGNED16(const u32 mVU_Pi4[4]) = {0x3f490fdb, 0x3f490fdb, 0x3f490fdb, 0x3f490fdb}; +//PCSX2_ALIGNED16(const u32 mVU_S1[4]) = {0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000}; +PCSX2_ALIGNED16(const u32 mVU_S2[4]) = {0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4}; +PCSX2_ALIGNED16(const u32 mVU_S3[4]) = {0x3c08873e, 0x3c08873e, 0x3c08873e, 0x3c08873e}; +PCSX2_ALIGNED16(const u32 mVU_S4[4]) = {0xb94fb21f, 0xb94fb21f, 0xb94fb21f, 0xb94fb21f}; +PCSX2_ALIGNED16(const u32 mVU_S5[4]) = {0x362e9c14, 0x362e9c14, 0x362e9c14, 0x362e9c14}; +PCSX2_ALIGNED16(const u32 mVU_E1[4]) = {0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8}; +PCSX2_ALIGNED16(const u32 mVU_E2[4]) = {0x3d0007f4, 0x3d0007f4, 0x3d0007f4, 0x3d0007f4}; +PCSX2_ALIGNED16(const u32 mVU_E3[4]) = {0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff}; +PCSX2_ALIGNED16(const u32 mVU_E4[4]) = {0x3933e553, 0x3933e553, 0x3933e553, 0x3933e553}; +PCSX2_ALIGNED16(const u32 mVU_E5[4]) = {0x36b63510, 0x36b63510, 0x36b63510, 0x36b63510}; +PCSX2_ALIGNED16(const u32 mVU_E6[4]) = {0x353961ac, 0x353961ac, 0x353961ac, 0x353961ac}; PCSX2_ALIGNED16(const float mVU_FTOI_4[4]) = {16.0, 16.0, 16.0, 16.0}; PCSX2_ALIGNED16(const float mVU_FTOI_12[4]) = {4096.0, 4096.0, 4096.0, 4096.0}; PCSX2_ALIGNED16(const float mVU_FTOI_15[4]) = {32768.0, 32768.0, 32768.0, 32768.0}; diff --git a/pcsx2/x86/microVU_Alloc.inl b/pcsx2/x86/microVU_Alloc.inl index b2ff61451d..32b53fbb97 100644 --- a/pcsx2/x86/microVU_Alloc.inl +++ b/pcsx2/x86/microVU_Alloc.inl @@ -748,14 +748,14 @@ microVUt(void) mVUallocMFLAGb(int reg, int fInstance) { microVUt(void) mVUallocVIa(int GPRreg, int _reg_) { microVU* mVU = mVUx; if (_reg_ == 0) { XOR32RtoR(GPRreg, GPRreg); } - else if (_reg_ < 9) { MOVD32MMXtoR(GPRreg, mmxVI1 + (_reg_ - 1)); } + else if (_reg_ < 9) { MOVD32MMXtoR(GPRreg, mmVI(_reg_)); } else { MOVZX32M16toR(GPRreg, (uptr)&mVU->regs->VI[_reg_].UL); } } microVUt(void) mVUallocVIb(int GPRreg, int _reg_) { microVU* mVU = mVUx; if (_reg_ == 0) { return; } - else if (_reg_ < 9) { MOVD32RtoMMX(mmxVI1 + (_reg_ - 1), GPRreg); } + else if (_reg_ < 9) { MOVD32RtoMMX(mmVI(_reg_), GPRreg); } else { MOV16RtoM((uptr)&mVU->regs->VI[_reg_].UL, GPRreg); } } @@ -773,8 +773,14 @@ microVUt(void) mVUallocVIb(int GPRreg, int _reg_) { //------------------------------------------------------------------ #define getReg5(reg, _reg_, _fxf_) { \ - mVUloadReg(reg, (uptr)&mVU->regs->VF[_reg_].UL[0], (1 << (3 - _fxf_))); \ - if (CHECK_VU_EXTRA_OVERFLOW) mVUclamp2(reg, xmmT1, (1 << (3 - _fxf_))); \ + if (!_reg_) { \ + if (_fxf_ < 3) { SSE_XORPS_XMM_to_XMM(reg, reg); } \ + else { mVUloadReg(reg, (uptr)&mVU->regs->VF[_reg_].UL[0], 3); } \ + } \ + else { \ + mVUloadReg(reg, (uptr)&mVU->regs->VF[_reg_].UL[0], (1 << (3 - _fxf_))); \ + if (CHECK_VU_EXTRA_OVERFLOW) mVUclamp2(reg, xmmT1, (1 << (3 - _fxf_))); \ + } \ } #endif //PCSX2_MICROVU diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 5ff2a4b495..46a41e6d89 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -167,7 +167,6 @@ microVUf(void) mVU_EATAN() { getReg5(xmmFs, _Fs_, _Fsf_); SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance - // ToDo: Can Be Optimized Further? (takes approximately (~125 cycles + mem access time) on a c2d) SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); SSE_SUBSS_M32_to_XMM(xmmFs, (uptr)mVU_one); SSE_ADDSS_M32_to_XMM(xmmPQ, (uptr)mVU_one); @@ -180,8 +179,8 @@ microVUf(void) mVU_EATANxy() { microVU* mVU = mVUx; if (recPass == 0) {} else { - getReg5(xmmFs, _Fs_, 1); - getReg5(xmmFt, _Fs_, 0); + getReg6(xmmFt, _Fs_); + SSE2_PSHUFD_XMM_to_XMM(xmmFs, xmmFt, 0x01); SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); @@ -196,8 +195,8 @@ microVUf(void) mVU_EATANxz() { microVU* mVU = mVUx; if (recPass == 0) {} else { - getReg5(xmmFs, _Fs_, 2); - getReg5(xmmFt, _Fs_, 0); + getReg6(xmmFt, _Fs_); + SSE2_PSHUFD_XMM_to_XMM(xmmFs, xmmFt, 0x02); SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); @@ -208,15 +207,162 @@ microVUf(void) mVU_EATANxz() { mVU_EATAN_(); } } -microVUf(void) mVU_EEXP() {} -microVUf(void) mVU_ELENG() {} +#define eexpHelper(addr) { \ + SSE_MULSS_XMM_to_XMM(xmmT1, xmmFs); \ + SSE_MOVSS_XMM_to_XMM(xmmFt, xmmT1); \ + SSE_MULSS_M32_to_XMM(xmmFt, (uptr)addr); \ + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFt); \ +} +microVUf(void) mVU_EEXP() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg5(xmmFs, _Fs_, _Fsf_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_MULSS_M32_to_XMM(xmmPQ, (uptr)mVU_E1); + SSE_ADDSS_M32_to_XMM(xmmPQ, (uptr)mVU_one); + + SSE_MOVSS_XMM_to_XMM(xmmFt, xmmFs); + SSE_MULSS_XMM_to_XMM(xmmFt, xmmFs); + SSE_MOVSS_XMM_to_XMM(xmmT1, xmmFt); + SSE_MULSS_M32_to_XMM(xmmFt, (uptr)mVU_E2); + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFt); + + eexpHelper(mVU_E3); + eexpHelper(mVU_E4); + eexpHelper(mVU_E5); + + SSE_MULSS_XMM_to_XMM(xmmT1, xmmFs); + SSE_MULSS_M32_to_XMM(xmmT1, (uptr)mVU_E6); + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmT1); + SSE_MULSS_XMM_to_XMM(xmmPQ, xmmPQ); + SSE_MULSS_XMM_to_XMM(xmmPQ, xmmPQ); + SSE_MOVSS_M32_to_XMM(xmmT1, (uptr)mVU_one); + SSE_DIVSS_XMM_to_XMM(xmmT1, xmmPQ); + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmT1); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} +microVUt(void) mVU_sumXYZ() { + // regd.x = x ^ 2 + y ^ 2 + z ^ 2 + if( cpucaps.hasStreamingSIMD4Extensions ) { + SSE4_DPPS_XMM_to_XMM(xmmFs, xmmFs, 0x71); + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + } + else { + SSE_MULPS_XMM_to_XMM(xmmFs, xmmFs); // wzyx ^ 2 + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_SHUFPS_XMM_to_XMM(xmmFs, xmmFs, 0xe1); // wzyx -> wzxy + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); // x ^ 2 + y ^ 2 + SSE_SHUFPS_XMM_to_XMM(xmmFs, xmmFs, 0xD2); // wzxy -> wxyz + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); // x ^ 2 + y ^ 2 + z ^ 2 + } +} +microVUf(void) mVU_ELENG() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg6(xmmFs, _Fs_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + mVU_sumXYZ(); + SSE_SQRTSS_XMM_to_XMM(xmmPQ, xmmPQ); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} microVUf(void) mVU_ERCPR() {} -microVUf(void) mVU_ERLENG() {} -microVUf(void) mVU_ERSADD() {} -microVUf(void) mVU_ERSQRT() {} -microVUf(void) mVU_ESADD() {} -microVUf(void) mVU_ESIN() {} -microVUf(void) mVU_ESQRT() {} +microVUf(void) mVU_ERLENG() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg6(xmmFs, _Fs_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + mVU_sumXYZ(); + SSE_SQRTSS_XMM_to_XMM(xmmPQ, xmmPQ); + SSE_MOVSS_M32_to_XMM(xmmFs, (uptr)mVU_one); + SSE_DIVSS_XMM_to_XMM(xmmFs, xmmPQ); + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} +microVUf(void) mVU_ERSADD() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg6(xmmFs, _Fs_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + mVU_sumXYZ(); + //SSE_RCPSS_XMM_to_XMM(xmmPQ, xmmPQ); // Lower Precision is bad? + SSE_MOVSS_M32_to_XMM(xmmFs, (uptr)mVU_one); + SSE_DIVSS_XMM_to_XMM(xmmFs, xmmPQ); + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} +microVUf(void) mVU_ERSQRT() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg5(xmmFs, _Fs_, _Fsf_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE_SQRTSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_MOVSS_M32_to_XMM(xmmFs, (uptr)mVU_one); + SSE_DIVSS_XMM_to_XMM(xmmFs, xmmPQ); + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} +microVUf(void) mVU_ESADD() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg6(xmmFs, _Fs_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + mVU_sumXYZ(); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} +#define esinHelper(addr) { \ + SSE_MULSS_XMM_to_XMM(xmmT1, xmmFt); \ + SSE_MOVSS_XMM_to_XMM(xmmFs, xmmT1); \ + SSE_MULSS_M32_to_XMM(xmmFs, (uptr)addr); \ + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); \ +} +microVUf(void) mVU_ESIN() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg5(xmmFs, _Fs_, _Fsf_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + //SSE_MULSS_M32_to_XMM(xmmPQ, (uptr)mVU_one); // Multiplying by 1 is redundant? + SSE_MOVSS_XMM_to_XMM(xmmFt, xmmFs); + SSE_MULSS_XMM_to_XMM(xmmFs, xmmFt); + SSE_MOVSS_XMM_to_XMM(xmmT1, xmmFs); + SSE_MULSS_XMM_to_XMM(xmmFs, xmmFt); + SSE_MOVSS_XMM_to_XMM(xmmFt, xmmFs); + SSE_MULSS_M32_to_XMM(xmmFs, (uptr)mVU_S2); + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); + + esinHelper(mVU_S3); + esinHelper(mVU_S4); + + SSE_MULSS_XMM_to_XMM(xmmT1, xmmFt); + SSE_MULSS_M32_to_XMM(xmmT1, (uptr)mVU_S5); + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmT1); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} +microVUf(void) mVU_ESQRT() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg5(xmmFs, _Fs_, _Fsf_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE_SQRTSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} microVUf(void) mVU_ESUM() { microVU* mVU = mVUx; if (recPass == 0) {} @@ -315,8 +461,11 @@ microVUf(void) mVU_IADD() { if (recPass == 0) {} else { mVUallocVIa(gprT1, _Fs_); - mVUallocVIa(gprT2, _Ft_); - ADD16RtoR(gprT1, gprT2); + if (_Ft_ != _Fs_) { + mVUallocVIa(gprT2, _Ft_); + ADD16RtoR(gprT1, gprT2); + } + else ADD16RtoR(gprT1, gprT1); mVUallocVIb(gprT1, _Fd_); } } @@ -343,8 +492,10 @@ microVUf(void) mVU_IAND() { if (recPass == 0) {} else { mVUallocVIa(gprT1, _Fs_); - mVUallocVIa(gprT2, _Ft_); - AND32RtoR(gprT1, gprT2); + if (_Ft_ != _Fs_) { + mVUallocVIa(gprT2, _Ft_); + AND32RtoR(gprT1, gprT2); + } mVUallocVIb(gprT1, _Fd_); } } @@ -353,8 +504,10 @@ microVUf(void) mVU_IOR() { if (recPass == 0) {} else { mVUallocVIa(gprT1, _Fs_); - mVUallocVIa(gprT2, _Ft_); - OR32RtoR(gprT1, gprT2); + if (_Ft_ != _Fs_) { + mVUallocVIa(gprT2, _Ft_); + OR32RtoR(gprT1, gprT2); + } mVUallocVIb(gprT1, _Fd_); } } @@ -362,10 +515,16 @@ microVUf(void) mVU_ISUB() { microVU* mVU = mVUx; if (recPass == 0) {} else { - mVUallocVIa(gprT1, _Fs_); - mVUallocVIa(gprT2, _Ft_); - SUB16RtoR(gprT1, gprT2); - mVUallocVIb(gprT1, _Fd_); + if (_Ft_ != _Fs_) { + mVUallocVIa(gprT1, _Fs_); + mVUallocVIa(gprT2, _Ft_); + SUB16RtoR(gprT1, gprT2); + } + else if (!isMMX(_Fd_)) { + XOR32RtoR(gprT1, gprT1); + mVUallocVIb(gprT1, _Fd_); + } + else { PXORRtoR(mmVI(_Fd_), mmVI(_Fd_)); } } } microVUf(void) mVU_ISUBIU() { diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index b30db341e9..e269ce39f5 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -21,6 +21,7 @@ //------------------------------------------------------------------ // Global Variables //------------------------------------------------------------------ + PCSX2_ALIGNED16_EXTERN(const u32 mVU_absclip[4]); PCSX2_ALIGNED16_EXTERN(const u32 mVU_signbit[4]); PCSX2_ALIGNED16_EXTERN(const u32 mVU_minvals[4]); @@ -40,6 +41,17 @@ PCSX2_ALIGNED16_EXTERN(const u32 mVU_T6[4]); PCSX2_ALIGNED16_EXTERN(const u32 mVU_T7[4]); PCSX2_ALIGNED16_EXTERN(const u32 mVU_T8[4]); PCSX2_ALIGNED16_EXTERN(const u32 mVU_Pi4[4]); +//PCSX2_ALIGNED16_EXTERN(const u32 mVU_S1[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_S2[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_S3[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_S4[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_S5[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E1[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E2[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E3[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E4[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E5[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E6[4]); //------------------------------------------------------------------ // Helper Macros @@ -129,4 +141,7 @@ PCSX2_ALIGNED16_EXTERN(const u32 mVU_Pi4[4]); //#define getFs (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<13)) //#define getFt (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<14)) +#define isMMX(_VIreg_) (_VIreg_ >= 1 && _VIreg_ <=9) +#define mmVI(_VIreg_) (_VIreg_ - 1) + #include "microVU_Misc.inl" diff --git a/pcsx2/x86/microVU_Upper.inl b/pcsx2/x86/microVU_Upper.inl index f0336aa081..651ef92048 100644 --- a/pcsx2/x86/microVU_Upper.inl +++ b/pcsx2/x86/microVU_Upper.inl @@ -84,7 +84,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC1a(Fd, Fs, Ft); \ if (_XYZW_SS) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ @@ -98,7 +97,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC3a(Fd, Fs, Ft); \ if (_XYZW_SS) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ @@ -112,7 +110,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC4a(ACC, Fs, Ft); \ if (_XYZW_SS && _X) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ @@ -126,7 +123,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC5a(ACC, Fs, Ft); \ if (_XYZW_SS && _X) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ @@ -140,7 +136,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC6a(Fd, Fs, Ft); \ if (_XYZW_SS) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ @@ -154,7 +149,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC7a(ACC, Fs, Ft); \ if (_XYZW_SS && _X) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ @@ -168,7 +162,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC8a(Fd, ACC, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -188,7 +181,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC9a(Fd, ACC, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -208,7 +200,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC10a(Fd, ACC, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -228,7 +219,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC11a(Fd, ACC, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -248,7 +238,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC12a(Fd, ACC, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -268,7 +257,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC13a(Fd, ACC, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -288,7 +276,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC14a(ACCw, ACCr, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -308,7 +295,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC15a(ACCw, ACCr, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -328,7 +314,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC16a(ACCw, ACCr, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -348,7 +333,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC17a(ACCw, ACCr, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -368,7 +352,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC18a(ACC, Fs, Ft); \ SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ mVUupdateFlags(Fs, xmmT1, Ft, _X_Y_Z_W, 0); \ @@ -381,7 +364,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC19a(Fd, ACC, Fs, Ft); \ SSE_MULPS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##PS_XMM_to_XMM(ACC, Fs); \ @@ -395,7 +377,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC20a(ACCw, ACCr, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -415,7 +396,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC21a(ACCw, ACCr, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -435,7 +415,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC22a(Fd, Fs, Ft); \ if (_XYZW_SS) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ @@ -449,7 +428,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC23a(ACC, Fs, Ft); \ if (_XYZW_SS && _X) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ @@ -463,7 +441,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC24a(Fd, ACC, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -483,7 +460,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int Fd, ACC, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC25a(Fd, ACC, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -503,7 +479,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC26a(ACCw, ACCr, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -523,7 +498,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ - if (isNOP) return; \ mVUallocFMAC27a(ACCw, ACCr, Fs, Ft); \ if (_XYZW_SS && _X) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ @@ -547,7 +521,6 @@ microVUf(void) mVU_ABS() { if (recPass == 0) {} else { int Fs, Ft; - if (isNOP) return; mVUallocFMAC2a(Fs, Ft); SSE_ANDPS_M128_to_XMM(Fs, (uptr)mVU_absclip); mVUallocFMAC1b(Ft); @@ -647,7 +620,6 @@ microVUq(void) mVU_FTOIx(uptr addr) { if (recPass == 0) {} else { int Fs, Ft; - if (isNOP) return; mVUallocFMAC2a(Fs, Ft); // Note: For help understanding this algorithm see recVUMI_FTOI_Saturate() @@ -673,7 +645,6 @@ microVUq(void) mVU_ITOFx(uptr addr) { if (recPass == 0) {} else { int Fs, Ft; - if (isNOP) return; mVUallocFMAC2a(Fs, Ft); SSE2_CVTDQ2PS_XMM_to_XMM(Ft, Fs); From 3870debc2212b78c4352ede1c4bdbcf164d33767 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Wed, 11 Mar 2009 23:59:51 +0000 Subject: [PATCH 15/77] implemented ERCPR (seems i forgot about it on my last update). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@750 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU_Lower.inl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 46a41e6d89..3a9dc54aed 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -270,7 +270,19 @@ microVUf(void) mVU_ELENG() { SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } -microVUf(void) mVU_ERCPR() {} +microVUf(void) mVU_ERCPR() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + getReg5(xmmFs, _Fs_, _Fsf_); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_MOVSS_M32_to_XMM(xmmFs, (uptr)mVU_one); + SSE_DIVSS_XMM_to_XMM(xmmFs, xmmPQ); + SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); + SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + } +} microVUf(void) mVU_ERLENG() { microVU* mVU = mVUx; if (recPass == 0) {} From b894a7a21792a094b8227b504ad8f29b19057af2 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Thu, 12 Mar 2009 05:32:27 +0000 Subject: [PATCH 16/77] some tweaks based on some optimization tips jake found. the idea is that with SSE, doing operations that don't modify all the vectors can give false-dependencies, and in some situations prevent CPU's out-of-order execution (slows things down). so the solution is to only use stuff like "movss" when you need to preserve the upper 3 vectors, if not, its always better(faster) to use movaps. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@751 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU_Alloc.inl | 8 +- pcsx2/x86/microVU_Lower.inl | 93 +++++++++++++---------- pcsx2/x86/microVU_Misc.inl | 144 +++++++++++++++++++----------------- 3 files changed, 134 insertions(+), 111 deletions(-) diff --git a/pcsx2/x86/microVU_Alloc.inl b/pcsx2/x86/microVU_Alloc.inl index 32b53fbb97..4441c8e3c9 100644 --- a/pcsx2/x86/microVU_Alloc.inl +++ b/pcsx2/x86/microVU_Alloc.inl @@ -520,8 +520,8 @@ microVUt(void) mVUallocFMAC18a(int& ACC, int& Fs, int& Ft) { if (!_Ft_) { getZero4(Ft); } else { getReg4(Ft, _Ft_); } - SSE_SHUFPS_XMM_to_XMM(Fs, Fs, 0xC9); // WXZY - SSE_SHUFPS_XMM_to_XMM(Ft, Ft, 0xD2); // WYXZ + SSE2_PSHUFD_XMM_to_XMM(Fs, Fs, 0xC9); // WXZY + SSE2_PSHUFD_XMM_to_XMM(Ft, Ft, 0xD2); // WYXZ } microVUt(void) mVUallocFMAC18b(int& ACC, int& Fs) { @@ -546,8 +546,8 @@ microVUt(void) mVUallocFMAC19a(int& Fd, int&ACC, int& Fs, int& Ft) { if (!_Ft_) { getZero4(Ft); } else { getReg4(Ft, _Ft_); } - SSE_SHUFPS_XMM_to_XMM(Fs, Fs, 0xC9); // WXZY - SSE_SHUFPS_XMM_to_XMM(Ft, Ft, 0xD2); // WYXZ + SSE2_PSHUFD_XMM_to_XMM(Fs, Fs, 0xC9); // WXZY + SSE2_PSHUFD_XMM_to_XMM(Ft, Ft, 0xD2); // WYXZ } microVUt(void) mVUallocFMAC19b(int& Fd) { diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 3a9dc54aed..c3f3035c64 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -137,7 +137,7 @@ microVUf(void) mVU_RSQRT() { #define EATANhelper(addr) { \ SSE_MULSS_XMM_to_XMM(xmmT1, xmmFs); \ SSE_MULSS_XMM_to_XMM(xmmT1, xmmFs); \ - SSE_MOVSS_XMM_to_XMM(xmmFt, xmmT1); \ + SSE_MOVAPS_XMM_to_XMM(xmmFt, xmmT1); \ SSE_MULSS_M32_to_XMM(xmmFt, (uptr)addr); \ SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFt); \ } @@ -147,7 +147,7 @@ microVUt(void) mVU_EATAN_() { // ToDo: Can Be Optimized Further? (takes approximately (~115 cycles + mem access time) on a c2d) SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); SSE_MULSS_M32_to_XMM(xmmPQ, (uptr)mVU_T1); - SSE_MOVSS_XMM_to_XMM(xmmT1, xmmFs); + SSE_MOVAPS_XMM_to_XMM(xmmT1, xmmFs); EATANhelper(mVU_T2); EATANhelper(mVU_T3); @@ -158,14 +158,14 @@ microVUt(void) mVU_EATAN_() { EATANhelper(mVU_T8); SSE_ADDSS_M32_to_XMM(xmmPQ, (uptr)mVU_Pi4); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); } microVUf(void) mVU_EATAN() { microVU* mVU = mVUx; if (recPass == 0) {} else { getReg5(xmmFs, _Fs_, _Fsf_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); SSE_SUBSS_M32_to_XMM(xmmFs, (uptr)mVU_one); @@ -181,7 +181,7 @@ microVUf(void) mVU_EATANxy() { else { getReg6(xmmFt, _Fs_); SSE2_PSHUFD_XMM_to_XMM(xmmFs, xmmFt, 0x01); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); SSE_SUBSS_M32_to_XMM(xmmFs, (uptr)mVU_one); @@ -197,7 +197,7 @@ microVUf(void) mVU_EATANxz() { else { getReg6(xmmFt, _Fs_); SSE2_PSHUFD_XMM_to_XMM(xmmFs, xmmFt, 0x02); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); SSE_SUBSS_XMM_to_XMM(xmmFs, xmmFt); @@ -209,7 +209,7 @@ microVUf(void) mVU_EATANxz() { } #define eexpHelper(addr) { \ SSE_MULSS_XMM_to_XMM(xmmT1, xmmFs); \ - SSE_MOVSS_XMM_to_XMM(xmmFt, xmmT1); \ + SSE_MOVAPS_XMM_to_XMM(xmmFt, xmmT1); \ SSE_MULSS_M32_to_XMM(xmmFt, (uptr)addr); \ SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFt); \ } @@ -218,14 +218,14 @@ microVUf(void) mVU_EEXP() { if (recPass == 0) {} else { getReg5(xmmFs, _Fs_, _Fsf_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); SSE_MULSS_M32_to_XMM(xmmPQ, (uptr)mVU_E1); SSE_ADDSS_M32_to_XMM(xmmPQ, (uptr)mVU_one); - SSE_MOVSS_XMM_to_XMM(xmmFt, xmmFs); + SSE_MOVAPS_XMM_to_XMM(xmmFt, xmmFs); SSE_MULSS_XMM_to_XMM(xmmFt, xmmFs); - SSE_MOVSS_XMM_to_XMM(xmmT1, xmmFt); + SSE_MOVAPS_XMM_to_XMM(xmmT1, xmmFt); SSE_MULSS_M32_to_XMM(xmmFt, (uptr)mVU_E2); SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFt); @@ -241,7 +241,7 @@ microVUf(void) mVU_EEXP() { SSE_MOVSS_M32_to_XMM(xmmT1, (uptr)mVU_one); SSE_DIVSS_XMM_to_XMM(xmmT1, xmmPQ); SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmT1); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } microVUt(void) mVU_sumXYZ() { @@ -253,9 +253,9 @@ microVUt(void) mVU_sumXYZ() { else { SSE_MULPS_XMM_to_XMM(xmmFs, xmmFs); // wzyx ^ 2 SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); - SSE_SHUFPS_XMM_to_XMM(xmmFs, xmmFs, 0xe1); // wzyx -> wzxy + SSE2_PSHUFD_XMM_to_XMM(xmmFs, xmmFs, 0xe1); // wzyx -> wzxy SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); // x ^ 2 + y ^ 2 - SSE_SHUFPS_XMM_to_XMM(xmmFs, xmmFs, 0xD2); // wzxy -> wxyz + SSE2_PSHUFD_XMM_to_XMM(xmmFs, xmmFs, 0xD2); // wzxy -> wxyz SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); // x ^ 2 + y ^ 2 + z ^ 2 } } @@ -264,10 +264,10 @@ microVUf(void) mVU_ELENG() { if (recPass == 0) {} else { getReg6(xmmFs, _Fs_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance mVU_sumXYZ(); SSE_SQRTSS_XMM_to_XMM(xmmPQ, xmmPQ); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } microVUf(void) mVU_ERCPR() { @@ -275,12 +275,12 @@ microVUf(void) mVU_ERCPR() { if (recPass == 0) {} else { getReg5(xmmFs, _Fs_, _Fsf_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); SSE_MOVSS_M32_to_XMM(xmmFs, (uptr)mVU_one); SSE_DIVSS_XMM_to_XMM(xmmFs, xmmPQ); SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } microVUf(void) mVU_ERLENG() { @@ -288,13 +288,13 @@ microVUf(void) mVU_ERLENG() { if (recPass == 0) {} else { getReg6(xmmFs, _Fs_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance mVU_sumXYZ(); SSE_SQRTSS_XMM_to_XMM(xmmPQ, xmmPQ); SSE_MOVSS_M32_to_XMM(xmmFs, (uptr)mVU_one); SSE_DIVSS_XMM_to_XMM(xmmFs, xmmPQ); SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } microVUf(void) mVU_ERSADD() { @@ -302,13 +302,13 @@ microVUf(void) mVU_ERSADD() { if (recPass == 0) {} else { getReg6(xmmFs, _Fs_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance mVU_sumXYZ(); //SSE_RCPSS_XMM_to_XMM(xmmPQ, xmmPQ); // Lower Precision is bad? SSE_MOVSS_M32_to_XMM(xmmFs, (uptr)mVU_one); SSE_DIVSS_XMM_to_XMM(xmmFs, xmmPQ); SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } microVUf(void) mVU_ERSQRT() { @@ -316,12 +316,12 @@ microVUf(void) mVU_ERSQRT() { if (recPass == 0) {} else { getReg5(xmmFs, _Fs_, _Fsf_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_SQRTSS_XMM_to_XMM(xmmPQ, xmmFs); SSE_MOVSS_M32_to_XMM(xmmFs, (uptr)mVU_one); SSE_DIVSS_XMM_to_XMM(xmmFs, xmmPQ); SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } microVUf(void) mVU_ESADD() { @@ -329,14 +329,14 @@ microVUf(void) mVU_ESADD() { if (recPass == 0) {} else { getReg6(xmmFs, _Fs_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance mVU_sumXYZ(); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } #define esinHelper(addr) { \ SSE_MULSS_XMM_to_XMM(xmmT1, xmmFt); \ - SSE_MOVSS_XMM_to_XMM(xmmFs, xmmT1); \ + SSE_MOVAPS_XMM_to_XMM(xmmFs, xmmT1); \ SSE_MULSS_M32_to_XMM(xmmFs, (uptr)addr); \ SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); \ } @@ -345,14 +345,14 @@ microVUf(void) mVU_ESIN() { if (recPass == 0) {} else { getReg5(xmmFs, _Fs_, _Fsf_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); //SSE_MULSS_M32_to_XMM(xmmPQ, (uptr)mVU_one); // Multiplying by 1 is redundant? - SSE_MOVSS_XMM_to_XMM(xmmFt, xmmFs); + SSE_MOVAPS_XMM_to_XMM(xmmFt, xmmFs); SSE_MULSS_XMM_to_XMM(xmmFs, xmmFt); - SSE_MOVSS_XMM_to_XMM(xmmT1, xmmFs); + SSE_MOVAPS_XMM_to_XMM(xmmT1, xmmFs); SSE_MULSS_XMM_to_XMM(xmmFs, xmmFt); - SSE_MOVSS_XMM_to_XMM(xmmFt, xmmFs); + SSE_MOVAPS_XMM_to_XMM(xmmFt, xmmFs); SSE_MULSS_M32_to_XMM(xmmFs, (uptr)mVU_S2); SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); @@ -362,7 +362,7 @@ microVUf(void) mVU_ESIN() { SSE_MULSS_XMM_to_XMM(xmmT1, xmmFt); SSE_MULSS_M32_to_XMM(xmmT1, (uptr)mVU_S5); SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmT1); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } microVUf(void) mVU_ESQRT() { @@ -370,9 +370,9 @@ microVUf(void) mVU_ESQRT() { if (recPass == 0) {} else { getReg5(xmmFs, _Fs_, _Fsf_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE_SQRTSS_XMM_to_XMM(xmmPQ, xmmFs); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } microVUf(void) mVU_ESUM() { @@ -380,13 +380,13 @@ microVUf(void) mVU_ESUM() { if (recPass == 0) {} else { getReg6(xmmFs, _Fs_); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance SSE2_PSHUFD_XMM_to_XMM(xmmFt, xmmFs, 0x1b); SSE_ADDPS_XMM_to_XMM(xmmFs, xmmFt); SSE2_PSHUFD_XMM_to_XMM(xmmFt, xmmFs, 0x01); SSE_ADDSS_XMM_to_XMM(xmmFs, xmmFt); SSE_MOVSS_XMM_to_XMM(xmmPQ, xmmFs); - SSE_SHUFPS_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back + SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } @@ -605,12 +605,29 @@ microVUf(void) mVU_MR32() { if (recPass == 0) {} else { mVUloadReg(xmmT1, (uptr)&mVU->regs->VF[_Fs_].UL[0], (_X_Y_Z_W == 8) ? 4 : 15); - if (_X_Y_Z_W != 8) { SSE_SHUFPS_XMM_to_XMM(xmmT1, xmmT1, 0x39); } + if (_X_Y_Z_W != 8) { SSE2_PSHUFD_XMM_to_XMM(xmmT1, xmmT1, 0x39); } mVUsaveReg(xmmT1, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); } } - -microVUf(void) mVU_LQ() {} +microVUf(void) mVU_LQ() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (!_Fs_) { + MOV32ItoR(gprT1, _Imm11_); + mVUaddrFix(gprT1); + mVUloadReg(xmmFt, (uptr)mVU->regs->Mem, _X_Y_Z_W); + mVUsaveReg(xmmFt, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); + } + else { + mVUallocVIa(gprT1, _Fs_); + ADD32ItoR(gprT1, _Imm11_); + mVUaddrFix(gprT1); + mVUloadReg2(xmmFt, gprT1, (uptr)mVU->regs->Mem, _X_Y_Z_W); + mVUsaveReg(xmmFt, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); + } + } +} microVUf(void) mVU_LQD() {} microVUf(void) mVU_LQI() {} microVUf(void) mVU_SQ() {} diff --git a/pcsx2/x86/microVU_Misc.inl b/pcsx2/x86/microVU_Misc.inl index 3b1fe47866..6674a2d46d 100644 --- a/pcsx2/x86/microVU_Misc.inl +++ b/pcsx2/x86/microVU_Misc.inl @@ -73,82 +73,68 @@ microVUx(void) mVUunpack_xyzw(int dstreg, int srcreg, int xyzw) { } } -microVUx(void) mVUloadReg(int reg, u32 offset, int xyzw) { +microVUx(void) mVUloadReg(int reg, uptr offset, int xyzw) { switch( xyzw ) { case 8: SSE_MOVSS_M32_to_XMM(reg, offset); break; // X case 4: SSE_MOVSS_M32_to_XMM(reg, offset+4); break; // Y case 2: SSE_MOVSS_M32_to_XMM(reg, offset+8); break; // Z case 1: SSE_MOVSS_M32_to_XMM(reg, offset+12); break; // W - //case 3: SSE_MOVHPS_M64_to_XMM(reg, offset+8); break; // ZW (not sure if this is faster than default) - //case 12: SSE_MOVLPS_M64_to_XMM(reg, offset); break; // XY (not sure if this is faster than default) default: SSE_MOVAPS_M128_to_XMM(reg, offset); break; } } +microVUx(void) mVUloadReg2(int reg, int gprReg, uptr offset, int xyzw) { + switch( xyzw ) { + case 8: SSE_MOVSS_RmOffset_to_XMM(reg, gprReg, offset); break; // X + case 4: SSE_MOVSS_RmOffset_to_XMM(reg, gprReg, offset+4); break; // Y + case 2: SSE_MOVSS_RmOffset_to_XMM(reg, gprReg, offset+8); break; // Z + case 1: SSE_MOVSS_RmOffset_to_XMM(reg, gprReg, offset+12); break; // W + default: SSE_MOVAPSRmtoROffset(reg, gprReg, offset); break; + } +} + microVUx(void) mVUsaveReg(int reg, u32 offset, int xyzw) { switch ( xyzw ) { - case 1: // W - SSE_MOVSS_XMM_to_M32(offset+12, reg); - break; - case 2: // Z - SSE_MOVSS_XMM_to_M32(offset+8, reg); - break; - case 3: // ZW - SSE_MOVHPS_XMM_to_M64(offset+8, reg); - break; - case 4: // Y - SSE_MOVSS_XMM_to_M32(offset+4, reg); - break; - case 5: // YW - SSE_SHUFPS_XMM_to_XMM(reg, reg, 0xB1); - SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); - SSE_MOVSS_XMM_to_M32(offset+4, reg); - SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); - break; - case 6: // YZ - SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0xc9); - SSE_MOVLPS_XMM_to_M64(offset+4, xmmT1); - break; - case 7: // YZW - SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x93); //ZYXW - SSE_MOVHPS_XMM_to_M64(offset+4, xmmT1); - SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); - break; - case 8: // X - SSE_MOVSS_XMM_to_M32(offset, reg); - break; - case 9: // XW - SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); - SSE_MOVSS_XMM_to_M32(offset, reg); - if ( cpucaps.hasStreamingSIMD3Extensions ) SSE3_MOVSLDUP_XMM_to_XMM(xmmT1, xmmT1); - else SSE_SHUFPS_XMM_to_XMM(xmmT1, xmmT1, 0x55); - SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); - break; - case 10: //XZ - SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); - SSE_MOVSS_XMM_to_M32(offset, reg); - SSE_MOVSS_XMM_to_M32(offset+8, xmmT1); - break; - case 11: //XZW - SSE_MOVSS_XMM_to_M32(offset, reg); - SSE_MOVHPS_XMM_to_M64(offset+8, reg); - break; - case 12: // XY - SSE_MOVLPS_XMM_to_M64(offset, reg); - break; - case 13: // XYW - SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x4b); //YXZW - SSE_MOVHPS_XMM_to_M64(offset, xmmT1); - SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); - break; - case 14: // XYZ - SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); - SSE_MOVLPS_XMM_to_M64(offset, reg); - SSE_MOVSS_XMM_to_M32(offset+8, xmmT1); - break; - case 15: // XYZW - SSE_MOVAPS_XMM_to_M128(offset, reg); - break; + case 5: SSE2_PSHUFD_XMM_to_XMM(reg, reg, 0xB1); + SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVSS_XMM_to_M32(offset+4, reg); + SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); + break; // YW + case 6: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0xc9); + SSE_MOVLPS_XMM_to_M64(offset+4, xmmT1); + break; // YZ + case 7: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x93); //ZYXW + SSE_MOVHPS_XMM_to_M64(offset+4, xmmT1); + SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); + break; // YZW + case 9: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVSS_XMM_to_M32(offset, reg); + if ( cpucaps.hasStreamingSIMD3Extensions ) SSE3_MOVSLDUP_XMM_to_XMM(xmmT1, xmmT1); + else SSE2_PSHUFD_XMM_to_XMM(xmmT1, xmmT1, 0x55); + SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); + break; // XW + case 10: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVSS_XMM_to_M32(offset, reg); + SSE_MOVSS_XMM_to_M32(offset+8, xmmT1); + break; //XZ + case 11: SSE_MOVSS_XMM_to_M32(offset, reg); + SSE_MOVHPS_XMM_to_M64(offset+8, reg); + break; //XZW + case 13: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x4b); //YXZW + SSE_MOVHPS_XMM_to_M64(offset, xmmT1); + SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); + break; // XYW + case 14: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVLPS_XMM_to_M64(offset, reg); + SSE_MOVSS_XMM_to_M32(offset+8, xmmT1); + break; // XYZ + case 8: SSE_MOVSS_XMM_to_M32(offset, reg); break; // X + case 4: SSE_MOVSS_XMM_to_M32(offset+4, reg); break; // Y + case 2: SSE_MOVSS_XMM_to_M32(offset+8, reg); break; // Z + case 1: SSE_MOVSS_XMM_to_M32(offset+12, reg); break; // W + case 12: SSE_MOVLPS_XMM_to_M64(offset, reg); break; // XY + case 3: SSE_MOVHPS_XMM_to_M64(offset+8, reg); break; // ZW + default: SSE_MOVAPS_XMM_to_M128(offset, reg); break; // XYZW } } @@ -174,10 +160,10 @@ microVUx(void) mVUmergeRegs(int dest, int src, int xyzw) { SSE2_MOVSD_XMM_to_XMM(dest, src); break; case 5: SSE_SHUFPS_XMM_to_XMM(dest, src, 0xd8); - SSE_SHUFPS_XMM_to_XMM(dest, dest, 0xd8); + SSE2_PSHUFD_XMM_to_XMM(dest, dest, 0xd8); break; case 6: SSE_SHUFPS_XMM_to_XMM(dest, src, 0x9c); - SSE_SHUFPS_XMM_to_XMM(dest, dest, 0x78); + SSE2_PSHUFD_XMM_to_XMM(dest, dest, 0x78); break; case 7: SSE_MOVSS_XMM_to_XMM(src, dest); SSE_MOVAPS_XMM_to_XMM(dest, src); @@ -185,10 +171,10 @@ microVUx(void) mVUmergeRegs(int dest, int src, int xyzw) { case 8: SSE_MOVSS_XMM_to_XMM(dest, src); break; case 9: SSE_SHUFPS_XMM_to_XMM(dest, src, 0xc9); - SSE_SHUFPS_XMM_to_XMM(dest, dest, 0xd2); + SSE2_PSHUFD_XMM_to_XMM(dest, dest, 0xd2); break; case 10: SSE_SHUFPS_XMM_to_XMM(dest, src, 0x8d); - SSE_SHUFPS_XMM_to_XMM(dest, dest, 0x72); + SSE2_PSHUFD_XMM_to_XMM(dest, dest, 0x72); break; case 11: SSE_MOVSS_XMM_to_XMM(dest, src); SSE_SHUFPS_XMM_to_XMM(dest, src, 0xe4); @@ -210,4 +196,24 @@ microVUx(void) mVUmergeRegs(int dest, int src, int xyzw) { } } +// Transforms the Address in gprReg to valid VU0/VU1 Address +microVUt(void) mVUaddrFix(int gprReg) { + if ( vuIndex == 1 ) { + AND32ItoR(EAX, 0x3ff); // wrap around + SHL32ItoR(EAX, 4); + } + else { + u8 *jmpA, *jmpB; + CMP32ItoR(EAX, 0x400); + jmpA = JL8(0); // if addr >= 0x4000, reads VU1's VF regs and VI regs + AND32ItoR(EAX, 0x43f); + jmpB = JMP8(0); + x86SetJ8(jmpA); + AND32ItoR(EAX, 0xff); // if addr < 0x4000, wrap around + x86SetJ8(jmpB); + + SHL32ItoR(EAX, 4); // multiply by 16 (shift left by 4) + } +} + #endif //PCSX2_MICROVU From b82d9a65418a0c21f619e213b7bd4ca6962a0e67 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 12 Mar 2009 12:44:22 +0000 Subject: [PATCH 17/77] Fixed a bug that caused pcsx2 to crash when loading/saving savestates using the "other..." menu option. Added new command line options for running pcsx2 without a gui. Using "pcsx2 [filename]" where filename is the name of a cd image, will run the game. use "pcsx2 -nogui" to boot whatever you have configured in your CDVD. Use -bootmode=1 to enable the quick boot method (same as RunCD) .. default boots through the BIOS. [untested feature! please report if it's broken] git-svn-id: http://pcsx2.googlecode.com/svn/trunk@752 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/HostGui.h | 42 ++++++++++--------- pcsx2/Saveslots.cpp | 15 ++++--- pcsx2/System.cpp | 5 +-- pcsx2/windows/WinMain.cpp | 78 +++++++++++++++--------------------- pcsx2/windows/WinSysExec.cpp | 58 +++++++++------------------ 5 files changed, 83 insertions(+), 115 deletions(-) diff --git a/pcsx2/HostGui.h b/pcsx2/HostGui.h index e191d87dce..3620d36cd8 100644 --- a/pcsx2/HostGui.h +++ b/pcsx2/HostGui.h @@ -19,28 +19,34 @@ #pragma once ////////////////////////////////////////////////////////////////////////////////////////// -// TestRun Parameters. +// Startup Parameters. -struct TESTRUNARGS +enum StartupMode { - u8 enabled; - u8 jpgcapture; - - uint frame; // if == 0, frame is unlimited (run until crash). - int numimages; - int curimage; - u32 autopad; // mask for auto buttons - bool efile; - int snapdone; - - const char* ptitle; - const char* pimagename; - const char* plogname; - const char* pgsdll, *pcdvddll, *pspudll; - const char* ppad1dll, *ppad2dll, *pdev9dll; + BootMode_Bios, + BootMode_Quick, + BootMode_Elf }; -extern TESTRUNARGS g_TestRun; +class StartupParams +{ +public: + // Name of the CDVD or ELF image to load. + // if NULL, the CDVD configured settings are used. + const char* ImageName; + + bool NoGui; + bool Enabled; + StartupMode BootMode; + + // Plugin overrides + const char* gsdll, *cdvddll, *spudll; + const char* pad1dll, *pad2dll, *dev9dll; + + StartupParams() { memzero_obj(*this); } +}; + +extern StartupParams g_Startup; ////////////////////////////////////////////////////////////////////////////////////////// // Core Gui APIs (shared by all platforms) diff --git a/pcsx2/Saveslots.cpp b/pcsx2/Saveslots.cpp index 001f864f08..379256f0e6 100644 --- a/pcsx2/Saveslots.cpp +++ b/pcsx2/Saveslots.cpp @@ -22,8 +22,7 @@ #include "GS.h" -TESTRUNARGS g_TestRun; - +StartupParams g_Startup; ////////////////////////////////////////////////////////////////////////////////////////// // Save Slot Detection System @@ -63,11 +62,11 @@ void States_Load( const string& file ) try { _loadStateOrExcept( file ); - HostGui::Notice( fmt_string(_("*PCSX2*: Loaded State %s"), file) ); + HostGui::Notice( fmt_string(_("*PCSX2*: Loaded State %hs"), &file) ); } catch( Exception::StateLoadError_Recoverable& ex) { - Console::Notice( "Could not load savestate file: %s.\n\n%s", params file, ex.cMessage() ); + Console::Notice( "Could not load savestate file: %hs.\n\n%s", params &file, ex.cMessage() ); // At this point the cpu hasn't been reset, so we can return // control to the user safely... (that's why we use a console notice instead of a popup) @@ -79,7 +78,7 @@ void States_Load( const string& file ) // The emulation state is ruined. Might as well give them a popup and start the gui. string message( fmt_string( - "Encountered an error while loading savestate from file: %s.\n", file ) ); + "Encountered an error while loading savestate from file: %hs.\n", &file ) ); if( g_EmulationInProgress ) message += "Since the savestate load was incomplete, the emulator must reset.\n"; @@ -145,12 +144,12 @@ void States_Save( const string& file ) try { StateRecovery::SaveToFile( file ); - HostGui::Notice( fmt_string( _( "State saved to file: %s" ), file ) ); + HostGui::Notice( fmt_string( _( "State saved to file: %hs" ), &file ) ); } catch( Exception::BaseException& ex ) { Console::Error( (fmt_string( - "An error occurred while trying to save to file %s\n", file ) + + "An error occurred while trying to save to file %hs\n", &file ) + "Your emulation state has not been saved!\n\nError: " + ex.Message()).c_str() ); } @@ -180,7 +179,7 @@ void States_Save(int num) // void vSyncDebugStuff( uint frame ) { -#ifdef PCSX2_DEVBUILD +#ifdef OLD_TESTBUILD_STUFF if( g_TestRun.enabled && g_TestRun.frame > 0 ) { if( frame > g_TestRun.frame ) { // take a snapshot diff --git a/pcsx2/System.cpp b/pcsx2/System.cpp index a043907ea1..0a45fb4fe6 100644 --- a/pcsx2/System.cpp +++ b/pcsx2/System.cpp @@ -391,7 +391,7 @@ void SysPrepareExecution( const char* elf_file, bool use_bios ) return; } - if (OpenPlugins(g_TestRun.ptitle) == -1) + if (OpenPlugins(NULL) == -1) return; if( elf_file == NULL ) @@ -401,9 +401,6 @@ void SysPrepareExecution( const char* elf_file, bool use_bios ) // Not recovering a state, so need to execute the bios and load the ELF information. // (note: gsRecoveries are done from ExecuteCpu) - // if the elf_file is null we use the CDVD elf file. - // But if the elf_file is an empty string then we boot the bios instead. - char ename[g_MaxPath]; ename[0] = 0; if( !use_bios ) diff --git a/pcsx2/windows/WinMain.cpp b/pcsx2/windows/WinMain.cpp index d5e01a0c9b..dc0d9b6fbc 100644 --- a/pcsx2/windows/WinMain.cpp +++ b/pcsx2/windows/WinMain.cpp @@ -55,36 +55,26 @@ void strcatz(char *dst, char *src) strcpy(dst + len, src); } + //2002-09-20 (Florin) BOOL APIENTRY CmdlineProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);//forward def //------------------- static const char* phelpmsg = - "pcsx2 [options] [file]\n\n" - "-cfg [file] {configuration file}\n" - "-efile [efile] {0 - reset, 1 - runcd (default), 2 - loadelf}\n" - "-help {display this help file}\n" - "-nogui {Don't use gui when launching}\n" - "-loadgs [file] {Loads a gsstate}\n" + "pcsx2 [options] [cdimage/elf file]\n\n" + "\t-cfg [file] {configuration file}\n" + "\t-bootmode [mode] {0 - quick (default), 1 - bios, 2 - load elf}\n" + "\t-nogui {disables display of the gui - skips right to opening the GS window}" + "\t-help {display this help file}\n" + "\t-loadgs [file] {Loads a gsstate}\n\n" + "Run without GUI Options:\n" "\n" -#ifdef PCSX2_DEVBUILD - "Testing Options: \n" - "\t-frame [frame] {game will run up to this frame before exiting}\n" - "\t-image [name] {path and base name of image (do not include the .ext)}\n" - "\t-jpg {save images to jpg format}\n" - "\t-log [name] {log path to save log file in}\n" - "\t-logopt [hex] {log options in hex (see debug.h) }\n" - "\t-numimages [num] {after hitting frame, this many images will be captures every 20 frames}\n" - "\t-test {Triggers testing mode (only for dev builds)}\n" - "\n" -#endif - "Plugin Overrides (specified dlls will be used in place of configured dlls):\n" "\t-cdvd [dllpath] {specifies an override for the CDVD plugin}\n" "\t-gs [dllpath] {specifies an override for the GS plugin}\n" "\t-spu [dllpath] {specifies an override for the SPU2 plugin}\n" - "\t-pads [dllpath] {specifies an override for *both* pad plugins}\n" + "\t-pad [dllpath] {specifies an override for *both* pad plugins}\n" "\t-pad1 [dllpath] {specifies an override for the PAD1 plugin only}\n" "\t-pad2 [dllpath] {specifies an override for the PAD2 plugin only}\n" "\t-dev9 [dllpath] {specifies an override for the DEV9 plugin}\n" @@ -189,21 +179,6 @@ void WinClose() BOOL SysLoggedSetLockPagesPrivilege ( HANDLE hProcess, BOOL bEnable); -// Returns TRUE if the test run mode was activated (game was run and has been exited) -static bool TestRunMode() -{ - if( IsDevBuild && (g_TestRun.enabled || g_TestRun.ptitle != NULL) ) - { - // run without ui - UseGui = false; - PCSX2_MEM_PROTECT_BEGIN(); - SysPrepareExecution( g_TestRun.efile ? g_TestRun.ptitle : NULL ); - PCSX2_MEM_PROTECT_END(); - return true; - } - return false; -} - static void _doPluginOverride( const char* name, const char* src, char (&dest)[g_MaxPath] ) { if( src == NULL || src[0] == 0 ) return; @@ -219,12 +194,12 @@ void WinRun() memcpy( &winConfig, &Config, sizeof( PcsxConfig ) ); - _doPluginOverride( "GS", g_TestRun.pgsdll, Config.GS ); - _doPluginOverride( "CDVD", g_TestRun.pcdvddll, Config.CDVD ); - _doPluginOverride( "SPU2", g_TestRun.pspudll, Config.SPU2 ); - _doPluginOverride( "PAD1", g_TestRun.ppad1dll, Config.PAD1 ); - _doPluginOverride( "PAD2", g_TestRun.ppad2dll, Config.PAD2 ); - _doPluginOverride( "DEV9", g_TestRun.pdev9dll, Config.DEV9 ); + _doPluginOverride( "GS", g_Startup.gsdll, Config.GS ); + _doPluginOverride( "CDVD", g_Startup.cdvddll, Config.CDVD ); + _doPluginOverride( "SPU2", g_Startup.spudll, Config.SPU2 ); + _doPluginOverride( "PAD1", g_Startup.pad1dll, Config.PAD1 ); + _doPluginOverride( "PAD2", g_Startup.pad2dll, Config.PAD2 ); + _doPluginOverride( "DEV9", g_Startup.dev9dll, Config.DEV9 ); #ifndef _DEBUG @@ -239,8 +214,6 @@ void WinRun() if (Pcsx2Configure(NULL) == FALSE) return; } - if( TestRunMode() ) return; - #ifdef PCSX2_DEVBUILD if( g_pRunGSState ) { LoadGSState(g_pRunGSState); @@ -294,8 +267,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine textdomain(PACKAGE); #endif - memzero_obj(g_TestRun); - _getcwd( g_WorkingFolder, g_MaxPath ); int argc; @@ -303,7 +274,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if( argv == NULL ) { - Msgbox::Alert( "A fatal error occured while attempting to parse the command line.\n" ); + Msgbox::Alert( "A fatal error occurred while attempting to parse the command line.\n" ); return 2; } @@ -396,6 +367,23 @@ void RunGui() LoadPatch( str_Default ); + if( g_Startup.NoGui || g_Startup.Enabled ) + { + // Initially bypass GUI and start PCSX2 directly. + // Manually load plugins using the user's configured image (if non-elf). + + if( g_Startup.Enabled && (g_Startup.BootMode != BootMode_Elf) ) + { + if (OpenPlugins(g_Startup.ImageName) == -1) + return; + } + + SysPrepareExecution( + (g_Startup.BootMode == BootMode_Elf) ? g_Startup.ImageName : NULL, + (g_Startup.BootMode == BootMode_Bios) + ); + } + do { CreateMainWindow(); diff --git a/pcsx2/windows/WinSysExec.cpp b/pcsx2/windows/WinSysExec.cpp index 7d8c627c41..7ecf2862b8 100644 --- a/pcsx2/windows/WinSysExec.cpp +++ b/pcsx2/windows/WinSysExec.cpp @@ -67,7 +67,7 @@ int SysPageFaultExceptionFilter( EXCEPTION_POINTERS* eps ) int ParseCommandLine( int tokenCount, TCHAR *const *const tokens ) { int tidx = 0; - g_TestRun.efile = 0; + g_Startup.BootMode = BootMode_Bios; while( tidx < tokenCount ) { @@ -75,8 +75,8 @@ int ParseCommandLine( int tokenCount, TCHAR *const *const tokens ) if( command[0] != '-' ) { - g_TestRun.ptitle = command; - printf("opening file %s\n", command); + g_Startup.ImageName = command; + g_Startup.Enabled = true; continue; } @@ -89,16 +89,11 @@ int ParseCommandLine( int tokenCount, TCHAR *const *const tokens ) return -1; } else if( CmdSwitchIs( "nogui" ) ) { - UseGui = false; + g_Startup.NoGui = true; } else if( CmdSwitchIs( "highpriority" ) ) { SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); } -#ifdef PCSX2_DEVBUILD - else if( CmdSwitchIs( "jpg" ) ) { - g_TestRun.jpgcapture = 1; - } -#endif else { const TCHAR* param; @@ -112,9 +107,9 @@ int ParseCommandLine( int tokenCount, TCHAR *const *const tokens ) if( CmdSwitchIs( "cfg" ) ) { g_CustomConfigFile = param; } - - else if( CmdSwitchIs( "efile" ) ) { - g_TestRun.efile = !!atoi( param ); + else if( CmdSwitchIs( "bootmode" ) ) { + g_Startup.BootMode = (StartupMode)atoi( param ); + g_Startup.Enabled = true; } else if( CmdSwitchIs( "loadgs" ) ) { g_pRunGSState = param; @@ -123,46 +118,28 @@ int ParseCommandLine( int tokenCount, TCHAR *const *const tokens ) // Options to configure plugins: else if( CmdSwitchIs( "gs" ) ) { - g_TestRun.pgsdll = param; + g_Startup.gsdll = param; } else if( CmdSwitchIs( "cdvd" ) ) { - g_TestRun.pcdvddll = param; + g_Startup.cdvddll = param; } else if( CmdSwitchIs( "spu" ) ) { - g_TestRun.pspudll = param; + g_Startup.spudll = param; } - else if( CmdSwitchIs( "pads" ) ) { - g_TestRun.ppad1dll = param; - g_TestRun.ppad2dll = param; + else if( CmdSwitchIs( "pad" ) ) { + g_Startup.pad1dll = param; + g_Startup.pad2dll = param; } else if( CmdSwitchIs( "pad1" ) ) { - g_TestRun.ppad1dll = param; + g_Startup.pad1dll = param; } else if( CmdSwitchIs( "pad2" ) ) { - g_TestRun.ppad2dll = param; + g_Startup.pad2dll = param; } else if( CmdSwitchIs( "dev9" ) ) { - g_TestRun.pdev9dll = param; + g_Startup.dev9dll = param; } -#ifdef PCSX2_DEVBUILD - else if( CmdSwitchIs( "image" ) ) { - g_TestRun.pimagename = param; - } - else if( CmdSwitchIs( "log" ) ) { - g_TestRun.plogname = param; - } - else if( CmdSwitchIs( "logopt" ) ) { - if( param[0] == '0' && param[1] == 'x' ) param += 2; - sscanf(param, "%x", &varLog); - } - else if( CmdSwitchIs( "frame" ) ) { - g_TestRun.frame = atoi( param ); - } - else if( CmdSwitchIs( "numimages" ) ) { - g_TestRun.numimages = atoi( param ); - } -#endif } } return 0; @@ -259,9 +236,10 @@ bool HostGuiInit() NTFS_CompressFile( MEMCARDS_DIR, Config.McdEnableNTFS ); +#ifdef OLD_TESTBUILD_STUFF if( IsDevBuild && emuLog == NULL && g_TestRun.plogname != NULL ) emuLog = fopen(g_TestRun.plogname, "w"); - +#endif if( emuLog == NULL ) emuLog = fopen(LOGS_DIR "\\emuLog.txt","w"); From 13c56743c10a7d1bf78c101d29e609645dfeccb1 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Thu, 12 Mar 2009 14:46:42 +0000 Subject: [PATCH 18/77] microVU recs: fixed a bug in LQ, and implemented LQI and LQD. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@754 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU.cpp | 61 ++++++++++++++++++------------------- pcsx2/x86/microVU_Lower.inl | 57 ++++++++++++++++++++++++++++------ pcsx2/x86/microVU_Misc.h | 61 +++++++++++++++++++------------------ pcsx2/x86/microVU_Misc.inl | 7 ++--- 4 files changed, 111 insertions(+), 75 deletions(-) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index 3171b7e2a4..cc28ab22a9 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -29,37 +29,36 @@ PCSX2_ALIGNED16(microVU microVU0); PCSX2_ALIGNED16(microVU microVU1); -PCSX2_ALIGNED16(const u32 mVU_absclip[4]) = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}; -PCSX2_ALIGNED16(const u32 mVU_signbit[4]) = {0x80000000, 0x80000000, 0x80000000, 0x80000000}; -PCSX2_ALIGNED16(const u32 mVU_minvals[4]) = {0xff7fffff, 0xff7fffff, 0xff7fffff, 0xff7fffff}; -PCSX2_ALIGNED16(const u32 mVU_maxvals[4]) = {0x7f7fffff, 0x7f7fffff, 0x7f7fffff, 0x7f7fffff}; -PCSX2_ALIGNED16(const u32 mVU_one[4]) = {0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000}; -PCSX2_ALIGNED16(const u32 mVU_T1[4]) = {0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5}; -PCSX2_ALIGNED16(const u32 mVU_T2[4]) = {0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c}; -PCSX2_ALIGNED16(const u32 mVU_T3[4]) = {0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6}; -PCSX2_ALIGNED16(const u32 mVU_T4[4]) = {0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63}; -PCSX2_ALIGNED16(const u32 mVU_T5[4]) = {0x3dc577df, 0x3dc577df, 0x3dc577df, 0x3dc577df}; -PCSX2_ALIGNED16(const u32 mVU_T6[4]) = {0xbd6501c4, 0xbd6501c4, 0xbd6501c4, 0xbd6501c4}; -PCSX2_ALIGNED16(const u32 mVU_T7[4]) = {0x3cb31652, 0x3cb31652, 0x3cb31652, 0x3cb31652}; -PCSX2_ALIGNED16(const u32 mVU_T8[4]) = {0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7}; -PCSX2_ALIGNED16(const u32 mVU_Pi4[4]) = {0x3f490fdb, 0x3f490fdb, 0x3f490fdb, 0x3f490fdb}; -//PCSX2_ALIGNED16(const u32 mVU_S1[4]) = {0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000}; -PCSX2_ALIGNED16(const u32 mVU_S2[4]) = {0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4}; -PCSX2_ALIGNED16(const u32 mVU_S3[4]) = {0x3c08873e, 0x3c08873e, 0x3c08873e, 0x3c08873e}; -PCSX2_ALIGNED16(const u32 mVU_S4[4]) = {0xb94fb21f, 0xb94fb21f, 0xb94fb21f, 0xb94fb21f}; -PCSX2_ALIGNED16(const u32 mVU_S5[4]) = {0x362e9c14, 0x362e9c14, 0x362e9c14, 0x362e9c14}; -PCSX2_ALIGNED16(const u32 mVU_E1[4]) = {0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8}; -PCSX2_ALIGNED16(const u32 mVU_E2[4]) = {0x3d0007f4, 0x3d0007f4, 0x3d0007f4, 0x3d0007f4}; -PCSX2_ALIGNED16(const u32 mVU_E3[4]) = {0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff}; -PCSX2_ALIGNED16(const u32 mVU_E4[4]) = {0x3933e553, 0x3933e553, 0x3933e553, 0x3933e553}; -PCSX2_ALIGNED16(const u32 mVU_E5[4]) = {0x36b63510, 0x36b63510, 0x36b63510, 0x36b63510}; -PCSX2_ALIGNED16(const u32 mVU_E6[4]) = {0x353961ac, 0x353961ac, 0x353961ac, 0x353961ac}; -PCSX2_ALIGNED16(const float mVU_FTOI_4[4]) = {16.0, 16.0, 16.0, 16.0}; -PCSX2_ALIGNED16(const float mVU_FTOI_12[4]) = {4096.0, 4096.0, 4096.0, 4096.0}; -PCSX2_ALIGNED16(const float mVU_FTOI_15[4]) = {32768.0, 32768.0, 32768.0, 32768.0}; -PCSX2_ALIGNED16(const float mVU_ITOF_4[4]) = {0.0625f, 0.0625f, 0.0625f, 0.0625f}; -PCSX2_ALIGNED16(const float mVU_ITOF_12[4]) = {0.000244140625, 0.000244140625, 0.000244140625, 0.000244140625}; -PCSX2_ALIGNED16(const float mVU_ITOF_15[4]) = {0.000030517578125, 0.000030517578125, 0.000030517578125, 0.000030517578125}; +PCSX2_ALIGNED16(u32 mVU_absclip[4]) = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}; +PCSX2_ALIGNED16(u32 mVU_signbit[4]) = {0x80000000, 0x80000000, 0x80000000, 0x80000000}; +PCSX2_ALIGNED16(u32 mVU_minvals[4]) = {0xff7fffff, 0xff7fffff, 0xff7fffff, 0xff7fffff}; +PCSX2_ALIGNED16(u32 mVU_maxvals[4]) = {0x7f7fffff, 0x7f7fffff, 0x7f7fffff, 0x7f7fffff}; +PCSX2_ALIGNED16(u32 mVU_one[4]) = {0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000}; +PCSX2_ALIGNED16(u32 mVU_T1[4]) = {0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5}; +PCSX2_ALIGNED16(u32 mVU_T2[4]) = {0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c}; +PCSX2_ALIGNED16(u32 mVU_T3[4]) = {0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6}; +PCSX2_ALIGNED16(u32 mVU_T4[4]) = {0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63}; +PCSX2_ALIGNED16(u32 mVU_T5[4]) = {0x3dc577df, 0x3dc577df, 0x3dc577df, 0x3dc577df}; +PCSX2_ALIGNED16(u32 mVU_T6[4]) = {0xbd6501c4, 0xbd6501c4, 0xbd6501c4, 0xbd6501c4}; +PCSX2_ALIGNED16(u32 mVU_T7[4]) = {0x3cb31652, 0x3cb31652, 0x3cb31652, 0x3cb31652}; +PCSX2_ALIGNED16(u32 mVU_T8[4]) = {0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7}; +PCSX2_ALIGNED16(u32 mVU_Pi4[4]) = {0x3f490fdb, 0x3f490fdb, 0x3f490fdb, 0x3f490fdb}; +PCSX2_ALIGNED16(u32 mVU_S2[4]) = {0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4}; +PCSX2_ALIGNED16(u32 mVU_S3[4]) = {0x3c08873e, 0x3c08873e, 0x3c08873e, 0x3c08873e}; +PCSX2_ALIGNED16(u32 mVU_S4[4]) = {0xb94fb21f, 0xb94fb21f, 0xb94fb21f, 0xb94fb21f}; +PCSX2_ALIGNED16(u32 mVU_S5[4]) = {0x362e9c14, 0x362e9c14, 0x362e9c14, 0x362e9c14}; +PCSX2_ALIGNED16(u32 mVU_E1[4]) = {0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8}; +PCSX2_ALIGNED16(u32 mVU_E2[4]) = {0x3d0007f4, 0x3d0007f4, 0x3d0007f4, 0x3d0007f4}; +PCSX2_ALIGNED16(u32 mVU_E3[4]) = {0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff}; +PCSX2_ALIGNED16(u32 mVU_E4[4]) = {0x3933e553, 0x3933e553, 0x3933e553, 0x3933e553}; +PCSX2_ALIGNED16(u32 mVU_E5[4]) = {0x36b63510, 0x36b63510, 0x36b63510, 0x36b63510}; +PCSX2_ALIGNED16(u32 mVU_E6[4]) = {0x353961ac, 0x353961ac, 0x353961ac, 0x353961ac}; +PCSX2_ALIGNED16(float mVU_FTOI_4[4]) = {16.0, 16.0, 16.0, 16.0}; +PCSX2_ALIGNED16(float mVU_FTOI_12[4]) = {4096.0, 4096.0, 4096.0, 4096.0}; +PCSX2_ALIGNED16(float mVU_FTOI_15[4]) = {32768.0, 32768.0, 32768.0, 32768.0}; +PCSX2_ALIGNED16(float mVU_ITOF_4[4]) = {0.0625f, 0.0625f, 0.0625f, 0.0625f}; +PCSX2_ALIGNED16(float mVU_ITOF_12[4]) = {0.000244140625, 0.000244140625, 0.000244140625, 0.000244140625}; +PCSX2_ALIGNED16(float mVU_ITOF_15[4]) = {0.000030517578125, 0.000030517578125, 0.000030517578125, 0.000030517578125}; //------------------------------------------------------------------ // Micro VU - Main Functions diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index c3f3035c64..76fc48ba0e 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -567,7 +567,7 @@ microVUf(void) mVU_ISWR() {} microVUf(void) mVU_MOVE() { microVU* mVU = mVUx; - if (recPass == 0) {} + if (recPass == 0) { /*If (!_Ft_ || (_Ft_ == _Fs_)) nop();*/ } else { mVUloadReg(xmmT1, (uptr)&mVU->regs->VF[_Fs_].UL[0], _X_Y_Z_W); mVUsaveReg(xmmT1, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); @@ -575,7 +575,7 @@ microVUf(void) mVU_MOVE() { } microVUf(void) mVU_MFIR() { microVU* mVU = mVUx; - if (recPass == 0) {} + if (recPass == 0) { /*If (!_Ft_) nop();*/ } else { mVUallocVIa(gprT1, _Fs_); MOVSX32R16toR(gprT1, gprT1); @@ -586,7 +586,7 @@ microVUf(void) mVU_MFIR() { } microVUf(void) mVU_MFP() { microVU* mVU = mVUx; - if (recPass == 0) {} + if (recPass == 0) { /*If (!_Ft_) nop();*/ } else { getPreg(xmmFt); mVUsaveReg(xmmFt, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); @@ -602,7 +602,7 @@ microVUf(void) mVU_MTIR() { } microVUf(void) mVU_MR32() { microVU* mVU = mVUx; - if (recPass == 0) {} + if (recPass == 0) { /*If (!_Ft_) nop();*/ } else { mVUloadReg(xmmT1, (uptr)&mVU->regs->VF[_Fs_].UL[0], (_X_Y_Z_W == 8) ? 4 : 15); if (_X_Y_Z_W != 8) { SSE2_PSHUFD_XMM_to_XMM(xmmT1, xmmT1, 0x39); } @@ -611,12 +611,10 @@ microVUf(void) mVU_MR32() { } microVUf(void) mVU_LQ() { microVU* mVU = mVUx; - if (recPass == 0) {} + if (recPass == 0) { /*If (!_Ft_) nop();*/ } else { if (!_Fs_) { - MOV32ItoR(gprT1, _Imm11_); - mVUaddrFix(gprT1); - mVUloadReg(xmmFt, (uptr)mVU->regs->Mem, _X_Y_Z_W); + mVUloadReg(xmmFt, (uptr)mVU->regs->Mem + getVUmem(_Imm11_), _X_Y_Z_W); mVUsaveReg(xmmFt, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); } else { @@ -628,8 +626,47 @@ microVUf(void) mVU_LQ() { } } } -microVUf(void) mVU_LQD() {} -microVUf(void) mVU_LQI() {} +microVUf(void) mVU_LQD() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (!_Fs_ && _Ft_) { + mVUloadReg(xmmFt, (uptr)mVU->regs->Mem, _X_Y_Z_W); + mVUsaveReg(xmmFt, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); + } + else { + mVUallocVIa(gprT1, _Fs_); + SUB16ItoR(gprT1, 1); + mVUallocVIb(gprT1, _Fs_); // ToDo: Backup to memory check. + if (_Ft_) { + mVUaddrFix(gprT1); + mVUloadReg2(xmmFt, gprT1, (uptr)mVU->regs->Mem, _X_Y_Z_W); + mVUsaveReg(xmmFt, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); + } + } + } +} +microVUf(void) mVU_LQI() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (!_Fs_ && _Ft_) { + mVUloadReg(xmmFt, (uptr)mVU->regs->Mem, _X_Y_Z_W); + mVUsaveReg(xmmFt, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); + } + else { + mVUallocVIa((_Ft_) ? gprT1 : gprT2, _Fs_); + if (_Ft_) { + MOV32RtoR(gprT2, gprT1); + mVUaddrFix(gprT1); + mVUloadReg2(xmmFt, gprT1, (uptr)mVU->regs->Mem, _X_Y_Z_W); + mVUsaveReg(xmmFt, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); + } + ADD16ItoR(gprT2, 1); + mVUallocVIb(gprT2, _Fs_); // ToDo: Backup to memory check. + } + } +} microVUf(void) mVU_SQ() {} microVUf(void) mVU_SQD() {} microVUf(void) mVU_SQI() {} diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index e269ce39f5..d8412016eb 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -22,36 +22,35 @@ // Global Variables //------------------------------------------------------------------ -PCSX2_ALIGNED16_EXTERN(const u32 mVU_absclip[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_signbit[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_minvals[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_maxvals[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_FTOI_4[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_FTOI_12[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_FTOI_15[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_4[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_12[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T1[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T2[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T3[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T4[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T5[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T6[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T7[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T8[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_Pi4[4]); -//PCSX2_ALIGNED16_EXTERN(const u32 mVU_S1[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_S2[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_S3[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_S4[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_S5[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E1[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E2[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E3[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E4[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E5[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E6[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_absclip[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_signbit[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_minvals[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_maxvals[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_T1[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_T2[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_T3[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_T4[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_T5[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_T6[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_T7[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_T8[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_Pi4[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_S2[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_S3[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_S4[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_S5[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_E1[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_E2[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_E3[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_E4[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_E5[4]); +PCSX2_ALIGNED16_EXTERN(u32 mVU_E6[4]); +PCSX2_ALIGNED16_EXTERN(float mVU_FTOI_4[4]); +PCSX2_ALIGNED16_EXTERN(float mVU_FTOI_12[4]); +PCSX2_ALIGNED16_EXTERN(float mVU_FTOI_15[4]); +PCSX2_ALIGNED16_EXTERN(float mVU_ITOF_4[4]); +PCSX2_ALIGNED16_EXTERN(float mVU_ITOF_12[4]); +PCSX2_ALIGNED16_EXTERN(float mVU_ITOF_15[4]); //------------------------------------------------------------------ // Helper Macros @@ -85,6 +84,8 @@ PCSX2_ALIGNED16_EXTERN(const u32 mVU_E6[4]); #define _Imm5_ (((mVU->code & 0x400) ? 0xfff0 : 0) | ((mVU->code >> 6) & 0xf)) #define _Imm15_ (((mVU->code >> 10) & 0x7800) | (mVU->code & 0x7ff)) +#define getVUmem(x) (((vuIndex == 1) ? (x & 0x3ff) : ((x >= 0x400) ? (x & 0x43f) : (x & 0xff))) * 16) + #define xmmT1 0 // Temp Reg #define xmmFs 1 // Holds the Value of Fs (writes back result Fd) #define xmmFt 2 // Holds the Value of Ft diff --git a/pcsx2/x86/microVU_Misc.inl b/pcsx2/x86/microVU_Misc.inl index 6674a2d46d..174ebe4fd2 100644 --- a/pcsx2/x86/microVU_Misc.inl +++ b/pcsx2/x86/microVU_Misc.inl @@ -206,12 +206,11 @@ microVUt(void) mVUaddrFix(int gprReg) { u8 *jmpA, *jmpB; CMP32ItoR(EAX, 0x400); jmpA = JL8(0); // if addr >= 0x4000, reads VU1's VF regs and VI regs - AND32ItoR(EAX, 0x43f); - jmpB = JMP8(0); + AND32ItoR(EAX, 0x43f); + jmpB = JMP8(0); x86SetJ8(jmpA); - AND32ItoR(EAX, 0xff); // if addr < 0x4000, wrap around + AND32ItoR(EAX, 0xff); // if addr < 0x4000, wrap around x86SetJ8(jmpB); - SHL32ItoR(EAX, 4); // multiply by 16 (shift left by 4) } } From 378a84658cc365d9975eb77dbc985bbe8571d740 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Thu, 12 Mar 2009 23:37:50 +0000 Subject: [PATCH 19/77] Linux: Bring in sync with recent changes. (as usual) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@756 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Linux/Linux.h | 2 +- pcsx2/Linux/LnxConsole.cpp | 4 +- pcsx2/Linux/LnxMain.cpp | 25 ++++----- pcsx2/Linux/LnxSysExec.cpp | 105 ++++++++++++++++--------------------- 4 files changed, 59 insertions(+), 77 deletions(-) diff --git a/pcsx2/Linux/Linux.h b/pcsx2/Linux/Linux.h index af627516d8..3db9330c95 100644 --- a/pcsx2/Linux/Linux.h +++ b/pcsx2/Linux/Linux.h @@ -22,6 +22,7 @@ #include "PrecompiledHeader.h" #include "Paths.h" #include "Common.h" +#include "HostGui.h" //For CpuDlg #include "Counters.h" @@ -53,7 +54,6 @@ extern "C" extern void SaveConfig(); extern int LoadConfig(); extern void SysRestorableReset(); -extern bool UseGui; extern int Pcsx2Configure(); diff --git a/pcsx2/Linux/LnxConsole.cpp b/pcsx2/Linux/LnxConsole.cpp index 076caa864d..c399b9ec4b 100644 --- a/pcsx2/Linux/LnxConsole.cpp +++ b/pcsx2/Linux/LnxConsole.cpp @@ -94,7 +94,7 @@ bool Alert(const char* fmt) { GtkWidget *dialog; - if (!UseGui) + if (g_Startup.NoGui) { Console::Error(fmt); return false; @@ -126,7 +126,7 @@ bool Alert(const char* fmt, VARG_PARAM dummy, ...) if (msg[msg.length()-1] == '\n') msg[msg.length()-1] = 0; - if (!UseGui) + if (g_Startup.NoGui) { Console::Error(msg.c_str()); return false; diff --git a/pcsx2/Linux/LnxMain.cpp b/pcsx2/Linux/LnxMain.cpp index b195743e45..4f764cfac7 100644 --- a/pcsx2/Linux/LnxMain.cpp +++ b/pcsx2/Linux/LnxMain.cpp @@ -59,16 +59,11 @@ int main(int argc, char *argv[]) #endif #ifdef PCSX2_DEVBUILD - memset(&g_TestRun, 0, sizeof(g_TestRun)); + memset(&g_Startup, 0, sizeof(g_Startup)); #endif if (!ParseCommandLine(argc, argv, file)) return 0; -#ifdef PCSX2_DEVBUILD - g_TestRun.efile = efile; - g_TestRun.ptitle = file; -#endif - // make gtk thread safe if using MTGS if (CHECK_MULTIGS) { @@ -76,7 +71,7 @@ int main(int argc, char *argv[]) gdk_threads_init(); } - if (UseGui) + if (!g_Startup.NoGui) { gtk_init(NULL, NULL); } @@ -133,7 +128,7 @@ int main(int argc, char *argv[]) } #endif - if (UseGui && (file == NULL)) + if (!g_Startup.NoGui && (file == NULL)) { StartGui(); return 0; @@ -315,7 +310,7 @@ gboolean OnDelete(GtkWidget *widget, GdkEvent *event, gpointer user_data) int Pcsx2Configure() { - if (!UseGui) return 0; + if (g_Startup.NoGui) return 0; MainWindow = NULL; OnConf_Conf(NULL, 0); @@ -397,17 +392,17 @@ void pcsx2_exit() printf("PCSX2 Quitting\n"); - if (UseGui) + if (g_Startup.NoGui) + { + SysClose(); + exit(0); + } + else { gtk_main_quit(); SysClose(); gtk_exit(0); } - else - { - SysClose(); - exit(0); - } } void SignalExit(int sig) diff --git a/pcsx2/Linux/LnxSysExec.cpp b/pcsx2/Linux/LnxSysExec.cpp index 6bd70d48df..0080dff9bc 100644 --- a/pcsx2/Linux/LnxSysExec.cpp +++ b/pcsx2/Linux/LnxSysExec.cpp @@ -20,8 +20,6 @@ #include "LnxSysExec.h" #include "HostGui.h" -bool UseGui = true; - static bool sinit = false; GtkWidget *FileSel; @@ -68,6 +66,7 @@ void SysPageFaultExceptionFilter( int signal, siginfo_t *info, void * ) bool ParseCommandLine(int argc, char *argv[], char *file) { int i = 1; + g_Startup.BootMode = BootMode_Bios; while (i < argc) { @@ -78,84 +77,50 @@ bool ParseCommandLine(int argc, char *argv[], char *file) //Msgbox::Alert( phelpmsg ); return false; } - else if (stricmp(token, "-efile") == 0) - { - token = argv[i++]; - if (token != NULL) - { - efile = atoi(token); - } - } else if (stricmp(token, "-nogui") == 0) { - UseGui = FALSE; + g_Startup.NoGui = FALSE; } else if (stricmp(token, "-loadgs") == 0) { g_pRunGSState = argv[i++]; - } -#ifdef PCSX2_DEVBUILD - else if (stricmp(token, "-image") == 0) - { - g_TestRun.pimagename = argv[i++]; - } - else if (stricmp(token, "-log") == 0) - { - g_TestRun.plogname = argv[i++]; - } - else if (stricmp(token, "-logopt") == 0) + } + else if( strcmp(token, "-bootmode" ) == 0) { token = argv[i++]; - if (token != NULL) - { - if (token[0] == '0' && token[1] == 'x') token += 2; - sscanf(token, "%x", &varLog); - } - } - else if (stricmp(token, "-frame") == 0) - { - token = argv[i++]; - if (token != NULL) - { - g_TestRun.frame = atoi(token); - } - } - else if (stricmp(token, "-numimages") == 0) - { - token = argv[i++]; - if (token != NULL) - { - g_TestRun.numimages = atoi(token); - } - } - else if (stricmp(token, "-jpg") == 0) - { - g_TestRun.jpgcapture = 1; + g_Startup.BootMode = (StartupMode)atoi( token); + g_Startup.Enabled = true; } else if (stricmp(token, "-gs") == 0) { token = argv[i++]; - g_TestRun.pgsdll = token; + g_Startup.gsdll = token; } else if (stricmp(token, "-cdvd") == 0) { token = argv[i++]; - g_TestRun.pcdvddll = token; + g_Startup.cdvddll = token; } else if (stricmp(token, "-spu") == 0) { token = argv[i++]; - g_TestRun.pspudll = token; + g_Startup.spudll = token; } - else if (stricmp(token, "-test") == 0) - { - g_TestRun.enabled = 1; - } -#endif else if (stricmp(token, "-pad") == 0) { token = argv[i++]; - printf("-pad ignored\n"); + g_Startup.pad1dll = token; + g_Startup.pad2dll = token; + } + else if (stricmp(token, "-pad1") == 0) + { + token = argv[i++]; + g_Startup.pad1dll = token; + } + else if (stricmp(token, "-pad2") == 0) + { + token = argv[i++]; + g_Startup.pad2dll = token; } else if (stricmp(token, "-loadgs") == 0) { @@ -183,9 +148,33 @@ void SysPrintf(const char *fmt, ...) Console::Write(msg); } +static std::string str_Default( "default" ); + void RunGui() { + PCSX2_MEM_PROTECT_BEGIN(); + + LoadPatch( str_Default ); + if( g_Startup.NoGui || g_Startup.Enabled ) + { + // Initially bypass GUI and start PCSX2 directly. + // Manually load plugins using the user's configured image (if non-elf). + + if( g_Startup.Enabled && (g_Startup.BootMode != BootMode_Elf) ) + { + if (OpenPlugins(g_Startup.ImageName) == -1) + return; + } + + SysPrepareExecution( + (g_Startup.BootMode == BootMode_Elf) ? g_Startup.ImageName : NULL, + (g_Startup.BootMode == BootMode_Bios) + ); + } + StartGui(); + + PCSX2_MEM_PROTECT_END(); } void OnStates_Load(GtkMenuItem *menuitem, gpointer user_data) @@ -319,8 +308,6 @@ bool SysInit() mkdir(LOGS_DIR, 0755); #ifdef PCSX2_DEVBUILD - if (g_TestRun.plogname != NULL) - emuLog = fopen(g_TestRun.plogname, "w"); if (emuLog == NULL) emuLog = fopen(LOGS_DIR "/emuLog.txt", "wb"); #endif @@ -525,7 +512,7 @@ namespace HostGui #endif SysEndExecution(); - if (!UseGui) exit(0); + if (g_Startup.NoGui) exit(0); // fixme: The GUI is now capable of receiving control back from the // emulator. Which means that when we call SysEscapeExecute() here, the From 12cd3f8b6c7f3ab0f7c7ca36f8ce407dbb331092 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 13 Mar 2009 01:05:43 +0000 Subject: [PATCH 20/77] Linux: Fix Final Fantasy XII. (memcmp_mmx appeared to be freezing MMX and not thawing it, and it didn't freeze it in Windows.) Comment out some unused code. Remove some code I commented earlier. And consolidate some of the calls to FreezeXMMRegs/FreezeMMXRegs. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@757 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/FiFo.cpp | 6 ++-- pcsx2/Gif.cpp | 27 ++++++----------- pcsx2/IopDma.cpp | 2 +- pcsx2/MTGS.cpp | 18 ++++-------- pcsx2/Misc.cpp | 4 +-- pcsx2/Misc.h | 2 ++ pcsx2/VifDma.cpp | 15 +++------- pcsx2/x86/fast_routines.S | 10 +++---- pcsx2/x86/iVif.cpp | 52 +-------------------------------- pcsx2/x86/ix86-32/iR5900-32.cpp | 7 +++-- pcsx2/x86/ix86/ix86_tools.cpp | 18 ++++++++---- 11 files changed, 50 insertions(+), 111 deletions(-) diff --git a/pcsx2/FiFo.cpp b/pcsx2/FiFo.cpp index 006682c34b..952c6766d7 100644 --- a/pcsx2/FiFo.cpp +++ b/pcsx2/FiFo.cpp @@ -184,11 +184,9 @@ void __fastcall WriteFIFO_page_6(u32 mem, const mem128_t *value) } else { - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); GSGIFTRANSFER3((u32*)value, 1); - FreezeMMXRegs(0); - FreezeXMMRegs(0); + FreezeRegs(0); } } diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index a7c3011cc1..bdcbace6d7 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -220,14 +220,12 @@ void GIFdma() // When MTGS is enabled, Gifchain calls WRITERING_DMA, which calls GSRINGBUF_DONECOPY, which freezes // the registers inside of the FreezeXMMRegs calls here and in the other two below.. // I'm not really sure that is intentional. --arcum42 - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); GIFchain(); - FreezeXMMRegs(0); // Theres a comment below that says not to unfreeze the xmm regs, so not sure about this. - FreezeMMXRegs(0); + FreezeRegs(0); // Theres a comment below that says not to unfreeze the xmm regs, so not sure about this. if((gspath3done == 1 || (gif->chcr & 0xc) == 0) && gif->qwc == 0){ - if(gif->qwc > 0) SysPrintf("Horray\n"); + if(gif->qwc > 0) SysPrintf("Hurray\n"); gspath3done = 0; gif->chcr &= ~0x100; //psHu32(GIF_MODE)&= ~0x4; @@ -248,11 +246,9 @@ void GIFdma() if ((psHu32(DMAC_CTRL) & 0xC0) == 0x80 && (gif->chcr & 0xc) == 0) { SysPrintf("DMA Stall Control on GIF normal\n"); } - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); GIFchain(); //Transfers the data set by the switch - FreezeXMMRegs(0); - FreezeMMXRegs(0); + FreezeRegs(0); if(gif->qwc == 0 && (gif->chcr & 0xc) == 0) gspath3done = 1; return; } @@ -298,12 +294,9 @@ void GIFdma() return; } } - - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); GIFchain(); //Transfers the data set by the switch - FreezeXMMRegs(0); - FreezeMMXRegs(0); + FreezeRegs(0); if ((gif->chcr & 0x80) && ptag[0] >> 31) { //Check TIE bit of CHCR and IRQ bit of tag GIF_LOG("dmaIrq Set\n"); @@ -534,15 +527,13 @@ void mfifoGIFtransfer(int qwc) { gifmfifoirq = 1; } } - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); if (mfifoGIFchain() == -1) { SysPrintf("GIF dmaChain error size=%d, madr=%lx, tadr=%lx\n", gif->qwc, gif->madr, gif->tadr); gifstate = GIF_STATE_STALL; } - FreezeXMMRegs(0); - FreezeMMXRegs(0); + FreezeRegs(0); if(gif->qwc == 0 && gifstate == GIF_STATE_DONE) gifstate = GIF_STATE_STALL; CPU_INT(11,mfifocycles); diff --git a/pcsx2/IopDma.cpp b/pcsx2/IopDma.cpp index 53995dfb1d..b698616e13 100644 --- a/pcsx2/IopDma.cpp +++ b/pcsx2/IopDma.cpp @@ -153,7 +153,7 @@ void psxDma10(u32 madr, u32 bcr, u32 chcr) { psHu32(0x1000F240) &= ~0x40; psHu32(0x1000F240) &= ~0x100; psHu32(0x1000F240) &= ~0x4000; - FreezeXMMRegs(0); + FreezeXMMRegs(0) } } diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 159163c9d8..485ba722d7 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -677,16 +677,14 @@ int mtgsThreadObject::Callback() void mtgsThreadObject::WaitGS() { // Freeze registers because some kernel code likes to destroy them - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); SetEvent(); while( volatize(m_RingPos) != volatize(m_WritePos) ) { Timeslice(); //SpinWait(); } - FreezeXMMRegs(0); - FreezeMMXRegs(0); + FreezeRegs(0); } // Sets the gsEvent flag and releases a timeslice. @@ -701,8 +699,7 @@ void mtgsThreadObject::SetEvent() void mtgsThreadObject::PrepEventWait() { // Freeze registers because some kernel code likes to destroy them - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); //Console::Notice( "MTGS Stall! EE waits for nothing! ... except your GPU sometimes." ); SetEvent(); Timeslice(); @@ -710,8 +707,7 @@ void mtgsThreadObject::PrepEventWait() void mtgsThreadObject::PostEventWait() const { - FreezeMMXRegs(0); - FreezeXMMRegs(0); + FreezeRegs(0); } u8* mtgsThreadObject::GetDataPacketPtr() const @@ -770,12 +766,10 @@ void mtgsThreadObject::SendDataPacket() m_CopyDataTally += m_packet_size; if( ( m_CopyDataTally > 0x8000 ) || ( ++m_CopyCommandTally > 16 ) ) { - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); //Console::Status( "MTGS Kick! DataSize : 0x%5.8x, CommandTally : %d", m_CopyDataTally, m_CopyCommandTally ); SetEvent(); - FreezeMMXRegs(0); - FreezeXMMRegs(0); + FreezeRegs(0); } } diff --git a/pcsx2/Misc.cpp b/pcsx2/Misc.cpp index 9848fb330c..801b015fae 100644 --- a/pcsx2/Misc.cpp +++ b/pcsx2/Misc.cpp @@ -721,7 +721,7 @@ void ProcessFKeys(int fkey, int shift) } } -void injectIRX(const char *filename) +/*void injectIRX(const char *filename) { char name[260], *p, *q; struct romdir *rd; @@ -785,7 +785,7 @@ void injectIRX(const char *filename) memcpy(rd[i].fileName, name, strlen(name)); rd[i].fileSize=filesize; rd[i].extInfoSize=0; -} +}*/ void _memset16_unaligned( void* dest, u16 data, size_t size ) diff --git a/pcsx2/Misc.h b/pcsx2/Misc.h index d464639b0c..1bfb0e22e7 100644 --- a/pcsx2/Misc.h +++ b/pcsx2/Misc.h @@ -69,9 +69,11 @@ extern bool g_EEFreezeRegs; #ifndef __INTEL_COMPILER extern "C" void FreezeXMMRegs_(int save); extern "C" void FreezeMMXRegs_(int save); +extern "C" void FreezeRegs(int save); #else extern void FreezeXMMRegs_(int save); extern void FreezeMMXRegs_(int save); +extern void FreezeRegs(int save); #endif // these macros check to see if needs freezing diff --git a/pcsx2/VifDma.cpp b/pcsx2/VifDma.cpp index 06079f6a98..4bf5ff8b2a 100644 --- a/pcsx2/VifDma.cpp +++ b/pcsx2/VifDma.cpp @@ -1534,11 +1534,9 @@ static int __fastcall Vif1TransDirectHL(u32 *data){ } else { - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); GSGIFTRANSFER2((u32*)splittransfer[0], 1); - FreezeMMXRegs(0); - FreezeXMMRegs(0); + FreezeRegs(0); } if(vif1.tag.size == 0) vif1.cmd = 0; @@ -1576,12 +1574,9 @@ static int __fastcall Vif1TransDirectHL(u32 *data){ mtgsThread->SendDataPacket(); } else { - - FreezeXMMRegs(1); - FreezeMMXRegs(1); + FreezeRegs(1); GSGIFTRANSFER2(data, (ret >> 2)); - FreezeMMXRegs(0); - FreezeXMMRegs(0); + FreezeRegs(0); } return ret; @@ -2128,9 +2123,7 @@ void dmaVIF1() vif1ch->madr += vif1ch->qwc * 16; // mgs3 scene changes vif1ch->qwc = 0; CPU_INT(1, g_vifCycles); - } - vif1.done = 1; return; } diff --git a/pcsx2/x86/fast_routines.S b/pcsx2/x86/fast_routines.S index c38669d08b..08cb90068a 100644 --- a/pcsx2/x86/fast_routines.S +++ b/pcsx2/x86/fast_routines.S @@ -44,11 +44,11 @@ memcmp_mmx: // make sure mmx regs are stored // FreezeMMXRegs(1); - cmp dword ptr [g_EEFreezeRegs], 0 - je memcmp_mmx_begin - push 1 - call FreezeMMXRegs_ - add esp, 4 + //cmp dword ptr [g_EEFreezeRegs], 0 + //je memcmp_mmx_begin + //push 1 + //call FreezeMMXRegs_ + //add esp, 4 memcmp_mmx_begin: push esi diff --git a/pcsx2/x86/iVif.cpp b/pcsx2/x86/iVif.cpp index f6e4fcfeac..64d63a99f9 100644 --- a/pcsx2/x86/iVif.cpp +++ b/pcsx2/x86/iVif.cpp @@ -29,11 +29,6 @@ extern u32 g_vif1Masks[48], g_vif0Masks[48]; extern u32 g_vif1HasMask3[4], g_vif0HasMask3[4]; -//static const u32 writearr[4] = { 0xffffffff, 0, 0, 0 }; -//static const u32 rowarr[4] = { 0, 0xffffffff, 0, 0 }; -//static const u32 colarr[4] = { 0, 0, 0xffffffff, 0 }; -//static const u32 updatearr[4] = {0xffffffff, 0xffffffff, 0xffffffff, 0 }; - // arranged in writearr, rowarr, colarr, updatearr static PCSX2_ALIGNED16(u32 s_maskarr[16][4]) = { 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, @@ -58,8 +53,6 @@ extern u8 s_maskwrite[256]; extern "C" PCSX2_ALIGNED16(u32 s_TempDecompress[4]) = {0}; -//#if defined(_MSC_VER) - void __fastcall SetNewMask(u32* vif1masks, u32* hasmask, u32 mask, u32 oldmask) { u32 i; @@ -67,7 +60,7 @@ void __fastcall SetNewMask(u32* vif1masks, u32* hasmask, u32 mask, u32 oldmask) FreezeXMMRegs(1); for(i = 0; i < 4; ++i, mask >>= 8, oldmask >>= 8, vif1masks += 16) { - prev |= s_maskwrite[mask&0xff];//((mask&3)==3)||((mask&0xc)==0xc)||((mask&0x30)==0x30)||((mask&0xc0)==0xc0); + prev |= s_maskwrite[mask&0xff]; hasmask[i] = prev; if( (mask&0xff) != (oldmask&0xff) ) { @@ -93,46 +86,3 @@ void __fastcall SetNewMask(u32* vif1masks, u32* hasmask, u32 mask, u32 oldmask) } FreezeXMMRegs(0); } - - -/*#else // gcc -// Is this really supposed to be assembly for gcc and C for Windows? -void __fastcall SetNewMask(u32* vif1masks, u32* hasmask, u32 mask, u32 oldmask) -{ - u32 i; - u32 prev = 0; - FreezeXMMRegs(1); - - for(i = 0; i < 4; ++i, mask >>= 8, oldmask >>= 8, vif1masks += 16) { - - prev |= s_maskwrite[mask&0xff];//((mask&3)==3)||((mask&0xc)==0xc)||((mask&0x30)==0x30)||((mask&0xc0)==0xc0); - hasmask[i] = prev; - - if( (mask&0xff) != (oldmask&0xff) ) { - u8* p0 = (u8*)&s_maskarr[mask&15][0]; - u8* p1 = (u8*)&s_maskarr[(mask>>4)&15][0]; - - __asm__(".intel_syntax noprefix\n" - "movaps xmm0, [%0]\n" - "movaps xmm1, [%1]\n" - "movaps xmm2, xmm0\n" - "punpcklwd xmm0, xmm0\n" - "punpckhwd xmm2, xmm2\n" - "movaps xmm3, xmm1\n" - "punpcklwd xmm1, xmm1\n" - "punpckhwd xmm3, xmm3\n" - "movq [%2], xmm0\n" - "movq [%2+8], xmm1\n" - "movhps [%2+16], xmm0\n" - "movhps [%2+24], xmm1\n" - "movq [%2+32], xmm2\n" - "movq [%2+40], xmm3\n" - "movhps [%2+48], xmm2\n" - "movhps [%2+56], xmm3\n" - ".att_syntax\n" : : "r"(p0), "r"(p1), "r"(vif1masks) ); - } - } - FreezeXMMRegs(0); -} - -#endif*/ diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 95931a0061..504bb507b2 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -613,9 +613,12 @@ void recStep( void ) { static __forceinline bool recEventTest() { #ifdef PCSX2_DEVBUILD - // dont' remove this check unless doing an official release - if( g_globalXMMSaved || g_globalMMXSaved) + // dont' remove this check unless doing an official release + if( g_globalXMMSaved || g_globalMMXSaved) + { DevCon::Error("Pcsx2 Foopah! Frozen regs have not been restored!!!"); + DevCon::Error("g_globalXMMSaved = %d,g_globalMMXSaved = %d",params g_globalXMMSaved, g_globalMMXSaved); + } assert( !g_globalXMMSaved && !g_globalMMXSaved); #endif diff --git a/pcsx2/x86/ix86/ix86_tools.cpp b/pcsx2/x86/ix86/ix86_tools.cpp index f2c5bde936..1ea1f9eaa9 100644 --- a/pcsx2/x86/ix86/ix86_tools.cpp +++ b/pcsx2/x86/ix86/ix86_tools.cpp @@ -72,15 +72,23 @@ void SetCPUState(u32 sseMXCSR, u32 sseVUMXCSR) extern "C" { #endif + +__forceinline void FreezeRegs(int save) +{ + FreezeXMMRegs(save); + FreezeMMXRegs(save); +} + __forceinline void FreezeMMXRegs_(int save) { + //DevCon::Notice("FreezeMMXRegs_(%d); [%d]\n", save, g_globalMMXSaved); assert( g_EEFreezeRegs ); if( save ) { g_globalMMXSaved++; if( g_globalMMXSaved>1 ) { - //SysPrintf("MMX Already Saved!\n"); + //DevCon::Notice("MMX Already Saved!\n"); return; } @@ -117,7 +125,7 @@ __forceinline void FreezeMMXRegs_(int save) else { if( g_globalMMXSaved==0 ) { - //SysPrintf("MMX Not Saved!\n"); + //DevCon::Notice("MMX Not Saved!\n"); return; } g_globalMMXSaved--; @@ -159,14 +167,14 @@ __forceinline void FreezeMMXRegs_(int save) // XMM Register Freezing __forceinline void FreezeXMMRegs_(int save) { - //SysPrintf("FreezeXMMRegs_(%d); [%d]\n", save, g_globalXMMSaved); + //DevCon::Notice("FreezeXMMRegs_(%d); [%d]\n", save, g_globalXMMSaved); assert( g_EEFreezeRegs ); if( save ) { g_globalXMMSaved++; if( g_globalXMMSaved > 1 ){ - //SysPrintf("XMM Already saved\n"); + //DevCon::Notice("XMM Already saved\n"); return; } @@ -204,7 +212,7 @@ __forceinline void FreezeXMMRegs_(int save) { if( g_globalXMMSaved==0 ) { - //SysPrintf("XMM Regs not saved!\n"); + //DevCon::Notice("XMM Regs not saved!\n"); return; } From 93529360a2b292c17d085fc0186fcd98cd679707 Mon Sep 17 00:00:00 2001 From: mattmenke Date: Fri, 13 Mar 2009 01:17:52 +0000 Subject: [PATCH 21/77] Should warn when can't write to config files. Getting sick of repeated posts by the unwashed masses about this (Though also find it bizarre that Vista chooses to not allow an app to write to its own subdirectories). Also, included VC 2005 project now builds successfully as long as you have an svnrev.h. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@758 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/LilyPad/Config.cpp | 22 +++++++++++++++------- plugins/LilyPad/DirectInput.cpp | 5 ++++- plugins/LilyPad/LilyPad.cpp | 4 ---- plugins/LilyPad/LilyPad.rc | 10 +++++----- plugins/LilyPad/LilyPad_VC2005.vcproj | 4 +++- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index 7c08d2097d..c4fcd6bfcc 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -609,10 +609,12 @@ int SaveSettings(wchar_t *file=0) { } DeleteFileW(file); - WritePrivateProfileStringW(L"General Settings", L"Last Config Path", config.lastSaveConfigPath, ini); + WritePrivateProfileStringW(L"General Settings", L"Last Config Path", config.lastSaveConfigPath, ini); WritePrivateProfileStringW(L"General Settings", L"Last Config Name", config.lastSaveConfigFileName, ini); - WritePrivateProfileInt(L"General Settings", L"Force Cursor Hide", config.forceHide, file); + // Just check first, last, and all pad bindings. Should be more than enough. No real need to check + // config path. + int noError = WritePrivateProfileInt(L"General Settings", L"Force Cursor Hide", config.forceHide, file); WritePrivateProfileInt(L"General Settings", L"Close Hacks", config.closeHacks, file); WritePrivateProfileInt(L"General Settings", L"Background", config.background, file); @@ -640,7 +642,7 @@ int SaveSettings(wchar_t *file=0) { WritePrivateProfileInt(L"Pad1", L"Guitar", config.guitar[0], file); WritePrivateProfileInt(L"Pad2", L"Guitar", config.guitar[1], file); WritePrivateProfileInt(L"Pad1", L"Auto Analog", config.AutoAnalog[0], file); - WritePrivateProfileInt(L"Pad2", L"Auto Analog", config.AutoAnalog[1], file); + noError &= WritePrivateProfileInt(L"Pad2", L"Auto Analog", config.AutoAnalog[1], file); for (int i=0; inumDevices; i++) { wchar_t id[50]; @@ -668,7 +670,7 @@ int SaveSettings(wchar_t *file=0) { VirtualControl *c = &dev->virtualControls[b->controlIndex]; wsprintfW(temp, L"Binding %i", bindingCount++); wsprintfW(temp2, L"0x%08X, %i, %i, %i, %i", c->uid, pad, b->command, b->sensitivity, b->turbo); - WritePrivateProfileStringW(id, temp, temp2, file); + noError &= WritePrivateProfileStringW(id, temp, temp2, file); } } bindingCount = 0; @@ -683,11 +685,14 @@ int SaveSettings(wchar_t *file=0) { AxisEffectInfo *info = b->axes + k; wsprintfW(wcschr(temp2,0), L", %i, %i", axis->id, info->force); } - WritePrivateProfileStringW(id, temp, temp2, file); + noError &= WritePrivateProfileStringW(id, temp, temp2, file); } } } - return 0; + if (!noError) { + MessageBoxA(hWndProp, "Unable to save settings. Make sure the disk is not full or write protected, the file isn't write protected, and that the app has permissions to write to the directory. On Vista, try running in administrator mode.", "Error Writing Configuration File", MB_OK | MB_ICONERROR); + } + return !noError; } static int loaded = 0; @@ -1741,7 +1746,10 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L return 0; case PSN_APPLY: selected = 0; - if (SaveSettings() == -1) return 0; + if (SaveSettings()) { + SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); + return 0; + } SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); return 1; } diff --git a/plugins/LilyPad/DirectInput.cpp b/plugins/LilyPad/DirectInput.cpp index 6a945d737f..e000e9540c 100644 --- a/plugins/LilyPad/DirectInput.cpp +++ b/plugins/LilyPad/DirectInput.cpp @@ -20,7 +20,7 @@ inline static u32 flipLong(u32 l) { static void GUIDtoString(wchar_t *data, const GUID *pg) { wsprintfW(data, L"%08X-%04X-%04X-%04X-%04X%08X", pg->Data1, (u32)pg->Data2, (u32)pg->Data3, - flipShort(((u16*)pg->Data4)[0]), + flipShort(((u16*)pg->Data4)[0]), flipShort(((u16*)pg->Data4)[1]), flipLong(((u32*)pg->Data4)[1])); } @@ -48,6 +48,9 @@ void ReleaseDirectInput() { di8d.lpDI8 = 0; } } + else { + di8d.refCount=di8d.refCount; + } } static int StringToGUID(GUID *pg, wchar_t *dataw) { diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 6b17a92c8b..23edeaaeed 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -203,10 +203,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, void* lpvReserved) { return 1; } -BOOL WINAPI MyDllMainCRTStartup(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved) { - return DllMain((HINSTANCE) hDllHandle, dwReason, lpReserved); -} - void AddForce(ButtonSum *sum, u8 cmd, int delta = 255) { if (!delta) return; if (cmd<0x14) { diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index df317def7d..33f7f7d78d 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -270,7 +270,7 @@ BEGIN CONTROL "Use GS thread (Recommended)",IDC_GS_THREAD_INPUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,271,116,10 CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,223,71,10 CONTROL "Save state # in title",IDC_SAVE_STATE_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,235,79,10 - CONTROL "App Local Volume",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,71,10 + CONTROL "Local volume control",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,77,10 CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,259,76,10 GROUPBOX "Debugging",IDC_STATIC,216,285,79,25 CONTROL "Enable logging",IDC_DEBUG_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,296,63,10 @@ -303,7 +303,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_CONFIG, DIALOG BEGIN diff --git a/plugins/LilyPad/LilyPad_VC2005.vcproj b/plugins/LilyPad/LilyPad_VC2005.vcproj index 6c38229e45..961edad7c9 100644 --- a/plugins/LilyPad/LilyPad_VC2005.vcproj +++ b/plugins/LilyPad/LilyPad_VC2005.vcproj @@ -51,6 +51,7 @@ From 71c4561f86a7a46c0ce27471d00c3ab6e7b45f90 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 13 Mar 2009 01:39:54 +0000 Subject: [PATCH 22/77] Linux: memcpy_fast seems stable enough on Linux, so I'm removing the switch, and turning it on by default. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@759 96395faa-99c1-11dd-bbfe-3dabce05a288 --- build.sh | 5 +-- pcsx2/IopDma.cpp | 2 +- pcsx2/MemcpyFast.h | 47 +++++++++-------------------- pcsx2/configure.ac | 16 +++++----- pcsx2/x86/iVUzerorec.cpp | 15 ++------- pcsx2/x86/ix86-32/iR5900AritImm.cpp | 14 --------- 6 files changed, 28 insertions(+), 71 deletions(-) diff --git a/build.sh b/build.sh index ae2ca97abe..e409a5c185 100644 --- a/build.sh +++ b/build.sh @@ -9,14 +9,11 @@ #export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --prefix `pwd`" #Optimized, but a devbuild -#export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --enable-devbuild --prefix `pwd`" +export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --enable-devbuild --prefix `pwd`" #Debug / Devbuild version #export PCSX2OPTIONS="--enable-debug --enable-devbuild --enable-sse3 --prefix `pwd`" -#Optimized, but a devbuild - with memcpy_fast_ enabled. - EXPERIMENTAL -export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --enable-devbuild --enable-memcpyfast --prefix `pwd`" - #ZeroGS Normal mode export ZEROGSOPTIONS="--enable-sse2" diff --git a/pcsx2/IopDma.cpp b/pcsx2/IopDma.cpp index b698616e13..53995dfb1d 100644 --- a/pcsx2/IopDma.cpp +++ b/pcsx2/IopDma.cpp @@ -153,7 +153,7 @@ void psxDma10(u32 madr, u32 bcr, u32 chcr) { psHu32(0x1000F240) &= ~0x40; psHu32(0x1000F240) &= ~0x100; psHu32(0x1000F240) &= ~0x4000; - FreezeXMMRegs(0) + FreezeXMMRegs(0); } } diff --git a/pcsx2/MemcpyFast.h b/pcsx2/MemcpyFast.h index 844de2ff62..c4ceeffa11 100644 --- a/pcsx2/MemcpyFast.h +++ b/pcsx2/MemcpyFast.h @@ -19,46 +19,29 @@ #ifndef __MEMCPY_FAST_H__ #define __MEMCPY_FAST_H__ -void _memset16_unaligned( void* dest, u16 data, size_t size ); +#if defined(_WIN32) + #include "windows/memzero.h" +#else + #include "Linux/memzero.h" +#endif // WIN32 -#if defined(_WIN32) && !defined(__x86_64__) + void _memset16_unaligned( void* dest, u16 data, size_t size ); // The new simplified memcpy_amd_ is now faster than memcpy_raz_. // memcpy_amd_ also does mmx register saving, negating the need for freezeregs (code cleanup!) // Additionally, using one single memcpy implementation keeps the code cache cleaner. - //extern void __fastcall memcpy_raz_udst(void *dest, const void *src, size_t bytes); - //extern void __fastcall memcpy_raz_usrc(void *dest, const void *src, size_t bytes); - //extern void __fastcall memcpy_raz_(void *dest, const void *src, size_t bytes); +#ifdef __LINUX__ + extern "C" void __fastcall memcpy_amd_(void *dest, const void *src, size_t bytes); + extern "C" u8 memcmp_mmx(const void* src1, const void* src2, int cmpsize); + extern "C" void memxor_mmx(void* dst, const void* src1, int cmpsize); +#else extern void __fastcall memcpy_amd_(void *dest, const void *src, size_t bytes); extern u8 memcmp_mmx(const void* src1, const void* src2, int cmpsize); extern void memxor_mmx(void* dst, const void* src1, int cmpsize); +#endif -# include "windows/memzero.h" -# define memcpy_fast memcpy_amd_ -# define memcpy_aligned memcpy_amd_ - -#else - - // for now linux uses the GCC memcpy/memset implementations. - //#define memcpy_raz_udst memcpy - //#define memcpy_raz_usrc memcpy - //#define memcpy_raz_ memcpy - - // fast_routines.S - extern "C" u8 memcmp_mmx(const void* src1, const void* src2, int cmpsize); - extern "C" void memxor_mmx(void* dst, const void* src1, int cmpsize); - -# include "Linux/memzero.h" -#if defined(LINUX_USE_FAST_MEMORY) -# define memcpy_fast memcpy_amd_ -# define memcpy_aligned memcpy_amd_ - extern "C" void __fastcall memcpy_amd_(void *dest, const void *src, size_t bytes); -#else -# define memcpy_fast memcpy -# define memcpy_aligned memcpy -#endif // LINUX_USE_FAST_MEMORY - -#endif // WIN32 - + #define memcpy_fast memcpy_amd_ + #define memcpy_aligned memcpy_amd_ + #endif //Header diff --git a/pcsx2/configure.ac b/pcsx2/configure.ac index 24f1f50881..c59dbb1510 100644 --- a/pcsx2/configure.ac +++ b/pcsx2/configure.ac @@ -63,14 +63,14 @@ AC_MSG_RESULT($debug) AC_CHECK_FUNCS([ _aligned_malloc _aligned_free ], AC_DEFINE(HAVE_ALIGNED_MALLOC)) -AC_MSG_CHECKING(turn on memcpy_fast_) -AC_ARG_ENABLE(memcpyfast, AC_HELP_STRING([--enable-memcpyfast], [Turns on memcpy_fast - EXPERIMENTAL]), - memcpyfast=$enableval,memcpyfast=no) -if test "x$memcpyfast" == xyes -then - AC_DEFINE(LINUX_USE_FAST_MEMORY,1,[LINUX_USE_FAST_MEMORY]) -fi -AC_MSG_RESULT($memcpyfast) +#AC_MSG_CHECKING(turn on memcpy_fast_) +#AC_ARG_ENABLE(memcpyfast, AC_HELP_STRING([--enable-memcpyfast], [Turns on memcpy_fast - EXPERIMENTAL]), +#memcpyfast=$enableval,memcpyfast=no) +#if test "x$memcpyfast" == xyes +#then +# AC_DEFINE(LINUX_USE_FAST_MEMORY,1,[LINUX_USE_FAST_MEMORY]) +#fi +#AC_MSG_RESULT($memcpyfast) #AC_MSG_CHECKING(turn on microVU) #AC_ARG_ENABLE(microVU, AC_HELP_STRING([--enable-microVU], [Turns on the currently incomplete microVU files - Not a good idea]), diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index 14116b9665..7cf66ef529 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -698,19 +698,10 @@ void* SuperVUGetProgram(u32 startpc, int vuindex) bool VuFunctionHeader::IsSame(void* pmem) { #ifdef SUPERVU_CACHING - //u32 checksum[2]; vector::iterator it; - FORIT(it, ranges) { - //memxor_mmx(checksum, (u8*)pmem+it->start, it->size); - //if( checksum[0] != it->checksum[0] || checksum[1] != it->checksum[1] ) - // return false; - // memcmp_mmx doesn't work on x86-64 machines - // and neither does pcsx2. -//#if defined(_MSC_VER) - if( memcmp_mmx((u8*)pmem+it->start, it->pmem, it->size) ) -//#else -// if( memcmp((u8*)pmem+it->start, it->pmem, it->size) ) -//#endif + FORIT(it, ranges) + { + if( memcmp_mmx((u8*)pmem+it->start, it->pmem, it->size) ) return false; } #endif diff --git a/pcsx2/x86/ix86-32/iR5900AritImm.cpp b/pcsx2/x86/ix86-32/iR5900AritImm.cpp index 89500896c4..4d805768e3 100644 --- a/pcsx2/x86/ix86-32/iR5900AritImm.cpp +++ b/pcsx2/x86/ix86-32/iR5900AritImm.cpp @@ -486,19 +486,6 @@ void recADDIU( void ) //////////////////////////////////////////////////// void recDADDI( void ) { -#ifdef __x86_64_ - if ( ! _Rt_ ) - { - return; - } - - MOV64MtoR( RAX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ] ); - if ( _Imm_ != 0 ) - { - ADD64ItoR( EAX, _Imm_ ); - } - MOV64RtoM( (int)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ], RAX ); -#else if ( ! _Rt_ ) { return; @@ -520,7 +507,6 @@ void recDADDI( void ) } MOV32RtoM( (int)&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ], EAX ); MOV32RtoM( (int)&cpuRegs.GPR.r[ _Rt_ ].UL[ 1 ], EDX ); -#endif } //////////////////////////////////////////////////// From cbe108e99ddd608d9a185baea50ec750cc98339f Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Fri, 13 Mar 2009 02:03:18 +0000 Subject: [PATCH 23/77] implemented some more opcodes... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@760 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU.cpp | 60 +++++++-------- pcsx2/x86/microVU.h | 5 +- pcsx2/x86/microVU_Alloc.inl | 7 +- pcsx2/x86/microVU_Lower.inl | 146 +++++++++++++++++++++++++++++++++--- pcsx2/x86/microVU_Misc.h | 59 ++++++++------- pcsx2/x86/microVU_Misc.inl | 127 +++++++++++++++++++++---------- 6 files changed, 292 insertions(+), 112 deletions(-) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index cc28ab22a9..2ce53e7a8c 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -29,36 +29,36 @@ PCSX2_ALIGNED16(microVU microVU0); PCSX2_ALIGNED16(microVU microVU1); -PCSX2_ALIGNED16(u32 mVU_absclip[4]) = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}; -PCSX2_ALIGNED16(u32 mVU_signbit[4]) = {0x80000000, 0x80000000, 0x80000000, 0x80000000}; -PCSX2_ALIGNED16(u32 mVU_minvals[4]) = {0xff7fffff, 0xff7fffff, 0xff7fffff, 0xff7fffff}; -PCSX2_ALIGNED16(u32 mVU_maxvals[4]) = {0x7f7fffff, 0x7f7fffff, 0x7f7fffff, 0x7f7fffff}; -PCSX2_ALIGNED16(u32 mVU_one[4]) = {0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000}; -PCSX2_ALIGNED16(u32 mVU_T1[4]) = {0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5}; -PCSX2_ALIGNED16(u32 mVU_T2[4]) = {0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c}; -PCSX2_ALIGNED16(u32 mVU_T3[4]) = {0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6}; -PCSX2_ALIGNED16(u32 mVU_T4[4]) = {0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63}; -PCSX2_ALIGNED16(u32 mVU_T5[4]) = {0x3dc577df, 0x3dc577df, 0x3dc577df, 0x3dc577df}; -PCSX2_ALIGNED16(u32 mVU_T6[4]) = {0xbd6501c4, 0xbd6501c4, 0xbd6501c4, 0xbd6501c4}; -PCSX2_ALIGNED16(u32 mVU_T7[4]) = {0x3cb31652, 0x3cb31652, 0x3cb31652, 0x3cb31652}; -PCSX2_ALIGNED16(u32 mVU_T8[4]) = {0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7}; -PCSX2_ALIGNED16(u32 mVU_Pi4[4]) = {0x3f490fdb, 0x3f490fdb, 0x3f490fdb, 0x3f490fdb}; -PCSX2_ALIGNED16(u32 mVU_S2[4]) = {0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4}; -PCSX2_ALIGNED16(u32 mVU_S3[4]) = {0x3c08873e, 0x3c08873e, 0x3c08873e, 0x3c08873e}; -PCSX2_ALIGNED16(u32 mVU_S4[4]) = {0xb94fb21f, 0xb94fb21f, 0xb94fb21f, 0xb94fb21f}; -PCSX2_ALIGNED16(u32 mVU_S5[4]) = {0x362e9c14, 0x362e9c14, 0x362e9c14, 0x362e9c14}; -PCSX2_ALIGNED16(u32 mVU_E1[4]) = {0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8}; -PCSX2_ALIGNED16(u32 mVU_E2[4]) = {0x3d0007f4, 0x3d0007f4, 0x3d0007f4, 0x3d0007f4}; -PCSX2_ALIGNED16(u32 mVU_E3[4]) = {0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff}; -PCSX2_ALIGNED16(u32 mVU_E4[4]) = {0x3933e553, 0x3933e553, 0x3933e553, 0x3933e553}; -PCSX2_ALIGNED16(u32 mVU_E5[4]) = {0x36b63510, 0x36b63510, 0x36b63510, 0x36b63510}; -PCSX2_ALIGNED16(u32 mVU_E6[4]) = {0x353961ac, 0x353961ac, 0x353961ac, 0x353961ac}; -PCSX2_ALIGNED16(float mVU_FTOI_4[4]) = {16.0, 16.0, 16.0, 16.0}; -PCSX2_ALIGNED16(float mVU_FTOI_12[4]) = {4096.0, 4096.0, 4096.0, 4096.0}; -PCSX2_ALIGNED16(float mVU_FTOI_15[4]) = {32768.0, 32768.0, 32768.0, 32768.0}; -PCSX2_ALIGNED16(float mVU_ITOF_4[4]) = {0.0625f, 0.0625f, 0.0625f, 0.0625f}; -PCSX2_ALIGNED16(float mVU_ITOF_12[4]) = {0.000244140625, 0.000244140625, 0.000244140625, 0.000244140625}; -PCSX2_ALIGNED16(float mVU_ITOF_15[4]) = {0.000030517578125, 0.000030517578125, 0.000030517578125, 0.000030517578125}; +PCSX2_ALIGNED16(const u32 mVU_absclip[4]) = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}; +PCSX2_ALIGNED16(const u32 mVU_signbit[4]) = {0x80000000, 0x80000000, 0x80000000, 0x80000000}; +PCSX2_ALIGNED16(const u32 mVU_minvals[4]) = {0xff7fffff, 0xff7fffff, 0xff7fffff, 0xff7fffff}; +PCSX2_ALIGNED16(const u32 mVU_maxvals[4]) = {0x7f7fffff, 0x7f7fffff, 0x7f7fffff, 0x7f7fffff}; +PCSX2_ALIGNED16(const u32 mVU_one[4]) = {0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000}; +PCSX2_ALIGNED16(const u32 mVU_T1[4]) = {0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5}; +PCSX2_ALIGNED16(const u32 mVU_T2[4]) = {0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c}; +PCSX2_ALIGNED16(const u32 mVU_T3[4]) = {0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6}; +PCSX2_ALIGNED16(const u32 mVU_T4[4]) = {0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63}; +PCSX2_ALIGNED16(const u32 mVU_T5[4]) = {0x3dc577df, 0x3dc577df, 0x3dc577df, 0x3dc577df}; +PCSX2_ALIGNED16(const u32 mVU_T6[4]) = {0xbd6501c4, 0xbd6501c4, 0xbd6501c4, 0xbd6501c4}; +PCSX2_ALIGNED16(const u32 mVU_T7[4]) = {0x3cb31652, 0x3cb31652, 0x3cb31652, 0x3cb31652}; +PCSX2_ALIGNED16(const u32 mVU_T8[4]) = {0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7}; +PCSX2_ALIGNED16(const u32 mVU_Pi4[4]) = {0x3f490fdb, 0x3f490fdb, 0x3f490fdb, 0x3f490fdb}; +PCSX2_ALIGNED16(const u32 mVU_S2[4]) = {0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4}; +PCSX2_ALIGNED16(const u32 mVU_S3[4]) = {0x3c08873e, 0x3c08873e, 0x3c08873e, 0x3c08873e}; +PCSX2_ALIGNED16(const u32 mVU_S4[4]) = {0xb94fb21f, 0xb94fb21f, 0xb94fb21f, 0xb94fb21f}; +PCSX2_ALIGNED16(const u32 mVU_S5[4]) = {0x362e9c14, 0x362e9c14, 0x362e9c14, 0x362e9c14}; +PCSX2_ALIGNED16(const u32 mVU_E1[4]) = {0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8}; +PCSX2_ALIGNED16(const u32 mVU_E2[4]) = {0x3d0007f4, 0x3d0007f4, 0x3d0007f4, 0x3d0007f4}; +PCSX2_ALIGNED16(const u32 mVU_E3[4]) = {0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff}; +PCSX2_ALIGNED16(const u32 mVU_E4[4]) = {0x3933e553, 0x3933e553, 0x3933e553, 0x3933e553}; +PCSX2_ALIGNED16(const u32 mVU_E5[4]) = {0x36b63510, 0x36b63510, 0x36b63510, 0x36b63510}; +PCSX2_ALIGNED16(const u32 mVU_E6[4]) = {0x353961ac, 0x353961ac, 0x353961ac, 0x353961ac}; +PCSX2_ALIGNED16(const float mVU_FTOI_4[4]) = {16.0, 16.0, 16.0, 16.0}; +PCSX2_ALIGNED16(const float mVU_FTOI_12[4]) = {4096.0, 4096.0, 4096.0, 4096.0}; +PCSX2_ALIGNED16(const float mVU_FTOI_15[4]) = {32768.0, 32768.0, 32768.0, 32768.0}; +PCSX2_ALIGNED16(const float mVU_ITOF_4[4]) = {0.0625f, 0.0625f, 0.0625f, 0.0625f}; +PCSX2_ALIGNED16(const float mVU_ITOF_12[4]) = {0.000244140625, 0.000244140625, 0.000244140625, 0.000244140625}; +PCSX2_ALIGNED16(const float mVU_ITOF_15[4]) = {0.000030517578125, 0.000030517578125, 0.000030517578125, 0.000030517578125}; //------------------------------------------------------------------ // Micro VU - Main Functions diff --git a/pcsx2/x86/microVU.h b/pcsx2/x86/microVU.h index d31d659694..dcae7f4377 100644 --- a/pcsx2/x86/microVU.h +++ b/pcsx2/x86/microVU.h @@ -100,11 +100,13 @@ struct microProgManager { }; struct microVU { - int index; // VU Index (VU0 or VU1) + u32 index; // VU Index (VU0 or VU1) u32 microSize; // VU Micro Memory Size u32 progSize; // VU Micro Program Size (microSize/8) u32 cacheAddr; // VU Cache Start Address static const u32 cacheSize = 0x400000; // VU Cache Size + + microProgManager<0x800> prog; // Micro Program Data VURegs* regs; // VU Regs Struct u8* cache; // Dynarec Cache Start (where we will start writing the recompiled code to) @@ -122,7 +124,6 @@ struct microVU { uptr x86esi; // Source register. Used as a pointer to a source in stream operations. uptr x86edi; // Destination register. Used as a pointer to a destination in stream operations. */ - microProgManager<0x800> prog; // Micro Program Data }; // microVU rec structs diff --git a/pcsx2/x86/microVU_Alloc.inl b/pcsx2/x86/microVU_Alloc.inl index 4441c8e3c9..ccea38603b 100644 --- a/pcsx2/x86/microVU_Alloc.inl +++ b/pcsx2/x86/microVU_Alloc.inl @@ -769,7 +769,7 @@ microVUt(void) mVUallocVIb(int GPRreg, int _reg_) { } //------------------------------------------------------------------ -// Div/Sqrt/Rsqrt Allocator Helpers +// Lower Instruction Allocator Helpers //------------------------------------------------------------------ #define getReg5(reg, _reg_, _fxf_) { \ @@ -783,4 +783,9 @@ microVUt(void) mVUallocVIb(int GPRreg, int _reg_) { } \ } +// Doesn't Clamp +#define getReg7(reg, _reg_) { \ + if (!_reg_) { getZero(reg); } \ + else { mVUloadReg(reg, (uptr)&mVU->regs->VF[_reg_].UL[0], _X_Y_Z_W); } \ +} #endif //PCSX2_MICROVU diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 76fc48ba0e..9a3579aae5 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -560,11 +560,6 @@ microVUf(void) mVU_IBNE() {} microVUf(void) mVU_JR() {} microVUf(void) mVU_JALR() {} -microVUf(void) mVU_ILW() {} -microVUf(void) mVU_ISW() {} -microVUf(void) mVU_ILWR() {} -microVUf(void) mVU_ISWR() {} - microVUf(void) mVU_MOVE() { microVU* mVU = mVUx; if (recPass == 0) { /*If (!_Ft_ || (_Ft_ == _Fs_)) nop();*/ } @@ -609,6 +604,89 @@ microVUf(void) mVU_MR32() { mVUsaveReg(xmmT1, (uptr)&mVU->regs->VF[_Ft_].UL[0], _X_Y_Z_W); } } + +microVUf(void) mVU_ILW() { + microVU* mVU = mVUx; + if (recPass == 0) { /*If (!_Ft_) nop();*/ } + else { + if (!_Fs_) { + MOVZX32M16toR( gprT1, (uptr)mVU->regs->Mem + getVUmem(_Imm11_) + offsetSS ); + mVUallocVIb(gprT1, _Ft_); + } + else { + mVUallocVIa(gprT1, _Fs_); + ADD32ItoR(gprT1, _Imm11_); + mVUaddrFix(gprT1); + MOV32RmSOffsettoR(gprT1, gprT1, (uptr)mVU->regs->Mem + offsetSS, 0); // ToDo: check if this works. + if (isMMX(_Ft_)) AND32ItoR(gprT1, 0xffff); + mVUallocVIb(gprT1, _Ft_); + } + } +} +microVUf(void) mVU_ILWR() { + microVU* mVU = mVUx; + if (recPass == 0) { /*If (!_Ft_) nop();*/ } + else { + if (!_Fs_) { + MOVZX32M16toR( gprT1, (uptr)mVU->regs->Mem + offsetSS ); + mVUallocVIb(gprT1, _Ft_); + } + else { + mVUallocVIa(gprT1, _Fs_); + mVUaddrFix(gprT1); + MOV32RmSOffsettoR(gprT1, gprT1, (uptr)mVU->regs->Mem + offsetSS, 0); // ToDo: check if this works. + if (isMMX(_Ft_)) AND32ItoR(gprT1, 0xffff); + mVUallocVIb(gprT1, _Ft_); + } + } +} +microVUf(void) mVU_ISW() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (!_Fs_) { + int imm = getVUmem(_Imm11_); + mVUallocVIa(gprT1, _Ft_); + if (_X) MOV32RtoM((uptr)mVU->regs->Mem + imm, gprT1); + if (_Y) MOV32RtoM((uptr)mVU->regs->Mem + imm + 4, gprT1); + if (_Z) MOV32RtoM((uptr)mVU->regs->Mem + imm + 8, gprT1); + if (_W) MOV32RtoM((uptr)mVU->regs->Mem + imm + 12, gprT1); + } + else { + mVUallocVIa(gprT1, _Fs_); + mVUallocVIa(gprT2, _Ft_); + ADD32ItoR(gprT1, _Imm11_); + mVUaddrFix(gprT1); + if (_X) MOV32RtoRmOffset(gprT1, gprT2, (uptr)mVU->regs->Mem); + if (_Y) MOV32RtoRmOffset(gprT1, gprT2, (uptr)mVU->regs->Mem+4); + if (_Z) MOV32RtoRmOffset(gprT1, gprT2, (uptr)mVU->regs->Mem+8); + if (_W) MOV32RtoRmOffset(gprT1, gprT2, (uptr)mVU->regs->Mem+12); + } + } +} +microVUf(void) mVU_ISWR() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (!_Fs_) { + mVUallocVIa(gprT1, _Ft_); + if (_X) MOV32RtoM((uptr)mVU->regs->Mem, gprT1); + if (_Y) MOV32RtoM((uptr)mVU->regs->Mem+4, gprT1); + if (_Z) MOV32RtoM((uptr)mVU->regs->Mem+8, gprT1); + if (_W) MOV32RtoM((uptr)mVU->regs->Mem+12, gprT1); + } + else { + mVUallocVIa(gprT1, _Fs_); + mVUallocVIa(gprT2, _Ft_); + mVUaddrFix(gprT1); + if (_X) MOV32RtoRmOffset(gprT1, gprT2, (uptr)mVU->regs->Mem); + if (_Y) MOV32RtoRmOffset(gprT1, gprT2, (uptr)mVU->regs->Mem+4); + if (_Z) MOV32RtoRmOffset(gprT1, gprT2, (uptr)mVU->regs->Mem+8); + if (_W) MOV32RtoRmOffset(gprT1, gprT2, (uptr)mVU->regs->Mem+12); + } + } +} + microVUf(void) mVU_LQ() { microVU* mVU = mVUx; if (recPass == 0) { /*If (!_Ft_) nop();*/ } @@ -667,10 +745,60 @@ microVUf(void) mVU_LQI() { } } } -microVUf(void) mVU_SQ() {} -microVUf(void) mVU_SQD() {} -microVUf(void) mVU_SQI() {} -//microVUf(void) mVU_LOI() {} +microVUf(void) mVU_SQ() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (!_Ft_) { + getReg7(xmmFs, _Fs_); + mVUsaveReg(xmmFs, (uptr)mVU->regs->Mem + getVUmem(_Imm11_), _X_Y_Z_W); + } + else { + mVUallocVIa(gprT1, _Ft_); + ADD32ItoR(gprT1, _Imm11_); + mVUaddrFix(gprT1); + getReg7(xmmFs, _Fs_); + mVUsaveReg2(xmmFs, gprT1, (uptr)mVU->regs->Mem, _X_Y_Z_W); + } + } +} +microVUf(void) mVU_SQD() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (!_Ft_) { + getReg7(xmmFs, _Fs_); + mVUsaveReg(xmmFs, (uptr)mVU->regs->Mem, _X_Y_Z_W); + } + else { + mVUallocVIa(gprT1, _Ft_); + SUB16ItoR(gprT1, 1); + mVUallocVIb(gprT1, _Ft_); // ToDo: Backup to memory check. + mVUaddrFix(gprT1); + getReg7(xmmFs, _Fs_); + mVUsaveReg2(xmmFs, gprT1, (uptr)mVU->regs->Mem, _X_Y_Z_W); + } + } +} +microVUf(void) mVU_SQI() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (!_Ft_) { + getReg7(xmmFs, _Fs_); + mVUsaveReg(xmmFs, (uptr)mVU->regs->Mem, _X_Y_Z_W); + } + else { + mVUallocVIa(gprT1, _Ft_); + MOV32RtoR(gprT2, gprT1); + mVUaddrFix(gprT1); + getReg7(xmmFs, _Fs_); + mVUsaveReg2(xmmFs, gprT1, (uptr)mVU->regs->Mem, _X_Y_Z_W); + ADD16ItoR(gprT2, 1); + mVUallocVIb(gprT2, _Ft_); // ToDo: Backup to memory check. + } + } +} microVUf(void) mVU_RINIT() {} microVUf(void) mVU_RGET() {} diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index d8412016eb..a7cfc6330d 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -22,35 +22,35 @@ // Global Variables //------------------------------------------------------------------ -PCSX2_ALIGNED16_EXTERN(u32 mVU_absclip[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_signbit[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_minvals[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_maxvals[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_T1[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_T2[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_T3[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_T4[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_T5[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_T6[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_T7[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_T8[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_Pi4[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_S2[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_S3[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_S4[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_S5[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_E1[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_E2[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_E3[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_E4[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_E5[4]); -PCSX2_ALIGNED16_EXTERN(u32 mVU_E6[4]); -PCSX2_ALIGNED16_EXTERN(float mVU_FTOI_4[4]); -PCSX2_ALIGNED16_EXTERN(float mVU_FTOI_12[4]); -PCSX2_ALIGNED16_EXTERN(float mVU_FTOI_15[4]); -PCSX2_ALIGNED16_EXTERN(float mVU_ITOF_4[4]); -PCSX2_ALIGNED16_EXTERN(float mVU_ITOF_12[4]); -PCSX2_ALIGNED16_EXTERN(float mVU_ITOF_15[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_absclip[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_signbit[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_minvals[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_maxvals[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_T1[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_T2[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_T3[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_T4[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_T5[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_T6[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_T7[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_T8[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_Pi4[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_S2[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_S3[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_S4[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_S5[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E1[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E2[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E3[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E4[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E5[4]); +PCSX2_ALIGNED16_EXTERN(const u32 mVU_E6[4]); +PCSX2_ALIGNED16_EXTERN(const float mVU_FTOI_4[4]); +PCSX2_ALIGNED16_EXTERN(const float mVU_FTOI_12[4]); +PCSX2_ALIGNED16_EXTERN(const float mVU_FTOI_15[4]); +PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_4[4]); +PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_12[4]); +PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); //------------------------------------------------------------------ // Helper Macros @@ -85,6 +85,7 @@ PCSX2_ALIGNED16_EXTERN(float mVU_ITOF_15[4]); #define _Imm15_ (((mVU->code >> 10) & 0x7800) | (mVU->code & 0x7ff)) #define getVUmem(x) (((vuIndex == 1) ? (x & 0x3ff) : ((x >= 0x400) ? (x & 0x43f) : (x & 0xff))) * 16) +#define offsetSS ((_X) ? (0) : ((_Y) ? (4) : ((_Z) ? 8: 12))) #define xmmT1 0 // Temp Reg #define xmmFs 1 // Holds the Value of Fs (writes back result Fd) diff --git a/pcsx2/x86/microVU_Misc.inl b/pcsx2/x86/microVU_Misc.inl index 174ebe4fd2..e229a09dae 100644 --- a/pcsx2/x86/microVU_Misc.inl +++ b/pcsx2/x86/microVU_Misc.inl @@ -93,48 +93,93 @@ microVUx(void) mVUloadReg2(int reg, int gprReg, uptr offset, int xyzw) { } } -microVUx(void) mVUsaveReg(int reg, u32 offset, int xyzw) { +microVUx(void) mVUsaveReg(int reg, uptr offset, int xyzw) { switch ( xyzw ) { - case 5: SSE2_PSHUFD_XMM_to_XMM(reg, reg, 0xB1); - SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); - SSE_MOVSS_XMM_to_M32(offset+4, reg); - SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); - break; // YW - case 6: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0xc9); - SSE_MOVLPS_XMM_to_M64(offset+4, xmmT1); - break; // YZ - case 7: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x93); //ZYXW - SSE_MOVHPS_XMM_to_M64(offset+4, xmmT1); - SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); - break; // YZW - case 9: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); - SSE_MOVSS_XMM_to_M32(offset, reg); - if ( cpucaps.hasStreamingSIMD3Extensions ) SSE3_MOVSLDUP_XMM_to_XMM(xmmT1, xmmT1); - else SSE2_PSHUFD_XMM_to_XMM(xmmT1, xmmT1, 0x55); - SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); - break; // XW - case 10: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); - SSE_MOVSS_XMM_to_M32(offset, reg); - SSE_MOVSS_XMM_to_M32(offset+8, xmmT1); - break; //XZ - case 11: SSE_MOVSS_XMM_to_M32(offset, reg); - SSE_MOVHPS_XMM_to_M64(offset+8, reg); - break; //XZW - case 13: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x4b); //YXZW - SSE_MOVHPS_XMM_to_M64(offset, xmmT1); - SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); - break; // XYW - case 14: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); - SSE_MOVLPS_XMM_to_M64(offset, reg); - SSE_MOVSS_XMM_to_M32(offset+8, xmmT1); - break; // XYZ - case 8: SSE_MOVSS_XMM_to_M32(offset, reg); break; // X - case 4: SSE_MOVSS_XMM_to_M32(offset+4, reg); break; // Y - case 2: SSE_MOVSS_XMM_to_M32(offset+8, reg); break; // Z - case 1: SSE_MOVSS_XMM_to_M32(offset+12, reg); break; // W - case 12: SSE_MOVLPS_XMM_to_M64(offset, reg); break; // XY - case 3: SSE_MOVHPS_XMM_to_M64(offset+8, reg); break; // ZW - default: SSE_MOVAPS_XMM_to_M128(offset, reg); break; // XYZW + case 5: SSE2_PSHUFD_XMM_to_XMM(reg, reg, 0xB1); + SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVSS_XMM_to_M32(offset+4, reg); + SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); + break; // YW + case 6: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0xc9); + SSE_MOVLPS_XMM_to_M64(offset+4, xmmT1); + break; // YZ + case 7: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x93); //ZYXW + SSE_MOVHPS_XMM_to_M64(offset+4, xmmT1); + SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); + break; // YZW + case 9: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVSS_XMM_to_M32(offset, reg); + if ( cpucaps.hasStreamingSIMD3Extensions ) SSE3_MOVSLDUP_XMM_to_XMM(xmmT1, xmmT1); + else SSE2_PSHUFD_XMM_to_XMM(xmmT1, xmmT1, 0x55); + SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); + break; // XW + case 10: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVSS_XMM_to_M32(offset, reg); + SSE_MOVSS_XMM_to_M32(offset+8, xmmT1); + break; //XZ + case 11: SSE_MOVSS_XMM_to_M32(offset, reg); + SSE_MOVHPS_XMM_to_M64(offset+8, reg); + break; //XZW + case 13: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x4b); //YXZW + SSE_MOVHPS_XMM_to_M64(offset, xmmT1); + SSE_MOVSS_XMM_to_M32(offset+12, xmmT1); + break; // XYW + case 14: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVLPS_XMM_to_M64(offset, reg); + SSE_MOVSS_XMM_to_M32(offset+8, xmmT1); + break; // XYZ + case 8: SSE_MOVSS_XMM_to_M32(offset, reg); break; // X + case 4: SSE_MOVSS_XMM_to_M32(offset+4, reg); break; // Y + case 2: SSE_MOVSS_XMM_to_M32(offset+8, reg); break; // Z + case 1: SSE_MOVSS_XMM_to_M32(offset+12, reg); break; // W + case 12: SSE_MOVLPS_XMM_to_M64(offset, reg); break; // XY + case 3: SSE_MOVHPS_XMM_to_M64(offset+8, reg); break; // ZW + default: SSE_MOVAPS_XMM_to_M128(offset, reg); break; // XYZW + } +} + +microVUx(void) mVUsaveReg2(int reg, int gprReg, u32 offset, int xyzw) { + switch ( xyzw ) { + case 5: SSE2_PSHUFD_XMM_to_XMM(reg, reg, 0xB1); + SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+4, reg); + SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+12, xmmT1); + break; // YW + case 6: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0xc9); + SSE_MOVLPS_XMM_to_RmOffset(gprReg, offset+4, xmmT1); + break; // YZ + case 7: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x93); //ZYXW + SSE_MOVHPS_XMM_to_RmOffset(gprReg, offset+4, xmmT1); + SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+12, xmmT1); + break; // YZW + case 9: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVSS_XMM_to_RmOffset(gprReg, offset, reg); + if ( cpucaps.hasStreamingSIMD3Extensions ) SSE3_MOVSLDUP_XMM_to_XMM(xmmT1, xmmT1); + else SSE2_PSHUFD_XMM_to_XMM(xmmT1, xmmT1, 0x55); + SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+12, xmmT1); + break; // XW + case 10: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVSS_XMM_to_RmOffset(gprReg, offset, reg); + SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+8, xmmT1); + break; //XZ + case 11: SSE_MOVSS_XMM_to_RmOffset(gprReg, offset, reg); + SSE_MOVHPS_XMM_to_RmOffset(gprReg, offset+8, reg); + break; //XZW + case 13: SSE2_PSHUFD_XMM_to_XMM(xmmT1, reg, 0x4b); //YXZW + SSE_MOVHPS_XMM_to_RmOffset(gprReg, offset, xmmT1); + SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+12, xmmT1); + break; // XYW + case 14: SSE_MOVHLPS_XMM_to_XMM(xmmT1, reg); + SSE_MOVLPS_XMM_to_RmOffset(gprReg, offset, reg); + SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+8, xmmT1); + break; // XYZ + case 8: SSE_MOVSS_XMM_to_RmOffset(gprReg, offset, reg); break; // X + case 4: SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+4, reg); break; // Y + case 2: SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+8, reg); break; // Z + case 1: SSE_MOVSS_XMM_to_RmOffset(gprReg, offset+12, reg); break; // W + case 12: SSE_MOVLPS_XMM_to_RmOffset(gprReg, offset, reg); break; // XY + case 3: SSE_MOVHPS_XMM_to_RmOffset(gprReg, offset+8, reg); break; // ZW + default: SSE_MOVAPSRtoRmOffset(gprReg, offset, reg); break; // XYZW } } From 3821425442d5eaf9103822a76b8f5368fd686dfe Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Fri, 13 Mar 2009 04:21:50 +0000 Subject: [PATCH 24/77] Minor fixes to the IOP Interpeter and const prop regarding the SLTIU instruction. Removed the rest of the references to the UseGui global boolean since it wasn't used anymore. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@761 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/R3000AInterpreter.cpp | 6 ++++-- pcsx2/R3000AOpcodeTables.cpp | 2 +- pcsx2/windows/Win32.h | 1 - pcsx2/windows/WinSysExec.cpp | 6 ------ pcsx2/x86/iR3000Atables.cpp | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pcsx2/R3000AInterpreter.cpp b/pcsx2/R3000AInterpreter.cpp index 3753aa0979..094eb29b72 100644 --- a/pcsx2/R3000AInterpreter.cpp +++ b/pcsx2/R3000AInterpreter.cpp @@ -380,8 +380,9 @@ void psxJALR() { if (_Rd_) { _SetLink(_Rd_); } doBranch(_u32(_rRs_)); } static __forceinline void execI() { psxRegs.code = iopMemRead32(psxRegs.pc); - - PSXCPU_LOG("%s\n", disR3000AF(psxRegs.code, psxRegs.pc)); + + //if( (psxRegs.pc >= 0x1200 && psxRegs.pc <= 0x1400) || (psxRegs.pc >= 0x0b40 && psxRegs.pc <= 0x1000)) + PSXCPU_LOG("%s\n", disR3000AF(psxRegs.code, psxRegs.pc)); psxRegs.pc+= 4; psxRegs.cycle++; @@ -395,6 +396,7 @@ static void doBranch(s32 tar) { branch2 = iopIsDelaySlot = true; branchPC = tar; execI(); + PSXCPU_LOG( "\n" ); iopIsDelaySlot = false; psxRegs.pc = branchPC; diff --git a/pcsx2/R3000AOpcodeTables.cpp b/pcsx2/R3000AOpcodeTables.cpp index ccd5c3c00c..7433bda285 100644 --- a/pcsx2/R3000AOpcodeTables.cpp +++ b/pcsx2/R3000AOpcodeTables.cpp @@ -58,7 +58,7 @@ void psxANDI() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) & _ImmU_; } // Rt = Rs void psxORI() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) | _ImmU_; } // Rt = Rs Or Im void psxXORI() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) ^ _ImmU_; } // Rt = Rs Xor Im void psxSLTI() { if (!_Rt_) return; _rRt_ = _i32(_rRs_) < _Imm_ ; } // Rt = Rs < Im (Signed) -void psxSLTIU() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) < _ImmU_; } // Rt = Rs < Im (Unsigned) +void psxSLTIU() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) < (u32)_Imm_; } // Rt = Rs < Im (Unsigned) /********************************************************* * Register arithmetic * diff --git a/pcsx2/windows/Win32.h b/pcsx2/windows/Win32.h index 737fe1b149..1ad9e1ca58 100644 --- a/pcsx2/windows/Win32.h +++ b/pcsx2/windows/Win32.h @@ -149,7 +149,6 @@ extern AppData gApp; extern HWND hStatusWnd; extern PcsxConfig winConfig; // local storage of the configuration options. -extern bool UseGui; extern bool nDisableSC; // screensaver extern unsigned int langsMax; diff --git a/pcsx2/windows/WinSysExec.cpp b/pcsx2/windows/WinSysExec.cpp index 7ecf2862b8..f797094183 100644 --- a/pcsx2/windows/WinSysExec.cpp +++ b/pcsx2/windows/WinSysExec.cpp @@ -25,7 +25,6 @@ #include "iR5900.h" static bool sinit = false; -bool UseGui = true; bool nDisableSC = false; // screensaver // This instance is not modified by command line overrides so @@ -442,11 +441,6 @@ namespace HostGui } else { - if( !UseGui ) { - // not using GUI and user just quit, so exit - WinClose(); - } - nDisableSC = 0; } diff --git a/pcsx2/x86/iR3000Atables.cpp b/pcsx2/x86/iR3000Atables.cpp index 6fd3885604..2ace926c44 100644 --- a/pcsx2/x86/iR3000Atables.cpp +++ b/pcsx2/x86/iR3000Atables.cpp @@ -97,7 +97,7 @@ PSXRECOMPILE_CONSTCODE1(SLTI); //// SLTIU void rpsxSLTIU_const() { - g_psxConstRegs[_Rt_] = g_psxConstRegs[_Rs_] < _ImmU_; + g_psxConstRegs[_Rt_] = g_psxConstRegs[_Rs_] < (u32)_Imm_; } void rpsxSLTUconst(int info, int dreg, int sreg, int imm) From e0347fd2851429dab35d1f6ec494590c25167965 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 13 Mar 2009 04:49:23 +0000 Subject: [PATCH 25/77] Some header work, get rid of some dead code, and rename PsxCommon.h. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@762 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVD.cpp | 4 +- pcsx2/CDVD.h | 2 +- pcsx2/CdRom.cpp | 4 +- pcsx2/CdRom.h | 2 +- pcsx2/Common.h | 12 +- pcsx2/DebugTools/Debug.h | 2 +- pcsx2/Elfheader.cpp | 125 +++------ pcsx2/IopBios.cpp | 2 +- pcsx2/{PsxCommon.h => IopCommon.h} | 34 +-- pcsx2/IopCounters.cpp | 2 +- pcsx2/IopDma.cpp | 2 +- pcsx2/IopHw.cpp | 3 +- pcsx2/IopMem.cpp | 2 +- pcsx2/IopSio2.cpp | 2 +- pcsx2/Makefile.am | 2 +- pcsx2/Mdec.cpp | 3 +- pcsx2/MemcpyFast.h | 1 + pcsx2/Memory.cpp | 3 +- pcsx2/MemoryCard.cpp | 2 +- pcsx2/Misc.cpp | 302 +++++---------------- pcsx2/Misc.h | 56 ---- pcsx2/Patch.cpp | 2 +- pcsx2/Plugins.cpp | 3 +- pcsx2/PrecompiledHeader.h | 27 ++ pcsx2/R3000A.cpp | 4 +- pcsx2/R3000AInterpreter.cpp | 3 +- pcsx2/R3000AOpcodeTables.cpp | 3 +- pcsx2/RDebug/deci2_dbgp.cpp | 3 +- pcsx2/RDebug/deci2_iloadp.cpp | 3 +- pcsx2/SaveState.cpp | 3 +- pcsx2/SaveState.h | 2 +- pcsx2/Sif.cpp | 3 +- pcsx2/Sio.cpp | 2 +- pcsx2/Stats.cpp | 3 +- pcsx2/System.h | 2 + pcsx2/configure.ac | 7 +- pcsx2/windows/VCprojects/pcsx2_2008.vcproj | 4 + pcsx2/windows/Win32.h | 2 +- pcsx2/x86/iCore.h | 1 + pcsx2/x86/iPsxMem.cpp | 2 +- pcsx2/x86/iR3000A.cpp | 2 +- pcsx2/x86/iR3000Atables.cpp | 2 +- pcsx2/x86/ix86-32/iCore-32.cpp | 2 +- 43 files changed, 199 insertions(+), 453 deletions(-) rename pcsx2/{PsxCommon.h => IopCommon.h} (77%) diff --git a/pcsx2/CDVD.cpp b/pcsx2/CDVD.cpp index 35c76b4387..9bcee55a05 100644 --- a/pcsx2/CDVD.cpp +++ b/pcsx2/CDVD.cpp @@ -20,7 +20,7 @@ #include -#include "PsxCommon.h" +#include "IopCommon.h" #include "CDVDiso.h" static cdvdStruct cdvd; @@ -462,7 +462,7 @@ void cdvdReadKey(u8 arg0, u16 arg1, u32 arg2, u8* key) { // get main elf name GetPS2ElfName(str); - sprintf(exeName, "%c%c%c%c%c%c%c%c%c%c%c",str[8],str[9],str[10],str[11],str[12],str[13],str[14],str[15],str[16],str[17],str[18]); + sprintf(exeName, "%c%c%c%c%c%c%c%c%c%c%c",str[8],str[9],str[10],str[11],str[12],str[13],str[14],str[15],str[16],str[17],str[18]); DevCon::Notice("exeName = %s", params &str[8]); // convert the number characters to a real 32bit number diff --git a/pcsx2/CDVD.h b/pcsx2/CDVD.h index f793e737e1..9eec464375 100644 --- a/pcsx2/CDVD.h +++ b/pcsx2/CDVD.h @@ -19,7 +19,7 @@ #ifndef __CDVD_H__ #define __CDVD_H__ -#include "PsxCommon.h" +#include "IopCommon.h" struct cdvdRTC { u8 status; diff --git a/pcsx2/CdRom.cpp b/pcsx2/CdRom.cpp index d0a3ff09f6..6947ae044a 100644 --- a/pcsx2/CdRom.cpp +++ b/pcsx2/CdRom.cpp @@ -18,8 +18,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" -#include "Common.h" +#include "IopCommon.h" //THIS ALL IS FOR THE CDROM REGISTERS HANDLING @@ -73,7 +72,6 @@ const char *CmdName[0x100]= { cdrStruct cdr; long LoadCdBios; -int cdOpenCase; u8 Test04[] = { 0 }; u8 Test05[] = { 0 }; diff --git a/pcsx2/CdRom.h b/pcsx2/CdRom.h index be33f9390c..10757dff7e 100644 --- a/pcsx2/CdRom.h +++ b/pcsx2/CdRom.h @@ -19,7 +19,7 @@ #ifndef __CDROM_H__ #define __CDROM_H__ -#include "PsxCommon.h" +#include "IopCommon.h" #include "Decode_XA.h" #include "PS2Edefs.h" diff --git a/pcsx2/Common.h b/pcsx2/Common.h index 7737c6c612..1461bb83bd 100644 --- a/pcsx2/Common.h +++ b/pcsx2/Common.h @@ -27,20 +27,20 @@ //#define PSXCLK 186864000 /* 36.864 Mhz */ #define PS2CLK 294912000 //hz /* 294.912 mhz */ +#define PCSX2_VERSION "(beta)" #include "Plugins.h" -#include "Misc.h" #include "SaveState.h" #include "DebugTools/Debug.h" -#include "R5900.h" #include "Memory.h" -#include "Elfheader.h" #include "Hw.h" -// Moving this before one of the other includes causes compilation issues. -//#include "Misc.h" + +#include "R5900.h" +#include "Elfheader.h" #include "Patch.h" -#define PCSX2_VERSION "(beta)" +#include "System.h" +#include "Pcsx2Config.h" #endif /* __COMMON_H__ */ diff --git a/pcsx2/DebugTools/Debug.h b/pcsx2/DebugTools/Debug.h index cc7dac97e9..77152441df 100644 --- a/pcsx2/DebugTools/Debug.h +++ b/pcsx2/DebugTools/Debug.h @@ -20,7 +20,7 @@ #ifndef __DEBUG_H__ #define __DEBUG_H__ -#include "Misc.h" +#include "Pcsx2Config.h" extern FILE *emuLog; diff --git a/pcsx2/Elfheader.cpp b/pcsx2/Elfheader.cpp index 020412431b..358a1cc672 100644 --- a/pcsx2/Elfheader.cpp +++ b/pcsx2/Elfheader.cpp @@ -148,7 +148,7 @@ static uint parseCommandLine( const char *filename ) { // 4 + 4 + 256 const char * p; int argc; - int i; + int i; args_ptr -= 256; @@ -159,59 +159,47 @@ static uint parseCommandLine( const char *filename ) p = strrchr( filename, '\\' ); #else //linux p = strrchr( filename, '/' ); - if( p == NULL ) - p = strchr(filename, '\\'); + if( p == NULL ) p = strchr(filename, '\\'); #endif - if ( p ) - { - p++; - } + if (p) + p++; else - { - p = filename; - } + p = filename; + args_ptr -= strlen( p ) + 1; - /* if ( args_ptr < 0 ) // fixme- This is still impossible. - { - return 0; - }*/ + strcpy( (char*)&PS2MEM_BASE[ args_ptr ], p ); //fill param 0; i.e. name of the program for ( i = strlen( p ) + 1 + 256, argc = 0; i > 0; i-- ) - { - while ( i && ( ( PS2MEM_BASE[ args_ptr + i ] == 0 ) || ( PS2MEM_BASE[ args_ptr + i ] == 32 ) ) ) - { - i--; - } - if ( PS2MEM_BASE[ args_ptr + i + 1 ] == ' ' ) - { - PS2MEM_BASE[ args_ptr + i + 1 ] = 0; - } - while ( i && ( PS2MEM_BASE[ args_ptr + i ] != 0 ) && ( PS2MEM_BASE[ args_ptr + i] != 32 ) ) - { - i--; - } - if ( ( PS2MEM_BASE[ args_ptr + i ] != 0 ) && ( PS2MEM_BASE[ args_ptr + i ] != 32 ) ) + { + while (i && ((PS2MEM_BASE[ args_ptr + i ] == 0) || (PS2MEM_BASE[ args_ptr + i ] == 32))) + { i--; } + + if ( PS2MEM_BASE[ args_ptr + i + 1 ] == ' ') PS2MEM_BASE[ args_ptr + i + 1 ] = 0; + + while (i && (PS2MEM_BASE[ args_ptr + i ] != 0) && (PS2MEM_BASE[ args_ptr + i] != 32)) + { i--; } + + if ((PS2MEM_BASE[ args_ptr + i ] != 0) && (PS2MEM_BASE[ args_ptr + i ] != 32)) { //i==0 argc++; + if ( args_ptr - 4 - 4 - argc * 4 < 0 ) // fixme - Should this be cast to a signed int? - { - return 0; - } + return 0; + ((u32*)PS2MEM_BASE)[ args_ptr / 4 - argc ] = args_ptr + i; } - else - { + else + { if ( ( PS2MEM_BASE[ args_ptr + i + 1 ] != 0 ) && ( PS2MEM_BASE[ args_ptr + i + 1 ] != 32 ) ) { argc++; if ( args_ptr - 4 - 4 - argc * 4 < 0 ) // fixme - Should this be cast to a signed int? - { return 0; - } + ((u32*)PS2MEM_BASE)[ args_ptr / 4 - argc ] = args_ptr + i + 1; } - } + } } ((u32*)PS2MEM_BASE)[ args_ptr /4 - argc - 1 ] = argc; //how many args ((u32*)PS2MEM_BASE)[ args_ptr /4 - argc - 2 ] = ( argc > 0); //have args? //not used, cannot be filled at all @@ -311,10 +299,10 @@ struct ElfObject if ((strnicmp( filename.c_str(), "cdrom0:", strlen("cdromN:")) == 0) || (strnicmp( filename.c_str(), "cdrom1:", strlen("cdromN:")) == 0)) { - int fi; - fi = CDVDFS_open(filename.c_str() + strlen("cdromN:"), 1);//RDONLY - if (fi < 0) - throw Exception::FileNotFound( filename ); + int fi = CDVDFS_open(filename.c_str() + strlen("cdromN:"), 1);//RDONLY + + if (fi < 0) throw Exception::FileNotFound( filename ); + CDVDFS_lseek( fi, 0, SEEK_SET ); rsize = CDVDFS_read( fi, (char*)data.GetPtr(), data.GetSizeInBytes() ); CDVDFS_close( fi ); @@ -324,15 +312,14 @@ struct ElfObject FILE *f; f = fopen( filename.c_str(), "rb" ); - if( f == NULL ) - Exception::FileNotFound( filename ); + if( f == NULL ) Exception::FileNotFound( filename ); + fseek( f, 0, SEEK_SET ); rsize = fread( data.GetPtr(), 1, data.GetSizeInBytes(), f ); fclose( f ); } - if( rsize < data.GetSizeInBytes() ) - throw Exception::EndOfStream( filename ); + if( rsize < data.GetSizeInBytes() ) throw Exception::EndOfStream( filename ); } u32 GetCRC() const @@ -426,37 +413,14 @@ struct ElfObject switch ( secthead[ i ].sh_type ) { - default: - ELF_LOG("unknown %08x",secthead[i].sh_type); - break; - - case 0x0: - ELF_LOG("null"); - break; - - case 0x1: - ELF_LOG("progbits"); - break; - - case 0x2: - ELF_LOG("symtab"); - break; - - case 0x3: - ELF_LOG("strtab"); - break; - - case 0x4: - ELF_LOG("rela"); - break; - - case 0x8: - ELF_LOG("no bits"); - break; - - case 0x9: - ELF_LOG("rel"); - break; + case 0x0: ELF_LOG("null"); break; + case 0x1: ELF_LOG("progbits"); break; + case 0x2: ELF_LOG("symtab"); break; + case 0x3: ELF_LOG("strtab"); break; + case 0x4: ELF_LOG("rela"); break; + case 0x8: ELF_LOG("no bits"); break; + case 0x9: ELF_LOG("rel"); break; + default: ELF_LOG("unknown %08x",secthead[i].sh_type); break; } ELF_LOG("\n"); @@ -619,17 +583,6 @@ void LoadGameSpecificSettings() g_FFXHack = 0; switch(ElfCRC) { - // The code involving VUFIX_SIGNEDZERO & VUFIX_EXTRAFLAGS - // is no longer in pcsx2. - - //case 0x0c414549: // spacefisherman, missing gfx - // g_VUGameFixes |= VUFIX_SIGNEDZERO; - // break; - //case 0x4C9EE7DF: // crazy taxi (u) - //case 0xC9C145BF: // crazy taxi, missing gfx - // g_VUGameFixes |= VUFIX_EXTRAFLAGS; - // break; - case 0xb99379b7: // erementar gerad (discolored chars) g_VUGameFixes |= VUFIX_XGKICKDELAY2; // Tested - still needed - arcum42 break; diff --git a/pcsx2/IopBios.cpp b/pcsx2/IopBios.cpp index bb84b6dc85..029b888cc7 100644 --- a/pcsx2/IopBios.cpp +++ b/pcsx2/IopBios.cpp @@ -19,7 +19,7 @@ #include "PrecompiledHeader.h" #include -#include "PsxCommon.h" +#include "IopCommon.h" namespace R3000A { diff --git a/pcsx2/PsxCommon.h b/pcsx2/IopCommon.h similarity index 77% rename from pcsx2/PsxCommon.h rename to pcsx2/IopCommon.h index 1e7683cdf8..27b8341f4d 100644 --- a/pcsx2/PsxCommon.h +++ b/pcsx2/IopCommon.h @@ -15,37 +15,25 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __PSXCOMMON_H__ -#define __PSXCOMMON_H__ - -#include "PS2Etypes.h" - -#include - -#include "System.h" - -extern long LoadCdBios; -extern int cdOpenCase; +#ifndef __IOPCOMMON_H__ +#define __IOPCOMMON_H__ #define PSXCLK (36864000ULL) /* 36.864 Mhz */ -#include "Plugins.h" -#include "Misc.h" -#include "SaveState.h" - #include "R3000A.h" +#include "Common.h" + +#include "CdRom.h" +#include "CDVD.h" + +#include "Sio.h" +#include "Sif.h" + #include "IopMem.h" #include "IopHw.h" #include "IopBios.h" #include "IopDma.h" #include "IopCounters.h" -#include "CdRom.h" -#include "Sio.h" -#include "DebugTools/Debug.h" #include "IopSio2.h" -#include "CDVD.h" -#include "Memory.h" -#include "Hw.h" -#include "Sif.h" -#endif /* __PSXCOMMON_H__ */ +#endif /* __IOPCOMMON_H__ */ diff --git a/pcsx2/IopCounters.cpp b/pcsx2/IopCounters.cpp index 798af8d94f..10027f1ed5 100644 --- a/pcsx2/IopCounters.cpp +++ b/pcsx2/IopCounters.cpp @@ -23,7 +23,7 @@ #include "PrecompiledHeader.h" #include -#include "PsxCommon.h" +#include "IopCommon.h" /* Config.PsxType == 1: PAL: VBlank interlaced 50.00 Hz diff --git a/pcsx2/IopDma.cpp b/pcsx2/IopDma.cpp index 53995dfb1d..d90b247aaa 100644 --- a/pcsx2/IopDma.cpp +++ b/pcsx2/IopDma.cpp @@ -18,7 +18,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" +#include "IopCommon.h" using namespace R3000A; diff --git a/pcsx2/IopHw.cpp b/pcsx2/IopHw.cpp index 80ea92c464..073102ef86 100644 --- a/pcsx2/IopHw.cpp +++ b/pcsx2/IopHw.cpp @@ -18,8 +18,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" -#include "Misc.h" +#include "IopCommon.h" #include "iR5900.h" // NOTE: Any modifications to read/write fns should also go into their const counterparts diff --git a/pcsx2/IopMem.cpp b/pcsx2/IopMem.cpp index 18d45cf737..0a4d04e582 100644 --- a/pcsx2/IopMem.cpp +++ b/pcsx2/IopMem.cpp @@ -18,7 +18,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "VU.h" #include "iCore.h" #include "Hw.h" diff --git a/pcsx2/IopSio2.cpp b/pcsx2/IopSio2.cpp index ebece56760..04e704e47a 100644 --- a/pcsx2/IopSio2.cpp +++ b/pcsx2/IopSio2.cpp @@ -18,7 +18,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" +#include "IopCommon.h" sio2Struct sio2; diff --git a/pcsx2/Makefile.am b/pcsx2/Makefile.am index 3dcb5723ec..4f6b70356e 100644 --- a/pcsx2/Makefile.am +++ b/pcsx2/Makefile.am @@ -18,7 +18,7 @@ RecoverySystem.cpp Saveslots.cpp libpcsx2_a_SOURCES += \ CDVD.h CDVDiso.h CDVDisodrv.h CDVDlib.h COP0.h Cache.h CdRom.h Common.h Counters.h Decode_XA.h EEregs.h \ Elfheader.h Exceptions.h GS.h Hw.h IopBios.h IopBios2.h IopCounters.h IopDma.h IopHw.h IopMem.h IopSio2.h Memcpyfast.h \ -Memory.h MemoryCard.h Misc.h Patch.h Paths.h Plugins.h PrecompiledHeader.h PsxCommon.h R3000A.h R5900.h R5900OpcodeTables.h \ +Memory.h MemoryCard.h Misc.h Patch.h Paths.h Plugins.h PrecompiledHeader.h IopCommon.h R3000A.h R5900.h R5900OpcodeTables.h \ SPR.h SamplProf.h SaveState.h Sif.h Sifcmd.h Sio.h SafeArray.h Stats.h StringUtils.h System.h Threading.h \ VU.h VUflags.h VUmicro.h VUops.h Vif.h VifDma.h cheatscpp.h vtlb.h NakedAsm.h R5900Exceptions.h HostGui.h Pcsx2Config.h diff --git a/pcsx2/Mdec.cpp b/pcsx2/Mdec.cpp index 3b16800591..839c84669b 100644 --- a/pcsx2/Mdec.cpp +++ b/pcsx2/Mdec.cpp @@ -21,8 +21,7 @@ #include #include -#include "Misc.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "Mdec.h" int iq_y[DCTSIZE2],iq_uv[DCTSIZE2]; diff --git a/pcsx2/MemcpyFast.h b/pcsx2/MemcpyFast.h index c4ceeffa11..652170be88 100644 --- a/pcsx2/MemcpyFast.h +++ b/pcsx2/MemcpyFast.h @@ -25,6 +25,7 @@ #include "Linux/memzero.h" #endif // WIN32 + // Only used in the Windows version of memzero.h. But it's in Misc.cpp for some reason. void _memset16_unaligned( void* dest, u16 data, size_t size ); // The new simplified memcpy_amd_ is now faster than memcpy_raz_. diff --git a/pcsx2/Memory.cpp b/pcsx2/Memory.cpp index 21098ad649..31c604598f 100644 --- a/pcsx2/Memory.cpp +++ b/pcsx2/Memory.cpp @@ -43,10 +43,9 @@ BIOS #include -#include "Common.h" +#include "IopCommon.h" #include "iR5900.h" -#include "PsxCommon.h" #include "VUmicro.h" #include "GS.h" #include "IPU/IPU.h" diff --git a/pcsx2/MemoryCard.cpp b/pcsx2/MemoryCard.cpp index 079309c0ec..b6805cdf3f 100644 --- a/pcsx2/MemoryCard.cpp +++ b/pcsx2/MemoryCard.cpp @@ -18,7 +18,7 @@ #include "PrecompiledHeader.h" -#include "Misc.h" +#include "System.h" #include "MemoryCard.h" #include "Paths.h" diff --git a/pcsx2/Misc.cpp b/pcsx2/Misc.cpp index 801b015fae..676ace76b2 100644 --- a/pcsx2/Misc.cpp +++ b/pcsx2/Misc.cpp @@ -26,8 +26,7 @@ #include -#include "Common.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "HostGui.h" #include "CDVDisodrv.h" @@ -52,6 +51,61 @@ char CdromId[12]; static int g_Pcsx2Recording = 0; // true 1 if recording video and sound bool renderswitch = 0; +#define NUM_STATES 10 +int StatesC = 0; + +extern char strgametitle[256]; + +struct LangDef { + char id[8]; + char name[64]; +}; + +LangDef sLangs[] = { + { "ar_AR", N_("Arabic") }, + { "bg_BG", N_("Bulgarian") }, + { "ca_CA", N_("Catalan") }, + { "cz_CZ", N_("Czech") }, + { "du_DU", N_("Dutch") }, + { "de_DE", N_("German") }, + { "el_EL", N_("Greek") }, + { "en_US", N_("English") }, + { "fr_FR", N_("French") }, + { "hb_HB" , N_("Hebrew") }, + { "hu_HU", N_("Hungarian") }, + { "it_IT", N_("Italian") }, + { "ja_JA", N_("Japanese") }, + { "pe_PE", N_("Persian") }, + { "po_PO", N_("Portuguese") }, + { "po_BR", N_("Portuguese BR") }, + { "pl_PL" , N_("Polish") }, + { "ro_RO", N_("Romanian") }, + { "ru_RU", N_("Russian") }, + { "es_ES", N_("Spanish") }, + { "sh_SH" , N_("S-Chinese") }, + { "sw_SW", N_("Swedish") }, + { "tc_TC", N_("T-Chinese") }, + { "tr_TR", N_("Turkish") }, + { "", "" }, +}; + +#define DIRENTRY_SIZE 16 + +#if defined(_MSC_VER) +#pragma pack(1) +#endif + +struct romdir{ + char fileName[10]; + u16 extInfoSize; + u32 fileSize; +#if defined(_MSC_VER) +}; +#pragma pack() //+22 +#else +} __attribute__((packed)); +#endif + const char *LabelAuthors = { N_( "PCSX2, a PS2 emulator\n\n" "Active Devs: Arcum42, Refraction,\n" @@ -82,74 +136,6 @@ const char *LabelGreets = { N_( ) }; -static struct { - const char *name; - u32 size; -} ioprps[]={ - {"IOPRP14", 43845}, - {"IOPRP142", 48109}, - {"IOPRP143", 58317}, - {"IOPRP144", 58525}, - {"IOPRP15", 82741}, - {"IOPRP151", 82917}, - {"IOPRP153", 82949}, - {"IOPRP16", 91909}, - {"IOPRP165", 98901}, - {"IOPRP20", 109809}, - {"IOPRP202", 110993}, - {"IOPRP205", 119797}, - {"IOPRP21", 126857}, - {"IOPRP211", 129577}, - {"IOPRP213", 129577}, - {"IOPRP214", 140945}, - {"IOPRP22", 199257}, - {"IOPRP221", 196937}, - {"IOPRP222", 198233}, - {"IOPRP224", 201065}, - {"IOPRP23", 230329}, - {"IOPRP234", 247641}, - {"IOPRP24", 251065}, - {"IOPRP241", 251049}, - {"IOPRP242", 252409}, - {"IOPRP243", 253201}, - {"IOPRP250", 264897}, - {"IOPRP252", 265233}, - {"IOPRP253", 267217}, - {"IOPRP254", 264449}, - {"IOPRP255", 264449}, - {"IOPRP260", 248945}, - {"IOPRP270", 249121}, - {"IOPRP271", 266817}, - {"IOPRP280", 269889}, - {"IOPRP300", 275345}, - {"DNAS280", 272753}, - {"DNAS270", 251729}, - {"DNAS271", 268977}, - {"DNAS300", 278641}, - {"DNAS280", 272705}, - {"DNAS255", 264945}, - {NULL, 0} -}; - -void GetRPCVersion(char *ioprp, char *rpcver){ - char *p=ioprp; - int i; - struct TocEntry te; - - if (p && (CDVD_findfile(p+strlen("cdromN:"), &te) != -1)){ - for (i=0; ioprps[i].size>0; i++) - if (te.fileSize==ioprps[i].size) - break; - if (ioprps[i].size>0) - p=(char *)ioprps[i].name; - } - // fixme - Is p really supposed to be set in the middle of an if statement? - if (p && (p=strstr(p, "IOPRP")+strlen("IOPRP"))){ - for (i=0;(i<4) && p && (*p>='0') && (*p<='9');i++, p++) rpcver[i]=*p; - for ( ; i<4 ;i++ ) rpcver[i]='0'; - } -} - u32 GetBiosVersion() { unsigned int fileOffset=0; s8 *ROMVER; @@ -269,44 +255,6 @@ int IsBIOS(char *filename, char *description) return FALSE; //fail quietly } -// LOAD STUFF - -// fixme - Is there any reason why we shouldn't delete this define, and replace the array lengths -// with the actual numbers? -#define ISODCL(from, to) (to - from + 1) - -struct iso_directory_record { - char length [ISODCL (1, 1)]; /* length[1]; 711 */ - char ext_attr_length [ISODCL (2, 2)]; /* ext_attr_length[1]; 711 */ - char extent [ISODCL (3, 10)]; /* extent[8]; 733 */ - char size [ISODCL (11, 18)]; /* size[8]; 733 */ - char date [ISODCL (19, 25)]; /* date[7]; 7 by 711 */ - char flags [ISODCL (26, 26)]; /* flags[1]; */ - char file_unit_size [ISODCL (27, 27)]; /* file_unit_size[1]; 711 */ - char interleave [ISODCL (28, 28)]; /* interleave[1]; 711 */ - char volume_sequence_number [ISODCL (29, 32)]; /* volume_sequence_number[3]; 723 */ - unsigned char name_len [ISODCL (33, 33)]; /* name_len[1]; 711 */ - char name [1]; -}; - -int LoadCdrom() { - return 0; -} - -int CheckCdrom() { - u8 *buf; - - if (CDVDreadTrack(16, CDVD_MODE_2352) == -1) - return -1; - buf = CDVDgetBuffer(); - if (buf == NULL) - return -1; - - strncpy(CdromId, (char*)buf+52, 10); - - return 0; -} - int GetPS2ElfName(char *name){ int f; char buffer[g_MaxPath];//if a file is longer...it should be shorter :D @@ -353,7 +301,6 @@ int GetPS2ElfName(char *name){ FILE *fp; int i; - // inifile_read(CdromId); fp = fopen("System.map", "r"); if( fp == NULL ) return 2; @@ -398,7 +345,6 @@ void SaveGSState(const string& file) g_fGSSave->Freeze( g_nLeftGSFrames ); } -extern uptr pDsp; void LoadGSState(const string& file) { int ret; @@ -450,40 +396,6 @@ void LoadGSState(const string& file) #endif -struct LangDef { - char id[8]; - char name[64]; -}; - -LangDef sLangs[] = { - { "ar_AR", N_("Arabic") }, - { "bg_BG", N_("Bulgarian") }, - { "ca_CA", N_("Catalan") }, - { "cz_CZ", N_("Czech") }, - { "du_DU", N_("Dutch") }, - { "de_DE", N_("German") }, - { "el_EL", N_("Greek") }, - { "en_US", N_("English") }, - { "fr_FR", N_("French") }, - { "hb_HB" , N_("Hebrew") }, - { "hu_HU", N_("Hungarian") }, - { "it_IT", N_("Italian") }, - { "ja_JA", N_("Japanese") }, - { "pe_PE", N_("Persian") }, - { "po_PO", N_("Portuguese") }, - { "po_BR", N_("Portuguese BR") }, - { "pl_PL" , N_("Polish") }, - { "ro_RO", N_("Romanian") }, - { "ru_RU", N_("Russian") }, - { "es_ES", N_("Spanish") }, - { "sh_SH" , N_("S-Chinese") }, - { "sw_SW", N_("Swedish") }, - { "tc_TC", N_("T-Chinese") }, - { "tr_TR", N_("Turkish") }, - { "", "" }, -}; - - char *ParseLang(char *id) { int i=0; @@ -496,11 +408,6 @@ char *ParseLang(char *id) { return id; } -#define NUM_STATES 10 -int StatesC = 0; - -extern char strgametitle[256]; - char* mystrlwr( char* string ) { assert( string != NULL ); @@ -577,10 +484,10 @@ void CycleFrameLimit(int dir) void ProcessFKeys(int fkey, int shift) { - assert(fkey >= 1 && fkey <= 12 ); + assert(fkey >= 1 && fkey <= 12 ); - switch(fkey) { - case 1: + switch(fkey) { + case 1: try { gzSavingState( SaveState::GetFilename( StatesC ) ).FreezeAll(); @@ -701,92 +608,25 @@ void ProcessFKeys(int fkey, int shift) #endif case 12: - if( shift ) { + if( shift ) { #ifdef PCSX2_DEVBUILD - iDumpRegisters(cpuRegs.pc, 0); + iDumpRegisters(cpuRegs.pc, 0); Console::Notice("hardware registers dumped EE:%x, IOP:%x\n", params cpuRegs.pc, psxRegs.pc); #endif - } - else { - g_Pcsx2Recording ^= 1; - if( mtgsThread != NULL ) { + } + else { + g_Pcsx2Recording ^= 1; + if( mtgsThread != NULL ) { mtgsThread->SendSimplePacket(GS_RINGTYPE_RECORD, g_Pcsx2Recording, 0, 0); - } - else { - if( GSsetupRecording != NULL ) GSsetupRecording(g_Pcsx2Recording, NULL); - } + } + else { + if( GSsetupRecording != NULL ) GSsetupRecording(g_Pcsx2Recording, NULL); + } if( SPU2setupRecording != NULL ) SPU2setupRecording(g_Pcsx2Recording, NULL); - } + } break; - } -} - -/*void injectIRX(const char *filename) -{ - char name[260], *p, *q; - struct romdir *rd; - int iROMDIR=-1, iIOPBTCONF=-1, iBLANK=-1, i, filesize; - FILE *fp; - - strcpy(name, filename); - for (i=0; name[i] && name[i]!='.' && i<10; i++) name[i]=toupper(name[i]);name[i]=0; - - //phase 1: find ROMDIR in bios - for (p=(char*)PS2MEM_ROM; p<(char*)PS2MEM_ROM+0x80000; p++) - if (strncmp(p, "RESET", 5)==0) - break; - rd=(struct romdir*)p; - - for (i=0; rd[i].fileName[0]; i++)if (strncmp(rd[i].fileName, name, strlen(name))==0)break; - if (rd[i].fileName[0])return;//already in;) - - //phase 2: make room in IOPBTCONF & ROMDIR - for (i=0; rd[i].fileName[0]; i++)if (strncmp(rd[i].fileName, "ROMDIR", 6)==0)iROMDIR=i; - for (i=0; rd[i].fileName[0]; i++)if (strncmp(rd[i].fileName, "IOPBTCONF", 9)==0)iIOPBTCONF=i; - - for (i=0; rd[i].fileName[0]; i++)if (rd[i].fileName[0]=='-')break; iBLANK=i; - rd[iBLANK].fileSize-=DIRENTRY_SIZE+DIRENTRY_SIZE; - p=(char*)PS2MEM_ROM;for (i=0; iq){*((u64*)p)=*((u64*)p-4);*((u64*)p+1)=*((u64*)p-3);p-=DIRENTRY_SIZE;} - *((u64*)p)=*((u64*)p+1)=0;p-=DIRENTRY_SIZE;rd[iIOPBTCONF].fileSize+=DIRENTRY_SIZE; - - q=(char*)PS2MEM_ROM;for (i=0; i<=iROMDIR; i++) q+=(rd[i].fileSize+0xF)&(~0xF); - while (p >q){*((u64*)p)=*((u64*)p-2);*((u64*)p+1)=*((u64*)p-1);p-=DIRENTRY_SIZE;} - *((u64*)p)=*((u64*)p+1)=0;p-=DIRENTRY_SIZE;rd[iROMDIR].fileSize+=DIRENTRY_SIZE; - - //phase 3: add the name to the end of IOPBTCONF - p=(char*)PS2MEM_ROM;for (i=0; i -#include -#endif - -#undef _ -#define _(String) dgettext (PACKAGE, String) -#ifdef gettext_noop -# define N_(String) gettext_noop (String) -#else -# define N_(String) (String) -#endif - -#else - -#define _(msgid) msgid -#define N_(msgid) msgid - -#endif // ENABLE_NLS - // what the hell is this unused piece of crap passed to every plugin for? (air) // Agreed. It ought to get removed in the next version of the plugin api. (arcum42) extern uptr pDsp; //Used in GS, MTGS, Plugins, Misc @@ -80,9 +49,6 @@ extern void FreezeRegs(int save); #define FreezeXMMRegs(save) if( g_EEFreezeRegs ) { FreezeXMMRegs_(save); } #define FreezeMMXRegs(save) if( g_EEFreezeRegs ) { FreezeMMXRegs_(save); } -// Not used. -//void injectIRX(const char *filename); - // If we move the rest of this stuff, we can probably move these, too. extern void InitCPUTicks(); extern u64 GetCPUTicks(); @@ -96,30 +62,8 @@ extern const char *LabelAuthors; extern const char *LabelGreets; void CycleFrameLimit(int dir); -// Only used in Misc.cpp void SaveGSState(const string& file); void LoadGSState(const string& file); -extern char CdromId[12]; -int LoadCdrom(); -int CheckCdrom(); - -#define DIRENTRY_SIZE 16 - -#if defined(_MSC_VER) -#pragma pack(1) -#endif - -struct romdir{ - char fileName[10]; - u16 extInfoSize; - u32 fileSize; -#if defined(_MSC_VER) -}; -#pragma pack() //+22 -#else -} __attribute__((packed)); -#endif - #endif /* __MISC_H__ */ diff --git a/pcsx2/Patch.cpp b/pcsx2/Patch.cpp index 429a10b887..30414ac479 100644 --- a/pcsx2/Patch.cpp +++ b/pcsx2/Patch.cpp @@ -23,7 +23,7 @@ #define _PC_ // disables MIPS opcode macros. -#include "PsxCommon.h" +#include "IopCommon.h" #include "Paths.h" #include "Patch.h" #include "VU.h" diff --git a/pcsx2/Plugins.cpp b/pcsx2/Plugins.cpp index 3216955736..1238eed877 100644 --- a/pcsx2/Plugins.cpp +++ b/pcsx2/Plugins.cpp @@ -19,8 +19,7 @@ #include "PrecompiledHeader.h" #include "RedtapeWindows.h" -#include "Common.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "GS.h" _GSinit GSinit; diff --git a/pcsx2/PrecompiledHeader.h b/pcsx2/PrecompiledHeader.h index 8bf5cdb6bd..84c3e977d2 100644 --- a/pcsx2/PrecompiledHeader.h +++ b/pcsx2/PrecompiledHeader.h @@ -115,6 +115,33 @@ static __forceinline u32 timeGetTime() # define __unused #endif +///////////////////////////////////////////////////////////////////////// +// GNU GetText / NLS + +#ifdef ENABLE_NLS + +#ifdef _WIN32 +#include "libintlmsc.h" +#else +#include +#include +#endif + +#undef _ +#define _(String) dgettext (PACKAGE, String) +#ifdef gettext_noop +# define N_(String) gettext_noop (String) +#else +# define N_(String) (String) +#endif + +#else + +#define _(msgid) msgid +#define N_(msgid) msgid + +#endif // ENABLE_NLS + ////////////////////////////////////////////////////////////////////////////////////////// // Forceinline macro that is enabled for RELEASE/PUBLIC builds ONLY. (non-inline in devel) // This is useful because forceinline can make certain types of debugging problematic since diff --git a/pcsx2/R3000A.cpp b/pcsx2/R3000A.cpp index 8d28d86a4a..fca5f4de97 100644 --- a/pcsx2/R3000A.cpp +++ b/pcsx2/R3000A.cpp @@ -18,9 +18,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" -#include "Misc.h" - +#include "IopCommon.h" #include "R5900.h" using namespace R3000A; diff --git a/pcsx2/R3000AInterpreter.cpp b/pcsx2/R3000AInterpreter.cpp index 094eb29b72..10f0c7aaee 100644 --- a/pcsx2/R3000AInterpreter.cpp +++ b/pcsx2/R3000AInterpreter.cpp @@ -19,8 +19,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" -#include "Common.h" +#include "IopCommon.h" using namespace R3000A; diff --git a/pcsx2/R3000AOpcodeTables.cpp b/pcsx2/R3000AOpcodeTables.cpp index 7433bda285..98ba9a92de 100644 --- a/pcsx2/R3000AOpcodeTables.cpp +++ b/pcsx2/R3000AOpcodeTables.cpp @@ -18,8 +18,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" -#include "Common.h" +#include "IopCommon.h" extern void zeroEx(); diff --git a/pcsx2/RDebug/deci2_dbgp.cpp b/pcsx2/RDebug/deci2_dbgp.cpp index 7a38786ee4..09ec2f44df 100644 --- a/pcsx2/RDebug/deci2_dbgp.cpp +++ b/pcsx2/RDebug/deci2_dbgp.cpp @@ -18,8 +18,7 @@ #include "PrecompiledHeader.h" -#include "Common.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "VUmicro.h" #include "deci2.h" diff --git a/pcsx2/RDebug/deci2_iloadp.cpp b/pcsx2/RDebug/deci2_iloadp.cpp index dcf733dc2a..86660bf28f 100644 --- a/pcsx2/RDebug/deci2_iloadp.cpp +++ b/pcsx2/RDebug/deci2_iloadp.cpp @@ -18,8 +18,7 @@ #include "PrecompiledHeader.h" -#include "Common.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "IopBios2.h" #include "deci2.h" diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 46c853a89a..318eb53b4a 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -18,8 +18,7 @@ #include "PrecompiledHeader.h" -#include "Common.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "SaveState.h" #include "CDVDisodrv.h" diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index 0a4bc57927..d7fe5fb242 100644 --- a/pcsx2/SaveState.h +++ b/pcsx2/SaveState.h @@ -23,7 +23,7 @@ #ifdef __LINUX__ #include "PS2Edefs.h" #endif - +#include "System.h" // Savestate Versioning! // If you make changes to the savestate version, please increment the value below. diff --git a/pcsx2/Sif.cpp b/pcsx2/Sif.cpp index 5996e030a9..06b11b45b3 100644 --- a/pcsx2/Sif.cpp +++ b/pcsx2/Sif.cpp @@ -20,8 +20,7 @@ #define _PC_ // disables MIPS opcode macros. -#include "PsxCommon.h" -#include "Common.h" +#include "IopCommon.h" #include "Sifcmd.h" using namespace std; diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index ed50adf161..894ad7e180 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -18,7 +18,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "MemoryCard.h" _sio sio; diff --git a/pcsx2/Stats.cpp b/pcsx2/Stats.cpp index 94f7c9d07c..b515c2f7fb 100644 --- a/pcsx2/Stats.cpp +++ b/pcsx2/Stats.cpp @@ -20,8 +20,7 @@ #include -#include "Common.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "Stats.h" #include "Paths.h" diff --git a/pcsx2/System.h b/pcsx2/System.h index 59e4690c8e..5d64ad0040 100644 --- a/pcsx2/System.h +++ b/pcsx2/System.h @@ -20,10 +20,12 @@ #define __SYSTEM_H__ #include "PS2Etypes.h" +#include "Pcsx2Config.h" #include "Exceptions.h" #include "Paths.h" #include "MemcpyFast.h" #include "SafeArray.h" +#include "Misc.h" enum PageProtectionMode diff --git a/pcsx2/configure.ac b/pcsx2/configure.ac index c59dbb1510..4f3d12e5e1 100644 --- a/pcsx2/configure.ac +++ b/pcsx2/configure.ac @@ -35,12 +35,13 @@ else DEBUG_FLAGS=" -O0 -g " fi -WARNING_FLAGS="-Wall -Wno-format -Wno-unused-value" -NORMAL_FLAGS=" -pipe -msse -msse2 -O2 " +WARNING_FLAGS="-Wno-format -Wno-unused-value" +EXTRA_WARNING_FLAGS="-Wall -Wextra" +NORMAL_FLAGS=" -pipe -msse -msse2 -O2 ${WARNING_FLAGS}" # These optimizations seem to cause issues with GCC 4.3.3, so we'll turn them off. NORMAL_FLAGS+=" -fno-guess-branch-probability -fno-dse -fno-tree-dse " -DEBUG_FLAGS+=" -g -msse -msse2 ${WARNING_FLAGS} " +DEBUG_FLAGS+=" -g -msse -msse2 ${EXTRA_WARNING_FLAGS} ${WARNING_FLAGS} " dnl Check for debug build AC_MSG_CHECKING(debug build) diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index c28f50407d..f8e1617bd5 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -3070,6 +3070,10 @@ RelativePath="..\..\Common.h" > + + diff --git a/pcsx2/windows/Win32.h b/pcsx2/windows/Win32.h index 1ad9e1ca58..252475101e 100644 --- a/pcsx2/windows/Win32.h +++ b/pcsx2/windows/Win32.h @@ -27,7 +27,7 @@ #include #include -#include "Misc.h" +#include "System.h" #include "HostGui.h" #include "resource.h" #include "WinDebugResource.h" diff --git a/pcsx2/x86/iCore.h b/pcsx2/x86/iCore.h index 002a2bc7e8..8191ddcfc2 100644 --- a/pcsx2/x86/iCore.h +++ b/pcsx2/x86/iCore.h @@ -324,6 +324,7 @@ void SetFPUstate(); #define MMX_TEMP 0x7f #define MMX_IS32BITS(x) (((x)>=MMX_FPU&&(x)= MMX_GPR && (x) < MMX_GPR+34) struct _mmxregs { diff --git a/pcsx2/x86/iPsxMem.cpp b/pcsx2/x86/iPsxMem.cpp index 4fa4003107..55b6384a0f 100644 --- a/pcsx2/x86/iPsxMem.cpp +++ b/pcsx2/x86/iPsxMem.cpp @@ -18,7 +18,7 @@ #include "PrecompiledHeader.h" -#include "PsxCommon.h" +#include "IopCommon.h" #include "iR3000A.h" #include "VU.h" diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 6a0c6af8dd..4fa5df94cd 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -30,7 +30,7 @@ #include #endif -#include "PsxCommon.h" +#include "IopCommon.h" #include "VU.h" #include "iCore.h" diff --git a/pcsx2/x86/iR3000Atables.cpp b/pcsx2/x86/iR3000Atables.cpp index 2ace926c44..ef66b115dc 100644 --- a/pcsx2/x86/iR3000Atables.cpp +++ b/pcsx2/x86/iR3000Atables.cpp @@ -19,7 +19,7 @@ #include "PrecompiledHeader.h" #include -#include "PsxCommon.h" +#include "IopCommon.h" #include "iR3000A.h" #include "IopMem.h" #include "IopDma.h" diff --git a/pcsx2/x86/ix86-32/iCore-32.cpp b/pcsx2/x86/ix86-32/iCore-32.cpp index d5c054c039..2a8411d4cf 100644 --- a/pcsx2/x86/ix86-32/iCore-32.cpp +++ b/pcsx2/x86/ix86-32/iCore-32.cpp @@ -444,7 +444,7 @@ int _getFreeMMXreg() // check for dead regs for (i=0; i= MMX_GPR && mmxregs[i].reg < MMX_GPR+34 ) { + if (mmxregs[i].reg >= MMX_GPR && mmxregs[i].reg < MMX_GPR+34 ) { // mmxregs[i] is unsigned, and MMX_GPR == 0, so the first part is always true. if( !(g_pCurInstInfo->regs[mmxregs[i].reg-MMX_GPR] & (EEINST_LIVE0|EEINST_LIVE1)) ) { _freeMMXreg(i); return i; From 43d719192748346dde41f6e45bc9e08b2f91bed3 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Fri, 13 Mar 2009 07:20:04 +0000 Subject: [PATCH 26/77] cleanup: moved 'software emulate mul' to gamefixes section since it seems to only be needed by 1 game. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@765 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/windows/AdvancedDlg.cpp | 4 --- pcsx2/windows/WinMain.cpp | 2 ++ pcsx2/windows/pcsx2.rc | 62 ++++++++++++++++++----------------- pcsx2/x86/iFPU.cpp | 4 +-- pcsx2/x86/iFPUd.cpp | 2 +- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/pcsx2/windows/AdvancedDlg.cpp b/pcsx2/windows/AdvancedDlg.cpp index 1546ae31e7..16a6f0d3aa 100644 --- a/pcsx2/windows/AdvancedDlg.cpp +++ b/pcsx2/windows/AdvancedDlg.cpp @@ -35,8 +35,6 @@ static void InitRoundClampModes( HWND hDlg, u32 new_eeopt, u32 new_vuopt ) else if (new_vuopt & 0x1) CheckRadioButton(hDlg, IDC_VU_CLAMPMODE0, IDC_VU_CLAMPMODE3, IDC_VU_CLAMPMODE0 + 1); else CheckRadioButton(hDlg, IDC_VU_CLAMPMODE0, IDC_VU_CLAMPMODE3, IDC_VU_CLAMPMODE0 + 0); - CheckDlgButton(hDlg, IDC_EE_CHECK3, (new_eeopt & 0x8) ? TRUE : FALSE); - if (new_eeopt & 0x4) CheckRadioButton(hDlg, IDC_EE_CLAMPMODE0, IDC_EE_CLAMPMODE3, IDC_EE_CLAMPMODE0 + 3); else if (new_eeopt & 0x2) CheckRadioButton(hDlg, IDC_EE_CLAMPMODE0, IDC_EE_CLAMPMODE3, IDC_EE_CLAMPMODE0 + 2); else if (new_eeopt & 0x1) CheckRadioButton(hDlg, IDC_EE_CLAMPMODE0, IDC_EE_CLAMPMODE3, IDC_EE_CLAMPMODE0 + 1); @@ -96,8 +94,6 @@ BOOL APIENTRY AdvancedOptionsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM new_eeopt |= IsDlgButtonChecked(hDlg, IDC_EE_CLAMPMODE2) ? 0x3 : 0; new_eeopt |= IsDlgButtonChecked(hDlg, IDC_EE_CLAMPMODE3) ? 0x7 : 0; - new_eeopt |= IsDlgButtonChecked(hDlg, IDC_EE_CHECK3) ? 0x8 : 0; - new_vuopt |= IsDlgButtonChecked(hDlg, IDC_VU_CLAMPMODE0) ? 0x0 : 0; new_vuopt |= IsDlgButtonChecked(hDlg, IDC_VU_CLAMPMODE1) ? 0x1 : 0; new_vuopt |= IsDlgButtonChecked(hDlg, IDC_VU_CLAMPMODE2) ? 0x3 : 0; diff --git a/pcsx2/windows/WinMain.cpp b/pcsx2/windows/WinMain.cpp index dc0d9b6fbc..e1dd5a4e83 100644 --- a/pcsx2/windows/WinMain.cpp +++ b/pcsx2/windows/WinMain.cpp @@ -526,6 +526,7 @@ BOOL APIENTRY GameFixes(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if(Config.GameFixes & 0x1) CheckDlgButton(hDlg, IDC_GAMEFIX2, TRUE);//Tri-Ace fix if(Config.GameFixes & 0x4) CheckDlgButton(hDlg, IDC_GAMEFIX3, TRUE);//Digimon FPU compare fix if(Config.GameFixes & 0x2) CheckDlgButton(hDlg, IDC_GAMEFIX4, TRUE);//GoW fix + if(Config.GameFixes & 0x8) CheckDlgButton(hDlg, IDC_GAMEFIX5, TRUE);//Tales of Destiny fix return TRUE; case WM_COMMAND: @@ -535,6 +536,7 @@ BOOL APIENTRY GameFixes(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX2) ? 0x1 : 0; newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX3) ? 0x4 : 0; newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX4) ? 0x2 : 0; + newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX5) ? 0x8 : 0; EndDialog(hDlg, TRUE); diff --git a/pcsx2/windows/pcsx2.rc b/pcsx2/windows/pcsx2.rc index bd892dca42..c1792704d7 100644 --- a/pcsx2/windows/pcsx2.rc +++ b/pcsx2/windows/pcsx2.rc @@ -74,21 +74,23 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN // Dialog // -IDD_GAMEFIXES DIALOGEX 0, 0, 278, 127 +IDD_GAMEFIXES DIALOGEX 0, 0, 279, 132 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Game Special Fixes" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - DEFPUSHBUTTON "OK",IDOK,85,91,50,14 - PUSHBUTTON "Cancel",IDCANCEL,139,91,50,14 - CTEXT "Some games need special settings.\nConfigure them here.",IDC_STATIC,7,7,264,17 - GROUPBOX "PCSX2 Gamefixes",IDC_STATIC,7,31,264,89 + DEFPUSHBUTTON "OK",IDOK,87,105,50,14 + PUSHBUTTON "Cancel",IDCANCEL,142,105,50,14 + CTEXT "Some games need special settings.\nConfigure them here.",IDC_STATIC,7,7,265,17 + GROUPBOX "PCSX2 Gamefixes",IDC_STATIC,7,28,265,97 CONTROL "FPU Compare Hack - Special fix for Digimon Rumble Arena 2.",IDC_GAMEFIX3, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,47,249,10 - CONTROL "VU Add / Sub Hack - Special fix for Tri-Ace games!",IDC_GAMEFIX2, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,61,252,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,43,249,10 + CONTROL "VU Add Hack - Special fix for Tri-Ace games!",IDC_GAMEFIX2, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,72,252,10 CONTROL "VU Clip Hack - Special fix for God of War",IDC_GAMEFIX4, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,75,144,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,86,238,10 + CONTROL "FPU Mul Hack - Special fix for Tales of Destiny (possibly other games).",IDC_GAMEFIX5, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,57,249,10 END @@ -103,10 +105,11 @@ BEGIN IDD_GAMEFIXES, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 271 - VERTGUIDE, 12 + RIGHTMARGIN, 272 + VERTGUIDE, 14 TOPMARGIN, 7 - BOTTOMMARGIN, 120 + BOTTOMMARGIN, 125 + HORZGUIDE, 119 END END #endif // APSTUDIO_INVOKED @@ -195,31 +198,30 @@ BEGIN RADIOBUTTON "Chop / Zero",IDC_EE_ROUNDMODE3,156,36,54,16 CONTROL " Flush to Zero",IDC_EE_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,105,58,13 CONTROL " Denormals are Zero",IDC_EE_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,111,105,79,13 - CONTROL " Flush to Zero",IDC_VU_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,232,58,13 - CONTROL " Denormals are Zero",IDC_VU_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,111,232,81,13 - RADIOBUTTON "Nearest",IDC_VU_ROUNDMODE0,20,172,44,12 - RADIOBUTTON "Negative",IDC_VU_ROUNDMODE1,64,172,47,12 - RADIOBUTTON "Positive",IDC_VU_ROUNDMODE2,111,172,45,12 - RADIOBUTTON "Chop / Zero",IDC_VU_ROUNDMODE3,156,172,52,12 + CONTROL " Flush to Zero",IDC_VU_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,217,58,13 + CONTROL " Denormals are Zero",IDC_VU_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,111,217,81,13 + RADIOBUTTON "Nearest",IDC_VU_ROUNDMODE0,20,157,44,12 + RADIOBUTTON "Negative",IDC_VU_ROUNDMODE1,64,157,47,12 + RADIOBUTTON "Positive",IDC_VU_ROUNDMODE2,111,157,45,12 + RADIOBUTTON "Chop / Zero",IDC_VU_ROUNDMODE3,156,157,52,12 PUSHBUTTON "Defaults",IDDEFAULT,346,254,50,14 - GROUPBOX "VU Recs Options",IDC_STATIC,7,146,250,122,BS_CENTER - GROUPBOX "EE Recs Options",IDC_STATIC,7,12,250,129,BS_CENTER - GROUPBOX "Round Mode",IDC_STATIC,11,159,236,32 + GROUPBOX "VU Recs Options",IDC_STATIC,7,133,250,118,BS_CENTER + GROUPBOX "EE Recs Options",IDC_STATIC,7,12,250,113,BS_CENTER + GROUPBOX "Round Mode",IDC_STATIC,11,144,236,32 GROUPBOX "Round Mode",IDC_STATIC,11,26,236,36 - GROUPBOX "Help",IDC_STATIC,271,12,251,238,BS_CENTER - GROUPBOX "Clamp Mode",IDC_STATIC,11,196,236,31 - RADIOBUTTON "None",IDC_VU_CLAMPMODE0,20,207,44,12 - RADIOBUTTON "Normal",IDC_VU_CLAMPMODE1,64,207,47,12 - RADIOBUTTON "Extra",IDC_VU_CLAMPMODE2,111,207,45,12 - RADIOBUTTON "Extra + Preserve Sign",IDC_VU_CLAMPMODE3,156,207,85,12 - CONTROL " Set O and U Flags",IDC_VU_CHECK3,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,20,250,91,13 - CONTROL " Software Emulate DaZ",IDC_VU_CHECK4,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,111,250,116,13 + GROUPBOX "Help",IDC_STATIC,271,12,251,239,BS_CENTER + GROUPBOX "Clamp Mode",IDC_STATIC,11,181,236,31 + RADIOBUTTON "None",IDC_VU_CLAMPMODE0,20,192,44,12 + RADIOBUTTON "Normal",IDC_VU_CLAMPMODE1,64,192,47,12 + RADIOBUTTON "Extra",IDC_VU_CLAMPMODE2,111,192,45,12 + RADIOBUTTON "Extra + Preserve Sign",IDC_VU_CLAMPMODE3,156,192,85,12 + CONTROL " Set O and U Flags",IDC_VU_CHECK3,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,20,235,91,13 + CONTROL " Software Emulate DaZ",IDC_VU_CHECK4,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,111,235,116,13 GROUPBOX "Clamp Mode",IDC_STATIC,11,67,236,31 RADIOBUTTON "None",IDC_EE_CLAMPMODE0,20,76,44,16 RADIOBUTTON "Normal",IDC_EE_CLAMPMODE1,64,76,47,16 RADIOBUTTON "Extra + Preserve Sign",IDC_EE_CLAMPMODE2,111,76,91,16 RADIOBUTTON "Full",IDC_EE_CLAMPMODE3,202,76,38,16 - CONTROL " Software Emulate MUL",IDC_EE_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,123,116,13 LTEXT "These options specify how your CPU rounds floating point values.\n\nTry changing the roundmode for EE if your game hangs, it could make it work again.",IDC_STATIC,287,33,216,35 GROUPBOX "Round Mode",IDC_STATIC,281,22,235,51,BS_LEFT GROUPBOX "Clamp Mode",IDC_STATIC,281,80,236,127,BS_LEFT diff --git a/pcsx2/x86/iFPU.cpp b/pcsx2/x86/iFPU.cpp index fcfdc6a140..7e02e4877c 100644 --- a/pcsx2/x86/iFPU.cpp +++ b/pcsx2/x86/iFPU.cpp @@ -592,7 +592,7 @@ void FPU_SUB(int regd, int regt) { // FPU_MUL (Used to approximate PS2's FPU mul behavior) //------------------------------------------------------------------ // PS2's multiplication uses some modification (possibly not the one used in this function) -// of booth multiplication with wallace trees (not used in this function) +// of booth multiplication with wallace trees (not used in this function) // it cuts of some bits, resulting in inaccurate and non-commutative results. // This function attempts to replicate this. It is currently inaccurate. But still not too bad. //------------------------------------------------------------------ @@ -653,7 +653,7 @@ u32 __fastcall FPU_MUL_MANTISSA(u32 s, u32 t) void FPU_MUL(int regd, int regt) { - if (CHECK_FPU_ATTEMPT_MUL) + if (CHECK_FPUMULHACK) { SSE2_MOVD_XMM_to_R(ECX, regd); SSE2_MOVD_XMM_to_R(EDX, regt); diff --git a/pcsx2/x86/iFPUd.cpp b/pcsx2/x86/iFPUd.cpp index 12b887fbe0..7b9e0edb68 100644 --- a/pcsx2/x86/iFPUd.cpp +++ b/pcsx2/x86/iFPUd.cpp @@ -391,7 +391,7 @@ void FPU_ADD_SUB(int tempd, int tempt) //tempd and tempt are overwritten, they a void FPU_MUL(int info, int regd, int sreg, int treg, bool acc) { - if (CHECK_FPU_ATTEMPT_MUL) + if (CHECK_FPUMULHACK) { SSE2_MOVD_XMM_to_R(ECX, sreg); SSE2_MOVD_XMM_to_R(EDX, treg); From c15b3129d40a54418af6cc7bd2d69067c2b713c7 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 13 Mar 2009 07:25:00 +0000 Subject: [PATCH 27/77] Preliminary work on a new version of the plugin api. Not hooked up, and very subject to change. Mainly committed both for backup, and for other devs to mess with... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@766 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Pcsx2Api.h | 99 ++++++++ common/include/PluginCallbacks.h | 394 +++++++++++++++++++++++++++++++ common/include/api/CDVDApi.h | 133 +++++++++++ common/include/api/Dev9Api.h | 65 +++++ common/include/api/FWApi.h | 56 +++++ common/include/api/GSApi.h | 84 +++++++ common/include/api/PadApi.h | 66 ++++++ common/include/api/SIOApi.h | 56 +++++ common/include/api/Spu2Api.h | 65 +++++ common/include/api/USBApi.h | 63 +++++ 10 files changed, 1081 insertions(+) create mode 100644 common/include/Pcsx2Api.h create mode 100644 common/include/PluginCallbacks.h create mode 100644 common/include/api/CDVDApi.h create mode 100644 common/include/api/Dev9Api.h create mode 100644 common/include/api/FWApi.h create mode 100644 common/include/api/GSApi.h create mode 100644 common/include/api/PadApi.h create mode 100644 common/include/api/SIOApi.h create mode 100644 common/include/api/Spu2Api.h create mode 100644 common/include/api/USBApi.h diff --git a/common/include/Pcsx2Api.h b/common/include/Pcsx2Api.h new file mode 100644 index 0000000000..d621419bcd --- /dev/null +++ b/common/include/Pcsx2Api.h @@ -0,0 +1,99 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __PCSX2API_H__ +#define __PCSX2API_H__ + +// Note; this header is experimental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + +#include "Pcsx2Types.h" +#include "Pcsx2Defs.h" + +// Indicate to use the new versions. +#define NEW_PLUGIN_APIS + +#ifdef _MSC_VER +#define EXPORT_C(type) extern "C" __declspec(dllexport) type CALLBACK +#else +#define EXPORT_C(type) extern "C" type +#endif + +EXPORT_C(u32) PS2EgetLibType(void); +EXPORT_C(u32) PS2EgetLibVersion2(u32 type); +EXPORT_C(char*) PS2EgetLibName(void); + +// PS2EgetLibType returns (may be OR'd) +enum { +PS2E_LT_GS = 0x01, +PS2E_LT_PAD = 0x02, // -=[ OBSOLETE ]=- +PS2E_LT_SPU2 = 0x04, +PS2E_LT_CDVD = 0x08, +PS2E_LT_DEV9 = 0x10, +PS2E_LT_USB = 0x20, +PS2E_LT_FW = 0x40, +PS2E_LT_SIO = 0x80 +} PluginLibType; + +// PS2EgetLibVersion2 (high 16 bits) +enum { +PS2E_GS_VERSION = 0x0006, +PS2E_PAD_VERSION = 0x0002, // -=[ OBSOLETE ]=- +PS2E_SPU2_VERSION = 0x0005, +PS2E_CDVD_VERSION = 0x0005, +PS2E_DEV9_VERSION = 0x0003, +PS2E_USB_VERSION = 0x0003, +PS2E_FW_VERSION = 0x0002, +PS2E_SIO_VERSION = 0x0001 +} PluginLibVersion; + +enum { +SIO_TYPE_PAD = 0x00000001, +SIO_TYPE_MTAP = 0x00000004, +SIO_TYPE_RM = 0x00000040, +SIO_TYPE_MC = 0x00000100 +} SioTypes; + +// freeze modes: +enum { +FREEZE_LOAD = 0, +FREEZE_SAVE = 1, +FREEZE_SIZE = 2 +} FreezeModes; + +typedef struct _GSdriverInfo { + char name[8]; + void *common; +} GSdriverInfo; + +#ifdef _MSC_VER +typedef struct _winInfo { // unsupported values must be set to zero + HWND hWnd; + HMENU hMenu; + HWND hStatusWnd; +} winInfo; +#endif + +#endif // __PCSX2API_H__ \ No newline at end of file diff --git a/common/include/PluginCallbacks.h b/common/include/PluginCallbacks.h new file mode 100644 index 0000000000..0545235215 --- /dev/null +++ b/common/include/PluginCallbacks.h @@ -0,0 +1,394 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __PLUGINCALLBACKS_H__ +#define __PLUGINCALLBACKS_H__ + +extern "C" { +typedef u32 (CALLBACK* _PS2EgetLibType)(void); +typedef u32 (CALLBACK* _PS2EgetLibVersion2)(u32 type); +typedef char*(CALLBACK* _PS2EgetLibName)(void); + +// GS +// NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs +// If you want to use them, need to save and restore current ones +typedef s32 (CALLBACK* _GSinit)(char *configpath); +typedef s32 (CALLBACK* _GSopen)(char *Title, bool multithread); +typedef void (CALLBACK* _GSclose)(); +typedef void (CALLBACK* _GSshutdown)(); +typedef void (CALLBACK* _GSvsync)(int field); +typedef void (CALLBACK* _GSgifTransfer1)(u32 *pMem, u32 addr); +typedef void (CALLBACK* _GSgifTransfer2)(u32 *pMem, u32 size); +typedef void (CALLBACK* _GSgifTransfer3)(u32 *pMem, u32 size); +typedef void (CALLBACK* _GSgetLastTag)(u64* ptag); // returns the last tag processed (64 bits) +typedef void (CALLBACK* _GSgifSoftReset)(u32 mask); +typedef void (CALLBACK* _GSreadFIFO)(u64 *pMem); +typedef void (CALLBACK* _GSreadFIFO2)(u64 *pMem, int qwc); + +typedef void (CALLBACK* _GSkeyEvent)(keyEvent* ev); +typedef void (CALLBACK* _GSchangeSaveState)(s32 state, const char* filename); +typedef void (CALLBACK* _GSirqCallback)(void (*callback)()); +typedef void (CALLBACK* _GSprintf)(s32 timeout, char *fmt, ...); +typedef void (CALLBACK* _GSsetBaseMem)(void*); +typedef void (CALLBACK* _GSsetGameCRC)(s32 crc, s32 gameoptions); + +typedef void (CALLBACK* _GSsetFrameSkip)(int frameskip); +typedef bool (CALLBACK* _GSsetupRecording)(bool start); +typedef void (CALLBACK* _GSreset)(); +typedef void (CALLBACK* _GSwriteCSR)(u32 value); +typedef void (CALLBACK* _GSgetDriverInfo)(GSdriverInfo *info); +#ifdef _WINDOWS_ +typedef s32 (CALLBACK* _GSsetWindowInfo)(winInfo *info); +#endif +typedef void (CALLBACK* _GSmakeSnapshot)(const char *path); +typedef void (CALLBACK* _GSmakeSnapshot2)(const char *path, int*, int); +typedef s32 (CALLBACK* _GSfreeze)(u8 mode, freezeData *data); +typedef void (CALLBACK* _GSconfigure)(); +typedef s32 (CALLBACK* _GStest)(); +typedef void (CALLBACK* _GSabout)(); + +// PAD +typedef s32 (CALLBACK* _PADinit)(char *configpath, u32 flags); +typedef s32 (CALLBACK* _PADopen)(); +typedef void (CALLBACK* _PADclose)(); +typedef void (CALLBACK* _PADshutdown)(); +typedef keyEvent* (CALLBACK* _PADkeyEvent)(); +typedef u8 (CALLBACK* _PADstartPoll)(u8 pad); +typedef u8 (CALLBACK* _PADpoll)(u8 value); +typedef u32 (CALLBACK* _PADquery)(); +typedef void (CALLBACK* _PADupdate)(u8 pad); + +typedef void (CALLBACK* _PADgsDriverInfo)(GSdriverInfo *info); +typedef void (CALLBACK* _PADconfigure)(); +typedef s32 (CALLBACK* _PADtest)(); +typedef void (CALLBACK* _PADabout)(); + +// SIO +typedef s32 (CALLBACK* _SIOinit)(char *configpath, u32 port, u32 slot, SIOchangeSlotCB f); +typedef s32 (CALLBACK* _SIOopen)(); +typedef void (CALLBACK* _SIOclose)(); +typedef void (CALLBACK* _SIOshutdown)(); +typedef u8 (CALLBACK* _SIOstartPoll)(u8 value); +typedef u8 (CALLBACK* _SIOpoll)(u8 value); +typedef u32 (CALLBACK* _SIOquery)(); + +typedef void (CALLBACK* _SIOconfigure)(); +typedef s32 (CALLBACK* _SIOtest)(); +typedef void (CALLBACK* _SIOabout)(); + +// SPU2 +// NOTE: The read/write functions CANNOT use XMM/MMX regs +// If you want to use them, need to save and restore current ones +typedef s32 (CALLBACK* _SPU2init)(char *configpath); +typedef s32 (CALLBACK* _SPU2open)(); +typedef void (CALLBACK* _SPU2close)(); +typedef void (CALLBACK* _SPU2shutdown)(); +typedef void (CALLBACK* _SPU2write)(u32 mem, u16 value); +typedef u16 (CALLBACK* _SPU2read)(u32 mem); +typedef void (CALLBACK* _SPU2readDMAMem)(u16 *pMem, u32 size, u8 core); +typedef void (CALLBACK* _SPU2writeDMAMem)(u16 *pMem, u32 size, u8 core); +typedef void (CALLBACK* _SPU2interruptDMA)(u8 core); +typedef void (CALLBACK* _SPU2setDMABaseAddr)(uptr baseaddr); +typedef void (CALLBACK* _SPU2irqCallback)(void (*SPU2callback)(),void (*DMA4callback)(),void (*DMA7callback)()); +typedef bool (CALLBACK* _SPU2setupRecording)(bool start); + +typedef void (CALLBACK* _SPU2setClockPtr)(u32*ptr); +typedef void (CALLBACK* _SPU2setTimeStretcher)(short int enable); + +typedef u32 (CALLBACK* _SPU2ReadMemAddr)(u8 core); +typedef void (CALLBACK* _SPU2WriteMemAddr)(u8 core,u32 value); +typedef void (CALLBACK* _SPU2async)(u32 cycles); +typedef s32 (CALLBACK* _SPU2freeze)(int mode, freezeData *data); +typedef void (CALLBACK* _SPU2configure)(); +typedef s32 (CALLBACK* _SPU2test)(); +typedef void (CALLBACK* _SPU2about)(); + +// CDVD +// NOTE: The read/write functions CANNOT use XMM/MMX regs +// If you want to use them, need to save and restore current ones +typedef s32 (CALLBACK* _CDVDinit)(char *configpath); +typedef s32 (CALLBACK* _CDVDopen)(const char* pTitleFilename); +typedef void (CALLBACK* _CDVDclose)(); +typedef void (CALLBACK* _CDVDshutdown)(); +typedef s32 (CALLBACK* _CDVDreadTrack)(u32 lsn, int mode); +typedef u8* (CALLBACK* _CDVDgetBuffer)(); +typedef s32 (CALLBACK* _CDVDreadSubQ)(u32 lsn, cdvdSubQ* subq); +typedef s32 (CALLBACK* _CDVDgetTN)(cdvdTN *Buffer); +typedef s32 (CALLBACK* _CDVDgetTD)(u8 Track, cdvdTD *Buffer); +typedef s32 (CALLBACK* _CDVDgetTOC)(void* toc); +typedef s32 (CALLBACK* _CDVDgetDiskType)(); +typedef s32 (CALLBACK* _CDVDgetTrayStatus)(); +typedef s32 (CALLBACK* _CDVDctrlTrayOpen)(); +typedef s32 (CALLBACK* _CDVDctrlTrayClose)(); + +typedef void (CALLBACK* _CDVDconfigure)(); +typedef s32 (CALLBACK* _CDVDtest)(); +typedef void (CALLBACK* _CDVDabout)(); +typedef void (CALLBACK* _CDVDnewDiskCB)(void (*callback)()); + +// DEV9 +// NOTE: The read/write functions CANNOT use XMM/MMX regs +// If you want to use them, need to save and restore current ones +typedef s32 (CALLBACK* _DEV9init)(char *configpath); +typedef s32 (CALLBACK* _DEV9open)(); +typedef void (CALLBACK* _DEV9close)(); +typedef void (CALLBACK* _DEV9shutdown)(); +typedef u8 (CALLBACK* _DEV9read8)(u32 mem); +typedef u16 (CALLBACK* _DEV9read16)(u32 mem); +typedef u32 (CALLBACK* _DEV9read32)(u32 mem); +typedef void (CALLBACK* _DEV9write8)(u32 mem, u8 value); +typedef void (CALLBACK* _DEV9write16)(u32 mem, u16 value); +typedef void (CALLBACK* _DEV9write32)(u32 mem, u32 value); +typedef void (CALLBACK* _DEV9readDMA8Mem)(u32 *pMem, int size); +typedef void (CALLBACK* _DEV9writeDMA8Mem)(u32 *pMem, int size); +typedef void (CALLBACK* _DEV9irqCallback)(DEV9callback callback); +typedef DEV9handler (CALLBACK* _DEV9irqHandler)(void); + +typedef s32 (CALLBACK* _DEV9freeze)(int mode, freezeData *data); +typedef void (CALLBACK* _DEV9configure)(); +typedef s32 (CALLBACK* _DEV9test)(); +typedef void (CALLBACK* _DEV9about)(); + +// USB +// NOTE: The read/write functions CANNOT use XMM/MMX regs +// If you want to use them, need to save and restore current ones +typedef s32 (CALLBACK* _USBinit)(char *configpath); +typedef s32 (CALLBACK* _USBopen)(); +typedef void (CALLBACK* _USBclose)(); +typedef void (CALLBACK* _USBshutdown)(); +typedef u8 (CALLBACK* _USBread8)(u32 mem); +typedef u16 (CALLBACK* _USBread16)(u32 mem); +typedef u32 (CALLBACK* _USBread32)(u32 mem); +typedef void (CALLBACK* _USBwrite8)(u32 mem, u8 value); +typedef void (CALLBACK* _USBwrite16)(u32 mem, u16 value); +typedef void (CALLBACK* _USBwrite32)(u32 mem, u32 value); +typedef void (CALLBACK* _USBasync)(u32 cycles); + + +typedef void (CALLBACK* _USBirqCallback)(USBcallback callback); +typedef USBhandler (CALLBACK* _USBirqHandler)(void); +typedef void (CALLBACK* _USBsetRAM)(void *mem); + +typedef s32 (CALLBACK* _USBfreeze)(int mode, freezeData *data); +typedef void (CALLBACK* _USBconfigure)(); +typedef s32 (CALLBACK* _USBtest)(); +typedef void (CALLBACK* _USBabout)(); + +//FW +typedef s32 (CALLBACK* _FWinit)(char *configpath); +typedef s32 (CALLBACK* _FWopen)(); +typedef void (CALLBACK* _FWclose)(); +typedef void (CALLBACK* _FWshutdown)(); +typedef u32 (CALLBACK* _FWread32)(u32 mem); +typedef void (CALLBACK* _FWwrite32)(u32 mem, u32 value); +typedef void (CALLBACK* _FWirqCallback)(void (*callback)()); + +typedef s32 (CALLBACK* _FWfreeze)(int mode, freezeData *data); +typedef void (CALLBACK* _FWconfigure)(); +typedef s32 (CALLBACK* _FWtest)(); +typedef void (CALLBACK* _FWabout)(); + +// GS +extern _GSinit GSinit; +extern _GSopen GSopen; +extern _GSclose GSclose; +extern _GSshutdown GSshutdown; +extern _GSvsync GSvsync; +extern _GSgifTransfer1 GSgifTransfer1; +extern _GSgifTransfer2 GSgifTransfer2; +extern _GSgifTransfer3 GSgifTransfer3; +extern _GSgetLastTag GSgetLastTag; +extern _GSgifSoftReset GSgifSoftReset; +extern _GSreadFIFO GSreadFIFO; +extern _GSreadFIFO2 GSreadFIFO2; + +extern _GSkeyEvent GSkeyEvent; +extern _GSchangeSaveState GSchangeSaveState; +extern _GSmakeSnapshot GSmakeSnapshot; +extern _GSmakeSnapshot2 GSmakeSnapshot2; +extern _GSirqCallback GSirqCallback; +extern _GSprintf GSprintf; +extern _GSsetBaseMem GSsetBaseMem; +extern _GSsetGameCRC GSsetGameCRC; +extern _GSsetFrameSkip GSsetFrameSkip; +extern _GSsetupRecording GSsetupRecording; +extern _GSreset GSreset; +extern _GSwriteCSR GSwriteCSR; +extern _GSgetDriverInfo GSgetDriverInfo; +#ifdef _WINDOWS_ +extern _GSsetWindowInfo GSsetWindowInfo; +#endif +extern _GSfreeze GSfreeze; +extern _GSconfigure GSconfigure; +extern _GStest GStest; +extern _GSabout GSabout; + +// PAD1 +extern _PADinit PAD1init; +extern _PADopen PAD1open; +extern _PADclose PAD1close; +extern _PADshutdown PAD1shutdown; +extern _PADkeyEvent PAD1keyEvent; +extern _PADstartPoll PAD1startPoll; +extern _PADpoll PAD1poll; +extern _PADquery PAD1query; +extern _PADupdate PAD1update; + +extern _PADgsDriverInfo PAD1gsDriverInfo; +extern _PADconfigure PAD1configure; +extern _PADtest PAD1test; +extern _PADabout PAD1about; + +// PAD2 +extern _PADinit PAD2init; +extern _PADopen PAD2open; +extern _PADclose PAD2close; +extern _PADshutdown PAD2shutdown; +extern _PADkeyEvent PAD2keyEvent; +extern _PADstartPoll PAD2startPoll; +extern _PADpoll PAD2poll; +extern _PADquery PAD2query; +extern _PADupdate PAD2update; + +extern _PADgsDriverInfo PAD2gsDriverInfo; +extern _PADconfigure PAD2configure; +extern _PADtest PAD2test; +extern _PADabout PAD2about; + +// SIO[2] +extern _SIOinit SIOinit[2][9]; +extern _SIOopen SIOopen[2][9]; +extern _SIOclose SIOclose[2][9]; +extern _SIOshutdown SIOshutdown[2][9]; +extern _SIOstartPoll SIOstartPoll[2][9]; +extern _SIOpoll SIOpoll[2][9]; +extern _SIOquery SIOquery[2][9]; + +extern _SIOconfigure SIOconfigure[2][9]; +extern _SIOtest SIOtest[2][9]; +extern _SIOabout SIOabout[2][9]; + +// SPU2 +extern _SPU2init SPU2init; +extern _SPU2open SPU2open; +extern _SPU2close SPU2close; +extern _SPU2shutdown SPU2shutdown; +extern _SPU2write SPU2write; +extern _SPU2read SPU2read; +extern _SPU2readDMA4Mem SPU2readDMA4Mem; +extern _SPU2writeDMA4Mem SPU2writeDMA4Mem; +extern _SPU2interruptDMA4 SPU2interruptDMA4; +extern _SPU2readDMA7Mem SPU2readDMA7Mem; +extern _SPU2writeDMA7Mem SPU2writeDMA7Mem; +extern _SPU2setDMABaseAddr SPU2setDMABaseAddr; +extern _SPU2interruptDMA7 SPU2interruptDMA7; +extern _SPU2ReadMemAddr SPU2ReadMemAddr; +extern _SPU2setupRecording SPU2setupRecording; +extern _SPU2WriteMemAddr SPU2WriteMemAddr; +extern _SPU2irqCallback SPU2irqCallback; + +extern _SPU2setClockPtr SPU2setClockPtr; +extern _SPU2setTimeStretcher SPU2setTimeStretcher; + +extern _SPU2async SPU2async; +extern _SPU2freeze SPU2freeze; +extern _SPU2configure SPU2configure; +extern _SPU2test SPU2test; +extern _SPU2about SPU2about; + +// CDVD +extern _CDVDinit CDVDinit; +extern _CDVDopen CDVDopen; +extern _CDVDclose CDVDclose; +extern _CDVDshutdown CDVDshutdown; +extern _CDVDreadTrack CDVDreadTrack; +extern _CDVDgetBuffer CDVDgetBuffer; +extern _CDVDreadSubQ CDVDreadSubQ; +extern _CDVDgetTN CDVDgetTN; +extern _CDVDgetTD CDVDgetTD; +extern _CDVDgetTOC CDVDgetTOC; +extern _CDVDgetDiskType CDVDgetDiskType; +extern _CDVDgetTrayStatus CDVDgetTrayStatus; +extern _CDVDctrlTrayOpen CDVDctrlTrayOpen; +extern _CDVDctrlTrayClose CDVDctrlTrayClose; + +extern _CDVDconfigure CDVDconfigure; +extern _CDVDtest CDVDtest; +extern _CDVDabout CDVDabout; +extern _CDVDnewDiskCB CDVDnewDiskCB; + +// DEV9 +extern _DEV9init DEV9init; +extern _DEV9open DEV9open; +extern _DEV9close DEV9close; +extern _DEV9shutdown DEV9shutdown; +extern _DEV9read8 DEV9read8; +extern _DEV9read16 DEV9read16; +extern _DEV9read32 DEV9read32; +extern _DEV9write8 DEV9write8; +extern _DEV9write16 DEV9write16; +extern _DEV9write32 DEV9write32; +extern _DEV9readDMA8Mem DEV9readDMA8Mem; +extern _DEV9writeDMA8Mem DEV9writeDMA8Mem; +extern _DEV9irqCallback DEV9irqCallback; +extern _DEV9irqHandler DEV9irqHandler; + +extern _DEV9configure DEV9configure; +extern _DEV9freeze DEV9freeze; +extern _DEV9test DEV9test; +extern _DEV9about DEV9about; + +// USB +extern _USBinit USBinit; +extern _USBopen USBopen; +extern _USBclose USBclose; +extern _USBshutdown USBshutdown; +extern _USBread8 USBread8; +extern _USBread16 USBread16; +extern _USBread32 USBread32; +extern _USBwrite8 USBwrite8; +extern _USBwrite16 USBwrite16; +extern _USBwrite32 USBwrite32; +extern _USBasync USBasync; + +extern _USBirqCallback USBirqCallback; +extern _USBirqHandler USBirqHandler; +extern _USBsetRAM USBsetRAM; + +extern _USBconfigure USBconfigure; +extern _USBfreeze USBfreeze; +extern _USBtest USBtest; +extern _USBabout USBabout; + +// FW +extern _FWinit FWinit; +extern _FWopen FWopen; +extern _FWclose FWclose; +extern _FWshutdown FWshutdown; +extern _FWread32 FWread32; +extern _FWwrite32 FWwrite32; +extern _FWirqCallback FWirqCallback; + +extern _FWconfigure FWconfigure; +extern _FWfreeze FWfreeze; +extern _FWtest FWtest; +extern _FWabout FWabout; +} + +#endif // __PLUGINCALLBACKS_H__ diff --git a/common/include/api/CDVDApi.h b/common/include/api/CDVDApi.h new file mode 100644 index 0000000000..9ace43c7ae --- /dev/null +++ b/common/include/api/CDVDApi.h @@ -0,0 +1,133 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __CDVDAPI_H__ +#define __CDVDAPI_H__ + +// Note; this header is experimental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + +#include "Pcsx2Api.h" + +/* CDVD plugin API */ + +// Basic functions. + +EXPORT_C_(s32) CDVDinit(char *configpath); +EXPORT_C_(s32) CDVDopen(const char* pTitleFilename); +EXPORT_C_(void) CDVDclose(); +EXPORT_C_(void) CDVDshutdown(); +EXPORT_C_(s32) CDVDreadTrack(u32 lsn, int mode); + +// return can be NULL (for async modes) +EXPORT_C_(u8*) CDVDgetBuffer(); + +EXPORT_C_(s32) CDVDreadSubQ(u32 lsn, cdvdSubQ* subq);//read subq from disc (only cds have subq data) +EXPORT_C_(s32) CDVDgetTN(cdvdTN *Buffer); //disk information +EXPORT_C_(s32) CDVDgetTD(u8 Track, cdvdTD *Buffer); //track info: min,sec,frame,type +EXPORT_C_(s32) CDVDgetTOC(void* toc); //gets ps2 style toc from disc +EXPORT_C_(s32) CDVDgetDiskType(); //CDVD_TYPE_xxxx +EXPORT_C_(s32) CDVDgetTrayStatus(); //CDVD_TRAY_xxxx +EXPORT_C_(s32) CDVDctrlTrayOpen(); //open disc tray +EXPORT_C_(s32) CDVDctrlTrayClose(); //close disc tray + +// Extended functions + +EXPORT_C_(void) CDVDconfigure(); +EXPORT_C_(void) CDVDabout(); +EXPORT_C_(s32) CDVDtest(); +EXPORT_C_(void) CDVDnewDiskCB(void (*callback)()); + +typedef struct _cdvdSubQ { + u8 ctrl:4; // control and mode bits + u8 mode:4; // control and mode bits + u8 trackNum; // current track number (1 to 99) + u8 trackIndex; // current index within track (0 to 99) + u8 trackM; // current minute location on the disc (BCD encoded) + u8 trackS; // current sector location on the disc (BCD encoded) + u8 trackF; // current frame location on the disc (BCD encoded) + u8 pad; // unused + u8 discM; // current minute offset from first track (BCD encoded) + u8 discS; // current sector offset from first track (BCD encoded) + u8 discF; // current frame offset from first track (BCD encoded) +} cdvdSubQ; + +typedef struct _cdvdTD { // NOT bcd coded + u32 lsn; + u8 type; +} cdvdTD; + +typedef struct _cdvdTN { + u8 strack; //number of the first track (usually 1) + u8 etrack; //number of the last track +} cdvdTN; + +// CDVDreadTrack mode values: +enum { +CDVD_MODE_2352 0, // full 2352 bytes +CDVD_MODE_2340 1, // skip sync (12) bytes +CDVD_MODE_2328 2, // skip sync+head+sub (24) bytes +CDVD_MODE_2048 3, // skip sync+head+sub (24) bytes +CDVD_MODE_2368 4 // full 2352 bytes + 16 subq +} TrackModes + +// CDVDgetDiskType returns: +enum { +CDVD_TYPE_ILLEGAL = 0xff, // Illegal Disc +CDVD_TYPE_DVDV = 0xfe, // DVD Video +CDVD_TYPE_CDDA = 0xfd, // Audio CD +CDVD_TYPE_PS2DVD = 0x14, // PS2 DVD +CDVD_TYPE_PS2CDDA = 0x13, // PS2 CD (with audio) +CDVD_TYPE_PS2CD = 0x12, // PS2 CD +CDVD_TYPE_PSCDDA = 0x11, // PS CD (with audio) +CDVD_TYPE_PSCD = 0x10, // PS CD +CDVD_TYPE_UNKNOWN = 0x05, // Unknown +CDVD_TYPE_DETCTDVDD = 0x04, // Detecting Dvd Dual Sided +CDVD_TYPE_DETCTDVDS = 0x03, // Detecting Dvd Single Sided +CDVD_TYPE_DETCTCD = 0x02, // Detecting Cd +CDVD_TYPE_DETCT = 0x01, // Detecting +CDVD_TYPE_NODISC = 0x00 // No Disc +} DiskType; + +// CDVDgetTrayStatus returns: +enum { +CDVD_TRAY_CLOSE = 0x00, +CDVD_TRAY_OPEN = 0x01 +} TrayStatus; + +// cdvdTD.type (track types for cds) +enum { +CDVD_AUDIO_TRACK = 0x01, +CDVD_MODE1_TRACK = 0x41, +CDVD_MODE2_TRACK = 0x61 +} CDVDTDType; + +enum { +CDVD_AUDIO_MASK = 0x00, +CDVD_DATA_MASK = 0x40 +// CDROM_DATA_TRACK 0x04 //do not enable this! (from linux kernel) +} CDVD_Masks; + +#endif // __CDVDAPI_H__ \ No newline at end of file diff --git a/common/include/api/Dev9Api.h b/common/include/api/Dev9Api.h new file mode 100644 index 0000000000..cd6746453c --- /dev/null +++ b/common/include/api/Dev9Api.h @@ -0,0 +1,65 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __DEV9API_H__ +#define __DEV9API_H__ + +// Note; this header is experimental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + * linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + +#include "Pcsx2Api.h" + +typedef void (*DEV9callback)(int cycles); +typedef int (*DEV9handler)(void); + +// Basic functions. +// NOTE: The read/write functions CANNOT use XMM/MMX regs +// If you want to use them, need to save and restore current ones +EXPORT_C_(s32) DEV9init(char *configpath); +EXPORT_C_(s32) DEV9open(); +EXPORT_C_(void) DEV9close(); +EXPORT_C_(void) DEV9shutdown(); +EXPORT_C_(u8) DEV9read8(u32 addr); +EXPORT_C_(u16) DEV9read16(u32 addr); +EXPORT_C_(u32) DEV9read32(u32 addr); +EXPORT_C_(void) DEV9write8(u32 addr, u8 value); +EXPORT_C_(void) DEV9write16(u32 addr, u16 value); +EXPORT_C_(void) DEV9write32(u32 addr, u32 value); +EXPORT_C_(void) DEV9readDMA8Mem(u32 *pMem, int size); +EXPORT_C_(void) DEV9writeDMA8Mem(u32 *pMem, int size); + +// cycles = IOP cycles before calling callback, +// if callback returns 1 the irq is triggered, else not +EXPORT_C_(void) DEV9irqCallback(DEV9callback callback); +EXPORT_C_(DEV9handler) DEV9irqHandler(void); + +// Extended functions + +EXPORT_C_(s32) DEV9freeze(int mode, freezeData *data); +EXPORT_C_(void) DEV9configure(); +EXPORT_C_(void) DEV9about(); +EXPORT_C_(s32) DEV9test(); + +#endif // __DEV9API_H__ \ No newline at end of file diff --git a/common/include/api/FWApi.h b/common/include/api/FWApi.h new file mode 100644 index 0000000000..bc42f0a11c --- /dev/null +++ b/common/include/api/FWApi.h @@ -0,0 +1,56 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __FWAPI_H__ +#define __FWAPI_H__ + +// Note; this header is experimental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + +#include "Pcsx2Api.h" + +/* FW plugin API */ + +// Basic functions. + +// NOTE: The read/write functions CANNOT use XMM/MMX regs +// If you want to use them, need to save and restore current ones +EXPORT_C_(s32) CALLBACK FWinit(char *configpath); +EXPORT_C_(s32) CALLBACK FWopen(); +EXPORT_C_(void) CALLBACK FWclose(); +EXPORT_C_(void) CALLBACK FWshutdown(); +EXPORT_C_(u32) CALLBACK FWread32(u32 addr); +EXPORT_C_(void) CALLBACK FWwrite32(u32 addr, u32 value); +EXPORT_C_(void) CALLBACK FWirqCallback(void (*callback)()); + +// Extended functions + +EXPORT_C_(s32) CALLBACK FWfreeze(int mode, freezeData *data); +EXPORT_C_(void) CALLBACK FWconfigure(); +EXPORT_C_(void) CALLBACK FWabout(); +EXPORT_C_(s32) CALLBACK FWtest(); +#endif + +#endif // __USBAPI_H__ \ No newline at end of file diff --git a/common/include/api/GSApi.h b/common/include/api/GSApi.h new file mode 100644 index 0000000000..e40972c6e2 --- /dev/null +++ b/common/include/api/GSApi.h @@ -0,0 +1,84 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __GSAPI_H__ +#define __GSAPI_H__ + +// Note; this header is experimental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + +#include "Pcsx2Api.h" + +typedef struct _GSdriverInfo { + char name[8]; + void *common; +} GSdriverInfo; + +// Basic functions. +EXPORT_C_(s32) GSinit(char *configpath); +EXPORT_C_(s32) GSopen(char *Title, bool multithread); +EXPORT_C_(void) GSclose(); +EXPORT_C_(void) GSshutdown(); +EXPORT_C_(void) GSvsync(int field); +EXPORT_C_(void) GSgifTransfer1(u32 *pMem, u32 addr); +EXPORT_C_(void) GSgifTransfer2(u32 *pMem, u32 size); +EXPORT_C_(void) GSgifTransfer3(u32 *pMem, u32 size); +EXPORT_C_(void) GSgetLastTag(u64* ptag); // returns the last tag processed (64 bits) +EXPORT_C_(void) GSgifSoftReset(u32 mask); +EXPORT_C_(void) GSreadFIFO(u64 *mem); +EXPORT_C_(void) GSreadFIFO2(u64 *mem, int qwc); + +// Extended functions + +// GSkeyEvent gets called when there is a keyEvent from the PAD plugin +EXPORT_C_(void) GSkeyEvent(keyEvent *ev); +EXPORT_C_(void) GSchangeSaveState(s32 state, const char* filename); +EXPORT_C_(void) GSmakeSnapshot(char *path); +EXPORT_C_(void) GSmakeSnapshot2(char *pathname, int* snapdone, int savejpg); +EXPORT_C_(void) GSirqCallback(void (*callback)()); +EXPORT_C_(void) CALLBACK GSprintf(s32 timeout, char *fmt, ...); +EXPORT_C_(void) GSsetBaseMem(void*); +EXPORT_C_(void) GSsetGameCRC(s32 crc, s32 gameoptions); + +// controls frame skipping in the GS, if this routine isn't present, frame skipping won't be done +EXPORT_C_(void) GSsetFrameSkip(int frameskip); + +// if start is true, starts recording spu2 data, else stops +// returns true if successful +// for now, pData is not used +EXPORT_C_(bool) GSsetupRecording(bool start); + +EXPORT_C_(void) GSreset(); +EXPORT_C_(void) GSwriteCSR(u32 value); +EXPORT_C_(void ) GSgetDriverInfo(GSdriverInfo *info); +#ifdef _WIN32 +EXPORT_C_(s32) CALLBACK GSsetWindowInfo(winInfo *info); +#endif +EXPORT_C_(s32) GSfreeze(u8 mode, freezeData *data); +EXPORT_C_(void) GSconfigure(); +EXPORT_C_(void) GSabout(); +EXPORT_C_(s32) GStest(); + +#endif // __GSAPI_H__ \ No newline at end of file diff --git a/common/include/api/PadApi.h b/common/include/api/PadApi.h new file mode 100644 index 0000000000..87658ddd81 --- /dev/null +++ b/common/include/api/PadApi.h @@ -0,0 +1,66 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __PADAPI_H__ +#define __PADAPI_H__ + +// Note; this header is experimental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + +#include "Pcsx2Api.h" + +/* PAD plugin API */ +/* So obsolete that everyone uses it. */ + +// Basic functions. +EXPORT_C_(s32) CALLBACK PADinit(char *configpath, u32 flags); +EXPORT_C_(s32) CALLBACK PADopen(); +EXPORT_C_(void) CALLBACK PADclose(); +EXPORT_C_(void) CALLBACK PADshutdown(); +// PADkeyEvent is called every vsync (return NULL if no event) +EXPORT_C_(keyEvent*) CALLBACK PADkeyEvent(); +EXPORT_C_(u8) CALLBACK PADstartPoll(u8 pad); +EXPORT_C_(u8) CALLBACK PADpoll(u8 value); +// returns: 1 if supported pad1 +// 2 if supported pad2 +// 3 if both are supported +EXPORT_C_(u8) CALLBACK PADquery(); + +// call to give a hint to the PAD plugin to query for the keyboard state. A +// good plugin will query the OS for keyboard state ONLY in this function. +// This function is necessary when multithreading because otherwise +// the PAD plugin can get into deadlocks with the thread that really owns +// the window (and input). Note that PADupdate can be called from a different +// thread than the other functions, so mutex or other multithreading primitives +// have to be added to maintain data integrity. +EXPORT_C_(void) CALLBACK PADupdate(u8 pad); + +// Extended functions +EXPORT_C_(void) CALLBACK PADgsDriverInfo(GSdriverInfo *info); +EXPORT_C_(void) CALLBACK PADconfigure(); +EXPORT_C_(void) CALLBACK PADabout(); +EXPORT_C_(s32) CALLBACK PADtest(); + +#endif // __PADAPI_H__ \ No newline at end of file diff --git a/common/include/api/SIOApi.h b/common/include/api/SIOApi.h new file mode 100644 index 0000000000..ec99b56343 --- /dev/null +++ b/common/include/api/SIOApi.h @@ -0,0 +1,56 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __SIOAPI_H__ +#define __SIOAPI_H__ + +// Note; this header is experimental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + +#include "Pcsx2Api.h" + +/* SIO plugin API */ + +// basic funcs + +s32 CALLBACK SIOinit(char *configpath, u32 port, u32 slot, SIOchangeSlotCB f); +s32 CALLBACK SIOopen(); +void CALLBACK SIOclose(); +void CALLBACK SIOshutdown(); +u8 CALLBACK SIOstartPoll(u8 value); +u8 CALLBACK SIOpoll(u8 value); + +// returns: SIO_TYPE_{PAD,MTAP,RM,MC} +u32 CALLBACK SIOquery(); + +// extended funcs + +void CALLBACK SIOconfigure(); +void CALLBACK SIOabout(); +s32 CALLBACK SIOtest(); + +#endif + +#endif // __SIOAPI_H__ \ No newline at end of file diff --git a/common/include/api/Spu2Api.h b/common/include/api/Spu2Api.h new file mode 100644 index 0000000000..51e7ff7dff --- /dev/null +++ b/common/include/api/Spu2Api.h @@ -0,0 +1,65 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __SPU2API_H__ +#define __SPU2API_H__ + +// Note; this header is experimental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + +#include "Pcsx2Api.h" + +EXPORT_C_(s32) SPU2init(char *configpath); +EXPORT_C_(s32) SPU2open(); +EXPORT_C_(void) SPU2close(); +EXPORT_C_(void) SPU2shutdown(); +EXPORT_C_(void) SPU2write(u32 mem, u16 value); +EXPORT_C_(u16) SPU2read(u32 mem); +EXPORT_C_(void) SPU2readDMAMem(u16 *pMem, u32 size, u8 core); +EXPORT_C_(void) SPU2writeDMAMem(u16 *pMem, u32 size, u8 core); +EXPORT_C_(void) SPU2interruptDMA(u8 core); + +// all addresses passed by dma will be pointers to the array starting at baseaddr +// This function is necessary to successfully save and reload the spu2 state +EXPORT_C_(void) SPU2setDMABaseAddr(uptr baseaddr); + +EXPORT_C_(u32) SPU2ReadMemAddr(u8 core); +EXPORT_C_(void) SPU2WriteMemAddr(u8 core,u32 value); +EXPORT_C_(void) SPU2irqCallback(void (*SPU2callback)(),void (*DMA4callback)(),void (*DMA7callback)()); + +// extended funcs +// if start is true, starts recording spu2 data, else stops +// returns true if successful +EXPORT_C_(bool) SPU2setupRecording(bool start); + +EXPORT_C_(void) SPU2setClockPtr(u32* ptr); + +EXPORT_C_(void) SPU2async(u32 cycles); +EXPORT_C_(s32) SPU2freeze(u8 mode, freezeData *data); +EXPORT_C_(void) SPU2configure(); +EXPORT_C_(void) SPU2about(); +EXPORT_C_(s32) SPU2test(); + +#endif \ No newline at end of file diff --git a/common/include/api/USBApi.h b/common/include/api/USBApi.h new file mode 100644 index 0000000000..dd71dc2038 --- /dev/null +++ b/common/include/api/USBApi.h @@ -0,0 +1,63 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef __USBAPI_H__ +#define __USBAPI_H__ + +// Note; this header is experimental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + +#include "Pcsx2Api.h" + +typedef void (*USBcallback)(int cycles); +typedef int (*USBhandler)(void); + +// Basic functions. +EXPORT_C_(s32) CALLBACK USBinit(char *configpath); +EXPORT_C_(s32) CALLBACK USBopen(); +EXPORT_C_(void) CALLBACK USBclose(); +EXPORT_C_(void) CALLBACK USBshutdown(); +EXPORT_C_(u8) CALLBACK USBread8(u32 addr); +EXPORT_C_(u16) CALLBACK USBread16(u32 addr); +EXPORT_C_(u32) CALLBACK USBread32(u32 addr); +EXPORT_C_(void) CALLBACK USBwrite8(u32 addr, u8 value); +EXPORT_C_(void) CALLBACK USBwrite16(u32 addr, u16 value); +EXPORT_C_(void) CALLBACK USBwrite32(u32 addr, u32 value); +EXPORT_C_(void) CALLBACK USBasync(u32 cycles); + +// cycles = IOP cycles before calling callback, +// if callback returns 1 the irq is triggered, else not +EXPORT_C_(void) CALLBACK USBirqCallback(USBcallback callback); +EXPORT_C_(USBhandler) CALLBACK USBirqHandler(void); +EXPORT_C_(void) CALLBACK USBsetRAM(void *mem); + +// Extended functions + +EXPORT_C_(s32) CALLBACK USBfreeze(int mode, freezeData *data); +EXPORT_C_(void) CALLBACK USBconfigure(); +EXPORT_C_(void) CALLBACK USBabout(); +EXPORT_C_(s32) CALLBACK USBtest(); + +#endif // __USBAPI_H__ \ No newline at end of file From 551d02721abebaf044a2f9f5956a43f225187c1a Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 13 Mar 2009 07:27:52 +0000 Subject: [PATCH 28/77] Forgot two files. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@767 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Pcsx2Defs.h | 115 +++++++++++++++++++++++++++ common/include/Pcsx2Types.h | 151 ++++++++++++++++++++++++++++++++++++ 2 files changed, 266 insertions(+) create mode 100644 common/include/Pcsx2Defs.h create mode 100644 common/include/Pcsx2Types.h diff --git a/common/include/Pcsx2Defs.h b/common/include/Pcsx2Defs.h new file mode 100644 index 0000000000..5d46d7a596 --- /dev/null +++ b/common/include/Pcsx2Defs.h @@ -0,0 +1,115 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2008 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __PCSX2DEFS_H__ +#define __PCSX2DEFS_H__ + +#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case +#define __LINUX__ +#endif + +#ifdef __CYGWIN__ +#define __LINUX__ +#endif + +// Renamed ARRAYSIZE to ArraySize -- looks nice and gets rid of Windows.h conflicts (air) +#ifndef ArraySize +#define ArraySize(x) (sizeof(x)/sizeof((x)[0])) +#endif + +////////////////////////////////////////////////////////////////////////////////////////// +// jASSUME - give hints to the optimizer +// This is primarily useful for the default case switch optimizer, which enables VC to +// generate more compact switches. + +#ifdef NDEBUG +# define jBREAKPOINT() ((void) 0) +# ifdef _MSC_VER +# define jASSUME(exp) (__assume(exp)) +# else +# define jASSUME(exp) ((void) sizeof(exp)) +# endif +#else +# if defined(_MSC_VER) +# define jBREAKPOINT() do { __asm int 3 } while(0) +# else +# define jBREAKPOINT() ((void) *(volatile char *) 0) +# endif +# define jASSUME(exp) if(exp) ; else jBREAKPOINT() +#endif + +// disable the default case in a switch +#define jNO_DEFAULT \ +{ \ + break; \ + \ +default: \ + jASSUME(0); \ + break; \ +} + +/* common defines */ +#ifndef C_ASSERT +#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] +#endif + +#ifdef _MSC_VER +// Note: building the 'extern' into PCSX2_ALIGNED16_DECL fixes Visual Assist X's intellisense. + +#define PCSX2_ALIGNED(alig,x) __declspec(align(alig)) x +#define PCSX2_ALIGNED_EXTERN(alig,x) __declspec(align(alig)) x +#define PCSX2_ALIGNED16(x) __declspec(align(16)) x +#define PCSX2_ALIGNED16_EXTERN(x) extern __declspec(align(16)) x + +#define __naked __declspec(naked) +#define CALLBACK __stdcall + +#else + +// fixme - is this needed for recent versions of GCC? Or can we just use the first two macros +// instead for both definitions (implementations) and declarations (includes)? -- air +#define PCSX2_ALIGNED(alig,x) x __attribute((aligned(alig))) +#define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) +#define PCSX2_ALIGNED_EXTERN(alig,x) extern x +#define PCSX2_ALIGNED16_EXTERN(x) extern x + +#define __naked // GCC lacks the naked specifier +#define CALLBACK // CALLBACK is a win32-specific mess + +// GCC uses attributes for a lot of things that Visual C+ doesn't. +#define __fastcall __attribute__((fastcall)) +#define __unused __attribute__((unused)) +#define _inline __inline__ __attribute__((unused)) +#define __forceinline __attribute__((always_inline,unused)) +#endif + +typedef struct { + int size; + s8 *data; +} freezeData; + +// event values: +#define KEYPRESS 1 +#define KEYRELEASE 2 + +typedef struct _keyEvent { + u32 key; + u32 evt; +} keyEvent; + +#endif \ No newline at end of file diff --git a/common/include/Pcsx2Types.h b/common/include/Pcsx2Types.h new file mode 100644 index 0000000000..942076e972 --- /dev/null +++ b/common/include/Pcsx2Types.h @@ -0,0 +1,151 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2008 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __PCSX2TYPES_H__ +#define __PCSX2TYPES_H__ + +// Note; this header is experamental, and will be a shifting target. Only use this if you are willing to repeatedly fix breakage. + +/* + * Based on PS2E Definitions by + linuzappz@hotmail.com, + * shadowpcsx2@yahoo.gr, + * and florinsasu@hotmail.com + */ + + +////////////////////////////////////////////////////////////////////////////////////////// +// Basic Atomic Types + +#if defined(_MSC_VER) + +typedef __int8 s8; +typedef __int16 s16; +typedef __int32 s32; +typedef __int64 s64; + +typedef unsigned __int8 u8; +typedef unsigned __int16 u16; +typedef unsigned __int32 u32; +typedef unsigned __int64 u64; + +typedef unsigned int uint; +typedef u32 uptr; +typedef s32 sptr; + +#else // _MSC_VER + + #ifdef __LINUX__ + +#ifdef HAVE_STDINT_H +#include "stdint.h" + +typedef int8_t s8; +typedef int16_t s16; +typedef int32_t s32; +typedef int64_t s64; + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +typedef uintptr_t uptr; +typedef intptr_t sptr; + +#else // HAVE_STDINT_H + +typedef char s8; +typedef short s16; +typedef int s32; +typedef long long s64; + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; + +typedef u32 uptr; +typedef s32 sptr; + +#endif // HAVE_STDINT_H + +typedef unsigned int uint; + +#define LONG long +typedef union _LARGE_INTEGER +{ + long long QuadPart; +} LARGE_INTEGER; + +#endif // __LINUX__ +#endif //_MSC_VER + + +////////////////////////////////////////////////////////////////////////////////////////// +// A rough-and-ready cross platform 128-bit datatype, Non-SSE style. +#ifdef __cplusplus +struct u128 +{ + u64 lo; + u64 hi; + + // Implicit conversion from u64 + u128( u64 src ) : + lo( src ) + , hi( 0 ) {} + + // Implicit conversion from u32 + u128( u32 src ) : + lo( src ) + , hi( 0 ) {} +}; + +struct s128 +{ + s64 lo; + s64 hi; + + // Implicit conversion from u64 + s128( s64 src ) : + lo( src ) + , hi( 0 ) {} + + // Implicit conversion from u32 + s128( s32 src ) : + lo( src ) + , hi( 0 ) {} +}; + +#else + +typedef union _u128_t +{ + u64 lo; + u64 hi; +} u128; + +typedef union _s128_t +{ + s64 lo; + s64 hi; +} s128; + +#endif + + #endif \ No newline at end of file From 2d0dd6b0b2470154e6e3b2ac206b63abdb3c8295 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Fri, 13 Mar 2009 07:57:23 +0000 Subject: [PATCH 29/77] forgot to commit this... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@768 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Pcsx2Config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/include/Pcsx2Config.h b/common/include/Pcsx2Config.h index a5326d388c..0d7b930b56 100644 --- a/common/include/Pcsx2Config.h +++ b/common/include/Pcsx2Config.h @@ -65,8 +65,9 @@ extern SessionOverrideFlags g_Session; #define CHECK_ESCAPE_HACK (Config.Hacks & 0x400) //------------ SPECIAL GAME FIXES!!! --------------- #define CHECK_VUADDSUBHACK (Config.GameFixes & 0x1) // Special Fix for Tri-ace games, they use an encryption algorithm that requires VU addi opcode to be bit-accurate. -#define CHECK_FPUCOMPAREHACK (Config.GameFixes & 0x4) // Special Fix for Digimon Rumble Arena 2, fixes spinning/hanging on intro-menu. #define CHECK_VUCLIPFLAGHACK (Config.GameFixes & 0x2) // Special Fix for God of War, fixes SPS. +#define CHECK_FPUCOMPAREHACK (Config.GameFixes & 0x4) // Special Fix for Digimon Rumble Arena 2, fixes spinning/hanging on intro-menu. +#define CHECK_FPUMULHACK (Config.GameFixes & 0x8) // Special Fix for Tales of Destiny hangs. //------------ Advanced Options!!! --------------- #define CHECK_VU_OVERFLOW (Config.vuOptions & 0x1) #define CHECK_VU_EXTRA_OVERFLOW (Config.vuOptions & 0x2) // If enabled, Operands are clamped before being used in the VU recs @@ -77,7 +78,6 @@ extern SessionOverrideFlags g_Session; #define CHECK_FPU_EXTRA_OVERFLOW (Config.eeOptions & 0x2) // If enabled, Operands are checked for infinities before being used in the FPU recs #define CHECK_FPU_EXTRA_FLAGS 1 // Always enabled now // Sets D/I flags on FPU instructions #define CHECK_FPU_FULL (Config.eeOptions & 0x4) -#define CHECK_FPU_ATTEMPT_MUL (Config.eeOptions & 0x8) #define DEFAULT_eeOptions 0x01 #define DEFAULT_vuOptions 0x01 //------------ DEFAULT sseMXCSR VALUES!!! --------------- From 3aedd8acb2f9a376d75764b2ea9eddfcb385bd49 Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Fri, 13 Mar 2009 18:23:28 +0000 Subject: [PATCH 30/77] Further work on the block manager. Grandia 2 is still broken but this is a little faster, less clear happy and "impossible block clearing failures" shouldn't occur any more. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@770 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Memory.cpp | 2 +- pcsx2/x86/BaseblockEx.cpp | 8 +- pcsx2/x86/BaseblockEx.h | 12 +- pcsx2/x86/ix86-32/iR5900-32.cpp | 241 ++++++++++++++++---------------- 4 files changed, 134 insertions(+), 129 deletions(-) diff --git a/pcsx2/Memory.cpp b/pcsx2/Memory.cpp index 31c604598f..fdd52ffa84 100644 --- a/pcsx2/Memory.cpp +++ b/pcsx2/Memory.cpp @@ -853,7 +853,7 @@ void mmap_ClearCpuBlock( uint offset ) for (u32 i=0;iClear(psMPWVA[offset][i],0x1000); + Cpu->Clear(psMPWVA[offset][i],0x400); } psMPWVA[offset].clear(); } \ No newline at end of file diff --git a/pcsx2/x86/BaseblockEx.cpp b/pcsx2/x86/BaseblockEx.cpp index 6a72251330..bdc5f4aab1 100644 --- a/pcsx2/x86/BaseblockEx.cpp +++ b/pcsx2/x86/BaseblockEx.cpp @@ -45,7 +45,7 @@ BASEBLOCKEX* BaseBlocks::New(u32 startpc) return &*iter; } -int BaseBlocks::Index(u32 startpc) const +int BaseBlocks::LastIndex(u32 startpc) const { if (0 == blocks.size()) return -1; @@ -61,9 +61,5 @@ int BaseBlocks::Index(u32 startpc) const imin = imid; } - if (startpc < blocks[imin].startpc || - startpc >= blocks[imin].startpc + blocks[imin].size*4) - return -1; - else - return imin; + return imin; } diff --git a/pcsx2/x86/BaseblockEx.h b/pcsx2/x86/BaseblockEx.h index 7d94533af7..a66371d480 100644 --- a/pcsx2/x86/BaseblockEx.h +++ b/pcsx2/x86/BaseblockEx.h @@ -64,7 +64,17 @@ public: } BASEBLOCKEX* New(u32 startpc); - int Index (u32 startpc) const; + int LastIndex (u32 startpc) const; + + inline int Index (u32 startpc) const + { + int idx = LastIndex(startpc); + if (idx == -1 || startpc < blocks[idx].startpc || + startpc >= blocks[idx].startpc + blocks[idx].size * 4) + return -1; + else + return idx; + } inline BASEBLOCKEX* operator[](int idx) { diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 504bb507b2..991949fb71 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -80,6 +80,7 @@ static u8* recStack = NULL; // stack mem static BASEBLOCK *recRAM = NULL; // and the ptr to the blocks here static BASEBLOCK *recROM = NULL; // and here static BASEBLOCK *recROM1 = NULL; // also here +static u32 *recRAMCopy = NULL; static BaseBlocks recBlocks(EE_NUMBLOCKS); static u8* recPtr = NULL, *recStackPtr = NULL; static EEINST* s_pInstCache = NULL; @@ -455,7 +456,7 @@ static u8* m_recBlockAlloc = NULL; static const uint m_recBlockAllocSize = (((Ps2MemSize::Base + Ps2MemSize::Rom + Ps2MemSize::Rom1) / 4) * sizeof(BASEBLOCK)) -+ RECSTACK_SIZE; // recStack ++ RECSTACK_SIZE + Ps2MemSize::Base; static void recAlloc() { @@ -497,7 +498,8 @@ static void recAlloc() recRAM = (BASEBLOCK*)curpos; curpos += (Ps2MemSize::Base / 4) * sizeof(BASEBLOCK); recROM = (BASEBLOCK*)curpos; curpos += (Ps2MemSize::Rom / 4) * sizeof(BASEBLOCK); recROM1 = (BASEBLOCK*)curpos; curpos += (Ps2MemSize::Rom1 / 4) * sizeof(BASEBLOCK); - recStack = (u8*)curpos; + recStack = (u8*)curpos; curpos += RECSTACK_SIZE; + recRAMCopy = (u32*)curpos; if( s_pInstCache == NULL ) { @@ -882,22 +884,6 @@ void recBREAK( void ) { } } } // end namespace R5900::Dynarec::OpcodeImpl -//////////////////////////////////////////////////// -static u32 REC_CLEARM( u32 mem ) -{ - if ((mem) < maxrecmem && (recLUT[(mem) >> 16] + mem)) - return recClearMem(mem); - else - return 4; -} - -void recClear( u32 Addr, u32 Size ) -{ - u32 pc = Addr; - while (pc < Addr + Size*4) - pc += REC_CLEARM(pc); -} - // Clears the recLUT table so that all blocks are mapped to the JIT recompiler by default. static void ClearRecLUT(BASEBLOCK* base, int count) { @@ -906,7 +892,7 @@ static void ClearRecLUT(BASEBLOCK* base, int count) } // Returns the offset to the next instruction after any cleared memory -u32 recClearMem(u32 pc) +void recClear(u32 addr, u32 size) { BASEBLOCKEX* pexblock; BASEBLOCK* pblock; @@ -928,30 +914,36 @@ u32 recClearMem(u32 pc) #endif #endif - pblock = PC_GETBLOCK(pc); - if (pblock->GetFnptr() == (uptr)JITCompile) - return 4; + if ((addr) >= maxrecmem || !(recLUT[(addr) >> 16] + (addr & ~0xFFFFUL))) + return; + addr = HWADDR(addr); - pc = HWADDR(pc); + int blockidx = recBlocks.LastIndex(addr + size * 4 - 4); - u32 lowerextent = pc, upperextent = pc + 4; - int blockidx = recBlocks.Index(pc); + if (blockidx == -1) + return; - jASSUME(blockidx != -1); + u32 lowerextent = (u32)-1, upperextent = 0, ceiling = (u32)-1; - while (pexblock = recBlocks[blockidx - 1]) { - if (pexblock->startpc + pexblock->size*4 <= lowerextent) - break; - - lowerextent = min(lowerextent, pexblock->startpc); - blockidx--; - } + pexblock = recBlocks[blockidx + 1]; + if (pexblock) + ceiling = pexblock->startpc; while (pexblock = recBlocks[blockidx]) { - if (pexblock->startpc >= upperextent) - break; + u32 blockstart = pexblock->startpc; + u32 blockend = pexblock->startpc + pexblock->size * 4; + pblock = PC_GETBLOCK(blockstart); + + if (pblock == s_pCurBlock) { + blockidx--; + continue; + } + + if (blockend <= addr) { + lowerextent = max(lowerextent, blockend); + break; + } - pblock = PC_GETBLOCK(pexblock->startpc); x86Ptr[_EmitterId_] = (u8*)pblock->GetFnptr(); jASSUME((u8*)JITCompile != x86Ptr[_EmitterId_]); @@ -962,27 +954,36 @@ u32 recClearMem(u32 pc) // here is the way to go. // there is a small problem: mem can be ored with 0xa<<28 or 0x8<<28, and don't know which - MOV32ItoR(EDX, pexblock->startpc); + MOV32ItoR(EDX, blockstart); assert((uptr)x86Ptr[_EmitterId_] <= 0xffffffff); PUSH32I((uptr)x86Ptr[_EmitterId_]); // will be replaced by JMP32 JMP32((uptr)DispatcherClear - ((uptr)x86Ptr[_EmitterId_] + 5)); - lowerextent = min(lowerextent, pexblock->startpc); - upperextent = max(upperextent, pexblock->startpc + pexblock->size * 4); - recBlocks.Remove(blockidx); + lowerextent = min(lowerextent, blockstart); + upperextent = max(upperextent, blockend); + // This might end up inside a block that doesn't contain the clearing range, + // so set it to recompile now. This will become JITCompile if we clear it. + pblock->SetFnptr((uptr)JITCompileInBlock); + recBlocks.Remove(blockidx--); } + upperextent = min(upperextent, ceiling); + #ifdef PCSX2_DEVBUILD - for (int i = 0; pexblock = recBlocks[i]; i++) - if (pc >= pexblock->startpc && pc < pexblock->startpc + pexblock->size * 4) { + for (int i = 0; pexblock = recBlocks[i]; i++) { + if (s_pCurBlock == PC_GETBLOCK(pexblock->startpc)) + continue; + u32 blockend = pexblock->startpc + pexblock->size * 4; + if (pexblock->startpc >= addr && pexblock->startpc < addr + size * 4 + || pexblock->startpc < addr && blockend > addr) { Console::Error("Impossible block clearing failure"); jASSUME(0); } + } #endif - ClearRecLUT(PC_GETBLOCK(lowerextent), (upperextent - lowerextent) / 4); - - return upperextent - pc; + if (upperextent > lowerextent) + ClearRecLUT(PC_GETBLOCK(lowerextent), (upperextent - lowerextent) / 4); } // check for end of bios @@ -1283,54 +1284,39 @@ void recompileNextInstruction(int delayslot) static u8 s_bFlushReg = 1; int i, count; - BASEBLOCK* pblock = PC_GETBLOCK(pc); - - // need *ppblock != s_pCurBlock because of branches - if (HWADDR(pc) != s_pCurBlockEx->startpc && pblock->GetFnptr() != (uptr)JITCompile && pblock->GetFnptr() != (uptr)JITCompileInBlock) - { - if (!delayslot) - { - // code already in place, so jump to it and exit recomp - assert( recBlocks.Get(HWADDR(pc))->startpc == HWADDR(pc) ); - - iFlushCall(FLUSH_EVERYTHING); - MOV32ItoM((uptr)&cpuRegs.pc, pc); - JMP32((uptr)pblock->GetFnptr() - ((uptr)x86Ptr[0] + 5)); - branch = 3; - return; - } - } - s_pCode = (int *)PSM( pc ); assert(s_pCode); + // why? #ifdef _DEBUG MOV32ItoR(EAX, pc); #endif cpuRegs.code = *(int *)s_pCode; pc += 4; - -//#ifdef _DEBUG -// CMP32ItoM((u32)s_pCode, cpuRegs.code); -// j8Ptr[0] = JE8(0); -// MOV32ItoR(EAX, pc); -// CALLFunc((uptr)checkcodefn); -// x86SetJ8( j8Ptr[ 0 ] ); -// -// if( !delayslot ) { -// CMP32ItoM((u32)&cpuRegs.pc, s_pCurBlockEx->startpc); -// j8Ptr[0] = JB8(0); -// CMP32ItoM((u32)&cpuRegs.pc, pc); -// j8Ptr[1] = JA8(0); -// j8Ptr[2] = JMP8(0); -// x86SetJ8( j8Ptr[ 0 ] ); -// x86SetJ8( j8Ptr[ 1 ] ); -// PUSH32I(s_pCurBlockEx->startpc); -// ADD32ItoR(ESP, 4); -// x86SetJ8( j8Ptr[ 2 ] ); -// } -//#endif + +#if 0 +#ifdef _DEBUG + CMP32ItoM((u32)s_pCode, cpuRegs.code); + j8Ptr[0] = JE8(0); + MOV32ItoR(EAX, pc); + CALLFunc((uptr)checkcodefn); + x86SetJ8( j8Ptr[ 0 ] ); + + if( !delayslot ) { + CMP32ItoM((u32)&cpuRegs.pc, s_pCurBlockEx->startpc); + j8Ptr[0] = JB8(0); + CMP32ItoM((u32)&cpuRegs.pc, pc); + j8Ptr[1] = JA8(0); + j8Ptr[2] = JMP8(0); + x86SetJ8( j8Ptr[ 0 ] ); + x86SetJ8( j8Ptr[ 1 ] ); + PUSH32I(s_pCurBlockEx->startpc); + ADD32ItoR(ESP, 4); + x86SetJ8( j8Ptr[ 2 ] ); + } +#endif +#endif g_pCurInstInfo++; @@ -1482,7 +1468,7 @@ void recRecompile( const u32 startpc ) #ifdef _DEBUG //dumplog |= 4; if( dumplog & 4 ) - iDumpRegisters(startpc, 0); + iDumpRegisters(startpc, 0); #endif assert( startpc ); @@ -1503,14 +1489,14 @@ void recRecompile( const u32 startpc ) || s_pCurBlock->GetFnptr() == (uptr)JITCompileInBlock); s_pCurBlockEx = recBlocks.Get(HWADDR(startpc)); - if (!s_pCurBlockEx || s_pCurBlockEx->startpc != HWADDR(startpc)) { - s_pCurBlockEx = recBlocks.New(HWADDR(startpc)); + assert(!s_pCurBlockEx || s_pCurBlockEx->startpc != HWADDR(startpc)); - if( s_pCurBlockEx == NULL ) { - //SysPrintf("ee reset (blocks)\n"); - recResetEE(); - s_pCurBlockEx = recBlocks.New(HWADDR(startpc)); - } + s_pCurBlockEx = recBlocks.New(HWADDR(startpc)); + + if( s_pCurBlockEx == NULL ) { + //SysPrintf("ee reset (blocks)\n"); + recResetEE(); + s_pCurBlockEx = recBlocks.New(HWADDR(startpc)); } assert(s_pCurBlockEx); @@ -1518,7 +1504,6 @@ void recRecompile( const u32 startpc ) x86SetPtr( recPtr ); x86Align(16); recPtr = x86Ptr[0]; - s_pCurBlock->SetFnptr( (uptr)x86Ptr[0] ); branch = 0; @@ -1815,40 +1800,25 @@ StartRecomp: #endif u32 sz=(s_nEndBlock-startpc)>>2; -#ifdef lulz - /* - Block checking (ADDED BY RAZ-TEMP) - */ - - MOV32ItoR(ECX,startpc); - MOV32ItoR(EDX,sz); -#endif - - u32 inpage_offs=startpc&0xFFF; u32 inpage_ptr=startpc; u32 inpage_sz=sz*4; - MOV32ItoR(ECX,startpc); - MOV32ItoR(EDX,sz); - while(inpage_sz) { - int PageType=mmap_GetRamPageInfo((u32*)PSM(inpage_ptr)); - u32 pgsz=std::min(0x1000-inpage_offs,inpage_sz); + int PageType = mmap_GetRamPageInfo((u32*)PSM(inpage_ptr)); + u32 inpage_offs = inpage_ptr & 0xFFF; + u32 pgsz = std::min(0x1000 - inpage_offs, inpage_sz); if(PageType!=-1) { if (PageType==0) - { - //MOV32ItoR(EAX,*pageVer); - //CMP32MtoR(EAX,(uptr)pageVer); - //JNE32(((u32)dyna_block_discard_recmem)- ( (u32)x86Ptr[0] + 6 )); - mmap_MarkCountedRamPage(PSM(inpage_ptr),inpage_ptr&~0xFFF); - } else { + MOV32ItoR(ECX, startpc); + MOV32ItoR(EDX, sz); + u32 lpc=inpage_ptr; u32 stg=pgsz; while(stg>0) @@ -1866,7 +1836,6 @@ StartRecomp: } inpage_ptr+=pgsz; inpage_sz-=pgsz; - inpage_offs=inpage_ptr&0xFFF; } // finally recompile // @@ -1883,6 +1852,34 @@ StartRecomp: assert( (pc-startpc)>>2 <= 0xffff ); s_pCurBlockEx->size = (pc-startpc)>>2; + if (HWADDR(pc) <= Ps2MemSize::Base) { + BASEBLOCKEX *oldBlock; + int i; + + i = recBlocks.LastIndex(HWADDR(pc) - 4); + while (oldBlock = recBlocks[i--]) { + if (oldBlock == s_pCurBlockEx) + continue; + if (oldBlock->startpc >= HWADDR(pc)) + continue; + if (oldBlock->startpc + oldBlock->size * 4 <= HWADDR(startpc)) + break; + if (memcmp(&recRAMCopy[oldBlock->startpc / 4], PSM(oldBlock->startpc), + oldBlock->size * 4)) { + u8* oldX86 = x86Ptr[_EmitterId_]; + recClear(startpc, (pc - startpc) / 4); + x86Ptr[_EmitterId_] = oldX86; + s_pCurBlockEx = recBlocks.Get(HWADDR(startpc)); + assert(s_pCurBlockEx->startpc == HWADDR(startpc)); + break; + } + } + + memcpy(&recRAMCopy[HWADDR(startpc) / 4], PSM(startpc), pc - startpc); + } + + s_pCurBlock->SetFnptr((uptr)recPtr); + for(i = 1; i < (u32)s_pCurBlockEx->size; i++) { if ((uptr)JITCompile == s_pCurBlock[i].GetFnptr()) s_pCurBlock[i].SetFnptr((uptr)JITCompileInBlock); @@ -1938,14 +1935,16 @@ StartRecomp: if( !branch ) { assert( ptr != NULL ); - s_pCurBlock = PC_GETBLOCK(pc); + BASEBLOCK *pblock = PC_GETBLOCK(pc); - if (s_pCurBlock->GetFnptr() == (uptr)JITCompile - || s_pCurBlock->GetFnptr() == (uptr)JITCompileInBlock) - recRecompile(pc); - - *ptr = s_pCurBlock->GetFnptr() - ((u32)ptr + 4); + if (pblock->GetFnptr() == (uptr)JITCompile + || pblock->GetFnptr() == (uptr)JITCompileInBlock) + recRecompile(pc); + *ptr = pblock->GetFnptr() - ((u32)ptr + 4); } + + s_pCurBlock = NULL; + s_pCurBlockEx = NULL; } R5900cpu recCpu = { From c8683cb350b9f54bbb288abc34d6037de2f942c5 Mon Sep 17 00:00:00 2001 From: refraction Date: Fri, 13 Mar 2009 21:14:33 +0000 Subject: [PATCH 31/77] Adjusted the backwards timing on GIF for intermediate transfers, this resolves issue101 git-svn-id: http://pcsx2.googlecode.com/svn/trunk@771 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Gif.cpp | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index bdcbace6d7..6fb8a79429 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -308,13 +308,21 @@ void GIFdma() prevcycles = 0; if (!(vif1Regs->mskpath3 || (psHu32(GIF_MODE) & 0x1))) { - if(gspath3done == 0){ - ptag = (u32*)dmaGetAddr(gif->tadr); //Set memory pointer to TADR - gif->qwc = (u16)ptag[0]; //QWC set to lower 16bits of the tag - gif->chcr = ( gif->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 - CPU_INT(2, gif->qwc * BIAS); - gif->qwc = 0; - return; + if(gspath3done == 0) + { + if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) + { + CPU_INT(2, min( 8, (int)gif->qwc )* BIAS); + } + else + { + ptag = (u32*)dmaGetAddr(gif->tadr); //Set memory pointer to TADR + gif->qwc = (u16)ptag[0]; //QWC set to lower 16bits of the tag + gif->chcr = ( gif->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 + CPU_INT(2, gif->qwc * BIAS); + gif->qwc = 0; + return; + } } //CPU_INT(2, gif->qwc * BIAS); gscycles = 0; @@ -348,7 +356,14 @@ void dmaGIF() { ptag = (u32*)dmaGetAddr(gif->tadr); gif->qwc = (u16)ptag[0]; //QWC set to lower 16bits of the tag gif->chcr = ( gif->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 - CPU_INT(2, gif->qwc * BIAS); + if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) + { + CPU_INT(2, min( 8, (int)gif->qwc ) * BIAS); + } + else + { + CPU_INT(2, gif->qwc * BIAS); + } gif->qwc = 0; return; } @@ -356,7 +371,14 @@ void dmaGIF() { if(gif->qwc > 0 && (gif->chcr & 0x4) == 0x4) { //SysPrintf("HL Hack\n"); gspath3done = 1; //Halflife sets a QWC amount in chain mode, no tadr set. - CPU_INT(2, gif->qwc * BIAS); + if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) + { + CPU_INT(2, min( 8, (int)gif->qwc ) * BIAS); + } + else + { + CPU_INT(2, gif->qwc * BIAS); + } GIFdma(); return; } @@ -364,7 +386,14 @@ void dmaGIF() { //GIFdma(); - CPU_INT(2, gif->qwc * BIAS); + if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) + { + CPU_INT(2, min( 8, (int)gif->qwc ) * BIAS); + } + else + { + CPU_INT(2, gif->qwc * BIAS); + } } From 81b038ed41c4114b52b7a743258e5a7978ad56ef Mon Sep 17 00:00:00 2001 From: refraction Date: Fri, 13 Mar 2009 22:15:31 +0000 Subject: [PATCH 32/77] Fixed a slight error in my last commit, fixed a bug from another previous commit and put in rama's hack for FFX which was bugged from r604, i know why its happening, but how to solve it properly is the issue. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@772 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Gif.cpp | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index 6fb8a79429..5b5bab2ea9 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -250,6 +250,13 @@ void GIFdma() GIFchain(); //Transfers the data set by the switch FreezeRegs(0); if(gif->qwc == 0 && (gif->chcr & 0xc) == 0) gspath3done = 1; + else + { + if(psHu32(GIF_MODE) & 0x4) + CPU_INT(2, min( 8, (int)gif->qwc )/** BIAS*/); + else + CPU_INT(2, gif->qwc/* * BIAS*/); + } return; } else { @@ -312,19 +319,24 @@ void GIFdma() { if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) { - CPU_INT(2, min( 8, (int)gif->qwc )* BIAS); + CPU_INT(2, min( 8, (int)gif->qwc )/** BIAS*/); } else { ptag = (u32*)dmaGetAddr(gif->tadr); //Set memory pointer to TADR gif->qwc = (u16)ptag[0]; //QWC set to lower 16bits of the tag gif->chcr = ( gif->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 - CPU_INT(2, gif->qwc * BIAS); + + if(psHu32(GIF_MODE) & 0x4) + CPU_INT(2, min( 8, (int)gif->qwc )/** BIAS*/); + else + CPU_INT(2, gif->qwc /** BIAS*/); + gif->qwc = 0; return; } } - //CPU_INT(2, gif->qwc * BIAS); + //CPU_INT(2, gif->qwc /** BIAS*/); gscycles = 0; } } @@ -358,11 +370,11 @@ void dmaGIF() { gif->chcr = ( gif->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) { - CPU_INT(2, min( 8, (int)gif->qwc ) * BIAS); + CPU_INT(2, min( 8, (int)gif->qwc ) /** BIAS*/); } else { - CPU_INT(2, gif->qwc * BIAS); + CPU_INT(2, gif->qwc /** BIAS*/); } gif->qwc = 0; return; @@ -373,13 +385,12 @@ void dmaGIF() { gspath3done = 1; //Halflife sets a QWC amount in chain mode, no tadr set. if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) { - CPU_INT(2, min( 8, (int)gif->qwc ) * BIAS); + CPU_INT(2, min( 8, (int)gif->qwc ) /** BIAS*/); } else { - CPU_INT(2, gif->qwc * BIAS); + CPU_INT(2, gif->qwc /** BIAS*/); } - GIFdma(); return; } @@ -388,11 +399,11 @@ void dmaGIF() { //GIFdma(); if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) { - CPU_INT(2, min( 8, (int)gif->qwc ) * BIAS); + CPU_INT(2, min( 8, (int)gif->qwc ) /** BIAS*/); } else { - CPU_INT(2, gif->qwc * BIAS); + CPU_INT(2, gif->qwc /** BIAS*/); } } From 762b022df535ba59706ab2a8d0266fb52d56ca53 Mon Sep 17 00:00:00 2001 From: refraction Date: Fri, 13 Mar 2009 22:16:51 +0000 Subject: [PATCH 33/77] Disabled whole program optimization for dev builds, it really isn't needed for development builds, all it does is slows us down :P git-svn-id: http://pcsx2.googlecode.com/svn/trunk@773 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/windows/VCprojects/pcsx2_2008.vcproj | 1 + 1 file changed, 1 insertion(+) diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index f8e1617bd5..ce25ff64eb 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -134,6 +134,7 @@ Date: Sat, 14 Mar 2009 00:21:35 +0000 Subject: [PATCH 34/77] Grandia 2 is playable again. The old block manager was incorrectly clearing a block which didn't need clearing and thus masking this constprop bug. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@774 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/ix86-32/iR5900Move.cpp | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/pcsx2/x86/ix86-32/iR5900Move.cpp b/pcsx2/x86/ix86-32/iR5900Move.cpp index 8554f58eee..76348682b7 100644 --- a/pcsx2/x86/ix86-32/iR5900Move.cpp +++ b/pcsx2/x86/ix86-32/iR5900Move.cpp @@ -425,12 +425,9 @@ void recMTLO1( void ) //// MOVZ void recMOVZtemp_const() { - GPR_DEL_CONST(_Rd_); - _deleteEEreg(_Rd_, 1); - _eeOnWriteReg(_Rd_, 0); if (g_cpuConstRegs[_Rt_].UD[0] == 0) { - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rs_].UL[0]); - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rs_].UL[1]); + g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; + g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; } } @@ -546,21 +543,14 @@ void recMOVZ() if( _Rs_ == _Rd_ ) return; + // aren't the templates meant to take care of this kind of thing? if( GPR_IS_CONST1(_Rd_) ) { - if( !GPR_IS_CONST2(_Rs_, _Rt_) ) { // remove the const, since move is conditional _deleteEEreg(_Rd_, 0); MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rd_].UL[0]); MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rd_].UL[1]); } - else { - if (g_cpuConstRegs[_Rt_].UD[0] == 0) { - g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; - g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; - } - return; - } } recMOVZtemp(); @@ -569,12 +559,9 @@ void recMOVZ() //// MOVN void recMOVNtemp_const() { - GPR_DEL_CONST(_Rd_); - _deleteEEreg(_Rd_, 1); - _eeOnWriteReg(_Rd_, 0); if (g_cpuConstRegs[_Rt_].UD[0] != 0) { - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rs_].UL[0]); - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rs_].UL[1]); + g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; + g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; } } @@ -686,20 +673,12 @@ void recMOVN() return; if( GPR_IS_CONST1(_Rd_) ) { - if( !GPR_IS_CONST2(_Rs_, _Rt_) ) { // remove the const, since move is conditional _deleteEEreg(_Rd_, 0); MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rd_].UL[0]); MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rd_].UL[1]); } - else { - if (g_cpuConstRegs[_Rt_].UD[0] != 0) { - g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; - g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; - } - return; - } } recMOVNtemp(); From 1689b73c778fd8b5979127be30df6fca8aae33c0 Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Sat, 14 Mar 2009 01:21:13 +0000 Subject: [PATCH 35/77] Realised that I probably broke MOVZ/N with my last commit and tried again. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@776 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/ix86-32/iR5900Move.cpp | 95 +++++++++++++------------------- 1 file changed, 39 insertions(+), 56 deletions(-) diff --git a/pcsx2/x86/ix86-32/iR5900Move.cpp b/pcsx2/x86/ix86-32/iR5900Move.cpp index 76348682b7..20ec6ade16 100644 --- a/pcsx2/x86/ix86-32/iR5900Move.cpp +++ b/pcsx2/x86/ix86-32/iR5900Move.cpp @@ -425,10 +425,7 @@ void recMTLO1( void ) //// MOVZ void recMOVZtemp_const() { - if (g_cpuConstRegs[_Rt_].UD[0] == 0) { - g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; - g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; - } + g_cpuConstRegs[_Rd_].UD[0] = g_cpuConstRegs[_Rs_].UD[0]; } //static PCSX2_ALIGNED16(u32 s_zero[4]) = {0,0,0xffffffff, 0xffffffff}; @@ -472,24 +469,22 @@ void recMOVZtemp_consts(int info) void recMOVZtemp_constt(int info) { - if (g_cpuConstRegs[_Rt_].UD[0] == 0) { - if( info & PROCESS_EE_MMX ) { - if( EEREC_D != EEREC_S ) MOVQRtoR(EEREC_D, EEREC_S); - return; - } - - if( _hasFreeXMMreg() ) { - int t0reg = _allocMMXreg(-1, MMX_TEMP, 0); - MOVQMtoR(t0reg, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]); - MOVQRtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ], t0reg); - _freeMMXreg(t0reg); - } - else { - MOV32MtoR(EAX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]); - MOV32MtoR(EDX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]); - MOV32RtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ], EAX); - MOV32RtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ], EDX); - } + if( info & PROCESS_EE_MMX ) { + if( EEREC_D != EEREC_S ) MOVQRtoR(EEREC_D, EEREC_S); + return; + } + + if( _hasFreeXMMreg() ) { + int t0reg = _allocMMXreg(-1, MMX_TEMP, 0); + MOVQMtoR(t0reg, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]); + MOVQRtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ], t0reg); + _freeMMXreg(t0reg); + } + else { + MOV32MtoR(EAX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]); + MOV32MtoR(EDX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]); + MOV32RtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ], EAX); + MOV32RtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ], EDX); } } @@ -543,15 +538,11 @@ void recMOVZ() if( _Rs_ == _Rd_ ) return; - // aren't the templates meant to take care of this kind of thing? - if( GPR_IS_CONST1(_Rd_) ) { - if( !GPR_IS_CONST2(_Rs_, _Rt_) ) { - // remove the const, since move is conditional - _deleteEEreg(_Rd_, 0); - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rd_].UL[0]); - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rd_].UL[1]); - } - } + if(GPR_IS_CONST1(_Rt_)) { + if (g_cpuConstRegs[_Rt_].UD[0] != 0) + return; + } else if (GPR_IS_CONST1(_Rd_)) + _deleteEEreg(_Rd_, 1); recMOVZtemp(); } @@ -559,10 +550,7 @@ void recMOVZ() //// MOVN void recMOVNtemp_const() { - if (g_cpuConstRegs[_Rt_].UD[0] != 0) { - g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; - g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; - } + g_cpuConstRegs[_Rd_].UD[0] = g_cpuConstRegs[_Rs_].UD[0]; } void recMOVNtemp_consts(int info) @@ -605,19 +593,17 @@ void recMOVNtemp_consts(int info) void recMOVNtemp_constt(int info) { - if (g_cpuConstRegs[_Rt_].UD[0] != 0) { - if( _hasFreeXMMreg() ) { - int t0reg = _allocMMXreg(-1, MMX_TEMP, 0); - MOVQMtoR(t0reg, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]); - MOVQRtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ], t0reg); - _freeMMXreg(t0reg); - } - else { - MOV32MtoR(EAX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]); - MOV32MtoR(EDX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]); - MOV32RtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ], EAX); - MOV32RtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ], EDX); - } + if( _hasFreeXMMreg() ) { + int t0reg = _allocMMXreg(-1, MMX_TEMP, 0); + MOVQMtoR(t0reg, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]); + MOVQRtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ], t0reg); + _freeMMXreg(t0reg); + } + else { + MOV32MtoR(EAX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]); + MOV32MtoR(EDX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]); + MOV32RtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ], EAX); + MOV32RtoM((int)&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ], EDX); } } @@ -672,14 +658,11 @@ void recMOVN() if( _Rs_ == _Rd_ ) return; - if( GPR_IS_CONST1(_Rd_) ) { - if( !GPR_IS_CONST2(_Rs_, _Rt_) ) { - // remove the const, since move is conditional - _deleteEEreg(_Rd_, 0); - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rd_].UL[0]); - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rd_].UL[1]); - } - } + if (GPR_IS_CONST1(_Rt_)) { + if (g_cpuConstRegs[_Rt_].UD[0] == 0) + return; + } else if (GPR_IS_CONST1(_Rd_)) + _deleteEEreg(_Rd_, 1); recMOVNtemp(); } From c8f3a36d66acd7eaabeb352be3c53f92198ec647 Mon Sep 17 00:00:00 2001 From: refraction Date: Sat, 14 Mar 2009 01:34:16 +0000 Subject: [PATCH 36/77] Made a rough start to what will hopefully be helpful in the future with dma timing and control. So VIF1 (and MFIFO) now have a restructured layout, i have left old code in place for the moment just incase its all a waste of time :p git-svn-id: http://pcsx2.googlecode.com/svn/trunk@777 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Vif.cpp | 89 ++++++--- pcsx2/VifDma.cpp | 491 ++++++++++++++++++++++++++++------------------- pcsx2/VifDma.h | 2 + 3 files changed, 357 insertions(+), 225 deletions(-) diff --git a/pcsx2/Vif.cpp b/pcsx2/Vif.cpp index 373fb37651..329f98f2d7 100644 --- a/pcsx2/Vif.cpp +++ b/pcsx2/Vif.cpp @@ -452,7 +452,10 @@ static __forceinline int mfifoVIF1chain() { int ret; /* Is QWC = 0? if so there is nothing to transfer */ - if (vif1ch->qwc == 0 && vif1.vifstalled == 0) return 0; + if (vif1ch->qwc == 0 && vif1.vifstalled == 0) { + vif1.inprogress = 0; + return 0; + } if (vif1ch->madr >= psHu32(DMAC_RBOR) && @@ -485,16 +488,30 @@ void mfifoVIF1transfer(int qwc) { g_vifCycles = 0; - mfifodmairq = 0; //Clear any previous TIE interrupt + if(qwc > 0){ vifqwc += qwc; - + if(vif1.inprogress & 0x10) + { + if (vif1ch->madr >= psHu32(DMAC_RBOR) && vif1ch->madr <= (psHu32(DMAC_RBOR)+psHu32(DMAC_RBSR))) + { + CPU_INT(10, min( (int)vifqwc, (int)vif1ch->qwc ) * BIAS); + } + else + { + CPU_INT(10, vif1ch->qwc * BIAS); + } + } + vif1.inprogress &= ~0x10; SPR_LOG("Added %x qw to mfifo, total now %x - Vif CHCR %x Stalled %x done %x\n", qwc, vifqwc, vif1ch->chcr, vif1.vifstalled, vif1.done); - - if((vif1ch->chcr & 0x100) == 0 || vif1.vifstalled == 1 || vif1.done == 1) return; + + /*if((vif1ch->chcr & 0x100) == 0 || vif1.vifstalled == 1 || vif1.done == 1 || vif1.inprogress == 1)*/ return; } + mfifodmairq = 0; //Clear any previous TIE interrupt + + if(vif1ch->qwc == 0){ ptag = (u32*)dmaGetAddr(vif1ch->tadr); @@ -505,7 +522,7 @@ void mfifoVIF1transfer(int qwc) { VIF_LOG("MFIFO Stallon tag\n"); vif1.stallontag = 1; - CPU_INT(10,cycles+g_vifCycles); + //CPU_INT(10,cycles+g_vifCycles); return; //IRQ set by VIFTransfer } } @@ -524,7 +541,7 @@ void mfifoVIF1transfer(int qwc) { switch (id) { case 0: // Refe - Transfer Packet According to ADDR field vif1ch->tadr = psHu32(DMAC_RBOR) + ((vif1ch->tadr + 16) & psHu32(DMAC_RBSR)); - vif1.done = 2; //End Transfer + vif1.done = 1; //End Transfer break; case 1: // CNT - Transfer QWC following the tag. @@ -550,31 +567,33 @@ void mfifoVIF1transfer(int qwc) { case 7: // End - Transfer QWC following the tag vif1ch->madr = psHu32(DMAC_RBOR) + ((vif1ch->tadr + 16) & psHu32(DMAC_RBSR)); //Set MADR to data following the tag vif1ch->tadr = psHu32(DMAC_RBOR) + ((vif1ch->madr + (vif1ch->qwc << 4)) & psHu32(DMAC_RBSR)); //Set TADR to QW following the data - vif1.done = 2; //End Transfer + vif1.done = 1; //End Transfer break; } - if ((vif1ch->chcr & 0x80) && (ptag[0] >> 31)) { - VIF_LOG("dmaIrq Set\n"); - vif1.done = 2; - mfifodmairq = 1; //Let the handler know we have prematurely ended MFIFO - } + if ((vif1ch->chcr & 0x80) && (ptag[0] >> 31)) + { + VIF_LOG("dmaIrq Set\n"); + vif1.done = 1; + mfifodmairq = 1; //Let the handler know we have prematurely ended MFIFO + } } - ret = mfifoVIF1chain(); - if (ret == -1) { + vif1.inprogress |= 1; + + /*if (ret == -1) { SysPrintf("VIF dmaChain error size=%d, madr=%lx, tadr=%lx\n", vif1ch->qwc, vif1ch->madr, vif1ch->tadr); vif1.done = 1; - CPU_INT(10,g_vifCycles); + //CPU_INT(10,g_vifCycles); } if(ret == -2){ VIF_LOG("MFIFO Stall\n"); - CPU_INT(10,g_vifCycles); + //CPU_INT(10,g_vifCycles); return; - } + }*/ - if(vif1.done == 2 && vif1ch->qwc == 0) vif1.done = 1; - CPU_INT(10,g_vifCycles); + //if(vif1.done == 2 && vif1ch->qwc == 0) vif1.done = 1; +//CPU_INT(10,g_vifCycles); SPR_LOG("mfifoVIF1transfer end %x madr %x, tadr %x vifqwc %x\n", vif1ch->chcr, vif1ch->madr, vif1ch->tadr, vifqwc); } @@ -582,6 +601,10 @@ void vifMFIFOInterrupt() { g_vifCycles = 0; + + + if(vif1.inprogress == 1) mfifoVIF1chain(); + if(vif1.irq && vif1.tag.size == 0) { vif1Regs->stat|= VIF1_STAT_INT; hwIntcIrq(INTC_VIF1); @@ -594,15 +617,35 @@ void vifMFIFOInterrupt() } } - if(vif1.done != 1) { + + + if(vif1.done != 1 || vif1.inprogress & 1) { + if(vifqwc <= 0){ //SysPrintf("Empty\n"); + vif1.inprogress |= 0x10; hwDmacIrq(14); return; } - mfifoVIF1transfer(0); + if(!(vif1.inprogress & 0x1)) mfifoVIF1transfer(0); + + if (vif1ch->madr >= psHu32(DMAC_RBOR) && vif1ch->madr <= (psHu32(DMAC_RBOR)+psHu32(DMAC_RBSR))) + { + CPU_INT(10, min( (int)vifqwc, (int)vif1ch->qwc ) * BIAS); + } + else + { + CPU_INT(10, vif1ch->qwc * BIAS); + } + + return; - } + } else if(vifqwc <= 0){ + //SysPrintf("Empty\n"); + //vif1.inprogress |= 0x10; + hwDmacIrq(14); + //return; + } //On a TIE break we do not clear the MFIFO (Art of Fighting) //If we dont clear it on MFIFO end, Tekken Tag breaks, understandably (Refraction) diff --git a/pcsx2/VifDma.cpp b/pcsx2/VifDma.cpp index 4bf5ff8b2a..0f24085f9a 100644 --- a/pcsx2/VifDma.cpp +++ b/pcsx2/VifDma.cpp @@ -1856,23 +1856,23 @@ int VIF1transfer(u32 *data, int size, int istag) { transferred += size - vif1.vifpacketsize; g_vifCycles+= (transferred>>2)*BIAS; /* guessing */ + vif1.irqoffset = transferred%4; // cannot lose the offset + if (vif1.irq && vif1.cmd == 0) { vif1.vifstalled = 1; - - if(((vif1Regs->code >> 24) & 0x7f) != 0x7)vif1Regs->stat|= VIF1_STAT_VIS; // Note: commenting this out fixes WALL-E // spiderman doesn't break on qw boundaries - vif1.irqoffset = transferred%4; // cannot lose the offset - + if( istag ) { return -2; } - + transferred = transferred >> 2; vif1ch->madr+= (transferred << 4); vif1ch->qwc-= transferred; + if(vif1ch->qwc == 0 && vif1.irqoffset == 0) vif1.inprogress = 0; //SysPrintf("Stall on vif1, FromSPR = %x, Vif1MADR = %x Sif0MADR = %x STADR = %x\n", psHu32(0x1000d010), vif1ch->madr, psHu32(0x1000c010), psHu32(DMAC_STADR)); return -2; } @@ -1885,198 +1885,13 @@ int VIF1transfer(u32 *data, int size, int istag) { transferred = transferred >> 2; vif1ch->madr+= (transferred << 4); vif1ch->qwc-= transferred; + if(vif1ch->qwc == 0 && vif1.irqoffset == 0) vif1.inprogress = 0; } return 0; } -int _VIF1chain() { - u32 *pMem; - //u32 qwc = vif1ch->qwc; - u32 ret; - - if (vif1ch->qwc == 0 && vif1.vifstalled == 0) return 0; - - pMem = (u32*)dmaGetAddr(vif1ch->madr); - if (pMem == NULL) - return -1; - - VIF_LOG("VIF1chain size=%d, madr=%lx, tadr=%lx\n", - vif1ch->qwc, vif1ch->madr, vif1ch->tadr); - - if( vif1.vifstalled ) { - ret = VIF1transfer(pMem+vif1.irqoffset, vif1ch->qwc*4-vif1.irqoffset, 0); - } - else { - ret = VIF1transfer(pMem, vif1ch->qwc*4, 0); - } - /*vif1ch->madr+= (vif1ch->qwc << 4); - vif1ch->qwc-= qwc;*/ - - return ret; -} - -static int prevvifcycles = 0; -static u32* prevviftag = NULL; -u32 *vif1ptag; -int _chainVIF1() { - int id; - int ret; - - vif1ptag = (u32*)dmaGetAddr(vif1ch->tadr); //Set memory pointer to TADR - if (vif1ptag == NULL) { //Is vif0ptag empty? - SysPrintf("Vif1 Tag BUSERR\n"); - vif1ch->chcr = ( vif1ch->chcr & 0xFFFF ) | ( (*vif1ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 - psHu32(DMAC_STAT)|= 1<<15; //If yes, set BEIS (BUSERR) in DMAC_STAT register - return -1; //Return -1 as an error has occurred - } - - id = (vif1ptag[0] >> 28) & 0x7; //ID for DmaChain copied from bit 28 of the tag - vif1ch->qwc = (u16)vif1ptag[0]; //QWC set to lower 16bits of the tag - vif1ch->madr = vif1ptag[1]; //MADR = ADDR field - g_vifCycles+=1; // Add 1 g_vifCycles from the QW read for the tag - - vif1ch->chcr = ( vif1ch->chcr & 0xFFFF ) | ( (*vif1ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 - // Transfer dma tag if tte is set - - VIF_LOG("VIF1 Tag %8.8x_%8.8x size=%d, id=%d, madr=%lx, tadr=%lx\n", - vif1ptag[1], vif1ptag[0], vif1ch->qwc, id, vif1ch->madr, vif1ch->tadr); - - //} else - - - if (!vif1.done && (psHu32(DMAC_CTRL) & 0xC0) == 0x40 && id == 4) { // STD == VIF1 - //vif1.done |= hwDmacSrcChainWithStack(vif1ch, id); - // there are still bugs, need to also check if gif->madr +16*qwc >= stadr, if not, stall - if( (vif1ch->madr + vif1ch->qwc * 16) >= psHu32(DMAC_STADR) ) { - // stalled - - hwDmacIrq(13); - return 0; - } - } - - if (vif1ch->chcr & 0x40) { - if(vif1.vifstalled == 1) ret = VIF1transfer(vif1ptag+(2+vif1.irqoffset), 2-vif1.irqoffset, 1); //Transfer Tag on stall - else ret = VIF1transfer(vif1ptag+2, 2, 1); //Transfer Tag - if (ret == -1) return -1; //There has been an error - if (ret == -2) { - return -2; //IRQ set by VIFTransfer - } - } - - vif1.done |= hwDmacSrcChainWithStack(vif1ch, id); - - ret = _VIF1chain(); //Transfers the data set by the switch - - if ((vif1ch->chcr & 0x80) && (vif1ptag[0] >> 31)) { //Check TIE bit of CHCR and IRQ bit of tag - VIF_LOG( "dmaIrq Set\n" ); - - vif1.done = 1; - return 0; //End Transfer - } - return vif1.done;//Return Done -} - -__forceinline void vif1Interrupt() { - VIF_LOG("vif1Interrupt: %8.8x\n", cpuRegs.cycle); - - g_vifCycles = 0; - - - if(vif1.irq && vif1.tag.size == 0) { - vif1Regs->stat|= VIF1_STAT_INT; - hwIntcIrq(VIF1intc); - --vif1.irq; - if(vif1Regs->stat & (VIF1_STAT_VSS|VIF1_STAT_VIS|VIF1_STAT_VFS)) - { - vif1Regs->stat&= ~0x1F000000; // FQC=0 - // One game doesnt like vif stalling at end, cant remember what. Spiderman isnt keen on it tho - vif1ch->chcr &= ~0x100; - return; - } - - if(vif1ch->qwc > 0 || vif1.irqoffset > 0){ - if(vif1.stallontag == 1) { - _chainVIF1(); - } - else _VIF1chain();//CPU_INT(13, vif1ch->qwc * BIAS); - CPU_INT(1, g_vifCycles); - return; - } - } - - - //} - if((vif1ch->chcr & 0x100) == 0) SysPrintf("Vif1 running when CHCR == %x\n", vif1ch->chcr); - - - if ((vif1ch->chcr & 0x104) == 0x104 && vif1.done == 0) { - - if( !(psHu32(DMAC_CTRL) & 0x1) ) { - SysPrintf("vif1 dma masked\n"); - return; - } - - _chainVIF1(); - CPU_INT(1, g_vifCycles); - - return; - } -#ifdef PCSX2_DEVBUILD - if(vif1ch->qwc > 0) SysPrintf("VIF1 Ending with %x QWC left\n"); - if(vif1.cmd != 0) SysPrintf("vif1.cmd still set %x\n", vif1.cmd); -#endif - - prevviftag = NULL; - prevvifcycles = 0; - vif1ch->chcr &= ~0x100; - g_vifCycles = 0; - hwDmacIrq(DMAC_VIF1); - if(vif1Regs->mskpath3 == 0 || (vif1ch->chcr & 0x1) == 0x1)vif1Regs->stat&= ~0x1F000000; // FQC=0 -} - -#define spr0 ((DMACh*)&PS2MEM_HW[0xD000]) -void dmaVIF1() -{ - - VIF_LOG("dmaVIF1 chcr = %lx, madr = %lx, qwc = %lx\n" - " tadr = %lx, asr0 = %lx, asr1 = %lx\n", - vif1ch->chcr, vif1ch->madr, vif1ch->qwc, - vif1ch->tadr, vif1ch->asr0, vif1ch->asr1 ); - - - g_vifCycles = 0; - - if (((psHu32(DMAC_CTRL) & 0xC) == 0x8)) { // VIF MFIFO - //SysPrintf("VIFMFIFO\n"); - if(!(vif1ch->chcr & 0x4)) SysPrintf("MFIFO mode != Chain! %x\n", vif1ch->chcr); - if(vif1ch->madr != spr0->madr)vifMFIFOInterrupt(); - return; - } - -#ifdef PCSX2_DEVBUILD - if ((psHu32(DMAC_CTRL) & 0xC0) == 0x40) { // STD == VIF1 - //SysPrintf("VIF Stall Control Source = %x, Drain = %x\n", (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3); - //return; - } -#endif - - - vif1Regs->stat|= 0x10000000; // FQC=16 - - if (!(vif1ch->chcr & 0x4) || vif1ch->qwc > 0) { // Normal Mode - if ((psHu32(DMAC_CTRL) & 0xC0) == 0x40) { - SysPrintf("DMA Stall Control on VIF1 normal\n"); - } - if ((vif1ch->chcr & 0x1)) { // to Memory - if(_VIF1chain() == -2) { - SysPrintf("Stall on normal\n"); - //vif1.vifstalled = 1; - } - CPU_INT(1, g_vifCycles); - } else { - +void vif1TransferFromMemory(){ int size; u64* pMem = (u64*)dmaGetAddr(vif1ch->madr); @@ -2122,11 +1937,279 @@ void dmaVIF1() g_vifCycles += vif1ch->qwc * 2; vif1ch->madr += vif1ch->qwc * 16; // mgs3 scene changes vif1ch->qwc = 0; - CPU_INT(1, g_vifCycles); +} + +int _VIF1chain() { + u32 *pMem; + //u32 qwc = vif1ch->qwc; + u32 ret; + + if (vif1ch->qwc == 0 && vif1.vifstalled == 0 && vif1.irqoffset == 0) { + vif1.inprogress = 0; + return 0; + } + + if(vif1.dmamode == 1){ + vif1TransferFromMemory(); + vif1.inprogress = 0; + return 0; + } + + pMem = (u32*)dmaGetAddr(vif1ch->madr); + if (pMem == NULL) + return -1; + + VIF_LOG("VIF1chain size=%d, madr=%lx, tadr=%lx\n", + vif1ch->qwc, vif1ch->madr, vif1ch->tadr); + + if( vif1.vifstalled ) { + ret = VIF1transfer(pMem+vif1.irqoffset, vif1ch->qwc*4-vif1.irqoffset, 0); + } + else { + ret = VIF1transfer(pMem, vif1ch->qwc*4, 0); + } + /*vif1ch->madr+= (vif1ch->qwc << 4); + vif1ch->qwc-= qwc;*/ + + return ret; +} + +static int prevvifcycles = 0; +static u32* prevviftag = NULL; +u32 *vif1ptag; +int _chainVIF1() { + + return vif1.done;//Return Done +} + +__forceinline void vif1SetupTransfer() { + + switch(vif1.dmamode){ + case 0: //Normal + case 1: //Normal (From memory) + vif1.inprogress = 1; + vif1.done = 1; + break; + + case 2: //Chain + int id; + int ret; + + + + vif1ptag = (u32*)dmaGetAddr(vif1ch->tadr); //Set memory pointer to TADR + if (vif1ptag == NULL) { //Is vif0ptag empty? + SysPrintf("Vif1 Tag BUSERR\n"); + vif1ch->chcr = ( vif1ch->chcr & 0xFFFF ) | ( (*vif1ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 + psHu32(DMAC_STAT)|= 1<<15; //If yes, set BEIS (BUSERR) in DMAC_STAT register + return; //Return -1 as an error has occurred + } + + id = (vif1ptag[0] >> 28) & 0x7; //ID for DmaChain copied from bit 28 of the tag + vif1ch->qwc = (u16)vif1ptag[0]; //QWC set to lower 16bits of the tag + vif1ch->madr = vif1ptag[1]; //MADR = ADDR field + g_vifCycles+=1; // Add 1 g_vifCycles from the QW read for the tag + + vif1ch->chcr = ( vif1ch->chcr & 0xFFFF ) | ( (*vif1ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 + // Transfer dma tag if tte is set + + VIF_LOG("VIF1 Tag %8.8x_%8.8x size=%d, id=%d, madr=%lx, tadr=%lx\n", + vif1ptag[1], vif1ptag[0], vif1ch->qwc, id, vif1ch->madr, vif1ch->tadr); + + //} else + + + if (!vif1.done && (psHu32(DMAC_CTRL) & 0xC0) == 0x40 && id == 4) { // STD == VIF1 + //vif1.done |= hwDmacSrcChainWithStack(vif1ch, id); + // there are still bugs, need to also check if gif->madr +16*qwc >= stadr, if not, stall + if( (vif1ch->madr + vif1ch->qwc * 16) >= psHu32(DMAC_STADR) ) { + // stalled + + hwDmacIrq(13); + return; + } + } + + if (vif1ch->chcr & 0x40) { + if(vif1.vifstalled == 1) ret = VIF1transfer(vif1ptag+(2+vif1.irqoffset), 2-vif1.irqoffset, 1); //Transfer Tag on stall + else ret = VIF1transfer(vif1ptag+2, 2, 1); //Transfer Tag + if (ret == -1) return; //There has been an error + if (ret == -2) { + return; //IRQ set by VIFTransfer + } + } + + vif1.inprogress = 1; + vif1.done |= hwDmacSrcChainWithStack(vif1ch, id); + + + if ((vif1ch->chcr & 0x80) && (vif1ptag[0] >> 31)) { //Check TIE bit of CHCR and IRQ bit of tag + VIF_LOG( "dmaIrq Set\n" ); + + vif1.done = 1; + return; //End Transfer + } + break; + } +} +__forceinline void vif1Interrupt() { + VIF_LOG("vif1Interrupt: %8.8x\n", cpuRegs.cycle); + + g_vifCycles = 0; + + + + + + //} + if((vif1ch->chcr & 0x100) == 0) SysPrintf("Vif1 running when CHCR == %x\n", vif1ch->chcr); + + if(vif1.inprogress == 1) _VIF1chain(); + + if(vif1.irq && vif1.tag.size == 0) + { + vif1Regs->stat|= VIF1_STAT_INT; + hwIntcIrq(VIF1intc); + --vif1.irq; + if(vif1Regs->stat & (VIF1_STAT_VSS|VIF1_STAT_VIS|VIF1_STAT_VFS)) + { + vif1Regs->stat&= ~0x1F000000; // FQC=0 + // One game doesnt like vif stalling at end, cant remember what. Spiderman isnt keen on it tho + vif1ch->chcr &= ~0x100; + return; + } + else if(vif1ch->qwc > 0 || vif1.irqoffset > 0) + { + if(vif1.stallontag == 1) + { + vif1SetupTransfer(); + } + else _VIF1chain();//CPU_INT(13, vif1ch->qwc * BIAS); + } - vif1.done = 1; + } + + if (vif1.done == 0 || vif1.inprogress == 1) { + + if( !(psHu32(DMAC_CTRL) & 0x1) ) { + SysPrintf("vif1 dma masked\n"); + return; + } + + //_chainVIF1(); + if(vif1.inprogress == 0)vif1SetupTransfer(); + + CPU_INT(1, vif1ch->qwc * BIAS); return; } +#ifdef PCSX2_DEVBUILD + if(vif1ch->qwc > 0) SysPrintf("VIF1 Ending with %x QWC left\n"); + if(vif1.cmd != 0) SysPrintf("vif1.cmd still set %x\n", vif1.cmd); +#endif + + prevviftag = NULL; + prevvifcycles = 0; + vif1ch->chcr &= ~0x100; + g_vifCycles = 0; + hwDmacIrq(DMAC_VIF1); + if(vif1Regs->mskpath3 == 0 || (vif1ch->chcr & 0x1) == 0x1)vif1Regs->stat&= ~0x1F000000; // FQC=0 +} + +#define spr0 ((DMACh*)&PS2MEM_HW[0xD000]) +void dmaVIF1() +{ + + VIF_LOG("dmaVIF1 chcr = %lx, madr = %lx, qwc = %lx\n" + " tadr = %lx, asr0 = %lx, asr1 = %lx\n", + vif1ch->chcr, vif1ch->madr, vif1ch->qwc, + vif1ch->tadr, vif1ch->asr0, vif1ch->asr1 ); + + + g_vifCycles = 0; + vif1.inprogress = 0; + + if (((psHu32(DMAC_CTRL) & 0xC) == 0x8)) { // VIF MFIFO + //SysPrintf("VIFMFIFO\n"); + if(!(vif1ch->chcr & 0x4)) SysPrintf("MFIFO mode != Chain! %x\n", vif1ch->chcr); + /*if(vif1ch->madr != spr0->madr)*/vifMFIFOInterrupt(); + //else vif1.inprogress |= 0x10; + return; + } + +#ifdef PCSX2_DEVBUILD + if ((psHu32(DMAC_CTRL) & 0xC0) == 0x40) { // STD == VIF1 + //SysPrintf("VIF Stall Control Source = %x, Drain = %x\n", (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3); + //return; + } +#endif + + + vif1Regs->stat|= 0x10000000; // FQC=16 + + if (!(vif1ch->chcr & 0x4) || vif1ch->qwc > 0) { // Normal Mode + + if ((psHu32(DMAC_CTRL) & 0xC0) == 0x40) { + SysPrintf("DMA Stall Control on VIF1 normal\n"); + } + if ((vif1ch->chcr & 0x1)) { // to Memory + /*if(_VIF1chain() == -2) { + SysPrintf("Stall on normal\n"); + //vif1.vifstalled = 1; + } + CPU_INT(1, g_vifCycles);*/ + vif1.dmamode = 0; + } else { + vif1.dmamode = 1; + /*int size; + u64* pMem = (u64*)dmaGetAddr(vif1ch->madr); + + // VIF from gsMemory + + if (pMem == NULL) { //Is vif0ptag empty? + SysPrintf("Vif1 Tag BUSERR\n"); + psHu32(DMAC_STAT)|= 1<<15; //If yes, set BEIS (BUSERR) in DMAC_STAT register + vif1.done = 1; + vif1Regs->stat&= ~0x1f000000; + vif1ch->qwc = 0; + CPU_INT(1, 0); + + return; //Return -1 as an error has occurred + } + + // MTGS concerns: The MTGS is inherently disagreeable with the idea of downloading + // stuff from the GS. The *only* way to handle this case safely is to flush the GS + // completely and execute the transfer there-after. + + FreezeXMMRegs(1); + if( GSreadFIFO2 == NULL ) { + for (size=vif1ch->qwc; size>0; --size) { + if (size > 1 ) { + mtgsWaitGS(); + GSreadFIFO((u64*)&PS2MEM_HW[0x5000]); + } + pMem[0] = psHu64(0x5000); + pMem[1] = psHu64(0x5008); pMem+= 2; + } + } + else { + mtgsWaitGS(); + GSreadFIFO2(pMem, vif1ch->qwc); + + // set incase read + psHu64(0x5000) = pMem[2*vif1ch->qwc-2]; + psHu64(0x5008) = pMem[2*vif1ch->qwc-1]; + } + FreezeXMMRegs(0); + + if(vif1Regs->mskpath3 == 0)vif1Regs->stat&= ~0x1f000000; + g_vifCycles += vif1ch->qwc * 2; + vif1ch->madr += vif1ch->qwc * 16; // mgs3 scene changes + vif1ch->qwc = 0; + CPU_INT(1, g_vifCycles);*/ + } + /*vif1.done = 1; + return;*/ + } else vif1.dmamode = 2; // Chain Mode vif1.done = 0; @@ -2154,6 +2237,7 @@ void vif1Write32(u32 mem, u32 value) { psHu64(0x10005008) = 0; vif1.done = 1; vif1Regs->err = 0; + vif1.inprogress = 0; vif1Regs->stat&= ~(0x1F800000|VIF1_STAT_INT|VIF1_STAT_VSS|VIF1_STAT_VIS|VIF1_STAT_VFS|VIF1_STAT_VPS); // FQC=0 } if (value & 0x2) { @@ -2192,15 +2276,18 @@ void vif1Write32(u32 mem, u32 value) { g_vifCycles = 0; // loop necessary for spiderman if((psHu32(DMAC_CTRL) & 0xC) == 0x8){ - //SysPrintf("MFIFO Stall\n"); - CPU_INT(10, 0); - }else { - if(vif1.stallontag == 1){ - //SysPrintf("Sorting VIF Stall on tag\n"); - _chainVIF1(); - } else _VIF1chain(); - CPU_INT(1, g_vifCycles); // Gets the timing right - Flatout + //SysPrintf("MFIFO Stall\n"); + //CPU_INT(10, 0); + CPU_INT(10, vif1ch->qwc * BIAS); + }else { + /*if(vif1.stallontag == 1){ + //SysPrintf("Sorting VIF Stall on tag\n"); + vif1SetupTransfer(); + } *///else _VIF1chain(); + + //CPU_INT(1, g_vifCycles); // Gets the timing right - Flatout + CPU_INT(1, vif1ch->qwc * BIAS); } vif1ch->chcr |= 0x100; } diff --git a/pcsx2/VifDma.h b/pcsx2/VifDma.h index e2605ec81a..86fe63f102 100644 --- a/pcsx2/VifDma.h +++ b/pcsx2/VifDma.h @@ -40,6 +40,8 @@ struct vifStruct { u8 irqoffset; // 32bit offset where next vif code is u32 savedtag; // need this for backwards compat with save states u32 vifpacketsize; + u8 inprogress; + u8 dmamode; }; extern vifStruct vif0, vif1; From 17298b7e6bd93c99c83830c6d1b6ada5f8b19166 Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Sat, 14 Mar 2009 02:06:18 +0000 Subject: [PATCH 37/77] Made constant register saving more simple and certain. Grandia 2 is probably the only game that this would've fixed, but maybe there are others. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@778 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/iR3000A.cpp | 38 +++------------------------ pcsx2/x86/iR3000A.h | 2 -- pcsx2/x86/iR5900.h | 2 -- pcsx2/x86/ix86-32/iR5900-32.cpp | 20 +++----------- pcsx2/x86/ix86-32/iR5900Templates.cpp | 22 ---------------- 5 files changed, 7 insertions(+), 77 deletions(-) diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 4fa5df94cd..0b67e095d9 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -74,8 +74,8 @@ static BASEBLOCKEX* s_pCurBlockEx = NULL; static u32 s_nEndBlock = 0; // what psxpc the current block ends -static u32 s_ConstGPRreg; -static u32 s_saveConstGPRreg = 0, s_saveHasConstReg = 0, s_saveFlushedConstReg = 0; +static u32 s_saveConstRegs[32]; +static u32 s_saveHasConstReg = 0, s_saveFlushedConstReg = 0; static EEINST* s_psaveInstInfo = NULL; u32 s_psxBlockCycles = 0; // cycles of current block recompiling @@ -334,7 +334,7 @@ void _psxFlushCall(int flushtype) void psxSaveBranchState() { s_savenBlockCycles = s_psxBlockCycles; - s_saveConstGPRreg = 0xffffffff; // indicate searching + memcpy(s_saveConstRegs, g_psxConstRegs, sizeof(g_psxConstRegs)); s_saveHasConstReg = g_psxHasConstReg; s_saveFlushedConstReg = g_psxFlushedConstReg; s_psaveInstInfo = g_pCurInstInfo; @@ -347,18 +347,7 @@ void psxLoadBranchState() { s_psxBlockCycles = s_savenBlockCycles; - if( s_saveConstGPRreg != 0xffffffff ) { - assert( s_saveConstGPRreg > 0 ); - - // make sure right GPR was saved - assert( g_psxHasConstReg == s_saveHasConstReg || (g_psxHasConstReg ^ s_saveHasConstReg) == (1< 0 ); - - // make sure right GPR was saved - assert( g_cpuHasConstReg == s_saveHasConstReg || (g_cpuHasConstReg ^ s_saveHasConstReg) == (1< Date: Sat, 14 Mar 2009 02:12:17 +0000 Subject: [PATCH 38/77] Plugin APIs: Restored pDsp, renamed to pDisplay for clarity (Though arcum42's right and about needing documentation). Renamed PADinit for psx emulator compatibility. Played around a bit with SIO api, thinking for simplicity best to just use one plugin of each type (SIO PAD/MTAP, remote, and memcard. Could even be separate types, but no real need for it). Added PADFreeze() and its friend SIOFreeze(). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@779 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/api/CDVDApi.h | 12 ++++++------ common/include/api/Dev9Api.h | 8 ++++---- common/include/api/FWApi.h | 8 ++++---- common/include/api/GSApi.h | 8 ++++---- common/include/api/PadApi.h | 11 ++++++----- common/include/api/SIOApi.h | 22 +++++++++++++++------- common/include/api/Spu2Api.h | 8 ++++---- common/include/api/USBApi.h | 8 ++++---- 8 files changed, 47 insertions(+), 38 deletions(-) diff --git a/common/include/api/CDVDApi.h b/common/include/api/CDVDApi.h index 9ace43c7ae..5a0310fe18 100644 --- a/common/include/api/CDVDApi.h +++ b/common/include/api/CDVDApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __CDVDAPI_H__ #define __CDVDAPI_H__ @@ -28,7 +28,7 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" /* CDVD plugin API */ @@ -36,7 +36,7 @@ // Basic functions. EXPORT_C_(s32) CDVDinit(char *configpath); -EXPORT_C_(s32) CDVDopen(const char* pTitleFilename); +EXPORT_C_(s32) CDVDopen(void *pDisplay, const char* pTitleFilename); EXPORT_C_(void) CDVDclose(); EXPORT_C_(void) CDVDshutdown(); EXPORT_C_(s32) CDVDreadTrack(u32 lsn, int mode); @@ -92,7 +92,7 @@ CDVD_MODE_2328 2, // skip sync+head+sub (24) bytes CDVD_MODE_2048 3, // skip sync+head+sub (24) bytes CDVD_MODE_2368 4 // full 2352 bytes + 16 subq } TrackModes - + // CDVDgetDiskType returns: enum { CDVD_TYPE_ILLEGAL = 0xff, // Illegal Disc @@ -110,7 +110,7 @@ CDVD_TYPE_DETCTCD = 0x02, // Detecting Cd CDVD_TYPE_DETCT = 0x01, // Detecting CDVD_TYPE_NODISC = 0x00 // No Disc } DiskType; - + // CDVDgetTrayStatus returns: enum { CDVD_TRAY_CLOSE = 0x00, diff --git a/common/include/api/Dev9Api.h b/common/include/api/Dev9Api.h index cd6746453c..4523dbef90 100644 --- a/common/include/api/Dev9Api.h +++ b/common/include/api/Dev9Api.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __DEV9API_H__ #define __DEV9API_H__ @@ -28,7 +28,7 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" typedef void (*DEV9callback)(int cycles); @@ -38,7 +38,7 @@ typedef int (*DEV9handler)(void); // NOTE: The read/write functions CANNOT use XMM/MMX regs // If you want to use them, need to save and restore current ones EXPORT_C_(s32) DEV9init(char *configpath); -EXPORT_C_(s32) DEV9open(); +EXPORT_C_(s32) DEV9open(void *pDisplay); EXPORT_C_(void) DEV9close(); EXPORT_C_(void) DEV9shutdown(); EXPORT_C_(u8) DEV9read8(u32 addr); diff --git a/common/include/api/FWApi.h b/common/include/api/FWApi.h index bc42f0a11c..df402bd2e9 100644 --- a/common/include/api/FWApi.h +++ b/common/include/api/FWApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __FWAPI_H__ #define __FWAPI_H__ @@ -28,7 +28,7 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" /* FW plugin API */ @@ -38,7 +38,7 @@ // NOTE: The read/write functions CANNOT use XMM/MMX regs // If you want to use them, need to save and restore current ones EXPORT_C_(s32) CALLBACK FWinit(char *configpath); -EXPORT_C_(s32) CALLBACK FWopen(); +EXPORT_C_(s32) CALLBACK FWopen(void *pDisplay); EXPORT_C_(void) CALLBACK FWclose(); EXPORT_C_(void) CALLBACK FWshutdown(); EXPORT_C_(u32) CALLBACK FWread32(u32 addr); diff --git a/common/include/api/GSApi.h b/common/include/api/GSApi.h index e40972c6e2..db17cb7111 100644 --- a/common/include/api/GSApi.h +++ b/common/include/api/GSApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __GSAPI_H__ #define __GSAPI_H__ @@ -28,7 +28,7 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" typedef struct _GSdriverInfo { @@ -38,7 +38,7 @@ typedef struct _GSdriverInfo { // Basic functions. EXPORT_C_(s32) GSinit(char *configpath); -EXPORT_C_(s32) GSopen(char *Title, bool multithread); +EXPORT_C_(s32) GSopen(void *pDisplay, char *Title, bool multithread); EXPORT_C_(void) GSclose(); EXPORT_C_(void) GSshutdown(); EXPORT_C_(void) GSvsync(int field); diff --git a/common/include/api/PadApi.h b/common/include/api/PadApi.h index 87658ddd81..5bee1f4eb1 100644 --- a/common/include/api/PadApi.h +++ b/common/include/api/PadApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __PADAPI_H__ #define __PADAPI_H__ @@ -28,15 +28,15 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" /* PAD plugin API */ /* So obsolete that everyone uses it. */ // Basic functions. -EXPORT_C_(s32) CALLBACK PADinit(char *configpath, u32 flags); -EXPORT_C_(s32) CALLBACK PADopen(); +EXPORT_C_(s32) CALLBACK PADinitEx(char *configpath); +EXPORT_C_(s32) CALLBACK PADopen(void *pDsp); EXPORT_C_(void) CALLBACK PADclose(); EXPORT_C_(void) CALLBACK PADshutdown(); // PADkeyEvent is called every vsync (return NULL if no event) @@ -58,6 +58,7 @@ EXPORT_C_(u8) CALLBACK PADquery(); EXPORT_C_(void) CALLBACK PADupdate(u8 pad); // Extended functions +EXPORT_C_(s32) CALLBACK PADfreeze(int mode, freezeData *data); EXPORT_C_(void) CALLBACK PADgsDriverInfo(GSdriverInfo *info); EXPORT_C_(void) CALLBACK PADconfigure(); EXPORT_C_(void) CALLBACK PADabout(); diff --git a/common/include/api/SIOApi.h b/common/include/api/SIOApi.h index ec99b56343..91ffeb00f3 100644 --- a/common/include/api/SIOApi.h +++ b/common/include/api/SIOApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __SIOAPI_H__ #define __SIOAPI_H__ @@ -28,19 +28,27 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" /* SIO plugin API */ // basic funcs -s32 CALLBACK SIOinit(char *configpath, u32 port, u32 slot, SIOchangeSlotCB f); -s32 CALLBACK SIOopen(); +// Single plugin can only be PAD, MTAP, RM, or MC. Only load one plugin of each type, +// but not both a PAD and MTAP. Simplifies plugin selection and interface, as well +// as API. +s32 CALLBACK SIOinit(char *configpath); +s32 CALLBACK SIOopen(void *pDisplay); void CALLBACK SIOclose(); void CALLBACK SIOshutdown(); -u8 CALLBACK SIOstartPoll(u8 value); -u8 CALLBACK SIOpoll(u8 value); +// Returns 0 if device doesn't exist. Simplifies things. Also means you don't +// have to distinguish between MTAP and PAD SIO plugins. +s32 CALLBACK SIOstartPoll(u8 deviceType, u32 port, u32 slot, u8 *returnValue); +// Returns 0 on the last output byte. +s32 CALLBACK SIOpoll(u8 value, u8 *returnValue); + +EXPORT_C_(keyEvent*) CALLBACK SIOkeyEvent(); // returns: SIO_TYPE_{PAD,MTAP,RM,MC} u32 CALLBACK SIOquery(); diff --git a/common/include/api/Spu2Api.h b/common/include/api/Spu2Api.h index 51e7ff7dff..e9abfced2e 100644 --- a/common/include/api/Spu2Api.h +++ b/common/include/api/Spu2Api.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __SPU2API_H__ #define __SPU2API_H__ @@ -28,11 +28,11 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" EXPORT_C_(s32) SPU2init(char *configpath); -EXPORT_C_(s32) SPU2open(); +EXPORT_C_(s32) SPU2open(void *pDisplay); EXPORT_C_(void) SPU2close(); EXPORT_C_(void) SPU2shutdown(); EXPORT_C_(void) SPU2write(u32 mem, u16 value); diff --git a/common/include/api/USBApi.h b/common/include/api/USBApi.h index dd71dc2038..99697ab882 100644 --- a/common/include/api/USBApi.h +++ b/common/include/api/USBApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __USBAPI_H__ #define __USBAPI_H__ @@ -28,7 +28,7 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" typedef void (*USBcallback)(int cycles); @@ -36,7 +36,7 @@ typedef int (*USBhandler)(void); // Basic functions. EXPORT_C_(s32) CALLBACK USBinit(char *configpath); -EXPORT_C_(s32) CALLBACK USBopen(); +EXPORT_C_(s32) CALLBACK USBopen(void *pDisplay); EXPORT_C_(void) CALLBACK USBclose(); EXPORT_C_(void) CALLBACK USBshutdown(); EXPORT_C_(u8) CALLBACK USBread8(u32 addr); From ceaee3748e9d71e2dd5d022ce5b6f98a642abdc2 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 14 Mar 2009 02:39:40 +0000 Subject: [PATCH 39/77] Plugin APIs: Corrected a few things that got missed when I committed initially. Moved the ini path passing to a separate function. Restored a few functions I'd deleted, and depreciated them instead. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@780 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Pcsx2Api.h | 7 ---- common/include/PluginCallbacks.h | 72 +++++++++++++++++++++++++------- common/include/api/CDVDApi.h | 5 ++- common/include/api/Dev9Api.h | 14 ++++--- common/include/api/FWApi.h | 31 +++++++------- common/include/api/GSApi.h | 10 +++-- common/include/api/PadApi.h | 36 ++++++++-------- common/include/api/SIOApi.h | 41 +++++++++++------- common/include/api/Spu2Api.h | 23 +++++++--- common/include/api/USBApi.h | 45 ++++++++++---------- 10 files changed, 180 insertions(+), 104 deletions(-) diff --git a/common/include/Pcsx2Api.h b/common/include/Pcsx2Api.h index d621419bcd..6dd07e6982 100644 --- a/common/include/Pcsx2Api.h +++ b/common/include/Pcsx2Api.h @@ -69,13 +69,6 @@ PS2E_FW_VERSION = 0x0002, PS2E_SIO_VERSION = 0x0001 } PluginLibVersion; -enum { -SIO_TYPE_PAD = 0x00000001, -SIO_TYPE_MTAP = 0x00000004, -SIO_TYPE_RM = 0x00000040, -SIO_TYPE_MC = 0x00000100 -} SioTypes; - // freeze modes: enum { FREEZE_LOAD = 0, diff --git a/common/include/PluginCallbacks.h b/common/include/PluginCallbacks.h index 0545235215..79a18d87e9 100644 --- a/common/include/PluginCallbacks.h +++ b/common/include/PluginCallbacks.h @@ -17,8 +17,8 @@ */ -#ifndef __PLUGINCALLBACKS_H__ -#define __PLUGINCALLBACKS_H__ +#ifndef __pDisplayS_H__ +#define __pDisplayS_H__ extern "C" { typedef u32 (CALLBACK* _PS2EgetLibType)(void); @@ -29,7 +29,7 @@ typedef char*(CALLBACK* _PS2EgetLibName)(void); // NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs // If you want to use them, need to save and restore current ones typedef s32 (CALLBACK* _GSinit)(char *configpath); -typedef s32 (CALLBACK* _GSopen)(char *Title, bool multithread); +typedef s32 (CALLBACK* _GSopen)(void *pDisplay, char *Title, bool multithread); typedef void (CALLBACK* _GSclose)(); typedef void (CALLBACK* _GSshutdown)(); typedef void (CALLBACK* _GSvsync)(int field); @@ -60,12 +60,13 @@ typedef void (CALLBACK* _GSmakeSnapshot)(const char *path); typedef void (CALLBACK* _GSmakeSnapshot2)(const char *path, int*, int); typedef s32 (CALLBACK* _GSfreeze)(u8 mode, freezeData *data); typedef void (CALLBACK* _GSconfigure)(); +typedef void (CALLBACK* _GSconfigpath)(char *configpath); typedef s32 (CALLBACK* _GStest)(); typedef void (CALLBACK* _GSabout)(); // PAD typedef s32 (CALLBACK* _PADinit)(char *configpath, u32 flags); -typedef s32 (CALLBACK* _PADopen)(); +typedef s32 (CALLBACK* _PADopen)(void *pDisplay); typedef void (CALLBACK* _PADclose)(); typedef void (CALLBACK* _PADshutdown)(); typedef keyEvent* (CALLBACK* _PADkeyEvent)(); @@ -75,20 +76,25 @@ typedef u32 (CALLBACK* _PADquery)(); typedef void (CALLBACK* _PADupdate)(u8 pad); typedef void (CALLBACK* _PADgsDriverInfo)(GSdriverInfo *info); +typedef s32 (CALLBACK* _PADfreeze)(u8 mode, freezeData *data); typedef void (CALLBACK* _PADconfigure)(); +typedef void (CALLBACK* _PADconfigpath)(char *configpath); typedef s32 (CALLBACK* _PADtest)(); typedef void (CALLBACK* _PADabout)(); // SIO -typedef s32 (CALLBACK* _SIOinit)(char *configpath, u32 port, u32 slot, SIOchangeSlotCB f); -typedef s32 (CALLBACK* _SIOopen)(); +typedef s32 (CALLBACK* _SIOinit)(); +typedef s32 (CALLBACK* _SIOopen)(void *pDisplay); typedef void (CALLBACK* _SIOclose)(); typedef void (CALLBACK* _SIOshutdown)(); -typedef u8 (CALLBACK* _SIOstartPoll)(u8 value); -typedef u8 (CALLBACK* _SIOpoll)(u8 value); +typedef s32 (CALLBACK* _SIOstartPoll)(u8 deviceType, u32 port, u32 slot, u8 *returnValue); +typedef s32 (CALLBACK* _SIOpoll)(u8 value, u8 *returnValue); typedef u32 (CALLBACK* _SIOquery)(); +typedef void (CALLBACK* _SIOkeyEvent)(keyEvent* ev); +typedef s32 (CALLBACK* _SIOfreeze)(u8 mode, freezeData *data); typedef void (CALLBACK* _SIOconfigure)(); +typedef void (CALLBACK* _SIOconfigpath)(char *configpath); typedef s32 (CALLBACK* _SIOtest)(); typedef void (CALLBACK* _SIOabout)(); @@ -96,11 +102,19 @@ typedef void (CALLBACK* _SIOabout)(); // NOTE: The read/write functions CANNOT use XMM/MMX regs // If you want to use them, need to save and restore current ones typedef s32 (CALLBACK* _SPU2init)(char *configpath); -typedef s32 (CALLBACK* _SPU2open)(); +typedef s32 (CALLBACK* _SPU2open)(void *pDisplay); typedef void (CALLBACK* _SPU2close)(); typedef void (CALLBACK* _SPU2shutdown)(); typedef void (CALLBACK* _SPU2write)(u32 mem, u16 value); typedef u16 (CALLBACK* _SPU2read)(u32 mem); + +typedef void (CALLBACK* _SPU2readDMA4Mem)(u16 *pMem, u32 size); +typedef void (CALLBACK* _SPU2writeDMA4Mem)(u16 *pMem, u32 size); +typedef void (CALLBACK* _SPU2interruptDMA4)(); +typedef void (CALLBACK* _SPU2readDMA7Mem)(u16 *pMem, u32 size); +typedef void (CALLBACK* _SPU2writeDMA7Mem)(u16 *pMem, u32 size); +typedef void (CALLBACK* _SPU2interruptDMA7)(); + typedef void (CALLBACK* _SPU2readDMAMem)(u16 *pMem, u32 size, u8 core); typedef void (CALLBACK* _SPU2writeDMAMem)(u16 *pMem, u32 size, u8 core); typedef void (CALLBACK* _SPU2interruptDMA)(u8 core); @@ -114,8 +128,10 @@ typedef void (CALLBACK* _SPU2setTimeStretcher)(short int enable); typedef u32 (CALLBACK* _SPU2ReadMemAddr)(u8 core); typedef void (CALLBACK* _SPU2WriteMemAddr)(u8 core,u32 value); typedef void (CALLBACK* _SPU2async)(u32 cycles); -typedef s32 (CALLBACK* _SPU2freeze)(int mode, freezeData *data); +typedef s32 (CALLBACK* _SPU2freeze)(u8 mode, freezeData *data); +typedef void (CALLBACK* _SPU2keyEvent)(keyEvent* ev); typedef void (CALLBACK* _SPU2configure)(); +typedef void (CALLBACK* _SPU2configpath)(char *configpath); typedef s32 (CALLBACK* _SPU2test)(); typedef void (CALLBACK* _SPU2about)(); @@ -137,7 +153,10 @@ typedef s32 (CALLBACK* _CDVDgetTrayStatus)(); typedef s32 (CALLBACK* _CDVDctrlTrayOpen)(); typedef s32 (CALLBACK* _CDVDctrlTrayClose)(); +typedef void (CALLBACK* _CDVDkeyEvent)(keyEvent* ev); +typedef s32 (CALLBACK* _CDVDfreeze)(u8 mode, freezeData *data); typedef void (CALLBACK* _CDVDconfigure)(); +typedef void (CALLBACK* _CDVDconfigpath)(char *configpath); typedef s32 (CALLBACK* _CDVDtest)(); typedef void (CALLBACK* _CDVDabout)(); typedef void (CALLBACK* _CDVDnewDiskCB)(void (*callback)()); @@ -146,7 +165,7 @@ typedef void (CALLBACK* _CDVDnewDiskCB)(void (*callback)()); // NOTE: The read/write functions CANNOT use XMM/MMX regs // If you want to use them, need to save and restore current ones typedef s32 (CALLBACK* _DEV9init)(char *configpath); -typedef s32 (CALLBACK* _DEV9open)(); +typedef s32 (CALLBACK* _DEV9open)(void *pDisplay); typedef void (CALLBACK* _DEV9close)(); typedef void (CALLBACK* _DEV9shutdown)(); typedef u8 (CALLBACK* _DEV9read8)(u32 mem); @@ -160,8 +179,10 @@ typedef void (CALLBACK* _DEV9writeDMA8Mem)(u32 *pMem, int size); typedef void (CALLBACK* _DEV9irqCallback)(DEV9callback callback); typedef DEV9handler (CALLBACK* _DEV9irqHandler)(void); +typedef void (CALLBACK* _DEV9keyEvent)(keyEvent* ev); typedef s32 (CALLBACK* _DEV9freeze)(int mode, freezeData *data); typedef void (CALLBACK* _DEV9configure)(); +typedef void (CALLBACK* _DEV9configpath)(char *configpath); typedef s32 (CALLBACK* _DEV9test)(); typedef void (CALLBACK* _DEV9about)(); @@ -169,7 +190,7 @@ typedef void (CALLBACK* _DEV9about)(); // NOTE: The read/write functions CANNOT use XMM/MMX regs // If you want to use them, need to save and restore current ones typedef s32 (CALLBACK* _USBinit)(char *configpath); -typedef s32 (CALLBACK* _USBopen)(); +typedef s32 (CALLBACK* _USBopen)(void *pDisplay); typedef void (CALLBACK* _USBclose)(); typedef void (CALLBACK* _USBshutdown)(); typedef u8 (CALLBACK* _USBread8)(u32 mem); @@ -185,22 +206,26 @@ typedef void (CALLBACK* _USBirqCallback)(USBcallback callback); typedef USBhandler (CALLBACK* _USBirqHandler)(void); typedef void (CALLBACK* _USBsetRAM)(void *mem); +typedef void (CALLBACK* _USBkeyEvent)(keyEvent* ev); typedef s32 (CALLBACK* _USBfreeze)(int mode, freezeData *data); typedef void (CALLBACK* _USBconfigure)(); +typedef void (CALLBACK* _USBconfigpath)(char *configpath); typedef s32 (CALLBACK* _USBtest)(); typedef void (CALLBACK* _USBabout)(); //FW typedef s32 (CALLBACK* _FWinit)(char *configpath); -typedef s32 (CALLBACK* _FWopen)(); +typedef s32 (CALLBACK* _FWopen)(void *pDisplay); typedef void (CALLBACK* _FWclose)(); typedef void (CALLBACK* _FWshutdown)(); typedef u32 (CALLBACK* _FWread32)(u32 mem); typedef void (CALLBACK* _FWwrite32)(u32 mem, u32 value); typedef void (CALLBACK* _FWirqCallback)(void (*callback)()); +typedef void (CALLBACK* _FWkeyEvent)(keyEvent* ev); typedef s32 (CALLBACK* _FWfreeze)(int mode, freezeData *data); typedef void (CALLBACK* _FWconfigure)(); +typedef void (CALLBACK* _FWconfigpath)(char *configpath); typedef s32 (CALLBACK* _FWtest)(); typedef void (CALLBACK* _FWabout)(); @@ -236,6 +261,7 @@ extern _GSsetWindowInfo GSsetWindowInfo; #endif extern _GSfreeze GSfreeze; extern _GSconfigure GSconfigure; +extern _GSconfigpath GSconfigpath; extern _GStest GStest; extern _GSabout GSabout; @@ -250,8 +276,10 @@ extern _PADpoll PAD1poll; extern _PADquery PAD1query; extern _PADupdate PAD1update; +extern _PADfreeze PAD1freeze; extern _PADgsDriverInfo PAD1gsDriverInfo; extern _PADconfigure PAD1configure; +extern _PADconfigpath PAD1configpath; extern _PADtest PAD1test; extern _PADabout PAD1about; @@ -266,8 +294,10 @@ extern _PADpoll PAD2poll; extern _PADquery PAD2query; extern _PADupdate PAD2update; +extern _PADfreeze PAD2freeze; extern _PADgsDriverInfo PAD2gsDriverInfo; extern _PADconfigure PAD2configure; +extern _PADconfigpath PAD2configpath; extern _PADtest PAD2test; extern _PADabout PAD2about; @@ -279,8 +309,11 @@ extern _SIOshutdown SIOshutdown[2][9]; extern _SIOstartPoll SIOstartPoll[2][9]; extern _SIOpoll SIOpoll[2][9]; extern _SIOquery SIOquery[2][9]; +extern _SIOkeyEvent SIOkeyEvent; +extern _SIOfreeze SIOfreeze[2][9]; extern _SIOconfigure SIOconfigure[2][9]; +extern _SIOconfigpath SIOconfigpath[2][9]; extern _SIOtest SIOtest[2][9]; extern _SIOabout SIOabout[2][9]; @@ -306,9 +339,11 @@ extern _SPU2irqCallback SPU2irqCallback; extern _SPU2setClockPtr SPU2setClockPtr; extern _SPU2setTimeStretcher SPU2setTimeStretcher; +extern _SPU2keyEvent SPU2keyEvent; extern _SPU2async SPU2async; extern _SPU2freeze SPU2freeze; extern _SPU2configure SPU2configure; +extern _SPU2configpath SPU2configpath; extern _SPU2test SPU2test; extern _SPU2about SPU2about; @@ -328,7 +363,10 @@ extern _CDVDgetTrayStatus CDVDgetTrayStatus; extern _CDVDctrlTrayOpen CDVDctrlTrayOpen; extern _CDVDctrlTrayClose CDVDctrlTrayClose; +extern _CDVDkeyEvent CDVDkeyEvent; +extern _CDVDfreeze CDVDfreeze; extern _CDVDconfigure CDVDconfigure; +extern _CDVDconfigpath CDVDconfigpath; extern _CDVDtest CDVDtest; extern _CDVDabout CDVDabout; extern _CDVDnewDiskCB CDVDnewDiskCB; @@ -349,7 +387,9 @@ extern _DEV9writeDMA8Mem DEV9writeDMA8Mem; extern _DEV9irqCallback DEV9irqCallback; extern _DEV9irqHandler DEV9irqHandler; +extern _DEV9keyEvent DEV9keyEvent; extern _DEV9configure DEV9configure; +extern _DEV9configpath DEV9configpath; extern _DEV9freeze DEV9freeze; extern _DEV9test DEV9test; extern _DEV9about DEV9about; @@ -371,7 +411,9 @@ extern _USBirqCallback USBirqCallback; extern _USBirqHandler USBirqHandler; extern _USBsetRAM USBsetRAM; +extern _USBkeyEvent USBkeyEvent; extern _USBconfigure USBconfigure; +extern _USBconfigpath USBconfigpath; extern _USBfreeze USBfreeze; extern _USBtest USBtest; extern _USBabout USBabout; @@ -385,10 +427,12 @@ extern _FWread32 FWread32; extern _FWwrite32 FWwrite32; extern _FWirqCallback FWirqCallback; +extern _FWkeyEvent FWkeyEvent; extern _FWconfigure FWconfigure; +extern _FWconfigpath FWconfigpath; extern _FWfreeze FWfreeze; extern _FWtest FWtest; extern _FWabout FWabout; } -#endif // __PLUGINCALLBACKS_H__ +#endif // __pDisplayS_H__ diff --git a/common/include/api/CDVDApi.h b/common/include/api/CDVDApi.h index 5a0310fe18..1be6538a9f 100644 --- a/common/include/api/CDVDApi.h +++ b/common/include/api/CDVDApi.h @@ -35,7 +35,7 @@ // Basic functions. -EXPORT_C_(s32) CDVDinit(char *configpath); +EXPORT_C_(s32) CDVDinit(); EXPORT_C_(s32) CDVDopen(void *pDisplay, const char* pTitleFilename); EXPORT_C_(void) CDVDclose(); EXPORT_C_(void) CDVDshutdown(); @@ -55,7 +55,10 @@ EXPORT_C_(s32) CDVDctrlTrayClose(); //close disc tray // Extended functions +EXPORT_C_(void) CDVDkeyEvent(keyEvent *ev); EXPORT_C_(void) CDVDconfigure(); +EXPORT_C_(s32) CDVDfreeze(u8 mode, freezeData *data); +EXPORT_C_(void) CDVDconfigpath(char *configpath); EXPORT_C_(void) CDVDabout(); EXPORT_C_(s32) CDVDtest(); EXPORT_C_(void) CDVDnewDiskCB(void (*callback)()); diff --git a/common/include/api/Dev9Api.h b/common/include/api/Dev9Api.h index 4523dbef90..8eaf36c297 100644 --- a/common/include/api/Dev9Api.h +++ b/common/include/api/Dev9Api.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __DEV9API_H__ #define __DEV9API_H__ @@ -28,7 +28,7 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" typedef void (*DEV9callback)(int cycles); @@ -37,7 +37,9 @@ typedef int (*DEV9handler)(void); // Basic functions. // NOTE: The read/write functions CANNOT use XMM/MMX regs // If you want to use them, need to save and restore current ones -EXPORT_C_(s32) DEV9init(char *configpath); +EXPORT_C_(s32) DEV9init(); + +// pDisplay normally is passed a handle to the GS plugins window. EXPORT_C_(s32) DEV9open(void *pDisplay); EXPORT_C_(void) DEV9close(); EXPORT_C_(void) DEV9shutdown(); @@ -57,8 +59,10 @@ EXPORT_C_(DEV9handler) DEV9irqHandler(void); // Extended functions -EXPORT_C_(s32) DEV9freeze(int mode, freezeData *data); +EXPORT_C_(void) DEV9keyEvent(keyEvent *ev); +EXPORT_C_(s32) DEV9freeze(u8 mode, freezeData *data); EXPORT_C_(void) DEV9configure(); +EXPORT_C_(void) DEV9configpath(char *configpath); EXPORT_C_(void) DEV9about(); EXPORT_C_(s32) DEV9test(); diff --git a/common/include/api/FWApi.h b/common/include/api/FWApi.h index df402bd2e9..cc35e99767 100644 --- a/common/include/api/FWApi.h +++ b/common/include/api/FWApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __FWAPI_H__ #define __FWAPI_H__ @@ -28,7 +28,7 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" /* FW plugin API */ @@ -37,20 +37,23 @@ // NOTE: The read/write functions CANNOT use XMM/MMX regs // If you want to use them, need to save and restore current ones -EXPORT_C_(s32) CALLBACK FWinit(char *configpath); -EXPORT_C_(s32) CALLBACK FWopen(void *pDisplay); -EXPORT_C_(void) CALLBACK FWclose(); -EXPORT_C_(void) CALLBACK FWshutdown(); -EXPORT_C_(u32) CALLBACK FWread32(u32 addr); -EXPORT_C_(void) CALLBACK FWwrite32(u32 addr, u32 value); -EXPORT_C_(void) CALLBACK FWirqCallback(void (*callback)()); +EXPORT_C_(s32) FWinit(); +// pDisplay normally is passed a handle to the GS plugins window. +EXPORT_C_(s32) FWopen(void *pDisplay); +EXPORT_C_(void) FWclose(); +EXPORT_C_(void) FWshutdown(); +EXPORT_C_(u32) FWread32(u32 addr); +EXPORT_C_(void) FWwrite32(u32 addr, u32 value); +EXPORT_C_(void) FWirqCallback(void (*callback)()); // Extended functions -EXPORT_C_(s32) CALLBACK FWfreeze(int mode, freezeData *data); -EXPORT_C_(void) CALLBACK FWconfigure(); -EXPORT_C_(void) CALLBACK FWabout(); -EXPORT_C_(s32) CALLBACK FWtest(); +EXPORT_C_(void) FWkeyEvent(keyEvent *ev); +EXPORT_C_(s32) FWfreeze(u8 mode, freezeData *data); +EXPORT_C_(void) FWconfigure(); +EXPORT_C_(void) SPU2configpath(char *configpath); +EXPORT_C_(void) FWabout(); +EXPORT_C_(s32) FWtest(); #endif #endif // __USBAPI_H__ \ No newline at end of file diff --git a/common/include/api/GSApi.h b/common/include/api/GSApi.h index db17cb7111..c87e79762b 100644 --- a/common/include/api/GSApi.h +++ b/common/include/api/GSApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __GSAPI_H__ #define __GSAPI_H__ @@ -28,7 +28,7 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" typedef struct _GSdriverInfo { @@ -37,7 +37,8 @@ typedef struct _GSdriverInfo { } GSdriverInfo; // Basic functions. -EXPORT_C_(s32) GSinit(char *configpath); +EXPORT_C_(s32) GSinit(); +// pDisplay normally is passed a handle to the GS plugins window. EXPORT_C_(s32) GSopen(void *pDisplay, char *Title, bool multithread); EXPORT_C_(void) GSclose(); EXPORT_C_(void) GSshutdown(); @@ -78,6 +79,7 @@ EXPORT_C_(s32) CALLBACK GSsetWindowInfo(winInfo *info); #endif EXPORT_C_(s32) GSfreeze(u8 mode, freezeData *data); EXPORT_C_(void) GSconfigure(); +EXPORT_C_(void) SGSconfigpath(char *configpath); EXPORT_C_(void) GSabout(); EXPORT_C_(s32) GStest(); diff --git a/common/include/api/PadApi.h b/common/include/api/PadApi.h index 5bee1f4eb1..0593f9f80c 100644 --- a/common/include/api/PadApi.h +++ b/common/include/api/PadApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __PADAPI_H__ #define __PADAPI_H__ @@ -28,25 +28,26 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" /* PAD plugin API */ /* So obsolete that everyone uses it. */ // Basic functions. -EXPORT_C_(s32) CALLBACK PADinitEx(char *configpath); -EXPORT_C_(s32) CALLBACK PADopen(void *pDsp); -EXPORT_C_(void) CALLBACK PADclose(); -EXPORT_C_(void) CALLBACK PADshutdown(); +EXPORT_C_(s32) PADinit(u32 flags); +// pDisplay normally is passed a handle to the GS plugins window. +EXPORT_C_(s32) PADopen(void *pDisplay); +EXPORT_C_(void) PADclose(); +EXPORT_C_(void) PADshutdown(); // PADkeyEvent is called every vsync (return NULL if no event) -EXPORT_C_(keyEvent*) CALLBACK PADkeyEvent(); -EXPORT_C_(u8) CALLBACK PADstartPoll(u8 pad); -EXPORT_C_(u8) CALLBACK PADpoll(u8 value); +EXPORT_C_(keyEvent*) PADkeyEvent(); +EXPORT_C_(u8) PADstartPoll(u8 pad); +EXPORT_C_(u8) PADpoll(u8 value); // returns: 1 if supported pad1 // 2 if supported pad2 // 3 if both are supported -EXPORT_C_(u8) CALLBACK PADquery(); +EXPORT_C_(u8) PADquery(); // call to give a hint to the PAD plugin to query for the keyboard state. A // good plugin will query the OS for keyboard state ONLY in this function. @@ -55,13 +56,14 @@ EXPORT_C_(u8) CALLBACK PADquery(); // the window (and input). Note that PADupdate can be called from a different // thread than the other functions, so mutex or other multithreading primitives // have to be added to maintain data integrity. -EXPORT_C_(void) CALLBACK PADupdate(u8 pad); +EXPORT_C_(void) PADupdate(u8 pad); // Extended functions -EXPORT_C_(s32) CALLBACK PADfreeze(int mode, freezeData *data); -EXPORT_C_(void) CALLBACK PADgsDriverInfo(GSdriverInfo *info); -EXPORT_C_(void) CALLBACK PADconfigure(); -EXPORT_C_(void) CALLBACK PADabout(); -EXPORT_C_(s32) CALLBACK PADtest(); +EXPORT_C_(void) PADgsDriverInfo(GSdriverInfo *info); +EXPORT_C_(s32) PADfreeze(u8 mode, freezeData *data); +EXPORT_C_(void) PADconfigure(); +EXPORT_C_(void) PADconfigpath(char *configpath); +EXPORT_C_(void) PADabout(); +EXPORT_C_(s32) PADtest(); #endif // __PADAPI_H__ \ No newline at end of file diff --git a/common/include/api/SIOApi.h b/common/include/api/SIOApi.h index 91ffeb00f3..8d4fe518c1 100644 --- a/common/include/api/SIOApi.h +++ b/common/include/api/SIOApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __SIOAPI_H__ #define __SIOAPI_H__ @@ -28,36 +28,45 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" /* SIO plugin API */ -// basic funcs +// Basic functions. +EXPORT_C_(s32) SIOinit(); // Single plugin can only be PAD, MTAP, RM, or MC. Only load one plugin of each type, // but not both a PAD and MTAP. Simplifies plugin selection and interface, as well // as API. -s32 CALLBACK SIOinit(char *configpath); -s32 CALLBACK SIOopen(void *pDisplay); -void CALLBACK SIOclose(); -void CALLBACK SIOshutdown(); +// pDisplay normally is passed a handle to the GS plugins window. +EXPORT_C_(s32) SIOopen(void *pDisplay); +EXPORT_C_(void) SIOclose(); +EXPORT_C_(void) SIOshutdown(); // Returns 0 if device doesn't exist. Simplifies things. Also means you don't // have to distinguish between MTAP and PAD SIO plugins. -s32 CALLBACK SIOstartPoll(u8 deviceType, u32 port, u32 slot, u8 *returnValue); +EXPORT_C_(s32) SIOstartPoll(u8 deviceType, u32 port, u32 slot, u8 *returnValue); // Returns 0 on the last output byte. -s32 CALLBACK SIOpoll(u8 value, u8 *returnValue); - -EXPORT_C_(keyEvent*) CALLBACK SIOkeyEvent(); +EXPORT_C_(s32) SIOpoll(u8 value, u8 *returnValue); // returns: SIO_TYPE_{PAD,MTAP,RM,MC} -u32 CALLBACK SIOquery(); +EXPORT_C_(u32) SIOquery(); // extended funcs -void CALLBACK SIOconfigure(); -void CALLBACK SIOabout(); -s32 CALLBACK SIOtest(); +EXPORT_C_(void) SIOconfigure(); +EXPORT_C_(keyEvent*) CALLBACK SIOkeyEvent(); +EXPORT_C_(s32) SIOfreeze(u8 mode, freezeData *data); +EXPORT_C_(void) SIOconfigpath(char *configpath); +EXPORT_C_(void) SIOabout(); +EXPORT_C_(s32) SIOtest(); + +enum { +SIO_TYPE_PAD = 0x00000001, +SIO_TYPE_MTAP = 0x00000004, +SIO_TYPE_RM = 0x00000040, +SIO_TYPE_MC = 0x00000100 +} SioTypes; #endif diff --git a/common/include/api/Spu2Api.h b/common/include/api/Spu2Api.h index e9abfced2e..7309398a00 100644 --- a/common/include/api/Spu2Api.h +++ b/common/include/api/Spu2Api.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __SPU2API_H__ #define __SPU2API_H__ @@ -28,15 +28,26 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" -EXPORT_C_(s32) SPU2init(char *configpath); +EXPORT_C_(s32) SPU2init(); +// pDisplay normally is passed a handle to the GS plugins window. EXPORT_C_(s32) SPU2open(void *pDisplay); EXPORT_C_(void) SPU2close(); EXPORT_C_(void) SPU2shutdown(); EXPORT_C_(void) SPU2write(u32 mem, u16 value); EXPORT_C_(u16) SPU2read(u32 mem); + +// The following calls are depreciated. +EXPORT_C_(void) SPU2readDMA4Mem(u16 *pMem, u32 size); +EXPORT_C_(void) SPU2readDMA7Mem(u16 *pMem, u32 size); +EXPORT_C_(void) SPU2writeDMA4Mem(u16 *pMem, u32 size); +EXPORT_C_(void) SPU2writeDMA7Mem(u16 *pMem, u32 size); +EXPORT_C_(void) SPU2interruptDMA4(); +EXPORT_C_(void) SPU2interruptDMA7(); + +// These calls replace the calls above. EXPORT_C_(void) SPU2readDMAMem(u16 *pMem, u32 size, u8 core); EXPORT_C_(void) SPU2writeDMAMem(u16 *pMem, u32 size, u8 core); EXPORT_C_(void) SPU2interruptDMA(u8 core); @@ -50,15 +61,17 @@ EXPORT_C_(void) SPU2WriteMemAddr(u8 core,u32 value); EXPORT_C_(void) SPU2irqCallback(void (*SPU2callback)(),void (*DMA4callback)(),void (*DMA7callback)()); // extended funcs + // if start is true, starts recording spu2 data, else stops // returns true if successful EXPORT_C_(bool) SPU2setupRecording(bool start); +EXPORT_C_(void) SPU2keyEvent(keyEvent *ev); EXPORT_C_(void) SPU2setClockPtr(u32* ptr); - EXPORT_C_(void) SPU2async(u32 cycles); EXPORT_C_(s32) SPU2freeze(u8 mode, freezeData *data); EXPORT_C_(void) SPU2configure(); +EXPORT_C_(void) SPU2configpath(char *configpath); EXPORT_C_(void) SPU2about(); EXPORT_C_(s32) SPU2test(); diff --git a/common/include/api/USBApi.h b/common/include/api/USBApi.h index 99697ab882..8ef202e1b0 100644 --- a/common/include/api/USBApi.h +++ b/common/include/api/USBApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __USBAPI_H__ #define __USBAPI_H__ @@ -28,36 +28,39 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" typedef void (*USBcallback)(int cycles); typedef int (*USBhandler)(void); // Basic functions. -EXPORT_C_(s32) CALLBACK USBinit(char *configpath); -EXPORT_C_(s32) CALLBACK USBopen(void *pDisplay); -EXPORT_C_(void) CALLBACK USBclose(); -EXPORT_C_(void) CALLBACK USBshutdown(); -EXPORT_C_(u8) CALLBACK USBread8(u32 addr); -EXPORT_C_(u16) CALLBACK USBread16(u32 addr); -EXPORT_C_(u32) CALLBACK USBread32(u32 addr); -EXPORT_C_(void) CALLBACK USBwrite8(u32 addr, u8 value); -EXPORT_C_(void) CALLBACK USBwrite16(u32 addr, u16 value); -EXPORT_C_(void) CALLBACK USBwrite32(u32 addr, u32 value); -EXPORT_C_(void) CALLBACK USBasync(u32 cycles); +EXPORT_C_(s32) USBinit(); +// pDisplay normally is passed a handle to the GS plugins window. +EXPORT_C_(s32) USBopen(void *pDisplay); +EXPORT_C_(void) USBclose(); +EXPORT_C_(void) USBshutdown(); +EXPORT_C_(u8) USBread8(u32 addr); +EXPORT_C_(u16) USBread16(u32 addr); +EXPORT_C_(u32) USBread32(u32 addr); +EXPORT_C_(void) USBwrite8(u32 addr, u8 value); +EXPORT_C_(void) USBwrite16(u32 addr, u16 value); +EXPORT_C_(void) USBwrite32(u32 addr, u32 value); +EXPORT_C_(void) USBasync(u32 cycles); // cycles = IOP cycles before calling callback, // if callback returns 1 the irq is triggered, else not -EXPORT_C_(void) CALLBACK USBirqCallback(USBcallback callback); -EXPORT_C_(USBhandler) CALLBACK USBirqHandler(void); -EXPORT_C_(void) CALLBACK USBsetRAM(void *mem); +EXPORT_C_(void) USBirqCallback(USBcallback callback); +EXPORT_C_(USBhandler) USBirqHandler(void); +EXPORT_C_(void) USBsetRAM(void *mem); // Extended functions -EXPORT_C_(s32) CALLBACK USBfreeze(int mode, freezeData *data); -EXPORT_C_(void) CALLBACK USBconfigure(); -EXPORT_C_(void) CALLBACK USBabout(); -EXPORT_C_(s32) CALLBACK USBtest(); +EXPORT_C_(void) USBkeyEvent(keyEvent *ev); +EXPORT_C_(s32) USBfreeze(u8 mode, freezeData *data); +EXPORT_C_(void) USBconfigure(); +EXPORT_C_(void) USBconfigpath(char *configpath); +EXPORT_C_(void) USBabout(); +EXPORT_C_(s32) USBtest(); #endif // __USBAPI_H__ \ No newline at end of file From d793d84860eb180f1f4ed34f047f0eedde930235 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 14 Mar 2009 02:43:40 +0000 Subject: [PATCH 40/77] The joys of unrestrained find/replace. :( git-svn-id: http://pcsx2.googlecode.com/svn/trunk@781 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/PluginCallbacks.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/include/PluginCallbacks.h b/common/include/PluginCallbacks.h index 79a18d87e9..3f344f8558 100644 --- a/common/include/PluginCallbacks.h +++ b/common/include/PluginCallbacks.h @@ -17,8 +17,8 @@ */ -#ifndef __pDisplayS_H__ -#define __pDisplayS_H__ +#ifndef __PLUGINCALLBACKS_H__ +#define __PLUGINCALLBACKS_H__ extern "C" { typedef u32 (CALLBACK* _PS2EgetLibType)(void); @@ -435,4 +435,4 @@ extern _FWtest FWtest; extern _FWabout FWabout; } -#endif // __pDisplayS_H__ +#endif // __PLUGINCALLBACKS_H__ From c483f17331d5b63e44f4512887a517dab87eb630 Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Sat, 14 Mar 2009 16:30:35 +0000 Subject: [PATCH 41/77] Rewrite immediate jumps from the block manager instead of having dispatchers to do this at execution time. Should be a tad faster. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@782 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/NakedAsm.h | 4 - pcsx2/x86/BaseblockEx.cpp | 24 +++- pcsx2/x86/BaseblockEx.h | 29 ++++- pcsx2/x86/aR3000A.S | 86 --------------- pcsx2/x86/iR3000A.cpp | 167 ++++------------------------ pcsx2/x86/ix86-32/aR5900-32.S | 86 --------------- pcsx2/x86/ix86-32/iR5900-32.cpp | 187 ++++++-------------------------- 7 files changed, 102 insertions(+), 481 deletions(-) diff --git a/pcsx2/NakedAsm.h b/pcsx2/NakedAsm.h index c744b2ece5..359f95183f 100644 --- a/pcsx2/NakedAsm.h +++ b/pcsx2/NakedAsm.h @@ -54,15 +54,11 @@ void svudispfn(); // aR3000A.S void iopJITCompile(); void iopJITCompileInBlock(); -void iopDispatcher(); -void iopDispatcherClear(); void iopDispatcherReg(); // aR5900-32.S void JITCompile(); void JITCompileInBlock(); -void Dispatcher(); -void DispatcherClear(); void DispatcherReg(); } diff --git a/pcsx2/x86/BaseblockEx.cpp b/pcsx2/x86/BaseblockEx.cpp index bdc5f4aab1..22a6765e60 100644 --- a/pcsx2/x86/BaseblockEx.cpp +++ b/pcsx2/x86/BaseblockEx.cpp @@ -19,7 +19,7 @@ #include "PrecompiledHeader.h" #include "BaseblockEx.h" -BASEBLOCKEX* BaseBlocks::New(u32 startpc) +BASEBLOCKEX* BaseBlocks::New(u32 startpc, uptr fnptr) { if (blocks.size() == size) return 0; @@ -28,6 +28,7 @@ BASEBLOCKEX* BaseBlocks::New(u32 startpc) std::vector::iterator iter; memset(&newblock, 0, sizeof newblock); newblock.startpc = startpc; + newblock.fnptr = fnptr; int imin = 0, imax = blocks.size(), imid; @@ -42,6 +43,11 @@ BASEBLOCKEX* BaseBlocks::New(u32 startpc) assert(imin == blocks.size() || blocks[imin].startpc > startpc); iter = blocks.insert(blocks.begin() + imin, newblock); + + std::pair range = links.equal_range(startpc); + for (linkiter_t i = range.first; i != range.second; ++i) + *(u32*)i->second = fnptr - (i->second + 4); + return &*iter; } @@ -63,3 +69,19 @@ int BaseBlocks::LastIndex(u32 startpc) const return imin; } + +BASEBLOCKEX* BaseBlocks::GetByX86(uptr ip) const +{ + // TODO + return 0; +} + +void BaseBlocks::Link(u32 pc, uptr jumpptr) +{ + BASEBLOCKEX *targetblock = Get(pc); + if (targetblock && targetblock->startpc == pc) + *(u32*)jumpptr = targetblock->fnptr - (jumpptr + 4); + else + *(u32*)jumpptr = recompiler - (jumpptr + 4); + links.insert(std::pair(pc, jumpptr)); +} \ No newline at end of file diff --git a/pcsx2/x86/BaseblockEx.h b/pcsx2/x86/BaseblockEx.h index a66371d480..6d32ed0f05 100644 --- a/pcsx2/x86/BaseblockEx.h +++ b/pcsx2/x86/BaseblockEx.h @@ -20,6 +20,8 @@ #include "PrecompiledHeader.h" #include +#include +#include // used to keep block information #define BLOCKTYPE_DELAYSLOT 1 // if bit set, delay slot @@ -38,9 +40,10 @@ struct BASEBLOCK // extra block info (only valid for start of fn) struct BASEBLOCKEX { - u16 size; // size in dwords - u16 dummy; u32 startpc; + uptr fnptr; + u16 size; // size in dwords + u16 x86size; #ifdef PCSX2_DEVBUILD u32 visited; // number of times called @@ -53,24 +56,30 @@ class BaseBlocks { private: std::vector blocks; + // switch to a hash map later? + std::multimap links; + typedef std::multimap::iterator linkiter_t; unsigned long size; + uptr recompiler; public: - BaseBlocks(unsigned long max) : - size(max), + BaseBlocks(unsigned long size_, uptr recompiler_) : + size(size_), + recompiler(recompiler_), blocks(0) { blocks.reserve(size); } - BASEBLOCKEX* New(u32 startpc); + BASEBLOCKEX* New(u32 startpc, uptr fnptr); int LastIndex (u32 startpc) const; + BASEBLOCKEX* GetByX86(uptr ip) const; inline int Index (u32 startpc) const { int idx = LastIndex(startpc); if (idx == -1 || startpc < blocks[idx].startpc || - startpc >= blocks[idx].startpc + blocks[idx].size * 4) + blocks[idx].size && (startpc >= blocks[idx].startpc + blocks[idx].size * 4)) return -1; else return idx; @@ -90,12 +99,20 @@ public: inline void Remove(int idx) { + u32 startpc = blocks[idx].startpc; + std::pair range = links.equal_range(blocks[idx].startpc); + for (linkiter_t i = range.first; i != range.second; ++i) + *(u32*)i->second = recompiler - (i->second + 4); + // TODO: remove links from this block? blocks.erase(blocks.begin() + idx); } + void Link(u32 pc, uptr jumpptr); + inline void Reset() { blocks.clear(); + links.clear(); } }; diff --git a/pcsx2/x86/aR3000A.S b/pcsx2/x86/aR3000A.S index 9af67a3c52..90b755025e 100644 --- a/pcsx2/x86/aR3000A.S +++ b/pcsx2/x86/aR3000A.S @@ -18,11 +18,6 @@ .extern RECLUT .extern iopRecRecompile -#define BLOCKTYPE_STARTPC 4 // startpc offset -#define BLOCKTYPE_DELAYSLOT 1 // if bit set, delay slot - -#define BASEBLOCK_SIZE 2 // in dwords - ////////////////////////////////////////////////////////////////////////// // The address for all cleared blocks. It recompiles the current pc and then // dispatches to the recompiled block address. @@ -42,87 +37,6 @@ iopJITCompile: iopJITCompileInBlock: jmp iopJITCompile - -////////////////////////////////////////////////////////////////////////// -// Recompiles the next block, and links the old block directly to it. -// This is a on-shot execution for any block which uses it. Once the block -// has been statically linked to the new block, this function will be bypassed -// -// edx - jump address to modify -.globl iopDispatcher -iopDispatcher: - - # calc PC_GETBLOCK - # ((BASEBLOCK*)(reclut[((u32)(x)) >> 16] + (x)*(sizeof(BASEBLOCK)/4))) - - mov eax, dword ptr [REGINFO + PCOFFSET] - mov ebx, eax - shr eax, 16 - mov ecx, dword ptr [RECLUT+eax*4] - mov eax, dword ptr [ecx+ebx] - - cmp eax, offset iopJITCompile - je Dispatch_notcompiled - cmp eax, offset iopJITCompileInBlock - je Dispatch_notcompiled - lea ebx, [eax-4] - sub ebx, edx - mov dword ptr [edx], ebx - jmp eax - - .align 16 -Dispatch_notcompiled: - mov esi, edx - lea edi, [ecx+ebx] - push ebx - call iopRecRecompile - add esp, 4 - - mov eax, dword ptr [edi] - lea ebx, [eax-4] - sub ebx, esi - mov dword ptr [esi], ebx - jmp eax - - -////////////////////////////////////////////////////////////////////////// -// edx - baseblock->startpc -// stack - x86Ptr -.globl iopDispatcherClear -iopDispatcherClear: - mov [REGINFO + PCOFFSET], edx - - # calc PC_GETBLOCK - # ((BASEBLOCK*)(reclut[((u32)(x)) >> 16] + (x)*(sizeof(BASEBLOCK)/4))) - - mov ebx, edx - shr edx, 16 - mov ecx, dword ptr [RECLUT+edx*4] - mov eax, dword ptr [ecx+ebx] - - cmp eax, offset iopJITCompile - je Clear_notcompiled - cmp eax, offset iopJITCompileInBlock - je Clear_notcompiled - add esp, 4 - jmp eax - - .align 16 -Clear_notcompiled: - lea edi, [ecx+ebx] - push ebx - call iopRecRecompile - add esp, 4 - mov eax, dword ptr [edi] - - pop ecx - mov byte ptr [ecx], 0xe9 // jmp32 - lea ebx, [eax-5] - sub ebx, ecx - mov dword ptr [ecx+1], ebx - - jmp eax - ////////////////////////////////////////////////////////////////////////// // called when jumping to variable pc address. diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 0b67e095d9..9b166c1954 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -60,7 +60,8 @@ static u8 *recMem = NULL; // the recompiled blocks will be here static BASEBLOCK *recRAM = NULL; // and the ptr to the blocks here static BASEBLOCK *recROM = NULL; // and here static BASEBLOCK *recROM1 = NULL; // also here -static BaseBlocks recBlocks(PSX_NUMBLOCKS); +void iopJITCompile(); +static BaseBlocks recBlocks(PSX_NUMBLOCKS, (uptr)iopJITCompile); static u8 *recPtr = NULL; u32 psxpc; // recompiler psxpc int psxbranch; // set for branch @@ -621,77 +622,6 @@ static __declspec(naked) void iopJITCompileInBlock() } } -// jumped to when an immediate branch (EE side) hasn't been statically linked yet. -// Block is compiled if needed, and the link is made. -// EDX contains the jump addr to modify -static __declspec(naked) void iopDispatcher() -{ - __asm { - mov eax, dword ptr [psxRegs.pc] - mov ebx, eax - shr eax, 16 - mov ecx, dword ptr [psxRecLUT+eax*4] - mov eax, dword ptr [ecx+ebx] - cmp eax, offset iopJITCompile - je notcompiled - cmp eax, offset iopJITCompileInBlock - je notcompiled - lea ebx, [eax-4] - sub ebx, edx - mov dword ptr [edx], ebx - jmp eax - - align 16 -notcompiled: - mov esi, edx - lea edi, [ecx+ebx] - push ebx - call iopRecRecompile - add esp, 4 - - mov eax, dword ptr [edi] - lea ebx, [eax-4] - sub ebx, esi - mov dword ptr [esi], ebx - jmp eax - } -} - -// edx - baseblock start pc -// stack - x86Ptr[0] -static __declspec(naked) void iopDispatcherClear() -{ - __asm { - mov [psxRegs.pc], edx - mov ebx, edx - shr edx, 16 - mov ecx, dword ptr [psxRecLUT+edx*4] - mov eax, dword ptr [ecx+ebx] - cmp eax, offset iopJITCompile - je notcompiled - cmp eax, offset iopJITCompileInBlock - je notcompiled - add esp, 4 - jmp eax - - align 16 -notcompiled: - lea edi, [ecx+ebx] - push ebx - call iopRecRecompile - add esp, 4 - mov eax, dword ptr [edi] - - pop ecx - mov byte ptr [ecx], 0xe9 // jmp32 - lea ebx, [eax-5] - sub ebx, ecx - mov dword ptr [ecx+1], ebx - - jmp eax - } -} - // called when jumping to variable psxpc address static __declspec(naked) void iopDispatcherReg() { @@ -793,28 +723,6 @@ static __forceinline u32 psxRecClearMem(u32 pc) if (pexblock->startpc >= upperextent) break; - pblock = PSX_GETBLOCK(pexblock->startpc); - x86Ptr[_EmitterId_] = (u8*)pblock->GetFnptr(); - - jASSUME((u8*)iopJITCompile != x86Ptr[_EmitterId_]); - // jASSUME((u8*)iopJITCompileInside != x86Ptr[_EmitterId_]); - - // This is breaking things currently, rather than figure it out - // I'm just using DispatcherReg, it's fast enough now. - // Actually, if we want to do this at all maybe keeping a hash - // table of const jumps and modifying the jumps straight from - // here is the way to go. -#if 1 - // there is a small problem: mem can be ored with 0xa<<28 or 0x8<<28, and don't know which - MOV32ItoR(EDX, pexblock->startpc); - assert((uptr)x86Ptr[_EmitterId_] <= 0xffffffff); - PUSH32I((uptr)x86Ptr[_EmitterId_]); // will be replaced by JMP32 - JMP32((uptr)iopDispatcherClear - ((uptr)x86Ptr[_EmitterId_] + 5)); -#else - MOV32ItoM((uptr)&psxRegs.pc, pexblock->startpc); - JMP32((uptr)iopDispatcherReg - ((uptr)x86Ptr[_EmitterId_] + 5)); -#endif - lowerextent = min(lowerextent, pexblock->startpc); upperextent = max(upperextent, pexblock->startpc + pexblock->size * 4); recBlocks.Remove(blockidx); @@ -878,9 +786,8 @@ void psxSetBranchImm( u32 imm ) _psxFlushCall(FLUSH_EVERYTHING); iPsxBranchTest(imm, imm <= psxpc); - MOV32ItoR(EDX, 0); - ptr = (u32*)(x86Ptr[0]-4); - *ptr = (uptr)JMP32((uptr)iopDispatcher - ( (uptr)x86Ptr[0] + 5 )); + ptr = JMP32(0); + recBlocks.Link(imm, (uptr)ptr); } //fixme : this is all a huge hack, we base the counter advancements on the average an opcode should take (wtf?) @@ -989,24 +896,6 @@ void psxRecompileNextInstruction(int delayslot) BASEBLOCK* pblock = PSX_GETBLOCK(psxpc); - // need *ppblock != s_pCurBlock because of branches - if (HWADDR(psxpc) != s_pCurBlockEx->startpc - && pblock->GetFnptr() != (uptr)iopJITCompile - && pblock->GetFnptr() != (uptr)iopJITCompileInBlock ) - { - if(!delayslot) - { - // code already in place, so jump to it and exit recomp - assert( recBlocks.Get(HWADDR(psxpc))->startpc == HWADDR(psxpc) ); - - _psxFlushCall(FLUSH_EVERYTHING); - MOV32ItoM((uptr)&psxRegs.pc, psxpc); - JMP32((uptr)pblock->GetFnptr() - ((uptr)x86Ptr[0] + 5)); - psxbranch = 3; - return; - } - } - #ifdef _DEBUG MOV32ItoR(EAX, psxpc); #endif @@ -1101,7 +990,6 @@ void iopRecRecompile(u32 startpc) u32 i; u32 branchTo; u32 willbranch3 = 0; - u32* ptr; #ifdef _DEBUG if( psxdump & 4 ) @@ -1114,6 +1002,10 @@ void iopRecRecompile(u32 startpc) if (((uptr)recPtr - (uptr)recMem) >= (RECMEM_SIZE - 0x10000)) recResetIOP(); + x86SetPtr( recPtr ); + x86Align(16); + recPtr = x86Ptr[_EmitterId_]; + s_pCurBlock = PSX_GETBLOCK(startpc); assert(s_pCurBlock->GetFnptr() == (uptr)iopJITCompile @@ -1121,19 +1013,16 @@ void iopRecRecompile(u32 startpc) s_pCurBlockEx = recBlocks.Get(HWADDR(startpc)); if(!s_pCurBlockEx || s_pCurBlockEx->startpc != HWADDR(startpc)) { - s_pCurBlockEx = recBlocks.New(HWADDR(startpc)); + s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr); if( s_pCurBlockEx == NULL ) { DevCon::WriteLn("IOP Recompiler data reset"); recResetIOP(); - s_pCurBlockEx = recBlocks.New(HWADDR(startpc)); + x86SetPtr( recPtr ); + s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr); } } - x86SetPtr( recPtr ); - x86Align(16); - recPtr = x86Ptr[0]; - psxbranch = 0; s_pCurBlock->SetFnptr( (uptr)x86Ptr[0] ); @@ -1274,7 +1163,6 @@ StartRecomp: JMP32((uptr)iopDispatcherReg - ( (uptr)x86Ptr[0] + 5 )); } else { - assert( psxbranch != 3 ); if( psxbranch ) assert( !willbranch3 ); else { @@ -1282,42 +1170,27 @@ StartRecomp: SUB32ItoM((uptr)&psxCycleEE, psxScaleBlockCycles()*8 ); } - if( willbranch3 ) { - BASEBLOCK* pblock = PSX_GETBLOCK(s_nEndBlock); + if (willbranch3 || !psxbranch) { assert( psxpc == s_nEndBlock ); _psxFlushCall(FLUSH_EVERYTHING); - MOV32ItoM((uptr)&psxRegs.pc, psxpc); - JMP32((uptr)pblock->GetFnptr() - ((uptr)x86Ptr[0] + 5)); + MOV32ItoM((uptr)&psxRegs.pc, psxpc); + u32 *ptr = JMP32(0); + recBlocks.Link(s_nEndBlock, (uptr)ptr); psxbranch = 3; } - else if( !psxbranch ) { - // didn't branch, but had to stop - MOV32ItoM( (uptr)&psxRegs.pc, psxpc ); - - _psxFlushCall(FLUSH_EVERYTHING); - - ptr = JMP32(0); - //JMP32((uptr)psxDispatcherReg - ( (uptr)x86Ptr[0] + 5 )); - } } assert( x86Ptr[0] < recMem+RECMEM_SIZE ); + assert(x86Ptr[_EmitterId_] - recPtr < 0x10000); + s_pCurBlockEx->x86size = x86Ptr[_EmitterId_] - recPtr; + recPtr = x86Ptr[0]; assert( (g_psxHasConstReg&g_psxFlushedConstReg) == g_psxHasConstReg ); - if( !psxbranch ) { - assert( ptr != NULL ); - s_pCurBlock = PSX_GETBLOCK(psxpc); - - if (s_pCurBlock->GetFnptr() == (uptr)iopJITCompile - || s_pCurBlock->GetFnptr() == (uptr)iopJITCompileInBlock){ - iopRecRecompile(psxpc); - } - - *ptr = s_pCurBlock->GetFnptr() - ((u32)ptr + 4); - } + s_pCurBlock = NULL; + s_pCurBlockEx = NULL; } R3000Acpu psxRec = { diff --git a/pcsx2/x86/ix86-32/aR5900-32.S b/pcsx2/x86/ix86-32/aR5900-32.S index 92fad3a2c2..457ad43fb2 100644 --- a/pcsx2/x86/ix86-32/aR5900-32.S +++ b/pcsx2/x86/ix86-32/aR5900-32.S @@ -18,11 +18,6 @@ .extern RECLUT .extern recRecompile -#define BLOCKTYPE_STARTPC 4 // startpc offset -#define BLOCKTYPE_DELAYSLOT 1 // if bit set, delay slot - -#define BASEBLOCK_SIZE 2 // in dwords - ////////////////////////////////////////////////////////////////////////// // The address for all cleared blocks. It recompiles the current pc and then // dispatches to the recompiled block address. @@ -41,87 +36,6 @@ JITCompile: .global JITCompileInBlock JITCompileInBlock: jmp JITCompile - -////////////////////////////////////////////////////////////////////////// -// Recompiles the next block, and links the old block directly to it. -// This is a on-shot execution for any block which uses it. Once the block -// has been statically linked to the new block, this function will be bypassed -// -// edx - jump address to modify -.globl Dispatcher -Dispatcher: - - # calc PC_GETBLOCK - # ((BASEBLOCK*)(reclut[((u32)(x)) >> 16] + (x)*(sizeof(BASEBLOCK)/4))) - - mov eax, dword ptr [REGINFO + PCOFFSET] - mov ebx, eax - shr eax, 16 - mov ecx, dword ptr [RECLUT+eax*4] - mov eax, dword ptr [ecx+ebx] - - cmp eax, offset JITCompile - je Dispatch_notcompiled - cmp eax, offset JITCompileInBlock - je Dispatch_notcompiled - lea ebx, [eax-4] - sub ebx, edx - mov dword ptr [edx], ebx - jmp eax - - .align 16 -Dispatch_notcompiled: - mov esi, edx - lea edi, [ecx+ebx] - push ebx - call recRecompile - add esp, 4 - - mov eax, dword ptr [edi] - lea ebx, [eax-4] - sub ebx, esi - mov dword ptr [esi], ebx - jmp eax - - -////////////////////////////////////////////////////////////////////////// -// edx - baseblock->startpc -// stack - x86Ptr -.globl DispatcherClear -DispatcherClear: - mov [REGINFO + PCOFFSET], edx - - # calc PC_GETBLOCK - # ((BASEBLOCK*)(reclut[((u32)(x)) >> 16] + (x)*(sizeof(BASEBLOCK)/4))) - - mov ebx, edx - shr edx, 16 - mov ecx, dword ptr [RECLUT+edx*4] - mov eax, dword ptr [ecx+ebx] - - cmp eax, offset JITCompile - je Clear_notcompiled - cmp eax, offset JITCompileInBlock - je Clear_notcompiled - add esp, 4 - jmp eax - - .align 16 -Clear_notcompiled: - lea edi, [ecx+ebx] - push ebx - call recRecompile - add esp, 4 - mov eax, dword ptr [edi] - - pop ecx - mov byte ptr [ecx], 0xe9 // jmp32 - lea ebx, [eax-5] - sub ebx, ecx - mov dword ptr [ecx+1], ebx - - jmp eax - ////////////////////////////////////////////////////////////////////////// // called when jumping to variable pc address. diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 75967a70aa..0fa6402b8b 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -79,7 +79,8 @@ static BASEBLOCK *recRAM = NULL; // and the ptr to the blocks here static BASEBLOCK *recROM = NULL; // and here static BASEBLOCK *recROM1 = NULL; // also here static u32 *recRAMCopy = NULL; -static BaseBlocks recBlocks(EE_NUMBLOCKS); +void JITCompile(); +static BaseBlocks recBlocks(EE_NUMBLOCKS, (uptr)JITCompile); static u8* recPtr = NULL, *recStackPtr = NULL; static EEINST* s_pInstCache = NULL; static u32 s_nInstCacheSize = 0; @@ -111,7 +112,7 @@ static u32 dumplog = 0; //static const char *txt2 = "M32 = %x\n"; #endif -static void iBranchTest(u32 newpc, bool noDispatch=false); +static void iBranchTest(u32 newpc = 0xffffffff, bool noDispatch=false); static void ClearRecLUT(BASEBLOCK* base, int count); //////////////////////////////////////////////////// @@ -446,7 +447,6 @@ u32* recAllocStackMem(int size, int align) return (u32*)(recStackPtr-size); } - static const int REC_CACHEMEM = 0x01000000; static void __fastcall dyna_block_discard(u32 start,u32 sz); @@ -600,6 +600,7 @@ static void recShutdown( void ) safe_aligned_free( m_recBlockAlloc ); recRAM = recROM = recROM1 = NULL; recStack = NULL; + recRAMCopy = NULL; safe_free( s_pInstCache ); s_nInstCacheSize = 0; @@ -662,79 +663,6 @@ static __declspec(naked) void JITCompileInBlock() } } -// jumped to when an immediate branch (EE side) hasn't been statically linked yet. -// Block is compiled if needed, and the link is made. -// EDX contains the jump addr to modify -static __naked void Dispatcher() -{ - __asm { - mov eax, dword ptr [cpuRegs.pc] - mov ebx, eax - shr eax, 16 - mov ecx, dword ptr [recLUT+eax*4] - mov eax, dword ptr [ecx+ebx] - - cmp eax, offset JITCompile - je notcompiled - cmp eax, offset JITCompileInBlock - je notcompiled - lea ebx, [eax-4] - sub ebx, edx - mov dword ptr [edx], ebx - jmp eax - - align 16 -notcompiled: - mov esi, edx - lea edi, [ecx+ebx] - push ebx - call recRecompile - add esp, 4 - - mov eax, dword ptr [edi] - lea ebx, [eax-4] - sub ebx, esi - mov dword ptr [esi], ebx - jmp eax - } -} - -// edx - block start pc -// stack - x86Ptr[0] -static __naked void DispatcherClear() -{ - __asm { - mov [cpuRegs.pc], edx - mov ebx, edx - shr edx, 16 - mov ecx, dword ptr [recLUT+edx*4] - mov eax, dword ptr [ecx+ebx] - - cmp eax, offset JITCompile - je notcompiled - cmp eax, offset JITCompileInBlock - je notcompiled - add esp, 4 - jmp eax - - align 16 -notcompiled: - lea edi, [ecx+ebx] - push ebx - call recRecompile - add esp, 4 - mov eax, dword ptr [edi] - - pop ecx - mov byte ptr [ecx], 0xe9 // jmp32 - lea ebx, [eax-5] - sub ebx, ecx - mov dword ptr [ecx+1], ebx - - jmp eax - } -} - // called when jumping to variable pc address static void __naked DispatcherReg() { @@ -943,21 +871,6 @@ void recClear(u32 addr, u32 size) break; } - x86Ptr[_EmitterId_] = (u8*)pblock->GetFnptr(); - - jASSUME((u8*)JITCompile != x86Ptr[_EmitterId_]); - jASSUME((u8*)JITCompileInBlock != x86Ptr[_EmitterId_]); - - // Actually, if we want to do this at all maybe keeping a hash - // table of const jumps and modifying the jumps straight from - // here is the way to go. - - // there is a small problem: mem can be ored with 0xa<<28 or 0x8<<28, and don't know which - MOV32ItoR(EDX, blockstart); - assert((uptr)x86Ptr[_EmitterId_] <= 0xffffffff); - PUSH32I((uptr)x86Ptr[_EmitterId_]); // will be replaced by JMP32 - JMP32((uptr)DispatcherClear - ((uptr)x86Ptr[_EmitterId_] + 5)); - lowerextent = min(lowerextent, blockstart); upperextent = max(upperextent, blockend); // This might end up inside a block that doesn't contain the clearing range, @@ -1055,7 +968,7 @@ void SetBranchReg( u32 reg ) iFlushCall(FLUSH_EVERYTHING); - iBranchTest(0xffffffff); + iBranchTest(); } void SetBranchImm( u32 imm ) @@ -1065,9 +978,7 @@ void SetBranchImm( u32 imm ) assert( imm ); // end the current block - MOV32ItoM( (uptr)&cpuRegs.pc, imm ); iFlushCall(FLUSH_EVERYTHING); - iBranchTest(imm); } @@ -1197,6 +1108,19 @@ u32 eeScaleBlockCycles() return temp >> (3+2); } +static void iBranch(u32 newpc, int type) +{ + u32* ptr; + + MOV32ItoM((uptr)&cpuRegs.pc, newpc); + if (type == 0) + ptr = JMP32(0); + else if (type == 1) + ptr = JS32(0); + + recBlocks.Link(HWADDR(newpc), (uptr)ptr); +} + // Generates dynarec code for Event tests followed by a block dispatch (branch). // Parameters: // newpc - address to jump to at the end of the block. If newpc == 0xffffffff then @@ -1212,41 +1136,23 @@ static void iBranchTest(u32 newpc, bool noDispatch) #ifdef _DEBUG //CALLFunc((uptr)testfpu); #endif - u32* ptr; if( bExecBIOS ) CheckForBIOSEnd(); - MOV32MtoR(EAX, (uptr)&cpuRegs.cycle); - if( !noDispatch && newpc != 0xffffffff ) - { - // Optimization note: Instructions order to pair EDX with EAX's load above. - - // Load EDX with the address of the JS32 jump below. - // We do this because the the Dispatcher will use this info to modify - // the JS instruction later on with the address of the block it's jumping - // to; creating a static link of blocks that doesn't require the overhead - // of a dispatcher. - MOV32ItoR(EDX, 0); - ptr = (u32*)(x86Ptr[0]-4); - } - // Check the Event scheduler if our "cycle target" has been reached. // Equiv code to: // cpuRegs.cycle += blockcycles; // if( cpuRegs.cycle > g_nextBranchCycle ) { DoEvents(); } + MOV32MtoR(EAX, (uptr)&cpuRegs.cycle); ADD32ItoR(EAX, eeScaleBlockCycles()); MOV32RtoM((uptr)&cpuRegs.cycle, EAX); // update cycles SUB32MtoR(EAX, (uptr)&g_nextBranchCycle); - if( newpc != 0xffffffff ) - { - // This is the jump instruction which gets modified by Dispatcher. - *ptr = (u32)JS32((u32)Dispatcher - ( (u32)x86Ptr[0] + 6 )); - } - else if( !noDispatch ) - { - // This instruction is a dynamic link, so it's never modified. - JS32((uptr)DispatcherReg - ( (uptr)x86Ptr[0] + 6 )); + if (!noDispatch) { + if (newpc == 0xffffffff) + JS32((uptr)DispatcherReg - ( (uptr)x86Ptr[0] + 6 )); + else + iBranch(newpc, 1); } RET(); @@ -1449,7 +1355,6 @@ void recRecompile( const u32 startpc ) u32 i = 0; u32 branchTo; u32 willbranch3 = 0; - u32* ptr; u32 usecop2; #ifdef _DEBUG @@ -1470,6 +1375,10 @@ void recRecompile( const u32 startpc ) recResetEE(); } + x86SetPtr( recPtr ); + x86Align(16); + recPtr = x86Ptr[_EmitterId_]; + s_pCurBlock = PC_GETBLOCK(startpc); assert(s_pCurBlock->GetFnptr() == (uptr)JITCompile @@ -1478,20 +1387,17 @@ void recRecompile( const u32 startpc ) s_pCurBlockEx = recBlocks.Get(HWADDR(startpc)); assert(!s_pCurBlockEx || s_pCurBlockEx->startpc != HWADDR(startpc)); - s_pCurBlockEx = recBlocks.New(HWADDR(startpc)); + s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr); if( s_pCurBlockEx == NULL ) { //SysPrintf("ee reset (blocks)\n"); recResetEE(); - s_pCurBlockEx = recBlocks.New(HWADDR(startpc)); + x86SetPtr( recPtr ); + s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr); } assert(s_pCurBlockEx); - x86SetPtr( recPtr ); - x86Align(16); - recPtr = x86Ptr[0]; - branch = 0; // reset recomp state variables @@ -1852,9 +1758,7 @@ StartRecomp: break; if (memcmp(&recRAMCopy[oldBlock->startpc / 4], PSM(oldBlock->startpc), oldBlock->size * 4)) { - u8* oldX86 = x86Ptr[_EmitterId_]; recClear(startpc, (pc - startpc) / 4); - x86Ptr[_EmitterId_] = oldX86; s_pCurBlockEx = recBlocks.Get(HWADDR(startpc)); assert(s_pCurBlockEx->startpc == HWADDR(startpc)); break; @@ -1893,21 +1797,9 @@ StartRecomp: else ADD32ItoM((int)&cpuRegs.cycle, eeScaleBlockCycles() ); - if( willbranch3 ) { - BASEBLOCK* pblock = PC_GETBLOCK(s_nEndBlock); - assert( pc == s_nEndBlock ); + if( willbranch3 || !branch) { iFlushCall(FLUSH_EVERYTHING); - MOV32ItoM((uptr)&cpuRegs.pc, pc); - JMP32((uptr)pblock->GetFnptr() - ((uptr)x86Ptr[0] + 5)); - branch = 3; - } - else if( !branch ) { - // didn't branch, but had to stop - MOV32ItoM( (uptr)&cpuRegs.pc, pc ); - - iFlushCall(FLUSH_EVERYTHING); - - ptr = JMP32(0); + iBranch(pc, 0); } } @@ -1915,20 +1807,13 @@ StartRecomp: assert( recStackPtr < recStack+RECSTACK_SIZE ); assert( x86FpuState == 0 ); + assert(x86Ptr[_EmitterId_] - recPtr < 0x10000); + s_pCurBlockEx->x86size = x86Ptr[_EmitterId_] - recPtr; + recPtr = x86Ptr[0]; assert( (g_cpuHasConstReg&g_cpuFlushedConstReg) == g_cpuHasConstReg ); - if( !branch ) { - assert( ptr != NULL ); - BASEBLOCK *pblock = PC_GETBLOCK(pc); - - if (pblock->GetFnptr() == (uptr)JITCompile - || pblock->GetFnptr() == (uptr)JITCompileInBlock) - recRecompile(pc); - *ptr = pblock->GetFnptr() - ((u32)ptr + 4); - } - s_pCurBlock = NULL; s_pCurBlockEx = NULL; } From 2b843ce49d404e19e395a1fb80463888b428b98a Mon Sep 17 00:00:00 2001 From: tmkkmac Date: Sat, 14 Mar 2009 16:59:03 +0000 Subject: [PATCH 42/77] Fixed a problem around the VU clip code, introduced in r659. GoW and Persona (and more) now work without a gamefix. I'll remove the gamefix if there is no problem. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@783 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/iVUzerorec.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index 7cf66ef529..e8e4b06efb 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -3002,21 +3002,22 @@ void VuInstruction::Recompile(list::iterator& itinst, u32 vuxyz) if( !CHECK_VUCLIPFLAGHACK && pparentinst != NULL ) { - if( pparentinst->pClipWrite == 0 ) { - pparentinst->pClipWrite = (uptr)SuperVUStaticAlloc(4); - } - if( nParentCheckForExecution >= 0 ) { + if( pparentinst->pClipWrite == 0 ) + pparentinst->pClipWrite = (uptr)SuperVUStaticAlloc(4); + if( s_ClipRead == 0 ) s_ClipRead = (uptr)&VU->VI[REG_CLIP_FLAG]; CMP32ItoM((uptr)&g_nLastBlockExecuted, nParentCheckForExecution); u8* jptr = JNE8(0); + CMP32ItoM((uptr)&s_ClipRead, (uptr)&VU->VI[REG_CLIP_FLAG]); + u8* jptr2 = JE8(0); MOV32MtoR(EAX, pparentinst->pClipWrite); MOV32RtoM(s_ClipRead, EAX); x86SetJ8(jptr); + x86SetJ8(jptr2); } - else s_ClipRead = (uptr)&VU->VI[REG_CLIP_FLAG]; } else s_ClipRead = (uptr)&VU->VI[REG_CLIP_FLAG]; } From 9ad464377ac9ce7b1f2f3b0c5855ac726019e85a Mon Sep 17 00:00:00 2001 From: tmkkmac Date: Sat, 14 Mar 2009 18:50:46 +0000 Subject: [PATCH 43/77] Removed a VU Clip gamefix. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@784 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Pcsx2Config.h | 1 - pcsx2/windows/WinMain.cpp | 2 -- pcsx2/windows/pcsx2.rc | 14 ++++++-------- pcsx2/x86/iVUzerorec.cpp | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/common/include/Pcsx2Config.h b/common/include/Pcsx2Config.h index 0d7b930b56..c7fbdbea3b 100644 --- a/common/include/Pcsx2Config.h +++ b/common/include/Pcsx2Config.h @@ -65,7 +65,6 @@ extern SessionOverrideFlags g_Session; #define CHECK_ESCAPE_HACK (Config.Hacks & 0x400) //------------ SPECIAL GAME FIXES!!! --------------- #define CHECK_VUADDSUBHACK (Config.GameFixes & 0x1) // Special Fix for Tri-ace games, they use an encryption algorithm that requires VU addi opcode to be bit-accurate. -#define CHECK_VUCLIPFLAGHACK (Config.GameFixes & 0x2) // Special Fix for God of War, fixes SPS. #define CHECK_FPUCOMPAREHACK (Config.GameFixes & 0x4) // Special Fix for Digimon Rumble Arena 2, fixes spinning/hanging on intro-menu. #define CHECK_FPUMULHACK (Config.GameFixes & 0x8) // Special Fix for Tales of Destiny hangs. //------------ Advanced Options!!! --------------- diff --git a/pcsx2/windows/WinMain.cpp b/pcsx2/windows/WinMain.cpp index e1dd5a4e83..0b8dbfd2ec 100644 --- a/pcsx2/windows/WinMain.cpp +++ b/pcsx2/windows/WinMain.cpp @@ -525,7 +525,6 @@ BOOL APIENTRY GameFixes(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: if(Config.GameFixes & 0x1) CheckDlgButton(hDlg, IDC_GAMEFIX2, TRUE);//Tri-Ace fix if(Config.GameFixes & 0x4) CheckDlgButton(hDlg, IDC_GAMEFIX3, TRUE);//Digimon FPU compare fix - if(Config.GameFixes & 0x2) CheckDlgButton(hDlg, IDC_GAMEFIX4, TRUE);//GoW fix if(Config.GameFixes & 0x8) CheckDlgButton(hDlg, IDC_GAMEFIX5, TRUE);//Tales of Destiny fix return TRUE; @@ -535,7 +534,6 @@ BOOL APIENTRY GameFixes(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) uint newfixes = 0; newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX2) ? 0x1 : 0; newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX3) ? 0x4 : 0; - newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX4) ? 0x2 : 0; newfixes |= IsDlgButtonChecked(hDlg, IDC_GAMEFIX5) ? 0x8 : 0; EndDialog(hDlg, TRUE); diff --git a/pcsx2/windows/pcsx2.rc b/pcsx2/windows/pcsx2.rc index c1792704d7..523f912ea4 100644 --- a/pcsx2/windows/pcsx2.rc +++ b/pcsx2/windows/pcsx2.rc @@ -74,21 +74,19 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN // Dialog // -IDD_GAMEFIXES DIALOGEX 0, 0, 279, 132 +IDD_GAMEFIXES DIALOGEX 0, 0, 279, 118 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Game Special Fixes" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - DEFPUSHBUTTON "OK",IDOK,87,105,50,14 - PUSHBUTTON "Cancel",IDCANCEL,142,105,50,14 + DEFPUSHBUTTON "OK",IDOK,87,89,50,14 + PUSHBUTTON "Cancel",IDCANCEL,142,89,50,14 CTEXT "Some games need special settings.\nConfigure them here.",IDC_STATIC,7,7,265,17 - GROUPBOX "PCSX2 Gamefixes",IDC_STATIC,7,28,265,97 + GROUPBOX "PCSX2 Gamefixes",IDC_STATIC,7,28,265,83 CONTROL "FPU Compare Hack - Special fix for Digimon Rumble Arena 2.",IDC_GAMEFIX3, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,43,249,10 CONTROL "VU Add Hack - Special fix for Tri-Ace games!",IDC_GAMEFIX2, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,72,252,10 - CONTROL "VU Clip Hack - Special fix for God of War",IDC_GAMEFIX4, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,86,238,10 CONTROL "FPU Mul Hack - Special fix for Tales of Destiny (possibly other games).",IDC_GAMEFIX5, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,57,249,10 END @@ -108,8 +106,8 @@ BEGIN RIGHTMARGIN, 272 VERTGUIDE, 14 TOPMARGIN, 7 - BOTTOMMARGIN, 125 - HORZGUIDE, 119 + BOTTOMMARGIN, 111 + HORZGUIDE, 103 END END #endif // APSTUDIO_INVOKED diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index e8e4b06efb..f4998b113e 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -3000,7 +3000,7 @@ void VuInstruction::Recompile(list::iterator& itinst, u32 vuxyz) if( type & INST_CLIP_WRITE ) { if( nParentPc < s_pCurBlock->startpc || nParentPc >= (int)pc ) { - if( !CHECK_VUCLIPFLAGHACK && pparentinst != NULL ) { + if( pparentinst != NULL ) { if( nParentCheckForExecution >= 0 ) { if( pparentinst->pClipWrite == 0 ) From 64a1b3fb45dae53e6d8af2329f50245a07781fb0 Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Sat, 14 Mar 2009 19:13:24 +0000 Subject: [PATCH 44/77] Forgot this. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@785 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/iR3000A.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 9b166c1954..c754abb6c8 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -787,7 +787,7 @@ void psxSetBranchImm( u32 imm ) iPsxBranchTest(imm, imm <= psxpc); ptr = JMP32(0); - recBlocks.Link(imm, (uptr)ptr); + recBlocks.Link(HWADDR(imm), (uptr)ptr); } //fixme : this is all a huge hack, we base the counter advancements on the average an opcode should take (wtf?) @@ -1175,7 +1175,7 @@ StartRecomp: _psxFlushCall(FLUSH_EVERYTHING); MOV32ItoM((uptr)&psxRegs.pc, psxpc); u32 *ptr = JMP32(0); - recBlocks.Link(s_nEndBlock, (uptr)ptr); + recBlocks.Link(HWADDR(s_nEndBlock), (uptr)ptr); psxbranch = 3; } } From bb47813a3cea0a7a5bd559b938f599255c6192c5 Mon Sep 17 00:00:00 2001 From: mattmenke Date: Sun, 15 Mar 2009 00:00:02 +0000 Subject: [PATCH 45/77] LilyPad: Removed "Axis" binding buttons. Try to autodetect full axis bindings instead, also a dropdown in case that fails. Experimental, untested PADFreeze() implemented. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@786 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/LilyPad/Config.cpp | 173 +++++++++++++++++++++---------- plugins/LilyPad/Config.h | 1 - plugins/LilyPad/Global.h | 1 + plugins/LilyPad/InputManager.cpp | 7 +- plugins/LilyPad/LilyPad.cpp | 96 +++++++++++++++-- plugins/LilyPad/LilyPad.def | 2 +- plugins/LilyPad/LilyPad.rc | 114 ++++++++------------ plugins/LilyPad/resource.h | 14 +-- 8 files changed, 259 insertions(+), 149 deletions(-) diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index c4fcd6bfcc..4afffc912a 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -180,18 +180,6 @@ void RefreshEnabledDevicesAndDisplay(int updateDeviceList = 0, HWND hWnd = 0, in wchar_t *GetCommandStringW(u8 command, int pad) { static wchar_t temp[34]; - if (command >= 0x30 && command <= 0x35) { - if (config.guitar[pad] && (command == 0x31 || command == 0x33)) { - HWND hWnd = GetDlgItem(hWnds[pad], 0x10F0+command); - int res = GetWindowTextW(hWnd, temp, 20); - if ((unsigned int)res-1 <= 18) return temp; - } - static wchar_t *axisCommands[] = { - L"D-Pad Horiz", L"D-Pad Vert", - L"L-Stick Horiz", L"L-Stick Vert", - L"R-Stick Horiz", L"R-Stick Vert"}; - return axisCommands[command-0x30]; - } if (command >= 0x20 && command <= 0x27) { if (config.guitar[pad] && (command == 0x20 || command == 0x22)) { HWND hWnd = GetDlgItem(hWnds[pad], 0x10F0+command); @@ -206,9 +194,42 @@ wchar_t *GetCommandStringW(u8 command, int pad) { return temp; } /* Get text from the buttons. */ - if (command >= 0x0B && command <=0x28 || - (command >= 0x36 && command <=0x38)) { + if (command >= 0x0C && command <=0x28) { HWND hWnd = GetDlgItem(hWnds[pad], 0x10F0+command); + if (!hWnd) { + wchar_t *strings[] = { + L"Lock Buttons", + L"Lock Input", + L"Lock Direction", + L"Mouse", + L"Select", + L"L3", + L"R3", + L"Start", + L"Up", + L"Right", + L"Down", + L"Left", + L"L2", + L"R2", + L"L1", + L"R1", + L"Triangle", + L"Circle", + L"Square", + L"Cross", + L"L-Stick Up", + L"L-Stick Right", + L"L-Stick Down", + L"L-Stick Left", + L"R-Stick Up", + L"R-Stick Right", + L"R-Stick Down", + L"R-Stick Left", + L"Analog", + }; + return strings[command - 0xC]; + } int res = GetWindowTextW(hWnd, temp, 20); if ((unsigned int)res-1 <= 18) return temp; } @@ -241,15 +262,15 @@ void SelChanged(int pad) { // Set if sensitivity != 0, but need to disable flip anyways. // Only used to relative axes. int disableFlip = 0; - wchar_t temp[3][1000]; + wchar_t temp[4][1000]; Device *dev; int bFound = 0; int ffbFound = 0; ForceFeedbackBinding *ffb = 0; + Binding *b = 0; if (i >= 1) { int index = -1; int flipped = 0; - Binding *b; while (1) { index = ListView_GetNextItem(hWndList, index, LVNI_SELECTED); if (index < 0) break; @@ -257,10 +278,31 @@ void SelChanged(int pad) { item.iItem = index; item.mask = LVIF_TEXT; for (j=0; j<3; j++) { - item.pszText = temp[j]; + item.pszText = temp[3]; item.iSubItem = j; - item.cchTextMax = sizeof(temp[0])/sizeof(temp[0][0]); + item.cchTextMax = sizeof(temp[0])/sizeof(temp[3][0]); if (!ListView_GetItem(hWndList, &item)) break; + if (!bFound && !ffbFound) + wcscpy(temp[j], temp[3]); + else if (wcsicmp(temp[j], temp[3])) { + int q = 0; + while (temp[j][q] == temp[3][q]) q++; + if (q && temp[j][q-1] == ' ' && temp[j][q] && temp[j][q+1] == 0) q--; + if (j == 1) { + // Really ugly, but merges labels for multiple directions for same axis. + if ((temp[j][q] == 0 || (temp[j][q] == ' ' && temp[j][q+2] == 0)) && + (temp[3][q] == 0 || (temp[3][q] == ' ' && temp[3][q+2] == 0))) { + temp[j][q] = 0; + continue; + } + } + // Merge different directions for same stick. + else if (j == 2 && q > 4) { + temp[j][q] = 0; + continue; + } + wcscpy(temp[j], L"*"); + } } if (j == 3) { devName = temp[0]; @@ -352,10 +394,6 @@ void SelChanged(int pad) { } } if (!ffb) { - SetWindowText(GetDlgItem(hWnd, IDC_AXIS_DEVICE1), devName); - SetWindowText(GetDlgItem(hWnd, IDC_AXIS1), key); - SetWindowText(GetDlgItem(hWnd, IDC_AXIS_CONTROL1), command); - SetLogSliderVal(hWnd, IDC_SLIDER1, GetDlgItem(hWnd, IDC_AXIS_SENSITIVITY1), sensitivity); if (disableFlip) EnableWindow(GetDlgItem(hWnd, IDC_FLIP1), 0); @@ -369,11 +407,45 @@ void SelChanged(int pad) { SendMessage(GetDlgItem(hWnd, IDC_TURBO), BM_SETSTYLE, BS_AUTOCHECKBOX, 0); CheckDlgButton(hWnd, IDC_TURBO, BST_CHECKED * (bFound && turbo == bFound)); } + HWND hWndCombo = GetDlgItem(hWnd, IDC_AXIS_DIRECTION); + int enableCombo = 0; + SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0); + if (b && bFound == 1) { + VirtualControl *control = &dev->virtualControls[b->controlIndex]; + unsigned int uid = control->uid; + if (((uid>>16) & 0xFF) == ABSAXIS) { + enableCombo = 1; + wchar_t *endings[3] = {L" -", L" +", L""}; + wchar_t *string = temp[3]; + wcscpy(string, key); + wchar_t *end = wcschr(string, 0); + int sel = 2; + if (!(uid & UID_AXIS)) { + end[-2] = 0; + sel = (end[-1] == '+'); + end -= 2; + } + for (int i=0; i<3; i++) { + wcscpy(end, endings[i]); + SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) string); + if (i == sel) + SendMessage(hWndCombo, CB_SETCURSEL, i, 0); + } + } + } + EnableWindow(hWndCombo, enableCombo); + if (!enableCombo) { + SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) key); + SendMessage(hWndCombo, CB_SELECTSTRING, i, (LPARAM) key); + } + + SetDlgItemText(hWnd, IDC_AXIS_DEVICE1, devName); + SetDlgItemText(hWnd, IDC_AXIS_CONTROL1, command); } else { wchar_t temp2[2000]; wsprintfW(temp2, L"%s / %s", devName, command); - SetWindowText(GetDlgItem(hWnd, ID_FF), temp2); + SetDlgItemText(hWnd, ID_FF, temp2); hWndTemp = GetDlgItem(hWnd, IDC_FF_EFFECT); SendMessage(hWndTemp, CB_RESETCONTENT, 0, 0); @@ -626,7 +698,6 @@ int SaveSettings(wchar_t *file=0) { WritePrivateProfileInt(L"General Settings", L"Mouse Unfocus", config.mouseUnfocus, file); WritePrivateProfileInt(L"General Settings", L"Pad1 Disable", config.disablePad[0], file); WritePrivateProfileInt(L"General Settings", L"Pad2 Disable", config.disablePad[1], file); - WritePrivateProfileInt(L"General Settings", L"Axis Buttons", config.axisButtons, file); WritePrivateProfileInt(L"General Settings", L"Logging", config.debug, file); WritePrivateProfileInt(L"General Settings", L"Keyboard Mode", config.keyboardApi, file); WritePrivateProfileInt(L"General Settings", L"Mouse Mode", config.mouseApi, file); @@ -746,7 +817,6 @@ int LoadSettings(int force, wchar_t *file) { config.disablePad[0] = GetPrivateProfileBool(L"General Settings", L"Pad1 Disable", 0, file); config.disablePad[1] = GetPrivateProfileBool(L"General Settings", L"Pad2 Disable", 0, file); config.debug = GetPrivateProfileBool(L"General Settings", L"Logging", 0, file); - config.axisButtons = GetPrivateProfileBool(L"General Settings", L"Axis Buttons", 0, file); config.multipleBinding = GetPrivateProfileBool(L"General Settings", L"Multiple Bindings", 0, file); config.forceHide = GetPrivateProfileBool(L"General Settings", L"Force Cursor Hide", 0, file); @@ -1184,11 +1254,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l int value; InitInfo info = {selected==0x7F, hWndProp, hWnd, GetDlgItem(hWnd, selected)}; int hint = 0; - if (selected < 0x30) { - // 1 will accept absolute axes, in addition to buttons. - hint = config.axisButtons; - } - else if (selected < 0x7F) { + if (selected < 0x7F) { // 2 will accept relative axes, absolute axes, and POV controls. hint = 2; } @@ -1355,7 +1421,27 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l } break; case WM_COMMAND: - if (HIWORD(wParam)==CBN_SELCHANGE && LOWORD(wParam) == IDC_FF_EFFECT) { + if (HIWORD(wParam)==CBN_SELCHANGE && LOWORD(wParam) == IDC_AXIS_DIRECTION) { + int index = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); + if (index >= 0) { + int cbsel = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0); + if (cbsel >= 0) { + ForceFeedbackBinding *ffb; + Binding *b; + Device *dev; + if (GetBinding(pad, index, dev, b, ffb)) { + int uid = dev->virtualControls[b->controlIndex].uid; + const static unsigned int axisUIDs[3] = {UID_AXIS_NEG, UID_AXIS_POS, UID_AXIS}; + uid = (uid&0x00FFFFFF) | axisUIDs[cbsel]; + Binding backup = *b; + DeleteSelected(pad); + int index = BindCommand(dev, uid, pad, backup.command, backup.sensitivity, backup.turbo); + ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); + } + } + } + } + else if (HIWORD(wParam)==CBN_SELCHANGE && LOWORD(wParam) == IDC_FF_EFFECT) { unsigned int typeIndex = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0); if (typeIndex >= 0) ChangeEffect(pad, 0, 0, &typeIndex); @@ -1559,7 +1645,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_CHECKED * config.AutoAnalog[0]); CheckDlgButton(hWnd, IDC_ANALOG_START2, BST_CHECKED * config.AutoAnalog[1]); CheckDlgButton(hWnd, IDC_DEBUG_FILE, BST_CHECKED * config.debug); - CheckDlgButton(hWnd, IDC_AXIS_BUTTONS, BST_CHECKED * config.axisButtons); CheckDlgButton(hWnd, IDC_MULTIPLE_BINDING, BST_CHECKED * config.multipleBinding); @@ -1673,25 +1758,8 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L config.AutoAnalog[0] = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START1) == BST_CHECKED); config.AutoAnalog[1] = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START2) == BST_CHECKED); config.debug = (IsDlgButtonChecked(hWnd, IDC_DEBUG_FILE) == BST_CHECKED); - int temp = config.axisButtons; - config.axisButtons = (IsDlgButtonChecked(hWnd, IDC_AXIS_BUTTONS) == BST_CHECKED); - if (!temp && config.axisButtons) { - int res = MessageBoxA(hWnd, - "Enabling this completely changes the way that binding objects other than buttons works.\n" - "Such devices include POV controls and joysticks. It has no effect on the bind to axis buttons, \n" - "but many people seem to have trouble figuring out how to click on those buttons.\n\n" - "Are you sure you want to enable this?\n\n" - "If you do, and then you have issues, don't waste my time complaining.\n\n", - "Are you sure?", MB_YESNO | MB_ICONEXCLAMATION); - if (res != IDYES) { - config.axisButtons = 0; - CheckDlgButton(hWnd, IDC_AXIS_BUTTONS, BST_CHECKED * config.axisButtons); - } - } config.multipleBinding = (IsDlgButtonChecked(hWnd, IDC_MULTIPLE_BINDING) == BST_CHECKED); - CheckDlgButton(hWnd, IDC_AXIS_BUTTONS, BST_CHECKED * config.axisButtons); - for (i=0; i<4; i++) { if (IsDlgButtonChecked(hWnd, IDC_KB_DISABLE+i) == BST_CHECKED) { if (i != NO_API || config.keyboardApi == NO_API || IDOK == MessageBoxA(hWnd, @@ -1715,13 +1783,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L config.gameApis.directInput = (IsDlgButtonChecked(hWnd, IDC_G_DI) == BST_CHECKED); config.gameApis.xInput = (IsDlgButtonChecked(hWnd, IDC_G_XI) == BST_CHECKED); - if (test == IDC_FORCEFEEDBACK_HACK1) { - CheckDlgButton(hWnd, IDC_FORCEFEEDBACK_HACK2, BST_UNCHECKED); - } - else if (test == IDC_FORCEFEEDBACK_HACK2) { - CheckDlgButton(hWnd, IDC_FORCEFEEDBACK_HACK1, BST_UNCHECKED); - } - config.forceHide = (IsDlgButtonChecked(hWnd, IDC_FORCE_HIDE) == BST_CHECKED); RefreshEnabledDevicesAndDisplay(0, hWnd, 1); diff --git a/plugins/LilyPad/Config.h b/plugins/LilyPad/Config.h index 8e711a6b5a..87b648f401 100644 --- a/plugins/LilyPad/Config.h +++ b/plugins/LilyPad/Config.h @@ -14,7 +14,6 @@ public: u8 disableScreenSaver; u8 closeHacks; - u8 axisButtons; DeviceAPI keyboardApi; DeviceAPI mouseApi; struct { diff --git a/plugins/LilyPad/Global.h b/plugins/LilyPad/Global.h index d6a3621b05..17e41b7013 100644 --- a/plugins/LilyPad/Global.h +++ b/plugins/LilyPad/Global.h @@ -62,6 +62,7 @@ EXPORT_C_(u32) PADreadPort2 (PadDataS* pads); EXPORT_C_(u32) PSEgetLibType(); EXPORT_C_(u32) PSEgetLibVersion(); EXPORT_C_(void) PADconfigure(); +EXPORT_C_(s32) PADfreeze(int mode, freezeData *data); #ifdef NO_CRT inline void * malloc(size_t size) { diff --git a/plugins/LilyPad/InputManager.cpp b/plugins/LilyPad/InputManager.cpp index aec8e777d2..0620243da5 100644 --- a/plugins/LilyPad/InputManager.cpp +++ b/plugins/LilyPad/InputManager.cpp @@ -161,7 +161,7 @@ void Device::CalcVirtualState() { } } else if (c->type & ABSAXIS) { - virtualControlState[index] = val; + virtualControlState[index] = (val + FULLY_DOWN)/2; // Positive. Overkill. virtualControlState[index+1] = (val & ~(val>>31)); // Negative @@ -382,7 +382,10 @@ Device *InputDeviceManager::GetActiveDevice(void *info, int axisHint, unsigned i if (axisHint != 2) { if (devices[i]->virtualControls[j].uid & UID_POV) continue; if (devices[i]->virtualControls[j].uid & UID_AXIS) { - if (!axisHint || (((devices[i]->virtualControls[j].uid>>16)&0xFF) != ABSAXIS)) continue; + if ((((devices[i]->virtualControls[j].uid>>16)&0xFF) != ABSAXIS)) continue; + // Very picky when binding entire axes. Prefer binding half-axes. + if (devices[i]->oldVirtualControlState[j] >= FULLY_DOWN/8 && + devices[i]->oldVirtualControlState[j] <= FULLY_DOWN*7/8) continue; } } bestDiff = diff; diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 23edeaaeed..f36fef572d 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -547,7 +547,15 @@ inline void ResetVibrate(Pad *pad) { ((int*)(pad->vibrate))[1] = 0xFFFFFFFF; } - +void ResetPad(int pad) { + memset(&pads[pad], 0, sizeof(pads[0])); + pads[pad].mode = MODE_DIGITAL; + pads[pad].umask[0] = pads[pad].umask[1] = 0xFF; + ResetVibrate(pads+pad); + if (config.AutoAnalog[pad]) { + pads[pad].mode = MODE_ANALOG; + } +} s32 CALLBACK PADinit(u32 flags) { // Note: Won't load settings if already loaded. @@ -566,13 +574,7 @@ s32 CALLBACK PADinit(u32 flags) { #endif pad --; - memset(&pads[pad], 0, sizeof(pads[0])); - pads[pad].mode = MODE_DIGITAL; - pads[pad].umask[0] = pads[pad].umask[1] = 0xFF; - ResetVibrate(pads+pad); - if (config.AutoAnalog[pad]) { - pads[pad].mode = MODE_ANALOG; - } + ResetPad(pad); pads[pad].initialized = 1; @@ -1173,6 +1175,84 @@ keyEvent* CALLBACK PADkeyEvent() { return &ev; } +#define PAD_SAVE_STATE_VERSION 0 + +struct PadFreezeData { + u8 mode; + u8 locked; + u8 config; + u8 vibrate[8]; + u8 umask[2]; +}; + +struct PadPluginFreezeData { + char format[8]; + // Currently all different versions are incompatible. + // May split into major/minor with some compatibility rules. + u32 version; + PadFreezeData padData[2]; +}; + +s32 CALLBACK PADfreeze(int mode, freezeData *data) { + if (mode == FREEZE_SIZE) { + data->size = sizeof(PadPluginFreezeData); + } + else if (mode == FREEZE_LOAD) { + if (data->size < sizeof(PadPluginFreezeData)) return 0; + PadPluginFreezeData &pdata = *(PadPluginFreezeData*)(data->data); + strcpy(pdata.format, "PadMode"); + pdata.version = PAD_SAVE_STATE_VERSION; + for (int i=0; i<2; i++) { + pdata.padData[i].mode = pads[i].mode; + pdata.padData[i].locked = pads[i].modeLock; + memcpy(pdata.padData[i].umask, pads[i].umask, sizeof(pads[i].umask)); + memcpy(pdata.padData[i].vibrate, pads[i].vibrate, sizeof(pads[i].vibrate)); + + + // Means I only have to have one chunk of code to parse vibrate info. + // Other plugins don't store it exactly, but think it's technically correct + // to do so, though I could be wrong. + pads[i].config = 1; + PADstartPoll(i+1); + PADpoll(0x4D); + PADpoll(0x00); + for (int j=0; j<7; j++) { + PADpoll(pdata.padData[i].vibrate[j]); + } + + pdata.padData[i].config = pads[i].config; + } + } + else if (mode == FREEZE_SAVE) { + if (data->size != sizeof(PadPluginFreezeData)) return 0; + PadPluginFreezeData &pdata = *(PadPluginFreezeData*)(data->data); + if (pdata.version != PAD_SAVE_STATE_VERSION || !stricmp(pdata.format, "PadMode")) return 0; + StopVibrate(); + for (int i=0; i<2; i++) { + u8 mode = pads[i].mode = pdata.padData[i].mode; + if (mode != MODE_DIGITAL && mode != MODE_ANALOG && mode != MODE_DS2_NATIVE) { + ResetPad(i); + continue; + } + pads[i].config = pdata.padData[i].config; + pads[i].modeLock = pdata.padData[i].locked; + memcpy(pads[i].umask, pdata.padData[i].umask, sizeof(pads[i].umask)); + + // Means I only have to have one chunk of code to parse vibrate info. + // Other plugins don't store it exactly, but think it's technically correct + // to do so, though I could be wrong. + PADstartPoll(i+1); + PADpoll(0x4D); + PADpoll(0x00); + for (int j=0; j<7; j++) { + PADpoll(pdata.padData[i].vibrate[j]); + } + } + } + else return -1; + return 0; +} + u32 CALLBACK PADreadPort1 (PadDataS* pads) { PADstartPoll(1); PADpoll(0x42); diff --git a/plugins/LilyPad/LilyPad.def b/plugins/LilyPad/LilyPad.def index c26aba711c..9754805d5a 100644 --- a/plugins/LilyPad/LilyPad.def +++ b/plugins/LilyPad/LilyPad.def @@ -19,4 +19,4 @@ EXPORTS PADtest PADabout PADupdate - + PADfreeze diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index 33f7f7d78d..39eba2e065 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -74,38 +74,21 @@ BEGIN PUSHBUTTON "R2",ID_R2,372,73,45,15 PUSHBUTTON "L3",ID_L3,195,93,45,15 PUSHBUTTON "R3",ID_R3,371,93,46,15 - GROUPBOX "D-Pad",ID_DPAD,251,44,110,68 - PUSHBUTTON "Up",ID_DPAD_UP,275,54,35,15 - PUSHBUTTON "Left",ID_DPAD_LEFT,257,73,35,15 - PUSHBUTTON "Right",ID_DPAD_RIGHT,297,73,35,15 - PUSHBUTTON "Down",ID_DPAD_DOWN,275,92,35,15 - PUSHBUTTON "Vert Axis",ID_DPAD_UDAXIS,314,54,40,15 - PUSHBUTTON "Horiz Axis",ID_DPAD_LRAXIS,314,92,40,15 - PUSHBUTTON "L1/R1 Axis",ID_L1R1,231,117,45,15 - PUSHBUTTON "L2/R2 Axis",ID_L2R2,281,117,45,15 - PUSHBUTTON "L3/R3 Axis",ID_L3R3,331,117,45,15 - GROUPBOX "Left Analog Stick",ID_LSTICK,195,135,108,70 - PUSHBUTTON "Up",ID_LSTICK_UP,218,145,35,15 - PUSHBUTTON "Left",ID_LSTICK_LEFT,200,164,35,15 - PUSHBUTTON "Right",ID_LSTICK_RIGHT,240,164,35,15 - PUSHBUTTON "Down",ID_LSTICK_DOWN,218,184,35,15 - PUSHBUTTON "Vert Axis",ID_LSTICK_UDAXIS,257,145,40,15 - PUSHBUTTON "Horiz Axis",ID_LSTICK_LRAXIS,257,184,40,15 - GROUPBOX "Right Analog Stick",ID_RSTICK,309,135,108,70 - PUSHBUTTON "Up",ID_RSTICK_UP,332,145,35,15 - PUSHBUTTON "Left",ID_RSTICK_LEFT,314,164,35,15 - PUSHBUTTON "Right",ID_RSTICK_RIGHT,354,164,35,15 - PUSHBUTTON "Down",ID_RSTICK_DOWN,332,184,35,15 - PUSHBUTTON "Vert Axis",ID_RSTICK_UDAXIS,371,145,40,15 - PUSHBUTTON "Horiz Axis",ID_RSTICK_LRAXIS,371,184,40,15 - GROUPBOX "Sensitivity",ID_SENSITIVITY,195,207,222,49 - EDITTEXT IDC_AXIS_DEVICE1,201,218,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_AXIS1,201,230,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_AXIS_CONTROL1,201,242,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,217,138,17 - CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,240,27,10 - CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,240,34,10 - EDITTEXT IDC_AXIS_SENSITIVITY1,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING + GROUPBOX "D-Pad",IDC_STATIC,251,44,110,68 + PUSHBUTTON "Up",ID_DPAD_UP,285,54,35,15 + PUSHBUTTON "Left",ID_DPAD_LEFT,267,73,35,15 + PUSHBUTTON "Right",ID_DPAD_RIGHT,307,73,35,15 + PUSHBUTTON "Down",ID_DPAD_DOWN,285,92,35,15 + GROUPBOX "Left Analog Stick",IDC_STATIC,195,115,108,70 + PUSHBUTTON "Up",ID_LSTICK_UP,228,125,35,15 + PUSHBUTTON "Left",ID_LSTICK_LEFT,210,144,35,15 + PUSHBUTTON "Right",ID_LSTICK_RIGHT,250,144,35,15 + PUSHBUTTON "Down",ID_LSTICK_DOWN,228,164,35,15 + GROUPBOX "Right Analog Stick",IDC_STATIC,309,115,108,70 + PUSHBUTTON "Up",ID_RSTICK_UP,342,125,35,15 + PUSHBUTTON "Left",ID_RSTICK_LEFT,324,144,35,15 + PUSHBUTTON "Right",ID_RSTICK_RIGHT,364,144,35,15 + PUSHBUTTON "Down",ID_RSTICK_DOWN,342,164,35,15 GROUPBOX "",ID_FF,195,6,222,250 COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17 @@ -133,6 +116,14 @@ BEGIN CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10 EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING PUSHBUTTON "Test",ID_TEST,196,260,62,15 + GROUPBOX "Binding Details",ID_SENSITIVITY,195,187,222,67 + EDITTEXT IDC_AXIS_DEVICE1,201,200,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + COMBOBOX IDC_AXIS_DIRECTION,201,216,63,47,CBS_DROPDOWNLIST | WS_TABSTOP + EDITTEXT IDC_AXIS_CONTROL1,201,238,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,215,138,17 + CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,238,27,10 + CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,238,34,10 + EDITTEXT IDC_AXIS_SENSITIVITY1,375,238,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,62,15 PUSHBUTTON "Lock Input",ID_LOCK,196,260,62,15 PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,62,15 @@ -159,31 +150,9 @@ BEGIN PUSHBUTTON "Start",ID_START,256,122,45,15 PUSHBUTTON "Select/Tilt",ID_SELECT,307,122,45,15 PUSHBUTTON "Whammy Bar Up",ID_LSTICK_UP,219,146,69,15 - PUSHBUTTON "Whammy Bar Axis",ID_LSTICK_UDAXIS,212,165,84,15 - PUSHBUTTON "Whammy Bar Down",ID_LSTICK_DOWN,219,184,69,15 - PUSHBUTTON "Analog",ID_ANALOG,372,7,45,12,NOT WS_VISIBLE - PUSHBUTTON "Mouse",ID_MOUSE,372,51,45,12,NOT WS_VISIBLE - PUSHBUTTON "L3",ID_L3,203,7,45,15,NOT WS_VISIBLE - PUSHBUTTON "R3",ID_R3,203,23,46,15,NOT WS_VISIBLE + PUSHBUTTON "Whammy Bar Down",ID_LSTICK_DOWN,219,164,69,15 PUSHBUTTON "Strum Bar Up",ID_DPAD_UP,336,146,58,15 - PUSHBUTTON "Strum Bar Axis",ID_DPAD_UDAXIS,328,165,74,15 - PUSHBUTTON "Strum Bar Down",ID_DPAD_DOWN,336,184,58,15 - PUSHBUTTON "Left",ID_DPAD_LEFT,342,28,35,15,NOT WS_VISIBLE - PUSHBUTTON "Right",ID_DPAD_RIGHT,382,28,35,15,NOT WS_VISIBLE - PUSHBUTTON "L1",ID_L1,372,85,45,15,NOT WS_VISIBLE - PUSHBUTTON "R1",ID_R1,372,67,45,15,NOT WS_VISIBLE - PUSHBUTTON "L2",ID_L2,372,103,45,15,NOT WS_VISIBLE - PUSHBUTTON "L1/R1 Axis",ID_L1R1,203,74,45,15,NOT WS_VISIBLE - PUSHBUTTON "L2/R2 Axis",ID_L2R2,203,58,45,15,NOT WS_VISIBLE - PUSHBUTTON "L3/R3 Axis",ID_L3R3,203,42,45,15,NOT WS_VISIBLE - GROUPBOX "Sensitivity",ID_SENSITIVITY,195,207,222,49 - EDITTEXT IDC_AXIS_DEVICE1,201,218,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_AXIS1,201,230,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - EDITTEXT IDC_AXIS_CONTROL1,201,242,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,217,138,17 - CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,240,27,10 - CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,240,34,10 - EDITTEXT IDC_AXIS_SENSITIVITY1,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING + PUSHBUTTON "Strum Bar Down",ID_DPAD_DOWN,336,164,58,15 GROUPBOX "",ID_FF,195,6,222,250 COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17 @@ -211,6 +180,14 @@ BEGIN CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10 EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING PUSHBUTTON "Test",ID_TEST,196,260,62,15 + GROUPBOX "Binding Details",ID_SENSITIVITY,195,187,222,67 + EDITTEXT IDC_AXIS_DEVICE1,201,200,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + COMBOBOX IDC_AXIS_DIRECTION,201,216,63,47,CBS_DROPDOWNLIST | WS_TABSTOP + EDITTEXT IDC_AXIS_CONTROL1,201,238,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,215,138,17 + CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,238,27,10 + CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,238,34,10 + EDITTEXT IDC_AXIS_SENSITIVITY1,375,238,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,62,15 PUSHBUTTON "Lock Input",ID_LOCK,196,260,62,15 PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,62,15 @@ -236,16 +213,16 @@ BEGIN CONTROL "DirectInput",IDC_G_DI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,65,10 CONTROL "XInput",IDC_G_XI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,104,39,10 CONTROL "Monitor when in background",IDC_BACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,116,106,10 - GROUPBOX "Mouse API",IDC_STATIC,216,16,192,73 + GROUPBOX "Mouse API",IDC_STATIC,216,16,192,85 CONTROL "Windows messaging",IDC_M_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,224,27,112,10 CONTROL "Raw input (XP and later only)",IDC_M_RAW,"Button",BS_AUTORADIOBUTTON,224,39,112,10 CONTROL "DirectInput",IDC_M_DI,"Button",BS_AUTORADIOBUTTON,224,51,112,10 CONTROL "Disable",IDC_M_DISABLE,"Button",BS_AUTORADIOBUTTON,224,63,39,10 CONTROL "Start without mouse focus",IDC_MOUSE_UNFOCUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,75,97,10 - GROUPBOX "Advanced",IDC_STATIC,216,92,192,38 - CONTROL "Allow binding entire axes to single buttons",IDC_AXIS_BUTTONS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,104,177,10 - CONTROL "Allow multiple binding",IDC_MULTIPLE_BINDING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,116,83,10 + CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,87,71,10 + GROUPBOX "Advanced",IDC_STATIC,216,103,192,27 + CONTROL "Allow binding multiple PS2 controls to one PC control",IDC_MULTIPLE_BINDING, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,115,182,10 GROUPBOX "Pad Options",IDC_STATIC,7,140,410,67 GROUPBOX "Pad 1",IDC_STATIC,16,150,192,49 CONTROL "Disable pad",IDC_DISABLE_PAD1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,162,53,10 @@ -268,10 +245,9 @@ BEGIN CONTROL "Safe fullscreen exit on escape",IDC_ESCAPE_FULLSCREEN_HACK, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,259,112,10 CONTROL "Use GS thread (Recommended)",IDC_GS_THREAD_INPUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,271,116,10 - CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,223,71,10 - CONTROL "Save state # in title",IDC_SAVE_STATE_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,235,79,10 - CONTROL "Local volume control",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,77,10 - CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,259,76,10 + CONTROL "Save state # in title",IDC_SAVE_STATE_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,223,79,10 + CONTROL "Local volume control",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,235,77,10 + CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,76,10 GROUPBOX "Debugging",IDC_STATIC,216,285,79,25 CONTROL "Enable logging",IDC_DEBUG_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,296,63,10 PUSHBUTTON "Load",ID_LOAD,313,295,48,15 @@ -303,7 +279,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_CONFIG, DIALOG BEGIN diff --git a/plugins/LilyPad/resource.h b/plugins/LilyPad/resource.h index 1d5010151c..67e24e710b 100644 --- a/plugins/LilyPad/resource.h +++ b/plugins/LilyPad/resource.h @@ -34,32 +34,22 @@ #define IDC_DISABLE_SCREENSAVER 1119 #define IDC_MOUSE_UNFOCUS 1120 #define IDC_MOUSE_UNFOCUS2 1121 -#define IDC_AXIS_BUTTONS 1121 #define IDC_BACKGROUND 1122 #define IDC_MULTIPLE_BINDING 1123 -#define IDC_DISABLE_SCREENSAVER2 1124 #define IDC_FORCE_HIDE 1124 -#define IDC_FORCE_HIDE2 1125 #define IDC_GH2_HACK 1125 -#define IDC_FORCEFEEDBACK_HACK1 1126 -#define IDC_GH2_HACK2 1126 #define IDC_VISTA_VOLUME 1126 -#define IDC_DISABLE_SCREENSAVER4 1127 -#define IDC_FORCEFEEDBACK_HACK2 1127 +#define IDC_FORCE_HIDE3 1127 #define IDC_GS_THREAD_INPUT 1128 -#define IDC_GS_THREAD_INPUT2 1129 #define IDC_SAVE_STATE_TITLE 1129 #define IDC_SLIDER1 0x1000 #define IDC_FLIP1 0x1001 -#define IDC_AXIS1 0x1002 +#define IDC_AXIS_DIRECTION 0x1002 #define IDC_AXIS_CONTROL1 0x1003 #define IDC_AXIS_SENSITIVITY1 0x1004 #define IDC_TURBO 0x1005 #define IDC_AXIS_DEVICE1 0x1006 #define ID_SENSITIVITY 0x1007 -#define ID_DPAD 0x1008 -#define ID_LSTICK 0x1009 -#define ID_RSTICK 0x100A #define ID_GUITAR_HERO 0x10FB #define ID_LOCK_BUTTONS 0x10FC #define ID_LOCK 0x10FD From fadeb5d86f7ce6d76582780dc1df3edf21e989ad Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sun, 15 Mar 2009 01:15:18 +0000 Subject: [PATCH 46/77] Linux: Bring the gamefixes dialog up to date. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@787 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVDlib.h | 2 +- pcsx2/Cache.cpp | 1 + pcsx2/Linux/HacksDlg.cpp | 8 +- pcsx2/Linux/Linux.h | 10 +- pcsx2/Linux/callbacks.h | 24 - pcsx2/Linux/interface.c | 577 +- pcsx2/Linux/pcsx2.glade | 14046 +++++++++++++++---------------------- pcsx2/Misc.h | 4 +- 8 files changed, 5581 insertions(+), 9091 deletions(-) diff --git a/pcsx2/CDVDlib.h b/pcsx2/CDVDlib.h index 9e74fb8d6d..b942055fbf 100644 --- a/pcsx2/CDVDlib.h +++ b/pcsx2/CDVDlib.h @@ -84,6 +84,7 @@ * Macros for sceCdGetDiskType() //comments translated from japanese;) */ +// These are already declared with different names in PS2Edefs.h. And aren't used. #define SCECdIllgalMedia 0xff // ILIMEDIA (Illegal Media) A non-PS / non-PS2 Disc. #define SCECdDVDV 0xfe // DVDV (DVD Video) A non-PS / non-PS2 Disc, but a DVD Video Disc #define SCECdCDDA 0xfd // CDDA (CD DA) A non-PS / non-PS2 Disc that include a DA track @@ -95,7 +96,6 @@ #define SCECdDETCT 0x01 // DETCT (Detecting) Disc distinction action #define SCECdNODISC 0x00 // NODISC (No disc) No disc entered - /* * Media mode */ diff --git a/pcsx2/Cache.cpp b/pcsx2/Cache.cpp index 149bad14bd..ad101b7cb9 100644 --- a/pcsx2/Cache.cpp +++ b/pcsx2/Cache.cpp @@ -27,6 +27,7 @@ namespace R5900{ namespace Interpreter { +// fixme - this code no longer compiles if PCSX2_CACHE_EMU_MEM is defined - do we need it any more? #ifdef PCSX2_CACHE_EMU_MEM int getFreeCache(u32 mem, int mode, int * way) { u8 * out; diff --git a/pcsx2/Linux/HacksDlg.cpp b/pcsx2/Linux/HacksDlg.cpp index 7d77378199..7a13ad8d83 100644 --- a/pcsx2/Linux/HacksDlg.cpp +++ b/pcsx2/Linux/HacksDlg.cpp @@ -24,9 +24,9 @@ GtkWidget *GameFixDlg, *SpeedHacksDlg; { GameFixDlg = create_GameFixDlg(); + set_checked(GameFixDlg, "check_FPU_Compare", (Config.GameFixes & FLAG_FPU_Compare)); set_checked(GameFixDlg, "check_VU_Add_Sub", (Config.GameFixes & FLAG_VU_ADD_SUB)); - set_checked(GameFixDlg, "check_VU_Clip", (Config.GameFixes & FLAG_VU_CLIP)); - set_checked(GameFixDlg, "check_FPU_Clamp", (Config.GameFixes & FLAG_FPU_CLAMP)); + set_checked(GameFixDlg, "check_FPU_Mul", (Config.GameFixes & FLAG_FPU_MUL)); gtk_widget_show_all(GameFixDlg); gtk_widget_set_sensitive(MainWindow, FALSE); @@ -37,9 +37,9 @@ void on_Game_Fix_OK(GtkButton *button, gpointer user_data) { Config.GameFixes = 0; + Config.GameFixes |= is_checked(GameFixDlg, "check_FPU_Compare") ? FLAG_FPU_Compare : 0; Config.GameFixes |= is_checked(GameFixDlg, "check_VU_Add_Sub") ? FLAG_VU_ADD_SUB : 0; - Config.GameFixes |= is_checked(GameFixDlg, "check_VU_Clip") ? FLAG_VU_CLIP : 0; - Config.GameFixes |= is_checked(GameFixDlg, "check_FPU_Clamp") ? FLAG_FPU_CLAMP : 0; + Config.GameFixes |= is_checked(GameFixDlg, "check_FPU_Mul") ? FLAG_FPU_MUL : 0; SaveConfig(); gtk_widget_destroy(GameFixDlg); diff --git a/pcsx2/Linux/Linux.h b/pcsx2/Linux/Linux.h index 3db9330c95..fc9b436e44 100644 --- a/pcsx2/Linux/Linux.h +++ b/pcsx2/Linux/Linux.h @@ -100,12 +100,12 @@ char iop_log_names[9][32] = "Cdr Log", "GPU Log" }; - +//Tri-Ace - IDC_GAMEFIX2 #define FLAG_VU_ADD_SUB 0x1 -#define FLAG_VU_CLIP 0x2 -#define FLAG_FPU_CLAMP 0x4 -#define FLAG_VU_FCOR_HACK 0x8 -#define FLAG_AVOID_DELAY_HANDLING 0x10 +// Digimon Rumble Arena - IDC_GAMEFIX3 +#define FLAG_FPU_Compare 0x4 +//Tales of Destiny - IDC_GAMEFIX5 +#define FLAG_FPU_MUL 0x8 #define FLAG_VU_NO_OVERFLOW 0x2 #define FLAG_VU_EXTRA_OVERFLOW 0x40 diff --git a/pcsx2/Linux/callbacks.h b/pcsx2/Linux/callbacks.h index 1857e6594b..a70ca55935 100644 --- a/pcsx2/Linux/callbacks.h +++ b/pcsx2/Linux/callbacks.h @@ -109,30 +109,6 @@ void OnDebug_memWrite32 (GtkButton *button, gpointer user_data); -void -OnConfConf_Pad2Conf (GtkButton *button, - gpointer user_data); - -void -OnConfConf_Pad2Test (GtkButton *button, - gpointer user_data); - -void -OnConfConf_Pad2About (GtkButton *button, - gpointer user_data); - -void -OnConfConf_Pad1Conf (GtkButton *button, - gpointer user_data); - -void -OnConfConf_Pad1Test (GtkButton *button, - gpointer user_data); - -void -OnConfConf_Pad1About (GtkButton *button, - gpointer user_data); - void OnConfButton (GtkButton *button, gpointer user_data); diff --git a/pcsx2/Linux/interface.c b/pcsx2/Linux/interface.c index 08b6244487..d35247ad3b 100644 --- a/pcsx2/Linux/interface.c +++ b/pcsx2/Linux/interface.c @@ -104,132 +104,110 @@ create_AdvDlg (void) GtkWidget *button80; AdvDlg = gtk_dialog_new (); - gtk_widget_set_name (AdvDlg, "AdvDlg"); gtk_window_set_title (GTK_WINDOW (AdvDlg), _("Advanced Options")); gtk_window_set_type_hint (GTK_WINDOW (AdvDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox4 = GTK_DIALOG (AdvDlg)->vbox; - gtk_widget_set_name (dialog_vbox4, "dialog_vbox4"); gtk_widget_show (dialog_vbox4); hbox33 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox33, "hbox33"); gtk_widget_show (hbox33); gtk_box_pack_start (GTK_BOX (dialog_vbox4), hbox33, TRUE, TRUE, 0); vbox52 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox52, "vbox52"); gtk_widget_show (vbox52); gtk_box_pack_start (GTK_BOX (hbox33), vbox52, TRUE, TRUE, 0); frame24 = gtk_frame_new (NULL); - gtk_widget_set_name (frame24, "frame24"); gtk_widget_show (frame24); gtk_box_pack_start (GTK_BOX (vbox52), frame24, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame24), GTK_SHADOW_NONE); alignment19 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment19, "alignment19"); gtk_widget_show (alignment19); gtk_container_add (GTK_CONTAINER (frame24), alignment19); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment19), 0, 0, 12, 0); vbox53 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox53, "vbox53"); gtk_widget_show (vbox53); gtk_container_add (GTK_CONTAINER (alignment19), vbox53); frame26 = gtk_frame_new (NULL); - gtk_widget_set_name (frame26, "frame26"); gtk_widget_show (frame26); gtk_box_pack_start (GTK_BOX (vbox53), frame26, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame26), GTK_SHADOW_NONE); alignment21 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment21, "alignment21"); gtk_widget_show (alignment21); gtk_container_add (GTK_CONTAINER (frame26), alignment21); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment21), 0, 0, 12, 0); hbox35 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox35, "hbox35"); gtk_widget_show (hbox35); gtk_container_add (GTK_CONTAINER (alignment21), hbox35); radio_EE_Round_Near = gtk_radio_button_new_with_mnemonic (NULL, _("Nearest")); - gtk_widget_set_name (radio_EE_Round_Near, "radio_EE_Round_Near"); gtk_widget_show (radio_EE_Round_Near); gtk_box_pack_start (GTK_BOX (hbox35), radio_EE_Round_Near, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Round_Near), radio_EE_Round_Near_group); radio_EE_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Round_Near)); radio_EE_Round_Negative = gtk_radio_button_new_with_mnemonic (NULL, _("Negative")); - gtk_widget_set_name (radio_EE_Round_Negative, "radio_EE_Round_Negative"); gtk_widget_show (radio_EE_Round_Negative); gtk_box_pack_start (GTK_BOX (hbox35), radio_EE_Round_Negative, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Round_Negative), radio_EE_Round_Near_group); radio_EE_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Round_Negative)); radio_EE_Round_Positive = gtk_radio_button_new_with_mnemonic (NULL, _("Positive")); - gtk_widget_set_name (radio_EE_Round_Positive, "radio_EE_Round_Positive"); gtk_widget_show (radio_EE_Round_Positive); gtk_box_pack_start (GTK_BOX (hbox35), radio_EE_Round_Positive, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Round_Positive), radio_EE_Round_Near_group); radio_EE_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Round_Positive)); radio_EE_Round_Zero = gtk_radio_button_new_with_mnemonic (NULL, _("Chop/Zero")); - gtk_widget_set_name (radio_EE_Round_Zero, "radio_EE_Round_Zero"); gtk_widget_show (radio_EE_Round_Zero); gtk_box_pack_start (GTK_BOX (hbox35), radio_EE_Round_Zero, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Round_Zero), radio_EE_Round_Near_group); radio_EE_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Round_Zero)); label72 = gtk_label_new (_("Round Mode")); - gtk_widget_set_name (label72, "label72"); gtk_widget_show (label72); gtk_frame_set_label_widget (GTK_FRAME (frame26), label72); gtk_label_set_use_markup (GTK_LABEL (label72), TRUE); frame27 = gtk_frame_new (NULL); - gtk_widget_set_name (frame27, "frame27"); gtk_widget_show (frame27); gtk_box_pack_start (GTK_BOX (vbox53), frame27, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame27), GTK_SHADOW_NONE); alignment22 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment22, "alignment22"); gtk_widget_show (alignment22); gtk_container_add (GTK_CONTAINER (frame27), alignment22); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment22), 0, 0, 12, 0); hbox37 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox37, "hbox37"); gtk_widget_show (hbox37); gtk_container_add (GTK_CONTAINER (alignment22), hbox37); radio_EE_Clamp_None = gtk_radio_button_new_with_mnemonic (NULL, _("None")); - gtk_widget_set_name (radio_EE_Clamp_None, "radio_EE_Clamp_None"); gtk_widget_show (radio_EE_Clamp_None); gtk_box_pack_start (GTK_BOX (hbox37), radio_EE_Clamp_None, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Clamp_None), radio_EE_Clamp_None_group); radio_EE_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Clamp_None)); radio_EE_Clamp_Normal = gtk_radio_button_new_with_mnemonic (NULL, _("Normal")); - gtk_widget_set_name (radio_EE_Clamp_Normal, "radio_EE_Clamp_Normal"); gtk_widget_show (radio_EE_Clamp_Normal); gtk_box_pack_start (GTK_BOX (hbox37), radio_EE_Clamp_Normal, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Normal), radio_EE_Clamp_None_group); radio_EE_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Normal)); radio_EE_Clamp_Extra_Preserve = gtk_radio_button_new_with_mnemonic (NULL, _("Extra + Preserve Sign")); - gtk_widget_set_name (radio_EE_Clamp_Extra_Preserve, "radio_EE_Clamp_Extra_Preserve"); gtk_widget_show (radio_EE_Clamp_Extra_Preserve); gtk_box_pack_start (GTK_BOX (hbox37), radio_EE_Clamp_Extra_Preserve, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Extra_Preserve), radio_EE_Clamp_None_group); radio_EE_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Extra_Preserve)); radio_EE_Clamp_Full = gtk_radio_button_new_with_mnemonic (NULL, _("Full")); - gtk_widget_set_name (radio_EE_Clamp_Full, "radio_EE_Clamp_Full"); gtk_widget_show (radio_EE_Clamp_Full); gtk_box_pack_start (GTK_BOX (hbox37), radio_EE_Clamp_Full, TRUE, TRUE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Full), radio_EE_Clamp_None_group); @@ -237,158 +215,132 @@ create_AdvDlg (void) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_EE_Clamp_Full), TRUE); label73 = gtk_label_new (_("Clamp Mode")); - gtk_widget_set_name (label73, "label73"); gtk_widget_show (label73); gtk_frame_set_label_widget (GTK_FRAME (frame27), label73); gtk_label_set_use_markup (GTK_LABEL (label73), TRUE); hbox34 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox34, "hbox34"); gtk_widget_show (hbox34); gtk_box_pack_start (GTK_BOX (vbox53), hbox34, TRUE, TRUE, 0); check_EE_Flush_Zero = gtk_check_button_new_with_mnemonic (_("Flush to Zero")); - gtk_widget_set_name (check_EE_Flush_Zero, "check_EE_Flush_Zero"); gtk_widget_show (check_EE_Flush_Zero); gtk_box_pack_start (GTK_BOX (hbox34), check_EE_Flush_Zero, FALSE, FALSE, 0); check_EE_Denormal_Zero = gtk_check_button_new_with_mnemonic (_("Denormals are Zero")); - gtk_widget_set_name (check_EE_Denormal_Zero, "check_EE_Denormal_Zero"); gtk_widget_show (check_EE_Denormal_Zero); gtk_box_pack_start (GTK_BOX (hbox34), check_EE_Denormal_Zero, FALSE, FALSE, 0); label70 = gtk_label_new (_("EE Recs Options")); - gtk_widget_set_name (label70, "label70"); gtk_widget_show (label70); gtk_frame_set_label_widget (GTK_FRAME (frame24), label70); gtk_label_set_use_markup (GTK_LABEL (label70), TRUE); frame25 = gtk_frame_new (NULL); - gtk_widget_set_name (frame25, "frame25"); gtk_widget_show (frame25); gtk_box_pack_start (GTK_BOX (vbox52), frame25, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame25), GTK_SHADOW_NONE); alignment20 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment20, "alignment20"); gtk_widget_show (alignment20); gtk_container_add (GTK_CONTAINER (frame25), alignment20); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment20), 0, 0, 12, 0); vbox54 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox54, "vbox54"); gtk_widget_show (vbox54); gtk_container_add (GTK_CONTAINER (alignment20), vbox54); frame28 = gtk_frame_new (NULL); - gtk_widget_set_name (frame28, "frame28"); gtk_widget_show (frame28); gtk_box_pack_start (GTK_BOX (vbox54), frame28, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame28), GTK_SHADOW_NONE); alignment23 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment23, "alignment23"); gtk_widget_show (alignment23); gtk_container_add (GTK_CONTAINER (frame28), alignment23); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment23), 0, 0, 12, 0); hbox36 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox36, "hbox36"); gtk_widget_show (hbox36); gtk_container_add (GTK_CONTAINER (alignment23), hbox36); radio_VU_Round_Near = gtk_radio_button_new_with_mnemonic (NULL, _("Nearest")); - gtk_widget_set_name (radio_VU_Round_Near, "radio_VU_Round_Near"); gtk_widget_show (radio_VU_Round_Near); gtk_box_pack_start (GTK_BOX (hbox36), radio_VU_Round_Near, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Round_Near), radio_VU_Round_Near_group); radio_VU_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Round_Near)); radio_VU_Round_Negative = gtk_radio_button_new_with_mnemonic (NULL, _("Negative")); - gtk_widget_set_name (radio_VU_Round_Negative, "radio_VU_Round_Negative"); gtk_widget_show (radio_VU_Round_Negative); gtk_box_pack_start (GTK_BOX (hbox36), radio_VU_Round_Negative, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Round_Negative), radio_VU_Round_Near_group); radio_VU_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Round_Negative)); radio_VU_Round_Positive = gtk_radio_button_new_with_mnemonic (NULL, _("Positive")); - gtk_widget_set_name (radio_VU_Round_Positive, "radio_VU_Round_Positive"); gtk_widget_show (radio_VU_Round_Positive); gtk_box_pack_start (GTK_BOX (hbox36), radio_VU_Round_Positive, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Round_Positive), radio_VU_Round_Near_group); radio_VU_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Round_Positive)); radio_VU_Round_Zero = gtk_radio_button_new_with_mnemonic (NULL, _("Zero")); - gtk_widget_set_name (radio_VU_Round_Zero, "radio_VU_Round_Zero"); gtk_widget_show (radio_VU_Round_Zero); gtk_box_pack_start (GTK_BOX (hbox36), radio_VU_Round_Zero, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Round_Zero), radio_VU_Round_Near_group); radio_VU_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Round_Zero)); label74 = gtk_label_new (_("Round Mode")); - gtk_widget_set_name (label74, "label74"); gtk_widget_show (label74); gtk_frame_set_label_widget (GTK_FRAME (frame28), label74); gtk_label_set_use_markup (GTK_LABEL (label74), TRUE); frame29 = gtk_frame_new (NULL); - gtk_widget_set_name (frame29, "frame29"); gtk_widget_show (frame29); gtk_box_pack_start (GTK_BOX (vbox54), frame29, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame29), GTK_SHADOW_NONE); alignment24 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment24, "alignment24"); gtk_widget_show (alignment24); gtk_container_add (GTK_CONTAINER (frame29), alignment24); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment24), 0, 0, 12, 0); hbox38 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox38, "hbox38"); gtk_widget_show (hbox38); gtk_container_add (GTK_CONTAINER (alignment24), hbox38); radio_VU_Clamp_None = gtk_radio_button_new_with_mnemonic (NULL, _("None")); - gtk_widget_set_name (radio_VU_Clamp_None, "radio_VU_Clamp_None"); gtk_widget_show (radio_VU_Clamp_None); gtk_box_pack_start (GTK_BOX (hbox38), radio_VU_Clamp_None, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Clamp_None), radio_VU_Clamp_None_group); radio_VU_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Clamp_None)); radio_VU_Clamp_Normal = gtk_radio_button_new_with_mnemonic (NULL, _("Normal")); - gtk_widget_set_name (radio_VU_Clamp_Normal, "radio_VU_Clamp_Normal"); gtk_widget_show (radio_VU_Clamp_Normal); gtk_box_pack_start (GTK_BOX (hbox38), radio_VU_Clamp_Normal, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Normal), radio_VU_Clamp_None_group); radio_VU_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Normal)); radio_VU_Clamp_Extra = gtk_radio_button_new_with_mnemonic (NULL, _("Extra")); - gtk_widget_set_name (radio_VU_Clamp_Extra, "radio_VU_Clamp_Extra"); gtk_widget_show (radio_VU_Clamp_Extra); gtk_box_pack_start (GTK_BOX (hbox38), radio_VU_Clamp_Extra, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Extra), radio_VU_Clamp_None_group); radio_VU_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Extra)); radio_VU_Clamp_Extra_Preserve = gtk_radio_button_new_with_mnemonic (NULL, _("Extra + Preserve Sign")); - gtk_widget_set_name (radio_VU_Clamp_Extra_Preserve, "radio_VU_Clamp_Extra_Preserve"); gtk_widget_show (radio_VU_Clamp_Extra_Preserve); gtk_box_pack_start (GTK_BOX (hbox38), radio_VU_Clamp_Extra_Preserve, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Extra_Preserve), radio_VU_Clamp_None_group); radio_VU_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Extra_Preserve)); label75 = gtk_label_new (_("Clamp Mode")); - gtk_widget_set_name (label75, "label75"); gtk_widget_show (label75); gtk_frame_set_label_widget (GTK_FRAME (frame29), label75); gtk_label_set_use_markup (GTK_LABEL (label75), TRUE); table7 = gtk_table_new (2, 2, FALSE); - gtk_widget_set_name (table7, "table7"); gtk_widget_show (table7); gtk_box_pack_start (GTK_BOX (vbox54), table7, TRUE, TRUE, 0); check_Emulate_DaZ = gtk_check_button_new_with_mnemonic (_("Software Emulate DaZ")); - gtk_widget_set_name (check_Emulate_DaZ, "check_Emulate_DaZ"); gtk_widget_show (check_Emulate_DaZ); gtk_table_attach (GTK_TABLE (table7), check_Emulate_DaZ, 1, 2, 1, 2, (GtkAttachOptions) (0), @@ -396,7 +348,6 @@ create_AdvDlg (void) gtk_widget_set_sensitive (check_Emulate_DaZ, FALSE); Check_Set_OU_Flags = gtk_check_button_new_with_mnemonic (_("Set O & U Flags")); - gtk_widget_set_name (Check_Set_OU_Flags, "Check_Set_OU_Flags"); gtk_widget_show (Check_Set_OU_Flags); gtk_table_attach (GTK_TABLE (table7), Check_Set_OU_Flags, 0, 1, 1, 2, (GtkAttachOptions) (0), @@ -404,121 +355,101 @@ create_AdvDlg (void) gtk_widget_set_sensitive (Check_Set_OU_Flags, FALSE); check_VU_Denormal_Zero = gtk_check_button_new_with_mnemonic (_("Denormals are Zero")); - gtk_widget_set_name (check_VU_Denormal_Zero, "check_VU_Denormal_Zero"); gtk_widget_show (check_VU_Denormal_Zero); gtk_table_attach (GTK_TABLE (table7), check_VU_Denormal_Zero, 1, 2, 0, 1, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); check_VU_Flush_Zero = gtk_check_button_new_with_mnemonic (_("Flush to Zero")); - gtk_widget_set_name (check_VU_Flush_Zero, "check_VU_Flush_Zero"); gtk_widget_show (check_VU_Flush_Zero); gtk_table_attach (GTK_TABLE (table7), check_VU_Flush_Zero, 0, 1, 0, 1, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); label71 = gtk_label_new (_("VU Recs Options")); - gtk_widget_set_name (label71, "label71"); gtk_widget_show (label71); gtk_frame_set_label_widget (GTK_FRAME (frame25), label71); gtk_label_set_use_markup (GTK_LABEL (label71), TRUE); vbox51 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox51, "vbox51"); gtk_widget_show (vbox51); gtk_box_pack_start (GTK_BOX (hbox33), vbox51, TRUE, TRUE, 0); frame30 = gtk_frame_new (NULL); - gtk_widget_set_name (frame30, "frame30"); gtk_widget_show (frame30); gtk_box_pack_start (GTK_BOX (vbox51), frame30, FALSE, FALSE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame30), GTK_SHADOW_NONE); alignment25 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment25, "alignment25"); gtk_widget_show (alignment25); gtk_container_add (GTK_CONTAINER (frame30), alignment25); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment25), 0, 0, 12, 0); label81 = gtk_label_new (_("These options specify how your CPU rounds floating point values.\n\nTry changing the roundmode for EE if your game hangs, it could make it work again.")); - gtk_widget_set_name (label81, "label81"); gtk_widget_show (label81); gtk_container_add (GTK_CONTAINER (alignment25), label81); gtk_label_set_line_wrap (GTK_LABEL (label81), TRUE); label78 = gtk_label_new (_("Round Mode")); - gtk_widget_set_name (label78, "label78"); gtk_widget_show (label78); gtk_frame_set_label_widget (GTK_FRAME (frame30), label78); gtk_label_set_use_markup (GTK_LABEL (label78), TRUE); frame31 = gtk_frame_new (NULL); - gtk_widget_set_name (frame31, "frame31"); gtk_widget_show (frame31); gtk_box_pack_start (GTK_BOX (vbox51), frame31, FALSE, FALSE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame31), GTK_SHADOW_NONE); alignment26 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment26, "alignment26"); gtk_widget_show (alignment26); gtk_container_add (GTK_CONTAINER (frame31), alignment26); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment26), 0, 0, 12, 0); label84 = gtk_label_new (_("These options specify how PCSX2's recompilers will clamp Infinities and NaN (Not a Number) values in the opcode instructions.\n\nNone - No clamping. (Fastest Mode)\nNormal - Clamps the result.\nExtra - Clamps the operands, the result, and anywhere in between.\nExtra + Preserve Sign - Same as \"\"Extra\"\", except preserves NaN's sign when clamping the operands. (Slowest Mode)")); - gtk_widget_set_name (label84, "label84"); gtk_widget_show (label84); gtk_container_add (GTK_CONTAINER (alignment26), label84); gtk_label_set_line_wrap (GTK_LABEL (label84), TRUE); label79 = gtk_label_new (_("Clamp Mode")); - gtk_widget_set_name (label79, "label79"); gtk_widget_show (label79); gtk_frame_set_label_widget (GTK_FRAME (frame31), label79); gtk_label_set_use_markup (GTK_LABEL (label79), TRUE); frame32 = gtk_frame_new (NULL); - gtk_widget_set_name (frame32, "frame32"); gtk_widget_show (frame32); gtk_box_pack_start (GTK_BOX (vbox51), frame32, FALSE, FALSE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame32), GTK_SHADOW_NONE); alignment27 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment27, "alignment27"); gtk_widget_show (alignment27); gtk_container_add (GTK_CONTAINER (frame32), alignment27); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment27), 0, 0, 12, 0); label83 = gtk_label_new (_("Flush to Zero - Your CPU makes Floating Point Underflows become Zero, so it does less work. (Speed Up)\n\nDenormals are Zero - Your CPU makes Floating Point Denormals become Zero, so it does less work. (Speed Up)")); - gtk_widget_set_name (label83, "label83"); gtk_widget_show (label83); gtk_container_add (GTK_CONTAINER (alignment27), label83); gtk_label_set_line_wrap (GTK_LABEL (label83), TRUE); label80 = gtk_label_new (_("Other Options")); - gtk_widget_set_name (label80, "label80"); gtk_widget_show (label80); gtk_frame_set_label_widget (GTK_FRAME (frame32), label80); gtk_label_set_use_markup (GTK_LABEL (label80), TRUE); dialog_action_area4 = GTK_DIALOG (AdvDlg)->action_area; - gtk_widget_set_name (dialog_action_area4, "dialog_action_area4"); gtk_widget_show (dialog_action_area4); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area4), GTK_BUTTONBOX_SPREAD); AdvDefaultBtn = gtk_button_new_with_mnemonic (_("Defaults")); - gtk_widget_set_name (AdvDefaultBtn, "AdvDefaultBtn"); gtk_widget_show (AdvDefaultBtn); gtk_dialog_add_action_widget (GTK_DIALOG (AdvDlg), AdvDefaultBtn, 0); GTK_WIDGET_SET_FLAGS (AdvDefaultBtn, GTK_CAN_DEFAULT); button79 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button79, "button79"); gtk_widget_show (button79); gtk_dialog_add_action_widget (GTK_DIALOG (AdvDlg), button79, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (button79, GTK_CAN_DEFAULT); button80 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button80, "button80"); gtk_widget_show (button80); gtk_dialog_add_action_widget (GTK_DIALOG (AdvDlg), button80, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (button80, GTK_CAN_DEFAULT); @@ -646,191 +577,158 @@ create_SpeedHacksDlg (void) GtkWidget *button98; SpeedHacksDlg = gtk_dialog_new (); - gtk_widget_set_name (SpeedHacksDlg, "SpeedHacksDlg"); gtk_window_set_title (GTK_WINDOW (SpeedHacksDlg), _("PCSX2 Speed Hacks")); gtk_window_set_type_hint (GTK_WINDOW (SpeedHacksDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox3 = GTK_DIALOG (SpeedHacksDlg)->vbox; - gtk_widget_set_name (dialog_vbox3, "dialog_vbox3"); gtk_widget_show (dialog_vbox3); vbox59 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox59, "vbox59"); gtk_widget_show (vbox59); gtk_box_pack_start (GTK_BOX (dialog_vbox3), vbox59, FALSE, FALSE, 0); label88 = gtk_label_new (_("These hacks will affect the speed of PCSX2 but possibly compromise compatibility.\nIf you have problems, Disable all of these and try again.")); - gtk_widget_set_name (label88, "label88"); gtk_widget_show (label88); gtk_box_pack_start (GTK_BOX (vbox59), label88, FALSE, FALSE, 0); hbox39 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox39, "hbox39"); gtk_widget_show (hbox39); gtk_box_pack_start (GTK_BOX (vbox59), hbox39, TRUE, TRUE, 0); frame37 = gtk_frame_new (NULL); - gtk_widget_set_name (frame37, "frame37"); gtk_widget_show (frame37); gtk_box_pack_start (GTK_BOX (hbox39), frame37, TRUE, TRUE, 0); alignment32 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment32, "alignment32"); gtk_widget_show (alignment32); gtk_container_add (GTK_CONTAINER (frame37), alignment32); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment32), 0, 0, 12, 0); vbox61 = gtk_vbox_new (FALSE, 2); - gtk_widget_set_name (vbox61, "vbox61"); gtk_widget_show (vbox61); gtk_container_add (GTK_CONTAINER (alignment32), vbox61); check_default_cycle_rate = gtk_radio_button_new_with_mnemonic (NULL, _("Default Cycle Rate")); - gtk_widget_set_name (check_default_cycle_rate, "check_default_cycle_rate"); gtk_widget_show (check_default_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox61), check_default_cycle_rate, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (check_default_cycle_rate), check_default_cycle_rate_group); check_default_cycle_rate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (check_default_cycle_rate)); label98 = gtk_label_new (_("Most compatible option - recommended for everyone with high-end machines.")); - gtk_widget_set_name (label98, "label98"); gtk_widget_show (label98); gtk_box_pack_start (GTK_BOX (vbox61), label98, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label98), TRUE); gtk_misc_set_alignment (GTK_MISC (label98), 0.29, 0.5); check_1_5_cycle_rate = gtk_radio_button_new_with_mnemonic (NULL, _("Use x1.5 Cycle Rate")); - gtk_widget_set_name (check_1_5_cycle_rate, "check_1_5_cycle_rate"); gtk_widget_show (check_1_5_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox61), check_1_5_cycle_rate, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (check_1_5_cycle_rate), check_default_cycle_rate_group); check_default_cycle_rate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (check_1_5_cycle_rate)); label93 = gtk_label_new (_("Moderate speedup, and works well with most games.")); - gtk_widget_set_name (label93, "label93"); gtk_widget_show (label93); gtk_box_pack_start (GTK_BOX (vbox61), label93, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label93), TRUE); gtk_misc_set_alignment (GTK_MISC (label93), 0.29, 0.5); check_2_cycle_rate = gtk_radio_button_new_with_mnemonic (NULL, _("Use x2 Cycle Rate")); - gtk_widget_set_name (check_2_cycle_rate, "check_2_cycle_rate"); gtk_widget_show (check_2_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox61), check_2_cycle_rate, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (check_2_cycle_rate), check_default_cycle_rate_group); check_default_cycle_rate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (check_2_cycle_rate)); label94 = gtk_label_new (_("Big speedup! Works well with many games.")); - gtk_widget_set_name (label94, "label94"); gtk_widget_show (label94); gtk_box_pack_start (GTK_BOX (vbox61), label94, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label94), TRUE); gtk_misc_set_alignment (GTK_MISC (label94), 0.36, 0.5); check_3_cycle_rate = gtk_radio_button_new_with_mnemonic (NULL, _("Use x3 Cycle Rate")); - gtk_widget_set_name (check_3_cycle_rate, "check_3_cycle_rate"); gtk_widget_show (check_3_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox61), check_3_cycle_rate, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (check_3_cycle_rate), check_default_cycle_rate_group); check_default_cycle_rate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (check_3_cycle_rate)); label95 = gtk_label_new (_("Big speedup, but causes flickering or missing geometry on many games.")); - gtk_widget_set_name (label95, "label95"); gtk_widget_show (label95); gtk_box_pack_start (GTK_BOX (vbox61), label95, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label95), TRUE); gtk_misc_set_alignment (GTK_MISC (label95), 0.24, 0.5); hseparator1 = gtk_hseparator_new (); - gtk_widget_set_name (hseparator1, "hseparator1"); gtk_widget_show (hseparator1); gtk_box_pack_start (GTK_BOX (vbox61), hseparator1, FALSE, FALSE, 0); label91 = gtk_label_new (_("Important: X2 & X3 sync hacks *will* cause choppy/skippy audio on many FMV movies.\nKnown to work well with a couple games, namely Shadow of the Colossus (but breaks most other games).")); - gtk_widget_set_name (label91, "label91"); gtk_widget_show (label91); gtk_box_pack_start (GTK_BOX (vbox61), label91, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label91), TRUE); label105 = gtk_label_new (_("EmotionEngine (EE) Sync Hacks")); - gtk_widget_set_name (label105, "label105"); gtk_widget_show (label105); gtk_frame_set_label_widget (GTK_FRAME (frame37), label105); gtk_label_set_use_markup (GTK_LABEL (label105), TRUE); vbox60 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox60, "vbox60"); gtk_widget_show (vbox60); gtk_box_pack_start (GTK_BOX (hbox39), vbox60, FALSE, FALSE, 0); check_iop_cycle_rate = gtk_check_button_new_with_mnemonic (_("Enable IOP x2 Cycle Rate")); - gtk_widget_set_name (check_iop_cycle_rate, "check_iop_cycle_rate"); gtk_widget_show (check_iop_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox60), check_iop_cycle_rate, FALSE, FALSE, 0); label96 = gtk_label_new (_("Small speedup, and works well with most games,")); - gtk_widget_set_name (label96, "label96"); gtk_widget_show (label96); gtk_box_pack_start (GTK_BOX (vbox60), label96, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label96), TRUE); check_wait_cycles_sync_hack = gtk_check_button_new_with_mnemonic (_("WaitCycles Sync Hack")); - gtk_widget_set_name (check_wait_cycles_sync_hack, "check_wait_cycles_sync_hack"); gtk_widget_show (check_wait_cycles_sync_hack); gtk_box_pack_start (GTK_BOX (vbox60), check_wait_cycles_sync_hack, FALSE, FALSE, 0); label97 = gtk_label_new (_("Small speedup. Works well with most games, but it may cause certain games to crash, or freeze up during bootup or stage changes.")); - gtk_widget_set_name (label97, "label97"); gtk_widget_show (label97); gtk_box_pack_start (GTK_BOX (vbox60), label97, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label97), TRUE); check_intc_sync_hack = gtk_check_button_new_with_mnemonic (_("INTC Sync Hack (experimental)")); - gtk_widget_set_name (check_intc_sync_hack, "check_intc_sync_hack"); gtk_widget_show (check_intc_sync_hack); gtk_box_pack_start (GTK_BOX (vbox60), check_intc_sync_hack, FALSE, FALSE, 0); label101 = gtk_label_new (_("Huge speedup in many games, and a pretty high compatibility rate (some games still work better with EE sync hacks).")); - gtk_widget_set_name (label101, "label101"); gtk_widget_show (label101); gtk_box_pack_start (GTK_BOX (vbox60), label101, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label101), TRUE); frame36 = gtk_frame_new (NULL); - gtk_widget_set_name (frame36, "frame36"); gtk_widget_show (frame36); gtk_box_pack_start (GTK_BOX (vbox59), frame36, FALSE, FALSE, 0); alignment31 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment31, "alignment31"); gtk_widget_show (alignment31); gtk_container_add (GTK_CONTAINER (frame36), alignment31); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment31), 0, 0, 12, 0); check_ESC_hack = gtk_check_button_new_with_mnemonic (_("Escape Hack - Use Esc key to fully exit PCSX2.")); - gtk_widget_set_name (check_ESC_hack, "check_ESC_hack"); gtk_widget_show (check_ESC_hack); gtk_container_add (GTK_CONTAINER (alignment31), check_ESC_hack); label89 = gtk_label_new (_("Miscellaneous")); - gtk_widget_set_name (label89, "label89"); gtk_widget_show (label89); gtk_frame_set_label_widget (GTK_FRAME (frame36), label89); gtk_label_set_use_markup (GTK_LABEL (label89), TRUE); dialog_action_area3 = GTK_DIALOG (SpeedHacksDlg)->action_area; - gtk_widget_set_name (dialog_action_area3, "dialog_action_area3"); gtk_widget_show (dialog_action_area3); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area3), GTK_BUTTONBOX_END); button99 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button99, "button99"); gtk_widget_show (button99); gtk_dialog_add_action_widget (GTK_DIALOG (SpeedHacksDlg), button99, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (button99, GTK_CAN_DEFAULT); button98 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button98, "button98"); gtk_widget_show (button98); gtk_dialog_add_action_widget (GTK_DIALOG (SpeedHacksDlg), button98, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (button98, GTK_CAN_DEFAULT); @@ -888,74 +786,62 @@ create_GameFixDlg (void) GtkWidget *GameSettings; GtkWidget *alignment5; GtkWidget *vbox30; - GtkWidget *check_FPU_Clamp; + GtkWidget *check_FPU_Compare; GtkWidget *check_VU_Add_Sub; - GtkWidget *check_VU_Clip; + GtkWidget *check_FPU_Mul; GtkWidget *label42; GtkWidget *dialog_action_area1; GtkWidget *cancelbutton1; GtkWidget *button83; GameFixDlg = gtk_dialog_new (); - gtk_widget_set_name (GameFixDlg, "GameFixDlg"); gtk_window_set_title (GTK_WINDOW (GameFixDlg), _("Game Special Fixes")); gtk_window_set_type_hint (GTK_WINDOW (GameFixDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox1 = GTK_DIALOG (GameFixDlg)->vbox; - gtk_widget_set_name (dialog_vbox1, "dialog_vbox1"); gtk_widget_show (dialog_vbox1); GameSettings = gtk_frame_new (NULL); - gtk_widget_set_name (GameSettings, "GameSettings"); gtk_widget_show (GameSettings); gtk_box_pack_start (GTK_BOX (dialog_vbox1), GameSettings, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (GameSettings), GTK_SHADOW_NONE); alignment5 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment5, "alignment5"); gtk_widget_show (alignment5); gtk_container_add (GTK_CONTAINER (GameSettings), alignment5); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment5), 0, 0, 12, 0); vbox30 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox30, "vbox30"); gtk_widget_show (vbox30); gtk_container_add (GTK_CONTAINER (alignment5), vbox30); - check_FPU_Clamp = gtk_check_button_new_with_mnemonic (_("FPU Clamp Hack - Special fix for Tekken 5 and maybe other games.")); - gtk_widget_set_name (check_FPU_Clamp, "check_FPU_Clamp"); - gtk_widget_show (check_FPU_Clamp); - gtk_box_pack_start (GTK_BOX (vbox30), check_FPU_Clamp, FALSE, FALSE, 0); + check_FPU_Compare = gtk_check_button_new_with_mnemonic (_("FPU Compare Hack - Special fix for Digimon Rumble Arena 2.")); + gtk_widget_show (check_FPU_Compare); + gtk_box_pack_start (GTK_BOX (vbox30), check_FPU_Compare, FALSE, FALSE, 0); check_VU_Add_Sub = gtk_check_button_new_with_mnemonic (_("VU Add / Sub Hack - Special fix for Tri-Ace games!")); - gtk_widget_set_name (check_VU_Add_Sub, "check_VU_Add_Sub"); gtk_widget_show (check_VU_Add_Sub); gtk_box_pack_start (GTK_BOX (vbox30), check_VU_Add_Sub, FALSE, FALSE, 0); - check_VU_Clip = gtk_check_button_new_with_mnemonic (_("VU Clip Hack - Special fix for God of War")); - gtk_widget_set_name (check_VU_Clip, "check_VU_Clip"); - gtk_widget_show (check_VU_Clip); - gtk_box_pack_start (GTK_BOX (vbox30), check_VU_Clip, FALSE, TRUE, 0); + check_FPU_Mul = gtk_check_button_new_with_mnemonic (_("FPU Mul Hack - Special fix for Tales of Destiny (possibly other games).")); + gtk_widget_show (check_FPU_Mul); + gtk_box_pack_start (GTK_BOX (vbox30), check_FPU_Mul, FALSE, TRUE, 0); label42 = gtk_label_new (_("Some games need special settings.\nConfigure them here.")); - gtk_widget_set_name (label42, "label42"); gtk_widget_show (label42); gtk_frame_set_label_widget (GTK_FRAME (GameSettings), label42); gtk_label_set_use_markup (GTK_LABEL (label42), TRUE); dialog_action_area1 = GTK_DIALOG (GameFixDlg)->action_area; - gtk_widget_set_name (dialog_action_area1, "dialog_action_area1"); gtk_widget_show (dialog_action_area1); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); cancelbutton1 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (cancelbutton1, "cancelbutton1"); gtk_widget_show (cancelbutton1); gtk_dialog_add_action_widget (GTK_DIALOG (GameFixDlg), cancelbutton1, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT); button83 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button83, "button83"); gtk_widget_show (button83); gtk_dialog_add_action_widget (GTK_DIALOG (GameFixDlg), button83, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (button83, GTK_CAN_DEFAULT); @@ -973,9 +859,9 @@ create_GameFixDlg (void) GLADE_HOOKUP_OBJECT (GameFixDlg, GameSettings, "GameSettings"); GLADE_HOOKUP_OBJECT (GameFixDlg, alignment5, "alignment5"); GLADE_HOOKUP_OBJECT (GameFixDlg, vbox30, "vbox30"); - GLADE_HOOKUP_OBJECT (GameFixDlg, check_FPU_Clamp, "check_FPU_Clamp"); + GLADE_HOOKUP_OBJECT (GameFixDlg, check_FPU_Compare, "check_FPU_Compare"); GLADE_HOOKUP_OBJECT (GameFixDlg, check_VU_Add_Sub, "check_VU_Add_Sub"); - GLADE_HOOKUP_OBJECT (GameFixDlg, check_VU_Clip, "check_VU_Clip"); + GLADE_HOOKUP_OBJECT (GameFixDlg, check_FPU_Mul, "check_FPU_Mul"); GLADE_HOOKUP_OBJECT (GameFixDlg, label42, "label42"); GLADE_HOOKUP_OBJECT_NO_REF (GameFixDlg, dialog_action_area1, "dialog_action_area1"); GLADE_HOOKUP_OBJECT (GameFixDlg, cancelbutton1, "cancelbutton1"); @@ -1002,78 +888,65 @@ create_MemWrite32 (void) GtkWidget *button72; MemWrite32 = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (MemWrite32, "MemWrite32"); gtk_container_set_border_width (GTK_CONTAINER (MemWrite32), 5); gtk_window_set_title (GTK_WINDOW (MemWrite32), _("memWrite32")); vbox25 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox25, "vbox25"); gtk_widget_show (vbox25); gtk_container_add (GTK_CONTAINER (MemWrite32), vbox25); gtk_container_set_border_width (GTK_CONTAINER (vbox25), 5); hbox18 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox18, "hbox18"); gtk_widget_show (hbox18); gtk_box_pack_start (GTK_BOX (vbox25), hbox18, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox18), 5); label27 = gtk_label_new (_("Address ")); - gtk_widget_set_name (label27, "label27"); gtk_widget_show (label27); gtk_box_pack_start (GTK_BOX (hbox18), label27, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label27), GTK_JUSTIFY_CENTER); label25 = gtk_label_new (_("0x")); - gtk_widget_set_name (label25, "label25"); gtk_widget_show (label25); gtk_box_pack_start (GTK_BOX (hbox18), label25, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label25), GTK_JUSTIFY_CENTER); GtkEntry_Mem = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_Mem, "GtkEntry_Mem"); gtk_widget_show (GtkEntry_Mem); gtk_box_pack_start (GTK_BOX (hbox18), GtkEntry_Mem, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_Mem), 8226); hbox19 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox19, "hbox19"); gtk_widget_show (hbox19); gtk_box_pack_start (GTK_BOX (vbox25), hbox19, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox19), 5); label28 = gtk_label_new (_("Data ")); - gtk_widget_set_name (label28, "label28"); gtk_widget_show (label28); gtk_box_pack_start (GTK_BOX (hbox19), label28, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label28), GTK_JUSTIFY_CENTER); label26 = gtk_label_new (_("0x")); - gtk_widget_set_name (label26, "label26"); gtk_widget_show (label26); gtk_box_pack_start (GTK_BOX (hbox19), label26, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label26), GTK_JUSTIFY_CENTER); GtkEntry_Data = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_Data, "GtkEntry_Data"); gtk_widget_show (GtkEntry_Data); gtk_box_pack_start (GTK_BOX (hbox19), GtkEntry_Data, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_Data), 8226); hbuttonbox22 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox22, "hbuttonbox22"); gtk_widget_show (hbuttonbox22); gtk_box_pack_start (GTK_BOX (vbox25), hbuttonbox22, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox22), 30); button71 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button71, "button71"); gtk_widget_show (button71); gtk_container_add (GTK_CONTAINER (hbuttonbox22), button71); GTK_WIDGET_SET_FLAGS (button71, GTK_CAN_DEFAULT); button72 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button72, "button72"); gtk_widget_show (button72); gtk_container_add (GTK_CONTAINER (hbuttonbox22), button72); GTK_WIDGET_SET_FLAGS (button72, GTK_CAN_DEFAULT); @@ -1120,57 +993,48 @@ create_CmdLine (void) tooltips = gtk_tooltips_new (); CmdLine = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (CmdLine, "CmdLine"); gtk_container_set_border_width (GTK_CONTAINER (CmdLine), 5); gtk_window_set_title (GTK_WINDOW (CmdLine), _("Program arguments")); gtk_window_set_modal (GTK_WINDOW (CmdLine), TRUE); vbox24 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox24, "vbox24"); gtk_widget_show (vbox24); gtk_container_add (GTK_CONTAINER (CmdLine), vbox24); gtk_container_set_border_width (GTK_CONTAINER (vbox24), 5); GtkLabel_Text = gtk_label_new (_("Fill in the command line arguments for the opened program:")); - gtk_widget_set_name (GtkLabel_Text, "GtkLabel_Text"); gtk_widget_show (GtkLabel_Text); gtk_box_pack_start (GTK_BOX (vbox24), GtkLabel_Text, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkLabel_Text), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (GtkLabel_Text), 0.1, 0.5); hbox17 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox17, "hbox17"); gtk_widget_show (hbox17); gtk_box_pack_start (GTK_BOX (vbox24), hbox17, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox17), 5); GtkEntry_dCMDLINE = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_dCMDLINE, "GtkEntry_dCMDLINE"); gtk_widget_show (GtkEntry_dCMDLINE); gtk_box_pack_start (GTK_BOX (hbox17), GtkEntry_dCMDLINE, TRUE, TRUE, 0); gtk_tooltips_set_tip (tooltips, GtkEntry_dCMDLINE, _("If you don't know what to write leave it blank"), NULL); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_dCMDLINE), 8226); GtkLabel_Note = gtk_label_new (_("Note: this is intended for developers only.")); - gtk_widget_set_name (GtkLabel_Note, "GtkLabel_Note"); gtk_widget_show (GtkLabel_Note); gtk_box_pack_start (GTK_BOX (vbox24), GtkLabel_Note, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkLabel_Note), GTK_JUSTIFY_CENTER); hbuttonbox20 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox20, "hbuttonbox20"); gtk_widget_show (hbuttonbox20); gtk_box_pack_start (GTK_BOX (vbox24), hbuttonbox20, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox20), 30); GtkButton_Ok3 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (GtkButton_Ok3, "GtkButton_Ok3"); gtk_widget_show (GtkButton_Ok3); gtk_container_add (GTK_CONTAINER (hbuttonbox20), GtkButton_Ok3); GTK_WIDGET_SET_FLAGS (GtkButton_Ok3, GTK_CAN_DEFAULT); GtkButton_Cancel2 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (GtkButton_Cancel2, "GtkButton_Cancel2"); gtk_widget_show (GtkButton_Cancel2); gtk_container_add (GTK_CONTAINER (hbuttonbox20), GtkButton_Cancel2); GTK_WIDGET_SET_FLAGS (GtkButton_Cancel2, GTK_CAN_DEFAULT); @@ -1215,79 +1079,66 @@ create_DumpRDlg (void) GtkWidget *button51; DumpRDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (DumpRDlg, "DumpRDlg"); gtk_container_set_border_width (GTK_CONTAINER (DumpRDlg), 5); gtk_window_set_title (GTK_WINDOW (DumpRDlg), _("Raw Dump")); vbox21 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox21, "vbox21"); gtk_widget_show (vbox21); gtk_container_add (GTK_CONTAINER (DumpRDlg), vbox21); gtk_container_set_border_width (GTK_CONTAINER (vbox21), 5); label18 = gtk_label_new (_("Set Dump Addr (in Hex):")); - gtk_widget_set_name (label18, "label18"); gtk_widget_show (label18); gtk_box_pack_start (GTK_BOX (vbox21), label18, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label18), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (label18), 0.1, 0.5); hbox13 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox13, "hbox13"); gtk_widget_show (hbox13); gtk_box_pack_start (GTK_BOX (vbox21), hbox13, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox13), 5); label19 = gtk_label_new (_("From 0x")); - gtk_widget_set_name (label19, "label19"); gtk_widget_show (label19); gtk_box_pack_start (GTK_BOX (hbox13), label19, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label19), GTK_JUSTIFY_CENTER); gtk_label_set_line_wrap (GTK_LABEL (label19), TRUE); GtkEntry_DumpRF = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_DumpRF, "GtkEntry_DumpRF"); gtk_widget_show (GtkEntry_DumpRF); gtk_box_pack_start (GTK_BOX (hbox13), GtkEntry_DumpRF, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_DumpRF), 8226); hbox14 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox14, "hbox14"); gtk_widget_show (hbox14); gtk_box_pack_start (GTK_BOX (vbox21), hbox14, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox14), 5); label20 = gtk_label_new (_("To 0x")); - gtk_widget_set_name (label20, "label20"); gtk_widget_show (label20); gtk_box_pack_start (GTK_BOX (hbox14), label20, FALSE, FALSE, 0); GtkEntry_DumpRT = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_DumpRT, "GtkEntry_DumpRT"); gtk_widget_show (GtkEntry_DumpRT); gtk_box_pack_start (GTK_BOX (hbox14), GtkEntry_DumpRT, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_DumpRT), 8226); label22 = gtk_label_new (_("Dump File = \"dump.txt\"")); - gtk_widget_set_name (label22, "label22"); gtk_widget_show (label22); gtk_box_pack_start (GTK_BOX (vbox21), label22, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (label22), 0.1, 0.5); hbuttonbox18 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox18, "hbuttonbox18"); gtk_widget_show (hbuttonbox18); gtk_box_pack_start (GTK_BOX (vbox21), hbuttonbox18, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox18), 30); button50 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button50, "button50"); gtk_widget_show (button50); gtk_container_add (GTK_CONTAINER (hbuttonbox18), button50); GTK_WIDGET_SET_FLAGS (button50, GTK_CAN_DEFAULT); button51 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button51, "button51"); gtk_widget_show (button51); gtk_container_add (GTK_CONTAINER (hbuttonbox18), button51); GTK_WIDGET_SET_FLAGS (button51, GTK_CAN_DEFAULT); @@ -1335,79 +1186,66 @@ create_DumpCDlg (void) GtkWidget *button49; DumpCDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (DumpCDlg, "DumpCDlg"); gtk_container_set_border_width (GTK_CONTAINER (DumpCDlg), 5); gtk_window_set_title (GTK_WINDOW (DumpCDlg), _("Dump code")); vbox20 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox20, "vbox20"); gtk_widget_show (vbox20); gtk_container_add (GTK_CONTAINER (DumpCDlg), vbox20); gtk_container_set_border_width (GTK_CONTAINER (vbox20), 5); label15 = gtk_label_new (_("Set Dump Addr (in Hex):")); - gtk_widget_set_name (label15, "label15"); gtk_widget_show (label15); gtk_box_pack_start (GTK_BOX (vbox20), label15, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (label15), 0.1, 0.5); hbox11 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox11, "hbox11"); gtk_widget_show (hbox11); gtk_box_pack_start (GTK_BOX (vbox20), hbox11, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox11), 5); label16 = gtk_label_new (_("From 0x")); - gtk_widget_set_name (label16, "label16"); gtk_widget_show (label16); gtk_box_pack_start (GTK_BOX (hbox11), label16, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_CENTER); gtk_label_set_line_wrap (GTK_LABEL (label16), TRUE); GtkEntry_DumpCF = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_DumpCF, "GtkEntry_DumpCF"); gtk_widget_show (GtkEntry_DumpCF); gtk_box_pack_start (GTK_BOX (hbox11), GtkEntry_DumpCF, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_DumpCF), 8226); hbox12 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox12, "hbox12"); gtk_widget_show (hbox12); gtk_box_pack_start (GTK_BOX (vbox20), hbox12, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox12), 5); label17 = gtk_label_new (_("To 0x")); - gtk_widget_set_name (label17, "label17"); gtk_widget_show (label17); gtk_box_pack_start (GTK_BOX (hbox12), label17, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label17), GTK_JUSTIFY_CENTER); GtkEntry_DumpCT = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_DumpCT, "GtkEntry_DumpCT"); gtk_widget_show (GtkEntry_DumpCT); gtk_box_pack_start (GTK_BOX (hbox12), GtkEntry_DumpCT, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_DumpCT), 8226); label21 = gtk_label_new (_("Dump File = \"dump.txt\"")); - gtk_widget_set_name (label21, "label21"); gtk_widget_show (label21); gtk_box_pack_start (GTK_BOX (vbox20), label21, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (label21), 0.1, 0.5); hbuttonbox17 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox17, "hbuttonbox17"); gtk_widget_show (hbuttonbox17); gtk_box_pack_start (GTK_BOX (vbox20), hbuttonbox17, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox17), 30); button48 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button48, "button48"); gtk_widget_show (button48); gtk_container_add (GTK_CONTAINER (hbuttonbox17), button48); GTK_WIDGET_SET_FLAGS (button48, GTK_CAN_DEFAULT); button49 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button49, "button49"); gtk_widget_show (button49); gtk_container_add (GTK_CONTAINER (hbuttonbox17), button49); GTK_WIDGET_SET_FLAGS (button49, GTK_CAN_DEFAULT); @@ -1451,55 +1289,46 @@ create_SetBPCDlg (void) GtkWidget *button47; SetBPCDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (SetBPCDlg, "SetBPCDlg"); gtk_container_set_border_width (GTK_CONTAINER (SetBPCDlg), 5); gtk_window_set_title (GTK_WINDOW (SetBPCDlg), _("SetBreakPoint Addr")); vbox19 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox19, "vbox19"); gtk_widget_show (vbox19); gtk_container_add (GTK_CONTAINER (SetBPCDlg), vbox19); gtk_container_set_border_width (GTK_CONTAINER (vbox19), 5); label13 = gtk_label_new (_("Set New BP Count (in Hex):")); - gtk_widget_set_name (label13, "label13"); gtk_widget_show (label13); gtk_box_pack_start (GTK_BOX (vbox19), label13, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label13), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (label13), 0.1, 0.5); hbox10 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox10, "hbox10"); gtk_widget_show (hbox10); gtk_box_pack_start (GTK_BOX (vbox19), hbox10, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox10), 5); label14 = gtk_label_new (_("0x")); - gtk_widget_set_name (label14, "label14"); gtk_widget_show (label14); gtk_box_pack_start (GTK_BOX (hbox10), label14, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label14), GTK_JUSTIFY_CENTER); GtkEntry_BPC = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_BPC, "GtkEntry_BPC"); gtk_widget_show (GtkEntry_BPC); gtk_box_pack_start (GTK_BOX (hbox10), GtkEntry_BPC, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_BPC), 8226); hbuttonbox16 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox16, "hbuttonbox16"); gtk_widget_show (hbuttonbox16); gtk_box_pack_start (GTK_BOX (vbox19), hbuttonbox16, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox16), 30); button46 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button46, "button46"); gtk_widget_show (button46); gtk_container_add (GTK_CONTAINER (hbuttonbox16), button46); GTK_WIDGET_SET_FLAGS (button46, GTK_CAN_DEFAULT); button47 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button47, "button47"); gtk_widget_show (button47); gtk_container_add (GTK_CONTAINER (hbuttonbox16), button47); GTK_WIDGET_SET_FLAGS (button47, GTK_CAN_DEFAULT); @@ -1539,55 +1368,46 @@ create_SetBPADlg (void) GtkWidget *button45; SetBPADlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (SetBPADlg, "SetBPADlg"); gtk_container_set_border_width (GTK_CONTAINER (SetBPADlg), 5); gtk_window_set_title (GTK_WINDOW (SetBPADlg), _("SetBreakPoint Addr")); vbox18 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox18, "vbox18"); gtk_widget_show (vbox18); gtk_container_add (GTK_CONTAINER (SetBPADlg), vbox18); gtk_container_set_border_width (GTK_CONTAINER (vbox18), 5); label11 = gtk_label_new (_("Set New BP Address (in Hex):")); - gtk_widget_set_name (label11, "label11"); gtk_widget_show (label11); gtk_box_pack_start (GTK_BOX (vbox18), label11, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label11), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (label11), 0.1, 0.5); hbox9 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox9, "hbox9"); gtk_widget_show (hbox9); gtk_box_pack_start (GTK_BOX (vbox18), hbox9, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox9), 5); label12 = gtk_label_new (_("0x")); - gtk_widget_set_name (label12, "label12"); gtk_widget_show (label12); gtk_box_pack_start (GTK_BOX (hbox9), label12, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label12), GTK_JUSTIFY_CENTER); GtkEntry_BPA = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_BPA, "GtkEntry_BPA"); gtk_widget_show (GtkEntry_BPA); gtk_box_pack_start (GTK_BOX (hbox9), GtkEntry_BPA, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_BPA), 8226); hbuttonbox15 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox15, "hbuttonbox15"); gtk_widget_show (hbuttonbox15); gtk_box_pack_start (GTK_BOX (vbox18), hbuttonbox15, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox15), 30); button44 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button44, "button44"); gtk_widget_show (button44); gtk_container_add (GTK_CONTAINER (hbuttonbox15), button44); GTK_WIDGET_SET_FLAGS (button44, GTK_CAN_DEFAULT); button45 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button45, "button45"); gtk_widget_show (button45); gtk_container_add (GTK_CONTAINER (hbuttonbox15), button45); GTK_WIDGET_SET_FLAGS (button45, GTK_CAN_DEFAULT); @@ -1627,55 +1447,46 @@ create_SetPCDlg (void) GtkWidget *button43; SetPCDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (SetPCDlg, "SetPCDlg"); gtk_container_set_border_width (GTK_CONTAINER (SetPCDlg), 5); gtk_window_set_title (GTK_WINDOW (SetPCDlg), _("SetPCDlg")); vbox17 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox17, "vbox17"); gtk_widget_show (vbox17); gtk_container_add (GTK_CONTAINER (SetPCDlg), vbox17); gtk_container_set_border_width (GTK_CONTAINER (vbox17), 5); label9 = gtk_label_new (_("Set New PC Address (in Hex):")); - gtk_widget_set_name (label9, "label9"); gtk_widget_show (label9); gtk_box_pack_start (GTK_BOX (vbox17), label9, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (label9), 0.1, 0.5); hbox8 = gtk_hbox_new (FALSE, 2); - gtk_widget_set_name (hbox8, "hbox8"); gtk_widget_show (hbox8); gtk_box_pack_start (GTK_BOX (vbox17), hbox8, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox8), 5); label10 = gtk_label_new (_("0x")); - gtk_widget_set_name (label10, "label10"); gtk_widget_show (label10); gtk_box_pack_start (GTK_BOX (hbox8), label10, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_CENTER); GtkEntry_dPC = gtk_entry_new (); - gtk_widget_set_name (GtkEntry_dPC, "GtkEntry_dPC"); gtk_widget_show (GtkEntry_dPC); gtk_box_pack_start (GTK_BOX (hbox8), GtkEntry_dPC, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_dPC), 8226); hbuttonbox14 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox14, "hbuttonbox14"); gtk_widget_show (hbuttonbox14); gtk_box_pack_start (GTK_BOX (vbox17), hbuttonbox14, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox14), 30); button42 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button42, "button42"); gtk_widget_show (button42); gtk_container_add (GTK_CONTAINER (hbuttonbox14), button42); GTK_WIDGET_SET_FLAGS (button42, GTK_CAN_DEFAULT); button43 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button43, "button43"); gtk_widget_show (button43); gtk_container_add (GTK_CONTAINER (hbuttonbox14), button43); GTK_WIDGET_SET_FLAGS (button43, GTK_CAN_DEFAULT); @@ -1735,164 +1546,136 @@ create_DebugWnd (void) GtkWidget *button68; DebugWnd = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (DebugWnd, "DebugWnd"); gtk_container_set_border_width (GTK_CONTAINER (DebugWnd), 5); gtk_window_set_title (GTK_WINDOW (DebugWnd), _("PCSX2 Debugger")); vbox16 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox16, "vbox16"); gtk_widget_show (vbox16); gtk_container_add (GTK_CONTAINER (DebugWnd), vbox16); gtk_container_set_border_width (GTK_CONTAINER (vbox16), 5); hbox16 = gtk_hbox_new (FALSE, 5); - gtk_widget_set_name (hbox16, "hbox16"); gtk_widget_show (hbox16); gtk_box_pack_start (GTK_BOX (vbox16), hbox16, FALSE, TRUE, 0); GtkRadioButton_EE = gtk_radio_button_new_with_mnemonic (NULL, _("EE Debug Mode")); - gtk_widget_set_name (GtkRadioButton_EE, "GtkRadioButton_EE"); gtk_widget_show (GtkRadioButton_EE); gtk_box_pack_start (GTK_BOX (hbox16), GtkRadioButton_EE, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_EE), GtkRadioButton_EE_group); GtkRadioButton_EE_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_EE)); GtkRadioButton_IOP = gtk_radio_button_new_with_mnemonic (NULL, _("IOP Debug Mode")); - gtk_widget_set_name (GtkRadioButton_IOP, "GtkRadioButton_IOP"); gtk_widget_show (GtkRadioButton_IOP); gtk_box_pack_start (GTK_BOX (hbox16), GtkRadioButton_IOP, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_IOP), GtkRadioButton_EE_group); GtkRadioButton_EE_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_IOP)); hbox6 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox6, "hbox6"); gtk_widget_show (hbox6); gtk_box_pack_start (GTK_BOX (vbox16), hbox6, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox6), 5); hbox7 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox7, "hbox7"); gtk_widget_show (hbox7); gtk_box_pack_start (GTK_BOX (hbox6), hbox7, TRUE, TRUE, 0); scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_name (scrolledwindow1, "scrolledwindow1"); gtk_widget_show (scrolledwindow1); gtk_box_pack_start (GTK_BOX (hbox7), scrolledwindow1, TRUE, TRUE, 0); GTK_WIDGET_UNSET_FLAGS (scrolledwindow1, GTK_CAN_FOCUS); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_ALWAYS, GTK_POLICY_NEVER); viewport1 = gtk_viewport_new (NULL, NULL); - gtk_widget_set_name (viewport1, "viewport1"); gtk_widget_show (viewport1); gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport1); GtkList_DisView = gtk_tree_view_new (); - gtk_widget_set_name (GtkList_DisView, "GtkList_DisView"); gtk_widget_show (GtkList_DisView); gtk_container_add (GTK_CONTAINER (viewport1), GtkList_DisView); GTK_WIDGET_UNSET_FLAGS (GtkList_DisView, GTK_CAN_FOCUS); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (GtkList_DisView), FALSE); GtkVScrollbar_VList = gtk_vscrollbar_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 412, 1, 20, 2))); - gtk_widget_set_name (GtkVScrollbar_VList, "GtkVScrollbar_VList"); gtk_widget_show (GtkVScrollbar_VList); gtk_box_pack_start (GTK_BOX (hbox7), GtkVScrollbar_VList, FALSE, TRUE, 0); vbox22 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox22, "vbox22"); gtk_widget_show (vbox22); gtk_box_pack_start (GTK_BOX (hbox6), vbox22, FALSE, TRUE, 0); vbuttonbox2 = gtk_vbutton_box_new (); - gtk_widget_set_name (vbuttonbox2, "vbuttonbox2"); gtk_widget_show (vbuttonbox2); gtk_box_pack_start (GTK_BOX (vbox22), vbuttonbox2, FALSE, TRUE, 0); button52 = gtk_button_new_with_mnemonic (_("Step")); - gtk_widget_set_name (button52, "button52"); gtk_widget_show (button52); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button52); GTK_WIDGET_SET_FLAGS (button52, GTK_CAN_DEFAULT); button53 = gtk_button_new_with_mnemonic (_("Skip")); - gtk_widget_set_name (button53, "button53"); gtk_widget_show (button53); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button53); GTK_WIDGET_SET_FLAGS (button53, GTK_CAN_DEFAULT); button65 = gtk_button_new_with_mnemonic (_("Go")); - gtk_widget_set_name (button65, "button65"); gtk_widget_show (button65); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button65); GTK_WIDGET_SET_FLAGS (button65, GTK_CAN_DEFAULT); button64 = gtk_button_new_with_mnemonic (_("Log On/Off")); - gtk_widget_set_name (button64, "button64"); gtk_widget_show (button64); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button64); GTK_WIDGET_SET_FLAGS (button64, GTK_CAN_DEFAULT); vbuttonbox3 = gtk_vbutton_box_new (); - gtk_widget_set_name (vbuttonbox3, "vbuttonbox3"); gtk_widget_show (vbuttonbox3); gtk_box_pack_start (GTK_BOX (vbox22), vbuttonbox3, FALSE, TRUE, 0); button58 = gtk_button_new_with_mnemonic (_("Set PC")); - gtk_widget_set_name (button58, "button58"); gtk_widget_show (button58); gtk_container_add (GTK_CONTAINER (vbuttonbox3), button58); GTK_WIDGET_SET_FLAGS (button58, GTK_CAN_DEFAULT); button59 = gtk_button_new_with_mnemonic (_("Set BP Addr")); - gtk_widget_set_name (button59, "button59"); gtk_widget_show (button59); gtk_container_add (GTK_CONTAINER (vbuttonbox3), button59); GTK_WIDGET_SET_FLAGS (button59, GTK_CAN_DEFAULT); button60 = gtk_button_new_with_mnemonic (_("Set BP Count")); - gtk_widget_set_name (button60, "button60"); gtk_widget_show (button60); gtk_container_add (GTK_CONTAINER (vbuttonbox3), button60); GTK_WIDGET_SET_FLAGS (button60, GTK_CAN_DEFAULT); button61 = gtk_button_new_with_mnemonic (_("Clear BPs")); - gtk_widget_set_name (button61, "button61"); gtk_widget_show (button61); gtk_container_add (GTK_CONTAINER (vbuttonbox3), button61); GTK_WIDGET_SET_FLAGS (button61, GTK_CAN_DEFAULT); vbuttonbox1 = gtk_vbutton_box_new (); - gtk_widget_set_name (vbuttonbox1, "vbuttonbox1"); gtk_widget_show (vbuttonbox1); gtk_box_pack_start (GTK_BOX (vbox22), vbuttonbox1, FALSE, TRUE, 0); button39 = gtk_button_new_with_mnemonic (_("Dump code")); - gtk_widget_set_name (button39, "button39"); gtk_widget_show (button39); gtk_container_add (GTK_CONTAINER (vbuttonbox1), button39); GTK_WIDGET_SET_FLAGS (button39, GTK_CAN_DEFAULT); button40 = gtk_button_new_with_mnemonic (_("Raw Dump")); - gtk_widget_set_name (button40, "button40"); gtk_widget_show (button40); gtk_container_add (GTK_CONTAINER (vbuttonbox1), button40); GTK_WIDGET_SET_FLAGS (button40, GTK_CAN_DEFAULT); button41 = gtk_button_new_with_mnemonic (_("Close")); - gtk_widget_set_name (button41, "button41"); gtk_widget_show (button41); gtk_container_add (GTK_CONTAINER (vbuttonbox1), button41); GTK_WIDGET_SET_FLAGS (button41, GTK_CAN_DEFAULT); vbuttonbox4 = gtk_vbutton_box_new (); - gtk_widget_set_name (vbuttonbox4, "vbuttonbox4"); gtk_widget_show (vbuttonbox4); gtk_box_pack_start (GTK_BOX (hbox6), vbuttonbox4, FALSE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (vbuttonbox4), 10); button68 = gtk_button_new_with_mnemonic (_("memWrite32")); - gtk_widget_set_name (button68, "button68"); gtk_widget_show (button68); gtk_container_add (GTK_CONTAINER (vbuttonbox4), button68); GTK_WIDGET_SET_FLAGS (button68, GTK_CAN_DEFAULT); @@ -2038,163 +1821,138 @@ create_ConfDlg (void) GtkWidget *GtkButton_Cancel; ConfDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (ConfDlg, "ConfDlg"); gtk_container_set_border_width (GTK_CONTAINER (ConfDlg), 10); gtk_window_set_title (GTK_WINDOW (ConfDlg), _("Conf")); gtk_window_set_resizable (GTK_WINDOW (ConfDlg), FALSE); vbox12 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox12, "vbox12"); gtk_widget_show (vbox12); gtk_container_add (GTK_CONTAINER (ConfDlg), vbox12); table2 = gtk_table_new (14, 2, FALSE); - gtk_widget_set_name (table2, "table2"); gtk_widget_show (table2); gtk_box_pack_start (GTK_BOX (vbox12), table2, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (table2), 2); gtk_table_set_col_spacings (GTK_TABLE (table2), 15); GtkCombo_Bios = gtk_combo_box_new_text (); - gtk_widget_set_name (GtkCombo_Bios, "GtkCombo_Bios"); gtk_widget_show (GtkCombo_Bios); gtk_table_attach (GTK_TABLE (table2), GtkCombo_Bios, 1, 2, 13, 14, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_GS = gtk_combo_box_new_text (); - gtk_widget_set_name (GtkCombo_GS, "GtkCombo_GS"); gtk_widget_show (GtkCombo_GS); gtk_table_attach (GTK_TABLE (table2), GtkCombo_GS, 0, 1, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_SPU2 = gtk_combo_box_new_text (); - gtk_widget_set_name (GtkCombo_SPU2, "GtkCombo_SPU2"); gtk_widget_show (GtkCombo_SPU2); gtk_table_attach (GTK_TABLE (table2), GtkCombo_SPU2, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_PAD1 = gtk_combo_box_new_text (); - gtk_widget_set_name (GtkCombo_PAD1, "GtkCombo_PAD1"); gtk_widget_show (GtkCombo_PAD1); gtk_table_attach (GTK_TABLE (table2), GtkCombo_PAD1, 0, 1, 4, 5, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_PAD2 = gtk_combo_box_new_text (); - gtk_widget_set_name (GtkCombo_PAD2, "GtkCombo_PAD2"); gtk_widget_show (GtkCombo_PAD2); gtk_table_attach (GTK_TABLE (table2), GtkCombo_PAD2, 1, 2, 4, 5, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_DEV9 = gtk_combo_box_new_text (); - gtk_widget_set_name (GtkCombo_DEV9, "GtkCombo_DEV9"); gtk_widget_show (GtkCombo_DEV9); gtk_table_attach (GTK_TABLE (table2), GtkCombo_DEV9, 0, 1, 7, 8, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_CDVD = gtk_combo_box_new_text (); - gtk_widget_set_name (GtkCombo_CDVD, "GtkCombo_CDVD"); gtk_widget_show (GtkCombo_CDVD); gtk_table_attach (GTK_TABLE (table2), GtkCombo_CDVD, 1, 2, 7, 8, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_USB = gtk_combo_box_new_text (); - gtk_widget_set_name (GtkCombo_USB, "GtkCombo_USB"); gtk_widget_show (GtkCombo_USB); gtk_table_attach (GTK_TABLE (table2), GtkCombo_USB, 0, 1, 10, 11, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_FW = gtk_combo_box_new_text (); - gtk_widget_set_name (GtkCombo_FW, "GtkCombo_FW"); gtk_widget_show (GtkCombo_FW); gtk_table_attach (GTK_TABLE (table2), GtkCombo_FW, 1, 2, 10, 11, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); hbuttonbox6 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox6, "hbuttonbox6"); gtk_widget_show (hbuttonbox6); gtk_table_attach (GTK_TABLE (table2), hbuttonbox6, 1, 2, 5, 6, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkButton_PAD2configure = gtk_button_new_with_mnemonic (_("Configure")); - gtk_widget_set_name (GtkButton_PAD2configure, "GtkButton_PAD2configure"); gtk_widget_show (GtkButton_PAD2configure); gtk_container_add (GTK_CONTAINER (hbuttonbox6), GtkButton_PAD2configure); GTK_WIDGET_SET_FLAGS (GtkButton_PAD2configure, GTK_CAN_DEFAULT); GtkButton_PAD2test = gtk_button_new_with_mnemonic (_("Test")); - gtk_widget_set_name (GtkButton_PAD2test, "GtkButton_PAD2test"); gtk_widget_show (GtkButton_PAD2test); gtk_container_add (GTK_CONTAINER (hbuttonbox6), GtkButton_PAD2test); GTK_WIDGET_SET_FLAGS (GtkButton_PAD2test, GTK_CAN_DEFAULT); GtkButton_PAD2about = gtk_button_new_with_mnemonic (_("About")); - gtk_widget_set_name (GtkButton_PAD2about, "GtkButton_PAD2about"); gtk_widget_show (GtkButton_PAD2about); gtk_container_add (GTK_CONTAINER (hbuttonbox6), GtkButton_PAD2about); GTK_WIDGET_SET_FLAGS (GtkButton_PAD2about, GTK_CAN_DEFAULT); hbuttonbox7 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox7, "hbuttonbox7"); gtk_widget_show (hbuttonbox7); gtk_table_attach (GTK_TABLE (table2), hbuttonbox7, 0, 1, 5, 6, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); GtkButton_PAD1configure = gtk_button_new_with_mnemonic (_("Configure")); - gtk_widget_set_name (GtkButton_PAD1configure, "GtkButton_PAD1configure"); gtk_widget_show (GtkButton_PAD1configure); gtk_container_add (GTK_CONTAINER (hbuttonbox7), GtkButton_PAD1configure); GTK_WIDGET_SET_FLAGS (GtkButton_PAD1configure, GTK_CAN_DEFAULT); GtkButton_PAD1test = gtk_button_new_with_mnemonic (_("Test")); - gtk_widget_set_name (GtkButton_PAD1test, "GtkButton_PAD1test"); gtk_widget_show (GtkButton_PAD1test); gtk_container_add (GTK_CONTAINER (hbuttonbox7), GtkButton_PAD1test); GTK_WIDGET_SET_FLAGS (GtkButton_PAD1test, GTK_CAN_DEFAULT); GtkButton_PAD1about = gtk_button_new_with_mnemonic (_("About")); - gtk_widget_set_name (GtkButton_PAD1about, "GtkButton_PAD1about"); gtk_widget_show (GtkButton_PAD1about); gtk_container_add (GTK_CONTAINER (hbuttonbox7), GtkButton_PAD1about); GTK_WIDGET_SET_FLAGS (GtkButton_PAD1about, GTK_CAN_DEFAULT); hbuttonbox8 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox8, "hbuttonbox8"); gtk_widget_show (hbuttonbox8); gtk_table_attach (GTK_TABLE (table2), hbuttonbox8, 0, 1, 2, 3, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkButton_GSconfigure = gtk_button_new_with_mnemonic (_("Configure")); - gtk_widget_set_name (GtkButton_GSconfigure, "GtkButton_GSconfigure"); gtk_widget_show (GtkButton_GSconfigure); gtk_container_add (GTK_CONTAINER (hbuttonbox8), GtkButton_GSconfigure); GTK_WIDGET_SET_FLAGS (GtkButton_GSconfigure, GTK_CAN_DEFAULT); GtkButton_GStest = gtk_button_new_with_mnemonic (_("Test")); - gtk_widget_set_name (GtkButton_GStest, "GtkButton_GStest"); gtk_widget_show (GtkButton_GStest); gtk_container_add (GTK_CONTAINER (hbuttonbox8), GtkButton_GStest); GTK_WIDGET_SET_FLAGS (GtkButton_GStest, GTK_CAN_DEFAULT); GtkButton_GSabout = gtk_button_new_with_mnemonic (_("About")); - gtk_widget_set_name (GtkButton_GSabout, "GtkButton_GSabout"); gtk_widget_show (GtkButton_GSabout); gtk_container_add (GTK_CONTAINER (hbuttonbox8), GtkButton_GSabout); GTK_WIDGET_SET_FLAGS (GtkButton_GSabout, GTK_CAN_DEFAULT); GtkLabel_Graphics = gtk_label_new (_("Graphics")); - gtk_widget_set_name (GtkLabel_Graphics, "GtkLabel_Graphics"); gtk_widget_show (GtkLabel_Graphics); gtk_table_attach (GTK_TABLE (table2), GtkLabel_Graphics, 0, 1, 0, 1, (GtkAttachOptions) (0), @@ -2203,7 +1961,6 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_Graphics), 0, 0.5); GtkLabel_FirstController = gtk_label_new (_("First Controller")); - gtk_widget_set_name (GtkLabel_FirstController, "GtkLabel_FirstController"); gtk_widget_show (GtkLabel_FirstController); gtk_table_attach (GTK_TABLE (table2), GtkLabel_FirstController, 0, 1, 3, 4, (GtkAttachOptions) (0), @@ -2212,7 +1969,6 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_FirstController), 0, 0.5); GtkLabel_SecondController = gtk_label_new (_("Second Controller")); - gtk_widget_set_name (GtkLabel_SecondController, "GtkLabel_SecondController"); gtk_widget_show (GtkLabel_SecondController); gtk_table_attach (GTK_TABLE (table2), GtkLabel_SecondController, 1, 2, 3, 4, (GtkAttachOptions) (0), @@ -2221,7 +1977,6 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_SecondController), 0, 0.5); GtkLabel_Sound = gtk_label_new (_("Sound")); - gtk_widget_set_name (GtkLabel_Sound, "GtkLabel_Sound"); gtk_widget_show (GtkLabel_Sound); gtk_table_attach (GTK_TABLE (table2), GtkLabel_Sound, 1, 2, 0, 1, (GtkAttachOptions) (0), @@ -2230,57 +1985,48 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_Sound), 0, 0.5); hbuttonbox12 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox12, "hbuttonbox12"); gtk_widget_show (hbuttonbox12); gtk_table_attach (GTK_TABLE (table2), hbuttonbox12, 1, 2, 2, 3, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); GtkButton_SPU2configure = gtk_button_new_with_mnemonic (_("Configure")); - gtk_widget_set_name (GtkButton_SPU2configure, "GtkButton_SPU2configure"); gtk_widget_show (GtkButton_SPU2configure); gtk_container_add (GTK_CONTAINER (hbuttonbox12), GtkButton_SPU2configure); GTK_WIDGET_SET_FLAGS (GtkButton_SPU2configure, GTK_CAN_DEFAULT); GtkButton_SPU2test = gtk_button_new_with_mnemonic (_("Test")); - gtk_widget_set_name (GtkButton_SPU2test, "GtkButton_SPU2test"); gtk_widget_show (GtkButton_SPU2test); gtk_container_add (GTK_CONTAINER (hbuttonbox12), GtkButton_SPU2test); GTK_WIDGET_SET_FLAGS (GtkButton_SPU2test, GTK_CAN_DEFAULT); GtkButton_SPU2about = gtk_button_new_with_mnemonic (_("About")); - gtk_widget_set_name (GtkButton_SPU2about, "GtkButton_SPU2about"); gtk_widget_show (GtkButton_SPU2about); gtk_container_add (GTK_CONTAINER (hbuttonbox12), GtkButton_SPU2about); GTK_WIDGET_SET_FLAGS (GtkButton_SPU2about, GTK_CAN_DEFAULT); hbuttonbox21 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox21, "hbuttonbox21"); gtk_widget_show (hbuttonbox21); gtk_table_attach (GTK_TABLE (table2), hbuttonbox21, 0, 1, 8, 9, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkButton_DEV9configure = gtk_button_new_with_mnemonic (_("Configure")); - gtk_widget_set_name (GtkButton_DEV9configure, "GtkButton_DEV9configure"); gtk_widget_show (GtkButton_DEV9configure); gtk_container_add (GTK_CONTAINER (hbuttonbox21), GtkButton_DEV9configure); GTK_WIDGET_SET_FLAGS (GtkButton_DEV9configure, GTK_CAN_DEFAULT); GtkButton_DEV9test = gtk_button_new_with_mnemonic (_("Test")); - gtk_widget_set_name (GtkButton_DEV9test, "GtkButton_DEV9test"); gtk_widget_show (GtkButton_DEV9test); gtk_container_add (GTK_CONTAINER (hbuttonbox21), GtkButton_DEV9test); GTK_WIDGET_SET_FLAGS (GtkButton_DEV9test, GTK_CAN_DEFAULT); GtkButton_DEV9about = gtk_button_new_with_mnemonic (_("About")); - gtk_widget_set_name (GtkButton_DEV9about, "GtkButton_DEV9about"); gtk_widget_show (GtkButton_DEV9about); gtk_container_add (GTK_CONTAINER (hbuttonbox21), GtkButton_DEV9about); GTK_WIDGET_SET_FLAGS (GtkButton_DEV9about, GTK_CAN_DEFAULT); label23 = gtk_label_new (_("Dev9")); - gtk_widget_set_name (label23, "label23"); gtk_widget_show (label23); gtk_table_attach (GTK_TABLE (table2), label23, 0, 1, 6, 7, (GtkAttachOptions) (0), @@ -2289,7 +2035,6 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (label23), 0, 0.5); GtkLabel_Cdvdrom = gtk_label_new (_("Cdvdrom")); - gtk_widget_set_name (GtkLabel_Cdvdrom, "GtkLabel_Cdvdrom"); gtk_widget_show (GtkLabel_Cdvdrom); gtk_table_attach (GTK_TABLE (table2), GtkLabel_Cdvdrom, 1, 2, 6, 7, (GtkAttachOptions) (0), @@ -2298,32 +2043,27 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_Cdvdrom), 0, 0.5); hbuttonbox13 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox13, "hbuttonbox13"); gtk_widget_show (hbuttonbox13); gtk_table_attach (GTK_TABLE (table2), hbuttonbox13, 1, 2, 8, 9, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); GtkButton_CDVDconfigure = gtk_button_new_with_mnemonic (_("Configure")); - gtk_widget_set_name (GtkButton_CDVDconfigure, "GtkButton_CDVDconfigure"); gtk_widget_show (GtkButton_CDVDconfigure); gtk_container_add (GTK_CONTAINER (hbuttonbox13), GtkButton_CDVDconfigure); GTK_WIDGET_SET_FLAGS (GtkButton_CDVDconfigure, GTK_CAN_DEFAULT); GtkButton_CDVDtest = gtk_button_new_with_mnemonic (_("Test")); - gtk_widget_set_name (GtkButton_CDVDtest, "GtkButton_CDVDtest"); gtk_widget_show (GtkButton_CDVDtest); gtk_container_add (GTK_CONTAINER (hbuttonbox13), GtkButton_CDVDtest); GTK_WIDGET_SET_FLAGS (GtkButton_CDVDtest, GTK_CAN_DEFAULT); GtkButton_CDVDabout = gtk_button_new_with_mnemonic (_("About")); - gtk_widget_set_name (GtkButton_CDVDabout, "GtkButton_CDVDabout"); gtk_widget_show (GtkButton_CDVDabout); gtk_container_add (GTK_CONTAINER (hbuttonbox13), GtkButton_CDVDabout); GTK_WIDGET_SET_FLAGS (GtkButton_CDVDabout, GTK_CAN_DEFAULT); label29 = gtk_label_new (_("Usb")); - gtk_widget_set_name (label29, "label29"); gtk_widget_show (label29); gtk_table_attach (GTK_TABLE (table2), label29, 0, 1, 9, 10, (GtkAttachOptions) (0), @@ -2332,57 +2072,48 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (label29), 0, 0.5); hbuttonbox23 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox23, "hbuttonbox23"); gtk_widget_show (hbuttonbox23); gtk_table_attach (GTK_TABLE (table2), hbuttonbox23, 0, 1, 11, 12, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkButton_USBconfigure = gtk_button_new_with_mnemonic (_("Configure")); - gtk_widget_set_name (GtkButton_USBconfigure, "GtkButton_USBconfigure"); gtk_widget_show (GtkButton_USBconfigure); gtk_container_add (GTK_CONTAINER (hbuttonbox23), GtkButton_USBconfigure); GTK_WIDGET_SET_FLAGS (GtkButton_USBconfigure, GTK_CAN_DEFAULT); GtkButton_USBtest = gtk_button_new_with_mnemonic (_("Test")); - gtk_widget_set_name (GtkButton_USBtest, "GtkButton_USBtest"); gtk_widget_show (GtkButton_USBtest); gtk_container_add (GTK_CONTAINER (hbuttonbox23), GtkButton_USBtest); GTK_WIDGET_SET_FLAGS (GtkButton_USBtest, GTK_CAN_DEFAULT); GtkButton_USBabout = gtk_button_new_with_mnemonic (_("About")); - gtk_widget_set_name (GtkButton_USBabout, "GtkButton_USBabout"); gtk_widget_show (GtkButton_USBabout); gtk_container_add (GTK_CONTAINER (hbuttonbox23), GtkButton_USBabout); GTK_WIDGET_SET_FLAGS (GtkButton_USBabout, GTK_CAN_DEFAULT); hbuttonbox24 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox24, "hbuttonbox24"); gtk_widget_show (hbuttonbox24); gtk_table_attach (GTK_TABLE (table2), hbuttonbox24, 1, 2, 11, 12, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); GtkButton_FWconfigure = gtk_button_new_with_mnemonic (_("Configure")); - gtk_widget_set_name (GtkButton_FWconfigure, "GtkButton_FWconfigure"); gtk_widget_show (GtkButton_FWconfigure); gtk_container_add (GTK_CONTAINER (hbuttonbox24), GtkButton_FWconfigure); GTK_WIDGET_SET_FLAGS (GtkButton_FWconfigure, GTK_CAN_DEFAULT); GtkButton_FWtest = gtk_button_new_with_mnemonic (_("Test")); - gtk_widget_set_name (GtkButton_FWtest, "GtkButton_FWtest"); gtk_widget_show (GtkButton_FWtest); gtk_container_add (GTK_CONTAINER (hbuttonbox24), GtkButton_FWtest); GTK_WIDGET_SET_FLAGS (GtkButton_FWtest, GTK_CAN_DEFAULT); GtkButton_FireWireabout = gtk_button_new_with_mnemonic (_("About")); - gtk_widget_set_name (GtkButton_FireWireabout, "GtkButton_FireWireabout"); gtk_widget_show (GtkButton_FireWireabout); gtk_container_add (GTK_CONTAINER (hbuttonbox24), GtkButton_FireWireabout); GTK_WIDGET_SET_FLAGS (GtkButton_FireWireabout, GTK_CAN_DEFAULT); label30 = gtk_label_new (_("FireWire")); - gtk_widget_set_name (label30, "label30"); gtk_widget_show (label30); gtk_table_attach (GTK_TABLE (table2), label30, 1, 2, 9, 10, (GtkAttachOptions) (0), @@ -2391,7 +2122,6 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (label30), 0, 0.5); GtkLabel_Bios = gtk_label_new (_("Bios")); - gtk_widget_set_name (GtkLabel_Bios, "GtkLabel_Bios"); gtk_widget_show (GtkLabel_Bios); gtk_table_attach (GTK_TABLE (table2), GtkLabel_Bios, 1, 2, 12, 13, (GtkAttachOptions) (0), @@ -2400,41 +2130,34 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_Bios), 0, 0.5); hbox5 = gtk_hbox_new (FALSE, 14); - gtk_widget_set_name (hbox5, "hbox5"); gtk_widget_show (hbox5); gtk_box_pack_start (GTK_BOX (vbox12), hbox5, TRUE, TRUE, 0); hbuttonbox11 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox11, "hbuttonbox11"); gtk_widget_show (hbuttonbox11); gtk_box_pack_start (GTK_BOX (hbox5), hbuttonbox11, FALSE, TRUE, 0); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox11), GTK_BUTTONBOX_START); GtkButton_SelectPluginsDir = gtk_button_new_with_mnemonic (_("Select Plugins Dir")); - gtk_widget_set_name (GtkButton_SelectPluginsDir, "GtkButton_SelectPluginsDir"); gtk_widget_show (GtkButton_SelectPluginsDir); gtk_container_add (GTK_CONTAINER (hbuttonbox11), GtkButton_SelectPluginsDir); GTK_WIDGET_SET_FLAGS (GtkButton_SelectPluginsDir, GTK_CAN_DEFAULT); GtkButton_SelectBiosDir = gtk_button_new_with_mnemonic (_("Select Bios Dir")); - gtk_widget_set_name (GtkButton_SelectBiosDir, "GtkButton_SelectBiosDir"); gtk_widget_show (GtkButton_SelectBiosDir); gtk_container_add (GTK_CONTAINER (hbuttonbox11), GtkButton_SelectBiosDir); GTK_WIDGET_SET_FLAGS (GtkButton_SelectBiosDir, GTK_CAN_DEFAULT); hbuttonbox10 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox10, "hbuttonbox10"); gtk_widget_show (hbuttonbox10); gtk_box_pack_start (GTK_BOX (hbox5), hbuttonbox10, TRUE, TRUE, 0); GtkButton_Ok1 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (GtkButton_Ok1, "GtkButton_Ok1"); gtk_widget_show (GtkButton_Ok1); gtk_container_add (GTK_CONTAINER (hbuttonbox10), GtkButton_Ok1); GTK_WIDGET_SET_FLAGS (GtkButton_Ok1, GTK_CAN_DEFAULT); GtkButton_Cancel = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (GtkButton_Cancel, "GtkButton_Cancel"); gtk_widget_show (GtkButton_Cancel); gtk_container_add (GTK_CONTAINER (hbuttonbox10), GtkButton_Cancel); GTK_WIDGET_SET_FLAGS (GtkButton_Cancel, GTK_CAN_DEFAULT); @@ -2606,72 +2329,60 @@ create_AboutDlg (void) GtkWidget *GtkButton_Ok; AboutDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (AboutDlg, "AboutDlg"); gtk_container_set_border_width (GTK_CONTAINER (AboutDlg), 10); gtk_window_set_title (GTK_WINDOW (AboutDlg), _("Pcsx About")); vbox2 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox2, "vbox2"); gtk_widget_show (vbox2); gtk_container_add (GTK_CONTAINER (AboutDlg), vbox2); vbox4 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox4, "vbox4"); gtk_widget_show (vbox4); gtk_box_pack_start (GTK_BOX (vbox2), vbox4, TRUE, TRUE, 0); GtkAbout_LabelVersion = gtk_label_new (_("PCSX2\n\nVersion x.x")); - gtk_widget_set_name (GtkAbout_LabelVersion, "GtkAbout_LabelVersion"); gtk_widget_show (GtkAbout_LabelVersion); gtk_box_pack_start (GTK_BOX (vbox4), GtkAbout_LabelVersion, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkAbout_LabelVersion), GTK_JUSTIFY_CENTER); frame1 = gtk_frame_new (NULL); - gtk_widget_set_name (frame1, "frame1"); gtk_widget_show (frame1); gtk_box_pack_start (GTK_BOX (vbox4), frame1, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame1), 5); vbox6 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox6, "vbox6"); gtk_widget_show (vbox6); gtk_container_add (GTK_CONTAINER (frame1), vbox6); gtk_container_set_border_width (GTK_CONTAINER (vbox6), 5); GtkAbout_LabelAuthors = gtk_label_new (_("written by...")); - gtk_widget_set_name (GtkAbout_LabelAuthors, "GtkAbout_LabelAuthors"); gtk_widget_show (GtkAbout_LabelAuthors); gtk_box_pack_start (GTK_BOX (vbox6), GtkAbout_LabelAuthors, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkAbout_LabelAuthors), GTK_JUSTIFY_CENTER); gtk_label_set_line_wrap (GTK_LABEL (GtkAbout_LabelAuthors), TRUE); frame2 = gtk_frame_new (NULL); - gtk_widget_set_name (frame2, "frame2"); gtk_widget_show (frame2); gtk_box_pack_start (GTK_BOX (vbox2), frame2, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame2), 5); vbox5 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox5, "vbox5"); gtk_widget_show (vbox5); gtk_container_add (GTK_CONTAINER (frame2), vbox5); gtk_container_set_border_width (GTK_CONTAINER (vbox5), 5); GtkAbout_LabelGreets = gtk_label_new (_("greets to...")); - gtk_widget_set_name (GtkAbout_LabelGreets, "GtkAbout_LabelGreets"); gtk_widget_show (GtkAbout_LabelGreets); gtk_box_pack_start (GTK_BOX (vbox5), GtkAbout_LabelGreets, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkAbout_LabelGreets), GTK_JUSTIFY_CENTER); gtk_label_set_line_wrap (GTK_LABEL (GtkAbout_LabelGreets), TRUE); hbuttonbox1 = gtk_hbutton_box_new (); - gtk_widget_set_name (hbuttonbox1, "hbuttonbox1"); gtk_widget_show (hbuttonbox1); gtk_box_pack_start (GTK_BOX (vbox2), hbuttonbox1, FALSE, FALSE, 0); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_EDGE); GtkButton_Ok = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (GtkButton_Ok, "GtkButton_Ok"); gtk_widget_show (GtkButton_Ok); gtk_container_add (GTK_CONTAINER (hbuttonbox1), GtkButton_Ok); GTK_WIDGET_SET_FLAGS (GtkButton_Ok, GTK_CAN_DEFAULT); @@ -2770,338 +2481,270 @@ create_MainWindow (void) GtkWidget *status_box; MainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (MainWindow, "MainWindow"); gtk_window_set_title (GTK_WINDOW (MainWindow), _("PCSX")); gtk_window_set_position (GTK_WINDOW (MainWindow), GTK_WIN_POS_CENTER); vbox1 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox1, "vbox1"); gtk_widget_show (vbox1); gtk_container_add (GTK_CONTAINER (MainWindow), vbox1); GtkMenuBar_Menu = gtk_menu_bar_new (); - gtk_widget_set_name (GtkMenuBar_Menu, "GtkMenuBar_Menu"); gtk_widget_show (GtkMenuBar_Menu); gtk_box_pack_start (GTK_BOX (vbox1), GtkMenuBar_Menu, FALSE, FALSE, 0); GtkMenuItem_File = gtk_menu_item_new_with_mnemonic (_("_File")); - gtk_widget_set_name (GtkMenuItem_File, "GtkMenuItem_File"); gtk_widget_show (GtkMenuItem_File); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_File); GtkMenuItem_File_menu = gtk_menu_new (); - gtk_widget_set_name (GtkMenuItem_File_menu, "GtkMenuItem_File_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_File), GtkMenuItem_File_menu); run_cd1 = gtk_menu_item_new_with_mnemonic (_("_Run CD")); - gtk_widget_set_name (run_cd1, "run_cd1"); gtk_widget_show (run_cd1); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), run_cd1); GtkMenuItem_LoadElf = gtk_menu_item_new_with_mnemonic (_("_Load Elf")); - gtk_widget_set_name (GtkMenuItem_LoadElf, "GtkMenuItem_LoadElf"); gtk_widget_show (GtkMenuItem_LoadElf); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), GtkMenuItem_LoadElf); separator2 = gtk_separator_menu_item_new (); - gtk_widget_set_name (separator2, "separator2"); gtk_widget_show (separator2); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), separator2); gtk_widget_set_sensitive (separator2, FALSE); states1 = gtk_menu_item_new_with_mnemonic (_("States")); - gtk_widget_set_name (states1, "states1"); gtk_widget_show (states1); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), states1); states1_menu = gtk_menu_new (); - gtk_widget_set_name (states1_menu, "states1_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (states1), states1_menu); load1 = gtk_menu_item_new_with_mnemonic (_("Load")); - gtk_widget_set_name (load1, "load1"); gtk_widget_show (load1); gtk_container_add (GTK_CONTAINER (states1_menu), load1); load1_menu = gtk_menu_new (); - gtk_widget_set_name (load1_menu, "load1_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (load1), load1_menu); load_slot_0 = gtk_menu_item_new_with_mnemonic (_("Slot 0")); - gtk_widget_set_name (load_slot_0, "load_slot_0"); gtk_widget_show (load_slot_0); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_0); load_slot_1 = gtk_menu_item_new_with_mnemonic (_("Slot 1")); - gtk_widget_set_name (load_slot_1, "load_slot_1"); gtk_widget_show (load_slot_1); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_1); load_slot_2 = gtk_menu_item_new_with_mnemonic (_("Slot 2")); - gtk_widget_set_name (load_slot_2, "load_slot_2"); gtk_widget_show (load_slot_2); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_2); load_slot_3 = gtk_menu_item_new_with_mnemonic (_("Slot 3")); - gtk_widget_set_name (load_slot_3, "load_slot_3"); gtk_widget_show (load_slot_3); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_3); load_slot_4 = gtk_menu_item_new_with_mnemonic (_("Slot 4")); - gtk_widget_set_name (load_slot_4, "load_slot_4"); gtk_widget_show (load_slot_4); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_4); other1 = gtk_menu_item_new_with_mnemonic (_("Other...")); - gtk_widget_set_name (other1, "other1"); gtk_widget_show (other1); gtk_container_add (GTK_CONTAINER (load1_menu), other1); save1 = gtk_menu_item_new_with_mnemonic (_("Save")); - gtk_widget_set_name (save1, "save1"); gtk_widget_show (save1); gtk_container_add (GTK_CONTAINER (states1_menu), save1); save1_menu = gtk_menu_new (); - gtk_widget_set_name (save1_menu, "save1_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (save1), save1_menu); save_slot_0 = gtk_menu_item_new_with_mnemonic (_("Slot 0")); - gtk_widget_set_name (save_slot_0, "save_slot_0"); gtk_widget_show (save_slot_0); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_0); save_slot_1 = gtk_menu_item_new_with_mnemonic (_("Slot 1")); - gtk_widget_set_name (save_slot_1, "save_slot_1"); gtk_widget_show (save_slot_1); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_1); save_slot_2 = gtk_menu_item_new_with_mnemonic (_("Slot 2")); - gtk_widget_set_name (save_slot_2, "save_slot_2"); gtk_widget_show (save_slot_2); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_2); save_slot_3 = gtk_menu_item_new_with_mnemonic (_("Slot 3")); - gtk_widget_set_name (save_slot_3, "save_slot_3"); gtk_widget_show (save_slot_3); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_3); save_slot_4 = gtk_menu_item_new_with_mnemonic (_("Slot 4")); - gtk_widget_set_name (save_slot_4, "save_slot_4"); gtk_widget_show (save_slot_4); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_4); other2 = gtk_menu_item_new_with_mnemonic (_("Other...")); - gtk_widget_set_name (other2, "other2"); gtk_widget_show (other2); gtk_container_add (GTK_CONTAINER (save1_menu), other2); GtkMenuItem_Exit = gtk_menu_item_new_with_mnemonic (_("E_xit")); - gtk_widget_set_name (GtkMenuItem_Exit, "GtkMenuItem_Exit"); gtk_widget_show (GtkMenuItem_Exit); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), GtkMenuItem_Exit); GtkMenuItem_Emulator = gtk_menu_item_new_with_mnemonic (_("_Run")); - gtk_widget_set_name (GtkMenuItem_Emulator, "GtkMenuItem_Emulator"); gtk_widget_show (GtkMenuItem_Emulator); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Emulator); GtkMenuItem_Emulator_menu = gtk_menu_new (); - gtk_widget_set_name (GtkMenuItem_Emulator_menu, "GtkMenuItem_Emulator_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_Emulator), GtkMenuItem_Emulator_menu); GtkMenuItem_Run = gtk_menu_item_new_with_mnemonic (_("E_xecute")); - gtk_widget_set_name (GtkMenuItem_Run, "GtkMenuItem_Run"); gtk_widget_show (GtkMenuItem_Run); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Emulator_menu), GtkMenuItem_Run); GtkMenuItem_Reset = gtk_menu_item_new_with_mnemonic (_("Re_set")); - gtk_widget_set_name (GtkMenuItem_Reset, "GtkMenuItem_Reset"); gtk_widget_show (GtkMenuItem_Reset); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Emulator_menu), GtkMenuItem_Reset); GtkMenuItem_Configuration = gtk_menu_item_new_with_mnemonic (_("_Config")); - gtk_widget_set_name (GtkMenuItem_Configuration, "GtkMenuItem_Configuration"); gtk_widget_show (GtkMenuItem_Configuration); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Configuration); GtkMenuItem_Configuration_menu = gtk_menu_new (); - gtk_widget_set_name (GtkMenuItem_Configuration_menu, "GtkMenuItem_Configuration_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_Configuration), GtkMenuItem_Configuration_menu); GtkMenuItem_PluginsBios = gtk_menu_item_new_with_mnemonic (_("_Configure")); - gtk_widget_set_name (GtkMenuItem_PluginsBios, "GtkMenuItem_PluginsBios"); gtk_widget_show (GtkMenuItem_PluginsBios); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_PluginsBios); separator3 = gtk_separator_menu_item_new (); - gtk_widget_set_name (separator3, "separator3"); gtk_widget_show (separator3); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), separator3); gtk_widget_set_sensitive (separator3, FALSE); GtkMenuItem_GS = gtk_menu_item_new_with_mnemonic (_("_Graphics")); - gtk_widget_set_name (GtkMenuItem_GS, "GtkMenuItem_GS"); gtk_widget_show (GtkMenuItem_GS); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_GS); GtkMenuItem_PAD1 = gtk_menu_item_new_with_mnemonic (_("C_ontrollers")); - gtk_widget_set_name (GtkMenuItem_PAD1, "GtkMenuItem_PAD1"); gtk_widget_show (GtkMenuItem_PAD1); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_PAD1); GtkMenuItem_SPU2 = gtk_menu_item_new_with_mnemonic (_("_Sound")); - gtk_widget_set_name (GtkMenuItem_SPU2, "GtkMenuItem_SPU2"); gtk_widget_show (GtkMenuItem_SPU2); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_SPU2); GtkMenuItem_CDVD = gtk_menu_item_new_with_mnemonic (_("_Cdvdrom")); - gtk_widget_set_name (GtkMenuItem_CDVD, "GtkMenuItem_CDVD"); gtk_widget_show (GtkMenuItem_CDVD); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_CDVD); GtkMenuItem_DEV9 = gtk_menu_item_new_with_mnemonic (_("D_ev9")); - gtk_widget_set_name (GtkMenuItem_DEV9, "GtkMenuItem_DEV9"); gtk_widget_show (GtkMenuItem_DEV9); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_DEV9); GtkMenuItem_USB = gtk_menu_item_new_with_mnemonic (_("U_SB")); - gtk_widget_set_name (GtkMenuItem_USB, "GtkMenuItem_USB"); gtk_widget_show (GtkMenuItem_USB); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_USB); GtkMenuItem_FW = gtk_menu_item_new_with_mnemonic (_("Fire_Wire")); - gtk_widget_set_name (GtkMenuItem_FW, "GtkMenuItem_FW"); gtk_widget_show (GtkMenuItem_FW); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_FW); separator4 = gtk_separator_menu_item_new (); - gtk_widget_set_name (separator4, "separator4"); gtk_widget_show (separator4); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), separator4); gtk_widget_set_sensitive (separator4, FALSE); GtkMenuItem_Memcards = gtk_menu_item_new_with_mnemonic (_("Memcards")); - gtk_widget_set_name (GtkMenuItem_Memcards, "GtkMenuItem_Memcards"); gtk_widget_show (GtkMenuItem_Memcards); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Memcards); GtkMenuItem_Cpu = gtk_menu_item_new_with_mnemonic (_("C_pu")); - gtk_widget_set_name (GtkMenuItem_Cpu, "GtkMenuItem_Cpu"); gtk_widget_show (GtkMenuItem_Cpu); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Cpu); GtkMenuItem_Game_Fixes = gtk_menu_item_new_with_mnemonic (_("Game Fixes")); - gtk_widget_set_name (GtkMenuItem_Game_Fixes, "GtkMenuItem_Game_Fixes"); gtk_widget_show (GtkMenuItem_Game_Fixes); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Game_Fixes); GtkMenuItem_Speed_Hacks = gtk_menu_item_new_with_mnemonic (_("Speed Hacks")); - gtk_widget_set_name (GtkMenuItem_Speed_Hacks, "GtkMenuItem_Speed_Hacks"); gtk_widget_show (GtkMenuItem_Speed_Hacks); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Speed_Hacks); GtkMenuItem_Advanced = gtk_menu_item_new_with_mnemonic (_("Advanced")); - gtk_widget_set_name (GtkMenuItem_Advanced, "GtkMenuItem_Advanced"); gtk_widget_show (GtkMenuItem_Advanced); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Advanced); GtkMenuItem_Language = gtk_menu_item_new_with_mnemonic (_("_Language")); - gtk_widget_set_name (GtkMenuItem_Language, "GtkMenuItem_Language"); gtk_widget_show (GtkMenuItem_Language); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Language); misc1 = gtk_menu_item_new_with_mnemonic (_("_Misc")); - gtk_widget_set_name (misc1, "misc1"); gtk_widget_show (misc1); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), misc1); misc1_menu = gtk_menu_new (); - gtk_widget_set_name (misc1_menu, "misc1_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (misc1), misc1_menu); patch_browser1 = gtk_menu_item_new_with_mnemonic (_("Patch _Browser")); - gtk_widget_set_name (patch_browser1, "patch_browser1"); gtk_widget_show (patch_browser1); gtk_container_add (GTK_CONTAINER (misc1_menu), patch_browser1); patch_finder2 = gtk_menu_item_new_with_mnemonic (_("Patch _Finder")); - gtk_widget_set_name (patch_finder2, "patch_finder2"); gtk_widget_show (patch_finder2); gtk_container_add (GTK_CONTAINER (misc1_menu), patch_finder2); separator7 = gtk_separator_menu_item_new (); - gtk_widget_set_name (separator7, "separator7"); gtk_widget_show (separator7); gtk_container_add (GTK_CONTAINER (misc1_menu), separator7); gtk_widget_set_sensitive (separator7, FALSE); enable_console1 = gtk_check_menu_item_new_with_mnemonic (_("Enable _Console")); - gtk_widget_set_name (enable_console1, "enable_console1"); gtk_widget_show (enable_console1); gtk_container_add (GTK_CONTAINER (misc1_menu), enable_console1); enable_patches1 = gtk_check_menu_item_new_with_mnemonic (_("Enable _Patches")); - gtk_widget_set_name (enable_patches1, "enable_patches1"); gtk_widget_show (enable_patches1); gtk_container_add (GTK_CONTAINER (misc1_menu), enable_patches1); print_cdvd_info1 = gtk_check_menu_item_new_with_mnemonic (_("Print CDVD Info")); - gtk_widget_set_name (print_cdvd_info1, "print_cdvd_info1"); gtk_widget_show (print_cdvd_info1); gtk_container_add (GTK_CONTAINER (misc1_menu), print_cdvd_info1); GtkMenuItem_Debug = gtk_menu_item_new_with_mnemonic (_("_Debug")); - gtk_widget_set_name (GtkMenuItem_Debug, "GtkMenuItem_Debug"); gtk_widget_show (GtkMenuItem_Debug); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Debug); GtkMenuItem_Debug_menu = gtk_menu_new (); - gtk_widget_set_name (GtkMenuItem_Debug_menu, "GtkMenuItem_Debug_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_Debug), GtkMenuItem_Debug_menu); GtkMenuItem_EnterDebugger = gtk_menu_item_new_with_mnemonic (_("Enter Debugger ...")); - gtk_widget_set_name (GtkMenuItem_EnterDebugger, "GtkMenuItem_EnterDebugger"); gtk_widget_show (GtkMenuItem_EnterDebugger); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Debug_menu), GtkMenuItem_EnterDebugger); GtkMenuItem_Logging = gtk_menu_item_new_with_mnemonic (_("Logging")); - gtk_widget_set_name (GtkMenuItem_Logging, "GtkMenuItem_Logging"); gtk_widget_show (GtkMenuItem_Logging); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Debug_menu), GtkMenuItem_Logging); separator8 = gtk_separator_menu_item_new (); - gtk_widget_set_name (separator8, "separator8"); gtk_widget_show (separator8); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Debug_menu), separator8); gtk_widget_set_sensitive (separator8, FALSE); GtkMenuItem_Arguments = gtk_menu_item_new_with_mnemonic (_("_Arguments")); - gtk_widget_set_name (GtkMenuItem_Arguments, "GtkMenuItem_Arguments"); gtk_widget_show (GtkMenuItem_Arguments); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Debug_menu), GtkMenuItem_Arguments); GtkMenuItem_Help = gtk_menu_item_new_with_mnemonic (_("_Help")); - gtk_widget_set_name (GtkMenuItem_Help, "GtkMenuItem_Help"); gtk_widget_show (GtkMenuItem_Help); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Help); GtkMenuItem_Help_menu = gtk_menu_new (); - gtk_widget_set_name (GtkMenuItem_Help_menu, "GtkMenuItem_Help_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_Help), GtkMenuItem_Help_menu); GtkMenuItem_About = gtk_menu_item_new_with_mnemonic (_("About PCSX2...")); - gtk_widget_set_name (GtkMenuItem_About, "GtkMenuItem_About"); gtk_widget_show (GtkMenuItem_About); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Help_menu), GtkMenuItem_About); image1 = create_pixmap (MainWindow, "pcsxAbout.bmp"); - gtk_widget_set_name (image1, "image1"); gtk_widget_show (image1); gtk_box_pack_start (GTK_BOX (vbox1), image1, TRUE, TRUE, 1); status_box = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (status_box, "status_box"); gtk_widget_show (status_box); gtk_box_pack_start (GTK_BOX (vbox1), status_box, TRUE, TRUE, 0); @@ -3320,70 +2963,57 @@ create_PatchBrowserWindow (void) GtkWidget *button91; PatchBrowserWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (PatchBrowserWindow, "PatchBrowserWindow"); gtk_window_set_title (GTK_WINDOW (PatchBrowserWindow), _("Patch List")); gtk_window_set_modal (GTK_WINDOW (PatchBrowserWindow), TRUE); gtk_window_set_decorated (GTK_WINDOW (PatchBrowserWindow), FALSE); gtk_window_set_type_hint (GTK_WINDOW (PatchBrowserWindow), GDK_WINDOW_TYPE_HINT_DIALOG); hbox24 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox24, "hbox24"); gtk_widget_show (hbox24); gtk_container_add (GTK_CONTAINER (PatchBrowserWindow), hbox24); scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_name (scrolledwindow2, "scrolledwindow2"); gtk_widget_show (scrolledwindow2); gtk_box_pack_start (GTK_BOX (hbox24), scrolledwindow2, TRUE, TRUE, 0); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_SHADOW_IN); treeview1 = gtk_tree_view_new (); - gtk_widget_set_name (treeview1, "treeview1"); gtk_widget_show (treeview1); gtk_container_add (GTK_CONTAINER (scrolledwindow2), treeview1); vbox40 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox40, "vbox40"); gtk_widget_show (vbox40); gtk_box_pack_start (GTK_BOX (hbox24), vbox40, TRUE, TRUE, 0); button84 = gtk_button_new_with_mnemonic (_("Enable / Diable")); - gtk_widget_set_name (button84, "button84"); gtk_widget_show (button84); gtk_box_pack_start (GTK_BOX (vbox40), button84, FALSE, FALSE, 0); button85 = gtk_button_new_with_mnemonic (_("Add Patch")); - gtk_widget_set_name (button85, "button85"); gtk_widget_show (button85); gtk_box_pack_start (GTK_BOX (vbox40), button85, FALSE, FALSE, 0); button86 = gtk_button_new_with_mnemonic (_("Edit Patch")); - gtk_widget_set_name (button86, "button86"); gtk_widget_show (button86); gtk_box_pack_start (GTK_BOX (vbox40), button86, FALSE, FALSE, 0); button87 = gtk_button_new_with_mnemonic (_("Add GS2v3-4")); - gtk_widget_set_name (button87, "button87"); gtk_widget_show (button87); gtk_box_pack_start (GTK_BOX (vbox40), button87, FALSE, FALSE, 0); button88 = gtk_button_new_with_mnemonic (_("Add Raw")); - gtk_widget_set_name (button88, "button88"); gtk_widget_show (button88); gtk_box_pack_start (GTK_BOX (vbox40), button88, FALSE, FALSE, 0); button89 = gtk_button_new_with_mnemonic (_("Pnach Writer")); - gtk_widget_set_name (button89, "button89"); gtk_widget_show (button89); gtk_box_pack_start (GTK_BOX (vbox40), button89, FALSE, FALSE, 0); button90 = gtk_button_new_with_mnemonic (_("Skip Mpeg")); - gtk_widget_set_name (button90, "button90"); gtk_widget_show (button90); gtk_box_pack_start (GTK_BOX (vbox40), button90, FALSE, FALSE, 0); button91 = gtk_button_new_from_stock ("gtk-close"); - gtk_widget_set_name (button91, "button91"); gtk_widget_show (button91); gtk_box_pack_start (GTK_BOX (vbox40), button91, FALSE, FALSE, 0); @@ -3425,8 +3055,11 @@ create_PatchFinderWindow (void) GtkWidget *radiobutton6; GSList *radiobutton6_group = NULL; GtkWidget *radiobutton5; + GSList *radiobutton5_group = NULL; GtkWidget *radiobutton4; + GSList *radiobutton4_group = NULL; GtkWidget *radiobutton3; + GSList *radiobutton3_group = NULL; GtkWidget *label56; GtkWidget *frame21; GtkWidget *alignment16; @@ -3462,84 +3095,70 @@ create_PatchFinderWindow (void) GtkWidget *button92; PatchFinderWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (PatchFinderWindow, "PatchFinderWindow"); gtk_window_set_title (GTK_WINDOW (PatchFinderWindow), _("Patch Finder")); gtk_window_set_modal (GTK_WINDOW (PatchFinderWindow), TRUE); gtk_window_set_type_hint (GTK_WINDOW (PatchFinderWindow), GDK_WINDOW_TYPE_HINT_DIALOG); hbox25 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox25, "hbox25"); gtk_widget_show (hbox25); gtk_container_add (GTK_CONTAINER (PatchFinderWindow), hbox25); vbox43 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox43, "vbox43"); gtk_widget_show (vbox43); gtk_box_pack_start (GTK_BOX (hbox25), vbox43, TRUE, TRUE, 0); frame19 = gtk_frame_new (NULL); - gtk_widget_set_name (frame19, "frame19"); gtk_widget_show (frame19); gtk_box_pack_start (GTK_BOX (vbox43), frame19, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame19), GTK_SHADOW_NONE); alignment14 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment14, "alignment14"); gtk_widget_show (alignment14); gtk_container_add (GTK_CONTAINER (frame19), alignment14); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment14), 0, 0, 12, 0); vbox44 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox44, "vbox44"); gtk_widget_show (vbox44); gtk_container_add (GTK_CONTAINER (alignment14), vbox44); radiobutton1 = gtk_radio_button_new_with_mnemonic (NULL, _("EE RAM")); - gtk_widget_set_name (radiobutton1, "radiobutton1"); gtk_widget_show (radiobutton1); gtk_box_pack_start (GTK_BOX (vbox44), radiobutton1, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton1), radiobutton1_group); radiobutton1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton1)); radiobutton2 = gtk_radio_button_new_with_mnemonic (NULL, _("IOP RAM")); - gtk_widget_set_name (radiobutton2, "radiobutton2"); gtk_widget_show (radiobutton2); gtk_box_pack_start (GTK_BOX (vbox44), radiobutton2, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton2), radiobutton1_group); radiobutton1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton2)); label55 = gtk_label_new (_("Search In")); - gtk_widget_set_name (label55, "label55"); gtk_widget_show (label55); gtk_frame_set_label_widget (GTK_FRAME (frame19), label55); gtk_label_set_use_markup (GTK_LABEL (label55), TRUE); frame20 = gtk_frame_new (NULL); - gtk_widget_set_name (frame20, "frame20"); gtk_widget_show (frame20); gtk_box_pack_start (GTK_BOX (vbox43), frame20, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame20), GTK_SHADOW_NONE); alignment15 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment15, "alignment15"); gtk_widget_show (alignment15); gtk_container_add (GTK_CONTAINER (frame20), alignment15); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment15), 0, 0, 12, 0); table6 = gtk_table_new (3, 2, FALSE); - gtk_widget_set_name (table6, "table6"); gtk_widget_show (table6); gtk_container_add (GTK_CONTAINER (alignment15), table6); checkbutton1 = gtk_check_button_new_with_mnemonic (_("Unsigned")); - gtk_widget_set_name (checkbutton1, "checkbutton1"); gtk_widget_show (checkbutton1); gtk_table_attach (GTK_TABLE (table6), checkbutton1, 0, 1, 2, 3, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); radiobutton6 = gtk_radio_button_new_with_mnemonic (NULL, _("64 bits")); - gtk_widget_set_name (radiobutton6, "radiobutton6"); gtk_widget_show (radiobutton6); gtk_table_attach (GTK_TABLE (table6), radiobutton6, 1, 2, 1, 2, (GtkAttachOptions) (0), @@ -3548,216 +3167,182 @@ create_PatchFinderWindow (void) radiobutton6_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton6)); radiobutton5 = gtk_radio_button_new_with_mnemonic (NULL, _("32 bits")); - gtk_widget_set_name (radiobutton5, "radiobutton5"); gtk_widget_show (radiobutton5); gtk_table_attach (GTK_TABLE (table6), radiobutton5, 0, 1, 1, 2, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton5), radiobutton6_group); - radiobutton6_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton5)); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton5), radiobutton5_group); + radiobutton5_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton5)); radiobutton4 = gtk_radio_button_new_with_mnemonic (NULL, _("16 bits")); - gtk_widget_set_name (radiobutton4, "radiobutton4"); gtk_widget_show (radiobutton4); gtk_table_attach (GTK_TABLE (table6), radiobutton4, 1, 2, 0, 1, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton4), radiobutton6_group); - radiobutton6_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton4)); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton4), radiobutton4_group); + radiobutton4_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton4)); radiobutton3 = gtk_radio_button_new_with_mnemonic (NULL, _("8 bits")); - gtk_widget_set_name (radiobutton3, "radiobutton3"); gtk_widget_show (radiobutton3); gtk_table_attach (GTK_TABLE (table6), radiobutton3, 0, 1, 0, 1, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton3), radiobutton6_group); - radiobutton6_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton3)); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton3), radiobutton3_group); + radiobutton3_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton3)); label56 = gtk_label_new (_("Values of Size")); - gtk_widget_set_name (label56, "label56"); gtk_widget_show (label56); gtk_frame_set_label_widget (GTK_FRAME (frame20), label56); gtk_label_set_use_markup (GTK_LABEL (label56), TRUE); frame21 = gtk_frame_new (NULL); - gtk_widget_set_name (frame21, "frame21"); gtk_widget_show (frame21); gtk_box_pack_start (GTK_BOX (vbox43), frame21, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame21), GTK_SHADOW_NONE); alignment16 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment16, "alignment16"); gtk_widget_show (alignment16); gtk_container_add (GTK_CONTAINER (frame21), alignment16); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment16), 0, 0, 12, 0); vbox45 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox45, "vbox45"); gtk_widget_show (vbox45); gtk_container_add (GTK_CONTAINER (alignment16), vbox45); radiobutton7 = gtk_radio_button_new_with_mnemonic (NULL, _("Equal")); - gtk_widget_set_name (radiobutton7, "radiobutton7"); gtk_widget_show (radiobutton7); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton7, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton7), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton7)); radiobutton8 = gtk_radio_button_new_with_mnemonic (NULL, _("Greater Then")); - gtk_widget_set_name (radiobutton8, "radiobutton8"); gtk_widget_show (radiobutton8); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton8, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton8), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton8)); radiobutton9 = gtk_radio_button_new_with_mnemonic (NULL, _("Less Then")); - gtk_widget_set_name (radiobutton9, "radiobutton9"); gtk_widget_show (radiobutton9); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton9, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton9), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton9)); radiobutton10 = gtk_radio_button_new_with_mnemonic (NULL, _("Greater Then or Equal")); - gtk_widget_set_name (radiobutton10, "radiobutton10"); gtk_widget_show (radiobutton10); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton10, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton10), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton10)); radiobutton11 = gtk_radio_button_new_with_mnemonic (NULL, _("Less Then or Equal")); - gtk_widget_set_name (radiobutton11, "radiobutton11"); gtk_widget_show (radiobutton11); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton11, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton11), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton11)); radiobutton12 = gtk_radio_button_new_with_mnemonic (NULL, _("Not Equal")); - gtk_widget_set_name (radiobutton12, "radiobutton12"); gtk_widget_show (radiobutton12); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton12, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton12), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton12)); label57 = gtk_label_new (_("Being")); - gtk_widget_set_name (label57, "label57"); gtk_widget_show (label57); gtk_frame_set_label_widget (GTK_FRAME (frame21), label57); gtk_label_set_use_markup (GTK_LABEL (label57), TRUE); frame22 = gtk_frame_new (NULL); - gtk_widget_set_name (frame22, "frame22"); gtk_widget_show (frame22); gtk_box_pack_start (GTK_BOX (vbox43), frame22, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame22), GTK_SHADOW_NONE); alignment17 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment17, "alignment17"); gtk_widget_show (alignment17); gtk_container_add (GTK_CONTAINER (frame22), alignment17); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment17), 0, 0, 12, 0); vbox46 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox46, "vbox46"); gtk_widget_show (vbox46); gtk_container_add (GTK_CONTAINER (alignment17), vbox46); radiobutton13 = gtk_radio_button_new_with_mnemonic (NULL, _("Old Value")); - gtk_widget_set_name (radiobutton13, "radiobutton13"); gtk_widget_show (radiobutton13); gtk_box_pack_start (GTK_BOX (vbox46), radiobutton13, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton13), radiobutton13_group); radiobutton13_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton13)); radiobutton14 = gtk_radio_button_new_with_mnemonic (NULL, _("Specific Value")); - gtk_widget_set_name (radiobutton14, "radiobutton14"); gtk_widget_show (radiobutton14); gtk_box_pack_start (GTK_BOX (vbox46), radiobutton14, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton14), radiobutton13_group); radiobutton13_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton14)); entry1 = gtk_entry_new (); - gtk_widget_set_name (entry1, "entry1"); gtk_widget_show (entry1); gtk_box_pack_start (GTK_BOX (vbox46), entry1, FALSE, FALSE, 0); label58 = gtk_label_new (_("Compared To")); - gtk_widget_set_name (label58, "label58"); gtk_widget_show (label58); gtk_frame_set_label_widget (GTK_FRAME (frame22), label58); gtk_label_set_use_markup (GTK_LABEL (label58), TRUE); vbox41 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox41, "vbox41"); gtk_widget_show (vbox41); gtk_box_pack_start (GTK_BOX (hbox25), vbox41, TRUE, TRUE, 0); vbox42 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox42, "vbox42"); gtk_widget_show (vbox42); gtk_box_pack_start (GTK_BOX (vbox41), vbox42, TRUE, TRUE, 0); hbox26 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox26, "hbox26"); gtk_widget_show (hbox26); gtk_box_pack_start (GTK_BOX (vbox42), hbox26, FALSE, FALSE, 0); label59 = gtk_label_new (_("Results:")); - gtk_widget_set_name (label59, "label59"); gtk_widget_show (label59); gtk_box_pack_start (GTK_BOX (hbox26), label59, FALSE, FALSE, 0); label60 = gtk_label_new (_("%s")); - gtk_widget_set_name (label60, "label60"); gtk_widget_show (label60); gtk_box_pack_start (GTK_BOX (hbox26), label60, TRUE, TRUE, 0); gtk_label_set_justify (GTK_LABEL (label60), GTK_JUSTIFY_CENTER); label61 = gtk_label_new (_("Ready to Search")); - gtk_widget_set_name (label61, "label61"); gtk_widget_show (label61); gtk_box_pack_start (GTK_BOX (hbox26), label61, TRUE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label61), GTK_JUSTIFY_RIGHT); scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_name (scrolledwindow3, "scrolledwindow3"); gtk_widget_show (scrolledwindow3); gtk_box_pack_start (GTK_BOX (vbox42), scrolledwindow3, TRUE, TRUE, 0); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_SHADOW_IN); treeview2 = gtk_tree_view_new (); - gtk_widget_set_name (treeview2, "treeview2"); gtk_widget_show (treeview2); gtk_container_add (GTK_CONTAINER (scrolledwindow3), treeview2); table5 = gtk_table_new (2, 2, FALSE); - gtk_widget_set_name (table5, "table5"); gtk_widget_show (table5); gtk_box_pack_start (GTK_BOX (vbox41), table5, FALSE, TRUE, 0); button95 = gtk_button_new_from_stock ("gtk-close"); - gtk_widget_set_name (button95, "button95"); gtk_widget_show (button95); gtk_table_attach (GTK_TABLE (table5), button95, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); button94 = gtk_button_new_from_stock ("gtk-add"); - gtk_widget_set_name (button94, "button94"); gtk_widget_show (button94); gtk_table_attach (GTK_TABLE (table5), button94, 0, 1, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); button93 = gtk_button_new_from_stock ("gtk-find"); - gtk_widget_set_name (button93, "button93"); gtk_widget_show (button93); gtk_table_attach (GTK_TABLE (table5), button93, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); button92 = gtk_button_new_from_stock ("gtk-clear"); - gtk_widget_set_name (button92, "button92"); gtk_widget_show (button92); gtk_table_attach (GTK_TABLE (table5), button92, 0, 1, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), @@ -3876,277 +3461,227 @@ create_CpuDlg (void) GtkWidget *button97; CpuDlg = gtk_dialog_new (); - gtk_widget_set_name (CpuDlg, "CpuDlg"); gtk_window_set_title (GTK_WINDOW (CpuDlg), _("dialog1")); gtk_window_set_type_hint (GTK_WINDOW (CpuDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox5 = GTK_DIALOG (CpuDlg)->vbox; - gtk_widget_set_name (dialog_vbox5, "dialog_vbox5"); gtk_widget_show (dialog_vbox5); hbox27 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox27, "hbox27"); gtk_widget_show (hbox27); gtk_box_pack_start (GTK_BOX (dialog_vbox5), hbox27, TRUE, TRUE, 0); vbox47 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox47, "vbox47"); gtk_widget_show (vbox47); gtk_box_pack_start (GTK_BOX (hbox27), vbox47, TRUE, TRUE, 0); frame8 = gtk_frame_new (NULL); - gtk_widget_set_name (frame8, "frame8"); gtk_widget_show (frame8); gtk_box_pack_start (GTK_BOX (vbox47), frame8, TRUE, TRUE, 0); alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment2, "alignment2"); gtk_widget_show (alignment2); gtk_container_add (GTK_CONTAINER (frame8), alignment2); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0); vbox28 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox28, "vbox28"); gtk_widget_show (vbox28); gtk_container_add (GTK_CONTAINER (alignment2), vbox28); GtkLabel_CpuVendor = gtk_label_new (_("CPU vendor")); - gtk_widget_set_name (GtkLabel_CpuVendor, "GtkLabel_CpuVendor"); gtk_widget_show (GtkLabel_CpuVendor); gtk_box_pack_start (GTK_BOX (vbox28), GtkLabel_CpuVendor, FALSE, FALSE, 0); GtkLabel_Family = gtk_label_new (_("Family")); - gtk_widget_set_name (GtkLabel_Family, "GtkLabel_Family"); gtk_widget_show (GtkLabel_Family); gtk_box_pack_start (GTK_BOX (vbox28), GtkLabel_Family, FALSE, FALSE, 0); GtkLabel_CpuSpeed = gtk_label_new (_("Cpu Speed")); - gtk_widget_set_name (GtkLabel_CpuSpeed, "GtkLabel_CpuSpeed"); gtk_widget_show (GtkLabel_CpuSpeed); gtk_box_pack_start (GTK_BOX (vbox28), GtkLabel_CpuSpeed, FALSE, FALSE, 0); GtkLabel_Features = gtk_label_new (_("Features")); - gtk_widget_set_name (GtkLabel_Features, "GtkLabel_Features"); gtk_widget_show (GtkLabel_Features); gtk_box_pack_start (GTK_BOX (vbox28), GtkLabel_Features, FALSE, FALSE, 0); label35 = gtk_label_new (""); - gtk_widget_set_name (label35, "label35"); gtk_widget_show (label35); gtk_frame_set_label_widget (GTK_FRAME (frame8), label35); gtk_label_set_use_markup (GTK_LABEL (label35), TRUE); GtkCheckButton_EERec = gtk_check_button_new_with_mnemonic (_("EERec - EE/IOP recompiler (Need MMX/SSE/SSE2)")); - gtk_widget_set_name (GtkCheckButton_EERec, "GtkCheckButton_EERec"); gtk_widget_show (GtkCheckButton_EERec); gtk_box_pack_start (GTK_BOX (vbox47), GtkCheckButton_EERec, FALSE, FALSE, 0); frame6 = gtk_frame_new (NULL); - gtk_widget_set_name (frame6, "frame6"); gtk_widget_show (frame6); gtk_box_pack_start (GTK_BOX (vbox47), frame6, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame6), 5); vbox26 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox26, "vbox26"); gtk_widget_show (vbox26); gtk_container_add (GTK_CONTAINER (frame6), vbox26); gtk_container_set_border_width (GTK_CONTAINER (vbox26), 5); GtkCheckButton_VU0rec = gtk_check_button_new_with_mnemonic (_("VU0rec - enable recompiler for VU0 unit")); - gtk_widget_set_name (GtkCheckButton_VU0rec, "GtkCheckButton_VU0rec"); gtk_widget_show (GtkCheckButton_VU0rec); gtk_box_pack_start (GTK_BOX (vbox26), GtkCheckButton_VU0rec, FALSE, FALSE, 0); GtkCheckButton_VU1rec = gtk_check_button_new_with_mnemonic (_("VU1rec - enable recompiler for VU1 unit")); - gtk_widget_set_name (GtkCheckButton_VU1rec, "GtkCheckButton_VU1rec"); gtk_widget_show (GtkCheckButton_VU1rec); gtk_box_pack_start (GTK_BOX (vbox26), GtkCheckButton_VU1rec, FALSE, FALSE, 0); label32 = gtk_label_new (_("VU Recompilers - All options are set by default")); - gtk_widget_set_name (label32, "label32"); gtk_widget_show (label32); gtk_frame_set_label_widget (GTK_FRAME (frame6), label32); GtkCheckButton_MTGS = gtk_check_button_new_with_mnemonic (_("Multi threaded GS mode (MTGS)\n (faster on dual core/HT CPUs, requires pcsx2 restart)")); - gtk_widget_set_name (GtkCheckButton_MTGS, "GtkCheckButton_MTGS"); gtk_widget_show (GtkCheckButton_MTGS); gtk_box_pack_start (GTK_BOX (vbox47), GtkCheckButton_MTGS, FALSE, FALSE, 0); vbox48 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox48, "vbox48"); gtk_widget_show (vbox48); gtk_box_pack_start (GTK_BOX (hbox27), vbox48, TRUE, TRUE, 0); frame9 = gtk_frame_new (NULL); - gtk_widget_set_name (frame9, "frame9"); gtk_widget_show (frame9); gtk_box_pack_start (GTK_BOX (vbox48), frame9, TRUE, TRUE, 0); alignment4 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment4, "alignment4"); gtk_widget_show (alignment4); gtk_container_add (GTK_CONTAINER (frame9), alignment4); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment4), 0, 0, 12, 0); vbox29 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox29, "vbox29"); gtk_widget_show (vbox29); gtk_container_add (GTK_CONTAINER (alignment4), vbox29); GtkRadioButton_LimitNormal = gtk_radio_button_new_with_mnemonic (NULL, _("Normal - All frames are rendered as fast as possible")); - gtk_widget_set_name (GtkRadioButton_LimitNormal, "GtkRadioButton_LimitNormal"); gtk_widget_show (GtkRadioButton_LimitNormal); gtk_box_pack_start (GTK_BOX (vbox29), GtkRadioButton_LimitNormal, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitNormal), GtkRadioButton_LimitNormal_group); GtkRadioButton_LimitNormal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitNormal)); GtkRadioButton_LimitLimit = gtk_radio_button_new_with_mnemonic (NULL, _("Limit - Force frames to normal speeds if too fast")); - gtk_widget_set_name (GtkRadioButton_LimitLimit, "GtkRadioButton_LimitLimit"); gtk_widget_show (GtkRadioButton_LimitLimit); gtk_box_pack_start (GTK_BOX (vbox29), GtkRadioButton_LimitLimit, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitLimit), GtkRadioButton_LimitNormal_group); GtkRadioButton_LimitNormal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitLimit)); GtkRadioButton_LimitFS = gtk_radio_button_new_with_mnemonic (NULL, _("Frame Skip - In order to achieve normal speeds, \n some frames are skipped (faster).\n Fps displayed counts skipped frames too")); - gtk_widget_set_name (GtkRadioButton_LimitFS, "GtkRadioButton_LimitFS"); gtk_widget_show (GtkRadioButton_LimitFS); gtk_box_pack_start (GTK_BOX (vbox29), GtkRadioButton_LimitFS, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitFS), GtkRadioButton_LimitNormal_group); GtkRadioButton_LimitNormal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitFS)); GtkRadioButton_VUSkip = gtk_radio_button_new_with_mnemonic (NULL, _("VU Skip - Same as Frame Skip, but tried to skip more. \n Artifacts might be present, but will be faster")); - gtk_widget_set_name (GtkRadioButton_VUSkip, "GtkRadioButton_VUSkip"); gtk_widget_show (GtkRadioButton_VUSkip); gtk_box_pack_start (GTK_BOX (vbox29), GtkRadioButton_VUSkip, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_VUSkip), GtkRadioButton_LimitNormal_group); GtkRadioButton_LimitNormal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_VUSkip)); label41 = gtk_label_new (_("Frame Limiting (F4 switches in-game)")); - gtk_widget_set_name (label41, "label41"); gtk_widget_show (label41); gtk_frame_set_label_widget (GTK_FRAME (frame9), label41); gtk_label_set_use_markup (GTK_LABEL (label41), TRUE); frame23 = gtk_frame_new (NULL); - gtk_widget_set_name (frame23, "frame23"); gtk_widget_show (frame23); gtk_box_pack_start (GTK_BOX (vbox48), frame23, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame23), GTK_SHADOW_NONE); alignment18 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment18, "alignment18"); gtk_widget_show (alignment18); gtk_container_add (GTK_CONTAINER (frame23), alignment18); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment18), 0, 0, 12, 0); vbox49 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox49, "vbox49"); gtk_widget_show (vbox49); gtk_container_add (GTK_CONTAINER (alignment18), vbox49); hbox29 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox29, "hbox29"); gtk_widget_show (hbox29); gtk_box_pack_start (GTK_BOX (vbox49), hbox29, TRUE, TRUE, 0); label66 = gtk_label_new (_("Custom FPS Limit (0=auto):")); - gtk_widget_set_name (label66, "label66"); gtk_widget_show (label66); gtk_box_pack_start (GTK_BOX (hbox29), label66, TRUE, TRUE, 0); CustomFPSLimit_adj = gtk_adjustment_new (0, 0, 9999, 1, 0, 0); CustomFPSLimit = gtk_spin_button_new (GTK_ADJUSTMENT (CustomFPSLimit_adj), 1, 0); - gtk_widget_set_name (CustomFPSLimit, "CustomFPSLimit"); gtk_widget_show (CustomFPSLimit); gtk_box_pack_end (GTK_BOX (hbox29), CustomFPSLimit, FALSE, TRUE, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (CustomFPSLimit), TRUE); hbox30 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox30, "hbox30"); gtk_widget_show (hbox30); gtk_box_pack_start (GTK_BOX (vbox49), hbox30, TRUE, TRUE, 0); label67 = gtk_label_new (_("Skip Frames when slower than[1]:")); - gtk_widget_set_name (label67, "label67"); gtk_widget_show (label67); gtk_box_pack_start (GTK_BOX (hbox30), label67, TRUE, TRUE, 0); FrameThreshold_adj = gtk_adjustment_new (0, 0, 9999, 1, 0, 0); FrameThreshold = gtk_spin_button_new (GTK_ADJUSTMENT (FrameThreshold_adj), 1, 0); - gtk_widget_set_name (FrameThreshold, "FrameThreshold"); gtk_widget_show (FrameThreshold); gtk_box_pack_end (GTK_BOX (hbox30), FrameThreshold, FALSE, TRUE, 0); hbox31 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox31, "hbox31"); gtk_widget_show (hbox31); gtk_box_pack_start (GTK_BOX (vbox49), hbox31, TRUE, TRUE, 0); label68 = gtk_label_new (_("Consecutive Frames before skipping[2]:")); - gtk_widget_set_name (label68, "label68"); gtk_widget_show (label68); gtk_box_pack_start (GTK_BOX (hbox31), label68, TRUE, TRUE, 0); FramesBeforeSkipping_adj = gtk_adjustment_new (0, 0, 9999, 1, 0, 0); FramesBeforeSkipping = gtk_spin_button_new (GTK_ADJUSTMENT (FramesBeforeSkipping_adj), 1, 0); - gtk_widget_set_name (FramesBeforeSkipping, "FramesBeforeSkipping"); gtk_widget_show (FramesBeforeSkipping); gtk_box_pack_end (GTK_BOX (hbox31), FramesBeforeSkipping, FALSE, TRUE, 0); hbox32 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox32, "hbox32"); gtk_widget_show (hbox32); gtk_box_pack_start (GTK_BOX (vbox49), hbox32, TRUE, TRUE, 0); label69 = gtk_label_new (_("Consecutive Frames to skip[3]:")); - gtk_widget_set_name (label69, "label69"); gtk_widget_show (label69); gtk_box_pack_start (GTK_BOX (hbox32), label69, TRUE, TRUE, 0); FramesToSkip_adj = gtk_adjustment_new (0, 0, 9999, 1, 0, 0); FramesToSkip = gtk_spin_button_new (GTK_ADJUSTMENT (FramesToSkip_adj), 1, 0); - gtk_widget_set_name (FramesToSkip, "FramesToSkip"); gtk_widget_show (FramesToSkip); gtk_box_pack_end (GTK_BOX (hbox32), FramesToSkip, FALSE, TRUE, 0); label63 = gtk_label_new (_("[1] Only skips when slower then this number(0 is auto; 9999 always skips).")); - gtk_widget_set_name (label63, "label63"); gtk_widget_show (label63); gtk_box_pack_start (GTK_BOX (vbox49), label63, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label63), TRUE); label64 = gtk_label_new (_("[2] Renders this many frames before skipping (0 is default).")); - gtk_widget_set_name (label64, "label64"); gtk_widget_show (label64); gtk_box_pack_start (GTK_BOX (vbox49), label64, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label64), TRUE); label65 = gtk_label_new (_("[3] Skips this many frames before continuing (0 is default).")); - gtk_widget_set_name (label65, "label65"); gtk_widget_show (label65); gtk_box_pack_start (GTK_BOX (vbox49), label65, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label65), TRUE); label62 = gtk_label_new (_("Detailed Settings")); - gtk_widget_set_name (label62, "label62"); gtk_widget_show (label62); gtk_frame_set_label_widget (GTK_FRAME (frame23), label62); gtk_label_set_use_markup (GTK_LABEL (label62), TRUE); dialog_action_area5 = GTK_DIALOG (CpuDlg)->action_area; - gtk_widget_set_name (dialog_action_area5, "dialog_action_area5"); gtk_widget_show (dialog_action_area5); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area5), GTK_BUTTONBOX_END); button96 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (button96, "button96"); gtk_widget_show (button96); gtk_dialog_add_action_widget (GTK_DIALOG (CpuDlg), button96, 0); GTK_WIDGET_SET_FLAGS (button96, GTK_CAN_DEFAULT); button97 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (button97, "button97"); gtk_widget_show (button97); gtk_dialog_add_action_widget (GTK_DIALOG (CpuDlg), button97, 0); GTK_WIDGET_SET_FLAGS (button97, GTK_CAN_DEFAULT); @@ -4266,253 +3801,205 @@ create_Logging (void) GtkWidget *Logging2Cancel; Logging = gtk_dialog_new (); - gtk_widget_set_name (Logging, "Logging"); gtk_window_set_title (GTK_WINDOW (Logging), _("Logging")); gtk_window_set_default_size (GTK_WINDOW (Logging), 200, 450); gtk_window_set_type_hint (GTK_WINDOW (Logging), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox6 = GTK_DIALOG (Logging)->vbox; - gtk_widget_set_name (dialog_vbox6, "dialog_vbox6"); gtk_widget_show (dialog_vbox6); scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_name (scrolledwindow4, "scrolledwindow4"); gtk_widget_show (scrolledwindow4); gtk_box_pack_start (GTK_BOX (dialog_vbox6), scrolledwindow4, TRUE, TRUE, 0); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN); viewport2 = gtk_viewport_new (NULL, NULL); - gtk_widget_set_name (viewport2, "viewport2"); gtk_widget_show (viewport2); gtk_container_add (GTK_CONTAINER (scrolledwindow4), viewport2); vbox55 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox55, "vbox55"); gtk_widget_show (vbox55); gtk_container_add (GTK_CONTAINER (viewport2), vbox55); frame33 = gtk_frame_new (NULL); - gtk_widget_set_name (frame33, "frame33"); gtk_widget_show (frame33); gtk_box_pack_start (GTK_BOX (vbox55), frame33, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame33), GTK_SHADOW_NONE); alignment28 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment28, "alignment28"); gtk_widget_show (alignment28); gtk_container_add (GTK_CONTAINER (frame33), alignment28); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment28), 0, 0, 12, 0); vbox56 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox56, "vbox56"); gtk_widget_show (vbox56); gtk_container_add (GTK_CONTAINER (alignment28), vbox56); Log0 = gtk_check_button_new_with_mnemonic (_("Cpu Log")); - gtk_widget_set_name (Log0, "Log0"); gtk_widget_show (Log0); gtk_box_pack_start (GTK_BOX (vbox56), Log0, FALSE, FALSE, 0); Log1 = gtk_check_button_new_with_mnemonic (_("Mem Log")); - gtk_widget_set_name (Log1, "Log1"); gtk_widget_show (Log1); gtk_box_pack_start (GTK_BOX (vbox56), Log1, FALSE, FALSE, 0); Log2 = gtk_check_button_new_with_mnemonic (_("Hw Log")); - gtk_widget_set_name (Log2, "Log2"); gtk_widget_show (Log2); gtk_box_pack_start (GTK_BOX (vbox56), Log2, FALSE, FALSE, 0); Log3 = gtk_check_button_new_with_mnemonic (_("Dma Log")); - gtk_widget_set_name (Log3, "Log3"); gtk_widget_show (Log3); gtk_box_pack_start (GTK_BOX (vbox56), Log3, FALSE, FALSE, 0); Log4 = gtk_check_button_new_with_mnemonic (_("Bios Log")); - gtk_widget_set_name (Log4, "Log4"); gtk_widget_show (Log4); gtk_box_pack_start (GTK_BOX (vbox56), Log4, FALSE, FALSE, 0); Log5 = gtk_check_button_new_with_mnemonic (_("Elf Log")); - gtk_widget_set_name (Log5, "Log5"); gtk_widget_show (Log5); gtk_box_pack_start (GTK_BOX (vbox56), Log5, FALSE, FALSE, 0); Log6 = gtk_check_button_new_with_mnemonic (_("Fpu Log")); - gtk_widget_set_name (Log6, "Log6"); gtk_widget_show (Log6); gtk_box_pack_start (GTK_BOX (vbox56), Log6, FALSE, FALSE, 0); Log7 = gtk_check_button_new_with_mnemonic (_("MMI Log")); - gtk_widget_set_name (Log7, "Log7"); gtk_widget_show (Log7); gtk_box_pack_start (GTK_BOX (vbox56), Log7, FALSE, FALSE, 0); Log8 = gtk_check_button_new_with_mnemonic (_("VU0 Log")); - gtk_widget_set_name (Log8, "Log8"); gtk_widget_show (Log8); gtk_box_pack_start (GTK_BOX (vbox56), Log8, FALSE, FALSE, 0); Log9 = gtk_check_button_new_with_mnemonic (_("Cop0 Log")); - gtk_widget_set_name (Log9, "Log9"); gtk_widget_show (Log9); gtk_box_pack_start (GTK_BOX (vbox56), Log9, FALSE, FALSE, 0); Log10 = gtk_check_button_new_with_mnemonic (_("Vif Log")); - gtk_widget_set_name (Log10, "Log10"); gtk_widget_show (Log10); gtk_box_pack_start (GTK_BOX (vbox56), Log10, FALSE, FALSE, 0); Log11 = gtk_check_button_new_with_mnemonic (_("SPR Log")); - gtk_widget_set_name (Log11, "Log11"); gtk_widget_show (Log11); gtk_box_pack_start (GTK_BOX (vbox56), Log11, FALSE, FALSE, 0); Log12 = gtk_check_button_new_with_mnemonic (_("GIF Log")); - gtk_widget_set_name (Log12, "Log12"); gtk_widget_show (Log12); gtk_box_pack_start (GTK_BOX (vbox56), Log12, FALSE, FALSE, 0); Log13 = gtk_check_button_new_with_mnemonic (_("Sif Log")); - gtk_widget_set_name (Log13, "Log13"); gtk_widget_show (Log13); gtk_box_pack_start (GTK_BOX (vbox56), Log13, FALSE, FALSE, 0); Log14 = gtk_check_button_new_with_mnemonic (_("IPU Log")); - gtk_widget_set_name (Log14, "Log14"); gtk_widget_show (Log14); gtk_box_pack_start (GTK_BOX (vbox56), Log14, FALSE, FALSE, 0); Log15 = gtk_check_button_new_with_mnemonic (_("VU Micro Log")); - gtk_widget_set_name (Log15, "Log15"); gtk_widget_show (Log15); gtk_box_pack_start (GTK_BOX (vbox56), Log15, FALSE, FALSE, 0); Log16 = gtk_check_button_new_with_mnemonic (_("RPC Log")); - gtk_widget_set_name (Log16, "Log16"); gtk_widget_show (Log16); gtk_box_pack_start (GTK_BOX (vbox56), Log16, FALSE, FALSE, 0); label85 = gtk_label_new (_("EE Logs")); - gtk_widget_set_name (label85, "label85"); gtk_widget_show (label85); gtk_frame_set_label_widget (GTK_FRAME (frame33), label85); gtk_label_set_use_markup (GTK_LABEL (label85), TRUE); frame34 = gtk_frame_new (NULL); - gtk_widget_set_name (frame34, "frame34"); gtk_widget_show (frame34); gtk_box_pack_start (GTK_BOX (vbox55), frame34, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame34), GTK_SHADOW_NONE); alignment29 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment29, "alignment29"); gtk_widget_show (alignment29); gtk_container_add (GTK_CONTAINER (frame34), alignment29); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment29), 0, 0, 12, 0); vbox57 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox57, "vbox57"); gtk_widget_show (vbox57); gtk_container_add (GTK_CONTAINER (alignment29), vbox57); Log20 = gtk_check_button_new_with_mnemonic (_("IOP Log")); - gtk_widget_set_name (Log20, "Log20"); gtk_widget_show (Log20); gtk_box_pack_start (GTK_BOX (vbox57), Log20, FALSE, FALSE, 0); Log21 = gtk_check_button_new_with_mnemonic (_("Mem Log")); - gtk_widget_set_name (Log21, "Log21"); gtk_widget_show (Log21); gtk_box_pack_start (GTK_BOX (vbox57), Log21, FALSE, FALSE, 0); Log22 = gtk_check_button_new_with_mnemonic (_("Hw Log")); - gtk_widget_set_name (Log22, "Log22"); gtk_widget_show (Log22); gtk_box_pack_start (GTK_BOX (vbox57), Log22, FALSE, FALSE, 0); Log23 = gtk_check_button_new_with_mnemonic (_("Bios Log")); - gtk_widget_set_name (Log23, "Log23"); gtk_widget_show (Log23); gtk_box_pack_start (GTK_BOX (vbox57), Log23, FALSE, FALSE, 0); Log24 = gtk_check_button_new_with_mnemonic (_("Dma Log")); - gtk_widget_set_name (Log24, "Log24"); gtk_widget_show (Log24); gtk_box_pack_start (GTK_BOX (vbox57), Log24, FALSE, FALSE, 0); Log25 = gtk_check_button_new_with_mnemonic (_("Pad Log")); - gtk_widget_set_name (Log25, "Log25"); gtk_widget_show (Log25); gtk_box_pack_start (GTK_BOX (vbox57), Log25, FALSE, FALSE, 0); Log26 = gtk_check_button_new_with_mnemonic (_("Gte Log")); - gtk_widget_set_name (Log26, "Log26"); gtk_widget_show (Log26); gtk_box_pack_start (GTK_BOX (vbox57), Log26, FALSE, FALSE, 0); Log27 = gtk_check_button_new_with_mnemonic (_("Cdr Log")); - gtk_widget_set_name (Log27, "Log27"); gtk_widget_show (Log27); gtk_box_pack_start (GTK_BOX (vbox57), Log27, FALSE, FALSE, 0); Log28 = gtk_check_button_new_with_mnemonic (_("GPU Log")); - gtk_widget_set_name (Log28, "Log28"); gtk_widget_show (Log28); gtk_box_pack_start (GTK_BOX (vbox57), Log28, FALSE, FALSE, 0); label86 = gtk_label_new (_("IOP Logs")); - gtk_widget_set_name (label86, "label86"); gtk_widget_show (label86); gtk_frame_set_label_widget (GTK_FRAME (frame34), label86); gtk_label_set_use_markup (GTK_LABEL (label86), TRUE); frame35 = gtk_frame_new (NULL); - gtk_widget_set_name (frame35, "frame35"); gtk_widget_show (frame35); gtk_box_pack_start (GTK_BOX (vbox55), frame35, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame35), GTK_SHADOW_NONE); alignment30 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment30, "alignment30"); gtk_widget_show (alignment30); gtk_container_add (GTK_CONTAINER (frame35), alignment30); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment30), 0, 0, 12, 0); vbox58 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox58, "vbox58"); gtk_widget_show (vbox58); gtk_container_add (GTK_CONTAINER (alignment30), vbox58); Log31 = gtk_check_button_new_with_mnemonic (_("Log to STDOUT")); - gtk_widget_set_name (Log31, "Log31"); gtk_widget_show (Log31); gtk_box_pack_start (GTK_BOX (vbox58), Log31, FALSE, FALSE, 0); Log30 = gtk_check_button_new_with_mnemonic (_("SYMs Log")); - gtk_widget_set_name (Log30, "Log30"); gtk_widget_show (Log30); gtk_box_pack_start (GTK_BOX (vbox58), Log30, FALSE, FALSE, 0); label87 = gtk_label_new (_("Misc")); - gtk_widget_set_name (label87, "label87"); gtk_widget_show (label87); gtk_frame_set_label_widget (GTK_FRAME (frame35), label87); gtk_label_set_use_markup (GTK_LABEL (label87), TRUE); dialog_action_area6 = GTK_DIALOG (Logging)->action_area; - gtk_widget_set_name (dialog_action_area6, "dialog_action_area6"); gtk_widget_show (dialog_action_area6); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area6), GTK_BUTTONBOX_END); Logging_Ok = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (Logging_Ok, "Logging_Ok"); gtk_widget_show (Logging_Ok); gtk_dialog_add_action_widget (GTK_DIALOG (Logging), Logging_Ok, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (Logging_Ok, GTK_CAN_DEFAULT); Logging2Cancel = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (Logging2Cancel, "Logging2Cancel"); gtk_widget_show (Logging2Cancel); gtk_dialog_add_action_widget (GTK_DIALOG (Logging), Logging2Cancel, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (Logging2Cancel, GTK_CAN_DEFAULT); @@ -4608,137 +4095,111 @@ create_MemDlg (void) GtkWidget *okbutton1; MemDlg = gtk_dialog_new (); - gtk_widget_set_name (MemDlg, "MemDlg"); gtk_window_set_title (GTK_WINDOW (MemDlg), _("Memcards")); gtk_window_set_type_hint (GTK_WINDOW (MemDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox7 = GTK_DIALOG (MemDlg)->vbox; - gtk_widget_set_name (dialog_vbox7, "dialog_vbox7"); gtk_widget_show (dialog_vbox7); hbox40 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox40, "hbox40"); gtk_widget_show (hbox40); gtk_box_pack_start (GTK_BOX (dialog_vbox7), hbox40, TRUE, TRUE, 0); hbox41 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox41, "hbox41"); gtk_widget_show (hbox41); gtk_box_pack_start (GTK_BOX (hbox40), hbox41, TRUE, TRUE, 0); vbox64 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox64, "vbox64"); gtk_widget_show (vbox64); gtk_box_pack_start (GTK_BOX (hbox41), vbox64, TRUE, TRUE, 0); vbox70 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox70, "vbox70"); gtk_widget_show (vbox70); gtk_box_pack_start (GTK_BOX (vbox64), vbox70, TRUE, TRUE, 0); hbox46 = gtk_hbox_new (TRUE, 0); - gtk_widget_set_name (hbox46, "hbox46"); gtk_widget_show (hbox46); gtk_box_pack_start (GTK_BOX (vbox70), hbox46, TRUE, TRUE, 0); check_enable_mcd1 = gtk_check_button_new_with_mnemonic (_("Enabled")); - gtk_widget_set_name (check_enable_mcd1, "check_enable_mcd1"); gtk_widget_show (check_enable_mcd1); gtk_box_pack_start (GTK_BOX (hbox46), check_enable_mcd1, FALSE, FALSE, 0); check_enable_mcd2 = gtk_check_button_new_with_mnemonic (_("Enabled")); - gtk_widget_set_name (check_enable_mcd2, "check_enable_mcd2"); gtk_widget_show (check_enable_mcd2); gtk_box_pack_start (GTK_BOX (hbox46), check_enable_mcd2, FALSE, FALSE, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_enable_mcd2), TRUE); vbox65 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox65, "vbox65"); gtk_widget_show (vbox65); gtk_box_pack_start (GTK_BOX (vbox64), vbox65, TRUE, TRUE, 0); vbox66 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox66, "vbox66"); gtk_widget_show (vbox66); gtk_box_pack_start (GTK_BOX (vbox65), vbox66, TRUE, TRUE, 0); hbox44 = gtk_hbox_new (TRUE, 0); - gtk_widget_set_name (hbox44, "hbox44"); gtk_widget_show (hbox44); gtk_box_pack_start (GTK_BOX (vbox66), hbox44, TRUE, TRUE, 0); label106 = gtk_label_new (_("Memcard 1")); - gtk_widget_set_name (label106, "label106"); gtk_widget_show (label106); gtk_box_pack_start (GTK_BOX (hbox44), label106, TRUE, TRUE, 0); label107 = gtk_label_new (_("Memcard 2")); - gtk_widget_set_name (label107, "label107"); gtk_widget_show (label107); gtk_box_pack_start (GTK_BOX (hbox44), label107, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label107), GTK_JUSTIFY_RIGHT); hbox45 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox45, "hbox45"); gtk_widget_show (hbox45); gtk_box_pack_start (GTK_BOX (vbox66), hbox45, TRUE, TRUE, 0); memcard1combo = gtk_combo_box_new_text (); - gtk_widget_set_name (memcard1combo, "memcard1combo"); gtk_widget_show (memcard1combo); gtk_box_pack_start (GTK_BOX (hbox45), memcard1combo, TRUE, TRUE, 0); memcard2combo = gtk_combo_box_new_text (); - gtk_widget_set_name (memcard2combo, "memcard2combo"); gtk_widget_show (memcard2combo); gtk_box_pack_start (GTK_BOX (hbox45), memcard2combo, TRUE, TRUE, 0); frame38 = gtk_frame_new (NULL); - gtk_widget_set_name (frame38, "frame38"); gtk_widget_show (frame38); gtk_box_pack_start (GTK_BOX (hbox41), frame38, TRUE, TRUE, 0); alignment33 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment33, "alignment33"); gtk_widget_show (alignment33); gtk_container_add (GTK_CONTAINER (frame38), alignment33); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment33), 0, 0, 12, 0); vbox63 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox63, "vbox63"); gtk_widget_show (vbox63); gtk_container_add (GTK_CONTAINER (alignment33), vbox63); check_eject_mcds = gtk_check_button_new_with_mnemonic (_("Eject Mcds when loading SaveStates")); - gtk_widget_set_name (check_eject_mcds, "check_eject_mcds"); gtk_widget_show (check_eject_mcds); gtk_box_pack_start (GTK_BOX (vbox63), check_eject_mcds, FALSE, FALSE, 0); label103 = gtk_label_new (_("This feature tells games when the mcd contents have changed so that they re-index the new Mcd contents. WARNING: Disabling this option is NOT recommended, and could lead to MemCard corruption if you also use SaveStates.")); - gtk_widget_set_name (label103, "label103"); gtk_widget_show (label103); gtk_box_pack_start (GTK_BOX (vbox63), label103, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label103), TRUE); label102 = gtk_label_new (_("Options")); - gtk_widget_set_name (label102, "label102"); gtk_widget_show (label102); gtk_frame_set_label_widget (GTK_FRAME (frame38), label102); gtk_label_set_use_markup (GTK_LABEL (label102), TRUE); dialog_action_area7 = GTK_DIALOG (MemDlg)->action_area; - gtk_widget_set_name (dialog_action_area7, "dialog_action_area7"); gtk_widget_show (dialog_action_area7); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area7), GTK_BUTTONBOX_END); memcardcancelbutton = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_set_name (memcardcancelbutton, "memcardcancelbutton"); gtk_widget_show (memcardcancelbutton); gtk_dialog_add_action_widget (GTK_DIALOG (MemDlg), memcardcancelbutton, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (memcardcancelbutton, GTK_CAN_DEFAULT); okbutton1 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_set_name (okbutton1, "okbutton1"); gtk_widget_show (okbutton1); gtk_dialog_add_action_widget (GTK_DIALOG (MemDlg), okbutton1, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); diff --git a/pcsx2/Linux/pcsx2.glade b/pcsx2/Linux/pcsx2.glade index febf8721c1..2d12461de5 100644 --- a/pcsx2/Linux/pcsx2.glade +++ b/pcsx2/Linux/pcsx2.glade @@ -1,8516 +1,5568 @@ - - - + + + - - - True - Advanced Options - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_SPREAD - - - - True - True - True - Defaults - True - GTK_RELIEF_NORMAL - True - 0 - - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - Nearest - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Negative - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_EE_Round_Near - - - 0 - False - False - - - - - - True - True - Positive - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_EE_Round_Near - - - 0 - False - False - - - - - - True - True - Chop/Zero - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_EE_Round_Near - - - 0 - False - False - - - - - - - - - - True - <b>Round Mode</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - None - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Normal - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_EE_Clamp_None - - - 0 - False - False - - - - - - True - True - Extra + Preserve Sign - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_EE_Clamp_None - - - 0 - False - False - - - - - - True - True - Full - True - GTK_RELIEF_NORMAL - True - True - False - True - radio_EE_Clamp_None - - - 0 - True - True - - - - - - - - - - True - <b>Clamp Mode</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - True - Flush to Zero - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Denormals are Zero - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - - - True - <b>EE Recs Options</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - Nearest - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Negative - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_VU_Round_Near - - - 0 - False - False - - - - - - True - True - Positive - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_VU_Round_Near - - - 0 - False - False - - - - - - True - True - Zero - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_VU_Round_Near - - - 0 - False - False - - - - - - - - - - True - <b>Round Mode</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - None - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Normal - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_VU_Clamp_None - - - 0 - False - False - - - - - - True - True - Extra - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_VU_Clamp_None - - - 0 - False - False - - - - - - True - True - Extra + Preserve Sign - True - GTK_RELIEF_NORMAL - True - False - False - True - radio_VU_Clamp_None - - - 0 - False - False - - - - - - - - - - True - <b>Clamp Mode</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 2 - 2 - False - 0 - 0 - - - - True - False - True - Software Emulate DaZ - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 2 - 1 - 2 - - - - - - - - True - False - True - Set O & U Flags - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - 1 - 1 - 2 - - - - - - - - True - True - Denormals are Zero - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 2 - 0 - 1 - - - - - - - - True - True - Flush to Zero - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - 1 - 0 - 1 - - - - - - - 0 - True - True - - - - - - - - - - True - <b>VU Recs Options</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - These options specify how your CPU rounds floating point values. + + True + Advanced Options + GDK_WINDOW_TYPE_HINT_DIALOG + + + True + + + True + + + True + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + Nearest + True + 0 + True + + + False + False + + + + + True + True + Negative + True + 0 + True + radio_EE_Round_Near + + + False + False + 1 + + + + + True + True + Positive + True + 0 + True + radio_EE_Round_Near + + + False + False + 2 + + + + + True + True + Chop/Zero + True + 0 + True + radio_EE_Round_Near + + + False + False + 3 + + + + + + + + + True + <b>Round Mode</b> + True + + + label_item + + + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + None + True + 0 + True + + + False + False + + + + + True + True + Normal + True + 0 + True + radio_EE_Clamp_None + + + False + False + 1 + + + + + True + True + Extra + Preserve Sign + True + 0 + True + radio_EE_Clamp_None + + + False + False + 2 + + + + + True + True + Full + True + 0 + True + True + radio_EE_Clamp_None + + + 3 + + + + + + + + + True + <b>Clamp Mode</b> + True + + + label_item + + + + + 1 + + + + + True + + + True + True + Flush to Zero + True + 0 + True + + + False + False + + + + + True + True + Denormals are Zero + True + 0 + True + + + False + False + 1 + + + + + 2 + + + + + + + + + True + <b>EE Recs Options</b> + True + + + label_item + + + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + Nearest + True + 0 + True + + + False + False + + + + + True + True + Negative + True + 0 + True + radio_VU_Round_Near + + + False + False + 1 + + + + + True + True + Positive + True + 0 + True + radio_VU_Round_Near + + + False + False + 2 + + + + + True + True + Zero + True + 0 + True + radio_VU_Round_Near + + + False + False + 3 + + + + + + + + + True + <b>Round Mode</b> + True + + + label_item + + + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + None + True + 0 + True + + + False + False + + + + + True + True + Normal + True + 0 + True + radio_VU_Clamp_None + + + False + False + 1 + + + + + True + True + Extra + True + 0 + True + radio_VU_Clamp_None + + + False + False + 2 + + + + + True + True + Extra + Preserve Sign + True + 0 + True + radio_VU_Clamp_None + + + False + False + 3 + + + + + + + + + True + <b>Clamp Mode</b> + True + + + label_item + + + + + 1 + + + + + True + 2 + 2 + + + True + False + True + Software Emulate DaZ + True + 0 + True + + + 1 + 2 + 1 + 2 + + + + + + + True + False + True + Set O & U Flags + True + 0 + True + + + 1 + 2 + + + + + + + True + True + Denormals are Zero + True + 0 + True + + + 1 + 2 + + + + + + + True + True + Flush to Zero + True + 0 + True + + + + + + + + + 2 + + + + + + + + + True + <b>VU Recs Options</b> + True + + + label_item + + + + + 1 + + + + + + + True + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + These options specify how your CPU rounds floating point values. Try changing the roundmode for EE if your game hangs, it could make it work again. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - - - - True - <b>Round Mode</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - These options specify how PCSX2's recompilers will clamp Infinities and NaN (Not a Number) values in the opcode instructions. + True + + + + + + + True + <b>Round Mode</b> + True + + + label_item + + + + + False + False + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + These options specify how PCSX2's recompilers will clamp Infinities and NaN (Not a Number) values in the opcode instructions. None - No clamping. (Fastest Mode) Normal - Clamps the result. Extra - Clamps the operands, the result, and anywhere in between. -Extra + Preserve Sign - Same as ""Extra"", except preserves NaN's sign when clamping the operands. (Slowest Mode) - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - - - - True - <b>Clamp Mode</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - Flush to Zero - Your CPU makes Floating Point Underflows become Zero, so it does less work. (Speed Up) +Extra + Preserve Sign - Same as ""Extra"", except preserves NaN's sign when clamping the operands. (Slowest Mode) + True + + + + + + + True + <b>Clamp Mode</b> + True + + + label_item + + + + + False + False + 1 + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + Flush to Zero - Your CPU makes Floating Point Underflows become Zero, so it does less work. (Speed Up) Denormals are Zero - Your CPU makes Floating Point Denormals become Zero, so it does less work. (Speed Up) - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - - - - True - <b>Other Options</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - True - PCSX2 Speed Hacks - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - These hacks will affect the speed of PCSX2 but possibly compromise compatibility. + True + + + + + + + True + <b>Other Options</b> + True + + + label_item + + + + + False + False + 2 + + + + + 1 + + + + + 2 + + + + + True + GTK_BUTTONBOX_SPREAD + + + True + True + True + Defaults + True + 0 + + + + + + True + True + True + gtk-ok + True + -5 + + + + 1 + + + + + True + True + True + gtk-cancel + True + -6 + + + + 2 + + + + + False + GTK_PACK_END + + + + + + + True + PCSX2 Speed Hacks + GDK_WINDOW_TYPE_HINT_DIALOG + + + True + + + True + + + True + These hacks will affect the speed of PCSX2 but possibly compromise compatibility. If you have problems, Disable all of these and try again. - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 2 - - - - True - True - Default Cycle Rate - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - Most compatible option - recommended for everyone with high-end machines. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.289999991655 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - Use x1.5 Cycle Rate - True - GTK_RELIEF_NORMAL - True - False - False - True - check_default_cycle_rate - - - 0 - False - False - - - - - - True - Moderate speedup, and works well with most games. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.289999991655 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - Use x2 Cycle Rate - True - GTK_RELIEF_NORMAL - True - False - False - True - check_default_cycle_rate - - - 0 - False - False - - - - - - True - Big speedup! Works well with many games. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.360000014305 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - Use x3 Cycle Rate - True - GTK_RELIEF_NORMAL - True - False - False - True - check_default_cycle_rate - - - 0 - False - False - - - - - - True - Big speedup, but causes flickering or missing geometry on many games. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.239999994636 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - - - 0 - False - False - - - - - - True - Important: X2 & X3 sync hacks *will* cause choppy/skippy audio on many FMV movies. + + + False + False + + + + + True + + + True + 0 + + + True + 12 + + + True + 2 + + + True + True + Default Cycle Rate + True + 0 + True + + + False + False + + + + + True + 0.28999999165534973 + Most compatible option - recommended for everyone with high-end machines. + True + + + False + False + 1 + + + + + True + True + Use x1.5 Cycle Rate + True + 0 + True + check_default_cycle_rate + + + False + False + 2 + + + + + True + 0.28999999165534973 + Moderate speedup, and works well with most games. + True + + + False + False + 3 + + + + + True + True + Use x2 Cycle Rate + True + 0 + True + check_default_cycle_rate + + + False + False + 4 + + + + + True + 0.36000001430511475 + Big speedup! Works well with many games. + True + + + False + False + 5 + + + + + True + True + Use x3 Cycle Rate + True + 0 + True + check_default_cycle_rate + + + False + False + 6 + + + + + True + 0.23999999463558197 + Big speedup, but causes flickering or missing geometry on many games. + True + + + False + False + 7 + + + + + True + + + False + False + 8 + + + + + True + Important: X2 & X3 sync hacks *will* cause choppy/skippy audio on many FMV movies. Known to work well with a couple games, namely Shadow of the Colossus (but breaks most other games). - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - True - <b>EmotionEngine (EE) Sync Hacks</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - True - Enable IOP x2 Cycle Rate - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - Small speedup, and works well with most games, - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - check_iop_cycle_rate - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - WaitCycles Sync Hack - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - Small speedup. Works well with most games, but it may cause certain games to crash, or freeze up during bootup or stage changes. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - check_wait_cycles_sync_hack - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - INTC Sync Hack (experimental) - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - Huge speedup in many games, and a pretty high compatibility rate (some games still work better with EE sync hacks). - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - True - Escape Hack - Use Esc key to fully exit PCSX2. - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - - - - - True - <b>Miscellaneous</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - 0 - False - False - - - - - - - - True - Game Special Fixes - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - FPU Clamp Hack - Special fix for Tekken 5 and maybe other games. - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - VU Add / Sub Hack - Special fix for Tri-Ace games! - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - VU Clip Hack - Special fix for God of War - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - True - - - - - - - - - - True - <b>Some games need special settings. + True + + + False + False + 9 + + + + + + + + + True + <b>EmotionEngine (EE) Sync Hacks</b> + True + + + label_item + + + + + + + True + + + True + True + Enable IOP x2 Cycle Rate + True + 0 + True + + + False + False + + + + + True + Small speedup, and works well with most games, + True + check_iop_cycle_rate + + + False + False + 1 + + + + + True + True + WaitCycles Sync Hack + True + 0 + True + + + False + False + 2 + + + + + True + Small speedup. Works well with most games, but it may cause certain games to crash, or freeze up during bootup or stage changes. + True + check_wait_cycles_sync_hack + + + False + False + 3 + + + + + True + True + INTC Sync Hack (experimental) + True + 0 + True + + + False + False + 4 + + + + + True + Huge speedup in many games, and a pretty high compatibility rate (some games still work better with EE sync hacks). + True + + + False + False + 5 + + + + + False + False + 1 + + + + + 1 + + + + + True + 0 + + + True + 12 + + + True + True + Escape Hack - Use Esc key to fully exit PCSX2. + True + 0 + True + + + + + + + True + <b>Miscellaneous</b> + True + + + label_item + + + + + False + False + 2 + + + + + False + False + 2 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-ok + True + -5 + + + + + + True + True + True + gtk-cancel + True + -6 + + + + 1 + + + + + False + GTK_PACK_END + + + + + + + True + Game Special Fixes + GDK_WINDOW_TYPE_HINT_DIALOG + + + True + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + FPU Compare Hack - Special fix for Digimon Rumble Arena 2. + True + 0 + True + + + False + False + + + + + True + True + VU Add / Sub Hack - Special fix for Tri-Ace games! + True + 0 + True + + + False + False + 1 + + + + + True + True + FPU Mul Hack - Special fix for Tales of Destiny (possibly other games). + True + 0 + True + + + False + 2 + + + + + + + + + True + <b>Some games need special settings. Configure them here.</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - - - 5 - True - memWrite32 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 5 - - - - 5 - True - False - 2 - - - - True - Address - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 0x - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - 5 - True - False - 2 - - - - True - Data - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 0x - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - - - 5 - True - Program arguments - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 5 - - - - True - Fill in the command line arguments for the opened program: - False - False - GTK_JUSTIFY_CENTER - False - False - 0.10000000149 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 5 - True - False - 2 - - - - True - If you don't know what to write leave it blank - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - Note: this is intended for developers only. - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - - - 5 - True - Raw Dump - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 5 - - - - True - Set Dump Addr (in Hex): - False - False - GTK_JUSTIFY_CENTER - False - False - 0.10000000149 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 5 - True - False - 2 - - - - True - From 0x - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - 5 - True - False - 2 - - - - True - To 0x - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - Dump File = "dump.txt" - False - False - GTK_JUSTIFY_LEFT - False - False - 0.10000000149 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - - - 5 - True - Dump code - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 5 - - - - True - Set Dump Addr (in Hex): - False - False - GTK_JUSTIFY_LEFT - False - False - 0.10000000149 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 5 - True - False - 2 - - - - True - From 0x - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - 5 - True - False - 2 - - - - True - To 0x - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - Dump File = "dump.txt" - False - False - GTK_JUSTIFY_LEFT - False - False - 0.10000000149 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - - - 5 - True - SetBreakPoint Addr - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 5 - - - - True - Set New BP Count (in Hex): - False - False - GTK_JUSTIFY_CENTER - False - False - 0.10000000149 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 5 - True - False - 2 - - - - True - 0x - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - - - 5 - True - SetBreakPoint Addr - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 5 - - - - True - Set New BP Address (in Hex): - False - False - GTK_JUSTIFY_CENTER - False - False - 0.10000000149 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 5 - True - False - 2 - - - - True - 0x - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - - - 5 - True - SetPCDlg - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 5 - - - - True - Set New PC Address (in Hex): - False - False - GTK_JUSTIFY_CENTER - False - False - 0.10000000149 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 5 - True - False - 2 - - - - True - 0x - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - • - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - - - - 5 - True - PCSX2 Debugger - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 0 - - - - True - False - 5 - - - - True - True - EE Debug Mode - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - - True - True - IOP Debug Mode - True - GTK_RELIEF_NORMAL - True - False - False - True - GtkRadioButton_EE - - - - 0 - False - False - - - - - 0 - False - True - - - - - - 5 - True - False - 0 - - - - True - False - 0 - - - - True - GTK_POLICY_ALWAYS - GTK_POLICY_NEVER - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - GTK_SHADOW_IN - - - - True - False - False - False - True - False - False - False - - - - - - - 0 - True - True - - - - - - True - GTK_UPDATE_CONTINUOUS - False - 0 0 412 1 20 2 - - - 0 - False - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Step - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Skip - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Go - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Log On/Off - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Set PC - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Set BP Addr - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Set BP Count - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Clear BPs - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Dump code - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Raw Dump - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Close - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - True - - - - - 0 - False - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 10 - - - - True - True - True - memWrite32 - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - True - - - - - 0 - True - True - - - - - - - - 10 - True - Conf - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - 2 - True - 14 - 2 - False - 0 - 15 - - - - True - - False - True - - - 1 - 2 - 13 - 14 - - - - - - True - - False - True - - - 0 - 1 - 1 - 2 - - - - - - True - - False - True - - - 1 - 2 - 1 - 2 - - - - - - True - - False - True - - - 0 - 1 - 4 - 5 - - - - - - True - - False - True - - - 1 - 2 - 4 - 5 - - - - - - True - - False - True - - - 0 - 1 - 7 - 8 - - - - - - True - - False - True - - - 1 - 2 - 7 - 8 - - - - - - True - - False - True - - - 0 - 1 - 10 - 11 - - - - - - True - - False - True - - - 1 - 2 - 10 - 11 - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Test - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - About - True - GTK_RELIEF_NORMAL - True - - - - - - 1 - 2 - 5 - 6 - - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Test - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - About - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - 1 - 5 - 6 - - - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Test - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - About - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - 1 - 2 - 3 - - - - - - - True - Graphics - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - - - - - - - - True - First Controller - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - - - - - - - - True - Second Controller - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 3 - 4 - - - - - - - - True - Sound - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - - - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Test - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - About - True - GTK_RELIEF_NORMAL - True - - - - - - 1 - 2 - 2 - 3 - - - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Test - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - About - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - 1 - 8 - 9 - - - - - - - True - Dev9 - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 6 - 7 - - - - - - - - True - Cdvdrom - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 6 - 7 - - - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Test - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - About - True - GTK_RELIEF_NORMAL - True - - - - - - 1 - 2 - 8 - 9 - - - - - - - - True - Usb - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 9 - 10 - - - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Test - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - About - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - 1 - 11 - 12 - - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Test - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - About - True - GTK_RELIEF_NORMAL - True - - - - - - 1 - 2 - 11 - 12 - - - - - - - - True - FireWire - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 9 - 10 - - - - - - - - True - Bios - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 12 - 13 - - - - - - - 0 - True - True - - - - - - True - False - 14 - - - - True - GTK_BUTTONBOX_START - 0 - - - - True - True - True - Select Plugins Dir - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - Select Bios Dir - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - 10 - True - Pcsx About - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - False - 0 - - - - True - PCSX2 + True + + + label_item + + + + + 2 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-ok + True + -5 + + + + + + True + True + True + gtk-cancel + True + -6 + + + + 1 + + + + + False + GTK_PACK_END + + + + + + + True + 5 + memWrite32 + + + True + 5 + 5 + + + True + 5 + 2 + + + True + Address + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + 0x + GTK_JUSTIFY_CENTER + + + False + False + 1 + + + + + True + True + • + + + 2 + + + + + False + False + + + + + True + 5 + 2 + + + True + Data + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + 0x + GTK_JUSTIFY_CENTER + + + False + False + 1 + + + + + True + True + • + + + 2 + + + + + 1 + + + + + True + 30 + + + True + True + True + gtk-ok + True + 0 + + + + + + True + True + True + gtk-cancel + True + 0 + + + + 1 + + + + + 2 + + + + + + + True + 5 + Program arguments + True + + + True + 5 + 5 + + + True + 0.10000000149011612 + Fill in the command line arguments for the opened program: + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + 5 + 2 + + + True + True + If you don't know what to write leave it blank + • + + + + + False + False + 1 + + + + + True + Note: this is intended for developers only. + GTK_JUSTIFY_CENTER + + + False + False + 2 + + + + + True + 30 + + + True + True + True + gtk-ok + True + 0 + + + + + + True + True + True + gtk-cancel + True + 0 + + + + 1 + + + + + 3 + + + + + + + True + 5 + Raw Dump + + + True + 5 + 5 + + + True + 0.10000000149011612 + Set Dump Addr (in Hex): + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + 5 + 2 + + + True + From 0x + GTK_JUSTIFY_CENTER + True + + + False + False + + + + + True + True + • + + + 1 + + + + + False + False + 1 + + + + + True + 5 + 2 + + + True + To 0x + + + False + False + + + + + True + True + • + + + 1 + + + + + 2 + + + + + True + 0.10000000149011612 + Dump File = "dump.txt" + + + False + False + 3 + + + + + True + 30 + + + True + True + True + gtk-ok + True + 0 + + + + + + True + True + True + gtk-cancel + True + 0 + + + + 1 + + + + + 4 + + + + + + + True + 5 + Dump code + + + True + 5 + 5 + + + True + 0.10000000149011612 + Set Dump Addr (in Hex): + + + False + False + + + + + True + 5 + 2 + + + True + From 0x + GTK_JUSTIFY_CENTER + True + + + False + False + + + + + True + True + • + + + 1 + + + + + False + False + 1 + + + + + True + 5 + 2 + + + True + To 0x + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + True + • + + + 1 + + + + + 2 + + + + + True + 0.10000000149011612 + Dump File = "dump.txt" + + + False + False + 3 + + + + + True + 30 + + + True + True + True + gtk-ok + True + 0 + + + + + + True + True + True + gtk-cancel + True + 0 + + + + 1 + + + + + 4 + + + + + + + True + 5 + SetBreakPoint Addr + + + True + 5 + 5 + + + True + 0.10000000149011612 + Set New BP Count (in Hex): + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + 5 + 2 + + + True + 0x + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + True + • + + + 1 + + + + + False + False + 1 + + + + + True + 30 + + + True + True + True + gtk-ok + True + 0 + + + + + + True + True + True + gtk-cancel + True + 0 + + + + 1 + + + + + 2 + + + + + + + True + 5 + SetBreakPoint Addr + + + True + 5 + 5 + + + True + 0.10000000149011612 + Set New BP Address (in Hex): + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + 5 + 2 + + + True + 0x + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + True + • + + + 1 + + + + + False + False + 1 + + + + + True + 30 + + + True + True + True + gtk-ok + True + 0 + + + + + + True + True + True + gtk-cancel + True + 0 + + + + 1 + + + + + 2 + + + + + + + True + 5 + SetPCDlg + + + True + 5 + 5 + + + True + 0.10000000149011612 + Set New PC Address (in Hex): + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + 5 + 2 + + + True + 0x + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + True + • + + + 1 + + + + + False + False + 1 + + + + + True + 30 + + + True + True + True + gtk-ok + True + 0 + + + + + + True + True + True + gtk-cancel + True + 0 + + + + 1 + + + + + 2 + + + + + + + True + 5 + PCSX2 Debugger + + + True + 5 + + + True + 5 + + + True + True + EE Debug Mode + True + 0 + True + + + + False + False + + + + + True + True + IOP Debug Mode + True + 0 + True + GtkRadioButton_EE + + + + False + False + 1 + + + + + False + + + + + True + 5 + + + True + + + True + False + GTK_POLICY_NEVER + + + True + + + True + False + + + + + + + + + True + 0 0 412 1 20 2 + + + False + 1 + + + + + + + True + + + True + + + True + True + True + Step + True + 0 + + + + + + True + True + True + Skip + True + 0 + + + + 1 + + + + + True + True + True + Go + True + 0 + + + + 2 + + + + + True + True + True + Log On/Off + True + 0 + + + + 3 + + + + + False + + + + + True + + + True + True + True + Set PC + True + 0 + + + + + + True + True + True + Set BP Addr + True + 0 + + + + 1 + + + + + True + True + True + Set BP Count + True + 0 + + + + 2 + + + + + True + True + True + Clear BPs + True + 0 + + + + 3 + + + + + False + 1 + + + + + True + + + True + True + True + Dump code + True + 0 + + + + + + True + True + True + Raw Dump + True + 0 + + + + 1 + + + + + True + True + True + Close + True + 0 + + + + 2 + + + + + False + 2 + + + + + False + 1 + + + + + True + 10 + + + True + True + True + memWrite32 + True + 0 + + + + + + False + 2 + + + + + 1 + + + + + + + True + 10 + Conf + False + + + True + + + True + 2 + 14 + 2 + 15 + + + + + + + + + True + + + + 1 + 2 + 13 + 14 + + + + + True + + + + 1 + 2 + + + + + True + + + + 1 + 2 + 1 + 2 + + + + + True + + + + 4 + 5 + + + + + True + + + + 1 + 2 + 4 + 5 + + + + + True + + + + 7 + 8 + + + + + True + + + + 1 + 2 + 7 + 8 + + + + + True + + + + 10 + 11 + + + + + True + + + + 1 + 2 + 10 + 11 + + + + + True + + + True + True + True + Configure + True + 0 + + + + + + True + True + True + Test + True + 0 + + + + 1 + + + + + True + True + True + About + True + 0 + + + + 2 + + + + + 1 + 2 + 5 + 6 + + + + + + True + + + True + True + True + Configure + True + 0 + + + + + + True + True + True + Test + True + 0 + + + + 1 + + + + + True + True + True + About + True + 0 + + + + 2 + + + + + 5 + 6 + + + + + + + True + + + True + True + True + Configure + True + 0 + + + + + + True + True + True + Test + True + 0 + + + + 1 + + + + + True + True + True + About + True + 0 + + + + 2 + + + + + 2 + 3 + + + + + + True + 0 + Graphics + GTK_JUSTIFY_CENTER + + + + + + + + + True + 0 + First Controller + GTK_JUSTIFY_CENTER + + + 3 + 4 + + + + + + + True + 0 + Second Controller + GTK_JUSTIFY_CENTER + + + 1 + 2 + 3 + 4 + + + + + + + True + 0 + Sound + GTK_JUSTIFY_CENTER + + + 1 + 2 + + + + + + + True + + + True + True + True + Configure + True + 0 + + + + + + True + True + True + Test + True + 0 + + + + 1 + + + + + True + True + True + About + True + 0 + + + + 2 + + + + + 1 + 2 + 2 + 3 + + + + + + + True + + + True + True + True + Configure + True + 0 + + + + + + True + True + True + Test + True + 0 + + + + 1 + + + + + True + True + True + About + True + 0 + + + + 2 + + + + + 8 + 9 + + + + + + True + 0 + Dev9 + GTK_JUSTIFY_CENTER + + + 6 + 7 + + + + + + + True + 0 + Cdvdrom + GTK_JUSTIFY_CENTER + + + 1 + 2 + 6 + 7 + + + + + + + True + + + True + True + True + Configure + True + 0 + + + + + + True + True + True + Test + True + 0 + + + + 1 + + + + + True + True + True + About + True + 0 + + + + 2 + + + + + 1 + 2 + 8 + 9 + + + + + + + True + 0 + Usb + GTK_JUSTIFY_CENTER + + + 9 + 10 + + + + + + + True + + + True + True + True + Configure + True + 0 + + + + + + True + True + True + Test + True + 0 + + + + 1 + + + + + True + True + True + About + True + 0 + + + + 2 + + + + + 11 + 12 + + + + + + True + + + True + True + True + Configure + True + 0 + + + + + + True + True + True + Test + True + 0 + + + + 1 + + + + + True + True + True + About + True + 0 + + + + 2 + + + + + 1 + 2 + 11 + 12 + + + + + + + True + 0 + FireWire + GTK_JUSTIFY_CENTER + + + 1 + 2 + 9 + 10 + + + + + + + True + 0 + Bios + GTK_JUSTIFY_CENTER + + + 1 + 2 + 12 + 13 + + + + + + + + + True + 14 + + + True + GTK_BUTTONBOX_START + + + True + True + True + Select Plugins Dir + True + 0 + + + + + + True + True + True + Select Bios Dir + True + 0 + + + + 1 + + + + + False + + + + + True + + + True + True + True + gtk-ok + True + 0 + + + + + + True + True + True + gtk-cancel + True + 0 + + + + 1 + + + + + 1 + + + + + 1 + + + + + + + True + 10 + Pcsx About + + + True + + + True + + + True + PCSX2 Version x.x - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 5 - True - False - 0 - - - - True - written by... - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 5 - True - False - 0 - - - - True - greets to... - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_EDGE - 0 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - False - - - - - - - - True - PCSX - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - - - True - False - 0 - - - - True - GTK_PACK_DIRECTION_LTR - GTK_PACK_DIRECTION_LTR - - - - True - _File - True - - - - - - - True - _Run CD - True - - - - - - - True - _Load Elf - True - - - - - - - True - - - - - - True - States - True - - - - - - - True - Load - True - - - - - - - True - Slot 0 - True - - - - - - - True - Slot 1 - True - - - - - - - True - Slot 2 - True - - - - - - - True - Slot 3 - True - - - - - - - True - Slot 4 - True - - - - - - - True - Other... - True - - - - - - - - - - - True - Save - True - - - - - - - True - Slot 0 - True - - - - - - - True - Slot 1 - True - - - - - - - True - Slot 2 - True - - - - - - - True - Slot 3 - True - - - - - - - True - Slot 4 - True - - - - - - - True - Other... - True - - - - - - - - - - - - - - - True - E_xit - True - - - - - - - - - - - True - _Run - True - - - - - - - True - E_xecute - True - - - - - - - True - Re_set - True - - - - - - - - - - - True - _Config - True - - - - - - - True - _Configure - True - - - - - - - True - - - - - - True - _Graphics - True - - - - - - - True - C_ontrollers - True - - - - - - - True - _Sound - True - - - - - - - True - _Cdvdrom - True - - - - - - - True - D_ev9 - True - - - - - - - True - U_SB - True - - - - - - - True - Fire_Wire - True - - - - - - - True - - - - - - True - Memcards - True - - - - - - - True - C_pu - True - - - - - - - True - Game Fixes - True - - - - - - - True - Speed Hacks - True - - - - - - - True - Advanced - True - - - - - - - - - - - True - _Language - True - - - - - - True - _Misc - True - - - - - - - True - Patch _Browser - True - - - - - - - True - Patch _Finder - True - - - - - - - True - - - - - - True - Enable _Console - True - False - - - - - - - True - Enable _Patches - True - False - - - - - - - True - Print CDVD Info - True - False - - - - - - - - - - - True - _Debug - True - - - - - - - True - Enter Debugger ... - True - - - - - - - True - Logging - True - - - - - - - True - - - - - - True - _Arguments - True - - - - - - - - - - - True - _Help - True - - - - - - - True - About PCSX2... - True - - - - - - - - - - 0 - False - False - - - - - - True - pcsxAbout.bmp - 0.5 - 0.5 - 0 - 0 - - - 1 - True - True - - - - - - True - False - 0 - - - - - - - 0 - True - True - - - - - - - - Patch List - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - True - False - False - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - True - Enable / Diable - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - - True - True - Add Patch - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - - True - True - Edit Patch - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - - True - True - Add GS2v3-4 - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - - True - True - Add Raw - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - - True - True - Pnach Writer - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - - True - True - Skip Mpeg - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - - - - - - - - - - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - True - Patch Finder - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - EE RAM - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - IOP RAM - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton1 - - - 0 - False - False - - - - - - - - - - True - <b>Search In</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - 3 - 2 - False - 0 - 0 - - - - True - True - Unsigned - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - 1 - 2 - 3 - - - - - - - - True - True - 64 bits - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 2 - 1 - 2 - - - - - - - - True - True - 32 bits - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton6 - - - 0 - 1 - 1 - 2 - - - - - - - - True - True - 16 bits - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton6 - - - 1 - 2 - 0 - 1 - - - - - - - - True - True - 8 bits - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton6 - - - 0 - 1 - 0 - 1 - - - - - - - - - - - - True - <b>Values of Size</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - Equal - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Greater Then - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton7 - - - 0 - False - False - - - - - - True - True - Less Then - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton7 - - - 0 - False - False - - - - - - True - True - Greater Then or Equal - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton7 - - - 0 - False - False - - - - - - True - True - Less Then or Equal - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton7 - - - 0 - False - False - - - - - - True - True - Not Equal - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton7 - - - 0 - False - False - - - - - - - - - - True - <b>Being</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - Old Value - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Specific Value - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton13 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - False - - - 0 - False - False - - - - - - - - - - True - <b>Compared To</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - False - 0 - - - - True - Results: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - %s - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - Ready to Search - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - False - - - - - 0 - False - False - - - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - False - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - 2 - 2 - False - 0 - 0 - - - - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - - - 1 - 2 - 1 - 2 - - - - - - - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - 0 - 1 - 1 - 2 - - - - - - - True - True - gtk-find - True - GTK_RELIEF_NORMAL - True - - - 1 - 2 - 0 - 1 - - - - - - - True - True - gtk-clear - True - GTK_RELIEF_NORMAL - True - - - 0 - 1 - 0 - 1 - - - - - - 0 - False - True - - - - - 0 - True - True - - - - - - - - True - dialog1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - 0 - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - 0 - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - CPU vendor - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - Family - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - Cpu Speed - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - Features - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - True - - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - True - EERec - EE/IOP recompiler (Need MMX/SSE/SSE2) - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 5 - True - False - 0 - - - - True - True - VU0rec - enable recompiler for VU0 unit - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - VU1rec - enable recompiler for VU1 unit - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - - - True - VU Recompilers - All options are set by default - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - True - Multi threaded GS mode (MTGS) + GTK_JUSTIFY_CENTER + + + False + False + + + + + True + 5 + 0 + + + True + 5 + + + True + written by... + GTK_JUSTIFY_CENTER + True + + + False + False + + + + + + + False + False + 1 + + + + + + + True + 5 + 0 + + + True + 5 + + + True + greets to... + GTK_JUSTIFY_CENTER + True + + + False + False + + + + + + + False + False + 1 + + + + + True + GTK_BUTTONBOX_EDGE + + + True + True + True + gtk-ok + True + 0 + + + + + + False + False + 2 + + + + + + + True + PCSX + GTK_WIN_POS_CENTER + + + + + True + + + True + + + True + _File + True + + + + + True + _Run CD + True + + + + + + True + _Load Elf + True + + + + + + True + + + + + True + States + True + + + + + True + Load + True + + + + + True + Slot 0 + True + + + + + + True + Slot 1 + True + + + + + + True + Slot 2 + True + + + + + + True + Slot 3 + True + + + + + + True + Slot 4 + True + + + + + + True + Other... + True + + + + + + + + + + True + Save + True + + + + + True + Slot 0 + True + + + + + + True + Slot 1 + True + + + + + + True + Slot 2 + True + + + + + + True + Slot 3 + True + + + + + + True + Slot 4 + True + + + + + + True + Other... + True + + + + + + + + + + + + + + True + E_xit + True + + + + + + + + + + True + _Run + True + + + + + True + E_xecute + True + + + + + + True + Re_set + True + + + + + + + + + + True + _Config + True + + + + + True + _Configure + True + + + + + + True + + + + + True + _Graphics + True + + + + + + True + C_ontrollers + True + + + + + + True + _Sound + True + + + + + + True + _Cdvdrom + True + + + + + + True + D_ev9 + True + + + + + + True + U_SB + True + + + + + + True + Fire_Wire + True + + + + + + True + + + + + True + Memcards + True + + + + + + True + C_pu + True + + + + + + True + Game Fixes + True + + + + + + True + Speed Hacks + True + + + + + + True + Advanced + True + + + + + + + + + + True + _Language + True + + + + + True + _Misc + True + + + + + True + Patch _Browser + True + + + + + + True + Patch _Finder + True + + + + + + True + + + + + True + Enable _Console + True + + + + + + True + Enable _Patches + True + + + + + + True + Print CDVD Info + True + + + + + + + + + + True + _Debug + True + + + + + True + Enter Debugger ... + True + + + + + + True + Logging + True + + + + + + True + + + + + True + _Arguments + True + + + + + + + + + + True + _Help + True + + + + + True + About PCSX2... + True + + + + + + + + + + False + False + + + + + True + pcsxAbout.bmp + + + 1 + 1 + + + + + True + + + + + + 2 + + + + + + + Patch List + True + GDK_WINDOW_TYPE_HINT_DIALOG + False + + + True + + + True + True + GTK_SHADOW_IN + + + True + True + + + + + + + True + + + True + True + Enable / Diable + True + 0 + + + False + False + + + + + True + True + Add Patch + True + 0 + + + False + False + 1 + + + + + True + True + Edit Patch + True + 0 + + + False + False + 2 + + + + + True + True + Add GS2v3-4 + True + 0 + + + False + False + 3 + + + + + True + True + Add Raw + True + 0 + + + False + False + 4 + + + + + True + True + Pnach Writer + True + 0 + + + False + False + 5 + + + + + True + True + Skip Mpeg + True + 0 + + + False + False + 6 + + + + + + + + + + + True + True + gtk-close + True + 0 + + + False + False + 9 + + + + + 1 + + + + + + + True + Patch Finder + True + GDK_WINDOW_TYPE_HINT_DIALOG + + + True + + + True + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + EE RAM + True + 0 + True + + + False + False + + + + + True + True + IOP RAM + True + 0 + True + radiobutton1 + + + False + False + 1 + + + + + + + + + True + <b>Search In</b> + True + + + label_item + + + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + 3 + 2 + + + + + + True + True + Unsigned + True + 0 + True + + + 2 + 3 + + + + + + + True + True + 64 bits + True + 0 + True + + + 1 + 2 + 1 + 2 + + + + + + + True + True + 32 bits + True + 0 + True + + + 1 + 2 + + + + + + + True + True + 16 bits + True + 0 + True + + + 1 + 2 + + + + + + + True + True + 8 bits + True + 0 + True + + + + + + + + + + + + + True + <b>Values of Size</b> + True + + + label_item + + + + + 1 + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + Equal + True + 0 + True + + + False + False + + + + + True + True + Greater Then + True + 0 + True + radiobutton7 + + + False + False + 1 + + + + + True + True + Less Then + True + 0 + True + radiobutton7 + + + False + False + 2 + + + + + True + True + Greater Then or Equal + True + 0 + True + radiobutton7 + + + False + False + 3 + + + + + True + True + Less Then or Equal + True + 0 + True + radiobutton7 + + + False + False + 4 + + + + + True + True + Not Equal + True + 0 + True + radiobutton7 + + + False + False + 5 + + + + + + + + + True + <b>Being</b> + True + + + label_item + + + + + 2 + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + Old Value + True + 0 + True + + + False + False + + + + + True + True + Specific Value + True + 0 + True + radiobutton13 + + + False + False + 1 + + + + + True + True + + + False + False + 2 + + + + + + + + + True + <b>Compared To</b> + True + + + label_item + + + + + 3 + + + + + + + True + + + True + + + True + + + True + Results: + + + False + False + + + + + True + %s + GTK_JUSTIFY_CENTER + + + 1 + + + + + True + Ready to Search + GTK_JUSTIFY_RIGHT + + + False + 2 + + + + + False + False + + + + + True + True + GTK_SHADOW_IN + + + True + True + + + + + 1 + + + + + + + True + 2 + 2 + + + True + True + gtk-close + True + 0 + + + 1 + 2 + 1 + 2 + + + + + + True + True + gtk-add + True + 0 + + + 1 + 2 + + + + + + True + True + gtk-find + True + 0 + + + 1 + 2 + + + + + + True + True + gtk-clear + True + 0 + + + + + + + + False + 1 + + + + + 1 + + + + + + + True + dialog1 + GDK_WINDOW_TYPE_HINT_DIALOG + + + True + + + True + + + True + + + True + 0 + + + True + 12 + + + True + + + True + CPU vendor + + + False + False + + + + + True + Family + + + False + False + 1 + + + + + True + Cpu Speed + + + False + False + 2 + + + + + True + Features + + + False + False + 3 + + + + + + + + + True + True + + + label_item + + + + + + + True + True + EERec - EE/IOP recompiler (Need MMX/SSE/SSE2) + True + 0 + True + + + False + False + 1 + + + + + True + 5 + 0 + + + True + 5 + + + True + True + VU0rec - enable recompiler for VU0 unit + True + 0 + True + + + False + False + + + + + True + True + VU1rec - enable recompiler for VU1 unit + True + 0 + True + + + False + False + 1 + + + + + + + True + VU Recompilers - All options are set by default + + + label_item + + + + + 2 + + + + + True + True + Multi threaded GS mode (MTGS) (faster on dual core/HT CPUs, requires pcsx2 restart) - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - Normal - All frames are rendered as fast as possible - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Limit - Force frames to normal speeds if too fast - True - GTK_RELIEF_NORMAL - True - False - False - True - GtkRadioButton_LimitNormal - - - 0 - False - False - - - - - - True - True - Frame Skip - In order to achieve normal speeds, + True + 0 + True + + + False + False + 3 + + + + + + + True + + + True + 0 + + + True + 12 + + + True + + + True + True + Normal - All frames are rendered as fast as possible + True + 0 + True + + + False + False + + + + + True + True + Limit - Force frames to normal speeds if too fast + True + 0 + True + GtkRadioButton_LimitNormal + + + False + False + 1 + + + + + True + True + Frame Skip - In order to achieve normal speeds, some frames are skipped (faster). Fps displayed counts skipped frames too - True - GTK_RELIEF_NORMAL - True - False - False - True - GtkRadioButton_LimitNormal - - - 0 - False - False - - - - - - True - True - VU Skip - Same as Frame Skip, but tried to skip more. + True + 0 + True + GtkRadioButton_LimitNormal + + + False + False + 2 + + + + + True + True + VU Skip - Same as Frame Skip, but tried to skip more. Artifacts might be present, but will be faster - True - GTK_RELIEF_NORMAL - True - False - False - True - GtkRadioButton_LimitNormal - - - 0 - False - False - - - - - - - - - - True - Frame Limiting (F4 switches in-game) - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - False - 0 - - - - True - Custom FPS Limit (0=auto): - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0 0 9999 1 0 0 - - - 0 - False - True - GTK_PACK_END - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - Skip Frames when slower than[1]: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 9999 1 0 0 - - - 0 - False - True - GTK_PACK_END - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - Consecutive Frames before skipping[2]: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 9999 1 0 0 - - - 0 - False - True - GTK_PACK_END - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - Consecutive Frames to skip[3]: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 9999 1 0 0 - - - 0 - False - True - GTK_PACK_END - - - - - 0 - True - True - - - - - - True - [1] Only skips when slower then this number(0 is auto; 9999 always skips). - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - [2] Renders this many frames before skipping (0 is default). - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - [3] Skips this many frames before continuing (0 is default). - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - True - Detailed Settings - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - True - Logging - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 200 - 450 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - GTK_SHADOW_IN - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - Cpu Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Mem Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Hw Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Dma Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Bios Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Elf Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Fpu Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - MMI Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - VU0 Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Cop0 Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Vif Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - SPR Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - GIF Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Sif Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - IPU Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - VU Micro Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - RPC Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - - - - - True - <b>EE Logs</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - IOP Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Mem Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Hw Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Bios Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Dma Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Pad Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Gte Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Cdr Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - GPU Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - - - - - True - <b>IOP Logs</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - Log to STDOUT - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - SYMs Log - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - - - - - True - <b>Misc</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - - - - 0 - True - True - - - - - - - - True - Memcards - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - False - 0 - - - - True - False - 0 - - - - True - True - 0 - - - - True - True - Enabled - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Enabled - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - True - 0 - - - - True - Memcard 1 - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - Memcard 2 - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - False - True - - - 0 - True - True - - - - - - True - False - True - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - Eject Mcds when loading SaveStates - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - This feature tells games when the mcd contents have changed so that they re-index the new Mcd contents. WARNING: Disabling this option is NOT recommended, and could lead to MemCard corruption if you also use SaveStates. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - True - <b>Options</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - + True + 0 + True + GtkRadioButton_LimitNormal + + + False + False + 3 + + + + + + + + + True + Frame Limiting (F4 switches in-game) + True + + + label_item + + + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + + + True + Custom FPS Limit (0=auto): + + + + + True + True + 0 0 9999 1 0 0 + 1 + True + + + False + GTK_PACK_END + 1 + + + + + + + True + + + True + Skip Frames when slower than[1]: + + + + + True + True + 0 0 9999 1 0 0 + 1 + + + False + GTK_PACK_END + 1 + + + + + 1 + + + + + True + + + True + Consecutive Frames before skipping[2]: + + + + + True + True + 0 0 9999 1 0 0 + 1 + + + False + GTK_PACK_END + 1 + + + + + 2 + + + + + True + + + True + Consecutive Frames to skip[3]: + + + + + True + True + 0 0 9999 1 0 0 + 1 + + + False + GTK_PACK_END + 1 + + + + + 3 + + + + + True + [1] Only skips when slower then this number(0 is auto; 9999 always skips). + True + + + False + False + 4 + + + + + True + [2] Renders this many frames before skipping (0 is default). + True + + + False + False + 5 + + + + + True + [3] Skips this many frames before continuing (0 is default). + True + + + False + False + 6 + + + + + + + + + True + Detailed Settings + True + + + label_item + + + + + 1 + + + + + 1 + + + + + 2 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-ok + True + 0 + + + + + + True + True + True + gtk-cancel + True + 0 + + + + 1 + + + + + False + GTK_PACK_END + + + + + + + True + Logging + 200 + 450 + GDK_WINDOW_TYPE_HINT_DIALOG + + + True + + + True + True + GTK_SHADOW_IN + + + True + + + True + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + Cpu Log + True + 0 + True + + + False + False + + + + + True + True + Mem Log + True + 0 + True + + + False + False + 1 + + + + + True + True + Hw Log + True + 0 + True + + + False + False + 2 + + + + + True + True + Dma Log + True + 0 + True + + + False + False + 3 + + + + + True + True + Bios Log + True + 0 + True + + + False + False + 4 + + + + + True + True + Elf Log + True + 0 + True + + + False + False + 5 + + + + + True + True + Fpu Log + True + 0 + True + + + False + False + 6 + + + + + True + True + MMI Log + True + 0 + True + + + False + False + 7 + + + + + True + True + VU0 Log + True + 0 + True + + + False + False + 8 + + + + + True + True + Cop0 Log + True + 0 + True + + + False + False + 9 + + + + + True + True + Vif Log + True + 0 + True + + + False + False + 10 + + + + + True + True + SPR Log + True + 0 + True + + + False + False + 11 + + + + + True + True + GIF Log + True + 0 + True + + + False + False + 12 + + + + + True + True + Sif Log + True + 0 + True + + + False + False + 13 + + + + + True + True + IPU Log + True + 0 + True + + + False + False + 14 + + + + + True + True + VU Micro Log + True + 0 + True + + + False + False + 15 + + + + + True + True + RPC Log + True + 0 + True + + + False + False + 16 + + + + + + + + + True + <b>EE Logs</b> + True + + + label_item + + + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + IOP Log + True + 0 + True + + + False + False + + + + + True + True + Mem Log + True + 0 + True + + + False + False + 1 + + + + + True + True + Hw Log + True + 0 + True + + + False + False + 2 + + + + + True + True + Bios Log + True + 0 + True + + + False + False + 3 + + + + + True + True + Dma Log + True + 0 + True + + + False + False + 4 + + + + + True + True + Pad Log + True + 0 + True + + + False + False + 5 + + + + + True + True + Gte Log + True + 0 + True + + + False + False + 6 + + + + + True + True + Cdr Log + True + 0 + True + + + False + False + 7 + + + + + True + True + GPU Log + True + 0 + True + + + False + False + 8 + + + + + + + + + True + <b>IOP Logs</b> + True + + + label_item + + + + + 1 + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + Log to STDOUT + True + 0 + True + + + False + False + + + + + True + True + SYMs Log + True + 0 + True + + + False + False + 1 + + + + + + + + + True + <b>Misc</b> + True + + + label_item + + + + + 2 + + + + + + + + + 2 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-ok + True + -5 + + + + + + True + True + True + gtk-cancel + True + -6 + + + + 1 + + + + + False + GTK_PACK_END + + + + + + + True + Memcards + GDK_WINDOW_TYPE_HINT_DIALOG + + + True + + + True + + + True + + + True + + + True + + + True + True + + + True + True + Enabled + True + 0 + True + + + False + False + + + + + True + True + Enabled + True + 0 + True + True + + + False + False + 1 + + + + + + + + + True + + + True + + + True + True + + + True + Memcard 1 + + + + + True + Memcard 2 + GTK_JUSTIFY_RIGHT + + + False + False + 1 + + + + + + + True + + + True + + + + + True + + + 1 + + + + + 1 + + + + + + + 1 + + + + + + + + + + True + 0 + + + True + 12 + + + True + + + True + True + Eject Mcds when loading SaveStates + True + 0 + True + + + False + False + + + + + True + This feature tells games when the mcd contents have changed so that they re-index the new Mcd contents. WARNING: Disabling this option is NOT recommended, and could lead to MemCard corruption if you also use SaveStates. + True + + + False + False + 1 + + + + + + + + + True + <b>Options</b> + True + + + label_item + + + + + 1 + + + + + + + 2 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-ok + True + -5 + + + + + + True + True + True + gtk-cancel + True + -6 + + + + 1 + + + + + False + GTK_PACK_END + + + + + diff --git a/pcsx2/Misc.h b/pcsx2/Misc.h index 9e5b7a2c5b..0f9648b24d 100644 --- a/pcsx2/Misc.h +++ b/pcsx2/Misc.h @@ -19,8 +19,8 @@ #ifndef __MISC_H__ #define __MISC_H__ -// what the hell is this unused piece of crap passed to every plugin for? (air) -// Agreed. It ought to get removed in the next version of the plugin api. (arcum42) +// Per ChickenLiver, this is being used to pass the GS plugins window handle to the Pad plugins. +// So a rename to pDisplay is in the works, but it will not, in fact, be removed. extern uptr pDsp; //Used in GS, MTGS, Plugins, Misc u32 GetBiosVersion(); // Used in Misc, Memory From 579a907edf39f512518c1824273a7119d42dee3e Mon Sep 17 00:00:00 2001 From: mattmenke Date: Sun, 15 Mar 2009 03:18:31 +0000 Subject: [PATCH 47/77] Plugin APIs: Now that I've figured out how multitaps work, fixed SIO API so it can theoretically actually work. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@788 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/api/GSApi.h | 8 ++++---- common/include/api/SIOApi.h | 23 +++++++++++++++++------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/common/include/api/GSApi.h b/common/include/api/GSApi.h index c87e79762b..303cad33ec 100644 --- a/common/include/api/GSApi.h +++ b/common/include/api/GSApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __GSAPI_H__ #define __GSAPI_H__ @@ -28,7 +28,7 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" typedef struct _GSdriverInfo { @@ -79,7 +79,7 @@ EXPORT_C_(s32) CALLBACK GSsetWindowInfo(winInfo *info); #endif EXPORT_C_(s32) GSfreeze(u8 mode, freezeData *data); EXPORT_C_(void) GSconfigure(); -EXPORT_C_(void) SGSconfigpath(char *configpath); +EXPORT_C_(void) GSconfigpath(char *configpath); EXPORT_C_(void) GSabout(); EXPORT_C_(s32) GStest(); diff --git a/common/include/api/SIOApi.h b/common/include/api/SIOApi.h index 8d4fe518c1..67ecae75e3 100644 --- a/common/include/api/SIOApi.h +++ b/common/include/api/SIOApi.h @@ -15,8 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __SIOAPI_H__ #define __SIOAPI_H__ @@ -28,14 +28,23 @@ * shadowpcsx2@yahoo.gr, * and florinsasu@hotmail.com */ - + #include "Pcsx2Api.h" /* SIO plugin API */ +// Called by SIO_TYPE_MTAP plugins to change the slot. +// Slot is then passed to memcard and pad plugins on SIOstartPoll. +// MTAP SIO plugins should ignore slot vvalues on startPoll, as should RMs (probably). +typedef int (CALLBACK * SIOchangeSlotCB)(int slot); + // Basic functions. -EXPORT_C_(s32) SIOinit(); +// Types is an or-ed combination of SioTypes to initialize. It'd probably be simplest +// just to make each SIO plugin support only one type, for simplicity. +// SIOchangeSlotCB should *only* be called by MTAP plugins. +EXPORT_C_(s32) SIOinit(int types, SIOchangeSlotCB f); + // Single plugin can only be PAD, MTAP, RM, or MC. Only load one plugin of each type, // but not both a PAD and MTAP. Simplifies plugin selection and interface, as well // as API. @@ -43,9 +52,11 @@ EXPORT_C_(s32) SIOinit(); EXPORT_C_(s32) SIOopen(void *pDisplay); EXPORT_C_(void) SIOclose(); EXPORT_C_(void) SIOshutdown(); -// Returns 0 if device doesn't exist. Simplifies things. Also means you don't -// have to distinguish between MTAP and PAD SIO plugins. + +// Returns 0 if device doesn't exist. Means old pad plugins can just say nothing +// connected to other slots, and SIOpoll won't be called on those slots, ideally. EXPORT_C_(s32) SIOstartPoll(u8 deviceType, u32 port, u32 slot, u8 *returnValue); + // Returns 0 on the last output byte. EXPORT_C_(s32) SIOpoll(u8 value, u8 *returnValue); From 85a1c605fa99fc64d85085b119179add250df046 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sun, 15 Mar 2009 05:57:16 +0000 Subject: [PATCH 48/77] Plugin APIs: Added the changes in r788 to PluginCallbacks.h. Changed the config path function to be one of the general functions, not plugin specific, and it now passes the whole pcsx2 config, not just the ini path. I can see all sorts of uses for that... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@789 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/Pcsx2Api.h | 7 +++++++ common/include/PluginCallbacks.h | 30 +++++++++++------------------- common/include/api/CDVDApi.h | 1 - common/include/api/Dev9Api.h | 1 - common/include/api/FWApi.h | 1 - common/include/api/GSApi.h | 1 - common/include/api/PadApi.h | 1 - common/include/api/SIOApi.h | 1 - common/include/api/Spu2Api.h | 1 - common/include/api/USBApi.h | 1 - 10 files changed, 18 insertions(+), 27 deletions(-) diff --git a/common/include/Pcsx2Api.h b/common/include/Pcsx2Api.h index 6dd07e6982..63b5f16755 100644 --- a/common/include/Pcsx2Api.h +++ b/common/include/Pcsx2Api.h @@ -31,6 +31,7 @@ #include "Pcsx2Types.h" #include "Pcsx2Defs.h" +#include "Pcsx2Config.h" // Indicate to use the new versions. #define NEW_PLUGIN_APIS @@ -45,6 +46,12 @@ EXPORT_C(u32) PS2EgetLibType(void); EXPORT_C(u32) PS2EgetLibVersion2(u32 type); EXPORT_C(char*) PS2EgetLibName(void); +// Extended functions. + +// allows the plugin to see the whole configuration when started up. +// Intended for them to get the ini and plugin paths, but could allow for other things as well. +EXPORT_C_(void) PS2EpassConfig(PcsxConfig Config); + // PS2EgetLibType returns (may be OR'd) enum { PS2E_LT_GS = 0x01, diff --git a/common/include/PluginCallbacks.h b/common/include/PluginCallbacks.h index 3f344f8558..bed5d784df 100644 --- a/common/include/PluginCallbacks.h +++ b/common/include/PluginCallbacks.h @@ -20,10 +20,13 @@ #ifndef __PLUGINCALLBACKS_H__ #define __PLUGINCALLBACKS_H__ -extern "C" { +extern "C" +{ +// General typedef u32 (CALLBACK* _PS2EgetLibType)(void); typedef u32 (CALLBACK* _PS2EgetLibVersion2)(u32 type); typedef char*(CALLBACK* _PS2EgetLibName)(void); +typedef void (CALLBACK* _PS2EpassConfig)(PcsxConfig Config); // GS // NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs @@ -60,7 +63,6 @@ typedef void (CALLBACK* _GSmakeSnapshot)(const char *path); typedef void (CALLBACK* _GSmakeSnapshot2)(const char *path, int*, int); typedef s32 (CALLBACK* _GSfreeze)(u8 mode, freezeData *data); typedef void (CALLBACK* _GSconfigure)(); -typedef void (CALLBACK* _GSconfigpath)(char *configpath); typedef s32 (CALLBACK* _GStest)(); typedef void (CALLBACK* _GSabout)(); @@ -78,12 +80,11 @@ typedef void (CALLBACK* _PADupdate)(u8 pad); typedef void (CALLBACK* _PADgsDriverInfo)(GSdriverInfo *info); typedef s32 (CALLBACK* _PADfreeze)(u8 mode, freezeData *data); typedef void (CALLBACK* _PADconfigure)(); -typedef void (CALLBACK* _PADconfigpath)(char *configpath); typedef s32 (CALLBACK* _PADtest)(); typedef void (CALLBACK* _PADabout)(); // SIO -typedef s32 (CALLBACK* _SIOinit)(); +typedef s32 (CALLBACK* _SIOinit)(int types, SIOchangeSlotCB f); typedef s32 (CALLBACK* _SIOopen)(void *pDisplay); typedef void (CALLBACK* _SIOclose)(); typedef void (CALLBACK* _SIOshutdown)(); @@ -94,7 +95,6 @@ typedef u32 (CALLBACK* _SIOquery)(); typedef void (CALLBACK* _SIOkeyEvent)(keyEvent* ev); typedef s32 (CALLBACK* _SIOfreeze)(u8 mode, freezeData *data); typedef void (CALLBACK* _SIOconfigure)(); -typedef void (CALLBACK* _SIOconfigpath)(char *configpath); typedef s32 (CALLBACK* _SIOtest)(); typedef void (CALLBACK* _SIOabout)(); @@ -131,7 +131,6 @@ typedef void (CALLBACK* _SPU2async)(u32 cycles); typedef s32 (CALLBACK* _SPU2freeze)(u8 mode, freezeData *data); typedef void (CALLBACK* _SPU2keyEvent)(keyEvent* ev); typedef void (CALLBACK* _SPU2configure)(); -typedef void (CALLBACK* _SPU2configpath)(char *configpath); typedef s32 (CALLBACK* _SPU2test)(); typedef void (CALLBACK* _SPU2about)(); @@ -156,7 +155,6 @@ typedef s32 (CALLBACK* _CDVDctrlTrayClose)(); typedef void (CALLBACK* _CDVDkeyEvent)(keyEvent* ev); typedef s32 (CALLBACK* _CDVDfreeze)(u8 mode, freezeData *data); typedef void (CALLBACK* _CDVDconfigure)(); -typedef void (CALLBACK* _CDVDconfigpath)(char *configpath); typedef s32 (CALLBACK* _CDVDtest)(); typedef void (CALLBACK* _CDVDabout)(); typedef void (CALLBACK* _CDVDnewDiskCB)(void (*callback)()); @@ -182,7 +180,6 @@ typedef DEV9handler (CALLBACK* _DEV9irqHandler)(void); typedef void (CALLBACK* _DEV9keyEvent)(keyEvent* ev); typedef s32 (CALLBACK* _DEV9freeze)(int mode, freezeData *data); typedef void (CALLBACK* _DEV9configure)(); -typedef void (CALLBACK* _DEV9configpath)(char *configpath); typedef s32 (CALLBACK* _DEV9test)(); typedef void (CALLBACK* _DEV9about)(); @@ -209,7 +206,6 @@ typedef void (CALLBACK* _USBsetRAM)(void *mem); typedef void (CALLBACK* _USBkeyEvent)(keyEvent* ev); typedef s32 (CALLBACK* _USBfreeze)(int mode, freezeData *data); typedef void (CALLBACK* _USBconfigure)(); -typedef void (CALLBACK* _USBconfigpath)(char *configpath); typedef s32 (CALLBACK* _USBtest)(); typedef void (CALLBACK* _USBabout)(); @@ -225,10 +221,15 @@ typedef void (CALLBACK* _FWirqCallback)(void (*callback)()); typedef void (CALLBACK* _FWkeyEvent)(keyEvent* ev); typedef s32 (CALLBACK* _FWfreeze)(int mode, freezeData *data); typedef void (CALLBACK* _FWconfigure)(); -typedef void (CALLBACK* _FWconfigpath)(char *configpath); typedef s32 (CALLBACK* _FWtest)(); typedef void (CALLBACK* _FWabout)(); +// General +extern _PS2EgetLibType PS2EgetLibType; +extern _PS2EgetLibVersion2 PS2EgetLibVersion2; +extern _PS2EgetLibName PS2EgetLibName; +extern _PS2EpassConfig PS2EpassConfig; + // GS extern _GSinit GSinit; extern _GSopen GSopen; @@ -261,7 +262,6 @@ extern _GSsetWindowInfo GSsetWindowInfo; #endif extern _GSfreeze GSfreeze; extern _GSconfigure GSconfigure; -extern _GSconfigpath GSconfigpath; extern _GStest GStest; extern _GSabout GSabout; @@ -279,7 +279,6 @@ extern _PADupdate PAD1update; extern _PADfreeze PAD1freeze; extern _PADgsDriverInfo PAD1gsDriverInfo; extern _PADconfigure PAD1configure; -extern _PADconfigpath PAD1configpath; extern _PADtest PAD1test; extern _PADabout PAD1about; @@ -297,7 +296,6 @@ extern _PADupdate PAD2update; extern _PADfreeze PAD2freeze; extern _PADgsDriverInfo PAD2gsDriverInfo; extern _PADconfigure PAD2configure; -extern _PADconfigpath PAD2configpath; extern _PADtest PAD2test; extern _PADabout PAD2about; @@ -313,7 +311,6 @@ extern _SIOkeyEvent SIOkeyEvent; extern _SIOfreeze SIOfreeze[2][9]; extern _SIOconfigure SIOconfigure[2][9]; -extern _SIOconfigpath SIOconfigpath[2][9]; extern _SIOtest SIOtest[2][9]; extern _SIOabout SIOabout[2][9]; @@ -343,7 +340,6 @@ extern _SPU2keyEvent SPU2keyEvent; extern _SPU2async SPU2async; extern _SPU2freeze SPU2freeze; extern _SPU2configure SPU2configure; -extern _SPU2configpath SPU2configpath; extern _SPU2test SPU2test; extern _SPU2about SPU2about; @@ -366,7 +362,6 @@ extern _CDVDctrlTrayClose CDVDctrlTrayClose; extern _CDVDkeyEvent CDVDkeyEvent; extern _CDVDfreeze CDVDfreeze; extern _CDVDconfigure CDVDconfigure; -extern _CDVDconfigpath CDVDconfigpath; extern _CDVDtest CDVDtest; extern _CDVDabout CDVDabout; extern _CDVDnewDiskCB CDVDnewDiskCB; @@ -389,7 +384,6 @@ extern _DEV9irqHandler DEV9irqHandler; extern _DEV9keyEvent DEV9keyEvent; extern _DEV9configure DEV9configure; -extern _DEV9configpath DEV9configpath; extern _DEV9freeze DEV9freeze; extern _DEV9test DEV9test; extern _DEV9about DEV9about; @@ -413,7 +407,6 @@ extern _USBsetRAM USBsetRAM; extern _USBkeyEvent USBkeyEvent; extern _USBconfigure USBconfigure; -extern _USBconfigpath USBconfigpath; extern _USBfreeze USBfreeze; extern _USBtest USBtest; extern _USBabout USBabout; @@ -429,7 +422,6 @@ extern _FWirqCallback FWirqCallback; extern _FWkeyEvent FWkeyEvent; extern _FWconfigure FWconfigure; -extern _FWconfigpath FWconfigpath; extern _FWfreeze FWfreeze; extern _FWtest FWtest; extern _FWabout FWabout; diff --git a/common/include/api/CDVDApi.h b/common/include/api/CDVDApi.h index 1be6538a9f..d6d0b4753a 100644 --- a/common/include/api/CDVDApi.h +++ b/common/include/api/CDVDApi.h @@ -58,7 +58,6 @@ EXPORT_C_(s32) CDVDctrlTrayClose(); //close disc tray EXPORT_C_(void) CDVDkeyEvent(keyEvent *ev); EXPORT_C_(void) CDVDconfigure(); EXPORT_C_(s32) CDVDfreeze(u8 mode, freezeData *data); -EXPORT_C_(void) CDVDconfigpath(char *configpath); EXPORT_C_(void) CDVDabout(); EXPORT_C_(s32) CDVDtest(); EXPORT_C_(void) CDVDnewDiskCB(void (*callback)()); diff --git a/common/include/api/Dev9Api.h b/common/include/api/Dev9Api.h index 8eaf36c297..88f495e8f2 100644 --- a/common/include/api/Dev9Api.h +++ b/common/include/api/Dev9Api.h @@ -62,7 +62,6 @@ EXPORT_C_(DEV9handler) DEV9irqHandler(void); EXPORT_C_(void) DEV9keyEvent(keyEvent *ev); EXPORT_C_(s32) DEV9freeze(u8 mode, freezeData *data); EXPORT_C_(void) DEV9configure(); -EXPORT_C_(void) DEV9configpath(char *configpath); EXPORT_C_(void) DEV9about(); EXPORT_C_(s32) DEV9test(); diff --git a/common/include/api/FWApi.h b/common/include/api/FWApi.h index cc35e99767..8e60bb6a55 100644 --- a/common/include/api/FWApi.h +++ b/common/include/api/FWApi.h @@ -51,7 +51,6 @@ EXPORT_C_(void) FWirqCallback(void (*callback)()); EXPORT_C_(void) FWkeyEvent(keyEvent *ev); EXPORT_C_(s32) FWfreeze(u8 mode, freezeData *data); EXPORT_C_(void) FWconfigure(); -EXPORT_C_(void) SPU2configpath(char *configpath); EXPORT_C_(void) FWabout(); EXPORT_C_(s32) FWtest(); #endif diff --git a/common/include/api/GSApi.h b/common/include/api/GSApi.h index 303cad33ec..79a78bee4a 100644 --- a/common/include/api/GSApi.h +++ b/common/include/api/GSApi.h @@ -79,7 +79,6 @@ EXPORT_C_(s32) CALLBACK GSsetWindowInfo(winInfo *info); #endif EXPORT_C_(s32) GSfreeze(u8 mode, freezeData *data); EXPORT_C_(void) GSconfigure(); -EXPORT_C_(void) GSconfigpath(char *configpath); EXPORT_C_(void) GSabout(); EXPORT_C_(s32) GStest(); diff --git a/common/include/api/PadApi.h b/common/include/api/PadApi.h index 0593f9f80c..34eafada87 100644 --- a/common/include/api/PadApi.h +++ b/common/include/api/PadApi.h @@ -62,7 +62,6 @@ EXPORT_C_(void) PADupdate(u8 pad); EXPORT_C_(void) PADgsDriverInfo(GSdriverInfo *info); EXPORT_C_(s32) PADfreeze(u8 mode, freezeData *data); EXPORT_C_(void) PADconfigure(); -EXPORT_C_(void) PADconfigpath(char *configpath); EXPORT_C_(void) PADabout(); EXPORT_C_(s32) PADtest(); diff --git a/common/include/api/SIOApi.h b/common/include/api/SIOApi.h index 67ecae75e3..0ed191c53c 100644 --- a/common/include/api/SIOApi.h +++ b/common/include/api/SIOApi.h @@ -68,7 +68,6 @@ EXPORT_C_(u32) SIOquery(); EXPORT_C_(void) SIOconfigure(); EXPORT_C_(keyEvent*) CALLBACK SIOkeyEvent(); EXPORT_C_(s32) SIOfreeze(u8 mode, freezeData *data); -EXPORT_C_(void) SIOconfigpath(char *configpath); EXPORT_C_(void) SIOabout(); EXPORT_C_(s32) SIOtest(); diff --git a/common/include/api/Spu2Api.h b/common/include/api/Spu2Api.h index 7309398a00..4e61e86241 100644 --- a/common/include/api/Spu2Api.h +++ b/common/include/api/Spu2Api.h @@ -71,7 +71,6 @@ EXPORT_C_(void) SPU2setClockPtr(u32* ptr); EXPORT_C_(void) SPU2async(u32 cycles); EXPORT_C_(s32) SPU2freeze(u8 mode, freezeData *data); EXPORT_C_(void) SPU2configure(); -EXPORT_C_(void) SPU2configpath(char *configpath); EXPORT_C_(void) SPU2about(); EXPORT_C_(s32) SPU2test(); diff --git a/common/include/api/USBApi.h b/common/include/api/USBApi.h index 8ef202e1b0..2dfd0e2e09 100644 --- a/common/include/api/USBApi.h +++ b/common/include/api/USBApi.h @@ -59,7 +59,6 @@ EXPORT_C_(void) USBsetRAM(void *mem); EXPORT_C_(void) USBkeyEvent(keyEvent *ev); EXPORT_C_(s32) USBfreeze(u8 mode, freezeData *data); EXPORT_C_(void) USBconfigure(); -EXPORT_C_(void) USBconfigpath(char *configpath); EXPORT_C_(void) USBabout(); EXPORT_C_(s32) USBtest(); From 493ecaa2064349c27f11241388bc3f283d4ca8a0 Mon Sep 17 00:00:00 2001 From: mattmenke Date: Sun, 15 Mar 2009 09:20:53 +0000 Subject: [PATCH 49/77] LilyPad: Fixed some binding stuff that some incompetant person broke in his last release. PADfreeze fixed so should work when called twice (Once for pad 1, once for pad 2). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@790 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/LilyPad/Config.cpp | 87 +++------------------------- plugins/LilyPad/InputManager.cpp | 26 ++++----- plugins/LilyPad/InputManager.h | 3 +- plugins/LilyPad/LilyPad.cpp | 97 ++++++++++++++++++++------------ plugins/LilyPad/LilyPad.rc | 14 ++--- plugins/LilyPad/resource.h | 21 +++---- 6 files changed, 100 insertions(+), 148 deletions(-) diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index 4afffc912a..f384f726da 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -1253,12 +1253,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l unsigned int uid; int value; InitInfo info = {selected==0x7F, hWndProp, hWnd, GetDlgItem(hWnd, selected)}; - int hint = 0; - if (selected < 0x7F) { - // 2 will accept relative axes, absolute axes, and POV controls. - hint = 2; - } - Device *dev = dm->GetActiveDevice(&info, hint, &uid, &index, &value); + Device *dev = dm->GetActiveDevice(&info, &uid, &index, &value); if (dev) { int command = selected; // Good idea to do this first, as BindCommand modifies the ListView, which will @@ -1276,75 +1271,6 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l index = BindCommand(dev, uid, pad, command, BASE_SENSITIVITY, 0); } } - else { - int v[4]; - int base = 0; - if (command == 0x30 || command == 0x31) { - base = 0x14; - } - else if (command == 0x32 || command == 0x33) { - base = 0x20; - } - else if (command == 0x34 || command == 0x35) { - base = 0x24; - } - else if (command == 0x36) { - base = 0x1B; - } - else if (command == 0x37) { - base = 0x19; - } - else if (command == 0x38) { - base = 0x12; - } - if (base) { - // Lx/Rx - if (base & 3) { - v[0] = base; - v[2] = base-1; - v[1]=v[3] = 0; - } - else { - if (command & 1) { - v[0] = base; - v[1] = base+1; - v[2] = base+2; - v[3] = base+3; - } - else { - v[0] = base+1; - v[1] = base+2; - v[2] = base+3; - v[3] = base; - } - } - if (uid & UID_POV) { - int rotate = 0; - while (value > 4500) { - rotate++; - value -= 9000; - } - index = BindCommand(dev, (uid&~UID_POV)|UID_POV_N, pad, v[(4-rotate)%4], BASE_SENSITIVITY, 0); - ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); - index = BindCommand(dev, (uid&~UID_POV)|UID_POV_E, pad, v[(5-rotate)%4], BASE_SENSITIVITY, 0); - ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); - index = BindCommand(dev, (uid&~UID_POV)|UID_POV_S, pad, v[(6-rotate)%4], BASE_SENSITIVITY, 0); - ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); - index = BindCommand(dev, (uid&~UID_POV)|UID_POV_W, pad, v[(7-rotate)%4], BASE_SENSITIVITY, 0); - } - else if (uid & UID_AXIS) { - int b1 = v[0]; - int b2 = v[2]; - if (value < 0) { - b1 = v[2]; - b2 = v[0]; - } - index = BindCommand(dev, (uid&~UID_AXIS)|UID_AXIS_POS, pad, b1, BASE_SENSITIVITY, 0); - ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); - index = BindCommand(dev, (uid&~UID_AXIS)|UID_AXIS_NEG, pad, b2, BASE_SENSITIVITY, 0); - } - } - } if (index >= 0) { PropSheet_Changed(hWndProp, hWnds[pad]); if (index >= 0) @@ -1504,7 +1430,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l } } } - else if ((cmd >= ID_GUITAR_HERO && cmd <= ID_L3R3) || cmd == ID_IGNORE) {// || cmd == ID_FORCE_FEEDBACK) { + else if ((cmd >= ID_GUITAR_HERO && cmd <= ID_ANALOG) || cmd == ID_IGNORE) {// || cmd == ID_FORCE_FEEDBACK) { // Messes up things, unfortunately. // End binding on a bunch of notification messages, and // this will send a bunch. @@ -1527,13 +1453,18 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l InitInfo info = {selected==0x7F, hWndProp, hWnd, GetDlgItem(hWnd, cmd)}; EatWndProc(info.hWndButton, DoNothingWndProc); + int w = timeGetTime(); dm->Update(&info); dm->PostRead(); // Workaround for things that return 0 on first poll and something else ever after. - Sleep(200); + Sleep(40); dm->Update(&info); dm->PostRead(); - SetTimer(hWnd, 1, 100, 0); + int w2 = timeGetTime(); + if (dm->devices[0xe]->oldVirtualControlState[6] != 0x8000) { + dm->devices[0xe]->oldVirtualControlState[6]=dm->devices[0xe]->oldVirtualControlState[6]; + } + SetTimer(hWnd, 1, 30, 0); } if (cmd == IDC_TURBO) { // Don't allow setting it back to indeterminate. diff --git a/plugins/LilyPad/InputManager.cpp b/plugins/LilyPad/InputManager.cpp index 0620243da5..809dab4649 100644 --- a/plugins/LilyPad/InputManager.cpp +++ b/plugins/LilyPad/InputManager.cpp @@ -350,7 +350,7 @@ void InputDeviceManager::PostRead() { } } -Device *InputDeviceManager::GetActiveDevice(void *info, int axisHint, unsigned int *uid, int *index, int *value) { +Device *InputDeviceManager::GetActiveDevice(void *info, unsigned int *uid, int *index, int *value) { int i, j; Update(info); int bestDiff = FULLY_DOWN/2; @@ -359,34 +359,30 @@ Device *InputDeviceManager::GetActiveDevice(void *info, int axisHint, unsigned i if (devices[i]->active) { for (j=0; jnumVirtualControls; j++) { if (devices[i]->virtualControlState[j] == devices[i]->oldVirtualControlState[j]) continue; + if (devices[i]->virtualControls[j].uid & UID_POV) continue; // Fix for two things: // Releasing button used to click on bind button, and // DirectInput not updating control state. //Note: Handling latter not great for pressure sensitive button handling, but should still work... // with some effort. - if (!((devices[i]->virtualControls[j].uid >> 16) & (POV|RELAXIS))) { + if (!(devices[i]->virtualControls[j].uid & (POV|RELAXIS))) { if (abs(devices[i]->oldVirtualControlState[j]) > abs(devices[i]->virtualControlState[j])) { devices[i]->oldVirtualControlState[j] = 0; } } int diff = abs(devices[i]->virtualControlState[j] - devices[i]->oldVirtualControlState[j]); - if ((devices[i]->virtualControls[j].uid & UID_POV) && diff) { - if (devices[i]->virtualControlState[j] == -1) diff = 0; - else diff = 2*FULLY_DOWN; - } // Make it require a bit more work to bind relative axes. - else if (((devices[i]->virtualControls[j].uid>>16) & 0xFF) == RELAXIS) { + if (((devices[i]->virtualControls[j].uid>>16) & 0xFF) == RELAXIS) { diff = diff/4+1; } if (diff > bestDiff) { - if (axisHint != 2) { - if (devices[i]->virtualControls[j].uid & UID_POV) continue; - if (devices[i]->virtualControls[j].uid & UID_AXIS) { - if ((((devices[i]->virtualControls[j].uid>>16)&0xFF) != ABSAXIS)) continue; - // Very picky when binding entire axes. Prefer binding half-axes. - if (devices[i]->oldVirtualControlState[j] >= FULLY_DOWN/8 && - devices[i]->oldVirtualControlState[j] <= FULLY_DOWN*7/8) continue; - } + if (devices[i]->virtualControls[j].uid & UID_AXIS) { + if ((((devices[i]->virtualControls[j].uid>>16)&0xFF) != ABSAXIS)) continue; + // Very picky when binding entire axes. Prefer binding half-axes. + if (!((devices[i]->oldVirtualControlState[j] < FULLY_DOWN/16 && devices[i]->virtualControlState[j] > FULLY_DOWN/8) || + (devices[i]->oldVirtualControlState[j] > 15*FULLY_DOWN/16 && devices[i]->virtualControlState[j] < 7*FULLY_DOWN/8))) + continue; + devices[i]->virtualControls[j].uid = devices[i]->virtualControls[j].uid; } bestDiff = diff; *uid = devices[i]->virtualControls[j].uid; diff --git a/plugins/LilyPad/InputManager.h b/plugins/LilyPad/InputManager.h index a53969865d..26120ee6a9 100644 --- a/plugins/LilyPad/InputManager.h +++ b/plugins/LilyPad/InputManager.h @@ -298,8 +298,7 @@ public: ~InputDeviceManager(); void AddDevice(Device *d); - // If axisHint is 1, prefer axes. - Device *GetActiveDevice(void *info, int axisHint, unsigned int *uid, int *index, int *value); + Device *GetActiveDevice(void *info, unsigned int *uid, int *index, int *value); void Update(void *attachInfo); // Called after reading state, after Update(). void PostRead(); diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index f36fef572d..482356c678 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -15,6 +15,10 @@ #include "svnrev.h" #include "resource.h" +#ifdef _DEBUG +#include "crtdbg.h" +#endif + // Used to prevent reading input and cleaning up input devices at the same time. // Only an issue when not reading input in GS thread and disabling devices due to // lost focus. @@ -32,8 +36,8 @@ int openCount = 0; int activeWindow = 0; int bufSize = 0; -static unsigned char outBuf[50]; -static unsigned char inBuf[50]; +unsigned char outBuf[50]; +unsigned char inBuf[50]; #define MODE_DIGITAL 0x41 #define MODE_ANALOG 0x73 @@ -79,10 +83,10 @@ void DEBUG_NEW_SET() { end++[0] = '\n'; DWORD junk; WriteFile(hFile, temp, end-temp, &junk, 0); - bufSize = 0; CloseHandle(hFile);; } } + bufSize = 0; } inline void DEBUG_IN(unsigned char c) { @@ -298,7 +302,6 @@ int lockStateChanged[2] = {0,0}; #define LOCK_BUTTONS 4 #define LOCK_BOTH 1 -extern HWND hWndStealing; void Update(int pad) { if ((unsigned int)pad > 2) return; @@ -529,11 +532,6 @@ void CALLBACK PADshutdown() { UnloadConfigs(); } -#ifdef _DEBUG -#include "crtdbg.h" -#endif - - inline void StopVibrate() { for (int i=0; i<4; i++) { SetVibrate(&pads[i/2], i&1, 0); @@ -626,7 +624,7 @@ struct QueryInfo { u8 currentCommand; u8 numBytes; u8 queryDone; - u8 response[22]; + u8 response[42]; } query = {0,0,0,0, 0,0xFF, 0xF3}; int saveStateIndex = 0; @@ -823,6 +821,19 @@ u8 CALLBACK PADpoll(u8 value) { DEBUG_OUT(query.response[1+query.lastByte]); return query.response[++query.lastByte]; } + /* + { + query.numBytes = 35; + u8 test[35] = {0xFF, 0x80, 0x5A, + 0x73, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80, + 0x73, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80, + 0x73, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80, + 0x73, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80 + }; + memcpy(query.response, test, sizeof(test)); + DEBUG_OUT(query.response[1+query.lastByte]); + return query.response[++query.lastByte]; + }//*/ int i; Pad *pad = &pads[query.pad]; if (query.lastByte == 0) { @@ -1190,7 +1201,11 @@ struct PadPluginFreezeData { // Currently all different versions are incompatible. // May split into major/minor with some compatibility rules. u32 version; - PadFreezeData padData[2]; + // So when loading, know which plugin's settings I'm loading. + // Not a big deal. Use a static variable when saving to figure it out. + u8 port; + // Currently only use padData[0]. Save room for all 4 slots for simplicity. + PadFreezeData padData[4]; }; s32 CALLBACK PADfreeze(int mode, freezeData *data) { @@ -1200,58 +1215,68 @@ s32 CALLBACK PADfreeze(int mode, freezeData *data) { else if (mode == FREEZE_LOAD) { if (data->size < sizeof(PadPluginFreezeData)) return 0; PadPluginFreezeData &pdata = *(PadPluginFreezeData*)(data->data); - strcpy(pdata.format, "PadMode"); - pdata.version = PAD_SAVE_STATE_VERSION; - for (int i=0; i<2; i++) { - pdata.padData[i].mode = pads[i].mode; - pdata.padData[i].locked = pads[i].modeLock; - memcpy(pdata.padData[i].umask, pads[i].umask, sizeof(pads[i].umask)); - memcpy(pdata.padData[i].vibrate, pads[i].vibrate, sizeof(pads[i].vibrate)); - + if (pdata.version != PAD_SAVE_STATE_VERSION || strcmp(pdata.format, "PadMode")) return 0; + StopVibrate(); + int port = pdata.port; + for (int i=0; i<1; i++) { + u8 mode = pads[port].mode = pdata.padData[i].mode; + if (mode != MODE_DIGITAL && mode != MODE_ANALOG && mode != MODE_DS2_NATIVE) { + ResetPad(i); + continue; + } + pads[port].config = pdata.padData[i].config; + pads[port].modeLock = pdata.padData[i].locked; + memcpy(pads[port].umask, pdata.padData[i].umask, sizeof(pads[port].umask)); // Means I only have to have one chunk of code to parse vibrate info. // Other plugins don't store it exactly, but think it's technically correct // to do so, though I could be wrong. - pads[i].config = 1; PADstartPoll(i+1); PADpoll(0x4D); PADpoll(0x00); for (int j=0; j<7; j++) { PADpoll(pdata.padData[i].vibrate[j]); } - - pdata.padData[i].config = pads[i].config; } } else if (mode == FREEZE_SAVE) { if (data->size != sizeof(PadPluginFreezeData)) return 0; PadPluginFreezeData &pdata = *(PadPluginFreezeData*)(data->data); - if (pdata.version != PAD_SAVE_STATE_VERSION || !stricmp(pdata.format, "PadMode")) return 0; - StopVibrate(); - for (int i=0; i<2; i++) { - u8 mode = pads[i].mode = pdata.padData[i].mode; - if (mode != MODE_DIGITAL && mode != MODE_ANALOG && mode != MODE_DS2_NATIVE) { - ResetPad(i); - continue; - } - pads[i].config = pdata.padData[i].config; - pads[i].modeLock = pdata.padData[i].locked; - memcpy(pads[i].umask, pdata.padData[i].umask, sizeof(pads[i].umask)); + static int nextPort = 0; + if (!pads[nextPort].initialized) nextPort ^= 1; + int port = nextPort; + if (!pads[nextPort^1].initialized) nextPort = 0; + else nextPort ^= 1; + + + memset(&pdata, 0, sizeof(pdata)); + strcpy(pdata.format, "PadMode"); + pdata.version = PAD_SAVE_STATE_VERSION; + pdata.port = port; + for (int i=0; i<1; i++) { + pdata.padData[i].mode = pads[port].mode; + pdata.padData[i].locked = pads[port].modeLock; + memcpy(pdata.padData[i].umask, pads[port].umask, sizeof(pads[port].umask)); + memcpy(pdata.padData[i].vibrate, pads[port].vibrate, sizeof(pads[port].vibrate)); + // Means I only have to have one chunk of code to parse vibrate info. // Other plugins don't store it exactly, but think it's technically correct // to do so, though I could be wrong. - PADstartPoll(i+1); + pads[port].config = 1; + PADstartPoll(port+1); PADpoll(0x4D); PADpoll(0x00); for (int j=0; j<7; j++) { - PADpoll(pdata.padData[i].vibrate[j]); + PADpoll(pdata.padData[port].vibrate[j]); } + + pdata.padData[port].config = pads[port].config; } } else return -1; return 0; -} + } u32 CALLBACK PADreadPort1 (PadDataS* pads) { PADstartPoll(1); diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index 39eba2e065..c6cf057224 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -74,17 +74,17 @@ BEGIN PUSHBUTTON "R2",ID_R2,372,73,45,15 PUSHBUTTON "L3",ID_L3,195,93,45,15 PUSHBUTTON "R3",ID_R3,371,93,46,15 - GROUPBOX "D-Pad",IDC_STATIC,251,44,110,68 + GROUPBOX "D-Pad",IDC_DPAD,251,44,110,68 PUSHBUTTON "Up",ID_DPAD_UP,285,54,35,15 PUSHBUTTON "Left",ID_DPAD_LEFT,267,73,35,15 PUSHBUTTON "Right",ID_DPAD_RIGHT,307,73,35,15 PUSHBUTTON "Down",ID_DPAD_DOWN,285,92,35,15 - GROUPBOX "Left Analog Stick",IDC_STATIC,195,115,108,70 + GROUPBOX "Left Analog Stick",IDC_LSTICK,195,115,108,70 PUSHBUTTON "Up",ID_LSTICK_UP,228,125,35,15 PUSHBUTTON "Left",ID_LSTICK_LEFT,210,144,35,15 PUSHBUTTON "Right",ID_LSTICK_RIGHT,250,144,35,15 PUSHBUTTON "Down",ID_LSTICK_DOWN,228,164,35,15 - GROUPBOX "Right Analog Stick",IDC_STATIC,309,115,108,70 + GROUPBOX "Right Analog Stick",IDC_RSTICK,309,115,108,70 PUSHBUTTON "Up",ID_RSTICK_UP,342,125,35,15 PUSHBUTTON "Left",ID_RSTICK_LEFT,324,144,35,15 PUSHBUTTON "Right",ID_RSTICK_RIGHT,364,144,35,15 @@ -279,7 +279,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_CONFIG, DIALOG BEGIN diff --git a/plugins/LilyPad/resource.h b/plugins/LilyPad/resource.h index 67e24e710b..7bb44e981c 100644 --- a/plugins/LilyPad/resource.h +++ b/plugins/LilyPad/resource.h @@ -34,11 +34,18 @@ #define IDC_DISABLE_SCREENSAVER 1119 #define IDC_MOUSE_UNFOCUS 1120 #define IDC_MOUSE_UNFOCUS2 1121 +#define IDC_AXIS_BUTTONS 1121 #define IDC_BACKGROUND 1122 #define IDC_MULTIPLE_BINDING 1123 +#define IDC_DISABLE_SCREENSAVER2 1124 #define IDC_FORCE_HIDE 1124 +#define IDC_FORCE_HIDE2 1125 #define IDC_GH2_HACK 1125 +#define IDC_FORCEFEEDBACK_HACK1 1126 +#define IDC_GH2_HACK2 1126 #define IDC_VISTA_VOLUME 1126 +#define IDC_DISABLE_SCREENSAVER4 1127 +#define IDC_FORCEFEEDBACK_HACK2 1127 #define IDC_FORCE_HIDE3 1127 #define IDC_GS_THREAD_INPUT 1128 #define IDC_SAVE_STATE_TITLE 1129 @@ -50,6 +57,9 @@ #define IDC_TURBO 0x1005 #define IDC_AXIS_DEVICE1 0x1006 #define ID_SENSITIVITY 0x1007 +#define IDC_DPAD 0x1008 +#define IDC_LSTICK 0x1009 +#define IDC_RSTICK 0x100A #define ID_GUITAR_HERO 0x10FB #define ID_LOCK_BUTTONS 0x10FC #define ID_LOCK 0x10FD @@ -80,15 +90,6 @@ #define ID_RSTICK_DOWN 0x1116 #define ID_RSTICK_LEFT 0x1117 #define ID_ANALOG 0x1118 -#define ID_DPAD_LRAXIS 0x1120 -#define ID_DPAD_UDAXIS 0x1121 -#define ID_LSTICK_LRAXIS 0x1122 -#define ID_LSTICK_UDAXIS 0x1123 -#define ID_RSTICK_LRAXIS 0x1124 -#define ID_RSTICK_UDAXIS 0x1125 -#define ID_L1R1 0x1126 -#define ID_L2R2 0x1127 -#define ID_L3R3 0x1128 #define ID_DELETE 0x11FF #define ID_DEBUG 0x1200 #define ID_IGNORE 0x1201 @@ -147,7 +148,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 112 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1127 +#define _APS_NEXT_CONTROL_VALUE 1130 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif From 0efde91a928ac1f50ad2ea52165e954008d53198 Mon Sep 17 00:00:00 2001 From: mattmenke Date: Sun, 15 Mar 2009 09:30:31 +0000 Subject: [PATCH 50/77] Save States: Added PADfreeze calls to PCSX2, though they're currently only implemented by LilyPad. Also fixed a bug where a save state would failed to load when the last plugin's freeze function actually saved something. Minor changes to new plugin API as well. Because of a convenient bug in load state function, older save states with no saved pad info should still work. Don't blame me if they don't, though. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@791 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/PS2Edefs.h | 11 +++++++---- common/include/PluginCallbacks.h | 20 ++++++++++---------- common/include/api/SIOApi.h | 13 ++++++++----- pcsx2/Plugins.cpp | 6 ++++++ pcsx2/SaveState.cpp | 6 ++++-- 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/common/include/PS2Edefs.h b/common/include/PS2Edefs.h index dbd2f1fcff..f5825d654a 100644 --- a/common/include/PS2Edefs.h +++ b/common/include/PS2Edefs.h @@ -5,12 +5,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA @@ -27,7 +27,7 @@ */ /* - Notes: + Notes: * Since this is still beta things may change. * OSflags: @@ -41,7 +41,7 @@ * reserved keys: F1 to F10 are reserved for the emulator - * plugins should NOT change the current + * plugins should NOT change the current working directory. (on win32, add flag OFN_NOCHANGEDIR for GetOpenFileName) @@ -548,6 +548,7 @@ typedef void (CALLBACK* _PADgsDriverInfo)(GSdriverInfo *info); typedef void (CALLBACK* _PADconfigure)(); typedef s32 (CALLBACK* _PADtest)(); typedef void (CALLBACK* _PADabout)(); +typedef int (CALLBACK* _PADfreeze)(int mode, freezeData *data); // SIO typedef s32 (CALLBACK* _SIOinit)(u32 port, u32 slot, SIOchangeSlotCB f); @@ -732,6 +733,7 @@ extern _PADgsDriverInfo PAD1gsDriverInfo; extern _PADconfigure PAD1configure; extern _PADtest PAD1test; extern _PADabout PAD1about; +extern _PADfreeze PAD1freeze; // PAD2 extern _PADinit PAD2init; @@ -748,6 +750,7 @@ extern _PADgsDriverInfo PAD2gsDriverInfo; extern _PADconfigure PAD2configure; extern _PADtest PAD2test; extern _PADabout PAD2about; +extern _PADfreeze PAD2freeze; // SIO[2] extern _SIOinit SIOinit[2][9]; diff --git a/common/include/PluginCallbacks.h b/common/include/PluginCallbacks.h index bed5d784df..b6e65a131a 100644 --- a/common/include/PluginCallbacks.h +++ b/common/include/PluginCallbacks.h @@ -15,18 +15,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - - + + #ifndef __PLUGINCALLBACKS_H__ #define __PLUGINCALLBACKS_H__ -extern "C" -{ +extern "C" +{ // General typedef u32 (CALLBACK* _PS2EgetLibType)(void); typedef u32 (CALLBACK* _PS2EgetLibVersion2)(u32 type); typedef char*(CALLBACK* _PS2EgetLibName)(void); -typedef void (CALLBACK* _PS2EpassConfig)(PcsxConfig Config); +typedef void (CALLBACK* _PS2EpassConfig)(PcsxConfig *Config); // GS // NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs @@ -224,7 +224,7 @@ typedef void (CALLBACK* _FWconfigure)(); typedef s32 (CALLBACK* _FWtest)(); typedef void (CALLBACK* _FWabout)(); -// General +// General extern _PS2EgetLibType PS2EgetLibType; extern _PS2EgetLibVersion2 PS2EgetLibVersion2; extern _PS2EgetLibName PS2EgetLibName; @@ -276,7 +276,7 @@ extern _PADpoll PAD1poll; extern _PADquery PAD1query; extern _PADupdate PAD1update; -extern _PADfreeze PAD1freeze; +extern _PADfreeze PAD1freeze; extern _PADgsDriverInfo PAD1gsDriverInfo; extern _PADconfigure PAD1configure; extern _PADtest PAD1test; @@ -293,7 +293,7 @@ extern _PADpoll PAD2poll; extern _PADquery PAD2query; extern _PADupdate PAD2update; -extern _PADfreeze PAD2freeze; +extern _PADfreeze PAD2freeze; extern _PADgsDriverInfo PAD2gsDriverInfo; extern _PADconfigure PAD2configure; extern _PADtest PAD2test; @@ -307,9 +307,9 @@ extern _SIOshutdown SIOshutdown[2][9]; extern _SIOstartPoll SIOstartPoll[2][9]; extern _SIOpoll SIOpoll[2][9]; extern _SIOquery SIOquery[2][9]; -extern _SIOkeyEvent SIOkeyEvent; +extern _SIOkeyEvent SIOkeyEvent; -extern _SIOfreeze SIOfreeze[2][9]; +extern _SIOfreeze SIOfreeze[2][9]; extern _SIOconfigure SIOconfigure[2][9]; extern _SIOtest SIOtest[2][9]; extern _SIOabout SIOabout[2][9]; diff --git a/common/include/api/SIOApi.h b/common/include/api/SIOApi.h index 0ed191c53c..a08fd1532a 100644 --- a/common/include/api/SIOApi.h +++ b/common/include/api/SIOApi.h @@ -35,8 +35,10 @@ // Called by SIO_TYPE_MTAP plugins to change the slot. // Slot is then passed to memcard and pad plugins on SIOstartPoll. -// MTAP SIO plugins should ignore slot vvalues on startPoll, as should RMs (probably). -typedef int (CALLBACK * SIOchangeSlotCB)(int slot); +// MTAP SIO plugins should ignore slot values on startPoll, as should RMs (probably). + +// Port isn't strictly necessary, but doesn't hurt. +typedef int (CALLBACK * SIOchangeSlotCB)(int port, int slot); // Basic functions. @@ -67,7 +69,10 @@ EXPORT_C_(u32) SIOquery(); EXPORT_C_(void) SIOconfigure(); EXPORT_C_(keyEvent*) CALLBACK SIOkeyEvent(); -EXPORT_C_(s32) SIOfreeze(u8 mode, freezeData *data); + +// Save one type at a time. If a plugin supports all 4 types, +// should expect 4 calls. Increases savestate compatibility. +EXPORT_C_(s32) SIOfreeze(u8 mode, freezeData *data, int type); EXPORT_C_(void) SIOabout(); EXPORT_C_(s32) SIOtest(); @@ -78,6 +83,4 @@ SIO_TYPE_RM = 0x00000040, SIO_TYPE_MC = 0x00000100 } SioTypes; -#endif - #endif // __SIOAPI_H__ \ No newline at end of file diff --git a/pcsx2/Plugins.cpp b/pcsx2/Plugins.cpp index 1238eed877..8576cf9215 100644 --- a/pcsx2/Plugins.cpp +++ b/pcsx2/Plugins.cpp @@ -71,6 +71,7 @@ _PADgsDriverInfo PAD1gsDriverInfo; _PADconfigure PAD1configure; _PADtest PAD1test; _PADabout PAD1about; +_PADfreeze PAD1freeze; // PAD2 _PADinit PAD2init; @@ -87,6 +88,7 @@ _PADgsDriverInfo PAD2gsDriverInfo; _PADconfigure PAD2configure; _PADtest PAD2test; _PADabout PAD2about; +_PADfreeze PAD2freeze; // SIO[2] _SIOinit SIOinit[2][9]; @@ -330,6 +332,7 @@ void *PAD1plugin; void CALLBACK PAD1_configure() {} void CALLBACK PAD1_about() {} s32 CALLBACK PAD1_test() { return 0; } +s32 CALLBACK PAD1_freeze(int mode, freezeData *data) { data->size = 0; return 0; } int LoadPAD1plugin(const string& filename) { void *drv; @@ -352,6 +355,7 @@ int LoadPAD1plugin(const string& filename) { MapSymbolPAD_Fallback(PAD1,PAD,configure); MapSymbolPAD_Fallback(PAD1,PAD,about); MapSymbolPAD_Fallback(PAD1,PAD,test); + MapSymbolPAD_Fallback(PAD1,PAD,freeze); return 0; } @@ -361,6 +365,7 @@ void *PAD2plugin; void CALLBACK PAD2_configure() {} void CALLBACK PAD2_about() {} s32 CALLBACK PAD2_test() { return 0; } +s32 CALLBACK PAD2_freeze(int mode, freezeData *data) { data->size = 0; return 0; } int LoadPAD2plugin(const string& filename) { void *drv; @@ -383,6 +388,7 @@ int LoadPAD2plugin(const string& filename) { MapSymbolPAD_Fallback(PAD2,PAD,configure); MapSymbolPAD_Fallback(PAD2,PAD,about); MapSymbolPAD_Fallback(PAD2,PAD,test); + MapSymbolPAD_Fallback(PAD2,PAD,freeze); return 0; } diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 318eb53b4a..9a13e1b07b 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -139,6 +139,8 @@ void SaveState::FreezeAll() FreezePlugin( "SPU2", SPU2freeze ); FreezePlugin( "DEV9", DEV9freeze ); FreezePlugin( "USB", USBfreeze ); + FreezePlugin( "PAD1", PAD1freeze ); + FreezePlugin( "PAD2", PAD2freeze ); if( IsLoading() ) PostLoadPrep(); @@ -267,9 +269,9 @@ void gzLoadingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int fP.data = (s8*)malloc(fP.size); if (fP.data == NULL) throw Exception::OutOfMemory(); - gzread(m_file, fP.data, fP.size); + int read = gzread(m_file, fP.data, fP.size); - if( gzeof( m_file ) ) + if( read != fP.size ) throw Exception::BadSavedState( m_filename ); if(freezer(FREEZE_LOAD, &fP) == -1) From 7a0e3dca12d231f0592df6f639923871b7841b08 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Sun, 15 Mar 2009 10:03:34 +0000 Subject: [PATCH 51/77] implemented all vu lower instructions (second pass). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@792 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU.cpp | 2 +- pcsx2/x86/microVU.h | 14 +-- pcsx2/x86/microVU_Alloc.inl | 16 ++++ pcsx2/x86/microVU_Lower.inl | 171 +++++++++++++++++++++++++++++++----- pcsx2/x86/microVU_Misc.h | 5 +- 5 files changed, 178 insertions(+), 30 deletions(-) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index 2ce53e7a8c..d61690c514 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -64,7 +64,7 @@ PCSX2_ALIGNED16(const float mVU_ITOF_15[4]) = {0.000030517578125, 0.000030517578 // Micro VU - Main Functions //------------------------------------------------------------------ -// Only run this once! ;) +// Only run this once per VU! ;) microVUt(void) mVUinit(VURegs* vuRegsPtr) { microVU* mVU = mVUx; diff --git a/pcsx2/x86/microVU.h b/pcsx2/x86/microVU.h index dcae7f4377..f76f271585 100644 --- a/pcsx2/x86/microVU.h +++ b/pcsx2/x86/microVU.h @@ -20,6 +20,7 @@ #define _EmitterId_ (vuIndex+1) #include "Common.h" #include "VU.h" +#include "GS.h" #include "ix86/ix86.h" #include "microVU_Alloc.h" @@ -104,15 +105,16 @@ struct microVU { u32 microSize; // VU Micro Memory Size u32 progSize; // VU Micro Program Size (microSize/8) u32 cacheAddr; // VU Cache Start Address - static const u32 cacheSize = 0x400000; // VU Cache Size + static const u32 cacheSize = 0x500000; // VU Cache Size microProgManager<0x800> prog; // Micro Program Data - VURegs* regs; // VU Regs Struct - u8* cache; // Dynarec Cache Start (where we will start writing the recompiled code to) - u8* ptr; // Pointer to next place to write recompiled code to - u32 code; // Contains the current Instruction - u32 iReg; // iReg + VURegs* regs; // VU Regs Struct + u8* cache; // Dynarec Cache Start (where we will start writing the recompiled code to) + u8* ptr; // Pointer to next place to write recompiled code to + u32 code; // Contains the current Instruction + u32 iReg; // iReg (only used in recompilation, not execution) + u32 clipFlag[4]; // 4 instances of clip flag (used in execution) /* uptr x86eax; // Accumulator register. Used in arithmetic operations. diff --git a/pcsx2/x86/microVU_Alloc.inl b/pcsx2/x86/microVU_Alloc.inl index ccea38603b..6da7d4472e 100644 --- a/pcsx2/x86/microVU_Alloc.inl +++ b/pcsx2/x86/microVU_Alloc.inl @@ -741,6 +741,16 @@ microVUt(void) mVUallocMFLAGb(int reg, int fInstance) { OR32RtoR(fInstance, reg); } +microVUt(void) mVUallocCFLAGa(int reg, int fInstance) { + microVU* mVU = mVUx; + MOV32MtoR(reg, mVU->clipFlag[fInstance]); +} + +microVUt(void) mVUallocCFLAGb(int reg, int fInstance) { + microVU* mVU = mVUx; + MOV32RtoM(mVU->clipFlag[fInstance], reg); +} + //------------------------------------------------------------------ // VI Reg Allocators //------------------------------------------------------------------ @@ -788,4 +798,10 @@ microVUt(void) mVUallocVIb(int GPRreg, int _reg_) { if (!_reg_) { getZero(reg); } \ else { mVUloadReg(reg, (uptr)&mVU->regs->VF[_reg_].UL[0], _X_Y_Z_W); } \ } + +// VF to GPR +#define getReg8(GPRreg, _reg_, _fxf_) { \ + if (!_reg_ && (_fxf_ < 3)) { XOR32RtoR(GPRreg, GPRreg); } \ + else { MOV32MtoR(GPRreg, (uptr)&mVU->regs->VF[_reg_].UL[0]); } \ +} #endif //PCSX2_MICROVU diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 9a3579aae5..1002a578f5 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -207,11 +207,11 @@ microVUf(void) mVU_EATANxz() { mVU_EATAN_(); } } -#define eexpHelper(addr) { \ - SSE_MULSS_XMM_to_XMM(xmmT1, xmmFs); \ - SSE_MOVAPS_XMM_to_XMM(xmmFt, xmmT1); \ - SSE_MULSS_M32_to_XMM(xmmFt, (uptr)addr); \ - SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFt); \ +#define eexpHelper(addr) { \ + SSE_MULSS_XMM_to_XMM(xmmT1, xmmFs); \ + SSE_MOVAPS_XMM_to_XMM(xmmFt, xmmT1); \ + SSE_MULSS_M32_to_XMM(xmmFt, (uptr)addr); \ + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFt); \ } microVUf(void) mVU_EEXP() { microVU* mVU = mVUx; @@ -334,11 +334,11 @@ microVUf(void) mVU_ESADD() { SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, writeP ? 0x27 : 0xC6); // Flip back } } -#define esinHelper(addr) { \ - SSE_MULSS_XMM_to_XMM(xmmT1, xmmFt); \ - SSE_MOVAPS_XMM_to_XMM(xmmFs, xmmT1); \ - SSE_MULSS_M32_to_XMM(xmmFs, (uptr)addr); \ - SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); \ +#define esinHelper(addr) { \ + SSE_MULSS_XMM_to_XMM(xmmT1, xmmFt); \ + SSE_MOVAPS_XMM_to_XMM(xmmFs, xmmT1); \ + SSE_MULSS_M32_to_XMM(xmmFs, (uptr)addr); \ + SSE_ADDSS_XMM_to_XMM(xmmPQ, xmmFs); \ } microVUf(void) mVU_ESIN() { microVU* mVU = mVUx; @@ -390,11 +390,56 @@ microVUf(void) mVU_ESUM() { } } -microVUf(void) mVU_FCAND() {} -microVUf(void) mVU_FCEQ() {} -microVUf(void) mVU_FCOR() {} -microVUf(void) mVU_FCSET() {} -microVUf(void) mVU_FCGET() {} +microVUf(void) mVU_FCAND() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + mVUallocCFLAGa(gprT2, fvcInstance); + XOR32RtoR(gprT1, gprT1); + AND32ItoR(gprT2, _Imm24_); + SETNZ8R(gprT1); + mVUallocVIb(gprT1, 1); + } +} +microVUf(void) mVU_FCEQ() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + mVUallocCFLAGa(gprT2, fvcInstance); + XOR32RtoR(gprT1, gprT1); + CMP32ItoR(gprT2, _Imm24_); + SETNZ8R(gprT1); + mVUallocVIb(gprT1, 1); + } +} +microVUf(void) mVU_FCGET() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + mVUallocCFLAGa(gprT1, fvcInstance); + AND32ItoR(gprT1, 0xfff); + mVUallocVIb(gprT1, _Ft_); + } +} +microVUf(void) mVU_FCOR() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + mVUallocCFLAGa(gprT1, fvcInstance); + OR32ItoR(gprT1, _Imm24_); + ADD32ItoR(gprT1, 1); // If 24 1's will make 25th bit 1, else 0 + SHR32ItoR(gprT1, 24); // Get the 25th bit (also clears the rest of the garbage in the reg) + mVUallocVIb(gprT1, 1); + } +} +microVUf(void) mVU_FCSET() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + MOV32ItoR(gprT1, _Imm24_); + mVUallocCFLAGb(gprT1, fcInstance); + } +} microVUf(void) mVU_FMAND() { microVU* mVU = mVUx; @@ -800,15 +845,76 @@ microVUf(void) mVU_SQI() { } } -microVUf(void) mVU_RINIT() {} -microVUf(void) mVU_RGET() {} -microVUf(void) mVU_RNEXT() {} -microVUf(void) mVU_RXOR() {} +microVUf(void) mVU_RINIT() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (_Fs_ || (_Fsf_ == 3)) { + getReg8(gprR, _Fs_, _Fsf_); + AND32ItoR(gprR, 0x007fffff); + OR32ItoR (gprR, 0x3f800000); + } + else MOV32ItoR(gprR, 0x3f800000); + } +} +microVUt(void) mVU_RGET_() { + microVU* mVU = mVUx; + if (_Ft_) { + if (_X) MOV32RtoM((uptr)&mVU->regs->VF[_Ft_].UL[0], gprR); + if (_Y) MOV32RtoM((uptr)&mVU->regs->VF[_Ft_].UL[1], gprR); + if (_Z) MOV32RtoM((uptr)&mVU->regs->VF[_Ft_].UL[2], gprR); + if (_W) MOV32RtoM((uptr)&mVU->regs->VF[_Ft_].UL[3], gprR); + } +} +microVUf(void) mVU_RGET() { + microVU* mVU = mVUx; + if (recPass == 0) { /*if (!_Ft_) nop();*/ } + else { mVU_RGET_(); } +} +microVUf(void) mVU_RNEXT() { + microVU* mVU = mVUx; + if (recPass == 0) { /*if (!_Ft_) nop();*/ } + else { + // algorithm from www.project-fao.org + MOV32RtoR(gprT1, gprR); + SHR32ItoR(gprT1, 4); + AND32ItoR(gprT1, 1); -microVUf(void) mVU_WAITP() {} -microVUf(void) mVU_WAITQ() {} + MOV32RtoR(gprT2, gprR); + SHR32ItoR(gprT2, 22); + AND32ItoR(gprT2, 1); + + SHL32ItoR(gprR, 1); + XOR32RtoR(gprT1, gprT2); + XOR32RtoR(gprR, gprT1); + AND32ItoR(gprR, 0x007fffff); + OR32ItoR (gprR, 0x3f800000); + mVU_RGET_(); + } +} +microVUf(void) mVU_RXOR() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + if (_Fs_ || (_Fsf_ == 3)) { + getReg8(gprT1, _Fs_, _Fsf_); + AND32ItoR(gprT1, 0x7fffff); + XOR32RtoR(gprR, gprT1); + } + } +} + +microVUf(void) mVU_WAITP() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else {} +} +microVUf(void) mVU_WAITQ() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else {} +} -microVUf(void) mVU_XGKICK() {} microVUf(void) mVU_XTOP() { microVU* mVU = mVUx; if (recPass == 0) {} @@ -825,4 +931,25 @@ microVUf(void) mVU_XITOP() { mVUallocVIb(gprT1, _Ft_); } } + +microVUt(void) __fastcall mVU_XGKICK_(u32 addr) { + microVU* mVU = mVUx; + u32 *data = (u32*)(mVU->regs->Mem + (addr&0x3fff)); + u32 size = mtgsThread->PrepDataPacket( GIF_PATH_1, data, (0x4000-(addr&0x3fff)) >> 4); + u8 *pDest = mtgsThread->GetDataPacketPtr(); + memcpy_aligned(pDest, mVU->regs->Mem + addr, size<<4); + mtgsThread->SendDataPacket(); +} +void __fastcall mVU_XGKICK0(u32 addr) { mVU_XGKICK_<0>(addr); } +void __fastcall mVU_XGKICK1(u32 addr) { mVU_XGKICK_<1>(addr); } + +microVUf(void) mVU_XGKICK() { + microVU* mVU = mVUx; + if (recPass == 0) {} + else { + mVUallocVIa(gprT2, _Fs_); // gprT2 = ECX for __fastcall + if (!vuIndex) CALLFunc((uptr)mVU_XGKICK0); + else CALLFunc((uptr)mVU_XGKICK1); + } +} #endif //PCSX2_MICROVU diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index a7cfc6330d..e28ec9c4e2 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -83,6 +83,7 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define _Imm12_ (((mVU->code >> 21 ) & 0x1) << 11) | (mVU->code & 0x7ff) #define _Imm5_ (((mVU->code & 0x400) ? 0xfff0 : 0) | ((mVU->code >> 6) & 0xf)) #define _Imm15_ (((mVU->code >> 10) & 0x7800) | (mVU->code & 0x7ff)) +#define _Imm24_ (u32)(mVU->code & 0xffffff) #define getVUmem(x) (((vuIndex == 1) ? (x & 0x3ff) : ((x >= 0x400) ? (x & 0x43f) : (x & 0xff))) * 16) #define offsetSS ((_X) ? (0) : ((_Y) ? (4) : ((_Z) ? 8: 12))) @@ -107,7 +108,7 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define gprT1 0 // Temp Reg #define gprT2 1 // Temp Reg -#define gprT3 2 // Temp Reg? +#define gprR 2 // R Reg #define gprF0 3 // MAC Flag::Status Flag 0 #define gprESP 4 // Don't use? #define gprF1 5 // MAC Flag::Status Flag 1 @@ -140,6 +141,8 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define fpsInstance (((u8)((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<12)) >> 12) - 1) & 0x3) #define fvmInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) #define fvsInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<16)) >> 16) +#define fvcInstance 1//((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) +#define fcInstance 1//((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) //#define getFs (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<13)) //#define getFt (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<14)) From 3f87ae7078964b34af871c9bf5a9b623e2c4d463 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Sun, 15 Mar 2009 12:24:24 +0000 Subject: [PATCH 52/77] Looks like the new PCR/TIMR code wasn't called correctly in recMFC0. This broke Fatal Frame (yes, again..). Thanks to Nneeve for finding and fixing it so fast :) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@793 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/iCOP0.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcsx2/x86/iCOP0.cpp b/pcsx2/x86/iCOP0.cpp index e4885568cf..658df14948 100644 --- a/pcsx2/x86/iCOP0.cpp +++ b/pcsx2/x86/iCOP0.cpp @@ -165,8 +165,12 @@ void recMFC0( void ) break; case 1: + CALLFunc( (uptr)COP0_UpdatePCCR ); + MOV32MtoR(EAX, (uptr)&cpuRegs.PERF.n.pcr0); + break; case 3: CALLFunc( (uptr)COP0_UpdatePCCR ); + MOV32MtoR(EAX, (uptr)&cpuRegs.PERF.n.pcr1); break; } _deleteEEreg(_Rt_, 0); From 0c95bbc9fdf069dc4516e71ca61750da837c5437 Mon Sep 17 00:00:00 2001 From: mattmenke Date: Sun, 15 Mar 2009 15:00:22 +0000 Subject: [PATCH 53/77] LilyPad: Lots of new code that (ideally) makes absolutely no difference. And a fix for saving rumble settings in PADfreeze. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@794 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/LilyPad/Config.cpp | 510 ++++++++++++++++++------------- plugins/LilyPad/Config.h | 16 +- plugins/LilyPad/DirectInput.cpp | 159 +++++----- plugins/LilyPad/InputManager.cpp | 102 ++++--- plugins/LilyPad/InputManager.h | 6 +- plugins/LilyPad/KeyboardHook.cpp | 4 +- plugins/LilyPad/LilyPad.cpp | 450 +++++++++++++-------------- plugins/LilyPad/LilyPad.rc | 22 +- plugins/LilyPad/XInput.cpp | 28 +- plugins/LilyPad/resource.h | 14 +- 10 files changed, 716 insertions(+), 595 deletions(-) diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index f384f726da..e3ce0d465f 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -29,10 +29,10 @@ HWND hWndProp = 0; int selected = 0; -HWND hWnds[2] = {0,0}; +HWND hWnds[2][4]; HWND hWndGeneral = 0; -void Populate(int pad); +void Populate(int port, int slot); void SetupLogSlider(HWND hWndSlider) { SendMessage(hWndSlider, TBM_SETRANGEMIN, 0, 1); @@ -173,16 +173,17 @@ void RefreshEnabledDevicesAndDisplay(int updateDeviceList = 0, HWND hWnd = 0, in } } if (populate) { - Populate(0); - Populate(1); + for (int i=0; i<8; i++) { + Populate(i&1, i>>1); + } } } -wchar_t *GetCommandStringW(u8 command, int pad) { +wchar_t *GetCommandStringW(u8 command, int port, int slot) { static wchar_t temp[34]; if (command >= 0x20 && command <= 0x27) { - if (config.guitar[pad] && (command == 0x20 || command == 0x22)) { - HWND hWnd = GetDlgItem(hWnds[pad], 0x10F0+command); + if (config.padConfigs[port][slot].type == GuitarPad && (command == 0x20 || command == 0x22)) { + HWND hWnd = GetDlgItem(hWnds[port][slot], 0x10F0+command); int res = GetWindowTextW(hWnd, temp, 20); if ((unsigned int)res-1 <= 18) return temp; } @@ -195,7 +196,7 @@ wchar_t *GetCommandStringW(u8 command, int pad) { } /* Get text from the buttons. */ if (command >= 0x0C && command <=0x28) { - HWND hWnd = GetDlgItem(hWnds[pad], 0x10F0+command); + HWND hWnd = GetDlgItem(hWnds[port][slot], 0x10F0+command); if (!hWnd) { wchar_t *strings[] = { L"Lock Buttons", @@ -243,13 +244,13 @@ inline void GetSettingsFileName(wchar_t *out) { wcscpy(out, L"inis\\LilyPad.ini"); } -int GetBinding(int pad, int index, Device *&dev, Binding *&b, ForceFeedbackBinding *&ffb); -int BindCommand(Device *dev, unsigned int uid, unsigned int pad, int command, int sensitivity, int turbo); +int GetBinding(int port, int slot, int index, Device *&dev, Binding *&b, ForceFeedbackBinding *&ffb); +int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int slot, int command, int sensitivity, int turbo); -int CreateEffectBinding(Device *dev, wchar_t *effectName, unsigned int pad, unsigned int motor, ForceFeedbackBinding **binding); +int CreateEffectBinding(Device *dev, wchar_t *effectName, unsigned int port, unsigned int slot, unsigned int motor, ForceFeedbackBinding **binding); -void SelChanged(int pad) { - HWND hWnd = hWnds[pad]; +void SelChanged(int port, int slot) { + HWND hWnd = hWnds[port][slot]; if (!hWnd) return; HWND hWndTemp, hWndList = GetDlgItem(hWnd, IDC_LIST); int j, i = ListView_GetSelectedCount(hWndList); @@ -308,7 +309,7 @@ void SelChanged(int pad) { devName = temp[0]; key = temp[1]; command = temp[2]; - if (GetBinding(pad, index, dev, b, ffb)) { + if (GetBinding(port, slot, index, dev, b, ffb)) { if (b) { bFound ++; VirtualControl *control = &dev->virtualControls[b->controlIndex]; @@ -466,40 +467,40 @@ void UnselectAll(HWND hWnd) { } -int GetItemIndex(int pad, Device *dev, ForceFeedbackBinding *binding) { +int GetItemIndex(int port, int slot, Device *dev, ForceFeedbackBinding *binding) { int count = 0; for (int i = 0; inumDevices; i++) { Device *dev2 = dm->devices[i]; if (!dev2->enabled) continue; if (dev2 != dev) { - count += dev2->pads[pad].numBindings + dev2->pads[pad].numFFBindings; + count += dev2->pads[port][slot].numBindings + dev2->pads[port][slot].numFFBindings; continue; } - return count += dev2->pads[pad].numBindings + (binding - dev2->pads[pad].ffBindings); + return count += dev2->pads[port][slot].numBindings + (binding - dev2->pads[port][slot].ffBindings); } return -1; } -int GetItemIndex(int pad, Device *dev, Binding *binding) { +int GetItemIndex(int port, int slot, Device *dev, Binding *binding) { int count = 0; for (int i = 0; inumDevices; i++) { Device *dev2 = dm->devices[i]; if (!dev2->enabled) continue; if (dev2 != dev) { - count += dev2->pads[pad].numBindings + dev2->pads[pad].numFFBindings; + count += dev2->pads[port][slot].numBindings + dev2->pads[port][slot].numFFBindings; continue; } - return count += binding - dev->pads[pad].bindings; + return count += binding - dev->pads[port][slot].bindings; } return -1; } // Doesn't check if already displayed. -int ListBoundCommand(int pad, Device *dev, Binding *b) { - if (!hWnds[pad]) return -1; - HWND hWndList = GetDlgItem(hWnds[pad], IDC_LIST); +int ListBoundCommand(int port, int slot, Device *dev, Binding *b) { + if (!hWnds[port][slot]) return -1; + HWND hWndList = GetDlgItem(hWnds[port][slot], IDC_LIST); int index = -1; if (hWndList) { - index = GetItemIndex(pad, dev, b); + index = GetItemIndex(port, slot, dev, b); if (index >= 0) { LVITEM item; item.mask = LVIF_TEXT; @@ -512,19 +513,19 @@ int ListBoundCommand(int pad, Device *dev, Binding *b) { item.pszText = dev->GetVirtualControlName(&dev->virtualControls[b->controlIndex]); SendMessage(hWndList, LVM_SETITEM, 0, (LPARAM)&item); item.iSubItem = 2; - item.pszText = GetCommandStringW(b->command, pad); + item.pszText = GetCommandStringW(b->command, port, slot); SendMessage(hWndList, LVM_SETITEM, 0, (LPARAM)&item); } } return index; } -int ListBoundEffect(int pad, Device *dev, ForceFeedbackBinding *b) { - if (!hWnds[pad]) return -1; - HWND hWndList = GetDlgItem(hWnds[pad], IDC_LIST); +int ListBoundEffect(int port, int slot, Device *dev, ForceFeedbackBinding *b) { + if (!hWnds[port][slot]) return -1; + HWND hWndList = GetDlgItem(hWnds[port][slot], IDC_LIST); int index = -1; if (hWndList) { - index = GetItemIndex(pad, dev, b); + index = GetItemIndex(port, slot, dev, b); if (index >= 0) { LVITEM item; item.mask = LVIF_TEXT; @@ -546,9 +547,9 @@ int ListBoundEffect(int pad, Device *dev, ForceFeedbackBinding *b) { } // Only for use with control bindings. Affects all highlighted bindings. -void ChangeValue(int pad, int *newSensitivity, int *turbo) { - if (!hWnds[pad]) return; - HWND hWndList = GetDlgItem(hWnds[pad], IDC_LIST); +void ChangeValue(int port, int slot, int *newSensitivity, int *turbo) { + if (!hWnds[port][slot]) return; + HWND hWndList = GetDlgItem(hWnds[port][slot], IDC_LIST); int count = ListView_GetSelectedCount(hWndList); if (count < 1) return; int index = -1; @@ -558,7 +559,7 @@ void ChangeValue(int pad, int *newSensitivity, int *turbo) { Device *dev; Binding *b; ForceFeedbackBinding *ffb; - if (!GetBinding(pad, index, dev, b, ffb) || ffb) return; + if (!GetBinding(port, slot, index, dev, b, ffb) || ffb) return; if (newSensitivity) { // Don't change flip state when modifying multiple controls. if (count > 1 && b->sensitivity < 0) @@ -570,21 +571,21 @@ void ChangeValue(int pad, int *newSensitivity, int *turbo) { b->turbo = *turbo; } } - PropSheet_Changed(hWndProp, hWnds[pad]); - SelChanged(pad); + PropSheet_Changed(hWndProp, hWnds[port][slot]); + SelChanged(port, slot); } // Only for use with effect bindings. -void ChangeEffect(int pad, int id, int *newForce, unsigned int *newEffectType) { - if (!hWnds[pad]) return; - HWND hWndList = GetDlgItem(hWnds[pad], IDC_LIST); +void ChangeEffect(int port, int slot, int id, int *newForce, unsigned int *newEffectType) { + if (!hWnds[port][slot]) return; + HWND hWndList = GetDlgItem(hWnds[port][slot], IDC_LIST); int i = ListView_GetSelectedCount(hWndList); if (i != 1) return; int index = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); Device *dev; Binding *b; ForceFeedbackBinding *ffb; - if (!GetBinding(pad, index, dev, b, ffb) || b) return; + if (!GetBinding(port, slot, index, dev, b, ffb) || b) return; if (newForce) { unsigned int axisIndex = (id - IDC_FF_AXIS1_ENABLED)/16; if (axisIndex < (unsigned int)dev->numFFAxes) { @@ -594,18 +595,18 @@ void ChangeEffect(int pad, int id, int *newForce, unsigned int *newEffectType) { if (newEffectType && *newEffectType < (unsigned int)dev->numFFEffectTypes) { ffb->effectIndex = *newEffectType; ListView_DeleteItem(hWndList, index); - index = ListBoundEffect(pad, dev, ffb); + index = ListBoundEffect(port, slot, dev, ffb); ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); } - PropSheet_Changed(hWndProp, hWnds[pad]); - SelChanged(pad); + PropSheet_Changed(hWndProp, hWnds[port][slot]); + SelChanged(port, slot); } -void Populate(int pad) { - if (!hWnds[pad]) return; - HWND hWnd = GetDlgItem(hWnds[pad], IDC_LIST); +void Populate(int port, int slot) { + if (!hWnds[port][slot]) return; + HWND hWnd = GetDlgItem(hWnds[port][slot], IDC_LIST); ListView_DeleteAllItems(hWnd); int i, j; @@ -614,16 +615,16 @@ void Populate(int pad) { for (j=0; jnumDevices; j++) { Device *dev = dm->devices[j]; if (!dev->enabled) continue; - for (i=0; ipads[pad].numBindings; i++) { - ListBoundCommand(pad, dev, dev->pads[pad].bindings+i); + for (i=0; ipads[port][slot].numBindings; i++) { + ListBoundCommand(port, slot, dev, dev->pads[port][slot].bindings+i); } - for (i=0; ipads[pad].numFFBindings; i++) { - ListBoundEffect(pad, dev, dev->pads[pad].ffBindings+i); + for (i=0; ipads[port][slot].numFFBindings; i++) { + ListBoundEffect(port, slot, dev, dev->pads[port][slot].ffBindings+i); } } config.multipleBinding = multipleBinding; - hWnd = GetDlgItem(hWnds[pad], IDC_FORCEFEEDBACK); + hWnd = GetDlgItem(hWnds[port][slot], IDC_FORCEFEEDBACK); SendMessage(hWnd, CB_RESETCONTENT, 0, 0); int added = 0; for (i=0; inumDevices; i++) { @@ -636,10 +637,10 @@ void Populate(int pad) { } SendMessage(hWnd, CB_SETCURSEL, 0, 0); EnableWindow(hWnd, added!=0); - EnableWindow(GetDlgItem(hWnds[pad], ID_BIG_MOTOR), added!=0); - EnableWindow(GetDlgItem(hWnds[pad], ID_SMALL_MOTOR), added!=0); + EnableWindow(GetDlgItem(hWnds[port][slot], ID_BIG_MOTOR), added!=0); + EnableWindow(GetDlgItem(hWnds[port][slot], ID_SMALL_MOTOR), added!=0); - SelChanged(pad); + SelChanged(port, slot); } int WritePrivateProfileInt(wchar_t *s1, wchar_t *s2, int v, wchar_t *ini) { @@ -696,8 +697,6 @@ int SaveSettings(wchar_t *file=0) { WritePrivateProfileInt(L"General Settings", L"Disable Screen Saver", config.disableScreenSaver, file); WritePrivateProfileInt(L"General Settings", L"GH2", config.GH2, file); WritePrivateProfileInt(L"General Settings", L"Mouse Unfocus", config.mouseUnfocus, file); - WritePrivateProfileInt(L"General Settings", L"Pad1 Disable", config.disablePad[0], file); - WritePrivateProfileInt(L"General Settings", L"Pad2 Disable", config.disablePad[1], file); WritePrivateProfileInt(L"General Settings", L"Logging", config.debug, file); WritePrivateProfileInt(L"General Settings", L"Keyboard Mode", config.keyboardApi, file); WritePrivateProfileInt(L"General Settings", L"Mouse Mode", config.mouseApi, file); @@ -710,10 +709,14 @@ int SaveSettings(wchar_t *file=0) { WritePrivateProfileInt(L"General Settings", L"Vista Volume", config.vistaVolume, file); WritePrivateProfileInt(L"General Settings", L"Volume", config.volume, file); - WritePrivateProfileInt(L"Pad1", L"Guitar", config.guitar[0], file); - WritePrivateProfileInt(L"Pad2", L"Guitar", config.guitar[1], file); - WritePrivateProfileInt(L"Pad1", L"Auto Analog", config.AutoAnalog[0], file); - noError &= WritePrivateProfileInt(L"Pad2", L"Auto Analog", config.AutoAnalog[1], file); + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + wchar_t temp[50]; + wsprintf(temp, L"Pad %i %i", port, slot); + WritePrivateProfileInt(temp, L"Mode", config.padConfigs[port][slot].type, file); + noError &= WritePrivateProfileInt(temp, L"Auto Analog", config.padConfigs[port][slot].autoAnalog, file); + } + } for (int i=0; inumDevices; i++) { wchar_t id[50]; @@ -734,29 +737,29 @@ int SaveSettings(wchar_t *file=0) { } WritePrivateProfileInt(id, L"API", dev->api, file); WritePrivateProfileInt(id, L"Type", dev->type, file); + int ffBindingCount = 0; int bindingCount = 0; - for (int pad=0; pad<2; pad++) { - for (int j=0; jpads[pad].numBindings; j++) { - Binding *b = dev->pads[pad].bindings+j; - VirtualControl *c = &dev->virtualControls[b->controlIndex]; - wsprintfW(temp, L"Binding %i", bindingCount++); - wsprintfW(temp2, L"0x%08X, %i, %i, %i, %i", c->uid, pad, b->command, b->sensitivity, b->turbo); - noError &= WritePrivateProfileStringW(id, temp, temp2, file); - } - } - bindingCount = 0; - for (int pad=0; pad<2; pad++) { - for (int j=0; jpads[pad].numFFBindings; j++) { - ForceFeedbackBinding *b = dev->pads[pad].ffBindings+j; - ForceFeedbackEffectType *eff = &dev->ffEffectTypes[b->effectIndex]; - wsprintfW(temp, L"FF Binding %i", bindingCount++); - wsprintfW(temp2, L"%s %i, %i", eff->effectID, pad, b->motor); - for (int k=0; knumFFAxes; k++) { - ForceFeedbackAxis *axis = dev->ffAxes + k; - AxisEffectInfo *info = b->axes + k; - wsprintfW(wcschr(temp2,0), L", %i, %i", axis->id, info->force); + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + for (int j=0; jpads[port][slot].numBindings; j++) { + Binding *b = dev->pads[port][slot].bindings+j; + VirtualControl *c = &dev->virtualControls[b->controlIndex]; + wsprintfW(temp, L"Binding %i", bindingCount++); + wsprintfW(temp2, L"0x%08X, %i, %i, %i, %i, %i", c->uid, port, b->command, b->sensitivity, b->turbo, slot); + noError &= WritePrivateProfileStringW(id, temp, temp2, file); + } + for (int j=0; jpads[port][slot].numFFBindings; j++) { + ForceFeedbackBinding *b = dev->pads[port][slot].ffBindings+j; + ForceFeedbackEffectType *eff = &dev->ffEffectTypes[b->effectIndex]; + wsprintfW(temp, L"FF Binding %i", ffBindingCount++); + wsprintfW(temp2, L"%s %i, %i, %i", eff->effectID, port, b->motor, slot); + for (int k=0; knumFFAxes; k++) { + ForceFeedbackAxis *axis = dev->ffAxes + k; + AxisEffectInfo *info = b->axes + k; + wsprintfW(wcschr(temp2,0), L", %i, %i", axis->id, info->force); + } + noError &= WritePrivateProfileStringW(id, temp, temp2, file); } - noError &= WritePrivateProfileStringW(id, temp, temp2, file); } } } @@ -814,8 +817,6 @@ int LoadSettings(int force, wchar_t *file) { config.closeHacks = (u8)GetPrivateProfileIntW(L"General Settings", L"Close Hacks", 0, file); if (config.closeHacks&1) config.closeHacks &= ~2; - config.disablePad[0] = GetPrivateProfileBool(L"General Settings", L"Pad1 Disable", 0, file); - config.disablePad[1] = GetPrivateProfileBool(L"General Settings", L"Pad2 Disable", 0, file); config.debug = GetPrivateProfileBool(L"General Settings", L"Logging", 0, file); config.multipleBinding = GetPrivateProfileBool(L"General Settings", L"Multiple Bindings", 0, file); config.forceHide = GetPrivateProfileBool(L"General Settings", L"Force Cursor Hide", 0, file); @@ -850,11 +851,15 @@ int LoadSettings(int force, wchar_t *file) { else CreateDirectory(L"logs", 0); } - const int slot = 1; - config.guitar[0] = GetPrivateProfileBool(L"Pad1", L"Guitar", 0, file); - config.guitar[1] = GetPrivateProfileBool(L"Pad2", L"Guitar", 0, file); - config.AutoAnalog[0] = GetPrivateProfileBool(L"Pad1", L"Auto Analog", 0, file); - config.AutoAnalog[1] = GetPrivateProfileBool(L"Pad2", L"Auto Analog", 0, file); + + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + wchar_t temp[50]; + wsprintf(temp, L"Pad %i %i", port, slot); + config.padConfigs[port][slot].type = (PadType) GetPrivateProfileInt(temp, L"Mode", Dualshock2Pad, file); + config.padConfigs[port][slot].autoAnalog = GetPrivateProfileBool(temp, L"Auto Analog", 0, file); + } + } loaded = 1; @@ -895,7 +900,7 @@ int LoadSettings(int force, wchar_t *file) { } last = 1; unsigned int uid; - int pad, command, sensitivity, turbo; + int port, command, sensitivity, turbo, slot = 0; int w = 0; char string[1000]; while (temp2[w]) { @@ -903,11 +908,12 @@ int LoadSettings(int force, wchar_t *file) { w++; } string[w] = 0; - if (sscanf(string, " %i , %i , %i , %i , %i", &uid, &pad, &command, &sensitivity, &turbo) == 5 && type) { + int len = sscanf(string, " %i , %i , %i , %i , %i , %i", &uid, &port, &command, &sensitivity, &turbo, &slot); + if (len >= 5 && type) { VirtualControl *c = dev->GetVirtualControl(uid); if (!c) c = dev->AddVirtualControl(uid, -1); if (c) { - BindCommand(dev, uid, pad, command, sensitivity, turbo); + BindCommand(dev, uid, port, slot, command, sensitivity, turbo); } } } @@ -922,7 +928,7 @@ int LoadSettings(int force, wchar_t *file) { continue; } last = 1; - int pad, motor; + int port, slot, motor; int w = 0; char string[1000]; char effect[1000]; @@ -933,8 +939,8 @@ int LoadSettings(int force, wchar_t *file) { string[w] = 0; // wcstok not in ntdll. More effore than its worth to shave off // whitespace without it. - if (sscanf(string, " %s %i , %i", effect, &pad, &motor) == 3) { - char *s = strchr(strchr(string, ',')+1, ','); + if (sscanf(string, " %s %i , %i , %i", effect, &port, &motor, &slot) == 4) { + char *s = strchr(strchr(strchr(string, ',')+1, ',')+1, ','); if (!s) continue; s++; w = 0; @@ -951,7 +957,7 @@ int LoadSettings(int force, wchar_t *file) { // eff = &dev->ffEffectTypes[dev->numFFEffectTypes-1]; } ForceFeedbackBinding *b; - int res = CreateEffectBinding(dev, temp2, pad, motor, &b); + CreateEffectBinding(dev, temp2, port, slot, motor, &b); if (b) { while (1) { int axisID = atoi(s); @@ -980,10 +986,14 @@ int LoadSettings(int force, wchar_t *file) { return 0; } -inline int GetPAD(HWND hWnd) { - for (int i=0; i>1] == hWnd) { + *slot = i>>1; + return i&1; + } } + *slot = 0; return 0; } @@ -1002,95 +1012,94 @@ void Diagnostics(HWND hWnd) { RefreshEnabledDevicesAndDisplay(0, hWnd, 1); } -int GetBinding(int pad, int index, Device *&dev, Binding *&b, ForceFeedbackBinding *&ffb) { +int GetBinding(int port, int slot, int index, Device *&dev, Binding *&b, ForceFeedbackBinding *&ffb) { ffb = 0; b = 0; for (int i = 0; inumDevices; i++) { dev = dm->devices[i]; if (!dev->enabled) continue; - if (index < dev->pads[pad].numBindings) { - b = dev->pads[pad].bindings + index; + if (index < dev->pads[port][slot].numBindings) { + b = dev->pads[port][slot].bindings + index; return 1; } - index -= dev->pads[pad].numBindings; + index -= dev->pads[port][slot].numBindings; - if (index < dev->pads[pad].numFFBindings) { - ffb = dev->pads[pad].ffBindings + index; + if (index < dev->pads[port][slot].numFFBindings) { + ffb = dev->pads[port][slot].ffBindings + index; return 1; } - index -= dev->pads[pad].numFFBindings; + index -= dev->pads[port][slot].numFFBindings; } return 0; } // Only used when deleting things from ListView. Will remove from listview if needed. -void DeleteBinding(int pad, Device *dev, Binding *b) { - if (dev->enabled && hWnds[pad]) { - int count = GetItemIndex(pad, dev, b); +void DeleteBinding(int port, int slot, Device *dev, Binding *b) { + if (dev->enabled && hWnds[port][slot]) { + int count = GetItemIndex(port, slot, dev, b); if (count >= 0) { - HWND hWndList = GetDlgItem(hWnds[pad], IDC_LIST); + HWND hWndList = GetDlgItem(hWnds[port][slot], IDC_LIST); if (hWndList) { ListView_DeleteItem(hWndList, count); } } } - Binding *bindings = dev->pads[pad].bindings; + Binding *bindings = dev->pads[port][slot].bindings; int i = b - bindings; - memmove(bindings+i, bindings+i+1, sizeof(Binding) * (dev->pads[pad].numBindings - i - 1)); - dev->pads[pad].numBindings--; + memmove(bindings+i, bindings+i+1, sizeof(Binding) * (dev->pads[port][slot].numBindings - i - 1)); + dev->pads[port][slot].numBindings--; } -void DeleteBinding(int pad, Device *dev, ForceFeedbackBinding *b) { - if (dev->enabled && hWnds[pad]) { - int count = GetItemIndex(pad, dev, b); +void DeleteBinding(int port, int slot, Device *dev, ForceFeedbackBinding *b) { + if (dev->enabled && hWnds[port][slot]) { + int count = GetItemIndex(port, slot, dev, b); if (count >= 0) { - HWND hWndList = GetDlgItem(hWnds[pad], IDC_LIST); + HWND hWndList = GetDlgItem(hWnds[port][slot], IDC_LIST); if (hWndList) { ListView_DeleteItem(hWndList, count); } } } - ForceFeedbackBinding *bindings = dev->pads[pad].ffBindings; + ForceFeedbackBinding *bindings = dev->pads[port][slot].ffBindings; int i = b - bindings; - memmove(bindings+i, bindings+i+1, sizeof(Binding) * (dev->pads[pad].numFFBindings - i - 1)); - dev->pads[pad].numFFBindings--; + memmove(bindings+i, bindings+i+1, sizeof(Binding) * (dev->pads[port][slot].numFFBindings - i - 1)); + dev->pads[port][slot].numFFBindings--; } -int DeleteByIndex(int pad, int index) { +int DeleteByIndex(int port, int slot, int index) { ForceFeedbackBinding *ffb; Binding *b; Device *dev; - if (GetBinding(pad, index, dev, b, ffb)) { + if (GetBinding(port, slot, index, dev, b, ffb)) { if (b) { - DeleteBinding(pad, dev, b); + DeleteBinding(port, slot, dev, b); } else { - DeleteBinding(pad, dev, ffb); + DeleteBinding(port, slot, dev, ffb); } return 1; } return 0; } -int DeleteSelected(int pad) { - if (!hWnds[pad]) return 0; - HWND hWnd = GetDlgItem(hWnds[pad], IDC_LIST); - int i = ListView_GetSelectedCount(hWnd); +int DeleteSelected(int port, int slot) { + if (!hWnds[port][slot]) return 0; + HWND hWnd = GetDlgItem(hWnds[port][slot], IDC_LIST); int changes = 0; - while (i-- > 0) { + while (1) { int index = ListView_GetNextItem(hWnd, -1, LVNI_SELECTED); - if (index >= 0) { - changes += DeleteByIndex(pad, index); - } + if (index < 0) break; + changes += DeleteByIndex(port, slot, index); } //ShowScrollBar(hWnd, SB_VERT, 1); return changes; } -int CreateEffectBinding(Device *dev, wchar_t *effectID, unsigned int pad, unsigned int motor, ForceFeedbackBinding **binding) { +int CreateEffectBinding(Device *dev, wchar_t *effectID, unsigned int port, unsigned int slot, unsigned int motor, ForceFeedbackBinding **binding) { // Checks needed because I use this directly when loading bindings. // Note: dev->numFFAxes *can* be 0, for loading from file. - if (pad > 1 || motor > 1 || !dev->numFFEffectTypes) { + *binding = 0; + if (port > 1 || slot>3 || motor > 1 || !dev->numFFEffectTypes) { return -1; } if (!effectID) { @@ -1099,24 +1108,24 @@ int CreateEffectBinding(Device *dev, wchar_t *effectID, unsigned int pad, unsign ForceFeedbackEffectType *eff = dev->GetForcefeedbackEffect(effectID); if (!eff) return -1; int effectIndex = eff - dev->ffEffectTypes; - dev->pads[pad].ffBindings = (ForceFeedbackBinding*) realloc(dev->pads[pad].ffBindings, (dev->pads[pad].numFFBindings+1) * sizeof(ForceFeedbackBinding)); - int newIndex = dev->pads[pad].numFFBindings; - while (newIndex && dev->pads[pad].ffBindings[newIndex-1].motor >= motor) { - dev->pads[pad].ffBindings[newIndex] = dev->pads[pad].ffBindings[newIndex-1]; + dev->pads[port][slot].ffBindings = (ForceFeedbackBinding*) realloc(dev->pads[port][slot].ffBindings, (dev->pads[port][slot].numFFBindings+1) * sizeof(ForceFeedbackBinding)); + int newIndex = dev->pads[port][slot].numFFBindings; + while (newIndex && dev->pads[port][slot].ffBindings[newIndex-1].motor >= motor) { + dev->pads[port][slot].ffBindings[newIndex] = dev->pads[port][slot].ffBindings[newIndex-1]; newIndex--; } - ForceFeedbackBinding *b = dev->pads[pad].ffBindings + newIndex; + ForceFeedbackBinding *b = dev->pads[port][slot].ffBindings + newIndex; b->axes = (AxisEffectInfo*) calloc(dev->numFFAxes, sizeof(AxisEffectInfo)); b->motor = motor; b->effectIndex = effectIndex; - dev->pads[pad].numFFBindings++; + dev->pads[port][slot].numFFBindings++; if (binding) *binding = b; - return ListBoundEffect(pad, dev, b); + return ListBoundEffect(port, slot, dev, b); } -int BindCommand(Device *dev, unsigned int uid, unsigned int pad, int command, int sensitivity, int turbo) { +int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int slot, int command, int sensitivity, int turbo) { // Checks needed because I use this directly when loading bindings. - if (pad > 1) { + if (port > 1 || slot>3) { return -1; } if (!sensitivity) sensitivity = BASE_SENSITIVITY; @@ -1129,7 +1138,7 @@ int BindCommand(Device *dev, unsigned int uid, unsigned int pad, int command, in // Add before deleting. Means I won't scroll up one line when scrolled down to bottom. int controlIndex = c - dev->virtualControls; int index = 0; - PadBindings *p = dev->pads+pad; + PadBindings *p = dev->pads[port]+slot; p->bindings = (Binding*) realloc(p->bindings, (p->numBindings+1) * sizeof(Binding)); for (index = p->numBindings; index > 0; index--) { if (p->bindings[index-1].controlIndex < controlIndex) break; @@ -1142,7 +1151,7 @@ int BindCommand(Device *dev, unsigned int uid, unsigned int pad, int command, in b->turbo = turbo; b->sensitivity = sensitivity; // Where it appears in listview. - int count = ListBoundCommand(pad, dev, b); + int count = ListBoundCommand(port, slot, dev, b); int newBindingIndex = index; index = 0; @@ -1170,7 +1179,7 @@ int BindCommand(Device *dev, unsigned int uid, unsigned int pad, int command, in newBindingIndex--; count --; } - DeleteBinding(pad, dev, b); + DeleteBinding(port, slot, dev, b); } return count; @@ -1209,7 +1218,8 @@ void EndBinding(HWND hWnd) { INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM lParam) { int index = (hWnd == PropSheet_IndexToHwnd(hWndProp, 1)); - int pad = GetPAD(hWnd); + int slot; + int port = GetPort(hWnd, &slot); HWND hWndList = GetDlgItem(hWnd, IDC_LIST); switch (msg) { case WM_INITDIALOG: @@ -1227,14 +1237,16 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l c.pszText = L"PS2 Control"; ListView_InsertColumn(hWndList, 2, &c); selected = 0; - hWnds[pad = (int)((PROPSHEETPAGE *)lParam)->lParam] = hWnd; + port = (int)((PROPSHEETPAGE *)lParam)->lParam & 1; + slot = (int)((PROPSHEETPAGE *)lParam)->lParam >> 1; + hWnds[port][slot] = hWnd; SendMessage(hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); HWND hWndSlider = GetDlgItem(hWnd, IDC_SLIDER1); SetupLogSlider(hWndSlider); - if (pad == 1) + if (port || slot) EnableWindow(GetDlgItem(hWnd, ID_IGNORE), 0); - Populate(pad); + Populate(port, slot); } break; case WM_DEVICECHANGE: @@ -1263,16 +1275,16 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l int index = -1; if (command == 0x7F) { if (dev->api == IGNORE_KEYBOARD) { - index = BindCommand(dev, uid, 0, command, BASE_SENSITIVITY, 0); + index = BindCommand(dev, uid, 0, 0, command, BASE_SENSITIVITY, 0); } } else if (command < 0x30) { if (!(uid & UID_POV)) { - index = BindCommand(dev, uid, pad, command, BASE_SENSITIVITY, 0); + index = BindCommand(dev, uid, port, slot, command, BASE_SENSITIVITY, 0); } } if (index >= 0) { - PropSheet_Changed(hWndProp, hWnds[pad]); + PropSheet_Changed(hWndProp, hWnds[port][slot]); if (index >= 0) ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); } @@ -1312,7 +1324,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l if (key->wVKey == VK_DELETE || key->wVKey == VK_BACK) { - if (DeleteSelected(pad)) + if (DeleteSelected(port, slot)) PropSheet_Changed(hWndProp, hWnds[0]); } } @@ -1325,7 +1337,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l } else if (n->hdr.code == NM_CUSTOMDRAW && NeedUpdate) { NeedUpdate = 0; - SelChanged(pad); + SelChanged(port, slot); } EndBinding(hWnd); } @@ -1339,10 +1351,10 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l int id = GetDlgCtrlID((HWND)lParam); int val = GetLogSliderVal(hWnd, id); if (id == IDC_SLIDER1) { - ChangeValue(pad, &val, 0); + ChangeValue(port, slot, &val, 0); } else { - ChangeEffect(pad, id, &val, 0); + ChangeEffect(port, slot, id, &val, 0); } } break; @@ -1355,13 +1367,13 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l ForceFeedbackBinding *ffb; Binding *b; Device *dev; - if (GetBinding(pad, index, dev, b, ffb)) { + if (GetBinding(port, slot, index, dev, b, ffb)) { int uid = dev->virtualControls[b->controlIndex].uid; const static unsigned int axisUIDs[3] = {UID_AXIS_NEG, UID_AXIS_POS, UID_AXIS}; uid = (uid&0x00FFFFFF) | axisUIDs[cbsel]; Binding backup = *b; - DeleteSelected(pad); - int index = BindCommand(dev, uid, pad, backup.command, backup.sensitivity, backup.turbo); + DeleteSelected(port, slot); + int index = BindCommand(dev, uid, port, slot, backup.command, backup.sensitivity, backup.turbo); ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); } } @@ -1370,18 +1382,18 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l else if (HIWORD(wParam)==CBN_SELCHANGE && LOWORD(wParam) == IDC_FF_EFFECT) { unsigned int typeIndex = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0); if (typeIndex >= 0) - ChangeEffect(pad, 0, 0, &typeIndex); + ChangeEffect(port, slot, 0, 0, &typeIndex); } else if (HIWORD(wParam)==BN_CLICKED) { EndBinding(hWnd); int cmd = LOWORD(wParam); if (cmd == ID_DELETE) { - if (DeleteSelected(pad)) + if (DeleteSelected(port, slot)) PropSheet_Changed(hWndProp, hWnd); } else if (cmd == ID_CLEAR) { int changed=0; - while (DeleteByIndex(pad, 0)) changed++; + while (DeleteByIndex(port, slot, 0)) changed++; if (changed) PropSheet_Changed(hWndProp, hWnd); } @@ -1391,7 +1403,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l unsigned int index = (unsigned int)SendMessage(GetDlgItem(hWnd, IDC_FORCEFEEDBACK), CB_GETITEMDATA, i, 0); if (index < (unsigned int) dm->numDevices) { ForceFeedbackBinding *b; - int count = CreateEffectBinding(dm->devices[index], 0, pad, cmd-ID_BIG_MOTOR, &b); + int count = CreateEffectBinding(dm->devices[index], 0, port, slot, cmd-ID_BIG_MOTOR, &b); if (b) { for (int j=0; j<2 && j devices[index]->numFFAxes; j++) { b->axes[j].force = BASE_SENSITIVITY; @@ -1414,7 +1426,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l ForceFeedbackBinding *ffb = 0; int selIndex = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); if (selIndex >= 0) { - if (GetBinding(pad, selIndex, dev, b, ffb)) { + if (GetBinding(port, slot, selIndex, dev, b, ffb)) { selected = 0xFF; InitInfo info = {0, hWndProp, hWnd, GetDlgItem(hWnd, cmd)}; EatWndProc(info.hWndButton, DoNothingWndProc); @@ -1470,11 +1482,11 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l // Don't allow setting it back to indeterminate. SendMessage(GetDlgItem(hWnd, IDC_TURBO), BM_SETSTYLE, BS_AUTOCHECKBOX, 0); int turbo = (IsDlgButtonChecked(hWnd, IDC_TURBO) == BST_CHECKED); - ChangeValue(pad, 0, &turbo); + ChangeValue(port, slot, 0, &turbo); } else if (cmd == IDC_FLIP1 || cmd == IDC_TURBO) { int val = GetLogSliderVal(hWnd, IDC_SLIDER1); - ChangeValue(pad, &val, 0); + ChangeValue(port, slot, &val, 0); } else if (cmd >= IDC_FF_AXIS1_ENABLED && cmd < IDC_FF_AXIS8_ENABLED + 16) { int index = (cmd - IDC_FF_AXIS1_ENABLED)/16; @@ -1482,7 +1494,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l if (IsDlgButtonChecked(hWnd, 16*index + IDC_FF_AXIS1_ENABLED) != BST_CHECKED) { val = 0; } - ChangeEffect(pad, cmd, &val, 0); + ChangeEffect(port, slot, cmd, &val, 0); } } break; @@ -1492,29 +1504,37 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l return 0; } -int CreatePadPages(HPROPSHEETPAGE *pages) { +void UpdatePadPages() { + HPROPSHEETPAGE pages[10]; int count = 0; - for (int pad=0; pad<2; pad++) { - if (config.disablePad[pad]) continue; + memset(hWnds, 0, sizeof(hWnds)); + int slot = 0; + for (int port=0; port<2; port++) { + if (config.padConfigs[port][slot].type == DisabledPad) continue; PROPSHEETPAGE psp; ZeroMemory(&psp, sizeof(psp)); psp.dwSize = sizeof(psp); psp.dwFlags = PSP_USETITLE | PSP_PREMATURE; psp.hInstance = hInst; psp.pfnDlgProc = (DLGPROC) DialogProc; - psp.lParam = pad; - if (pad == 0) + psp.lParam = port | (slot<<1); + if (port == 0) psp.pszTitle = L"Pad 1"; else psp.pszTitle = L"Pad 2"; - if (!config.guitar[pad]) + if (config.padConfigs[port][slot].type != GuitarPad) psp.pszTemplate = MAKEINTRESOURCE(IDD_CONFIG); else psp.pszTemplate = MAKEINTRESOURCE(IDD_CONFIG_GUITAR); pages[count] = CreatePropertySheetPage(&psp); if (pages[count]) count++; } - return count; + while (SendMessage(hWndProp, PSM_INDEXTOPAGE, 1, 0)) { + PropSheet_RemovePage(hWndProp, 1, 0); + } + for (int i=0; inumDevices; i++) { + Device *dev = dm->devices[i]; + if (!dev->enabled) continue; + count += dev->pads[port][slot].numBindings + dev->pads[port][slot].numFFBindings; + } + wsprintf(text, L"%i", count); + item.pszText = text; + ListView_SetItem(hWndList, &item); + index++; + } + int sel = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); + + EnableWindow(hWndCombo, sel>=0); + EnableWindow(hWndAnalog, sel>=0); + if (sel < 0) { + SendMessage(hWndCombo, CB_SETCURSEL, -1, 0); + CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_UNCHECKED); + } + else { + SendMessage(hWndCombo, CB_SETCURSEL, config.padConfigs[sel][0].type, 0); + CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_CHECKED*config.padConfigs[sel][0].autoAnalog); + } +} INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM lParam) { int i; + HWND hWndList = GetDlgItem(hWnd, IDC_PAD_LIST); switch (msg) { case WM_INITDIALOG: { - HPROPSHEETPAGE pages[10]; - int count = CreatePadPages(pages); - while (SendMessage(hWndProp, PSM_INDEXTOPAGE, 1, 0)) { - PropSheet_RemovePage(hWndProp, 1, 0); - } - for (int i=0; i>1)); CheckDlgButton(hWnd, IDC_CLOSE_HACK3, BST_CHECKED * ((config.closeHacks&4)>>2)); - CheckDlgButton(hWnd, IDC_DISABLE_PAD1, BST_CHECKED * config.disablePad[0]); - CheckDlgButton(hWnd, IDC_DISABLE_PAD2, BST_CHECKED * config.disablePad[1]); CheckDlgButton(hWnd, IDC_MOUSE_UNFOCUS, BST_CHECKED * config.mouseUnfocus); CheckDlgButton(hWnd, IDC_GS_THREAD_INPUT, BST_CHECKED * config.GSThreadUpdates); @@ -1571,10 +1656,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L CheckDlgButton(hWnd, IDC_VISTA_VOLUME, BST_CHECKED * config.vistaVolume); if (config.osVersion < 6) EnableWindow(GetDlgItem(hWnd, IDC_VISTA_VOLUME), 0); - CheckDlgButton(hWnd, IDC_GUITAR1, BST_CHECKED * config.guitar[0]); - CheckDlgButton(hWnd, IDC_GUITAR2, BST_CHECKED * config.guitar[1]); - CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_CHECKED * config.AutoAnalog[0]); - CheckDlgButton(hWnd, IDC_ANALOG_START2, BST_CHECKED * config.AutoAnalog[1]); CheckDlgButton(hWnd, IDC_DEBUG_FILE, BST_CHECKED * config.debug); CheckDlgButton(hWnd, IDC_MULTIPLE_BINDING, BST_CHECKED * config.multipleBinding); @@ -1598,7 +1679,18 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L } break; case WM_COMMAND: - if (HIWORD(wParam)==BN_CLICKED && (LOWORD(wParam) == ID_LOAD || LOWORD(wParam) == ID_SAVE)) { + if (LOWORD(wParam) == IDC_PAD_TYPE) { + if (HIWORD(wParam) == CBN_SELCHANGE) { + int pad = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); + HWND hWndCombo = GetDlgItem(hWnd, IDC_PAD_TYPE); + int sel = SendMessage(hWndCombo, CB_GETCURSEL, 0, 0); + if (pad >= 0 && sel >= 0 && sel != config.padConfigs[sel][0].type) { + config.padConfigs[sel][0].type = (PadType)sel; + PropSheet_Changed(hWndProp, hWnd); + } + } + } + else if (HIWORD(wParam)==BN_CLICKED && (LOWORD(wParam) == ID_LOAD || LOWORD(wParam) == ID_SAVE)) { OPENFILENAMEW ofn; memset (&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); @@ -1616,6 +1708,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L if (GetOpenFileNameW(&ofn)) { LoadSettings(1, ofn.lpstrFile); GeneralDialogProc(hWnd, WM_INITDIALOG, 0, 0); + PropSheet_Changed(hWndProp, hWnd); } } else { @@ -1637,6 +1730,13 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L else if (HIWORD(wParam)==BN_CLICKED && LOWORD(wParam) == ID_REFRESH) { RefreshEnabledDevicesAndDisplay(1, hWnd, 1); } + else if (HIWORD(wParam)==BN_CLICKED && LOWORD(wParam) == IDC_ANALOG_START1) { + int pad = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); + if (pad >= 0) { + config.padConfigs[pad][0].autoAnalog = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START1) == BST_CHECKED); + PropSheet_Changed(hWndProp, hWnd); + } + } else { int t = IDC_CLOSE_HACK1; int test = LOWORD(wParam); @@ -1668,26 +1768,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L } - unsigned int needUpdate = 0; - unsigned int disablePad1New = (IsDlgButtonChecked(hWnd, IDC_DISABLE_PAD1) == BST_CHECKED); - unsigned int disablePad2New = (IsDlgButtonChecked(hWnd, IDC_DISABLE_PAD2) == BST_CHECKED); - unsigned int guitarNew1 = (IsDlgButtonChecked(hWnd, IDC_GUITAR1) == BST_CHECKED); - unsigned int guitarNew2 = (IsDlgButtonChecked(hWnd, IDC_GUITAR2) == BST_CHECKED); - if (config.disablePad[0] != disablePad1New || - config.disablePad[1] != disablePad2New || - config.guitar[0] != guitarNew1 || - config.guitar[1] != guitarNew2) { - - config.disablePad[0] = disablePad1New; - config.disablePad[1] = disablePad2New; - config.guitar[0] = guitarNew1; - config.guitar[1] = guitarNew2; - - needUpdate = 1; - } - - config.AutoAnalog[0] = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START1) == BST_CHECKED); - config.AutoAnalog[1] = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START2) == BST_CHECKED); config.debug = (IsDlgButtonChecked(hWnd, IDC_DEBUG_FILE) == BST_CHECKED); config.multipleBinding = (IsDlgButtonChecked(hWnd, IDC_MULTIPLE_BINDING) == BST_CHECKED); @@ -1719,9 +1799,10 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L RefreshEnabledDevicesAndDisplay(0, hWnd, 1); PropSheet_Changed(hWndProp, hWnd); + /* if (needUpdate) { - GeneralDialogProc(hWnd, WM_INITDIALOG, 0, 0); - } + UpdatePadPages(); + }//*/ } break; case WM_NOTIFY: @@ -1746,9 +1827,12 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L return 1; } } - else { - if (n->hdr.idFrom == IDC_LIST && n->hdr.code == NM_DBLCLK) { - Diagnostics(hWnd); + else if (n->hdr.idFrom == IDC_LIST && n->hdr.code == NM_DBLCLK) { + Diagnostics(hWnd); + } + else if (n->hdr.idFrom == IDC_PAD_LIST) { + if (n->hdr.code == NM_CLICK) { + UpdatePadList(hWnd); } } } @@ -1787,7 +1871,7 @@ void CALLBACK PADconfigure() { psh.pszCaption = title; PropertySheet(&psh); LoadSettings(1); - hWnds[0] = hWnds[1] = 0; + memset(hWnds, 0, sizeof(hWnds)); } void UnloadConfigs() { diff --git a/plugins/LilyPad/Config.h b/plugins/LilyPad/Config.h index 87b648f401..07ef8cbfbc 100644 --- a/plugins/LilyPad/Config.h +++ b/plugins/LilyPad/Config.h @@ -6,9 +6,20 @@ extern u8 ps2e; +enum PadType { + DisabledPad, + Dualshock2Pad, + GuitarPad +}; + +struct PadConfig { + PadType type; + u8 autoAnalog; +}; + struct GeneralConfig { public: - u8 disablePad[2]; + PadConfig padConfigs[2][4]; u8 mouseUnfocus; u8 disableScreenSaver; @@ -32,9 +43,6 @@ public: u8 GSThreadUpdates; u8 escapeFullscreenHack; - u8 guitar[2]; - u8 AutoAnalog[2]; - u8 saveStateTitle; u8 vistaVolume; diff --git a/plugins/LilyPad/DirectInput.cpp b/plugins/LilyPad/DirectInput.cpp index e000e9540c..f66235e064 100644 --- a/plugins/LilyPad/DirectInput.cpp +++ b/plugins/LilyPad/DirectInput.cpp @@ -98,9 +98,17 @@ public: } void SetEffect(ForceFeedbackBinding *binding, unsigned char force) { - unsigned int index = binding - pads[0].ffBindings; - if (index >= (unsigned int)pads[0].numFFBindings) { - index = pads[0].numFFBindings + (binding - pads[1].ffBindings); + int index = 0; + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + unsigned int diff = binding - pads[port][slot].ffBindings; + if (diff < (unsigned int)pads[port][slot].numFFBindings) { + index += diff; + port = 2; + break; + } + index += pads[port][slot].numFFBindings; + } } IDirectInputEffect *die = diEffects[index].die; if (die) { @@ -139,7 +147,7 @@ public: } int Activate(void *d) { - int i, j; + int i; IDirectInput8 *di8 = GetDirectInput(); Deactivate(); if (!di8) return 0; @@ -211,74 +219,78 @@ public: return 0; } AllocState(); - diEffects = (DI8Effect*) calloc(pads[0].numFFBindings + pads[1].numFFBindings, sizeof(DI8Effect)); - for (i=0; i= pads[0].numFFBindings) { - b = &pads[1].ffBindings[i-pads[0].numFFBindings]; - } - else - b = &pads[0].ffBindings[i]; - ForceFeedbackEffectType *eff = ffEffectTypes + b->effectIndex; - GUID guid; - if (!StringToGUID(&guid, eff->effectID)) continue; + int count = GetFFBindingCount(); + diEffects = (DI8Effect*) calloc(count, sizeof(DI8Effect)); + i = 0; + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + int subIndex = i; + for (int j=0; jeffectIndex; + GUID guid; + if (!StringToGUID(&guid, eff->effectID)) continue; - DIEFFECT dieffect; - memset(&dieffect, 0, sizeof(dieffect)); - dieffect.dwSize = sizeof(dieffect); - dieffect.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTIDS; - dieffect.dwDuration = 2000000; - dieffect.dwGain = 10000; - dieffect.dwTriggerButton = DIEB_NOTRIGGER; - union { - DIPERIODIC pediodic; - DIRAMPFORCE ramp; - DICONSTANTFORCE constant; - } stuff = {0,0,0,0}; + DIEFFECT dieffect; + memset(&dieffect, 0, sizeof(dieffect)); + dieffect.dwSize = sizeof(dieffect); + dieffect.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTIDS; + dieffect.dwDuration = 2000000; + dieffect.dwGain = 10000; + dieffect.dwTriggerButton = DIEB_NOTRIGGER; + union { + DIPERIODIC pediodic; + DIRAMPFORCE ramp; + DICONSTANTFORCE constant; + } stuff = {0,0,0,0}; - if (eff->type == EFFECT_CONSTANT) { - dieffect.cbTypeSpecificParams = sizeof(DICONSTANTFORCE); - } - else if (eff->type == EFFECT_PERIODIC) { - dieffect.cbTypeSpecificParams = sizeof(DIPERIODIC); - } - else if (eff->type == EFFECT_RAMP) { - dieffect.cbTypeSpecificParams = sizeof(DIRAMPFORCE); - } - dieffect.lpvTypeSpecificParams = &stuff; - - int maxForce = 0; - int numAxes = 0; - int *axes = (int*) malloc(sizeof(int) * 3 * numFFAxes); - DWORD *axisIDs = (DWORD*)(axes + numFFAxes); - LONG *dirList = (LONG*)(axisIDs + numFFAxes); - dieffect.rgdwAxes = axisIDs; - dieffect.rglDirection = dirList; - for (j=0; jaxes[j].force) { - int force = abs(b->axes[j].force); - if (force > maxForce) { - maxForce = force; + if (eff->type == EFFECT_CONSTANT) { + dieffect.cbTypeSpecificParams = sizeof(DICONSTANTFORCE); } - axes[numAxes] = j; - axisIDs[numAxes] = ffAxes[j].id; - dirList[numAxes] = b->axes[j].force; - numAxes++; + else if (eff->type == EFFECT_PERIODIC) { + dieffect.cbTypeSpecificParams = sizeof(DIPERIODIC); + } + else if (eff->type == EFFECT_RAMP) { + dieffect.cbTypeSpecificParams = sizeof(DIRAMPFORCE); + } + dieffect.lpvTypeSpecificParams = &stuff; + + int maxForce = 0; + int numAxes = 0; + int *axes = (int*) malloc(sizeof(int) * 3 * numFFAxes); + DWORD *axisIDs = (DWORD*)(axes + numFFAxes); + LONG *dirList = (LONG*)(axisIDs + numFFAxes); + dieffect.rgdwAxes = axisIDs; + dieffect.rglDirection = dirList; + for (int k=0; kaxes[k].force) { + int force = abs(b->axes[k].force); + if (force > maxForce) { + maxForce = force; + } + axes[numAxes] = k; + axisIDs[numAxes] = ffAxes[k].id; + dirList[numAxes] = b->axes[k].force; + numAxes++; + } + } + if (!numAxes) { + free(axes); + continue; + } + dieffect.cAxes = numAxes; + diEffects[i].scale = maxForce; + if (!SUCCEEDED(did->CreateEffect(guid, &dieffect, &diEffects[i].die, 0))) { + diEffects[i].die = 0; + diEffects[i].scale = 0; + } + + free(axes); + axes = 0; + i++; } } - if (!numAxes) { - free(axes); - continue; - } - dieffect.cAxes = numAxes; - diEffects[i].scale = maxForce; - if (!SUCCEEDED(did->CreateEffect(guid, &dieffect, &diEffects[i].die, 0))) { - diEffects[i].die = 0; - diEffects[i].scale = 0; - } - - free(axes); - axes = 0; } active = 1; return 1; @@ -306,10 +318,21 @@ public: return 1; } + int GetFFBindingCount() { + int count = 0; + for (int port = 0; port<2; port++) { + for (int slot = 0; slot<4; slot++) { + count += pads[port][slot].numFFBindings; + } + } + return count; + } + void Deactivate() { FreeState(); if (diEffects) { - for (int i=0; iStop(); diEffects[i].die->Release(); diff --git a/plugins/LilyPad/InputManager.cpp b/plugins/LilyPad/InputManager.cpp index 809dab4649..2be1429dca 100644 --- a/plugins/LilyPad/InputManager.cpp +++ b/plugins/LilyPad/InputManager.cpp @@ -67,12 +67,14 @@ Device::~Device() { // Generally called by deactivate, but just in case... FreeState(); int i; - for (int pad=0; pad<2; pad++) { - free(pads[pad].bindings); - for (i=0; iaxes = (AxisEffectInfo*) realloc(b->axes, sizeof(AxisEffectInfo) * (numFFAxes)); - memset(b->axes + (numFFAxes-1), 0, sizeof(AxisEffectInfo)); + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + for (int i=0; iaxes = (AxisEffectInfo*) realloc(b->axes, sizeof(AxisEffectInfo) * (numFFAxes)); + memset(b->axes + (numFFAxes-1), 0, sizeof(AxisEffectInfo)); + } } } } @@ -254,9 +258,9 @@ PhysicalControl *Device::AddPhysicalControl(ControlType type, unsigned short id, return control; } -void Device::SetEffects(unsigned char pad, unsigned char motor, unsigned char force) { - for (int i=0; imotor == motor) { SetEffect(binding, force); } @@ -451,7 +455,7 @@ ForceFeedbackAxis *Device::GetForceFeedbackAxis(int id) { void InputDeviceManager::CopyBindings(int numOldDevices, Device **oldDevices) { int *oldMatches = (int*) malloc(sizeof(int) * numOldDevices); int *matches = (int*) malloc(sizeof(int) * numDevices); - int i, j, pad; + int i, j, port, slot; Device *old, *dev; for (i=0; ipads[pad].numBindings + old->pads[pad].numFFBindings) { - // Means that there are bindings. - oldMatches[i] = -1; + for (port=0; port<2; port++) { + for (slot=0; slot<4; slot++) { + if (old->pads[port][slot].numBindings + old->pads[port][slot].numFFBindings) { + // Means that there are bindings. + oldMatches[i] = -1; + } } } } @@ -514,37 +520,39 @@ void InputDeviceManager::CopyBindings(int numOldDevices, Device **oldDevices) { } else { dev = devices[oldMatches[i]]; - for (pad=0; pad<2; pad++) { - if (old->pads[pad].numBindings) { - dev->pads[pad].bindings = (Binding*) malloc(old->pads[pad].numBindings * sizeof(Binding)); - for (int j=0; jpads[pad].numBindings; j++) { - Binding *bo = old->pads[pad].bindings + j; - Binding *bn = dev->pads[pad].bindings + dev->pads[pad].numBindings; - VirtualControl *cn = dev->GetVirtualControl(old->virtualControls[bo->controlIndex].uid); - if (cn) { - *bn = *bo; - bn->controlIndex = cn - dev->virtualControls; - dev->pads[pad].numBindings++; + for (port=0; port<2; port++) { + for (slot=0; slot<4; slot++) { + if (old->pads[port][slot].numBindings) { + dev->pads[port][slot].bindings = (Binding*) malloc(old->pads[port][slot].numBindings * sizeof(Binding)); + for (int j=0; jpads[port][slot].numBindings; j++) { + Binding *bo = old->pads[port][slot].bindings + j; + Binding *bn = dev->pads[port][slot].bindings + dev->pads[port][slot].numBindings; + VirtualControl *cn = dev->GetVirtualControl(old->virtualControls[bo->controlIndex].uid); + if (cn) { + *bn = *bo; + bn->controlIndex = cn - dev->virtualControls; + dev->pads[port][slot].numBindings++; + } } } - } - if (old->pads[pad].numFFBindings) { - dev->pads[pad].ffBindings = (ForceFeedbackBinding*) malloc(old->pads[pad].numFFBindings * sizeof(ForceFeedbackBinding)); - for (int j=0; jpads[pad].numFFBindings; j++) { - ForceFeedbackBinding *bo = old->pads[pad].ffBindings + j; - ForceFeedbackBinding *bn = dev->pads[pad].ffBindings + dev->pads[pad].numFFBindings; - ForceFeedbackEffectType *en = dev->GetForcefeedbackEffect(old->ffEffectTypes[bo->effectIndex].effectID); - if (en) { - *bn = *bo; - bn->effectIndex = en - dev->ffEffectTypes; - bn->axes = (AxisEffectInfo*)calloc(dev->numFFAxes, sizeof(AxisEffectInfo)); - for (int k=0; knumFFAxes; k++) { - ForceFeedbackAxis *newAxis = dev->GetForceFeedbackAxis(old->ffAxes[k].id); - if (newAxis) { - bn->axes[newAxis - dev->ffAxes] = bo->axes[k]; + if (old->pads[port][slot].numFFBindings) { + dev->pads[port][slot].ffBindings = (ForceFeedbackBinding*) malloc(old->pads[port][slot].numFFBindings * sizeof(ForceFeedbackBinding)); + for (int j=0; jpads[port][slot].numFFBindings; j++) { + ForceFeedbackBinding *bo = old->pads[port][slot].ffBindings + j; + ForceFeedbackBinding *bn = dev->pads[port][slot].ffBindings + dev->pads[port][slot].numFFBindings; + ForceFeedbackEffectType *en = dev->GetForcefeedbackEffect(old->ffEffectTypes[bo->effectIndex].effectID); + if (en) { + *bn = *bo; + bn->effectIndex = en - dev->ffEffectTypes; + bn->axes = (AxisEffectInfo*)calloc(dev->numFFAxes, sizeof(AxisEffectInfo)); + for (int k=0; knumFFAxes; k++) { + ForceFeedbackAxis *newAxis = dev->GetForceFeedbackAxis(old->ffAxes[k].id); + if (newAxis) { + bn->axes[newAxis - dev->ffAxes] = bo->axes[k]; + } } + dev->pads[port][slot].numFFBindings++; } - dev->pads[pad].numFFBindings++; } } } @@ -555,11 +563,11 @@ void InputDeviceManager::CopyBindings(int numOldDevices, Device **oldDevices) { free(matches); } -void InputDeviceManager::SetEffect(unsigned char pad, unsigned char motor, unsigned char force) { +void InputDeviceManager::SetEffect(unsigned char port, unsigned int slot, unsigned char motor, unsigned char force) { for (int i=0; ienabled && dev->numFFEffectTypes) { - dev->SetEffects(pad, motor, force); + dev->SetEffects(port, slot, motor, force); } } } diff --git a/plugins/LilyPad/InputManager.h b/plugins/LilyPad/InputManager.h index 26120ee6a9..97e7c95227 100644 --- a/plugins/LilyPad/InputManager.h +++ b/plugins/LilyPad/InputManager.h @@ -194,7 +194,7 @@ public: }; }; - PadBindings pads[2]; + PadBindings pads[2][4]; // Virtual controls. All basically act like pressure sensitivity buttons, with // values between 0 and 2^16. 2^16 is fully down, 0 is up. Larger values @@ -267,7 +267,7 @@ public: // Note: Only used externally for binding, so if override the other one, can assume // all other forces are currently 0. inline virtual void SetEffect(ForceFeedbackBinding *binding, unsigned char force) {} - inline virtual void SetEffects(unsigned char pad, unsigned char motor, unsigned char force); + inline virtual void SetEffects(unsigned char port, unsigned int slot, unsigned char motor, unsigned char force); // Called after reading. Basically calls FlipState(). // Some device types (Those that don't incrementally update) @@ -303,7 +303,7 @@ public: // Called after reading state, after Update(). void PostRead(); - void SetEffect(unsigned char pad, unsigned char motor, unsigned char force); + void SetEffect(unsigned char port, unsigned int slot, unsigned char motor, unsigned char force); // Update does this as needed. // void GetInput(void *v); diff --git a/plugins/LilyPad/KeyboardHook.cpp b/plugins/LilyPad/KeyboardHook.cpp index a8f25bd133..0c7a146b98 100644 --- a/plugins/LilyPad/KeyboardHook.cpp +++ b/plugins/LilyPad/KeyboardHook.cpp @@ -87,8 +87,8 @@ LRESULT CALLBACK IgnoreKeyboardHook(int code, WPARAM wParam, LPARAM lParam) { if (wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN) { KBDLLHOOKSTRUCT* key = (KBDLLHOOKSTRUCT*) lParam; if (key->vkCode < 256) { - for (int i=0; ipads[0].numBindings; i++) { - if (ikhd->pads[0].bindings[i].controlIndex == key->vkCode) { + for (int i=0; ipads[0][0].numBindings; i++) { + if (ikhd->pads[0][0].bindings[i].controlIndex == key->vkCode) { return 1; } } diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 482356c678..70f628b172 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -106,28 +106,38 @@ struct ButtonSum { Stick sticks[3]; }; -class Pad { + +struct PadFreezeData { + // Digital / Analog / Full Analog (aka DS2 Native) + u8 mode; + u8 modeLock; + + // In config mode + u8 config; + + u8 vibrate[8]; + u8 umask[2]; +}; + +class Pad : public PadFreezeData { public: ButtonSum sum, lockedSum; int lockedState; - u8 vibrate[8]; - - u8 umask[2]; u8 vibrateI[2]; u8 vibrateVal[2]; - // Digital / Analog / Full Analog (aka DS2 Native) - u8 mode; - u8 modeLock; - // In config mode - u8 config; // Used to keep track of which pads I'm running. // Note that initialized pads *can* be disabled. // I keep track of state of non-disabled non-initialized // pads, but should never be asked for their state. u8 initialized; -} pads[2]; +} pads[2][4]; + +// Active slots for each port. +int slots[2]; +// Which ports we're running on. +int portInitialized[2]; // Force value to be from 0 to 255. u8 Cap (int i) { @@ -149,9 +159,15 @@ void UpdateEnabledDevices(int updateList = 0) { // Enable all devices I might want. Can ignore the rest. RefreshEnabledDevices(updateList); // Figure out which pads I'm getting input for. - int padsEnabled[2] = { - pads[0].initialized && !config.disablePad[0], - pads[1].initialized && !config.disablePad[1] + int padsEnabled[2][4] = { + {pads[0][0].initialized && config.padConfigs[0][0].type != DisabledPad, + pads[0][1].initialized && config.padConfigs[0][1].type != DisabledPad, + pads[0][2].initialized && config.padConfigs[0][2].type != DisabledPad, + pads[0][3].initialized && config.padConfigs[0][3].type != DisabledPad}, + {pads[1][0].initialized && config.padConfigs[1][0].type != DisabledPad, + pads[1][1].initialized && config.padConfigs[1][1].type != DisabledPad, + pads[1][2].initialized && config.padConfigs[1][2].type != DisabledPad, + pads[1][3].initialized && config.padConfigs[1][3].type != DisabledPad} }; for (int i=0; inumDevices; i++) { Device *dev = dm->devices[i]; @@ -164,7 +180,7 @@ void UpdateEnabledDevices(int updateList = 0) { // Disable ignore keyboard if don't have focus or there are no keys to ignore. if (dev->api == IGNORE_KEYBOARD) { - if ((!config.vistaVolume && (config.keyboardApi == NO_API || !dev->pads[0].numBindings)) || !activeWindow) { + if ((!config.vistaVolume && (config.keyboardApi == NO_API || !dev->pads[0][0].numBindings)) || !activeWindow) { dm->DisableDevice(i); } continue; @@ -181,9 +197,11 @@ void UpdateEnabledDevices(int updateList = 0) { else if (!activeWindow && !config.background) dm->DisableDevice(i); else { int numActiveBindings = 0; - for (int pad=0; pad<2; pad++) { - if (padsEnabled[pad]) { - numActiveBindings += dev->pads[pad].numBindings + dev->pads[pad].numFFBindings; + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + if (padsEnabled[port][slot]) { + numActiveBindings += dev->pads[port][slot].numBindings + dev->pads[port][slot].numFFBindings; + } } } if (!numActiveBindings) @@ -297,7 +315,6 @@ void CapSum(ButtonSum *sum) { // key press info requests. int summed[3] = {0, 0, 0}; -int lockStateChanged[2] = {0,0}; #define LOCK_DIRECTION 2 #define LOCK_BUTTONS 4 #define LOCK_BOTH 1 @@ -310,9 +327,13 @@ void Update(int pad) { return; } int i; - ButtonSum s[2]; - s[0] = pads[0].lockedSum; - s[1] = pads[1].lockedSum; + ButtonSum s[2][4]; + u8 lockStateChanged[2][4]; + memset(lockStateChanged, 0, sizeof(lockStateChanged)); + + for (i=0; i<8; i++) { + s[i&1][i>>1] = pads[i&1][i>>1].lockedSum; + } InitInfo info = { 0, hWnd, hWnd, 0 }; @@ -328,36 +349,38 @@ void Update(int pad) { // Skip both disabled devices and inactive enabled devices. // Shouldn't be any of the latter, in general, but just in case... if (!dev->virtualControlState) continue; - for (int pad=0; pad<2; pad++) { - if (config.disablePad[pad]) continue; - for (int j=0; jpads[pad].numBindings; j++) { - Binding *b = dev->pads[pad].bindings+j; - int cmd = b->command; - int state = dev->virtualControlState[b->controlIndex]; - if (!(turbo & b->turbo)) { - if (cmd > 0x0F && cmd != 0x28) { - ProcessButtonBinding(b, s+pad, state); - } - else if ((state>>15) && !(dev->oldVirtualControlState[b->controlIndex]>>15)) { - if (cmd == 0x0F) { - miceEnabled = !miceEnabled; - UpdateEnabledDevices(); + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + if (config.padConfigs[port][slot].type == DisabledPad || !pads[port][slot].initialized) continue; + for (int j=0; jpads[port][slot].numBindings; j++) { + Binding *b = dev->pads[port][slot].bindings+j; + int cmd = b->command; + int state = dev->virtualControlState[b->controlIndex]; + if (!(turbo & b->turbo)) { + if (cmd > 0x0F && cmd != 0x28) { + ProcessButtonBinding(b, &s[port][slot], state); } - else if (cmd == 0x0C) { - lockStateChanged[pad] |= LOCK_BUTTONS; - } - else if (cmd == 0x0E) { - lockStateChanged[pad] |= LOCK_DIRECTION; - } - else if (cmd == 0x0D) { - lockStateChanged[pad] |= LOCK_BOTH; - } - else if (cmd == 0x28) { - if (!pads[pad].modeLock) { - if (pads[pad].mode != MODE_DIGITAL) - pads[pad].mode = MODE_DIGITAL; - else - pads[pad].mode = MODE_ANALOG; + else if ((state>>15) && !(dev->oldVirtualControlState[b->controlIndex]>>15)) { + if (cmd == 0x0F) { + miceEnabled = !miceEnabled; + UpdateEnabledDevices(); + } + else if (cmd == 0x0C) { + lockStateChanged[port][slot] |= LOCK_BUTTONS; + } + else if (cmd == 0x0E) { + lockStateChanged[port][slot] |= LOCK_DIRECTION; + } + else if (cmd == 0x0D) { + lockStateChanged[port][slot] |= LOCK_BOTH; + } + else if (cmd == 0x28) { + if (!pads[port][slot].modeLock) { + if (pads[port][slot].mode != MODE_DIGITAL) + pads[port][slot].mode = MODE_DIGITAL; + else + pads[port][slot].mode = MODE_ANALOG; + } } } } @@ -371,101 +394,99 @@ void Update(int pad) { LeaveCriticalSection(&readInputCriticalSection); } - for (int currentPad = 0; currentPad<2; currentPad++) { - if (config.guitar[currentPad]) { - if (!config.GH2) { - s[currentPad].sticks[1].vert = -s[currentPad].sticks[1].vert; - } - // GH2 hack. - else if (config.GH2) { - const unsigned int oldIdList[5] = {ID_R2, ID_CIRCLE, ID_TRIANGLE, ID_CROSS, ID_SQUARE}; - const unsigned int idList[5] = {ID_L2, ID_L1, ID_R1, ID_R2, ID_CROSS}; - int values[5]; - int i; - for (i=0; i<5; i++) { - int id = oldIdList[i] - 0x1104; - values[i] = s[currentPad].buttons[id]; - s[currentPad].buttons[id] = 0; + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + if (config.padConfigs[port][slot].type == DisabledPad || !pads[port][slot].initialized) continue; + if (config.padConfigs[port][slot].type == GuitarPad) { + if (!config.GH2) { + s[port][slot].sticks[1].vert = -s[port][slot].sticks[1].vert; } - s[currentPad].buttons[ID_TRIANGLE-0x1104] = values[1]; - for (i=0; i<5; i++) { - int id = idList[i] - 0x1104; - s[currentPad].buttons[id] = values[i]; - } - if (abs(s[currentPad].sticks[0].vert) <= 48) { - for (int i=0; i<5; i++) { - unsigned int id = idList[i] - 0x1104; - if (pads[currentPad].sum.buttons[id] < s[currentPad].buttons[id]) { - s[currentPad].buttons[id] = pads[currentPad].sum.buttons[id]; + // GH2 hack. + else if (config.GH2) { + const unsigned int oldIdList[5] = {ID_R2, ID_CIRCLE, ID_TRIANGLE, ID_CROSS, ID_SQUARE}; + const unsigned int idList[5] = {ID_L2, ID_L1, ID_R1, ID_R2, ID_CROSS}; + int values[5]; + int i; + for (i=0; i<5; i++) { + int id = oldIdList[i] - 0x1104; + values[i] = s[port][slot].buttons[id]; + s[port][slot].buttons[id] = 0; + } + s[port][slot].buttons[ID_TRIANGLE-0x1104] = values[1]; + for (i=0; i<5; i++) { + int id = idList[i] - 0x1104; + s[port][slot].buttons[id] = values[i]; + } + if (abs(s[port][slot].sticks[0].vert) <= 48) { + for (int i=0; i<5; i++) { + unsigned int id = idList[i] - 0x1104; + if (pads[port][slot].sum.buttons[id] < s[port][slot].buttons[id]) { + s[port][slot].buttons[id] = pads[port][slot].sum.buttons[id]; + } } } - } - else if (abs(pads[currentPad].sum.sticks[0].vert) <= 48) { - for (int i=0; i<5; i++) { - unsigned int id = idList[i] - 0x1104; - if (pads[currentPad].sum.buttons[id]) { - s[currentPad].buttons[id] = 0; + else if (abs(pads[port][slot].sum.sticks[0].vert) <= 48) { + for (int i=0; i<5; i++) { + unsigned int id = idList[i] - 0x1104; + if (pads[port][slot].sum.buttons[id]) { + s[port][slot].buttons[id] = 0; + } } } } } - } - if (pads[currentPad].mode == 0x41) { - s[currentPad].sticks[0].horiz += - s[currentPad].sticks[1].horiz + - s[currentPad].sticks[2].horiz; - s[currentPad].sticks[0].vert += - s[currentPad].sticks[1].vert + - s[currentPad].sticks[2].vert; - } + if (pads[port][slot].mode == 0x41) { + s[port][slot].sticks[0].horiz += + s[port][slot].sticks[1].horiz + + s[port][slot].sticks[2].horiz; + s[port][slot].sticks[0].vert += + s[port][slot].sticks[1].vert + + s[port][slot].sticks[2].vert; + } - CapSum(&s[currentPad]); - if (lockStateChanged[currentPad]) { - if (lockStateChanged[currentPad] & LOCK_BOTH) { - if (pads[currentPad].lockedState != (LOCK_DIRECTION | LOCK_BUTTONS)) { - // Enable the one that's not enabled. - lockStateChanged[currentPad] ^= pads[currentPad].lockedState^(LOCK_DIRECTION | LOCK_BUTTONS); + CapSum(&s[port][slot]); + if (lockStateChanged[port][slot]) { + if (lockStateChanged[port][slot] & LOCK_BOTH) { + if (pads[port][slot].lockedState != (LOCK_DIRECTION | LOCK_BUTTONS)) { + // Enable the one that's not enabled. + lockStateChanged[port][slot] ^= pads[port][slot].lockedState^(LOCK_DIRECTION | LOCK_BUTTONS); + } + else { + // Disable both + lockStateChanged[port][slot] ^= LOCK_DIRECTION | LOCK_BUTTONS; + } } - else { - // Disable both - lockStateChanged[currentPad] ^= LOCK_DIRECTION | LOCK_BUTTONS; + if (lockStateChanged[port][slot] & LOCK_DIRECTION) { + if (pads[port][slot].lockedState & LOCK_DIRECTION) { + memset(pads[port][slot].lockedSum.sticks, 0, sizeof(pads[port][slot].lockedSum.sticks)); + } + else { + memcpy(pads[port][slot].lockedSum.sticks, s[port][slot].sticks, sizeof(pads[port][slot].lockedSum.sticks)); + } + pads[port][slot].lockedState ^= LOCK_DIRECTION; + } + if (lockStateChanged[port][slot] & LOCK_BUTTONS) { + if (pads[port][slot].lockedState & LOCK_BUTTONS) { + memset(pads[port][slot].lockedSum.buttons, 0, sizeof(pads[port][slot].lockedSum.buttons)); + } + else { + memcpy(pads[port][slot].lockedSum.buttons, s[port][slot].buttons, sizeof(pads[port][slot].lockedSum.buttons)); + } + pads[port][slot].lockedState ^= LOCK_BUTTONS; + } + for (i=0; i>1].sum = s[i&1][i>>1]; } summed[0] = 1; summed[1] = 1; @@ -477,10 +498,10 @@ void CALLBACK PADupdate(int pad) { if (config.GSThreadUpdates) Update(pad); } -inline void SetVibrate(Pad *pad, int motor, u8 val) { - if (val | pad->vibrateVal[motor]) { - dm->SetEffect(pad - pads, motor, val); - pad->vibrateVal[motor] = val; +inline void SetVibrate(int port, int slot, int motor, u8 val) { + if (val || pads[port][slot].vibrateVal[motor]) { + dm->SetEffect(port,slot, motor, val); + pads[port][slot].vibrateVal[motor] = val; } } @@ -527,34 +548,48 @@ char* CALLBACK PS2EgetLibName(void) { //} void CALLBACK PADshutdown() { - pads[0].initialized = 0; - pads[1].initialized = 0; + for (int i=0; i<8; i++) + pads[i&1][i>>1].initialized = 0; UnloadConfigs(); } inline void StopVibrate() { - for (int i=0; i<4; i++) { - SetVibrate(&pads[i/2], i&1, 0); + for (int i=0; i<8; i++) { + SetVibrate(i&1, i>>1, 0, 0); + SetVibrate(i&1, i>>1, 1, 0); } } -inline void ResetVibrate(Pad *pad) { - SetVibrate(pad, 0, 0); - SetVibrate(pad, 1, 0); - ((int*)(pad->vibrate))[0] = 0xFFFFFF5A; - ((int*)(pad->vibrate))[1] = 0xFFFFFFFF; +inline void ResetVibrate(int port, int slot) { + SetVibrate(port, slot, 0, 0); + SetVibrate(port, slot, 1, 0); + ((int*)(pads[port][slot].vibrate))[0] = 0xFFFFFF5A; + ((int*)(pads[port][slot].vibrate))[1] = 0xFFFFFFFF; } -void ResetPad(int pad) { - memset(&pads[pad], 0, sizeof(pads[0])); - pads[pad].mode = MODE_DIGITAL; - pads[pad].umask[0] = pads[pad].umask[1] = 0xFF; - ResetVibrate(pads+pad); - if (config.AutoAnalog[pad]) { - pads[pad].mode = MODE_ANALOG; +void ResetPad(int port, int slot) { + memset(&pads[port][slot], 0, sizeof(pads[0])); + pads[port][slot].mode = MODE_DIGITAL; + pads[port][slot].umask[0] = pads[port][slot].umask[1] = 0xFF; + ResetVibrate(port, slot); + if (config.padConfigs[port][slot].autoAnalog) { + pads[port][slot].mode = MODE_ANALOG; } } + +struct QueryInfo { + u8 port; + u8 slot; + u8 lastByte; + u8 currentCommand; + u8 numBytes; + u8 queryDone; + u8 response[42]; +} query = {0,0,0,0, 0,0xFF, 0xF3}; + +int saveStateIndex = 0; + s32 CALLBACK PADinit(u32 flags) { // Note: Won't load settings if already loaded. if (LoadSettings() < 0) { @@ -572,10 +607,13 @@ s32 CALLBACK PADinit(u32 flags) { #endif pad --; - ResetPad(pad); + ResetPad(pad, 0); - pads[pad].initialized = 1; + pads[pad][0].initialized = 1; + memset(slots, 0, sizeof(slots)); + query.lastByte = 1; + query.numBytes = 0; return 0; } @@ -618,17 +656,6 @@ static const u8 queryMode[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static const u8 setNativeMode[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A}; -struct QueryInfo { - u8 pad; - u8 lastByte; - u8 currentCommand; - u8 numBytes; - u8 queryDone; - u8 response[42]; -} query = {0,0,0,0, 0,0xFF, 0xF3}; - -int saveStateIndex = 0; - // Implements a couple of the hacks, also responsible for monitoring device addition/removal and focus // changes. ExtraWndProcResult HackWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *output) { @@ -759,15 +786,14 @@ s32 CALLBACK PADopen(void *pDsp) { } restoreFullScreen = 0; } - memset(&pads[0].sum, 0, sizeof(pads[0].sum)); - memset(&pads[0].lockedSum, 0, sizeof(pads[0].lockedSum)); - pads[0].lockedState = 0; - memset(&pads[1].sum, 0, sizeof(pads[0].sum)); - memset(&pads[1].lockedSum, 0, sizeof(pads[0].lockedSum)); - pads[1].lockedState = 0; + for (int port=0; port<2; port++) { + for (int slot=0; slot<4; slot++) { + memset(&pads[port][slot].sum, 0, sizeof(pads[port][slot].sum)); + memset(&pads[port][slot].lockedSum, 0, sizeof(pads[port][slot].lockedSum)); + pads[port][slot].lockedState = 0; + } + } - query.lastByte = 1; - query.numBytes = 0; // I'd really rather use this line, but GetActiveWindow() does not have complete specs. // It *seems* to return null when no window from this thread has focus, but the // Microsoft specs seem to imply it returns the window from this thread that would have focus, @@ -794,7 +820,8 @@ u8 CALLBACK PADstartPoll(int pad) { pad--; if ((unsigned int)pad <= 1) { query.queryDone = 0; - query.pad = pad; + query.port = pad; + query.slot = slots[query.port]; query.numBytes = 2; query.lastByte = 0; DEBUG_IN(pad); @@ -835,7 +862,7 @@ u8 CALLBACK PADpoll(u8 value) { return query.response[++query.lastByte]; }//*/ int i; - Pad *pad = &pads[query.pad]; + Pad *pad = &pads[query.port][query.slot]; if (query.lastByte == 0) { query.lastByte++; query.currentCommand = value; @@ -853,7 +880,7 @@ u8 CALLBACK PADpoll(u8 value) { query.response[2] = 0x5A; { if (!config.GSThreadUpdates) { - Update(pad != pads); + Update(query.port); } ButtonSum *sum = &pad->sum; @@ -864,7 +891,7 @@ u8 CALLBACK PADpoll(u8 value) { for (i = 0; i<8; i++) { b2 -= (sum->buttons[i+4]>=128) << i; } - if (config.guitar[query.pad] && !config.GH2) { + if (config.padConfigs[query.port][query.slot].type == GuitarPad && !config.GH2) { sum->sticks[0].horiz = -255; // Not sure about this. Forces wammy to be from 0 to 0x7F. // if (sum->sticks[2].vert > 0) sum->sticks[2].vert = 0; @@ -936,11 +963,11 @@ u8 CALLBACK PADpoll(u8 value) { // SET_MODE_AND_LOCK case 0x44: SET_RESULT(setMode); - ResetVibrate(pad); + ResetVibrate(query.port, query.slot); break; // QUERY_MODEL_AND_MODE case 0x45: - if (!config.guitar[query.pad] || config.GH2) SET_FINAL_RESULT(queryModelDS2) + if (config.padConfigs[query.port][query.slot].type != GuitarPad || config.GH2) SET_FINAL_RESULT(queryModelDS2) else SET_FINAL_RESULT(queryModelDS1); query.response[5] = pad->mode != MODE_DIGITAL; break; @@ -960,7 +987,7 @@ u8 CALLBACK PADpoll(u8 value) { case 0x4D: memcpy(query.response+2, pad->vibrate, 7); query.numBytes = 9; - ResetVibrate(pad); + ResetVibrate(query.port, query.slot); break; // SET_DS2_NATIVE_MODE case 0x4F: @@ -980,10 +1007,10 @@ u8 CALLBACK PADpoll(u8 value) { // READ_DATA_AND_VIBRATE case 0x42: if (query.lastByte == pad->vibrateI[0]) { - SetVibrate(pad, 1, 255*(0!=value)); + SetVibrate(query.port, query.slot, 1, 255*(0!=value)); } else if (query.lastByte == pad->vibrateI[1]) { - SetVibrate(pad, 0, value); + SetVibrate(query.port, query.slot, 0, value); } break; // CONFIG_MODE @@ -1005,7 +1032,7 @@ u8 CALLBACK PADpoll(u8 value) { } else { pad->modeLock = 0; - if (pad->mode == MODE_DIGITAL && config.AutoAnalog[query.pad]) { + if (pad->mode == MODE_DIGITAL && config.padConfigs[query.port][query.slot].autoAnalog) { pad->mode = MODE_ANALOG; } } @@ -1188,14 +1215,6 @@ keyEvent* CALLBACK PADkeyEvent() { #define PAD_SAVE_STATE_VERSION 0 -struct PadFreezeData { - u8 mode; - u8 locked; - u8 config; - u8 vibrate[8]; - u8 umask[2]; -}; - struct PadPluginFreezeData { char format[8]; // Currently all different versions are incompatible. @@ -1204,6 +1223,8 @@ struct PadPluginFreezeData { // So when loading, know which plugin's settings I'm loading. // Not a big deal. Use a static variable when saving to figure it out. u8 port; + // active slot for port + u8 slot; // Currently only use padData[0]. Save room for all 4 slots for simplicity. PadFreezeData padData[4]; }; @@ -1215,37 +1236,40 @@ s32 CALLBACK PADfreeze(int mode, freezeData *data) { else if (mode == FREEZE_LOAD) { if (data->size < sizeof(PadPluginFreezeData)) return 0; PadPluginFreezeData &pdata = *(PadPluginFreezeData*)(data->data); - if (pdata.version != PAD_SAVE_STATE_VERSION || strcmp(pdata.format, "PadMode")) return 0; + if (pdata.version != PAD_SAVE_STATE_VERSION || strcmp(pdata.format, "PadMode")) { + return 0; + } StopVibrate(); int port = pdata.port; - for (int i=0; i<1; i++) { - u8 mode = pads[port].mode = pdata.padData[i].mode; + for (int slot=0; slot<4; slot++) { + u8 mode = pads[port][slot].mode = pdata.padData[slot].mode; if (mode != MODE_DIGITAL && mode != MODE_ANALOG && mode != MODE_DS2_NATIVE) { - ResetPad(i); + ResetPad(port, slot); continue; } - pads[port].config = pdata.padData[i].config; - pads[port].modeLock = pdata.padData[i].locked; - memcpy(pads[port].umask, pdata.padData[i].umask, sizeof(pads[port].umask)); + pads[port][slot].config = pdata.padData[slot].config; + pads[port][slot].modeLock = pdata.padData[slot].modeLock; + memcpy(pads[port][slot].umask, pdata.padData[slot].umask, sizeof(pads[port][slot].umask)); + slots[port] = slot; // Means I only have to have one chunk of code to parse vibrate info. // Other plugins don't store it exactly, but think it's technically correct // to do so, though I could be wrong. - PADstartPoll(i+1); + PADstartPoll(port+1); PADpoll(0x4D); - PADpoll(0x00); for (int j=0; j<7; j++) { - PADpoll(pdata.padData[i].vibrate[j]); + PADpoll(pdata.padData[slot].vibrate[j]); } } + slots[port] = pdata.slot; } else if (mode == FREEZE_SAVE) { if (data->size != sizeof(PadPluginFreezeData)) return 0; PadPluginFreezeData &pdata = *(PadPluginFreezeData*)(data->data); static int nextPort = 0; - if (!pads[nextPort].initialized) nextPort ^= 1; + if (!portInitialized[nextPort]) nextPort ^= 1; int port = nextPort; - if (!pads[nextPort^1].initialized) nextPort = 0; + if (!portInitialized[nextPort^1]) nextPort = 0; else nextPort ^= 1; @@ -1253,25 +1277,9 @@ s32 CALLBACK PADfreeze(int mode, freezeData *data) { strcpy(pdata.format, "PadMode"); pdata.version = PAD_SAVE_STATE_VERSION; pdata.port = port; - for (int i=0; i<1; i++) { - pdata.padData[i].mode = pads[port].mode; - pdata.padData[i].locked = pads[port].modeLock; - memcpy(pdata.padData[i].umask, pads[port].umask, sizeof(pads[port].umask)); - memcpy(pdata.padData[i].vibrate, pads[port].vibrate, sizeof(pads[port].vibrate)); - - - // Means I only have to have one chunk of code to parse vibrate info. - // Other plugins don't store it exactly, but think it's technically correct - // to do so, though I could be wrong. - pads[port].config = 1; - PADstartPoll(port+1); - PADpoll(0x4D); - PADpoll(0x00); - for (int j=0; j<7; j++) { - PADpoll(pdata.padData[port].vibrate[j]); - } - - pdata.padData[port].config = pads[port].config; + pdata.slot = slots[port]; + for (int slot=0; slot<4; slot++) { + pdata.padData[slot] = pads[port][slot]; } } else return -1; diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index c6cf057224..f903c77b46 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -89,7 +89,7 @@ BEGIN PUSHBUTTON "Left",ID_RSTICK_LEFT,324,144,35,15 PUSHBUTTON "Right",ID_RSTICK_RIGHT,364,144,35,15 PUSHBUTTON "Down",ID_RSTICK_DOWN,342,164,35,15 - GROUPBOX "",ID_FF,195,6,222,250 + GROUPBOX "",ID_FF,195,6,222,248 COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17 CONTROL "Axis 1",IDC_FF_AXIS1_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,60,91,10 @@ -153,7 +153,7 @@ BEGIN PUSHBUTTON "Whammy Bar Down",ID_LSTICK_DOWN,219,164,69,15 PUSHBUTTON "Strum Bar Up",ID_DPAD_UP,336,146,58,15 PUSHBUTTON "Strum Bar Down",ID_DPAD_DOWN,336,164,58,15 - GROUPBOX "",ID_FF,195,6,222,250 + GROUPBOX "",ID_FF,195,6,222,248 COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17 CONTROL "Axis 1",IDC_FF_AXIS1_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,60,91,10 @@ -220,20 +220,14 @@ BEGIN CONTROL "Disable",IDC_M_DISABLE,"Button",BS_AUTORADIOBUTTON,224,63,39,10 CONTROL "Start without mouse focus",IDC_MOUSE_UNFOCUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,75,97,10 CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,87,71,10 - GROUPBOX "Advanced",IDC_STATIC,216,103,192,27 + GROUPBOX "Advanced",IDC_STATIC,216,105,192,25 CONTROL "Allow binding multiple PS2 controls to one PC control",IDC_MULTIPLE_BINDING, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,115,182,10 - GROUPBOX "Pad Options",IDC_STATIC,7,140,410,67 - GROUPBOX "Pad 1",IDC_STATIC,16,150,192,49 - CONTROL "Disable pad",IDC_DISABLE_PAD1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,162,53,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,116,182,10 + GROUPBOX "Pads",IDC_STATIC,7,140,410,67 + CONTROL "",IDC_PAD_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | WS_TABSTOP,17,152,183,48,WS_EX_CLIENTEDGE + COMBOBOX IDC_PAD_TYPE,211,153,140,41,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP CONTROL "Use analog mode whenever possible",IDC_ANALOG_START1, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,174,132,10 - CONTROL "Guitar",IDC_GUITAR1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,186,35,10 - GROUPBOX "Pad 2",IDC_STATIC,216,150,192,49 - CONTROL "Disable pad",IDC_DISABLE_PAD2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,162,53,10 - CONTROL "Use analog mode whenever possible",IDC_ANALOG_START2, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,174,132,10 - CONTROL "Guitar",IDC_GUITAR2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,186,35,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,211,172,132,10 GROUPBOX "Device Diagnostics",IDC_STATIC,7,211,201,99 CONTROL "",IDC_LIST,"SysListView32",LVS_LIST | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,15,224,185,61,WS_EX_CLIENTEDGE PUSHBUTTON "Test Device",ID_TEST,86,289,57,15 diff --git a/plugins/LilyPad/XInput.cpp b/plugins/LilyPad/XInput.cpp index f20141312d..12b1d5656f 100644 --- a/plugins/LilyPad/XInput.cpp +++ b/plugins/LilyPad/XInput.cpp @@ -27,7 +27,7 @@ __forceinline int ShortToAxis(int v) { class XInputDevice : public Device { // Cached last vibration values by pad and motor. // Need this, as only one value is changed at a time. - int ps2Vibration[2][2]; + int ps2Vibration[2][4][2]; // Minor optimization - cache last set vibration values // When there's no change, no need to do anything. XINPUT_VIBRATION xInputVibration; @@ -112,15 +112,17 @@ public: return 1; } - void SetEffects(unsigned char pad, unsigned char motor, unsigned char force) { - ps2Vibration[pad][motor] = force; + void SetEffects(unsigned char port, unsigned int slot, unsigned char motor, unsigned char force) { + ps2Vibration[port][slot][motor] = force; int newVibration[2] = {0,0}; for (int p=0; p<2; p++) { - for (int i=0; iaxes[0].force * (__int64)ps2Vibration[p][ffb->motor]) / 255); - newVibration[1] += (int)((ffb->axes[1].force * (__int64)ps2Vibration[p][ffb->motor]) / 255); + for (int s=0; s<4; s++) { + for (int i=0; iaxes[0].force * (__int64)ps2Vibration[p][s][ffb->motor]) / 255); + newVibration[1] += (int)((ffb->axes[1].force * (__int64)ps2Vibration[p][s][ffb->motor]) / 255); + } } } newVibration[0] = abs(newVibration[0]); @@ -140,11 +142,11 @@ public: } void SetEffect(ForceFeedbackBinding *binding, unsigned char force) { - PadBindings pBackup = pads[0]; - pads[0].ffBindings = binding; - pads[0].numFFBindings = 1; - SetEffects(0, binding->motor, 255); - pads[0] = pBackup; + PadBindings pBackup = pads[0][0]; + pads[0][0].ffBindings = binding; + pads[0][0].numFFBindings = 1; + SetEffects(0, 0, binding->motor, 255); + pads[0][0] = pBackup; } void Deactivate() { diff --git a/plugins/LilyPad/resource.h b/plugins/LilyPad/resource.h index 7bb44e981c..1e51bec3b3 100644 --- a/plugins/LilyPad/resource.h +++ b/plugins/LilyPad/resource.h @@ -17,7 +17,6 @@ #define IDC_KB_WM 1102 #define IDC_KB_RAW 1103 #define IDC_DISABLE_PAD1 1104 -#define IDC_DISABLE_PAD2 1105 #define IDC_M_DISABLE 1106 #define IDC_M_DI 1107 #define IDC_M_WM 1108 @@ -28,27 +27,22 @@ #define IDC_CLOSE_HACK3 1113 #define IDC_DEBUG_FILE 1114 #define IDC_GUITAR1 1115 -#define IDC_GUITAR2 1116 #define IDC_ANALOG_START1 1117 -#define IDC_ANALOG_START2 1118 #define IDC_DISABLE_SCREENSAVER 1119 #define IDC_MOUSE_UNFOCUS 1120 -#define IDC_MOUSE_UNFOCUS2 1121 #define IDC_AXIS_BUTTONS 1121 #define IDC_BACKGROUND 1122 #define IDC_MULTIPLE_BINDING 1123 #define IDC_DISABLE_SCREENSAVER2 1124 #define IDC_FORCE_HIDE 1124 -#define IDC_FORCE_HIDE2 1125 #define IDC_GH2_HACK 1125 #define IDC_FORCEFEEDBACK_HACK1 1126 -#define IDC_GH2_HACK2 1126 #define IDC_VISTA_VOLUME 1126 -#define IDC_DISABLE_SCREENSAVER4 1127 -#define IDC_FORCEFEEDBACK_HACK2 1127 -#define IDC_FORCE_HIDE3 1127 #define IDC_GS_THREAD_INPUT 1128 #define IDC_SAVE_STATE_TITLE 1129 +#define IDC_PAD_LIST 1133 +#define IDC_COMBO1 1134 +#define IDC_PAD_TYPE 1134 #define IDC_SLIDER1 0x1000 #define IDC_FLIP1 0x1001 #define IDC_AXIS_DIRECTION 0x1002 @@ -148,7 +142,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 112 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1130 +#define _APS_NEXT_CONTROL_VALUE 1135 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif From 0deb44c70dbf57a19ccf3c6d404a4bc9a0a0ddde Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Mon, 16 Mar 2009 01:43:13 +0000 Subject: [PATCH 54/77] seems i had misunderstood ACC's pipeline rules. turns out there only needs to be 1 instance of it, so i had to fix all opcodes that use ACC. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@795 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU_Alloc.h | 34 +++--- pcsx2/x86/microVU_Alloc.inl | 214 ++++++++++++++---------------------- pcsx2/x86/microVU_Lower.inl | 20 ++-- pcsx2/x86/microVU_Misc.h | 17 +-- pcsx2/x86/microVU_Upper.inl | 152 +++++++------------------ 5 files changed, 158 insertions(+), 279 deletions(-) diff --git a/pcsx2/x86/microVU_Alloc.h b/pcsx2/x86/microVU_Alloc.h index 51ce87b21d..60611ebfbe 100644 --- a/pcsx2/x86/microVU_Alloc.h +++ b/pcsx2/x86/microVU_Alloc.h @@ -37,22 +37,28 @@ struct microAllocInfo { u8 q; u8 p; u8 r; - u16 info[pSize];// bit 0 = NOP? - // bit 1 = Used with bit 2 to make a 2-bit key for ACC write instance - // bit 2 = (00 = instance #0, 01 = instance #1, 10 = instance #2, 11 = instance #3) - // bit 3 = Used with bit 4 to make a 2-bit key for ACC read instance - // bit 4 = (00 = instance #0, 01 = instance #1, 10 = instance #2, 11 = instance #3) - // bit 5 = Write to Q1 or Q2? - // bit 6 = Read Q1 or Q2? - // bit 7 = Read/Write to P1 or P2? - // bit 8 = Update Mac Flags? - // bit 9 = Update Status Flags? + u32 info[pSize];// bit 00 = Lower Instruction is NOP + // bit 01 = Used with bit 2 to make a 2-bit key for ACC write instance + // bit 02 = (00 = instance #0, 01 = instance #1, 10 = instance #2, 11 = instance #3) + // bit 03 = Used with bit 4 to make a 2-bit key for ACC read instance + // bit 04 = (00 = instance #0, 01 = instance #1, 10 = instance #2, 11 = instance #3) + // bit 05 = Write to Q1 or Q2? + // bit 06 = Read Q1 or Q2? + // bit 07 = Read/Write to P1 or P2? + // bit 08 = Update Mac Flags? + // bit 09 = Update Status Flags? // bit 10 = Used with bit 11 to make a 2-bit key for mac flag instance - // bit 11 = (00 = instance #0, 01 = instance #1, 10 = instance #2, 11 = instance #3) + // bit 11 // bit 12 = Used with bit 13 to make a 2-bit key for status flag instance - // bit 13 = (00 = instance #0, 01 = instance #1, 10 = instance #2, 11 = instance #3) - // bit 14 = Read VI(Fs) from backup memory? - // bit 15 = Read VI(Ft) from backup memory? + // bit 13 + // bit 14 = Used with bit 15 to make a 2-bit key for clip flag instance + // bit 15 + // bit 16 = Used with bit 17 to make a 2-bit key for mac flag instance + // bit 17 + // bit 18 = Used with bit 19 to make a 2-bit key for status flag instance + // bit 19 + // bit 20 = Read VI(Fs) from backup memory? + // bit 21 = Read VI(Ft) from backup memory? u32 curPC; }; diff --git a/pcsx2/x86/microVU_Alloc.inl b/pcsx2/x86/microVU_Alloc.inl index 6da7d4472e..ccd8a9221c 100644 --- a/pcsx2/x86/microVU_Alloc.inl +++ b/pcsx2/x86/microVU_Alloc.inl @@ -146,18 +146,18 @@ microVUt(void) mVUallocFMAC3b(int& Fd) { if (_W) { mVUloadReg(reg, (uptr)&mVU->regs->VF[0].UL[0], _xyzw_ACC); } \ else { SSE_XORPS_XMM_to_XMM(reg, reg); } \ } - +/* #define getACC(reg) { \ reg = xmmACC0 + writeACC; \ if (_X_Y_Z_W != 15) { SSE_MOVAPS_XMM_to_XMM(reg, (xmmACC0 + prevACC)); } \ } - +*/ microVUt(void) mVUallocFMAC4a(int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; - Fs = xmmFs; + ACC = xmmACC; + Fs = (_X_Y_Z_W == 15) ? xmmACC : xmmFs; Ft = xmmFt; - getACC(ACC); - if (_XYZW_SS && _X) { + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); if (_Ft_ == _Fs_) { Ft = Fs; } else { getReg6(Ft, _Ft_); } @@ -184,10 +184,10 @@ microVUt(void) mVUallocFMAC4b(int& ACC, int& Fs) { microVUt(void) mVUallocFMAC5a(int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; - Fs = xmmFs; + ACC = xmmACC; + Fs = (_X_Y_Z_W == 15) ? xmmACC : xmmFs; Ft = xmmFt; - getACC(ACC); - if (_XYZW_SS && _X) { + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); if ((_Ft_ == _Fs_) && _bc_x) { Ft = Fs; } else if (!_Ft_) { getZero3SS(Ft); } @@ -236,11 +236,11 @@ microVUt(void) mVUallocFMAC6b(int& Fd) { microVUt(void) mVUallocFMAC7a(int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; - Fs = xmmFs; + ACC = xmmACC; + Fs = (_X_Y_Z_W == 15) ? xmmACC : xmmFs; Ft = xmmFt; - getACC(ACC); getIreg(Ft); - if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); } else if (!_Fs_) { getZero4(Fs); } else { getReg4(Fs, _Fs_); } } @@ -253,13 +253,13 @@ microVUt(void) mVUallocFMAC7b(int& ACC, int& Fs) { // FMAC8 - MADD FMAC Opcode Storing Result to Fd //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC8a(int& Fd, int&ACC, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC8a(int& Fd, int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; Fs = xmmFs; Ft = xmmFt; Fd = xmmFs; - ACC = xmmACC0 + readACC; - if (_XYZW_SS && _X) { + ACC = xmmACC; + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); if (_Ft_ == _Fs_) { Ft = Fs; } else { getReg6(Ft, _Ft_); } @@ -285,14 +285,14 @@ microVUt(void) mVUallocFMAC8b(int& Fd) { // FMAC9 - MSUB FMAC Opcode Storing Result to Fd //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC9a(int& Fd, int&ACC, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC9a(int& Fd, int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; Fs = xmmFs; Ft = xmmFt; Fd = xmmT1; ACC = xmmT1; - SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC0 + readACC); - if (_XYZW_SS && _X) { + SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC); + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); if (_Ft_ == _Fs_) { Ft = Fs; } else { getReg6(Ft, _Ft_); } @@ -323,8 +323,8 @@ microVUt(void) mVUallocFMAC10a(int& Fd, int& ACC, int& Fs, int& Ft) { Fs = xmmFs; Ft = xmmFt; Fd = xmmFs; - ACC = xmmACC0 + readACC; - if (_XYZW_SS && _X) { + ACC = xmmACC; + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); if ( (_Ft_ == _Fs_) && _bc_x) { Ft = Fs; } else if (!_Ft_) { getZero3SS(Ft); } @@ -353,8 +353,8 @@ microVUt(void) mVUallocFMAC11a(int& Fd, int& ACC, int& Fs, int& Ft) { Ft = xmmFt; Fd = xmmT1; ACC = xmmT1; - SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC0 + readACC); - if (_XYZW_SS && _X) { + SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC); + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); if ( (_Ft_ == _Fs_) && _bc_x) { Ft = Fs; } else if (!_Ft_) { getZero3SS(Ft); } @@ -377,14 +377,14 @@ microVUt(void) mVUallocFMAC11b(int& Fd) { // FMAC12 - MADD FMAC Opcode Storing Result to Fd (I Reg) //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC12a(int& Fd, int&ACC, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC12a(int& Fd, int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; Fs = xmmFs; Ft = xmmFt; Fd = xmmFs; - ACC = xmmACC0 + readACC; + ACC = xmmACC; getIreg(Ft); - if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); } else if (!_Fs_) { getZero4(Fs); } else { getReg4(Fs, _Fs_); } } @@ -397,15 +397,15 @@ microVUt(void) mVUallocFMAC12b(int& Fd) { // FMAC13 - MSUB FMAC Opcode Storing Result to Fd (I Reg) //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC13a(int& Fd, int&ACC, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC13a(int& Fd, int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; Fs = xmmFs; Ft = xmmFt; Fd = xmmT1; ACC = xmmT1; - SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC0 + readACC); + SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC); getIreg(Ft); - if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); } else if (!_Fs_) { getZero4(Fs); } else { getReg4(Fs, _Fs_); } } @@ -415,16 +415,18 @@ microVUt(void) mVUallocFMAC13b(int& Fd) { } //------------------------------------------------------------------ -// FMAC14 - MADDA FMAC Opcode +// FMAC14 - MADDA/MSUBA FMAC Opcodes //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC14a(int& ACCw, int&ACCr, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC14a(int& ACCw, int& ACCr, int& Fs, int& Ft) { microVU* mVU = mVUx; - getACC(ACCw); - Fs = (_X_Y_Z_W == 15) ? ACCw : xmmFs; + Fs = xmmFs; Ft = xmmFt; - ACCr = xmmACC0 + readACC; - if (_XYZW_SS && _X) { + ACCw = xmmACC; + ACCr = ((_X_Y_Z_W == 15) || (_X_Y_Z_W == 8)) ? xmmACC : xmmT1; + SSE_MOVAPS_XMM_to_XMM(ACCr, xmmACC); + + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); if (_Ft_ == _Fs_) { Ft = Fs; } else { getReg6(Ft, _Ft_); } @@ -439,39 +441,25 @@ microVUt(void) mVUallocFMAC14a(int& ACCw, int&ACCr, int& Fs, int& Ft) { } } -microVUt(void) mVUallocFMAC14b(int& ACCw, int& Fs) { - microVU* mVU = mVUx; - if (CHECK_VU_OVERFLOW) mVUclamp1(Fs, xmmT1, _xyzw_ACC); - mVUmergeRegs(ACCw, Fs, _X_Y_Z_W); -} - -//------------------------------------------------------------------ -// FMAC15 - MSUBA FMAC Opcode -//------------------------------------------------------------------ - -microVUt(void) mVUallocFMAC15a(int& ACCw, int&ACCr, int& Fs, int& Ft) { - mVUallocFMAC14a(ACCw, ACCr, Fs, Ft); - SSE_MOVAPS_XMM_to_XMM(xmmT1, ACCr); - ACCr = xmmT1; -} - -microVUt(void) mVUallocFMAC15b(int& ACCw, int& ACCr) { +microVUt(void) mVUallocFMAC14b(int& ACCw, int& ACCr) { microVU* mVU = mVUx; if (CHECK_VU_OVERFLOW) mVUclamp1(ACCr, xmmFt, _xyzw_ACC); mVUmergeRegs(ACCw, ACCr, _X_Y_Z_W); } //------------------------------------------------------------------ -// FMAC16 - MADDA BC(xyzw) FMAC Opcode +// FMAC15 - MADDA/MSUBA BC(xyzw) FMAC Opcode //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC16a(int& ACCw, int&ACCr, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC15a(int& ACCw, int& ACCr, int& Fs, int& Ft) { microVU* mVU = mVUx; - getACC(ACCw); - Fs = (_X_Y_Z_W == 15) ? ACCw : xmmFs; + Fs = xmmFs; Ft = xmmFt; - ACCr = xmmACC0 + readACC; - if (_XYZW_SS && _X) { + ACCw = xmmACC; + ACCr = ((_X_Y_Z_W == 15) || (_X_Y_Z_W == 8)) ? xmmACC : xmmT1; + SSE_MOVAPS_XMM_to_XMM(ACCr, xmmACC); + + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); if ((_Ft_ == _Fs_) && _bc_x) { Ft = Fs; } else if (!_Ft_) { getZero3SS(Ft); } @@ -486,22 +474,29 @@ microVUt(void) mVUallocFMAC16a(int& ACCw, int&ACCr, int& Fs, int& Ft) { } } -microVUt(void) mVUallocFMAC16b(int& ACCw, int& Fs) { - mVUallocFMAC14b(ACCw, Fs); +microVUt(void) mVUallocFMAC15b(int& ACCw, int& ACCr) { + mVUallocFMAC14b(ACCw, ACCr); } //------------------------------------------------------------------ -// FMAC17 - MSUBA BC(xyzw) FMAC Opcode +// FMAC16 - MADDA/MSUBA FMAC Opcode (I Reg) //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC17a(int& ACCw, int&ACCr, int& Fs, int& Ft) { - mVUallocFMAC16a(ACCw, ACCr, Fs, Ft); - SSE_MOVAPS_XMM_to_XMM(xmmT1, ACCr); - ACCr = xmmT1; +microVUt(void) mVUallocFMAC16a(int& ACCw, int& ACCr, int& Fs, int& Ft) { + microVU* mVU = mVUx; + Fs = xmmFs; + Ft = xmmFt; + ACCw = xmmACC; + ACCr = ((_X_Y_Z_W == 15) || (_X_Y_Z_W == 8)) ? xmmACC : xmmT1; + SSE_MOVAPS_XMM_to_XMM(ACCr, xmmACC); + getIreg(Ft); + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); } + else if (!_Fs_) { getZero4(Fs); } + else { getReg4(Fs, _Fs_); } } -microVUt(void) mVUallocFMAC17b(int& ACCw, int& ACCr) { - mVUallocFMAC15b(ACCw, ACCr); +microVUt(void) mVUallocFMAC16b(int& ACCw, int& ACCr) { + mVUallocFMAC14b(ACCw, ACCr); } //------------------------------------------------------------------ @@ -512,7 +507,7 @@ microVUt(void) mVUallocFMAC18a(int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; Fs = xmmFs; Ft = xmmFt; - getACC(ACC); + ACC = xmmACC; if (!_Fs_) { getZero4(Fs); } else { getReg4(Fs, _Fs_); } @@ -532,13 +527,13 @@ microVUt(void) mVUallocFMAC18b(int& ACC, int& Fs) { // FMAC19 - OPMULA FMAC Opcode //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC19a(int& Fd, int&ACC, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC19a(int& Fd, int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; Fs = xmmFs; Ft = xmmFt; Fd = xmmT1; ACC = xmmT1; - SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC0 + readACC); + SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC); if (!_Fs_) { getZero4(Fs); } else { getReg4(Fs, _Fs_); } @@ -554,40 +549,6 @@ microVUt(void) mVUallocFMAC19b(int& Fd) { mVUallocFMAC9b(Fd); } -//------------------------------------------------------------------ -// FMAC20 - MADDA FMAC Opcode (I Reg) -//------------------------------------------------------------------ - -microVUt(void) mVUallocFMAC20a(int& ACCw, int&ACCr, int& Fs, int& Ft) { - microVU* mVU = mVUx; - getACC(ACCw); - Fs = (_X_Y_Z_W == 15) ? ACCw : xmmFs; - Ft = xmmFt; - ACCr = xmmACC0 + readACC; - getIreg(Ft); - if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } - else if (!_Fs_) { getZero4(Fs); } - else { getReg4(Fs, _Fs_); } -} - -microVUt(void) mVUallocFMAC20b(int& ACCw, int& Fs) { - mVUallocFMAC14b(ACCw, Fs); -} - -//------------------------------------------------------------------ -// FMAC21 - MSUBA FMAC Opcode (I Reg) -//------------------------------------------------------------------ - -microVUt(void) mVUallocFMAC21a(int& ACCw, int&ACCr, int& Fs, int& Ft) { - mVUallocFMAC20a(ACCw, ACCr, Fs, Ft); - SSE_MOVAPS_XMM_to_XMM(xmmT1, ACCr); - ACCr = xmmT1; -} - -microVUt(void) mVUallocFMAC21b(int& ACCw, int& ACCr) { - mVUallocFMAC15b(ACCw, ACCr); -} - //------------------------------------------------------------------ // FMAC22 - Normal FMAC Opcodes (Q Reg) //------------------------------------------------------------------ @@ -616,11 +577,11 @@ microVUt(void) mVUallocFMAC22b(int& Fd) { microVUt(void) mVUallocFMAC23a(int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; - Fs = xmmFs; + ACC = xmmACC; + Fs = (_X_Y_Z_W == 15) ? xmmACC : xmmFs; Ft = xmmFt; - getACC(ACC); getQreg(Ft); - if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); } else if (!_Fs_) { getZero4(Fs); } else { getReg4(Fs, _Fs_); } } @@ -633,14 +594,14 @@ microVUt(void) mVUallocFMAC23b(int& ACC, int& Fs) { // FMAC24 - MADD FMAC Opcode Storing Result to Fd (Q Reg) //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC24a(int& Fd, int&ACC, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC24a(int& Fd, int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; Fs = xmmFs; Ft = xmmFt; Fd = xmmFs; - ACC = xmmACC0 + readACC; + ACC = xmmACC; getQreg(Ft); - if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); } else if (!_Fs_) { getZero4(Fs); } else { getReg4(Fs, _Fs_); } } @@ -653,15 +614,15 @@ microVUt(void) mVUallocFMAC24b(int& Fd) { // FMAC25 - MSUB FMAC Opcode Storing Result to Fd (Q Reg) //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC25a(int& Fd, int&ACC, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC25a(int& Fd, int& ACC, int& Fs, int& Ft) { microVU* mVU = mVUx; Fs = xmmFs; Ft = xmmFt; Fd = xmmT1; ACC = xmmT1; - SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC0 + readACC); + SSE_MOVAPS_XMM_to_XMM(ACC, xmmACC); getQreg(Ft); - if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); } else if (!_Fs_) { getZero4(Fs); } else { getReg4(Fs, _Fs_); } } @@ -671,37 +632,24 @@ microVUt(void) mVUallocFMAC25b(int& Fd) { } //------------------------------------------------------------------ -// FMAC26 - MADDA FMAC Opcode (Q Reg) +// FMAC26 - MADDA/MSUBA FMAC Opcode (Q Reg) //------------------------------------------------------------------ -microVUt(void) mVUallocFMAC26a(int& ACCw, int&ACCr, int& Fs, int& Ft) { +microVUt(void) mVUallocFMAC26a(int& ACCw, int& ACCr, int& Fs, int& Ft) { microVU* mVU = mVUx; - getACC(ACCw); - Fs = (_X_Y_Z_W == 15) ? ACCw : xmmFs; + Fs = xmmFs; Ft = xmmFt; - ACCr = xmmACC0 + readACC; + ACCw = xmmACC; + ACCr = ((_X_Y_Z_W == 15) || (_X_Y_Z_W == 8)) ? xmmACC : xmmT1; + SSE_MOVAPS_XMM_to_XMM(ACCr, xmmACC); getQreg(Ft); - if (_XYZW_SS && _X) { getReg6(Fs, _Fs_); } + if (_X_Y_Z_W == 8) { getReg6(Fs, _Fs_); } else if (!_Fs_) { getZero4(Fs); } else { getReg4(Fs, _Fs_); } } -microVUt(void) mVUallocFMAC26b(int& ACCw, int& Fs) { - mVUallocFMAC14b(ACCw, Fs); -} - -//------------------------------------------------------------------ -// FMAC27 - MSUBA FMAC Opcode (Q Reg) -//------------------------------------------------------------------ - -microVUt(void) mVUallocFMAC27a(int& ACCw, int&ACCr, int& Fs, int& Ft) { - mVUallocFMAC26a(ACCw, ACCr, Fs, Ft); - SSE_MOVAPS_XMM_to_XMM(xmmT1, ACCr); - ACCr = xmmT1; -} - -microVUt(void) mVUallocFMAC27b(int& ACCw, int& ACCr) { - mVUallocFMAC15b(ACCw, ACCr); +microVUt(void) mVUallocFMAC26b(int& ACCw, int& ACCr) { + mVUallocFMAC14b(ACCw, ACCr); } //------------------------------------------------------------------ diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 1002a578f5..b2a3556385 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -405,10 +405,10 @@ microVUf(void) mVU_FCEQ() { microVU* mVU = mVUx; if (recPass == 0) {} else { - mVUallocCFLAGa(gprT2, fvcInstance); - XOR32RtoR(gprT1, gprT1); - CMP32ItoR(gprT2, _Imm24_); - SETNZ8R(gprT1); + mVUallocCFLAGa(gprT1, fvcInstance); + XOR32ItoR(gprT1, _Imm24_); + SUB32ItoR(gprT1, 1); + SHR32ItoR(gprT1, 31); mVUallocVIb(gprT1, 1); } } @@ -457,9 +457,9 @@ microVUf(void) mVU_FMEQ() { else { mVUallocMFLAGa(gprT1, fvmInstance); mVUallocVIa(gprT2, _Fs_); - CMP16RtoR(gprT1, gprT2); - SETE8R(gprT1); - AND16ItoR(gprT1, 0x1); + XOR32RtoR(gprT1, gprT2); + SUB32ItoR(gprT1, 1); + SHR32ItoR(gprT1, 31); mVUallocVIb(gprT1, _Ft_); } } @@ -488,9 +488,9 @@ microVUf(void) mVU_FSEQ() { if (recPass == 0) {} else { mVUallocSFLAGa(gprT1, fvsInstance); - CMP16ItoR(gprT1, _Imm12_); - SETE8R(gprT1); - AND16ItoR(gprT1, 0x1); + XOR16ItoR(gprT1, _Imm12_); + SUB16ItoR(gprT1, 1); + SHR16ItoR(gprT1, 15); mVUallocVIb(gprT1, _Ft_); } } diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index e28ec9c4e2..0c50cbb003 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -91,10 +91,10 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define xmmT1 0 // Temp Reg #define xmmFs 1 // Holds the Value of Fs (writes back result Fd) #define xmmFt 2 // Holds the Value of Ft -#define xmmACC0 3 // Holds ACC Instance #0 -#define xmmACC1 4 // Holds ACC Instance #1 -#define xmmACC2 5 // Holds ACC Instance #2 -#define xmmACC3 6 // Holds ACC Instance #3 +#define xmmACC 3 // Holds ACC +#define xmmT2 4 // Temp Reg? +#define xmmT3 5 // Temp Reg? +#define xmmT4 6 // Temp Reg? #define xmmPQ 7 // Holds the Value and Backup Values of P and Q regs #define mmxVI1 0 // Holds VI 1 @@ -137,12 +137,13 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define doStatus (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<9)) #define fmInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<10)) >> 10) #define fsInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<12)) >> 12) +#define fcInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) #define fpmInstance (((u8)((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<10)) >> 10) - 1) & 0x3) #define fpsInstance (((u8)((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<12)) >> 12) - 1) & 0x3) -#define fvmInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) -#define fvsInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<16)) >> 16) -#define fvcInstance 1//((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) -#define fcInstance 1//((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) +#define fvmInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<16)) >> 16) +#define fvsInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<18)) >> 18) +#define fvcInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) + //#define getFs (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<13)) //#define getFt (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<14)) diff --git a/pcsx2/x86/microVU_Upper.inl b/pcsx2/x86/microVU_Upper.inl index 651ef92048..df8e7aa406 100644 --- a/pcsx2/x86/microVU_Upper.inl +++ b/pcsx2/x86/microVU_Upper.inl @@ -111,7 +111,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int ACC, Fs, Ft; \ mVUallocFMAC4a(ACC, Fs, Ft); \ - if (_XYZW_SS && _X) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ + if (_X_Y_Z_W == 8) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ mVUupdateFlags(Fs, xmmT1, Ft, _X_Y_Z_W, 0); \ mVUallocFMAC4b(ACC, Fs); \ @@ -124,7 +124,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int ACC, Fs, Ft; \ mVUallocFMAC5a(ACC, Fs, Ft); \ - if (_XYZW_SS && _X) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ + if (_X_Y_Z_W == 8) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ mVUupdateFlags(Fs, xmmT1, Ft, _X_Y_Z_W, 0); \ mVUallocFMAC5b(ACC, Fs); \ @@ -150,7 +150,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int ACC, Fs, Ft; \ mVUallocFMAC7a(ACC, Fs, Ft); \ - if (_XYZW_SS && _X) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ + if (_X_Y_Z_W == 8) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ mVUupdateFlags(Fs, xmmT1, Ft, _X_Y_Z_W, 0); \ mVUallocFMAC7b(ACC, Fs); \ @@ -163,7 +163,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int Fd, ACC, Fs, Ft; \ mVUallocFMAC8a(Fd, ACC, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(Fs, ACC); \ } \ @@ -182,7 +182,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int Fd, ACC, Fs, Ft; \ mVUallocFMAC9a(Fd, ACC, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(ACC, Fs); \ } \ @@ -201,11 +201,11 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int Fd, ACC, Fs, Ft; \ mVUallocFMAC10a(Fd, ACC, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(Fs, ACC); \ } \ - else { \ + else { \ SSE_MULPS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##PS_XMM_to_XMM(Fs, ACC); \ } \ @@ -220,7 +220,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int Fd, ACC, Fs, Ft; \ mVUallocFMAC11a(Fd, ACC, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(ACC, Fs); \ } \ @@ -239,7 +239,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int Fd, ACC, Fs, Ft; \ mVUallocFMAC12a(Fd, ACC, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(Fs, ACC); \ } \ @@ -258,7 +258,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int Fd, ACC, Fs, Ft; \ mVUallocFMAC13a(Fd, ACC, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(ACC, Fs); \ } \ @@ -270,33 +270,33 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC13b(Fd); \ } \ } -// FMAC14 - MADDA FMAC Opcode +// FMAC14 - MADDA/MSUBA FMAC Opcode #define mVU_FMAC14(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ mVUallocFMAC14a(ACCw, ACCr, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##SS_XMM_to_XMM(Fs, ACCr); \ + SSE_##operation##SS_XMM_to_XMM(ACCr, Fs); \ } \ else { \ SSE_MULPS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##PS_XMM_to_XMM(Fs, ACCr); \ + SSE_##operation##PS_XMM_to_XMM(ACCr, Fs); \ } \ - mVUupdateFlags(Fs, xmmT1, Ft, _X_Y_Z_W, 0); \ - mVUallocFMAC14b(ACCw, Fs); \ + mVUupdateFlags(ACCr, Fs, Ft, _X_Y_Z_W, 0); \ + mVUallocFMAC14b(ACCw, ACCr); \ } \ } -// FMAC15 - MSUBA FMAC Opcode +// FMAC15 - MADDA/MSUBA BC(xyzw) FMAC Opcode #define mVU_FMAC15(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ mVUallocFMAC15a(ACCw, ACCr, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(ACCr, Fs); \ } \ @@ -308,33 +308,14 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC15b(ACCw, ACCr); \ } \ } -// FMAC16 - MADDA BC(xyzw) FMAC Opcode +// FMAC16 - MADDA/MSUBA FMAC Opcode (I Reg) #define mVU_FMAC16(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ mVUallocFMAC16a(ACCw, ACCr, Fs, Ft); \ - if (_XYZW_SS && _X) { \ - SSE_MULSS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##SS_XMM_to_XMM(Fs, ACCr); \ - } \ - else { \ - SSE_MULPS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##PS_XMM_to_XMM(Fs, ACCr); \ - } \ - mVUupdateFlags(Fs, xmmT1, Ft, _X_Y_Z_W, 0); \ - mVUallocFMAC16b(ACCw, Fs); \ - } \ -} -// FMAC17 - MSUBA BC(xyzw) FMAC Opcode -#define mVU_FMAC17(operation) { \ - microVU* mVU = mVUx; \ - if (recPass == 0) {} \ - else { \ - int ACCw, ACCr, Fs, Ft; \ - mVUallocFMAC17a(ACCw, ACCr, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(ACCr, Fs); \ } \ @@ -343,7 +324,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX SSE_##operation##PS_XMM_to_XMM(ACCr, Fs); \ } \ mVUupdateFlags(ACCr, Fs, Ft, _X_Y_Z_W, 0); \ - mVUallocFMAC17b(ACCw, ACCr); \ + mVUallocFMAC16b(ACCw, ACCr); \ } \ } // FMAC18 - OPMULA FMAC Opcode @@ -371,44 +352,6 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC19b(Fd); \ } \ } -// FMAC20 - MADDA FMAC Opcode (I Reg) -#define mVU_FMAC20(operation) { \ - microVU* mVU = mVUx; \ - if (recPass == 0) {} \ - else { \ - int ACCw, ACCr, Fs, Ft; \ - mVUallocFMAC20a(ACCw, ACCr, Fs, Ft); \ - if (_XYZW_SS && _X) { \ - SSE_MULSS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##SS_XMM_to_XMM(Fs, ACCr); \ - } \ - else { \ - SSE_MULPS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##PS_XMM_to_XMM(Fs, ACCr); \ - } \ - mVUupdateFlags(Fs, xmmT1, Ft, _X_Y_Z_W, 0); \ - mVUallocFMAC20b(ACCw, Fs); \ - } \ -} -// FMAC21 - MSUBA FMAC Opcode (I Reg) -#define mVU_FMAC21(operation) { \ - microVU* mVU = mVUx; \ - if (recPass == 0) {} \ - else { \ - int ACCw, ACCr, Fs, Ft; \ - mVUallocFMAC21a(ACCw, ACCr, Fs, Ft); \ - if (_XYZW_SS && _X) { \ - SSE_MULSS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##SS_XMM_to_XMM(ACCr, Fs); \ - } \ - else { \ - SSE_MULPS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##PS_XMM_to_XMM(ACCr, Fs); \ - } \ - mVUupdateFlags(ACCr, Fs, Ft, _X_Y_Z_W, 0); \ - mVUallocFMAC21b(ACCw, ACCr); \ - } \ -} // FMAC22 - Normal FMAC Opcodes (Q Reg) #define mVU_FMAC22(operation) { \ microVU* mVU = mVUx; \ @@ -429,7 +372,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int ACC, Fs, Ft; \ mVUallocFMAC23a(ACC, Fs, Ft); \ - if (_XYZW_SS && _X) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ + if (_X_Y_Z_W == 8) SSE_##operation##SS_XMM_to_XMM(Fs, Ft); \ else SSE_##operation##PS_XMM_to_XMM(Fs, Ft); \ mVUupdateFlags(Fs, xmmT1, Ft, _X_Y_Z_W, 0); \ mVUallocFMAC23b(ACC, Fs); \ @@ -442,7 +385,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int Fd, ACC, Fs, Ft; \ mVUallocFMAC24a(Fd, ACC, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(Fs, ACC); \ } \ @@ -461,7 +404,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX else { \ int Fd, ACC, Fs, Ft; \ mVUallocFMAC25a(Fd, ACC, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(ACC, Fs); \ } \ @@ -473,33 +416,14 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX mVUallocFMAC25b(Fd); \ } \ } -// FMAC26 - MADDA FMAC Opcode (Q Reg) +// FMAC26 - MADDA/MSUBA FMAC Opcode (Q Reg) #define mVU_FMAC26(operation) { \ microVU* mVU = mVUx; \ if (recPass == 0) {} \ else { \ int ACCw, ACCr, Fs, Ft; \ mVUallocFMAC26a(ACCw, ACCr, Fs, Ft); \ - if (_XYZW_SS && _X) { \ - SSE_MULSS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##SS_XMM_to_XMM(Fs, ACCr); \ - } \ - else { \ - SSE_MULPS_XMM_to_XMM(Fs, Ft); \ - SSE_##operation##PS_XMM_to_XMM(Fs, ACCr); \ - } \ - mVUupdateFlags(Fs, xmmT1, Ft, _X_Y_Z_W, 0); \ - mVUallocFMAC26b(ACCw, Fs); \ - } \ -} -// FMAC27 - MSUBA FMAC Opcode (Q Reg) -#define mVU_FMAC27(operation) { \ - microVU* mVU = mVUx; \ - if (recPass == 0) {} \ - else { \ - int ACCw, ACCr, Fs, Ft; \ - mVUallocFMAC27a(ACCw, ACCr, Fs, Ft); \ - if (_XYZW_SS && _X) { \ + if (_X_Y_Z_W == 8) { \ SSE_MULSS_XMM_to_XMM(Fs, Ft); \ SSE_##operation##SS_XMM_to_XMM(ACCr, Fs); \ } \ @@ -508,7 +432,7 @@ microVUt(void) mVUupdateFlags(int reg, int regT1, int regT2, int xyzw, bool modX SSE_##operation##PS_XMM_to_XMM(ACCr, Fs); \ } \ mVUupdateFlags(ACCr, Fs, Ft, _X_Y_Z_W, 0); \ - mVUallocFMAC27b(ACCw, ACCr); \ + mVUallocFMAC26b(ACCw, ACCr); \ } \ } @@ -576,12 +500,12 @@ microVUf(void) mVU_MADDy() { mVU_FMAC10(ADD); } microVUf(void) mVU_MADDz() { mVU_FMAC10(ADD); } microVUf(void) mVU_MADDw() { mVU_FMAC10(ADD); } microVUf(void) mVU_MADDA() { mVU_FMAC14(ADD); } -microVUf(void) mVU_MADDAi() { mVU_FMAC20(ADD); } +microVUf(void) mVU_MADDAi() { mVU_FMAC16(ADD); } microVUf(void) mVU_MADDAq() { mVU_FMAC26(ADD); } -microVUf(void) mVU_MADDAx() { mVU_FMAC16(ADD); } -microVUf(void) mVU_MADDAy() { mVU_FMAC16(ADD); } -microVUf(void) mVU_MADDAz() { mVU_FMAC16(ADD); } -microVUf(void) mVU_MADDAw() { mVU_FMAC16(ADD); } +microVUf(void) mVU_MADDAx() { mVU_FMAC15(ADD); } +microVUf(void) mVU_MADDAy() { mVU_FMAC15(ADD); } +microVUf(void) mVU_MADDAz() { mVU_FMAC15(ADD); } +microVUf(void) mVU_MADDAw() { mVU_FMAC15(ADD); } microVUf(void) mVU_MSUB() { mVU_FMAC9(SUB); } microVUf(void) mVU_MSUBi() { mVU_FMAC13(SUB); } microVUf(void) mVU_MSUBq() { mVU_FMAC25(SUB); } @@ -590,12 +514,12 @@ microVUf(void) mVU_MSUBy() { mVU_FMAC11(SUB); } microVUf(void) mVU_MSUBz() { mVU_FMAC11(SUB); } microVUf(void) mVU_MSUBw() { mVU_FMAC11(SUB); } microVUf(void) mVU_MSUBA() { mVU_FMAC14(SUB); } -microVUf(void) mVU_MSUBAi() { mVU_FMAC21(SUB); } -microVUf(void) mVU_MSUBAq() { mVU_FMAC27(SUB); } -microVUf(void) mVU_MSUBAx() { mVU_FMAC17(SUB); } -microVUf(void) mVU_MSUBAy() { mVU_FMAC17(SUB); } -microVUf(void) mVU_MSUBAz() { mVU_FMAC17(SUB); } -microVUf(void) mVU_MSUBAw() { mVU_FMAC17(SUB); } +microVUf(void) mVU_MSUBAi() { mVU_FMAC16(SUB); } +microVUf(void) mVU_MSUBAq() { mVU_FMAC26(SUB); } +microVUf(void) mVU_MSUBAx() { mVU_FMAC15(SUB); } +microVUf(void) mVU_MSUBAy() { mVU_FMAC15(SUB); } +microVUf(void) mVU_MSUBAz() { mVU_FMAC15(SUB); } +microVUf(void) mVU_MSUBAw() { mVU_FMAC15(SUB); } microVUf(void) mVU_MAX() { mVU_FMAC1(MAX); } microVUf(void) mVU_MAXi() { mVU_FMAC6(MAX); } microVUf(void) mVU_MAXx() { mVU_FMAC3(MAX); } From 80abd88a67293dc319f71851e6699aa38b656bf3 Mon Sep 17 00:00:00 2001 From: mattmenke Date: Mon, 16 Mar 2009 02:58:38 +0000 Subject: [PATCH 55/77] LilyPad: Couple GUI fixes and cleanups, with intention of releasing soon. Added mysteriously missing check for binding same control on different pads, fixed rearranged pad type stuff. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@796 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/LilyPad/Config.cpp | 28 +++++++++++-- plugins/LilyPad/LilyPad.rc | 80 +++++++++++++++++++------------------- 2 files changed, 65 insertions(+), 43 deletions(-) diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index e3ce0d465f..e968b206e9 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -1181,6 +1181,22 @@ int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int s } DeleteBinding(port, slot, dev, b); } + if (!config.multipleBinding) { + for (int port2=0; port2<2; port2++) { + for (int slot2=0; slot2<4; slot2++) { + if (port2==port && slot2 == slot) continue; + PadBindings *p = dev->pads[port2]+slot2; + for (int i=0; i < p->numBindings; i++) { + Binding *b = p->bindings+i; + int uid2 = dev->virtualControls[b->controlIndex].uid; + if (b->controlIndex == controlIndex || (!((uid2^uid) & 0xFFFFFF) && ((uid|uid2) & (UID_POV | UID_AXIS)))) { + DeleteBinding(port2, slot2, dev, b); + i--; + } + } + } + } + } return count; } @@ -1631,10 +1647,10 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) L"Guitar"); } } - UpdatePadList(hWnd); UpdatePadPages(); hWndGeneral = hWnd; RefreshEnabledDevicesAndDisplay(0, hWnd, 0); + UpdatePadList(hWnd); CheckDlgButton(hWnd, IDC_BACKGROUND, BST_CHECKED * config.background); CheckDlgButton(hWnd, IDC_FORCE_HIDE, BST_CHECKED * config.forceHide); @@ -1676,6 +1692,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L case WM_DEVICECHANGE: if (wParam == DBT_DEVNODES_CHANGED) { RefreshEnabledDevicesAndDisplay(1, hWndGeneral, 1); + UpdatePadList(hWnd); } break; case WM_COMMAND: @@ -1684,8 +1701,11 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L int pad = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); HWND hWndCombo = GetDlgItem(hWnd, IDC_PAD_TYPE); int sel = SendMessage(hWndCombo, CB_GETCURSEL, 0, 0); - if (pad >= 0 && sel >= 0 && sel != config.padConfigs[sel][0].type) { - config.padConfigs[sel][0].type = (PadType)sel; + if (pad >= 0 && sel >= 0 && sel != config.padConfigs[pad][0].type) { + config.padConfigs[pad][0].type = (PadType)sel; + UpdatePadList(hWnd); + UpdatePadPages(); + RefreshEnabledDevicesAndDisplay(0, hWnd, 1); PropSheet_Changed(hWndProp, hWnd); } } @@ -1729,6 +1749,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L } else if (HIWORD(wParam)==BN_CLICKED && LOWORD(wParam) == ID_REFRESH) { RefreshEnabledDevicesAndDisplay(1, hWnd, 1); + UpdatePadList(hWnd); } else if (HIWORD(wParam)==BN_CLICKED && LOWORD(wParam) == IDC_ANALOG_START1) { int pad = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); @@ -1797,6 +1818,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L config.forceHide = (IsDlgButtonChecked(hWnd, IDC_FORCE_HIDE) == BST_CHECKED); RefreshEnabledDevicesAndDisplay(0, hWnd, 1); + UpdatePadList(hWnd); PropSheet_Changed(hWndProp, hWnd); /* diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index f903c77b46..02e58ca82b 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -75,20 +75,20 @@ BEGIN PUSHBUTTON "L3",ID_L3,195,93,45,15 PUSHBUTTON "R3",ID_R3,371,93,46,15 GROUPBOX "D-Pad",IDC_DPAD,251,44,110,68 - PUSHBUTTON "Up",ID_DPAD_UP,285,54,35,15 - PUSHBUTTON "Left",ID_DPAD_LEFT,267,73,35,15 - PUSHBUTTON "Right",ID_DPAD_RIGHT,307,73,35,15 - PUSHBUTTON "Down",ID_DPAD_DOWN,285,92,35,15 + PUSHBUTTON "Up",ID_DPAD_UP,285,55,35,15 + PUSHBUTTON "Left",ID_DPAD_LEFT,267,74,35,15 + PUSHBUTTON "Right",ID_DPAD_RIGHT,307,74,35,15 + PUSHBUTTON "Down",ID_DPAD_DOWN,285,93,35,15 GROUPBOX "Left Analog Stick",IDC_LSTICK,195,115,108,70 - PUSHBUTTON "Up",ID_LSTICK_UP,228,125,35,15 - PUSHBUTTON "Left",ID_LSTICK_LEFT,210,144,35,15 - PUSHBUTTON "Right",ID_LSTICK_RIGHT,250,144,35,15 - PUSHBUTTON "Down",ID_LSTICK_DOWN,228,164,35,15 + PUSHBUTTON "Up",ID_LSTICK_UP,228,126,35,15 + PUSHBUTTON "Left",ID_LSTICK_LEFT,210,145,35,15 + PUSHBUTTON "Right",ID_LSTICK_RIGHT,250,145,35,15 + PUSHBUTTON "Down",ID_LSTICK_DOWN,228,165,35,15 GROUPBOX "Right Analog Stick",IDC_RSTICK,309,115,108,70 - PUSHBUTTON "Up",ID_RSTICK_UP,342,125,35,15 - PUSHBUTTON "Left",ID_RSTICK_LEFT,324,144,35,15 - PUSHBUTTON "Right",ID_RSTICK_RIGHT,364,144,35,15 - PUSHBUTTON "Down",ID_RSTICK_DOWN,342,164,35,15 + PUSHBUTTON "Up",ID_RSTICK_UP,342,126,35,15 + PUSHBUTTON "Left",ID_RSTICK_LEFT,324,145,35,15 + PUSHBUTTON "Right",ID_RSTICK_RIGHT,364,145,35,15 + PUSHBUTTON "Down",ID_RSTICK_DOWN,342,165,35,15 GROUPBOX "",ID_FF,195,6,222,248 COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17 @@ -115,19 +115,19 @@ BEGIN CONTROL "Axis 6",IDC_FF_AXIS6_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,240,91,10 CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10 EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING - PUSHBUTTON "Test",ID_TEST,196,260,62,15 - GROUPBOX "Binding Details",ID_SENSITIVITY,195,187,222,67 - EDITTEXT IDC_AXIS_DEVICE1,201,200,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - COMBOBOX IDC_AXIS_DIRECTION,201,216,63,47,CBS_DROPDOWNLIST | WS_TABSTOP - EDITTEXT IDC_AXIS_CONTROL1,201,238,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,215,138,17 - CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,238,27,10 - CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,238,34,10 - EDITTEXT IDC_AXIS_SENSITIVITY1,375,238,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING - PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,62,15 - PUSHBUTTON "Lock Input",ID_LOCK,196,260,62,15 - PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,62,15 - PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,62,15 + PUSHBUTTON "Test",ID_TEST,196,260,59,15 + PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,59,15 + GROUPBOX "Binding Details",ID_SENSITIVITY,195,188,222,66 + EDITTEXT IDC_AXIS_DEVICE1,203,202,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + COMBOBOX IDC_AXIS_DIRECTION,202,218,70,47,CBS_DROPDOWNLIST | WS_TABSTOP + EDITTEXT IDC_AXIS_CONTROL1,203,240,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,217,138,17 + CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,240,27,10 + CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,240,34,10 + EDITTEXT IDC_AXIS_SENSITIVITY1,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING + PUSHBUTTON "Lock Input",ID_LOCK,196,260,59,15 + PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,59,15 + PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,59,15 GROUPBOX "New Force Feedback Effect",IDC_STATIC,262,260,155,51 COMBOBOX IDC_FORCEFEEDBACK,269,273,142,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Big Motor",ID_BIG_MOTOR,269,291,64,14 @@ -179,19 +179,19 @@ BEGIN CONTROL "Axis 6",IDC_FF_AXIS6_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,240,91,10 CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10 EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING - PUSHBUTTON "Test",ID_TEST,196,260,62,15 - GROUPBOX "Binding Details",ID_SENSITIVITY,195,187,222,67 - EDITTEXT IDC_AXIS_DEVICE1,201,200,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - COMBOBOX IDC_AXIS_DIRECTION,201,216,63,47,CBS_DROPDOWNLIST | WS_TABSTOP - EDITTEXT IDC_AXIS_CONTROL1,201,238,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,215,138,17 - CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,238,27,10 - CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,238,34,10 - EDITTEXT IDC_AXIS_SENSITIVITY1,375,238,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING - PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,62,15 - PUSHBUTTON "Lock Input",ID_LOCK,196,260,62,15 - PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,62,15 - PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,62,15 + PUSHBUTTON "Test",ID_TEST,196,260,59,15 + PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,59,15 + GROUPBOX "Binding Details",ID_SENSITIVITY,195,188,222,66 + EDITTEXT IDC_AXIS_DEVICE1,203,202,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + COMBOBOX IDC_AXIS_DIRECTION,202,218,70,47,CBS_DROPDOWNLIST | WS_TABSTOP + EDITTEXT IDC_AXIS_CONTROL1,203,240,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,217,138,17 + CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,240,27,10 + CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,240,34,10 + EDITTEXT IDC_AXIS_SENSITIVITY1,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING + PUSHBUTTON "Lock Input",ID_LOCK,196,260,59,15 + PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,59,15 + PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,59,15 GROUPBOX "New Force Feedback Effect",IDC_STATIC,262,260,155,51 COMBOBOX IDC_FORCEFEEDBACK,269,273,142,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Big Motor",ID_BIG_MOTOR,269,291,64,14 @@ -211,10 +211,10 @@ BEGIN "Button",BS_AUTORADIOBUTTON,23,64,175,10 GROUPBOX "Game Device APIs",IDC_STATIC,16,81,191,49 CONTROL "DirectInput",IDC_G_DI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,65,10 - CONTROL "XInput",IDC_G_XI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,104,39,10 + CONTROL "XInput (Xbox 360 controllers only)",IDC_G_XI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,104,125,10 CONTROL "Monitor when in background",IDC_BACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,116,106,10 GROUPBOX "Mouse API",IDC_STATIC,216,16,192,85 - CONTROL "Windows messaging",IDC_M_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,224,27,112,10 + CONTROL "Windows messaging (Recommended)",IDC_M_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,224,27,134,10 CONTROL "Raw input (XP and later only)",IDC_M_RAW,"Button",BS_AUTORADIOBUTTON,224,39,112,10 CONTROL "DirectInput",IDC_M_DI,"Button",BS_AUTORADIOBUTTON,224,51,112,10 CONTROL "Disable",IDC_M_DISABLE,"Button",BS_AUTORADIOBUTTON,224,63,39,10 From 2fa30cabf45808b26351780115336c7873a3c673 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Mon, 16 Mar 2009 08:19:46 +0000 Subject: [PATCH 56/77] work in progress stuff... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@797 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU.cpp | 6 ++-- pcsx2/x86/microVU.h | 7 ++-- pcsx2/x86/microVU_Alloc.h | 21 ++++++----- pcsx2/x86/microVU_Compile.inl | 34 +++++++++++++++++- pcsx2/x86/microVU_Lower.inl | 67 +++++++++++++++++++++++++++++------ pcsx2/x86/microVU_Misc.h | 46 +++++++++++++----------- pcsx2/x86/microVU_Misc.inl | 16 ++++----- pcsx2/x86/microVU_Tables.inl | 3 ++ 8 files changed, 145 insertions(+), 55 deletions(-) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index d61690c514..396bb81471 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -86,7 +86,7 @@ microVUt(void) mVUreset() { // Create Block Managers for (int i; i <= mVU->prog.max; i++) { - for (u32 j; j < mVU->progSize; j++) { + for (u32 j; j < (mVU->progSize / 2); j++) { mVU->prog.prog[i].block[j] = new microBlockManager(); } } @@ -112,7 +112,7 @@ microVUt(void) mVUclose() { // Delete Block Managers for (int i; i <= mVU->prog.max; i++) { - for (u32 j; j < mVU->progSize; j++) { + for (u32 j; j < (mVU->progSize / 2); j++) { if (mVU->prog.prog[i].block[j]) delete mVU->prog.prog[i].block[j]; } } @@ -163,7 +163,7 @@ void* __fastcall mVUexecuteVU1(u32 startPC, u32 cycles) { // Clears program data (Sets used to 1 because calling this function implies the program will be used at least once) __forceinline void mVUclearProg(microVU* mVU, int progIndex) { mVU->prog.prog[progIndex].used = 1; - for (u32 i = 0; i < mVU->progSize; i++) { + for (u32 i = 0; i < (mVU->progSize / 2); i++) { mVU->prog.prog[progIndex].block[i]->reset(); } } diff --git a/pcsx2/x86/microVU.h b/pcsx2/x86/microVU.h index f76f271585..370b7ef852 100644 --- a/pcsx2/x86/microVU.h +++ b/pcsx2/x86/microVU.h @@ -82,9 +82,9 @@ public: template struct microProgram { - u8 data[progSize]; + u32 data[progSize]; u32 used; // Number of times its been used - microBlockManager* block[progSize]; + microBlockManager* block[progSize / 2]; microAllocInfo allocInfo; }; @@ -107,7 +107,7 @@ struct microVU { u32 cacheAddr; // VU Cache Start Address static const u32 cacheSize = 0x500000; // VU Cache Size - microProgManager<0x800> prog; // Micro Program Data + microProgManager<0x1000> prog; // Micro Program Data VURegs* regs; // VU Regs Struct u8* cache; // Dynarec Cache Start (where we will start writing the recompiled code to) @@ -149,3 +149,4 @@ microVUt(void) mVUclose(); #include "microVU_Misc.h" #include "microVU_Alloc.inl" #include "microVU_Tables.inl" +#include "microVU_Compile.inl" diff --git a/pcsx2/x86/microVU_Alloc.h b/pcsx2/x86/microVU_Alloc.h index 60611ebfbe..81e1ce9fa0 100644 --- a/pcsx2/x86/microVU_Alloc.h +++ b/pcsx2/x86/microVU_Alloc.h @@ -28,8 +28,7 @@ union regInfo { }; }; -template -struct microAllocInfo { +struct microRegInfo { regInfo VF[32]; regInfo Acc; u8 VI[32]; @@ -37,11 +36,19 @@ struct microAllocInfo { u8 q; u8 p; u8 r; +}; + +template +struct microAllocInfo { + microRegInfo regs; + u8 branch; // 0 = No Branch, 1 = Branch, 2 = Conditional Branch, 3 = Jump (JALR/JR) + u32 curPC; // Current PC + u32 cycles; // Cycles for current block u32 info[pSize];// bit 00 = Lower Instruction is NOP - // bit 01 = Used with bit 2 to make a 2-bit key for ACC write instance - // bit 02 = (00 = instance #0, 01 = instance #1, 10 = instance #2, 11 = instance #3) - // bit 03 = Used with bit 4 to make a 2-bit key for ACC read instance - // bit 04 = (00 = instance #0, 01 = instance #1, 10 = instance #2, 11 = instance #3) + // bit 01 + // bit 02 + // bit 03 + // bit 04 // bit 05 = Write to Q1 or Q2? // bit 06 = Read Q1 or Q2? // bit 07 = Read/Write to P1 or P2? @@ -59,6 +66,4 @@ struct microAllocInfo { // bit 19 // bit 20 = Read VI(Fs) from backup memory? // bit 21 = Read VI(Ft) from backup memory? - u32 curPC; }; - diff --git a/pcsx2/x86/microVU_Compile.inl b/pcsx2/x86/microVU_Compile.inl index e674aaf8df..be372ee45f 100644 --- a/pcsx2/x86/microVU_Compile.inl +++ b/pcsx2/x86/microVU_Compile.inl @@ -19,4 +19,36 @@ #pragma once #ifdef PCSX2_MICROVU -#endif //PCSX2_MICROVU \ No newline at end of file +#define mVUbranch mVUallocInfo.branch +#define iPC mVUcurProg.curPC +#define curI mVUcurProg.data[iPC] +#define setCode() { mVU->code = curI; } +#define incPC() { iPC = ((iPC + 1) & (mVU->progSize-1)); setCode();} + +microVUx(void) mVUcompile(u32 startPC, u32 pipelineState, u8* x86ptrStart) { + microVU* mVU = mVUx; + int x; + iPC = startPC; + setCode(); + for (x = 0; ; x++) { + if (curI & _Ibit_) { SysPrintf("microVU: I-bit set!\n"); } + if (curI & _Ebit_) { SysPrintf("microVU: E-bit set!\n"); } + if (curI & _Mbit_) { SysPrintf("microVU: M-bit set!\n"); } + if (curI & _Dbit_) { SysPrintf("microVU: D-bit set!\n"); mVUbranch = 4; } + if (curI & _Tbit_) { SysPrintf("microVU: T-bit set!\n"); mVUbranch = 4; } + mVUopU(); + incPC(); + mVUopL(); + if (mVUbranch == 4) { mVUbranch = 0; break; } + else if (mVUbranch) { mVUbranch = 4; } + } + iPC = startPC; + setCode(); + for (int i = 0; i < x; i++) { + mVUopU(); + incPC(); + if (!isNop) mVUopL(); + } +} + +#endif //PCSX2_MICROVU diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index b2a3556385..69d9b20098 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -594,17 +594,6 @@ microVUf(void) mVU_ISUBIU() { } } -microVUf(void) mVU_B() {} -microVUf(void) mVU_BAL() {} -microVUf(void) mVU_IBEQ() {} -microVUf(void) mVU_IBGEZ() {} -microVUf(void) mVU_IBGTZ() {} -microVUf(void) mVU_IBLTZ() {} -microVUf(void) mVU_IBLEZ() {} -microVUf(void) mVU_IBNE() {} -microVUf(void) mVU_JR() {} -microVUf(void) mVU_JALR() {} - microVUf(void) mVU_MOVE() { microVU* mVU = mVUx; if (recPass == 0) { /*If (!_Ft_ || (_Ft_ == _Fs_)) nop();*/ } @@ -952,4 +941,60 @@ microVUf(void) mVU_XGKICK() { else CALLFunc((uptr)mVU_XGKICK1); } } + +//------------------------------------------------------------------ +// Branches +//------------------------------------------------------------------ + +microVUf(void) mVU_B() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 1; } + else {} +} +microVUf(void) mVU_BAL() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 1; } + else {} +} +microVUf(void) mVU_IBEQ() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 2; } + else {} +} +microVUf(void) mVU_IBGEZ() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 2; } + else {} +} +microVUf(void) mVU_IBGTZ() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 2; } + else {} +} +microVUf(void) mVU_IBLTZ() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 2; } + else {} +} +microVUf(void) mVU_IBLEZ() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 2; } + else {} +} +microVUf(void) mVU_IBNE() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 2; } + else {} +} +microVUf(void) mVU_JR() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 3; } + else {} +} +microVUf(void) mVU_JALR() { + microVU* mVU = mVUx; + if (recPass == 0) { mVUallocInfo.branch = 3; } + else {} +} + #endif //PCSX2_MICROVU diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index 0c50cbb003..0828a34d97 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -59,15 +59,14 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define _Fs_ ((mVU->code >> 11) & 0x1F) // The rd part of the instruction register #define _Fd_ ((mVU->code >> 6) & 0x1F) // The sa part of the instruction register -#define _X ((mVU->code>>24) & 0x1) -#define _Y ((mVU->code>>23) & 0x1) -#define _Z ((mVU->code>>22) & 0x1) -#define _W ((mVU->code>>21) & 0x1) +#define _X ((mVU->code>>24) & 0x1) +#define _Y ((mVU->code>>23) & 0x1) +#define _Z ((mVU->code>>22) & 0x1) +#define _W ((mVU->code>>21) & 0x1) -#define _XYZW_SS (_X+_Y+_Z+_W==1) - -#define _X_Y_Z_W (((mVU->code >> 21 ) & 0xF )) -#define _xyzw_ACC ((_XYZW_SS && !_X) ? 15 : _X_Y_Z_W) +#define _XYZW_SS (_X+_Y+_Z+_W==1) +#define _X_Y_Z_W (((mVU->code >> 21 ) & 0xF )) +#define _xyzw_ACC ((_XYZW_SS && !_X) ? 15 : _X_Y_Z_W) #define _bc_ (mVU->code & 0x03) #define _bc_x ((mVU->code & 0x03) == 0) @@ -78,12 +77,17 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define _Fsf_ ((mVU->code >> 21) & 0x03) #define _Ftf_ ((mVU->code >> 23) & 0x03) -#define _Imm11_ (s32)(mVU->code & 0x400 ? 0xfffffc00 | (mVU->code & 0x3ff) : mVU->code & 0x3ff) -#define _UImm11_ (s32)(mVU->code & 0x7ff) -#define _Imm12_ (((mVU->code >> 21 ) & 0x1) << 11) | (mVU->code & 0x7ff) -#define _Imm5_ (((mVU->code & 0x400) ? 0xfff0 : 0) | ((mVU->code >> 6) & 0xf)) -#define _Imm15_ (((mVU->code >> 10) & 0x7800) | (mVU->code & 0x7ff)) -#define _Imm24_ (u32)(mVU->code & 0xffffff) +#define _Imm5_ (((mVU->code & 0x400) ? 0xfff0 : 0) | ((mVU->code >> 6) & 0xf)) +#define _Imm11_ (s32)(mVU->code & 0x400 ? 0xfffffc00 | (mVU->code & 0x3ff) : mVU->code & 0x3ff) +#define _Imm12_ (((mVU->code >> 21 ) & 0x1) << 11) | (mVU->code & 0x7ff) +#define _Imm15_ (((mVU->code >> 10) & 0x7800) | (mVU->code & 0x7ff)) +#define _Imm24_ (u32)(mVU->code & 0xffffff) + +#define _Ibit_ (1<<31) +#define _Ebit_ (1<<30) +#define _Mbit_ (1<<29) +#define _Dbit_ (1<<28) +#define _Tbit_ (1<<27) #define getVUmem(x) (((vuIndex == 1) ? (x & 0x3ff) : ((x >= 0x400) ? (x & 0x43f) : (x & 0xff))) * 16) #define offsetSS ((_X) ? (0) : ((_Y) ? (4) : ((_Z) ? 8: 12))) @@ -92,9 +96,9 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define xmmFs 1 // Holds the Value of Fs (writes back result Fd) #define xmmFt 2 // Holds the Value of Ft #define xmmACC 3 // Holds ACC -#define xmmT2 4 // Temp Reg? -#define xmmT3 5 // Temp Reg? -#define xmmT4 6 // Temp Reg? +#define xmmMax 4 // Holds mVU_maxvals +#define xmmMin 5 // Holds mVU_minvals +#define xmmT2 6 // Temp Reg? #define xmmPQ 7 // Holds the Value and Backup Values of P and Q regs #define mmxVI1 0 // Holds VI 1 @@ -122,12 +126,13 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define microVUf(aType) template aType #define microVUq(aType) template __forceinline aType +#define mVUcurProg mVU->prog.prog[mVU->prog.cur] #define mVUallocInfo mVU->prog.prog[mVU->prog.cur].allocInfo #define isNOP (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<0)) -#define writeACC ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<1)) >> 1) -#define prevACC (((u8)((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<1)) >> 1) - 1) & 0x3) -#define readACC ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<3)) >> 3) +//#define writeACC ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<1)) >> 1) +//#define prevACC (((u8)((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<1)) >> 1) - 1) & 0x3) +//#define readACC ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<3)) >> 3) #define writeQ ((mVUallocInfo.info[mVUallocInfo.curPC] & (1<<5)) >> 5) #define readQ ((mVUallocInfo.info[mVUallocInfo.curPC] & (1<<6)) >> 6) #define writeP ((mVUallocInfo.info[mVUallocInfo.curPC] & (1<<7)) >> 7) @@ -143,7 +148,6 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define fvmInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<16)) >> 16) #define fvsInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<18)) >> 18) #define fvcInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) - //#define getFs (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<13)) //#define getFt (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<14)) diff --git a/pcsx2/x86/microVU_Misc.inl b/pcsx2/x86/microVU_Misc.inl index e229a09dae..6977b765e1 100644 --- a/pcsx2/x86/microVU_Misc.inl +++ b/pcsx2/x86/microVU_Misc.inl @@ -27,12 +27,12 @@ microVUx(void) mVUclamp1(int reg, int regT1, int xyzw) { switch (xyzw) { case 1: case 2: case 4: case 8: - SSE_MINSS_M32_to_XMM(reg, (uptr)mVU_maxvals); - SSE_MAXSS_M32_to_XMM(reg, (uptr)mVU_minvals); + SSE_MINSS_XMM_to_XMM(reg, xmmMax); + SSE_MAXSS_XMM_to_XMM(reg, xmmMin); break; default: - SSE_MINPS_M128_to_XMM(reg, (uptr)mVU_maxvals); - SSE_MAXPS_M128_to_XMM(reg, (uptr)mVU_minvals); + SSE_MINPS_XMM_to_XMM(reg, xmmMax); + SSE_MAXPS_XMM_to_XMM(reg, xmmMin); break; } } @@ -44,15 +44,15 @@ microVUx(void) mVUclamp2(int reg, int regT1, int xyzw) { case 1: case 2: case 4: case 8: SSE_MOVSS_XMM_to_XMM(regT1, reg); SSE_ANDPS_M128_to_XMM(regT1, (uptr)mVU_signbit); - SSE_MINSS_M32_to_XMM(reg, (uptr)mVU_maxvals); - SSE_MAXSS_M32_to_XMM(reg, (uptr)mVU_minvals); + SSE_MINSS_XMM_to_XMM(reg, xmmMax); + SSE_MAXSS_XMM_to_XMM(reg, xmmMin); SSE_ORPS_XMM_to_XMM(reg, regT1); break; default: SSE_MOVAPS_XMM_to_XMM(regT1, reg); SSE_ANDPS_M128_to_XMM(regT1, (uptr)mVU_signbit); - SSE_MINPS_M128_to_XMM(reg, (uptr)mVU_maxvals); - SSE_MAXPS_M128_to_XMM(reg, (uptr)mVU_minvals); + SSE_MINPS_XMM_to_XMM(reg, xmmMax); + SSE_MAXPS_XMM_to_XMM(reg, xmmMin); SSE_ORPS_XMM_to_XMM(reg, regT1); break; } diff --git a/pcsx2/x86/microVU_Tables.inl b/pcsx2/x86/microVU_Tables.inl index a0ea34cae0..22af9f2aaa 100644 --- a/pcsx2/x86/microVU_Tables.inl +++ b/pcsx2/x86/microVU_Tables.inl @@ -750,4 +750,7 @@ microVUf(void) mVULowerOP_T3_01() { doTableStuff(mVULowerOP_T3_01_OPCODE, ((mVUg microVUf(void) mVULowerOP_T3_10() { doTableStuff(mVULowerOP_T3_10_OPCODE, ((mVUgetCode >> 6) & 0x1f)); } microVUf(void) mVULowerOP_T3_11() { doTableStuff(mVULowerOP_T3_11_OPCODE, ((mVUgetCode >> 6) & 0x1f)); } microVUf(void) mVUunknown() { SysPrintf("mVUunknown<%d,%d> : Unknown Micro VU opcode called\n", vuIndex, recPass); } +microVUf(void) mVUopU() { doTableStuff(mVU_UPPER_OPCODE, (mVUgetCode & 0x3f)); } // Gets Upper Opcode +microVUf(void) mVUopL() { doTableStuff(mVULOWER_OPCODE, (mVUgetCode >> 25)); } // Gets Lower Opcode + #endif //PCSX2_MICROVU From 7c00edfc074491f1788d10a9e54c66b4228ae0a1 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Mon, 16 Mar 2009 18:32:18 +0000 Subject: [PATCH 57/77] Disabled global optimization properly, and enabled Incremental Link, on devel builds. Minor code changes compile fairly instantly now. ;) I'll make some property sheets for enabled/disabled LTCG/WPO in the future. Added a new Threading class: ScopedLock. Used as an automatic unlocking mutex (safe for use with C++ exceptions, and cleaner/simpler code too). It works like C#'s "using" and "lock" directives, for those familiar with that. Optimized the AtomicExchange implementations for MSVC. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@798 96395faa-99c1-11dd-bbfe-3dabce05a288 --- 3rdparty/bzip2/bzip2.vcproj | 3 +- 3rdparty/w32pthreads/pthreads_2008.vcproj | 3 +- .../ptw32_InterlockedCompareExchange.c | 37 +++++++------- 3rdparty/zlib/zlib.vcproj | 3 +- pcsx2/Linux/LnxThreads.cpp | 1 - pcsx2/RDebug/deci2.h | 2 - pcsx2/RDebug/deci2_dbgp.cpp | 1 - pcsx2/System.cpp | 14 +++-- pcsx2/System.h | 1 + pcsx2/ThreadTools.cpp | 1 + pcsx2/Threading.h | 51 +++++++++++++++++-- pcsx2/windows/VCprojects/pcsx2_2008.vcproj | 5 +- pcsx2/windows/WinThreads.cpp | 19 +++---- .../CDVDiso/src/Windows/CDVDiso_vs2008.vcproj | 9 ++-- 14 files changed, 95 insertions(+), 55 deletions(-) diff --git a/3rdparty/bzip2/bzip2.vcproj b/3rdparty/bzip2/bzip2.vcproj index 37821de9b7..5d36273f2a 100644 --- a/3rdparty/bzip2/bzip2.vcproj +++ b/3rdparty/bzip2/bzip2.vcproj @@ -142,7 +142,7 @@ ConfigurationType="4" InheritedPropertySheets="..\3rdparty.vsprops" CharacterSet="2" - WholeProgramOptimization="1" + WholeProgramOptimization="0" > Execute() block without // bad things happening (recompilers will slow down for a brief moment since rec code blocks diff --git a/pcsx2/System.h b/pcsx2/System.h index 5d64ad0040..1c51e8352b 100644 --- a/pcsx2/System.h +++ b/pcsx2/System.h @@ -26,6 +26,7 @@ #include "MemcpyFast.h" #include "SafeArray.h" #include "Misc.h" +#include "Threading.h" // to use threading stuff, include the Threading namespace in your file. enum PageProtectionMode diff --git a/pcsx2/ThreadTools.cpp b/pcsx2/ThreadTools.cpp index 47e1665faf..665ad569bc 100644 --- a/pcsx2/ThreadTools.cpp +++ b/pcsx2/ThreadTools.cpp @@ -44,6 +44,7 @@ namespace Threading void Thread::Close() { + if( m_terminated ) return; pthread_cancel( m_thread ); pthread_join( m_thread, NULL ); } diff --git a/pcsx2/Threading.h b/pcsx2/Threading.h index d0ed296574..eef45fe0bf 100644 --- a/pcsx2/Threading.h +++ b/pcsx2/Threading.h @@ -67,8 +67,7 @@ namespace Threading void Unlock(); }; - // Returns the number of available logical CPUs (cores plus - // hyperthreaded cpus) + // Returns the number of available logical CPUs (cores plus hyperthreaded cpus) extern void CountLogicalCores( int LogicalCoresPerPhysicalCPU, int PhysicalCoresPerPhysicalCPU ); // Releases a timeslice to other threads. @@ -80,6 +79,24 @@ namespace Threading // sleeps the current thread for the given number of milliseconds. extern void Sleep( int ms ); + ////////////////////////////////////////////////////////////////////////////////////////// + // Thread - Helper class for the basics of starting/managing simple threads. + // + // Use this as a base class for your threaded procedure, and implement the 'int Callback()' + // method. Use Start() and Close() to start and shutdown the thread, and use m_post_event + // internally to post/receive events for the thread (make a public accessor for it in your + // derived class if your thread utilizes the post). + // + // Notes: + // * To ensure thread safety against C++'s bizarre and not-thread-friendly object + // constructors and destructors, you *must* use Start() and Close(). There is a built- + // in Close() called on destruction, which should work for very simple threads (that + // do not have any special shutdown code of their own), but + // + // * Constructing threads as static vars isn't recommended since it can potentially con- + // fuse w32pthreads, if the static initializers are executed out-of-order (C++ offers + // no dependency options for ensuring correct static var initializations). + // class Thread : NoncopyableObject { protected: @@ -106,12 +123,36 @@ namespace Threading // on linux). static void* _internal_callback( void* func ); - // Implemented by derrived class to handle threading actions! + // Implemented by derived class to handle threading actions! virtual int Callback()=0; }; - // Our fundamental interlocking functions. All other useful interlocks can - // be derrived from these little beasties! + ////////////////////////////////////////////////////////////////////////////////////////// + // ScopedLock: Helper class for using Mutexes. + // Using this class provides an exception-safe (and generally clean) method of locking + // code inside a mutex. + class ScopedLock : NoncopyableObject + { + protected: + MutexLock& m_lock; + + public: + virtual ~ScopedLock() + { + m_lock.Unlock(); + } + + ScopedLock( MutexLock& locker ) : + m_lock( locker ) + { + m_lock.Lock(); + } + }; + + + ////////////////////////////////////////////////////////////////////////////////////////// + // Our fundamental interlocking functions. All other useful interlocks can be derived + // from these little beasties! extern long pcsx2_InterlockedExchange(volatile long* Target, long srcval); extern long pcsx2_InterlockedCompareExchange( volatile long* target, long srcval, long comp ); diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index ce25ff64eb..a88aca38bb 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -106,7 +106,7 @@ UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" - WholeProgramOptimization="1" + WholeProgramOptimization="0" > Date: Mon, 16 Mar 2009 22:17:50 +0000 Subject: [PATCH 58/77] LilyPad: fix0red the save state reload crash (memset overflow randomly null'ed the global dm variable and other things). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@799 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSDrawScanlineCodeGenerator.cpp | 16 +-- plugins/GSdx/GSRasterizer.cpp | 104 ++++++++++--------- plugins/GSdx/GSState.cpp | 2 + plugins/LilyPad/LilyPad.cpp | 2 +- 4 files changed, 64 insertions(+), 60 deletions(-) diff --git a/plugins/GSdx/GSDrawScanlineCodeGenerator.cpp b/plugins/GSdx/GSDrawScanlineCodeGenerator.cpp index c08aaaaa10..5b0c12411c 100644 --- a/plugins/GSdx/GSDrawScanlineCodeGenerator.cpp +++ b/plugins/GSdx/GSDrawScanlineCodeGenerator.cpp @@ -373,22 +373,22 @@ void GSDrawScanlineCodeGenerator::Init(int params) if(m_sel.fb) { - if(m_sel.edge) + if(m_sel.edge || m_sel.tfx != TFX_NONE) { movaps(xmm4, xmmword[ebx + 32]); // v.t + } - cvttps2dq(xmm4, xmm4); + if(m_sel.edge) + { + pshufhw(xmm3, xmm4, _MM_SHUFFLE(2, 2, 2, 2)); + pshufd(xmm3, xmm3, _MM_SHUFFLE(3, 3, 3, 3)); + psrlw(xmm3, 9); - pshufhw(xmm4, xmm4, _MM_SHUFFLE(2, 2, 2, 2)); - pshufd(xmm4, xmm4, _MM_SHUFFLE(3, 3, 3, 3)); - - movdqa(xmmword[&m_env.temp.cov], xmm4); + movdqa(xmmword[&m_env.temp.cov], xmm3); } if(m_sel.tfx != TFX_NONE) { - movaps(xmm4, xmmword[ebx + 32]); // v.t - if(m_sel.fst) { // GSVector4i vti(vt); diff --git a/plugins/GSdx/GSRasterizer.cpp b/plugins/GSdx/GSRasterizer.cpp index 1dcea7f61c..6b0b0a61ee 100644 --- a/plugins/GSdx/GSRasterizer.cpp +++ b/plugins/GSdx/GSRasterizer.cpp @@ -478,6 +478,8 @@ void GSRasterizer::DrawTriangleSection(int top, int bottom, GSVertexSW& l, const GSVertexSW scan = l + dscan * (lrmax - l.p).xxxx(); + ASSERT(m_dsf.ssl); + m_dsf.ssl(right, left, top, scan); } } @@ -519,6 +521,8 @@ void GSRasterizer::DrawTriangleSection(int top, int bottom, GSVertexSW& l, const GSVertexSW scan = l + dscan * (lrmax - l.p).xxxx(); + ASSERT(m_dsf.ssl); + m_dsf.ssl(right, left, top, scan); } } @@ -667,28 +671,29 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS edge += dedge * (tbmax.wwww() - edge.p.yyyy()); } + GSVector4i p = GSVector4i(edge.p.upl(dedge.p) * 0x10000); + + int x = p.extract32<0>(); + int dx = p.extract32<1>(); + if(side) { while(1) { do { - if((top % m_threads) == m_id) + int xi = x >> 16; + int xf = x & 0xffff; + + if(scissor.x <= xi && xi < scissor.z && (xi % m_threads) == m_id) { - GSVector4 p = edge.p.ceil(); - - if(((fscissor.xxxx() < p) & (p <= fscissor.zzzz())).mask() & 1) - { - GSVector4 coverage = (p - edge.p).xxxx(); + m_stats.pixels++; - edge.t = edge.t.xyxy(edge.t.uph(coverage * 0x80)); // coverage => t.w + edge.t.u32[3] = (0x10000 - xf) & 0xffff; - int x = GSVector4i(p).extract32<0>() - 1; - - m_stats.pixels++; - - m_dsf.ssle(x + 1, x, top, edge); - } + m_dsf.ssle(xi + 1, xi, top, edge); + + edge.t.u32[3] = 0; } } while(0); @@ -696,6 +701,7 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS if(++top >= bottom) break; edge += dedge; + x += dx; } } else @@ -704,22 +710,18 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS { do { - if((top % m_threads) == m_id) + int xi = (x >> 16) + 1; + int xf = x & 0xffff; + + if(scissor.x <= xi && xi < scissor.z && (xi % m_threads) == m_id) { - GSVector4 p = edge.p.floor(); - - if(((fscissor.xxxx() <= p) & (p < fscissor.zzzz())).mask() & 1) - { - GSVector4 coverage = (edge.p - p).xxxx(); + m_stats.pixels++; - edge.t = edge.t.xyxy(edge.t.uph(coverage * 0x80)); // coverage => t.w + edge.t.u32[3] = xf; - int x = GSVector4i(p).extract32<0>() + 1; + m_dsf.ssle(xi + 1, xi, top, edge); - m_stats.pixels++; - - m_dsf.ssle(x + 1, x, top, edge); - } + edge.t.u32[3] = 0; } } while(0); @@ -727,6 +729,7 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS if(++top >= bottom) break; edge += dedge; + x += dx; } } } @@ -766,28 +769,29 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS edge += dedge * (lrmax.yyyy() - edge.p.xxxx()); } + GSVector4i p = GSVector4i(edge.p.upl(dedge.p) * 0x10000); + + int y = p.extract32<2>(); + int dy = p.extract32<3>(); + if(side) { while(1) { do { - GSVector4 p = edge.p.ceil(); - - if(((fscissor.yyyy() < p) & (p <= fscissor.wwww())).mask() & 2) + int yi = y >> 16; + int yf = y & 0xffff; + + if(scissor.y <= yi && yi < scissor.w && (yi % m_threads) == m_id) { - int y = GSVector4i(p).extract32<1>() - 1; + m_stats.pixels++; - if((y % m_threads) == m_id) - { - GSVector4 coverage = (p - edge.p).yyyy(); + edge.t.u32[3] = (0x10000 - yf) & 0xffff; - edge.t = edge.t.xyxy(edge.t.uph(coverage * 0x80)); // coverage => t.w - - m_stats.pixels++; - - m_dsf.ssle(left + 1, left, y, edge); - } + m_dsf.ssle(left + 1, left, yi, edge); + + edge.t.u32[3] = 0; } } while(0); @@ -795,6 +799,7 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS if(++left >= right) break; edge += dedge; + y += dy; } } else @@ -803,22 +808,18 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS { do { - GSVector4 p = edge.p.floor(); - - if(((fscissor.yyyy() <= p) & (p < fscissor.wwww())).mask() & 2) + int yi = (y >> 16) + 1; + int yf = y & 0xffff; + + if(scissor.y <= yi && yi < scissor.w && (yi % m_threads) == m_id) { - int y = GSVector4i(p).extract32<1>() + 1; + m_stats.pixels++; - if((y % m_threads) == m_id) - { - GSVector4 coverage = (edge.p - p).yyyy(); + edge.t.u32[3] = yf; - edge.t = edge.t.xyxy(edge.t.uph(coverage * 0x80)); // coverage => t.w - - m_stats.pixels++; - - m_dsf.ssle(left + 1, left, y, edge); - } + m_dsf.ssle(left + 1, left, yi, edge); + + edge.t.u32[3] = 0; } } while(0); @@ -826,6 +827,7 @@ void GSRasterizer::DrawEdge(const GSVertexSW& v0, const GSVertexSW& v1, const GS if(++left >= right) break; edge += dedge; + y += dy; } } } diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 3920f19301..e3f98cb122 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -107,6 +107,8 @@ GSState::GSState(BYTE* base, bool mt, void (*irq)(), int nloophack) BUSDIR = (GSRegBUSDIR*)(base + GS_BUSDIR); SIGLBLID = (GSRegSIGLBLID*)(base + GS_SIGLBLID); + memset(PMODE, 0, 0x1100); + PRIM = &m_env.PRIM; // CSR->rREV = 0x20; m_env.PRMODECONT.AC = 1; diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 70f628b172..3fc6ad00f0 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -568,7 +568,7 @@ inline void ResetVibrate(int port, int slot) { } void ResetPad(int port, int slot) { - memset(&pads[port][slot], 0, sizeof(pads[0])); + memset(&pads[port][slot], 0, sizeof(pads[0][0])); pads[port][slot].mode = MODE_DIGITAL; pads[port][slot].umask[0] = pads[port][slot].umask[1] = 0xFF; ResetVibrate(port, slot); From c2e35368183680aab08629c5376630f82ea5ca96 Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Tue, 17 Mar 2009 00:57:59 +0000 Subject: [PATCH 59/77] Emitter: encode negative 8 bit immediates for some instructions and EAX forms for MOV git-svn-id: http://pcsx2.googlecode.com/svn/trunk@800 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/ix86/ix86.inl | 82 ++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/pcsx2/x86/ix86/ix86.inl b/pcsx2/x86/ix86/ix86.inl index 15068f4823..606eaed417 100644 --- a/pcsx2/x86/ix86/ix86.inl +++ b/pcsx2/x86/ix86/ix86.inl @@ -41,7 +41,7 @@ emitterT void WriteRmOffset(x86IntRegType to, s32 offset) ModRM( 0, 0, 4 ); SibSB( 0, ESP, 4 ); } - else if( offset < 128 && offset >= -128 ) { + else if( offset <= 127 && offset >= -128 ) { ModRM( 1, 0, 4 ); SibSB( 0, ESP, 4 ); write8(offset); @@ -56,7 +56,7 @@ emitterT void WriteRmOffset(x86IntRegType to, s32 offset) if( offset == 0 ) { ModRM( 0, 0, to ); } - else if( offset < 128 && offset >= -128 ) { + else if( offset <= 127 && offset >= -128 ) { ModRM( 1, 0, to ); write8(offset); } @@ -74,7 +74,7 @@ emitterT void WriteRmOffsetFrom(x86IntRegType to, x86IntRegType from, int offset ModRM( 0, to, 0x4 ); SibSB( 0, 0x4, 0x4 ); } - else if( offset < 128 && offset >= -128 ) { + else if( offset <= 127 && offset >= -128 ) { ModRM( 1, to, 0x4 ); SibSB( 0, 0x4, 0x4 ); write8(offset); @@ -89,7 +89,7 @@ emitterT void WriteRmOffsetFrom(x86IntRegType to, x86IntRegType from, int offset if( offset == 0 ) { ModRM( 0, to, from ); } - else if( offset < 128 && offset >= -128 ) { + else if( offset <= 127 && offset >= -128 ) { ModRM( 1, to, from ); write8(offset); } @@ -401,8 +401,12 @@ emitterT void eMOV32RtoR( x86IntRegType to, x86IntRegType from ) emitterT void eMOV32RtoM( uptr to, x86IntRegType from ) { RexR(0, from); - write8( 0x89 ); - ModRM( 0, from, DISP32 ); + if (from == EAX) { + write8(0xA3); + } else { + write8( 0x89 ); + ModRM( 0, from, DISP32 ); + } write32( MEMADDR(to, 4) ); } @@ -410,8 +414,12 @@ emitterT void eMOV32RtoM( uptr to, x86IntRegType from ) emitterT void eMOV32MtoR( x86IntRegType to, uptr from ) { RexR(0, to); - write8( 0x8B ); - ModRM( 0, to, DISP32 ); + if (to == EAX) { + write8(0xA1); + } else { + write8( 0x8B ); + ModRM( 0, to, DISP32 ); + } write32( MEMADDR(from, 4) ); } @@ -1038,69 +1046,69 @@ emitterT void eADD64RtoR( x86IntRegType to, x86IntRegType from ) } /* add imm32 to EAX */ -emitterT void eADD32ItoEAX( u32 from ) +emitterT void eADD32ItoEAX( s32 imm ) { write8( 0x05 ); - write32( from ); + write32( imm ); } /* add imm32 to r32 */ -emitterT void eADD32ItoR( x86IntRegType to, u32 from ) +emitterT void eADD32ItoR( x86IntRegType to, s32 imm ) { RexB(0, to); - if(from < 0x80) + if (imm <= 127 && imm >= -128) { write8( 0x83 ); ModRM( 3, 0, to ); - write8( from ); + write8( (s8)imm ); } else { if ( to == EAX ) { - eADD32ItoEAX(from); + eADD32ItoEAX(imm); } else { write8( 0x81 ); ModRM( 3, 0, to ); - write32( from ); + write32( imm ); } } } /* add imm32 to m32 */ -emitterT void eADD32ItoM( uptr to, u32 from ) +emitterT void eADD32ItoM( uptr to, s32 imm ) { - /*if(from < 0x80) // crashes games in 64bit build; TODO: figure out why. + if(imm <= 127 && imm >= -128) { write8( 0x83 ); ModRM( 0, 0, DISP32 ); write32( MEMADDR(to, 8) ); - write8( from ); - } - else*/ + write8( imm ); + } + else { write8( 0x81 ); ModRM( 0, 0, DISP32 ); write32( MEMADDR(to, 8) ); - write32( from ); + write32( imm ); } } // add imm32 to [r32+off] -emitterT void eADD32ItoRmOffset( x86IntRegType to, u32 from, s32 offset) +emitterT void eADD32ItoRmOffset( x86IntRegType to, s32 imm, s32 offset) { RexB(0,to); - if(from < 0x80) + if(imm <= 127 && imm >= -128) { write8( 0x83 ); WriteRmOffset(to,offset); - write8(from); + write8(imm); } else { write8( 0x81 ); WriteRmOffset(to,offset); - write32(from); + write32(imm); } } @@ -1140,7 +1148,7 @@ emitterT void eADD16RtoR( x86IntRegType to , x86IntRegType from ) } /* add imm16 to r16 */ -emitterT void eADD16ItoR( x86IntRegType to, u16 from ) +emitterT void eADD16ItoR( x86IntRegType to, s16 imm ) { write8( 0x66 ); RexB(0,to); @@ -1148,39 +1156,39 @@ emitterT void eADD16ItoR( x86IntRegType to, u16 from ) if ( to == EAX) { write8( 0x05 ); - write16( from ); + write16( imm ); } - else if(from < 0x80) + else if(imm <= 127 && imm >= -128) { write8( 0x83 ); ModRM( 3, 0, to ); - write8((u8)from ); + write8((u8)imm ); } else { write8( 0x81 ); ModRM( 3, 0, to ); - write16( from ); + write16( imm ); } } /* add imm16 to m16 */ -emitterT void eADD16ItoM( uptr to, u16 from ) +emitterT void eADD16ItoM( uptr to, s16 imm ) { write8( 0x66 ); - if(from < 0x80) + if(imm <= 127 && imm >= -128) { write8( 0x83 ); ModRM( 0, 0, DISP32 ); write32( MEMADDR(to, 6) ); - write8((u8)from ); + write8((u8)imm ); } else { write8( 0x81 ); ModRM( 0, 0, DISP32 ); write32( MEMADDR(to, 6) ); - write16( from ); + write16( imm ); } } @@ -3250,7 +3258,7 @@ emitterT void eLEA16RtoR(x86IntRegType to, x86IntRegType from, u16 offset) eLEA32RtoR(to, from, offset); } -emitterT void eLEA32RtoR(x86IntRegType to, x86IntRegType from, u32 offset) +emitterT void eLEA32RtoR(x86IntRegType to, x86IntRegType from, s32 offset) { RexRB(0,to,from); write8(0x8d); @@ -3260,7 +3268,7 @@ emitterT void eLEA32RtoR(x86IntRegType to, x86IntRegType from, u32 offset) ModRM(1, to, from); write8(0x24); } - else if( offset < 128 ) { + else if( offset <= 127 && offset >= -128 ) { ModRM(1, to, from); write8(0x24); write8(offset); @@ -3275,7 +3283,7 @@ emitterT void eLEA32RtoR(x86IntRegType to, x86IntRegType from, u32 offset) if( offset == 0 && from != EBP && from!=ESP ) { ModRM(0, to, from); } - else if( offset < 128 ) { + else if( offset <= 127 && offset >= -128 ) { ModRM(1, to, from); write8(offset); } From 2c0f8fe41eabb48244f6a32c17bbe7599ec10db3 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Tue, 17 Mar 2009 03:34:26 +0000 Subject: [PATCH 60/77] more W.I.P. stuff.. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@801 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU.cpp | 4 +- pcsx2/x86/microVU.h | 27 ++++++++---- pcsx2/x86/microVU_Compile.inl | 80 ++++++++++++++++++++++++++--------- pcsx2/x86/microVU_Lower.inl | 42 ++++++++---------- pcsx2/x86/microVU_Misc.h | 68 ++++++++++++++++++++--------- 5 files changed, 146 insertions(+), 75 deletions(-) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index 396bb81471..935a197a21 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -142,8 +142,8 @@ microVUt(void*) __fastcall mVUexecute(u32 startPC, u32 cycles) { */ microVU* mVU = mVUx; if ( mVUsearchProg(mVU) ) { // Found Program - microBlock* block = mVU->prog.prog[mVU->prog.cur].block[startPC]->search(mVU->prog.lastPipelineState); - if (block) return block->x86ptrStart; // Found Block + //microBlock* block = mVU->prog.prog[mVU->prog.cur].block[startPC]->search(mVU->prog.lastPipelineState); + //if (block) return block->x86ptrStart; // Found Block } // Recompile code return NULL; diff --git a/pcsx2/x86/microVU.h b/pcsx2/x86/microVU.h index 370b7ef852..f7490dc334 100644 --- a/pcsx2/x86/microVU.h +++ b/pcsx2/x86/microVU.h @@ -17,6 +17,7 @@ */ #pragma once +#define mVUdebug // Prints Extra Info to Console #define _EmitterId_ (vuIndex+1) #include "Common.h" #include "VU.h" @@ -25,10 +26,11 @@ #include "microVU_Alloc.h" struct microBlock { - u32 pipelineState; // FMACx|y|z|w | FDiv | EFU | IALU | BRANCH // Still thinking of how I'm going to do this - u8* x86ptrStart; - u8* x86ptrEnd; - u8* x86ptrBranch; + microRegInfo pState; // Detailed State of Pipeline + u32 pipelineState; // | FDiv x 4 | EFU x 6 | Needs pState Info? x 1 | // Simple State of Pipeline + u8* x86ptrStart; // Start of code + u8* x86ptrEnd; // End of code (first byte outside of block) + u8* x86ptrBranch; // //u32 size; }; @@ -54,17 +56,24 @@ public: } void reset() { init(); }; void close() {}; // Can be Omitted? - void add(u32 pipelineState, u8* x86ptrStart) { + /*void add(u32 pipelineState, u8* x86ptrStart) { if (!search(pipelineState)) { listSize++; listSize &= MaxBlocks; blockList[listSize].pipelineState = pipelineState; blockList[listSize].x86ptrStart = x86ptrStart; } - } - microBlock* search(u32 pipelineState) { - for (int i = 0; i < listSize; i++) { - if (blockList[i].pipelineState == pipelineState) return &blockList[i]; + }*/ + microBlock* search(u32 pipelineState, microRegInfo* pState) { + if (pipelineState & 1) { // Needs Detailed Search (Exact Match of Pipeline State) + for (int i = 0; i < listSize; i++) { + if (!memcmp(pState, &blockList[i].pState, sizeof(microRegInfo))) return &blockList[i]; + } + } + else { // Can do Simple Search (Only Matches the Important Pipeline Stuff) + for (int i = 0; i < listSize; i++) { + if (blockList[i].pipelineState == pipelineState) return &blockList[i]; + } } return NULL; } diff --git a/pcsx2/x86/microVU_Compile.inl b/pcsx2/x86/microVU_Compile.inl index be372ee45f..0574d9faa3 100644 --- a/pcsx2/x86/microVU_Compile.inl +++ b/pcsx2/x86/microVU_Compile.inl @@ -19,35 +19,77 @@ #pragma once #ifdef PCSX2_MICROVU -#define mVUbranch mVUallocInfo.branch -#define iPC mVUcurProg.curPC +#ifdef mVUdebug +#define mVUdebugStuff1() { \ + if (curI & _Ibit_) { SysPrintf("microVU: I-bit set!\n"); } \ + if (curI & _Ebit_) { SysPrintf("microVU: E-bit set!\n"); } \ + if (curI & _Mbit_) { SysPrintf("microVU: M-bit set!\n"); } \ + if (curI & _Dbit_) { SysPrintf("microVU: D-bit set!\n"); } \ + if (curI & _Tbit_) { SysPrintf("microVU: T-bit set!\n"); } \ +} +#else +#define mVUdebugStuff1() {} +#endif + #define curI mVUcurProg.data[iPC] #define setCode() { mVU->code = curI; } -#define incPC() { iPC = ((iPC + 1) & (mVU->progSize-1)); setCode();} +#define incPC(x) { iPC = ((iPC + x) & (mVU->progSize-1)); setCode(); } -microVUx(void) mVUcompile(u32 startPC, u32 pipelineState, u8* x86ptrStart) { +#define createBlock(blockEndPtr) { \ + block.pipelineState = pipelineState; \ + block.x86ptrStart = x86ptrStart; \ + block.x86ptrEnd = blockEndPtr; \ + /*block.x86ptrBranch;*/ \ + if (!(pipelineState & 1)) { \ + memcpy_fast(&block.pState, pState, sizeof(microRegInfo)); \ + } \ +} + +microVUx(void) mVUcompile(u32 startPC, u32 pipelineState, microRegInfo* pState, u8* x86ptrStart) { microVU* mVU = mVUx; - int x; - iPC = startPC; + microBlock block; + iPC = startPC / 4; + + // Searches for Existing Compiled Block (if found, then returns; else, compile) + microBlock* pblock = mVUblock[iPC]->search(pipelineState, pState); + if (block) { x86SetPtr(pblock->x86ptrEnd); return; } + + // First Pass setCode(); - for (x = 0; ; x++) { - if (curI & _Ibit_) { SysPrintf("microVU: I-bit set!\n"); } - if (curI & _Ebit_) { SysPrintf("microVU: E-bit set!\n"); } - if (curI & _Mbit_) { SysPrintf("microVU: M-bit set!\n"); } - if (curI & _Dbit_) { SysPrintf("microVU: D-bit set!\n"); mVUbranch = 4; } - if (curI & _Tbit_) { SysPrintf("microVU: T-bit set!\n"); mVUbranch = 4; } + for (;;) { + mVUdebugStuff1(); mVUopU(); - incPC(); - mVUopL(); - if (mVUbranch == 4) { mVUbranch = 0; break; } - else if (mVUbranch) { mVUbranch = 4; } + if (curI & _Ebit_) { mVUbranch = 5; } + if (curI & _MDTbit_) { mVUbranch = 4; } + if (curI & _Ibit_) { incPC(1); mVUinfo |= _isNOP; } + else { incPC(1); mVUopL(); } + if (mVUbranch == 4) { mVUbranch = 0; mVUinfo |= _isEOB; break; } + else if (mVUbranch == 5) { mVUbranch = 4; } + else if (mVUbranch) { mVUbranch = 4; mVUinfo |= _isBranch; } + incPC(1); } + + // Second Pass iPC = startPC; setCode(); - for (int i = 0; i < x; i++) { + for (bool x = 1; x==1; ) { + if (isEOB) { x = 0; } + else if (isBranch) { mVUopU(); incPC(2); } + mVUopU(); - incPC(); - if (!isNop) mVUopL(); + if (isNop) { incPC(1); } + else { incPC(1); mVUopL(); } + if (!isBdelay) { incPC(1); } + else { + incPC(-2); // Go back to Branch Opcode + mVUopL(); // Run Branch Opcode + switch (mVUbranch) { + case 1: break; + case 2: break; + case 3: break; + } + break; + } } } diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 69d9b20098..ff391179f5 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -394,10 +394,10 @@ microVUf(void) mVU_FCAND() { microVU* mVU = mVUx; if (recPass == 0) {} else { - mVUallocCFLAGa(gprT2, fvcInstance); - XOR32RtoR(gprT1, gprT1); - AND32ItoR(gprT2, _Imm24_); - SETNZ8R(gprT1); + mVUallocCFLAGa(gprT1, fvcInstance); + AND32ItoR(gprT1, _Imm24_); + ADD32ItoR(gprT1, 0xffffff); + SHR32ItoR(gprT1, 24); mVUallocVIb(gprT1, 1); } } @@ -948,53 +948,47 @@ microVUf(void) mVU_XGKICK() { microVUf(void) mVU_B() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 1; } - else {} + mVUbranch = 1; } microVUf(void) mVU_BAL() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 1; } - else {} + mVUbranch = 1; + if (recPass) { + MOV32ItoR(gprT1, (xPC + (2 * 8)) & 0xffff); + mVUallocVIb(gprT1, _Ft_); + } } microVUf(void) mVU_IBEQ() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 2; } - else {} + mVUbranch = 2; } microVUf(void) mVU_IBGEZ() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 2; } - else {} + mVUbranch = 2; } microVUf(void) mVU_IBGTZ() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 2; } - else {} + mVUbranch = 2; } microVUf(void) mVU_IBLTZ() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 2; } - else {} + mVUbranch = 2; } microVUf(void) mVU_IBLEZ() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 2; } - else {} + mVUbranch = 2; } microVUf(void) mVU_IBNE() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 2; } - else {} + mVUbranch = 2; } microVUf(void) mVU_JR() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 3; } - else {} + mVUbranch = 3; } microVUf(void) mVU_JALR() { microVU* mVU = mVUx; - if (recPass == 0) { mVUallocInfo.branch = 3; } - else {} + mVUbranch = 3; } #endif //PCSX2_MICROVU diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index 0828a34d97..2b76665365 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -88,6 +88,7 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define _Mbit_ (1<<29) #define _Dbit_ (1<<28) #define _Tbit_ (1<<27) +#define _MDTbit_ ( _Mbit_ | _Dbit_ | _Tbit_ ) #define getVUmem(x) (((vuIndex == 1) ? (x & 0x3ff) : ((x >= 0x400) ? (x & 0x43f) : (x & 0xff))) * 16) #define offsetSS ((_X) ? (0) : ((_Y) ? (4) : ((_Z) ? 8: 12))) @@ -127,29 +128,54 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define microVUq(aType) template __forceinline aType #define mVUcurProg mVU->prog.prog[mVU->prog.cur] +#define mVUblock mVU->prog.prog[mVU->prog.cur].block #define mVUallocInfo mVU->prog.prog[mVU->prog.cur].allocInfo +#define mVUbranch mVUallocInfo.branch +#define mVUinfo mVUallocInfo.info[mVUallocInfo.curPC / 2] +#define iPC mVUallocInfo.curPC +#define xPC ((iPC / 2) * 8) -#define isNOP (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<0)) -//#define writeACC ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<1)) >> 1) -//#define prevACC (((u8)((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<1)) >> 1) - 1) & 0x3) -//#define readACC ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<3)) >> 3) -#define writeQ ((mVUallocInfo.info[mVUallocInfo.curPC] & (1<<5)) >> 5) -#define readQ ((mVUallocInfo.info[mVUallocInfo.curPC] & (1<<6)) >> 6) -#define writeP ((mVUallocInfo.info[mVUallocInfo.curPC] & (1<<7)) >> 7) -#define readP ((mVUallocInfo.info[mVUallocInfo.curPC] & (1<<7)) >> 7) // same as write -#define doFlags (mVUallocInfo.info[mVUallocInfo.curPC] & (3<<8)) -#define doMac (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<8)) -#define doStatus (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<9)) -#define fmInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<10)) >> 10) -#define fsInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<12)) >> 12) -#define fcInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) -#define fpmInstance (((u8)((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<10)) >> 10) - 1) & 0x3) -#define fpsInstance (((u8)((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<12)) >> 12) - 1) & 0x3) -#define fvmInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<16)) >> 16) -#define fvsInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<18)) >> 18) -#define fvcInstance ((mVUallocInfo.info[mVUallocInfo.curPC] & (3<<14)) >> 14) -//#define getFs (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<13)) -//#define getFt (mVUallocInfo.info[mVUallocInfo.curPC] & (1<<14)) +#define _isNOP (1<<0) // Skip Lower Instruction +#define _isBranch (1<<1) // Cur Instruction is a Branch +#define _isEOB (1<<2) // End of Block +#define _isBdelay (1<<3) // Cur Instruction in Branch Delay slot +#define _writeQ (1<<5) +#define _readQ (1<<6) +#define _writeP (1<<7) +#define _readP (1<<7) +#define _doFlags (3<<8) +#define _doMac (1<<8) +#define _doStatus (1<<9) +#define _fmInstance (3<<10) +#define _fsInstance (3<<12) +#define _fcInstance (3<<14) +#define _fpmInstance (3<<10) +#define _fpsInstance (3<<12) +#define _fvmInstance (3<<16) +#define _fvsInstance (3<<18) +#define _fvcInstance (3<<14) + +#define isNOP (mVUinfo & (1<<0)) +#define isBranch (mVUinfo & (1<<1)) +#define isEOB (mVUinfo & (1<<2)) +#define isBdelay (mVUinfo & (1<<3)) +#define writeQ ((mVUinfo & (1<<5)) >> 5) +#define readQ ((mVUinfo & (1<<6)) >> 6) +#define writeP ((mVUinfo & (1<<7)) >> 7) +#define readP ((mVUinfo & (1<<7)) >> 7) // same as write +#define doFlags (mVUinfo & (3<<8)) +#define doMac (mVUinfo & (1<<8)) +#define doStatus (mVUinfo & (1<<9)) +#define fmInstance ((mVUinfo & (3<<10)) >> 10) +#define fsInstance ((mVUinfo & (3<<12)) >> 12) +#define fcInstance ((mVUinfo & (3<<14)) >> 14) +#define fpmInstance (((u8)((mVUinfo & (3<<10)) >> 10) - 1) & 0x3) +#define fpsInstance (((u8)((mVUinfo & (3<<12)) >> 12) - 1) & 0x3) +#define fvmInstance ((mVUinfo & (3<<16)) >> 16) +#define fvsInstance ((mVUinfo & (3<<18)) >> 18) +#define fvcInstance ((mVUinfo & (3<<14)) >> 14) +//#define getFs (mVUinfo & (1<<13)) +//#define getFt (mVUinfo & (1<<14)) #define isMMX(_VIreg_) (_VIreg_ >= 1 && _VIreg_ <=9) #define mmVI(_VIreg_) (_VIreg_ - 1) From e5f8c7dbe938b765c16cb9796acb34949307ba8d Mon Sep 17 00:00:00 2001 From: mattmenke Date: Tue, 17 Mar 2009 05:37:09 +0000 Subject: [PATCH 61/77] LilyPad: Minor GUI rearrangements and attempts to beautify. Relabeled "Hacks" that aren't really all that hackish. To be released as 0.9.11. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@802 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/LilyPad/Config.cpp | 54 ++++++++-------------------- plugins/LilyPad/Diagnostics.cpp | 19 +++++----- plugins/LilyPad/DirectInput.cpp | 7 ++-- plugins/LilyPad/InputManager.h | 6 ++-- plugins/LilyPad/LilyPad.cpp | 36 ++++++++++--------- plugins/LilyPad/LilyPad.rc | 64 ++++++++++++++++----------------- 6 files changed, 81 insertions(+), 105 deletions(-) diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index e968b206e9..3ba081f37f 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -122,18 +122,6 @@ void RefreshEnabledDevices(int updateDeviceList) { else dm->DisableDevice(i); } - - // Older code. Newer version is a bit uglier, but doesn't - // release devices that are enabled both before and afterwards. - // So a bit nicer, in theory. - /* - dm->DisableAllDevices(); - dm->EnableDevices(KEYBOARD, config.keyboardApi); - dm->EnableDevices(MOUSE, config.mouseApi); - if (config.gameApis.directInput) { - dm->EnableDevices(OTHER, DI); - } - //*/ } // Disables/enables devices as necessary. Also updates diagnostic list @@ -278,8 +266,8 @@ void SelChanged(int port, int slot) { LVITEMW item; item.iItem = index; item.mask = LVIF_TEXT; + item.pszText = temp[3]; for (j=0; j<3; j++) { - item.pszText = temp[3]; item.iSubItem = j; item.cchTextMax = sizeof(temp[0])/sizeof(temp[3][0]); if (!ListView_GetItem(hWndList, &item)) break; @@ -682,7 +670,7 @@ int SaveSettings(wchar_t *file=0) { } DeleteFileW(file); - WritePrivateProfileStringW(L"General Settings", L"Last Config Path", config.lastSaveConfigPath, ini); + WritePrivateProfileStringW(L"General Settings", L"Last Config Path", config.lastSaveConfigPath, ini); WritePrivateProfileStringW(L"General Settings", L"Last Config Name", config.lastSaveConfigFileName, ini); // Just check first, last, and all pad bindings. Should be more than enough. No real need to check @@ -1289,20 +1277,15 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l EndBinding(hWnd); UnselectAll(hWndList); int index = -1; - if (command == 0x7F) { - if (dev->api == IGNORE_KEYBOARD) { - index = BindCommand(dev, uid, 0, 0, command, BASE_SENSITIVITY, 0); - } + if (command == 0x7F && dev->api == IGNORE_KEYBOARD) { + index = BindCommand(dev, uid, 0, 0, command, BASE_SENSITIVITY, 0); } else if (command < 0x30) { - if (!(uid & UID_POV)) { - index = BindCommand(dev, uid, port, slot, command, BASE_SENSITIVITY, 0); - } + index = BindCommand(dev, uid, port, slot, command, BASE_SENSITIVITY, 0); } if (index >= 0) { PropSheet_Changed(hWndProp, hWnds[port][slot]); - if (index >= 0) - ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); + ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); } } } @@ -1332,6 +1315,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); return 1; } + break; } else if (n->hdr.idFrom == IDC_LIST) { static int NeedUpdate = 0; @@ -1355,11 +1339,9 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l NeedUpdate = 0; SelChanged(port, slot); } - EndBinding(hWnd); - } - else { - EndBinding(hWnd); } + // Stop binding when user does something else. + EndBinding(hWnd); } break; case WM_HSCROLL: @@ -1384,21 +1366,22 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l Binding *b; Device *dev; if (GetBinding(port, slot, index, dev, b, ffb)) { - int uid = dev->virtualControls[b->controlIndex].uid; const static unsigned int axisUIDs[3] = {UID_AXIS_NEG, UID_AXIS_POS, UID_AXIS}; + int uid = dev->virtualControls[b->controlIndex].uid; uid = (uid&0x00FFFFFF) | axisUIDs[cbsel]; Binding backup = *b; DeleteSelected(port, slot); int index = BindCommand(dev, uid, port, slot, backup.command, backup.sensitivity, backup.turbo); ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED); + PropSheet_Changed(hWndProp, hWnd); } } } } else if (HIWORD(wParam)==CBN_SELCHANGE && LOWORD(wParam) == IDC_FF_EFFECT) { - unsigned int typeIndex = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0); + int typeIndex = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0); if (typeIndex >= 0) - ChangeEffect(port, slot, 0, 0, &typeIndex); + ChangeEffect(port, slot, 0, 0, (unsigned int*)&typeIndex); } else if (HIWORD(wParam)==BN_CLICKED) { EndBinding(hWnd); @@ -1408,10 +1391,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l PropSheet_Changed(hWndProp, hWnd); } else if (cmd == ID_CLEAR) { - int changed=0; - while (DeleteByIndex(port, slot, 0)) changed++; - if (changed) - PropSheet_Changed(hWndProp, hWnd); + while (DeleteByIndex(port, slot, 0)) PropSheet_Changed(hWndProp, hWnd); } else if (cmd == ID_BIG_MOTOR || cmd == ID_SMALL_MOTOR) { int i = (int)SendMessage(GetDlgItem(hWnd, IDC_FORCEFEEDBACK), CB_GETCURSEL, 0, 0); @@ -1788,7 +1768,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L SetVolume(100); } - config.debug = (IsDlgButtonChecked(hWnd, IDC_DEBUG_FILE) == BST_CHECKED); config.multipleBinding = (IsDlgButtonChecked(hWnd, IDC_MULTIPLE_BINDING) == BST_CHECKED); @@ -1821,10 +1800,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L UpdatePadList(hWnd); PropSheet_Changed(hWndProp, hWnd); - /* - if (needUpdate) { - UpdatePadPages(); - }//*/ } break; case WM_NOTIFY: @@ -1838,6 +1813,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L return 0; case PSN_SETACTIVE: //selected = 0; + UpdatePadList(hWnd); return 0; case PSN_APPLY: selected = 0; diff --git a/plugins/LilyPad/Diagnostics.cpp b/plugins/LilyPad/Diagnostics.cpp index 9efab71a60..07c2f3812a 100644 --- a/plugins/LilyPad/Diagnostics.cpp +++ b/plugins/LilyPad/Diagnostics.cpp @@ -8,12 +8,12 @@ Device *dev; -INT_PTR CALLBACK DiagDialog(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM lParam) { +INT_PTR CALLBACK DiagDialog(HWND hWnd, unsigned int uMsg, WPARAM wParam, LPARAM lParam) { int i; HWND hWndList = GetDlgItem(hWnd, IDC_LIST); static int fullRefresh; if (dev) { - switch (msg) { + switch (uMsg) { case WM_INITDIALOG: { fullRefresh = 1; @@ -91,16 +91,15 @@ INT_PTR CALLBACK DiagDialog(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l } break; case WM_NOTIFY: - if (1) { - PSHNOTIFY* n = (PSHNOTIFY*) lParam; - if (n->hdr.idFrom != IDC_LIST || n->hdr.code != LVN_KEYDOWN) break; - NMLVKEYDOWN *key = (NMLVKEYDOWN *) n; - if (key->wVKey != VK_ESCAPE) break; + { + NMLVKEYDOWN *n = (NMLVKEYDOWN *) lParam; + // Don't always get the notification when testing DirectInput non-keyboard devices. + // Don't get it (Or want it) when testing keyboards. + if (n->hdr.idFrom != IDC_LIST || n->hdr.code != LVN_KEYDOWN || n->wVKey != VK_ESCAPE) break; } - else { case WM_ACTIVATE: - if (wParam != WA_INACTIVE) break; - } + if (uMsg == WM_ACTIVATE && wParam != WA_INACTIVE) break; + break; case WM_CLOSE: KillTimer(hWnd, 1); dm->ReleaseInput(); diff --git a/plugins/LilyPad/DirectInput.cpp b/plugins/LilyPad/DirectInput.cpp index f66235e064..5f0f388154 100644 --- a/plugins/LilyPad/DirectInput.cpp +++ b/plugins/LilyPad/DirectInput.cpp @@ -9,10 +9,12 @@ #include "PS2Etypes.h" #include +// Aka htons, without the winsock dependency. inline static u16 flipShort(u16 s) { return (s>>8) | (s<<8); } +// Aka htonl, without the winsock dependency. inline static u32 flipLong(u32 l) { return (((u32)flipShort((u16)l))<<16) | flipShort((u16)(l>>16)); } @@ -158,12 +160,10 @@ public: } { - DIOBJECTDATAFORMAT *formats = (DIOBJECTDATAFORMAT*)malloc(sizeof(DIOBJECTDATAFORMAT) * numPhysicalControls); + DIOBJECTDATAFORMAT *formats = (DIOBJECTDATAFORMAT*)calloc(numPhysicalControls, sizeof(DIOBJECTDATAFORMAT)); for (i=0; iStop(); diEffects[i].die->Release(); - diEffects[i].die = 0; } } free(diEffects); diff --git a/plugins/LilyPad/InputManager.h b/plugins/LilyPad/InputManager.h index 97e7c95227..a5f0587e11 100644 --- a/plugins/LilyPad/InputManager.h +++ b/plugins/LilyPad/InputManager.h @@ -276,7 +276,6 @@ public: virtual void PostRead(); }; -// Don't need objects for devices with no bound controls. class InputDeviceManager { public: Device **devices; @@ -289,8 +288,8 @@ public: // All old bindings are copied to matching devices. // When old devices are missing, I do a slightly more careful search - // using id2s and create new dummy devices if no matches. - + // using productIDs and then (in desperation) displayName. + // Finally create new dummy devices if no matches found. void CopyBindings(int numDevices, Device **devices); @@ -300,6 +299,7 @@ public: void AddDevice(Device *d); Device *GetActiveDevice(void *info, unsigned int *uid, int *index, int *value); void Update(void *attachInfo); + // Called after reading state, after Update(). void PostRead(); diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 3fc6ad00f0..ad01d03fa7 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -3,6 +3,9 @@ #include #include +// For escape timer, so as not to break GSDX+DX9. +#include + #define PADdefs #include "PS2Etypes.h" #include "PS2Edefs.h" @@ -27,7 +30,7 @@ CRITICAL_SECTION readInputCriticalSection; HINSTANCE hInst; HWND hWnd; -// Used to toggle mouse binding. +// Used to toggle mouse listening. u8 miceEnabled; // 2 when both pads are initialized, 1 for one pad, etc. @@ -43,7 +46,6 @@ unsigned char inBuf[50]; #define MODE_ANALOG 0x73 #define MODE_DS2_NATIVE 0x79 - int IsWindowMaximized (HWND hWnd) { RECT rect; if (GetWindowRect(hWnd, &rect)) { @@ -108,8 +110,9 @@ struct ButtonSum { struct PadFreezeData { - // Digital / Analog / Full Analog (aka DS2 Native) + // Digital / Analog / DS2 Native u8 mode; + u8 modeLock; // In config mode @@ -125,8 +128,13 @@ public: int lockedState; + // Vibration indices. u8 vibrateI[2]; + + // Last vibration value. Only used so as not to call vibration + // functions when old and new values are both 0. u8 vibrateVal[2]; + // Used to keep track of which pads I'm running. // Note that initialized pads *can* be disabled. // I keep track of state of non-disabled non-initialized @@ -159,16 +167,12 @@ void UpdateEnabledDevices(int updateList = 0) { // Enable all devices I might want. Can ignore the rest. RefreshEnabledDevices(updateList); // Figure out which pads I'm getting input for. - int padsEnabled[2][4] = { - {pads[0][0].initialized && config.padConfigs[0][0].type != DisabledPad, - pads[0][1].initialized && config.padConfigs[0][1].type != DisabledPad, - pads[0][2].initialized && config.padConfigs[0][2].type != DisabledPad, - pads[0][3].initialized && config.padConfigs[0][3].type != DisabledPad}, - {pads[1][0].initialized && config.padConfigs[1][0].type != DisabledPad, - pads[1][1].initialized && config.padConfigs[1][1].type != DisabledPad, - pads[1][2].initialized && config.padConfigs[1][2].type != DisabledPad, - pads[1][3].initialized && config.padConfigs[1][3].type != DisabledPad} - }; + int padsEnabled[2][4]; + for (int port = 0; port<2; port++) { + for (int slot = 0; slot<4; slot++) { + padsEnabled[port][slot] = pads[port][slot].initialized && config.padConfigs[port][slot].type != DisabledPad; + } + } for (int i=0; inumDevices; i++) { Device *dev = dm->devices[i]; @@ -482,7 +486,6 @@ void Update(int pad) { pads[port][slot].lockedState = 0; } } - lockStateChanged[port][slot] = 0; } } for (i=0; i<8; i++) { @@ -510,7 +513,7 @@ u32 CALLBACK PS2EgetLibType(void) { return PS2E_LT_PAD; } -#define VERSION ((0<<8) | 9 | (10<<24)) +#define VERSION ((0<<8) | 9 | (11<<24)) u32 CALLBACK PS2EgetLibVersion2(u32 type) { ps2e = 1; @@ -851,7 +854,7 @@ u8 CALLBACK PADpoll(u8 value) { /* { query.numBytes = 35; - u8 test[35] = {0xFF, 0x80, 0x5A, + u8 test[35] = {0xFF, 0x80, 0x5A, 0x73, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x73, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x73, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80, @@ -1125,7 +1128,6 @@ void CALLBACK PADabout() { s32 CALLBACK PADtest() { return 0; } -#include DWORD WINAPI RenameWindowThreadProc(void *lpParameter) { wchar_t newTitle[200]; diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index 02e58ca82b..4f9d958551 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -74,7 +74,7 @@ BEGIN PUSHBUTTON "R2",ID_R2,372,73,45,15 PUSHBUTTON "L3",ID_L3,195,93,45,15 PUSHBUTTON "R3",ID_R3,371,93,46,15 - GROUPBOX "D-Pad",IDC_DPAD,251,44,110,68 + GROUPBOX "D-Pad",IDC_DPAD,251,44,110,70 PUSHBUTTON "Up",ID_DPAD_UP,285,55,35,15 PUSHBUTTON "Left",ID_DPAD_LEFT,267,74,35,15 PUSHBUTTON "Right",ID_DPAD_RIGHT,307,74,35,15 @@ -117,7 +117,7 @@ BEGIN EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING PUSHBUTTON "Test",ID_TEST,196,260,59,15 PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,59,15 - GROUPBOX "Binding Details",ID_SENSITIVITY,195,188,222,66 + GROUPBOX "Sensitivity",ID_SENSITIVITY,195,188,222,66 EDITTEXT IDC_AXIS_DEVICE1,203,202,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP COMBOBOX IDC_AXIS_DIRECTION,202,218,70,47,CBS_DROPDOWNLIST | WS_TABSTOP EDITTEXT IDC_AXIS_CONTROL1,203,240,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP @@ -128,7 +128,7 @@ BEGIN PUSHBUTTON "Lock Input",ID_LOCK,196,260,59,15 PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,59,15 PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,59,15 - GROUPBOX "New Force Feedback Effect",IDC_STATIC,262,260,155,51 + GROUPBOX "Add Force Feedback Effect",IDC_STATIC,262,260,155,51 COMBOBOX IDC_FORCEFEEDBACK,269,273,142,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Big Motor",ID_BIG_MOTOR,269,291,64,14 PUSHBUTTON "Small Motor",ID_SMALL_MOTOR,347,291,64,14 @@ -204,48 +204,48 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Input APIs",IDC_STATIC,7,6,410,131 GROUPBOX "Keyboard API",IDC_STATIC,16,16,192,61 - CONTROL "Windows messaging (Recommended)",IDC_KB_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,23,28,134,10 - CONTROL "Raw input (XP and later only)",IDC_KB_RAW,"Button",BS_AUTORADIOBUTTON,23,40,112,10 - CONTROL "DirectInput",IDC_KB_DI,"Button",BS_AUTORADIOBUTTON,23,52,112,10 + CONTROL "Windows messaging (Recommended)",IDC_KB_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,22,28,134,10 + CONTROL "Raw input (XP and later only)",IDC_KB_RAW,"Button",BS_AUTORADIOBUTTON,22,40,112,10 + CONTROL "DirectInput",IDC_KB_DI,"Button",BS_AUTORADIOBUTTON,22,52,112,10 CONTROL "Disable (Intended for use with other pad plugins)",IDC_KB_DISABLE, - "Button",BS_AUTORADIOBUTTON,23,64,175,10 + "Button",BS_AUTORADIOBUTTON,22,64,175,10 GROUPBOX "Game Device APIs",IDC_STATIC,16,81,191,49 - CONTROL "DirectInput",IDC_G_DI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,65,10 - CONTROL "XInput (Xbox 360 controllers only)",IDC_G_XI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,104,125,10 - CONTROL "Monitor when in background",IDC_BACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,116,106,10 + CONTROL "DirectInput",IDC_G_DI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,92,65,10 + CONTROL "XInput (Xbox 360 controllers only)",IDC_G_XI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,104,125,10 + CONTROL "Monitor when in background",IDC_BACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,116,106,10 GROUPBOX "Mouse API",IDC_STATIC,216,16,192,85 - CONTROL "Windows messaging (Recommended)",IDC_M_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,224,27,134,10 - CONTROL "Raw input (XP and later only)",IDC_M_RAW,"Button",BS_AUTORADIOBUTTON,224,39,112,10 - CONTROL "DirectInput",IDC_M_DI,"Button",BS_AUTORADIOBUTTON,224,51,112,10 - CONTROL "Disable",IDC_M_DISABLE,"Button",BS_AUTORADIOBUTTON,224,63,39,10 - CONTROL "Start without mouse focus",IDC_MOUSE_UNFOCUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,75,97,10 - CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,87,71,10 + CONTROL "Windows messaging (Recommended)",IDC_M_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,223,27,134,10 + CONTROL "Raw input (XP and later only)",IDC_M_RAW,"Button",BS_AUTORADIOBUTTON,223,39,112,10 + CONTROL "DirectInput",IDC_M_DI,"Button",BS_AUTORADIOBUTTON,223,51,112,10 + CONTROL "Disable",IDC_M_DISABLE,"Button",BS_AUTORADIOBUTTON,223,63,39,10 + CONTROL "Start without mouse focus",IDC_MOUSE_UNFOCUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,75,97,10 + CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,87,71,10 GROUPBOX "Advanced",IDC_STATIC,216,105,192,25 CONTROL "Allow binding multiple PS2 controls to one PC control",IDC_MULTIPLE_BINDING, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,116,182,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,116,182,10 GROUPBOX "Pads",IDC_STATIC,7,140,410,67 CONTROL "",IDC_PAD_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | WS_TABSTOP,17,152,183,48,WS_EX_CLIENTEDGE - COMBOBOX IDC_PAD_TYPE,211,153,140,41,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_PAD_TYPE,209,153,140,41,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP CONTROL "Use analog mode whenever possible",IDC_ANALOG_START1, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,211,172,132,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,172,132,10 GROUPBOX "Device Diagnostics",IDC_STATIC,7,211,201,99 CONTROL "",IDC_LIST,"SysListView32",LVS_LIST | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,15,224,185,61,WS_EX_CLIENTEDGE PUSHBUTTON "Test Device",ID_TEST,86,289,57,15 PUSHBUTTON "Refresh",ID_REFRESH,152,289,48,15 - GROUPBOX "Hacks",IDC_STATIC,216,211,201,73 - CONTROL "Send escape on window close",IDC_CLOSE_HACK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,223,113,10 - CONTROL "Exit emulator on window close",IDC_CLOSE_HACK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,235,112,10 - CONTROL "Disable screensaver",IDC_DISABLE_SCREENSAVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,247,80,10 + GROUPBOX "Miscellaneous",IDC_STATIC,216,211,201,35 + CONTROL "Use GS thread (Recommended)",IDC_GS_THREAD_INPUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,221,221,116,10 + CONTROL "Disable screensaver",IDC_DISABLE_SCREENSAVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,221,232,80,10 + CONTROL "Local volume control",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,221,77,10 + CONTROL "Enable logging",IDC_DEBUG_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,232,62,10 + GROUPBOX "Hacks",IDC_STATIC,216,247,201,45 + CONTROL "Send escape on window close",IDC_CLOSE_HACK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,257,113,10 + CONTROL "Exit emulator on window close",IDC_CLOSE_HACK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,268,112,10 CONTROL "Safe fullscreen exit on escape",IDC_ESCAPE_FULLSCREEN_HACK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,259,112,10 - CONTROL "Use GS thread (Recommended)",IDC_GS_THREAD_INPUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,271,116,10 - CONTROL "Save state # in title",IDC_SAVE_STATE_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,223,79,10 - CONTROL "Local volume control",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,235,77,10 - CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,76,10 - GROUPBOX "Debugging",IDC_STATIC,216,285,79,25 - CONTROL "Enable logging",IDC_DEBUG_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,296,63,10 - PUSHBUTTON "Load",ID_LOAD,313,295,48,15 - PUSHBUTTON "Save",ID_SAVE,369,295,48,15 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,279,112,10 + CONTROL "Save state # in title",IDC_SAVE_STATE_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,257,79,10 + CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,268,76,10 + PUSHBUTTON "Load Bindings",ID_LOAD,283,295,62,15 + PUSHBUTTON "Save Bindings",ID_SAVE,355,295,62,15 END IDD_ABOUT DIALOGEX 0, 0, 108, 66 From 698220744095ec96ddb5c21d92549c76457a4239 Mon Sep 17 00:00:00 2001 From: gabest11 Date: Tue, 17 Mar 2009 09:38:36 +0000 Subject: [PATCH 62/77] xpad: repaired broken keyboard event forwarding to pcsx2 git-svn-id: http://pcsx2.googlecode.com/svn/trunk@803 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/xpad/xpad.cpp | 49 +++++++++++++++++++++++++++++++------------ plugins/xpad/xpad.h | 31 +++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 13 deletions(-) diff --git a/plugins/xpad/xpad.cpp b/plugins/xpad/xpad.cpp index 0ae8d20f2b..1551c3dd0f 100644 --- a/plugins/xpad/xpad.cpp +++ b/plugins/xpad/xpad.cpp @@ -99,8 +99,6 @@ EXPORT_C_(UINT32) PSEgetLibVersion() EXPORT_C_(UINT32) PS2EgetLibType() { - s_ps2 = true; - return PS2E_LT_PAD; } @@ -111,6 +109,8 @@ EXPORT_C_(char*) PS2EgetLibName() EXPORT_C_(UINT32) PS2EgetLibVersion2(UINT32 type) { + s_ps2 = true; + return (s_ver.build << 0) | (s_ver.revision << 8) | (PS2E_PAD_VERSION << 16) | (s_ver.minor << 24); } @@ -553,7 +553,34 @@ public: static int s_nRefs = 0; static HWND s_hWnd = NULL; static WNDPROC s_GSWndProc = NULL; -static KeyEvent s_event = {0, 0}; + +static class CKeyEventList : protected CAtlList, protected CCritSec +{ +public: + void Push(UINT32 event, UINT32 key) + { + CAutoLock cAutoLock(this); + + KeyEvent e; + + e.event = event; + e.key = key; + + AddTail(e); + } + + bool Pop(KeyEvent& e) + { + CAutoLock cAutoLock(this); + + if(IsEmpty()) return false; + + e = RemoveHead(); + + return true; + } + +} s_event; LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -561,17 +588,14 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { case WM_KEYDOWN: if(lParam & 0x40000000) return TRUE; - s_event.event = KEYPRESS; - s_event.key = wParam; + s_event.Push(KEYPRESS, wParam); return TRUE; case WM_KEYUP: - s_event.event = KEYRELEASE; - s_event.key = wParam; + s_event.Push(KEYRELEASE, wParam); return TRUE; case WM_DESTROY: case WM_QUIT: - s_event.event = KEYPRESS; - s_event.key = VK_ESCAPE; + s_event.Push(KEYPRESS, VK_ESCAPE); break; } @@ -666,10 +690,9 @@ EXPORT_C_(UINT32) PADreadPort2(PadDataS* ppds) EXPORT_C_(KeyEvent*) PADkeyEvent() { - static KeyEvent event; - event = s_event; - s_event.event = 0; - return &event; + static KeyEvent e; + + return s_event.Pop(e) ? &e : NULL; } EXPORT_C PADconfigure() diff --git a/plugins/xpad/xpad.h b/plugins/xpad/xpad.h index 3d63676fcd..9afa410498 100644 --- a/plugins/xpad/xpad.h +++ b/plugins/xpad/xpad.h @@ -87,3 +87,34 @@ struct KeyEvent #define KEYPRESS 1 #define KEYRELEASE 2 + +// + +class CCritSec +{ + CCritSec(const CCritSec &refCritSec); + CCritSec &operator=(const CCritSec &refCritSec); + + CRITICAL_SECTION m_CritSec; + +public: + CCritSec() {InitializeCriticalSection(&m_CritSec);}; + ~CCritSec() {DeleteCriticalSection(&m_CritSec);}; + + void Lock() {EnterCriticalSection(&m_CritSec);}; + void Unlock() {LeaveCriticalSection(&m_CritSec);}; +}; + +class CAutoLock +{ + CAutoLock(const CAutoLock &refAutoLock); + CAutoLock &operator=(const CAutoLock &refAutoLock); + +protected: + CCritSec * m_pLock; + +public: + CAutoLock(CCritSec * plock) {m_pLock = plock; m_pLock->Lock();}; + ~CAutoLock() {m_pLock->Unlock();}; +}; + From 063703e28ae2eeedfebb55399c70958fd3a05da0 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 17 Mar 2009 14:48:13 +0000 Subject: [PATCH 63/77] Improved CDVD seek timing; should speed up some games that had abnorally long load times -- hopefully without breaking other games. (testing needed) Fixed a condition in the INTC hack that could cause it to hang in rare occasions. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@804 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVD.cpp | 89 ++++++++++++++++++++++++++++++++---------------- pcsx2/HwRead.cpp | 7 ++-- 2 files changed, 64 insertions(+), 32 deletions(-) diff --git a/pcsx2/CDVD.cpp b/pcsx2/CDVD.cpp index 9bcee55a05..79ab349afe 100644 --- a/pcsx2/CDVD.cpp +++ b/pcsx2/CDVD.cpp @@ -79,35 +79,53 @@ enum cdvdActions , cdvdAction_Read // note: not used yet. }; -////////////////////////////////////////////////////////////////////////// -// -- Cdvd Block Read Cycle Timings -- -// These timings are based on a median average block read speed. In theory the read -// speeds differ based on the location of the sector being read (outer rings have -// a different read speed from inner rings). But for our purposes an average is good -// enough, since all of Pcsx2's instruction cycle counting is hardly accurate anyway. +////////////////////////////////////////////////////////////////////////////////////////// +// Cdvd Block Read Cycle Timings +// +// The PS2 CDVD effectively has two seek modes -- the normal/slow one (est. avg seeks being +// around 120-160ms), and a faster seek which has an estimated seek time of about 35-40ms. +// Fast seeks happen when the destination sector is within a certain range of the starting +// point, such that abs(start-dest) is less than the value in the tbl_FastSeekDelta. +// +// CDVDs also have a secondary seeking method used when the destination is close enough +// that a contiguous sector read can reach the sector faster than initiating a full seek. +// Typically this value is very low. -// Morale of the story: don't get too caught up micro-managing your cycle timings. :) +enum CDVD_MODE_TYPE +{ + MODE_CDROM = 0, + MODE_DVDROM, +}; + +static const uint tbl_FastSeekDelta[3] = +{ + 4371, // CD-ROM + 14764, // Single-layer DVD-ROM + 13360 // dual-layer DVD-ROM [currently unused] +}; + +// if a seek is within this many blocks, read instead of seek. +// These values are arbitrary assumptions. Not sure what the real PS2 uses. +static const uint tbl_ContigiousSeekDelta[3] = +{ + 8, // CD-ROM + 16, // single-layer DVD-ROM + 16, // dual-layer DVD-ROM [currently unused] +}; // Note: DVD read times are modified to be faster, because games seem to be a lot more // concerned with accurate(ish) seek delays and less concerned with actual block read speeds. +// Translation: it's a minor speedhack :D static const uint PSX_CD_READSPEED = 153600; // 1 Byte Time @ x1 (150KB = cd x 1) static const uint PSX_DVD_READSPEED = 1382400 + 256000; // normal is 1 Byte Time @ x1 (1350KB = dvd x 1). -enum CDVD_MODE_TYPE -{ - MODE_DVDROM, - MODE_CDROM -}; - -// if a seek is within this many blocks, read instead of seek. -// I picked 9 as an arbitrary value. Not sure what the real PS2 uses. -static const int Cdvd_Contigious_Seek = 9; -//Note: This timing causes many games to load very slow, but it likely not the real problem. -//Games breaking with it set to PSXCLK*40 : "wrath unleashed" and "Shijou Saikyou no Deshi Kenichi". -static const uint Cdvd_Avg_SeekCycles = (PSXCLK*95) / 1000; // average number of cycles per seek (95ms) +// Legacy Note: FullSeek timing causes many games to load very slow, but it likely not the real problem. +// Games breaking with it set to PSXCLK*40 : "wrath unleashed" and "Shijou Saikyou no Deshi Kenichi". +static const uint Cdvd_FullSeek_Cycles = (PSXCLK*100) / 1000; // average number of cycles per fullseek (100ms) +static const uint Cdvd_FastSeek_Cycles = (PSXCLK*30) / 1000; // average number of cycles per fastseek (37ms) static const char *mg_zones[8] = {"Japan", "USA", "Europe", "Oceania", "Asia", "Russia", "China", "Mexico"}; @@ -941,8 +959,8 @@ __forceinline void cdvdActionInterrupt() } // inlined due to being referenced in only one place. -__forceinline void cdvdReadInterrupt() { - +__forceinline void cdvdReadInterrupt() +{ //SysPrintf("cdvdReadInterrupt %x %x %x %x %x\n", cpuRegs.interrupt, cdvd.Readed, cdvd.Reading, cdvd.nSectors, (HW_DMA3_BCR_H16 * HW_DMA3_BCR_L16) *4); cdvd.Ready = 0x00; @@ -1265,7 +1283,7 @@ u8 cdvdRead3A(void) { // DEC_SET // Returns the number of IOP cycles until the event completes. -static uint cdvdStartSeek( uint newsector ) +static uint cdvdStartSeek( uint newsector, CDVD_MODE_TYPE mode ) { cdvd.SeekToSector = newsector; @@ -1283,10 +1301,21 @@ static uint cdvdStartSeek( uint newsector ) seektime = PSXCLK / 3; // 333ms delay cdvd.Spinning = true; } - else if( (Cdvd_Contigious_Seek >= 0) && (delta >= Cdvd_Contigious_Seek) ) + else if( (tbl_ContigiousSeekDelta[mode] == 0) || (delta >= tbl_ContigiousSeekDelta[mode]) ) { - CDR_LOG( "CdSeek Begin > to sector %d, from %d - delta=%d\n", cdvd.SeekToSector, cdvd.Sector, delta ); - seektime = Cdvd_Avg_SeekCycles; + // Select either Full or Fast seek depending on delta: + + if( delta >= tbl_FastSeekDelta[mode] ) + { + // Full Seek + CDR_LOG( "CdSeek Begin > to sector %d, from %d - delta=%d [FULL]\n", cdvd.SeekToSector, cdvd.Sector, delta ); + seektime = Cdvd_FullSeek_Cycles; + } + else + { + CDR_LOG( "CdSeek Begin > to sector %d, from %d - delta=%d [FAST]\n", cdvd.SeekToSector, cdvd.Sector, delta ); + seektime = Cdvd_FastSeek_Cycles; + } } else { @@ -1332,7 +1361,7 @@ void cdvdWrite04(u8 rt) { // NCOMMAND DevCon::Notice( "CdStandby : %d", params rt ); cdvd.Action = cdvdAction_Standby; cdvd.ReadTime = cdvdBlockReadTime( MODE_DVDROM ); - CDVD_INT( cdvdStartSeek( 0 ) ); + CDVD_INT( cdvdStartSeek( 0, MODE_DVDROM ) ); break; case 0x03: // CdStop @@ -1349,7 +1378,7 @@ void cdvdWrite04(u8 rt) { // NCOMMAND case 0x05: // CdSeek cdvd.Action = cdvdAction_Seek; cdvd.ReadTime = cdvdBlockReadTime( MODE_DVDROM ); - CDVD_INT( cdvdStartSeek( *(uint*)(cdvd.Param+0) ) ); + CDVD_INT( cdvdStartSeek( *(uint*)(cdvd.Param+0), MODE_DVDROM ) ); break; case 0x06: // CdRead @@ -1372,7 +1401,7 @@ void cdvdWrite04(u8 rt) { // NCOMMAND params cdvd.Sector, cdvd.nSectors,cdvd.BlockSize,cdvd.Speed); cdvd.ReadTime = cdvdBlockReadTime( MODE_CDROM ); - CDVDREAD_INT( cdvdStartSeek( cdvd.SeekToSector ) ); + CDVDREAD_INT( cdvdStartSeek( cdvd.SeekToSector,MODE_CDROM ) ); // Read-ahead by telling the plugin about the track now. // This helps improve performance on actual from-cd emulation @@ -1413,7 +1442,7 @@ void cdvdWrite04(u8 rt) { // NCOMMAND params cdvd.Sector, cdvd.nSectors,cdvd.BlockSize,cdvd.Speed); cdvd.ReadTime = cdvdBlockReadTime( MODE_CDROM ); - CDVDREAD_INT( cdvdStartSeek( cdvd.SeekToSector ) ); + CDVDREAD_INT( cdvdStartSeek( cdvd.SeekToSector, MODE_CDROM ) ); // Read-ahead by telling the plugin about the track now. // This helps improve performance on actual from-cd emulation @@ -1444,7 +1473,7 @@ void cdvdWrite04(u8 rt) { // NCOMMAND params cdvd.Sector, cdvd.nSectors,cdvd.BlockSize,cdvd.Speed); cdvd.ReadTime = cdvdBlockReadTime( MODE_DVDROM ); - CDVDREAD_INT( cdvdStartSeek( cdvd.SeekToSector ) ); + CDVDREAD_INT( cdvdStartSeek( cdvd.SeekToSector, MODE_DVDROM ) ); // Read-ahead by telling the plugin about the track now. // This helps improve performance on actual from-cd emulation diff --git a/pcsx2/HwRead.cpp b/pcsx2/HwRead.cpp index a81de37137..87cfda6934 100644 --- a/pcsx2/HwRead.cpp +++ b/pcsx2/HwRead.cpp @@ -36,8 +36,11 @@ using namespace R5900; static __forceinline void IntCHackCheck() { - cpuRegs.cycle = g_nextBranchCycle; - + // Sanity check: To protect from accidentally "rewinding" the cyclecount + // on the few times nextBranchCycle can be behind our current cycle. + s32 diff = g_nextBranchCycle - cpuRegs.cycle; + if( diff > 0 ) cpuRegs.cycle = g_nextBranchCycle; + // Threshold method, might fix games that have problems with the simple // implementation above (none known that break yet) /*if( ( g_nextBranchCycle - cpuRegs.cycle ) > 500 ) From 6c13dcdb41363259e0513f3e16f29a075ff3380a Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 17 Mar 2009 18:15:02 +0000 Subject: [PATCH 64/77] Fixed a bug in the vtlb constprop support (stores weren't using the right macro). Reduced the BIOS rom warnings from gaudy red text and stars to simple yellow warnings (since they really don't matter). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@805 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Memory.cpp | 6 +----- pcsx2/x86/ix86-32/iR5900LoadStore.cpp | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pcsx2/Memory.cpp b/pcsx2/Memory.cpp index fdd52ffa84..2e02c84603 100644 --- a/pcsx2/Memory.cpp +++ b/pcsx2/Memory.cpp @@ -104,11 +104,7 @@ void loadBiosRom( const char *ext, u8 *dest, long maxSize ) Bios1 = Path::Combine( Config.BiosDir, ext ) + ".bin"; if( (filesize=Path::getFileSize( Bios1 ) ) <= 0 ) { - Console::Error( "\n\n\n" - "**************\n" - "%s NOT FOUND\n" - "**************\n\n\n", params ext - ); + Console::Notice( "Bios Warning > %s not found.", params ext ); return; } } diff --git a/pcsx2/x86/ix86-32/iR5900LoadStore.cpp b/pcsx2/x86/ix86-32/iR5900LoadStore.cpp index 01ffb2198b..21fb5df349 100644 --- a/pcsx2/x86/ix86-32/iR5900LoadStore.cpp +++ b/pcsx2/x86/ix86-32/iR5900LoadStore.cpp @@ -2092,7 +2092,7 @@ void recLoad64( u32 bits, bool sign ) else MOV32ItoR(EDX, (uptr)&dummyValue[0] ); - if( IS_EECONSTREG( _Rs_ ) ) + if( GPR_IS_CONST1( _Rs_ ) ) { u32 srcadr = g_cpuConstRegs[_Rs_].UL[0] + _Imm_; if( bits == 128 ) srcadr &= ~0x0f; @@ -2125,7 +2125,7 @@ void recLoad32(u32 bits,bool sign) // 8/16/32 bit modes return the loaded value in EAX. - if( IS_EECONSTREG( _Rs_ ) ) + if( GPR_IS_CONST1( _Rs_ ) ) { u32 srcadr = g_cpuConstRegs[_Rs_].UL[0] + _Imm_; vtlb_DynGenRead32_Const( bits, sign, srcadr ); From 43c0d895ad32cfb144ec4e964452b35721e5c5f9 Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Tue, 17 Mar 2009 20:07:17 +0000 Subject: [PATCH 65/77] Removed unnecessary rs flushes for loads and stores git-svn-id: http://pcsx2.googlecode.com/svn/trunk@807 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/ix86-32/iR5900LoadStore.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pcsx2/x86/ix86-32/iR5900LoadStore.cpp b/pcsx2/x86/ix86-32/iR5900LoadStore.cpp index 21fb5df349..e3e3664a5a 100644 --- a/pcsx2/x86/ix86-32/iR5900LoadStore.cpp +++ b/pcsx2/x86/ix86-32/iR5900LoadStore.cpp @@ -2077,13 +2077,6 @@ void recLoad64( u32 bits, bool sign ) //no int 3? i love to get my hands dirty ;p - Raz //write8(0xCC); - _deleteEEreg(_Rs_, 1); - _eeOnLoadWrite(_Rt_); - - EEINST_RESETSIGNEXT(_Rt_); // remove the sign extension - - _deleteEEreg(_Rt_, 0); - // Load EDX with the destination. // 64/128 bit modes load the result directly into the cpuRegs.GPR struct. @@ -2094,14 +2087,21 @@ void recLoad64( u32 bits, bool sign ) if( GPR_IS_CONST1( _Rs_ ) ) { + _eeOnLoadWrite(_Rt_); + EEINST_RESETSIGNEXT(_Rt_); // remove the sign extension + _deleteEEreg(_Rt_, 0); u32 srcadr = g_cpuConstRegs[_Rs_].UL[0] + _Imm_; if( bits == 128 ) srcadr &= ~0x0f; vtlb_DynGenRead64_Const( bits, srcadr ); } else { + _deleteEEreg(_Rs_, 1); // Load ECX with the source memory address that we're reading from. MOV32MtoR( ECX, (uptr)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ] ); + _eeOnLoadWrite(_Rt_); + EEINST_RESETSIGNEXT(_Rt_); // remove the sign extension + _deleteEEreg(_Rt_, 0); if ( _Imm_ != 0 ) ADD32ItoR( ECX, _Imm_ ); @@ -2119,21 +2119,23 @@ void recLoad32(u32 bits,bool sign) //no int 3? i love to get my hands dirty ;p - Raz //write8(0xCC); - _deleteEEreg(_Rs_, 1); - _eeOnLoadWrite(_Rt_); - _deleteEEreg(_Rt_, 0); - // 8/16/32 bit modes return the loaded value in EAX. if( GPR_IS_CONST1( _Rs_ ) ) { + _eeOnLoadWrite(_Rt_); + _deleteEEreg(_Rt_, 0); + u32 srcadr = g_cpuConstRegs[_Rs_].UL[0] + _Imm_; vtlb_DynGenRead32_Const( bits, sign, srcadr ); } else { + _deleteEEreg(_Rs_, 1); // Load ECX with the source memory address that we're reading from. MOV32MtoR( ECX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ] ); + _eeOnLoadWrite(_Rt_); + _deleteEEreg(_Rt_, 0); if ( _Imm_ != 0 ) ADD32ItoR( ECX, _Imm_ ); @@ -2463,7 +2465,6 @@ void recStore(u32 sz) //no int 3? i love to get my hands dirty ;p - Raz //write8(0xCC); - _deleteEEreg(_Rs_, 1); _deleteEEreg(_Rt_, 1); // Performance note: Const prop for the store address is good, always. @@ -2498,6 +2499,7 @@ void recStore(u32 sz) } else { + _deleteEEreg(_Rs_, 1); MOV32MtoR( ECX, (int)&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ] ); if ( _Imm_ != 0 ) ADD32ItoR(ECX, _Imm_); From fa3288971f2d855e72b903d41243e4f69cf0fa3d Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Tue, 17 Mar 2009 20:58:59 +0000 Subject: [PATCH 66/77] Save a few bytes on const flushing using 5 byte eax movs for 0 and -1 instead of 10 byte immediate movs. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@808 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/ix86-32/iCore-32.cpp | 64 +++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/pcsx2/x86/ix86-32/iCore-32.cpp b/pcsx2/x86/ix86-32/iCore-32.cpp index 2a8411d4cf..d3557228e0 100644 --- a/pcsx2/x86/ix86-32/iCore-32.cpp +++ b/pcsx2/x86/ix86-32/iCore-32.cpp @@ -139,17 +139,63 @@ void _flushConstReg(int reg) void _flushConstRegs() { - int i; + int i, j; + int zero_cnt = 0, minusone_cnt = 0; + int eaxval = 1; // 0, -1 + unsigned long done[4] = {0, 0, 0, 0}; + u8* rewindPtr; // flush constants + // flush 0 and -1 first // ignore r0 - for(i = 1; i < 32; ++i) { - if( g_cpuHasConstReg & (1< 0) + XOR32RtoR(EAX, EAX), eaxval = 0; +#else + if (eaxval > 0) + MOV32ItoR(EAX, -1), eaxval = -1; +#endif + if (eaxval == 0) + NOT32R(EAX), eaxval = -1; + MOV32RtoM((uptr)&cpuRegs.GPR.r[i].SL[j], EAX); + done[j + 2] |= 1< Date: Wed, 18 Mar 2009 06:39:55 +0000 Subject: [PATCH 67/77] Minor optimizations to vssprintf. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@809 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/vssprintf.cpp | 68 ++++++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/pcsx2/vssprintf.cpp b/pcsx2/vssprintf.cpp index 38c45bbcbc..234017f0e1 100644 --- a/pcsx2/vssprintf.cpp +++ b/pcsx2/vssprintf.cpp @@ -209,10 +209,21 @@ static void number(std::string& dest, T num, int base, int size, int precision, tmp[i++] = '0'; else { - while (num != 0) + if( base == 16 ) { - tmp[i++] = dig[num % (uint) base]; - num = num / (uint) base; + while (num != 0) + { + tmp[i++] = dig[num & 0xf]; + num = (uint)num >> 4; + } + } + else + { + while (num != 0) + { + tmp[i++] = dig[num % (uint) base]; + num /= (uint) base; + } } } @@ -232,10 +243,16 @@ static void number(std::string& dest, T num, int base, int size, int precision, } } - if (!(type & LEFT)) while (size-- > 0) dest += c; - while (i < precision--) dest += '0'; + + if( !(type & LEFT) && size > 0) { dest.append( size, c ); size = 0; } + if( i < precision ) dest.append( precision-i, '0' ); while (i-- > 0) dest += tmp[i]; - while (size-- > 0) dest += ' '; + if( size > 0 ) dest.append( size, ' ' ); + + //if (!(type & LEFT)) while (size-- > 0) dest += c; + //while (i < precision--) dest += '0'; + //while (i-- > 0) dest += tmp[i]; + //while (size-- > 0) dest += ' '; } static void eaddr( std::string& dest, unsigned char *addr, int size, int precision, int type) @@ -451,7 +468,7 @@ static void flt( std::string& dest, double num, int size, int precision, char fm { char tmp[80]; char c, sign; - int n, i; + int n; // Left align means no zero padding if (flags & LEFT) flags &= ~ZEROPAD; @@ -498,11 +515,12 @@ static void flt( std::string& dest, double num, int size, int precision, char fm // Output number with alignment and padding size -= n; - if (!(flags & (ZEROPAD | LEFT))) while (size-- > 0) dest += ' '; + + if (!(flags & (ZEROPAD | LEFT)) && size > 0) { dest.append( size, ' ' ); size = 0; } if (sign) dest += sign; - if (!(flags & LEFT)) while (size-- > 0) dest += c; - for (i = 0; i < n; i++) dest += tmp[i]; - while (size-- > 0) dest += ' '; + if (!(flags & LEFT) && size > 0) { dest.append( size, c ); size = 0; } + dest.append( tmp, n ); + if(size > 0) dest.append( size, ' ' ); } #endif @@ -520,11 +538,7 @@ void vssappendf(std::string& dest, const char* format, va_list args) int precision; // Min. # of digits for integers; max number of chars for from string int qualifier; // 'h', 'l', or 'L' for integer fields - // Optimization: Memory is cheap. Allocating it on the fly is not. Allocate more room - // than we'll likely need right upfront! - dest.reserve( strlen( format ) * 2 ); - - for( const char* fmt = format; *fmt; fmt++ ) + for( const char* fmt = format; *fmt; ++fmt ) { if (*fmt != '%') { @@ -607,16 +621,26 @@ repeat: if( precision < 0 ) { // no precision override so just copy the whole string. - if (!(flags & LEFT)) while (len < field_width--) dest += ' '; + if (!(flags & LEFT) && (len < field_width)) + { + dest.append( field_width - len, ' ' ); + field_width = 0; + } dest += *ss; } else { if( len > precision ) len = precision; - if (!(flags & LEFT)) while (len < field_width--) dest += ' '; + if (!(flags & LEFT) && (len < field_width)) + { + dest.append( field_width - len, ' ' ); + field_width = 0; + } dest.append( ss->begin(), ss->begin()+len ); } - while (len < field_width--) dest += ' '; + + if( len < field_width ) + dest.append( field_width - len, ' ' ); } else { @@ -736,7 +760,12 @@ repeat: void vssprintf( std::string& dest, const char* format, va_list args ) { + // Optimization: Memory is cheap. Allocating it on the fly is not. Allocate more room + // than we'll likely need right upfront! Also, strlen is slow, so better to just pick an + // arbitrarily generous value to reserve instead of basing it on string length. + dest.clear(); + dest.reserve( 96 ); vssappendf( dest, format, args ); } @@ -807,6 +836,5 @@ std::string vfmt_string( const char* fmt, va_list args ) std::string retval; vssprintf( retval, fmt, args ); - return retval; } From 996f229cbfa2b403af47f77f15728ea617085928 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Wed, 18 Mar 2009 08:22:01 +0000 Subject: [PATCH 68/77] pcsx2: got rid of the compile warning. microVU: minor changes/cleanup. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@811 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/windows/WinThreads.cpp | 2 +- pcsx2/x86/microVU.cpp | 32 +----------- pcsx2/x86/microVU.h | 2 +- pcsx2/x86/microVU_Lower.inl | 6 +-- pcsx2/x86/microVU_Misc.h | 96 ++++++++++++++++++++---------------- 5 files changed, 60 insertions(+), 78 deletions(-) diff --git a/pcsx2/windows/WinThreads.cpp b/pcsx2/windows/WinThreads.cpp index 4e61113b90..658aab7a0a 100644 --- a/pcsx2/windows/WinThreads.cpp +++ b/pcsx2/windows/WinThreads.cpp @@ -109,7 +109,7 @@ namespace Threading __forceinline long pcsx2_InterlockedExchangeAdd( volatile long* target, long srcval ) { - long result; + //long result; // Use our own implementation... // Pcsx2 won't use threads unless it's a multicore cpu, so no need to use diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index 935a197a21..cd96ba9259 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -29,37 +29,7 @@ PCSX2_ALIGNED16(microVU microVU0); PCSX2_ALIGNED16(microVU microVU1); -PCSX2_ALIGNED16(const u32 mVU_absclip[4]) = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}; -PCSX2_ALIGNED16(const u32 mVU_signbit[4]) = {0x80000000, 0x80000000, 0x80000000, 0x80000000}; -PCSX2_ALIGNED16(const u32 mVU_minvals[4]) = {0xff7fffff, 0xff7fffff, 0xff7fffff, 0xff7fffff}; -PCSX2_ALIGNED16(const u32 mVU_maxvals[4]) = {0x7f7fffff, 0x7f7fffff, 0x7f7fffff, 0x7f7fffff}; -PCSX2_ALIGNED16(const u32 mVU_one[4]) = {0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000}; -PCSX2_ALIGNED16(const u32 mVU_T1[4]) = {0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5, 0x3f7ffff5}; -PCSX2_ALIGNED16(const u32 mVU_T2[4]) = {0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c, 0xbeaaa61c}; -PCSX2_ALIGNED16(const u32 mVU_T3[4]) = {0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6, 0x3e4c40a6}; -PCSX2_ALIGNED16(const u32 mVU_T4[4]) = {0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63, 0xbe0e6c63}; -PCSX2_ALIGNED16(const u32 mVU_T5[4]) = {0x3dc577df, 0x3dc577df, 0x3dc577df, 0x3dc577df}; -PCSX2_ALIGNED16(const u32 mVU_T6[4]) = {0xbd6501c4, 0xbd6501c4, 0xbd6501c4, 0xbd6501c4}; -PCSX2_ALIGNED16(const u32 mVU_T7[4]) = {0x3cb31652, 0x3cb31652, 0x3cb31652, 0x3cb31652}; -PCSX2_ALIGNED16(const u32 mVU_T8[4]) = {0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7, 0xbb84d7e7}; -PCSX2_ALIGNED16(const u32 mVU_Pi4[4]) = {0x3f490fdb, 0x3f490fdb, 0x3f490fdb, 0x3f490fdb}; -PCSX2_ALIGNED16(const u32 mVU_S2[4]) = {0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4, 0xbe2aaaa4}; -PCSX2_ALIGNED16(const u32 mVU_S3[4]) = {0x3c08873e, 0x3c08873e, 0x3c08873e, 0x3c08873e}; -PCSX2_ALIGNED16(const u32 mVU_S4[4]) = {0xb94fb21f, 0xb94fb21f, 0xb94fb21f, 0xb94fb21f}; -PCSX2_ALIGNED16(const u32 mVU_S5[4]) = {0x362e9c14, 0x362e9c14, 0x362e9c14, 0x362e9c14}; -PCSX2_ALIGNED16(const u32 mVU_E1[4]) = {0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8, 0x3e7fffa8}; -PCSX2_ALIGNED16(const u32 mVU_E2[4]) = {0x3d0007f4, 0x3d0007f4, 0x3d0007f4, 0x3d0007f4}; -PCSX2_ALIGNED16(const u32 mVU_E3[4]) = {0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff, 0x3b29d3ff}; -PCSX2_ALIGNED16(const u32 mVU_E4[4]) = {0x3933e553, 0x3933e553, 0x3933e553, 0x3933e553}; -PCSX2_ALIGNED16(const u32 mVU_E5[4]) = {0x36b63510, 0x36b63510, 0x36b63510, 0x36b63510}; -PCSX2_ALIGNED16(const u32 mVU_E6[4]) = {0x353961ac, 0x353961ac, 0x353961ac, 0x353961ac}; -PCSX2_ALIGNED16(const float mVU_FTOI_4[4]) = {16.0, 16.0, 16.0, 16.0}; -PCSX2_ALIGNED16(const float mVU_FTOI_12[4]) = {4096.0, 4096.0, 4096.0, 4096.0}; -PCSX2_ALIGNED16(const float mVU_FTOI_15[4]) = {32768.0, 32768.0, 32768.0, 32768.0}; -PCSX2_ALIGNED16(const float mVU_ITOF_4[4]) = {0.0625f, 0.0625f, 0.0625f, 0.0625f}; -PCSX2_ALIGNED16(const float mVU_ITOF_12[4]) = {0.000244140625, 0.000244140625, 0.000244140625, 0.000244140625}; -PCSX2_ALIGNED16(const float mVU_ITOF_15[4]) = {0.000030517578125, 0.000030517578125, 0.000030517578125, 0.000030517578125}; - +declareAllVariables // Declares All Global Variables :D //------------------------------------------------------------------ // Micro VU - Main Functions //------------------------------------------------------------------ diff --git a/pcsx2/x86/microVU.h b/pcsx2/x86/microVU.h index f7490dc334..d755d28b61 100644 --- a/pcsx2/x86/microVU.h +++ b/pcsx2/x86/microVU.h @@ -31,7 +31,7 @@ struct microBlock { u8* x86ptrStart; // Start of code u8* x86ptrEnd; // End of code (first byte outside of block) u8* x86ptrBranch; // - //u32 size; + u32 size; // Number of 64bit VU Instructions in Block }; #define mMaxBlocks 32 // Max Blocks With Different Pipeline States (For n = 1, 2, 4, 8, 16, etc...) diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index ff391179f5..817cc46b1d 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -56,7 +56,7 @@ microVUf(void) mVU_DIV() { SSE_XORPS_XMM_to_XMM(xmmFs, xmmFt); SSE_ANDPS_M128_to_XMM(xmmFs, (uptr)mVU_signbit); - SSE_ORPS_M128_to_XMM(xmmFs, (uptr)mVU_maxvals); // If division by zero, then xmmFs = +/- fmax + SSE_ORPS_XMM_to_XMM(xmmFs, xmmMax); // If division by zero, then xmmFs = +/- fmax bjmp32 = JMP32(0); x86SetJ32(ajmp32); @@ -86,7 +86,7 @@ microVUf(void) mVU_SQRT() { //x86SetJ8(pjmp); SSE_ANDPS_M128_to_XMM(xmmFt, (uptr)mVU_absclip); // Do a cardinal sqrt - if (CHECK_VU_OVERFLOW) SSE_MINSS_M32_to_XMM(xmmFt, (uptr)mVU_maxvals); // Clamp infinities (only need to do positive clamp since xmmFt is positive) + if (CHECK_VU_OVERFLOW) SSE_MINSS_XMM_to_XMM(xmmFt, xmmMax); // Clamp infinities (only need to do positive clamp since xmmFt is positive) SSE_SQRTSS_XMM_to_XMM(xmmFt, xmmFt); mVUunpack_xyzw(xmmFt, xmmFt, 0); mVUmergeRegs(xmmPQ, xmmFt, writeQ ? 4 : 8); @@ -122,7 +122,7 @@ microVUf(void) mVU_RSQRT() { ajmp8 = JZ8(0); // Skip if none are //OR32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0x820); // Zero divide flag SSE_ANDPS_M128_to_XMM(xmmFs, (uptr)mVU_signbit); - SSE_ORPS_M128_to_XMM(xmmFs, (uptr)mVU_maxvals); // EEREC_TEMP = +/-Max + SSE_ORPS_XMM_to_XMM(xmmFs, xmmMax); // EEREC_TEMP = +/-Max bjmp8 = JMP8(0); x86SetJ8(ajmp8); SSE_DIVSS_XMM_to_XMM(xmmFs, xmmFt); diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index 2b76665365..47558d2d3c 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -22,35 +22,46 @@ // Global Variables //------------------------------------------------------------------ -PCSX2_ALIGNED16_EXTERN(const u32 mVU_absclip[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_signbit[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_minvals[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_maxvals[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T1[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T2[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T3[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T4[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T5[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T6[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T7[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_T8[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_Pi4[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_S2[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_S3[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_S4[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_S5[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E1[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E2[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E3[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E4[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E5[4]); -PCSX2_ALIGNED16_EXTERN(const u32 mVU_E6[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_FTOI_4[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_FTOI_12[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_FTOI_15[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_4[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_12[4]); -PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); +#define declareAllVariables \ +initVariable( _somePrefix_, u32, mVU_absclip, 0x7fffffff ); \ +initVariable( _somePrefix_, u32, mVU_signbit, 0x80000000 ); \ +initVariable( _somePrefix_, u32, mVU_minvals, 0xff7fffff ); \ +initVariable( _somePrefix_, u32, mVU_maxvals, 0x7f7fffff ); \ +initVariable( _somePrefix_, u32, mVU_one, 0x3f800000 ); \ +initVariable( _somePrefix_, u32, mVU_T1, 0x3f7ffff5 ); \ +initVariable( _somePrefix_, u32, mVU_T2, 0xbeaaa61c ); \ +initVariable( _somePrefix_, u32, mVU_T3, 0x3e4c40a6 ); \ +initVariable( _somePrefix_, u32, mVU_T4, 0xbe0e6c63 ); \ +initVariable( _somePrefix_, u32, mVU_T5, 0x3dc577df ); \ +initVariable( _somePrefix_, u32, mVU_T6, 0xbd6501c4 ); \ +initVariable( _somePrefix_, u32, mVU_T7, 0x3cb31652 ); \ +initVariable( _somePrefix_, u32, mVU_T8, 0xbb84d7e7 ); \ +initVariable( _somePrefix_, u32, mVU_Pi4, 0x3f490fdb ); \ +initVariable( _somePrefix_, u32, mVU_S2, 0xbe2aaaa4 ); \ +initVariable( _somePrefix_, u32, mVU_S3, 0x3c08873e ); \ +initVariable( _somePrefix_, u32, mVU_S4, 0xb94fb21f ); \ +initVariable( _somePrefix_, u32, mVU_S5, 0x362e9c14 ); \ +initVariable( _somePrefix_, u32, mVU_E1, 0x3e7fffa8 ); \ +initVariable( _somePrefix_, u32, mVU_E2, 0x3d0007f4 ); \ +initVariable( _somePrefix_, u32, mVU_E3, 0x3b29d3ff ); \ +initVariable( _somePrefix_, u32, mVU_E4, 0x3933e553 ); \ +initVariable( _somePrefix_, u32, mVU_E5, 0x36b63510 ); \ +initVariable( _somePrefix_, u32, mVU_E6, 0x353961ac ); \ +initVariable( _somePrefix_, float, mVU_FTOI_4, 16.0 ); \ +initVariable( _somePrefix_, float, mVU_FTOI_12, 4096.0 ); \ +initVariable( _somePrefix_, float, mVU_FTOI_15, 32768.0 ); \ +initVariable( _somePrefix_, float, mVU_ITOF_4, 0.0625f ); \ +initVariable( _somePrefix_, float, mVU_ITOF_12, 0.000244140625 ); \ +initVariable( _somePrefix_, float, mVU_ITOF_15, 0.000030517578125 ); + +#define _somePrefix_ PCSX2_ALIGNED16_EXTERN +#define initVariable(aprefix, atype, aname, avalue) aprefix (const atype aname [4]); +declareAllVariables +#undef _somePrefix_ +#undef initVariable + +#define _somePrefix_ PCSX2_ALIGNED16 +#define initVariable(aprefix, atype, aname, avalue) aprefix (const atype aname [4]) = {avalue, avalue, avalue, avalue}; //------------------------------------------------------------------ // Helper Macros @@ -142,7 +153,7 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define _writeQ (1<<5) #define _readQ (1<<6) #define _writeP (1<<7) -#define _readP (1<<7) +#define _readP (1<<7) // same as writeP #define _doFlags (3<<8) #define _doMac (1<<8) #define _doStatus (1<<9) @@ -159,23 +170,24 @@ PCSX2_ALIGNED16_EXTERN(const float mVU_ITOF_15[4]); #define isBranch (mVUinfo & (1<<1)) #define isEOB (mVUinfo & (1<<2)) #define isBdelay (mVUinfo & (1<<3)) -#define writeQ ((mVUinfo & (1<<5)) >> 5) -#define readQ ((mVUinfo & (1<<6)) >> 6) -#define writeP ((mVUinfo & (1<<7)) >> 7) -#define readP ((mVUinfo & (1<<7)) >> 7) // same as write +#define writeQ ((mVUinfo >> 5) & 1) +#define readQ ((mVUinfo >> 6) & 1) +#define writeP ((mVUinfo >> 7) & 1) +#define readP ((mVUinfo >> 7) & 1) // same as writeP #define doFlags (mVUinfo & (3<<8)) #define doMac (mVUinfo & (1<<8)) #define doStatus (mVUinfo & (1<<9)) -#define fmInstance ((mVUinfo & (3<<10)) >> 10) -#define fsInstance ((mVUinfo & (3<<12)) >> 12) -#define fcInstance ((mVUinfo & (3<<14)) >> 14) -#define fpmInstance (((u8)((mVUinfo & (3<<10)) >> 10) - 1) & 0x3) -#define fpsInstance (((u8)((mVUinfo & (3<<12)) >> 12) - 1) & 0x3) -#define fvmInstance ((mVUinfo & (3<<16)) >> 16) -#define fvsInstance ((mVUinfo & (3<<18)) >> 18) -#define fvcInstance ((mVUinfo & (3<<14)) >> 14) +#define fmInstance ((mVUinfo >> 10) & 3) +#define fsInstance ((mVUinfo >> 12) & 3) +#define fpsInstance ((((mVUinfo>>12) & 3) - 1) & 0x3) +#define fcInstance ((mVUinfo >> 14) & 3) +#define fvcInstance ((mVUinfo >> 14) & 3) +#define fvmInstance ((mVUinfo >> 16) & 3) +#define fvsInstance ((mVUinfo >> 18) & 3) + //#define getFs (mVUinfo & (1<<13)) //#define getFt (mVUinfo & (1<<14)) +//#define fpmInstance (((u8)((mVUinfo & (3<<10)) >> 10) - 1) & 0x3) #define isMMX(_VIreg_) (_VIreg_ >= 1 && _VIreg_ <=9) #define mmVI(_VIreg_) (_VIreg_ - 1) From 1bbcf07a22eb7412c5ddeb2681c171b4949814c6 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 18 Mar 2009 18:56:03 +0000 Subject: [PATCH 69/77] Added a BastTaskThread class to the threading tools. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@812 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Threading.h | 101 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/pcsx2/Threading.h b/pcsx2/Threading.h index eef45fe0bf..a448e9a943 100644 --- a/pcsx2/Threading.h +++ b/pcsx2/Threading.h @@ -130,7 +130,8 @@ namespace Threading ////////////////////////////////////////////////////////////////////////////////////////// // ScopedLock: Helper class for using Mutexes. // Using this class provides an exception-safe (and generally clean) method of locking - // code inside a mutex. + // code inside a function or conditional block. + // class ScopedLock : NoncopyableObject { protected: @@ -149,6 +150,104 @@ namespace Threading } }; + ////////////////////////////////////////////////////////////////////////////////////////// + // BaseTaskThread - an abstract base class which provides simple parallel execution of + // single tasks. + // + // Implementation: + // To use this class your derived class will need to implement its own Task() function + // and also a "StartTask( parameters )" function which suits the need of your task, along + // with any local variables your task needs to do its job. You may additionally want to + // implement a "GetResult()" function, which would be a combination of WaitForResult() + // and a return value of the computational result. + // + // Thread Safety: + // If operating on local variables, you must execute WaitForResult() before leaving the + // variable scope -- or alternatively have your StartTask() implementation make full + // copies of dependent data. Also, by default PostTask() always assumes the previous + // task has completed. If your system can post a new task before the previous one has + // completed, then it needs to explicitly call WaitForResult() or provide a mechanism + // to cancel the previous task (which is probably more work than it's worth). + // + // Performance notes: + // * Remember that thread creation is generally slow, so you should make your object + // instance once early and then feed it tasks repeatedly over the course of program + // execution. + // + // * For threading to be a successful speedup, the task being performed should be as lock + // free as possible. For example using STL containers in parallel usually fails to + // yield any speedup due to the gratuitous amount of locking that the STL performs + // internally. + // + // * The best application of tasking threads is to divide a large loop over a linear array + // into smaller sections. For example, if you have 20,000 items to process, the task + // can be divided into two threads of 10,000 items each. + // + class BaseTaskThread : public Thread + { + protected: + volatile bool m_done; + volatile bool m_TaskComplete; + + public: + virtual ~BaseTaskThread() {} + BaseTaskThread() : + m_done( false ) + , m_TaskComplete( false ) + { + } + + // Tells the thread to exit and then waits for thread termination. + // To force-terminate the thread without "nicely" waiting for the task to complete, + // explicitly use the Thread::Close parent implementation instead. + void Close() + { + if( m_terminated ) return; + m_done = true; + m_post_event.Post(); + pthread_join( m_thread, NULL ); + } + + // Initiates the new task. This should be called after your own StartTask has + // initialized internal variables / preparations for task execution. + void PostTask() + { + jASSUME( !m_terminated ); + m_TaskComplete = false; + m_post_event.Post(); + } + + // Blocks current thread execution pending the completion of the parallel task. + void WaitForResult() const + { + if( m_terminated ) return; + while( !m_TaskComplete ) + { + Timeslice(); + SpinWait(); + } + } + + protected: + // Abstract method run when a task has been posted. Implementing classes should do + // all your necessary processing work here. + virtual void Task()=0; + + int Callback() + { + do + { + // Wait for a job! + m_post_event.Wait(); + + if( m_done ) break; + Task(); + m_TaskComplete = true; + } while( !m_done ); + + return 0; + } + }; ////////////////////////////////////////////////////////////////////////////////////////// // Our fundamental interlocking functions. All other useful interlocks can be derived From f2477537f94054b20526aaa9126f2888c9ba54ea Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 18 Mar 2009 22:38:36 +0000 Subject: [PATCH 70/77] Implemented more correct support for the IOP's "isc bit" (bit 16 on the COP0 status register), which in turn allowed me to simpify some of the IOP's memory access and paging logic. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@813 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/IopMem.cpp | 221 ++++++++++++++++++++------------------------ pcsx2/SaveState.cpp | 5 +- 2 files changed, 102 insertions(+), 124 deletions(-) diff --git a/pcsx2/IopMem.cpp b/pcsx2/IopMem.cpp index 0a4d04e582..2ef4f71df3 100644 --- a/pcsx2/IopMem.cpp +++ b/pcsx2/IopMem.cpp @@ -24,9 +24,6 @@ #include "Hw.h" #include "iR3000A.h" -int g_psxWriteOk=1; -static u32 writectrl; - #ifdef PCSX2_VIRTUAL_MEM void psxMemAlloc() { @@ -451,10 +448,11 @@ u8 iopMemRead8(u32 mem) { if (t == 0x1f40) { mem&= 0x1fffffff; return psxHw4Read8(mem); - } else { + } else + { p = (const u8*)(psxMemRLUT[mem >> 16]); if (p != NULL) { - return *(const u8 *)(p + (mem & 0xffff)); + return ( psxRegs.CP0.n.Status & 0x10000 ) ? 0 : *(const u8 *)(p + (mem & 0xffff)); } else { if (t == 0x1000) return DEV9read8(mem & 0x1FFFFFFF); PSXMEM_LOG("err lb %8.8lx\n", mem); @@ -474,7 +472,8 @@ u16 iopMemRead16(u32 mem) { return psxHu16(mem); else return psxHwRead16(mem); - } else { + } else + { p = (const u8*)(psxMemRLUT[mem >> 16]); if (p != NULL) { if (t == 0x1d00) { @@ -494,7 +493,10 @@ u16 iopMemRead16(u32 mem) { ret = 0; break; default: - ret = psxHu16(mem); + if( !(psxRegs.CP0.n.Status & 0x10000) ) + ret = psxHu16(mem); + else + ret = 0; break; } SIF_LOG("Sif reg read %x value %x\n", mem, ret); @@ -521,7 +523,8 @@ u32 iopMemRead32(u32 mem) { return psxHu32(mem); else return psxHwRead32(mem); - } else { + } else + { //see also Hw.c p = (const u8*)(psxMemRLUT[mem >> 16]); if (p != NULL) { @@ -548,7 +551,10 @@ u32 iopMemRead32(u32 mem) { ret = 0; break; default: - ret = psxHu32(mem); + if( !(psxRegs.CP0.n.Status & 0x10000) ) + ret = psxHu32(mem); + else + ret = 0; break; } SIF_LOG("Sif reg read %x value %x\n", mem, ret); @@ -558,11 +564,6 @@ u32 iopMemRead32(u32 mem) { } else { if (t == 0x1000) return DEV9read32(mem & 0x1FFFFFFF); - if (mem != 0xfffe0130) { - if (g_psxWriteOk) PSXMEM_LOG("err lw %8.8lx\n", mem); - } else { - return writectrl; - } return 0; } } @@ -583,12 +584,16 @@ void iopMemWrite8(u32 mem, u8 value) { if (t == 0x1f40) { mem&= 0x1fffffff; psxHw4Write8(mem, value); - } else { + } else + { p = (char *)(psxMemWLUT[mem >> 16]); - if (p != NULL) { + if (p != NULL && !(psxRegs.CP0.n.Status & 0x10000) ) + { *(u8 *)(p + (mem & 0xffff)) = value; psxCpu->Clear(mem&~3, 1); - } else { + } + else + { if ((t & 0x1FFF)==0x1D00) SysPrintf("sw8 [0x%08X]=0x%08X\n", mem, value); if (t == 0x1d00) { psxSu8(mem) = value; return; @@ -612,39 +617,45 @@ void iopMemWrite16(u32 mem, u16 value) { psxHu16(mem) = value; else psxHwWrite16(mem, value); - } else { + } else + { p = (char *)(psxMemWLUT[mem >> 16]); - if (p != NULL) { + if (p != NULL && !(psxRegs.CP0.n.Status & 0x10000) ) + { if ((t & 0x1FFF)==0x1D00) SysPrintf("sw16 [0x%08X]=0x%08X\n", mem, value); *(u16 *)(p + (mem & 0xffff)) = value; psxCpu->Clear(mem&~3, 1); - } else { - if (t == 0x1d00) { - switch (mem & 0xf0) { - case 0x10: - // write to ps2 mem - psHu16(0x1000F210) = value; - return; - case 0x40: + } + else + { + if (t == 0x1d00) + { + switch (mem & 0xf0) + { + case 0x10: + // write to ps2 mem + psHu16(0x1000F210) = value; + return; + case 0x40: + { + u32 temp = value & 0xF0; + // write to ps2 mem + if(value & 0x20 || value & 0x80) { - u32 temp = value & 0xF0; - // write to ps2 mem - if(value & 0x20 || value & 0x80) - { - psHu16(0x1000F240) &= ~0xF000; - psHu16(0x1000F240) |= 0x2000; - } - - - if(psHu16(0x1000F240) & temp) psHu16(0x1000F240) &= ~temp; - else psHu16(0x1000F240) |= temp; - return; + psHu16(0x1000F240) &= ~0xF000; + psHu16(0x1000F240) |= 0x2000; } - case 0x60: - psHu32(0x1000F260) = 0; - return; + + if(psHu16(0x1000F240) & temp) psHu16(0x1000F240) &= ~temp; + else psHu16(0x1000F240) |= temp; + return; } + case 0x60: + psHu32(0x1000F260) = 0; + return; + + } psxSu16(mem) = value; return; } if (t == 0x1F90) { @@ -669,98 +680,64 @@ void iopMemWrite32(u32 mem, u32 value) { psxHu32(mem) = value; else psxHwWrite32(mem, value); - } else { + } else + { //see also Hw.c p = (char *)(psxMemWLUT[mem >> 16]); - if (p != NULL) { + if( p != NULL && !(psxRegs.CP0.n.Status & 0x10000) ) + { *(u32 *)(p + (mem & 0xffff)) = value; psxCpu->Clear(mem&~3, 1); - } else { - if (mem != 0xfffe0130) { - if (t == 0x1d00) { + } + else + { + if (t == 0x1d00) + { MEM_LOG("iop Sif reg write %x value %x\n", mem, value); - switch (mem & 0xf0) { - case 0x10: - // write to ps2 mem - psHu32(0x1000F210) = value; - return; - case 0x20: - // write to ps2 mem - psHu32(0x1000F220) &= ~value; - return; - case 0x30: - // write to ps2 mem - psHu32(0x1000F230) |= value; - return; - case 0x40: + switch (mem & 0xf0) + { + case 0x10: + // write to ps2 mem + psHu32(0x1000F210) = value; + return; + case 0x20: + // write to ps2 mem + psHu32(0x1000F220) &= ~value; + return; + case 0x30: + // write to ps2 mem + psHu32(0x1000F230) |= value; + return; + case 0x40: + { + u32 temp = value & 0xF0; + // write to ps2 mem + if(value & 0x20 || value & 0x80) { - u32 temp = value & 0xF0; - // write to ps2 mem - if(value & 0x20 || value & 0x80) - { - psHu32(0x1000F240) &= ~0xF000; - psHu32(0x1000F240) |= 0x2000; - } - - - if(psHu32(0x1000F240) & temp) psHu32(0x1000F240) &= ~temp; - else psHu32(0x1000F240) |= temp; - return; + psHu32(0x1000F240) &= ~0xF000; + psHu32(0x1000F240) |= 0x2000; } - case 0x60: - psHu32(0x1000F260) = 0; - return; + + if(psHu32(0x1000F240) & temp) psHu32(0x1000F240) &= ~temp; + else psHu32(0x1000F240) |= temp; + return; } - psxSu32(mem) = value; + case 0x60: + psHu32(0x1000F260) = 0; + return; - // write to ps2 mem - if( (mem & 0xf0) != 0x60 ) - *(u32*)(PS2MEM_HW+0xf200+(mem&0xf0)) = value; - return; - } - if (t == 0x1000) { - DEV9write32(mem & 0x1fffffff, value); return; } + psxSu32(mem) = value; - //if (!g_psxWriteOk) psxCpu->Clear(mem&~3, 1); - if (g_psxWriteOk) { PSXMEM_LOG("err sw %8.8lx = %x\n", mem, value); } - } else { - writectrl = value; - switch (value) { - case 0x800: case 0x804: - case 0xc00: case 0xc04: - case 0xcc0: case 0xcc4: - case 0x0c4: - if (g_psxWriteOk == 0) break; - g_psxWriteOk = 0; - - // Performance note: Use a for loop instead of memset/memzero - // This generates *much* more efficient code in this particular case (due to few iterations) - for (int i=0; i<0x0080; i++) - { - psxMemWLUT[i + 0x0000] = 0; - psxMemWLUT[i + 0x8000] = 0; - psxMemWLUT[i + 0xa000] = 0; - } - //PSXMEM_LOG("writectrl: writenot ok\n"); - break; - case 0x1e988: - case 0x1edd8: - if (g_psxWriteOk == 1) break; - g_psxWriteOk = 1; - for (int i=0; i<0x0080; i++) - { - psxMemWLUT[i + 0x0000] = (uptr)&psxM[(i & 0x1f) << 16]; - psxMemWLUT[i + 0x8000] = (uptr)&psxM[(i & 0x1f) << 16]; - psxMemWLUT[i + 0xa000] = (uptr)&psxM[(i & 0x1f) << 16]; - } - //PSXMEM_LOG("writectrl: write ok\n"); - break; - default: - PSXMEM_LOG("unk %8.8lx = %x\n", mem, value); - break; - } + // write to ps2 mem + if( (mem & 0xf0) != 0x60 ) + *(u32*)(PS2MEM_HW+0xf200+(mem&0xf0)) = value; + return; + } + else if (t == 0x1000) + { + DEV9write32(mem & 0x1fffffff, value); return; } } } diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 9a13e1b07b..762a1ca4bf 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -33,7 +33,6 @@ using namespace R5900; -extern int g_psxWriteOk; extern void recResetEE(); extern void recResetIOP(); @@ -110,7 +109,9 @@ void SaveState::FreezeAll() Freeze(s_iLastCOP0Cycle); Freeze(s_iLastPERFCycle); - Freeze(g_psxWriteOk); + u32 dummy = 1; + Freeze( dummy ); // was g_psxWriteOk + //hope didn't forgot any cpu.... From a51b407cdb78f2b10a891d2165a55796c05a6cb8 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 19 Mar 2009 03:59:25 +0000 Subject: [PATCH 71/77] More changes to the IOP's memory model. Some of these are experimental and might cause problems (needs testing). Quick rundown: * The R3000 does not have a TLB, and has no valid addresses mapped above page 0x2000 in physical memory [lower 512M]. Thus all addresses can have the top 6 bits masked off and still retain full validity. For example, address 0xbfc0 is simply a mirror of physical address 0x1fc0. Technically speaking, a full emulation of the IOP memory model would raise bus error exceptions for accesses between 0x2000 to 0x8000 segments (instead of treating them as mirrors of the lower 0x2000 segment), but buss errors are generally fatal (unrecoverable) program errors that would never happen within the context of game emulation. * The IOP's SIF register space is only 256 bytes, and then mirrored repeatedly through it's 64k page at 0x1d00. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@814 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/IopMem.cpp | 560 ++++++++++++----------------------------------- pcsx2/IopMem.h | 13 +- 2 files changed, 144 insertions(+), 429 deletions(-) diff --git a/pcsx2/IopMem.cpp b/pcsx2/IopMem.cpp index 2ef4f71df3..26b56efe9d 100644 --- a/pcsx2/IopMem.cpp +++ b/pcsx2/IopMem.cpp @@ -24,309 +24,10 @@ #include "Hw.h" #include "iR3000A.h" -#ifdef PCSX2_VIRTUAL_MEM -void psxMemAlloc() -{ - // In VirtualMemory land all mem taken care by memAlloc -} - -void psxMemReset() -{ - memzero_ptr(psxM); -} - -void psxMemShutdown() -{ -} - -u8 iopMemRead8(u32 mem) -{ - u32 t = (mem >> 16) & 0x1fff; - - switch(t) { - case 0x1f80: - mem&= 0x1fffffff; - if (mem < 0x1f801000) - return psxHu8(mem); - else - return psxHwRead8(mem); - break; - -#ifdef _DEBUG - case 0x1d00: assert(0); -#endif - - case 0x1f40: - mem &= 0x1fffffff; - return psxHw4Read8(mem); - - case 0x1000: return DEV9read8(mem & 0x1FFFFFFF); - - default: - assert( g_psxWriteOk ); - return *(u8*)PSXM(mem); - } -} - -u16 iopMemRead16(u32 mem) -{ - u32 t = (mem >> 16) & 0x1fff; - - switch(t) { - case 0x1f80: - mem&= 0x1fffffff; - if (mem < 0x1f801000) - return psxHu16(mem); - else - return psxHwRead16(mem); - break; - - case 0x1d00: - SIF_LOG("Sif reg read %x value %x\n", mem, psxHu16(mem)); - switch(mem & 0xF0) - { - case 0x40: return psHu16(0x1000F240) | 0x0002; - case 0x60: return 0; - default: return *(u16*)(PS2MEM_HW+0xf200+(mem&0xf0)); - } - break; - - case 0x1f90: - return SPU2read(mem & 0x1FFFFFFF); - case 0x1000: - return DEV9read16(mem & 0x1FFFFFFF); - - default: - assert( g_psxWriteOk ); - return *(u16*)PSXM(mem); - } -} - -u32 iopMemRead32(u32 mem) -{ - u32 t = (mem >> 16) & 0x1fff; - - switch(t) { - case 0x1f80: - mem&= 0x1fffffff; - if (mem < 0x1f801000) - return psxHu32(mem); - else - return psxHwRead32(mem); - break; - - case 0x1d00: - SIF_LOG("Sif reg read %x value %x\n", mem, psxHu32(mem)); - switch(mem & 0xF0) - { - case 0x40: return psHu32(0x1000F240) | 0xF0000002; - case 0x60: return 0; - default: return *(u32*)(PS2MEM_HW+0xf200+(mem&0xf0)); - } - break; - - case 0x1fff: return g_psxWriteOk; - case 0x1000: - return DEV9read32(mem & 0x1FFFFFFF); - - default: - //assert(g_psxWriteOk); - if( mem == 0xfffe0130 ) - return writectrl; - else if( mem == 0xffffffff ) - return writectrl; - else if( g_psxWriteOk ) - return *(u32*)PSXM(mem); - else return 0; - } -} - -void iopMemWrite8(u32 mem, u8 value) -{ - u32 t = (mem >> 16) & 0x1fff; - - switch(t) { - case 0x1f80: - mem&= 0x1fffffff; - if (mem < 0x1f801000) - psxHu8(mem) = value; - else - psxHwWrite8(mem, value); - break; - - case 0x1f40: - mem&= 0x1fffffff; - psxHw4Write8(mem, value); - break; - - case 0x1d00: - SysPrintf("sw8 [0x%08X]=0x%08X\n", mem, value); - *(u8*)(PS2MEM_HW+0xf200+(mem&0xff)) = value; - break; - - case 0x1000: - DEV9write8(mem & 0x1fffffff, value); - return; - - default: - assert(g_psxWriteOk); - *(u8 *)PSXM(mem) = value; - psxCpu->Clear(mem&~3, 1); - break; - } -} - -void iopMemWrite16(u32 mem, u16 value) -{ - u32 t = (mem >> 16) & 0x1fff; - switch(t) { - case 0x1600: - //HACK: DEV9 VM crash fix - break; - case 0x1f80: - mem&= 0x1fffffff; - if (mem < 0x1f801000) - psxHu16(mem) = value; - else - psxHwWrite16(mem, value); - break; - - case 0x1d00: - switch (mem & 0xf0) { - case 0x10: - // write to ps2 mem - psHu16(0x1000F210) = value; - return; - case 0x40: - { - u32 temp = value & 0xF0; - // write to ps2 mem - if(value & 0x20 || value & 0x80) - { - psHu16(0x1000F240) &= ~0xF000; - psHu16(0x1000F240) |= 0x2000; - } - - if(psHu16(0x1000F240) & temp) psHu16(0x1000F240) &= ~temp; - else psHu16(0x1000F240) |= temp; - return; - } - case 0x60: - psHu32(0x1000F260) = 0; - return; - default: - assert(0); - } - return; - - case 0x1f90: - SPU2write(mem & 0x1FFFFFFF, value); return; - - case 0x1000: - DEV9write16(mem & 0x1fffffff, value); return; - default: - assert( g_psxWriteOk ); - *(u16 *)PSXM(mem) = value; - psxCpu->Clear(mem&~3, 1); - break; - } -} - -void iopMemWrite32(u32 mem, u32 value) -{ - u32 t = (mem >> 16) & 0x1fff; - switch(t) { - case 0x1f80: - mem&= 0x1fffffff; - if (mem < 0x1f801000) - psxHu32(mem) = value; - else - psxHwWrite32(mem, value); - break; - - case 0x1d00: - switch (mem & 0xf0) { - case 0x10: - // write to ps2 mem - psHu32(0x1000F210) = value; - return; - case 0x20: - // write to ps2 mem - psHu32(0x1000F220) &= ~value; - return; - case 0x30: - // write to ps2 mem - psHu32(0x1000F230) |= value; - return; - case 0x40: - { - u32 temp = value & 0xF0; - // write to ps2 mem - if(value & 0x20 || value & 0x80) - { - psHu32(0x1000F240) &= ~0xF000; - psHu32(0x1000F240) |= 0x2000; - } - - - if(psHu32(0x1000F240) & temp) psHu32(0x1000F240) &= ~temp; - else psHu32(0x1000F240) |= temp; - return; - } - case 0x60: - psHu32(0x1000F260) = 0; - return; - - default: - *(u32*)(PS2MEM_HW+0xf200+(mem&0xf0)) = value; - } - - return; - - case 0x1000: - DEV9write32(mem & 0x1fffffff, value); - return; - - case 0x1ffe: - if( mem == 0xfffe0130 ) { - writectrl = value; - switch (value) { - case 0x800: case 0x804: - case 0xc00: case 0xc04: - case 0xcc0: case 0xcc4: - case 0x0c4: - g_psxWriteOk = 0; - //PSXMEM_LOG("writectrl: writenot ok\n"); - break; - case 0x1e988: - case 0x1edd8: - g_psxWriteOk = 1; - //PSXMEM_LOG("writectrl: write ok\n"); - break; - default: - PSXMEM_LOG("unk %8.8lx = %x\n", mem, value); - break; - } - } - break; - - default: - - if( g_psxWriteOk ) { - *(u32 *)PSXM(mem) = value; - psxCpu->Clear(mem&~3, 1); - } - - break; - } -} - -#else - u8 *psxM = NULL; u8 *psxP = NULL; -u8 *psxH = NULL; -u8 *psxS = NULL; +u8 *psxH = NULL; // standard hardware registers (0x000->0x3ff is the scratchpad) +u8 *psxS = NULL; // 'undocumented' SIF communication registers uptr *psxMemWLUT = NULL; const uptr *psxMemRLUT = NULL; @@ -336,7 +37,7 @@ static const uint m_psxMemSize = Ps2MemSize::IopRam + Ps2MemSize::IopHardware + 0x00010000 + // psxP - 0x00010000 ; // psxS + 0x00000100 ; // psxS void psxMemAlloc() { @@ -352,8 +53,8 @@ void psxMemAlloc() psxH = curpos; curpos += Ps2MemSize::IopHardware; psxS = curpos; //curpos += 0x00010000; - psxMemWLUT = (uptr*)_aligned_malloc(0x10000 * sizeof(uptr) * 2, 16); - psxMemRLUT = psxMemWLUT + 0x10000; //(uptr*)_aligned_malloc(0x10000 * sizeof(uptr),16); + psxMemWLUT = (uptr*)_aligned_malloc(0x2000 * sizeof(uptr) * 2, 16); + psxMemRLUT = psxMemWLUT + 0x2000; //(uptr*)_aligned_malloc(0x10000 * sizeof(uptr),16); } // Note! Resetting the IOP's memory state is dependent on having *all* psx memory allocated, @@ -365,53 +66,53 @@ void psxMemReset() DbgCon::Status( "psxMemReset > Resetting core memory!" ); - memzero_ptr<0x10000 * sizeof(uptr) * 2>( psxMemWLUT ); // clears both allocations, RLUT and WLUT + memzero_ptr<0x2000 * sizeof(uptr) * 2>( psxMemWLUT ); // clears both allocations, RLUT and WLUT memzero_ptr( m_psxAllMem ); // Trick! We're accessing RLUT here through WLUT, since it's the non-const pointer. - // So the ones with a 1 prefixed (ala 0x18000, etc) are RLUT tables. + // So the ones with a 0x2000 prefixed are RLUT tables. // Map IOP main memory, which is Read/Write, and mirrored three times // at 0x0, 0x8000, and 0xa000: for (int i=0; i<0x0080; i++) { psxMemWLUT[i + 0x0000] = (uptr)&psxM[(i & 0x1f) << 16]; - psxMemWLUT[i + 0x8000] = (uptr)&psxM[(i & 0x1f) << 16]; - psxMemWLUT[i + 0xa000] = (uptr)&psxM[(i & 0x1f) << 16]; + //psxMemWLUT[i + 0x8000] = (uptr)&psxM[(i & 0x1f) << 16]; + //psxMemWLUT[i + 0xa000] = (uptr)&psxM[(i & 0x1f) << 16]; // RLUTs, accessed through WLUT. - psxMemWLUT[i + 0x10000] = (uptr)&psxM[(i & 0x1f) << 16]; - psxMemWLUT[i + 0x18000] = (uptr)&psxM[(i & 0x1f) << 16]; - psxMemWLUT[i + 0x1a000] = (uptr)&psxM[(i & 0x1f) << 16]; + psxMemWLUT[i + 0x2000] = (uptr)&psxM[(i & 0x1f) << 16]; + //psxMemWLUT[i + 0x18000] = (uptr)&psxM[(i & 0x1f) << 16]; + //psxMemWLUT[i + 0x1a000] = (uptr)&psxM[(i & 0x1f) << 16]; } // A few single-page allocations for things we store in special locations. - psxMemWLUT[0x11f00] = (uptr)psxP; - psxMemWLUT[0x11f80] = (uptr)psxH; - psxMemWLUT[0x1bf80] = (uptr)psxH; + psxMemWLUT[0x2000 + 0x1f00] = (uptr)psxP; + psxMemWLUT[0x2000 + 0x1f80] = (uptr)psxH; + //psxMemWLUT[0x1bf80] = (uptr)psxH; psxMemWLUT[0x1f00] = (uptr)psxP; psxMemWLUT[0x1f80] = (uptr)psxH; - psxMemWLUT[0xbf80] = (uptr)psxH; + //psxMemWLUT[0xbf80] = (uptr)psxH; // Read-only memory areas, so don't map WLUT for these... for (int i=0; i<0x0040; i++) { - psxMemWLUT[i + 0x11fc0] = (uptr)&PS2MEM_ROM[i << 16]; - psxMemWLUT[i + 0x19fc0] = (uptr)&PS2MEM_ROM[i << 16]; - psxMemWLUT[i + 0x1bfc0] = (uptr)&PS2MEM_ROM[i << 16]; + psxMemWLUT[i + 0x2000 + 0x1fc0] = (uptr)&PS2MEM_ROM[i << 16]; + //psxMemWLUT[i + 0x19fc0] = (uptr)&PS2MEM_ROM[i << 16]; + //psxMemWLUT[i + 0x1bfc0] = (uptr)&PS2MEM_ROM[i << 16]; } for (int i=0; i<0x0004; i++) { - psxMemWLUT[i + 0x11e00] = (uptr)&PS2MEM_ROM1[i << 16]; - psxMemWLUT[i + 0x19e00] = (uptr)&PS2MEM_ROM1[i << 16]; - psxMemWLUT[i + 0x1be00] = (uptr)&PS2MEM_ROM1[i << 16]; + psxMemWLUT[i + 0x2000 + 0x1e00] = (uptr)&PS2MEM_ROM1[i << 16]; + //psxMemWLUT[i + 0x19e00] = (uptr)&PS2MEM_ROM1[i << 16]; + //psxMemWLUT[i + 0x1be00] = (uptr)&PS2MEM_ROM1[i << 16]; } - // Scratchpad! (which is read only? (air)) - psxMemWLUT[0x11d00] = (uptr)psxS; - psxMemWLUT[0x1bd00] = (uptr)psxS; + // sif!! (which is read only? (air)) + psxMemWLUT[0x2000 + 0x1d00] = (uptr)psxS; + //psxMemWLUT[0x1bd00] = (uptr)psxS; // why isn't scratchpad read/write? (air) //for (i=0; i<0x0001; i++) psxMemWLUT[i + 0x1d00] = (uptr)&psxS[i << 16]; @@ -433,50 +134,58 @@ void psxMemShutdown() psxMemRLUT = NULL; } -u8 iopMemRead8(u32 mem) { - const u8* p; - u32 t; +u8 iopMemRead8(u32 mem) +{ + mem &= 0x1fffffff; + u32 t = mem >> 16; - t = (mem >> 16) & 0x1fff; - if (t == 0x1f80) { - mem&= 0x1fffffff; + if (t == 0x1f80) + { if (mem < 0x1f801000) return psxHu8(mem); else return psxHwRead8(mem); - } else - if (t == 0x1f40) { - mem&= 0x1fffffff; - return psxHw4Read8(mem); - } else + } + else if (t == 0x1f40) { - p = (const u8*)(psxMemRLUT[mem >> 16]); - if (p != NULL) { - return ( psxRegs.CP0.n.Status & 0x10000 ) ? 0 : *(const u8 *)(p + (mem & 0xffff)); - } else { - if (t == 0x1000) return DEV9read8(mem & 0x1FFFFFFF); + return psxHw4Read8(mem); + } + else + { + const u8* p = (const u8*)(psxMemRLUT[mem >> 16]); + if (p != NULL) + { + return *(const u8 *)(p + (mem & 0xffff)); + } + else + { + if (t == 0x1000) + return DEV9read8(mem); PSXMEM_LOG("err lb %8.8lx\n", mem); return 0; } } } -u16 iopMemRead16(u32 mem) { - const u8* p; - u32 t; +u16 iopMemRead16(u32 mem) +{ + mem &= 0x1fffffff; + u32 t = mem >> 16; - t = (mem >> 16) & 0x1fff; - if (t == 0x1f80) { - mem&= 0x1fffffff; + if (t == 0x1f80) + { if (mem < 0x1f801000) return psxHu16(mem); else return psxHwRead16(mem); - } else + } + else { - p = (const u8*)(psxMemRLUT[mem >> 16]); - if (p != NULL) { - if (t == 0x1d00) { + const u8* p = (const u8*)(psxMemRLUT[mem >> 16]); + if (p != NULL) + { + if (t == 0x1d00) + { u16 ret; switch(mem & 0xF0) { @@ -493,32 +202,33 @@ u16 iopMemRead16(u32 mem) { ret = 0; break; default: - if( !(psxRegs.CP0.n.Status & 0x10000) ) - ret = psxHu16(mem); - else - ret = 0; + ret = psxHu16(mem); break; } SIF_LOG("Sif reg read %x value %x\n", mem, ret); return ret; } return *(const u16 *)(p + (mem & 0xffff)); - } else { + } + else + { if (t == 0x1F90) - return SPU2read(mem & 0x1FFFFFFF); - if (t == 0x1000) return DEV9read16(mem & 0x1FFFFFFF); + return SPU2read(mem); + if (t == 0x1000) + return DEV9read16(mem); PSXMEM_LOG("err lh %8.8lx\n", mem); return 0; } } } -u32 iopMemRead32(u32 mem) { - const u8* p; - u32 t; - t = (mem >> 16) & 0x1fff; - if (t == 0x1f80) { - mem&= 0x1fffffff; +u32 iopMemRead32(u32 mem) +{ + mem &= 0x1fffffff; + u32 t = mem >> 16; + + if (t == 0x1f80) + { if (mem < 0x1f801000) return psxHu32(mem); else @@ -526,9 +236,11 @@ u32 iopMemRead32(u32 mem) { } else { //see also Hw.c - p = (const u8*)(psxMemRLUT[mem >> 16]); - if (p != NULL) { - if (t == 0x1d00) { + const u8* p = (const u8*)(psxMemRLUT[mem >> 16]); + if (p != NULL) + { + if (t == 0x1d00) + { u32 ret; switch(mem & 0xF0) { @@ -551,42 +263,42 @@ u32 iopMemRead32(u32 mem) { ret = 0; break; default: - if( !(psxRegs.CP0.n.Status & 0x10000) ) - ret = psxHu32(mem); - else - ret = 0; + ret = psxHu32(mem); break; } SIF_LOG("Sif reg read %x value %x\n", mem, ret); return ret; } return *(const u32 *)(p + (mem & 0xffff)); - } else { - if (t == 0x1000) return DEV9read32(mem & 0x1FFFFFFF); - + } + else + { + if (t == 0x1000) + return DEV9read32(mem); return 0; } } } -void iopMemWrite8(u32 mem, u8 value) { - char *p; - u32 t; - - t = (mem >> 16) & 0x1fff; - if (t == 0x1f80) { - mem&= 0x1fffffff; +void iopMemWrite8(u32 mem, u8 value) +{ + mem &= 0x1fffffff; + u32 t = mem >> 16; + + if (t == 0x1f80) + { if (mem < 0x1f801000) psxHu8(mem) = value; else psxHwWrite8(mem, value); - } else - if (t == 0x1f40) { - mem&= 0x1fffffff; - psxHw4Write8(mem, value); - } else + } + else if (t == 0x1f40) { - p = (char *)(psxMemWLUT[mem >> 16]); + psxHw4Write8(mem, value); + } + else + { + u8* p = (u8 *)(psxMemWLUT[mem >> 16]); if (p != NULL && !(psxRegs.CP0.n.Status & 0x10000) ) { *(u8 *)(p + (mem & 0xffff)) = value; @@ -594,35 +306,35 @@ void iopMemWrite8(u32 mem, u8 value) { } else { - if ((t & 0x1FFF)==0x1D00) SysPrintf("sw8 [0x%08X]=0x%08X\n", mem, value); + if (t == 0x1D00) SysPrintf("sw8 [0x%08X]=0x%08X\n", mem, value); if (t == 0x1d00) { psxSu8(mem) = value; return; } if (t == 0x1000) { - DEV9write8(mem & 0x1fffffff, value); return; + DEV9write8(mem, value); return; } PSXMEM_LOG("err sb %8.8lx = %x\n", mem, value); } } } -void iopMemWrite16(u32 mem, u16 value) { - char *p; - u32 t; +void iopMemWrite16(u32 mem, u16 value) +{ + mem &= 0x1fffffff; + u32 t = mem >> 16; - t = (mem >> 16) & 0x1fff; - if (t == 0x1f80) { - mem&= 0x1fffffff; + if (t == 0x1f80) + { if (mem < 0x1f801000) psxHu16(mem) = value; else psxHwWrite16(mem, value); } else { - p = (char *)(psxMemWLUT[mem >> 16]); + u8* p = (u8 *)(psxMemWLUT[mem >> 16]); if (p != NULL && !(psxRegs.CP0.n.Status & 0x10000) ) { - if ((t & 0x1FFF)==0x1D00) SysPrintf("sw16 [0x%08X]=0x%08X\n", mem, value); + if( t==0x1D00 ) SysPrintf("sw16 [0x%08X]=0x%08X\n", mem, value); *(u16 *)(p + (mem & 0xffff)) = value; psxCpu->Clear(mem&~3, 1); } @@ -659,23 +371,23 @@ void iopMemWrite16(u32 mem, u16 value) { psxSu16(mem) = value; return; } if (t == 0x1F90) { - SPU2write(mem & 0x1FFFFFFF, value); return; + SPU2write(mem, value); return; } if (t == 0x1000) { - DEV9write16(mem & 0x1fffffff, value); return; + DEV9write16(mem, value); return; } PSXMEM_LOG("err sh %8.8lx = %x\n", mem, value); } } } -void iopMemWrite32(u32 mem, u32 value) { - char *p; - u32 t; +void iopMemWrite32(u32 mem, u32 value) +{ + mem &= 0x1fffffff; + u32 t = mem >> 16; - t = (mem >> 16) & 0x1fff; - if (t == 0x1f80) { - mem&= 0x1fffffff; + if (t == 0x1f80) + { if (mem < 0x1f801000) psxHu32(mem) = value; else @@ -683,7 +395,7 @@ void iopMemWrite32(u32 mem, u32 value) { } else { //see also Hw.c - p = (char *)(psxMemWLUT[mem >> 16]); + u8* p = (u8 *)(psxMemWLUT[mem >> 16]); if( p != NULL && !(psxRegs.CP0.n.Status & 0x10000) ) { *(u32 *)(p + (mem & 0xffff)) = value; @@ -696,22 +408,24 @@ void iopMemWrite32(u32 mem, u32 value) { MEM_LOG("iop Sif reg write %x value %x\n", mem, value); switch (mem & 0xf0) { - case 0x10: - // write to ps2 mem + case 0x00: // EE write path (EE/IOP readable) + return; // this is the IOP, so read-only (do nothing) + + case 0x10: // IOP write path (EE/IOP readable) psHu32(0x1000F210) = value; return; - case 0x20: - // write to ps2 mem + + case 0x20: // Bits cleared when written from IOP. psHu32(0x1000F220) &= ~value; return; - case 0x30: - // write to ps2 mem + + case 0x30: // bits set when written from IOP psHu32(0x1000F230) |= value; return; - case 0x40: + + case 0x40: // Control Register { u32 temp = value & 0xF0; - // write to ps2 mem if(value & 0x20 || value & 0x80) { psHu32(0x1000F240) &= ~0xF000; @@ -719,28 +433,28 @@ void iopMemWrite32(u32 mem, u32 value) { } - if(psHu32(0x1000F240) & temp) psHu32(0x1000F240) &= ~temp; - else psHu32(0x1000F240) |= temp; + if(psHu32(0x1000F240) & temp) + psHu32(0x1000F240) &= ~temp; + else + psHu32(0x1000F240) |= temp; return; } + case 0x60: psHu32(0x1000F260) = 0; - return; - + return; } psxSu32(mem) = value; - // write to ps2 mem - if( (mem & 0xf0) != 0x60 ) - *(u32*)(PS2MEM_HW+0xf200+(mem&0xf0)) = value; + // wtf? why were we writing to the EE's sif space? Commenting this out doesn't + // break any of my games, and should be more correct, but I guess we'll see. --air + //*(u32*)(PS2MEM_HW+0xf200+(mem&0xf0)) = value; return; } else if (t == 0x1000) { - DEV9write32(mem & 0x1fffffff, value); return; + DEV9write32(mem, value); return; } } } } - -#endif diff --git a/pcsx2/IopMem.h b/pcsx2/IopMem.h index c86baef464..21581df609 100644 --- a/pcsx2/IopMem.h +++ b/pcsx2/IopMem.h @@ -46,7 +46,8 @@ static __forceinline T* iopVirtMemW( u32 mem ) template static __forceinline const T* iopVirtMemR( u32 mem ) { - return (psxMemRLUT[(mem) >> 16] == 0) ? NULL : (const T*)(psxMemRLUT[(mem) >> 16] + ((mem) & 0xffff)); + mem &= 0x1fffffff; + return (psxMemRLUT[mem >> 16] == 0) ? NULL : (const T*)(psxMemRLUT[mem >> 16] + (mem & 0xffff)); } // Obtains a pointer to the IOP's physical mapping (bypasses the TLB) @@ -56,11 +57,11 @@ static __forceinline u8* iopPhysMem( u32 addr ) } #define psxSs8(mem) psxS[(mem) & 0xffff] -#define psxSs16(mem) (*(s16*)&psxS[(mem) & 0xffff]) -#define psxSs32(mem) (*(s32*)&psxS[(mem) & 0xffff]) -#define psxSu8(mem) (*(u8*) &psxS[(mem) & 0xffff]) -#define psxSu16(mem) (*(u16*)&psxS[(mem) & 0xffff]) -#define psxSu32(mem) (*(u32*)&psxS[(mem) & 0xffff]) +#define psxSs16(mem) (*(s16*)&psxS[(mem) & 0x00ff]) +#define psxSs32(mem) (*(s32*)&psxS[(mem) & 0x00ff]) +#define psxSu8(mem) (*(u8*) &psxS[(mem) & 0x00ff]) +#define psxSu16(mem) (*(u16*)&psxS[(mem) & 0x00ff]) +#define psxSu32(mem) (*(u32*)&psxS[(mem) & 0x00ff]) #define psxPs8(mem) psxP[(mem) & 0xffff] #define psxPs16(mem) (*(s16*)&psxP[(mem) & 0xffff]) From 1f36e97927176ab9b175265e7f398fd6ffa204aa Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 19 Mar 2009 04:16:24 +0000 Subject: [PATCH 72/77] Major overhaul of the savestate system! Since backwards compat of savestates got totally broken a few revisions ago anyway, I decided to take this opportunity to revamp the savestate system with some significant cleanups (yes it loses all backward compat once again). Improvements include: * Reduced state size by removing some unneeded data (faster saves now too!) * Added string tags to varios "sections" of the states to assist in troubleshooting and retaining savestate compat in future versions. * Better error handling and fewer memory leaks. * Removed some unused/obsolete data from psxRegs, Counters, and psxCounters structures. * Removed all old savestate versioning code, since none of the old versions are supported anymore anyways. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@815 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVD.cpp | 1 + pcsx2/CdRom.cpp | 12 +--- pcsx2/Counters.cpp | 79 ++++++++++++------------ pcsx2/Counters.h | 16 +++-- pcsx2/Gif.cpp | 15 +++-- pcsx2/IPU/IPU.cpp | 12 ++-- pcsx2/IopCounters.cpp | 2 + pcsx2/IopCounters.h | 3 +- pcsx2/IopSio2.cpp | 1 + pcsx2/MTGS.cpp | 2 + pcsx2/Misc.cpp | 53 +++++++++------- pcsx2/Misc.h | 5 +- pcsx2/R3000A.h | 8 +-- pcsx2/R5900.cpp | 2 +- pcsx2/SPR.cpp | 12 ++-- pcsx2/SaveState.cpp | 137 +++++++++++++++++++++++------------------- pcsx2/SaveState.h | 18 ++++-- pcsx2/Sif.cpp | 21 ++----- pcsx2/Sio.cpp | 17 ++---- pcsx2/VUmicroMem.cpp | 23 ++----- pcsx2/VifDma.cpp | 38 ++++-------- 21 files changed, 230 insertions(+), 247 deletions(-) diff --git a/pcsx2/CDVD.cpp b/pcsx2/CDVD.cpp index 79ab349afe..8f038abdda 100644 --- a/pcsx2/CDVD.cpp +++ b/pcsx2/CDVD.cpp @@ -786,6 +786,7 @@ struct Freeze_v10Compat void SaveState::cdvdFreeze() { + FreezeTag( "cdvd" ); Freeze( cdvd ); if( IsLoading() ) diff --git a/pcsx2/CdRom.cpp b/pcsx2/CdRom.cpp index 6947ae044a..e6ba423d3d 100644 --- a/pcsx2/CdRom.cpp +++ b/pcsx2/CdRom.cpp @@ -944,15 +944,9 @@ void cdrReset() { cdReadTime = (PSXCLK / 1757) * BIAS; } -void SaveState::cdrFreeze() { +void SaveState::cdrFreeze() +{ + FreezeTag( "cdrom" ); Freeze(cdr); - - // Alrighty! This code used to, for some reason, recalculate the pTransfer value - // even though it's being saved as part of the cdr struct. Probably a backwards - // compat fix with an earlier save version. - - int tmp; // = (int)(cdr.pTransfer - cdr.Transfer); - Freeze(tmp); - //if (Mode == 0) cdr.pTransfer = cdr.Transfer + tmp; } diff --git a/pcsx2/Counters.cpp b/pcsx2/Counters.cpp index 97c4016a11..cb148f8261 100644 --- a/pcsx2/Counters.cpp +++ b/pcsx2/Counters.cpp @@ -43,7 +43,9 @@ int gates = 0; // Counter 4 takes care of scanlines - hSync/hBlanks // Counter 5 takes care of vSync/vBlanks -Counter counters[6]; +Counter counters[4]; +SyncCounter hsyncCounter; +SyncCounter vsyncCounter; u32 nextsCounter; // records the cpuRegs.cycle value of the last call to rcntUpdate() s32 nextCounter; // delta from nextsCounter, in cycles, until the next rcntUpdate() @@ -101,7 +103,7 @@ static __forceinline void cpuRcntSet() int i; nextsCounter = cpuRegs.cycle; - nextCounter = (counters[5].sCycle + counters[5].CycleT) - cpuRegs.cycle; + nextCounter = (vsyncCounter.sCycle + vsyncCounter.CycleT) - cpuRegs.cycle; for (i = 0; i < 4; i++) _rcntSet( i ); @@ -124,10 +126,10 @@ void rcntInit() { counters[2].interrupt = 11; counters[3].interrupt = 12; - counters[4].modeval = MODE_HRENDER; - counters[4].sCycle = cpuRegs.cycle; - counters[5].modeval = MODE_VRENDER; - counters[5].sCycle = cpuRegs.cycle; + hsyncCounter.Mode = MODE_HRENDER; + hsyncCounter.sCycle = cpuRegs.cycle; + vsyncCounter.Mode = MODE_VRENDER; + vsyncCounter.sCycle = cpuRegs.cycle; UpdateVSyncRate(); @@ -136,7 +138,7 @@ void rcntInit() { } // debug code, used for stats -int g_nCounters[4]; +int g_nhsyncCounter; static uint iFrame = 0; #ifndef _WIN32 @@ -235,8 +237,8 @@ u32 UpdateVSyncRate() vSyncInfoCalc( &vSyncInfo, FRAMERATE_NTSC, SCANLINES_TOTAL_NTSC ); } - counters[4].CycleT = vSyncInfo.hRender; // Amount of cycles before the counter will be updated - counters[5].CycleT = vSyncInfo.Render; // Amount of cycles before the counter will be updated + hsyncCounter.CycleT = vSyncInfo.hRender; // Amount of cycles before the counter will be updated + vsyncCounter.CycleT = vSyncInfo.Render; // Amount of cycles before the counter will be updated if (Config.CustomFps > 0) { @@ -393,28 +395,28 @@ static int vblankinc = 0; __forceinline void rcntUpdate_hScanline() { - if( !cpuTestCycle( counters[4].sCycle, counters[4].CycleT ) ) return; + if( !cpuTestCycle( hsyncCounter.sCycle, hsyncCounter.CycleT ) ) return; //iopBranchAction = 1; - if (counters[4].modeval & MODE_HBLANK) { //HBLANK Start - rcntStartGate(false, counters[4].sCycle); + if (hsyncCounter.Mode & MODE_HBLANK) { //HBLANK Start + rcntStartGate(false, hsyncCounter.sCycle); psxCheckStartGate16(0); // Setup the hRender's start and end cycle information: - counters[4].sCycle += vSyncInfo.hBlank; // start (absolute cycle value) - counters[4].CycleT = vSyncInfo.hRender; // endpoint (delta from start value) - counters[4].modeval = MODE_HRENDER; + hsyncCounter.sCycle += vSyncInfo.hBlank; // start (absolute cycle value) + hsyncCounter.CycleT = vSyncInfo.hRender; // endpoint (delta from start value) + hsyncCounter.Mode = MODE_HRENDER; } else { //HBLANK END / HRENDER Begin if (CSRw & 0x4) GSCSRr |= 4; // signal if (!(GSIMR&0x400)) gsIrq(); - if (gates) rcntEndGate(false, counters[4].sCycle); + if (gates) rcntEndGate(false, hsyncCounter.sCycle); if (psxhblankgate) psxCheckEndGate16(0); // set up the hblank's start and end cycle information: - counters[4].sCycle += vSyncInfo.hRender; // start (absolute cycle value) - counters[4].CycleT = vSyncInfo.hBlank; // endpoint (delta from start value) - counters[4].modeval = MODE_HBLANK; + hsyncCounter.sCycle += vSyncInfo.hRender; // start (absolute cycle value) + hsyncCounter.CycleT = vSyncInfo.hBlank; // endpoint (delta from start value) + hsyncCounter.Mode = MODE_HBLANK; # ifdef VSYNC_DEBUG hsc++; @@ -424,30 +426,30 @@ __forceinline void rcntUpdate_hScanline() __forceinline bool rcntUpdate_vSync() { - s32 diff = (cpuRegs.cycle - counters[5].sCycle); - if( diff < counters[5].CycleT ) return false; + s32 diff = (cpuRegs.cycle - vsyncCounter.sCycle); + if( diff < vsyncCounter.CycleT ) return false; //iopBranchAction = 1; - if (counters[5].modeval == MODE_VSYNC) + if (vsyncCounter.Mode == MODE_VSYNC) { - VSyncEnd(counters[5].sCycle); + VSyncEnd(vsyncCounter.sCycle); - counters[5].sCycle += vSyncInfo.Blank; - counters[5].CycleT = vSyncInfo.Render; - counters[5].modeval = MODE_VRENDER; + vsyncCounter.sCycle += vSyncInfo.Blank; + vsyncCounter.CycleT = vSyncInfo.Render; + vsyncCounter.Mode = MODE_VRENDER; return true; } else // VSYNC end / VRENDER begin { - VSyncStart(counters[5].sCycle); + VSyncStart(vsyncCounter.sCycle); - counters[5].sCycle += vSyncInfo.Render; - counters[5].CycleT = vSyncInfo.Blank; - counters[5].modeval = MODE_VSYNC; + vsyncCounter.sCycle += vSyncInfo.Render; + vsyncCounter.CycleT = vSyncInfo.Blank; + vsyncCounter.Mode = MODE_VSYNC; // Accumulate hsync rounding errors: - counters[4].sCycle += vSyncInfo.hSyncError; + hsyncCounter.sCycle += vSyncInfo.hSyncError; # ifdef VSYNC_DEBUG vblankinc++; @@ -766,15 +768,12 @@ u32 __fastcall rcntCycle(int index) void SaveState::rcntFreeze() { - Freeze(counters); - Freeze(nextCounter); - Freeze(nextsCounter); - - // New in version 1 -- save the PAL/NTSC info! - if( GetVersion() >= 0x1 ) - { - Freeze( Config.PsxType ); - } + Freeze( counters ); + Freeze( hsyncCounter ); + Freeze( vsyncCounter ); + Freeze( nextCounter ); + Freeze( nextsCounter ); + Freeze( Config.PsxType ); if( IsLoading() ) { diff --git a/pcsx2/Counters.h b/pcsx2/Counters.h index f5b2d07253..f4c70776ee 100644 --- a/pcsx2/Counters.h +++ b/pcsx2/Counters.h @@ -66,7 +66,8 @@ struct EECNT_MODE // fixme: Cycle and sCycleT members are unused. // But they can't be removed without making a new savestate version. -struct Counter { +struct Counter +{ u32 count; union { @@ -75,10 +76,14 @@ struct Counter { }; u32 target, hold; u32 rate, interrupt; - u32 Cycle; + u32 sCycleT; // delta values should be signed. +}; + +struct SyncCounter +{ + u32 Mode; u32 sCycle; // start cycle of timer s32 CycleT; - u32 sCycleT; // delta values should be signed. }; //------------------------------------------------------------------ @@ -124,7 +129,10 @@ struct Counter { #define MODE_HBLANK 0x1 //Set for the remaining ~1/6 of 1 Scanline -extern Counter counters[6]; +extern Counter counters[4]; +extern SyncCounter hsyncCounter; +extern SyncCounter vsyncCounter; + extern s32 nextCounter; // delta until the next counter event (must be signed) extern u32 nextsCounter; diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index 5b5bab2ea9..af27c1f2c7 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -615,13 +615,12 @@ void gifMFIFOInterrupt() void SaveState::gifFreeze() { - if( GetVersion() >= 0x04 ) - { - Freeze( gifstate ); - Freeze( gifqwc ); - Freeze( gspath3done ); - Freeze( gscycles ); + FreezeTag( "GIFdma" ); - // Note: mfifocycles is not a persistent var, so no need to save it here. - } + Freeze( gifstate ); + Freeze( gifqwc ); + Freeze( gspath3done ); + Freeze( gscycles ); + + // Note: mfifocycles is not a persistent var, so no need to save it here. } diff --git a/pcsx2/IPU/IPU.cpp b/pcsx2/IPU/IPU.cpp index 96edda1524..b7b3ad5fec 100644 --- a/pcsx2/IPU/IPU.cpp +++ b/pcsx2/IPU/IPU.cpp @@ -163,14 +163,14 @@ void ipuShutdown() // fixme - ipuFreeze looks fairly broken. Should probably take a closer look at some point. -void SaveState::ipuFreeze() { +void SaveState::ipuFreeze() +{ IPUProcessInterrupt(); - if( GetVersion() < 0x04 ) - { - // old versions saved the IPU regs, but they're already saved as part of HW! - FreezeMem(ipuRegs, sizeof(IPUregisters)); - } + FreezeTag( "IPU" ); + + // old versions saved the IPU regs, but they're already saved as part of HW! + //FreezeMem(ipuRegs, sizeof(IPUregisters)); Freeze(g_nDMATransfer); Freeze(FIreadpos); diff --git a/pcsx2/IopCounters.cpp b/pcsx2/IopCounters.cpp index 10027f1ed5..b4f40c801f 100644 --- a/pcsx2/IopCounters.cpp +++ b/pcsx2/IopCounters.cpp @@ -751,6 +751,8 @@ void psxRcntSetGates() void SaveState::psxRcntFreeze() { + FreezeTag( "iopCounters" ); + Freeze(psxCounters); Freeze(psxNextCounter); Freeze(psxNextsCounter); diff --git a/pcsx2/IopCounters.h b/pcsx2/IopCounters.h index 8012b5ace2..058052548a 100644 --- a/pcsx2/IopCounters.h +++ b/pcsx2/IopCounters.h @@ -25,8 +25,7 @@ struct psxCounter { u64 count, target; u32 mode; - u32 rate, interrupt, otarget; - u32 sCycle, Cycle; + u32 rate, interrupt; u32 sCycleT; s32 CycleT; }; diff --git a/pcsx2/IopSio2.cpp b/pcsx2/IopSio2.cpp index 04e704e47a..c4270b7465 100644 --- a/pcsx2/IopSio2.cpp +++ b/pcsx2/IopSio2.cpp @@ -203,6 +203,7 @@ u8 sio2_fifoOut(){ void SaveState::sio2Freeze() { + FreezeTag( "sio2" ); Freeze(sio2); } diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 485ba722d7..bc94623e9b 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -116,6 +116,8 @@ static void _mtgsFreezeGIF( SaveState& state, GIFPath (&paths)[3] ) void SaveState::mtgsFreeze() { + FreezeTag( "mtgs" ); + if( mtgsThread != NULL ) { mtgsThread->Freeze( *this ); diff --git a/pcsx2/Misc.cpp b/pcsx2/Misc.cpp index 676ace76b2..738550ad32 100644 --- a/pcsx2/Misc.cpp +++ b/pcsx2/Misc.cpp @@ -176,9 +176,9 @@ u32 GetBiosVersion() { } //2002-09-22 (Florin) -int IsBIOS(char *filename, char *description) +int IsBIOS(const char *filename, char *description) { - char ROMVER[14+1], zone[12+1]; + char ROMVER[14+1]; FILE *fp; unsigned int fileOffset=0, found=FALSE; struct romdir rd; @@ -200,31 +200,38 @@ int IsBIOS(char *filename, char *description) return FALSE; //Unable to locate ROMDIR structure in file or a ioprpXXX.img } - while(strlen(rd.fileName) > 0){ - if (strcmp(rd.fileName, "ROMVER") == 0){ // found romver - unsigned int filepos=ftell(fp); + while(strlen(rd.fileName) > 0) + { + if (strcmp(rd.fileName, "ROMVER") == 0) // found romver + { + uint filepos = ftell(fp); fseek(fp, fileOffset, SEEK_SET); if (fread(&ROMVER, 14, 1, fp) == 0) break; fseek(fp, filepos, SEEK_SET);//go back - - switch(ROMVER[4]){ - case 'T':sprintf(zone, "T10K "); break; - case 'X':sprintf(zone, "Test ");break; - case 'J':sprintf(zone, "Japan "); break; - case 'A':sprintf(zone, "USA "); break; - case 'E':sprintf(zone, "Europe"); break; - case 'H':sprintf(zone, "HK "); break; - case 'P':sprintf(zone, "Free "); break; - case 'C':sprintf(zone, "China "); break; - default: sprintf(zone, "%c ",ROMVER[4]); break;//shoudn't show + + const char zonefail[2] = { ROMVER[4], '\0' }; // the default "zone" (unknown code) + const char* zone = zonefail; + + switch(ROMVER[4]) + { + case 'T': zone = "T10K "; break; + case 'X': zone = "Test "; break; + case 'J': zone = "Japan "; break; + case 'A': zone = "USA "; break; + case 'E': zone = "Europe"; break; + case 'H': zone = "HK "; break; + case 'P': zone = "Free "; break; + case 'C': zone = "China "; break; } - sprintf(description, "%s vXX.XX(XX/XX/XXXX) %s", zone, - ROMVER[5]=='C'?"Console":ROMVER[5]=='D'?"Devel":""); - strncpy(description+ 8, ROMVER+ 0, 2);//ver major - strncpy(description+11, ROMVER+ 2, 2);//ver minor - strncpy(description+14, ROMVER+12, 2);//day - strncpy(description+17, ROMVER+10, 2);//month - strncpy(description+20, ROMVER+ 6, 4);//year + + sprintf(description, "%s v%c%c.%c%c(%c%c/%c%c/%c%c%c%c) %s", zone, + ROMVER[0], ROMVER[1], // ver major + ROMVER[2], ROMVER[3], // ver minor + ROMVER[12], ROMVER[13], // day + ROMVER[10], ROMVER[11], // month + ROMVER[6], ROMVER[7], ROMVER[8], ROMVER[9], // year! + (ROMVER[5]=='C') ? "Console" : (ROMVER[5]=='D') ? "Devel" : "" + ); found = TRUE; } diff --git a/pcsx2/Misc.h b/pcsx2/Misc.h index 0f9648b24d..d90a1cf020 100644 --- a/pcsx2/Misc.h +++ b/pcsx2/Misc.h @@ -55,8 +55,9 @@ extern u64 GetCPUTicks(); extern u64 GetTickFrequency(); // Used in Misc,and Windows/Linux files. -void ProcessFKeys(int fkey, int shift); // processes fkey related commands value 1-12 -int IsBIOS(char *filename, char *description); +extern void ProcessFKeys(int fkey, int shift); // processes fkey related commands value 1-12 +extern int IsBIOS(const char *filename, char *description); + char *ParseLang(char *id); extern const char *LabelAuthors; extern const char *LabelGreets; diff --git a/pcsx2/R3000A.h b/pcsx2/R3000A.h index 2c6f1cadcd..41cb4862a5 100644 --- a/pcsx2/R3000A.h +++ b/pcsx2/R3000A.h @@ -112,10 +112,10 @@ struct psxRegisters { u32 code; /* The instruction */ u32 cycle; u32 interrupt; - u32 sCycle[64]; // start cycle for signaled ints - s32 eCycle[64]; // cycle delta for signaled ints (sCycle + eCycle == branch cycle) - u32 _msflag[32]; - u32 _smflag[32]; + u32 sCycle[32]; // start cycle for signaled ints + s32 eCycle[32]; // cycle delta for signaled ints (sCycle + eCycle == branch cycle) + //u32 _msflag[32]; + //u32 _smflag[32]; }; PCSX2_ALIGNED16_EXTERN(psxRegisters psxRegs); diff --git a/pcsx2/R5900.cpp b/pcsx2/R5900.cpp index 78ad012144..b7e179f542 100644 --- a/pcsx2/R5900.cpp +++ b/pcsx2/R5900.cpp @@ -522,7 +522,7 @@ __forceinline bool _cpuBranchTest_Shared() cpuSetNextBranchDelta( ((g_psxNextBranchCycle-psxRegs.cycle)*8) - EEsCycle ); // Apply the hsync counter's nextCycle - cpuSetNextBranch( counters[4].sCycle, counters[4].CycleT ); + cpuSetNextBranch( hsyncCounter.sCycle, hsyncCounter.CycleT ); // Apply vsync and other counter nextCycles cpuSetNextBranch( nextsCounter, nextCounter ); diff --git a/pcsx2/SPR.cpp b/pcsx2/SPR.cpp index d346f33c0e..c9b59e1a25 100644 --- a/pcsx2/SPR.cpp +++ b/pcsx2/SPR.cpp @@ -454,11 +454,9 @@ void SPRTOinterrupt() void SaveState::sprFreeze() { - // Gotta save the weird ref-style DMA timing vars! - if( GetVersion() >= 0x05 ) - { - Freeze(spr0finished); - Freeze(spr1finished); - Freeze(mfifotransferred); - } + FreezeTag( "SPRdma" ); + + Freeze(spr0finished); + Freeze(spr1finished); + Freeze(mfifotransferred); } \ No newline at end of file diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 762a1ca4bf..106fc0adc5 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -53,7 +53,9 @@ string SaveState::GetFilename( int slot ) return Path::Combine( SSTATES_DIR, fmt_string( "%8.8X.%3.3d", ElfCRC, slot ) ); } -SaveState::SaveState( const char* msg, const string& destination ) : m_version( g_SaveVersion ) +SaveState::SaveState( const char* msg, const string& destination ) : + m_version( g_SaveVersion ) +, m_tagspace( 128 ) { Console::WriteLn( "%s %hs", params msg, &destination ); } @@ -77,44 +79,76 @@ s32 CALLBACK gsSafeFreeze( int mode, freezeData *data ) } } +void SaveState::FreezeTag( const char* src ) +{ + const int length = strlen( src ); + m_tagspace.MakeRoomFor( length+1 ); + + strcpy( m_tagspace.GetPtr(), src ); + FreezeMem( m_tagspace.GetPtr(), length ); + + if( strcmp( m_tagspace.GetPtr(), src ) != 0 ) + { + assert( 0 ); + throw Exception::BadSavedState( string( "Tag: " )+src ); + } +} + void SaveState::FreezeAll() { if( IsLoading() ) PreLoadPrep(); + + // Check the BIOS, and issue a warning if the bios for this state + // doesn't match the bios currently being used (chances are it'll still + // work fine, but some games are very picky). - FreezeMem(PS2MEM_BASE, Ps2MemSize::Base); // 32 MB main memory - FreezeMem(PS2MEM_ROM, Ps2MemSize::Rom); // 4 mb rom memory - FreezeMem(PS2MEM_ROM1, Ps2MemSize::Rom1); // 256kb rom1 memory + char descout[128], descin[128]; + memzero_obj( descout ); + IsBIOS( Config.Bios, descout ); + memcpy_fast( descin, descout, 128 ); + Freeze( descin ); + + if( memcmp( descin, descout, 128 ) != 0 ) + { + Console::Error( + "\n\tWarning: BIOS Version Mismatch, savestate may be unstable!\n" + "\t\tCurrent BIOS: %s\n" + "\t\tSavestate BIOS: %s\n", + params descout, descin + ); + } + + // First Block - Memory Dumps + // --------------------------- + FreezeMem(PS2MEM_BASE, Ps2MemSize::Base); // 32 MB main memory FreezeMem(PS2MEM_SCRATCH, Ps2MemSize::Scratch); // scratch pad - FreezeMem(PS2MEM_HW, Ps2MemSize::Hardware); // hardware memory + FreezeMem(PS2MEM_HW, Ps2MemSize::Hardware); // hardware memory + FreezeMem(psxM, Ps2MemSize::IopRam); // 2 MB main memory + FreezeMem(psxH, Ps2MemSize::IopHardware); // hardware memory + FreezeMem(psxS, 0x000100); // iop's sif memory + + // Second Block - Various CPU Registers and States + // ----------------------------------------------- + FreezeTag( "cpuRegs" ); Freeze(cpuRegs); // cpu regs + COP0 Freeze(psxRegs); // iop regs - if (GetVersion() >= 0x6) - Freeze(fpuRegs); - else - { - // Old versiosn didn't save the ACCflags... - FreezeLegacy(fpuRegs, sizeof(u32)); // fpu regs - fpuRegs.ACCflag = 0; - } + Freeze(fpuRegs); Freeze(tlb); // tlbs + // Third Block - Cycle Timers and Events + // ------------------------------------- + FreezeTag( "Cycles" ); Freeze(EEsCycle); Freeze(EEoCycle); - Freeze(psxRegs.cycle); // used to be IOPoCycle. This retains compatibility. Freeze(g_nextBranchCycle); Freeze(g_psxNextBranchCycle); - Freeze(s_iLastCOP0Cycle); Freeze(s_iLastPERFCycle); - u32 dummy = 1; - Freeze( dummy ); // was g_psxWriteOk - - - //hope didn't forgot any cpu.... - + // Fourth Block - EE-related systems + // --------------------------------- rcntFreeze(); gsFreeze(); vuMicroFreeze(); @@ -125,17 +159,16 @@ void SaveState::FreezeAll() gifFreeze(); sprFreeze(); - // iop now - FreezeMem(psxM, Ps2MemSize::IopRam); // 2 MB main memory - FreezeMem(psxH, Ps2MemSize::IopHardware); // hardware memory - //FreezeMem(psxS, 0x00010000); // sif memory - + // Fifth Block - iop-related systems + // --------------------------------- + psxRcntFreeze(); sioFreeze(); + sio2Freeze(); cdrFreeze(); cdvdFreeze(); - psxRcntFreeze(); - sio2Freeze(); + // Sixth Block - Plugins Galore! + // ----------------------------- FreezePlugin( "GS", gsSafeFreeze ); FreezePlugin( "SPU2", SPU2freeze ); FreezePlugin( "DEV9", DEV9freeze ); @@ -147,18 +180,6 @@ void SaveState::FreezeAll() PostLoadPrep(); } -// this function is yet incomplete. Version numbers hare still < 0x12 so it won't be run. -// (which is good because it won't work :P) -void SaveState::_testCdvdCrc() -{ - /*if( GetVersion() < 0x0012 ) return; - - u32 thiscrc = ElfCRC; - Freeze( thiscrc ); - if( thiscrc != ElfCRC ) - throw Exception::StateCrcMismatch( thiscrc, ElfCRC );*/ -} - ///////////////////////////////////////////////////////////////////////////// // gzipped to/from disk state saves implementation @@ -215,8 +236,6 @@ gzLoadingState::gzLoadingState( const string& filename ) : "\tThe savestate was created with a newer version of Pcsx2. I don't know how to load it!" ); throw Exception::UnsupportedStateVersion( m_version ); } - - _testCdvdCrc(); } gzLoadingState::~gzLoadingState() { } @@ -229,34 +248,30 @@ void gzSavingState::FreezeMem( void* data, int size ) void gzLoadingState::FreezeMem( void* data, int size ) { - gzread( m_file, data, size ); - if( gzeof( m_file ) ) + if( gzread( m_file, data, size ) != size ) throw Exception::BadSavedState( m_filename ); } void gzSavingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int mode, freezeData *data) ) { - Console::WriteLn( "\tSaving %s", params name ); freezeData fP = { 0, NULL }; + Console::WriteLn( "\tSaving %s", params name ); + + FreezeTag( name ); if (freezer(FREEZE_SIZE, &fP) == -1) throw Exception::FreezePluginFailure( name, "saving" ); - gzwrite(m_file, &fP.size, sizeof(fP.size)); + Freeze( fP.size ); if( fP.size == 0 ) return; - fP.data = (s8*)malloc(fP.size); - if (fP.data == NULL) - throw Exception::OutOfMemory(); + SafeArray buffer( fP.size ); + fP.data = buffer.GetPtr(); if(freezer(FREEZE_SAVE, &fP) == -1) throw Exception::FreezePluginFailure( name, "saving" ); - if (fP.size) - { - gzwrite(m_file, fP.data, fP.size); - free(fP.data); - } + FreezeMem( fP.data, fP.size ); } void gzLoadingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int mode, freezeData *data) ) @@ -264,21 +279,17 @@ void gzLoadingState::FreezePlugin( const char* name, s32 (CALLBACK *freezer)(int freezeData fP = { 0, NULL }; Console::WriteLn( "\tLoading %s", params name ); - gzread(m_file, &fP.size, sizeof(fP.size)); + FreezeTag( name ); + Freeze( fP.size ); if( fP.size == 0 ) return; - fP.data = (s8*)malloc(fP.size); - if (fP.data == NULL) - throw Exception::OutOfMemory(); - int read = gzread(m_file, fP.data, fP.size); + SafeArray buffer( fP.size ); + fP.data = buffer.GetPtr(); - if( read != fP.size ) - throw Exception::BadSavedState( m_filename ); + FreezeMem( fP.data, fP.size ); if(freezer(FREEZE_LOAD, &fP) == -1) throw Exception::FreezePluginFailure( name, "loading" ); - - if (fP.size) free(fP.data); } ////////////////////////////////////////////////////////////////////////////////// diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index d7fe5fb242..380f7185e3 100644 --- a/pcsx2/SaveState.h +++ b/pcsx2/SaveState.h @@ -24,10 +24,14 @@ #include "PS2Edefs.h" #endif #include "System.h" + // Savestate Versioning! // If you make changes to the savestate version, please increment the value below. +// If the change is minor and compatibility with old states is retained, increment +// the lower 16 bit value. IF the change is breaking of all compatibility with old +// states, increment the upper 16 bit value, and clear the lower 16 bits to 0. -static const u32 g_SaveVersion = 0x8b400006; +static const u32 g_SaveVersion = 0x8b410000; // this function is meant to be used in the place of GSfreeze, and provides a safe layer // between the GS saving function and the MTGS's needs. :) @@ -41,6 +45,7 @@ class SaveState { protected: u32 m_version; // version of the savestate being loaded. + SafeArray m_tagspace; public: SaveState( const char* msg, const string& destination ); @@ -76,6 +81,12 @@ public: FreezeMem( &data, sizeof( T ) - sizeOfNewStuff ); } + // Freezes an identifier value into the savestate for troubleshooting purposes. + // Identifiers can be used to determine where in a savestate that data has become + // skewed (if the value does not match then the error occurs somewhere prior to that + // position). + void FreezeTag( const char* src ); + // Loads or saves a plugin. Plugin name is for console logging purposes. virtual void FreezePlugin( const char* name, s32 (CALLBACK* freezer)(int mode, freezeData *data) )=0; @@ -95,11 +106,6 @@ public: protected: - // Used internally by constructors to check the cdvd's crc against the CRC of the savestate. - // This allows for proper exception handling of changed CDs on-the-fly. - void _testCdvdCrc(); - - // Load/Save functions for the various components of our glorious emulator! void rcntFreeze(); diff --git a/pcsx2/Sif.cpp b/pcsx2/Sif.cpp index 06b11b45b3..0456780b60 100644 --- a/pcsx2/Sif.cpp +++ b/pcsx2/Sif.cpp @@ -586,22 +586,13 @@ __forceinline void dmaSIF2() { } -void SaveState::sifFreeze() { +void SaveState::sifFreeze() +{ + FreezeTag( "SIFdma" ); + Freeze(sif0); Freeze(sif1); - if( GetVersion() >= 0x0002 ) - { - Freeze(eesifbusy); - Freeze(iopsifbusy); - } - else if( IsLoading() ) - { - // Old savestate, inferior data so... - // Take an educated guess on what they should be. Or well, set to 1 because - // it more or less forces them to "kick" - - iopsifbusy[0] = eesifbusy[0] = 1; - iopsifbusy[1] = eesifbusy[1] = 1; - } + Freeze(eesifbusy); + Freeze(iopsifbusy); } diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index 894ad7e180..8e17a70ccc 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -566,22 +566,15 @@ void SaveState::sioFreeze() // CRCs for memory cards. u64 m_mcdCRCs[2]; + FreezeTag( "sio" ); Freeze( sio ); - // versions prior to 3 didn't have CRCs. - if( GetVersion() >= 0x03 ) + if( IsSaving() ) { - if( IsSaving() ) - { - for( int i=0; i<2; ++i ) - m_mcdCRCs[i] = MemoryCard::GetCRC( i ); - } - Freeze( m_mcdCRCs ); - } - else - { - m_mcdCRCs[0] = m_mcdCRCs[1] = 0; + for( int i=0; i<2; ++i ) + m_mcdCRCs[i] = MemoryCard::GetCRC( i ); } + Freeze( m_mcdCRCs ); if( IsLoading() && Config.McdEnableEject ) { diff --git a/pcsx2/VUmicroMem.cpp b/pcsx2/VUmicroMem.cpp index 1c31f324aa..bdcef00d31 100644 --- a/pcsx2/VUmicroMem.cpp +++ b/pcsx2/VUmicroMem.cpp @@ -160,6 +160,8 @@ void vuMicroMemReset() void SaveState::vuMicroFreeze() { + FreezeTag( "vuMicro" ); + jASSUME( VU0.Mem != NULL ); jASSUME( VU1.Mem != NULL ); @@ -169,15 +171,7 @@ void SaveState::vuMicroFreeze() FreezeMem(VU0.Micro, 4*1024); Freeze(VU0.VF); - if( GetVersion() >= 0x02 ) - Freeze(VU0.VI); - else - { - // Old versions stored the VIregs as 32 bit values... - memzero_obj( VU0.VI ); - for(int i=0; i<32; i++ ) - Freeze( VU0.VI[i].UL ); - } + Freeze(VU0.VI); Freeze(VU1.ACC); Freeze(VU1.code); @@ -185,14 +179,5 @@ void SaveState::vuMicroFreeze() FreezeMem(VU1.Micro, 16*1024); Freeze(VU1.VF); - if( GetVersion() >= 0x02 ) - Freeze(VU1.VI); - else - { - // Old versions stored the VIregs as 32 bit values... - memzero_obj( VU1.VI ); - for(int i=0; i<32; i++ ) - Freeze( VU1.VI[i].UL ); - } - + Freeze(VU1.VI); } diff --git a/pcsx2/VifDma.cpp b/pcsx2/VifDma.cpp index 0f24085f9a..c2a2d13ca5 100644 --- a/pcsx2/VifDma.cpp +++ b/pcsx2/VifDma.cpp @@ -1344,23 +1344,17 @@ void vif0Reset() { void SaveState::vif0Freeze() { + FreezeTag( "VIFdma" ); + // Dunno if this one is needed, but whatever, it's small. :) - if( GetVersion() >= 0x04 ) - Freeze( g_vifCycles ); + Freeze( g_vifCycles ); Freeze( vif0 ); - if( GetVersion() >= 0x04 ) - { - Freeze( g_vif0HasMask3 ); - Freeze( g_vif0Masks ); - Freeze( g_vifRow0 ); - Freeze( g_vifCol0 ); - } - else if( IsLoading() ) - { - // Hack to "help" old savestates recover... - SetNewMask(g_vif0Masks, g_vif0HasMask3, vif0Regs->mask, ~vif0Regs->mask); - } + + Freeze( g_vif0HasMask3 ); + Freeze( g_vif0Masks ); + Freeze( g_vifRow0 ); + Freeze( g_vifCol0 ); } ////////////////////////////////////////////////////////////////////////////// @@ -2357,16 +2351,8 @@ void SaveState::vif1Freeze() { Freeze(vif1); - if( GetVersion() >= 0x04 ) - { - Freeze( g_vif1HasMask3 ); - Freeze( g_vif1Masks ); - Freeze( g_vifRow1 ); - Freeze( g_vifCol1 ); - } - else if( IsLoading() ) - { - SetNewMask(g_vif1Masks, g_vif1HasMask3, vif1Regs->mask, ~vif1Regs->mask); - //if(vif1ch->chcr & 0x100) vif1.done = 0; - } + Freeze( g_vif1HasMask3 ); + Freeze( g_vif1Masks ); + Freeze( g_vifRow1 ); + Freeze( g_vifCol1 ); } From e172d0e104cca13056dbaa6f7f79eb8204b89b09 Mon Sep 17 00:00:00 2001 From: mattmenke Date: Thu, 19 Mar 2009 06:28:23 +0000 Subject: [PATCH 73/77] LilyPad: Svn release builds now have svn numbers, some configuration load/save/populate code cleanup. Two additional checkboxes that at the moment do absolutely nothing useful, so don't get too excited, probably be quite a while before I get around to hooking everything up... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@816 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/LilyPad/Config.cpp | 289 ++++++++++++++------------ plugins/LilyPad/Config.h | 40 ++-- plugins/LilyPad/LilyPad.cpp | 30 ++- plugins/LilyPad/LilyPad.rc | 8 +- plugins/LilyPad/LilyPad_VC2005.vcproj | 1 + plugins/LilyPad/resource.h | 3 +- 6 files changed, 201 insertions(+), 170 deletions(-) diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index 3ba081f37f..2b956fefd1 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -32,6 +32,37 @@ int selected = 0; HWND hWnds[2][4]; HWND hWndGeneral = 0; +struct GeneralSettingsBool { + wchar_t *name; + unsigned int ControlId; + u8 defaultValue; +}; + +// Ties together config data structure, config files, and general config +// dialog. +const GeneralSettingsBool BoolOptionsInfo[] = { + {L"Force Cursor Hide", IDC_FORCE_HIDE, 0}, + {L"Mouse Unfocus", IDC_MOUSE_UNFOCUS, 1}, + {L"Background", IDC_BACKGROUND, 1}, + {L"Multiple Bindings", IDC_MULTIPLE_BINDING, 0}, + + {L"DirectInput Game Devices", IDC_G_DI, 1}, + {L"XInput", IDC_G_XI, 1}, + + {L"Multitap 1", IDC_MULTITAP1, 0}, + {L"Multitap 2", IDC_MULTITAP2, 0}, + + {L"GS Thread Updates", IDC_GS_THREAD_INPUT, 1}, + {L"Escape Fullscreen Hack", IDC_ESCAPE_FULLSCREEN_HACK, 1}, + {L"Disable Screen Saver", IDC_DISABLE_SCREENSAVER, 1}, + {L"Logging", IDC_DEBUG_FILE, 0}, + + {L"Save State in Title", IDC_SAVE_STATE_TITLE, 1}, + {L"GH2", IDC_GH2_HACK, 0}, + + {L"Vista Volume", IDC_VISTA_VOLUME, 1}, +}; + void Populate(int port, int slot); void SetupLogSlider(HWND hWndSlider) { @@ -675,26 +706,16 @@ int SaveSettings(wchar_t *file=0) { // Just check first, last, and all pad bindings. Should be more than enough. No real need to check // config path. - int noError = WritePrivateProfileInt(L"General Settings", L"Force Cursor Hide", config.forceHide, file); + int noError = 1; + + for (int i=0; i= 2 + 3*(config.multitap[0]+config.multitap[1])) { + *port = 0; + *slot = 0; + return 0; + } + if (index < 1 + 3*config.multitap[0]) { + *port = 0; + *slot = index; + } + else { + *port = 1; + *slot = index-1-3*config.multitap[0]; + } + return 1; +} + void UpdatePadList(HWND hWnd) { HWND hWndList = GetDlgItem(hWnd, IDC_PAD_LIST); HWND hWndCombo = GetDlgItem(hWnd, IDC_PAD_TYPE); HWND hWndAnalog = GetDlgItem(hWnd, IDC_ANALOG_START1); - int slot = 0; + int slot; + int port; int index = 0; - for (int port=0; port<2; port++) { - wchar_t text[100]; - wsprintf(text, L"Pad %i", port); - LVITEM item; - item.iItem = index; - item.iSubItem = 0; - item.mask = LVIF_TEXT; - item.pszText = text; - if (SendMessage(hWndList, LVM_GETITEMCOUNT, 0, 0) <= index) { - ListView_InsertItem(hWndList, &item); - } - else { + wchar_t *strings[] = {L"Disabled", L"Dualshock 2", L"Guitar"}; + for (port=0; port<2; port++) { + for (slot = 0; slot<4; slot++) { + wchar_t text[100]; + if (!slot) + wsprintf(text, L"Pad %i", port+1); + else { + if (!config.multitap[port]) continue; + wsprintf(text, L"Pad %i-%i", port+1, slot+1); + } + LVITEM item; + item.iItem = index; + item.iSubItem = 0; + item.mask = LVIF_TEXT; + item.pszText = text; + if (SendMessage(hWndList, LVM_GETITEMCOUNT, 0, 0) <= index) { + ListView_InsertItem(hWndList, &item); + } + else { + ListView_SetItem(hWndList, &item); + } + + item.iSubItem = 1; + if (2 < (unsigned int)config.padConfigs[port][slot].type) config.padConfigs[port][slot].type = Dualshock2Pad; + item.pszText = strings[config.padConfigs[port][slot].type]; ListView_SetItem(hWndList, &item); - } - item.iSubItem = 1; - wchar_t *strings[] = {L"Disabled", L"Dualshock 2", L"Guitar"}; - if (2 < (unsigned int)config.padConfigs[port][slot].type) config.padConfigs[port][slot].type = Dualshock2Pad; - item.pszText = strings[config.padConfigs[port][slot].type]; - ListView_SetItem(hWndList, &item); - - item.iSubItem = 2; - int count = 0; - for (int i = 0; inumDevices; i++) { - Device *dev = dm->devices[i]; - if (!dev->enabled) continue; - count += dev->pads[port][slot].numBindings + dev->pads[port][slot].numFFBindings; + item.iSubItem = 2; + int count = 0; + for (int i = 0; inumDevices; i++) { + Device *dev = dm->devices[i]; + if (!dev->enabled) continue; + count += dev->pads[port][slot].numBindings + dev->pads[port][slot].numFFBindings; + } + wsprintf(text, L"%i", count); + item.pszText = text; + ListView_SetItem(hWndList, &item); + index++; } - wsprintf(text, L"%i", count); - item.pszText = text; - ListView_SetItem(hWndList, &item); - index++; } + while (ListView_DeleteItem(hWndList, index)); int sel = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); - EnableWindow(hWndCombo, sel>=0); - EnableWindow(hWndAnalog, sel>=0); - if (sel < 0) { + int enable; + if (!ListIndexToPortAndSlot(sel, &port, &slot)) { + enable = 0; SendMessage(hWndCombo, CB_SETCURSEL, -1, 0); CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_UNCHECKED); } else { - SendMessage(hWndCombo, CB_SETCURSEL, config.padConfigs[sel][0].type, 0); - CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_CHECKED*config.padConfigs[sel][0].autoAnalog); + enable = 1; + SendMessage(hWndCombo, CB_SETCURSEL, config.padConfigs[port][slot].type, 0); + CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_CHECKED*config.padConfigs[port][slot].autoAnalog); } + EnableWindow(hWndCombo, enable); + EnableWindow(hWndAnalog, enable); } INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM lParam) { @@ -1632,37 +1675,24 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L RefreshEnabledDevicesAndDisplay(0, hWnd, 0); UpdatePadList(hWnd); - CheckDlgButton(hWnd, IDC_BACKGROUND, BST_CHECKED * config.background); - CheckDlgButton(hWnd, IDC_FORCE_HIDE, BST_CHECKED * config.forceHide); + for (int j=0; j>1)); - CheckDlgButton(hWnd, IDC_CLOSE_HACK3, BST_CHECKED * ((config.closeHacks&4)>>2)); - CheckDlgButton(hWnd, IDC_MOUSE_UNFOCUS, BST_CHECKED * config.mouseUnfocus); - CheckDlgButton(hWnd, IDC_GS_THREAD_INPUT, BST_CHECKED * config.GSThreadUpdates); if (!ps2e) { EnableWindow(GetDlgItem(hWnd, IDC_GS_THREAD_INPUT), 0); } - CheckDlgButton(hWnd, IDC_ESCAPE_FULLSCREEN_HACK, BST_CHECKED * config.escapeFullscreenHack); - CheckDlgButton(hWnd, IDC_DISABLE_SCREENSAVER, BST_CHECKED * config.disableScreenSaver); - CheckDlgButton(hWnd, IDC_GH2_HACK, BST_CHECKED * config.GH2); - CheckDlgButton(hWnd, IDC_SAVE_STATE_TITLE, BST_CHECKED * config.saveStateTitle); - - CheckDlgButton(hWnd, IDC_VISTA_VOLUME, BST_CHECKED * config.vistaVolume); if (config.osVersion < 6) EnableWindow(GetDlgItem(hWnd, IDC_VISTA_VOLUME), 0); - CheckDlgButton(hWnd, IDC_DEBUG_FILE, BST_CHECKED * config.debug); - CheckDlgButton(hWnd, IDC_MULTIPLE_BINDING, BST_CHECKED * config.multipleBinding); - if (config.keyboardApi < 0 || config.keyboardApi > 3) config.keyboardApi = NO_API; CheckRadioButton(hWnd, IDC_KB_DISABLE, IDC_KB_RAW, IDC_KB_DISABLE + config.keyboardApi); if (config.mouseApi < 0 || config.mouseApi > 3) config.mouseApi = NO_API; CheckRadioButton(hWnd, IDC_M_DISABLE, IDC_M_RAW, IDC_M_DISABLE + config.mouseApi); - CheckDlgButton(hWnd, IDC_G_DI, BST_CHECKED * config.gameApis.directInput); - CheckDlgButton(hWnd, IDC_G_XI, BST_CHECKED * config.gameApis.xInput); - if (!InitializeRawInput()) { EnableWindow(GetDlgItem(hWnd, IDC_KB_RAW), 0); @@ -1678,11 +1708,13 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L case WM_COMMAND: if (LOWORD(wParam) == IDC_PAD_TYPE) { if (HIWORD(wParam) == CBN_SELCHANGE) { - int pad = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); HWND hWndCombo = GetDlgItem(hWnd, IDC_PAD_TYPE); + int index = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); int sel = SendMessage(hWndCombo, CB_GETCURSEL, 0, 0); - if (pad >= 0 && sel >= 0 && sel != config.padConfigs[pad][0].type) { - config.padConfigs[pad][0].type = (PadType)sel; + int port, slot; + if (sel < 0 || !ListIndexToPortAndSlot(index, &port, &slot)) break; + if (sel != config.padConfigs[port][slot].type) { + config.padConfigs[port][slot].type = (PadType)sel; UpdatePadList(hWnd); UpdatePadPages(); RefreshEnabledDevicesAndDisplay(0, hWnd, 1); @@ -1732,11 +1764,11 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L UpdatePadList(hWnd); } else if (HIWORD(wParam)==BN_CLICKED && LOWORD(wParam) == IDC_ANALOG_START1) { - int pad = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); - if (pad >= 0) { - config.padConfigs[pad][0].autoAnalog = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START1) == BST_CHECKED); - PropSheet_Changed(hWndProp, hWnd); - } + int index = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); + int port, slot; + if (!ListIndexToPortAndSlot(index, &port, &slot)) break; + config.padConfigs[port][slot].autoAnalog = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START1) == BST_CHECKED); + PropSheet_Changed(hWndProp, hWnd); } else { int t = IDC_CLOSE_HACK1; @@ -1748,28 +1780,18 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L CheckDlgButton(hWnd, IDC_CLOSE_HACK1, BST_UNCHECKED); } - config.forceHide = (IsDlgButtonChecked(hWnd, IDC_FORCE_HIDE) == BST_CHECKED); - config.closeHacks = (IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK1) == BST_CHECKED) | - ((IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK2) == BST_CHECKED)<<1) | - ((IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK3) == BST_CHECKED)<<2); - config.background = (IsDlgButtonChecked(hWnd, IDC_BACKGROUND) == BST_CHECKED); - config.mouseUnfocus = (IsDlgButtonChecked(hWnd, IDC_MOUSE_UNFOCUS) == BST_CHECKED); + int mtap = config.multitap[0] + 2*config.multitap[1]; - config.GSThreadUpdates = (IsDlgButtonChecked(hWnd, IDC_GS_THREAD_INPUT) == BST_CHECKED); - config.escapeFullscreenHack = (IsDlgButtonChecked(hWnd, IDC_ESCAPE_FULLSCREEN_HACK) == BST_CHECKED); - - config.disableScreenSaver = (IsDlgButtonChecked(hWnd, IDC_DISABLE_SCREENSAVER) == BST_CHECKED); - config.GH2 = (IsDlgButtonChecked(hWnd, IDC_GH2_HACK) == BST_CHECKED); - config.saveStateTitle = (IsDlgButtonChecked(hWnd, IDC_SAVE_STATE_TITLE) == BST_CHECKED); - - u8 newVistaVolume = (IsDlgButtonChecked(hWnd, IDC_VISTA_VOLUME) == BST_CHECKED); - if (config.vistaVolume != newVistaVolume) { - config.vistaVolume = newVistaVolume; - SetVolume(100); + for (int j=0; j>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); +#elif (_MSC_VER != 1400) + wsprintfW(out, L"LilyPad svn %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); #else wsprintfW(out, L"LilyPad %i.%i.%i", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); #endif @@ -537,6 +539,11 @@ char* CALLBACK PSEgetLibName() { sprintf(version, "LilyPad Debug (r%i)", SVN_REV); return version; #else + #if (_MSC_VER != 1400) + static char version[50]; + sprintf(version, "LilyPad svn (r%i)", SVN_REV); + return version; + #endif return "LilyPad"; #endif } @@ -617,6 +624,11 @@ s32 CALLBACK PADinit(u32 flags) { query.lastByte = 1; query.numBytes = 0; + ClearKeyQueue(); + // Just in case, when resuming emulation. + QueueKeyEvent(VK_SHIFT, KEYRELEASE); + QueueKeyEvent(VK_MENU, KEYRELEASE); + QueueKeyEvent(VK_CONTROL, KEYRELEASE); return 0; } @@ -1142,21 +1154,6 @@ DWORD WINAPI RenameWindowThreadProc(void *lpParameter) { return 0; } -// For escape fullscreen hack. This doesn't work when called from another thread, for some reason. -// That includes a new thread, independent of GS and PCSX2 thread, so use this to make sure it's -// called from the right spot. -ExtraWndProcResult KillFullScreenProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *output) { - // Prevent infinite recursion. Could also just remove this function from the list, - // but CONTINUE_BLISSFULLY_AND_RELEASE_PROC is a safer way to do that. - static int inFunction = 0; - if (!inFunction) { - inFunction = 1; - ShowWindow(hWnd, SW_MINIMIZE); - inFunction = 0; - } - return CONTINUE_BLISSFULLY_AND_RELEASE_PROC; -} - keyEvent* CALLBACK PADkeyEvent() { if (!config.GSThreadUpdates) { Update(2); @@ -1172,7 +1169,6 @@ keyEvent* CALLBACK PADkeyEvent() { QueueKeyEvent(-2, KEYPRESS); HANDLE hThread = CreateThread(0, 0, MaximizeWindowThreadProc, 0, 0, 0); if (hThread) CloseHandle(hThread); - //ShowWindowAsync(hWnd, SW_HIDE); restoreFullScreen = 1; return 0; } @@ -1190,7 +1186,7 @@ keyEvent* CALLBACK PADkeyEvent() { saveStateIndex = (saveStateIndex+10)%10; if (config.saveStateTitle) { // GSDX only checks its window's message queue at certain points or something, so - // have to do this in another thread to prevent lockup. + // have to do this in another thread to prevent deadlock. HANDLE hThread = CreateThread(0, 0, RenameWindowThreadProc, 0, 0, 0); if (hThread) CloseHandle(hThread); } diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index 4f9d958551..9fd6224740 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -224,10 +224,12 @@ BEGIN CONTROL "Allow binding multiple PS2 controls to one PC control",IDC_MULTIPLE_BINDING, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,116,182,10 GROUPBOX "Pads",IDC_STATIC,7,140,410,67 - CONTROL "",IDC_PAD_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | WS_TABSTOP,17,152,183,48,WS_EX_CLIENTEDGE - COMBOBOX IDC_PAD_TYPE,209,153,140,41,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "Port 1 Multitap",IDC_MULTITAP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,152,63,10 + CONTROL "Port 2 Multitap",IDC_MULTITAP2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,164,63,10 + CONTROL "",IDC_PAD_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_TABSTOP,81,152,183,48,WS_EX_CLIENTEDGE + COMBOBOX IDC_PAD_TYPE,270,153,140,41,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP CONTROL "Use analog mode whenever possible",IDC_ANALOG_START1, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,172,132,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,270,170,132,10 GROUPBOX "Device Diagnostics",IDC_STATIC,7,211,201,99 CONTROL "",IDC_LIST,"SysListView32",LVS_LIST | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,15,224,185,61,WS_EX_CLIENTEDGE PUSHBUTTON "Test Device",ID_TEST,86,289,57,15 diff --git a/plugins/LilyPad/LilyPad_VC2005.vcproj b/plugins/LilyPad/LilyPad_VC2005.vcproj index 961edad7c9..c7ac387621 100644 --- a/plugins/LilyPad/LilyPad_VC2005.vcproj +++ b/plugins/LilyPad/LilyPad_VC2005.vcproj @@ -80,6 +80,7 @@ Date: Thu, 19 Mar 2009 08:28:00 +0000 Subject: [PATCH 74/77] A few very minor comment cleanups; getting all my code branches in sync for when I hit the road today. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@817 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/IopCounters.h | 3 --- pcsx2/IopMem.cpp | 5 ----- pcsx2/vtlb.cpp | 4 ++-- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/pcsx2/IopCounters.h b/pcsx2/IopCounters.h index 058052548a..69c56acd74 100644 --- a/pcsx2/IopCounters.h +++ b/pcsx2/IopCounters.h @@ -19,9 +19,6 @@ #ifndef __PSXCOUNTERS_H__ #define __PSXCOUNTERS_H__ -// fixme: sCycle, Cycle, and otarget are unused -// Can't remove them without making a new savestate version though. - struct psxCounter { u64 count, target; u32 mode; diff --git a/pcsx2/IopMem.cpp b/pcsx2/IopMem.cpp index 26b56efe9d..e32657f704 100644 --- a/pcsx2/IopMem.cpp +++ b/pcsx2/IopMem.cpp @@ -17,12 +17,7 @@ */ #include "PrecompiledHeader.h" - #include "IopCommon.h" -#include "VU.h" -#include "iCore.h" -#include "Hw.h" -#include "iR3000A.h" u8 *psxM = NULL; u8 *psxP = NULL; diff --git a/pcsx2/vtlb.cpp b/pcsx2/vtlb.cpp index b10b3dbfb2..f2e3c82ba4 100644 --- a/pcsx2/vtlb.cpp +++ b/pcsx2/vtlb.cpp @@ -55,7 +55,7 @@ namespace vtlb_private // first indexer -- 8/16/32/64/128 bit tables [values 0-4] // second indexer -- read/write [0 or 1] - // third indexer -- 128 pages of memory! + // third indexer -- 128 possible handlers! void* RWFT[5][2][128]; } @@ -97,7 +97,7 @@ callfunction: // Interpreter Implementations of VTLB Memory Operations. // See recVTLB.cpp for the dynarec versions. -// Interpreterd VTLB lookup for 8, 16, and 32 bit accesses +// Interpreted VTLB lookup for 8, 16, and 32 bit accesses template __forceinline DataType __fastcall MemOp_r0(u32 addr) { From 774929b273ae2d7f863d1c6546c17b5b6e0686e2 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Thu, 19 Mar 2009 09:44:57 +0000 Subject: [PATCH 75/77] Linux: Fix a minor breakage in the gui code I just noticed... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@818 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Linux/interface.c | 542 ++ pcsx2/Linux/pcsx2.glade | 14043 +++++++++++++++++++++++--------------- 2 files changed, 9036 insertions(+), 5549 deletions(-) diff --git a/pcsx2/Linux/interface.c b/pcsx2/Linux/interface.c index d35247ad3b..62bceb6fdc 100644 --- a/pcsx2/Linux/interface.c +++ b/pcsx2/Linux/interface.c @@ -104,110 +104,132 @@ create_AdvDlg (void) GtkWidget *button80; AdvDlg = gtk_dialog_new (); + gtk_widget_set_name (AdvDlg, "AdvDlg"); gtk_window_set_title (GTK_WINDOW (AdvDlg), _("Advanced Options")); gtk_window_set_type_hint (GTK_WINDOW (AdvDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox4 = GTK_DIALOG (AdvDlg)->vbox; + gtk_widget_set_name (dialog_vbox4, "dialog_vbox4"); gtk_widget_show (dialog_vbox4); hbox33 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox33, "hbox33"); gtk_widget_show (hbox33); gtk_box_pack_start (GTK_BOX (dialog_vbox4), hbox33, TRUE, TRUE, 0); vbox52 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox52, "vbox52"); gtk_widget_show (vbox52); gtk_box_pack_start (GTK_BOX (hbox33), vbox52, TRUE, TRUE, 0); frame24 = gtk_frame_new (NULL); + gtk_widget_set_name (frame24, "frame24"); gtk_widget_show (frame24); gtk_box_pack_start (GTK_BOX (vbox52), frame24, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame24), GTK_SHADOW_NONE); alignment19 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment19, "alignment19"); gtk_widget_show (alignment19); gtk_container_add (GTK_CONTAINER (frame24), alignment19); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment19), 0, 0, 12, 0); vbox53 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox53, "vbox53"); gtk_widget_show (vbox53); gtk_container_add (GTK_CONTAINER (alignment19), vbox53); frame26 = gtk_frame_new (NULL); + gtk_widget_set_name (frame26, "frame26"); gtk_widget_show (frame26); gtk_box_pack_start (GTK_BOX (vbox53), frame26, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame26), GTK_SHADOW_NONE); alignment21 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment21, "alignment21"); gtk_widget_show (alignment21); gtk_container_add (GTK_CONTAINER (frame26), alignment21); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment21), 0, 0, 12, 0); hbox35 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox35, "hbox35"); gtk_widget_show (hbox35); gtk_container_add (GTK_CONTAINER (alignment21), hbox35); radio_EE_Round_Near = gtk_radio_button_new_with_mnemonic (NULL, _("Nearest")); + gtk_widget_set_name (radio_EE_Round_Near, "radio_EE_Round_Near"); gtk_widget_show (radio_EE_Round_Near); gtk_box_pack_start (GTK_BOX (hbox35), radio_EE_Round_Near, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Round_Near), radio_EE_Round_Near_group); radio_EE_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Round_Near)); radio_EE_Round_Negative = gtk_radio_button_new_with_mnemonic (NULL, _("Negative")); + gtk_widget_set_name (radio_EE_Round_Negative, "radio_EE_Round_Negative"); gtk_widget_show (radio_EE_Round_Negative); gtk_box_pack_start (GTK_BOX (hbox35), radio_EE_Round_Negative, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Round_Negative), radio_EE_Round_Near_group); radio_EE_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Round_Negative)); radio_EE_Round_Positive = gtk_radio_button_new_with_mnemonic (NULL, _("Positive")); + gtk_widget_set_name (radio_EE_Round_Positive, "radio_EE_Round_Positive"); gtk_widget_show (radio_EE_Round_Positive); gtk_box_pack_start (GTK_BOX (hbox35), radio_EE_Round_Positive, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Round_Positive), radio_EE_Round_Near_group); radio_EE_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Round_Positive)); radio_EE_Round_Zero = gtk_radio_button_new_with_mnemonic (NULL, _("Chop/Zero")); + gtk_widget_set_name (radio_EE_Round_Zero, "radio_EE_Round_Zero"); gtk_widget_show (radio_EE_Round_Zero); gtk_box_pack_start (GTK_BOX (hbox35), radio_EE_Round_Zero, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Round_Zero), radio_EE_Round_Near_group); radio_EE_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Round_Zero)); label72 = gtk_label_new (_("Round Mode")); + gtk_widget_set_name (label72, "label72"); gtk_widget_show (label72); gtk_frame_set_label_widget (GTK_FRAME (frame26), label72); gtk_label_set_use_markup (GTK_LABEL (label72), TRUE); frame27 = gtk_frame_new (NULL); + gtk_widget_set_name (frame27, "frame27"); gtk_widget_show (frame27); gtk_box_pack_start (GTK_BOX (vbox53), frame27, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame27), GTK_SHADOW_NONE); alignment22 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment22, "alignment22"); gtk_widget_show (alignment22); gtk_container_add (GTK_CONTAINER (frame27), alignment22); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment22), 0, 0, 12, 0); hbox37 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox37, "hbox37"); gtk_widget_show (hbox37); gtk_container_add (GTK_CONTAINER (alignment22), hbox37); radio_EE_Clamp_None = gtk_radio_button_new_with_mnemonic (NULL, _("None")); + gtk_widget_set_name (radio_EE_Clamp_None, "radio_EE_Clamp_None"); gtk_widget_show (radio_EE_Clamp_None); gtk_box_pack_start (GTK_BOX (hbox37), radio_EE_Clamp_None, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Clamp_None), radio_EE_Clamp_None_group); radio_EE_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Clamp_None)); radio_EE_Clamp_Normal = gtk_radio_button_new_with_mnemonic (NULL, _("Normal")); + gtk_widget_set_name (radio_EE_Clamp_Normal, "radio_EE_Clamp_Normal"); gtk_widget_show (radio_EE_Clamp_Normal); gtk_box_pack_start (GTK_BOX (hbox37), radio_EE_Clamp_Normal, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Normal), radio_EE_Clamp_None_group); radio_EE_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Normal)); radio_EE_Clamp_Extra_Preserve = gtk_radio_button_new_with_mnemonic (NULL, _("Extra + Preserve Sign")); + gtk_widget_set_name (radio_EE_Clamp_Extra_Preserve, "radio_EE_Clamp_Extra_Preserve"); gtk_widget_show (radio_EE_Clamp_Extra_Preserve); gtk_box_pack_start (GTK_BOX (hbox37), radio_EE_Clamp_Extra_Preserve, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Extra_Preserve), radio_EE_Clamp_None_group); radio_EE_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Extra_Preserve)); radio_EE_Clamp_Full = gtk_radio_button_new_with_mnemonic (NULL, _("Full")); + gtk_widget_set_name (radio_EE_Clamp_Full, "radio_EE_Clamp_Full"); gtk_widget_show (radio_EE_Clamp_Full); gtk_box_pack_start (GTK_BOX (hbox37), radio_EE_Clamp_Full, TRUE, TRUE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_EE_Clamp_Full), radio_EE_Clamp_None_group); @@ -215,132 +237,158 @@ create_AdvDlg (void) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_EE_Clamp_Full), TRUE); label73 = gtk_label_new (_("Clamp Mode")); + gtk_widget_set_name (label73, "label73"); gtk_widget_show (label73); gtk_frame_set_label_widget (GTK_FRAME (frame27), label73); gtk_label_set_use_markup (GTK_LABEL (label73), TRUE); hbox34 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox34, "hbox34"); gtk_widget_show (hbox34); gtk_box_pack_start (GTK_BOX (vbox53), hbox34, TRUE, TRUE, 0); check_EE_Flush_Zero = gtk_check_button_new_with_mnemonic (_("Flush to Zero")); + gtk_widget_set_name (check_EE_Flush_Zero, "check_EE_Flush_Zero"); gtk_widget_show (check_EE_Flush_Zero); gtk_box_pack_start (GTK_BOX (hbox34), check_EE_Flush_Zero, FALSE, FALSE, 0); check_EE_Denormal_Zero = gtk_check_button_new_with_mnemonic (_("Denormals are Zero")); + gtk_widget_set_name (check_EE_Denormal_Zero, "check_EE_Denormal_Zero"); gtk_widget_show (check_EE_Denormal_Zero); gtk_box_pack_start (GTK_BOX (hbox34), check_EE_Denormal_Zero, FALSE, FALSE, 0); label70 = gtk_label_new (_("EE Recs Options")); + gtk_widget_set_name (label70, "label70"); gtk_widget_show (label70); gtk_frame_set_label_widget (GTK_FRAME (frame24), label70); gtk_label_set_use_markup (GTK_LABEL (label70), TRUE); frame25 = gtk_frame_new (NULL); + gtk_widget_set_name (frame25, "frame25"); gtk_widget_show (frame25); gtk_box_pack_start (GTK_BOX (vbox52), frame25, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame25), GTK_SHADOW_NONE); alignment20 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment20, "alignment20"); gtk_widget_show (alignment20); gtk_container_add (GTK_CONTAINER (frame25), alignment20); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment20), 0, 0, 12, 0); vbox54 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox54, "vbox54"); gtk_widget_show (vbox54); gtk_container_add (GTK_CONTAINER (alignment20), vbox54); frame28 = gtk_frame_new (NULL); + gtk_widget_set_name (frame28, "frame28"); gtk_widget_show (frame28); gtk_box_pack_start (GTK_BOX (vbox54), frame28, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame28), GTK_SHADOW_NONE); alignment23 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment23, "alignment23"); gtk_widget_show (alignment23); gtk_container_add (GTK_CONTAINER (frame28), alignment23); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment23), 0, 0, 12, 0); hbox36 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox36, "hbox36"); gtk_widget_show (hbox36); gtk_container_add (GTK_CONTAINER (alignment23), hbox36); radio_VU_Round_Near = gtk_radio_button_new_with_mnemonic (NULL, _("Nearest")); + gtk_widget_set_name (radio_VU_Round_Near, "radio_VU_Round_Near"); gtk_widget_show (radio_VU_Round_Near); gtk_box_pack_start (GTK_BOX (hbox36), radio_VU_Round_Near, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Round_Near), radio_VU_Round_Near_group); radio_VU_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Round_Near)); radio_VU_Round_Negative = gtk_radio_button_new_with_mnemonic (NULL, _("Negative")); + gtk_widget_set_name (radio_VU_Round_Negative, "radio_VU_Round_Negative"); gtk_widget_show (radio_VU_Round_Negative); gtk_box_pack_start (GTK_BOX (hbox36), radio_VU_Round_Negative, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Round_Negative), radio_VU_Round_Near_group); radio_VU_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Round_Negative)); radio_VU_Round_Positive = gtk_radio_button_new_with_mnemonic (NULL, _("Positive")); + gtk_widget_set_name (radio_VU_Round_Positive, "radio_VU_Round_Positive"); gtk_widget_show (radio_VU_Round_Positive); gtk_box_pack_start (GTK_BOX (hbox36), radio_VU_Round_Positive, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Round_Positive), radio_VU_Round_Near_group); radio_VU_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Round_Positive)); radio_VU_Round_Zero = gtk_radio_button_new_with_mnemonic (NULL, _("Zero")); + gtk_widget_set_name (radio_VU_Round_Zero, "radio_VU_Round_Zero"); gtk_widget_show (radio_VU_Round_Zero); gtk_box_pack_start (GTK_BOX (hbox36), radio_VU_Round_Zero, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Round_Zero), radio_VU_Round_Near_group); radio_VU_Round_Near_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Round_Zero)); label74 = gtk_label_new (_("Round Mode")); + gtk_widget_set_name (label74, "label74"); gtk_widget_show (label74); gtk_frame_set_label_widget (GTK_FRAME (frame28), label74); gtk_label_set_use_markup (GTK_LABEL (label74), TRUE); frame29 = gtk_frame_new (NULL); + gtk_widget_set_name (frame29, "frame29"); gtk_widget_show (frame29); gtk_box_pack_start (GTK_BOX (vbox54), frame29, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame29), GTK_SHADOW_NONE); alignment24 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment24, "alignment24"); gtk_widget_show (alignment24); gtk_container_add (GTK_CONTAINER (frame29), alignment24); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment24), 0, 0, 12, 0); hbox38 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox38, "hbox38"); gtk_widget_show (hbox38); gtk_container_add (GTK_CONTAINER (alignment24), hbox38); radio_VU_Clamp_None = gtk_radio_button_new_with_mnemonic (NULL, _("None")); + gtk_widget_set_name (radio_VU_Clamp_None, "radio_VU_Clamp_None"); gtk_widget_show (radio_VU_Clamp_None); gtk_box_pack_start (GTK_BOX (hbox38), radio_VU_Clamp_None, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Clamp_None), radio_VU_Clamp_None_group); radio_VU_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Clamp_None)); radio_VU_Clamp_Normal = gtk_radio_button_new_with_mnemonic (NULL, _("Normal")); + gtk_widget_set_name (radio_VU_Clamp_Normal, "radio_VU_Clamp_Normal"); gtk_widget_show (radio_VU_Clamp_Normal); gtk_box_pack_start (GTK_BOX (hbox38), radio_VU_Clamp_Normal, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Normal), radio_VU_Clamp_None_group); radio_VU_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Normal)); radio_VU_Clamp_Extra = gtk_radio_button_new_with_mnemonic (NULL, _("Extra")); + gtk_widget_set_name (radio_VU_Clamp_Extra, "radio_VU_Clamp_Extra"); gtk_widget_show (radio_VU_Clamp_Extra); gtk_box_pack_start (GTK_BOX (hbox38), radio_VU_Clamp_Extra, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Extra), radio_VU_Clamp_None_group); radio_VU_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Extra)); radio_VU_Clamp_Extra_Preserve = gtk_radio_button_new_with_mnemonic (NULL, _("Extra + Preserve Sign")); + gtk_widget_set_name (radio_VU_Clamp_Extra_Preserve, "radio_VU_Clamp_Extra_Preserve"); gtk_widget_show (radio_VU_Clamp_Extra_Preserve); gtk_box_pack_start (GTK_BOX (hbox38), radio_VU_Clamp_Extra_Preserve, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Extra_Preserve), radio_VU_Clamp_None_group); radio_VU_Clamp_None_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_VU_Clamp_Extra_Preserve)); label75 = gtk_label_new (_("Clamp Mode")); + gtk_widget_set_name (label75, "label75"); gtk_widget_show (label75); gtk_frame_set_label_widget (GTK_FRAME (frame29), label75); gtk_label_set_use_markup (GTK_LABEL (label75), TRUE); table7 = gtk_table_new (2, 2, FALSE); + gtk_widget_set_name (table7, "table7"); gtk_widget_show (table7); gtk_box_pack_start (GTK_BOX (vbox54), table7, TRUE, TRUE, 0); check_Emulate_DaZ = gtk_check_button_new_with_mnemonic (_("Software Emulate DaZ")); + gtk_widget_set_name (check_Emulate_DaZ, "check_Emulate_DaZ"); gtk_widget_show (check_Emulate_DaZ); gtk_table_attach (GTK_TABLE (table7), check_Emulate_DaZ, 1, 2, 1, 2, (GtkAttachOptions) (0), @@ -348,6 +396,7 @@ create_AdvDlg (void) gtk_widget_set_sensitive (check_Emulate_DaZ, FALSE); Check_Set_OU_Flags = gtk_check_button_new_with_mnemonic (_("Set O & U Flags")); + gtk_widget_set_name (Check_Set_OU_Flags, "Check_Set_OU_Flags"); gtk_widget_show (Check_Set_OU_Flags); gtk_table_attach (GTK_TABLE (table7), Check_Set_OU_Flags, 0, 1, 1, 2, (GtkAttachOptions) (0), @@ -355,101 +404,121 @@ create_AdvDlg (void) gtk_widget_set_sensitive (Check_Set_OU_Flags, FALSE); check_VU_Denormal_Zero = gtk_check_button_new_with_mnemonic (_("Denormals are Zero")); + gtk_widget_set_name (check_VU_Denormal_Zero, "check_VU_Denormal_Zero"); gtk_widget_show (check_VU_Denormal_Zero); gtk_table_attach (GTK_TABLE (table7), check_VU_Denormal_Zero, 1, 2, 0, 1, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); check_VU_Flush_Zero = gtk_check_button_new_with_mnemonic (_("Flush to Zero")); + gtk_widget_set_name (check_VU_Flush_Zero, "check_VU_Flush_Zero"); gtk_widget_show (check_VU_Flush_Zero); gtk_table_attach (GTK_TABLE (table7), check_VU_Flush_Zero, 0, 1, 0, 1, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); label71 = gtk_label_new (_("VU Recs Options")); + gtk_widget_set_name (label71, "label71"); gtk_widget_show (label71); gtk_frame_set_label_widget (GTK_FRAME (frame25), label71); gtk_label_set_use_markup (GTK_LABEL (label71), TRUE); vbox51 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox51, "vbox51"); gtk_widget_show (vbox51); gtk_box_pack_start (GTK_BOX (hbox33), vbox51, TRUE, TRUE, 0); frame30 = gtk_frame_new (NULL); + gtk_widget_set_name (frame30, "frame30"); gtk_widget_show (frame30); gtk_box_pack_start (GTK_BOX (vbox51), frame30, FALSE, FALSE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame30), GTK_SHADOW_NONE); alignment25 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment25, "alignment25"); gtk_widget_show (alignment25); gtk_container_add (GTK_CONTAINER (frame30), alignment25); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment25), 0, 0, 12, 0); label81 = gtk_label_new (_("These options specify how your CPU rounds floating point values.\n\nTry changing the roundmode for EE if your game hangs, it could make it work again.")); + gtk_widget_set_name (label81, "label81"); gtk_widget_show (label81); gtk_container_add (GTK_CONTAINER (alignment25), label81); gtk_label_set_line_wrap (GTK_LABEL (label81), TRUE); label78 = gtk_label_new (_("Round Mode")); + gtk_widget_set_name (label78, "label78"); gtk_widget_show (label78); gtk_frame_set_label_widget (GTK_FRAME (frame30), label78); gtk_label_set_use_markup (GTK_LABEL (label78), TRUE); frame31 = gtk_frame_new (NULL); + gtk_widget_set_name (frame31, "frame31"); gtk_widget_show (frame31); gtk_box_pack_start (GTK_BOX (vbox51), frame31, FALSE, FALSE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame31), GTK_SHADOW_NONE); alignment26 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment26, "alignment26"); gtk_widget_show (alignment26); gtk_container_add (GTK_CONTAINER (frame31), alignment26); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment26), 0, 0, 12, 0); label84 = gtk_label_new (_("These options specify how PCSX2's recompilers will clamp Infinities and NaN (Not a Number) values in the opcode instructions.\n\nNone - No clamping. (Fastest Mode)\nNormal - Clamps the result.\nExtra - Clamps the operands, the result, and anywhere in between.\nExtra + Preserve Sign - Same as \"\"Extra\"\", except preserves NaN's sign when clamping the operands. (Slowest Mode)")); + gtk_widget_set_name (label84, "label84"); gtk_widget_show (label84); gtk_container_add (GTK_CONTAINER (alignment26), label84); gtk_label_set_line_wrap (GTK_LABEL (label84), TRUE); label79 = gtk_label_new (_("Clamp Mode")); + gtk_widget_set_name (label79, "label79"); gtk_widget_show (label79); gtk_frame_set_label_widget (GTK_FRAME (frame31), label79); gtk_label_set_use_markup (GTK_LABEL (label79), TRUE); frame32 = gtk_frame_new (NULL); + gtk_widget_set_name (frame32, "frame32"); gtk_widget_show (frame32); gtk_box_pack_start (GTK_BOX (vbox51), frame32, FALSE, FALSE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame32), GTK_SHADOW_NONE); alignment27 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment27, "alignment27"); gtk_widget_show (alignment27); gtk_container_add (GTK_CONTAINER (frame32), alignment27); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment27), 0, 0, 12, 0); label83 = gtk_label_new (_("Flush to Zero - Your CPU makes Floating Point Underflows become Zero, so it does less work. (Speed Up)\n\nDenormals are Zero - Your CPU makes Floating Point Denormals become Zero, so it does less work. (Speed Up)")); + gtk_widget_set_name (label83, "label83"); gtk_widget_show (label83); gtk_container_add (GTK_CONTAINER (alignment27), label83); gtk_label_set_line_wrap (GTK_LABEL (label83), TRUE); label80 = gtk_label_new (_("Other Options")); + gtk_widget_set_name (label80, "label80"); gtk_widget_show (label80); gtk_frame_set_label_widget (GTK_FRAME (frame32), label80); gtk_label_set_use_markup (GTK_LABEL (label80), TRUE); dialog_action_area4 = GTK_DIALOG (AdvDlg)->action_area; + gtk_widget_set_name (dialog_action_area4, "dialog_action_area4"); gtk_widget_show (dialog_action_area4); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area4), GTK_BUTTONBOX_SPREAD); AdvDefaultBtn = gtk_button_new_with_mnemonic (_("Defaults")); + gtk_widget_set_name (AdvDefaultBtn, "AdvDefaultBtn"); gtk_widget_show (AdvDefaultBtn); gtk_dialog_add_action_widget (GTK_DIALOG (AdvDlg), AdvDefaultBtn, 0); GTK_WIDGET_SET_FLAGS (AdvDefaultBtn, GTK_CAN_DEFAULT); button79 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (button79, "button79"); gtk_widget_show (button79); gtk_dialog_add_action_widget (GTK_DIALOG (AdvDlg), button79, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (button79, GTK_CAN_DEFAULT); button80 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button80, "button80"); gtk_widget_show (button80); gtk_dialog_add_action_widget (GTK_DIALOG (AdvDlg), button80, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (button80, GTK_CAN_DEFAULT); @@ -577,158 +646,191 @@ create_SpeedHacksDlg (void) GtkWidget *button98; SpeedHacksDlg = gtk_dialog_new (); + gtk_widget_set_name (SpeedHacksDlg, "SpeedHacksDlg"); gtk_window_set_title (GTK_WINDOW (SpeedHacksDlg), _("PCSX2 Speed Hacks")); gtk_window_set_type_hint (GTK_WINDOW (SpeedHacksDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox3 = GTK_DIALOG (SpeedHacksDlg)->vbox; + gtk_widget_set_name (dialog_vbox3, "dialog_vbox3"); gtk_widget_show (dialog_vbox3); vbox59 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox59, "vbox59"); gtk_widget_show (vbox59); gtk_box_pack_start (GTK_BOX (dialog_vbox3), vbox59, FALSE, FALSE, 0); label88 = gtk_label_new (_("These hacks will affect the speed of PCSX2 but possibly compromise compatibility.\nIf you have problems, Disable all of these and try again.")); + gtk_widget_set_name (label88, "label88"); gtk_widget_show (label88); gtk_box_pack_start (GTK_BOX (vbox59), label88, FALSE, FALSE, 0); hbox39 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox39, "hbox39"); gtk_widget_show (hbox39); gtk_box_pack_start (GTK_BOX (vbox59), hbox39, TRUE, TRUE, 0); frame37 = gtk_frame_new (NULL); + gtk_widget_set_name (frame37, "frame37"); gtk_widget_show (frame37); gtk_box_pack_start (GTK_BOX (hbox39), frame37, TRUE, TRUE, 0); alignment32 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment32, "alignment32"); gtk_widget_show (alignment32); gtk_container_add (GTK_CONTAINER (frame37), alignment32); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment32), 0, 0, 12, 0); vbox61 = gtk_vbox_new (FALSE, 2); + gtk_widget_set_name (vbox61, "vbox61"); gtk_widget_show (vbox61); gtk_container_add (GTK_CONTAINER (alignment32), vbox61); check_default_cycle_rate = gtk_radio_button_new_with_mnemonic (NULL, _("Default Cycle Rate")); + gtk_widget_set_name (check_default_cycle_rate, "check_default_cycle_rate"); gtk_widget_show (check_default_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox61), check_default_cycle_rate, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (check_default_cycle_rate), check_default_cycle_rate_group); check_default_cycle_rate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (check_default_cycle_rate)); label98 = gtk_label_new (_("Most compatible option - recommended for everyone with high-end machines.")); + gtk_widget_set_name (label98, "label98"); gtk_widget_show (label98); gtk_box_pack_start (GTK_BOX (vbox61), label98, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label98), TRUE); gtk_misc_set_alignment (GTK_MISC (label98), 0.29, 0.5); check_1_5_cycle_rate = gtk_radio_button_new_with_mnemonic (NULL, _("Use x1.5 Cycle Rate")); + gtk_widget_set_name (check_1_5_cycle_rate, "check_1_5_cycle_rate"); gtk_widget_show (check_1_5_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox61), check_1_5_cycle_rate, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (check_1_5_cycle_rate), check_default_cycle_rate_group); check_default_cycle_rate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (check_1_5_cycle_rate)); label93 = gtk_label_new (_("Moderate speedup, and works well with most games.")); + gtk_widget_set_name (label93, "label93"); gtk_widget_show (label93); gtk_box_pack_start (GTK_BOX (vbox61), label93, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label93), TRUE); gtk_misc_set_alignment (GTK_MISC (label93), 0.29, 0.5); check_2_cycle_rate = gtk_radio_button_new_with_mnemonic (NULL, _("Use x2 Cycle Rate")); + gtk_widget_set_name (check_2_cycle_rate, "check_2_cycle_rate"); gtk_widget_show (check_2_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox61), check_2_cycle_rate, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (check_2_cycle_rate), check_default_cycle_rate_group); check_default_cycle_rate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (check_2_cycle_rate)); label94 = gtk_label_new (_("Big speedup! Works well with many games.")); + gtk_widget_set_name (label94, "label94"); gtk_widget_show (label94); gtk_box_pack_start (GTK_BOX (vbox61), label94, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label94), TRUE); gtk_misc_set_alignment (GTK_MISC (label94), 0.36, 0.5); check_3_cycle_rate = gtk_radio_button_new_with_mnemonic (NULL, _("Use x3 Cycle Rate")); + gtk_widget_set_name (check_3_cycle_rate, "check_3_cycle_rate"); gtk_widget_show (check_3_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox61), check_3_cycle_rate, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (check_3_cycle_rate), check_default_cycle_rate_group); check_default_cycle_rate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (check_3_cycle_rate)); label95 = gtk_label_new (_("Big speedup, but causes flickering or missing geometry on many games.")); + gtk_widget_set_name (label95, "label95"); gtk_widget_show (label95); gtk_box_pack_start (GTK_BOX (vbox61), label95, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label95), TRUE); gtk_misc_set_alignment (GTK_MISC (label95), 0.24, 0.5); hseparator1 = gtk_hseparator_new (); + gtk_widget_set_name (hseparator1, "hseparator1"); gtk_widget_show (hseparator1); gtk_box_pack_start (GTK_BOX (vbox61), hseparator1, FALSE, FALSE, 0); label91 = gtk_label_new (_("Important: X2 & X3 sync hacks *will* cause choppy/skippy audio on many FMV movies.\nKnown to work well with a couple games, namely Shadow of the Colossus (but breaks most other games).")); + gtk_widget_set_name (label91, "label91"); gtk_widget_show (label91); gtk_box_pack_start (GTK_BOX (vbox61), label91, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label91), TRUE); label105 = gtk_label_new (_("EmotionEngine (EE) Sync Hacks")); + gtk_widget_set_name (label105, "label105"); gtk_widget_show (label105); gtk_frame_set_label_widget (GTK_FRAME (frame37), label105); gtk_label_set_use_markup (GTK_LABEL (label105), TRUE); vbox60 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox60, "vbox60"); gtk_widget_show (vbox60); gtk_box_pack_start (GTK_BOX (hbox39), vbox60, FALSE, FALSE, 0); check_iop_cycle_rate = gtk_check_button_new_with_mnemonic (_("Enable IOP x2 Cycle Rate")); + gtk_widget_set_name (check_iop_cycle_rate, "check_iop_cycle_rate"); gtk_widget_show (check_iop_cycle_rate); gtk_box_pack_start (GTK_BOX (vbox60), check_iop_cycle_rate, FALSE, FALSE, 0); label96 = gtk_label_new (_("Small speedup, and works well with most games,")); + gtk_widget_set_name (label96, "label96"); gtk_widget_show (label96); gtk_box_pack_start (GTK_BOX (vbox60), label96, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label96), TRUE); check_wait_cycles_sync_hack = gtk_check_button_new_with_mnemonic (_("WaitCycles Sync Hack")); + gtk_widget_set_name (check_wait_cycles_sync_hack, "check_wait_cycles_sync_hack"); gtk_widget_show (check_wait_cycles_sync_hack); gtk_box_pack_start (GTK_BOX (vbox60), check_wait_cycles_sync_hack, FALSE, FALSE, 0); label97 = gtk_label_new (_("Small speedup. Works well with most games, but it may cause certain games to crash, or freeze up during bootup or stage changes.")); + gtk_widget_set_name (label97, "label97"); gtk_widget_show (label97); gtk_box_pack_start (GTK_BOX (vbox60), label97, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label97), TRUE); check_intc_sync_hack = gtk_check_button_new_with_mnemonic (_("INTC Sync Hack (experimental)")); + gtk_widget_set_name (check_intc_sync_hack, "check_intc_sync_hack"); gtk_widget_show (check_intc_sync_hack); gtk_box_pack_start (GTK_BOX (vbox60), check_intc_sync_hack, FALSE, FALSE, 0); label101 = gtk_label_new (_("Huge speedup in many games, and a pretty high compatibility rate (some games still work better with EE sync hacks).")); + gtk_widget_set_name (label101, "label101"); gtk_widget_show (label101); gtk_box_pack_start (GTK_BOX (vbox60), label101, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label101), TRUE); frame36 = gtk_frame_new (NULL); + gtk_widget_set_name (frame36, "frame36"); gtk_widget_show (frame36); gtk_box_pack_start (GTK_BOX (vbox59), frame36, FALSE, FALSE, 0); alignment31 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment31, "alignment31"); gtk_widget_show (alignment31); gtk_container_add (GTK_CONTAINER (frame36), alignment31); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment31), 0, 0, 12, 0); check_ESC_hack = gtk_check_button_new_with_mnemonic (_("Escape Hack - Use Esc key to fully exit PCSX2.")); + gtk_widget_set_name (check_ESC_hack, "check_ESC_hack"); gtk_widget_show (check_ESC_hack); gtk_container_add (GTK_CONTAINER (alignment31), check_ESC_hack); label89 = gtk_label_new (_("Miscellaneous")); + gtk_widget_set_name (label89, "label89"); gtk_widget_show (label89); gtk_frame_set_label_widget (GTK_FRAME (frame36), label89); gtk_label_set_use_markup (GTK_LABEL (label89), TRUE); dialog_action_area3 = GTK_DIALOG (SpeedHacksDlg)->action_area; + gtk_widget_set_name (dialog_action_area3, "dialog_action_area3"); gtk_widget_show (dialog_action_area3); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area3), GTK_BUTTONBOX_END); button99 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (button99, "button99"); gtk_widget_show (button99); gtk_dialog_add_action_widget (GTK_DIALOG (SpeedHacksDlg), button99, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (button99, GTK_CAN_DEFAULT); button98 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button98, "button98"); gtk_widget_show (button98); gtk_dialog_add_action_widget (GTK_DIALOG (SpeedHacksDlg), button98, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (button98, GTK_CAN_DEFAULT); @@ -795,53 +897,65 @@ create_GameFixDlg (void) GtkWidget *button83; GameFixDlg = gtk_dialog_new (); + gtk_widget_set_name (GameFixDlg, "GameFixDlg"); gtk_window_set_title (GTK_WINDOW (GameFixDlg), _("Game Special Fixes")); gtk_window_set_type_hint (GTK_WINDOW (GameFixDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox1 = GTK_DIALOG (GameFixDlg)->vbox; + gtk_widget_set_name (dialog_vbox1, "dialog_vbox1"); gtk_widget_show (dialog_vbox1); GameSettings = gtk_frame_new (NULL); + gtk_widget_set_name (GameSettings, "GameSettings"); gtk_widget_show (GameSettings); gtk_box_pack_start (GTK_BOX (dialog_vbox1), GameSettings, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (GameSettings), GTK_SHADOW_NONE); alignment5 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment5, "alignment5"); gtk_widget_show (alignment5); gtk_container_add (GTK_CONTAINER (GameSettings), alignment5); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment5), 0, 0, 12, 0); vbox30 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox30, "vbox30"); gtk_widget_show (vbox30); gtk_container_add (GTK_CONTAINER (alignment5), vbox30); check_FPU_Compare = gtk_check_button_new_with_mnemonic (_("FPU Compare Hack - Special fix for Digimon Rumble Arena 2.")); + gtk_widget_set_name (check_FPU_Compare, "check_FPU_Compare"); gtk_widget_show (check_FPU_Compare); gtk_box_pack_start (GTK_BOX (vbox30), check_FPU_Compare, FALSE, FALSE, 0); check_VU_Add_Sub = gtk_check_button_new_with_mnemonic (_("VU Add / Sub Hack - Special fix for Tri-Ace games!")); + gtk_widget_set_name (check_VU_Add_Sub, "check_VU_Add_Sub"); gtk_widget_show (check_VU_Add_Sub); gtk_box_pack_start (GTK_BOX (vbox30), check_VU_Add_Sub, FALSE, FALSE, 0); check_FPU_Mul = gtk_check_button_new_with_mnemonic (_("FPU Mul Hack - Special fix for Tales of Destiny (possibly other games).")); + gtk_widget_set_name (check_FPU_Mul, "check_FPU_Mul"); gtk_widget_show (check_FPU_Mul); gtk_box_pack_start (GTK_BOX (vbox30), check_FPU_Mul, FALSE, TRUE, 0); label42 = gtk_label_new (_("Some games need special settings.\nConfigure them here.")); + gtk_widget_set_name (label42, "label42"); gtk_widget_show (label42); gtk_frame_set_label_widget (GTK_FRAME (GameSettings), label42); gtk_label_set_use_markup (GTK_LABEL (label42), TRUE); dialog_action_area1 = GTK_DIALOG (GameFixDlg)->action_area; + gtk_widget_set_name (dialog_action_area1, "dialog_action_area1"); gtk_widget_show (dialog_action_area1); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); cancelbutton1 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (cancelbutton1, "cancelbutton1"); gtk_widget_show (cancelbutton1); gtk_dialog_add_action_widget (GTK_DIALOG (GameFixDlg), cancelbutton1, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT); button83 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button83, "button83"); gtk_widget_show (button83); gtk_dialog_add_action_widget (GTK_DIALOG (GameFixDlg), button83, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (button83, GTK_CAN_DEFAULT); @@ -888,65 +1002,78 @@ create_MemWrite32 (void) GtkWidget *button72; MemWrite32 = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (MemWrite32, "MemWrite32"); gtk_container_set_border_width (GTK_CONTAINER (MemWrite32), 5); gtk_window_set_title (GTK_WINDOW (MemWrite32), _("memWrite32")); vbox25 = gtk_vbox_new (FALSE, 5); + gtk_widget_set_name (vbox25, "vbox25"); gtk_widget_show (vbox25); gtk_container_add (GTK_CONTAINER (MemWrite32), vbox25); gtk_container_set_border_width (GTK_CONTAINER (vbox25), 5); hbox18 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox18, "hbox18"); gtk_widget_show (hbox18); gtk_box_pack_start (GTK_BOX (vbox25), hbox18, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox18), 5); label27 = gtk_label_new (_("Address ")); + gtk_widget_set_name (label27, "label27"); gtk_widget_show (label27); gtk_box_pack_start (GTK_BOX (hbox18), label27, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label27), GTK_JUSTIFY_CENTER); label25 = gtk_label_new (_("0x")); + gtk_widget_set_name (label25, "label25"); gtk_widget_show (label25); gtk_box_pack_start (GTK_BOX (hbox18), label25, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label25), GTK_JUSTIFY_CENTER); GtkEntry_Mem = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_Mem, "GtkEntry_Mem"); gtk_widget_show (GtkEntry_Mem); gtk_box_pack_start (GTK_BOX (hbox18), GtkEntry_Mem, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_Mem), 8226); hbox19 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox19, "hbox19"); gtk_widget_show (hbox19); gtk_box_pack_start (GTK_BOX (vbox25), hbox19, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox19), 5); label28 = gtk_label_new (_("Data ")); + gtk_widget_set_name (label28, "label28"); gtk_widget_show (label28); gtk_box_pack_start (GTK_BOX (hbox19), label28, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label28), GTK_JUSTIFY_CENTER); label26 = gtk_label_new (_("0x")); + gtk_widget_set_name (label26, "label26"); gtk_widget_show (label26); gtk_box_pack_start (GTK_BOX (hbox19), label26, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label26), GTK_JUSTIFY_CENTER); GtkEntry_Data = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_Data, "GtkEntry_Data"); gtk_widget_show (GtkEntry_Data); gtk_box_pack_start (GTK_BOX (hbox19), GtkEntry_Data, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_Data), 8226); hbuttonbox22 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox22, "hbuttonbox22"); gtk_widget_show (hbuttonbox22); gtk_box_pack_start (GTK_BOX (vbox25), hbuttonbox22, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox22), 30); button71 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (button71, "button71"); gtk_widget_show (button71); gtk_container_add (GTK_CONTAINER (hbuttonbox22), button71); GTK_WIDGET_SET_FLAGS (button71, GTK_CAN_DEFAULT); button72 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button72, "button72"); gtk_widget_show (button72); gtk_container_add (GTK_CONTAINER (hbuttonbox22), button72); GTK_WIDGET_SET_FLAGS (button72, GTK_CAN_DEFAULT); @@ -993,48 +1120,57 @@ create_CmdLine (void) tooltips = gtk_tooltips_new (); CmdLine = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (CmdLine, "CmdLine"); gtk_container_set_border_width (GTK_CONTAINER (CmdLine), 5); gtk_window_set_title (GTK_WINDOW (CmdLine), _("Program arguments")); gtk_window_set_modal (GTK_WINDOW (CmdLine), TRUE); vbox24 = gtk_vbox_new (FALSE, 5); + gtk_widget_set_name (vbox24, "vbox24"); gtk_widget_show (vbox24); gtk_container_add (GTK_CONTAINER (CmdLine), vbox24); gtk_container_set_border_width (GTK_CONTAINER (vbox24), 5); GtkLabel_Text = gtk_label_new (_("Fill in the command line arguments for the opened program:")); + gtk_widget_set_name (GtkLabel_Text, "GtkLabel_Text"); gtk_widget_show (GtkLabel_Text); gtk_box_pack_start (GTK_BOX (vbox24), GtkLabel_Text, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkLabel_Text), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (GtkLabel_Text), 0.1, 0.5); hbox17 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox17, "hbox17"); gtk_widget_show (hbox17); gtk_box_pack_start (GTK_BOX (vbox24), hbox17, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox17), 5); GtkEntry_dCMDLINE = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_dCMDLINE, "GtkEntry_dCMDLINE"); gtk_widget_show (GtkEntry_dCMDLINE); gtk_box_pack_start (GTK_BOX (hbox17), GtkEntry_dCMDLINE, TRUE, TRUE, 0); gtk_tooltips_set_tip (tooltips, GtkEntry_dCMDLINE, _("If you don't know what to write leave it blank"), NULL); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_dCMDLINE), 8226); GtkLabel_Note = gtk_label_new (_("Note: this is intended for developers only.")); + gtk_widget_set_name (GtkLabel_Note, "GtkLabel_Note"); gtk_widget_show (GtkLabel_Note); gtk_box_pack_start (GTK_BOX (vbox24), GtkLabel_Note, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkLabel_Note), GTK_JUSTIFY_CENTER); hbuttonbox20 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox20, "hbuttonbox20"); gtk_widget_show (hbuttonbox20); gtk_box_pack_start (GTK_BOX (vbox24), hbuttonbox20, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox20), 30); GtkButton_Ok3 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (GtkButton_Ok3, "GtkButton_Ok3"); gtk_widget_show (GtkButton_Ok3); gtk_container_add (GTK_CONTAINER (hbuttonbox20), GtkButton_Ok3); GTK_WIDGET_SET_FLAGS (GtkButton_Ok3, GTK_CAN_DEFAULT); GtkButton_Cancel2 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (GtkButton_Cancel2, "GtkButton_Cancel2"); gtk_widget_show (GtkButton_Cancel2); gtk_container_add (GTK_CONTAINER (hbuttonbox20), GtkButton_Cancel2); GTK_WIDGET_SET_FLAGS (GtkButton_Cancel2, GTK_CAN_DEFAULT); @@ -1079,66 +1215,79 @@ create_DumpRDlg (void) GtkWidget *button51; DumpRDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (DumpRDlg, "DumpRDlg"); gtk_container_set_border_width (GTK_CONTAINER (DumpRDlg), 5); gtk_window_set_title (GTK_WINDOW (DumpRDlg), _("Raw Dump")); vbox21 = gtk_vbox_new (FALSE, 5); + gtk_widget_set_name (vbox21, "vbox21"); gtk_widget_show (vbox21); gtk_container_add (GTK_CONTAINER (DumpRDlg), vbox21); gtk_container_set_border_width (GTK_CONTAINER (vbox21), 5); label18 = gtk_label_new (_("Set Dump Addr (in Hex):")); + gtk_widget_set_name (label18, "label18"); gtk_widget_show (label18); gtk_box_pack_start (GTK_BOX (vbox21), label18, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label18), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (label18), 0.1, 0.5); hbox13 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox13, "hbox13"); gtk_widget_show (hbox13); gtk_box_pack_start (GTK_BOX (vbox21), hbox13, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox13), 5); label19 = gtk_label_new (_("From 0x")); + gtk_widget_set_name (label19, "label19"); gtk_widget_show (label19); gtk_box_pack_start (GTK_BOX (hbox13), label19, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label19), GTK_JUSTIFY_CENTER); gtk_label_set_line_wrap (GTK_LABEL (label19), TRUE); GtkEntry_DumpRF = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_DumpRF, "GtkEntry_DumpRF"); gtk_widget_show (GtkEntry_DumpRF); gtk_box_pack_start (GTK_BOX (hbox13), GtkEntry_DumpRF, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_DumpRF), 8226); hbox14 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox14, "hbox14"); gtk_widget_show (hbox14); gtk_box_pack_start (GTK_BOX (vbox21), hbox14, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox14), 5); label20 = gtk_label_new (_("To 0x")); + gtk_widget_set_name (label20, "label20"); gtk_widget_show (label20); gtk_box_pack_start (GTK_BOX (hbox14), label20, FALSE, FALSE, 0); GtkEntry_DumpRT = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_DumpRT, "GtkEntry_DumpRT"); gtk_widget_show (GtkEntry_DumpRT); gtk_box_pack_start (GTK_BOX (hbox14), GtkEntry_DumpRT, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_DumpRT), 8226); label22 = gtk_label_new (_("Dump File = \"dump.txt\"")); + gtk_widget_set_name (label22, "label22"); gtk_widget_show (label22); gtk_box_pack_start (GTK_BOX (vbox21), label22, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (label22), 0.1, 0.5); hbuttonbox18 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox18, "hbuttonbox18"); gtk_widget_show (hbuttonbox18); gtk_box_pack_start (GTK_BOX (vbox21), hbuttonbox18, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox18), 30); button50 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (button50, "button50"); gtk_widget_show (button50); gtk_container_add (GTK_CONTAINER (hbuttonbox18), button50); GTK_WIDGET_SET_FLAGS (button50, GTK_CAN_DEFAULT); button51 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button51, "button51"); gtk_widget_show (button51); gtk_container_add (GTK_CONTAINER (hbuttonbox18), button51); GTK_WIDGET_SET_FLAGS (button51, GTK_CAN_DEFAULT); @@ -1186,66 +1335,79 @@ create_DumpCDlg (void) GtkWidget *button49; DumpCDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (DumpCDlg, "DumpCDlg"); gtk_container_set_border_width (GTK_CONTAINER (DumpCDlg), 5); gtk_window_set_title (GTK_WINDOW (DumpCDlg), _("Dump code")); vbox20 = gtk_vbox_new (FALSE, 5); + gtk_widget_set_name (vbox20, "vbox20"); gtk_widget_show (vbox20); gtk_container_add (GTK_CONTAINER (DumpCDlg), vbox20); gtk_container_set_border_width (GTK_CONTAINER (vbox20), 5); label15 = gtk_label_new (_("Set Dump Addr (in Hex):")); + gtk_widget_set_name (label15, "label15"); gtk_widget_show (label15); gtk_box_pack_start (GTK_BOX (vbox20), label15, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (label15), 0.1, 0.5); hbox11 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox11, "hbox11"); gtk_widget_show (hbox11); gtk_box_pack_start (GTK_BOX (vbox20), hbox11, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox11), 5); label16 = gtk_label_new (_("From 0x")); + gtk_widget_set_name (label16, "label16"); gtk_widget_show (label16); gtk_box_pack_start (GTK_BOX (hbox11), label16, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_CENTER); gtk_label_set_line_wrap (GTK_LABEL (label16), TRUE); GtkEntry_DumpCF = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_DumpCF, "GtkEntry_DumpCF"); gtk_widget_show (GtkEntry_DumpCF); gtk_box_pack_start (GTK_BOX (hbox11), GtkEntry_DumpCF, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_DumpCF), 8226); hbox12 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox12, "hbox12"); gtk_widget_show (hbox12); gtk_box_pack_start (GTK_BOX (vbox20), hbox12, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox12), 5); label17 = gtk_label_new (_("To 0x")); + gtk_widget_set_name (label17, "label17"); gtk_widget_show (label17); gtk_box_pack_start (GTK_BOX (hbox12), label17, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label17), GTK_JUSTIFY_CENTER); GtkEntry_DumpCT = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_DumpCT, "GtkEntry_DumpCT"); gtk_widget_show (GtkEntry_DumpCT); gtk_box_pack_start (GTK_BOX (hbox12), GtkEntry_DumpCT, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_DumpCT), 8226); label21 = gtk_label_new (_("Dump File = \"dump.txt\"")); + gtk_widget_set_name (label21, "label21"); gtk_widget_show (label21); gtk_box_pack_start (GTK_BOX (vbox20), label21, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (label21), 0.1, 0.5); hbuttonbox17 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox17, "hbuttonbox17"); gtk_widget_show (hbuttonbox17); gtk_box_pack_start (GTK_BOX (vbox20), hbuttonbox17, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox17), 30); button48 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (button48, "button48"); gtk_widget_show (button48); gtk_container_add (GTK_CONTAINER (hbuttonbox17), button48); GTK_WIDGET_SET_FLAGS (button48, GTK_CAN_DEFAULT); button49 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button49, "button49"); gtk_widget_show (button49); gtk_container_add (GTK_CONTAINER (hbuttonbox17), button49); GTK_WIDGET_SET_FLAGS (button49, GTK_CAN_DEFAULT); @@ -1289,46 +1451,55 @@ create_SetBPCDlg (void) GtkWidget *button47; SetBPCDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (SetBPCDlg, "SetBPCDlg"); gtk_container_set_border_width (GTK_CONTAINER (SetBPCDlg), 5); gtk_window_set_title (GTK_WINDOW (SetBPCDlg), _("SetBreakPoint Addr")); vbox19 = gtk_vbox_new (FALSE, 5); + gtk_widget_set_name (vbox19, "vbox19"); gtk_widget_show (vbox19); gtk_container_add (GTK_CONTAINER (SetBPCDlg), vbox19); gtk_container_set_border_width (GTK_CONTAINER (vbox19), 5); label13 = gtk_label_new (_("Set New BP Count (in Hex):")); + gtk_widget_set_name (label13, "label13"); gtk_widget_show (label13); gtk_box_pack_start (GTK_BOX (vbox19), label13, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label13), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (label13), 0.1, 0.5); hbox10 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox10, "hbox10"); gtk_widget_show (hbox10); gtk_box_pack_start (GTK_BOX (vbox19), hbox10, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox10), 5); label14 = gtk_label_new (_("0x")); + gtk_widget_set_name (label14, "label14"); gtk_widget_show (label14); gtk_box_pack_start (GTK_BOX (hbox10), label14, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label14), GTK_JUSTIFY_CENTER); GtkEntry_BPC = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_BPC, "GtkEntry_BPC"); gtk_widget_show (GtkEntry_BPC); gtk_box_pack_start (GTK_BOX (hbox10), GtkEntry_BPC, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_BPC), 8226); hbuttonbox16 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox16, "hbuttonbox16"); gtk_widget_show (hbuttonbox16); gtk_box_pack_start (GTK_BOX (vbox19), hbuttonbox16, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox16), 30); button46 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (button46, "button46"); gtk_widget_show (button46); gtk_container_add (GTK_CONTAINER (hbuttonbox16), button46); GTK_WIDGET_SET_FLAGS (button46, GTK_CAN_DEFAULT); button47 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button47, "button47"); gtk_widget_show (button47); gtk_container_add (GTK_CONTAINER (hbuttonbox16), button47); GTK_WIDGET_SET_FLAGS (button47, GTK_CAN_DEFAULT); @@ -1368,46 +1539,55 @@ create_SetBPADlg (void) GtkWidget *button45; SetBPADlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (SetBPADlg, "SetBPADlg"); gtk_container_set_border_width (GTK_CONTAINER (SetBPADlg), 5); gtk_window_set_title (GTK_WINDOW (SetBPADlg), _("SetBreakPoint Addr")); vbox18 = gtk_vbox_new (FALSE, 5); + gtk_widget_set_name (vbox18, "vbox18"); gtk_widget_show (vbox18); gtk_container_add (GTK_CONTAINER (SetBPADlg), vbox18); gtk_container_set_border_width (GTK_CONTAINER (vbox18), 5); label11 = gtk_label_new (_("Set New BP Address (in Hex):")); + gtk_widget_set_name (label11, "label11"); gtk_widget_show (label11); gtk_box_pack_start (GTK_BOX (vbox18), label11, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label11), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (label11), 0.1, 0.5); hbox9 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox9, "hbox9"); gtk_widget_show (hbox9); gtk_box_pack_start (GTK_BOX (vbox18), hbox9, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox9), 5); label12 = gtk_label_new (_("0x")); + gtk_widget_set_name (label12, "label12"); gtk_widget_show (label12); gtk_box_pack_start (GTK_BOX (hbox9), label12, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label12), GTK_JUSTIFY_CENTER); GtkEntry_BPA = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_BPA, "GtkEntry_BPA"); gtk_widget_show (GtkEntry_BPA); gtk_box_pack_start (GTK_BOX (hbox9), GtkEntry_BPA, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_BPA), 8226); hbuttonbox15 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox15, "hbuttonbox15"); gtk_widget_show (hbuttonbox15); gtk_box_pack_start (GTK_BOX (vbox18), hbuttonbox15, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox15), 30); button44 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (button44, "button44"); gtk_widget_show (button44); gtk_container_add (GTK_CONTAINER (hbuttonbox15), button44); GTK_WIDGET_SET_FLAGS (button44, GTK_CAN_DEFAULT); button45 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button45, "button45"); gtk_widget_show (button45); gtk_container_add (GTK_CONTAINER (hbuttonbox15), button45); GTK_WIDGET_SET_FLAGS (button45, GTK_CAN_DEFAULT); @@ -1447,46 +1627,55 @@ create_SetPCDlg (void) GtkWidget *button43; SetPCDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (SetPCDlg, "SetPCDlg"); gtk_container_set_border_width (GTK_CONTAINER (SetPCDlg), 5); gtk_window_set_title (GTK_WINDOW (SetPCDlg), _("SetPCDlg")); vbox17 = gtk_vbox_new (FALSE, 5); + gtk_widget_set_name (vbox17, "vbox17"); gtk_widget_show (vbox17); gtk_container_add (GTK_CONTAINER (SetPCDlg), vbox17); gtk_container_set_border_width (GTK_CONTAINER (vbox17), 5); label9 = gtk_label_new (_("Set New PC Address (in Hex):")); + gtk_widget_set_name (label9, "label9"); gtk_widget_show (label9); gtk_box_pack_start (GTK_BOX (vbox17), label9, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_CENTER); gtk_misc_set_alignment (GTK_MISC (label9), 0.1, 0.5); hbox8 = gtk_hbox_new (FALSE, 2); + gtk_widget_set_name (hbox8, "hbox8"); gtk_widget_show (hbox8); gtk_box_pack_start (GTK_BOX (vbox17), hbox8, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox8), 5); label10 = gtk_label_new (_("0x")); + gtk_widget_set_name (label10, "label10"); gtk_widget_show (label10); gtk_box_pack_start (GTK_BOX (hbox8), label10, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_CENTER); GtkEntry_dPC = gtk_entry_new (); + gtk_widget_set_name (GtkEntry_dPC, "GtkEntry_dPC"); gtk_widget_show (GtkEntry_dPC); gtk_box_pack_start (GTK_BOX (hbox8), GtkEntry_dPC, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (GtkEntry_dPC), 8226); hbuttonbox14 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox14, "hbuttonbox14"); gtk_widget_show (hbuttonbox14); gtk_box_pack_start (GTK_BOX (vbox17), hbuttonbox14, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (hbuttonbox14), 30); button42 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (button42, "button42"); gtk_widget_show (button42); gtk_container_add (GTK_CONTAINER (hbuttonbox14), button42); GTK_WIDGET_SET_FLAGS (button42, GTK_CAN_DEFAULT); button43 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button43, "button43"); gtk_widget_show (button43); gtk_container_add (GTK_CONTAINER (hbuttonbox14), button43); GTK_WIDGET_SET_FLAGS (button43, GTK_CAN_DEFAULT); @@ -1546,136 +1735,164 @@ create_DebugWnd (void) GtkWidget *button68; DebugWnd = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (DebugWnd, "DebugWnd"); gtk_container_set_border_width (GTK_CONTAINER (DebugWnd), 5); gtk_window_set_title (GTK_WINDOW (DebugWnd), _("PCSX2 Debugger")); vbox16 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox16, "vbox16"); gtk_widget_show (vbox16); gtk_container_add (GTK_CONTAINER (DebugWnd), vbox16); gtk_container_set_border_width (GTK_CONTAINER (vbox16), 5); hbox16 = gtk_hbox_new (FALSE, 5); + gtk_widget_set_name (hbox16, "hbox16"); gtk_widget_show (hbox16); gtk_box_pack_start (GTK_BOX (vbox16), hbox16, FALSE, TRUE, 0); GtkRadioButton_EE = gtk_radio_button_new_with_mnemonic (NULL, _("EE Debug Mode")); + gtk_widget_set_name (GtkRadioButton_EE, "GtkRadioButton_EE"); gtk_widget_show (GtkRadioButton_EE); gtk_box_pack_start (GTK_BOX (hbox16), GtkRadioButton_EE, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_EE), GtkRadioButton_EE_group); GtkRadioButton_EE_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_EE)); GtkRadioButton_IOP = gtk_radio_button_new_with_mnemonic (NULL, _("IOP Debug Mode")); + gtk_widget_set_name (GtkRadioButton_IOP, "GtkRadioButton_IOP"); gtk_widget_show (GtkRadioButton_IOP); gtk_box_pack_start (GTK_BOX (hbox16), GtkRadioButton_IOP, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_IOP), GtkRadioButton_EE_group); GtkRadioButton_EE_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_IOP)); hbox6 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox6, "hbox6"); gtk_widget_show (hbox6); gtk_box_pack_start (GTK_BOX (vbox16), hbox6, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox6), 5); hbox7 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox7, "hbox7"); gtk_widget_show (hbox7); gtk_box_pack_start (GTK_BOX (hbox6), hbox7, TRUE, TRUE, 0); scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_name (scrolledwindow1, "scrolledwindow1"); gtk_widget_show (scrolledwindow1); gtk_box_pack_start (GTK_BOX (hbox7), scrolledwindow1, TRUE, TRUE, 0); GTK_WIDGET_UNSET_FLAGS (scrolledwindow1, GTK_CAN_FOCUS); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_ALWAYS, GTK_POLICY_NEVER); viewport1 = gtk_viewport_new (NULL, NULL); + gtk_widget_set_name (viewport1, "viewport1"); gtk_widget_show (viewport1); gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport1); GtkList_DisView = gtk_tree_view_new (); + gtk_widget_set_name (GtkList_DisView, "GtkList_DisView"); gtk_widget_show (GtkList_DisView); gtk_container_add (GTK_CONTAINER (viewport1), GtkList_DisView); GTK_WIDGET_UNSET_FLAGS (GtkList_DisView, GTK_CAN_FOCUS); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (GtkList_DisView), FALSE); GtkVScrollbar_VList = gtk_vscrollbar_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 412, 1, 20, 2))); + gtk_widget_set_name (GtkVScrollbar_VList, "GtkVScrollbar_VList"); gtk_widget_show (GtkVScrollbar_VList); gtk_box_pack_start (GTK_BOX (hbox7), GtkVScrollbar_VList, FALSE, TRUE, 0); vbox22 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox22, "vbox22"); gtk_widget_show (vbox22); gtk_box_pack_start (GTK_BOX (hbox6), vbox22, FALSE, TRUE, 0); vbuttonbox2 = gtk_vbutton_box_new (); + gtk_widget_set_name (vbuttonbox2, "vbuttonbox2"); gtk_widget_show (vbuttonbox2); gtk_box_pack_start (GTK_BOX (vbox22), vbuttonbox2, FALSE, TRUE, 0); button52 = gtk_button_new_with_mnemonic (_("Step")); + gtk_widget_set_name (button52, "button52"); gtk_widget_show (button52); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button52); GTK_WIDGET_SET_FLAGS (button52, GTK_CAN_DEFAULT); button53 = gtk_button_new_with_mnemonic (_("Skip")); + gtk_widget_set_name (button53, "button53"); gtk_widget_show (button53); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button53); GTK_WIDGET_SET_FLAGS (button53, GTK_CAN_DEFAULT); button65 = gtk_button_new_with_mnemonic (_("Go")); + gtk_widget_set_name (button65, "button65"); gtk_widget_show (button65); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button65); GTK_WIDGET_SET_FLAGS (button65, GTK_CAN_DEFAULT); button64 = gtk_button_new_with_mnemonic (_("Log On/Off")); + gtk_widget_set_name (button64, "button64"); gtk_widget_show (button64); gtk_container_add (GTK_CONTAINER (vbuttonbox2), button64); GTK_WIDGET_SET_FLAGS (button64, GTK_CAN_DEFAULT); vbuttonbox3 = gtk_vbutton_box_new (); + gtk_widget_set_name (vbuttonbox3, "vbuttonbox3"); gtk_widget_show (vbuttonbox3); gtk_box_pack_start (GTK_BOX (vbox22), vbuttonbox3, FALSE, TRUE, 0); button58 = gtk_button_new_with_mnemonic (_("Set PC")); + gtk_widget_set_name (button58, "button58"); gtk_widget_show (button58); gtk_container_add (GTK_CONTAINER (vbuttonbox3), button58); GTK_WIDGET_SET_FLAGS (button58, GTK_CAN_DEFAULT); button59 = gtk_button_new_with_mnemonic (_("Set BP Addr")); + gtk_widget_set_name (button59, "button59"); gtk_widget_show (button59); gtk_container_add (GTK_CONTAINER (vbuttonbox3), button59); GTK_WIDGET_SET_FLAGS (button59, GTK_CAN_DEFAULT); button60 = gtk_button_new_with_mnemonic (_("Set BP Count")); + gtk_widget_set_name (button60, "button60"); gtk_widget_show (button60); gtk_container_add (GTK_CONTAINER (vbuttonbox3), button60); GTK_WIDGET_SET_FLAGS (button60, GTK_CAN_DEFAULT); button61 = gtk_button_new_with_mnemonic (_("Clear BPs")); + gtk_widget_set_name (button61, "button61"); gtk_widget_show (button61); gtk_container_add (GTK_CONTAINER (vbuttonbox3), button61); GTK_WIDGET_SET_FLAGS (button61, GTK_CAN_DEFAULT); vbuttonbox1 = gtk_vbutton_box_new (); + gtk_widget_set_name (vbuttonbox1, "vbuttonbox1"); gtk_widget_show (vbuttonbox1); gtk_box_pack_start (GTK_BOX (vbox22), vbuttonbox1, FALSE, TRUE, 0); button39 = gtk_button_new_with_mnemonic (_("Dump code")); + gtk_widget_set_name (button39, "button39"); gtk_widget_show (button39); gtk_container_add (GTK_CONTAINER (vbuttonbox1), button39); GTK_WIDGET_SET_FLAGS (button39, GTK_CAN_DEFAULT); button40 = gtk_button_new_with_mnemonic (_("Raw Dump")); + gtk_widget_set_name (button40, "button40"); gtk_widget_show (button40); gtk_container_add (GTK_CONTAINER (vbuttonbox1), button40); GTK_WIDGET_SET_FLAGS (button40, GTK_CAN_DEFAULT); button41 = gtk_button_new_with_mnemonic (_("Close")); + gtk_widget_set_name (button41, "button41"); gtk_widget_show (button41); gtk_container_add (GTK_CONTAINER (vbuttonbox1), button41); GTK_WIDGET_SET_FLAGS (button41, GTK_CAN_DEFAULT); vbuttonbox4 = gtk_vbutton_box_new (); + gtk_widget_set_name (vbuttonbox4, "vbuttonbox4"); gtk_widget_show (vbuttonbox4); gtk_box_pack_start (GTK_BOX (hbox6), vbuttonbox4, FALSE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (vbuttonbox4), 10); button68 = gtk_button_new_with_mnemonic (_("memWrite32")); + gtk_widget_set_name (button68, "button68"); gtk_widget_show (button68); gtk_container_add (GTK_CONTAINER (vbuttonbox4), button68); GTK_WIDGET_SET_FLAGS (button68, GTK_CAN_DEFAULT); @@ -1821,138 +2038,163 @@ create_ConfDlg (void) GtkWidget *GtkButton_Cancel; ConfDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (ConfDlg, "ConfDlg"); gtk_container_set_border_width (GTK_CONTAINER (ConfDlg), 10); gtk_window_set_title (GTK_WINDOW (ConfDlg), _("Conf")); gtk_window_set_resizable (GTK_WINDOW (ConfDlg), FALSE); vbox12 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox12, "vbox12"); gtk_widget_show (vbox12); gtk_container_add (GTK_CONTAINER (ConfDlg), vbox12); table2 = gtk_table_new (14, 2, FALSE); + gtk_widget_set_name (table2, "table2"); gtk_widget_show (table2); gtk_box_pack_start (GTK_BOX (vbox12), table2, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (table2), 2); gtk_table_set_col_spacings (GTK_TABLE (table2), 15); GtkCombo_Bios = gtk_combo_box_new_text (); + gtk_widget_set_name (GtkCombo_Bios, "GtkCombo_Bios"); gtk_widget_show (GtkCombo_Bios); gtk_table_attach (GTK_TABLE (table2), GtkCombo_Bios, 1, 2, 13, 14, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_GS = gtk_combo_box_new_text (); + gtk_widget_set_name (GtkCombo_GS, "GtkCombo_GS"); gtk_widget_show (GtkCombo_GS); gtk_table_attach (GTK_TABLE (table2), GtkCombo_GS, 0, 1, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_SPU2 = gtk_combo_box_new_text (); + gtk_widget_set_name (GtkCombo_SPU2, "GtkCombo_SPU2"); gtk_widget_show (GtkCombo_SPU2); gtk_table_attach (GTK_TABLE (table2), GtkCombo_SPU2, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_PAD1 = gtk_combo_box_new_text (); + gtk_widget_set_name (GtkCombo_PAD1, "GtkCombo_PAD1"); gtk_widget_show (GtkCombo_PAD1); gtk_table_attach (GTK_TABLE (table2), GtkCombo_PAD1, 0, 1, 4, 5, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_PAD2 = gtk_combo_box_new_text (); + gtk_widget_set_name (GtkCombo_PAD2, "GtkCombo_PAD2"); gtk_widget_show (GtkCombo_PAD2); gtk_table_attach (GTK_TABLE (table2), GtkCombo_PAD2, 1, 2, 4, 5, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_DEV9 = gtk_combo_box_new_text (); + gtk_widget_set_name (GtkCombo_DEV9, "GtkCombo_DEV9"); gtk_widget_show (GtkCombo_DEV9); gtk_table_attach (GTK_TABLE (table2), GtkCombo_DEV9, 0, 1, 7, 8, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_CDVD = gtk_combo_box_new_text (); + gtk_widget_set_name (GtkCombo_CDVD, "GtkCombo_CDVD"); gtk_widget_show (GtkCombo_CDVD); gtk_table_attach (GTK_TABLE (table2), GtkCombo_CDVD, 1, 2, 7, 8, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_USB = gtk_combo_box_new_text (); + gtk_widget_set_name (GtkCombo_USB, "GtkCombo_USB"); gtk_widget_show (GtkCombo_USB); gtk_table_attach (GTK_TABLE (table2), GtkCombo_USB, 0, 1, 10, 11, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkCombo_FW = gtk_combo_box_new_text (); + gtk_widget_set_name (GtkCombo_FW, "GtkCombo_FW"); gtk_widget_show (GtkCombo_FW); gtk_table_attach (GTK_TABLE (table2), GtkCombo_FW, 1, 2, 10, 11, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); hbuttonbox6 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox6, "hbuttonbox6"); gtk_widget_show (hbuttonbox6); gtk_table_attach (GTK_TABLE (table2), hbuttonbox6, 1, 2, 5, 6, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkButton_PAD2configure = gtk_button_new_with_mnemonic (_("Configure")); + gtk_widget_set_name (GtkButton_PAD2configure, "GtkButton_PAD2configure"); gtk_widget_show (GtkButton_PAD2configure); gtk_container_add (GTK_CONTAINER (hbuttonbox6), GtkButton_PAD2configure); GTK_WIDGET_SET_FLAGS (GtkButton_PAD2configure, GTK_CAN_DEFAULT); GtkButton_PAD2test = gtk_button_new_with_mnemonic (_("Test")); + gtk_widget_set_name (GtkButton_PAD2test, "GtkButton_PAD2test"); gtk_widget_show (GtkButton_PAD2test); gtk_container_add (GTK_CONTAINER (hbuttonbox6), GtkButton_PAD2test); GTK_WIDGET_SET_FLAGS (GtkButton_PAD2test, GTK_CAN_DEFAULT); GtkButton_PAD2about = gtk_button_new_with_mnemonic (_("About")); + gtk_widget_set_name (GtkButton_PAD2about, "GtkButton_PAD2about"); gtk_widget_show (GtkButton_PAD2about); gtk_container_add (GTK_CONTAINER (hbuttonbox6), GtkButton_PAD2about); GTK_WIDGET_SET_FLAGS (GtkButton_PAD2about, GTK_CAN_DEFAULT); hbuttonbox7 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox7, "hbuttonbox7"); gtk_widget_show (hbuttonbox7); gtk_table_attach (GTK_TABLE (table2), hbuttonbox7, 0, 1, 5, 6, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); GtkButton_PAD1configure = gtk_button_new_with_mnemonic (_("Configure")); + gtk_widget_set_name (GtkButton_PAD1configure, "GtkButton_PAD1configure"); gtk_widget_show (GtkButton_PAD1configure); gtk_container_add (GTK_CONTAINER (hbuttonbox7), GtkButton_PAD1configure); GTK_WIDGET_SET_FLAGS (GtkButton_PAD1configure, GTK_CAN_DEFAULT); GtkButton_PAD1test = gtk_button_new_with_mnemonic (_("Test")); + gtk_widget_set_name (GtkButton_PAD1test, "GtkButton_PAD1test"); gtk_widget_show (GtkButton_PAD1test); gtk_container_add (GTK_CONTAINER (hbuttonbox7), GtkButton_PAD1test); GTK_WIDGET_SET_FLAGS (GtkButton_PAD1test, GTK_CAN_DEFAULT); GtkButton_PAD1about = gtk_button_new_with_mnemonic (_("About")); + gtk_widget_set_name (GtkButton_PAD1about, "GtkButton_PAD1about"); gtk_widget_show (GtkButton_PAD1about); gtk_container_add (GTK_CONTAINER (hbuttonbox7), GtkButton_PAD1about); GTK_WIDGET_SET_FLAGS (GtkButton_PAD1about, GTK_CAN_DEFAULT); hbuttonbox8 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox8, "hbuttonbox8"); gtk_widget_show (hbuttonbox8); gtk_table_attach (GTK_TABLE (table2), hbuttonbox8, 0, 1, 2, 3, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkButton_GSconfigure = gtk_button_new_with_mnemonic (_("Configure")); + gtk_widget_set_name (GtkButton_GSconfigure, "GtkButton_GSconfigure"); gtk_widget_show (GtkButton_GSconfigure); gtk_container_add (GTK_CONTAINER (hbuttonbox8), GtkButton_GSconfigure); GTK_WIDGET_SET_FLAGS (GtkButton_GSconfigure, GTK_CAN_DEFAULT); GtkButton_GStest = gtk_button_new_with_mnemonic (_("Test")); + gtk_widget_set_name (GtkButton_GStest, "GtkButton_GStest"); gtk_widget_show (GtkButton_GStest); gtk_container_add (GTK_CONTAINER (hbuttonbox8), GtkButton_GStest); GTK_WIDGET_SET_FLAGS (GtkButton_GStest, GTK_CAN_DEFAULT); GtkButton_GSabout = gtk_button_new_with_mnemonic (_("About")); + gtk_widget_set_name (GtkButton_GSabout, "GtkButton_GSabout"); gtk_widget_show (GtkButton_GSabout); gtk_container_add (GTK_CONTAINER (hbuttonbox8), GtkButton_GSabout); GTK_WIDGET_SET_FLAGS (GtkButton_GSabout, GTK_CAN_DEFAULT); GtkLabel_Graphics = gtk_label_new (_("Graphics")); + gtk_widget_set_name (GtkLabel_Graphics, "GtkLabel_Graphics"); gtk_widget_show (GtkLabel_Graphics); gtk_table_attach (GTK_TABLE (table2), GtkLabel_Graphics, 0, 1, 0, 1, (GtkAttachOptions) (0), @@ -1961,6 +2203,7 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_Graphics), 0, 0.5); GtkLabel_FirstController = gtk_label_new (_("First Controller")); + gtk_widget_set_name (GtkLabel_FirstController, "GtkLabel_FirstController"); gtk_widget_show (GtkLabel_FirstController); gtk_table_attach (GTK_TABLE (table2), GtkLabel_FirstController, 0, 1, 3, 4, (GtkAttachOptions) (0), @@ -1969,6 +2212,7 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_FirstController), 0, 0.5); GtkLabel_SecondController = gtk_label_new (_("Second Controller")); + gtk_widget_set_name (GtkLabel_SecondController, "GtkLabel_SecondController"); gtk_widget_show (GtkLabel_SecondController); gtk_table_attach (GTK_TABLE (table2), GtkLabel_SecondController, 1, 2, 3, 4, (GtkAttachOptions) (0), @@ -1977,6 +2221,7 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_SecondController), 0, 0.5); GtkLabel_Sound = gtk_label_new (_("Sound")); + gtk_widget_set_name (GtkLabel_Sound, "GtkLabel_Sound"); gtk_widget_show (GtkLabel_Sound); gtk_table_attach (GTK_TABLE (table2), GtkLabel_Sound, 1, 2, 0, 1, (GtkAttachOptions) (0), @@ -1985,48 +2230,57 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_Sound), 0, 0.5); hbuttonbox12 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox12, "hbuttonbox12"); gtk_widget_show (hbuttonbox12); gtk_table_attach (GTK_TABLE (table2), hbuttonbox12, 1, 2, 2, 3, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); GtkButton_SPU2configure = gtk_button_new_with_mnemonic (_("Configure")); + gtk_widget_set_name (GtkButton_SPU2configure, "GtkButton_SPU2configure"); gtk_widget_show (GtkButton_SPU2configure); gtk_container_add (GTK_CONTAINER (hbuttonbox12), GtkButton_SPU2configure); GTK_WIDGET_SET_FLAGS (GtkButton_SPU2configure, GTK_CAN_DEFAULT); GtkButton_SPU2test = gtk_button_new_with_mnemonic (_("Test")); + gtk_widget_set_name (GtkButton_SPU2test, "GtkButton_SPU2test"); gtk_widget_show (GtkButton_SPU2test); gtk_container_add (GTK_CONTAINER (hbuttonbox12), GtkButton_SPU2test); GTK_WIDGET_SET_FLAGS (GtkButton_SPU2test, GTK_CAN_DEFAULT); GtkButton_SPU2about = gtk_button_new_with_mnemonic (_("About")); + gtk_widget_set_name (GtkButton_SPU2about, "GtkButton_SPU2about"); gtk_widget_show (GtkButton_SPU2about); gtk_container_add (GTK_CONTAINER (hbuttonbox12), GtkButton_SPU2about); GTK_WIDGET_SET_FLAGS (GtkButton_SPU2about, GTK_CAN_DEFAULT); hbuttonbox21 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox21, "hbuttonbox21"); gtk_widget_show (hbuttonbox21); gtk_table_attach (GTK_TABLE (table2), hbuttonbox21, 0, 1, 8, 9, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkButton_DEV9configure = gtk_button_new_with_mnemonic (_("Configure")); + gtk_widget_set_name (GtkButton_DEV9configure, "GtkButton_DEV9configure"); gtk_widget_show (GtkButton_DEV9configure); gtk_container_add (GTK_CONTAINER (hbuttonbox21), GtkButton_DEV9configure); GTK_WIDGET_SET_FLAGS (GtkButton_DEV9configure, GTK_CAN_DEFAULT); GtkButton_DEV9test = gtk_button_new_with_mnemonic (_("Test")); + gtk_widget_set_name (GtkButton_DEV9test, "GtkButton_DEV9test"); gtk_widget_show (GtkButton_DEV9test); gtk_container_add (GTK_CONTAINER (hbuttonbox21), GtkButton_DEV9test); GTK_WIDGET_SET_FLAGS (GtkButton_DEV9test, GTK_CAN_DEFAULT); GtkButton_DEV9about = gtk_button_new_with_mnemonic (_("About")); + gtk_widget_set_name (GtkButton_DEV9about, "GtkButton_DEV9about"); gtk_widget_show (GtkButton_DEV9about); gtk_container_add (GTK_CONTAINER (hbuttonbox21), GtkButton_DEV9about); GTK_WIDGET_SET_FLAGS (GtkButton_DEV9about, GTK_CAN_DEFAULT); label23 = gtk_label_new (_("Dev9")); + gtk_widget_set_name (label23, "label23"); gtk_widget_show (label23); gtk_table_attach (GTK_TABLE (table2), label23, 0, 1, 6, 7, (GtkAttachOptions) (0), @@ -2035,6 +2289,7 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (label23), 0, 0.5); GtkLabel_Cdvdrom = gtk_label_new (_("Cdvdrom")); + gtk_widget_set_name (GtkLabel_Cdvdrom, "GtkLabel_Cdvdrom"); gtk_widget_show (GtkLabel_Cdvdrom); gtk_table_attach (GTK_TABLE (table2), GtkLabel_Cdvdrom, 1, 2, 6, 7, (GtkAttachOptions) (0), @@ -2043,27 +2298,32 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_Cdvdrom), 0, 0.5); hbuttonbox13 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox13, "hbuttonbox13"); gtk_widget_show (hbuttonbox13); gtk_table_attach (GTK_TABLE (table2), hbuttonbox13, 1, 2, 8, 9, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); GtkButton_CDVDconfigure = gtk_button_new_with_mnemonic (_("Configure")); + gtk_widget_set_name (GtkButton_CDVDconfigure, "GtkButton_CDVDconfigure"); gtk_widget_show (GtkButton_CDVDconfigure); gtk_container_add (GTK_CONTAINER (hbuttonbox13), GtkButton_CDVDconfigure); GTK_WIDGET_SET_FLAGS (GtkButton_CDVDconfigure, GTK_CAN_DEFAULT); GtkButton_CDVDtest = gtk_button_new_with_mnemonic (_("Test")); + gtk_widget_set_name (GtkButton_CDVDtest, "GtkButton_CDVDtest"); gtk_widget_show (GtkButton_CDVDtest); gtk_container_add (GTK_CONTAINER (hbuttonbox13), GtkButton_CDVDtest); GTK_WIDGET_SET_FLAGS (GtkButton_CDVDtest, GTK_CAN_DEFAULT); GtkButton_CDVDabout = gtk_button_new_with_mnemonic (_("About")); + gtk_widget_set_name (GtkButton_CDVDabout, "GtkButton_CDVDabout"); gtk_widget_show (GtkButton_CDVDabout); gtk_container_add (GTK_CONTAINER (hbuttonbox13), GtkButton_CDVDabout); GTK_WIDGET_SET_FLAGS (GtkButton_CDVDabout, GTK_CAN_DEFAULT); label29 = gtk_label_new (_("Usb")); + gtk_widget_set_name (label29, "label29"); gtk_widget_show (label29); gtk_table_attach (GTK_TABLE (table2), label29, 0, 1, 9, 10, (GtkAttachOptions) (0), @@ -2072,48 +2332,57 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (label29), 0, 0.5); hbuttonbox23 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox23, "hbuttonbox23"); gtk_widget_show (hbuttonbox23); gtk_table_attach (GTK_TABLE (table2), hbuttonbox23, 0, 1, 11, 12, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); GtkButton_USBconfigure = gtk_button_new_with_mnemonic (_("Configure")); + gtk_widget_set_name (GtkButton_USBconfigure, "GtkButton_USBconfigure"); gtk_widget_show (GtkButton_USBconfigure); gtk_container_add (GTK_CONTAINER (hbuttonbox23), GtkButton_USBconfigure); GTK_WIDGET_SET_FLAGS (GtkButton_USBconfigure, GTK_CAN_DEFAULT); GtkButton_USBtest = gtk_button_new_with_mnemonic (_("Test")); + gtk_widget_set_name (GtkButton_USBtest, "GtkButton_USBtest"); gtk_widget_show (GtkButton_USBtest); gtk_container_add (GTK_CONTAINER (hbuttonbox23), GtkButton_USBtest); GTK_WIDGET_SET_FLAGS (GtkButton_USBtest, GTK_CAN_DEFAULT); GtkButton_USBabout = gtk_button_new_with_mnemonic (_("About")); + gtk_widget_set_name (GtkButton_USBabout, "GtkButton_USBabout"); gtk_widget_show (GtkButton_USBabout); gtk_container_add (GTK_CONTAINER (hbuttonbox23), GtkButton_USBabout); GTK_WIDGET_SET_FLAGS (GtkButton_USBabout, GTK_CAN_DEFAULT); hbuttonbox24 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox24, "hbuttonbox24"); gtk_widget_show (hbuttonbox24); gtk_table_attach (GTK_TABLE (table2), hbuttonbox24, 1, 2, 11, 12, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); GtkButton_FWconfigure = gtk_button_new_with_mnemonic (_("Configure")); + gtk_widget_set_name (GtkButton_FWconfigure, "GtkButton_FWconfigure"); gtk_widget_show (GtkButton_FWconfigure); gtk_container_add (GTK_CONTAINER (hbuttonbox24), GtkButton_FWconfigure); GTK_WIDGET_SET_FLAGS (GtkButton_FWconfigure, GTK_CAN_DEFAULT); GtkButton_FWtest = gtk_button_new_with_mnemonic (_("Test")); + gtk_widget_set_name (GtkButton_FWtest, "GtkButton_FWtest"); gtk_widget_show (GtkButton_FWtest); gtk_container_add (GTK_CONTAINER (hbuttonbox24), GtkButton_FWtest); GTK_WIDGET_SET_FLAGS (GtkButton_FWtest, GTK_CAN_DEFAULT); GtkButton_FireWireabout = gtk_button_new_with_mnemonic (_("About")); + gtk_widget_set_name (GtkButton_FireWireabout, "GtkButton_FireWireabout"); gtk_widget_show (GtkButton_FireWireabout); gtk_container_add (GTK_CONTAINER (hbuttonbox24), GtkButton_FireWireabout); GTK_WIDGET_SET_FLAGS (GtkButton_FireWireabout, GTK_CAN_DEFAULT); label30 = gtk_label_new (_("FireWire")); + gtk_widget_set_name (label30, "label30"); gtk_widget_show (label30); gtk_table_attach (GTK_TABLE (table2), label30, 1, 2, 9, 10, (GtkAttachOptions) (0), @@ -2122,6 +2391,7 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (label30), 0, 0.5); GtkLabel_Bios = gtk_label_new (_("Bios")); + gtk_widget_set_name (GtkLabel_Bios, "GtkLabel_Bios"); gtk_widget_show (GtkLabel_Bios); gtk_table_attach (GTK_TABLE (table2), GtkLabel_Bios, 1, 2, 12, 13, (GtkAttachOptions) (0), @@ -2130,34 +2400,41 @@ create_ConfDlg (void) gtk_misc_set_alignment (GTK_MISC (GtkLabel_Bios), 0, 0.5); hbox5 = gtk_hbox_new (FALSE, 14); + gtk_widget_set_name (hbox5, "hbox5"); gtk_widget_show (hbox5); gtk_box_pack_start (GTK_BOX (vbox12), hbox5, TRUE, TRUE, 0); hbuttonbox11 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox11, "hbuttonbox11"); gtk_widget_show (hbuttonbox11); gtk_box_pack_start (GTK_BOX (hbox5), hbuttonbox11, FALSE, TRUE, 0); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox11), GTK_BUTTONBOX_START); GtkButton_SelectPluginsDir = gtk_button_new_with_mnemonic (_("Select Plugins Dir")); + gtk_widget_set_name (GtkButton_SelectPluginsDir, "GtkButton_SelectPluginsDir"); gtk_widget_show (GtkButton_SelectPluginsDir); gtk_container_add (GTK_CONTAINER (hbuttonbox11), GtkButton_SelectPluginsDir); GTK_WIDGET_SET_FLAGS (GtkButton_SelectPluginsDir, GTK_CAN_DEFAULT); GtkButton_SelectBiosDir = gtk_button_new_with_mnemonic (_("Select Bios Dir")); + gtk_widget_set_name (GtkButton_SelectBiosDir, "GtkButton_SelectBiosDir"); gtk_widget_show (GtkButton_SelectBiosDir); gtk_container_add (GTK_CONTAINER (hbuttonbox11), GtkButton_SelectBiosDir); GTK_WIDGET_SET_FLAGS (GtkButton_SelectBiosDir, GTK_CAN_DEFAULT); hbuttonbox10 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox10, "hbuttonbox10"); gtk_widget_show (hbuttonbox10); gtk_box_pack_start (GTK_BOX (hbox5), hbuttonbox10, TRUE, TRUE, 0); GtkButton_Ok1 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (GtkButton_Ok1, "GtkButton_Ok1"); gtk_widget_show (GtkButton_Ok1); gtk_container_add (GTK_CONTAINER (hbuttonbox10), GtkButton_Ok1); GTK_WIDGET_SET_FLAGS (GtkButton_Ok1, GTK_CAN_DEFAULT); GtkButton_Cancel = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (GtkButton_Cancel, "GtkButton_Cancel"); gtk_widget_show (GtkButton_Cancel); gtk_container_add (GTK_CONTAINER (hbuttonbox10), GtkButton_Cancel); GTK_WIDGET_SET_FLAGS (GtkButton_Cancel, GTK_CAN_DEFAULT); @@ -2329,60 +2606,72 @@ create_AboutDlg (void) GtkWidget *GtkButton_Ok; AboutDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (AboutDlg, "AboutDlg"); gtk_container_set_border_width (GTK_CONTAINER (AboutDlg), 10); gtk_window_set_title (GTK_WINDOW (AboutDlg), _("Pcsx About")); vbox2 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox2, "vbox2"); gtk_widget_show (vbox2); gtk_container_add (GTK_CONTAINER (AboutDlg), vbox2); vbox4 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox4, "vbox4"); gtk_widget_show (vbox4); gtk_box_pack_start (GTK_BOX (vbox2), vbox4, TRUE, TRUE, 0); GtkAbout_LabelVersion = gtk_label_new (_("PCSX2\n\nVersion x.x")); + gtk_widget_set_name (GtkAbout_LabelVersion, "GtkAbout_LabelVersion"); gtk_widget_show (GtkAbout_LabelVersion); gtk_box_pack_start (GTK_BOX (vbox4), GtkAbout_LabelVersion, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkAbout_LabelVersion), GTK_JUSTIFY_CENTER); frame1 = gtk_frame_new (NULL); + gtk_widget_set_name (frame1, "frame1"); gtk_widget_show (frame1); gtk_box_pack_start (GTK_BOX (vbox4), frame1, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame1), 5); vbox6 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox6, "vbox6"); gtk_widget_show (vbox6); gtk_container_add (GTK_CONTAINER (frame1), vbox6); gtk_container_set_border_width (GTK_CONTAINER (vbox6), 5); GtkAbout_LabelAuthors = gtk_label_new (_("written by...")); + gtk_widget_set_name (GtkAbout_LabelAuthors, "GtkAbout_LabelAuthors"); gtk_widget_show (GtkAbout_LabelAuthors); gtk_box_pack_start (GTK_BOX (vbox6), GtkAbout_LabelAuthors, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkAbout_LabelAuthors), GTK_JUSTIFY_CENTER); gtk_label_set_line_wrap (GTK_LABEL (GtkAbout_LabelAuthors), TRUE); frame2 = gtk_frame_new (NULL); + gtk_widget_set_name (frame2, "frame2"); gtk_widget_show (frame2); gtk_box_pack_start (GTK_BOX (vbox2), frame2, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame2), 5); vbox5 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox5, "vbox5"); gtk_widget_show (vbox5); gtk_container_add (GTK_CONTAINER (frame2), vbox5); gtk_container_set_border_width (GTK_CONTAINER (vbox5), 5); GtkAbout_LabelGreets = gtk_label_new (_("greets to...")); + gtk_widget_set_name (GtkAbout_LabelGreets, "GtkAbout_LabelGreets"); gtk_widget_show (GtkAbout_LabelGreets); gtk_box_pack_start (GTK_BOX (vbox5), GtkAbout_LabelGreets, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (GtkAbout_LabelGreets), GTK_JUSTIFY_CENTER); gtk_label_set_line_wrap (GTK_LABEL (GtkAbout_LabelGreets), TRUE); hbuttonbox1 = gtk_hbutton_box_new (); + gtk_widget_set_name (hbuttonbox1, "hbuttonbox1"); gtk_widget_show (hbuttonbox1); gtk_box_pack_start (GTK_BOX (vbox2), hbuttonbox1, FALSE, FALSE, 0); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_EDGE); GtkButton_Ok = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (GtkButton_Ok, "GtkButton_Ok"); gtk_widget_show (GtkButton_Ok); gtk_container_add (GTK_CONTAINER (hbuttonbox1), GtkButton_Ok); GTK_WIDGET_SET_FLAGS (GtkButton_Ok, GTK_CAN_DEFAULT); @@ -2481,270 +2770,338 @@ create_MainWindow (void) GtkWidget *status_box; MainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (MainWindow, "MainWindow"); gtk_window_set_title (GTK_WINDOW (MainWindow), _("PCSX")); gtk_window_set_position (GTK_WINDOW (MainWindow), GTK_WIN_POS_CENTER); vbox1 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox1, "vbox1"); gtk_widget_show (vbox1); gtk_container_add (GTK_CONTAINER (MainWindow), vbox1); GtkMenuBar_Menu = gtk_menu_bar_new (); + gtk_widget_set_name (GtkMenuBar_Menu, "GtkMenuBar_Menu"); gtk_widget_show (GtkMenuBar_Menu); gtk_box_pack_start (GTK_BOX (vbox1), GtkMenuBar_Menu, FALSE, FALSE, 0); GtkMenuItem_File = gtk_menu_item_new_with_mnemonic (_("_File")); + gtk_widget_set_name (GtkMenuItem_File, "GtkMenuItem_File"); gtk_widget_show (GtkMenuItem_File); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_File); GtkMenuItem_File_menu = gtk_menu_new (); + gtk_widget_set_name (GtkMenuItem_File_menu, "GtkMenuItem_File_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_File), GtkMenuItem_File_menu); run_cd1 = gtk_menu_item_new_with_mnemonic (_("_Run CD")); + gtk_widget_set_name (run_cd1, "run_cd1"); gtk_widget_show (run_cd1); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), run_cd1); GtkMenuItem_LoadElf = gtk_menu_item_new_with_mnemonic (_("_Load Elf")); + gtk_widget_set_name (GtkMenuItem_LoadElf, "GtkMenuItem_LoadElf"); gtk_widget_show (GtkMenuItem_LoadElf); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), GtkMenuItem_LoadElf); separator2 = gtk_separator_menu_item_new (); + gtk_widget_set_name (separator2, "separator2"); gtk_widget_show (separator2); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), separator2); gtk_widget_set_sensitive (separator2, FALSE); states1 = gtk_menu_item_new_with_mnemonic (_("States")); + gtk_widget_set_name (states1, "states1"); gtk_widget_show (states1); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), states1); states1_menu = gtk_menu_new (); + gtk_widget_set_name (states1_menu, "states1_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (states1), states1_menu); load1 = gtk_menu_item_new_with_mnemonic (_("Load")); + gtk_widget_set_name (load1, "load1"); gtk_widget_show (load1); gtk_container_add (GTK_CONTAINER (states1_menu), load1); load1_menu = gtk_menu_new (); + gtk_widget_set_name (load1_menu, "load1_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (load1), load1_menu); load_slot_0 = gtk_menu_item_new_with_mnemonic (_("Slot 0")); + gtk_widget_set_name (load_slot_0, "load_slot_0"); gtk_widget_show (load_slot_0); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_0); load_slot_1 = gtk_menu_item_new_with_mnemonic (_("Slot 1")); + gtk_widget_set_name (load_slot_1, "load_slot_1"); gtk_widget_show (load_slot_1); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_1); load_slot_2 = gtk_menu_item_new_with_mnemonic (_("Slot 2")); + gtk_widget_set_name (load_slot_2, "load_slot_2"); gtk_widget_show (load_slot_2); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_2); load_slot_3 = gtk_menu_item_new_with_mnemonic (_("Slot 3")); + gtk_widget_set_name (load_slot_3, "load_slot_3"); gtk_widget_show (load_slot_3); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_3); load_slot_4 = gtk_menu_item_new_with_mnemonic (_("Slot 4")); + gtk_widget_set_name (load_slot_4, "load_slot_4"); gtk_widget_show (load_slot_4); gtk_container_add (GTK_CONTAINER (load1_menu), load_slot_4); other1 = gtk_menu_item_new_with_mnemonic (_("Other...")); + gtk_widget_set_name (other1, "other1"); gtk_widget_show (other1); gtk_container_add (GTK_CONTAINER (load1_menu), other1); save1 = gtk_menu_item_new_with_mnemonic (_("Save")); + gtk_widget_set_name (save1, "save1"); gtk_widget_show (save1); gtk_container_add (GTK_CONTAINER (states1_menu), save1); save1_menu = gtk_menu_new (); + gtk_widget_set_name (save1_menu, "save1_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (save1), save1_menu); save_slot_0 = gtk_menu_item_new_with_mnemonic (_("Slot 0")); + gtk_widget_set_name (save_slot_0, "save_slot_0"); gtk_widget_show (save_slot_0); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_0); save_slot_1 = gtk_menu_item_new_with_mnemonic (_("Slot 1")); + gtk_widget_set_name (save_slot_1, "save_slot_1"); gtk_widget_show (save_slot_1); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_1); save_slot_2 = gtk_menu_item_new_with_mnemonic (_("Slot 2")); + gtk_widget_set_name (save_slot_2, "save_slot_2"); gtk_widget_show (save_slot_2); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_2); save_slot_3 = gtk_menu_item_new_with_mnemonic (_("Slot 3")); + gtk_widget_set_name (save_slot_3, "save_slot_3"); gtk_widget_show (save_slot_3); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_3); save_slot_4 = gtk_menu_item_new_with_mnemonic (_("Slot 4")); + gtk_widget_set_name (save_slot_4, "save_slot_4"); gtk_widget_show (save_slot_4); gtk_container_add (GTK_CONTAINER (save1_menu), save_slot_4); other2 = gtk_menu_item_new_with_mnemonic (_("Other...")); + gtk_widget_set_name (other2, "other2"); gtk_widget_show (other2); gtk_container_add (GTK_CONTAINER (save1_menu), other2); GtkMenuItem_Exit = gtk_menu_item_new_with_mnemonic (_("E_xit")); + gtk_widget_set_name (GtkMenuItem_Exit, "GtkMenuItem_Exit"); gtk_widget_show (GtkMenuItem_Exit); gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), GtkMenuItem_Exit); GtkMenuItem_Emulator = gtk_menu_item_new_with_mnemonic (_("_Run")); + gtk_widget_set_name (GtkMenuItem_Emulator, "GtkMenuItem_Emulator"); gtk_widget_show (GtkMenuItem_Emulator); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Emulator); GtkMenuItem_Emulator_menu = gtk_menu_new (); + gtk_widget_set_name (GtkMenuItem_Emulator_menu, "GtkMenuItem_Emulator_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_Emulator), GtkMenuItem_Emulator_menu); GtkMenuItem_Run = gtk_menu_item_new_with_mnemonic (_("E_xecute")); + gtk_widget_set_name (GtkMenuItem_Run, "GtkMenuItem_Run"); gtk_widget_show (GtkMenuItem_Run); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Emulator_menu), GtkMenuItem_Run); GtkMenuItem_Reset = gtk_menu_item_new_with_mnemonic (_("Re_set")); + gtk_widget_set_name (GtkMenuItem_Reset, "GtkMenuItem_Reset"); gtk_widget_show (GtkMenuItem_Reset); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Emulator_menu), GtkMenuItem_Reset); GtkMenuItem_Configuration = gtk_menu_item_new_with_mnemonic (_("_Config")); + gtk_widget_set_name (GtkMenuItem_Configuration, "GtkMenuItem_Configuration"); gtk_widget_show (GtkMenuItem_Configuration); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Configuration); GtkMenuItem_Configuration_menu = gtk_menu_new (); + gtk_widget_set_name (GtkMenuItem_Configuration_menu, "GtkMenuItem_Configuration_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_Configuration), GtkMenuItem_Configuration_menu); GtkMenuItem_PluginsBios = gtk_menu_item_new_with_mnemonic (_("_Configure")); + gtk_widget_set_name (GtkMenuItem_PluginsBios, "GtkMenuItem_PluginsBios"); gtk_widget_show (GtkMenuItem_PluginsBios); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_PluginsBios); separator3 = gtk_separator_menu_item_new (); + gtk_widget_set_name (separator3, "separator3"); gtk_widget_show (separator3); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), separator3); gtk_widget_set_sensitive (separator3, FALSE); GtkMenuItem_GS = gtk_menu_item_new_with_mnemonic (_("_Graphics")); + gtk_widget_set_name (GtkMenuItem_GS, "GtkMenuItem_GS"); gtk_widget_show (GtkMenuItem_GS); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_GS); GtkMenuItem_PAD1 = gtk_menu_item_new_with_mnemonic (_("C_ontrollers")); + gtk_widget_set_name (GtkMenuItem_PAD1, "GtkMenuItem_PAD1"); gtk_widget_show (GtkMenuItem_PAD1); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_PAD1); GtkMenuItem_SPU2 = gtk_menu_item_new_with_mnemonic (_("_Sound")); + gtk_widget_set_name (GtkMenuItem_SPU2, "GtkMenuItem_SPU2"); gtk_widget_show (GtkMenuItem_SPU2); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_SPU2); GtkMenuItem_CDVD = gtk_menu_item_new_with_mnemonic (_("_Cdvdrom")); + gtk_widget_set_name (GtkMenuItem_CDVD, "GtkMenuItem_CDVD"); gtk_widget_show (GtkMenuItem_CDVD); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_CDVD); GtkMenuItem_DEV9 = gtk_menu_item_new_with_mnemonic (_("D_ev9")); + gtk_widget_set_name (GtkMenuItem_DEV9, "GtkMenuItem_DEV9"); gtk_widget_show (GtkMenuItem_DEV9); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_DEV9); GtkMenuItem_USB = gtk_menu_item_new_with_mnemonic (_("U_SB")); + gtk_widget_set_name (GtkMenuItem_USB, "GtkMenuItem_USB"); gtk_widget_show (GtkMenuItem_USB); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_USB); GtkMenuItem_FW = gtk_menu_item_new_with_mnemonic (_("Fire_Wire")); + gtk_widget_set_name (GtkMenuItem_FW, "GtkMenuItem_FW"); gtk_widget_show (GtkMenuItem_FW); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_FW); separator4 = gtk_separator_menu_item_new (); + gtk_widget_set_name (separator4, "separator4"); gtk_widget_show (separator4); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), separator4); gtk_widget_set_sensitive (separator4, FALSE); GtkMenuItem_Memcards = gtk_menu_item_new_with_mnemonic (_("Memcards")); + gtk_widget_set_name (GtkMenuItem_Memcards, "GtkMenuItem_Memcards"); gtk_widget_show (GtkMenuItem_Memcards); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Memcards); GtkMenuItem_Cpu = gtk_menu_item_new_with_mnemonic (_("C_pu")); + gtk_widget_set_name (GtkMenuItem_Cpu, "GtkMenuItem_Cpu"); gtk_widget_show (GtkMenuItem_Cpu); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Cpu); GtkMenuItem_Game_Fixes = gtk_menu_item_new_with_mnemonic (_("Game Fixes")); + gtk_widget_set_name (GtkMenuItem_Game_Fixes, "GtkMenuItem_Game_Fixes"); gtk_widget_show (GtkMenuItem_Game_Fixes); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Game_Fixes); GtkMenuItem_Speed_Hacks = gtk_menu_item_new_with_mnemonic (_("Speed Hacks")); + gtk_widget_set_name (GtkMenuItem_Speed_Hacks, "GtkMenuItem_Speed_Hacks"); gtk_widget_show (GtkMenuItem_Speed_Hacks); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Speed_Hacks); GtkMenuItem_Advanced = gtk_menu_item_new_with_mnemonic (_("Advanced")); + gtk_widget_set_name (GtkMenuItem_Advanced, "GtkMenuItem_Advanced"); gtk_widget_show (GtkMenuItem_Advanced); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Configuration_menu), GtkMenuItem_Advanced); GtkMenuItem_Language = gtk_menu_item_new_with_mnemonic (_("_Language")); + gtk_widget_set_name (GtkMenuItem_Language, "GtkMenuItem_Language"); gtk_widget_show (GtkMenuItem_Language); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Language); misc1 = gtk_menu_item_new_with_mnemonic (_("_Misc")); + gtk_widget_set_name (misc1, "misc1"); gtk_widget_show (misc1); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), misc1); misc1_menu = gtk_menu_new (); + gtk_widget_set_name (misc1_menu, "misc1_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (misc1), misc1_menu); patch_browser1 = gtk_menu_item_new_with_mnemonic (_("Patch _Browser")); + gtk_widget_set_name (patch_browser1, "patch_browser1"); gtk_widget_show (patch_browser1); gtk_container_add (GTK_CONTAINER (misc1_menu), patch_browser1); patch_finder2 = gtk_menu_item_new_with_mnemonic (_("Patch _Finder")); + gtk_widget_set_name (patch_finder2, "patch_finder2"); gtk_widget_show (patch_finder2); gtk_container_add (GTK_CONTAINER (misc1_menu), patch_finder2); separator7 = gtk_separator_menu_item_new (); + gtk_widget_set_name (separator7, "separator7"); gtk_widget_show (separator7); gtk_container_add (GTK_CONTAINER (misc1_menu), separator7); gtk_widget_set_sensitive (separator7, FALSE); enable_console1 = gtk_check_menu_item_new_with_mnemonic (_("Enable _Console")); + gtk_widget_set_name (enable_console1, "enable_console1"); gtk_widget_show (enable_console1); gtk_container_add (GTK_CONTAINER (misc1_menu), enable_console1); enable_patches1 = gtk_check_menu_item_new_with_mnemonic (_("Enable _Patches")); + gtk_widget_set_name (enable_patches1, "enable_patches1"); gtk_widget_show (enable_patches1); gtk_container_add (GTK_CONTAINER (misc1_menu), enable_patches1); print_cdvd_info1 = gtk_check_menu_item_new_with_mnemonic (_("Print CDVD Info")); + gtk_widget_set_name (print_cdvd_info1, "print_cdvd_info1"); gtk_widget_show (print_cdvd_info1); gtk_container_add (GTK_CONTAINER (misc1_menu), print_cdvd_info1); GtkMenuItem_Debug = gtk_menu_item_new_with_mnemonic (_("_Debug")); + gtk_widget_set_name (GtkMenuItem_Debug, "GtkMenuItem_Debug"); gtk_widget_show (GtkMenuItem_Debug); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Debug); GtkMenuItem_Debug_menu = gtk_menu_new (); + gtk_widget_set_name (GtkMenuItem_Debug_menu, "GtkMenuItem_Debug_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_Debug), GtkMenuItem_Debug_menu); GtkMenuItem_EnterDebugger = gtk_menu_item_new_with_mnemonic (_("Enter Debugger ...")); + gtk_widget_set_name (GtkMenuItem_EnterDebugger, "GtkMenuItem_EnterDebugger"); gtk_widget_show (GtkMenuItem_EnterDebugger); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Debug_menu), GtkMenuItem_EnterDebugger); GtkMenuItem_Logging = gtk_menu_item_new_with_mnemonic (_("Logging")); + gtk_widget_set_name (GtkMenuItem_Logging, "GtkMenuItem_Logging"); gtk_widget_show (GtkMenuItem_Logging); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Debug_menu), GtkMenuItem_Logging); separator8 = gtk_separator_menu_item_new (); + gtk_widget_set_name (separator8, "separator8"); gtk_widget_show (separator8); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Debug_menu), separator8); gtk_widget_set_sensitive (separator8, FALSE); GtkMenuItem_Arguments = gtk_menu_item_new_with_mnemonic (_("_Arguments")); + gtk_widget_set_name (GtkMenuItem_Arguments, "GtkMenuItem_Arguments"); gtk_widget_show (GtkMenuItem_Arguments); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Debug_menu), GtkMenuItem_Arguments); GtkMenuItem_Help = gtk_menu_item_new_with_mnemonic (_("_Help")); + gtk_widget_set_name (GtkMenuItem_Help, "GtkMenuItem_Help"); gtk_widget_show (GtkMenuItem_Help); gtk_container_add (GTK_CONTAINER (GtkMenuBar_Menu), GtkMenuItem_Help); GtkMenuItem_Help_menu = gtk_menu_new (); + gtk_widget_set_name (GtkMenuItem_Help_menu, "GtkMenuItem_Help_menu"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_Help), GtkMenuItem_Help_menu); GtkMenuItem_About = gtk_menu_item_new_with_mnemonic (_("About PCSX2...")); + gtk_widget_set_name (GtkMenuItem_About, "GtkMenuItem_About"); gtk_widget_show (GtkMenuItem_About); gtk_container_add (GTK_CONTAINER (GtkMenuItem_Help_menu), GtkMenuItem_About); image1 = create_pixmap (MainWindow, "pcsxAbout.bmp"); + gtk_widget_set_name (image1, "image1"); gtk_widget_show (image1); gtk_box_pack_start (GTK_BOX (vbox1), image1, TRUE, TRUE, 1); status_box = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (status_box, "status_box"); gtk_widget_show (status_box); gtk_box_pack_start (GTK_BOX (vbox1), status_box, TRUE, TRUE, 0); @@ -2963,57 +3320,70 @@ create_PatchBrowserWindow (void) GtkWidget *button91; PatchBrowserWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (PatchBrowserWindow, "PatchBrowserWindow"); gtk_window_set_title (GTK_WINDOW (PatchBrowserWindow), _("Patch List")); gtk_window_set_modal (GTK_WINDOW (PatchBrowserWindow), TRUE); gtk_window_set_decorated (GTK_WINDOW (PatchBrowserWindow), FALSE); gtk_window_set_type_hint (GTK_WINDOW (PatchBrowserWindow), GDK_WINDOW_TYPE_HINT_DIALOG); hbox24 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox24, "hbox24"); gtk_widget_show (hbox24); gtk_container_add (GTK_CONTAINER (PatchBrowserWindow), hbox24); scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_name (scrolledwindow2, "scrolledwindow2"); gtk_widget_show (scrolledwindow2); gtk_box_pack_start (GTK_BOX (hbox24), scrolledwindow2, TRUE, TRUE, 0); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_SHADOW_IN); treeview1 = gtk_tree_view_new (); + gtk_widget_set_name (treeview1, "treeview1"); gtk_widget_show (treeview1); gtk_container_add (GTK_CONTAINER (scrolledwindow2), treeview1); vbox40 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox40, "vbox40"); gtk_widget_show (vbox40); gtk_box_pack_start (GTK_BOX (hbox24), vbox40, TRUE, TRUE, 0); button84 = gtk_button_new_with_mnemonic (_("Enable / Diable")); + gtk_widget_set_name (button84, "button84"); gtk_widget_show (button84); gtk_box_pack_start (GTK_BOX (vbox40), button84, FALSE, FALSE, 0); button85 = gtk_button_new_with_mnemonic (_("Add Patch")); + gtk_widget_set_name (button85, "button85"); gtk_widget_show (button85); gtk_box_pack_start (GTK_BOX (vbox40), button85, FALSE, FALSE, 0); button86 = gtk_button_new_with_mnemonic (_("Edit Patch")); + gtk_widget_set_name (button86, "button86"); gtk_widget_show (button86); gtk_box_pack_start (GTK_BOX (vbox40), button86, FALSE, FALSE, 0); button87 = gtk_button_new_with_mnemonic (_("Add GS2v3-4")); + gtk_widget_set_name (button87, "button87"); gtk_widget_show (button87); gtk_box_pack_start (GTK_BOX (vbox40), button87, FALSE, FALSE, 0); button88 = gtk_button_new_with_mnemonic (_("Add Raw")); + gtk_widget_set_name (button88, "button88"); gtk_widget_show (button88); gtk_box_pack_start (GTK_BOX (vbox40), button88, FALSE, FALSE, 0); button89 = gtk_button_new_with_mnemonic (_("Pnach Writer")); + gtk_widget_set_name (button89, "button89"); gtk_widget_show (button89); gtk_box_pack_start (GTK_BOX (vbox40), button89, FALSE, FALSE, 0); button90 = gtk_button_new_with_mnemonic (_("Skip Mpeg")); + gtk_widget_set_name (button90, "button90"); gtk_widget_show (button90); gtk_box_pack_start (GTK_BOX (vbox40), button90, FALSE, FALSE, 0); button91 = gtk_button_new_from_stock ("gtk-close"); + gtk_widget_set_name (button91, "button91"); gtk_widget_show (button91); gtk_box_pack_start (GTK_BOX (vbox40), button91, FALSE, FALSE, 0); @@ -3095,70 +3465,84 @@ create_PatchFinderWindow (void) GtkWidget *button92; PatchFinderWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (PatchFinderWindow, "PatchFinderWindow"); gtk_window_set_title (GTK_WINDOW (PatchFinderWindow), _("Patch Finder")); gtk_window_set_modal (GTK_WINDOW (PatchFinderWindow), TRUE); gtk_window_set_type_hint (GTK_WINDOW (PatchFinderWindow), GDK_WINDOW_TYPE_HINT_DIALOG); hbox25 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox25, "hbox25"); gtk_widget_show (hbox25); gtk_container_add (GTK_CONTAINER (PatchFinderWindow), hbox25); vbox43 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox43, "vbox43"); gtk_widget_show (vbox43); gtk_box_pack_start (GTK_BOX (hbox25), vbox43, TRUE, TRUE, 0); frame19 = gtk_frame_new (NULL); + gtk_widget_set_name (frame19, "frame19"); gtk_widget_show (frame19); gtk_box_pack_start (GTK_BOX (vbox43), frame19, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame19), GTK_SHADOW_NONE); alignment14 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment14, "alignment14"); gtk_widget_show (alignment14); gtk_container_add (GTK_CONTAINER (frame19), alignment14); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment14), 0, 0, 12, 0); vbox44 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox44, "vbox44"); gtk_widget_show (vbox44); gtk_container_add (GTK_CONTAINER (alignment14), vbox44); radiobutton1 = gtk_radio_button_new_with_mnemonic (NULL, _("EE RAM")); + gtk_widget_set_name (radiobutton1, "radiobutton1"); gtk_widget_show (radiobutton1); gtk_box_pack_start (GTK_BOX (vbox44), radiobutton1, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton1), radiobutton1_group); radiobutton1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton1)); radiobutton2 = gtk_radio_button_new_with_mnemonic (NULL, _("IOP RAM")); + gtk_widget_set_name (radiobutton2, "radiobutton2"); gtk_widget_show (radiobutton2); gtk_box_pack_start (GTK_BOX (vbox44), radiobutton2, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton2), radiobutton1_group); radiobutton1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton2)); label55 = gtk_label_new (_("Search In")); + gtk_widget_set_name (label55, "label55"); gtk_widget_show (label55); gtk_frame_set_label_widget (GTK_FRAME (frame19), label55); gtk_label_set_use_markup (GTK_LABEL (label55), TRUE); frame20 = gtk_frame_new (NULL); + gtk_widget_set_name (frame20, "frame20"); gtk_widget_show (frame20); gtk_box_pack_start (GTK_BOX (vbox43), frame20, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame20), GTK_SHADOW_NONE); alignment15 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment15, "alignment15"); gtk_widget_show (alignment15); gtk_container_add (GTK_CONTAINER (frame20), alignment15); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment15), 0, 0, 12, 0); table6 = gtk_table_new (3, 2, FALSE); + gtk_widget_set_name (table6, "table6"); gtk_widget_show (table6); gtk_container_add (GTK_CONTAINER (alignment15), table6); checkbutton1 = gtk_check_button_new_with_mnemonic (_("Unsigned")); + gtk_widget_set_name (checkbutton1, "checkbutton1"); gtk_widget_show (checkbutton1); gtk_table_attach (GTK_TABLE (table6), checkbutton1, 0, 1, 2, 3, (GtkAttachOptions) (0), (GtkAttachOptions) (0), 0, 0); radiobutton6 = gtk_radio_button_new_with_mnemonic (NULL, _("64 bits")); + gtk_widget_set_name (radiobutton6, "radiobutton6"); gtk_widget_show (radiobutton6); gtk_table_attach (GTK_TABLE (table6), radiobutton6, 1, 2, 1, 2, (GtkAttachOptions) (0), @@ -3167,6 +3551,7 @@ create_PatchFinderWindow (void) radiobutton6_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton6)); radiobutton5 = gtk_radio_button_new_with_mnemonic (NULL, _("32 bits")); + gtk_widget_set_name (radiobutton5, "radiobutton5"); gtk_widget_show (radiobutton5); gtk_table_attach (GTK_TABLE (table6), radiobutton5, 0, 1, 1, 2, (GtkAttachOptions) (0), @@ -3175,6 +3560,7 @@ create_PatchFinderWindow (void) radiobutton5_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton5)); radiobutton4 = gtk_radio_button_new_with_mnemonic (NULL, _("16 bits")); + gtk_widget_set_name (radiobutton4, "radiobutton4"); gtk_widget_show (radiobutton4); gtk_table_attach (GTK_TABLE (table6), radiobutton4, 1, 2, 0, 1, (GtkAttachOptions) (0), @@ -3183,6 +3569,7 @@ create_PatchFinderWindow (void) radiobutton4_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton4)); radiobutton3 = gtk_radio_button_new_with_mnemonic (NULL, _("8 bits")); + gtk_widget_set_name (radiobutton3, "radiobutton3"); gtk_widget_show (radiobutton3); gtk_table_attach (GTK_TABLE (table6), radiobutton3, 0, 1, 0, 1, (GtkAttachOptions) (0), @@ -3191,158 +3578,189 @@ create_PatchFinderWindow (void) radiobutton3_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton3)); label56 = gtk_label_new (_("Values of Size")); + gtk_widget_set_name (label56, "label56"); gtk_widget_show (label56); gtk_frame_set_label_widget (GTK_FRAME (frame20), label56); gtk_label_set_use_markup (GTK_LABEL (label56), TRUE); frame21 = gtk_frame_new (NULL); + gtk_widget_set_name (frame21, "frame21"); gtk_widget_show (frame21); gtk_box_pack_start (GTK_BOX (vbox43), frame21, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame21), GTK_SHADOW_NONE); alignment16 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment16, "alignment16"); gtk_widget_show (alignment16); gtk_container_add (GTK_CONTAINER (frame21), alignment16); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment16), 0, 0, 12, 0); vbox45 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox45, "vbox45"); gtk_widget_show (vbox45); gtk_container_add (GTK_CONTAINER (alignment16), vbox45); radiobutton7 = gtk_radio_button_new_with_mnemonic (NULL, _("Equal")); + gtk_widget_set_name (radiobutton7, "radiobutton7"); gtk_widget_show (radiobutton7); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton7, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton7), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton7)); radiobutton8 = gtk_radio_button_new_with_mnemonic (NULL, _("Greater Then")); + gtk_widget_set_name (radiobutton8, "radiobutton8"); gtk_widget_show (radiobutton8); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton8, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton8), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton8)); radiobutton9 = gtk_radio_button_new_with_mnemonic (NULL, _("Less Then")); + gtk_widget_set_name (radiobutton9, "radiobutton9"); gtk_widget_show (radiobutton9); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton9, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton9), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton9)); radiobutton10 = gtk_radio_button_new_with_mnemonic (NULL, _("Greater Then or Equal")); + gtk_widget_set_name (radiobutton10, "radiobutton10"); gtk_widget_show (radiobutton10); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton10, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton10), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton10)); radiobutton11 = gtk_radio_button_new_with_mnemonic (NULL, _("Less Then or Equal")); + gtk_widget_set_name (radiobutton11, "radiobutton11"); gtk_widget_show (radiobutton11); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton11, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton11), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton11)); radiobutton12 = gtk_radio_button_new_with_mnemonic (NULL, _("Not Equal")); + gtk_widget_set_name (radiobutton12, "radiobutton12"); gtk_widget_show (radiobutton12); gtk_box_pack_start (GTK_BOX (vbox45), radiobutton12, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton12), radiobutton7_group); radiobutton7_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton12)); label57 = gtk_label_new (_("Being")); + gtk_widget_set_name (label57, "label57"); gtk_widget_show (label57); gtk_frame_set_label_widget (GTK_FRAME (frame21), label57); gtk_label_set_use_markup (GTK_LABEL (label57), TRUE); frame22 = gtk_frame_new (NULL); + gtk_widget_set_name (frame22, "frame22"); gtk_widget_show (frame22); gtk_box_pack_start (GTK_BOX (vbox43), frame22, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame22), GTK_SHADOW_NONE); alignment17 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment17, "alignment17"); gtk_widget_show (alignment17); gtk_container_add (GTK_CONTAINER (frame22), alignment17); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment17), 0, 0, 12, 0); vbox46 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox46, "vbox46"); gtk_widget_show (vbox46); gtk_container_add (GTK_CONTAINER (alignment17), vbox46); radiobutton13 = gtk_radio_button_new_with_mnemonic (NULL, _("Old Value")); + gtk_widget_set_name (radiobutton13, "radiobutton13"); gtk_widget_show (radiobutton13); gtk_box_pack_start (GTK_BOX (vbox46), radiobutton13, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton13), radiobutton13_group); radiobutton13_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton13)); radiobutton14 = gtk_radio_button_new_with_mnemonic (NULL, _("Specific Value")); + gtk_widget_set_name (radiobutton14, "radiobutton14"); gtk_widget_show (radiobutton14); gtk_box_pack_start (GTK_BOX (vbox46), radiobutton14, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton14), radiobutton13_group); radiobutton13_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton14)); entry1 = gtk_entry_new (); + gtk_widget_set_name (entry1, "entry1"); gtk_widget_show (entry1); gtk_box_pack_start (GTK_BOX (vbox46), entry1, FALSE, FALSE, 0); label58 = gtk_label_new (_("Compared To")); + gtk_widget_set_name (label58, "label58"); gtk_widget_show (label58); gtk_frame_set_label_widget (GTK_FRAME (frame22), label58); gtk_label_set_use_markup (GTK_LABEL (label58), TRUE); vbox41 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox41, "vbox41"); gtk_widget_show (vbox41); gtk_box_pack_start (GTK_BOX (hbox25), vbox41, TRUE, TRUE, 0); vbox42 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox42, "vbox42"); gtk_widget_show (vbox42); gtk_box_pack_start (GTK_BOX (vbox41), vbox42, TRUE, TRUE, 0); hbox26 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox26, "hbox26"); gtk_widget_show (hbox26); gtk_box_pack_start (GTK_BOX (vbox42), hbox26, FALSE, FALSE, 0); label59 = gtk_label_new (_("Results:")); + gtk_widget_set_name (label59, "label59"); gtk_widget_show (label59); gtk_box_pack_start (GTK_BOX (hbox26), label59, FALSE, FALSE, 0); label60 = gtk_label_new (_("%s")); + gtk_widget_set_name (label60, "label60"); gtk_widget_show (label60); gtk_box_pack_start (GTK_BOX (hbox26), label60, TRUE, TRUE, 0); gtk_label_set_justify (GTK_LABEL (label60), GTK_JUSTIFY_CENTER); label61 = gtk_label_new (_("Ready to Search")); + gtk_widget_set_name (label61, "label61"); gtk_widget_show (label61); gtk_box_pack_start (GTK_BOX (hbox26), label61, TRUE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label61), GTK_JUSTIFY_RIGHT); scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_name (scrolledwindow3, "scrolledwindow3"); gtk_widget_show (scrolledwindow3); gtk_box_pack_start (GTK_BOX (vbox42), scrolledwindow3, TRUE, TRUE, 0); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_SHADOW_IN); treeview2 = gtk_tree_view_new (); + gtk_widget_set_name (treeview2, "treeview2"); gtk_widget_show (treeview2); gtk_container_add (GTK_CONTAINER (scrolledwindow3), treeview2); table5 = gtk_table_new (2, 2, FALSE); + gtk_widget_set_name (table5, "table5"); gtk_widget_show (table5); gtk_box_pack_start (GTK_BOX (vbox41), table5, FALSE, TRUE, 0); button95 = gtk_button_new_from_stock ("gtk-close"); + gtk_widget_set_name (button95, "button95"); gtk_widget_show (button95); gtk_table_attach (GTK_TABLE (table5), button95, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); button94 = gtk_button_new_from_stock ("gtk-add"); + gtk_widget_set_name (button94, "button94"); gtk_widget_show (button94); gtk_table_attach (GTK_TABLE (table5), button94, 0, 1, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); button93 = gtk_button_new_from_stock ("gtk-find"); + gtk_widget_set_name (button93, "button93"); gtk_widget_show (button93); gtk_table_attach (GTK_TABLE (table5), button93, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); button92 = gtk_button_new_from_stock ("gtk-clear"); + gtk_widget_set_name (button92, "button92"); gtk_widget_show (button92); gtk_table_attach (GTK_TABLE (table5), button92, 0, 1, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), @@ -3461,227 +3879,277 @@ create_CpuDlg (void) GtkWidget *button97; CpuDlg = gtk_dialog_new (); + gtk_widget_set_name (CpuDlg, "CpuDlg"); gtk_window_set_title (GTK_WINDOW (CpuDlg), _("dialog1")); gtk_window_set_type_hint (GTK_WINDOW (CpuDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox5 = GTK_DIALOG (CpuDlg)->vbox; + gtk_widget_set_name (dialog_vbox5, "dialog_vbox5"); gtk_widget_show (dialog_vbox5); hbox27 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox27, "hbox27"); gtk_widget_show (hbox27); gtk_box_pack_start (GTK_BOX (dialog_vbox5), hbox27, TRUE, TRUE, 0); vbox47 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox47, "vbox47"); gtk_widget_show (vbox47); gtk_box_pack_start (GTK_BOX (hbox27), vbox47, TRUE, TRUE, 0); frame8 = gtk_frame_new (NULL); + gtk_widget_set_name (frame8, "frame8"); gtk_widget_show (frame8); gtk_box_pack_start (GTK_BOX (vbox47), frame8, TRUE, TRUE, 0); alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment2, "alignment2"); gtk_widget_show (alignment2); gtk_container_add (GTK_CONTAINER (frame8), alignment2); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0); vbox28 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox28, "vbox28"); gtk_widget_show (vbox28); gtk_container_add (GTK_CONTAINER (alignment2), vbox28); GtkLabel_CpuVendor = gtk_label_new (_("CPU vendor")); + gtk_widget_set_name (GtkLabel_CpuVendor, "GtkLabel_CpuVendor"); gtk_widget_show (GtkLabel_CpuVendor); gtk_box_pack_start (GTK_BOX (vbox28), GtkLabel_CpuVendor, FALSE, FALSE, 0); GtkLabel_Family = gtk_label_new (_("Family")); + gtk_widget_set_name (GtkLabel_Family, "GtkLabel_Family"); gtk_widget_show (GtkLabel_Family); gtk_box_pack_start (GTK_BOX (vbox28), GtkLabel_Family, FALSE, FALSE, 0); GtkLabel_CpuSpeed = gtk_label_new (_("Cpu Speed")); + gtk_widget_set_name (GtkLabel_CpuSpeed, "GtkLabel_CpuSpeed"); gtk_widget_show (GtkLabel_CpuSpeed); gtk_box_pack_start (GTK_BOX (vbox28), GtkLabel_CpuSpeed, FALSE, FALSE, 0); GtkLabel_Features = gtk_label_new (_("Features")); + gtk_widget_set_name (GtkLabel_Features, "GtkLabel_Features"); gtk_widget_show (GtkLabel_Features); gtk_box_pack_start (GTK_BOX (vbox28), GtkLabel_Features, FALSE, FALSE, 0); label35 = gtk_label_new (""); + gtk_widget_set_name (label35, "label35"); gtk_widget_show (label35); gtk_frame_set_label_widget (GTK_FRAME (frame8), label35); gtk_label_set_use_markup (GTK_LABEL (label35), TRUE); GtkCheckButton_EERec = gtk_check_button_new_with_mnemonic (_("EERec - EE/IOP recompiler (Need MMX/SSE/SSE2)")); + gtk_widget_set_name (GtkCheckButton_EERec, "GtkCheckButton_EERec"); gtk_widget_show (GtkCheckButton_EERec); gtk_box_pack_start (GTK_BOX (vbox47), GtkCheckButton_EERec, FALSE, FALSE, 0); frame6 = gtk_frame_new (NULL); + gtk_widget_set_name (frame6, "frame6"); gtk_widget_show (frame6); gtk_box_pack_start (GTK_BOX (vbox47), frame6, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame6), 5); vbox26 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox26, "vbox26"); gtk_widget_show (vbox26); gtk_container_add (GTK_CONTAINER (frame6), vbox26); gtk_container_set_border_width (GTK_CONTAINER (vbox26), 5); GtkCheckButton_VU0rec = gtk_check_button_new_with_mnemonic (_("VU0rec - enable recompiler for VU0 unit")); + gtk_widget_set_name (GtkCheckButton_VU0rec, "GtkCheckButton_VU0rec"); gtk_widget_show (GtkCheckButton_VU0rec); gtk_box_pack_start (GTK_BOX (vbox26), GtkCheckButton_VU0rec, FALSE, FALSE, 0); GtkCheckButton_VU1rec = gtk_check_button_new_with_mnemonic (_("VU1rec - enable recompiler for VU1 unit")); + gtk_widget_set_name (GtkCheckButton_VU1rec, "GtkCheckButton_VU1rec"); gtk_widget_show (GtkCheckButton_VU1rec); gtk_box_pack_start (GTK_BOX (vbox26), GtkCheckButton_VU1rec, FALSE, FALSE, 0); label32 = gtk_label_new (_("VU Recompilers - All options are set by default")); + gtk_widget_set_name (label32, "label32"); gtk_widget_show (label32); gtk_frame_set_label_widget (GTK_FRAME (frame6), label32); GtkCheckButton_MTGS = gtk_check_button_new_with_mnemonic (_("Multi threaded GS mode (MTGS)\n (faster on dual core/HT CPUs, requires pcsx2 restart)")); + gtk_widget_set_name (GtkCheckButton_MTGS, "GtkCheckButton_MTGS"); gtk_widget_show (GtkCheckButton_MTGS); gtk_box_pack_start (GTK_BOX (vbox47), GtkCheckButton_MTGS, FALSE, FALSE, 0); vbox48 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox48, "vbox48"); gtk_widget_show (vbox48); gtk_box_pack_start (GTK_BOX (hbox27), vbox48, TRUE, TRUE, 0); frame9 = gtk_frame_new (NULL); + gtk_widget_set_name (frame9, "frame9"); gtk_widget_show (frame9); gtk_box_pack_start (GTK_BOX (vbox48), frame9, TRUE, TRUE, 0); alignment4 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment4, "alignment4"); gtk_widget_show (alignment4); gtk_container_add (GTK_CONTAINER (frame9), alignment4); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment4), 0, 0, 12, 0); vbox29 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox29, "vbox29"); gtk_widget_show (vbox29); gtk_container_add (GTK_CONTAINER (alignment4), vbox29); GtkRadioButton_LimitNormal = gtk_radio_button_new_with_mnemonic (NULL, _("Normal - All frames are rendered as fast as possible")); + gtk_widget_set_name (GtkRadioButton_LimitNormal, "GtkRadioButton_LimitNormal"); gtk_widget_show (GtkRadioButton_LimitNormal); gtk_box_pack_start (GTK_BOX (vbox29), GtkRadioButton_LimitNormal, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitNormal), GtkRadioButton_LimitNormal_group); GtkRadioButton_LimitNormal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitNormal)); GtkRadioButton_LimitLimit = gtk_radio_button_new_with_mnemonic (NULL, _("Limit - Force frames to normal speeds if too fast")); + gtk_widget_set_name (GtkRadioButton_LimitLimit, "GtkRadioButton_LimitLimit"); gtk_widget_show (GtkRadioButton_LimitLimit); gtk_box_pack_start (GTK_BOX (vbox29), GtkRadioButton_LimitLimit, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitLimit), GtkRadioButton_LimitNormal_group); GtkRadioButton_LimitNormal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitLimit)); GtkRadioButton_LimitFS = gtk_radio_button_new_with_mnemonic (NULL, _("Frame Skip - In order to achieve normal speeds, \n some frames are skipped (faster).\n Fps displayed counts skipped frames too")); + gtk_widget_set_name (GtkRadioButton_LimitFS, "GtkRadioButton_LimitFS"); gtk_widget_show (GtkRadioButton_LimitFS); gtk_box_pack_start (GTK_BOX (vbox29), GtkRadioButton_LimitFS, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitFS), GtkRadioButton_LimitNormal_group); GtkRadioButton_LimitNormal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_LimitFS)); GtkRadioButton_VUSkip = gtk_radio_button_new_with_mnemonic (NULL, _("VU Skip - Same as Frame Skip, but tried to skip more. \n Artifacts might be present, but will be faster")); + gtk_widget_set_name (GtkRadioButton_VUSkip, "GtkRadioButton_VUSkip"); gtk_widget_show (GtkRadioButton_VUSkip); gtk_box_pack_start (GTK_BOX (vbox29), GtkRadioButton_VUSkip, FALSE, FALSE, 0); gtk_radio_button_set_group (GTK_RADIO_BUTTON (GtkRadioButton_VUSkip), GtkRadioButton_LimitNormal_group); GtkRadioButton_LimitNormal_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (GtkRadioButton_VUSkip)); label41 = gtk_label_new (_("Frame Limiting (F4 switches in-game)")); + gtk_widget_set_name (label41, "label41"); gtk_widget_show (label41); gtk_frame_set_label_widget (GTK_FRAME (frame9), label41); gtk_label_set_use_markup (GTK_LABEL (label41), TRUE); frame23 = gtk_frame_new (NULL); + gtk_widget_set_name (frame23, "frame23"); gtk_widget_show (frame23); gtk_box_pack_start (GTK_BOX (vbox48), frame23, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame23), GTK_SHADOW_NONE); alignment18 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment18, "alignment18"); gtk_widget_show (alignment18); gtk_container_add (GTK_CONTAINER (frame23), alignment18); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment18), 0, 0, 12, 0); vbox49 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox49, "vbox49"); gtk_widget_show (vbox49); gtk_container_add (GTK_CONTAINER (alignment18), vbox49); hbox29 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox29, "hbox29"); gtk_widget_show (hbox29); gtk_box_pack_start (GTK_BOX (vbox49), hbox29, TRUE, TRUE, 0); label66 = gtk_label_new (_("Custom FPS Limit (0=auto):")); + gtk_widget_set_name (label66, "label66"); gtk_widget_show (label66); gtk_box_pack_start (GTK_BOX (hbox29), label66, TRUE, TRUE, 0); CustomFPSLimit_adj = gtk_adjustment_new (0, 0, 9999, 1, 0, 0); CustomFPSLimit = gtk_spin_button_new (GTK_ADJUSTMENT (CustomFPSLimit_adj), 1, 0); + gtk_widget_set_name (CustomFPSLimit, "CustomFPSLimit"); gtk_widget_show (CustomFPSLimit); gtk_box_pack_end (GTK_BOX (hbox29), CustomFPSLimit, FALSE, TRUE, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (CustomFPSLimit), TRUE); hbox30 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox30, "hbox30"); gtk_widget_show (hbox30); gtk_box_pack_start (GTK_BOX (vbox49), hbox30, TRUE, TRUE, 0); label67 = gtk_label_new (_("Skip Frames when slower than[1]:")); + gtk_widget_set_name (label67, "label67"); gtk_widget_show (label67); gtk_box_pack_start (GTK_BOX (hbox30), label67, TRUE, TRUE, 0); FrameThreshold_adj = gtk_adjustment_new (0, 0, 9999, 1, 0, 0); FrameThreshold = gtk_spin_button_new (GTK_ADJUSTMENT (FrameThreshold_adj), 1, 0); + gtk_widget_set_name (FrameThreshold, "FrameThreshold"); gtk_widget_show (FrameThreshold); gtk_box_pack_end (GTK_BOX (hbox30), FrameThreshold, FALSE, TRUE, 0); hbox31 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox31, "hbox31"); gtk_widget_show (hbox31); gtk_box_pack_start (GTK_BOX (vbox49), hbox31, TRUE, TRUE, 0); label68 = gtk_label_new (_("Consecutive Frames before skipping[2]:")); + gtk_widget_set_name (label68, "label68"); gtk_widget_show (label68); gtk_box_pack_start (GTK_BOX (hbox31), label68, TRUE, TRUE, 0); FramesBeforeSkipping_adj = gtk_adjustment_new (0, 0, 9999, 1, 0, 0); FramesBeforeSkipping = gtk_spin_button_new (GTK_ADJUSTMENT (FramesBeforeSkipping_adj), 1, 0); + gtk_widget_set_name (FramesBeforeSkipping, "FramesBeforeSkipping"); gtk_widget_show (FramesBeforeSkipping); gtk_box_pack_end (GTK_BOX (hbox31), FramesBeforeSkipping, FALSE, TRUE, 0); hbox32 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox32, "hbox32"); gtk_widget_show (hbox32); gtk_box_pack_start (GTK_BOX (vbox49), hbox32, TRUE, TRUE, 0); label69 = gtk_label_new (_("Consecutive Frames to skip[3]:")); + gtk_widget_set_name (label69, "label69"); gtk_widget_show (label69); gtk_box_pack_start (GTK_BOX (hbox32), label69, TRUE, TRUE, 0); FramesToSkip_adj = gtk_adjustment_new (0, 0, 9999, 1, 0, 0); FramesToSkip = gtk_spin_button_new (GTK_ADJUSTMENT (FramesToSkip_adj), 1, 0); + gtk_widget_set_name (FramesToSkip, "FramesToSkip"); gtk_widget_show (FramesToSkip); gtk_box_pack_end (GTK_BOX (hbox32), FramesToSkip, FALSE, TRUE, 0); label63 = gtk_label_new (_("[1] Only skips when slower then this number(0 is auto; 9999 always skips).")); + gtk_widget_set_name (label63, "label63"); gtk_widget_show (label63); gtk_box_pack_start (GTK_BOX (vbox49), label63, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label63), TRUE); label64 = gtk_label_new (_("[2] Renders this many frames before skipping (0 is default).")); + gtk_widget_set_name (label64, "label64"); gtk_widget_show (label64); gtk_box_pack_start (GTK_BOX (vbox49), label64, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label64), TRUE); label65 = gtk_label_new (_("[3] Skips this many frames before continuing (0 is default).")); + gtk_widget_set_name (label65, "label65"); gtk_widget_show (label65); gtk_box_pack_start (GTK_BOX (vbox49), label65, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label65), TRUE); label62 = gtk_label_new (_("Detailed Settings")); + gtk_widget_set_name (label62, "label62"); gtk_widget_show (label62); gtk_frame_set_label_widget (GTK_FRAME (frame23), label62); gtk_label_set_use_markup (GTK_LABEL (label62), TRUE); dialog_action_area5 = GTK_DIALOG (CpuDlg)->action_area; + gtk_widget_set_name (dialog_action_area5, "dialog_action_area5"); gtk_widget_show (dialog_action_area5); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area5), GTK_BUTTONBOX_END); button96 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (button96, "button96"); gtk_widget_show (button96); gtk_dialog_add_action_widget (GTK_DIALOG (CpuDlg), button96, 0); GTK_WIDGET_SET_FLAGS (button96, GTK_CAN_DEFAULT); button97 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (button97, "button97"); gtk_widget_show (button97); gtk_dialog_add_action_widget (GTK_DIALOG (CpuDlg), button97, 0); GTK_WIDGET_SET_FLAGS (button97, GTK_CAN_DEFAULT); @@ -3801,205 +4269,253 @@ create_Logging (void) GtkWidget *Logging2Cancel; Logging = gtk_dialog_new (); + gtk_widget_set_name (Logging, "Logging"); gtk_window_set_title (GTK_WINDOW (Logging), _("Logging")); gtk_window_set_default_size (GTK_WINDOW (Logging), 200, 450); gtk_window_set_type_hint (GTK_WINDOW (Logging), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox6 = GTK_DIALOG (Logging)->vbox; + gtk_widget_set_name (dialog_vbox6, "dialog_vbox6"); gtk_widget_show (dialog_vbox6); scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_name (scrolledwindow4, "scrolledwindow4"); gtk_widget_show (scrolledwindow4); gtk_box_pack_start (GTK_BOX (dialog_vbox6), scrolledwindow4, TRUE, TRUE, 0); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN); viewport2 = gtk_viewport_new (NULL, NULL); + gtk_widget_set_name (viewport2, "viewport2"); gtk_widget_show (viewport2); gtk_container_add (GTK_CONTAINER (scrolledwindow4), viewport2); vbox55 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox55, "vbox55"); gtk_widget_show (vbox55); gtk_container_add (GTK_CONTAINER (viewport2), vbox55); frame33 = gtk_frame_new (NULL); + gtk_widget_set_name (frame33, "frame33"); gtk_widget_show (frame33); gtk_box_pack_start (GTK_BOX (vbox55), frame33, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame33), GTK_SHADOW_NONE); alignment28 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment28, "alignment28"); gtk_widget_show (alignment28); gtk_container_add (GTK_CONTAINER (frame33), alignment28); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment28), 0, 0, 12, 0); vbox56 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox56, "vbox56"); gtk_widget_show (vbox56); gtk_container_add (GTK_CONTAINER (alignment28), vbox56); Log0 = gtk_check_button_new_with_mnemonic (_("Cpu Log")); + gtk_widget_set_name (Log0, "Log0"); gtk_widget_show (Log0); gtk_box_pack_start (GTK_BOX (vbox56), Log0, FALSE, FALSE, 0); Log1 = gtk_check_button_new_with_mnemonic (_("Mem Log")); + gtk_widget_set_name (Log1, "Log1"); gtk_widget_show (Log1); gtk_box_pack_start (GTK_BOX (vbox56), Log1, FALSE, FALSE, 0); Log2 = gtk_check_button_new_with_mnemonic (_("Hw Log")); + gtk_widget_set_name (Log2, "Log2"); gtk_widget_show (Log2); gtk_box_pack_start (GTK_BOX (vbox56), Log2, FALSE, FALSE, 0); Log3 = gtk_check_button_new_with_mnemonic (_("Dma Log")); + gtk_widget_set_name (Log3, "Log3"); gtk_widget_show (Log3); gtk_box_pack_start (GTK_BOX (vbox56), Log3, FALSE, FALSE, 0); Log4 = gtk_check_button_new_with_mnemonic (_("Bios Log")); + gtk_widget_set_name (Log4, "Log4"); gtk_widget_show (Log4); gtk_box_pack_start (GTK_BOX (vbox56), Log4, FALSE, FALSE, 0); Log5 = gtk_check_button_new_with_mnemonic (_("Elf Log")); + gtk_widget_set_name (Log5, "Log5"); gtk_widget_show (Log5); gtk_box_pack_start (GTK_BOX (vbox56), Log5, FALSE, FALSE, 0); Log6 = gtk_check_button_new_with_mnemonic (_("Fpu Log")); + gtk_widget_set_name (Log6, "Log6"); gtk_widget_show (Log6); gtk_box_pack_start (GTK_BOX (vbox56), Log6, FALSE, FALSE, 0); Log7 = gtk_check_button_new_with_mnemonic (_("MMI Log")); + gtk_widget_set_name (Log7, "Log7"); gtk_widget_show (Log7); gtk_box_pack_start (GTK_BOX (vbox56), Log7, FALSE, FALSE, 0); Log8 = gtk_check_button_new_with_mnemonic (_("VU0 Log")); + gtk_widget_set_name (Log8, "Log8"); gtk_widget_show (Log8); gtk_box_pack_start (GTK_BOX (vbox56), Log8, FALSE, FALSE, 0); Log9 = gtk_check_button_new_with_mnemonic (_("Cop0 Log")); + gtk_widget_set_name (Log9, "Log9"); gtk_widget_show (Log9); gtk_box_pack_start (GTK_BOX (vbox56), Log9, FALSE, FALSE, 0); Log10 = gtk_check_button_new_with_mnemonic (_("Vif Log")); + gtk_widget_set_name (Log10, "Log10"); gtk_widget_show (Log10); gtk_box_pack_start (GTK_BOX (vbox56), Log10, FALSE, FALSE, 0); Log11 = gtk_check_button_new_with_mnemonic (_("SPR Log")); + gtk_widget_set_name (Log11, "Log11"); gtk_widget_show (Log11); gtk_box_pack_start (GTK_BOX (vbox56), Log11, FALSE, FALSE, 0); Log12 = gtk_check_button_new_with_mnemonic (_("GIF Log")); + gtk_widget_set_name (Log12, "Log12"); gtk_widget_show (Log12); gtk_box_pack_start (GTK_BOX (vbox56), Log12, FALSE, FALSE, 0); Log13 = gtk_check_button_new_with_mnemonic (_("Sif Log")); + gtk_widget_set_name (Log13, "Log13"); gtk_widget_show (Log13); gtk_box_pack_start (GTK_BOX (vbox56), Log13, FALSE, FALSE, 0); Log14 = gtk_check_button_new_with_mnemonic (_("IPU Log")); + gtk_widget_set_name (Log14, "Log14"); gtk_widget_show (Log14); gtk_box_pack_start (GTK_BOX (vbox56), Log14, FALSE, FALSE, 0); Log15 = gtk_check_button_new_with_mnemonic (_("VU Micro Log")); + gtk_widget_set_name (Log15, "Log15"); gtk_widget_show (Log15); gtk_box_pack_start (GTK_BOX (vbox56), Log15, FALSE, FALSE, 0); Log16 = gtk_check_button_new_with_mnemonic (_("RPC Log")); + gtk_widget_set_name (Log16, "Log16"); gtk_widget_show (Log16); gtk_box_pack_start (GTK_BOX (vbox56), Log16, FALSE, FALSE, 0); label85 = gtk_label_new (_("EE Logs")); + gtk_widget_set_name (label85, "label85"); gtk_widget_show (label85); gtk_frame_set_label_widget (GTK_FRAME (frame33), label85); gtk_label_set_use_markup (GTK_LABEL (label85), TRUE); frame34 = gtk_frame_new (NULL); + gtk_widget_set_name (frame34, "frame34"); gtk_widget_show (frame34); gtk_box_pack_start (GTK_BOX (vbox55), frame34, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame34), GTK_SHADOW_NONE); alignment29 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment29, "alignment29"); gtk_widget_show (alignment29); gtk_container_add (GTK_CONTAINER (frame34), alignment29); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment29), 0, 0, 12, 0); vbox57 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox57, "vbox57"); gtk_widget_show (vbox57); gtk_container_add (GTK_CONTAINER (alignment29), vbox57); Log20 = gtk_check_button_new_with_mnemonic (_("IOP Log")); + gtk_widget_set_name (Log20, "Log20"); gtk_widget_show (Log20); gtk_box_pack_start (GTK_BOX (vbox57), Log20, FALSE, FALSE, 0); Log21 = gtk_check_button_new_with_mnemonic (_("Mem Log")); + gtk_widget_set_name (Log21, "Log21"); gtk_widget_show (Log21); gtk_box_pack_start (GTK_BOX (vbox57), Log21, FALSE, FALSE, 0); Log22 = gtk_check_button_new_with_mnemonic (_("Hw Log")); + gtk_widget_set_name (Log22, "Log22"); gtk_widget_show (Log22); gtk_box_pack_start (GTK_BOX (vbox57), Log22, FALSE, FALSE, 0); Log23 = gtk_check_button_new_with_mnemonic (_("Bios Log")); + gtk_widget_set_name (Log23, "Log23"); gtk_widget_show (Log23); gtk_box_pack_start (GTK_BOX (vbox57), Log23, FALSE, FALSE, 0); Log24 = gtk_check_button_new_with_mnemonic (_("Dma Log")); + gtk_widget_set_name (Log24, "Log24"); gtk_widget_show (Log24); gtk_box_pack_start (GTK_BOX (vbox57), Log24, FALSE, FALSE, 0); Log25 = gtk_check_button_new_with_mnemonic (_("Pad Log")); + gtk_widget_set_name (Log25, "Log25"); gtk_widget_show (Log25); gtk_box_pack_start (GTK_BOX (vbox57), Log25, FALSE, FALSE, 0); Log26 = gtk_check_button_new_with_mnemonic (_("Gte Log")); + gtk_widget_set_name (Log26, "Log26"); gtk_widget_show (Log26); gtk_box_pack_start (GTK_BOX (vbox57), Log26, FALSE, FALSE, 0); Log27 = gtk_check_button_new_with_mnemonic (_("Cdr Log")); + gtk_widget_set_name (Log27, "Log27"); gtk_widget_show (Log27); gtk_box_pack_start (GTK_BOX (vbox57), Log27, FALSE, FALSE, 0); Log28 = gtk_check_button_new_with_mnemonic (_("GPU Log")); + gtk_widget_set_name (Log28, "Log28"); gtk_widget_show (Log28); gtk_box_pack_start (GTK_BOX (vbox57), Log28, FALSE, FALSE, 0); label86 = gtk_label_new (_("IOP Logs")); + gtk_widget_set_name (label86, "label86"); gtk_widget_show (label86); gtk_frame_set_label_widget (GTK_FRAME (frame34), label86); gtk_label_set_use_markup (GTK_LABEL (label86), TRUE); frame35 = gtk_frame_new (NULL); + gtk_widget_set_name (frame35, "frame35"); gtk_widget_show (frame35); gtk_box_pack_start (GTK_BOX (vbox55), frame35, TRUE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame35), GTK_SHADOW_NONE); alignment30 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment30, "alignment30"); gtk_widget_show (alignment30); gtk_container_add (GTK_CONTAINER (frame35), alignment30); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment30), 0, 0, 12, 0); vbox58 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox58, "vbox58"); gtk_widget_show (vbox58); gtk_container_add (GTK_CONTAINER (alignment30), vbox58); Log31 = gtk_check_button_new_with_mnemonic (_("Log to STDOUT")); + gtk_widget_set_name (Log31, "Log31"); gtk_widget_show (Log31); gtk_box_pack_start (GTK_BOX (vbox58), Log31, FALSE, FALSE, 0); Log30 = gtk_check_button_new_with_mnemonic (_("SYMs Log")); + gtk_widget_set_name (Log30, "Log30"); gtk_widget_show (Log30); gtk_box_pack_start (GTK_BOX (vbox58), Log30, FALSE, FALSE, 0); label87 = gtk_label_new (_("Misc")); + gtk_widget_set_name (label87, "label87"); gtk_widget_show (label87); gtk_frame_set_label_widget (GTK_FRAME (frame35), label87); gtk_label_set_use_markup (GTK_LABEL (label87), TRUE); dialog_action_area6 = GTK_DIALOG (Logging)->action_area; + gtk_widget_set_name (dialog_action_area6, "dialog_action_area6"); gtk_widget_show (dialog_action_area6); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area6), GTK_BUTTONBOX_END); Logging_Ok = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (Logging_Ok, "Logging_Ok"); gtk_widget_show (Logging_Ok); gtk_dialog_add_action_widget (GTK_DIALOG (Logging), Logging_Ok, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (Logging_Ok, GTK_CAN_DEFAULT); Logging2Cancel = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (Logging2Cancel, "Logging2Cancel"); gtk_widget_show (Logging2Cancel); gtk_dialog_add_action_widget (GTK_DIALOG (Logging), Logging2Cancel, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (Logging2Cancel, GTK_CAN_DEFAULT); @@ -4095,111 +4611,137 @@ create_MemDlg (void) GtkWidget *okbutton1; MemDlg = gtk_dialog_new (); + gtk_widget_set_name (MemDlg, "MemDlg"); gtk_window_set_title (GTK_WINDOW (MemDlg), _("Memcards")); gtk_window_set_type_hint (GTK_WINDOW (MemDlg), GDK_WINDOW_TYPE_HINT_DIALOG); dialog_vbox7 = GTK_DIALOG (MemDlg)->vbox; + gtk_widget_set_name (dialog_vbox7, "dialog_vbox7"); gtk_widget_show (dialog_vbox7); hbox40 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox40, "hbox40"); gtk_widget_show (hbox40); gtk_box_pack_start (GTK_BOX (dialog_vbox7), hbox40, TRUE, TRUE, 0); hbox41 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox41, "hbox41"); gtk_widget_show (hbox41); gtk_box_pack_start (GTK_BOX (hbox40), hbox41, TRUE, TRUE, 0); vbox64 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox64, "vbox64"); gtk_widget_show (vbox64); gtk_box_pack_start (GTK_BOX (hbox41), vbox64, TRUE, TRUE, 0); vbox70 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox70, "vbox70"); gtk_widget_show (vbox70); gtk_box_pack_start (GTK_BOX (vbox64), vbox70, TRUE, TRUE, 0); hbox46 = gtk_hbox_new (TRUE, 0); + gtk_widget_set_name (hbox46, "hbox46"); gtk_widget_show (hbox46); gtk_box_pack_start (GTK_BOX (vbox70), hbox46, TRUE, TRUE, 0); check_enable_mcd1 = gtk_check_button_new_with_mnemonic (_("Enabled")); + gtk_widget_set_name (check_enable_mcd1, "check_enable_mcd1"); gtk_widget_show (check_enable_mcd1); gtk_box_pack_start (GTK_BOX (hbox46), check_enable_mcd1, FALSE, FALSE, 0); check_enable_mcd2 = gtk_check_button_new_with_mnemonic (_("Enabled")); + gtk_widget_set_name (check_enable_mcd2, "check_enable_mcd2"); gtk_widget_show (check_enable_mcd2); gtk_box_pack_start (GTK_BOX (hbox46), check_enable_mcd2, FALSE, FALSE, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_enable_mcd2), TRUE); vbox65 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox65, "vbox65"); gtk_widget_show (vbox65); gtk_box_pack_start (GTK_BOX (vbox64), vbox65, TRUE, TRUE, 0); vbox66 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox66, "vbox66"); gtk_widget_show (vbox66); gtk_box_pack_start (GTK_BOX (vbox65), vbox66, TRUE, TRUE, 0); hbox44 = gtk_hbox_new (TRUE, 0); + gtk_widget_set_name (hbox44, "hbox44"); gtk_widget_show (hbox44); gtk_box_pack_start (GTK_BOX (vbox66), hbox44, TRUE, TRUE, 0); label106 = gtk_label_new (_("Memcard 1")); + gtk_widget_set_name (label106, "label106"); gtk_widget_show (label106); gtk_box_pack_start (GTK_BOX (hbox44), label106, TRUE, TRUE, 0); label107 = gtk_label_new (_("Memcard 2")); + gtk_widget_set_name (label107, "label107"); gtk_widget_show (label107); gtk_box_pack_start (GTK_BOX (hbox44), label107, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (label107), GTK_JUSTIFY_RIGHT); hbox45 = gtk_hbox_new (FALSE, 0); + gtk_widget_set_name (hbox45, "hbox45"); gtk_widget_show (hbox45); gtk_box_pack_start (GTK_BOX (vbox66), hbox45, TRUE, TRUE, 0); memcard1combo = gtk_combo_box_new_text (); + gtk_widget_set_name (memcard1combo, "memcard1combo"); gtk_widget_show (memcard1combo); gtk_box_pack_start (GTK_BOX (hbox45), memcard1combo, TRUE, TRUE, 0); memcard2combo = gtk_combo_box_new_text (); + gtk_widget_set_name (memcard2combo, "memcard2combo"); gtk_widget_show (memcard2combo); gtk_box_pack_start (GTK_BOX (hbox45), memcard2combo, TRUE, TRUE, 0); frame38 = gtk_frame_new (NULL); + gtk_widget_set_name (frame38, "frame38"); gtk_widget_show (frame38); gtk_box_pack_start (GTK_BOX (hbox41), frame38, TRUE, TRUE, 0); alignment33 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_set_name (alignment33, "alignment33"); gtk_widget_show (alignment33); gtk_container_add (GTK_CONTAINER (frame38), alignment33); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment33), 0, 0, 12, 0); vbox63 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox63, "vbox63"); gtk_widget_show (vbox63); gtk_container_add (GTK_CONTAINER (alignment33), vbox63); check_eject_mcds = gtk_check_button_new_with_mnemonic (_("Eject Mcds when loading SaveStates")); + gtk_widget_set_name (check_eject_mcds, "check_eject_mcds"); gtk_widget_show (check_eject_mcds); gtk_box_pack_start (GTK_BOX (vbox63), check_eject_mcds, FALSE, FALSE, 0); label103 = gtk_label_new (_("This feature tells games when the mcd contents have changed so that they re-index the new Mcd contents. WARNING: Disabling this option is NOT recommended, and could lead to MemCard corruption if you also use SaveStates.")); + gtk_widget_set_name (label103, "label103"); gtk_widget_show (label103); gtk_box_pack_start (GTK_BOX (vbox63), label103, FALSE, FALSE, 0); gtk_label_set_line_wrap (GTK_LABEL (label103), TRUE); label102 = gtk_label_new (_("Options")); + gtk_widget_set_name (label102, "label102"); gtk_widget_show (label102); gtk_frame_set_label_widget (GTK_FRAME (frame38), label102); gtk_label_set_use_markup (GTK_LABEL (label102), TRUE); dialog_action_area7 = GTK_DIALOG (MemDlg)->action_area; + gtk_widget_set_name (dialog_action_area7, "dialog_action_area7"); gtk_widget_show (dialog_action_area7); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area7), GTK_BUTTONBOX_END); memcardcancelbutton = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_set_name (memcardcancelbutton, "memcardcancelbutton"); gtk_widget_show (memcardcancelbutton); gtk_dialog_add_action_widget (GTK_DIALOG (MemDlg), memcardcancelbutton, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (memcardcancelbutton, GTK_CAN_DEFAULT); okbutton1 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_set_name (okbutton1, "okbutton1"); gtk_widget_show (okbutton1); gtk_dialog_add_action_widget (GTK_DIALOG (MemDlg), okbutton1, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); diff --git a/pcsx2/Linux/pcsx2.glade b/pcsx2/Linux/pcsx2.glade index 2d12461de5..103e4c2b04 100644 --- a/pcsx2/Linux/pcsx2.glade +++ b/pcsx2/Linux/pcsx2.glade @@ -1,5568 +1,8513 @@ - - - + + + - - True - Advanced Options - GDK_WINDOW_TYPE_HINT_DIALOG - - - True - - - True - - - True - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - Nearest - True - 0 - True - - - False - False - - - - - True - True - Negative - True - 0 - True - radio_EE_Round_Near - - - False - False - 1 - - - - - True - True - Positive - True - 0 - True - radio_EE_Round_Near - - - False - False - 2 - - - - - True - True - Chop/Zero - True - 0 - True - radio_EE_Round_Near - - - False - False - 3 - - - - - - - - - True - <b>Round Mode</b> - True - - - label_item - - - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - None - True - 0 - True - - - False - False - - - - - True - True - Normal - True - 0 - True - radio_EE_Clamp_None - - - False - False - 1 - - - - - True - True - Extra + Preserve Sign - True - 0 - True - radio_EE_Clamp_None - - - False - False - 2 - - - - - True - True - Full - True - 0 - True - True - radio_EE_Clamp_None - - - 3 - - - - - - - - - True - <b>Clamp Mode</b> - True - - - label_item - - - - - 1 - - - - - True - - - True - True - Flush to Zero - True - 0 - True - - - False - False - - - - - True - True - Denormals are Zero - True - 0 - True - - - False - False - 1 - - - - - 2 - - - - - - - - - True - <b>EE Recs Options</b> - True - - - label_item - - - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - Nearest - True - 0 - True - - - False - False - - - - - True - True - Negative - True - 0 - True - radio_VU_Round_Near - - - False - False - 1 - - - - - True - True - Positive - True - 0 - True - radio_VU_Round_Near - - - False - False - 2 - - - - - True - True - Zero - True - 0 - True - radio_VU_Round_Near - - - False - False - 3 - - - - - - - - - True - <b>Round Mode</b> - True - - - label_item - - - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - None - True - 0 - True - - - False - False - - - - - True - True - Normal - True - 0 - True - radio_VU_Clamp_None - - - False - False - 1 - - - - - True - True - Extra - True - 0 - True - radio_VU_Clamp_None - - - False - False - 2 - - - - - True - True - Extra + Preserve Sign - True - 0 - True - radio_VU_Clamp_None - - - False - False - 3 - - - - - - - - - True - <b>Clamp Mode</b> - True - - - label_item - - - - - 1 - - - - - True - 2 - 2 - - - True - False - True - Software Emulate DaZ - True - 0 - True - - - 1 - 2 - 1 - 2 - - - - - - - True - False - True - Set O & U Flags - True - 0 - True - - - 1 - 2 - - - - - - - True - True - Denormals are Zero - True - 0 - True - - - 1 - 2 - - - - - - - True - True - Flush to Zero - True - 0 - True - - - - - - - - - 2 - - - - - - - - - True - <b>VU Recs Options</b> - True - - - label_item - - - - - 1 - - - - - - - True - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - These options specify how your CPU rounds floating point values. + + + True + Advanced Options + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_SPREAD + + + + True + True + True + Defaults + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Nearest + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Negative + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_EE_Round_Near + + + 0 + False + False + + + + + + True + True + Positive + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_EE_Round_Near + + + 0 + False + False + + + + + + True + True + Chop/Zero + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_EE_Round_Near + + + 0 + False + False + + + + + + + + + + True + <b>Round Mode</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + None + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Normal + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_EE_Clamp_None + + + 0 + False + False + + + + + + True + True + Extra + Preserve Sign + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_EE_Clamp_None + + + 0 + False + False + + + + + + True + True + Full + True + GTK_RELIEF_NORMAL + True + True + False + True + radio_EE_Clamp_None + + + 0 + True + True + + + + + + + + + + True + <b>Clamp Mode</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + True + Flush to Zero + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Denormals are Zero + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + + + True + <b>EE Recs Options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Nearest + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Negative + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_VU_Round_Near + + + 0 + False + False + + + + + + True + True + Positive + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_VU_Round_Near + + + 0 + False + False + + + + + + True + True + Zero + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_VU_Round_Near + + + 0 + False + False + + + + + + + + + + True + <b>Round Mode</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + None + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Normal + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_VU_Clamp_None + + + 0 + False + False + + + + + + True + True + Extra + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_VU_Clamp_None + + + 0 + False + False + + + + + + True + True + Extra + Preserve Sign + True + GTK_RELIEF_NORMAL + True + False + False + True + radio_VU_Clamp_None + + + 0 + False + False + + + + + + + + + + True + <b>Clamp Mode</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 2 + 2 + False + 0 + 0 + + + + True + False + True + Software Emulate DaZ + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 1 + 2 + 1 + 2 + + + + + + + + True + False + True + Set O & U Flags + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 1 + 2 + + + + + + + + True + True + Denormals are Zero + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 1 + 2 + 0 + 1 + + + + + + + + True + True + Flush to Zero + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 0 + 1 + + + + + + + 0 + True + True + + + + + + + + + + True + <b>VU Recs Options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + These options specify how your CPU rounds floating point values. Try changing the roundmode for EE if your game hangs, it could make it work again. - True - - - - - - - True - <b>Round Mode</b> - True - - - label_item - - - - - False - False - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - These options specify how PCSX2's recompilers will clamp Infinities and NaN (Not a Number) values in the opcode instructions. + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + + + + True + <b>Round Mode</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + These options specify how PCSX2's recompilers will clamp Infinities and NaN (Not a Number) values in the opcode instructions. None - No clamping. (Fastest Mode) Normal - Clamps the result. Extra - Clamps the operands, the result, and anywhere in between. -Extra + Preserve Sign - Same as ""Extra"", except preserves NaN's sign when clamping the operands. (Slowest Mode) - True - - - - - - - True - <b>Clamp Mode</b> - True - - - label_item - - - - - False - False - 1 - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - Flush to Zero - Your CPU makes Floating Point Underflows become Zero, so it does less work. (Speed Up) +Extra + Preserve Sign - Same as ""Extra"", except preserves NaN's sign when clamping the operands. (Slowest Mode) + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + + + + True + <b>Clamp Mode</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + Flush to Zero - Your CPU makes Floating Point Underflows become Zero, so it does less work. (Speed Up) Denormals are Zero - Your CPU makes Floating Point Denormals become Zero, so it does less work. (Speed Up) - True - - - - - - - True - <b>Other Options</b> - True - - - label_item - - - - - False - False - 2 - - - - - 1 - - - - - 2 - - - - - True - GTK_BUTTONBOX_SPREAD - - - True - True - True - Defaults - True - 0 - - - - - - True - True - True - gtk-ok - True - -5 - - - - 1 - - - - - True - True - True - gtk-cancel - True - -6 - - - - 2 - - - - - False - GTK_PACK_END - - - - - - - True - PCSX2 Speed Hacks - GDK_WINDOW_TYPE_HINT_DIALOG - - - True - - - True - - - True - These hacks will affect the speed of PCSX2 but possibly compromise compatibility. + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + + + + True + <b>Other Options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + True + PCSX2 Speed Hacks + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + These hacks will affect the speed of PCSX2 but possibly compromise compatibility. If you have problems, Disable all of these and try again. - - - False - False - - - - - True - - - True - 0 - - - True - 12 - - - True - 2 - - - True - True - Default Cycle Rate - True - 0 - True - - - False - False - - - - - True - 0.28999999165534973 - Most compatible option - recommended for everyone with high-end machines. - True - - - False - False - 1 - - - - - True - True - Use x1.5 Cycle Rate - True - 0 - True - check_default_cycle_rate - - - False - False - 2 - - - - - True - 0.28999999165534973 - Moderate speedup, and works well with most games. - True - - - False - False - 3 - - - - - True - True - Use x2 Cycle Rate - True - 0 - True - check_default_cycle_rate - - - False - False - 4 - - - - - True - 0.36000001430511475 - Big speedup! Works well with many games. - True - - - False - False - 5 - - - - - True - True - Use x3 Cycle Rate - True - 0 - True - check_default_cycle_rate - - - False - False - 6 - - - - - True - 0.23999999463558197 - Big speedup, but causes flickering or missing geometry on many games. - True - - - False - False - 7 - - - - - True - - - False - False - 8 - - - - - True - Important: X2 & X3 sync hacks *will* cause choppy/skippy audio on many FMV movies. + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 2 + + + + True + True + Default Cycle Rate + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + Most compatible option - recommended for everyone with high-end machines. + False + False + GTK_JUSTIFY_LEFT + True + False + 0.289999991655 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + Use x1.5 Cycle Rate + True + GTK_RELIEF_NORMAL + True + False + False + True + check_default_cycle_rate + + + 0 + False + False + + + + + + True + Moderate speedup, and works well with most games. + False + False + GTK_JUSTIFY_LEFT + True + False + 0.289999991655 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + Use x2 Cycle Rate + True + GTK_RELIEF_NORMAL + True + False + False + True + check_default_cycle_rate + + + 0 + False + False + + + + + + True + Big speedup! Works well with many games. + False + False + GTK_JUSTIFY_LEFT + True + False + 0.360000014305 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + Use x3 Cycle Rate + True + GTK_RELIEF_NORMAL + True + False + False + True + check_default_cycle_rate + + + 0 + False + False + + + + + + True + Big speedup, but causes flickering or missing geometry on many games. + False + False + GTK_JUSTIFY_LEFT + True + False + 0.239999994636 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + + + 0 + False + False + + + + + + True + Important: X2 & X3 sync hacks *will* cause choppy/skippy audio on many FMV movies. Known to work well with a couple games, namely Shadow of the Colossus (but breaks most other games). - True - - - False - False - 9 - - - - - - - - - True - <b>EmotionEngine (EE) Sync Hacks</b> - True - - - label_item - - - - - - - True - - - True - True - Enable IOP x2 Cycle Rate - True - 0 - True - - - False - False - - - - - True - Small speedup, and works well with most games, - True - check_iop_cycle_rate - - - False - False - 1 - - - - - True - True - WaitCycles Sync Hack - True - 0 - True - - - False - False - 2 - - - - - True - Small speedup. Works well with most games, but it may cause certain games to crash, or freeze up during bootup or stage changes. - True - check_wait_cycles_sync_hack - - - False - False - 3 - - - - - True - True - INTC Sync Hack (experimental) - True - 0 - True - - - False - False - 4 - - - - - True - Huge speedup in many games, and a pretty high compatibility rate (some games still work better with EE sync hacks). - True - - - False - False - 5 - - - - - False - False - 1 - - - - - 1 - - - - - True - 0 - - - True - 12 - - - True - True - Escape Hack - Use Esc key to fully exit PCSX2. - True - 0 - True - - - - - - - True - <b>Miscellaneous</b> - True - - - label_item - - - - - False - False - 2 - - - - - False - False - 2 - - - - - True - GTK_BUTTONBOX_END - - - True - True - True - gtk-ok - True - -5 - - - - - - True - True - True - gtk-cancel - True - -6 - - - - 1 - - - - - False - GTK_PACK_END - - - - - - - True - Game Special Fixes - GDK_WINDOW_TYPE_HINT_DIALOG - - - True - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - FPU Compare Hack - Special fix for Digimon Rumble Arena 2. - True - 0 - True - - - False - False - - - - - True - True - VU Add / Sub Hack - Special fix for Tri-Ace games! - True - 0 - True - - - False - False - 1 - - - - - True - True - FPU Mul Hack - Special fix for Tales of Destiny (possibly other games). - True - 0 - True - - - False - 2 - - - - - - - - - True - <b>Some games need special settings. + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + True + <b>EmotionEngine (EE) Sync Hacks</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + True + Enable IOP x2 Cycle Rate + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + Small speedup, and works well with most games, + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + check_iop_cycle_rate + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + WaitCycles Sync Hack + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + Small speedup. Works well with most games, but it may cause certain games to crash, or freeze up during bootup or stage changes. + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + check_wait_cycles_sync_hack + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + INTC Sync Hack (experimental) + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + Huge speedup in many games, and a pretty high compatibility rate (some games still work better with EE sync hacks). + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + True + Escape Hack - Use Esc key to fully exit PCSX2. + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + + + + + True + <b>Miscellaneous</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + 0 + False + False + + + + + + + + True + Game Special Fixes + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + FPU Compare Hack - Special fix for Digimon Rumble Arena 2. + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + VU Add / Sub Hack - Special fix for Tri-Ace games! + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + FPU Mul Hack - Special fix for Tales of Destiny (possibly other games). + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + True + + + + + + + + + + True + <b>Some games need special settings. Configure them here.</b> - True - - - label_item - - - - - 2 - - - - - True - GTK_BUTTONBOX_END - - - True - True - True - gtk-ok - True - -5 - - - - - - True - True - True - gtk-cancel - True - -6 - - - - 1 - - - - - False - GTK_PACK_END - - - - - - - True - 5 - memWrite32 - - - True - 5 - 5 - - - True - 5 - 2 - - - True - Address - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - 0x - GTK_JUSTIFY_CENTER - - - False - False - 1 - - - - - True - True - • - - - 2 - - - - - False - False - - - - - True - 5 - 2 - - - True - Data - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - 0x - GTK_JUSTIFY_CENTER - - - False - False - 1 - - - - - True - True - • - - - 2 - - - - - 1 - - - - - True - 30 - - - True - True - True - gtk-ok - True - 0 - - - - - - True - True - True - gtk-cancel - True - 0 - - - - 1 - - - - - 2 - - - - - - - True - 5 - Program arguments - True - - - True - 5 - 5 - - - True - 0.10000000149011612 - Fill in the command line arguments for the opened program: - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - 5 - 2 - - - True - True - If you don't know what to write leave it blank - • - - - - - False - False - 1 - - - - - True - Note: this is intended for developers only. - GTK_JUSTIFY_CENTER - - - False - False - 2 - - - - - True - 30 - - - True - True - True - gtk-ok - True - 0 - - - - - - True - True - True - gtk-cancel - True - 0 - - - - 1 - - - - - 3 - - - - - - - True - 5 - Raw Dump - - - True - 5 - 5 - - - True - 0.10000000149011612 - Set Dump Addr (in Hex): - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - 5 - 2 - - - True - From 0x - GTK_JUSTIFY_CENTER - True - - - False - False - - - - - True - True - • - - - 1 - - - - - False - False - 1 - - - - - True - 5 - 2 - - - True - To 0x - - - False - False - - - - - True - True - • - - - 1 - - - - - 2 - - - - - True - 0.10000000149011612 - Dump File = "dump.txt" - - - False - False - 3 - - - - - True - 30 - - - True - True - True - gtk-ok - True - 0 - - - - - - True - True - True - gtk-cancel - True - 0 - - - - 1 - - - - - 4 - - - - - - - True - 5 - Dump code - - - True - 5 - 5 - - - True - 0.10000000149011612 - Set Dump Addr (in Hex): - - - False - False - - - - - True - 5 - 2 - - - True - From 0x - GTK_JUSTIFY_CENTER - True - - - False - False - - - - - True - True - • - - - 1 - - - - - False - False - 1 - - - - - True - 5 - 2 - - - True - To 0x - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - True - • - - - 1 - - - - - 2 - - - - - True - 0.10000000149011612 - Dump File = "dump.txt" - - - False - False - 3 - - - - - True - 30 - - - True - True - True - gtk-ok - True - 0 - - - - - - True - True - True - gtk-cancel - True - 0 - - - - 1 - - - - - 4 - - - - - - - True - 5 - SetBreakPoint Addr - - - True - 5 - 5 - - - True - 0.10000000149011612 - Set New BP Count (in Hex): - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - 5 - 2 - - - True - 0x - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - True - • - - - 1 - - - - - False - False - 1 - - - - - True - 30 - - - True - True - True - gtk-ok - True - 0 - - - - - - True - True - True - gtk-cancel - True - 0 - - - - 1 - - - - - 2 - - - - - - - True - 5 - SetBreakPoint Addr - - - True - 5 - 5 - - - True - 0.10000000149011612 - Set New BP Address (in Hex): - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - 5 - 2 - - - True - 0x - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - True - • - - - 1 - - - - - False - False - 1 - - - - - True - 30 - - - True - True - True - gtk-ok - True - 0 - - - - - - True - True - True - gtk-cancel - True - 0 - - - - 1 - - - - - 2 - - - - - - - True - 5 - SetPCDlg - - - True - 5 - 5 - - - True - 0.10000000149011612 - Set New PC Address (in Hex): - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - 5 - 2 - - - True - 0x - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - True - • - - - 1 - - - - - False - False - 1 - - - - - True - 30 - - - True - True - True - gtk-ok - True - 0 - - - - - - True - True - True - gtk-cancel - True - 0 - - - - 1 - - - - - 2 - - - - - - - True - 5 - PCSX2 Debugger - - - True - 5 - - - True - 5 - - - True - True - EE Debug Mode - True - 0 - True - - - - False - False - - - - - True - True - IOP Debug Mode - True - 0 - True - GtkRadioButton_EE - - - - False - False - 1 - - - - - False - - - - - True - 5 - - - True - - - True - False - GTK_POLICY_NEVER - - - True - - - True - False - - - - - - - - - True - 0 0 412 1 20 2 - - - False - 1 - - - - - - - True - - - True - - - True - True - True - Step - True - 0 - - - - - - True - True - True - Skip - True - 0 - - - - 1 - - - - - True - True - True - Go - True - 0 - - - - 2 - - - - - True - True - True - Log On/Off - True - 0 - - - - 3 - - - - - False - - - - - True - - - True - True - True - Set PC - True - 0 - - - - - - True - True - True - Set BP Addr - True - 0 - - - - 1 - - - - - True - True - True - Set BP Count - True - 0 - - - - 2 - - - - - True - True - True - Clear BPs - True - 0 - - - - 3 - - - - - False - 1 - - - - - True - - - True - True - True - Dump code - True - 0 - - - - - - True - True - True - Raw Dump - True - 0 - - - - 1 - - - - - True - True - True - Close - True - 0 - - - - 2 - - - - - False - 2 - - - - - False - 1 - - - - - True - 10 - - - True - True - True - memWrite32 - True - 0 - - - - - - False - 2 - - - - - 1 - - - - - - - True - 10 - Conf - False - - - True - - - True - 2 - 14 - 2 - 15 - - - - - - - - - True - - - - 1 - 2 - 13 - 14 - - - - - True - - - - 1 - 2 - - - - - True - - - - 1 - 2 - 1 - 2 - - - - - True - - - - 4 - 5 - - - - - True - - - - 1 - 2 - 4 - 5 - - - - - True - - - - 7 - 8 - - - - - True - - - - 1 - 2 - 7 - 8 - - - - - True - - - - 10 - 11 - - - - - True - - - - 1 - 2 - 10 - 11 - - - - - True - - - True - True - True - Configure - True - 0 - - - - - - True - True - True - Test - True - 0 - - - - 1 - - - - - True - True - True - About - True - 0 - - - - 2 - - - - - 1 - 2 - 5 - 6 - - - - - - True - - - True - True - True - Configure - True - 0 - - - - - - True - True - True - Test - True - 0 - - - - 1 - - - - - True - True - True - About - True - 0 - - - - 2 - - - - - 5 - 6 - - - - - - - True - - - True - True - True - Configure - True - 0 - - - - - - True - True - True - Test - True - 0 - - - - 1 - - - - - True - True - True - About - True - 0 - - - - 2 - - - - - 2 - 3 - - - - - - True - 0 - Graphics - GTK_JUSTIFY_CENTER - - - - - - - - - True - 0 - First Controller - GTK_JUSTIFY_CENTER - - - 3 - 4 - - - - - - - True - 0 - Second Controller - GTK_JUSTIFY_CENTER - - - 1 - 2 - 3 - 4 - - - - - - - True - 0 - Sound - GTK_JUSTIFY_CENTER - - - 1 - 2 - - - - - - - True - - - True - True - True - Configure - True - 0 - - - - - - True - True - True - Test - True - 0 - - - - 1 - - - - - True - True - True - About - True - 0 - - - - 2 - - - - - 1 - 2 - 2 - 3 - - - - - - - True - - - True - True - True - Configure - True - 0 - - - - - - True - True - True - Test - True - 0 - - - - 1 - - - - - True - True - True - About - True - 0 - - - - 2 - - - - - 8 - 9 - - - - - - True - 0 - Dev9 - GTK_JUSTIFY_CENTER - - - 6 - 7 - - - - - - - True - 0 - Cdvdrom - GTK_JUSTIFY_CENTER - - - 1 - 2 - 6 - 7 - - - - - - - True - - - True - True - True - Configure - True - 0 - - - - - - True - True - True - Test - True - 0 - - - - 1 - - - - - True - True - True - About - True - 0 - - - - 2 - - - - - 1 - 2 - 8 - 9 - - - - - - - True - 0 - Usb - GTK_JUSTIFY_CENTER - - - 9 - 10 - - - - - - - True - - - True - True - True - Configure - True - 0 - - - - - - True - True - True - Test - True - 0 - - - - 1 - - - - - True - True - True - About - True - 0 - - - - 2 - - - - - 11 - 12 - - - - - - True - - - True - True - True - Configure - True - 0 - - - - - - True - True - True - Test - True - 0 - - - - 1 - - - - - True - True - True - About - True - 0 - - - - 2 - - - - - 1 - 2 - 11 - 12 - - - - - - - True - 0 - FireWire - GTK_JUSTIFY_CENTER - - - 1 - 2 - 9 - 10 - - - - - - - True - 0 - Bios - GTK_JUSTIFY_CENTER - - - 1 - 2 - 12 - 13 - - - - - - - - - True - 14 - - - True - GTK_BUTTONBOX_START - - - True - True - True - Select Plugins Dir - True - 0 - - - - - - True - True - True - Select Bios Dir - True - 0 - - - - 1 - - - - - False - - - - - True - - - True - True - True - gtk-ok - True - 0 - - - - - - True - True - True - gtk-cancel - True - 0 - - - - 1 - - - - - 1 - - - - - 1 - - - - - - - True - 10 - Pcsx About - - - True - - - True - - - True - PCSX2 + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + + + 5 + True + memWrite32 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 5 + + + + 5 + True + False + 2 + + + + True + Address + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 0x + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + False + False + + + + + + 5 + True + False + 2 + + + + True + Data + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 0x + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + + + + 5 + True + Program arguments + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 5 + + + + True + Fill in the command line arguments for the opened program: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.10000000149 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 5 + True + False + 2 + + + + True + If you don't know what to write leave it blank + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + Note: this is intended for developers only. + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + + + + 5 + True + Raw Dump + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 5 + + + + True + Set Dump Addr (in Hex): + False + False + GTK_JUSTIFY_CENTER + False + False + 0.10000000149 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 5 + True + False + 2 + + + + True + From 0x + False + False + GTK_JUSTIFY_CENTER + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + False + False + + + + + + 5 + True + False + 2 + + + + True + To 0x + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + Dump File = "dump.txt" + False + False + GTK_JUSTIFY_LEFT + False + False + 0.10000000149 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + + + + 5 + True + Dump code + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 5 + + + + True + Set Dump Addr (in Hex): + False + False + GTK_JUSTIFY_LEFT + False + False + 0.10000000149 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 5 + True + False + 2 + + + + True + From 0x + False + False + GTK_JUSTIFY_CENTER + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + False + False + + + + + + 5 + True + False + 2 + + + + True + To 0x + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + Dump File = "dump.txt" + False + False + GTK_JUSTIFY_LEFT + False + False + 0.10000000149 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + + + + 5 + True + SetBreakPoint Addr + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 5 + + + + True + Set New BP Count (in Hex): + False + False + GTK_JUSTIFY_CENTER + False + False + 0.10000000149 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 5 + True + False + 2 + + + + True + 0x + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + + + + 5 + True + SetBreakPoint Addr + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 5 + + + + True + Set New BP Address (in Hex): + False + False + GTK_JUSTIFY_CENTER + False + False + 0.10000000149 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 5 + True + False + 2 + + + + True + 0x + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + + + + 5 + True + SetPCDlg + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 5 + + + + True + Set New PC Address (in Hex): + False + False + GTK_JUSTIFY_CENTER + False + False + 0.10000000149 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 5 + True + False + 2 + + + + True + 0x + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + • + False + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + + + + 5 + True + PCSX2 Debugger + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 0 + + + + True + False + 5 + + + + True + True + EE Debug Mode + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + True + True + IOP Debug Mode + True + GTK_RELIEF_NORMAL + True + False + False + True + GtkRadioButton_EE + + + + 0 + False + False + + + + + 0 + False + True + + + + + + 5 + True + False + 0 + + + + True + False + 0 + + + + True + GTK_POLICY_ALWAYS + GTK_POLICY_NEVER + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + GTK_SHADOW_IN + + + + True + False + False + False + True + False + False + False + + + + + + + 0 + True + True + + + + + + True + GTK_UPDATE_CONTINUOUS + False + 0 0 412 1 20 2 + + + 0 + False + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Step + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Skip + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Go + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Log On/Off + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + True + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Set PC + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Set BP Addr + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Set BP Count + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Clear BPs + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + True + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Dump code + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Raw Dump + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Close + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 10 + + + + True + True + True + memWrite32 + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + + + 10 + True + Conf + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + 2 + True + 14 + 2 + False + 0 + 15 + + + + True + + False + True + + + 1 + 2 + 13 + 14 + + + + + + True + + False + True + + + 0 + 1 + 1 + 2 + + + + + + True + + False + True + + + 1 + 2 + 1 + 2 + + + + + + True + + False + True + + + 0 + 1 + 4 + 5 + + + + + + True + + False + True + + + 1 + 2 + 4 + 5 + + + + + + True + + False + True + + + 0 + 1 + 7 + 8 + + + + + + True + + False + True + + + 1 + 2 + 7 + 8 + + + + + + True + + False + True + + + 0 + 1 + 10 + 11 + + + + + + True + + False + True + + + 1 + 2 + 10 + 11 + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Configure + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Test + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + About + True + GTK_RELIEF_NORMAL + True + + + + + + 1 + 2 + 5 + 6 + + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Configure + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Test + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + About + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + 1 + 5 + 6 + + + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Configure + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Test + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + About + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + 1 + 2 + 3 + + + + + + + True + Graphics + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + + + True + First Controller + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + + + + + + + + True + Second Controller + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 3 + 4 + + + + + + + + True + Sound + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + + + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Configure + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Test + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + About + True + GTK_RELIEF_NORMAL + True + + + + + + 1 + 2 + 2 + 3 + + + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Configure + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Test + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + About + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + 1 + 8 + 9 + + + + + + + True + Dev9 + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 6 + 7 + + + + + + + + True + Cdvdrom + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 6 + 7 + + + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Configure + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Test + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + About + True + GTK_RELIEF_NORMAL + True + + + + + + 1 + 2 + 8 + 9 + + + + + + + + True + Usb + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 9 + 10 + + + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Configure + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Test + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + About + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + 1 + 11 + 12 + + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + Configure + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Test + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + About + True + GTK_RELIEF_NORMAL + True + + + + + + 1 + 2 + 11 + 12 + + + + + + + + True + FireWire + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 9 + 10 + + + + + + + + True + Bios + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 12 + 13 + + + + + + + 0 + True + True + + + + + + True + False + 14 + + + + True + GTK_BUTTONBOX_START + 0 + + + + True + True + True + Select Plugins Dir + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Select Bios Dir + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + True + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + 10 + True + Pcsx About + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + False + 0 + + + + True + PCSX2 Version x.x - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - 5 - 0 - - - True - 5 - - - True - written by... - GTK_JUSTIFY_CENTER - True - - - False - False - - - - - - - False - False - 1 - - - - - - - True - 5 - 0 - - - True - 5 - - - True - greets to... - GTK_JUSTIFY_CENTER - True - - - False - False - - - - - - - False - False - 1 - - - - - True - GTK_BUTTONBOX_EDGE - - - True - True - True - gtk-ok - True - 0 - - - - - - False - False - 2 - - - - - - - True - PCSX - GTK_WIN_POS_CENTER - - - - - True - - - True - - - True - _File - True - - - - - True - _Run CD - True - - - - - - True - _Load Elf - True - - - - - - True - - - - - True - States - True - - - - - True - Load - True - - - - - True - Slot 0 - True - - - - - - True - Slot 1 - True - - - - - - True - Slot 2 - True - - - - - - True - Slot 3 - True - - - - - - True - Slot 4 - True - - - - - - True - Other... - True - - - - - - - - - - True - Save - True - - - - - True - Slot 0 - True - - - - - - True - Slot 1 - True - - - - - - True - Slot 2 - True - - - - - - True - Slot 3 - True - - - - - - True - Slot 4 - True - - - - - - True - Other... - True - - - - - - - - - - - - - - True - E_xit - True - - - - - - - - - - True - _Run - True - - - - - True - E_xecute - True - - - - - - True - Re_set - True - - - - - - - - - - True - _Config - True - - - - - True - _Configure - True - - - - - - True - - - - - True - _Graphics - True - - - - - - True - C_ontrollers - True - - - - - - True - _Sound - True - - - - - - True - _Cdvdrom - True - - - - - - True - D_ev9 - True - - - - - - True - U_SB - True - - - - - - True - Fire_Wire - True - - - - - - True - - - - - True - Memcards - True - - - - - - True - C_pu - True - - - - - - True - Game Fixes - True - - - - - - True - Speed Hacks - True - - - - - - True - Advanced - True - - - - - - - - - - True - _Language - True - - - - - True - _Misc - True - - - - - True - Patch _Browser - True - - - - - - True - Patch _Finder - True - - - - - - True - - - - - True - Enable _Console - True - - - - - - True - Enable _Patches - True - - - - - - True - Print CDVD Info - True - - - - - - - - - - True - _Debug - True - - - - - True - Enter Debugger ... - True - - - - - - True - Logging - True - - - - - - True - - - - - True - _Arguments - True - - - - - - - - - - True - _Help - True - - - - - True - About PCSX2... - True - - - - - - - - - - False - False - - - - - True - pcsxAbout.bmp - - - 1 - 1 - - - - - True - - - - - - 2 - - - - - - - Patch List - True - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - - - True - True - GTK_SHADOW_IN - - - True - True - - - - - - - True - - - True - True - Enable / Diable - True - 0 - - - False - False - - - - - True - True - Add Patch - True - 0 - - - False - False - 1 - - - - - True - True - Edit Patch - True - 0 - - - False - False - 2 - - - - - True - True - Add GS2v3-4 - True - 0 - - - False - False - 3 - - - - - True - True - Add Raw - True - 0 - - - False - False - 4 - - - - - True - True - Pnach Writer - True - 0 - - - False - False - 5 - - - - - True - True - Skip Mpeg - True - 0 - - - False - False - 6 - - - - - - - - - - - True - True - gtk-close - True - 0 - - - False - False - 9 - - - - - 1 - - - - - - - True - Patch Finder - True - GDK_WINDOW_TYPE_HINT_DIALOG - - - True - - - True - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - EE RAM - True - 0 - True - - - False - False - - - - - True - True - IOP RAM - True - 0 - True - radiobutton1 - - - False - False - 1 - - - - - - - - - True - <b>Search In</b> - True - - - label_item - - - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - 3 - 2 - - - - - - True - True - Unsigned - True - 0 - True - - - 2 - 3 - - - - - - - True - True - 64 bits - True - 0 - True - - - 1 - 2 - 1 - 2 - - - - - - - True - True - 32 bits - True - 0 - True - - - 1 - 2 - - - - - - - True - True - 16 bits - True - 0 - True - - - 1 - 2 - - - - - - - True - True - 8 bits - True - 0 - True - - - - - - - - - - - - - True - <b>Values of Size</b> - True - - - label_item - - - - - 1 - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - Equal - True - 0 - True - - - False - False - - - - - True - True - Greater Then - True - 0 - True - radiobutton7 - - - False - False - 1 - - - - - True - True - Less Then - True - 0 - True - radiobutton7 - - - False - False - 2 - - - - - True - True - Greater Then or Equal - True - 0 - True - radiobutton7 - - - False - False - 3 - - - - - True - True - Less Then or Equal - True - 0 - True - radiobutton7 - - - False - False - 4 - - - - - True - True - Not Equal - True - 0 - True - radiobutton7 - - - False - False - 5 - - - - - - - - - True - <b>Being</b> - True - - - label_item - - - - - 2 - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - Old Value - True - 0 - True - - - False - False - - - - - True - True - Specific Value - True - 0 - True - radiobutton13 - - - False - False - 1 - - - - - True - True - - - False - False - 2 - - - - - - - - - True - <b>Compared To</b> - True - - - label_item - - - - - 3 - - - - - - - True - - - True - - - True - - - True - Results: - - - False - False - - - - - True - %s - GTK_JUSTIFY_CENTER - - - 1 - - - - - True - Ready to Search - GTK_JUSTIFY_RIGHT - - - False - 2 - - - - - False - False - - - - - True - True - GTK_SHADOW_IN - - - True - True - - - - - 1 - - - - - - - True - 2 - 2 - - - True - True - gtk-close - True - 0 - - - 1 - 2 - 1 - 2 - - - - - - True - True - gtk-add - True - 0 - - - 1 - 2 - - - - - - True - True - gtk-find - True - 0 - - - 1 - 2 - - - - - - True - True - gtk-clear - True - 0 - - - - - - - - False - 1 - - - - - 1 - - - - - - - True - dialog1 - GDK_WINDOW_TYPE_HINT_DIALOG - - - True - - - True - - - True - - - True - 0 - - - True - 12 - - - True - - - True - CPU vendor - - - False - False - - - - - True - Family - - - False - False - 1 - - - - - True - Cpu Speed - - - False - False - 2 - - - - - True - Features - - - False - False - 3 - - - - - - - - - True - True - - - label_item - - - - - - - True - True - EERec - EE/IOP recompiler (Need MMX/SSE/SSE2) - True - 0 - True - - - False - False - 1 - - - - - True - 5 - 0 - - - True - 5 - - - True - True - VU0rec - enable recompiler for VU0 unit - True - 0 - True - - - False - False - - - - - True - True - VU1rec - enable recompiler for VU1 unit - True - 0 - True - - - False - False - 1 - - - - - - - True - VU Recompilers - All options are set by default - - - label_item - - - - - 2 - - - - - True - True - Multi threaded GS mode (MTGS) + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + 5 + True + False + 0 + + + + True + written by... + False + False + GTK_JUSTIFY_CENTER + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + 5 + True + False + 0 + + + + True + greets to... + False + False + GTK_JUSTIFY_CENTER + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_EDGE + 0 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + False + + + + + + + + True + PCSX + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + + + True + False + 0 + + + + True + GTK_PACK_DIRECTION_LTR + GTK_PACK_DIRECTION_LTR + + + + True + _File + True + + + + + + + True + _Run CD + True + + + + + + + True + _Load Elf + True + + + + + + + True + + + + + + True + States + True + + + + + + + True + Load + True + + + + + + + True + Slot 0 + True + + + + + + + True + Slot 1 + True + + + + + + + True + Slot 2 + True + + + + + + + True + Slot 3 + True + + + + + + + True + Slot 4 + True + + + + + + + True + Other... + True + + + + + + + + + + + True + Save + True + + + + + + + True + Slot 0 + True + + + + + + + True + Slot 1 + True + + + + + + + True + Slot 2 + True + + + + + + + True + Slot 3 + True + + + + + + + True + Slot 4 + True + + + + + + + True + Other... + True + + + + + + + + + + + + + + + True + E_xit + True + + + + + + + + + + + True + _Run + True + + + + + + + True + E_xecute + True + + + + + + + True + Re_set + True + + + + + + + + + + + True + _Config + True + + + + + + + True + _Configure + True + + + + + + + True + + + + + + True + _Graphics + True + + + + + + + True + C_ontrollers + True + + + + + + + True + _Sound + True + + + + + + + True + _Cdvdrom + True + + + + + + + True + D_ev9 + True + + + + + + + True + U_SB + True + + + + + + + True + Fire_Wire + True + + + + + + + True + + + + + + True + Memcards + True + + + + + + + True + C_pu + True + + + + + + + True + Game Fixes + True + + + + + + + True + Speed Hacks + True + + + + + + + True + Advanced + True + + + + + + + + + + + True + _Language + True + + + + + + True + _Misc + True + + + + + + + True + Patch _Browser + True + + + + + + + True + Patch _Finder + True + + + + + + + True + + + + + + True + Enable _Console + True + False + + + + + + + True + Enable _Patches + True + False + + + + + + + True + Print CDVD Info + True + False + + + + + + + + + + + True + _Debug + True + + + + + + + True + Enter Debugger ... + True + + + + + + + True + Logging + True + + + + + + + True + + + + + + True + _Arguments + True + + + + + + + + + + + True + _Help + True + + + + + + + True + About PCSX2... + True + + + + + + + + + + 0 + False + False + + + + + + True + pcsxAbout.bmp + 0.5 + 0.5 + 0 + 0 + + + 1 + True + True + + + + + + True + False + 0 + + + + + + + 0 + True + True + + + + + + + + Patch List + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + True + False + False + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + True + Enable / Diable + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + True + True + Add Patch + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + True + True + Edit Patch + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + True + True + Add GS2v3-4 + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + True + True + Add Raw + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + True + True + Pnach Writer + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + True + True + Skip Mpeg + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + + + + + + + + + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + True + Patch Finder + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + EE RAM + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + IOP RAM + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobutton1 + + + 0 + False + False + + + + + + + + + + True + <b>Search In</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + 3 + 2 + False + 0 + 0 + + + + True + True + Unsigned + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 2 + 3 + + + + + + + + True + True + 64 bits + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 1 + 2 + 1 + 2 + + + + + + + + True + True + 32 bits + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 1 + 2 + + + + + + + + True + True + 16 bits + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 1 + 2 + 0 + 1 + + + + + + + + True + True + 8 bits + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 0 + 1 + + + + + + + + + + + + True + <b>Values of Size</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Equal + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Greater Then + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobutton7 + + + 0 + False + False + + + + + + True + True + Less Then + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobutton7 + + + 0 + False + False + + + + + + True + True + Greater Then or Equal + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobutton7 + + + 0 + False + False + + + + + + True + True + Less Then or Equal + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobutton7 + + + 0 + False + False + + + + + + True + True + Not Equal + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobutton7 + + + 0 + False + False + + + + + + + + + + True + <b>Being</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Old Value + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Specific Value + True + GTK_RELIEF_NORMAL + True + False + False + True + radiobutton13 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + * + False + + + 0 + False + False + + + + + + + + + + True + <b>Compared To</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + Results: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + %s + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + Ready to Search + False + False + GTK_JUSTIFY_RIGHT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + False + + + + + 0 + False + False + + + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + 2 + 2 + False + 0 + 0 + + + + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + + + 1 + 2 + 1 + 2 + + + + + + + True + True + gtk-add + True + GTK_RELIEF_NORMAL + True + + + 0 + 1 + 1 + 2 + + + + + + + True + True + gtk-find + True + GTK_RELIEF_NORMAL + True + + + 1 + 2 + 0 + 1 + + + + + + + True + True + gtk-clear + True + GTK_RELIEF_NORMAL + True + + + 0 + 1 + 0 + 1 + + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + + + True + dialog1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + 0 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + CPU vendor + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Family + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Cpu Speed + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Features + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + True + + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + True + EERec - EE/IOP recompiler (Need MMX/SSE/SSE2) + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + 5 + True + False + 0 + + + + True + True + VU0rec - enable recompiler for VU0 unit + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + VU1rec - enable recompiler for VU1 unit + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + + + True + VU Recompilers - All options are set by default + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + True + Multi threaded GS mode (MTGS) (faster on dual core/HT CPUs, requires pcsx2 restart) - True - 0 - True - - - False - False - 3 - - - - - - - True - - - True - 0 - - - True - 12 - - - True - - - True - True - Normal - All frames are rendered as fast as possible - True - 0 - True - - - False - False - - - - - True - True - Limit - Force frames to normal speeds if too fast - True - 0 - True - GtkRadioButton_LimitNormal - - - False - False - 1 - - - - - True - True - Frame Skip - In order to achieve normal speeds, + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Normal - All frames are rendered as fast as possible + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Limit - Force frames to normal speeds if too fast + True + GTK_RELIEF_NORMAL + True + False + False + True + GtkRadioButton_LimitNormal + + + 0 + False + False + + + + + + True + True + Frame Skip - In order to achieve normal speeds, some frames are skipped (faster). Fps displayed counts skipped frames too - True - 0 - True - GtkRadioButton_LimitNormal - - - False - False - 2 - - - - - True - True - VU Skip - Same as Frame Skip, but tried to skip more. + True + GTK_RELIEF_NORMAL + True + False + False + True + GtkRadioButton_LimitNormal + + + 0 + False + False + + + + + + True + True + VU Skip - Same as Frame Skip, but tried to skip more. Artifacts might be present, but will be faster - True - 0 - True - GtkRadioButton_LimitNormal - - - False - False - 3 - - - - - - - - - True - Frame Limiting (F4 switches in-game) - True - - - label_item - - - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - - - True - Custom FPS Limit (0=auto): - - - - - True - True - 0 0 9999 1 0 0 - 1 - True - - - False - GTK_PACK_END - 1 - - - - - - - True - - - True - Skip Frames when slower than[1]: - - - - - True - True - 0 0 9999 1 0 0 - 1 - - - False - GTK_PACK_END - 1 - - - - - 1 - - - - - True - - - True - Consecutive Frames before skipping[2]: - - - - - True - True - 0 0 9999 1 0 0 - 1 - - - False - GTK_PACK_END - 1 - - - - - 2 - - - - - True - - - True - Consecutive Frames to skip[3]: - - - - - True - True - 0 0 9999 1 0 0 - 1 - - - False - GTK_PACK_END - 1 - - - - - 3 - - - - - True - [1] Only skips when slower then this number(0 is auto; 9999 always skips). - True - - - False - False - 4 - - - - - True - [2] Renders this many frames before skipping (0 is default). - True - - - False - False - 5 - - - - - True - [3] Skips this many frames before continuing (0 is default). - True - - - False - False - 6 - - - - - - - - - True - Detailed Settings - True - - - label_item - - - - - 1 - - - - - 1 - - - - - 2 - - - - - True - GTK_BUTTONBOX_END - - - True - True - True - gtk-ok - True - 0 - - - - - - True - True - True - gtk-cancel - True - 0 - - - - 1 - - - - - False - GTK_PACK_END - - - - - - - True - Logging - 200 - 450 - GDK_WINDOW_TYPE_HINT_DIALOG - - - True - - - True - True - GTK_SHADOW_IN - - - True - - - True - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - Cpu Log - True - 0 - True - - - False - False - - - - - True - True - Mem Log - True - 0 - True - - - False - False - 1 - - - - - True - True - Hw Log - True - 0 - True - - - False - False - 2 - - - - - True - True - Dma Log - True - 0 - True - - - False - False - 3 - - - - - True - True - Bios Log - True - 0 - True - - - False - False - 4 - - - - - True - True - Elf Log - True - 0 - True - - - False - False - 5 - - - - - True - True - Fpu Log - True - 0 - True - - - False - False - 6 - - - - - True - True - MMI Log - True - 0 - True - - - False - False - 7 - - - - - True - True - VU0 Log - True - 0 - True - - - False - False - 8 - - - - - True - True - Cop0 Log - True - 0 - True - - - False - False - 9 - - - - - True - True - Vif Log - True - 0 - True - - - False - False - 10 - - - - - True - True - SPR Log - True - 0 - True - - - False - False - 11 - - - - - True - True - GIF Log - True - 0 - True - - - False - False - 12 - - - - - True - True - Sif Log - True - 0 - True - - - False - False - 13 - - - - - True - True - IPU Log - True - 0 - True - - - False - False - 14 - - - - - True - True - VU Micro Log - True - 0 - True - - - False - False - 15 - - - - - True - True - RPC Log - True - 0 - True - - - False - False - 16 - - - - - - - - - True - <b>EE Logs</b> - True - - - label_item - - - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - IOP Log - True - 0 - True - - - False - False - - - - - True - True - Mem Log - True - 0 - True - - - False - False - 1 - - - - - True - True - Hw Log - True - 0 - True - - - False - False - 2 - - - - - True - True - Bios Log - True - 0 - True - - - False - False - 3 - - - - - True - True - Dma Log - True - 0 - True - - - False - False - 4 - - - - - True - True - Pad Log - True - 0 - True - - - False - False - 5 - - - - - True - True - Gte Log - True - 0 - True - - - False - False - 6 - - - - - True - True - Cdr Log - True - 0 - True - - - False - False - 7 - - - - - True - True - GPU Log - True - 0 - True - - - False - False - 8 - - - - - - - - - True - <b>IOP Logs</b> - True - - - label_item - - - - - 1 - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - True - True - Log to STDOUT - True - 0 - True - - - False - False - - - - - True - True - SYMs Log - True - 0 - True - - - False - False - 1 - - - - - - - - - True - <b>Misc</b> - True - - - label_item - - - - - 2 - - - - - - - - - 2 - - - - - True - GTK_BUTTONBOX_END - - - True - True - True - gtk-ok - True - -5 - - - - - - True - True - True - gtk-cancel - True - -6 - - - - 1 - - - - - False - GTK_PACK_END - - - - - - - True - Memcards - GDK_WINDOW_TYPE_HINT_DIALOG - - - True - - - True - - - True - - - True - - - True - - - True - True - - - True - True - Enabled - True - 0 - True - - - False - False - - - - - True - True - Enabled - True - 0 - True - True - - - False - False - 1 - - - - - - - - - True - - - True - - - True - True - - - True - Memcard 1 - - - - - True - Memcard 2 - GTK_JUSTIFY_RIGHT - - - False - False - 1 - - - - - - - True - - - True - - - - - True - - - 1 - - - - - 1 - - - - - - - 1 - - - - - - - - - - True - 0 - - - True - 12 - - - True - - - True - True - Eject Mcds when loading SaveStates - True - 0 - True - - - False - False - - - - - True - This feature tells games when the mcd contents have changed so that they re-index the new Mcd contents. WARNING: Disabling this option is NOT recommended, and could lead to MemCard corruption if you also use SaveStates. - True - - - False - False - 1 - - - - - - - - - True - <b>Options</b> - True - - - label_item - - - - - 1 - - - - - - - 2 - - - - - True - GTK_BUTTONBOX_END - - - True - True - True - gtk-ok - True - -5 - - - - - - True - True - True - gtk-cancel - True - -6 - - - - 1 - - - - - False - GTK_PACK_END - - - - - + True + GTK_RELIEF_NORMAL + True + False + False + True + GtkRadioButton_LimitNormal + + + 0 + False + False + + + + + + + + + + True + Frame Limiting (F4 switches in-game) + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + Custom FPS Limit (0=auto): + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 0 9999 1 0 0 + + + 0 + False + True + GTK_PACK_END + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + Skip Frames when slower than[1]: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 9999 1 0 0 + + + 0 + False + True + GTK_PACK_END + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + Consecutive Frames before skipping[2]: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 9999 1 0 0 + + + 0 + False + True + GTK_PACK_END + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + Consecutive Frames to skip[3]: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 9999 1 0 0 + + + 0 + False + True + GTK_PACK_END + + + + + 0 + True + True + + + + + + True + [1] Only skips when slower then this number(0 is auto; 9999 always skips). + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + [2] Renders this many frames before skipping (0 is default). + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + [3] Skips this many frames before continuing (0 is default). + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + True + Detailed Settings + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + True + Logging + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 200 + 450 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + GTK_SHADOW_IN + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Cpu Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Mem Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Hw Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Dma Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Bios Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Elf Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Fpu Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + MMI Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + VU0 Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Cop0 Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Vif Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + SPR Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + GIF Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Sif Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + IPU Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + VU Micro Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + RPC Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + + + + + True + <b>EE Logs</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + IOP Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Mem Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Hw Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Bios Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Dma Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Pad Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Gte Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Cdr Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + GPU Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + + + + + True + <b>IOP Logs</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Log to STDOUT + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + SYMs Log + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + + + + + True + <b>Misc</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + + + + 0 + True + True + + + + + + + + True + Memcards + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + 0 + + + + True + True + Enabled + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Enabled + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + 0 + + + + True + Memcard 1 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + Memcard 2 + False + False + GTK_JUSTIFY_RIGHT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + False + True + + + 0 + True + True + + + + + + True + False + True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Eject Mcds when loading SaveStates + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + This feature tells games when the mcd contents have changed so that they re-index the new Mcd contents. WARNING: Disabling this option is NOT recommended, and could lead to MemCard corruption if you also use SaveStates. + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + True + <b>Options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + From c5b366095a2c27b0d307fc0bcb3b39c97906a2da Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 19 Mar 2009 10:20:56 +0000 Subject: [PATCH 76/77] Fix for some random slowdown introduced in 815 (bad cacheline coloring caused a random 30% speed drop when not using speedhacks) >_< git-svn-id: http://pcsx2.googlecode.com/svn/trunk@819 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/PS2Etypes.h | 2 +- pcsx2/vtlb.cpp | 78 ++++++++++++++++------------------- pcsx2/vtlb.h | 15 +++++-- pcsx2/x86/ix86-32/recVTLB.cpp | 16 +++---- 4 files changed, 57 insertions(+), 54 deletions(-) diff --git a/common/include/PS2Etypes.h b/common/include/PS2Etypes.h index 258deaaded..9dceb3cd0a 100644 --- a/common/include/PS2Etypes.h +++ b/common/include/PS2Etypes.h @@ -82,7 +82,7 @@ typedef unsigned int uint; // Note: building the 'extern' into PCSX2_ALIGNED16_DECL fixes Visual Assist X's intellisense. #define PCSX2_ALIGNED(alig,x) __declspec(align(alig)) x -#define PCSX2_ALIGNED_EXTERN(alig,x) __declspec(align(alig)) x +#define PCSX2_ALIGNED_EXTERN(alig,x) extern __declspec(align(alig)) x #define PCSX2_ALIGNED16(x) __declspec(align(16)) x #define PCSX2_ALIGNED16_EXTERN(x) extern __declspec(align(16)) x diff --git a/pcsx2/vtlb.cpp b/pcsx2/vtlb.cpp index f2e3c82ba4..5bc06b18a9 100644 --- a/pcsx2/vtlb.cpp +++ b/pcsx2/vtlb.cpp @@ -50,13 +50,7 @@ using namespace vtlb_private; namespace vtlb_private { - s32 pmap[VTLB_PMAP_ITEMS]; //512KB - s32 vmap[VTLB_VMAP_ITEMS]; //4MB - - // first indexer -- 8/16/32/64/128 bit tables [values 0-4] - // second indexer -- read/write [0 or 1] - // third indexer -- 128 possible handlers! - void* RWFT[5][2][128]; + PCSX2_ALIGNED( 64, MapData vtlbdata ); } vtlbHandler vtlbHandlerCount=0; @@ -101,7 +95,7 @@ callfunction: template __forceinline DataType __fastcall MemOp_r0(u32 addr) { - u32 vmv=vmap[addr>>VTLB_PAGE_BITS]; + u32 vmv=vtlbdata.vmap[addr>>VTLB_PAGE_BITS]; s32 ppf=addr+vmv; if (!(ppf<0)) @@ -111,13 +105,13 @@ __forceinline DataType __fastcall MemOp_r0(u32 addr) u32 hand=(u8)vmv; u32 paddr=ppf-hand+0x80000000; //SysPrintf("Translated 0x%08X to 0x%08X\n",addr,paddr); - //return reinterpret_cast::HandlerType*>(RWFT[TemplateHelper::sidx][0][hand])(paddr,data); + //return reinterpret_cast::HandlerType*>(vtlbdata.RWFT[TemplateHelper::sidx][0][hand])(paddr,data); switch( DataSize ) { - case 8: return ((vtlbMemR8FP*)RWFT[0][0][hand])(paddr); - case 16: return ((vtlbMemR16FP*)RWFT[1][0][hand])(paddr); - case 32: return ((vtlbMemR32FP*)RWFT[2][0][hand])(paddr); + case 8: return ((vtlbMemR8FP*)vtlbdata.RWFT[0][0][hand])(paddr); + case 16: return ((vtlbMemR16FP*)vtlbdata.RWFT[1][0][hand])(paddr); + case 32: return ((vtlbMemR32FP*)vtlbdata.RWFT[2][0][hand])(paddr); jNO_DEFAULT; } @@ -127,7 +121,7 @@ __forceinline DataType __fastcall MemOp_r0(u32 addr) template __forceinline void __fastcall MemOp_r1(u32 addr, DataType* data) { - u32 vmv=vmap[addr>>VTLB_PAGE_BITS]; + u32 vmv=vtlbdata.vmap[addr>>VTLB_PAGE_BITS]; s32 ppf=addr+vmv; if (!(ppf<0)) @@ -146,8 +140,8 @@ __forceinline void __fastcall MemOp_r1(u32 addr, DataType* data) switch( DataSize ) { - case 64: ((vtlbMemR64FP*)RWFT[3][0][hand])(paddr, data); break; - case 128: ((vtlbMemR128FP*)RWFT[4][0][hand])(paddr, data); break; + case 64: ((vtlbMemR64FP*)vtlbdata.RWFT[3][0][hand])(paddr, data); break; + case 128: ((vtlbMemR128FP*)vtlbdata.RWFT[4][0][hand])(paddr, data); break; jNO_DEFAULT; } @@ -157,7 +151,7 @@ __forceinline void __fastcall MemOp_r1(u32 addr, DataType* data) template __forceinline void __fastcall MemOp_w0(u32 addr, DataType data) { - u32 vmv=vmap[addr>>VTLB_PAGE_BITS]; + u32 vmv=vtlbdata.vmap[addr>>VTLB_PAGE_BITS]; s32 ppf=addr+vmv; if (!(ppf<0)) { @@ -172,9 +166,9 @@ __forceinline void __fastcall MemOp_w0(u32 addr, DataType data) switch( DataSize ) { - case 8: return ((vtlbMemW8FP*)RWFT[0][1][hand])(paddr, (u8)data); - case 16: return ((vtlbMemW16FP*)RWFT[1][1][hand])(paddr, (u16)data); - case 32: return ((vtlbMemW32FP*)RWFT[2][1][hand])(paddr, (u32)data); + case 8: return ((vtlbMemW8FP*)vtlbdata.RWFT[0][1][hand])(paddr, (u8)data); + case 16: return ((vtlbMemW16FP*)vtlbdata.RWFT[1][1][hand])(paddr, (u16)data); + case 32: return ((vtlbMemW32FP*)vtlbdata.RWFT[2][1][hand])(paddr, (u32)data); jNO_DEFAULT; } @@ -184,7 +178,7 @@ template __forceinline void __fastcall MemOp_w1(u32 addr,const DataType* data) { verify(DataSize==128 || DataSize==64); - u32 vmv=vmap[addr>>VTLB_PAGE_BITS]; + u32 vmv=vtlbdata.vmap[addr>>VTLB_PAGE_BITS]; s32 ppf=addr+vmv; if (!(ppf<0)) { @@ -200,8 +194,8 @@ __forceinline void __fastcall MemOp_w1(u32 addr,const DataType* data) //SysPrintf("Translated 0x%08X to 0x%08X\n",addr,paddr); switch( DataSize ) { - case 64: return ((vtlbMemW64FP*)RWFT[3][1][hand])(paddr, data); - case 128: return ((vtlbMemW128FP*)RWFT[4][1][hand])(paddr, data); + case 64: return ((vtlbMemW64FP*)vtlbdata.RWFT[3][1][hand])(paddr, data); + case 128: return ((vtlbMemW128FP*)vtlbdata.RWFT[4][1][hand])(paddr, data); jNO_DEFAULT; } @@ -352,17 +346,17 @@ vtlbHandler vtlb_RegisterHandler( vtlbMemR8FP* r8,vtlbMemR16FP* r16,vtlbMemR32FP //write the code :p vtlbHandler rv=vtlbHandlerCount++; - RWFT[0][0][rv] = (r8!=0) ? r8:vtlbDefaultPhyRead8; - RWFT[1][0][rv] = (r16!=0) ? r16:vtlbDefaultPhyRead16; - RWFT[2][0][rv] = (r32!=0) ? r32:vtlbDefaultPhyRead32; - RWFT[3][0][rv] = (r64!=0) ? r64:vtlbDefaultPhyRead64; - RWFT[4][0][rv] = (r128!=0) ? r128:vtlbDefaultPhyRead128; + vtlbdata.RWFT[0][0][rv] = (r8!=0) ? r8:vtlbDefaultPhyRead8; + vtlbdata.RWFT[1][0][rv] = (r16!=0) ? r16:vtlbDefaultPhyRead16; + vtlbdata.RWFT[2][0][rv] = (r32!=0) ? r32:vtlbDefaultPhyRead32; + vtlbdata.RWFT[3][0][rv] = (r64!=0) ? r64:vtlbDefaultPhyRead64; + vtlbdata.RWFT[4][0][rv] = (r128!=0) ? r128:vtlbDefaultPhyRead128; - RWFT[0][1][rv] = (w8!=0) ? w8:vtlbDefaultPhyWrite8; - RWFT[1][1][rv] = (w16!=0) ? w16:vtlbDefaultPhyWrite16; - RWFT[2][1][rv] = (w32!=0) ? w32:vtlbDefaultPhyWrite32; - RWFT[3][1][rv] = (w64!=0) ? w64:vtlbDefaultPhyWrite64; - RWFT[4][1][rv] = (w128!=0) ? w128:vtlbDefaultPhyWrite128; + vtlbdata.RWFT[0][1][rv] = (w8!=0) ? w8:vtlbDefaultPhyWrite8; + vtlbdata.RWFT[1][1][rv] = (w16!=0) ? w16:vtlbDefaultPhyWrite16; + vtlbdata.RWFT[2][1][rv] = (w32!=0) ? w32:vtlbDefaultPhyWrite32; + vtlbdata.RWFT[3][1][rv] = (w64!=0) ? w64:vtlbDefaultPhyWrite64; + vtlbdata.RWFT[4][1][rv] = (w128!=0) ? w128:vtlbDefaultPhyWrite128; return rv; } @@ -382,7 +376,7 @@ void vtlb_MapHandler(vtlbHandler handler,u32 start,u32 size) while(size>0) { - pmap[start>>VTLB_PAGE_BITS]=value; + vtlbdata.pmap[start>>VTLB_PAGE_BITS]=value; start+=VTLB_PAGE_SIZE; size-=VTLB_PAGE_SIZE; @@ -407,7 +401,7 @@ void vtlb_MapBlock(void* base,u32 start,u32 size,u32 blocksize) while(blocksz>0) { - pmap[start>>VTLB_PAGE_BITS]=ptr; + vtlbdata.pmap[start>>VTLB_PAGE_BITS]=ptr; start+=VTLB_PAGE_SIZE; ptr+=VTLB_PAGE_SIZE; @@ -425,7 +419,7 @@ void vtlb_Mirror(u32 new_region,u32 start,u32 size) while(size>0) { - pmap[start>>VTLB_PAGE_BITS]=pmap[new_region>>VTLB_PAGE_BITS]; + vtlbdata.pmap[start>>VTLB_PAGE_BITS]=vtlbdata.pmap[new_region>>VTLB_PAGE_BITS]; start+=VTLB_PAGE_SIZE; new_region+=VTLB_PAGE_SIZE; @@ -435,10 +429,10 @@ void vtlb_Mirror(u32 new_region,u32 start,u32 size) __forceinline void* vtlb_GetPhyPtr(u32 paddr) { - if (paddr>=VTLB_PMAP_SZ || pmap[paddr>>VTLB_PAGE_BITS]<0) + if (paddr>=VTLB_PMAP_SZ || vtlbdata.pmap[paddr>>VTLB_PAGE_BITS]<0) return NULL; else - return reinterpret_cast(pmap[paddr>>VTLB_PAGE_BITS]+(paddr&VTLB_PAGE_MASK)); + return reinterpret_cast(vtlbdata.pmap[paddr>>VTLB_PAGE_BITS]+(paddr&VTLB_PAGE_MASK)); } //virtual mappings @@ -462,11 +456,11 @@ void vtlb_VMap(u32 vaddr,u32 paddr,u32 sz) } else { - pme=pmap[paddr>>VTLB_PAGE_BITS]; + pme=vtlbdata.pmap[paddr>>VTLB_PAGE_BITS]; if (pme<0) pme|=paddr;// top bit is set anyway ... } - vmap[vaddr>>VTLB_PAGE_BITS]=pme-vaddr; + vtlbdata.vmap[vaddr>>VTLB_PAGE_BITS]=pme-vaddr; vaddr+=VTLB_PAGE_SIZE; paddr+=VTLB_PAGE_SIZE; sz-=VTLB_PAGE_SIZE; @@ -480,7 +474,7 @@ void vtlb_VMapBuffer(u32 vaddr,void* buffer,u32 sz) u32 bu8=(u32)buffer; while(sz>0) { - vmap[vaddr>>VTLB_PAGE_BITS]=bu8-vaddr; + vtlbdata.vmap[vaddr>>VTLB_PAGE_BITS]=bu8-vaddr; vaddr+=VTLB_PAGE_SIZE; bu8+=VTLB_PAGE_SIZE; sz-=VTLB_PAGE_SIZE; @@ -500,7 +494,7 @@ void vtlb_VMapUnmap(u32 vaddr,u32 sz) } handl|=vaddr; // top bit is set anyway ... handl|=0x80000000; - vmap[vaddr>>VTLB_PAGE_BITS]=handl-vaddr; + vtlbdata.vmap[vaddr>>VTLB_PAGE_BITS]=handl-vaddr; vaddr+=VTLB_PAGE_SIZE; sz-=VTLB_PAGE_SIZE; } @@ -510,7 +504,7 @@ void vtlb_VMapUnmap(u32 vaddr,u32 sz) void vtlb_Init() { vtlbHandlerCount=0; - memzero_obj(RWFT); + memzero_obj(vtlbdata.RWFT); //Register default handlers //Unmapped Virt handlers _MUST_ be registered first. diff --git a/pcsx2/vtlb.h b/pcsx2/vtlb.h index 84ba374d08..5571d6b835 100644 --- a/pcsx2/vtlb.h +++ b/pcsx2/vtlb.h @@ -75,9 +75,18 @@ namespace vtlb_private static const uint VTLB_PMAP_SZ = 0x20000000; static const uint VTLB_VMAP_ITEMS = 0x100000000ULL / VTLB_PAGE_SIZE; - extern void* RWFT[5][2][128]; - extern s32 pmap[VTLB_PMAP_ITEMS]; //512KB - extern s32 vmap[VTLB_VMAP_ITEMS]; //4MB + struct MapData + { + s32 pmap[VTLB_PMAP_ITEMS]; //512KB + s32 vmap[VTLB_VMAP_ITEMS]; //4MB + + // first indexer -- 8/16/32/64/128 bit tables [values 0-4] + // second indexer -- read/write [0 or 1] + // third indexer -- 128 possible handlers! + void* RWFT[5][2][128]; + }; + + PCSX2_ALIGNED_EXTERN( 64, MapData vtlbdata ); } #endif diff --git a/pcsx2/x86/ix86-32/recVTLB.cpp b/pcsx2/x86/ix86-32/recVTLB.cpp index 05889e7ce3..90047888b2 100644 --- a/pcsx2/x86/ix86-32/recVTLB.cpp +++ b/pcsx2/x86/ix86-32/recVTLB.cpp @@ -173,7 +173,7 @@ static void _vtlb_DynGen_IndirectRead( u32 bits ) MOVZX32R8toR(EAX,EAX); SUB32RtoR(ECX,EAX); //eax=[funct+eax] - MOV32RmSOffsettoR(EAX,EAX,(int)RWFT[szidx][0],2); + MOV32RmSOffsettoR(EAX,EAX,(int)vtlbdata.RWFT[szidx][0],2); SUB32ItoR(ECX,0x80000000); CALL32R(EAX); } @@ -187,7 +187,7 @@ void vtlb_DynGenRead64(u32 bits) MOV32RtoR(EAX,ECX); SHR32ItoR(EAX,VTLB_PAGE_BITS); - MOV32RmSOffsettoR(EAX,EAX,(int)vmap,2); + MOV32RmSOffsettoR(EAX,EAX,(int)vtlbdata.vmap,2); ADD32RtoR(ECX,EAX); u8* _fullread = JS8(0); @@ -209,7 +209,7 @@ void vtlb_DynGenRead32(u32 bits, bool sign) MOV32RtoR(EAX,ECX); SHR32ItoR(EAX,VTLB_PAGE_BITS); - MOV32RmSOffsettoR(EAX,EAX,(int)vmap,2); + MOV32RmSOffsettoR(EAX,EAX,(int)vtlbdata.vmap,2); ADD32RtoR(ECX,EAX); u8* _fullread = JS8(0); @@ -243,7 +243,7 @@ void vtlb_DynGenRead64_Const( u32 bits, u32 addr_const ) { jASSUME( bits == 64 || bits == 128 ); - void* vmv_ptr = &vmap[addr_const>>VTLB_PAGE_BITS]; + void* vmv_ptr = &vtlbdata.vmap[addr_const>>VTLB_PAGE_BITS]; MOV32MtoR(EAX,(uptr)vmv_ptr); MOV32ItoR(ECX,addr_const); @@ -266,7 +266,7 @@ void vtlb_DynGenRead32_Const( u32 bits, bool sign, u32 addr_const ) { jASSUME( bits <= 32 ); - void* vmv_ptr = &vmap[addr_const>>VTLB_PAGE_BITS]; + void* vmv_ptr = &vtlbdata.vmap[addr_const>>VTLB_PAGE_BITS]; MOV32MtoR(EAX,(uptr)vmv_ptr); MOV32ItoR(ECX,addr_const); @@ -368,7 +368,7 @@ static void _vtlb_DynGen_IndirectWrite( u32 bits ) MOVZX32R8toR(EAX,EAX); SUB32RtoR(ECX,EAX); //eax=[funct+eax] - MOV32RmSOffsettoR(EAX,EAX,(int)RWFT[szidx][1],2); + MOV32RmSOffsettoR(EAX,EAX,(int)vtlbdata.RWFT[szidx][1],2); SUB32ItoR(ECX,0x80000000); CALL32R(EAX); } @@ -377,7 +377,7 @@ void vtlb_DynGenWrite(u32 sz) { MOV32RtoR(EAX,ECX); SHR32ItoR(EAX,VTLB_PAGE_BITS); - MOV32RmSOffsettoR(EAX,EAX,(int)vmap,2); + MOV32RmSOffsettoR(EAX,EAX,(int)vtlbdata.vmap,2); ADD32RtoR(ECX,EAX); u8* _full=JS8(0); @@ -398,7 +398,7 @@ void vtlb_DynGenWrite_Const( u32 bits, u32 addr_const ) // the VTLB could feasibly be remapped by other recompiled code at any time. // So we're limited in exactly how much we can pre-calcuate. - void* vmv_ptr = &vmap[addr_const>>VTLB_PAGE_BITS]; + void* vmv_ptr = &vtlbdata.vmap[addr_const>>VTLB_PAGE_BITS]; MOV32MtoR(EAX,(uptr)vmv_ptr); MOV32ItoR(ECX,addr_const); From 382431ebcbe74507dce74f75f9d933835d849a46 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Thu, 19 Mar 2009 11:11:30 +0000 Subject: [PATCH 77/77] Linux: Make some of the assembly look a bit better. Change the PCSX2_ALIGNED_EXTERN defs a bit. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@820 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/PS2Etypes.h | 4 +- common/include/Pcsx2Defs.h | 6 +-- pcsx2/IPU/yuv2rgb.cpp | 2 +- pcsx2/Linux/memzero.h | 26 +++++------ pcsx2/VifDma.cpp | 12 ++--- pcsx2/x86/iR3000A.cpp | 2 +- pcsx2/x86/ix86-32/iR5900-32.cpp | 2 +- pcsx2/x86/ix86/ix86_cpudetect.cpp | 4 +- pcsx2/x86/ix86/ix86_tools.cpp | 74 +++++++++++++++---------------- 9 files changed, 66 insertions(+), 66 deletions(-) diff --git a/common/include/PS2Etypes.h b/common/include/PS2Etypes.h index 9dceb3cd0a..24ce9f20d0 100644 --- a/common/include/PS2Etypes.h +++ b/common/include/PS2Etypes.h @@ -146,8 +146,8 @@ typedef union _LARGE_INTEGER // fixme - is this needed for recent versions of GCC? Or can we just use the macros // above instead for both definitions (implementations) and declarations (includes)? -- air -#define PCSX2_ALIGNED_EXTERN(alig,x) extern x -#define PCSX2_ALIGNED16_EXTERN(x) extern x +#define PCSX2_ALIGNED_EXTERN(alig,x) extern x __attribute((aligned(alig))) +#define PCSX2_ALIGNED16_EXTERN(x) extern x __attribute((aligned(16))) #endif // _MSC_VER diff --git a/common/include/Pcsx2Defs.h b/common/include/Pcsx2Defs.h index 5d46d7a596..dbaf5ca315 100644 --- a/common/include/Pcsx2Defs.h +++ b/common/include/Pcsx2Defs.h @@ -72,7 +72,7 @@ default: \ // Note: building the 'extern' into PCSX2_ALIGNED16_DECL fixes Visual Assist X's intellisense. #define PCSX2_ALIGNED(alig,x) __declspec(align(alig)) x -#define PCSX2_ALIGNED_EXTERN(alig,x) __declspec(align(alig)) x +#define PCSX2_ALIGNED_EXTERN(alig,x) extern __declspec(align(alig)) x #define PCSX2_ALIGNED16(x) __declspec(align(16)) x #define PCSX2_ALIGNED16_EXTERN(x) extern __declspec(align(16)) x @@ -85,8 +85,8 @@ default: \ // instead for both definitions (implementations) and declarations (includes)? -- air #define PCSX2_ALIGNED(alig,x) x __attribute((aligned(alig))) #define PCSX2_ALIGNED16(x) x __attribute((aligned(16))) -#define PCSX2_ALIGNED_EXTERN(alig,x) extern x -#define PCSX2_ALIGNED16_EXTERN(x) extern x +#define PCSX2_ALIGNED_EXTERN(alig,x) extern x __attribute((aligned(alig))) +#define PCSX2_ALIGNED16_EXTERN(x) extern x __attribute((aligned(16))) #define __naked // GCC lacks the naked specifier #define CALLBACK // CALLBACK is a win32-specific mess diff --git a/pcsx2/IPU/yuv2rgb.cpp b/pcsx2/IPU/yuv2rgb.cpp index 312ff8b845..1d93bc6ba9 100644 --- a/pcsx2/IPU/yuv2rgb.cpp +++ b/pcsx2/IPU/yuv2rgb.cpp @@ -215,7 +215,7 @@ ihatemsvc: jne tworows } #elif defined(__GNUC__) - asm( + __asm__( ".intel_syntax noprefix\n" "mov eax, 1\n" "xor esi, esi\n" diff --git a/pcsx2/Linux/memzero.h b/pcsx2/Linux/memzero.h index 4b1cbebe61..bdc6265c37 100644 --- a/pcsx2/Linux/memzero.h +++ b/pcsx2/Linux/memzero.h @@ -109,14 +109,14 @@ static __forceinline void memset_8( void *dest ) ( ".intel_syntax noprefix\n" "cld\n" -// "mov edi, %0\n" -// "mov eax, %1\n" +// "mov edi, %[dest]\n" +// "mov eax, %[data32]\n" "stosd\n" "stosd\n" "stosd\n" ".att_syntax\n" : - : "D"(dest), "a"(data32) + : [dest]"D"(dest), [data32]"a"(data32) // D - edi, a -- eax, c ecx : ); @@ -127,15 +127,15 @@ static __forceinline void memset_8( void *dest ) ( ".intel_syntax noprefix\n" "cld\n" -// "mov edi, %0\n" -// "mov eax, %1\n" +// "mov edi, %[dest]\n" +// "mov eax, %[data32]\n" "stosd\n" "stosd\n" "stosd\n" "stosd\n" ".att_syntax\n" : - : "D"(dest), "a"(data32) + : [dest]"D"(dest), [data32]"a"(data32) : ); @@ -146,8 +146,8 @@ static __forceinline void memset_8( void *dest ) ( ".intel_syntax noprefix\n" "cld\n" -// "mov edi, %0\n" -// "mov eax, %1\n" +// "mov edi, %[dest]\n" +// "mov eax, %[data32]\n" "stosd\n" "stosd\n" "stosd\n" @@ -155,7 +155,7 @@ static __forceinline void memset_8( void *dest ) "stosd\n" ".att_syntax\n" : - : "D"(dest), "a"(data32) + : [dest]"D"(dest), [data32]"a"(data32) : ); @@ -166,13 +166,13 @@ static __forceinline void memset_8( void *dest ) ( ".intel_syntax noprefix\n" "cld\n" -// "mov ecx, %0\n" -// "mov edi, %1\n" -// "mov eax, %2\n" +// "mov ecx, %[remdat]\n" +// "mov edi, %[dest]\n" +// "mov eax, %\[data32]n" "rep stosd\n" ".att_syntax\n" : - : "c"(remdat), "D"(dest), "a"(data32) + : [remdat]"c"(remdat), [dest]"D"(dest), [data32]"a"(data32) : ); return; diff --git a/pcsx2/VifDma.cpp b/pcsx2/VifDma.cpp index c2a2d13ca5..8f3422e866 100644 --- a/pcsx2/VifDma.cpp +++ b/pcsx2/VifDma.cpp @@ -505,15 +505,15 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma #else if( VIFdmanum ) { __asm__(".intel_syntax noprefix\n" - "movaps xmm6, xmmword ptr [%0]\n" - "movaps xmm7, xmmword ptr [%1]\n" - ".att_syntax\n" : :"r"(g_vifRow1), "r"(g_vifCol1) ); + "movaps xmm6, xmmword ptr [%[g_vifRow1]]\n" + "movaps xmm7, xmmword ptr [%[g_vifCol1]]\n" + ".att_syntax\n" : :[g_vifRow1]"r"(g_vifRow1), [g_vifCol1]"r"(g_vifCol1) ); } else { __asm__(".intel_syntax noprefix\n" - "movaps xmm6, xmmword ptr [%0]\n" - "movaps xmm7, xmmword ptr [%1]\n" - ".att_syntax\n" : : "r"(g_vifRow0), "r"(g_vifCol0) ); + "movaps xmm6, xmmword ptr [%[g_vifRow0]]\n" + "movaps xmm7, xmmword ptr [%[g_vifCol0]]\n" + ".att_syntax\n" : : [g_vifRow0]"r"(g_vifRow0), [g_vifCol0]"r"(g_vifCol0) ); } #endif diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index c754abb6c8..db7ede34c4 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -845,7 +845,7 @@ static void checkcodefn() #ifdef _MSC_VER __asm mov pctemp, eax; #else - __asm__("movl %%eax, %0" : : "m"(pctemp) ); + __asm__("movl %%eax, %[pctemp]" : : [pctemp]"m"(pctemp) ); #endif SysPrintf("iop code changed! %x\n", pctemp); } diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 0fa6402b8b..29b27a460f 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -1165,7 +1165,7 @@ static void checkcodefn() #ifdef _MSC_VER __asm mov pctemp, eax; #else - __asm__("movl %%eax, %0" : "=m"(pctemp) ); + __asm__("movl %%eax, %[pctemp]" : [pctemp]"=m"(pctemp) ); #endif Console::Error("code changed! %x", params pctemp); diff --git a/pcsx2/x86/ix86/ix86_cpudetect.cpp b/pcsx2/x86/ix86/ix86_cpudetect.cpp index 6c0d91838e..bf88feeb32 100644 --- a/pcsx2/x86/ix86/ix86_cpudetect.cpp +++ b/pcsx2/x86/ix86/ix86_cpudetect.cpp @@ -115,7 +115,7 @@ extern s32 iCpuId( u32 cmd, u32 *regs ) "pushf\n" "pop %%eax\n" "xor %%edx, %%eax\n" - "mov %%eax, %0\n" + "mov %%eax, %[flag]\n" "add $0x18, %%esp\n" "cmpl $0x0,%%eax\n" "jne 1f\n" @@ -123,7 +123,7 @@ extern s32 iCpuId( u32 cmd, u32 *regs ) "leave\n" "ret\n" "1:\n" - : "=r"(flag) : + : [flag]"=r"(flag) : ); cpuid(cmd, regs[0], regs[1], regs[2], regs[3]); diff --git a/pcsx2/x86/ix86/ix86_tools.cpp b/pcsx2/x86/ix86/ix86_tools.cpp index 1ea1f9eaa9..5ef532ffcd 100644 --- a/pcsx2/x86/ix86/ix86_tools.cpp +++ b/pcsx2/x86/ix86/ix86_tools.cpp @@ -61,7 +61,7 @@ void SetCPUState(u32 sseMXCSR, u32 sseVUMXCSR) #ifdef _MSC_VER __asm ldmxcsr g_sseMXCSR; // set the new sse control #else - __asm__("ldmxcsr %0" : : "m"(g_sseMXCSR) ); + __asm__("ldmxcsr %[g_sseMXCSR]" : : [g_sseMXCSR]"m"(g_sseMXCSR) ); #endif //g_sseVUMXCSR = g_sseMXCSR|0x6000; } @@ -108,16 +108,16 @@ __forceinline void FreezeMMXRegs_(int save) #else __asm__( ".intel_syntax noprefix\n" - "movq [%0+0x00], mm0\n" - "movq [%0+0x08], mm1\n" - "movq [%0+0x10], mm2\n" - "movq [%0+0x18], mm3\n" - "movq [%0+0x20], mm4\n" - "movq [%0+0x28], mm5\n" - "movq [%0+0x30], mm6\n" - "movq [%0+0x38], mm7\n" + "movq [%[g_globalMMXData]+0x00], mm0\n" + "movq [%[g_globalMMXData]+0x08], mm1\n" + "movq [%[g_globalMMXData]+0x10], mm2\n" + "movq [%[g_globalMMXData]+0x18], mm3\n" + "movq [%[g_globalMMXData]+0x20], mm4\n" + "movq [%[g_globalMMXData]+0x28], mm5\n" + "movq [%[g_globalMMXData]+0x30], mm6\n" + "movq [%[g_globalMMXData]+0x38], mm7\n" "emms\n" - ".att_syntax\n" : : "r"(g_globalMMXData) + ".att_syntax\n" : : [g_globalMMXData]"r"(g_globalMMXData) ); #endif @@ -148,16 +148,16 @@ __forceinline void FreezeMMXRegs_(int save) #else __asm__( ".intel_syntax noprefix\n" - "movq mm0, [%0+0x00]\n" - "movq mm1, [%0+0x08]\n" - "movq mm2, [%0+0x10]\n" - "movq mm3, [%0+0x18]\n" - "movq mm4, [%0+0x20]\n" - "movq mm5, [%0+0x28]\n" - "movq mm6, [%0+0x30]\n" - "movq mm7, [%0+0x38]\n" + "movq mm0, [%[g_globalMMXData]+0x00]\n" + "movq mm1, [%[g_globalMMXData]+0x08]\n" + "movq mm2, [%[g_globalMMXData]+0x10]\n" + "movq mm3, [%[g_globalMMXData]+0x18]\n" + "movq mm4, [%[g_globalMMXData]+0x20]\n" + "movq mm5, [%[g_globalMMXData]+0x28]\n" + "movq mm6, [%[g_globalMMXData]+0x30]\n" + "movq mm7, [%[g_globalMMXData]+0x38]\n" "emms\n" - ".att_syntax\n" : : "r"(g_globalMMXData) + ".att_syntax\n" : : [g_globalMMXData]"r"(g_globalMMXData) ); #endif } @@ -195,15 +195,15 @@ __forceinline void FreezeXMMRegs_(int save) #else __asm__( ".intel_syntax noprefix\n" - "movaps [%0+0x00], xmm0\n" - "movaps [%0+0x10], xmm1\n" - "movaps [%0+0x20], xmm2\n" - "movaps [%0+0x30], xmm3\n" - "movaps [%0+0x40], xmm4\n" - "movaps [%0+0x50], xmm5\n" - "movaps [%0+0x60], xmm6\n" - "movaps [%0+0x70], xmm7\n" - ".att_syntax\n" : : "r"(g_globalXMMData) + "movaps [%[g_globalXMMData]+0x00], xmm0\n" + "movaps [%[g_globalXMMData]+0x10], xmm1\n" + "movaps [%[g_globalXMMData]+0x20], xmm2\n" + "movaps [%[g_globalXMMData]+0x30], xmm3\n" + "movaps [%[g_globalXMMData]+0x40], xmm4\n" + "movaps [%[g_globalXMMData]+0x50], xmm5\n" + "movaps [%[g_globalXMMData]+0x60], xmm6\n" + "movaps [%[g_globalXMMData]+0x70], xmm7\n" + ".att_syntax\n" : : [g_globalXMMData]"r"(g_globalXMMData) ); #endif // _MSC_VER @@ -237,15 +237,15 @@ __forceinline void FreezeXMMRegs_(int save) #else __asm__( ".intel_syntax noprefix\n" - "movaps xmm0, [%0+0x00]\n" - "movaps xmm1, [%0+0x10]\n" - "movaps xmm2, [%0+0x20]\n" - "movaps xmm3, [%0+0x30]\n" - "movaps xmm4, [%0+0x40]\n" - "movaps xmm5, [%0+0x50]\n" - "movaps xmm6, [%0+0x60]\n" - "movaps xmm7, [%0+0x70]\n" - ".att_syntax\n" : : "r"(g_globalXMMData) + "movaps xmm0, [%[g_globalXMMData]+0x00]\n" + "movaps xmm1, [%[g_globalXMMData]+0x10]\n" + "movaps xmm2, [%[g_globalXMMData]+0x20]\n" + "movaps xmm3, [%[g_globalXMMData]+0x30]\n" + "movaps xmm4, [%[g_globalXMMData]+0x40]\n" + "movaps xmm5, [%[g_globalXMMData]+0x50]\n" + "movaps xmm6, [%[g_globalXMMData]+0x60]\n" + "movaps xmm7, [%[g_globalXMMData]+0x70]\n" + ".att_syntax\n" : : [g_globalXMMData]"r"(g_globalXMMData) ); #endif // _MSC_VER