diff --git a/pcsx2/Exceptions.h b/pcsx2/Exceptions.h index 32af70b8e1..2812a7a0a2 100644 --- a/pcsx2/Exceptions.h +++ b/pcsx2/Exceptions.h @@ -204,8 +204,8 @@ namespace Exception std::string plugin_name; // name of the plugin virtual ~PluginFailure() throw() {} - explicit PluginFailure( const std::string& plugin, const std::string& msg = "An error occured in the " ) : - RuntimeError( plugin + msg + " Plugin" ) + explicit PluginFailure( const std::string& plugin, const std::string& msg = "A plugin encountered a critical error." ) : + RuntimeError( msg ) , plugin_name( plugin ) {} }; diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 3ab3d0686c..9cd435ea51 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -214,7 +214,7 @@ mtgsThreadObject::mtgsThreadObject() : m_wait_InitDone.Wait(); if( m_returncode != 0 ) // means the thread failed to init the GS plugin - throw Exception::PluginFailure( "GS", "An error occured while opening the " ); + throw Exception::PluginFailure( "GS", "The GS plugin failed to open/initialize." ); } mtgsThreadObject::~mtgsThreadObject() diff --git a/pcsx2/Misc.cpp b/pcsx2/Misc.cpp index abe26cc6ca..c3cd0c3386 100644 --- a/pcsx2/Misc.cpp +++ b/pcsx2/Misc.cpp @@ -426,7 +426,7 @@ void LoadGSState(const string& file) if (ret != 0) { delete f; - throw Exception::PluginFailure( "GS", "Error opening" ); + throw Exception::PluginFailure( "GS" ); } ret = PAD1open((void *)&pDsp); diff --git a/pcsx2_suite_2008.sln b/pcsx2_suite_2008.sln index b7d3dbae29..ab56caf55f 100644 --- a/pcsx2_suite_2008.sln +++ b/pcsx2_suite_2008.sln @@ -50,30 +50,30 @@ Global {26511268-2902-4997-8421-ECD7055F9E28}.Release vm|Win32.Build.0 = Release|Win32 {26511268-2902-4997-8421-ECD7055F9E28}.Release vtlb|Win32.ActiveCfg = Release|Win32 {26511268-2902-4997-8421-ECD7055F9E28}.Release vtlb|Win32.Build.0 = Release|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Debug vm|Win32.ActiveCfg = DebugFast|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Debug vm|Win32.Build.0 = DebugFast|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Debug vtlb|Win32.ActiveCfg = DebugFast|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Debug vtlb|Win32.Build.0 = DebugFast|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Devel vm|Win32.ActiveCfg = Release (dev)|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Devel vm|Win32.Build.0 = Release (dev)|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Devel vtlb|Win32.ActiveCfg = Release (dev)|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Devel vtlb|Win32.Build.0 = Release (dev)|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Release vm|Win32.ActiveCfg = Release (nondev) [public]|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Release vm|Win32.Build.0 = Release (nondev) [public]|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Release vtlb|Win32.ActiveCfg = Release (nondev) [public]|Win32 - {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Release vtlb|Win32.Build.0 = Release (nondev) [public]|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Debug vm|Win32.ActiveCfg = Debug|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Debug vm|Win32.Build.0 = Debug|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Debug vm|Win32.ActiveCfg = Debug|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Debug vm|Win32.Build.0 = Debug|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Debug vtlb|Win32.ActiveCfg = Debug|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Debug vtlb|Win32.Build.0 = Debug|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Devel vm|Win32.ActiveCfg = Devel|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Devel vm|Win32.Build.0 = Devel|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Devel vtlb|Win32.ActiveCfg = Devel|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Devel vtlb|Win32.Build.0 = Devel|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Release vm|Win32.ActiveCfg = Release|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Release vm|Win32.Build.0 = Release|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Release vtlb|Win32.ActiveCfg = Release|Win32 + {5307BBB7-EBB9-4AA4-8CB6-A94EC473C8C4}.Release vtlb|Win32.Build.0 = Release|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Debug vm|Win32.ActiveCfg = Release|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Debug vm|Win32.Build.0 = Release|Win32 {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Debug vtlb|Win32.ActiveCfg = Debug|Win32 {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Debug vtlb|Win32.Build.0 = Debug|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Devel vm|Win32.ActiveCfg = Release (dev)|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Devel vm|Win32.Build.0 = Release (dev)|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Devel vtlb|Win32.ActiveCfg = Release (dev)|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Devel vtlb|Win32.Build.0 = Release (dev)|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release vm|Win32.ActiveCfg = Release (nondev) [public]|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release vm|Win32.Build.0 = Release (nondev) [public]|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release vtlb|Win32.ActiveCfg = Release (nondev) [public]|Win32 - {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release vtlb|Win32.Build.0 = Release (nondev) [public]|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Devel vm|Win32.ActiveCfg = Devel|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Devel vm|Win32.Build.0 = Devel|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Devel vtlb|Win32.ActiveCfg = Devel|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Devel vtlb|Win32.Build.0 = Devel|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release vm|Win32.ActiveCfg = Release|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release vm|Win32.Build.0 = Release|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release vtlb|Win32.ActiveCfg = Release|Win32 + {5C6B7D28-E73D-4F71-8FC0-17ADA640EBD8}.Release vtlb|Win32.Build.0 = Release|Win32 {7F059854-568D-4E08-9D00-1E78E203E4DC}.Debug vm|Win32.ActiveCfg = Debug|Win32 {7F059854-568D-4E08-9D00-1E78E203E4DC}.Debug vm|Win32.Build.0 = Debug|Win32 {7F059854-568D-4E08-9D00-1E78E203E4DC}.Debug vtlb|Win32.ActiveCfg = Debug|Win32 diff --git a/plugins/spu2ghz/SPU2ghz_vs2008.vcproj b/plugins/spu2ghz/SPU2ghz_vs2008.vcproj index 5b24d44776..32f358155c 100644 --- a/plugins/spu2ghz/SPU2ghz_vs2008.vcproj +++ b/plugins/spu2ghz/SPU2ghz_vs2008.vcproj @@ -16,7 +16,7 @@ + + + + + + @@ -495,27 +516,6 @@ BrowseInformation="1" /> - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - #include @@ -74,7 +74,7 @@ struct Vector_16F //#define ZEROGS_CACHEDCLEAR // much better performance //#define RELEASE_TO_PUBLIC -#if !defined(_RELEASE) +#if defined(ZEROGS_DEVBUILD) #define GS_LOG __Log #else #define GS_LOG 0&& diff --git a/plugins/zerogs/dx/GSmain.cpp b/plugins/zerogs/dx/GSmain.cpp index 003054716d..e842f2b4a7 100644 --- a/plugins/zerogs/dx/GSmain.cpp +++ b/plugins/zerogs/dx/GSmain.cpp @@ -42,7 +42,7 @@ using namespace std; #include "targets.h" #include "zerogsshaders/zerogsshaders.h" -#ifdef __MSCW32__ +#ifdef _MSC_VER #pragma warning(disable:4244) #endif @@ -130,7 +130,10 @@ void SysMessage(char *fmt, ...) { void __Log(const char *fmt, ...) { va_list list; - if (!conf.log) return; + // gsLog can be null if the config dialog is used prior to Pcsx2 an emulation session. + // (GSinit won't have been called then) + + if (gsLog == NULL || !conf.log) return; va_start(list, fmt); vfprintf(gsLog, fmt, list); @@ -142,8 +145,12 @@ void __LogToConsole(const char *fmt, ...) { printf("ZeroGS: "); + // gsLog can be null if the config dialog is used prior to Pcsx2 an emulation session. + // (GSinit won't have been called then) + va_start(list, fmt); - vfprintf(gsLog, fmt, list); + if( gsLog != NULL ) + vfprintf(gsLog, fmt, list); vprintf(fmt, list); va_end(list); } diff --git a/plugins/zerogs/dx/Regs.cpp b/plugins/zerogs/dx/Regs.cpp index 365251d070..2ae3b8e464 100644 --- a/plugins/zerogs/dx/Regs.cpp +++ b/plugins/zerogs/dx/Regs.cpp @@ -33,7 +33,7 @@ #include "zerogs.h" #include "targets.h" -#ifdef __MSCW32__ +#ifdef _MSC_VER #pragma warning(disable:4244) #endif diff --git a/plugins/zerogs/dx/Win32/GSsoftdx.def b/plugins/zerogs/dx/Win32/GSsoftdx.def index 8ca92c5cf0..04d77506fe 100644 --- a/plugins/zerogs/dx/Win32/GSsoftdx.def +++ b/plugins/zerogs/dx/Win32/GSsoftdx.def @@ -1,6 +1,6 @@ ; Declares the module parameters for the DLL. -LIBRARY "ZeroGS" +;LIBRARY "ZeroGS" EXPORTS ; Explicit exports can go here diff --git a/plugins/zerogs/dx/Win32/zerogs_2008.vcproj b/plugins/zerogs/dx/Win32/zerogs_2008.vcproj index f5fea4c018..ace8d9adae 100644 --- a/plugins/zerogs/dx/Win32/zerogs_2008.vcproj +++ b/plugins/zerogs/dx/Win32/zerogs_2008.vcproj @@ -16,7 +16,7 @@ -#include -#include - -// need C definitions -extern "C" { -#define GSdefs -#include "PS2Edefs.h" -} - #ifdef _WIN32 #include @@ -36,10 +26,6 @@ extern "C" { extern HWND GShwnd; -extern "C" u32 CALLBACK PS2EgetLibType(void); -extern "C" u32 CALLBACK PS2EgetLibVersion2(u32 type); -extern "C" char* CALLBACK PS2EgetLibName(void); - #else // linux basic definitions #include @@ -53,15 +39,31 @@ extern "C" char* CALLBACK PS2EgetLibName(void); #include #include +#endif + +#include +#include +#include + +// need C definitions +extern "C" { +#define GSdefs +#include "PS2Edefs.h" + +extern "C" u32 CALLBACK PS2EgetLibType(void); +extern "C" u32 CALLBACK PS2EgetLibVersion2(u32 type); +extern "C" char* CALLBACK PS2EgetLibName(void); +} + +#include "zerogsmath.h" + +#ifndef _WIN32 #include -#include #include #include using namespace std; -#include "zerogsmath.h" - extern u32 THR_KeyEvent; // value for passing out key events beetwen threads extern bool THR_bShift; @@ -145,8 +147,10 @@ struct Vector_16F // The only code that uses it is commented out! //#define ZEROGS_CACHEDCLEAR // much better performance //#define RELEASE_TO_PUBLIC +// fixme - We should use ZEROGS_DEVBUILD to determine devel/debug builds from "public release" builds. +// Means a lot of search-and-replace though. (air) -#if !defined(_RELEASE) +#ifdef ZEROGS_DEVBUILD #define GS_LOG __Log #else #define GS_LOG 0&& diff --git a/plugins/zerogs/opengl/GSmain.cpp b/plugins/zerogs/opengl/GSmain.cpp index db74b09e71..2c2c0ef7c6 100644 --- a/plugins/zerogs/opengl/GSmain.cpp +++ b/plugins/zerogs/opengl/GSmain.cpp @@ -40,7 +40,7 @@ using namespace std; #include "targets.h" #include "ZeroGSShaders/zerogsshaders.h" -#ifdef __MSCW32__ +#ifdef _MSC_VER #pragma warning(disable:4244) #endif @@ -69,11 +69,11 @@ unsigned char zgsbuild = VER; unsigned char zgsminor = 7; #ifdef _DEBUG -char *libraryName = "ZeroGS OpenGL (Debug) "; +char *libraryName = "ZeroGS-Pg OpenGL (Debug) "; #elif defined(RELEASE_TO_PUBLIC) -char *libraryName = "ZeroGS KOSMOS OpenGL "; +char *libraryName = "ZeroGS Playground OpenGL "; #else -char *libraryName = "ZeroGS OpenGL (Dev) "; +char *libraryName = "ZeroGS-Pg OpenGL (Dev) "; #endif static const char* s_aa[3] = { "AA none |", "AA 2x |", "AA 4x |" }; @@ -131,7 +131,10 @@ bool THR_bShift = false; void __Log(const char *fmt, ...) { va_list list; - if (!conf.log) return; + // gsLog can be null if the config dialog is used prior to Pcsx2 an emulation session. + // (GSinit won't have been called then) + + if (gsLog == NULL || !conf.log) return; va_start(list, fmt); vfprintf(gsLog, fmt, list); @@ -142,11 +145,13 @@ void __LogToConsole(const char *fmt, ...) { va_list list; va_start(list, fmt); - fprintf(gsLog, "ZeroGS: "); - vfprintf(gsLog, fmt, list); - va_end(list); - va_start(list, fmt); + // gsLog can be null if the config dialog is used prior to Pcsx2 an emulation session. + // (GSinit won't have been called then) + + if( gsLog != NULL ) + vfprintf(gsLog, fmt, list); + printf("ZeroGS: "); vprintf(fmt, list); va_end(list); diff --git a/plugins/zerogs/opengl/Regs.cpp b/plugins/zerogs/opengl/Regs.cpp index 0695d4897d..09e9aa9221 100644 --- a/plugins/zerogs/opengl/Regs.cpp +++ b/plugins/zerogs/opengl/Regs.cpp @@ -31,7 +31,7 @@ const u32 g_primmult[8] = { 1, 2, 2, 3, 3, 3, 2, 0xff }; const u32 g_primsub[8] = { 1, 2, 1, 3, 1, 1, 2, 0 }; -#ifdef __MSCW32__ +#ifdef _MSC_VER #pragma warning(disable:4244) #endif diff --git a/plugins/zerogs/opengl/Win32/zerogs.def b/plugins/zerogs/opengl/Win32/zerogs.def index 4714177bf8..62d7e24901 100644 --- a/plugins/zerogs/opengl/Win32/zerogs.def +++ b/plugins/zerogs/opengl/Win32/zerogs.def @@ -1,7 +1,7 @@ ; Declares the module parameters for the DLL. -LIBRARY "ZeroGS" -DESCRIPTION 'ZeroGS dll' +;LIBRARY "ZeroGS" +;DESCRIPTION 'ZeroGS dll' EXPORTS ; Explicit exports can go here diff --git a/plugins/zerogs/opengl/Win32/zerogsogl_2005.sln b/plugins/zerogs/opengl/Win32/zerogsogl_2005.sln deleted file mode 100644 index 81edd3c635..0000000000 --- a/plugins/zerogs/opengl/Win32/zerogsogl_2005.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zerogsogl_2005", "zerogsogl_2005.vcproj", "{2D4E85B2-F47F-4D65-B091-701E5C031DAC}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release (to Public)|Win32 = Release (to Public)|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Debug|Win32.ActiveCfg = Debug|Win32 - {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Debug|Win32.Build.0 = Debug|Win32 - {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Release (to Public)|Win32.ActiveCfg = Release (to Public)|Win32 - {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Release (to Public)|Win32.Build.0 = Release (to Public)|Win32 - {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Release|Win32.ActiveCfg = Release|Win32 - {2D4E85B2-F47F-4D65-B091-701E5C031DAC}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/plugins/zerogs/opengl/Win32/zerogsogl_2008.vcproj b/plugins/zerogs/opengl/Win32/zerogsogl_2008.vcproj index 7791bbd1d2..f2c7a7974c 100644 --- a/plugins/zerogs/opengl/Win32/zerogsogl_2008.vcproj +++ b/plugins/zerogs/opengl/Win32/zerogsogl_2008.vcproj @@ -2,7 +2,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include #ifndef PI #define PI ((dReal)3.141592654) diff --git a/plugins/zerogs/opengl/zpipe.cpp b/plugins/zerogs/opengl/zpipe.cpp index 3dc4b17d6c..703ab487b8 100644 --- a/plugins/zerogs/opengl/zpipe.cpp +++ b/plugins/zerogs/opengl/zpipe.cpp @@ -8,7 +8,7 @@ #include //#define ZLIB_WINAPI -#include "zlib.h" +#include "zlib/zlib.h" int def(char *src, char *dst, int bytes_to_compress, int *bytes_after_compressed) ; int inf(char *src, char *dst, int bytes_to_decompress, int maximum_after_decompress) ; diff --git a/plugins/zerospu2/Win32.cpp b/plugins/zerospu2/Win32.cpp index e703cd4b29..710e8799f4 100644 --- a/plugins/zerospu2/Win32.cpp +++ b/plugins/zerospu2/Win32.cpp @@ -209,7 +209,7 @@ void SysMessage(char *fmt, ...) { char tmp[512]; va_start(list,fmt); - vsprintf(tmp,fmt,list); + vsprintf_s(tmp,fmt,list); va_end(list); MessageBox(0, tmp, "SPU2NULL Msg", 0); } @@ -302,10 +302,11 @@ void SaveConfig() szTemp = strrchr(szIniFile, '\\'); if(!szTemp) return; - strcpy(szTemp, "\\inis\\zerospu2.ini"); - sprintf(szValue,"%u",Conf1->Log); + szTemp[0] = 0; // this modifies szInitFile also. + strcat_s(szIniFile, "\\inis\\zerospu2.ini"); + sprintf_s(szValue,"%u",Conf1->Log); WritePrivateProfileString("Interface", "Logging",szValue,szIniFile); - sprintf(szValue,"%u",Conf1->options); + sprintf_s(szValue,"%u",Conf1->options); WritePrivateProfileString("Interface", "Options",szValue,szIniFile); } @@ -321,8 +322,9 @@ void LoadConfig() szTemp = strrchr(szIniFile, '\\'); if(!szTemp) return ; - strcpy(szTemp, "\\inis\\zerospu2.ini"); - fp=fopen("inis\\zerospu2.ini","rt");//check if usbnull.ini really exists + szTemp[0] = 0; + strcpy_s(szIniFile, "\\inis\\zerospu2.ini"); + fopen_s(&fp, "inis\\zerospu2.ini","rt");//check if usbnull.ini really exists if (!fp) { CreateDirectory("inis",NULL); diff --git a/plugins/zerospu2/ZeroSPU2_2008.vcproj b/plugins/zerospu2/ZeroSPU2_2008.vcproj index 90f24e4ef1..aabcfe279d 100644 --- a/plugins/zerospu2/ZeroSPU2_2008.vcproj +++ b/plugins/zerospu2/ZeroSPU2_2008.vcproj @@ -50,7 +50,7 @@ RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" - DebugInformationFormat="3" + DebugInformationFormat="4" />