From de2d3603a0fd8ef31dafb1b0acbdd9d707f3cceb Mon Sep 17 00:00:00 2001 From: gabest11 Date: Sun, 16 Aug 2009 16:45:26 +0000 Subject: [PATCH] GSdx: corrected recording code. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1637 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/windows/VCprojects/pcsx2.vcxproj | 1 + pcsx2/windows/VCprojects/pcsx2.vcxproj.filters | 3 +++ plugins/GSdx/GS.cpp | 10 +++++++--- plugins/GSdx/GSDevice.cpp | 2 +- plugins/GSdx/GSRenderer.cpp | 18 ++++-------------- plugins/GSdx/GSRenderer.h | 3 +-- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/pcsx2/windows/VCprojects/pcsx2.vcxproj b/pcsx2/windows/VCprojects/pcsx2.vcxproj index f640abdb8e..54cc63b2d6 100644 --- a/pcsx2/windows/VCprojects/pcsx2.vcxproj +++ b/pcsx2/windows/VCprojects/pcsx2.vcxproj @@ -731,6 +731,7 @@ + diff --git a/pcsx2/windows/VCprojects/pcsx2.vcxproj.filters b/pcsx2/windows/VCprojects/pcsx2.vcxproj.filters index 4caba0668a..1631567454 100644 --- a/pcsx2/windows/VCprojects/pcsx2.vcxproj.filters +++ b/pcsx2/windows/VCprojects/pcsx2.vcxproj.filters @@ -1110,6 +1110,9 @@ Ps2\EmotionEngine\VUmicro\Dynarec\microVU + + Ps2\EmotionEngine\VUmicro\Dynarec\microVU + Ps2\EmotionEngine\VUmicro\Dynarec\microVU diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index 8a104f56fc..ec0c53f555 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -289,10 +289,14 @@ EXPORT_C GSirqCallback(void (*irq)()) s_irq = irq; } - -EXPORT_C_(int) GSsetupRecording(int start, void* pData) +EXPORT_C_(int) GSsetupRecording(int start, void* data) { - s_gs->ToggleRecord(); + GSKeyEventData e; + + e.type = KEYPRESS; + e.key = VK_F12; + + s_gs->KeyEvent(&e, start & 1); return 1; } diff --git a/plugins/GSdx/GSDevice.cpp b/plugins/GSdx/GSDevice.cpp index 32c0b01d31..8d1dd4007a 100644 --- a/plugins/GSdx/GSDevice.cpp +++ b/plugins/GSdx/GSDevice.cpp @@ -25,7 +25,7 @@ GSDevice::GSDevice() : m_wnd(NULL) - , m_rbswapped(true) //(GScapture) was false before, but seems to be needed now (rama) + , m_rbswapped(false) , m_backbuffer(NULL) , m_merge(NULL) , m_weavebob(NULL) diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index 2e25684a94..9191041263 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -375,7 +375,7 @@ void GSRenderer::VSync(int field) if(offscreen->Map(m)) { - m_capture.DeliverFrame(m.bits, m.pitch, m_dev->IsRBSwapped()); + m_capture.DeliverFrame(m.bits, m.pitch, !m_dev->IsRBSwapped()); offscreen->Unmap(); } @@ -403,17 +403,7 @@ bool GSRenderer::MakeSnapshot(const string& path) return true; } -void GSRenderer::ToggleRecord(void) -{ - if(m_capture.IsCapturing()){ - m_capture.EndCapture(); - } - else { - m_capture.BeginCapture(GetFPS()); - } -} - -void GSRenderer::KeyEvent(GSKeyEventData* e) +void GSRenderer::KeyEvent(GSKeyEventData* e, int param) { if(e->type == KEYPRESS) { @@ -433,8 +423,8 @@ void GSRenderer::KeyEvent(GSKeyEventData* e) m_shader = (m_shader + 3 + step) % 3; return; case VK_F12: - if(m_capture.IsCapturing()) m_capture.EndCapture(); - else m_capture.BeginCapture(GetFPS()); + if(param) m_capture.BeginCapture(GetFPS()); + else m_capture.EndCapture(); return; case VK_DELETE: m_aa1 = !m_aa1; diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index 2f4118da92..378ab45afb 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -76,8 +76,7 @@ public: virtual bool Create(const string& title, int w, int h); virtual void VSync(int field); virtual bool MakeSnapshot(const string& path); - virtual void KeyEvent(GSKeyEventData* e); - virtual void ToggleRecord(); + virtual void KeyEvent(GSKeyEventData* e, int param = 0); virtual bool CanUpscale() { return !m_nativeres && m_regs->PMODE.EN != 0; // upscale ratio depends on the display size, with no output it may not be set correctly (ps2 logo to game transition)