From f99a6ebc686c03d9f5d4fac031018fc55238152a Mon Sep 17 00:00:00 2001 From: Jean-Paul Mari Date: Fri, 9 Aug 2019 05:02:32 -0400 Subject: [PATCH] Set cartridge view menu for debugger mode only --- docs/vj_HistoryNotes.txt | 3 +- src/debugger/CartFilesListWin.cpp | 13 ++--- src/gui/mainwin.cpp | 89 +++++++++++++++++++++++-------- src/gui/mainwin.h | 10 ++-- 4 files changed, 82 insertions(+), 33 deletions(-) diff --git a/docs/vj_HistoryNotes.txt b/docs/vj_HistoryNotes.txt index 16a719b..84e0b65 100644 --- a/docs/vj_HistoryNotes.txt +++ b/docs/vj_HistoryNotes.txt @@ -76,7 +76,7 @@ Git commit: TBD 40) Added the return address information in the call stack 41) Added multiple breakpoints feature, and their key bindings, for functions only 42) Added timer initialisation for the SDL setup -43) Added a cartdridge view menu +43) Added a cartridge view menu -- Added a window to display my own directory and his files list 44) Debugger sources code clean-up 45) Fix a crash when emulator, in non-debugger mode, opens the breakpoint UIs at launch @@ -88,6 +88,7 @@ Git commit: TBD -- -d has been renamed by -D because another -d was also used for the dsp command line option 51) Removed the sorting filter in the all watches window 52) Fix the support of the DRAM size limit option in the heap allocation window +53) Set cartridge view menu for debugger mode only Release 3 (13th November 2017) ------------------------------ diff --git a/src/debugger/CartFilesListWin.cpp b/src/debugger/CartFilesListWin.cpp index b20ee15..add639e 100644 --- a/src/debugger/CartFilesListWin.cpp +++ b/src/debugger/CartFilesListWin.cpp @@ -1,5 +1,5 @@ // -// CartFilesListWin.cpp - List files in the cartdridge +// CartFilesListWin.cpp - List files in the cartridge // // by Jean-Paul Mari // @@ -8,6 +8,7 @@ // Who When What // --- ---------- ----------------------------------------------------------- // JPM Oct./2018 Created this file, and changed position of the status bar +// JPM Aug./2019 Update texts descriptions // // TO DO: @@ -39,7 +40,7 @@ nbItem(0), CartUsedBytes(0), CartDirType(CFL_NOTYPE) { - setWindowTitle(tr("Cartdridge directory & files")); + setWindowTitle(tr("cartridge directory & files")); // Set the font QFont fixedFont("Lucida Console", 8, QFont::Normal); @@ -118,7 +119,7 @@ void CartFilesListWindow::RefreshContents(void) if ((CartDirectory = (CARTDIRINFO *)CreateInfos())) { UpdateInfos(); - sprintf(msg, "%u files | %u bytes in cartdridge", (unsigned int)CartNbrFiles, (unsigned int)CartUsedBytes); + sprintf(msg, "%u files | %u bytes in cartridge", (unsigned int)CartNbrFiles, (unsigned int)CartUsedBytes); Error = CFL_NOERROR; } else @@ -165,7 +166,7 @@ void CartFilesListWindow::RefreshContents(void) } -// Get files number in the directory +// Get files number in the cartridge directory size_t CartFilesListWindow::GetNbrFiles(void) { switch (CartDirType) @@ -181,7 +182,7 @@ size_t CartFilesListWindow::GetNbrFiles(void) } -// Get directory type +// Get cartridge directory type size_t CartFilesListWindow::GetDirType(void) { if (DBGManager_GetAdrFromSymbolName((char *)"OSJAG_Directory")) @@ -225,7 +226,7 @@ void CartFilesListWindow::GetFileInfos(CARTDIRINFO *Ptr, size_t index) } -// Create information from the directory information +// Create information from the cartridge directory information void *CartFilesListWindow::CreateInfos(void) { CARTDIRINFO *Ptr = (CARTDIRINFO *)calloc(CartNbrFiles, sizeof(CARTDIRINFO)); diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 0c3ec45..a25fad1 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -20,9 +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, cartdridge view menu +// 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 // // FIXED: @@ -180,16 +181,21 @@ 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); + + // Windows debugger mode features if (vjs.softTypeDebugger) { //VideoOutputWin = new VideoOutputWindow(this); @@ -461,7 +467,7 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), // Cart files list CartFilesListAct = new QAction(QIcon(""), tr("Directory and files"), this); - CartFilesListAct->setStatusTip(tr("List of the files in the cartdridge's directory")); + CartFilesListAct->setStatusTip(tr("List of the files in the cartridge's directory structure")); connect(CartFilesListAct, SIGNAL(triggered()), this, SLOT(ShowCartFilesListWin())); // Memory windows @@ -537,13 +543,15 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), // Alpine and debugger menus if (vjs.hardwareTypeAlpine || vjs.softTypeDebugger) { - // Create debug & view menu + // Create debug menu debugMenu = menuBar()->addMenu(tr("&Debug")); - viewMenu = menuBar()->addMenu(tr("&View")); // Create debugger menu if (vjs.softTypeDebugger) { + // Create view menu + viewMenu = menuBar()->addMenu(tr("&View")); + // Cart menu viewCartMenu = viewMenu->addMenu(tr("&Cartridge")); viewCartMenu->addAction(CartFilesListAct); @@ -1081,7 +1089,7 @@ void MainWin::Configure(void) // Just in case we crash before a clean exit... WriteSettings(); - DebuggerRefreshWindows(); + RefreshWindows(); } @@ -1133,16 +1141,19 @@ static uint32_t ntscTickCount; 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++; } } @@ -1247,7 +1258,9 @@ void MainWin::TogglePowerState(void) WriteLog("GUI: Resetting Jaguar...\n"); JaguarReset(); DebuggerReset(); + CommonReset(); DebuggerResetWindows(); + CommonResetWindows(); DACPauseAudioThread(false); } } @@ -1293,7 +1306,7 @@ void MainWin::ToggleRunState(void) cpuBrowseWin->HoldBPM(); cpuBrowseWin->HandleBPMContinue(); - DebuggerRefreshWindows(); + RefreshWindows(); } } else @@ -1471,6 +1484,7 @@ void MainWin::LoadSoftware(QString file) } } + // 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()); @@ -1525,7 +1539,7 @@ void MainWin::ShowNewFunctionBreakpointWin(void) } -// Display list of files found in cartdridge +// Display list of files found in cartridge void MainWin::ShowCartFilesListWin(void) { CartFilesListWin->show(); @@ -1533,7 +1547,7 @@ void MainWin::ShowCartFilesListWin(void) } -// +// Display the save dump pickup file void MainWin::ShowSaveDumpAsWin(void) { SaveDumpAsWin->show(); @@ -1545,7 +1559,7 @@ void MainWin::DebuggerTraceStepInto(void) { JaguarStepInto(); videoWidget->updateGL(); - DebuggerRefreshWindows(); + RefreshWindows(); #ifdef _MSC_VER #pragma message("Warning: !!! Need to verify the Step Into function !!!") #else @@ -1567,7 +1581,8 @@ void MainWin::DebuggerRestart(void) m68k_brk_hitcounts_reset(); bpmHitCounts = 0; DebuggerResetWindows(); - DebuggerRefreshWindows(); + CommonResetWindows(); + RefreshWindows(); #ifdef _MSC_VER #pragma message("Warning: !!! Need to verify the Restart function !!!") #else @@ -1581,7 +1596,7 @@ void MainWin::DebuggerTraceStepOver(void) { JaguarStepOver(0); videoWidget->updateGL(); - DebuggerRefreshWindows(); + RefreshWindows(); #ifdef _MSC_VER #pragma message("Warning: !!! Need to verify the Step Over function !!!") #else @@ -1980,6 +1995,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) { @@ -2000,11 +2020,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); @@ -2075,7 +2090,7 @@ void MainWin::ReadUISettings(void) size = settings.value("CallStackBrowseWinSize", QSize(400, 400)).toSize(); CallStackBrowseWin->resize(size); - // Cartdridge directory and files UI information + // cartridge directory and files UI information pos = settings.value("CartFilesListWinPos", QPoint(200, 200)).toPoint(); CartFilesListWin->move(pos); settings.value("CartFilesListWinIsVisible", false).toBool() ? ShowCartFilesListWin() : void(); @@ -2258,6 +2273,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) { @@ -2268,8 +2287,6 @@ 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()); @@ -2337,13 +2354,24 @@ void MainWin::AlpineRefreshWindows(void) cpuBrowseWin->RefreshContents(); memBrowseWin->RefreshContents(); stackBrowseWin->RefreshContents(); - emuStatusWin->RefreshContents(); opBrowseWin->RefreshContents(); riscDasmBrowseWin->RefreshContents(); m68kDasmBrowseWin->RefreshContents(); } +// +void MainWin::CommonResetWindows(void) +{ +} + + +// Reset common +void MainWin::CommonReset(void) +{ +} + + // Reset soft debugger void MainWin::DebuggerReset(void) { @@ -2369,6 +2397,13 @@ void MainWin::DebuggerResetWindows(void) } +// Refresh common windows +void MainWin::CommonRefreshWindows(void) +{ + emuStatusWin->RefreshContents(); +} + + // Refresh view windows void MainWin::ViewRefreshWindows(void) { @@ -2376,6 +2411,14 @@ void MainWin::ViewRefreshWindows(void) } +// +void MainWin::RefreshWindows(void) +{ + DebuggerRefreshWindows(); + CommonRefreshWindows(); +} + + // Refresh soft debugger & alpine debug windows void MainWin::DebuggerRefreshWindows(void) { diff --git a/src/gui/mainwin.h b/src/gui/mainwin.h index 849b0cc..e76f4ff 100644 --- a/src/gui/mainwin.h +++ b/src/gui/mainwin.h @@ -24,9 +24,6 @@ class HelpWindow; class FilePickerWindow; //class VideoOutputWindow; //class DasmWindow; -class m68KDasmWindow; -class GPUDasmWindow; -class DSPDasmWindow; class EmuStatusWindow; // Alpine @@ -38,6 +35,9 @@ class M68KDasmBrowserWindow; class RISCDasmBrowserWindow; // Debugger +class m68KDasmWindow; +class GPUDasmWindow; +class DSPDasmWindow; class AllWatchBrowserWindow; class LocalBrowserWindow; class CallStackBrowserWindow; @@ -64,8 +64,12 @@ class MainWin: public QMainWindow void SyncUI(void); void DebuggerRefreshWindows(void); void ViewRefreshWindows(void); + void RefreshWindows(void); + void CommonRefreshWindows(void); void AlpineRefreshWindows(void); void DebuggerResetWindows(void); + void CommonResetWindows(void); + void CommonReset(void); void DebuggerReset(void); protected: -- 2.20.1