X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/blobdiff_plain/6564336c1aab410c2f67c4a2accb948080211201..e1f83a1a126789a59e5436aa58a6df2becc53289:/src/gui/mainwin.cpp diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index ad3a838..ede2dc8 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -20,6 +20,10 @@ // JPM 11/04/2017 Added the local window // JPM 08/31/2018 Added the call stack window // JPM Sept./2018 Added the new Models and BIOS handler, a screenshot feature and source code files browsing +// JPM Oct./2018 Added search paths in the settings, breakpoints feature, cartridge view menu +// JPM 11/18/2018 Fix crash with non-debugger mode +// JPM April/2019 Added ELF sections check, added a save memory dump +// JPM Aug./2019 Update texts descriptions, set cartridge view menu for debugger mode only, added a HW registers browser and source level tracing // // FIXED: @@ -32,10 +36,10 @@ // // STILL TO BE DONE: // +// - The source file listing do not need to be refresh more than one time // - Fix bug in switching between PAL & NTSC in fullscreen mode. // - Remove SDL dependencies (sound, mainly) from Jaguar core lib -// - Fix inconsistency with trailing slashes in paths (eeproms needs one, -// software doesn't) +// - Fix inconsistency with trailing slashes in paths (eeproms needs one, software doesn't) // // SFDX CODE: S1E9T8H5M23YS @@ -67,6 +71,7 @@ #include "debug/stackbrowser.h" #include "debug/opbrowser.h" #include "debug/riscdasmbrowser.h" +#include "debug/hwregsbrowser.h" #include "dac.h" #include "jaguar.h" @@ -83,19 +88,24 @@ #include "joystick.h" #include "m68000/m68kinterface.h" +#include "debugger/DBGManager.h" //#include "debugger/VideoWin.h" //#include "debugger/DasmWin.h" +#include "debugger/SourcesWin.h" #include "debugger/m68KDasmWin.h" #include "debugger/GPUDasmWin.h" #include "debugger/DSPDasmWin.h" #include "debugger/memory1browser.h" -//#include "debugger/brkWin.h" +#include "debugger/BreakpointsWin.h" +#include "debugger/NewFnctBreakpointWin.h" #include "debugger/FilesrcListWin.h" #include "debugger/exceptionvectortablebrowser.h" #include "debugger/allwatchbrowser.h" #include "debugger/localbrowser.h" #include "debugger/heapallocatorbrowser.h" #include "debugger/callstackbrowser.h" +#include "debugger/CartFilesListWin.h" +#include "debugger/SaveDumpAsWin.h" // According to SebRmv, this header isn't seen on Arch Linux either... :-/ @@ -173,16 +183,22 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), setWindowTitle(title); + // Windows common features aboutWin = new AboutWindow(this); helpWin = new HelpWindow(this); filePickWin = new FilePickerWindow(this); + emuStatusWin = new EmuStatusWindow(this); + + // Windows alpine mode features memBrowseWin = new MemoryBrowserWindow(this); stackBrowseWin = new StackBrowserWindow(this); - emuStatusWin = new EmuStatusWindow(this); cpuBrowseWin = new CPUBrowserWindow(this); opBrowseWin = new OPBrowserWindow(this); m68kDasmBrowseWin = new M68KDasmBrowserWindow(this); riscDasmBrowseWin = new RISCDasmBrowserWindow(this); + hwRegsBrowseWin = new HWRegsBrowserWindow(this); + + // Windows debugger mode features if (vjs.softTypeDebugger) { //VideoOutputWin = new VideoOutputWindow(this); @@ -192,9 +208,12 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), allWatchBrowseWin = new AllWatchBrowserWindow(this); LocalBrowseWin = new LocalBrowserWindow(this); heapallocatorBrowseWin = new HeapAllocatorBrowserWindow(this); - //brkWin = new BrkWindow(this); + BreakpointsWin = new BreakpointsWindow(this); + NewFunctionBreakpointWin = new NewFnctBreakpointWindow(this); + SaveDumpAsWin = new SaveDumpAsWindow(this); exceptionvectortableBrowseWin = new ExceptionVectorTableBrowserWindow(this); CallStackBrowseWin = new CallStackBrowserWindow(this); + CartFilesListWin = new CartFilesListWindow(this); mem1BrowseWin = (Memory1BrowserWindow **)calloc(vjs.nbrmemory1browserwindow, sizeof(Memory1BrowserWindow)); #ifdef _MSC_VER @@ -226,9 +245,11 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), #endif // Setup disasm tabs dasmtabWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - dasmtabWidget->addTab(m68kDasmWin = new m68KDasmWindow(this), tr("M68000")); + dasmtabWidget->addTab(SourcesWin = new SourcesWindow(this), tr("Sources")); + dasmtabWidget->setCurrentIndex(dasmtabWidget->addTab(m68kDasmWin = new m68KDasmWindow(this), tr("M68000"))); dasmtabWidget->addTab(GPUDasmWin = new GPUDasmWindow(this), tr("GPU")); dasmtabWidget->addTab(DSPDasmWin = new DSPDasmWindow(this), tr("DSP")); + connect(dasmtabWidget, SIGNAL(currentChanged(const int)), this, SLOT(SelectdasmtabWidget(const int))); #if 1 setCentralWidget(dasmtabWidget); #endif @@ -239,29 +260,25 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), setUnifiedTitleAndToolBarOnMac(true); - // Create actions - + // Quit actions quitAppAct = new QAction(QIcon(":/res/exit.png"), tr("E&xit"), this); -// quitAppAct->setShortcuts(QKeySequence::Quit); -// quitAppAct->setShortcut(QKeySequence(tr("Alt+x"))); - //quitAppAct->setShortcut(QKeySequence(tr("Ctrl+q"))); quitAppAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBQUIT].KBSettingValue))); quitAppAct->setShortcutContext(Qt::ApplicationShortcut); quitAppAct->setStatusTip(tr("Quit Virtual Jaguar")); connect(quitAppAct, SIGNAL(triggered()), this, SLOT(close())); + // Power action powerGreen.addFile(":/res/power-off.png", QSize(), QIcon::Normal, QIcon::Off); powerGreen.addFile(":/res/power-on-green.png", QSize(), QIcon::Normal, QIcon::On); powerRed.addFile(":/res/power-off.png", QSize(), QIcon::Normal, QIcon::Off); powerRed.addFile(":/res/power-on-red.png", QSize(), QIcon::Normal, QIcon::On); - powerAct = new QAction(powerGreen, tr("&Power"), this); powerAct->setStatusTip(tr("Powers Jaguar on/off")); powerAct->setCheckable(true); powerAct->setChecked(false); connect(powerAct, SIGNAL(triggered()), this, SLOT(TogglePowerState())); - // Pause feature + // Pause action QIcon pauseIcon; pauseIcon.addFile(":/res/pause-off.png", QSize(), QIcon::Normal, QIcon::Off); pauseIcon.addFile(":/res/pause-on.png", QSize(), QIcon::Normal, QIcon::On); @@ -269,12 +286,11 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), pauseAct->setStatusTip(tr("Toggles the running state")); pauseAct->setCheckable(true); pauseAct->setDisabled(true); - //pauseAct->setShortcut(QKeySequence(tr("Esc"))); pauseAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBPAUSE].KBSettingValue))); pauseAct->setShortcutContext(Qt::ApplicationShortcut); connect(pauseAct, SIGNAL(triggered()), this, SLOT(ToggleRunState())); - // Screenshot feature + // Screenshot action screenshotAct = new QAction(QIcon(":/res/screenshot.png"), tr("&Screenshot"), this); screenshotAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBSCREENSHOT].KBSettingValue))); screenshotAct->setShortcutContext(Qt::ApplicationShortcut); @@ -282,51 +298,51 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), screenshotAct->setDisabled(false); connect(screenshotAct, SIGNAL(triggered()), this, SLOT(MakeScreenshot())); + // Zoom actions zoomActs = new QActionGroup(this); - x1Act = new QAction(QIcon(":/res/zoom100.png"), tr("Zoom 100%"), zoomActs); x1Act->setStatusTip(tr("Set window zoom to 100%")); x1Act->setCheckable(true); connect(x1Act, SIGNAL(triggered()), this, SLOT(SetZoom100())); - x2Act = new QAction(QIcon(":/res/zoom200.png"), tr("Zoom 200%"), zoomActs); x2Act->setStatusTip(tr("Set window zoom to 200%")); x2Act->setCheckable(true); connect(x2Act, SIGNAL(triggered()), this, SLOT(SetZoom200())); - x3Act = new QAction(QIcon(":/res/zoom300.png"), tr("Zoom 300%"), zoomActs); x3Act->setStatusTip(tr("Set window zoom to 300%")); x3Act->setCheckable(true); connect(x3Act, SIGNAL(triggered()), this, SLOT(SetZoom300())); + // TV type actions tvTypeActs = new QActionGroup(this); - ntscAct = new QAction(QIcon(":/res/ntsc.png"), tr("NTSC"), tvTypeActs); ntscAct->setStatusTip(tr("Sets Jaguar to NTSC mode")); ntscAct->setCheckable(true); connect(ntscAct, SIGNAL(triggered()), this, SLOT(SetNTSC())); - palAct = new QAction(QIcon(":/res/pal.png"), tr("PAL"), tvTypeActs); palAct->setStatusTip(tr("Sets Jaguar to PAL mode")); palAct->setCheckable(true); connect(palAct, SIGNAL(triggered()), this, SLOT(SetPAL())); + // Blur action blur.addFile(":/res/blur-off.png", QSize(), QIcon::Normal, QIcon::Off); blur.addFile(":/res/blur-on.png", QSize(), QIcon::Normal, QIcon::On); - blurAct = new QAction(blur, tr("Blur"), this); blurAct->setStatusTip(tr("Sets OpenGL rendering to GL_NEAREST")); blurAct->setCheckable(true); connect(blurAct, SIGNAL(triggered()), this, SLOT(ToggleBlur())); + // About action aboutAct = new QAction(QIcon(":/res/vj-icon.png"), tr("&About..."), this); aboutAct->setStatusTip(tr("Blatant self-promotion")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(ShowAboutWin())); + // Help action helpAct = new QAction(QIcon(":/res/vj-icon.png"), tr("&Contents..."), this); helpAct->setStatusTip(tr("Help is available, if you should need it")); connect(helpAct, SIGNAL(triggered()), this, SLOT(ShowHelpWin())); + // File pickup action if (!vjs.softTypeDebugger) { filePickAct = new QAction(QIcon(":/res/software.png"), tr("&Insert Cartridge..."), this); @@ -337,99 +353,129 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), filePickAct = new QAction(QIcon(":/res/software.png"), tr("&Insert executable file..."), this); filePickAct->setStatusTip(tr("Insert an executable into Virtual Jaguar")); } - //filePickAct->setShortcut(QKeySequence(tr("Ctrl+i"))); filePickAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBPICKFILE].KBSettingValue))); filePickAct->setShortcutContext(Qt::ApplicationShortcut); connect(filePickAct, SIGNAL(triggered()), this, SLOT(InsertCart())); + // Configuration action configAct = new QAction(QIcon(":/res/wrench.png"), tr("&Configure"), this); configAct->setStatusTip(tr("Configure options for Virtual Jaguar")); - //configAct->setShortcut(QKeySequence(tr("Ctrl+c"))); configAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBCONFIGURE].KBSettingValue))); configAct->setShortcutContext(Qt::ApplicationShortcut); connect(configAct, SIGNAL(triggered()), this, SLOT(Configure())); + // Emulation status action emustatusAct = new QAction(QIcon(":/res/status.png"), tr("&Status"), this); emustatusAct->setStatusTip(tr("Emulator status")); - //emustatusAct->setShortcut(QKeySequence(tr("Ctrl+s"))); emustatusAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBEMUSTATUS].KBSettingValue))); emustatusAct->setShortcutContext(Qt::ApplicationShortcut); connect(emustatusAct, SIGNAL(triggered()), this, SLOT(ShowEmuStatusWin())); + // Use CD action useCDAct = new QAction(QIcon(":/res/compact-disc.png"), tr("&Use CD Unit"), this); useCDAct->setStatusTip(tr("Use Jaguar Virtual CD unit")); -// useCDAct->setShortcut(QKeySequence(tr("Ctrl+c"))); useCDAct->setCheckable(true); connect(useCDAct, SIGNAL(triggered()), this, SLOT(ToggleCDUsage())); + // Frame advance action frameAdvanceAct = new QAction(QIcon(":/res/frame-advance.png"), tr("&Frame Advance"), this); - //frameAdvanceAct->setShortcut(QKeySequence(tr("F7"))); frameAdvanceAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBFRAMEADVANCE].KBSettingValue))); frameAdvanceAct->setShortcutContext(Qt::ApplicationShortcut); frameAdvanceAct->setDisabled(true); connect(frameAdvanceAct, SIGNAL(triggered()), this, SLOT(FrameAdvance())); + // Fullscreen action + fullScreenAct = new QAction(QIcon(":/res/fullscreen.png"), tr("F&ull Screen"), this); + fullScreenAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBFULLSCREEN].KBSettingValue))); + fullScreenAct->setShortcutContext(Qt::ApplicationShortcut); + fullScreenAct->setCheckable(true); + connect(fullScreenAct, SIGNAL(triggered()), this, SLOT(ToggleFullScreen())); + + // Actions dedicated to debugger mode if (vjs.softTypeDebugger) { + // Restart restartAct = new QAction(QIcon(":/res/debug-restart.png"), tr("&Restart"), this); - //restartAct->setShortcut(QKeySequence(tr("Ctrl+Shift+F5"))); restartAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBRESTART].KBSettingValue))); restartAct->setShortcutContext(Qt::ApplicationShortcut); restartAct->setCheckable(false); restartAct->setDisabled(true); connect(restartAct, SIGNAL(triggered()), this, SLOT(DebuggerRestart())); + // Step over trace traceStepOverAct = new QAction(QIcon(":/res/debug-stepover.png"), tr("&Step Over"), this); - //traceStepOverAct->setShortcut(QKeySequence(tr("F10"))); traceStepOverAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBSTEPOVER].KBSettingValue))); traceStepOverAct->setShortcutContext(Qt::ApplicationShortcut); traceStepOverAct->setCheckable(false); traceStepOverAct->setDisabled(true); connect(traceStepOverAct, SIGNAL(triggered()), this, SLOT(DebuggerTraceStepOver())); + // Trace into tracing traceStepIntoAct = new QAction(QIcon(":/res/debug-stepinto.png"), tr("&Step Into"), this); - //traceStepIntoAct->setShortcut(QKeySequence(tr("F11"))); traceStepIntoAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBSTEPINTO].KBSettingValue))); traceStepIntoAct->setShortcutContext(Qt::ApplicationShortcut); traceStepIntoAct->setCheckable(false); traceStepIntoAct->setDisabled(true); connect(traceStepIntoAct, SIGNAL(triggered()), this, SLOT(DebuggerTraceStepInto())); - newBreakpointFunctionAct = new QAction(QIcon(""), tr("&Function Breakpoint"), this); - newBreakpointFunctionAct->setShortcut(QKeySequence(tr("Ctrl+B"))); - connect(newBreakpointFunctionAct, SIGNAL(triggered()), this, SLOT(NewBreakpointFunction())); - } + // Function breakpoint + newFunctionBreakpointAct = new QAction(QIcon(""), tr("&Function Breakpoint"), this); + newFunctionBreakpointAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBFUNCTIONBREAKPOINT].KBSettingValue))); + connect(newFunctionBreakpointAct, SIGNAL(triggered()), this, SLOT(ShowNewFunctionBreakpointWin())); + BreakpointsAct = new QAction(QIcon(":/res/debug-breakpoints.png"), tr("&Breakpoints"), this); + BreakpointsAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBBREAKPOINTS].KBSettingValue))); + connect(BreakpointsAct, SIGNAL(triggered()), this, SLOT(ShowBreakpointsWin())); + deleteAllBreakpointsAct = new QAction(QIcon(":/res/debug-deleteallbreakpoints.png"), tr("&Delete All Breakpoints"), this); + deleteAllBreakpointsAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBDELETEALLBREAKPOINTS].KBSettingValue))); + connect(deleteAllBreakpointsAct, SIGNAL(triggered()), this, SLOT(DeleteAllBreakpoints())); + disableAllBreakpointsAct = new QAction(QIcon(":/res/debug-disableallbreakpoints.png"), tr("&Disable All Breakpoints"), this); + connect(disableAllBreakpointsAct, SIGNAL(triggered()), this, SLOT(DisableAllBreakpoints())); + + // Save dump + saveDumpAsAct = new QAction(tr("&Save Dump As..."), this); + saveDumpAsAct->setCheckable(false); + saveDumpAsAct->setDisabled(false); + connect(saveDumpAsAct, SIGNAL(triggered()), this, SLOT(ShowSaveDumpAsWin())); - fullScreenAct = new QAction(QIcon(":/res/fullscreen.png"), tr("F&ull Screen"), this); - //fullScreenAct->setShortcut(QKeySequence(tr("F9"))); - fullScreenAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBFULLSCREEN].KBSettingValue))); - fullScreenAct->setShortcutContext(Qt::ApplicationShortcut); - fullScreenAct->setCheckable(true); - connect(fullScreenAct, SIGNAL(triggered()), this, SLOT(ToggleFullScreen())); + //VideoOutputAct = new QAction(tr("Output Video"), this); + //VideoOutputAct->setStatusTip(tr("Shows the output video window")); + //connect(VideoOutputAct, SIGNAL(triggered()), this, SLOT(ShowVideoOutputWin())); - // Debugger Actions - if (vjs.softTypeDebugger) - { + //DasmAct = new QAction(tr("Disassembly"), this); + //DasmAct->setStatusTip(tr("Shows the disassembly window")); + //connect(DasmAct, SIGNAL(triggered()), this, SLOT(ShowDasmWin())); + + // Exception vector table window exceptionVectorTableBrowseAct = new QAction(QIcon(""), tr("Exception Vector Table"), this); exceptionVectorTableBrowseAct->setStatusTip(tr("Shows all Exception Vector Table browser window")); connect(exceptionVectorTableBrowseAct, SIGNAL(triggered()), this, SLOT(ShowExceptionVectorTableBrowserWin())); + // All watch variables window allWatchBrowseAct = new QAction(QIcon(":/res/debug-watch.png"), tr("All Watch"), this); allWatchBrowseAct->setStatusTip(tr("Shows all Watch browser window")); connect(allWatchBrowseAct, SIGNAL(triggered()), this, SLOT(ShowAllWatchBrowserWin())); + // Local variables window LocalBrowseAct = new QAction(QIcon(":/res/debug-local.png"), tr("Locals"), this); LocalBrowseAct->setStatusTip(tr("Shows Locals browser window")); connect(LocalBrowseAct, SIGNAL(triggered()), this, SLOT(ShowLocalBrowserWin())); + // Heap (memory) allocation window heapallocatorBrowseAct = new QAction(QIcon(""), tr("Heap allocator"), this); heapallocatorBrowseAct->setStatusTip(tr("Shows the heap allocator browser window")); connect(heapallocatorBrowseAct, SIGNAL(triggered()), this, SLOT(ShowHeapAllocatorBrowserWin())); + // Call stack window CallStackBrowseAct = new QAction(QIcon(":/res/debug-callstack.png"), tr("Call Stack"), this); CallStackBrowseAct->setStatusTip(tr("Shows Call Stack browser window")); connect(CallStackBrowseAct, SIGNAL(triggered()), this, SLOT(ShowCallStackBrowserWin())); + // Cart files list + CartFilesListAct = new QAction(QIcon(""), tr("Directory and files"), this); + CartFilesListAct->setStatusTip(tr("List of the files in the cartridge's directory structure")); + connect(CartFilesListAct, SIGNAL(triggered()), this, SLOT(ShowCartFilesListWin())); + + // Memory windows mem1BrowseAct = (QAction **)calloc(vjs.nbrmemory1browserwindow, sizeof(QAction)); QSignalMapper *signalMapper = new QSignalMapper(this); #ifdef _MSC_VER @@ -443,56 +489,47 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), sprintf(MB, "Memory %i", (unsigned int)(i+1)); mem1BrowseAct[i] = new QAction(QIcon(":/res/debug-memory.png"), tr(MB), this); mem1BrowseAct[i]->setStatusTip(tr("Shows a Jaguar memory browser window")); - //mem1BrowseAct[i]-> - //connect(mem1BrowseAct[0], SIGNAL(triggered()), this, SLOT(ShowMemory1BrowserWin(size_t(0)))); connect(mem1BrowseAct[i], SIGNAL(triggered()), signalMapper, SLOT(map())); signalMapper->setMapping(mem1BrowseAct[i], (int)i); connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(ShowMemory1BrowserWin(int))); } } - // Debugger Browser Actions + // Memory browser window action memBrowseAct = new QAction(QIcon(":/res/tool-memory.png"), tr("Memory Browser"), this); memBrowseAct->setStatusTip(tr("Shows the Jaguar memory browser window")); -// memBrowseAct->setCheckable(true); connect(memBrowseAct, SIGNAL(triggered()), this, SLOT(ShowMemoryBrowserWin())); + // Stack browser window action stackBrowseAct = new QAction(QIcon(":/res/tool-stack.png"), tr("Stack Browser"), this); stackBrowseAct->setStatusTip(tr("Shows the Jaguar stack browser window")); - // memBrowseAct->setCheckable(true); connect(stackBrowseAct, SIGNAL(triggered()), this, SLOT(ShowStackBrowserWin())); + // CPUs (M68000, GPU & DSP browser window action cpuBrowseAct = new QAction(QIcon(":/res/tool-cpu.png"), tr("CPU Browser"), this); cpuBrowseAct->setStatusTip(tr("Shows the Jaguar CPU browser window")); -// memBrowseAct->setCheckable(true); connect(cpuBrowseAct, SIGNAL(triggered()), this, SLOT(ShowCPUBrowserWin())); + // OP browser window action opBrowseAct = new QAction(QIcon(":/res/tool-op.png"), tr("OP Browser"), this); opBrowseAct->setStatusTip(tr("Shows the Jaguar OP browser window")); -// memBrowseAct->setCheckable(true); connect(opBrowseAct, SIGNAL(triggered()), this, SLOT(ShowOPBrowserWin())); + // M68000 disassembly browser window m68kDasmBrowseAct = new QAction(QIcon(":/res/tool-68k-dis.png"), tr("68K Listing Browser"), this); m68kDasmBrowseAct->setStatusTip(tr("Shows the 68K disassembly browser window")); -// memBrowseAct->setCheckable(true); connect(m68kDasmBrowseAct, SIGNAL(triggered()), this, SLOT(ShowM68KDasmBrowserWin())); + // HW registers browser window + hwRegsBrowseAct = new QAction(QIcon(":/res/tool-hw-regs.png"), tr("HW Registers Browser"), this); + hwRegsBrowseAct->setStatusTip(tr("Shows the HW registers browser window")); + connect(hwRegsBrowseAct, SIGNAL(triggered()), this, SLOT(ShowHWRegsBrowserWin())); + + // Risc (DSP / GPU) disassembly browser window riscDasmBrowseAct = new QAction(QIcon(":/res/tool-risc-dis.png"), tr("RISC Listing Browser"), this); riscDasmBrowseAct->setStatusTip(tr("Shows the RISC disassembly browser window")); -// memBrowseAct->setCheckable(true); connect(riscDasmBrowseAct, SIGNAL(triggered()), this, SLOT(ShowRISCDasmBrowserWin())); - if (vjs.softTypeDebugger) - { - //VideoOutputAct = new QAction(tr("Output Video"), this); - //VideoOutputAct->setStatusTip(tr("Shows the output video window")); - //connect(VideoOutputAct, SIGNAL(triggered()), this, SLOT(ShowVideoOutputWin())); - - //DasmAct = new QAction(tr("Disassembly"), this); - //DasmAct->setStatusTip(tr("Shows the disassembly window")); - //connect(DasmAct, SIGNAL(triggered()), this, SLOT(ShowDasmWin())); - } - // Misc. connections... connect(filePickWin, SIGNAL(RequestLoad(QString)), this, SLOT(LoadSoftware(QString))); connect(filePickWin, SIGNAL(FilePickerHiding()), this, SLOT(Unpause())); @@ -513,12 +550,29 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), fileMenu->addSeparator(); fileMenu->addAction(quitAppAct); + // Alpine and debugger menus if (vjs.hardwareTypeAlpine || vjs.softTypeDebugger) { + // Create debug menu debugMenu = menuBar()->addMenu(tr("&Debug")); + + // Create debugger menu if (vjs.softTypeDebugger) { + // Create view menu + viewMenu = menuBar()->addMenu(tr("&View")); + + // Cart menu + viewCartMenu = viewMenu->addMenu(tr("&Cartridge")); + viewCartMenu->addAction(CartFilesListAct); +#if 0 + viewCartMenu->addSeparator(); + viewCartMenu->addAction(CartStreamsAct); +#endif + + // Windows menu debugWindowsMenu = debugMenu->addMenu(tr("&Windows")); + debugWindowsMenu->addAction(BreakpointsAct); debugWindowExceptionMenu = debugWindowsMenu->addMenu(tr("&Exception")); debugWindowExceptionMenu->addAction(exceptionVectorTableBrowseAct); debugWindowsMenu->addSeparator(); @@ -548,6 +602,7 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), debugWindowsBrowsesMenu->addAction(opBrowseAct); debugWindowsBrowsesMenu->addAction(m68kDasmBrowseAct); debugWindowsBrowsesMenu->addAction(riscDasmBrowseAct); + debugWindowsBrowsesMenu->addAction(hwRegsBrowseAct); debugMenu->addSeparator(); debugMenu->addAction(pauseAct); debugMenu->addAction(frameAdvanceAct); @@ -555,25 +610,32 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), debugMenu->addSeparator(); debugMenu->addAction(traceStepIntoAct); debugMenu->addAction(traceStepOverAct); -#if 0 debugMenu->addSeparator(); debugNewBreakpointMenu = debugMenu->addMenu(tr("&New Breakpoint")); - debugNewBreakpointMenu->addAction(newBreakpointFunctionAct); + debugNewBreakpointMenu->addAction(newFunctionBreakpointAct); + debugMenu->addAction(deleteAllBreakpointsAct); + debugMenu->addAction(disableAllBreakpointsAct); + debugMenu->addSeparator(); + debugMenu->addAction(saveDumpAsAct); +#if 0 + debugMenu->addSeparator(); + debugMenu->addAction(DasmAct); #endif - //debugMenu->addSeparator(); - //debugMenu->addAction(DasmAct); } else { + // Create alpine menu debugMenu->addAction(memBrowseAct); debugMenu->addAction(stackBrowseAct); debugMenu->addAction(cpuBrowseAct); debugMenu->addAction(opBrowseAct); debugMenu->addAction(m68kDasmBrowseAct); debugMenu->addAction(riscDasmBrowseAct); + debugMenu->addAction(hwRegsBrowseAct); } } + // Help menus helpMenu = menuBar()->addMenu(tr("&Help")); helpMenu->addAction(helpAct); helpMenu->addAction(aboutAct); @@ -613,6 +675,8 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), debuggerbar->addSeparator(); debuggerbar->addAction(traceStepIntoAct); debuggerbar->addAction(traceStepOverAct); + debuggerbar->addSeparator(); + debuggerbar->addAction(BreakpointsAct); } if (vjs.hardwareTypeAlpine) @@ -624,6 +688,7 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), debugbar->addAction(opBrowseAct); debugbar->addAction(m68kDasmBrowseAct); debugbar->addAction(riscDasmBrowseAct); + debugbar->addAction(hwRegsBrowseAct); } // Add actions to the main window, as hiding widgets with them @@ -796,6 +861,17 @@ void MainWin::SyncUI(void) } +// +void MainWin::SelectdasmtabWidget(const int Index) +{ + // check sources tab + if (Index == 0) + { + SourcesWin->RefreshContents(); + } +} + + void MainWin::closeEvent(QCloseEvent * event) { JaguarDone(); @@ -1037,7 +1113,7 @@ void MainWin::Configure(void) // Just in case we crash before a clean exit... WriteSettings(); - DebuggerRefreshWindows(); + RefreshWindows(); } @@ -1083,22 +1159,25 @@ static uint32_t ntscTickCount; // Otherwise, run the Jaguar simulation HandleGamepads(); JaguarExecuteNew(); - if (!vjs.softTypeDebugger) + //if (!vjs.softTypeDebugger) videoWidget->HandleMouseHiding(); static uint32_t refresh = 0; // Do autorefresh on debug windows // Have to be careful, too much causes the emulator to slow way down! + if (refresh == vjs.refresh) + { if (vjs.hardwareTypeAlpine || vjs.softTypeDebugger) { - if (refresh == vjs.refresh) - { AlpineRefreshWindows(); //memBrowseWin->RefreshContents(); //cpuBrowseWin->RefreshContents(); + } + CommonRefreshWindows(); refresh = 0; } else + { refresh++; } } @@ -1138,6 +1217,7 @@ static uint32_t refresh = 0; } +// Toggle the power state, it can be either on or off void MainWin::TogglePowerState(void) { powerButtonOn = !powerButtonOn; @@ -1147,31 +1227,34 @@ void MainWin::TogglePowerState(void) if (!powerButtonOn) { // Restore the mouse pointer, if hidden: - if (!vjs.softTypeDebugger) + //if (!vjs.softTypeDebugger) + { videoWidget->CheckAndRestoreMouseCursor(); + } + useCDAct->setDisabled(false); palAct->setDisabled(false); ntscAct->setDisabled(false); pauseAct->setChecked(false); pauseAct->setDisabled(true); showUntunedTankCircuit = true; + DACPauseAudioThread(); - // This is just in case the ROM we were playing was in a narrow or wide - // field mode, so the untuned tank sim doesn't look wrong. :-) + // This is just in case the ROM we were playing was in a narrow or wide field mode, so the untuned tank sim doesn't look wrong. :-) TOMReset(); if (plzDontKillMyComputer) { - //if (!vjs.softTypeDebugger) + // We have to do it line by line, because the texture pitch is not the same as the picture buffer's pitch. + for (uint32_t y = 0; y < videoWidget->rasterHeight; y++) { - // We have to do it line by line, because the texture pitch is not - // the same as the picture buffer's pitch. - for (uint32_t y = 0; y < videoWidget->rasterHeight; y++) + if (vjs.hardwareTypeNTSC) { - if (vjs.hardwareTypeNTSC) - memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t)); - else - memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern2 + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t)); + memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t)); + } + else + { + memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern2 + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t)); } } } @@ -1198,19 +1281,25 @@ void MainWin::TogglePowerState(void) WriteLog("GUI: Resetting Jaguar...\n"); JaguarReset(); + DebuggerReset(); + CommonReset(); DebuggerResetWindows(); + CommonResetWindows(); DACPauseAudioThread(false); } } +// Toggle the emulator state, it can be either on or off void MainWin::ToggleRunState(void) { startM68KTracing = running; running = !running; + // Pause mode if (!running) { + // Set action buttons for the pause mode frameAdvanceAct->setDisabled(false); pauseAct->setChecked(true); pauseAct->setDisabled(false); @@ -1228,7 +1317,6 @@ void MainWin::ToggleRunState(void) { // Restore the mouse pointer, if hidden: videoWidget->CheckAndRestoreMouseCursor(); - // frameAdvanceAct->setDisabled(false); for (uint32_t i = 0; i < (uint32_t)(videoWidget->textureWidth * 256); i++) { @@ -1242,7 +1330,7 @@ void MainWin::ToggleRunState(void) cpuBrowseWin->HoldBPM(); cpuBrowseWin->HandleBPMContinue(); - DebuggerRefreshWindows(); + RefreshWindows(); } } else @@ -1255,6 +1343,7 @@ void MainWin::ToggleRunState(void) traceStepIntoAct->setDisabled(true); traceStepOverAct->setDisabled(true); restartAct->setDisabled(true); + BreakpointsWin->RefreshContents(); } cpuBrowseWin->UnholdBPM(); @@ -1367,6 +1456,7 @@ void MainWin::LoadSoftware(QString file) running = false; // Prevent bad things(TM) from happening... pauseForFileSelector = false; // Reset the file selector pause flag + // Setup BIOS in his own dedicated Jaguar memory #ifndef NEWMODELSBIOSHANDLER uint8_t * biosPointer = jaguarBootROM; @@ -1380,6 +1470,7 @@ void MainWin::LoadSoftware(QString file) SelectBIOS(vjs.biosType); #endif + // Turn 'on' the power to initialize the Jaguar powerAct->setDisabled(false); powerAct->setChecked(true); powerButtonOn = false; @@ -1387,7 +1478,7 @@ void MainWin::LoadSoftware(QString file) // We have to load our software *after* the Jaguar RESET cartridgeLoaded = JaguarLoadFile(file.toUtf8().data()); - SET32(jaguarMainRAM, 0, vjs.DRAM_size); // Set top of stack... + SET32(jaguarMainRAM, 0, vjs.DRAM_size); // Set stack in the M68000's Reset SP // This is icky because we've already done it // it gets worse :-P @@ -1403,6 +1494,7 @@ void MainWin::LoadSoftware(QString file) { m68k_set_reg(M68K_REG_A6, 0); m68kDasmWin->SetAddress(jaguarRunAddress); + SourcesWin->Init(); //pauseAct->setDisabled(false); //pauseAct->setChecked(true); ToggleRunState(); @@ -1410,13 +1502,14 @@ void MainWin::LoadSoftware(QString file) } else { - // Prevent the Alpine mode to crash in case of software without a start address - if (vjs.hardwareTypeAlpine && !jaguarRunAddress) + // Prevent the launch in case of software without a start address and without BIOS presence + if (!vjs.useJaguarBIOS && !jaguarRunAddress) { ToggleRunState(); } } + // Display the Atari Jaguar software which is running if ((!vjs.hardwareTypeAlpine || !vjs.softTypeDebugger) && !loadAndGo && jaguarRunAddress) { QString newTitle = QString("Virtual Jaguar " VJ_RELEASE_VERSION " Rx - Now playing: %1").arg(filePickWin->GetSelectedPrettyName()); @@ -1437,20 +1530,72 @@ void MainWin::ToggleCDUsage(void) } -// -void MainWin::NewBreakpointFunction(void) +// Open, or display, the breakpoints list window +void MainWin::ShowBreakpointsWin(void) +{ + BreakpointsWin->show(); + BreakpointsWin->RefreshContents(); +} + + +// Delete all breakpoints +void MainWin::DeleteAllBreakpoints(void) { - //brkWin->show(); - //brkWin->RefreshContents(); + cpuBrowseWin->ResetBPM(); + m68k_brk_reset(); + ShowBreakpointsWin(); +} + + +// Disable all breakpoints +void MainWin::DisableAllBreakpoints(void) +{ + cpuBrowseWin->DisableBPM(); + m68k_brk_disable(); + ShowBreakpointsWin(); +} + + +// Open, or display, the new breakpoint function window +void MainWin::ShowNewFunctionBreakpointWin(void) +{ + NewFunctionBreakpointWin->show(); + ShowBreakpointsWin(); +} + + +// Display list of files found in cartridge +void MainWin::ShowCartFilesListWin(void) +{ + CartFilesListWin->show(); + CartFilesListWin->RefreshContents(); +} + + +// Display the save dump pickup file +void MainWin::ShowSaveDumpAsWin(void) +{ + SaveDumpAsWin->show(); } // Step Into trace void MainWin::DebuggerTraceStepInto(void) { - JaguarStepInto(); + if (SourcesWin->isVisible() && SourcesWin->GetTraceStatus()) + { + while (!SourcesWin->CheckChangeLine()) + { + JaguarStepInto(); + } + } + else + { + JaguarStepInto(); + } + videoWidget->updateGL(); - DebuggerRefreshWindows(); + RefreshWindows(); #ifdef _MSC_VER #pragma message("Warning: !!! Need to verify the Step Into function !!!") #else @@ -1459,7 +1604,7 @@ void MainWin::DebuggerTraceStepInto(void) } -// Restart +// Restart the Jaguar executable void MainWin::DebuggerRestart(void) { #if 1 @@ -1468,10 +1613,14 @@ void MainWin::DebuggerRestart(void) m68k_set_reg(M68K_REG_PC, jaguarRunAddress); m68k_set_reg(M68K_REG_SP, vjs.DRAM_size); #endif + dasmtabWidget->setCurrentIndex(1); // set focus on the disasm M68K tab m68k_set_reg(M68K_REG_A6, 0); - + m68k_brk_hitcounts_reset(); + bpmHitCounts = 0; DebuggerResetWindows(); - DebuggerRefreshWindows(); + CommonResetWindows(); + SourcesWin->Init(); + RefreshWindows(); #ifdef _MSC_VER #pragma message("Warning: !!! Need to verify the Restart function !!!") #else @@ -1483,9 +1632,17 @@ void MainWin::DebuggerRestart(void) // Step Over trace void MainWin::DebuggerTraceStepOver(void) { - JaguarStepOver(0); + if (SourcesWin->isVisible() && SourcesWin->GetTraceStatus()) + { + + } + else + { + JaguarStepOver(0); + } + videoWidget->updateGL(); - DebuggerRefreshWindows(); + RefreshWindows(); #ifdef _MSC_VER #pragma message("Warning: !!! Need to verify the Step Over function !!!") #else @@ -1653,6 +1810,7 @@ void MainWin::ShowCPUBrowserWin(void) } +// Show the OP browser window void MainWin::ShowOPBrowserWin(void) { opBrowseWin->show(); @@ -1660,6 +1818,15 @@ void MainWin::ShowOPBrowserWin(void) } +// Show the HW registers browser window +void MainWin::ShowHWRegsBrowserWin(void) +{ + hwRegsBrowseWin->show(); + hwRegsBrowseWin->RefreshContents(); +} + + +// Show the M68K browser window void MainWin::ShowM68KDasmBrowserWin(void) { m68kDasmBrowseWin->show(); @@ -1698,12 +1865,13 @@ void MainWin::ShowVideoOutputWin(void) #endif +// Resize video window based on zoom factor +// It doesn't apply in debugger mode as we use this window to display disassembly void MainWin::ResizeMainWindow(void) { if (!vjs.softTypeDebugger) { - videoWidget->setFixedSize(zoomLevel * VIRTUAL_SCREEN_WIDTH, - zoomLevel * (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL)); + videoWidget->setFixedSize(zoomLevel * VIRTUAL_SCREEN_WIDTH, zoomLevel * (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL)); // Show the test pattern if user requested plzDontKillMyComputer mode if (!powerButtonOn && plzDontKillMyComputer) @@ -1711,9 +1879,13 @@ void MainWin::ResizeMainWindow(void) for (uint32_t y = 0; y < videoWidget->rasterHeight; y++) { if (vjs.hardwareTypeNTSC) + { memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t)); + } else + { memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern2 + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t)); + } } } @@ -1758,10 +1930,12 @@ void MainWin::ReadSettings(void) // Read settings from the Debugger mode settings.beginGroup("debugger"); strcpy(vjs.debuggerROMPath, settings.value("DefaultROM", "").toString().toUtf8().data()); + strcpy(vjs.sourcefilesearchPaths, settings.value("SourceFileSearchPaths", "").toString().toUtf8().data()); vjs.nbrdisasmlines = settings.value("NbrDisasmLines", 32).toUInt(); vjs.disasmopcodes = settings.value("DisasmOpcodes", true).toBool(); vjs.displayHWlabels = settings.value("DisplayHWLabels", true).toBool(); vjs.displayFullSourceFilename = settings.value("displayFullSourceFilename", true).toBool(); + vjs.ELFSectionsCheck = settings.value("ELFSectionsCheck", false).toBool(); vjs.nbrmemory1browserwindow = settings.value("NbrMemory1BrowserWindow", MaxMemory1BrowserWindow).toUInt(); settings.endGroup(); @@ -1783,12 +1957,15 @@ void MainWin::ReadSettings(void) // Write important settings to the log file WriteLog("MainWin: Paths\n"); - WriteLog(" EEPROMPath = \"%s\"\n", vjs.EEPROMPath); - WriteLog(" ROMPath = \"%s\"\n", vjs.ROMPath); - WriteLog(" AlpineROMPath = \"%s\"\n", vjs.alpineROMPath); - WriteLog("DebuggerROMPath = \"%s\"\n", vjs.debuggerROMPath); - WriteLog(" absROMPath = \"%s\"\n", vjs.absROMPath); - WriteLog(" Pipelined DSP = %s\n", (vjs.usePipelinedDSP ? "ON" : "off")); + WriteLog(" EEPROMPath = \"%s\"\n", vjs.EEPROMPath); + WriteLog(" ROMPath = \"%s\"\n", vjs.ROMPath); + WriteLog(" AlpineROMPath = \"%s\"\n", vjs.alpineROMPath); + WriteLog(" DebuggerROMPath = \"%s\"\n", vjs.debuggerROMPath); + WriteLog(" absROMPath = \"%s\"\n", vjs.absROMPath); + WriteLog(" ScreenshotsPath = \"%s\"\n", vjs.screenshotPath); + WriteLog("SourceFileSearchPaths = \"%s\"\n", vjs.sourcefilesearchPaths); + WriteLog("MainWin: Misc.\n"); + WriteLog(" Pipelined DSP = %s\n", (vjs.usePipelinedDSP ? "ON" : "off")); #if 0 // Keybindings in order of U, D, L, R, C, B, A, Op, Pa, 0-9, #, * @@ -1840,6 +2017,7 @@ void MainWin::ReadSettings(void) WriteLog("Read setting = Done\n"); ReadProfiles(&settings); + DBGManager_SourceFileSearchPathsSet(vjs.sourcefilesearchPaths); } @@ -1873,6 +2051,11 @@ void MainWin::ReadUISettings(void) // Video output information zoomLevel = settings.value("zoom", 2).toInt(); +// Emulator status UI information + pos = settings.value("emuStatusWinPos", QPoint(200, 200)).toPoint(); + emuStatusWin->move(pos); + settings.value("emuStatusWinIsVisible", false).toBool() ? ShowEmuStatusWin() : void(); + // Alpine debug UI information (also needed by the Debugger) if (vjs.hardwareTypeAlpine || vjs.softTypeDebugger) { @@ -1893,11 +2076,6 @@ void MainWin::ReadUISettings(void) size = settings.value("stackBrowseWinSize", QSize(400, 400)).toSize(); stackBrowseWin->resize(size); - // Emulator status UI information - pos = settings.value("emuStatusWinPos", QPoint(200, 200)).toPoint(); - emuStatusWin->move(pos); - settings.value("emuStatusWinIsVisible", false).toBool() ? ShowEmuStatusWin() : void(); - // OP (Object Processor) UI information pos = settings.value("opBrowseWinPos", QPoint(200, 200)).toPoint(); opBrowseWin->move(pos); @@ -1905,6 +2083,13 @@ void MainWin::ReadUISettings(void) size = settings.value("opBrowseWinSize", QSize(400, 400)).toSize(); opBrowseWin->resize(size); + // HW registers UI information + pos = settings.value("hwRegsBrowseWinPos", QPoint(200, 200)).toPoint(); + hwRegsBrowseWin->move(pos); + settings.value("hwRegsBrowseWinIsVisible", false).toBool() ? ShowHWRegsBrowserWin() : void(); + size = settings.value("hwRegsBrowseWinSize", QSize(400, 400)).toSize(); + hwRegsBrowseWin->resize(size); + // RISC disassembly UI information pos = settings.value("riscDasmBrowseWinPos", QPoint(200, 200)).toPoint(); riscDasmBrowseWin->move(pos); @@ -1968,6 +2153,33 @@ void MainWin::ReadUISettings(void) size = settings.value("CallStackBrowseWinSize", QSize(400, 400)).toSize(); CallStackBrowseWin->resize(size); + // cartridge directory and files UI information + pos = settings.value("CartFilesListWinPos", QPoint(200, 200)).toPoint(); + CartFilesListWin->move(pos); + settings.value("CartFilesListWinIsVisible", false).toBool() ? ShowCartFilesListWin() : void(); + size = settings.value("CartFilesListWinSize", QSize(400, 400)).toSize(); + CartFilesListWin->resize(size); + + // Save dump UI information + pos = settings.value("SaveDumpAsWinPos", QPoint(200, 200)).toPoint(); + SaveDumpAsWin->move(pos); + settings.value("SaveDumpAsWinIsVisible", false).toBool() ? ShowSaveDumpAsWin() : void(); + size = settings.value("SaveDumpAsWinSize", QSize(400, 400)).toSize(); + SaveDumpAsWin->resize(size); + + // Breakpoints UI information + pos = settings.value("BreakpointsWinPos", QPoint(200, 200)).toPoint(); + BreakpointsWin->move(pos); + settings.value("BreakpointsWinIsVisible", false).toBool() ? ShowBreakpointsWin() : void(); + size = settings.value("BreakpointsWinSize", QSize(400, 400)).toSize(); + BreakpointsWin->resize(size); + // New function breakpoint UI information + pos = settings.value("NewFunctionBreakpointWinPos", QPoint(200, 200)).toPoint(); + NewFunctionBreakpointWin->move(pos); + settings.value("NewFunctionBreakpointWinIsVisible", false).toBool() ? ShowNewFunctionBreakpointWin() : void(); + size = settings.value("NewFunctionBreakpointWinSize", QSize(400, 400)).toSize(); + NewFunctionBreakpointWin->resize(size); + // Memories browser UI information for (i = 0; i < vjs.nbrmemory1browserwindow; i++) { @@ -2021,8 +2233,8 @@ void MainWin::WriteSettings(void) settings.setValue("jaguarModel", vjs.jaguarModel); settings.setValue("biosType", vjs.biosType); settings.setValue("useFastBlitter", vjs.useFastBlitter); - settings.setValue("JagBootROM", vjs.jagBootPath); - settings.setValue("CDBootROM", vjs.CDBootPath); + //settings.setValue("JagBootROM", vjs.jagBootPath); + //settings.setValue("CDBootROM", vjs.CDBootPath); settings.setValue("EEPROMs", vjs.EEPROMPath); settings.setValue("ROMs", vjs.ROMPath); settings.setValue("Screenshots", vjs.screenshotPath); @@ -2041,8 +2253,10 @@ void MainWin::WriteSettings(void) settings.setValue("NbrDisasmLines", vjs.nbrdisasmlines); settings.setValue("DisasmOpcodes", vjs.disasmopcodes); settings.setValue("displayFullSourceFilename", vjs.displayFullSourceFilename); + settings.setValue("ELFSectionsCheck", vjs.ELFSectionsCheck); settings.setValue("NbrMemory1BrowserWindow", (unsigned int)vjs.nbrmemory1browserwindow); settings.setValue("DefaultROM", vjs.debuggerROMPath); + settings.setValue("SourceFileSearchPaths", vjs.sourcefilesearchPaths); settings.endGroup(); // Write settings from the Keybindings @@ -2100,6 +2314,7 @@ void MainWin::WriteSettings(void) #endif WriteProfiles(&settings); + DBGManager_SourceFileSearchPathsSet(vjs.sourcefilesearchPaths); } @@ -2121,6 +2336,10 @@ void MainWin::WriteUISettings(void) // Video output information settings.setValue("zoom", zoomLevel); + // Common UI information + settings.setValue("emuStatusWinPos", emuStatusWin->pos()); + settings.setValue("emuStatusWinIsVisible", emuStatusWin->isVisible()); + // Alpine debug UI information (also needed by the Debugger) if (vjs.hardwareTypeAlpine || vjs.softTypeDebugger) { @@ -2131,11 +2350,12 @@ void MainWin::WriteUISettings(void) settings.setValue("stackBrowseWinPos", stackBrowseWin->pos()); settings.setValue("stackBrowseWinIsVisible", stackBrowseWin->isVisible()); settings.setValue("stackBrowseWinSize", stackBrowseWin->size()); - settings.setValue("emuStatusWinPos", emuStatusWin->pos()); - settings.setValue("emuStatusWinIsVisible", emuStatusWin->isVisible()); settings.setValue("opBrowseWinPos", opBrowseWin->pos()); settings.setValue("opBrowseWinIsVisible", opBrowseWin->isVisible()); settings.setValue("opBrowseWinSize", opBrowseWin->size()); + settings.setValue("hwRegsBrowseWinPos", hwRegsBrowseWin->pos()); + settings.setValue("hwRegsBrowseWinIsVisible", hwRegsBrowseWin->isVisible()); + settings.setValue("hwRegsBrowseWinSize", hwRegsBrowseWin->size()); settings.setValue("riscDasmBrowseWinPos", riscDasmBrowseWin->pos()); settings.setValue("riscDasmBrowseWinIsVisible", riscDasmBrowseWin->isVisible()); settings.setValue("m68kDasmBrowseWinPos", m68kDasmBrowseWin->pos()); @@ -2166,6 +2386,19 @@ void MainWin::WriteUISettings(void) settings.setValue("CallStackBrowseWinPos", CallStackBrowseWin->pos()); settings.setValue("CallStackBrowseWinIsVisible", CallStackBrowseWin->isVisible()); settings.setValue("CallStackBrowseWinSize", CallStackBrowseWin->size()); + settings.setValue("BreakpointsWinPos", BreakpointsWin->pos()); + settings.setValue("BreakpointsWinIsVisible", BreakpointsWin->isVisible()); + settings.setValue("BreakpointsWinSize", BreakpointsWin->size()); + settings.setValue("NewFunctionBreakpointWinPos", NewFunctionBreakpointWin->pos()); + settings.setValue("NewFunctionBreakpointWinIsVisible", NewFunctionBreakpointWin->isVisible()); + settings.setValue("NewFunctionBreakpointWinSize", NewFunctionBreakpointWin->size()); + settings.setValue("CartFilesListWinPos", CartFilesListWin->pos()); + settings.setValue("CartFilesListWinIsVisible", CartFilesListWin->isVisible()); + settings.setValue("CartFilesListWinSize", CartFilesListWin->size()); + settings.setValue("SaveDumpAsWinPos", SaveDumpAsWin->pos()); + settings.setValue("SaveDumpAsWinIsVisible", SaveDumpAsWin->isVisible()); + settings.setValue("SaveDumpAsWinSize", SaveDumpAsWin->size()); + for (i = 0; i < vjs.nbrmemory1browserwindow; i++) { sprintf(mem1Name, "mem1BrowseWinPos[%i]", (unsigned int)i); @@ -2187,10 +2420,32 @@ void MainWin::AlpineRefreshWindows(void) cpuBrowseWin->RefreshContents(); memBrowseWin->RefreshContents(); stackBrowseWin->RefreshContents(); - emuStatusWin->RefreshContents(); opBrowseWin->RefreshContents(); riscDasmBrowseWin->RefreshContents(); m68kDasmBrowseWin->RefreshContents(); + hwRegsBrowseWin->RefreshContents(); +} + + +// +void MainWin::CommonResetWindows(void) +{ +} + + +// Reset common +void MainWin::CommonReset(void) +{ +} + + +// Reset soft debugger +void MainWin::DebuggerReset(void) +{ + if (vjs.softTypeDebugger) + { + DeleteAllBreakpoints(); + } } @@ -2202,20 +2457,43 @@ void MainWin::DebuggerResetWindows(void) FilesrcListWin->Reset(); allWatchBrowseWin->Reset(); heapallocatorBrowseWin->Reset(); - + BreakpointsWin->Reset(); + CartFilesListWin->Reset(); + SourcesWin->Reset(); //ResetAlpineWindows(); } } +// Refresh common windows +void MainWin::CommonRefreshWindows(void) +{ + emuStatusWin->RefreshContents(); +} + + +// Refresh view windows +void MainWin::ViewRefreshWindows(void) +{ + CartFilesListWin->RefreshContents(); +} + + +// +void MainWin::RefreshWindows(void) +{ + DebuggerRefreshWindows(); + CommonRefreshWindows(); +} + + // Refresh soft debugger & alpine debug windows void MainWin::DebuggerRefreshWindows(void) { - size_t i; - if (vjs.softTypeDebugger) { FilesrcListWin->RefreshContents(); + SourcesWin->RefreshContents(); m68kDasmWin->RefreshContents(); GPUDasmWin->RefreshContents(); DSPDasmWin->RefreshContents(); @@ -2223,12 +2501,14 @@ void MainWin::DebuggerRefreshWindows(void) LocalBrowseWin->RefreshContents(); CallStackBrowseWin->RefreshContents(); heapallocatorBrowseWin->RefreshContents(); - for (i = 0; i < vjs.nbrmemory1browserwindow; i++) + BreakpointsWin->RefreshContents(); + for (size_t i = 0; i < vjs.nbrmemory1browserwindow; i++) { mem1BrowseWin[i]->RefreshContents(i); } AlpineRefreshWindows(); + ViewRefreshWindows(); } } @@ -2247,6 +2527,6 @@ void MainWin::MakeScreenshot(void) // Create screenshot screenshot = videoWidget->grabFrameBuffer(); - screenshot.save(Text, "JPG", 100); + screenshot.save((char *)Text, "JPG", 100); }