diff --git a/Core/CoreParameter.h b/Core/CoreParameter.h index 080df70503..2cf0112055 100644 --- a/Core/CoreParameter.h +++ b/Core/CoreParameter.h @@ -43,8 +43,6 @@ struct CoreParameter { std::string errorString; bool startPaused; - bool disableG3Dlog; - bool enableDebugging; // enables breakpoints and other time-consuming debugger features bool printfEmuLog; // writes "emulator:" logging to stdout std::string *collectEmuLog; bool headLess; // Try to avoid messageboxes etc diff --git a/Core/System.cpp b/Core/System.cpp index 34d9d80b81..4cfae68b9a 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -178,10 +178,6 @@ void CPU_Init() { Audio_Init(); } - if (coreParameter.disableG3Dlog) { - LogManager::GetInstance()->SetEnable(LogTypes::G3D, false); - } - CoreTiming::Init(); // Init all the HLE modules diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index e694cfa65b..1da271fd3d 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -75,7 +75,6 @@ void EmuScreen::bootGame(const std::string &filename) { coreParam.fileToStart = fileToStart; coreParam.mountIso = ""; coreParam.startPaused = false; - coreParam.enableDebugging = false; coreParam.printfEmuLog = false; coreParam.headLess = false; diff --git a/Windows/Debugger/CtrlDisAsmView.cpp b/Windows/Debugger/CtrlDisAsmView.cpp index 54f0933eb7..e314b27c4a 100644 --- a/Windows/Debugger/CtrlDisAsmView.cpp +++ b/Windows/Debugger/CtrlDisAsmView.cpp @@ -810,11 +810,13 @@ void CtrlDisAsmView::onKeyDown(WPARAM wParam, LPARAM lParam) { switch (tolower(wParam & 0xFFFF)) { + case 'f': case 's': search(false); break; case 'c': - search(true); + case VK_INSERT: + copyInstructions(selectRangeStart, selectRangeEnd, true); break; case 'x': disassembleToFile(); @@ -884,6 +886,9 @@ void CtrlDisAsmView::onKeyDown(WPARAM wParam, LPARAM lParam) case VK_SPACE: debugger->toggleBreakpoint(curAddress); break; + case VK_F3: + search(true); + break; default: keyTaken = false; return; @@ -981,6 +986,35 @@ void CtrlDisAsmView::onMouseDown(WPARAM wParam, LPARAM lParam, int button) redraw(); } +void CtrlDisAsmView::copyInstructions(u32 startAddr, u32 endAddr, bool withDisasm) +{ + int count = (endAddr - startAddr) / instructionSize; + + char opcode[64], arguments[256]; + int space = count * (withDisasm ? 256 : 32); + char *temp = new char[space]; + + char *p = temp, *end = temp + space; + for (u32 pos = startAddr; pos < endAddr; pos += instructionSize) + { + if (withDisasm) + { + const char *dizz = debugger->disasm(pos, instructionSize); + parseDisasm(dizz, opcode, arguments); + p += snprintf(p, end - p, "%s\t%s", opcode, arguments); + } + else + p += snprintf(p, end - p, "%08X", debugger->readMemory(pos)); + + // Don't leave a trailing newline. + if (pos + instructionSize < endAddr) + p += snprintf(p, end - p, "\r\n"); + } + + W32Util::CopyTextToClipboard(wnd, temp); + delete [] temp; +} + void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) { if (button == 1) @@ -1010,22 +1044,7 @@ void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) assembleOpcode(curAddress,""); break; case ID_DISASM_COPYINSTRUCTIONDISASM: - { - int space = 256 * (selectRangeEnd - selectRangeStart) / instructionSize; - char opcode[64], arguments[256]; - char *temp = new char[space]; - - char *p = temp, *end = temp + space; - for (u32 pos = selectRangeStart; pos < selectRangeEnd; pos += instructionSize) - { - const char *dizz = debugger->disasm(pos, instructionSize); - parseDisasm(dizz, opcode, arguments); - p += snprintf(p, end - p, "%s\t%s\r\n", opcode, arguments); - } - - W32Util::CopyTextToClipboard(wnd, temp); - delete [] temp; - } + copyInstructions(selectRangeStart, selectRangeEnd, true); break; case ID_DISASM_COPYADDRESS: { @@ -1042,17 +1061,7 @@ void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) followBranch(); break; case ID_DISASM_COPYINSTRUCTIONHEX: - { - int space = 24 * (selectRangeEnd - selectRangeStart) / instructionSize; - char *temp = new char[space]; - - char *p = temp, *end = temp + space; - for (u32 pos = selectRangeStart; pos < selectRangeEnd; pos += instructionSize) - p += snprintf(p, end - p, "%08X\r\n", debugger->readMemory(pos)); - - W32Util::CopyTextToClipboard(wnd, temp); - delete [] temp; - } + copyInstructions(selectRangeStart, selectRangeEnd, false); break; case ID_DISASM_RUNTOHERE: { diff --git a/Windows/Debugger/CtrlDisAsmView.h b/Windows/Debugger/CtrlDisAsmView.h index 6d761e7452..67278596b8 100644 --- a/Windows/Debugger/CtrlDisAsmView.h +++ b/Windows/Debugger/CtrlDisAsmView.h @@ -98,6 +98,7 @@ class CtrlDisAsmView void parseDisasm(const char* disasm, char* opcode, char* arguments); void updateStatusBarText(); void drawBranchLine(HDC hdc, BranchLine& line); + void copyInstructions(u32 startAddr, u32 endAddr, bool withDisasm); public: CtrlDisAsmView(HWND _wnd); ~CtrlDisAsmView(); diff --git a/android/jni/TestRunner.cpp b/android/jni/TestRunner.cpp index 5add0a674a..0b79e9c8ff 100644 --- a/android/jni/TestRunner.cpp +++ b/android/jni/TestRunner.cpp @@ -69,7 +69,6 @@ void RunTests() coreParam.enableSound = g_Config.bEnableSound; coreParam.mountIso = ""; coreParam.startPaused = false; - coreParam.enableDebugging = false; coreParam.printfEmuLog = false; coreParam.headLess = true; coreParam.renderWidth = 480; diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 09f5722f4b..3ffe30d3e5 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -301,7 +301,6 @@ int main(int argc, const char* argv[]) coreParameter.enableSound = false; coreParameter.mountIso = mountIso ? mountIso : ""; coreParameter.startPaused = false; - coreParameter.enableDebugging = false; coreParameter.printfEmuLog = !autoCompare; coreParameter.headLess = true; coreParameter.renderWidth = 480;