From 85c8e4c4afe7038fff9056ac4076e0a1f2fb67eb Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 8 May 2009 22:40:56 +0000 Subject: [PATCH] Mostly port the GSnull plugin to Windows. Currently asserts on startup in Windows about GSirq not being null. (Though it works if you hit ignore.) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1158 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSnull/GS.cpp | 1 - plugins/GSnull/GS.h | 21 ++++++----- plugins/GSnull/Windows/Config.cpp | 8 ++-- plugins/GSnull/Windows/GS.def | 42 ++++++++++++++++----- plugins/GSnull/Windows/GSnull_vc2008.sln | 20 ++++++++++ plugins/GSnull/Windows/GSnull_vc2008.vcproj | 16 ++++---- plugins/GSnull/Windows/Win32.cpp | 8 ++-- 7 files changed, 79 insertions(+), 37 deletions(-) create mode 100644 plugins/GSnull/Windows/GSnull_vc2008.sln diff --git a/plugins/GSnull/GS.cpp b/plugins/GSnull/GS.cpp index 96b566706a..e32ad8a4e2 100644 --- a/plugins/GSnull/GS.cpp +++ b/plugins/GSnull/GS.cpp @@ -72,7 +72,6 @@ EXPORT_C_(void) GSprintf(int timeout, char *fmt, ...) { va_list list; char msg[512]; - char cmd[512]; va_start(list, fmt); vsprintf(msg, fmt, list); diff --git a/plugins/GSnull/GS.h b/plugins/GSnull/GS.h index 5cee36c9af..56b6ff8417 100644 --- a/plugins/GSnull/GS.h +++ b/plugins/GSnull/GS.h @@ -21,16 +21,6 @@ #include -#ifdef __cplusplus -extern "C" -{ -#endif -#define GSdefs -#include "PS2Edefs.h" -#ifdef __cplusplus -} -#endif - #ifdef _WIN32 #include @@ -44,6 +34,16 @@ extern "C" #endif +#ifdef __cplusplus +extern "C" +{ +#endif +#define GSdefs +#include "PS2Edefs.h" +#ifdef __cplusplus +} +#endif + /*#ifdef _MSC_VER #define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK #else @@ -63,6 +63,7 @@ typedef struct int Log; } Config; + extern Config conf; extern FILE *gsLog; diff --git a/plugins/GSnull/Windows/Config.cpp b/plugins/GSnull/Windows/Config.cpp index 62db91dd61..593766f613 100644 --- a/plugins/GSnull/Windows/Config.cpp +++ b/plugins/GSnull/Windows/Config.cpp @@ -1,6 +1,6 @@ #include -#include "../FW.h" +#include "../GS.h" extern HINSTANCE hInst; void SaveConfig() @@ -14,7 +14,7 @@ void SaveConfig() szTemp = strrchr(szIniFile, '\\'); if(!szTemp) return; - strcpy(szTemp, "\\inis\\fwnull.ini"); + strcpy(szTemp, "\\inis\\gsnull.ini"); sprintf(szValue,"%u",Conf1->Log); WritePrivateProfileString("Interface", "Logging",szValue,szIniFile); @@ -32,8 +32,8 @@ void LoadConfig() { szTemp = strrchr(szIniFile, '\\'); if(!szTemp) return ; - strcpy(szTemp, "\\inis\\fwnull.ini"); - fp=fopen("inis\\fwnull.ini","rt");//check if firewirenull.ini really exists + strcpy(szTemp, "\\inis\\gsnull.ini"); + fp=fopen("inis\\gsnull.ini","rt");//check if gsnull.ini really exists if (!fp) { CreateDirectory("inis",NULL); diff --git a/plugins/GSnull/Windows/GS.def b/plugins/GSnull/Windows/GS.def index 51e786a1fd..d71a22d69d 100644 --- a/plugins/GSnull/Windows/GS.def +++ b/plugins/GSnull/Windows/GS.def @@ -7,13 +7,35 @@ EXPORTS PS2EgetLibType @2 PS2EgetLibName @3 PS2EgetLibVersion2 @4 - FWinit @5 - FWshutdown @6 - FWopen @7 - FWclose @8 - FWread32 @11 - FWwrite32 @14 - FWirqCallback @15 - FWconfigure @17 - FWtest @18 - FWabout @19 + GSinit @5 + GSopen @6 + GSclose @7 + GSshutdown @8 + GSvsync @9 + GSgifTransfer1 @10 + GSgifTransfer2 @11 + GSgifTransfer3 @12 + GSgetLastTag @13 + GSgifSoftReset @14 + GSreadFIFO @15 + GSreadFIFO2 @16 + GSkeyEvent @17 + GSchangeSaveState @18 + GSmakeSnapshot @19 + GSmakeSnapshot2 @20 + GSirqCallback @21 + GSprintf @22 + GSsetBaseMem @23 + GSsetGameCRC @24 + GSsetFrameSkip @25 + GSsetupRecording @26 + GSreset @27 + GSwriteCSR @28 + GSgetDriverInfo @29 + GSsetWindowInfo @30 + GSfreeze @31 + GSconfigure @32 + GSabout @33 + GStest @34 + + diff --git a/plugins/GSnull/Windows/GSnull_vc2008.sln b/plugins/GSnull/Windows/GSnull_vc2008.sln new file mode 100644 index 0000000000..cbdf517657 --- /dev/null +++ b/plugins/GSnull/Windows/GSnull_vc2008.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GSnull", "GSnull_vc2008.vcproj", "{3D0EB14D-32F3-4D82-9C6D-B806ADBB859C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3D0EB14D-32F3-4D82-9C6D-B806ADBB859C}.Debug|Win32.ActiveCfg = Debug|Win32 + {3D0EB14D-32F3-4D82-9C6D-B806ADBB859C}.Debug|Win32.Build.0 = Debug|Win32 + {3D0EB14D-32F3-4D82-9C6D-B806ADBB859C}.Release|Win32.ActiveCfg = Release|Win32 + {3D0EB14D-32F3-4D82-9C6D-B806ADBB859C}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/plugins/GSnull/Windows/GSnull_vc2008.vcproj b/plugins/GSnull/Windows/GSnull_vc2008.vcproj index 7ca94e36c7..e08a6c645c 100644 --- a/plugins/GSnull/Windows/GSnull_vc2008.vcproj +++ b/plugins/GSnull/Windows/GSnull_vc2008.vcproj @@ -2,9 +2,9 @@ @@ -55,7 +55,7 @@ /> @@ -122,7 +122,7 @@ /> @@ -161,7 +161,7 @@ > diff --git a/plugins/GSnull/Windows/Win32.cpp b/plugins/GSnull/Windows/Win32.cpp index c09edf89f0..0071924a65 100644 --- a/plugins/GSnull/Windows/Win32.cpp +++ b/plugins/GSnull/Windows/Win32.cpp @@ -4,7 +4,7 @@ #include "resource.h" -#include "../FW.h" +#include "../GS.h" HINSTANCE hInst; @@ -15,7 +15,7 @@ void SysMessage(char *fmt, ...) { va_start(list,fmt); vsprintf(tmp,fmt,list); va_end(list); - MessageBox(0, tmp, "FW Plugin Msg", 0); + MessageBox(0, tmp, "GS Plugin Msg", 0); } BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -58,14 +58,14 @@ BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) { return FALSE; } -void CALLBACK FWconfigure() { +EXPORT_C_(void) GSconfigure() { DialogBox(hInst, MAKEINTRESOURCE(IDD_CONFIG), GetActiveWindow(), (DLGPROC)ConfigureDlgProc); } -void CALLBACK FWabout() { +EXPORT_C_(void) GSabout() { DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUT), GetActiveWindow(),