From c32940f989a0aa88377cf7de199eca9de2db3d86 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Thu, 22 Jan 2009 12:46:10 +0000 Subject: [PATCH] Playing a bit of catchup. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@623 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/DebugTools/DisR5900.cpp | 10 ++--- pcsx2/DebugTools/Makefile.am | 6 +-- pcsx2/Hw.cpp | 2 +- pcsx2/IPU/Makefile.am | 4 +- pcsx2/Linux/ConfigDlg.h | 2 +- pcsx2/Linux/DebugDlg.cpp | 2 +- pcsx2/Linux/DebugDlg.h | 2 +- pcsx2/Linux/GtkGui.cpp | 2 - pcsx2/Linux/GtkGui.h | 6 +-- pcsx2/Linux/Linux.h | 5 +++ pcsx2/Linux/LnxMain.cpp | 19 +++++---- pcsx2/Linux/memzero.h | 70 +++++++++++++++++++++++++++++++++ pcsx2/Makefile.am | 34 ++++++++-------- pcsx2/Memory.cpp | 6 ++- pcsx2/Memory.h | 1 + pcsx2/Misc.h | 3 +- pcsx2/SourceLog.cpp | 2 + pcsx2/windows/CpuDlg.cpp | 2 +- pcsx2/x86/Makefile.am | 14 ++++--- pcsx2/x86/iHw.cpp | 2 +- pcsx2/x86/ix86-32/iR5900-32.cpp | 49 +++++++++++++++++++++++ 21 files changed, 190 insertions(+), 53 deletions(-) create mode 100644 pcsx2/Linux/memzero.h diff --git a/pcsx2/DebugTools/DisR5900.cpp b/pcsx2/DebugTools/DisR5900.cpp index ddfba0ca93..e8caa5ad0e 100644 --- a/pcsx2/DebugTools/DisR5900.cpp +++ b/pcsx2/DebugTools/DisR5900.cpp @@ -24,19 +24,19 @@ using namespace std; #include "R5900.h" #include "VU.h" -static const char * const disRNameCP2f[] = { +const char * const disRNameCP2f[] = { "VF00", "VF01", "VF02", "VF03", "VF04", "VF05", "VF06", "VF07", "VF08", "VF09", "VF10", "VF11", "VF12", "VF13", "VF14", "VF15", "VF16", "VF17", "VF18", "VF19", "VF20", "VF21", "VF22", "VF23", "VF24", "VF25", "VF26", "VF27", "VF28", "VF29", "VF30", "VF31"}; -static const char * const disRNameCP2i[] = { +const char * const disRNameCP2i[] = { "VI00", "VI01", "VI02", "VI03", "VI04", "VI05", "VI06", "VI07", "VI08", "VI09", "VI10", "VI11", "VI12", "VI13", "VI14", "VI15", "Status", "MAC", "Clip", "*RES*", "R", "I", "Q", "*RES*", "*RES*", "*RES*", "TPC", "CMSAR0", "FBRST", "VPU-STAT", "*RES*", "CMSAR1"}; -static const char * const CP2VFnames[] = { "x", "y", "z", "w" }; +const char * const CP2VFnames[] = { "x", "y", "z", "w" }; namespace R5900 { @@ -54,13 +54,13 @@ const char * const disRNameCP0[] = { "Config" , "LLAddr" , "WatchLo" , "WatchHi" , "*RES*" , "*RES*" , "*RES*" , "Debug", "DEPC" , "PerfCnt" , "ErrCtl" , "CacheErr", "TagLo" , "TagHi" , "ErrorEPC" , "DESAVE"}; -static const char * const disRNameCP1[] = { +const char * const disRNameCP1[] = { "FPR0" , "FPR1" , "FPR2" , "FPR3" , "FPR4" , "FPR5" , "FPR6" , "FPR7", "FPR8" , "FPR9" , "FPR10", "FPR11", "FPR12", "FPR13", "FPR14", "FPR15", "FPR16", "FPR17", "FPR18", "FPR19", "FPR20", "FPR21", "FPR22", "FPR23", "FPR24", "FPR25", "FPR26", "FPR27", "FPR28", "FPR29", "FPR30", "FPR31"}; -static const char * const disRNameCP1c[] = { +const char * const disRNameCP1c[] = { "FRevID", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", "*RES*", diff --git a/pcsx2/DebugTools/Makefile.am b/pcsx2/DebugTools/Makefile.am index 9fccb3232b..d5dea9cd57 100644 --- a/pcsx2/DebugTools/Makefile.am +++ b/pcsx2/DebugTools/Makefile.am @@ -2,6 +2,6 @@ INCLUDES = -I@srcdir@/../ -I@srcdir@/../../common/ noinst_LIBRARIES = libDebugTools.a libDebugTools_a_SOURCES = \ -Debug.h.bak DisR3000asm.cpp DisVU0Micro.cpp DisVUops.h \ -DisASM.h DisR5900asm.cpp DisVU1Micro.cpp \ -Debug.h DisR3000A.cpp DisR5900.cpp DisVUmicro.h +DisR3000A.cpp DisR5900.cpp DisVU0Micro.cpp \ +DisR3000asm.cpp DisR5900asm.cpp DisVU1Micro.cpp \ +Debug.h DisVUmicro.h DisASM.h DisVUops.h diff --git a/pcsx2/Hw.cpp b/pcsx2/Hw.cpp index 761701f540..83899496ff 100644 --- a/pcsx2/Hw.cpp +++ b/pcsx2/Hw.cpp @@ -29,7 +29,7 @@ #include "GS.h" #include "Counters.h" #include "Vif.h" -#include "Vifdma.h" +#include "VifDma.h" #include "SPR.h" #include "Sif.h" diff --git a/pcsx2/IPU/Makefile.am b/pcsx2/IPU/Makefile.am index 114c4c2e95..dbbf54470e 100644 --- a/pcsx2/IPU/Makefile.am +++ b/pcsx2/IPU/Makefile.am @@ -1,7 +1,9 @@ INCLUDES = -I@srcdir@/../ -I@srcdir@/../x86 -I@srcdir@/../../common/ noinst_LIBRARIES = libIPU.a -libIPU_a_SOURCES = IPU.c yuv2rgb.cpp coroutine.cpp acoroutine.S +libIPU_a_SOURCES = IPU.cpp yuv2rgb.cpp coroutine.cpp \ +IPU.h yuv2rgb.h coroutine.h \ +acoroutine.S SUBDIRS = mpeg2lib diff --git a/pcsx2/Linux/ConfigDlg.h b/pcsx2/Linux/ConfigDlg.h index 6ce4c91fd2..eb5249d432 100644 --- a/pcsx2/Linux/ConfigDlg.h +++ b/pcsx2/Linux/ConfigDlg.h @@ -32,7 +32,7 @@ extern "C" { } #endif #include "R3000A.h" -#include "PsxMem.h" +#include "IopMem.h" // Helper Functions diff --git a/pcsx2/Linux/DebugDlg.cpp b/pcsx2/Linux/DebugDlg.cpp index b157937bc4..903e39fbff 100644 --- a/pcsx2/Linux/DebugDlg.cpp +++ b/pcsx2/Linux/DebugDlg.cpp @@ -18,7 +18,7 @@ #include "DebugDlg.h" using namespace R5900; -using namespace Dynarec; +//using namespace Dynarec; void UpdateDebugger() { diff --git a/pcsx2/Linux/DebugDlg.h b/pcsx2/Linux/DebugDlg.h index 4595c93903..2a4b995437 100644 --- a/pcsx2/Linux/DebugDlg.h +++ b/pcsx2/Linux/DebugDlg.h @@ -32,7 +32,7 @@ extern "C" { } #endif #include "R3000A.h" -#include "PsxMem.h" +#include "IopMem.h" GtkWidget *ListDV; diff --git a/pcsx2/Linux/GtkGui.cpp b/pcsx2/Linux/GtkGui.cpp index 9dbae1b834..bd18291b59 100644 --- a/pcsx2/Linux/GtkGui.cpp +++ b/pcsx2/Linux/GtkGui.cpp @@ -566,8 +566,6 @@ void OnCpu_Ok(GtkButton *button, gpointer user_data) { Config.CustomFrameSkip = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(lookup_widget(CpuDlg, "FrameThreshold"))); Config.CustomConsecutiveFrames = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(lookup_widget(CpuDlg, "FramesBeforeSkipping"))); Config.CustomConsecutiveSkip = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(lookup_widget(CpuDlg, "FramesToSkip"))); - - if (newopts & PCSX2_EEREC ) newopts |= PCSX2_COP2REC; if (Config.Options != newopts) { diff --git a/pcsx2/Linux/GtkGui.h b/pcsx2/Linux/GtkGui.h index 9aa5dd9d38..d114621eea 100644 --- a/pcsx2/Linux/GtkGui.h +++ b/pcsx2/Linux/GtkGui.h @@ -19,7 +19,10 @@ #ifndef __GTKGUI_H__ #define __GTKGUI_H__ + +#include "PrecompiledHeader.h" #include "Linux.h" + #ifdef __cplusplus extern "C" { #endif @@ -31,9 +34,6 @@ extern "C" { #ifdef __cplusplus } #endif -#include "R3000A.h" -#include "PsxMem.h" - bool applychanges = FALSE; bool configuringplug = FALSE; diff --git a/pcsx2/Linux/Linux.h b/pcsx2/Linux/Linux.h index 9520c28114..0d6be3a8e4 100644 --- a/pcsx2/Linux/Linux.h +++ b/pcsx2/Linux/Linux.h @@ -48,6 +48,11 @@ #include "Paths.h" #include "Common.h" +#include "Counters.h" +#include "VUmicro.h" +#include "Plugins.h" +#include "x86/ix86/ix86.h" + /* Misc.c */ extern void vu0Shutdown(); extern void vu1Shutdown(); diff --git a/pcsx2/Linux/LnxMain.cpp b/pcsx2/Linux/LnxMain.cpp index 48007fd81b..b28c6c2ee1 100644 --- a/pcsx2/Linux/LnxMain.cpp +++ b/pcsx2/Linux/LnxMain.cpp @@ -29,7 +29,7 @@ // Definitely not all. Most of them are coming from assembly files. :( using namespace R5900; -using namespace Dynarec; +//using namespace Dynarec; DIR *dir; @@ -161,7 +161,7 @@ int main(int argc, char *argv[]) { strcpy(Config.BiosDir, DEFAULT_BIOS_DIR "/"); strcpy(Config.PluginsDir, DEFAULT_PLUGINS_DIR "/"); Config.Patch = 1; - Config.Options = PCSX2_EEREC | PCSX2_VU0REC | PCSX2_VU1REC | PCSX2_COP2REC; + Config.Options = PCSX2_EEREC | PCSX2_VU0REC | PCSX2_VU1REC; Config.sseMXCSR = DEFAULT_sseMXCSR; Config.sseVUMXCSR = DEFAULT_sseVUMXCSR; @@ -356,7 +356,8 @@ void SysMessage(const char *fmt, ...) { bool SysInit() { - sinit=0; + if( sinit ) return true; + sinit = true; mkdir(SSTATES_DIR, 0755); mkdir(MEMCARDS_DIR, 0755); @@ -373,7 +374,13 @@ bool SysInit() if( emuLog != NULL ) setvbuf(emuLog, NULL, _IONBF, 0); + PCSX2_MEM_PROTECT_BEGIN(); SysDetect(); + if( !SysAllocateMem() ) + return false; // critical memory allocation failure; + + SysAllocateDynarecs(); + PCSX2_MEM_PROTECT_END(); while (LoadPlugins() == -1) { if (Pcsx2Configure() == FALSE) @@ -382,11 +389,7 @@ bool SysInit() exit(1); } } - - if( !cpuInit() ) - return false; - - sinit = 1; + return true; } diff --git a/pcsx2/Linux/memzero.h b/pcsx2/Linux/memzero.h new file mode 100644 index 0000000000..45c81d1d1f --- /dev/null +++ b/pcsx2/Linux/memzero.h @@ -0,0 +1,70 @@ +/* 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 _PCSX2_MEMZERO_H_ +#define _PCSX2_MEMZERO_H_ + +// This stubs out that memzero Windows specific stuff Air seems to have added +// all over, to allow Linux to compile. I may actually try to translate the file at +// some point, but for now, lets just use memset. + +template< size_t bytes > +static __forceinline void memzero_air( void *dest ) +{ + memset(dest, 0, bytes); +} + +template< u8 data, size_t bytes > +static __forceinline void memset_8( void *dest ) +{ + memset(dest, data, bytes); +} + +template< u16 data, size_t bytes > +static __forceinline void memset_16( void *dest ) +{ + memset(dest, data, bytes); +} + +template< u32 data, size_t bytes > +static __forceinline void memset_32( void *dest ) +{ + memset(dest, data, bytes); +} + +// This method can clear any object-like entity -- which is anything that is not a pointer. +// Structures, static arrays, etc. No need to include sizeof() crap, this does it automatically +// for you! +template< typename T > +static __forceinline void memzero_obj( T& object ) +{ + memzero_air( &object ); +} + +template< uint data, typename T > +static __forceinline void memset_obj( T& object ) +{ + if( data <= 0xff ) + memset_8<(u8)data, sizeof(T)>( &object ); + else if( data <= 0xffff ) + memset_16<(u16)data, sizeof(T)>( &object ); + else + memset_32<(u32)data, sizeof(T)>( &object ); +} + +#endif \ No newline at end of file diff --git a/pcsx2/Makefile.am b/pcsx2/Makefile.am index b42f986e3f..997593a644 100644 --- a/pcsx2/Makefile.am +++ b/pcsx2/Makefile.am @@ -3,22 +3,20 @@ INCLUDES = -I@srcdir@/x86/ -I@srcdir@/../common/ noinst_LIBRARIES = libpcsx2.a libpcsx2_a_SOURCES = \ -CdRom.cpp Decode_XA.h Mdec.h PsxBios.h R3000A.cpp Vif.h \ -CdRom.h EEregs.h PsxCommon.h R3000A.h VU0.cpp \ -CDVD.cpp Elfheader.cpp Memory.cpp PsxCounters.cpp R5900.cpp VU0.h \ -CDVD.h Elfheader.h Memory.h PsxCounters.h R5900.h VU0micro.cpp \ -CDVDiso.cpp FiFo.cpp Misc.cpp PsxDma.cpp Sif.cpp VU1micro.cpp \ -CDVDisodrv.cpp FPU2.cpp PsxDma.h Sifcmd.h VUflags.cpp \ -CDVDisodrv.h FPU.cpp MMI.cpp MTGS.cpp Sif.h VUflags.h \ -CDVDiso.h GS.cpp PathUtils.cpp Patch.cpp Sio.cpp \ -CDVDlib.h GS.h Patch.h PsxHw.cpp Sio.h VUmicro.h \ -Common.h Hw.cpp Plugins.cpp PsxHw.h SPR.cpp VUops.cpp \ -COP0.cpp COP2.cpp Hw.h Plugins.h PsxInterpreter.cpp SPR.h VUops.h \ -COP0.h Interpreter.cpp PS2Edefs.h PsxMem.cpp System.h \ -Counters.cpp InterTables.cpp PS2Etypes.h PsxMem.h Vif.cpp \ -Counters.h InterTables.h PsxBios2.h PsxSio2.cpp VifDma.cpp \ -Decode_XA.cpp PsxBios.cpp PsxSio2.h VifDma.h Cache.cpp vtlb.cpp \ -xmlpatchloader.cpp ThreadTools.cpp SourceLog.cpp SaveState.cpp System.cpp \ -Console.cpp vssprintf.cpp StringUtils.cpp +CDVD.cpp CDVDiso.cpp CDVDisodrv.cpp COP0.cpp COP2.cpp Cache.cpp CdRom.cpp Console.cpp \ +Counters.cpp Decode_XA.cpp Elfheader.cpp FPU.cpp FPU2.cpp FiFo.cpp GS.cpp Hw.cpp Interpreter.cpp \ +IopBios.cpp IopCounters.cpp IopDma.cpp IopHw.cpp IopMem.cpp IopSio2.cpp MMI.cpp MTGS.cpp \ +Memory.cpp Misc.cpp Patch.cpp PathUtils.cpp Plugins.cpp PrecompiledHeader.cpp R3000A.cpp \ +R3000AInterpreter.cpp R3000AOpcodeTables.cpp R5900.cpp R5900OpcodeImpl.cpp R5900OpcodeTables.cpp \ +SPR.cpp SaveState.cpp Sif.cpp Sio.cpp SourceLog.cpp Stats.cpp System.cpp ThreadTools.cpp \ +VU0.cpp VU0micro.cpp VU0microInterp.cpp VU1micro.cpp VU1microInterp.cpp VUflags.cpp VUmicroMem.cpp VUops.cpp \ +Vif.cpp VifDma.cpp vssprintf.cpp vtlb.cpp xmlpatchloader.cpp -SUBDIRS = x86 . DebugTools IPU RDebug tinyxml Linux \ No newline at end of file +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 \ +Memory.h Misc.h Patch.h Paths.h Plugins.h PrecompiledHeader.h PsxCommon.h R3000A.h R5900.h R5900OpcodeTables.h \ +SPR.h SamplProf.h SaveState.h Sif.h Sifcmd.h Sio.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 + +SUBDIRS = x86 . DebugTools IPU RDebug tinyxml Linux diff --git a/pcsx2/Memory.cpp b/pcsx2/Memory.cpp index a5520e820c..f43d4ca158 100644 --- a/pcsx2/Memory.cpp +++ b/pcsx2/Memory.cpp @@ -54,7 +54,7 @@ BIOS #include "VUmicro.h" #include "GS.h" #include "vtlb.h" -#include "ipu/IPU.h" +#include "IPU/IPU.h" #ifdef ENABLECACHE #include "Cache.h" @@ -2912,6 +2912,10 @@ __forceinline void __fastcall InstallLinuxExceptionHandler() sigaction(SIGSEGV, &sa, NULL); } +__forceinline void __fastcall ReleaseLinuxExceptionHandler() +{ + // Code this later. +} // Linux implementation of SIGSEGV handler. Bind it using sigaction(). // This is my shot in the dark. Probably needs some work. Good luck! (air) __forceinline void __fastcall SysPageFaultExceptionFilter( int signal, siginfo_t *info, void * ) diff --git a/pcsx2/Memory.h b/pcsx2/Memory.h index 46c8b8bd33..b609aab750 100644 --- a/pcsx2/Memory.h +++ b/pcsx2/Memory.h @@ -241,6 +241,7 @@ void memShutdown(); #ifdef __LINUX__ void SysPageFaultExceptionFilter( int signal, siginfo_t *info, void * ); void __fastcall InstallLinuxExceptionHandler(); +void __fastcall ReleaseLinuxExceptionHandler(); #endif #ifdef _WIN32 diff --git a/pcsx2/Misc.h b/pcsx2/Misc.h index 69aa6602b3..0399f6199b 100644 --- a/pcsx2/Misc.h +++ b/pcsx2/Misc.h @@ -232,7 +232,7 @@ extern u8 g_globalXMMSaved; extern void __fastcall memcpy_raz_u(void *dest, const void *src, size_t bytes); extern void __fastcall memcpy_raz_(void *dest, const void *src, size_t qwc); extern void * memcpy_amd_(void *dest, const void *src, size_t n); -# include "windows/memzero.h" + #include "windows/memzero.h" #define memcpy_fast memcpy_amd_ //#define memcpy_fast memcpy //Dont use normal memcpy, it has sse in 2k5! @@ -241,6 +241,7 @@ extern u8 g_globalXMMSaved; #define memcpy_fast memcpy #define memcpy_raz_ memcpy #define memcpy_raz_u memcpy + #include "Linux/memzero.h" #endif diff --git a/pcsx2/SourceLog.cpp b/pcsx2/SourceLog.cpp index 80dbc1b60b..256a293efe 100644 --- a/pcsx2/SourceLog.cpp +++ b/pcsx2/SourceLog.cpp @@ -28,6 +28,8 @@ #include #include "R3000A.h" +#include "iR5900.h" +#include "System.h" using namespace R5900; diff --git a/pcsx2/windows/CpuDlg.cpp b/pcsx2/windows/CpuDlg.cpp index ce32e78878..fb28ca87d6 100644 --- a/pcsx2/windows/CpuDlg.cpp +++ b/pcsx2/windows/CpuDlg.cpp @@ -22,7 +22,7 @@ #include "Common.h" #include "Counters.h" #include "VUmicro.h" -#include "plugins.h" +#include "Plugins.h" #include "ix86/ix86.h" diff --git a/pcsx2/x86/Makefile.am b/pcsx2/x86/Makefile.am index 5e9dcf9dbb..c37ffa0a0e 100644 --- a/pcsx2/x86/Makefile.am +++ b/pcsx2/x86/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = -I@srcdir@/../ -I@srcdir@/../../common/ +INCLUDES = -I@srcdir@/../ -I@srcdir@/../../common/ -I@srcdir@/../IPU/ noinst_LIBRARIES = libx86recomp.a # have to add the sources instead of making a library since the linking is complicated @@ -8,10 +8,14 @@ ix86-32/iR5900Move.cpp ix86-32/iR5900Shift.cpp ix86-32/iR5900Arit.cpp ix86-32/i ix86-32/iR5900LoadStore.cpp ix86-32/iR5900MultDiv.cpp ix86-32/iCore-32.cpp ix86-32/aR5900-32.S \ ix86-32/iR5900Templates.cpp -libx86recomp_a_SOURCES = iCOP2.cpp iCP0.cpp iFPU.cpp iHw.cpp iMMI.cpp iPsxHw.cpp iPsxMem.cpp \ -ir5900tables.cpp iVU0micro.cpp iVU1micro.cpp iVUmicro.cpp iVUmicroUpper.cpp iVUmicroLower.cpp \ -iCore.cpp iGS.cpp iR3000A.cpp iR3000Atables.cpp iVif.cpp iVUzerorec.cpp \ -fast_routines.S aR3000A.S aVUzerorec.S aVif.S $(archfiles) +libx86recomp_a_SOURCES = \ +BaseblockEx.cpp iCOP0.cpp iCOP2.cpp iCore.cpp iFPU.cpp iGS.cpp iHw.cpp iIPU.cpp iMMI.cpp iPsxHw.cpp iPsxMem.cpp \ +iR3000A.cpp iR3000Atables.cpp iR5900Misc.cpp iVU0micro.cpp iVU1micro.cpp iVUmicro.cpp iVUmicroLower.cpp iVUmicroUpper.cpp \ +iVUzerorec.cpp iVif.cpp ir5900tables.cpp fast_routines.S aR3000A.S aVUzerorec.S aVif.S $(archfiles) + +libx86recomp_a_SOURCES += \ +BaseblockEx.h iCOP0.h iCore.h iFPU.h iMMI.h iR3000A.h iR5900.h iR5900Arit.h iR5900AritImm.h iR5900Branch.h iR5900Jump.h \ +iR5900LoadStore.h iR5900Move.h iR5900MultDiv.h iR5900Shift.h iVUmicro.h iVUops.h iVUzerorec.h libx86recomp_a_DEPENDENCIES = ix86/libix86.a diff --git a/pcsx2/x86/iHw.cpp b/pcsx2/x86/iHw.cpp index bb13f75fed..68e88af81c 100644 --- a/pcsx2/x86/iHw.cpp +++ b/pcsx2/x86/iHw.cpp @@ -28,7 +28,7 @@ #include "GS.h" #include "Counters.h" #include "Vif.h" -#include "Vifdma.h" +#include "VifDma.h" #include "SPR.h" #include "Sif.h" diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 666e30e196..db100401b4 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -834,6 +834,55 @@ extern void Dispatcher(); extern void DispatcherClear(); extern void DispatcherReg(); } +__forceinline void recExecute() +{ + // Optimization note : Compared pushad against manually pushing the regs one-by-one. + // Manually pushing is faster, especially on Core2's and such. :) + do { + g_EEFreezeRegs = true; + __asm + ( + ".intel_syntax\n" + "push %ebx\n" + "push %esi\n" + "push %edi\n" + "push %ebp\n" + + "call DispatcherReg\n" + + "pop %ebp\n" + "pop %edi\n" + "pop %esi\n" + "pop %ebx\n" + ".att_syntax\n" + ); + g_EEFreezeRegs = false; + } + while( !recEventTest() ); +} + +static void recExecuteBlock() +{ + g_EEFreezeRegs = true; + __asm + ( + ".intel_syntax\n" + "push %ebx\n" + "push %esi\n" + "push %edi\n" + "push %ebp\n" + + "call DispatcherReg\n" + + "pop %ebp\n" + "pop %edi\n" + "pop %esi\n" + "pop %ebx\n" + ".att_syntax\n" + ); + g_EEFreezeRegs = false; + recEventTest(); +} #endif namespace R5900 {