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; 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 diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 35b3e7840a..99872fe769 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 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; for (size_t i = 0; i < vfbs_.size(); ++i) { @@ -1158,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_) { 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; 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/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())); diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 4fe6aec2ff..428a4d0228 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -765,6 +765,29 @@ 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; + + 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 350ab3ccb4..f75657e543 100644 Binary files a/Windows/ppsspp.rc and b/Windows/ppsspp.rc differ diff --git a/Windows/resource.h b/Windows/resource.h index 8ebcf38a60..baa91b8b8f 100644 Binary files a/Windows/resource.h and b/Windows/resource.h differ diff --git a/native b/native index b7c8b8ddef..4871c1192d 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit b7c8b8ddef4e22324b768129f53a10382684259a +Subproject commit 4871c1192d54adb9be8f642d4c0303cf359104db