From bafd21140fe930d68d75684c05ee891736b4574b Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sun, 2 Aug 2009 16:48:03 +0000 Subject: [PATCH] wxgui: * finished most of the new plugin system (branch is buildable and runnable again, but no significant functionality has been added yet). * Removed STGS code from the branch since I planned to kill it off anyway and it was more work to code proper support for it in wx than to remove it. git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1595 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/PS2Edefs.h | 132 +----- common/include/Pcsx2Config.h | 2 - common/include/PluginCallbacks.h | 80 ++-- pcsx2/CDVD/CDVD.cpp | 20 +- pcsx2/CDVD/CDVD.h | 57 ++- pcsx2/CDVD/CDVDaccess.cpp | 158 ++++--- pcsx2/CDVD/CDVDaccess.h | 5 +- pcsx2/CDVD/CDVDisoReader.cpp | 47 +-- pcsx2/CDVD/CdRom.cpp | 13 +- pcsx2/CDVD/IsoFileFormats.cpp | 6 +- pcsx2/CDVD/IsoFileFormats.h | 12 +- pcsx2/Docs/ChangeLog.txt | 26 +- pcsx2/FiFo.cpp | 19 +- pcsx2/GS.cpp | 162 +------ pcsx2/GS.h | 5 - pcsx2/Gif.cpp | 38 +- pcsx2/MTGS.cpp | 36 +- pcsx2/Misc.cpp | 84 ++-- pcsx2/Plugins.cpp | 511 ++++++++++++++++------- pcsx2/Plugins.h | 59 ++- pcsx2/RecoverySystem.cpp | 3 +- pcsx2/SaveState.cpp | 26 +- pcsx2/Sio.cpp | 40 +- pcsx2/System.cpp | 19 +- pcsx2/VUops.cpp | 43 +- pcsx2/VifDma.cpp | 41 +- pcsx2/gui/App.h | 2 +- pcsx2/gui/Dialogs/PickUserModeDialog.cpp | 4 +- pcsx2/gui/MainFrame.cpp | 3 +- pcsx2/gui/MainMenuClicks.cpp | 5 + pcsx2/gui/Panels/PluginSelectorPanel.cpp | 4 +- pcsx2/gui/wxHelpers.cpp | 4 +- pcsx2/x86/microVU_Lower.inl | 8 +- pcsx2/x86/sVU_zerorec.cpp | 30 +- pcsx2_suite_2008.sln | 33 +- 35 files changed, 859 insertions(+), 878 deletions(-) diff --git a/common/include/PS2Edefs.h b/common/include/PS2Edefs.h index f89cda1c49..3fdd3b0944 100644 --- a/common/include/PS2Edefs.h +++ b/common/include/PS2Edefs.h @@ -512,20 +512,15 @@ 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)(); typedef s32 (CALLBACK* _GSopen)(void *pDsp, char *Title, int 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)(int, const char* filename); typedef void (CALLBACK* _GSirqCallback)(void (*callback)()); typedef void (CALLBACK* _GSprintf)(int timeout, char *fmt, ...); @@ -536,33 +531,22 @@ typedef void (CALLBACK* _GSsetFrameLimit)(int limit); typedef int (CALLBACK* _GSsetupRecording)(int, void*); 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)(int mode, freezeData *data); -typedef void (CALLBACK* _GSconfigure)(); -typedef s32 (CALLBACK* _GStest)(); -typedef void (CALLBACK* _GSabout)(); + +// Worthless crap function that returns GS plugin specific data via some +// undocumented void* to a struct. If ant pad plugin actually relies on +// this info, it deserves to fail new nwer pcsx2s. -- air +//typedef void (CALLBACK* _GSgetDriverInfo)(GSdriverInfo *info); // PAD -typedef s32 (CALLBACK* _PADinit)(u32 flags); typedef s32 (CALLBACK* _PADopen)(void *pDsp); -typedef void (CALLBACK* _PADclose)(); -typedef void (CALLBACK* _PADshutdown)(); -typedef keyEvent* (CALLBACK* _PADkeyEvent)(); typedef u8 (CALLBACK* _PADstartPoll)(int pad); typedef u8 (CALLBACK* _PADpoll)(u8 value); -typedef u32 (CALLBACK* _PADquery)(); +typedef u32 (CALLBACK* _PADquery)(int pad); typedef void (CALLBACK* _PADupdate)(int pad); - +typedef keyEvent* (CALLBACK* _PADkeyEvent)(); 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); typedef s32 (CALLBACK* _PADsetSlot)(u8 port, u8 slot); typedef s32 (CALLBACK* _PADqueryMtap)(u8 port); @@ -582,10 +566,7 @@ 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)(); typedef s32 (CALLBACK* _SPU2open)(void *pDsp); -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, int size); @@ -604,19 +585,12 @@ typedef void (CALLBACK* _SPU2setTimeStretcher)(short int enable); typedef u32 (CALLBACK* _SPU2ReadMemAddr)(int core); typedef void (CALLBACK* _SPU2WriteMemAddr)(int 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)(); 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); @@ -631,19 +605,13 @@ typedef s32 (CALLBACK* _CDVDreadSector)(u8* buffer, u32 lsn, int mode); typedef s32 (CALLBACK* _CDVDgetBuffer2)(u8* buffer); typedef s32 (CALLBACK* _CDVDgetDualInfo)(s32* dualType, u32* _layer1start); -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)(); typedef s32 (CALLBACK* _DEV9open)(void *pDsp); -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); @@ -655,18 +623,10 @@ 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)(); typedef s32 (CALLBACK* _USBopen)(void *pDsp); -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); @@ -675,30 +635,15 @@ 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)(); typedef s32 (CALLBACK* _FWopen)(void *pDsp); -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)(); - #endif #ifdef PLUGINfuncs @@ -709,7 +654,6 @@ extern _GSvsync GSvsync; extern _GSgifTransfer1 GSgifTransfer1; extern _GSgifTransfer2 GSgifTransfer2; extern _GSgifTransfer3 GSgifTransfer3; -extern _GSgetLastTag GSgetLastTag; extern _GSgifSoftReset GSgifSoftReset; extern _GSreadFIFO GSreadFIFO; extern _GSreadFIFO2 GSreadFIFO2; @@ -726,29 +670,18 @@ extern _GSsetFrameLimit GSsetFrameLimit; extern _GSsetupRecording GSsetupRecording; extern _GSreset GSreset; extern _GSwriteCSR GSwriteCSR; -extern _GSgetDriverInfo GSgetDriverInfo; -#ifdef _WINDOWS_ -extern _GSsetWindowInfo GSsetWindowInfo; -#endif -// PAD1 -extern _PADopen PAD1open; -extern _PADstartPoll PAD1startPoll; -extern _PADpoll PAD1poll; -extern _PADquery PAD1query; -extern _PADupdate PAD1update; +// PAD +extern _PADopen PADopen; +extern _PADstartPoll PADstartPoll; +extern _PADpoll PADpoll; +extern _PADquery PADquery; +extern _PADupdate PADupdate; +extern _PADkeyEvent PADkeyEvent; +extern _PADgsDriverInfo PADgsDriverInfo; +extern _PADsetSlot PADsetSlot; +extern _PADqueryMtap PADqueryMtap; -extern _PADgsDriverInfo PAD1gsDriverInfo; -extern _PADsetSlot PAD1setSlot; -extern _PADqueryMtap PAD1queryMtap; - -extern _PADgsDriverInfo PAD2gsDriverInfo; -extern _PADconfigure PAD2configure; -extern _PADtest PAD2test; -extern _PADabout PAD2about; -extern _PADfreeze PAD2freeze; -extern _PADsetSlot PAD2setSlot; -extern _PADqueryMtap PAD2queryMtap; // SIO[2] extern _SIOopen SIOopen[2][9]; @@ -777,37 +710,6 @@ extern _SPU2setTimeStretcher SPU2setTimeStretcher; extern _SPU2async SPU2async; -// CDVD -struct CDVDplugin { - _CDVDinit init; - _CDVDopen open; - _CDVDclose close; - _CDVDshutdown shutdown; - _CDVDreadTrack readTrack; - _CDVDgetBuffer getBuffer; - _CDVDreadSubQ readSubQ; - _CDVDgetTN getTN; - _CDVDgetTD getTD; - _CDVDgetTOC getTOC; - _CDVDgetDiskType getDiskType; - _CDVDgetTrayStatus getTrayStatus; - _CDVDctrlTrayOpen ctrlTrayOpen; - _CDVDctrlTrayClose ctrlTrayClose; - - _CDVDconfigure configure; - _CDVDtest test; - _CDVDabout about; - _CDVDnewDiskCB newDiskCB; - - // special functions, not in external interface yet - _CDVDreadSector readSector; - _CDVDgetBuffer2 getBuffer2; - _CDVDgetDualInfo getDualInfo; - - int* initCount; -}; -extern CDVDplugin CDVD_plugin; // _plugin because of - // DEV9 extern _DEV9open DEV9open; extern _DEV9read8 DEV9read8; diff --git a/common/include/Pcsx2Config.h b/common/include/Pcsx2Config.h index 8c23af695f..e7a891d8f0 100644 --- a/common/include/Pcsx2Config.h +++ b/common/include/Pcsx2Config.h @@ -44,7 +44,6 @@ extern SessionOverrideFlags g_Session; ////////////////////////////////////////////////////////////////////////// // Pcsx2 User Configuration Options! -#define PCSX2_GSMULTITHREAD 0x0001 // Use Multi-Threaded GS #define PCSX2_EEREC 0x0010 #define PCSX2_VU0REC 0x0020 #define PCSX2_VU1REC 0x0040 @@ -58,7 +57,6 @@ extern SessionOverrideFlags g_Session; #define CHECK_FRAMELIMIT (Config.Options&PCSX2_FRAMELIMIT_MASK) //------------ CPU Options!!! --------------- -#define CHECK_MULTIGS (Config.Options&PCSX2_GSMULTITHREAD) #define CHECK_MICROVU0 (Config.Options&PCSX2_MICROVU0) #define CHECK_MICROVU1 (Config.Options&PCSX2_MICROVU1) #define CHECK_EEREC (!g_Session.ForceDisableEErec && Config.Options&PCSX2_EEREC) diff --git a/common/include/PluginCallbacks.h b/common/include/PluginCallbacks.h index efc0bcbc5f..0635c3fc0f 100644 --- a/common/include/PluginCallbacks.h +++ b/common/include/PluginCallbacks.h @@ -194,6 +194,37 @@ typedef struct _PS2E_SessionInfo } PS2E_SessionInfo; +///////////////////////////////////////////////////////////////////////////////////////// +// +typedef struct _PS2E_CustomSettingsAPI +{ + int (PS2E_CALLBACK* GetInt)( const char* name ); + + // GetBoolean + // Should return either 1 (true) or 0 (false). Returning any non-zero value for true + // probably "works" but is not recommended, since C/C++ standard specifically defines + // the result of bool->int conversions as a 0 or 1 result. + int (PS2E_CALLBACK* GetBoolean)( const char* name ); + + // GetString + // Copies an ASCII-Z string into the dest pointer, to max length allowed. The result + // is always safely zero-terminated (none of that snprintf crap where you have to + // zero-terminate yourself >_<). + // + int (PS2E_CALLBACK* GetString)( const char* name, char* dest, int maxlen ); + + // GetStringAlloc + // Provides an alternative to GetString, that can rerieve strings of arbitrary length. + // The plugin must provide a valid allocator callback, which takes a sice parameter and + // returns a pointer to an allocation large enough to hold the size. + // + // It is then the responsibility of the plugin to free the allocated pointer when it + // is done with it. + // + char* (PS2E_CALLBACK* GetStringAlloc)( const char* name, void* (*allocator)(int size) ); + +} PS2E_CustomSettingsAPI; + ///////////////////////////////////////////////////////////////////////////////////////// // PS2E_EmulatorAPI // @@ -207,7 +238,7 @@ typedef struct _PS2E_EmulatorAPI // console. Some emulators may not support a console, in which case these functions // will be NOPs. For plain and simple to-disk logging, plugins should create and use // their own logging facilities. - ConsoleLogger* Console; + ConsoleLogger Console; // OSD_WriteLn // This function allows the plugin to post messages to the emulator's On-Screen Display. @@ -229,6 +260,18 @@ typedef struct _PS2E_EmulatorAPI // msg - string message displayed to the user. void (PS2E_CALLBACK* OSD_WriteLn)( int icon, const char* msg ); + // CustomSettings + // Provides an interface through which a plugin can retrieve custom setting values straight + // from the emulator's ini file itself; intended for advanced plugin/emu binding only, and + // should generally be accompanied with the appropriate version/name checks. + // + // Emulators may implement this as a direct match to the emu's ini file/registry contents + // (recommended), or may provide additional and/or alternative custom strings. Direct + // ini.registry relationships are preferred since those are easy for a plugin author to + // reference without documentation. + // + PS2E_CustomSettingsAPI CustomSettings; + } PS2E_EmulatorAPI; @@ -769,41 +812,6 @@ extern _PS2EgetLibVersion2 PS2EgetLibVersion2; extern _PS2EgetLibName PS2EgetLibName; extern _PS2EpassConfig PS2EpassConfig; -// 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; diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index 67061faffa..bb07fb9923 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -390,7 +390,7 @@ void cdvdReadKey(u8 arg0, u16 arg1, u32 arg2, u8* key) { key[15] = 0x01; } - Console::WriteLn( "CDVD.KEY = %02X,%02X,%02X,%02X,%02X,%02X,%02X", params + Console::WriteLn( "CDVD->KEY = %02X,%02X,%02X,%02X,%02X,%02X,%02X", params cdvd.Key[0],cdvd.Key[1],cdvd.Key[2],cdvd.Key[3],cdvd.Key[4],cdvd.Key[14],cdvd.Key[15] ); // Now's a good time to reload the ELF info... @@ -404,28 +404,28 @@ void cdvdReadKey(u8 arg0, u16 arg1, u32 arg2, u8* key) { s32 cdvdGetToc(void* toc) { - s32 ret = CDVD.getTOC(toc); + s32 ret = CDVD->getTOC(toc); if (ret == -1) ret = 0x80; return ret; } s32 cdvdReadSubQ(s32 lsn, cdvdSubQ* subq) { - s32 ret = CDVD.readSubQ(lsn, subq); + s32 ret = CDVD->readSubQ(lsn, subq); if (ret == -1) ret = 0x80; return ret; } s32 cdvdCtrlTrayOpen() { - s32 ret = CDVD.ctrlTrayOpen(); + s32 ret = CDVD->ctrlTrayOpen(); if (ret == -1) ret = 0x80; return ret; } s32 cdvdCtrlTrayClose() { - s32 ret = CDVD.ctrlTrayClose(); + s32 ret = CDVD->ctrlTrayClose(); if (ret == -1) ret = 0x80; return ret; } @@ -434,7 +434,7 @@ s32 cdvdCtrlTrayClose() // checks if tray was opened since last call to this func s32 cdvdGetTrayStatus() { - s32 ret = CDVD.getTrayStatus(); + s32 ret = CDVD->getTrayStatus(); if (ret == -1) return(CDVD_TRAY_CLOSE); @@ -464,7 +464,7 @@ static s32 cdvdReadDvdDualInfo(s32* dualType, u32* layer1Start) *dualType = 0; *layer1Start = 0; - return CDVD.getDualInfo(dualType,layer1Start); + return CDVD->getDualInfo(dualType,layer1Start); } static uint cdvdBlockReadTime( CDVD_MODE_TYPE mode ) @@ -519,8 +519,6 @@ void SaveState::cdvdFreeze() } } -// Modified by (efp) - 16/01/2006 - void cdvdDetectDisk() { cdvd.Type = DoCDVDdetectDiskType(); @@ -533,7 +531,8 @@ void cdvdDetectDisk() { ElfCRC = loadElfCRC( str.ToAscii().data() ); ElfApplyPatches(); - GSsetGameCRC( ElfCRC, 0 ); + if( GSsetGameCRC != NULL ) + GSsetGameCRC( ElfCRC, 0 ); } } @@ -736,7 +735,6 @@ __forceinline void cdvdReadInterrupt() } else { - if (cdvd.RErr == 0) { cdr.RErr = DoCDVDgetBuffer(cdr.Transfer); diff --git a/pcsx2/CDVD/CDVD.h b/pcsx2/CDVD/CDVD.h index 151b97bce1..fb24a5da4f 100644 --- a/pcsx2/CDVD/CDVD.h +++ b/pcsx2/CDVD/CDVD.h @@ -132,6 +132,42 @@ struct cdvdStruct { bool Spinning; // indicates if the Cdvd is spinning or needs a spinup delay }; + +struct CDVD_API +{ + struct + { + void (CALLBACK *close)(); + + // Don't need init or shutdown. iso/nodisc have no init/shutdown and plugin's + // is handled by the PluginManager. + + // Don't need pluign specific things like freeze, test, or other stuff here. + // Those are handled by the plugin manager specifically. + + } Common; + + _CDVDopen open; + _CDVDreadTrack readTrack; + _CDVDgetBuffer getBuffer; + _CDVDreadSubQ readSubQ; + _CDVDgetTN getTN; + _CDVDgetTD getTD; + _CDVDgetTOC getTOC; + _CDVDgetDiskType getDiskType; + _CDVDgetTrayStatus getTrayStatus; + _CDVDctrlTrayOpen ctrlTrayOpen; + _CDVDctrlTrayClose ctrlTrayClose; + _CDVDnewDiskCB newDiskCB; + + // special functions, not in external interface yet + _CDVDreadSector readSector; + _CDVDgetBuffer2 getBuffer2; + _CDVDgetDualInfo getDualInfo; + + wxString (*getUniqueFilename)(); +}; + extern void cdvdReset(); extern void cdvdVsync(); extern void cdvdActionInterrupt(); @@ -143,6 +179,21 @@ extern void cdvdNewDiskCB(); extern u8 cdvdRead(u8 key); extern void cdvdWrite(u8 key, u8 rt); -extern CDVDplugin CDVD; -extern CDVDplugin ISO; -extern CDVDplugin NODISC; +// ---------------------------------------------------------------------------- +// Multiple interface system for CDVD +// used to provide internal CDVDiso and NoDisc, and external plugin interfaces. +// --------------------------------------------------------------------------- + +enum CDVD_SourceType +{ + CDVDsrc_Iso, // use built in ISO api + CDVDsrc_NoDisc, // use built in CDVDnull + CDVDsrc_Plugin, // use external plugin +}; + +extern void CDVDsys_ChangeSource( CDVD_SourceType type ); +extern CDVD_API* CDVD; // currently active CDVD access mode api (either Iso, NoDisc, or Plugin) + +extern CDVD_API CDVDapi_Plugin; +extern CDVD_API CDVDapi_Iso; +extern CDVD_API CDVDapi_NoDisc; diff --git a/pcsx2/CDVD/CDVDaccess.cpp b/pcsx2/CDVD/CDVDaccess.cpp index 7630faafdb..1bba701ad6 100644 --- a/pcsx2/CDVD/CDVDaccess.cpp +++ b/pcsx2/CDVD/CDVDaccess.cpp @@ -32,13 +32,30 @@ #include "IsoFSdrv.h" #include "CDVDisoReader.h" +// ---------------------------------------------------------------------------- +// diskTypeCached +// Internal disc type cache, to reduce the overhead of disc type checks, which are +// performed quite liberally by many games (perhaps intended to keep the PS2 DVD +// from spinning down due to idle activity?). +// Cache is set to -1 for init and when the disc is removed/changed, which invokes +// a new DiskTypeCheck. Al subsequent checks use the non-negative value here. +// static int diskTypeCached=-1; +// used to bridge the gap between the old getBuffer api and the new getBuffer2 api. int lastReadSize; -static int plsn=0; // This never gets set, so it's always 0. +// Records last read block length for block dumping +static int plsn = 0; static isoFile *blockDumpFile; +// Assertion check for CDVD != NULL (in devel and debgu builds), because its handier than +// relying on DEP exceptions -- and a little more reliable too. +static void CheckNullCDVD() +{ + DevAssert( CDVD != NULL, "Invalid CDVD object state (null pointer exception)" ); +} + ///////////////////////////////////////////////// // // Disk Type detection stuff (from cdvdGigaherz) @@ -88,14 +105,14 @@ int CheckDiskTypeFS(int baseType) static char bleh[2352]; -int FindDiskType(int mType) +static int FindDiskType(int mType) { int dataTracks = 0; int audioTracks = 0; int iCDType = mType; cdvdTN tn; - CDVD.getTN(&tn); + CDVD->getTN(&tn); if (tn.strack != tn.etrack) // multitrack == CD. { @@ -104,8 +121,8 @@ int FindDiskType(int mType) else if (mType < 0) { cdvdTD td; - - CDVD.getTD(0,&td); + + CDVD->getTD(0,&td); if (td.lsn > 452849) { iCDType = CDVD_TYPE_DETCTDVDS; @@ -128,7 +145,7 @@ int FindDiskType(int mType) s32 dlt = 0; u32 l1s = 0; - if(CDVD.getDualInfo(&dlt,&l1s)==0) + if(CDVD->getDualInfo(&dlt,&l1s)==0) { if (dlt > 0) iCDType = CDVD_TYPE_DETCTDVDD; } @@ -154,12 +171,12 @@ int FindDiskType(int mType) { cdvdTD td,td2; - CDVD.getTD(i,&td); + CDVD->getTD(i,&td); if (tn.etrack > i) - CDVD.getTD(i+1,&td2); + CDVD->getTD(i+1,&td2); else - CDVD.getTD(0,&td2); + CDVD->getTD(0,&td2); int tlength = td2.lsn - td.lsn; @@ -199,18 +216,21 @@ int FindDiskType(int mType) return iCDType; } -void DetectDiskType() +static void DetectDiskType() { - if (CDVD.getTrayStatus() == CDVD_TRAY_OPEN) + if (CDVD->getTrayStatus() == CDVD_TRAY_OPEN) { diskTypeCached = CDVD_TYPE_NODISC; return; } - int baseMediaType = CDVD.getDiskType(); + int baseMediaType = CDVD->getDiskType(); int mType = -1; - switch(baseMediaType) // Paranoid mode: do not trust the plugin's detection system to work correctly. + // Paranoid mode: do not trust the plugin's detection system to work correctly. + // (.. and there's no reason plugins should be doing their own detection anyway). + + switch(baseMediaType) { case CDVD_TYPE_CDDA: case CDVD_TYPE_PSCD: @@ -239,35 +259,47 @@ void DetectDiskType() diskTypeCached = FindDiskType(mType); } +// ---------------------------------------------------------------------------- +// CDVDsys_ChangeSource // -///////////////////////////////////////////////// - -s32 DoCDVDinit() +void CDVDsys_ChangeSource( CDVD_SourceType type ) { - diskTypeCached = -1; + if( CDVD != NULL ) + DoCDVDclose(); + + switch( type ) + { + case CDVDsrc_Iso: + CDVD = &CDVDapi_Iso; + break; + + case CDVDsrc_NoDisc: + CDVD = &CDVDapi_NoDisc; + break; - if(CDVD.initCount) *CDVD.initCount++; // used to handle the case where the plugin was inited at boot, but then iso takes over - return CDVD.init(); -} + case CDVDsrc_Plugin: + CDVD = &CDVDapi_Plugin; + break; -void DoCDVDshutdown() -{ - if(CDVD.initCount) *CDVD.initCount--; - CDVD.shutdown(); + jNO_DEFAULT; + } } s32 DoCDVDopen(const char* pTitleFilename) { - int ret = CDVD.open(pTitleFilename); + CheckNullCDVD(); + + int ret = CDVD->open(pTitleFilename); int cdtype = DoCDVDdetectDiskType(); if ((Config.Blockdump) && (cdtype != CDVD_TYPE_NODISC)) { - // write blockdumps to the CWD for now. + // TODO: Add a blockdumps configurable folder, and use that instead of CWD(). - wxString temp( Path::Combine( wxGetCwd(), (CDVD.init == ISO.init) ? - Path::GetFilenameWithoutExt(wxString::FromAscii(isoFileName)) : L"Untitled" - ) ); + // TODO: "Untitled" should use pnach/slus name resolution, slus if no patch, + // and finally an "Untitled-[ElfCRC]" if no slus. + + wxString temp( Path::Combine( wxGetCwd(), CDVD->getUniqueFilename() ) ); #ifdef ENABLE_TIMESTAMPS wxDateTime curtime( wxDateTime::GetTimeNow() ); @@ -280,7 +312,7 @@ s32 DoCDVDopen(const char* pTitleFilename) temp += L".dump"; cdvdTD td; - CDVD.getTD(0, &td); + CDVD->getTD(0, &td); int blockofs = 0, blocksize = 0, blocks = td.lsn; @@ -313,26 +345,29 @@ s32 DoCDVDopen(const char* pTitleFilename) void DoCDVDclose() { + CheckNullCDVD(); if(blockDumpFile) isoClose(blockDumpFile); - CDVD.close(); + if( CDVD->Common.close != NULL ) + CDVD->Common.close(); } s32 DoCDVDreadSector(u8* buffer, u32 lsn, int mode) { - int ret = CDVD.readSector(buffer,lsn,mode); + CheckNullCDVD(); + int ret = CDVD->readSector(buffer,lsn,mode); - if(ret==0) + if(ret == 0 && blockDumpFile != NULL ) { - if (blockDumpFile != NULL) - { - isoWriteBlock(blockDumpFile, buffer, plsn); - } + isoWriteBlock(blockDumpFile, buffer, lsn); } + return ret; } s32 DoCDVDreadTrack(u32 lsn, int mode) { + CheckNullCDVD(); + // TEMP: until all the plugins use the new CDVDgetBuffer style switch (mode) { @@ -352,21 +387,17 @@ s32 DoCDVDreadTrack(u32 lsn, int mode) //DevCon::Notice("CDVD readTrack(lsn=%d,mode=%d)",params lsn, lastReadSize); - return CDVD.readTrack(lsn,mode); + return CDVD->readTrack(lsn,mode); } -// return can be NULL (for async modes) - s32 DoCDVDgetBuffer(u8* buffer) { - int ret = CDVD.getBuffer2(buffer); + CheckNullCDVD(); + int ret = CDVD->getBuffer2(buffer); - if (ret == 0) + if (ret == 0 && blockDumpFile != NULL) { - if (blockDumpFile != NULL) - { - isoWriteBlock(blockDumpFile, buffer, plsn); - } + isoWriteBlock(blockDumpFile, buffer, lastReadSize); } return ret; @@ -374,8 +405,8 @@ s32 DoCDVDgetBuffer(u8* buffer) s32 DoCDVDdetectDiskType() { - if(diskTypeCached<0) DetectDiskType(); - + CheckNullCDVD(); + if(diskTypeCached < 0) DetectDiskType(); return diskTypeCached; } @@ -389,10 +420,6 @@ void DoCDVDresetDiskTypeCache() // CDVD null interface for Run BIOS menu -s32 CALLBACK NODISCinit() -{ - return 0; -} s32 CALLBACK NODISCopen(const char* pTitle) { @@ -403,10 +430,6 @@ void CALLBACK NODISCclose() { } -void CALLBACK NODISCshutdown() -{ -} - s32 CALLBACK NODISCreadTrack(u32 lsn, int mode) { return -1; @@ -453,10 +476,6 @@ s32 CALLBACK NODISCdummyS32() return 0; } -void CALLBACK NODISCdummyVOID() -{ -} - void CALLBACK NODISCnewDiskCB(void(CALLBACK*)()) { } @@ -476,11 +495,19 @@ s32 CALLBACK NODISCgetDualInfo(s32* dualType, u32* _layer1start) return -1; } -CDVDplugin NODISC = { - NODISCinit, +wxString NODISCgetUniqueFilename() +{ + DevAssert( false, "NODISC is an invalid CDVD object for block dumping.. >_<" ); + return L"epicfail"; +} + +CDVD_API CDVDapi_NoDisc = +{ + { + NODISCclose, + }, + NODISCopen, - NODISCclose, - NODISCshutdown, NODISCreadTrack, NODISCgetBuffer, NODISCreadSubQ, @@ -492,9 +519,6 @@ CDVDplugin NODISC = { NODISCdummyS32, NODISCdummyS32, - NODISCdummyVOID, - NODISCdummyS32, - NODISCdummyVOID, NODISCnewDiskCB, NODISCreadSector, diff --git a/pcsx2/CDVD/CDVDaccess.h b/pcsx2/CDVD/CDVDaccess.h index ff4124dae1..4af11f74dd 100644 --- a/pcsx2/CDVD/CDVDaccess.h +++ b/pcsx2/CDVD/CDVDaccess.h @@ -19,10 +19,11 @@ #ifndef __CDVD_ACCESS_H__ #define __CDVD_ACCESS_H__ -extern s32 DoCDVDinit(); +extern void CDVDsys_Init(); +extern void CDVDsys_Shutdown(); + extern s32 DoCDVDopen(const char* pTitleFilename); extern void DoCDVDclose(); -extern void DoCDVDshutdown(); extern s32 DoCDVDreadSector(u8* buffer, u32 lsn, int mode); extern s32 DoCDVDreadTrack(u32 lsn, int mode); extern s32 DoCDVDgetBuffer(u8* buffer); diff --git a/pcsx2/CDVD/CDVDisoReader.cpp b/pcsx2/CDVD/CDVDisoReader.cpp index c7f70c4e53..9f708b4325 100644 --- a/pcsx2/CDVD/CDVDisoReader.cpp +++ b/pcsx2/CDVD/CDVDisoReader.cpp @@ -31,26 +31,22 @@ char isoFileName[g_MaxPath]; u8 *pbuffer; -static int psize, cdtype; u8 cdbuffer[2352] = {0}; isoFile *iso; -s32 CALLBACK ISOinit() -{ - CDVD_LOG("ISOinit\n"); +static int psize, cdtype; - return 0; -} - -void CALLBACK ISOshutdown() +void CALLBACK ISOclose() { - CDVD_LOG("ISOshutdown\n"); + isoClose(iso); } s32 CALLBACK ISOopen(const char* pTitle) { //if (pTitle != NULL) strcpy(isoFileName, pTitle); + ISOclose(); // just in case + iso = isoOpen(isoFileName); if (iso == NULL) { @@ -74,11 +70,6 @@ s32 CALLBACK ISOopen(const char* pTitle) return 0; } -void CALLBACK ISOclose() -{ - isoClose(iso); -} - s32 CALLBACK ISOreadSubQ(u32 lsn, cdvdSubQ* subq) { // fake it @@ -391,19 +382,22 @@ s32 CALLBACK ISOdummyS32() return 0; } -void CALLBACK ISOdummyVOID() -{ -} - void CALLBACK ISOnewDiskCB(void(CALLBACK*)()) { } -CDVDplugin ISO = { - ISOinit, +wxString ISOgetUniqueFilename() +{ + return Path::GetFilenameWithoutExt(wxString::FromAscii(isoFileName)); +} + +CDVD_API CDVDapi_Iso = +{ + { + ISOclose + }, + ISOopen, - ISOclose, - ISOshutdown, ISOreadTrack, ISOgetBuffer, // emu shouldn't use this one. ISOreadSubQ, @@ -411,13 +405,10 @@ CDVDplugin ISO = { ISOgetTD, ISOgetTOC, ISOgetDiskType, - ISOdummyS32, - ISOdummyS32, - ISOdummyS32, + ISOdummyS32, // trayStatus + ISOdummyS32, // trayOpen + ISOdummyS32, // trayClose - ISOdummyVOID, - ISOdummyS32, - ISOdummyVOID, ISOnewDiskCB, ISOreadSector, diff --git a/pcsx2/CDVD/CdRom.cpp b/pcsx2/CDVD/CdRom.cpp index 6218a06a3d..d5c742b3ae 100644 --- a/pcsx2/CDVD/CdRom.cpp +++ b/pcsx2/CDVD/CdRom.cpp @@ -315,7 +315,7 @@ void cdrInterrupt() { SetResultSize(3); cdr.StatP|= 0x2; cdr.Result[0] = cdr.StatP; - if (CDVD.getTN(&cdr.ResultTN) == -1) { + if (CDVD->getTN(&cdr.ResultTN) == -1) { cdr.Stat = DiskError; cdr.Result[0]|= 0x01; } else { @@ -330,7 +330,7 @@ void cdrInterrupt() { cdr.Track = btoi(cdr.Param[0]); SetResultSize(4); cdr.StatP|= 0x2; - if (CDVD.getTD(cdr.Track, &trackInfo) == -1) { + if (CDVD->getTD(cdr.Track, &trackInfo) == -1) { cdr.Stat = DiskError; cdr.Result[0]|= 0x01; } else { @@ -499,7 +499,7 @@ void cdrReadInterrupt() { Console::Status("Reading From CDR"); cdr.RErr = DoCDVDgetBuffer(cdr.Transfer); - if (cdr.RErr == -1) + if (cdr.RErr == -1) { CDR_LOG(" err\n"); memzero_ptr<2340>(cdr.Transfer); @@ -509,6 +509,13 @@ void cdrReadInterrupt() { CDREAD_INT((cdr.Mode & 0x80) ? (cdReadTime / 2) : cdReadTime); return; } + else if(cdr.RErr == -2) + { + // async mode is not finished yet ... give it a bit more time + CDREAD_INT(cdReadTime / 4); + return; + } + cdr.Stat = DataReady; CDR_LOG(" %x:%x:%x", cdr.Transfer[0], cdr.Transfer[1], cdr.Transfer[2]); diff --git a/pcsx2/CDVD/IsoFileFormats.cpp b/pcsx2/CDVD/IsoFileFormats.cpp index 791823913a..154c81f72f 100644 --- a/pcsx2/CDVD/IsoFileFormats.cpp +++ b/pcsx2/CDVD/IsoFileFormats.cpp @@ -414,10 +414,10 @@ int isoWriteBlock(isoFile *iso, u8 *src, int lsn) void isoClose(isoFile *iso) { + if (iso == NULL ) return; if (iso->handle) _closefile(iso->handle); if (iso->htable) _closefile(iso->htable); - if (iso->buffer) free(iso->buffer); - - free(iso); + safe_free( iso->buffer ); + safe_free( iso ); } diff --git a/pcsx2/CDVD/IsoFileFormats.h b/pcsx2/CDVD/IsoFileFormats.h index f7e6f95af2..1df8f4b1ec 100644 --- a/pcsx2/CDVD/IsoFileFormats.h +++ b/pcsx2/CDVD/IsoFileFormats.h @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - #ifndef __LIBISO_H__ +#ifndef __LIBISO_H__ #define __LIBISO_H__ #include "CDVD.h" @@ -33,11 +33,11 @@ enum isoType enum isoFlags { - ISOFLAGS_Z = 0x0001, - ISOFLAGS_Z2 = 0x0002, - ISOFLAGS_BLOCKDUMP = 0x0004, - ISOFLAGS_MULTI = 0x0008, - ISOFLAGS_BZ2 = 0x0010 + ISOFLAGS_Z = 0x0001, + ISOFLAGS_Z2 = 0x0002, + ISOFLAGS_BLOCKDUMP = 0x0004, + ISOFLAGS_MULTI = 0x0008, + ISOFLAGS_BZ2 = 0x0010 }; #define CD_FRAMESIZE_RAW 2352 diff --git a/pcsx2/Docs/ChangeLog.txt b/pcsx2/Docs/ChangeLog.txt index 182d60802b..2ccfe94163 100644 --- a/pcsx2/Docs/ChangeLog.txt +++ b/pcsx2/Docs/ChangeLog.txt @@ -533,7 +533,7 @@ v0.9.1: * 30/03/05:[*] Cleaned up a bit writes to VIFX regs [-] Fixed a small bug in vif1 stalls - [-] Commented readclock win32 code at CDVD.c + [-] Commented readclock win32 code at CDVD->c [-] Fixed two small issues with branches in interp (linuzappz) @@ -1173,7 +1173,7 @@ v0.9.1: (linuzappz) * 02/02/04:[-] Included stdarg.h in GRecCommon.h - [+] Added some scmds to CDVD.c (auMatt) + [+] Added some scmds to CDVD->c (auMatt) [+] cdvd.Status now changes to CDVD_STATUS_SEEK_COMPLETE, after a CdRead CMD (linuzappz) @@ -1718,7 +1718,7 @@ v0.9.1: that to you florin :) (linuzappz) - * 12/08/03:[*] Changed the time in CDVD.c and some WIN32 defines to __WIN32__ + * 12/08/03:[*] Changed the time in CDVD->c and some WIN32 defines to __WIN32__ (Florin) * 08/08/03:[+] Started SMAP/DEV9 stuff @@ -1730,7 +1730,7 @@ v0.9.1: v0.41: * 05/08/03:[-] Uncommented some sif WIP stuff :) [*] Addeded 0x00100008 PC for cpuExecuteBios as well - [-] Fixed silly bug in CDVD.c for DvdReads + [-] Fixed silly bug in CDVD->c for DvdReads (linuzappz) v0.4: @@ -1865,7 +1865,7 @@ v0.9.1: [!] sven shows one screen now, and others want to ;) (linuzappz) - * 29/06/03:[-] Removed the experimental code i added yesterday from CDVD.c/h + * 29/06/03:[-] Removed the experimental code i added yesterday from CDVD->c/h [*] Improved EE/IOP Rcnts (linuzappz) @@ -1885,13 +1885,13 @@ v0.9.1: * 26/06/03:[-] Really fixed HLE mode ;). (linuzappz) - * 26/06/03:[-] Small CDVD.c corrections. (linuzappz) + * 26/06/03:[-] Small CDVD->c corrections. (linuzappz) * 24/06/03:[*] Fixed elf loader at least not to crash at bad elfs. (Florin) * 23/06/03:[*] Added "rom1.bin" as a valid file for rom1 filesystem. (Florin) - * 23/06/03:[-] Small fix to CDVD.c, maybe fixed a time out problem + * 23/06/03:[-] Small fix to CDVD->c, maybe fixed a time out problem with some cdvdman versions. (linuzappz) @@ -1902,10 +1902,10 @@ v0.9.1: (linuzappz) * 17/06/03:[-] Fixed Sio2, PADs are working :D, Sio.c, PsxSio2.c - [-] Fixed language in CDVD.c, now's english again :) + [-] Fixed language in CDVD->c, now's english again :) (linuzappz) - * 16/06/03:[-] Better error handling over CDVD.c + * 16/06/03:[-] Better error handling over CDVD->c [+] ROM1 stuff, Memory.c/h, PsxMem.c, iR3000A.c, iR5900.c [!] PCSX2 now detects the rom1 in this way: ie. you use scph10000.bin, then you must have @@ -1915,7 +1915,7 @@ v0.9.1: * 16/06/03:[-] Rewrote the VIFtransfer and VIFdma again. Better speed and compatibility this time (asadr). - * 16/06/03:[*] Reoverwritten CDVD.c/h with my CDVD.c/h, + * 16/06/03:[*] Reoverwritten CDVD->c/h with my CDVD->c/h, this is simpler, more direct and faster, CdRom.c, PsxHw.c, R3000A.c, PsxCounters.c, Memory.c @@ -1939,11 +1939,11 @@ v0.9.1: * 11/06/03:[+] More functions on lle cdrom (cdread) (Florin) - * 10/06/03:[+] Rudely overwritten linuzappz work in CDVD.c/.h + * 10/06/03:[+] Rudely overwritten linuzappz work in CDVD->c/.h [!] Sorry man, i think i did the best...i created a framework with names and so on. Also we have to talk about;) (Florin) - * 10/06/03:[+] Started CDVD.c/h, moved old CDVD.h to CDVDlib.h, + * 10/06/03:[+] Started CDVD->c/h, moved old CDVD->h to CDVDlib.h, PsxMem.c, PsxCommon.h (linuzappz) * 10/06/03:[*] Added new SPU2 dma functions plugin.c @@ -2434,7 +2434,7 @@ v0.9.1: v0.1: * 17/12/02: Small cleaning for release (linuzappz) - * 17/12/02: Fixed a comment in CDVD.h (linuzappz) + * 17/12/02: Fixed a comment in CDVD->h (linuzappz) v0.046: * 17/12/02: FIXED THAT BASTARD BUG with interpreter diff --git a/pcsx2/FiFo.cpp b/pcsx2/FiFo.cpp index 1523702820..c9a530623d 100644 --- a/pcsx2/FiFo.cpp +++ b/pcsx2/FiFo.cpp @@ -174,19 +174,12 @@ void __fastcall WriteFIFO_page_6(u32 mem, const mem128_t *value) psHu64(0x6008) = value[1]; FreezeRegs(1); - if( mtgsThread != NULL ) - { - const uint count = mtgsThread->PrepDataPacket( GIF_PATH_3, value, 1 ); - jASSUME( count == 1 ); - u64* data = (u64*)mtgsThread->GetDataPacketPtr(); - data[0] = value[0]; - data[1] = value[1]; - mtgsThread->SendDataPacket(); - } - else - { - GSGIFTRANSFER3((u32*)value, 1); - } + const uint count = mtgsThread->PrepDataPacket( GIF_PATH_3, value, 1 ); + jASSUME( count == 1 ); + u64* data = (u64*)mtgsThread->GetDataPacketPtr(); + data[0] = value[0]; + data[1] = value[1]; + mtgsThread->SendDataPacket(); FreezeRegs(0); } diff --git a/pcsx2/GS.cpp b/pcsx2/GS.cpp index a91f1f6ad0..47b6adc002 100644 --- a/pcsx2/GS.cpp +++ b/pcsx2/GS.cpp @@ -52,6 +52,8 @@ int g_SaveGSStream = 0; // save GS stream; 1 - prepare, 2 - save int g_nLeftGSFrames = 0; // when saving, number of frames left gzSavingState* g_fGSSave; +// fixme - need to take this concept and make it MTGS friendly. +#ifdef _STGS_GSSTATE_CODE void GSGIFTRANSFER1(u32 *pMem, u32 addr) { if( g_SaveGSStream == 2) { u32 type = GSRUN_TRANS1; @@ -91,22 +93,7 @@ __forceinline void GSVSYNC(void) { g_fGSSave->Freeze( type ); } } -#else - -__forceinline void GSGIFTRANSFER1(u32 *pMem, u32 addr) { - GSgifTransfer1(pMem, addr); -} - -__forceinline void GSGIFTRANSFER2(u32 *pMem, u32 size) { - GSgifTransfer2(pMem, size); -} - -__forceinline void GSGIFTRANSFER3(u32 *pMem, u32 size) { - GSgifTransfer3(pMem, size); -} - -__forceinline void GSVSYNC(void) { -} +#endif #endif void _gs_ChangeTimings( u32 framerate, u32 iTicks ) @@ -136,10 +123,7 @@ void _gs_ChangeTimings( u32 framerate, u32 iTicks ) void gsOnModeChanged( u32 framerate, u32 newTickrate ) { - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket( GS_RINGTYPE_MODECHANGE, framerate, newTickrate, 0 ); - else - _gs_ChangeTimings( framerate, newTickrate ); + mtgsThread->SendSimplePacket( GS_RINGTYPE_MODECHANGE, framerate, newTickrate, 0 ); } void gsSetVideoRegionType( u32 isPal ) @@ -218,34 +202,14 @@ void gsClose() { if( !m_gsOpened ) return; m_gsOpened = false; - - // Throw an assert if our multigs setting and mtgsThread status - // aren't synched. It shouldn't break the code anyway but it's a - // bad coding habit that we should catch and fix early. - assert( !!CHECK_MULTIGS == (mtgsThread != NULL ) ); - - if( mtgsThread != NULL ) - { - mtgsThread->Close(); - safe_delete( mtgsThread ); - } - else - GSclose(); + safe_delete( mtgsThread ); } void gsReset() { // Sanity check in case the plugin hasn't been initialized... if( !m_gsOpened ) return; - - if( mtgsThread != NULL ) - mtgsThread->Reset(); - else - { - Console::Notice( "GIF reset" ); - GSreset(); - GSsetFrameSkip(0); - } + mtgsThread->Reset(); gsOnModeChanged( (Config.PsxType & 1) ? FRAMERATE_PAL : FRAMERATE_NTSC, @@ -274,10 +238,7 @@ bool gsGIFSoftReset( int mask ) return false; } - if( mtgsThread != NULL ) - mtgsThread->GIFSoftReset( mask ); - else - GSgifSoftReset( mask ); + mtgsThread->GIFSoftReset( mask ); return true; } @@ -314,12 +275,7 @@ void gsCSRwrite(u32 value) // support soft resets. if( !gsGIFSoftReset( 7 ) ) - { - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket( GS_RINGTYPE_RESET, 0, 0, 0 ); - else - GSreset(); - } + mtgsThread->SendSimplePacket( GS_RINGTYPE_RESET, 0, 0, 0 ); CSRw |= 0x1f; GSCSRr = 0x551B4000; // Set the FINISH bit to 1 - GS is always at a finish state as we don't have a FIFO(saqib) @@ -332,12 +288,7 @@ void gsCSRwrite(u32 value) else { CSRw |= value & 0x1f; - - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket( GS_RINGTYPE_WRITECSR, CSRw, 0, 0 ); - else - GSwriteCSR(CSRw); - + mtgsThread->SendSimplePacket( GS_RINGTYPE_WRITECSR, CSRw, 0, 0 ); GSCSRr = ((GSCSRr&~value)&0x1f)|(GSCSRr&~0x1f); } @@ -368,9 +319,7 @@ __forceinline void gsWrite8(u32 mem, u8 value) gsCSRwrite((CSRw & ~0xff000000) | (value << 24)); break; default: *PS2GS_BASE(mem) = value; - - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE8, mem&0x13ff, value, 0); + mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE8, mem&0x13ff, value, 0); } GIF_LOG("GS write 8 at %8.8lx with data %8.8lx", mem, value); } @@ -417,9 +366,7 @@ __forceinline void gsWrite16(u32 mem, u16 value) } *(u16*)PS2GS_BASE(mem) = value; - - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE16, mem&0x13ff, value, 0); + mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE16, mem&0x13ff, value, 0); } ////////////////////////////////////////////////////////////////////////// @@ -444,9 +391,7 @@ __forceinline void gsWrite32(u32 mem, u32 value) } *(u32*)PS2GS_BASE(mem) = value; - - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE32, mem&0x13ff, value, 0); + mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE32, mem&0x13ff, value, 0); } ////////////////////////////////////////////////////////////////////////// @@ -482,9 +427,7 @@ void __fastcall gsWrite64_generic( u32 mem, const mem64_t* value ) GIF_LOG("GS Write64 at %8.8lx with data %8.8x_%8.8x", mem, srcval32[1], srcval32[0]); *(u64*)PS2GS_BASE(mem) = *value; - - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE64, mem&0x13ff, srcval32[0], srcval32[1]); + mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE64, mem&0x13ff, srcval32[0], srcval32[1]); } ////////////////////////////////////////////////////////////////////////// @@ -525,46 +468,10 @@ void __fastcall gsWrite128_generic( u32 mem, const mem128_t* value ) writeTo[0] = value[0]; writeTo[1] = value[1]; - if( mtgsThread != NULL ) - { - mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE64, masked_mem, srcval32[0], srcval32[1]); - mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE64, masked_mem+8, srcval32[2], srcval32[3]); - } + mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE64, masked_mem, srcval32[0], srcval32[1]); + mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE64, masked_mem+8, srcval32[2], srcval32[3]); } -#if 0 -// This function is left in for now for debugging/reference purposes. -__forceinline void gsWrite64(u32 mem, u64 value) -{ - GIF_LOG("GS write 64 at %8.8lx with data %8.8lx_%8.8lx", mem, ((u32*)&value)[1], (u32)value); - - switch (mem) - { - case 0x12000010: // GS_SMODE1 - gsSetVideoRegionType( (value & 0x6000) == 0x6000 ); - break; - - case 0x12000020: // GS_SMODE2 - if(value & 0x1) Config.PsxType |= 2; // Interlaced - else Config.PsxType &= ~2; // Non-Interlaced - break; - - case 0x12001000: // GS_CSR - gsCSRwrite((u32)value); - return; - - case 0x12001010: // GS_IMR - IMRwrite((u32)value); - return; - } - - *(u64*)PS2GS_BASE(mem) = value; - - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket(GS_RINGTYPE_MEMWRITE64, mem&0x13ff, (u32)value, (u32)(value>>32)); -} -#endif - __forceinline u8 gsRead8(u32 mem) { GIF_LOG("GS read 8 from %8.8lx value: %8.8lx", mem, *(u8*)PS2GS_BASE(mem)); @@ -604,20 +511,12 @@ void gsSyncLimiterLostTime( s32 deltaTime ) //Console::WriteLn("LostTime on the EE!"); - if( mtgsThread != NULL ) - { - mtgsThread->SendSimplePacket( - GS_RINGTYPE_STARTTIME, - deltaTime, - 0, - 0 - ); - } - else - { - m_iSlowStart += deltaTime; - //m_justSkipped = false; - } + mtgsThread->SendSimplePacket( + GS_RINGTYPE_STARTTIME, + deltaTime, + 0, + 0 + ); } // FrameSkipper - Measures delta time between calls and issues frameskips @@ -755,19 +654,7 @@ __forceinline void gsFrameSkip( bool forceskip ) void gsPostVsyncEnd( bool updategs ) { *(u32*)(PS2MEM_GS+0x1000) ^= 0x2000; // swap the vsync field - - if( mtgsThread != NULL ) - mtgsThread->PostVsyncEnd( updategs ); - else - { - GSvsync((*(u32*)(PS2MEM_GS+0x1000)&0x2000)); - - // update here on single thread mode *OBSOLETE* - if( PAD1update != NULL ) PAD1update(0); - if( PAD2update != NULL ) PAD2update(1); - - gsFrameSkip( !updategs ); - } + mtgsThread->PostVsyncEnd( updategs ); } void _gs_ResetFrameskip() @@ -778,10 +665,7 @@ void _gs_ResetFrameskip() // Disables the GS Frameskip at runtime without any racy mess... void gsResetFrameSkip() { - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0); - else - _gs_ResetFrameskip(); + mtgsThread->SendSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0); } void gsDynamicSkipEnable() diff --git a/pcsx2/GS.h b/pcsx2/GS.h index a591767146..0d185f99a5 100644 --- a/pcsx2/GS.h +++ b/pcsx2/GS.h @@ -368,9 +368,4 @@ extern gzSavingState* g_fGSSave; void RunGSState(gzLoadingState& f); -extern void GSGIFTRANSFER1(u32 *pMem, u32 addr); -extern void GSGIFTRANSFER2(u32 *pMem, u32 addr); -extern void GSGIFTRANSFER3(u32 *pMem, u32 addr); -extern void GSVSYNC(); - #endif diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index fb29f830b5..a61aa8b38b 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -111,33 +111,23 @@ static u32 WRITERING_DMA(u32 *pMem, u32 qwc) { psHu32(GIF_STAT) |= GIF_STAT_APATH3 | GIF_STAT_OPH; - if( mtgsThread != NULL ) - { - int sizetoread = qwc; - sizetoread = mtgsThread->PrepDataPacket( GIF_PATH_3, pMem, qwc ); - u8* pgsmem = mtgsThread->GetDataPacketPtr(); + int sizetoread = qwc; + sizetoread = mtgsThread->PrepDataPacket( GIF_PATH_3, pMem, qwc ); + u8* pgsmem = mtgsThread->GetDataPacketPtr(); - /* check if page of endmem is valid (dark cloud2) */ - // fixme: this hack makes no sense, because the giftagDummy will - // process the full length of bytes regardess of how much we copy. - // So you'd think if we're truncating the copy to prevent DEPs, we - // should truncate the gif packet size too.. (air) + /* check if page of endmem is valid (dark cloud2) */ + // fixme: this hack makes no sense, because the giftagDummy will + // process the full length of bytes regardess of how much we copy. + // So you'd think if we're truncating the copy to prevent DEPs, we + // should truncate the gif packet size too.. (air) - // fixed? PrepDataPacket now returns the actual size of the packet. - // VIF handles scratchpad wrapping also, so this code shouldn't be needed anymore. + // fixed? PrepDataPacket now returns the actual size of the packet. + // VIF handles scratchpad wrapping also, so this code shouldn't be needed anymore. - memcpy_aligned(pgsmem, pMem, sizetoread<<4); - - mtgsThread->SendDataPacket(); - return sizetoread; - } - else - { - GSGIFTRANSFER3(pMem, qwc); - gif->madr+= qwc*16; - gif->qwc -= qwc; - return qwc; - } + memcpy_aligned(pgsmem, pMem, sizetoread<<4); + + mtgsThread->SendDataPacket(); + return sizetoread; } int _GIFchain() diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 6820eb5610..56f6dc293f 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -113,21 +113,7 @@ static void _mtgsFreezeGIF( SaveState& state, GIFPath (&paths)[3] ) void SaveState::mtgsFreeze() { FreezeTag( "mtgs" ); - - if( mtgsThread != NULL ) - { - mtgsThread->Freeze( *this ); - } - else - { - // save some zero'd dummy info... - // This isn't ideal, and it could lead to problems in very rare - // circumstances, but most of the time should be perfectly fine. - - GIFPath path[3]; - memzero_obj( path ); - _mtgsFreezeGIF( *this, path ); - } + mtgsThread->Freeze( *this ); } @@ -220,7 +206,7 @@ void mtgsThreadObject::Start() { Thread::Start(); - // Wait for the thread to finish initialization (it runs GSinit, which can take + // Wait for the thread to finish initialization (it runs GSopen, which can take // some time since it's creating a new window and all), and then check for errors. m_post_InitDone.Wait(); @@ -231,6 +217,7 @@ void mtgsThreadObject::Start() mtgsThreadObject::~mtgsThreadObject() { + Close(); } void mtgsThreadObject::Close() @@ -525,8 +512,7 @@ int mtgsThreadObject::Callback() #else //tells GSdx to go into dx9 sw if "renderswitch" is set. Abusing the isMultiThread int //for that so we don't need a new callback - if (!renderswitch) m_returncode = GSopen((void *)&pDsp, "PCSX2", 1); - else if (renderswitch) m_returncode = GSopen((void *)&pDsp, "PCSX2", 2); + m_returncode = GSopen((void *)&pDsp, "PCSX2", renderswitch ? 2 : 1); #endif Console::WriteLn( "MTGS > GSopen Finished, return code: 0x%x", params m_returncode ); @@ -620,8 +606,11 @@ int mtgsThreadObject::Callback() //Console::Status( " << Frame Removed!" ); m_lock_FrameQueueCounter.Unlock(); - if( PAD1update != NULL ) PAD1update(0); - if( PAD2update != NULL ) PAD2update(1); + if( PADupdate != NULL ) + { + PADupdate(0); + PADupdate(1); + } } break; @@ -646,7 +635,7 @@ int mtgsThreadObject::Callback() { freezeData* data = (freezeData*)(*(uptr*)&tag.data[1]); int mode = tag.data[0]; - GSfreeze( mode, data ); + g_plugins->Freeze( PluginId_GS, mode, data ); break; } @@ -684,7 +673,7 @@ int mtgsThreadObject::Callback() break; case GS_RINGTYPE_QUIT: - GSclose(); + g_plugins->Close( PluginId_GS ); return 0; #ifdef PCSX2_DEVBUILD @@ -1099,9 +1088,6 @@ void mtgsWaitGS() bool mtgsOpen() { - // Check the config flag since our thread object has yet to be created - if( !CHECK_MULTIGS ) return false; - // better not be a thread already running, yo! assert( mtgsThread == NULL ); diff --git a/pcsx2/Misc.cpp b/pcsx2/Misc.cpp index 243605abcb..e48a8c003a 100644 --- a/pcsx2/Misc.cpp +++ b/pcsx2/Misc.cpp @@ -360,7 +360,7 @@ void LoadGSState(const wxString& file) throw Exception::PluginFailure( "GS" ); } - ret = PAD1open((void *)&pDsp); + ret = PADopen((void *)&pDsp); f->Freeze(g_nLeftGSFrames); f->gsFreeze(); @@ -371,8 +371,8 @@ void LoadGSState(const wxString& file) delete( f ); - GSclose(); - PAD1close(); + g_plugins->Close( PluginId_GS ); + g_plugins->Close( PluginId_PAD ); } #endif @@ -544,25 +544,14 @@ void ProcessFKeys(int fkey, struct KeyModifiers *keymod) break; case 9: //gsdx "on the fly" renderer switching - if (!renderswitch) - { - StateRecovery::MakeGsOnly(); - g_EmulationInProgress = false; - CloseGS(); - renderswitch = true; //go to dx9 sw - StateRecovery::Recover(); - HostGui::BeginExecution(); //also sets g_EmulationInProgress to true later - } - else - { - StateRecovery::MakeGsOnly(); - g_EmulationInProgress = false; - CloseGS(); - renderswitch = false; //return to default renderer - StateRecovery::Recover(); - HostGui::BeginExecution(); //also sets g_EmulationInProgress to true later - } + StateRecovery::MakeGsOnly(); + g_EmulationInProgress = false; + CloseGS(); + renderswitch = !renderswitch; + StateRecovery::Recover(); + HostGui::BeginExecution(); // also sets g_EmulationInProgress to true later break; + #ifdef PCSX2_DEVBUILD case 10: // There's likely a better way to implement this, but this seemed useful. @@ -576,38 +565,35 @@ void ProcessFKeys(int fkey, struct KeyModifiers *keymod) GSprintf(10,"Logging Disabled."); break; + case 11: - if( mtgsThread != NULL ) + Console::Notice( "Cannot make gsstates in MTGS mode" ); + + // fixme : fix up gsstate mess and make it mtgs compatible -- air +#ifdef _STGS_GSSTATE_CODE + wxString Text; + if( strgametitle[0] != 0 ) { - Console::Notice( "Cannot make gsstates in MTGS mode" ); + // only take the first two words + wxString gsText; + + wxStringTokenizer parts( strgametitle, L" " ); + + wxString name( parts.GetNextToken() ); // first part + wxString part2( parts.GetNextToken() ); + + if( !!part2 ) + name += L"_" + part2; + + gsText.Printf( L"%s.%d.gs", name.c_str(), StatesC ); + Text = Path::Combine( g_Conf->Folders.Savestates, gsText ); } else { - wxString Text; - if( strgametitle[0] != 0 ) - { - // only take the first two words - wxString gsText; - - wxStringTokenizer parts( strgametitle, L" " ); - - wxString name( parts.GetNextToken() ); // first part - wxString part2( parts.GetNextToken() ); - - if( !!part2 ) - name += L"_" + part2; - - gsText.Printf( L"%s.%d.gs", name.c_str(), StatesC ); - Text = Path::Combine( g_Conf->Folders.Savestates, gsText ); - } - else - { - Text = GetGSStateFilename(); - } - - SaveGSState(Text); + Text = GetGSStateFilename(); } break; +#endif #endif case 12: @@ -622,11 +608,7 @@ void ProcessFKeys(int fkey, struct KeyModifiers *keymod) { g_Pcsx2Recording ^= 1; - if( mtgsThread != NULL ) - mtgsThread->SendSimplePacket(GS_RINGTYPE_RECORD, g_Pcsx2Recording, 0, 0); - else if( GSsetupRecording != NULL ) - GSsetupRecording(g_Pcsx2Recording, NULL); - + mtgsThread->SendSimplePacket(GS_RINGTYPE_RECORD, g_Pcsx2Recording, 0, 0); if( SPU2setupRecording != NULL ) SPU2setupRecording(g_Pcsx2Recording, NULL); } break; diff --git a/pcsx2/Plugins.cpp b/pcsx2/Plugins.cpp index 00e5f4abf9..a080325938 100644 --- a/pcsx2/Plugins.cpp +++ b/pcsx2/Plugins.cpp @@ -19,7 +19,6 @@ #include "PrecompiledHeader.h" #include "Utilities/RedtapeWindows.h" -#include #include #include @@ -47,6 +46,7 @@ const PluginInfo tbl_PluginInfo[] = }; typedef void CALLBACK VoidMethod(); +typedef void CALLBACK vMeth(); // shorthand for VoidMethod ; // extra semicolon fixes VA-X intellisense breakage caused by CALLBACK in the above typedef >_< // ---------------------------------------------------------------------------- @@ -59,7 +59,7 @@ struct LegacyApi_CommonMethod VoidMethod* Fallback; // returns the method name as a wxString, converted from UTF8. - wxString& GetMethodName( PluginsEnum_t pid ) const + wxString GetMethodName( PluginsEnum_t pid ) const { return wxString::FromUTF8( tbl_PluginInfo[pid].shortname) + wxString::FromUTF8( MethodName ); } @@ -76,7 +76,7 @@ struct LegacyApi_ReqMethod VoidMethod* Fallback; // returns the method name as a wxString, converted from UTF8. - wxString& GetMethodName( ) const + wxString GetMethodName( ) const { return wxString::FromUTF8( MethodName ); } @@ -89,7 +89,7 @@ struct LegacyApi_OptMethod VoidMethod** Dest; // Target function where the binding is saved. // returns the method name as a wxString, converted from UTF8. - wxString& GetMethodName() const { return wxString::FromUTF8( MethodName ); } + wxString GetMethodName() const { return wxString::FromUTF8( MethodName ); } }; @@ -104,7 +104,6 @@ _GSopen GSopen; _GSgifTransfer1 GSgifTransfer1; _GSgifTransfer2 GSgifTransfer2; _GSgifTransfer3 GSgifTransfer3; -_GSgetLastTag GSgetLastTag; _GSgifSoftReset GSgifSoftReset; _GSreadFIFO GSreadFIFO; _GSreadFIFO2 GSreadFIFO2; @@ -120,10 +119,6 @@ _GSsetFrameLimit GSsetFrameLimit; _GSsetupRecording GSsetupRecording; _GSreset GSreset; _GSwriteCSR GSwriteCSR; -_GSgetDriverInfo GSgetDriverInfo; -#ifdef _WINDOWS_ -_GSsetWindowInfo GSsetWindowInfo; -#endif static void CALLBACK GS_makeSnapshot(const char *path) {} static void CALLBACK GS_irqCallback(void (*callback)()) {} @@ -146,10 +141,11 @@ _PADpoll PADpoll; _PADquery PADquery; _PADupdate PADupdate; _PADkeyEvent PADkeyEvent; -_PADgsDriverInfo PADgsDriverInfo; _PADsetSlot PADsetSlot; _PADqueryMtap PADqueryMtap; +void PAD_update( u32 padslot ) { } + // SIO[2] /* _SIOinit SIOinit[2][9]; @@ -183,9 +179,6 @@ _SPU2irqCallback SPU2irqCallback; _SPU2setClockPtr SPU2setClockPtr; _SPU2async SPU2async; -// CDVD -CDVDplugin CDVD_plugin = {0}; -CDVDplugin CDVD = {0}; // DEV9 _DEV9open DEV9open; @@ -201,7 +194,7 @@ _DEV9irqCallback DEV9irqCallback; _DEV9irqHandler DEV9irqHandler; // USB -_USBopen USB9open; +_USBopen USBopen; _USBread8 USBread8; _USBread16 USBread16; _USBread32 USBread32; @@ -215,7 +208,7 @@ _USBirqHandler USBirqHandler; _USBsetRAM USBsetRAM; // FW -_FW9open FW9open; +_FWopen FWopen; _FWread32 FWread32; _FWwrite32 FWwrite32; _FWirqCallback FWirqCallback; @@ -234,8 +227,8 @@ static const LegacyApi_CommonMethod s_MethMessCommon[] = { "close", NULL }, { "shutdown", NULL }, - { "freeze", (VoidMethod*)fallback_freeze }, - { "test", (VoidMethod*)fallback_test }, + { "freeze", (vMeth*)fallback_freeze }, + { "test", (vMeth*)fallback_test }, { "configure", fallback_configure }, { "about", fallback_about }, @@ -248,77 +241,307 @@ static const LegacyApi_CommonMethod s_MethMessCommon[] = // ---------------------------------------------------------------------------- static const LegacyApi_ReqMethod s_MethMessReq_GS[] = { - { "GSvsync", (VoidMethod**)&GSinit, NULL }, - { "GSvsync", (VoidMethod**)&GSvsync, NULL }, - { "GSgifTransfer1", (VoidMethod**)&GSgifTransfer1, NULL }, - { "GSgifTransfer2", (VoidMethod**)&GSgifTransfer2, NULL }, - { "GSgifTransfer3", (VoidMethod**)&GSgifTransfer3, NULL }, - { "GSreadFIFO2", (VoidMethod**)&GSreadFIFO2, NULL }, + { "GSopen", (vMeth**)&GSopen, NULL }, + { "GSvsync", (vMeth**)&GSvsync, NULL }, + { "GSgifTransfer1", (vMeth**)&GSgifTransfer1, NULL }, + { "GSgifTransfer2", (vMeth**)&GSgifTransfer2, NULL }, + { "GSgifTransfer3", (vMeth**)&GSgifTransfer3, NULL }, + { "GSreadFIFO2", (vMeth**)&GSreadFIFO2, NULL }, - { "GSmakeSnapshot", (VoidMethod**)&GSmakeSnapshot, (VoidMethod*)GS_makeSnapshot }, - { "GSirqCallback", (VoidMethod**)&GSirqCallback, (VoidMethod*)GS_irqCallback }, - { "GSprintf", (VoidMethod**)&GSprintf, (VoidMethod*)GS_printf }, - { "GSsetBaseMem", (VoidMethod**)&GSsetBaseMem, NULL }, - { "GSwriteCSR", (VoidMethod**)&GSwriteCSR, NULL }, + { "GSmakeSnapshot", (vMeth**)&GSmakeSnapshot, (vMeth*)GS_makeSnapshot }, + { "GSirqCallback", (vMeth**)&GSirqCallback, (vMeth*)GS_irqCallback }, + { "GSprintf", (vMeth**)&GSprintf, (vMeth*)GS_printf }, + { "GSsetBaseMem", (vMeth**)&GSsetBaseMem, NULL }, + { "GSwriteCSR", (vMeth**)&GSwriteCSR, NULL }, { NULL } }; static const LegacyApi_OptMethod s_MethMessOpt_GS[] = { - { "GSgetDriverInfo" }, - { "GSreset" }, - { "GSsetupRecording" }, - { "GSsetGameCRC" }, - { "GSsetFrameSkip" }, - { "GSsetFrameLimit" }, - { "GSchangeSaveState" }, - { "GSmakeSnapshot2" }, - #ifdef _WINDOWS_ - { "GSsetWindowInfo" }, - #endif - { "GSgetLastTag" }, - { "GSgifSoftReset" }, - { "GSreadFIFO" }, + { "GSreset", (vMeth**)&GSreset }, + { "GSsetupRecording", (vMeth**)&GSsetupRecording }, + { "GSsetGameCRC", (vMeth**)&GSsetGameCRC }, + { "GSsetFrameSkip", (vMeth**)&GSsetFrameSkip }, + { "GSsetFrameLimit", (vMeth**)&GSsetFrameLimit }, + { "GSchangeSaveState",(vMeth**)&GSchangeSaveState }, + { "GSmakeSnapshot2", (vMeth**)&GSmakeSnapshot2 }, + { "GSgifSoftReset", (vMeth**)&GSgifSoftReset }, + { "GSreadFIFO", (vMeth**)&GSreadFIFO }, + { NULL } +}; + +// ---------------------------------------------------------------------------- +// PAD Mess! +// ---------------------------------------------------------------------------- +static const LegacyApi_ReqMethod s_MethMessReq_PAD[] = +{ + { "PADopen", (vMeth**)&PADopen, NULL }, + { "PADstartPoll", (vMeth**)&PADstartPoll, NULL }, + { "PADpoll", (vMeth**)&PADpoll, NULL }, + { "PADquery", (vMeth**)&PADquery, NULL }, + { "PADkeyEvent", (vMeth**)&PADkeyEvent, NULL }, + + // fixme - Following functions are new as of some revison post-0.9.6, and + // are for multitap support only. They should either be optional or offer + // NOP fallbacks, to allow older plugins to retain functionality. + { "PADsetSlot", (vMeth**)&PADsetSlot, NULL }, + { "PADqueryMtap", (vMeth**)&PADqueryMtap, NULL }, + { NULL }, +}; + +static const LegacyApi_OptMethod s_MethMessOpt_PAD[] = +{ + { "PADupdate", (vMeth**)&PADupdate }, + { NULL }, +}; + +// ---------------------------------------------------------------------------- +// CDVD Mess! +// ---------------------------------------------------------------------------- +void CALLBACK CDVD_newDiskCB(void (*callback)()) {} + +extern int lastReadSize; +s32 CALLBACK CDVD_getBuffer2(u8* buffer) +{ + int ret; + + // TEMP: until I fix all the plugins to use this function style + u8* pb = CDVD->getBuffer(); + if(pb != NULL) + { + memcpy(buffer,pb,lastReadSize); + ret = 0; + } + else ret = -2; + + return ret; +} + + +s32 CALLBACK CDVD_readSector(u8* buffer, u32 lsn, int mode) +{ + if(CDVD->readTrack(lsn,mode) < 0) + return -1; + + // TEMP: until all the plugins use the new CDVDgetBuffer style + switch (mode) + { + case CDVD_MODE_2352: + lastReadSize = 2352; + break; + case CDVD_MODE_2340: + lastReadSize = 2340; + break; + case CDVD_MODE_2328: + lastReadSize = 2328; + break; + case CDVD_MODE_2048: + lastReadSize = 2048; + break; + } + return CDVD->getBuffer2(buffer); +} + +s32 CALLBACK CDVD_getDualInfo(s32* dualType, u32* layer1Start) +{ + u8 toc[2064]; + + // if error getting toc, settle for single layer disc ;) + if(CDVD->getTOC(toc)) + return 0; + + if(toc[14] & 0x60) + { + if(toc[14] & 0x10) + { + // otp dvd + *dualType = 2; + *layer1Start = (toc[25]<<16) + (toc[26]<<8) + (toc[27]) - 0x30000 + 1; + } + else + { + // ptp dvd + *dualType = 1; + *layer1Start = (toc[21]<<16) + (toc[22]<<8) + (toc[23]) - 0x30000 + 1; + } + } + else + { + // single layer dvd + *dualType = 0; + *layer1Start = (toc[21]<<16) + (toc[22]<<8) + (toc[23]) - 0x30000 + 1; + } + + return 1; +} + +static void CALLBACK CDVDplugin_Close() +{ + g_plugins->Close( PluginId_CDVD ); +} + +CDVD_API CDVDapi_Plugin= +{ + { + CDVDplugin_Close + }, + + // The rest are filled in by the plugin manager + NULL +}; +CDVD_API* CDVD = NULL; + +static const LegacyApi_ReqMethod s_MethMessReq_CDVD[] = +{ + { "CDVDopen", (vMeth**)&CDVDapi_Plugin.open, NULL }, + { "CDVDreadTrack", (vMeth**)&CDVDapi_Plugin.readTrack, NULL }, + { "CDVDgetBuffer", (vMeth**)&CDVDapi_Plugin.getBuffer, NULL }, + { "CDVDreadSubQ", (vMeth**)&CDVDapi_Plugin.readSubQ, NULL }, + { "CDVDgetTN", (vMeth**)&CDVDapi_Plugin.getTN, NULL }, + { "CDVDgetTD", (vMeth**)&CDVDapi_Plugin.getTD, NULL }, + { "CDVDgetTOC", (vMeth**)&CDVDapi_Plugin.getTOC, NULL }, + { "CDVDgetDiskType", (vMeth**)&CDVDapi_Plugin.getDiskType, NULL }, + { "CDVDgetTrayStatus",(vMeth**)&CDVDapi_Plugin.getTrayStatus, NULL }, + { "CDVDctrlTrayOpen", (vMeth**)&CDVDapi_Plugin.ctrlTrayOpen, NULL }, + { "CDVDctrlTrayClose",(vMeth**)&CDVDapi_Plugin.ctrlTrayClose, NULL }, + { "CDVDnewDiskCB", (vMeth**)&CDVDapi_Plugin.newDiskCB, (vMeth*)CDVD_newDiskCB }, + + { "CDVDreadSector", (vMeth**)&CDVDapi_Plugin.readSector, (vMeth*)CDVD_readSector }, + { "CDVDgetBuffer2", (vMeth**)&CDVDapi_Plugin.getBuffer2, (vMeth*)CDVD_getBuffer2 }, + { "CDVDgetDualInfo", (vMeth**)&CDVDapi_Plugin.getDualInfo, (vMeth*)CDVD_getDualInfo }, + + { NULL } +}; + +static const LegacyApi_OptMethod s_MethMessOpt_CDVD[] = +{ + { NULL } +}; + +// ---------------------------------------------------------------------------- +// SPU2 Mess! +// ---------------------------------------------------------------------------- +static const LegacyApi_ReqMethod s_MethMessReq_SPU2[] = +{ + { "SPU2open", (vMeth**)SPU2open, NULL }, + { "SPU2write", (vMeth**)SPU2write, NULL }, + { "SPU2read", (vMeth**)SPU2read, NULL }, + { "SPU2readDMA4Mem", (vMeth**)SPU2readDMA4Mem, NULL }, + { "SPU2readDMA7Mem", (vMeth**)SPU2readDMA7Mem, NULL }, + { "SPU2writeDMA4Mem", (vMeth**)SPU2writeDMA4Mem, NULL }, + { "SPU2writeDMA7Mem", (vMeth**)SPU2writeDMA7Mem, NULL }, + { "SPU2interruptDMA4", (vMeth**)SPU2interruptDMA4, NULL }, + { "SPU2interruptDMA7", (vMeth**)SPU2interruptDMA7, NULL }, + { "SPU2setDMABaseAddr", (vMeth**)SPU2setDMABaseAddr,NULL }, + { "SPU2ReadMemAddr", (vMeth**)SPU2ReadMemAddr, NULL }, + { "SPU2irqCallback", (vMeth**)SPU2irqCallback, NULL }, + + { NULL } +}; + +static const LegacyApi_OptMethod s_MethMessOpt_SPU2[] = +{ + { "SPU2setClockPtr", (vMeth**)SPU2setClockPtr }, + { "SPU2async", (vMeth**)SPU2async }, + { "SPU2WriteMemAddr", (vMeth**)SPU2WriteMemAddr }, + { "SPU2setupRecording", (vMeth**)SPU2setupRecording }, + + { NULL } +}; + +// ---------------------------------------------------------------------------- +// DEV9 Mess! +// ---------------------------------------------------------------------------- +static const LegacyApi_ReqMethod s_MethMessReq_DEV9[] = +{ + { "DEV9open", (vMeth**)&DEV9open, NULL }, + { "DEV9read8", (vMeth**)&DEV9read8, NULL }, + { "DEV9read16", (vMeth**)&DEV9read16, NULL }, + { "DEV9read32", (vMeth**)&DEV9read32, NULL }, + { "DEV9write8", (vMeth**)&DEV9write8, NULL }, + { "DEV9write16", (vMeth**)&DEV9write16, NULL }, + { "DEV9write32", (vMeth**)&DEV9write32, NULL }, + { "DEV9readDMA8Mem", (vMeth**)&DEV9readDMA8Mem, NULL }, + { "DEV9writeDMA8Mem", (vMeth**)&DEV9writeDMA8Mem, NULL }, + { "DEV9irqCallback", (vMeth**)&DEV9irqCallback, NULL }, + { "DEV9irqHandler", (vMeth**)&DEV9irqHandler, NULL }, + + { NULL } +}; + +static const LegacyApi_OptMethod s_MethMessOpt_DEV9[] = +{ + { NULL } +}; + +// ---------------------------------------------------------------------------- +// USB Mess! +// ---------------------------------------------------------------------------- +static const LegacyApi_ReqMethod s_MethMessReq_USB[] = +{ + { "USBopen", (vMeth**)&USBopen, NULL }, + { "USBread8", (vMeth**)&USBread8, NULL }, + { "USBread16", (vMeth**)&USBread16, NULL }, + { "USBread32", (vMeth**)&USBread32, NULL }, + { "USBwrite8", (vMeth**)&USBwrite8, NULL }, + { "USBwrite16", (vMeth**)&USBwrite16, NULL }, + { "USBwrite32", (vMeth**)&USBwrite32, NULL }, + { "USBirqCallback", (vMeth**)&USBirqCallback, NULL }, + { "USBirqHandler", (vMeth**)&USBirqHandler, NULL }, +}; + +static const LegacyApi_OptMethod s_MethMessOpt_USB[] = +{ + { "USBasync", (vMeth**)&USBasync }, + { NULL } +}; + +// ---------------------------------------------------------------------------- +// FW Mess! +// ---------------------------------------------------------------------------- +static const LegacyApi_ReqMethod s_MethMessReq_FW[] = +{ + { "FWopen", (vMeth**)&FWopen, NULL }, + { "FWread32", (vMeth**)&FWread32, NULL }, + { "FWwrite32", (vMeth**)&FWwrite32, NULL }, + { "FWirqCallback", (vMeth**)&FWirqCallback, NULL }, +}; + +static const LegacyApi_OptMethod s_MethMessOpt_FW[] = +{ { NULL } }; static const LegacyApi_ReqMethod* const s_MethMessReq[] = { + s_MethMessReq_CDVD, s_MethMessReq_GS, + s_MethMessReq_PAD, + s_MethMessReq_SPU2, + s_MethMessReq_USB, + s_MethMessReq_FW, + s_MethMessReq_DEV9 }; static const LegacyApi_OptMethod* const s_MethMessOpt[] = { - s_MethMessOpt_GS + s_MethMessOpt_CDVD, + s_MethMessOpt_GS, + s_MethMessOpt_PAD, + s_MethMessOpt_SPU2, + s_MethMessOpt_USB, + s_MethMessOpt_FW, + s_MethMessOpt_DEV9 }; -////////////////////////////////////////////////////////////////////////////////////////// -// -class PluginManager -{ -protected: - bool m_initialized; - bool m_loaded; +PluginManager *g_plugins = NULL; - LegacyPluginAPI_Common m_CommonBindings[PluginId_Count]; - wxDynamicLibrary m_libs[PluginId_Count]; +Exception::NotPcsxPlugin::NotPcsxPlugin( const wxString& objname ) : + Stream( objname, wxLt("File is not a PCSX2 plugin") ) {} -public: - ~PluginManager(); - PluginManager() : - m_initialized( false ) - , m_loaded( false ) - { - } +Exception::NotPcsxPlugin::NotPcsxPlugin( const PluginsEnum_t& pid ) : + Stream( wxString::FromUTF8( tbl_PluginInfo[pid].shortname ), wxLt("File is not a PCSX2 plugin") ) {} - void LoadPlugins(); - void UnloadPlugins(); - -protected: - void BindCommon( PluginsEnum_t pid ); - void BindRequired( PluginsEnum_t pid ); - void BindOptional( PluginsEnum_t pid ); -}; void PluginManager::BindCommon( PluginsEnum_t pid ) { @@ -403,6 +626,76 @@ void PluginManager::LoadPlugins() } } +void PluginManager::Open( PluginsEnum_t pid ) +{ + // Each Open needs to be called explicitly. >_< +} + +void PluginManager::Close( PluginsEnum_t pid ) +{ + if( m_IsOpened[pid] ) + { + m_IsOpened[pid] = false; + m_CommonBindings[pid].Close(); + } +} + +void PluginManager::Init( PluginsEnum_t pid ) +{ + if( !m_IsInitialized[pid] ) + { + m_IsInitialized[pid] = true; + m_CommonBindings[pid].Init(); + } +} + +void PluginManager::Shutdown( PluginsEnum_t pid ) +{ + if( m_IsInitialized[pid] ) + { + m_IsInitialized[pid] = false; + m_CommonBindings[pid].Shutdown(); + } +} + +void PluginManager::Freeze( PluginsEnum_t pid, int mode, freezeData* data ) +{ + m_CommonBindings[pid].Freeze( mode, data ); +} + +// ---------------------------------------------------------------------------- +// Thread Safety: +// This function should only be called by the Main GUI thread and the GS thread (for GS states only), +// as it has special handlers to ensure that GS freeze commands are executed appropriately on the +// GS thread. +// +void PluginManager::Freeze( PluginsEnum_t pid, SaveState& state ) +{ + if( pid == PluginId_GS && wxThread::IsMain() ) + { + // Need to send the GS freeze request on the GS thread. + } + else + { + state.FreezePlugin( tbl_PluginInfo[pid].shortname, m_CommonBindings[pid].Freeze ); + } +} + +// ---------------------------------------------------------------------------- +// This overload of Freeze performs savestate freeze operation on *all* plugins, +// as according to the order in PluignsEnum_t. +// +// Thread Safety: +// This function should only be called by the Main GUI thread and the GS thread (for GS states only), +// as it has special handlers to ensure that GS freeze commands are executed appropriately on the +// GS thread. +// +void PluginManager::Freeze( SaveState& state ) +{ + for( int i=0; iinitCount = &cdvdInitCount; cdvdInitCount=0; return 0; @@ -1096,7 +1309,7 @@ bool OpenCDVD(const char* pTitleFilename) if (!OpenStatus.CDVD && !only_loading_elf) { //First, we need the data. - CDVD.newDiskCB(cdvdNewDiskCB); + CDVD->newDiskCB(cdvdNewDiskCB); if (DoCDVDopen(pTitleFilename) != 0) { diff --git a/pcsx2/Plugins.h b/pcsx2/Plugins.h index 6e63be976b..54efe73b1d 100644 --- a/pcsx2/Plugins.h +++ b/pcsx2/Plugins.h @@ -23,6 +23,8 @@ #define PLUGINfuncs #include "PS2Edefs.h" +#include + struct PluginInfo { const char* shortname; @@ -31,19 +33,14 @@ struct PluginInfo int version; // minimum version required / supported }; -extern const PluginInfo tbl_PluginInfo[]; - namespace Exception { class NotPcsxPlugin : public Stream { public: virtual ~NotPcsxPlugin() throw() {} - explicit NotPcsxPlugin( const wxString& objname ) : - Stream( objname, wxLt("File is not a PCSX2 plugin") ) {} - - explicit NotPcsxPlugin( const PluginsEnum_t& pid ) : - Stream( wxString::FromUTF8( tbl_PluginInfo[pid].shortname ), wxLt("File is not a PCSX2 plugin") ) {} + explicit NotPcsxPlugin( const wxString& objname ); + explicit NotPcsxPlugin( const PluginsEnum_t& pid ); }; }; @@ -65,6 +62,54 @@ struct LegacyPluginAPI_Common void (CALLBACK* About)(); }; +class SaveState; + +////////////////////////////////////////////////////////////////////////////////////////// +// +class PluginManager +{ +protected: + bool m_initialized; + bool m_loaded; + + bool m_IsInitialized[PluginId_Count]; + bool m_IsOpened[PluginId_Count]; + + LegacyPluginAPI_Common m_CommonBindings[PluginId_Count]; + wxDynamicLibrary m_libs[PluginId_Count]; + +public: + ~PluginManager(); + PluginManager() : + m_initialized( false ) + , m_loaded( false ) + { + memzero_obj( m_IsInitialized ); + memzero_obj( m_IsOpened ); + } + + void LoadPlugins(); + void UnloadPlugins(); + + void Init( PluginsEnum_t pid ); + void Shutdown( PluginsEnum_t pid ); + void Open( PluginsEnum_t pid ); + void Close( PluginsEnum_t pid ); + + void Freeze( PluginsEnum_t pid, int mode, freezeData* data ); + void Freeze( PluginsEnum_t pid, SaveState& state ); + void Freeze( SaveState& state ); + +protected: + void BindCommon( PluginsEnum_t pid ); + void BindRequired( PluginsEnum_t pid ); + void BindOptional( PluginsEnum_t pid ); +}; + +extern const PluginInfo tbl_PluginInfo[]; +extern PluginManager* g_plugins; + + void LoadPlugins(); void ReleasePlugins(); diff --git a/pcsx2/RecoverySystem.cpp b/pcsx2/RecoverySystem.cpp index 1a23e99965..0a87479df4 100644 --- a/pcsx2/RecoverySystem.cpp +++ b/pcsx2/RecoverySystem.cpp @@ -77,11 +77,10 @@ namespace StateRecovery { return g_RecoveryState != NULL || g_gsRecoveryState != NULL; } - // Exceptions: void Recover() { // Just in case they weren't initialized earlier (no harm in calling this multiple times) - if( OpenPlugins(NULL) == -1 ) return; + OpenPlugins(NULL); if( g_RecoveryState != NULL ) { diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index e089ee4210..e4d46ca32e 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -63,21 +63,10 @@ SaveState::SaveState( const char* msg, const wxString& destination ) : s32 CALLBACK gsSafeFreeze( int mode, freezeData *data ) { - if( mtgsThread != NULL ) - { - if( mode == 2 ) - return GSfreeze( 2, data ); - - // have to call in thread, otherwise weird stuff will start happening - mtgsThread->SendPointerPacket( GS_RINGTYPE_FREEZE, mode, data ); - mtgsWaitGS(); - return 0; - } - else - { - // Single threaded... - return GSfreeze( mode, data ); - } + // have to call in the GS thread, otherwise weird stuff will start happening + mtgsThread->SendPointerPacket( GS_RINGTYPE_FREEZE, mode, data ); + mtgsWaitGS(); + return 0; } void SaveState::FreezeTag( const char* src ) @@ -174,11 +163,8 @@ void SaveState::FreezeAll() // Sixth Block - Plugins Galore! // ----------------------------- FreezePlugin( "GS", gsSafeFreeze ); - FreezePlugin( "SPU2", SPU2freeze ); - FreezePlugin( "DEV9", DEV9freeze ); - FreezePlugin( "USB", USBfreeze ); - FreezePlugin( "PAD1", PAD1freeze ); - FreezePlugin( "PAD2", PAD2freeze ); + + g_plugins->Freeze( *this ); if( IsLoading() ) PostLoadPrep(); diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index d944ebd299..ab97a34efb 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -50,11 +50,7 @@ __forceinline void SIO_INT() // Could lets PCSX2 have its own options, if anyone ever // wants to add support for using the extra memcard slots. static bool IsMtapPresent( uint port ) { - switch(port) { - case 0: return 0 != PAD1queryMtap(port+1); - case 1: return 0 != PAD2queryMtap(port+1); - } - return 0; + return 0 != PADqueryMtap(port+1); } static void _ReadMcd(u8 *data, u32 adr, int size) { @@ -126,11 +122,11 @@ void SIO_CommandWrite(u8 value,int way) { switch (sio.CtrlReg&0x2002) { case 0x0002: sio.packetsize ++; // Total packet size sent - sio.buf[sio.parp] = PAD1poll(value); + sio.buf[sio.parp] = PADpoll(value); break; case 0x2002: sio.packetsize ++; // Total packet size sent - sio.buf[sio.parp] = PAD2poll(value); + sio.buf[sio.parp] = PADpoll(value); break; } if (!(sio.buf[sio.parp] & 0x0f)) { @@ -144,8 +140,8 @@ void SIO_CommandWrite(u8 value,int way) { case 2: sio.parp++; switch (sio.CtrlReg&0x2002) { - case 0x0002: sio.packetsize ++; sio.buf[sio.parp] = PAD1poll(value); break; - case 0x2002: sio.packetsize ++; sio.buf[sio.parp] = PAD2poll(value); break; + case 0x0002: sio.packetsize ++; sio.buf[sio.parp] = PADpoll(value); break; + case 0x2002: sio.packetsize ++; sio.buf[sio.parp] = PADpoll(value); break; } if (sio.parp == sio.bufcount) { sio.padst = 0; return; } SIO_INT(); @@ -515,27 +511,23 @@ void InitializeSIO(u8 value) sio.count = 0; sio2.packet.recvVal1 = 0x1100; // Pad is present - switch (sio.CtrlReg&0x2002) { - case 0x0002: - if (!PAD1setSlot(1, 1+sio.activePadSlot[0]) && sio.activePadSlot[0]) { + if( (sio.CtrlReg & 2) == 2 ) + { + int padslot = (sio.CtrlReg>>12) & 2; // move 0x2000 bitmask into leftmost bits + if( padslot != 1 ) + { + padslot >>= 1; // transform 0/2 to be 0/1 values + + if (!PADsetSlot(padslot+1, 1+sio.activePadSlot[padslot]) && sio.activePadSlot[padslot]) + { // Pad is not present. Don't send poll, just return a bunch of 0's. sio2.packet.recvVal1 = 0x1D100; sio.padst = 3; } else { - sio.buf[0] = PAD1startPoll(1); + sio.buf[0] = PADstartPoll(padslot+1); } - break; - case 0x2002: - if (!PAD2setSlot(2, 1+sio.activePadSlot[1]) && sio.activePadSlot[1]) { - // Pad is not present. Don't send poll, just return a bunch of 0's. - sio2.packet.recvVal1 = 0x1D100; - sio.padst = 3; - } - else { - sio.buf[0] = PAD2startPoll(2); - } - break; + } } SIO_INT(); diff --git a/pcsx2/System.cpp b/pcsx2/System.cpp index 7f088fbe4f..1adddfc291 100644 --- a/pcsx2/System.cpp +++ b/pcsx2/System.cpp @@ -283,16 +283,7 @@ void SysClearExecutionCache() __forceinline void SysUpdate() { -#ifdef __LINUX__ - // Doing things the other way results in no keys functioning under Linux! - HostGui::KeyEvent(PAD1keyEvent()); - HostGui::KeyEvent(PAD2keyEvent()); -#else - keyEvent* ev1 = PAD1keyEvent(); - keyEvent* ev2 = PAD2keyEvent(); - - HostGui::KeyEvent( (ev1 != NULL) ? ev1 : ev2); -#endif + HostGui::KeyEvent( PADkeyEvent() ); } void SysExecute() @@ -348,10 +339,6 @@ void SysEndExecution() // use_bios - forces the game to boot through the PS2 bios, instead of bypassing it. void SysPrepareExecution( const wxString& elf_file, bool use_bios ) { - // solve a little crash - if(CDVD.init == NULL) - CDVD = CDVD_plugin; - if( !g_EmulationInProgress ) { try @@ -366,9 +353,7 @@ void SysPrepareExecution( const wxString& elf_file, bool use_bios ) g_Startup.BootMode = (elf_file) ? BootMode_Elf : BootMode_Normal; - if (OpenPlugins(NULL) == -1) { - return; - } + OpenPlugins(NULL); if( elf_file.IsEmpty() ) { diff --git a/pcsx2/VUops.cpp b/pcsx2/VUops.cpp index 412c020371..ede25f5ece 100644 --- a/pcsx2/VUops.cpp +++ b/pcsx2/VUops.cpp @@ -2063,31 +2063,28 @@ void _vuXGKICK(VURegs * VU) GSGIFTRANSFER1((u32*)&tempmem[0], 0); } else*/ //DevCon::Notice("Addr %x", params VU->VI[_Is_].US[0] & 0x3fff); - if( mtgsThread != NULL ) + + u32* data = (u32*)((u8*)VU->Mem + ((VU->VI[_Is_].US[0]*16) & 0x3fff)); + u32 size; + size = mtgsThread->PrepDataPacket( GIF_PATH_1, data, (0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff)) >> 4); { - u32* data = (u32*)((u8*)VU->Mem + ((VU->VI[_Is_].US[0]*16) & 0x3fff)); - u32 size; - size = mtgsThread->PrepDataPacket( GIF_PATH_1, data, (0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff)) >> 4); - { - u8* pmem = mtgsThread->GetDataPacketPtr(); - - /* if((size << 4) > (u32)(0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff))) - { - //DevCon::Notice("addr + Size = 0x%x, transferring %x then doing %x", params ((VU->VI[_Is_].US[0]*16) & 0x3fff) + (size << 4), (0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff)) >> 4, size - (0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff) >> 4)); - memcpy_aligned(pmem, (u8*)VU->Mem+((VU->VI[_Is_].US[0]*16) & 0x3fff), 0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff)); - size -= (0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff)) >> 4; - //DevCon::Notice("Size left %x", params size); - pmem += 0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff); - memcpy_aligned(pmem, (u8*)VU->Mem, size<<4); - } - else - {*/ - memcpy_aligned(pmem, (u8*)VU->Mem+((VU->VI[_Is_].US[0]*16) & 0x3fff), size<<4); - //} - mtgsThread->SendDataPacket(); - } + u8* pmem = mtgsThread->GetDataPacketPtr(); - }else GSGIFTRANSFER1((u32*)VU->Mem, (VU->VI[_Is_].US[0]*16) & 0x3fff); + /* if((size << 4) > (u32)(0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff))) + { + //DevCon::Notice("addr + Size = 0x%x, transferring %x then doing %x", params ((VU->VI[_Is_].US[0]*16) & 0x3fff) + (size << 4), (0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff)) >> 4, size - (0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff) >> 4)); + memcpy_aligned(pmem, (u8*)VU->Mem+((VU->VI[_Is_].US[0]*16) & 0x3fff), 0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff)); + size -= (0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff)) >> 4; + //DevCon::Notice("Size left %x", params size); + pmem += 0x4000-((VU->VI[_Is_].US[0]*16) & 0x3fff); + memcpy_aligned(pmem, (u8*)VU->Mem, size<<4); + } + else + {*/ + memcpy_aligned(pmem, (u8*)VU->Mem+((VU->VI[_Is_].US[0]*16) & 0x3fff), size<<4); + //} + mtgsThread->SendDataPacket(); + } } void _vuXTOP(VURegs * VU) { diff --git a/pcsx2/VifDma.cpp b/pcsx2/VifDma.cpp index 37808750bc..a05be3679a 100644 --- a/pcsx2/VifDma.cpp +++ b/pcsx2/VifDma.cpp @@ -1888,22 +1888,15 @@ static int __fastcall Vif1TransDirectHL(u32 *data) } FreezeRegs(1); - if (mtgsThread != NULL) - { - // copy 16 bytes the fast way: - const u64* src = (u64*)splittransfer[0]; - const uint count = mtgsThread->PrepDataPacket(GIF_PATH_2, src, 1); - jASSUME(count == 1); - u64* dst = (u64*)mtgsThread->GetDataPacketPtr(); - dst[0] = src[0]; - dst[1] = src[1]; + // copy 16 bytes the fast way: + const u64* src = (u64*)splittransfer[0]; + const uint count = mtgsThread->PrepDataPacket(GIF_PATH_2, src, 1); + jASSUME(count == 1); + u64* dst = (u64*)mtgsThread->GetDataPacketPtr(); + dst[0] = src[0]; + dst[1] = src[1]; - mtgsThread->SendDataPacket(); - } - else - { - GSGIFTRANSFER2((u32*)splittransfer[0], 1); - } + mtgsThread->SendDataPacket(); FreezeRegs(0); if (vif1.tag.size == 0) vif1.cmd = 0; @@ -1937,18 +1930,12 @@ static int __fastcall Vif1TransDirectHL(u32 *data) //TODO: ret is guaranteed to be qword aligned ? FreezeRegs(1); - if (mtgsThread != NULL) - { - //unaligned copy.VIF handling is -very- messy, so i'l use this code til i fix it :) - // Round ret up, just in case it's not 128bit aligned. - const uint count = mtgsThread->PrepDataPacket(GIF_PATH_2, data, (ret + 3) >> 2); - memcpy_fast(mtgsThread->GetDataPacketPtr(), data, count << 4); - mtgsThread->SendDataPacket(); - } - else - { - GSGIFTRANSFER2(data, (ret >> 2)); - } + + // Round ret up, just in case it's not 128bit aligned. + const uint count = mtgsThread->PrepDataPacket(GIF_PATH_2, data, (ret + 3) >> 2); + memcpy_fast(mtgsThread->GetDataPacketPtr(), data, count << 4); + mtgsThread->SendDataPacket(); + FreezeRegs(0); return ret; diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index 00fd534615..c0c5cfe588 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -38,7 +38,7 @@ DECLARE_EVENT_TYPE(wxEVT_DockConsole, -1); extern wxRect wxGetDisplayArea(); extern bool pxIsValidWindowPosition( const wxWindow& window, const wxPoint& windowPos ); -static const bool EnableThreadedLoggingTest = true; +static const bool EnableThreadedLoggingTest = false; //true; ////////////////////////////////////////////////////////////////////////////////////////// // ConsoleThreadTest -- useful class for unit testing the thread safety and general performance diff --git a/pcsx2/gui/Dialogs/PickUserModeDialog.cpp b/pcsx2/gui/Dialogs/PickUserModeDialog.cpp index 6a7f72a315..259cd227f5 100644 --- a/pcsx2/gui/Dialogs/PickUserModeDialog.cpp +++ b/pcsx2/gui/Dialogs/PickUserModeDialog.cpp @@ -38,9 +38,9 @@ Dialogs::PickUserModeDialog::PickUserModeDialog( wxWindow* parent, int id ) : AddOkCancel( s_main ); SetSizerAndFit( &s_main ); - - Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PickUserModeDialog::OnOk_Click ) ); + CenterOnScreen(); + Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PickUserModeDialog::OnOk_Click ) ); // TODO : Add a command event handler for language changes, that dynamically re-update contents of this window. } diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index a9cf1cc718..f0f9f438f3 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -122,7 +122,8 @@ void MainEmuFrame::OnMoveAround( wxMoveEvent& evt ) // Uncomment this when doing logger stress testing (and then move the window around // while the logger spams itself) // ... makes for a good test of the message pump's responsiveness. - Console::Notice( "Mess o' crashiness? It can't be!" ); + if( EnableThreadedLoggingTest ) + Console::Notice( "Threaded Logging Test! (a window move event)" ); // evt.GetPosition() returns the client area position, not the window frame position. // So read the window's screen-relative position directly. diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index d79aad8f8d..4a6a729c8b 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -17,6 +17,8 @@ */ #include "PrecompiledHeader.h" +#include "CDVD/CDVD.h" + #include "MainFrame.h" #include "Dialogs/ModalPopups.h" #include "Dialogs/ConfigurationDialog.h" @@ -41,10 +43,13 @@ void MainEmuFrame::Menu_RunIso_Click(wxCommandEvent &event) if( ctrl.ShowModal() == wxID_CANCEL ) return; g_Conf->Folders.RunIso = ctrl.GetPath(); + + //g_Conf->Save(); } void MainEmuFrame::Menu_RunWithoutDisc_Click(wxCommandEvent &event) { + CDVDsys_ChangeSource( CDVDsrc_NoDisc ); SysPrepareExecution( wxEmptyString, true ); } diff --git a/pcsx2/gui/Panels/PluginSelectorPanel.cpp b/pcsx2/gui/Panels/PluginSelectorPanel.cpp index 64f404111c..7d5b1167ef 100644 --- a/pcsx2/gui/Panels/PluginSelectorPanel.cpp +++ b/pcsx2/gui/Panels/PluginSelectorPanel.cpp @@ -32,6 +32,8 @@ DECLARE_EVENT_TYPE(wxEVT_EnumerationFinished, -1) DEFINE_EVENT_TYPE(wxEVT_EnumeratedNext) DEFINE_EVENT_TYPE(wxEVT_EnumerationFinished); +typedef s32 (CALLBACK* PluginTestFnptr)(); + ////////////////////////////////////////////////////////////////////////////////////////// // class PluginEnumerator @@ -92,7 +94,7 @@ public: bool Test( int pluginTypeIndex ) const { // all test functions use the same parameterless API, so just pick one arbitrarily (I pick PAD!) - _PADtest testfunc = (_PADtest)m_plugin.GetSymbol( wxString::FromAscii( tbl_PluginInfo[pluginTypeIndex].shortname ) + L"test" ); + PluginTestFnptr testfunc = (PluginTestFnptr)m_plugin.GetSymbol( wxString::FromAscii( tbl_PluginInfo[pluginTypeIndex].shortname ) + L"test" ); if( testfunc == NULL ) return false; return (testfunc() == 0); } diff --git a/pcsx2/gui/wxHelpers.cpp b/pcsx2/gui/wxHelpers.cpp index 844001b684..db04220e1d 100644 --- a/pcsx2/gui/wxHelpers.cpp +++ b/pcsx2/gui/wxHelpers.cpp @@ -391,7 +391,7 @@ wxStaticText& wxPanelWithHelpers::AddStaticText(wxSizer& sizer, const wxString& // wxRadioButton& wxPanelWithHelpers::AddRadioButton( wxSizer& sizer, const wxString& label, const wxString& subtext, const wxString& tooltip ) { - return wxHelpers::AddRadioButtonTo( this, sizer, label, subtext, tooltip, GetIdealWidth()-8, m_StartNewRadioGroup ); + wxRadioButton& result = wxHelpers::AddRadioButtonTo( this, sizer, label, subtext, tooltip, GetIdealWidth()-8, m_StartNewRadioGroup ); m_StartNewRadioGroup = false; + return result; } - diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 2a2537191c..16beb54f14 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -1122,16 +1122,12 @@ void __fastcall mVU_XGKICK_(u32 addr) { mtgsThread->SendDataPacket(); } -void __fastcall mVU_XGKICK__(u32 addr) { - GSGIFTRANSFER1((u32*)microVU1.regs->Mem, ((addr<<4)&0x3fff)); -} - microVUt(void) mVU_XGKICK_DELAY(mV, bool memVI) { mVUbackupRegs(mVU); if (memVI) MOV32MtoR(gprT2, (uptr)&mVU->VIxgkick); else mVUallocVIa(mVU, gprT2, _Is_); - if (mtgsThread) CALLFunc((uptr)mVU_XGKICK_); - else CALLFunc((uptr)mVU_XGKICK__); + + CALLFunc((uptr)mVU_XGKICK_); mVUrestoreRegs(mVU); } diff --git a/pcsx2/x86/sVU_zerorec.cpp b/pcsx2/x86/sVU_zerorec.cpp index 9e4d391920..fe7636c9ff 100644 --- a/pcsx2/x86/sVU_zerorec.cpp +++ b/pcsx2/x86/sVU_zerorec.cpp @@ -4353,22 +4353,6 @@ void recVUMI_JALR(VURegs* vuu, s32 info) branch |= 4; } -#ifdef PCSX2_DEVBUILD -void vu1xgkick(u32* pMem, u32 addr) -{ - assert(addr < 0x4000); -#ifdef SUPERVU_COUNT - StopSVUCounter(); -#endif - - GSGIFTRANSFER1(pMem, addr); - -#ifdef SUPERVU_COUNT - StartSVUCounter(); -#endif -} -#endif - void recVUMI_XGKICK_(VURegs *VU) { assert(s_XGKICKReg > 0 && x86regs[s_XGKICKReg].inuse && x86regs[s_XGKICKReg].type == X86TYPE_VITEMP); @@ -4381,18 +4365,8 @@ void recVUMI_XGKICK_(VURegs *VU) PUSH32R(s_XGKICKReg); PUSH32I((uptr)VU->Mem); - if (mtgsThread) { - CALLFunc((uptr)VU1XGKICK_MTGSTransfer); - ADD32ItoR(ESP, 8); - } - else { -#ifdef PCSX2_DEVBUILD - CALLFunc((uptr)vu1xgkick); - ADD32ItoR(ESP, 8); -#else - CALLFunc((uptr)GSgifTransfer1); -#endif - } + CALLFunc((uptr)VU1XGKICK_MTGSTransfer); + ADD32ItoR(ESP, 8); AND32ItoM((uptr)&psHu32(GIF_STAT), ~(GIF_STAT_APATH1 | GIF_STAT_OPH)); // Clear PATH1 GIF Status Flags s_ScheduleXGKICK = 0; } diff --git a/pcsx2_suite_2008.sln b/pcsx2_suite_2008.sln index 39dbffc7da..514de59dca 100644 --- a/pcsx2_suite_2008.sln +++ b/pcsx2_suite_2008.sln @@ -284,28 +284,22 @@ Global {F4EB4AB2-C595-4B05-8BC0-059024BC796C}.Release|x64.ActiveCfg = Release|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Debug|Win32.ActiveCfg = Debug|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Debug|Win32.Build.0 = Debug|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Debug|x64.ActiveCfg = Debug|x64 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Debug|x64.Build.0 = Debug|x64 + {E4081455-398C-4610-A87C-90A8A7D72DC3}.Debug|x64.ActiveCfg = Debug|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Devel|Win32.ActiveCfg = Release|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Devel|Win32.Build.0 = Release|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Devel|x64.ActiveCfg = Debug|x64 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Devel|x64.Build.0 = Debug|x64 + {E4081455-398C-4610-A87C-90A8A7D72DC3}.Devel|x64.ActiveCfg = Debug|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE2|Win32.ActiveCfg = Release|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE2|Win32.Build.0 = Release|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE2|x64.ActiveCfg = Release|x64 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE2|x64.Build.0 = Release|x64 + {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE2|x64.ActiveCfg = Release|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE4|Win32.ActiveCfg = Release|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE4|Win32.Build.0 = Release|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE4|x64.ActiveCfg = Release|x64 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE4|x64.Build.0 = Release|x64 + {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSE4|x64.ActiveCfg = Release|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSSE3|Win32.ActiveCfg = Release|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSSE3|Win32.Build.0 = Release|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSSE3|x64.ActiveCfg = Release|x64 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSSE3|x64.Build.0 = Release|x64 + {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release SSSE3|x64.ActiveCfg = Release|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release|Win32.ActiveCfg = Release|Win32 {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release|Win32.Build.0 = Release|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release|x64.ActiveCfg = Release|x64 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release|x64.Build.0 = Release|x64 + {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release|x64.ActiveCfg = Release|Win32 {26511268-2902-4997-8421-ECD7055F9E28}.Debug|Win32.ActiveCfg = Debug|Win32 {26511268-2902-4997-8421-ECD7055F9E28}.Debug|Win32.Build.0 = Debug|Win32 {26511268-2902-4997-8421-ECD7055F9E28}.Debug|x64.ActiveCfg = Debug|Win32 @@ -344,24 +338,19 @@ Global {7F059854-568D-4E08-9D00-1E78E203E4DC}.Release|x64.ActiveCfg = Release|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Debug|Win32.ActiveCfg = Debug|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Debug|Win32.Build.0 = Debug|Win32 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Debug|x64.ActiveCfg = Debug|x64 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Debug|x64.Build.0 = Debug|x64 + {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Debug|x64.ActiveCfg = Debug|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Devel|Win32.ActiveCfg = Release|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Devel|Win32.Build.0 = Release|Win32 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Devel|x64.ActiveCfg = Debug SSE4|x64 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Devel|x64.Build.0 = Debug SSE4|x64 + {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Devel|x64.ActiveCfg = Debug SSE4|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE2|Win32.ActiveCfg = Release|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE2|Win32.Build.0 = Release|Win32 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE2|x64.ActiveCfg = Release SSE2|x64 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE2|x64.Build.0 = Release SSE2|x64 + {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE2|x64.ActiveCfg = Release SSE2|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE4|Win32.ActiveCfg = Release|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE4|Win32.Build.0 = Release|Win32 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE4|x64.ActiveCfg = Release SSE4|x64 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE4|x64.Build.0 = Release SSE4|x64 + {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSE4|x64.ActiveCfg = Release SSE4|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSSE3|Win32.ActiveCfg = Release|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSSE3|Win32.Build.0 = Release|Win32 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSSE3|x64.ActiveCfg = Release SSSE3|x64 - {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSSE3|x64.Build.0 = Release SSSE3|x64 + {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release SSSE3|x64.ActiveCfg = Release SSSE3|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release|Win32.ActiveCfg = Release|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release|Win32.Build.0 = Release|Win32 {6F3C4136-5801-4EBC-AC6E-37DF6FAB150A}.Release|x64.ActiveCfg = Release|Win32