mirror of https://github.com/PCSX2/pcsx2.git
Avih (of Firefox plugin "Smoothwheel" fame ;) ) worked on bringing back that extended GSdx information we lost in the merge to the new WX Gui.
Here's his changelog: GSdx, PCSX2: Fixed broken GS info at the title bar * If the plugin doesn't support the API, PCSX2 will display only the image mode (progressive/interlaced field/frame), NON i18n! * If the plugin does support the API, PCSX2 will not display the image mode, and instead display the info from the plugin * GSdx now properly sends title info: resolution, image mode, deinterlace mode (weave - bff, etc) * To enable the full GSdx title info as it used to work before it got broken: uncomment //#define GSTITLEINFO_API_FORCE_VERBOSE at GS.h of GSdx. NOTE: When using an older pcsx2.exe with newer GS plugin, the title would contain duplicate image mode info. All other combos work fine. * PCSX2 still displays the performance info, etc in the title bar. Thanks a bunch for bringing this information back, Avih! :) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4070 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
cc9461471b
commit
1b1f112533
|
@ -186,10 +186,13 @@ static void CALLBACK GS_printf(int timeout, char *fmt, ...)
|
|||
}
|
||||
|
||||
void CALLBACK GS_getTitleInfo( char dest[128] )
|
||||
{
|
||||
dest[0] = 'G';
|
||||
dest[1] = 'S';
|
||||
dest[2] = 0;
|
||||
{//default GS title reply if not supported by the plugin: provide the info we can: interlace mode only
|
||||
//NOTE: i18n is ignored here. Since the api is ascii7, result is plain ascii english
|
||||
const u64& smode2 = *(u64*)PS2GS_BASE(GS_SMODE2);
|
||||
sprintf(dest, "%s (%s)",
|
||||
(smode2 & 1) ? "Interlaced" : "Progressive",
|
||||
(smode2 & 2) ? "frame" : "field"
|
||||
);
|
||||
}
|
||||
|
||||
// This legacy passthrough function is needed because the old GS plugins tended to assume that
|
||||
|
|
|
@ -410,13 +410,12 @@ void GSFrame::OnUpdateTitle( wxTimerEvent& evt )
|
|||
|
||||
const u64& smode2 = *(u64*)PS2GS_BASE(GS_SMODE2);
|
||||
|
||||
SetTitle( pxsFmt( L"%s | %s (%s) | Limiter: %s | fps: %6.02f%s",
|
||||
|
||||
|
||||
SetTitle( pxsFmt( L"GS | %s | Limiter: %s | fps: %6.02f%s",
|
||||
fromUTF8(gsDest).c_str(),
|
||||
(smode2 & 1) ? L"Interlaced" : L"Progressive",
|
||||
(smode2 & 2) ? L"frame" : L"field",
|
||||
limiterStr, fps, cpuUsage.c_str() )
|
||||
);
|
||||
|
||||
//States_GetCurrentSlot()
|
||||
}
|
||||
|
||||
|
|
|
@ -474,7 +474,12 @@ EXPORT_C GSgetLastTag(uint32* tag)
|
|||
|
||||
EXPORT_C GSgetTitleInfo(char dest[128])
|
||||
{
|
||||
//s_gs->GetWindowTitle
|
||||
if (!TryEnterCriticalSection(&(s_gs->m_pGSsetTitle_Crit)))
|
||||
return; //for performance's sake, no one would miss a single title update
|
||||
|
||||
strncpy(dest, s_gs->m_GStitleInfoBuffer, sizeof(s_gs->m_GStitleInfoBuffer)-1);
|
||||
LeaveCriticalSection(&(s_gs->m_pGSsetTitle_Crit));
|
||||
|
||||
}
|
||||
|
||||
EXPORT_C GSsetFrameSkip(int frameskip)
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
#define MAX_PAGES 512
|
||||
#define MAX_BLOCKS 16384
|
||||
|
||||
//if defined, will send much info in reply to the API title info queri from PCSX2
|
||||
//default should be undefined
|
||||
//#define GSTITLEINFO_API_FORCE_VERBOSE
|
||||
|
||||
#include "GSVector.h"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
|
|
@ -48,6 +48,8 @@ GSRenderer::GSRenderer()
|
|||
s_save = !!theApp.GetConfig("save", 0);
|
||||
s_savez = !!theApp.GetConfig("savez", 0);
|
||||
s_saven = theApp.GetConfig("saven", 0);
|
||||
|
||||
InitializeCriticalSection(&m_pGSsetTitle_Crit);
|
||||
}
|
||||
|
||||
GSRenderer::~GSRenderer()
|
||||
|
@ -60,6 +62,7 @@ GSRenderer::~GSRenderer()
|
|||
_aligned_free( m_tex_buff );
|
||||
|
||||
delete m_dev;
|
||||
DeleteCriticalSection(&m_pGSsetTitle_Crit);
|
||||
}
|
||||
|
||||
bool GSRenderer::CreateWnd(const string& title, int w, int h)
|
||||
|
@ -307,7 +310,7 @@ void GSRenderer::VSync(int field)
|
|||
|
||||
// osd
|
||||
|
||||
if((m_perfmon.GetFrame() & 0x1f) == 0 && m_wnd.IsManaged())
|
||||
if((m_perfmon.GetFrame() & 0x1f) == 0)
|
||||
{
|
||||
m_perfmon.Update();
|
||||
|
||||
|
@ -317,33 +320,68 @@ void GSRenderer::VSync(int field)
|
|||
|
||||
GSVector4i r = GetDisplayRect();
|
||||
|
||||
string s = format(
|
||||
"%I64d | %d x %d | %.2f fps (%d%%) | %s - %s | %s | %d/%d/%d | %d%% CPU | %.2f | %.2f",
|
||||
m_perfmon.GetFrame(), r.width(), r.height(), fps, (int)(100.0 * fps / GetFPS()),
|
||||
s2.c_str(),
|
||||
GSSettingsDlg::g_interlace[m_interlace].name.c_str(),
|
||||
GSSettingsDlg::g_aspectratio[m_aspectratio].name.c_str(),
|
||||
(int)m_perfmon.Get(GSPerfMon::Quad),
|
||||
(int)m_perfmon.Get(GSPerfMon::Prim),
|
||||
(int)m_perfmon.Get(GSPerfMon::Draw),
|
||||
m_perfmon.CPU(),
|
||||
m_perfmon.Get(GSPerfMon::Swizzle) / 1024,
|
||||
m_perfmon.Get(GSPerfMon::Unswizzle) / 1024
|
||||
);
|
||||
string s;
|
||||
|
||||
double fillrate = m_perfmon.Get(GSPerfMon::Fillrate);
|
||||
#ifdef GSTITLEINFO_API_FORCE_VERBOSE
|
||||
if (1)//force verbose reply
|
||||
#else
|
||||
if (m_wnd.IsManaged())
|
||||
#endif
|
||||
{//GSdx owns the window's title, be verbose.
|
||||
s = format(
|
||||
"%I64d | %d x %d | %.2f fps (%d%%) | %s - %s | %s | %d/%d/%d | %d%% CPU | %.2f | %.2f",
|
||||
m_perfmon.GetFrame(), r.width(), r.height(), fps, (int)(100.0 * fps / GetFPS()),
|
||||
s2.c_str(),
|
||||
GSSettingsDlg::g_interlace[m_interlace].name.c_str(),
|
||||
GSSettingsDlg::g_aspectratio[m_aspectratio].name.c_str(),
|
||||
(int)m_perfmon.Get(GSPerfMon::Quad),
|
||||
(int)m_perfmon.Get(GSPerfMon::Prim),
|
||||
(int)m_perfmon.Get(GSPerfMon::Draw),
|
||||
m_perfmon.CPU(),
|
||||
m_perfmon.Get(GSPerfMon::Swizzle) / 1024,
|
||||
m_perfmon.Get(GSPerfMon::Unswizzle) / 1024
|
||||
);
|
||||
|
||||
double fillrate = m_perfmon.Get(GSPerfMon::Fillrate);
|
||||
|
||||
if(fillrate > 0)
|
||||
{
|
||||
s += format(" | %.2f mpps", fps * fillrate / (1024 * 1024));
|
||||
}
|
||||
|
||||
if(fillrate > 0)
|
||||
{
|
||||
s += format(" | %.2f mpps", fps * fillrate / (1024 * 1024));
|
||||
}
|
||||
else
|
||||
{//Satisfy PCSX2's request for title info: minimal verbosity due to more external title text
|
||||
s = format(
|
||||
"%dx%d | %s - %s",
|
||||
r.width(), r.height(),
|
||||
s2.c_str(),
|
||||
GSSettingsDlg::g_interlace[m_interlace].name.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if(m_capture.IsCapturing())
|
||||
{
|
||||
s += " | Recording...";
|
||||
}
|
||||
|
||||
m_wnd.SetWindowText(s.c_str());
|
||||
if (m_wnd.IsManaged())
|
||||
{
|
||||
m_wnd.SetWindowText(s.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!TryEnterCriticalSection(&m_pGSsetTitle_Crit))
|
||||
return; //for performance's sake, no one would miss a single title update
|
||||
|
||||
strncpy(m_GStitleInfoBuffer, s.c_str(), sizeof(m_GStitleInfoBuffer)-1);
|
||||
m_GStitleInfoBuffer[sizeof(m_GStitleInfoBuffer)-1]=0;//make sure null terminated even if text overflows
|
||||
|
||||
LeaveCriticalSection(&m_pGSsetTitle_Crit);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -107,6 +107,10 @@ public:
|
|||
// TODO : Implement proper locking here *if needed* (not sure yet if it is) --air
|
||||
uint8* GetTextureBufferLock() { return m_tex_buff; }
|
||||
void ReleaseTextureBufferLock() { }
|
||||
|
||||
public:
|
||||
CRITICAL_SECTION m_pGSsetTitle_Crit;
|
||||
char m_GStitleInfoBuffer[128];
|
||||
};
|
||||
|
||||
template<class Vertex> class GSRendererT : public GSRenderer
|
||||
|
|
|
@ -42,3 +42,4 @@ EXPORTS
|
|||
GSgetLastTag
|
||||
GSReplay
|
||||
GSBenchmark
|
||||
GSgetTitleInfo
|
||||
|
|
Loading…
Reference in New Issue