From d28dbffe685ea1519de22cb5dfdcd41b763bc205 Mon Sep 17 00:00:00 2001 From: raven02 Date: Wed, 3 Jul 2013 08:13:16 +0800 Subject: [PATCH 01/13] Fix uninitialized variable in PSPMsgDialog --- Core/Dialog/PSPMsgDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Dialog/PSPMsgDialog.cpp b/Core/Dialog/PSPMsgDialog.cpp index 46a82a82dd..e9a7d16048 100755 --- a/Core/Dialog/PSPMsgDialog.cpp +++ b/Core/Dialog/PSPMsgDialog.cpp @@ -181,7 +181,7 @@ void PSPMsgDialog::DisplayMessage(std::string text, bool hasYesNo) I18NCategory *d = GetI18NCategory("Dialog"); float x, w; x = 240.0f; - w = w / 2.0f + 16.0f; + w = 15.0f; h /= 2.0f; float y2 = y + h2 + 10.0f; h2 += h + 4.0f; From d43a2f4d0623c3e74398f546b7df6dca44bd2b5e Mon Sep 17 00:00:00 2001 From: raven02 Date: Wed, 3 Jul 2013 08:39:45 +0800 Subject: [PATCH 02/13] Fix stencil issue in MotoGP --- GPU/GLES/StateMapping.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMapping.cpp index 360e3d8f7c..acd3523a45 100644 --- a/GPU/GLES/StateMapping.cpp +++ b/GPU/GLES/StateMapping.cpp @@ -234,12 +234,9 @@ void TransformDrawEngine::ApplyDrawState(int prim) { glstate.colorMask.set(colorMask, colorMask, colorMask, alphaMask); // Stencil Test - if (gstate.isStencilTestEnabled()) { - glstate.stencilTest.enable(); - glstate.stencilOp.set(GL_REPLACE, GL_REPLACE, GL_REPLACE); - glstate.stencilFunc.set(GL_ALWAYS, 0, 0xFF); - } else - glstate.stencilTest.disable(); + glstate.stencilTest.enable(); + glstate.stencilOp.set(GL_REPLACE, GL_REPLACE, GL_REPLACE); + glstate.stencilFunc.set(GL_ALWAYS, 0, 0xFF); } else { From defe7505581b1d6974572ef132293d26fa972c66 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 2 Jul 2013 22:59:47 -0700 Subject: [PATCH 03/13] Update debugger UI on the debugger's threads. --- Windows/Debugger/DebuggerShared.h | 4 +++- Windows/Debugger/Debugger_Disasm.cpp | 7 ++++++- Windows/Debugger/Debugger_Disasm.h | 3 --- Windows/Debugger/Debugger_MemoryDlg.cpp | 5 +++++ Windows/WindowsHost.cpp | 18 ++++++++++++------ 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Windows/Debugger/DebuggerShared.h b/Windows/Debugger/DebuggerShared.h index 97ff067275..be55ec8eb8 100644 --- a/Windows/Debugger/DebuggerShared.h +++ b/Windows/Debugger/DebuggerShared.h @@ -8,7 +8,9 @@ enum { WM_DEB_RUNTOWPARAM = WM_USER+2, WM_DEB_REMOVEBREAKPOINT, WM_DEB_GOTOADDRESSEDIT, WM_DEB_MAPLOADED, - WM_DEB_TABPRESSED + WM_DEB_TABPRESSED, + WM_DEB_SETDEBUGLPARAM, + WM_DEB_UPDATE, }; bool executeExpressionWindow(HWND hwnd, DebugInterface* cpu, u32& dest); diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 2d581eab66..b8a34a62a5 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -784,9 +784,14 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) } break; - case WM_DISASM_SETDEBUG: + case WM_DEB_SETDEBUGLPARAM: SetDebugMode(lParam != 0); return TRUE; + + case WM_DEB_UPDATE: + Update(); + return TRUE; + case WM_DEB_TABPRESSED: { HWND bp = GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST); diff --git a/Windows/Debugger/Debugger_Disasm.h b/Windows/Debugger/Debugger_Disasm.h index 163af28f47..b38d73db1e 100644 --- a/Windows/Debugger/Debugger_Disasm.h +++ b/Windows/Debugger/Debugger_Disasm.h @@ -14,9 +14,6 @@ #include -// Takes lParam for debug mode, zero or non zero. -const int WM_DISASM_SETDEBUG = WM_APP + 0; - class CtrlThreadList; class CDisasm : public Dialog diff --git a/Windows/Debugger/Debugger_MemoryDlg.cpp b/Windows/Debugger/Debugger_MemoryDlg.cpp index 18bd81376b..292a891777 100644 --- a/Windows/Debugger/Debugger_MemoryDlg.cpp +++ b/Windows/Debugger/Debugger_MemoryDlg.cpp @@ -177,6 +177,11 @@ BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) } break; } + + case WM_DEB_UPDATE: + Update(); + return TRUE; + case WM_INITDIALOG: { return TRUE; diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 77dd9d8760..7bf05e021e 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -25,9 +25,10 @@ #include "WndMainWindow.h" #include "OpenGLBase.h" -#include "../Windows/Debugger/Debugger_Disasm.h" -#include "../Windows/Debugger/Debugger_MemoryDlg.h" -#include "../Core/Debugger/SymbolMap.h" +#include "Windows/Debugger/DebuggerShared.h" +#include "Windows/Debugger/Debugger_Disasm.h" +#include "Windows/Debugger/Debugger_MemoryDlg.h" +#include "Core/Debugger/SymbolMap.h" #include "main.h" @@ -45,6 +46,11 @@ int MyMix(short *buffer, int numSamples, int bits, int rate, int channels) } } +static BOOL PostDialogMessage(Dialog *dialog, UINT message, WPARAM wParam = 0, LPARAM lParam = 0) +{ + return PostMessage(dialog->GetDlgHandle(), message, wParam, lParam); +} + bool WindowsHost::InitGL(std::string *error_message) { return GL_Init(MainWindow::GetDisplayHWND(), error_message); @@ -112,14 +118,14 @@ void WindowsHost::UpdateMemView() { for (int i=0; iUpdate(); + PostDialogMessage(memoryWindow[i], WM_DEB_UPDATE); } void WindowsHost::UpdateDisassembly() { for (int i=0; iUpdate(); + PostDialogMessage(disasmWindow[i], WM_DEB_UPDATE); } void WindowsHost::SetDebugMode(bool mode) @@ -127,7 +133,7 @@ void WindowsHost::SetDebugMode(bool mode) for (int i = 0; i < numCPUs; i++) { if (disasmWindow[i]) - PostMessage(disasmWindow[i]->GetDlgHandle(), WM_DISASM_SETDEBUG, 0, (LPARAM)mode); + PostDialogMessage(disasmWindow[i], WM_DEB_SETDEBUGLPARAM, 0, (LPARAM)mode); } } From c4c95692b79f72951bbed92c19ea5aef93a17350 Mon Sep 17 00:00:00 2001 From: raven02 Date: Sun, 30 Jun 2013 15:43:40 +0800 Subject: [PATCH 04/13] Toggle to bind right analog stick --- UI/MenuScreens.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index f92f2d59d7..81aa1f2048 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -1365,7 +1365,36 @@ void ControlsScreen::render() { UICheckBox(GEN_ID, x, y += stride, c->T("OnScreen", "On-Screen Touch Controls"), ALIGN_TOPLEFT, &g_Config.bShowTouchControls); UICheckBox(GEN_ID, x, y += stride, c->T("Tilt", "Tilt to Analog (horizontal)"), ALIGN_TOPLEFT, &g_Config.bAccelerometerToAnalogHoriz); if (g_Config.bShowTouchControls) { - UICheckBox(GEN_ID, x, y += stride, c->T("Show Analog Stick"), ALIGN_TOPLEFT, &g_Config.bShowAnalogStick); + UICheckBox(GEN_ID, x, y += stride, c->T("Show Left Analog Stick"), ALIGN_TOPLEFT, &g_Config.bShowAnalogStick); + bool rightstick = g_Config.iRightStickBind > 0; + UICheckBox(GEN_ID, x, y += stride, c->T("Bind Right Analog Stick"), ALIGN_TOPLEFT, &rightstick); + if (rightstick) { + if (g_Config.iRightStickBind <= 0 ) + g_Config.iRightStickBind = 1; + + char showType[256]; + std::string type; + switch (g_Config.iRightStickBind) { + case 1: type = "Arrow Buttons";break; + case 2: type = "Face Buttons";break; + case 3: type = "L/R";break; + case 4: type = "L/R + Triangle/Cross";break; + } + sprintf(showType, "%s %s", c->T("Target :"), type.c_str()); + ui_draw2d.DrawText(UBUNTU24, showType, x + 60, (y += stride) , 0xFFFFFFFF, ALIGN_LEFT); + HLinear hlinear1(x + 60 , y+= stride + 5, 10); + if (UIButton(GEN_ID, hlinear1, 200, 0, c->T("Arrow Buttons"), ALIGN_LEFT)) + g_Config.iRightStickBind = 1; + if (UIButton(GEN_ID, hlinear1, 200, 0, c->T("Face Buttons"), ALIGN_LEFT)) + g_Config.iRightStickBind = 2; + if (UIButton(GEN_ID, hlinear1, 60, 0, c->T("L/R"), ALIGN_LEFT)) + g_Config.iRightStickBind = 3; + if (UIButton(GEN_ID, hlinear1, 280, 0, c->T("L/R + Triangle/Cross"), ALIGN_LEFT)) + g_Config.iRightStickBind = 4; + y += 20; + } else + g_Config.iRightStickBind = 0; + UICheckBox(GEN_ID, x, y += stride, c->T("Buttons Scaling"), ALIGN_TOPLEFT, &g_Config.bLargeControls); if (g_Config.bLargeControls) { char scale[256]; From ea1f9e268efbe7df83edb455c8f7b418f54eb1dd Mon Sep 17 00:00:00 2001 From: raven02 Date: Tue, 2 Jul 2013 07:09:32 +0800 Subject: [PATCH 05/13] Toggle to add "Full screen" and "Skip updating PSP Memory" --- UI/MenuScreens.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index 81aa1f2048..11d0c43347 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -818,6 +818,7 @@ void GraphicsScreenP1::render() { bool Vsync = g_Config.iVSyncInterval != 0; UICheckBox(GEN_ID, x, y += stride, gs->T("VSync"), ALIGN_TOPLEFT, &Vsync); g_Config.iVSyncInterval = Vsync ? 1 : 0; + UICheckBox(GEN_ID, x, y += stride, gs->T("Fullscreen"), ALIGN_TOPLEFT, &g_Config.bFullScreen); #endif UICheckBox(GEN_ID, x, y += stride, gs->T("Display Raw Framebuffer"), ALIGN_TOPLEFT, &g_Config.bDisplayFramebuffer); if (UICheckBox(GEN_ID, x, y += stride, gs->T("Buffered Rendering"), ALIGN_TOPLEFT, &g_Config.bBufferedRendering)) { @@ -825,7 +826,13 @@ void GraphicsScreenP1::render() { gpu->Resized(); } if (g_Config.bBufferedRendering) { - if (UICheckBox(GEN_ID, x + 60, y += stride, gs->T("AA", "Anti Aliasing"), ALIGN_TOPLEFT, &g_Config.SSAntiAliasing)) { + bool memory = !g_Config.bFramebuffersToMem; + if (UICheckBox(GEN_ID, x + 60, y += stride, gs->T("Skip updating PSP Memory"), ALIGN_TOPLEFT, &memory)) { + if (gpu) + gpu->Resized(); + } + g_Config.bFramebuffersToMem = memory ? 0 : 1; + if (UICheckBox(GEN_ID, x + 60, y += stride, gs->T("AA", "Anti-aliasing"), ALIGN_TOPLEFT, &g_Config.SSAntiAliasing)) { if (gpu) gpu->Resized(); } From 4ab8b76628d30c57e540b6567323696abeccbb2d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 3 Jul 2013 01:18:37 -0700 Subject: [PATCH 06/13] Update native for Android buildfix. --- native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native b/native index d28b58a203..3db24e97c1 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit d28b58a203dd7fe51b88318b18af83675fa6745d +Subproject commit 3db24e97c11ba5639845ad827afca90094f88943 From f525ea07eb6c71bf3def2daaf2bec09820934013 Mon Sep 17 00:00:00 2001 From: raven02 Date: Wed, 3 Jul 2013 16:31:30 +0800 Subject: [PATCH 07/13] Toggle to unlock CPU speed --- UI/MenuScreens.cpp | 92 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 68 insertions(+), 24 deletions(-) diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index 11d0c43347..92abd55fdb 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -1241,27 +1241,45 @@ void SystemScreen::render() { UICheckBox(GEN_ID, x, y += stride, s->T("Fast Memory", "Fast Memory (unstable)"), ALIGN_TOPLEFT, &g_Config.bFastMemory); bool LockCPUSpeed = g_Config.iLockedCPUSpeed != 0; - UICheckBox(GEN_ID, x, y += stride, s->T("Lock PSP CPU Speed"), ALIGN_TOPLEFT, &LockCPUSpeed); + UICheckBox(GEN_ID, x, y += stride, s->T("Unlock CPU Speed"), ALIGN_TOPLEFT, &LockCPUSpeed); if(LockCPUSpeed) { if(g_Config.iLockedCPUSpeed <= 0) g_Config.iLockedCPUSpeed = 222; char showCPUSpeed[256]; - sprintf(showCPUSpeed, "%s %d", s->T("Locked CPU Speed:"), g_Config.iLockedCPUSpeed); + sprintf(showCPUSpeed, "%s %d", s->T("Clock: "), g_Config.iLockedCPUSpeed); ui_draw2d.DrawText(UBUNTU24, showCPUSpeed, x + 60, (y += stride) - 5, 0xFFFFFFFF, ALIGN_LEFT); + HLinear hlinear1(x + 250, y, 20); + if (UIButton(GEN_ID, hlinear1, 80, 0, s->T("Auto"), ALIGN_LEFT)) + g_Config.iLockedCPUSpeed = 333; + if (UIButton(GEN_ID, hlinear1, 40, 0, s->T("-"), ALIGN_LEFT)) + if (g_Config.iLockedCPUSpeed > 111) + g_Config.iLockedCPUSpeed -= 111; + if (UIButton(GEN_ID, hlinear1, 40, 0, s->T("+"), ALIGN_LEFT)) + if (g_Config.iLockedCPUSpeed < 666) + g_Config.iLockedCPUSpeed += 111; + y += 20; } - else { + else g_Config.iLockedCPUSpeed = 0; + + UICheckBox(GEN_ID, x, y += stride, s->T("Enable Cheats"), ALIGN_TOPLEFT, &g_Config.bEnableCheats); + if (g_Config.bEnableCheats) { + HLinear hlinear1(x + 60, y += stride + 10, 20); + if (UIButton(GEN_ID, hlinear1, LARGE_BUTTON_WIDTH + 50, 0, s->T("Reload Cheats"), ALIGN_TOPLEFT)) + g_Config.bReloadCheats = true; + y += 10; } - //UICheckBox(GEN_ID, x, y += stride, s->T("Daylight Savings"), ALIGN_TOPLEFT, &g_Config.bDayLightSavings); + + y += 20; const char *buttonPreferenceTitle; switch (g_Config.iButtonPreference) { case PSP_SYSTEMPARAM_BUTTON_CIRCLE: - buttonPreferenceTitle = s->T("Button Preference - O to Confirm"); + buttonPreferenceTitle = s->T("Button Pref : O to Confirm"); break; case PSP_SYSTEMPARAM_BUTTON_CROSS: default: - buttonPreferenceTitle = s->T("Button Preference - X to Confirm"); + buttonPreferenceTitle = s->T("Button Pref : X to Confirm"); break; } @@ -1270,15 +1288,55 @@ void SystemScreen::render() { #else const int checkboxH = 48; #endif - ui_draw2d.DrawTextShadow(UBUNTU24, buttonPreferenceTitle, x + UI_SPACE + 29, (y += stride) + checkboxH / 2, 0xFFFFFFFF, ALIGN_LEFT | ALIGN_VCENTER); - y += stride; + ui_draw2d.DrawTextShadow(UBUNTU24, buttonPreferenceTitle, x, (y += stride) + checkboxH / 2, 0xFFFFFFFF, ALIGN_LEFT | ALIGN_VCENTER); // 29 is the width of the checkbox, new UI will replace. - HLinear hlinearButtonPref(x + UI_SPACE + 29, y, 20); + HLinear hlinearButtonPref(x + 400, y, 20); if (UIButton(GEN_ID, hlinearButtonPref, 90, 0, s->T("Use O"), ALIGN_LEFT)) g_Config.iButtonPreference = PSP_SYSTEMPARAM_BUTTON_CIRCLE; if (UIButton(GEN_ID, hlinearButtonPref, 90, 0, s->T("Use X"), ALIGN_LEFT)) g_Config.iButtonPreference = PSP_SYSTEMPARAM_BUTTON_CROSS; - y += 20 + 6; + + y += 20; + + char recents[256]; + sprintf(recents, "%s %i", s->T("Max. No of Recents :"), g_Config.iMaxRecent); + ui_draw2d.DrawText(UBUNTU24, recents, x, y += stride , 0xFFFFFFFF, ALIGN_LEFT); + HLinear hlinear2(x + 400, y, 20); + if (UIButton(GEN_ID, hlinear2, 50, 0, s->T("-1"), ALIGN_LEFT)) + if (g_Config.iMaxRecent > 4) + g_Config.iMaxRecent -= 1; + if (UIButton(GEN_ID, hlinear2, 50, 0, s->T("+1"), ALIGN_LEFT)) + if (g_Config.iMaxRecent < 40) + g_Config.iMaxRecent += 1; + if (UIButton(GEN_ID, hlinear2, 80, 0, s->T("Clear"), ALIGN_LEFT)) { + g_Config.recentIsos.clear(); + } + y += 20; + + + + char lang[256]; + std::string type; + switch (g_Config.ilanguage) { + case 0: type = "日本語";break; + case 1: type = "English";break; + case 2: type = "Français";break; + case 3: type = "Castellano";break; + case 4: type = "Deutsch";break; + case 5: type = "Italiano";break; + case 6: type = "Nederlands";break; + case 7: type = "Português";break; + case 8: type = "한국어";break; + case 9: type = "Русский";break; + case 10: type = "繁體中文";break; + case 11: type = "简体中文";break; + } + sprintf(lang, "%s %s", s->T("System Language :"), type.c_str()); + ui_draw2d.DrawText(UBUNTU24, lang, x, y += stride , 0xFFFFFFFF, ALIGN_LEFT); + HLinear hlinear3(x + 400, y, 20); + if (UIButton(GEN_ID, hlinear3, LARGE_BUTTON_WIDTH, 0, s->T("Language"), ALIGN_TOPLEFT)) { + screenManager()->push(new LanguageScreen()); + } /* bool time = g_Config.iTimeFormat > 0 ; @@ -1330,20 +1388,6 @@ void SystemScreen::render() { g_Config.iDateFormat = 0; */ -#ifndef ANDROID - UICheckBox(GEN_ID, x, y += stride, s->T("Enable Cheats"), ALIGN_TOPLEFT, &g_Config.bEnableCheats); - if (g_Config.bEnableCheats) { - HLinear hlinear1(x + 60, y += stride + 10, 20); - if (UIButton(GEN_ID, hlinear1, LARGE_BUTTON_WIDTH + 50, 0, s->T("Reload Cheats"), ALIGN_TOPLEFT)) - g_Config.bReloadCheats = true; - y += 10; - } -#endif - HLinear hlinear2(x, y += stride + 10, 20); - - if (UIButton(GEN_ID, hlinear2, LARGE_BUTTON_WIDTH, 0, s->T("Language"), ALIGN_TOPLEFT)) { - screenManager()->push(new LanguageScreen()); - } UIEnd(); } From 676c000b8a5438639227df4a7c6b5e6a43d4854d Mon Sep 17 00:00:00 2001 From: Sacha Date: Thu, 4 Jul 2013 01:35:18 +1000 Subject: [PATCH 08/13] Add FFMPEG to Qt Linux x86. Buildfix for CMake --- CMakeLists.txt | 1 + Qt/PPSSPP.pro | 2 ++ Qt/Settings.pri | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 46dcc70081..3e2ca329c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -580,6 +580,7 @@ add_library(native STATIC native/image/zim_save.h native/input/gesture_detector.cpp native/input/gesture_detector.h + native/input/input_state.cpp native/input/input_state.h native/json/json_writer.cpp native/json/json_writer.h diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index aed48f2b9f..c3d94ba222 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -34,6 +34,8 @@ linux { DEFINES += QT_HAS_SDL PKGCONFIG += sdl } + FFMPEG_DIR=../ffmpeg/linux/x86_64/lib/ + LIBS += $${FFMPEG_DIR}libavformat.a $${FFMPEG_DIR}libavcodec.a $${FFMPEG_DIR}libavutil.a $${FFMPEG_DIR}libswresample.a $${FFMPEG_DIR}libswscale.a } } diff --git a/Qt/Settings.pri b/Qt/Settings.pri index c95e2633fe..666abebf26 100644 --- a/Qt/Settings.pri +++ b/Qt/Settings.pri @@ -35,6 +35,10 @@ contains(MEEGO_EDITION,harmattan)|!count(gleslib,0) { # Platform specific contains(MEEGO_EDITION,harmattan): DEFINES += MEEGO_EDITION_HARMATTAN "_SYS_UCONTEXT_H=1" +linux:!mobile_platform: { + DEFINES += USE_FFMPEG + INCLUDEPATH += ../ffmpeg/linux/x86_64/include +} qnx { # Use mkspec: unsupported/qws/qnx-armv7-g++ DEFINES += BLACKBERRY "_QNX_SOURCE=1" "_C99=1" From fbe8a19143a7bf7508ae4af92f0541f985db3126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 3 Jul 2013 17:57:33 +0200 Subject: [PATCH 09/13] When alpha mask is off, don't write to stencil if stencil is off (as alpha and stencil are shared on the PSP, when neither are on nothing should be written to the stencil channel). thanks unknown. --- GPU/GLES/StateMapping.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMapping.cpp index acd3523a45..84cec4b44c 100644 --- a/GPU/GLES/StateMapping.cpp +++ b/GPU/GLES/StateMapping.cpp @@ -126,7 +126,7 @@ void TransformDrawEngine::ApplyDrawState(int prim) { // Set cull bool wantCull = !gstate.isModeClear() && !gstate.isModeThrough() && prim != GE_PRIM_RECTANGLES && gstate.isCullEnabled(); glstate.cullFace.set(wantCull); - if (wantCull) + if (wantCull) glstate.cullFaceMode.set(cullingMode[gstate.getCullMode()]); // TODO: The top bit of the alpha channel should be written to the stencil bit somehow. This appears to require very expensive multipass rendering :( Alternatively, one could do a @@ -234,9 +234,13 @@ void TransformDrawEngine::ApplyDrawState(int prim) { glstate.colorMask.set(colorMask, colorMask, colorMask, alphaMask); // Stencil Test - glstate.stencilTest.enable(); - glstate.stencilOp.set(GL_REPLACE, GL_REPLACE, GL_REPLACE); - glstate.stencilFunc.set(GL_ALWAYS, 0, 0xFF); + if (alphaMask) { + glstate.stencilTest.enable(); + glstate.stencilOp.set(GL_REPLACE, GL_REPLACE, GL_REPLACE); + glstate.stencilFunc.set(GL_ALWAYS, 0, 0xFF); + } else { + glstate.stencilTest.disable(); + } } else { From c8431493be00894dfe276e6e0ff8a9ce8b31bdb4 Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 4 Jul 2013 00:54:44 +0800 Subject: [PATCH 10/13] Fix black screen in non-buffered rendering mode --- GPU/GLES/TextureCache.cpp | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 49bae3c92f..730c3fc3b0 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -979,13 +979,7 @@ void TextureCache::SetTexture() { // Check for FBO - slow! if (entry->framebuffer) { entry->framebuffer->usageFlags |= FB_USAGE_TEXTURE; - if (!g_Config.bBufferedRendering) { - if (entry->framebuffer->fbo) - entry->framebuffer->fbo = 0; - glBindTexture(GL_TEXTURE_2D, 0); - lastBoundTexture = -1; - entry->lastFrame = gpuStats.numFrames; - } else { + if (g_Config.bBufferedRendering) { if (entry->framebuffer->fbo) { fbo_bind_color_as_texture(entry->framebuffer->fbo, 0); } else { @@ -994,19 +988,23 @@ void TextureCache::SetTexture() { gstate_c.skipDrawReason |= SKIPDRAW_BAD_FB_TEXTURE; } UpdateSamplingParams(*entry, false); + // This isn't right. + gstate_c.curTextureWidth = entry->framebuffer->width; + gstate_c.curTextureHeight = entry->framebuffer->height; + gstate_c.flipTexture = true; + gstate_c.textureFullAlpha = entry->framebuffer->format == GE_FORMAT_565; + entry->lastFrame = gpuStats.numFrames; + return; + } else { + if (entry->framebuffer->fbo) + entry->framebuffer->fbo = 0; + glBindTexture(GL_TEXTURE_2D, 0); + lastBoundTexture = -1; + entry->lastFrame = gpuStats.numFrames; } - - // This isn't right. - gstate_c.curTextureWidth = entry->framebuffer->width; - gstate_c.curTextureHeight = entry->framebuffer->height; - int h = 1 << ((gstate.texsize[0] >> 8) & 0xf); - gstate_c.actualTextureHeight = h; - gstate_c.flipTexture = true; - gstate_c.textureFullAlpha = entry->framebuffer->format == GE_FORMAT_565; - entry->lastFrame = gpuStats.numFrames; - return; } - //Validate the texture here (width, height etc) + + // Validate the texture here (width, height etc) int dim = gstate.texsize[0] & 0xF0F; bool match = entry->Matches(dim, format, maxLevel); From ab8c1f5b5fb0871105d27742f3ca41bb734ca159 Mon Sep 17 00:00:00 2001 From: The Dax Date: Wed, 3 Jul 2013 14:37:31 -0400 Subject: [PATCH 11/13] Fix multiple compilation issues for all platforms. --- Common/Common.vcxproj | 2 ++ Common/Common.vcxproj.filters | 2 ++ Common/KeyMap.cpp | 2 +- Common/KeyMap.h | 2 +- Core/HLE/sceCtrl.h | 2 +- Qt/Common.pro | 2 ++ android/jni/Android.mk | 1 + 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index 0095221811..6663b6cb24 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -186,6 +186,7 @@ + @@ -225,6 +226,7 @@ + diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters index 177eccf73e..044653e788 100644 --- a/Common/Common.vcxproj.filters +++ b/Common/Common.vcxproj.filters @@ -46,6 +46,7 @@ Crypto + @@ -76,6 +77,7 @@ Crypto + diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp index 55956ac61d..4ea005343f 100644 --- a/Common/KeyMap.cpp +++ b/Common/KeyMap.cpp @@ -16,7 +16,7 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "input/input_state.h" -#include "Core/Config.h" +#include "../Core/Config.h" #include "KeyMap.h" using namespace KeyMap; diff --git a/Common/KeyMap.h b/Common/KeyMap.h index c72c2d45fa..4b959f365a 100644 --- a/Common/KeyMap.h +++ b/Common/KeyMap.h @@ -20,7 +20,7 @@ #include #include #include "input/keycodes.h" // keyboard keys -#include "Core/HLE/sceCtrl.h" // psp keys +#include "../Core/HLE/sceCtrl.h" // psp keys #define KEYMAP_ERROR_KEY_ALREADY_USED -1 #define KEYMAP_ERROR_UNKNOWN_KEY 0 diff --git a/Core/HLE/sceCtrl.h b/Core/HLE/sceCtrl.h index dd3eabffa8..b25464b98a 100644 --- a/Core/HLE/sceCtrl.h +++ b/Core/HLE/sceCtrl.h @@ -17,7 +17,7 @@ #pragma once -#include "Common/CommonTypes.h" +#include "../Common/CommonTypes.h" class PointerWrap; diff --git a/Qt/Common.pro b/Qt/Common.pro index ed69d9c4c9..93578b5ec2 100755 --- a/Qt/Common.pro +++ b/Qt/Common.pro @@ -37,6 +37,7 @@ SOURCES += ../Common/ColorUtil.cpp \ ../Common/FileUtil.cpp \ ../Common/Hash.cpp \ ../Common/LogManager.cpp \ + ../Common/KeyMap.cpp \ ../Common/MathUtil.cpp \ ../Common/MemArena.cpp \ ../Common/MemoryUtil.cpp \ @@ -56,6 +57,7 @@ HEADERS += ../Common/ChunkFile.h \ ../Common/FileUtil.h \ ../Common/Hash.h \ ../Common/LogManager.h \ + ../Common/KeyMap.cpp \ ../Common/MathUtil.h \ ../Common/MemArena.h \ ../Common/MemoryUtil.h \ diff --git a/android/jni/Android.mk b/android/jni/Android.mk index a5599f8c35..17ab5c6638 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -152,6 +152,7 @@ LOCAL_SRC_FILES := \ $(SRC)/ext/snappy/snappy.cpp \ $(SRC)/ext/xbrz/xbrz.cpp \ $(SRC)/Common/Crypto/md5.cpp \ + $(SRC)/Common/KeyMap.cpp \ $(SRC)/Common/LogManager.cpp \ $(SRC)/Common/MemArena.cpp \ $(SRC)/Common/MemoryUtil.cpp \ From a4764812085f15567532b6c8668f97a04c4d7ac4 Mon Sep 17 00:00:00 2001 From: The Dax Date: Wed, 3 Jul 2013 14:39:18 -0400 Subject: [PATCH 12/13] Fix typo in Common.pro. --- Qt/Common.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qt/Common.pro b/Qt/Common.pro index 93578b5ec2..db597e56d0 100755 --- a/Qt/Common.pro +++ b/Qt/Common.pro @@ -57,7 +57,7 @@ HEADERS += ../Common/ChunkFile.h \ ../Common/FileUtil.h \ ../Common/Hash.h \ ../Common/LogManager.h \ - ../Common/KeyMap.cpp \ + ../Common/KeyMap.h \ ../Common/MathUtil.h \ ../Common/MemArena.h \ ../Common/MemoryUtil.h \ From bccc3c42819d43d2aa9cf1a2a1640b929be52163 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Wed, 3 Jul 2013 22:29:35 +0200 Subject: [PATCH 13/13] Debug interface improvements --- Windows/Debugger/Debugger_Disasm.cpp | 26 ++++++++++++++++++- Windows/Debugger/Debugger_Disasm.h | 1 + Windows/Debugger/Debugger_Lists.cpp | 36 +++++++++++++++++++++++++-- Windows/Debugger/Debugger_Lists.h | 1 + Windows/ppsspp.rc | Bin 43766 -> 43954 bytes Windows/resource.h | Bin 24832 -> 24924 bytes 6 files changed, 61 insertions(+), 3 deletions(-) diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index b8a34a62a5..20a3035cf5 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -558,6 +558,10 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) ptr->gotoPC(); UpdateDialog(); vfpudlg->Update(); + + CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW))->redraw(); + threadList->reloadThreads(); + updateThreadLabel(false); } break; @@ -575,7 +579,7 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) ptr->setDontRedraw(true); u32 breakpointAddress = cpu->GetPC()+cpu->getInstructionSize(0); - if (memcmp(dis,"jal\t",4) == 0) + if (memcmp(dis,"jal\t",4) == 0 || memcmp(dis,"jalr\t",5) == 0) { // it's a function call with a delay slot - skip that too breakpointAddress += cpu->getInstructionSize(0); @@ -844,6 +848,19 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) return FALSE; } +void CDisasm::updateThreadLabel(bool clear) +{ + char label[512]; + if (clear) + { + sprintf(label,"Thread: -"); + } else { + sprintf(label,"Thread: %s",threadList->getCurrentThreadName()); + } + + SetDlgItemText(m_hDlg, IDC_THREADNAME,label); +} + void CDisasm::UpdateSize(WORD width, WORD height) { HWND disasm = GetDlgItem(m_hDlg, IDC_DISASMVIEW); @@ -905,6 +922,7 @@ void CDisasm::SetDebugMode(bool _bDebug) CBreakPoints::ClearTemporaryBreakPoints(); updateBreakpointList(); threadList->reloadThreads(); + updateThreadLabel(false); EnableWindow( GetDlgItem(hDlg, IDC_GO), TRUE); EnableWindow( GetDlgItem(hDlg, IDC_STEP), TRUE); @@ -915,12 +933,18 @@ void CDisasm::SetDebugMode(bool _bDebug) CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW)); ptr->setDontRedraw(false); ptr->gotoPC(); + + CtrlMemView *mem = CtrlMemView::getFrom(GetDlgItem(m_hDlg,IDC_DEBUGMEMVIEW)); + mem->redraw(); + // update the callstack //CDisam::blah blah UpdateDialog(); } else { + updateThreadLabel(true); + EnableWindow( GetDlgItem(hDlg, IDC_GO), FALSE); EnableWindow( GetDlgItem(hDlg, IDC_STEP), FALSE); EnableWindow( GetDlgItem(hDlg, IDC_STEPOVER), FALSE); diff --git a/Windows/Debugger/Debugger_Disasm.h b/Windows/Debugger/Debugger_Disasm.h index b38d73db1e..a984068a7f 100644 --- a/Windows/Debugger/Debugger_Disasm.h +++ b/Windows/Debugger/Debugger_Disasm.h @@ -41,6 +41,7 @@ private: void removeBreakpoint(int itemIndex); int getTotalBreakpointCount(); int getBreakpointIndex(int itemIndex, bool& isMemory); + void updateThreadLabel(bool clear); public: int index; //helper diff --git a/Windows/Debugger/Debugger_Lists.cpp b/Windows/Debugger/Debugger_Lists.cpp index 09919fb9d5..fedd360b33 100644 --- a/Windows/Debugger/Debugger_Lists.cpp +++ b/Windows/Debugger/Debugger_Lists.cpp @@ -83,7 +83,20 @@ void CtrlThreadList::handleNotify(LPARAM lParam) if (mhdr->code == NM_DBLCLK) { LPNMITEMACTIVATE item = (LPNMITEMACTIVATE) lParam; - SendMessage(GetParent(wnd),WM_DEB_GOTOWPARAM,threads[item->iItem].curPC,0); + + u32 address; + switch (threads[item->iItem].status) + { + case THREADSTATUS_DORMANT: + case THREADSTATUS_DEAD: + address = threads[item->iItem].entrypoint; + break; + default: + address = threads[item->iItem].curPC; + break; + } + + SendMessage(GetParent(wnd),WM_DEB_GOTOWPARAM,address,0); return; } @@ -99,7 +112,16 @@ void CtrlThreadList::handleNotify(LPARAM lParam) strcpy(stringBuffer,threads[index].name); break; case TL_PROGRAMCOUNTER: - sprintf(stringBuffer,"0x%08X",threads[index].curPC); + switch (threads[index].status) + { + case THREADSTATUS_DORMANT: + case THREADSTATUS_DEAD: + sprintf(stringBuffer,"N/A"); + break; + default: + sprintf(stringBuffer,"0x%08X",threads[index].curPC); + break; + }; break; case TL_ENTRYPOINT: sprintf(stringBuffer,"0x%08X",threads[index].entrypoint); @@ -168,3 +190,13 @@ void CtrlThreadList::reloadThreads() InvalidateRect(wnd,NULL,true); UpdateWindow(wnd); } + +const char* CtrlThreadList::getCurrentThreadName() +{ + for (int i = 0; i < threads.size(); i++) + { + if (threads[i].isCurrent) return threads[i].name; + } + + return "N/A"; +} \ No newline at end of file diff --git a/Windows/Debugger/Debugger_Lists.h b/Windows/Debugger/Debugger_Lists.h index 875959df5e..ac8ffd5afb 100644 --- a/Windows/Debugger/Debugger_Lists.h +++ b/Windows/Debugger/Debugger_Lists.h @@ -15,4 +15,5 @@ public: void reloadThreads(); void handleNotify(LPARAM lParam); static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + const char* getCurrentThreadName(); }; \ No newline at end of file diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 31e05eb94e1ccc7443d98c2bf0b04a3b28326e38..0fb48aeb0c30d255410e0a4f56b76436886bd66d 100644 GIT binary patch delta 74 zcmex%m1)y;rVRpW`XLM+3_%R842}#g41Pe;7s%FOFlMl1Fa^^(42BE_KnS6ACMWtS SPu`~FH2H#;#%2MvXDt9}7!e}? delta 14 WcmdmVo$1?ErVRpWo6o2{YXJZ_2nS98 diff --git a/Windows/resource.h b/Windows/resource.h index 836aa27a9141f05b041a193bd3f5311bd4a11e77..bed8c55149ed681a8d418e88f2db6bc308efb119 100644 GIT binary patch delta 45 zcmV+|0Mh?}!U5dE0kFO;lNwnVlX@)-0ZxKkue#Qzybub)-5VC Df&dR+ delta 21 dcmca}h_T@iA7EnHY^0}U3;<}_2qFLg