From 858d1d69877c888e514914d6f3963e40e9c8661f Mon Sep 17 00:00:00 2001 From: raven02 Date: Tue, 23 Jul 2013 20:01:31 +0800 Subject: [PATCH 01/10] Framebuffer to memory : Skip frame inline with frameskipping option --- GPU/GLES/Framebuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 8d74b34664..95ec81ad8b 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -1150,7 +1150,8 @@ std::vector FramebufferManager::GetFramebufferList() { void FramebufferManager::DecimateFBOs() { fbo_unbind(); currentRenderVfb_ = 0; - bool thirdFrame = (gpuStats.numFrames % 3 == 0); + int skip = g_Config.iFrameSkip > 0 ? g_Config.iFrameSkip : 3; + bool thirdFrame = (gpuStats.numFrames % skip == 0); bool useFramebufferToMem = g_Config.iRenderingMode != FB_BUFFERED_MODE ? 1 : 0; for (size_t i = 0; i < vfbs_.size(); ++i) { From a0faeb7849ef0098e9b190a282944b6f4552f304 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Tue, 23 Jul 2013 20:26:33 +0800 Subject: [PATCH 02/10] Fix "for The variable 'ringbuffer' is being used without being initialized" in Second Novel Kanojo no Natsu 15 fun no Kioku --- Core/HLE/sceMpeg.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index bbb3f31c6f..3935e02c19 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -392,9 +392,10 @@ u32 sceMpegCreate(u32 mpegAddr, u32 dataPtr, u32 size, u32 ringbufferAddr, u32 f Memory::Memcpy(mpegHandle, "LIBMPEG.001", 12); Memory::Write_U32(-1, mpegHandle + 12); - Memory::Write_U32(ringbufferAddr, mpegHandle + 16); - Memory::Write_U32(ringbuffer.dataUpperBound, mpegHandle + 20); - + if (ringbufferAddr){ + Memory::Write_U32(ringbufferAddr, mpegHandle + 16); + Memory::Write_U32(ringbuffer.dataUpperBound, mpegHandle + 20); + } MpegContext *ctx = new MpegContext; mpegMap[mpegHandle] = ctx; lastMpegHandle = mpegHandle; From 75dcbc0f09209416d4b197578d6de7fb479c85b1 Mon Sep 17 00:00:00 2001 From: The Dax Date: Tue, 23 Jul 2013 16:44:42 -0400 Subject: [PATCH 03/10] Fix warning in sceNet.cpp. --- Core/HLE/sceNet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 6b88d4dd5c..110c2ab89e 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -306,7 +306,7 @@ int sceNetEtherNtostr(const char *mac, u32 bufferPtr) { DEBUG_LOG(HLE, "UNTESTED sceNetEtherNtostr(%s, %x)", mac, bufferPtr); if(Memory::IsValidAddress(bufferPtr)) { size_t len = strlen(mac); - for (int i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) Memory::Write_U8(mac[i], bufferPtr + i); } else From faa2932c881647badd618d7ac5ab8429d44dbaa2 Mon Sep 17 00:00:00 2001 From: The Dax Date: Tue, 23 Jul 2013 17:05:58 -0400 Subject: [PATCH 04/10] Update F5 key behaviour to cycle all buffered rendering modes. --- Windows/WndMainWindow.cpp | 22 ++++++++++++++++++++++ Windows/ppsspp.rc | Bin 38622 -> 38660 bytes Windows/resource.h | Bin 25386 -> 25488 bytes 3 files changed, 22 insertions(+) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 186ef02bca..7978b44d51 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -743,6 +743,28 @@ namespace MainWindow setRenderingMode(3); break; + case ID_OPTIONS_BUFFEREDRENDERINGDUMMY: + g_Config.iRenderingMode = ++g_Config.iRenderingMode > 3? 0 : g_Config.iRenderingMode; + + switch(g_Config.iRenderingMode) { + case 0: + osm.Show(g->T("Non-Buffered Rendering")); + break; + case 1: + osm.Show(g->T("Buffered Rendering")); + break; + case 2: + osm.Show(g->T("Read Framebuffer to Memory (CPU)")); + break; + case 3: + osm.Show(g->T("Read Framebuffer to Memory (GPU)")); + break; + } + + setRenderingMode(g_Config.iRenderingMode); + + break; + case ID_OPTIONS_SHOWDEBUGSTATISTICS: g_Config.bShowDebugStats = !g_Config.bShowDebugStats; break; diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 699669b4783c038e2733e19e858b8fa508f6f34b..b092e902440f2bd17f1747ba22f35af42718adc7 100644 GIT binary patch delta 65 zcmcb&mZ@bO(}n|roGuKZ489D$43U#B3TsbJ5ER(_OYlUDv;u<$gByb>g91YdLq3B7 VLo!1pLo!1SLn?#j=7V{%8UTpI5zznu delta 25 hcmZo!$8>Kk(}n|rj5?Daa)@qzAowO`^NTzg4FHnH3pxM* diff --git a/Windows/resource.h b/Windows/resource.h index f95a7243be5e6b7d1af304b885adf732f80dcfc6..9440f38c26c71d728940d40f3c2452c97a809e19 100644 GIT binary patch delta 40 wcmZ2=jB&zo#tlsglN-2%Ci}T43A!+ZGWat1GDI>cFqkqJFc@r3OgPB|01i|OV*mgE delta 22 ecmbPmoN?7L#tlsglLeSqCL6f3Z2pk2fC&I Date: Tue, 23 Jul 2013 17:08:42 -0400 Subject: [PATCH 05/10] Add a couple comments. --- Windows/WndMainWindow.cpp | 1 + Windows/resource.h | Bin 25488 -> 25656 bytes 2 files changed, 1 insertion(+) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 7978b44d51..f63d39fdfa 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -743,6 +743,7 @@ namespace MainWindow setRenderingMode(3); break; + // Dummy option to let the buffered rendering hotkey cycle through all the options case ID_OPTIONS_BUFFEREDRENDERINGDUMMY: g_Config.iRenderingMode = ++g_Config.iRenderingMode > 3? 0 : g_Config.iRenderingMode; diff --git a/Windows/resource.h b/Windows/resource.h index 9440f38c26c71d728940d40f3c2452c97a809e19..b3e8e9c6ff5f0dc5506d0263fca9092e048a669c 100644 GIT binary patch delta 187 zcmYk0u?@m76hvR>+2IS(QDlkK%n(SNIKr_}u!~e#0hC3MkPsWd3`~RgRjSjw;@w@} z+3SiP4;t9+8md7iwOXlDGHzf From f79de0b5411615ccab9cf3fbb7c82dd4514b5805 Mon Sep 17 00:00:00 2001 From: raven02 Date: Wed, 24 Jul 2013 22:46:47 +0800 Subject: [PATCH 06/10] Max frameskip as 8 and code cleanup --- GPU/GLES/Framebuffer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 55610381a9..96a4eeafc0 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -1150,8 +1150,8 @@ std::vector FramebufferManager::GetFramebufferList() { void FramebufferManager::DecimateFBOs() { fbo_unbind(); currentRenderVfb_ = 0; - int skip = g_Config.iFrameSkip > 0 ? g_Config.iFrameSkip : 3; - bool thirdFrame = (gpuStats.numFrames % skip == 0); + int num = g_Config.iFrameSkip > 0 ? g_Config.iFrameSkip - 1 : 3; + bool skipFrame = (gpuStats.numFrames % num == 0); bool useFramebufferToMem = g_Config.iRenderingMode != FB_BUFFERED_MODE ? 1 : 0; for (size_t i = 0; i < vfbs_.size(); ++i) { @@ -1159,10 +1159,9 @@ void FramebufferManager::DecimateFBOs() { int age = frameLastFramebufUsed - vfb->last_frame_used; if(useFramebufferToMem) { - // Every third frame we'll commit framebuffers to memory - if(thirdFrame && age <= FBO_OLD_AGE) { + // Commit framebuffers to memory + if(skipFrame && age <= FBO_OLD_AGE) ReadFramebufferToMemory(vfb); - } } if (vfb == displayFramebuf_ || vfb == prevDisplayFramebuf_ || vfb == prevPrevDisplayFramebuf_) { From cffb397fbf37cc0c6d983935bfe578cdf91d4ce9 Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 25 Jul 2013 00:01:00 +0800 Subject: [PATCH 07/10] Fall the depth test to the simplest and correct one --- GPU/GLES/StateMapping.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMapping.cpp index 702fd0f613..6b7a53cc93 100644 --- a/GPU/GLES/StateMapping.cpp +++ b/GPU/GLES/StateMapping.cpp @@ -215,15 +215,9 @@ void TransformDrawEngine::ApplyDrawState(int prim) { // Depth Test bool depthMask = (gstate.clearmode >> 10) & 1; - if (gstate.isDepthTestEnabled()) { - glstate.depthTest.enable(); - glstate.depthFunc.set(GL_ALWAYS); - glstate.depthWrite.set(depthMask || !gstate.isDepthWriteEnabled() ? GL_TRUE : GL_FALSE); - } else { - glstate.depthTest.enable(); - glstate.depthFunc.set(GL_ALWAYS); - glstate.depthWrite.set(GL_TRUE); - } + glstate.depthTest.enable(); + glstate.depthFunc.set(GL_ALWAYS); + glstate.depthWrite.set(depthMask ? GL_TRUE : GL_FALSE); // Color Test bool colorMask = (gstate.clearmode >> 8) & 1; From 629a134946e530c3d81ae24b9392fa4bf70f052b Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 25 Jul 2013 00:29:05 +0800 Subject: [PATCH 08/10] Fix divide by 0 bug --- GPU/GLES/Framebuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 96a4eeafc0..99872fe769 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -1150,7 +1150,7 @@ std::vector FramebufferManager::GetFramebufferList() { void FramebufferManager::DecimateFBOs() { fbo_unbind(); currentRenderVfb_ = 0; - int num = g_Config.iFrameSkip > 0 ? g_Config.iFrameSkip - 1 : 3; + int num = g_Config.iFrameSkip > 0 && g_Config.iFrameSkip != 9 ? g_Config.iFrameSkip : 3; bool skipFrame = (gpuStats.numFrames % num == 0); bool useFramebufferToMem = g_Config.iRenderingMode != FB_BUFFERED_MODE ? 1 : 0; From 6551db82a18c0ac981f345e8f22e85fbcf8bef7f Mon Sep 17 00:00:00 2001 From: The Dax Date: Wed, 24 Jul 2013 17:25:44 -0400 Subject: [PATCH 09/10] NewUI: Allow Unlock CPU Speed to be set to 0 with the slider bar. If the minimum is kept at 1, it can't be turned off otherwise. --- UI/GameSettingsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index fc53bb8c81..a8da85390d 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -262,7 +262,7 @@ void GameSettingsScreen::CreateViews() { tabHolder->AddTab("System", systemSettingsScroll); systemSettings->Add(new CheckBox(&g_Config.bJit, s->T("Dynarec", "Dynarec (JIT)"))); systemSettings->Add(new CheckBox(&g_Config.bFastMemory, s->T("Fast Memory", "Fast Memory (Unstable)"))); - systemSettings->Add(new PopupSliderChoice(&g_Config.iLockedCPUSpeed, 1, 1000, gs->T("Unlock CPU Clock"), screenManager())); + systemSettings->Add(new PopupSliderChoice(&g_Config.iLockedCPUSpeed, 0, 1000, gs->T("Unlock CPU Clock"), screenManager())); systemSettings->Add(new CheckBox(&g_Config.bDayLightSavings, s->T("Day Light Saving"))); static const char *dateFormat[] = { "YYYYMMDD", "MMDDYYYY", "DDMMYYYY"}; systemSettings->Add(new PopupMultiChoice(&g_Config.iDateFormat, gs->T("Date Format"), dateFormat, 1, 3, s, screenManager())); From 79990fe01d09fead87ab86d026e289f6bb8fd459 Mon Sep 17 00:00:00 2001 From: Sacha Date: Thu, 25 Jul 2013 14:29:12 +1000 Subject: [PATCH 10/10] Implement parts of the new input system for Blackberry and Qt. Touchscreen now works again. --- Qt/QtHost.cpp | 16 ++++++++++++++++ Qt/qtemugl.cpp | 14 ++++++++++++++ native | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Qt/QtHost.cpp b/Qt/QtHost.cpp index f0d7f94b0d..ba03f98ac7 100644 --- a/Qt/QtHost.cpp +++ b/Qt/QtHost.cpp @@ -421,6 +421,22 @@ void NativeUpdate(InputState &input) screenManager->update(input); } +void NativeTouch(const TouchInput &touch) { + if (screenManager) + screenManager->touch(touch); +} + +void NativeKey(const KeyInput &key) { + g_buttonTracker.Process(key); + if (screenManager) + screenManager->key(key); +} + +void NativeAxis(const AxisInput &key) { + if (screenManager) + screenManager->axis(key); +} + void NativeShutdownGraphics() { delete uiTexture; diff --git a/Qt/qtemugl.cpp b/Qt/qtemugl.cpp index 0f4c5a91e7..973a005d9b 100644 --- a/Qt/qtemugl.cpp +++ b/Qt/qtemugl.cpp @@ -38,12 +38,26 @@ void QtEmuGL::mouseDoubleClickEvent(QMouseEvent *) void QtEmuGL::mousePressEvent(QMouseEvent *e) { + TouchInput input; input_state->pointer_down[0] = true; input_state->pointer_x[0] = e->x(); input_state->pointer_y[0] = e->y(); + + input.x = e->x(); + input.y = e->y(); + input.flags = TOUCH_DOWN; + input.id = 0; + NativeTouch(input); } void QtEmuGL::mouseReleaseEvent(QMouseEvent *e) { + TouchInput input; input_state->pointer_down[0] = false; + + input.x = e->x(); + input.y = e->y(); + input.flags = TOUCH_UP; + input.id = 0; + NativeTouch(input); } diff --git a/native b/native index b7c8b8ddef..4871c1192d 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit b7c8b8ddef4e22324b768129f53a10382684259a +Subproject commit 4871c1192d54adb9be8f642d4c0303cf359104db