From f2c0ff23a97b44cfdd6db79baf1e860012e4ba44 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Fri, 3 Dec 2010 21:18:29 +0000 Subject: [PATCH] PCSX2, GSdx (patch from avih): Fix broken backward/forward compatibility regarding GSgetTitleInfo * PCSX2: Added GSgetTileinfo2 and deprecated=removed GSgetTitleInfo * GSdx: moved to the new GSgetTitleInfo2 * New PCSX2 with new GSdx will have the new functionality, all other combos remain with old functionality. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4073 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/include/PS2Edefs.h | 8 +++++--- pcsx2/PluginManager.cpp | 6 +++--- pcsx2/gui/FrameForGS.cpp | 2 +- plugins/GSdx/GS.cpp | 2 +- plugins/GSdx/GSdx.def | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/common/include/PS2Edefs.h b/common/include/PS2Edefs.h index c5497d1b5d..6d6119d4c7 100644 --- a/common/include/PS2Edefs.h +++ b/common/include/PS2Edefs.h @@ -278,7 +278,9 @@ void CALLBACK GSsetFrameSkip(int frameskip); int CALLBACK GSsetupRecording(int start, void* pData); void CALLBACK GSreset(); -void CALLBACK GSgetTitleInfo( char* dest, size_t length ); +//deprecated: GSgetTitleInfo was used in PCSX2 but no plugin supported it prior to r4070: +//void CALLBACK GSgetTitleInfo( char dest[128] ); +void CALLBACK GSgetTitleInfo2( char* dest, size_t length ); void CALLBACK GSwriteCSR(u32 value); s32 CALLBACK GSfreeze(int mode, freezeData *data); void CALLBACK GSconfigure(); @@ -575,7 +577,7 @@ typedef void (CALLBACK* _GSreadFIFO)(u64 *pMem); typedef void (CALLBACK* _GSreadFIFO2)(u64 *pMem, int qwc); typedef void (CALLBACK* _GSchangeSaveState)(int, const char* filename); -typedef void (CALLBACK* _GSgetTitleInfo)(char* dest, size_t length); +typedef void (CALLBACK* _GSgetTitleInfo2)(char* dest, size_t length); typedef void (CALLBACK* _GSirqCallback)(void (*callback)()); typedef void (CALLBACK* _GSprintf)(int timeout, char *fmt, ...); typedef void (CALLBACK* _GSsetBaseMem)(void*); @@ -729,7 +731,7 @@ extern _GSreadFIFO GSreadFIFO; extern _GSreadFIFO2 GSreadFIFO2; extern _GSchangeSaveState GSchangeSaveState; -extern _GSgetTitleInfo GSgetTitleInfo; +extern _GSgetTitleInfo2 GSgetTitleInfo2; extern _GSmakeSnapshot GSmakeSnapshot; extern _GSmakeSnapshot2 GSmakeSnapshot2; extern _GSirqCallback GSirqCallback; diff --git a/pcsx2/PluginManager.cpp b/pcsx2/PluginManager.cpp index ee37878c40..4edd5d35e7 100644 --- a/pcsx2/PluginManager.cpp +++ b/pcsx2/PluginManager.cpp @@ -152,7 +152,7 @@ _GSgifSoftReset GSgifSoftReset; _GSreadFIFO GSreadFIFO; _GSreadFIFO2 GSreadFIFO2; _GSchangeSaveState GSchangeSaveState; -_GSgetTitleInfo GSgetTitleInfo; +_GSgetTitleInfo2 GSgetTitleInfo2; _GSmakeSnapshot GSmakeSnapshot; _GSmakeSnapshot2 GSmakeSnapshot2; _GSirqCallback GSirqCallback; @@ -185,7 +185,7 @@ static void CALLBACK GS_printf(int timeout, char *fmt, ...) Console.WriteLn(msg); } -void CALLBACK GS_getTitleInfo( char* dest, size_t length ) +void CALLBACK GS_getTitleInfo2( char* dest, size_t length ) { // Just return a generic "GS" title -- a plugin actually implementing this feature // should return a title such as "GSdx" or "ZZogl" instead. --air @@ -375,7 +375,7 @@ static const LegacyApi_ReqMethod s_MethMessReq_GS[] = { "GSsetVsync", (vMeth**)&GSsetVsync, (vMeth*)GS_setVsync }, { "GSsetExclusive", (vMeth**)&GSsetExclusive, (vMeth*)GS_setExclusive }, { "GSchangeSaveState",(vMeth**)&GSchangeSaveState,(vMeth*)GS_changeSaveState }, - { "GSgetTitleInfo", (vMeth**)&GSgetTitleInfo, (vMeth*)GS_getTitleInfo }, + { "GSgetTitleInfo2", (vMeth**)&GSgetTitleInfo2, (vMeth*)GS_getTitleInfo2 }, { NULL } }; diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index 964660591e..1125c735a0 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -386,7 +386,7 @@ void GSFrame::OnUpdateTitle( wxTimerEvent& evt ) double fps = wxGetApp().FpsManager.GetFramerate(); char gsDest[128]; - GSgetTitleInfo( gsDest, sizeof(gsDest) ); + GSgetTitleInfo2( gsDest, sizeof(gsDest) ); const wxChar* limiterStr = L"None"; diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index 9ada2ebaa9..2d09fb884d 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -478,7 +478,7 @@ EXPORT_C GSgetLastTag(uint32* tag) #define snprintf _snprintf #endif -EXPORT_C GSgetTitleInfo(char* dest, size_t length) +EXPORT_C GSgetTitleInfo2(char* dest, size_t length) { if (!s_gs->m_GStitleInfoBuffer[0]) strcpy(dest, "GSdx"); diff --git a/plugins/GSdx/GSdx.def b/plugins/GSdx/GSdx.def index 6484dc6513..f9af4d285b 100644 --- a/plugins/GSdx/GSdx.def +++ b/plugins/GSdx/GSdx.def @@ -42,4 +42,4 @@ EXPORTS GSgetLastTag GSReplay GSBenchmark - GSgetTitleInfo + GSgetTitleInfo2 \ No newline at end of file