diff --git a/CMakeLists.txt b/CMakeLists.txt index a3fbc25ed7..3223114e63 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/keycodes.h native/input/input_state.h native/input/input_state.cpp 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/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; 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/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMapping.cpp index 360e3d8f7c..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,12 +234,13 @@ void TransformDrawEngine::ApplyDrawState(int prim) { glstate.colorMask.set(colorMask, colorMask, colorMask, alphaMask); // Stencil Test - if (gstate.isStencilTestEnabled()) { + if (alphaMask) { glstate.stencilTest.enable(); glstate.stencilOp.set(GL_REPLACE, GL_REPLACE, GL_REPLACE); glstate.stencilFunc.set(GL_ALWAYS, 0, 0xFF); - } else + } else { glstate.stencilTest.disable(); + } } else { 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); diff --git a/Qt/Common.pro b/Qt/Common.pro index ed69d9c4c9..db597e56d0 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.h \ ../Common/MathUtil.h \ ../Common/MemArena.h \ ../Common/MemoryUtil.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" diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index 6c898eddf8..5b3a7b6944 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -839,6 +839,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)) { @@ -846,7 +847,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(); } @@ -1255,27 +1262,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; } @@ -1284,15 +1309,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 ; @@ -1344,20 +1409,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(); } @@ -1386,7 +1437,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]; 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..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); @@ -784,9 +788,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); @@ -839,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); @@ -900,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); @@ -910,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 163af28f47..a984068a7f 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 @@ -44,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/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); } } diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 31e05eb94e..0fb48aeb0c 100644 Binary files a/Windows/ppsspp.rc and b/Windows/ppsspp.rc differ diff --git a/Windows/resource.h b/Windows/resource.h index 836aa27a91..bed8c55149 100644 Binary files a/Windows/resource.h and b/Windows/resource.h differ 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 \ diff --git a/native b/native index d28b58a203..3db24e97c1 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit d28b58a203dd7fe51b88318b18af83675fa6745d +Subproject commit 3db24e97c11ba5639845ad827afca90094f88943