2 // mainwin.cpp - Qt-based GUI for Virtual Jaguar: Main Application Window
4 // (C) 2009 Underground Software
6 // JLH = James Hammons <jlhamm@acm.org>
7 // JPM = Jean-Paul Mari <djipi.mari@gmail.com>
10 // --- ---------- ------------------------------------------------------------
11 // JLH 12/23/2009 Created this file
12 // JLH 12/20/2010 Added settings, menus & toolbars
13 // JLH 07/05/2011 Added CD BIOS functionality to GUI
14 // JPM 06/06/2016 Visual Studio support
15 // JPM 06/19/2016 Soft debugger integration
16 // JPM 01/11/2017 Added stack browser
17 // JPM 01/02/2017 Added GPU disassembly
18 // JPM 02/02/2017 Added DSP disassembly
19 // JPM 07/12/2017 Added all Watch window
20 // JPM 08/01/2017 Added heap allocator window
21 // JPM 08/07/2017 Added memories window
22 // JPM 08/10/2017 Added a restart feature
23 // JPM 08/31/2017 Added breakpoints window [Not Supported]
24 // JPM 09/01/2017 Save position & visibility windows status in the settings
25 // JPM 09/02/2017 Save size windows in the settings
26 // JPM 09/05/2017 Added Exception Vector Table window
27 // JPM 09/06/2017 Added the 'Rx' word to the emulator window name
28 // JPM 09/12/2017 Added the keybindings in the settings
29 // JPM 11/04/2017 Added the local window
30 // JPM 08/31/2018 Added the call stack window
31 // JPM 09/04/2018 Added the new Models and BIOS handler
36 // - Add dbl click/enter to select in cart list, ESC to dimiss [DONE]
37 // - Autoscan/autoload all available BIOS from 'software' folder [DONE]
38 // - Add 1 key jumping in cartridge list (press 'R', jumps to carts starting
39 // with 'R', etc) [DONE]
40 // - Controller configuration [DONE]
44 // - Fix bug in switching between PAL & NTSC in fullscreen mode.
45 // - Remove SDL dependencies (sound, mainly) from Jaguar core lib
46 // - Fix inconsistency with trailing slashes in paths (eeproms needs one,
49 // SFDX CODE: S1E9T8H5M23YS
51 // Uncomment this for debugging...
53 //#define DEBUGFOO // Various tool debugging... but not used
54 //#define DEBUGTP // Toolpalette debugging... but not used
61 #include "configdialog.h"
62 #include "controllertab.h"
63 #include "keybindingstab.h"
64 #include "filepicker.h"
66 #include "generaltab.h"
72 #include "emustatus.h"
73 #include "debug/cpubrowser.h"
74 #include "debug/m68kdasmbrowser.h"
75 #include "debug/memorybrowser.h"
76 #include "debug/stackbrowser.h"
77 #include "debug/opbrowser.h"
78 #include "debug/riscdasmbrowser.h"
84 #ifndef NEWMODELSBIOSHANDLER
87 #include "jagstub2bios.h"
89 #include "modelsBIOS.h"
91 #include "jagcdbios.h"
93 #include "m68000/m68kinterface.h"
95 //#include "debugger/VideoWin.h"
96 #include "debugger/DasmWin.h"
97 #include "debugger/m68KDasmWin.h"
98 #include "debugger/GPUDasmWin.h"
99 #include "debugger/DSPDasmWin.h"
100 #include "debugger/memory1browser.h"
101 #include "debugger/brkWin.h"
102 #include "debugger/exceptionvectortablebrowser.h"
103 #include "debugger/allwatchbrowser.h"
104 #include "debugger/localbrowser.h"
105 #include "debugger/heapallocatorbrowser.h"
106 #include "debugger/callstackbrowser.h"
109 // According to SebRmv, this header isn't seen on Arch Linux either... :-/
110 //#ifdef __GCCWIN32__
111 // Apparently on win32, usleep() is not pulled in by the usual suspects.
115 #include "_MSC_VER/unistd.h"
119 // The way BSNES controls things is by setting a timer with a zero
120 // timeout, sleeping if not emulating anything. Seems there has to be a
123 // It has a novel approach to plugging-in/using different video/audio/input
124 // methods, can we do something similar or should we just use the built-in
127 // We're going to try to use the built-in OpenGL support and see how it goes.
128 // We'll make the VJ core modular so that it doesn't matter what GUI is in
129 // use, we can drop it in anywhere and use it as-is.
131 MainWin::MainWin(bool autoRun
): running(true), powerButtonOn(false),
132 showUntunedTankCircuit(true), cartridgeLoaded(false), CDActive(false),
133 pauseForFileSelector(false), loadAndGo(autoRun
), scannedSoftwareFolder(false), plzDontKillMyComputer(false)
139 for(int i
=0; i
<8; i
++)
143 for(int i
=0; i
<RING_BUFFER_SIZE
; i
++)
146 ringBufferPointer
= RING_BUFFER_SIZE
- 1;
149 //if (vjs.softTypeDebugger)
151 // mainWindowCentrale = new QMdiArea;
152 // setCentralWidget(mainWindowCentrale);
155 WriteLog("Window creation start\n");
158 videoWidget
= new GLWidget(this);
159 videoWidget
->setSizePolicy(QSizePolicy::Expanding
, QSizePolicy::Expanding
);
161 // set central output window
162 if (!vjs
.softTypeDebugger
)
164 setCentralWidget(videoWidget
);
168 mainWindowCentrale
= new QMdiArea(this);
169 setCentralWidget(mainWindowCentrale
);
172 setWindowIcon(QIcon(":/res/vj-icon.png"));
174 QString title
= QString(tr("Virtual Jaguar " VJ_RELEASE_VERSION
" Rx"));
176 if (vjs
.hardwareTypeAlpine
)
177 title
+= QString(tr(" - Alpine Mode"));
179 if (vjs
.softTypeDebugger
)
180 title
+= QString(tr(" - Debugger Mode"));
182 setWindowTitle(title
);
184 aboutWin
= new AboutWindow(this);
185 helpWin
= new HelpWindow(this);
186 filePickWin
= new FilePickerWindow(this);
187 memBrowseWin
= new MemoryBrowserWindow(this);
188 stackBrowseWin
= new StackBrowserWindow(this);
189 emuStatusWin
= new EmuStatusWindow(this);
190 cpuBrowseWin
= new CPUBrowserWindow(this);
191 opBrowseWin
= new OPBrowserWindow(this);
192 m68kDasmBrowseWin
= new M68KDasmBrowserWindow(this);
193 riscDasmBrowseWin
= new RISCDasmBrowserWindow(this);
194 if (vjs
.softTypeDebugger
)
196 //VideoOutputWin = new VideoOutputWindow(this);
197 //VideoOutputWin->setCentralWidget()
198 //DasmWin = new DasmWindow();
199 DasmWin
= new DasmWindow(this);
200 allWatchBrowseWin
= new AllWatchBrowserWindow(this);
201 LocalBrowseWin
= new LocalBrowserWindow(this);
202 heapallocatorBrowseWin
= new HeapAllocatorBrowserWindow(this);
203 brkWin
= new BrkWindow(this);
204 exceptionvectortableBrowseWin
= new ExceptionVectorTableBrowserWindow(this);
205 CallStackBrowseWin
= new CallStackBrowserWindow(this);
207 mem1BrowseWin
= (Memory1BrowserWindow
**)calloc(vjs
.nbrmemory1browserwindow
, sizeof(Memory1BrowserWindow
));
209 #pragma message("Warning: !!! Need to do the memory desalocation for mem1BrowseWin !!!")
211 #warning "!!! Need to do the memory desalocation for mem1BrowseWin !!!"
213 for (size_t i
= 0; i
< vjs
.nbrmemory1browserwindow
; i
++)
215 mem1BrowseWin
[i
] = new Memory1BrowserWindow(this);
218 dasmtabWidget
= new QTabWidget(this);
219 dasmtabWidget
->setSizePolicy(QSizePolicy::Expanding
, QSizePolicy::Expanding
);
220 dasmtabWidget
->addTab(m68kDasmWin
= new m68KDasmWindow(this), tr("M68000"));
221 dasmtabWidget
->addTab(GPUDasmWin
= new GPUDasmWindow(this), tr("GPU"));
222 dasmtabWidget
->addTab(DSPDasmWin
= new DSPDasmWindow(this), tr("DSP"));
223 ////dasmtabWidget->addTab(m68kDasmBrowseWin, tr("M68000"));
224 setCentralWidget(dasmtabWidget
);
227 QDockWidget
*shapesDockWidget
= new QDockWidget(tr("Shapes"));
228 shapesDockWidget
->setObjectName("shapesDockWidget");
229 shapesDockWidget
->setWidget(m68kDasmWin
);
230 //shapesDockWidget->setWidget(treeWidget);
231 shapesDockWidget
->setAllowedAreas(Qt::LeftDockWidgetArea
| Qt::RightDockWidgetArea
);
232 addDockWidget(Qt::LeftDockWidgetArea
, shapesDockWidget
);
236 // videoWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
237 setSizePolicy(QSizePolicy::Expanding
, QSizePolicy::Expanding
);
239 setUnifiedTitleAndToolBarOnMac(true);
243 quitAppAct
= new QAction(QIcon(":/res/exit.png"), tr("E&xit"), this);
244 // quitAppAct->setShortcuts(QKeySequence::Quit);
245 // quitAppAct->setShortcut(QKeySequence(tr("Alt+x")));
246 //quitAppAct->setShortcut(QKeySequence(tr("Ctrl+q")));
247 quitAppAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBQUIT
].KBSettingValue
)));
248 quitAppAct
->setShortcutContext(Qt::ApplicationShortcut
);
249 quitAppAct
->setStatusTip(tr("Quit Virtual Jaguar"));
250 connect(quitAppAct
, SIGNAL(triggered()), this, SLOT(close()));
252 powerGreen
.addFile(":/res/power-off.png", QSize(), QIcon::Normal
, QIcon::Off
);
253 powerGreen
.addFile(":/res/power-on-green.png", QSize(), QIcon::Normal
, QIcon::On
);
254 powerRed
.addFile(":/res/power-off.png", QSize(), QIcon::Normal
, QIcon::Off
);
255 powerRed
.addFile(":/res/power-on-red.png", QSize(), QIcon::Normal
, QIcon::On
);
257 powerAct
= new QAction(powerGreen
, tr("&Power"), this);
258 powerAct
->setStatusTip(tr("Powers Jaguar on/off"));
259 powerAct
->setCheckable(true);
260 powerAct
->setChecked(false);
261 connect(powerAct
, SIGNAL(triggered()), this, SLOT(TogglePowerState()));
264 pauseIcon
.addFile(":/res/pause-off.png", QSize(), QIcon::Normal
, QIcon::Off
);
265 pauseIcon
.addFile(":/res/pause-on.png", QSize(), QIcon::Normal
, QIcon::On
);
266 pauseAct
= new QAction(pauseIcon
, tr("Pause"), this);
267 pauseAct
->setStatusTip(tr("Toggles the running state"));
268 pauseAct
->setCheckable(true);
269 pauseAct
->setDisabled(true);
270 //pauseAct->setShortcut(QKeySequence(tr("Esc")));
271 pauseAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBPAUSE
].KBSettingValue
)));
272 pauseAct
->setShortcutContext(Qt::ApplicationShortcut
);
273 connect(pauseAct
, SIGNAL(triggered()), this, SLOT(ToggleRunState()));
275 zoomActs
= new QActionGroup(this);
277 x1Act
= new QAction(QIcon(":/res/zoom100.png"), tr("Zoom 100%"), zoomActs
);
278 x1Act
->setStatusTip(tr("Set window zoom to 100%"));
279 x1Act
->setCheckable(true);
280 connect(x1Act
, SIGNAL(triggered()), this, SLOT(SetZoom100()));
282 x2Act
= new QAction(QIcon(":/res/zoom200.png"), tr("Zoom 200%"), zoomActs
);
283 x2Act
->setStatusTip(tr("Set window zoom to 200%"));
284 x2Act
->setCheckable(true);
285 connect(x2Act
, SIGNAL(triggered()), this, SLOT(SetZoom200()));
287 x3Act
= new QAction(QIcon(":/res/zoom300.png"), tr("Zoom 300%"), zoomActs
);
288 x3Act
->setStatusTip(tr("Set window zoom to 300%"));
289 x3Act
->setCheckable(true);
290 connect(x3Act
, SIGNAL(triggered()), this, SLOT(SetZoom300()));
292 tvTypeActs
= new QActionGroup(this);
294 ntscAct
= new QAction(QIcon(":/res/ntsc.png"), tr("NTSC"), tvTypeActs
);
295 ntscAct
->setStatusTip(tr("Sets Jaguar to NTSC mode"));
296 ntscAct
->setCheckable(true);
297 connect(ntscAct
, SIGNAL(triggered()), this, SLOT(SetNTSC()));
299 palAct
= new QAction(QIcon(":/res/pal.png"), tr("PAL"), tvTypeActs
);
300 palAct
->setStatusTip(tr("Sets Jaguar to PAL mode"));
301 palAct
->setCheckable(true);
302 connect(palAct
, SIGNAL(triggered()), this, SLOT(SetPAL()));
304 blur
.addFile(":/res/blur-off.png", QSize(), QIcon::Normal
, QIcon::Off
);
305 blur
.addFile(":/res/blur-on.png", QSize(), QIcon::Normal
, QIcon::On
);
307 blurAct
= new QAction(blur
, tr("Blur"), this);
308 blurAct
->setStatusTip(tr("Sets OpenGL rendering to GL_NEAREST"));
309 blurAct
->setCheckable(true);
310 connect(blurAct
, SIGNAL(triggered()), this, SLOT(ToggleBlur()));
312 aboutAct
= new QAction(QIcon(":/res/vj-icon.png"), tr("&About..."), this);
313 aboutAct
->setStatusTip(tr("Blatant self-promotion"));
314 connect(aboutAct
, SIGNAL(triggered()), this, SLOT(ShowAboutWin()));
316 helpAct
= new QAction(QIcon(":/res/vj-icon.png"), tr("&Contents..."), this);
317 helpAct
->setStatusTip(tr("Help is available, if you should need it"));
318 connect(helpAct
, SIGNAL(triggered()), this, SLOT(ShowHelpWin()));
320 if (!vjs
.softTypeDebugger
)
322 filePickAct
= new QAction(QIcon(":/res/software.png"), tr("&Insert Cartridge..."), this);
323 filePickAct
->setStatusTip(tr("Insert a cartridge into Virtual Jaguar"));
327 filePickAct
= new QAction(QIcon(":/res/software.png"), tr("&Insert executable file..."), this);
328 filePickAct
->setStatusTip(tr("Insert an executable into Virtual Jaguar"));
330 //filePickAct->setShortcut(QKeySequence(tr("Ctrl+i")));
331 filePickAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBPICKFILE
].KBSettingValue
)));
332 filePickAct
->setShortcutContext(Qt::ApplicationShortcut
);
333 connect(filePickAct
, SIGNAL(triggered()), this, SLOT(InsertCart()));
335 configAct
= new QAction(QIcon(":/res/wrench.png"), tr("&Configure"), this);
336 configAct
->setStatusTip(tr("Configure options for Virtual Jaguar"));
337 //configAct->setShortcut(QKeySequence(tr("Ctrl+c")));
338 configAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBCONFIGURE
].KBSettingValue
)));
339 configAct
->setShortcutContext(Qt::ApplicationShortcut
);
340 connect(configAct
, SIGNAL(triggered()), this, SLOT(Configure()));
342 emustatusAct
= new QAction(QIcon(":/res/status.png"), tr("&Status"), this);
343 emustatusAct
->setStatusTip(tr("Emulator status"));
344 //emustatusAct->setShortcut(QKeySequence(tr("Ctrl+s")));
345 emustatusAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBEMUSTATUS
].KBSettingValue
)));
346 emustatusAct
->setShortcutContext(Qt::ApplicationShortcut
);
347 connect(emustatusAct
, SIGNAL(triggered()), this, SLOT(ShowEmuStatusWin()));
349 useCDAct
= new QAction(QIcon(":/res/compact-disc.png"), tr("&Use CD Unit"), this);
350 useCDAct
->setStatusTip(tr("Use Jaguar Virtual CD unit"));
351 // useCDAct->setShortcut(QKeySequence(tr("Ctrl+c")));
352 useCDAct
->setCheckable(true);
353 connect(useCDAct
, SIGNAL(triggered()), this, SLOT(ToggleCDUsage()));
355 frameAdvanceAct
= new QAction(QIcon(":/res/frame-advance.png"), tr("&Frame Advance"), this);
356 //frameAdvanceAct->setShortcut(QKeySequence(tr("F7")));
357 frameAdvanceAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBFRAMEADVANCE
].KBSettingValue
)));
358 frameAdvanceAct
->setShortcutContext(Qt::ApplicationShortcut
);
359 frameAdvanceAct
->setDisabled(true);
360 connect(frameAdvanceAct
, SIGNAL(triggered()), this, SLOT(FrameAdvance()));
362 if (vjs
.softTypeDebugger
)
364 restartAct
= new QAction(QIcon(":/res/debug-restart.png"), tr("&Restart"), this);
365 //restartAct->setShortcut(QKeySequence(tr("Ctrl+Shift+F5")));
366 restartAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBRESTART
].KBSettingValue
)));
367 restartAct
->setShortcutContext(Qt::ApplicationShortcut
);
368 restartAct
->setCheckable(false);
369 restartAct
->setDisabled(true);
370 connect(restartAct
, SIGNAL(triggered()), this, SLOT(DebuggerRestart()));
372 traceStepOverAct
= new QAction(QIcon(":/res/debug-stepover.png"), tr("&Step Over"), this);
373 //traceStepOverAct->setShortcut(QKeySequence(tr("F10")));
374 traceStepOverAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBSTEPOVER
].KBSettingValue
)));
375 traceStepOverAct
->setShortcutContext(Qt::ApplicationShortcut
);
376 traceStepOverAct
->setCheckable(false);
377 traceStepOverAct
->setDisabled(true);
378 connect(traceStepOverAct
, SIGNAL(triggered()), this, SLOT(DebuggerTraceStepOver()));
380 traceStepIntoAct
= new QAction(QIcon(":/res/debug-stepinto.png"), tr("&Step Into"), this);
381 //traceStepIntoAct->setShortcut(QKeySequence(tr("F11")));
382 traceStepIntoAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBSTEPINTO
].KBSettingValue
)));
383 traceStepIntoAct
->setShortcutContext(Qt::ApplicationShortcut
);
384 traceStepIntoAct
->setCheckable(false);
385 traceStepIntoAct
->setDisabled(true);
386 connect(traceStepIntoAct
, SIGNAL(triggered()), this, SLOT(DebuggerTraceStepInto()));
388 newBreakpointFunctionAct
= new QAction(QIcon(""), tr("&Function Breakpoint"), this);
389 newBreakpointFunctionAct
->setShortcut(QKeySequence(tr("Ctrl+B")));
390 connect(newBreakpointFunctionAct
, SIGNAL(triggered()), this, SLOT(NewBreakpointFunction()));
393 fullScreenAct
= new QAction(QIcon(":/res/fullscreen.png"), tr("F&ull Screen"), this);
394 //fullScreenAct->setShortcut(QKeySequence(tr("F9")));
395 fullScreenAct
->setShortcut(QKeySequence(tr(vjs
.KBContent
[KBFULLSCREEN
].KBSettingValue
)));
396 fullScreenAct
->setShortcutContext(Qt::ApplicationShortcut
);
397 fullScreenAct
->setCheckable(true);
398 connect(fullScreenAct
, SIGNAL(triggered()), this, SLOT(ToggleFullScreen()));
401 if (vjs
.softTypeDebugger
)
403 exceptionVectorTableBrowseAct
= new QAction(QIcon(""), tr("Exception Vector Table"), this);
404 exceptionVectorTableBrowseAct
->setStatusTip(tr("Shows all Exception Vector Table browser window"));
405 connect(exceptionVectorTableBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowExceptionVectorTableBrowserWin()));
407 allWatchBrowseAct
= new QAction(QIcon(":/res/debug-watch.png"), tr("All Watch"), this);
408 allWatchBrowseAct
->setStatusTip(tr("Shows all Watch browser window"));
409 connect(allWatchBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowAllWatchBrowserWin()));
411 LocalBrowseAct
= new QAction(QIcon(":/res/debug-local.png"), tr("Local"), this);
412 LocalBrowseAct
->setStatusTip(tr("Shows Local browser window"));
413 connect(LocalBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowLocalBrowserWin()));
415 heapallocatorBrowseAct
= new QAction(QIcon(""), tr("Heap allocator"), this);
416 heapallocatorBrowseAct
->setStatusTip(tr("Shows the heap allocator browser window"));
417 connect(heapallocatorBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowHeapAllocatorBrowserWin()));
419 CallStackBrowseAct
= new QAction(QIcon(":/res/debug-callstack.png"), tr("Call Stack"), this);
420 CallStackBrowseAct
->setStatusTip(tr("Shows Call Stack browser window"));
421 connect(CallStackBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowCallStackBrowserWin()));
423 mem1BrowseAct
= (QAction
**)calloc(vjs
.nbrmemory1browserwindow
, sizeof(QAction
));
424 QSignalMapper
*signalMapper
= new QSignalMapper(this);
426 #pragma message("Warning: !!! Need to do the memory desalocation for mem1BrowseAct !!!")
428 #warning "!!! Need to do the memory desalocation for mem1BrowseAct !!!"
430 for (int i
= 0; i
< vjs
.nbrmemory1browserwindow
; i
++)
433 sprintf(MB
, "Memory %i", (unsigned int)(i
+1));
434 mem1BrowseAct
[i
] = new QAction(QIcon(":/res/debug-memory.png"), tr(MB
), this);
435 mem1BrowseAct
[i
]->setStatusTip(tr("Shows a Jaguar memory browser window"));
437 //connect(mem1BrowseAct[0], SIGNAL(triggered()), this, SLOT(ShowMemory1BrowserWin(size_t(0))));
438 connect(mem1BrowseAct
[i
], SIGNAL(triggered()), signalMapper
, SLOT(map()));
439 signalMapper
->setMapping(mem1BrowseAct
[i
], (int)i
);
440 connect(signalMapper
, SIGNAL(mapped(int)), this, SLOT(ShowMemory1BrowserWin(int)));
444 // Debugger Browser Actions
445 memBrowseAct
= new QAction(QIcon(":/res/tool-memory.png"), tr("Memory Browser"), this);
446 memBrowseAct
->setStatusTip(tr("Shows the Jaguar memory browser window"));
447 // memBrowseAct->setCheckable(true);
448 connect(memBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowMemoryBrowserWin()));
450 stackBrowseAct
= new QAction(QIcon(":/res/tool-stack.png"), tr("Stack Browser"), this);
451 stackBrowseAct
->setStatusTip(tr("Shows the Jaguar stack browser window"));
452 // memBrowseAct->setCheckable(true);
453 connect(stackBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowStackBrowserWin()));
455 cpuBrowseAct
= new QAction(QIcon(":/res/tool-cpu.png"), tr("CPU Browser"), this);
456 cpuBrowseAct
->setStatusTip(tr("Shows the Jaguar CPU browser window"));
457 // memBrowseAct->setCheckable(true);
458 connect(cpuBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowCPUBrowserWin()));
460 opBrowseAct
= new QAction(QIcon(":/res/tool-op.png"), tr("OP Browser"), this);
461 opBrowseAct
->setStatusTip(tr("Shows the Jaguar OP browser window"));
462 // memBrowseAct->setCheckable(true);
463 connect(opBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowOPBrowserWin()));
465 m68kDasmBrowseAct
= new QAction(QIcon(":/res/tool-68k-dis.png"), tr("68K Listing Browser"), this);
466 m68kDasmBrowseAct
->setStatusTip(tr("Shows the 68K disassembly browser window"));
467 // memBrowseAct->setCheckable(true);
468 connect(m68kDasmBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowM68KDasmBrowserWin()));
470 riscDasmBrowseAct
= new QAction(QIcon(":/res/tool-risc-dis.png"), tr("RISC Listing Browser"), this);
471 riscDasmBrowseAct
->setStatusTip(tr("Shows the RISC disassembly browser window"));
472 // memBrowseAct->setCheckable(true);
473 connect(riscDasmBrowseAct
, SIGNAL(triggered()), this, SLOT(ShowRISCDasmBrowserWin()));
475 if (vjs
.softTypeDebugger
)
477 VideoOutputAct
= new QAction(tr("Output Video"), this);
478 VideoOutputAct
->setStatusTip(tr("Shows the output video window"));
479 connect(VideoOutputAct
, SIGNAL(triggered()), this, SLOT(ShowVideoOutputWin()));
481 DasmAct
= new QAction(tr("Disassembly"), this);
482 DasmAct
->setStatusTip(tr("Shows the disassembly window"));
483 connect(DasmAct
, SIGNAL(triggered()), this, SLOT(ShowDasmWin()));
486 // Misc. connections...
487 connect(filePickWin
, SIGNAL(RequestLoad(QString
)), this, SLOT(LoadSoftware(QString
)));
488 connect(filePickWin
, SIGNAL(FilePickerHiding()), this, SLOT(Unpause()));
492 fileMenu
= menuBar()->addMenu(tr("&Jaguar"));
493 fileMenu
->addAction(powerAct
);
494 if (!vjs
.softTypeDebugger
)
496 fileMenu
->addAction(pauseAct
);
497 // fileMenu->addAction(frameAdvanceAct);
499 fileMenu
->addAction(filePickAct
);
500 fileMenu
->addAction(useCDAct
);
501 fileMenu
->addAction(configAct
);
502 fileMenu
->addAction(emustatusAct
);
503 fileMenu
->addSeparator();
504 fileMenu
->addAction(quitAppAct
);
506 if (vjs
.hardwareTypeAlpine
|| vjs
.softTypeDebugger
)
508 debugMenu
= menuBar()->addMenu(tr("&Debug"));
509 if (vjs
.softTypeDebugger
)
511 debugWindowsMenu
= debugMenu
->addMenu(tr("&Windows"));
512 debugWindowExceptionMenu
= debugWindowsMenu
->addMenu(tr("&Exception"));
513 debugWindowExceptionMenu
->addAction(exceptionVectorTableBrowseAct
);
514 debugWindowsMenu
->addSeparator();
516 debugWindowOutputMenu
= debugWindowsMenu
->addMenu(tr("&Output"));
517 debugWindowOutputMenu
->addAction(VideoOutputAct
);
518 debugWindowsMenu
->addSeparator();
520 debugWindowsWatchMenu
= debugWindowsMenu
->addMenu(tr("&Watch"));
521 debugWindowsWatchMenu
->addAction(allWatchBrowseAct
);
522 debugWindowsMenu
->addAction(LocalBrowseAct
);
523 debugWindowsMenu
->addSeparator();
524 debugWindowsMenu
->addAction(CallStackBrowseAct
);
525 debugWindowsMenu
->addSeparator();
526 debugWindowsMemoryMenu
= debugWindowsMenu
->addMenu(tr("&Memory"));
527 debugWindowsMemoryMenu
->addAction(heapallocatorBrowseAct
);
528 debugWindowsMemoryMenu
->addSeparator();
529 for (int i
= 0; i
< vjs
.nbrmemory1browserwindow
; i
++)
531 debugWindowsMemoryMenu
->addAction(mem1BrowseAct
[i
]);
533 debugWindowsMenu
->addSeparator();
534 debugWindowsBrowsesMenu
= debugWindowsMenu
->addMenu(tr("&Browsers"));
535 debugWindowsBrowsesMenu
->addAction(memBrowseAct
);
536 debugWindowsBrowsesMenu
->addAction(stackBrowseAct
);
537 debugWindowsBrowsesMenu
->addAction(cpuBrowseAct
);
538 debugWindowsBrowsesMenu
->addAction(opBrowseAct
);
539 debugWindowsBrowsesMenu
->addAction(m68kDasmBrowseAct
);
540 debugWindowsBrowsesMenu
->addAction(riscDasmBrowseAct
);
541 debugMenu
->addSeparator();
542 debugMenu
->addAction(pauseAct
);
543 debugMenu
->addAction(frameAdvanceAct
);
544 debugMenu
->addAction(restartAct
);
545 debugMenu
->addSeparator();
546 debugMenu
->addAction(traceStepIntoAct
);
547 debugMenu
->addAction(traceStepOverAct
);
549 debugMenu
->addSeparator();
550 debugNewBreakpointMenu
= debugMenu
->addMenu(tr("&New Breakpoint"));
551 debugNewBreakpointMenu
->addAction(newBreakpointFunctionAct
);
553 //debugMenu->addSeparator();
554 //debugMenu->addAction(DasmAct);
558 debugMenu
->addAction(memBrowseAct
);
559 debugMenu
->addAction(stackBrowseAct
);
560 debugMenu
->addAction(cpuBrowseAct
);
561 debugMenu
->addAction(opBrowseAct
);
562 debugMenu
->addAction(m68kDasmBrowseAct
);
563 debugMenu
->addAction(riscDasmBrowseAct
);
567 helpMenu
= menuBar()->addMenu(tr("&Help"));
568 helpMenu
->addAction(helpAct
);
569 helpMenu
->addAction(aboutAct
);
573 toolbar
= addToolBar(tr("Stuff"));
574 toolbar
->addAction(powerAct
);
575 if (!vjs
.softTypeDebugger
)
577 toolbar
->addAction(pauseAct
);
578 toolbar
->addAction(frameAdvanceAct
);
580 toolbar
->addAction(filePickAct
);
581 toolbar
->addAction(useCDAct
);
582 toolbar
->addSeparator();
583 if (!vjs
.softTypeDebugger
)
585 toolbar
->addAction(x1Act
);
586 toolbar
->addAction(x2Act
);
587 toolbar
->addAction(x3Act
);
588 toolbar
->addSeparator();
589 toolbar
->addAction(ntscAct
);
590 toolbar
->addAction(palAct
);
591 toolbar
->addSeparator();
592 toolbar
->addAction(blurAct
);
593 toolbar
->addAction(fullScreenAct
);
597 debuggerbar
= addToolBar(tr("&Debugger"));
598 debuggerbar
->addAction(pauseAct
);
599 debuggerbar
->addAction(frameAdvanceAct
);
600 debuggerbar
->addAction(restartAct
);
601 debuggerbar
->addSeparator();
602 debuggerbar
->addAction(traceStepIntoAct
);
603 debuggerbar
->addAction(traceStepOverAct
);
606 if (vjs
.hardwareTypeAlpine
)
608 debugbar
= addToolBar(tr("&Debug"));
609 debugbar
->addAction(memBrowseAct
);
610 debugbar
->addAction(stackBrowseAct
);
611 debugbar
->addAction(cpuBrowseAct
);
612 debugbar
->addAction(opBrowseAct
);
613 debugbar
->addAction(m68kDasmBrowseAct
);
614 debugbar
->addAction(riscDasmBrowseAct
);
617 // Add actions to the main window, as hiding widgets with them
619 addAction(fullScreenAct
);
620 addAction(quitAppAct
);
621 addAction(configAct
);
622 addAction(emustatusAct
);
624 addAction(filePickAct
);
625 addAction(frameAdvanceAct
);
628 statusBar()->showMessage(tr("Ready"));
630 // Do this in case original size isn't correct (mostly for the first-run case)
633 WriteLog("Window creation done\n");
635 // Create our test pattern NTSC bitmap
636 WriteLog("Test pattern 1 bitmap\n");
638 QImage
tempImg(":/res/test-pattern.jpg");
639 QImage tempImgScaled
= tempImg
.scaled(VIRTUAL_SCREEN_WIDTH
, VIRTUAL_SCREEN_HEIGHT_PAL
, Qt::IgnoreAspectRatio
, Qt::SmoothTransformation
);
641 for(uint32_t y
=0; y
<VIRTUAL_SCREEN_HEIGHT_PAL
; y
++)
643 const QRgb
* scanline
= (QRgb
*)tempImgScaled
.constScanLine(y
);
645 for(uint32_t x
=0; x
<VIRTUAL_SCREEN_WIDTH
; x
++)
647 uint32_t pixel
= (qRed(scanline
[x
]) << 24) | (qGreen(scanline
[x
]) << 16) | (qBlue(scanline
[x
]) << 8) | 0xFF;
648 testPattern
[(y
* VIRTUAL_SCREEN_WIDTH
) + x
] = pixel
;
652 // Create our test pattern PAL bitmap
653 WriteLog("Test pattern 2 bitmap\n");
655 QImage
tempImg2(":/res/test-pattern-pal.jpg");
656 QImage tempImgScaled2
= tempImg2
.scaled(VIRTUAL_SCREEN_WIDTH
, VIRTUAL_SCREEN_HEIGHT_PAL
, Qt::IgnoreAspectRatio
, Qt::SmoothTransformation
);
658 for(uint32_t y
=0; y
<VIRTUAL_SCREEN_HEIGHT_PAL
; y
++)
660 const QRgb
* scanline
= (QRgb
*)tempImgScaled2
.constScanLine(y
);
662 for(uint32_t x
=0; x
<VIRTUAL_SCREEN_WIDTH
; x
++)
664 uint32_t pixel
= (qRed(scanline
[x
]) << 24) | (qGreen(scanline
[x
]) << 16) | (qBlue(scanline
[x
]) << 8) | 0xFF;
665 testPattern2
[(y
* VIRTUAL_SCREEN_WIDTH
) + x
] = pixel
;
669 // Set up timer based loop for animation...
670 timer
= new QTimer(this);
671 connect(timer
, SIGNAL(timeout()), this, SLOT(Timer()));
673 // This isn't very accurate for NTSC: This is early by 40 msec per frame.
674 // This is because it's discarding the 0.6666... on the end of the fraction.
675 // Alas, 6 doesn't divide cleanly into 10. :-P
676 //Should we defer this until SyncUI? Probably.
677 //No, it doesn't work, because it uses setInterval() instead of start()...
678 // timer->start(vjs.hardwareTypeNTSC ? 16 : 20);
680 // We set this initially, to make VJ behave somewhat as it would if no
681 // cart were inserted and the BIOS was set as active...
682 jaguarCartInserted
= true;
683 WriteLog("Virtual Jaguar %s Rx (Last full build was on %s %s)\n", VJ_RELEASE_VERSION
, __DATE__
, __TIME__
);
684 WriteLog("VJ: Initializing jaguar subsystem...\n");
687 #ifndef NEWMODELSBIOSHANDLER
688 // memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Use the stock BIOS
689 memcpy(jagMemSpace
+ 0xE00000, (vjs
.biosType
== BT_K_SERIES
? jaguarBootROM
: jaguarBootROM2
), 0x20000); // Use the stock BIOS
691 SelectBIOS(vjs
.biosType
);
694 // Prevent the file scanner from running if filename passed
695 // in on the command line...
699 // Load up the default ROM if in Alpine mode:
700 if (vjs
.hardwareTypeAlpine
)
702 bool romLoaded
= JaguarLoadFile(vjs
.alpineROMPath
);
704 // If regular load failed, try just a straight file load
705 // (Dev only! I don't want people to start getting lazy with their releases again! :-P)
707 romLoaded
= AlpineLoadFile(vjs
.alpineROMPath
);
710 WriteLog("Alpine Mode: Successfully loaded file \"%s\".\n", vjs
.alpineROMPath
);
712 WriteLog("Alpine Mode: Unable to load file \"%s\"!\n", vjs
.alpineROMPath
);
714 // Attempt to load/run the ABS file...
715 LoadSoftware(vjs
.absROMPath
);
716 #ifndef NEWMODELSBIOSHANDLER
717 memcpy(jagMemSpace
+ 0xE00000, jaguarDevBootROM2
, 0x20000); // Use the stub BIOS
719 SelectBIOS(vjs
.biosType
);
721 // Prevent the scanner from running...
725 // Load up the default ROM if in Debugger mode:
726 if (vjs
.softTypeDebugger
)
728 bool romLoaded
= JaguarLoadFile(vjs
.debuggerROMPath
);
730 // If regular load failed, try just a straight file load
731 // (Dev only! I don't want people to start getting lazy with their releases again! :-P)
733 romLoaded
= DebuggerLoadFile(vjs
.debuggerROMPath
);
736 WriteLog("Debugger Mode: Successfully loaded file \"%s\".\n", vjs
.debuggerROMPath
);
738 WriteLog("Debugger Mode: Unable to load file \"%s\"!\n", vjs
.debuggerROMPath
);
740 // Attempt to load/run the ABS file...
741 LoadSoftware(vjs
.absROMPath
);
742 #ifndef NEWMODELSBIOSHANDLER
743 memcpy(jagMemSpace
+ 0xE00000, jaguarDevBootROM2
, 0x20000); // Use the stub BIOS
744 // Prevent the scanner from running...
746 SelectBIOS(vjs
.biosType
);
751 // Run the scanner if nothing passed in and *not* Alpine mode...
752 // NB: Really need to look into caching the info scanned in here...
753 filePickWin
->ScanSoftwareFolder(allowUnknownSoftware
);
754 scannedSoftwareFolder
= true;
758 void MainWin::LoadFile(QString file
)
764 void MainWin::SyncUI(void)
766 // Set toolbar buttons/menus based on settings read in (sync the UI)...
767 // (Really, this is to sync command line options passed in)
768 blurAct
->setChecked(vjs
.glFilter
);
769 x1Act
->setChecked(zoomLevel
== 1);
770 x2Act
->setChecked(zoomLevel
== 2);
771 x3Act
->setChecked(zoomLevel
== 3);
772 // running = powerAct->isChecked();
773 ntscAct
->setChecked(vjs
.hardwareTypeNTSC
);
774 palAct
->setChecked(!vjs
.hardwareTypeNTSC
);
775 powerAct
->setIcon(vjs
.hardwareTypeNTSC
? powerRed
: powerGreen
);
777 fullScreenAct
->setChecked(vjs
.fullscreen
);
778 fullScreen
= vjs
.fullscreen
;
779 SetFullScreen(fullScreen
);
781 // Reset the timer to be what was set in the command line (if any):
782 // timer->setInterval(vjs.hardwareTypeNTSC ? 16 : 20);
783 timer
->start(vjs
.hardwareTypeNTSC
? 16 : 20);
787 void MainWin::closeEvent(QCloseEvent
* event
)
790 // This should only be done by the config dialog
793 event
->accept(); // ignore() if can't close for some reason
797 void MainWin::keyPressEvent(QKeyEvent
* e
)
799 #ifndef VJ_REMOVE_DEV_CODE
801 //extern bool startM68KTracing; // moved to jaguar.h
803 extern int blit_start_log
;
805 extern bool startConciseBlitLogging
;
808 // We ignore the Alt key for now, since it causes problems with the GUI
809 if (e
->key() == Qt::Key_Alt
)
814 // Bar this shite from release versions kthxbai
815 #ifndef VJ_REMOVE_DEV_CODE
816 else if (e
->key() == Qt::Key_F11
)
818 startM68KTracing
= true;
822 else if (e
->key() == Qt::Key_F12
)
824 blit_start_log
= true;
828 else if (e
->key() == Qt::Key_F10
)
830 startConciseBlitLogging
= true;
835 else if (e
->key() == Qt::Key_F8
)
837 // ggn: For extra NYAN pleasure...
838 // ggn: There you go James :P
839 // Shamus: Thanks for the patch! :-D
840 WriteLog(" o + + +\n");
841 WriteLog("+ o o + o\n");
842 WriteLog("-_-_-_-_-_-_-_,------, o \n");
843 WriteLog("_-_-_-_-_-_-_-| /\\_/\\ \n");
844 WriteLog("-_-_-_-_-_-_-~|__( ^ .^) + + \n");
845 WriteLog("_-_-_-_-_-_-_-\"\" \"\" \n");
846 WriteLog("+ o o + o\n");
853 This is done now by a QAction...
854 if (e->key() == Qt::Key_F9)
864 void MainWin::keyReleaseEvent(QKeyEvent
* e
)
866 // We ignore the Alt key for now, since it causes problems with the GUI
867 if (e
->key() == Qt::Key_Alt
)
873 HandleKeys(e
, false);
877 void MainWin::HandleKeys(QKeyEvent
* e
, bool state
)
879 enum { P1LEFT
= 0, P1RIGHT
, P1UP
, P1DOWN
, P2LEFT
, P2RIGHT
, P2UP
, P2DOWN
};
880 // We kill bad key combos here, before they can get to the emulator...
881 // This also kills the illegal instruction problem that cropped up in
884 // First, settle key states...
885 if (e
->key() == (int)vjs
.p1KeyBindings
[BUTTON_L
])
886 keyHeld
[P1LEFT
] = state
;
887 else if (e
->key() == (int)vjs
.p1KeyBindings
[BUTTON_R
])
888 keyHeld
[P1RIGHT
] = state
;
889 else if (e
->key() == (int)vjs
.p1KeyBindings
[BUTTON_U
])
890 keyHeld
[P1UP
] = state
;
891 else if (e
->key() == (int)vjs
.p1KeyBindings
[BUTTON_D
])
892 keyHeld
[P1DOWN
] = state
;
893 else if (e
->key() == (int)vjs
.p2KeyBindings
[BUTTON_L
])
894 keyHeld
[P2LEFT
] = state
;
895 else if (e
->key() == (int)vjs
.p2KeyBindings
[BUTTON_R
])
896 keyHeld
[P2RIGHT
] = state
;
897 else if (e
->key() == (int)vjs
.p2KeyBindings
[BUTTON_U
])
898 keyHeld
[P2UP
] = state
;
899 else if (e
->key() == (int)vjs
.p2KeyBindings
[BUTTON_D
])
900 keyHeld
[P2DOWN
] = state
;
902 // Next, check for conflicts and kill 'em if there are any...
903 if (keyHeld
[P1LEFT
] && keyHeld
[P1RIGHT
])
904 keyHeld
[P1LEFT
] = keyHeld
[P1RIGHT
] = false;
906 if (keyHeld
[P1UP
] && keyHeld
[P1DOWN
])
907 keyHeld
[P1UP
] = keyHeld
[P1DOWN
] = false;
909 if (keyHeld
[P2LEFT
] && keyHeld
[P2RIGHT
])
910 keyHeld
[P2LEFT
] = keyHeld
[P2RIGHT
] = false;
912 if (keyHeld
[P2UP
] && keyHeld
[P2DOWN
])
913 keyHeld
[P2UP
] = keyHeld
[P2DOWN
] = false;
915 // No bad combos exist now, let's stuff the emulator key buffers...!
916 for(int i
=BUTTON_FIRST
; i
<=BUTTON_LAST
; i
++)
918 if (e
->key() == (int)vjs
.p1KeyBindings
[i
])
919 joypad0Buttons
[i
] = (state
? 0x01 : 0x00);
921 if (e
->key() == (int)vjs
.p2KeyBindings
[i
])
922 joypad1Buttons
[i
] = (state
? 0x01 : 0x00);
928 // N.B.: The profile system AutoConnect functionality sets the gamepad IDs here.
930 void MainWin::HandleGamepads(void)
934 for(int i
=BUTTON_FIRST
; i
<=BUTTON_LAST
; i
++)
936 if (vjs
.p1KeyBindings
[i
] & (JOY_BUTTON
| JOY_HAT
| JOY_AXIS
))
937 joypad0Buttons
[i
] = (Gamepad::GetState(gamepadIDSlot1
, vjs
.p1KeyBindings
[i
]) ? 0x01 : 0x00);
939 if (vjs
.p2KeyBindings
[i
] & (JOY_BUTTON
| JOY_HAT
| JOY_AXIS
))
940 joypad1Buttons
[i
] = (Gamepad::GetState(gamepadIDSlot2
, vjs
.p2KeyBindings
[i
]) ? 0x01 : 0x00);
945 void MainWin::Open(void)
950 void MainWin::Configure(void)
952 // Call the configuration dialog and update settings
953 ConfigDialog
dlg(this);
955 dlg
.generalTab
->useUnknownSoftware
->setChecked(allowUnknownSoftware
);
956 dlg
.controllerTab1
->profileNum
= lastEditedProfile
;
957 dlg
.controllerTab1
->SetupLastUsedProfile();
958 // maybe instead of this, we tell the controller tab to work on a copy that gets
959 // written if the user hits 'OK'.
960 SaveProfiles(); // Just in case user cancels
962 if (dlg
.exec() == false)
968 QString before
= vjs
.ROMPath
;
969 QString alpineBefore
= vjs
.alpineROMPath
;
970 QString absBefore
= vjs
.absROMPath
;
971 // bool audioBefore = vjs.audioEnabled;
972 bool audioBefore
= vjs
.DSPEnabled
;
973 dlg
.UpdateVJSettings();
974 QString after
= vjs
.ROMPath
;
975 QString alpineAfter
= vjs
.alpineROMPath
;
976 QString absAfter
= vjs
.absROMPath
;
977 // bool audioAfter = vjs.audioEnabled;
978 bool audioAfter
= vjs
.DSPEnabled
;
980 bool allowOld
= allowUnknownSoftware
;
982 allowUnknownSoftware
= dlg
.generalTab
->useUnknownSoftware
->isChecked();
983 lastEditedProfile
= dlg
.controllerTab1
->profileNum
;
984 AutoConnectProfiles();
986 // We rescan the "software" folder if the user either changed the path or
987 // checked/unchecked the "Allow unknown files" option in the config dialog.
988 if ((before
!= after
) || (allowOld
!= allowUnknownSoftware
))
989 filePickWin
->ScanSoftwareFolder(allowUnknownSoftware
);
991 // If the "Alpine" ROM is changed, then let's load it...
992 if (alpineBefore
!= alpineAfter
)
994 if (!JaguarLoadFile(vjs
.alpineROMPath
) && !AlpineLoadFile(vjs
.alpineROMPath
))
996 // Oh crap, we couldn't get the file! Alert the media!
998 msg
.setText(QString(tr("Could not load file \"%1\"!")).arg(vjs
.alpineROMPath
));
999 msg
.setIcon(QMessageBox::Warning
);
1004 // If the "ABS" ROM is changed, then let's load it...
1005 if (absBefore
!= absAfter
)
1007 if (!JaguarLoadFile(vjs
.absROMPath
))
1009 // Oh crap, we couldn't get the file! Alert the media!
1011 msg
.setText(QString(tr("Could not load file \"%1\"!")).arg(vjs
.absROMPath
));
1012 msg
.setIcon(QMessageBox::Warning
);
1017 // If the "Enable DSP" checkbox changed, then we have to re-init the DAC,
1018 // since it's running in the host audio IRQ...
1019 if (audioBefore
!= audioAfter
)
1025 // Just in case we crash before a clean exit...
1028 DebuggerRefreshWindows();
1033 // Here's the main emulator loop
1035 void MainWin::Timer(void)
1038 static uint32_t ntscTickCount
;
1039 if (vjs
.hardwareTypeNTSC
)
1043 timer
->start(16 + (ntscTickCount
== 0 ? 1 : 0));
1050 if (showUntunedTankCircuit
)
1052 // Some machines can't handle this, so we give them the option to disable it. :-)
1053 if (!plzDontKillMyComputer
)
1055 // if (!vjs.softTypeDebugger)
1057 // Random hash & trash
1058 // We try to simulate an untuned tank circuit here... :-)
1059 for (uint32_t x
= 0; x
< videoWidget
->rasterWidth
; x
++)
1061 for (uint32_t y
= 0; y
< videoWidget
->rasterHeight
; y
++)
1063 videoWidget
->buffer
[(y
* videoWidget
->textureWidth
) + x
] = (rand() & 0xFF) << 8 | (rand() & 0xFF) << 16 | (rand() & 0xFF) << 24;
1071 // Otherwise, run the Jaguar simulation
1074 if (!vjs
.softTypeDebugger
)
1075 videoWidget
->HandleMouseHiding();
1077 static uint32_t refresh
= 0;
1078 // Do autorefresh on debug windows
1079 // Have to be careful, too much causes the emulator to slow way down!
1080 if (vjs
.hardwareTypeAlpine
|| vjs
.softTypeDebugger
)
1082 if (refresh
== vjs
.refresh
)
1084 RefreshAlpineWindows();
1085 //memBrowseWin->RefreshContents();
1086 //cpuBrowseWin->RefreshContents();
1094 //if (!vjs.softTypeDebugger)
1095 videoWidget
->updateGL();
1098 // Approach: We use a ring buffer to store times (in ms) over a given
1099 // amount of frames, then sum them to figure out the FPS.
1100 uint32_t timestamp
= SDL_GetTicks();
1101 // This assumes the ring buffer size is a power of 2
1102 // ringBufferPointer = (ringBufferPointer + 1) & (RING_BUFFER_SIZE - 1);
1103 // Doing it this way is better. Ring buffer size can be arbitrary then.
1104 ringBufferPointer
= (ringBufferPointer
+ 1) % RING_BUFFER_SIZE
;
1105 ringBuffer
[ringBufferPointer
] = timestamp
- oldTimestamp
;
1106 uint32_t elapsedTime
= 0;
1108 for(uint32_t i
=0; i
<RING_BUFFER_SIZE
; i
++)
1109 elapsedTime
+= ringBuffer
[i
];
1111 // elapsedTime must be non-zero
1112 if (elapsedTime
== 0)
1115 // This is in frames per 10 seconds, so we can have 1 decimal
1116 uint32_t framesPerSecond
= (uint32_t)(((float)RING_BUFFER_SIZE
/ (float)elapsedTime
) * 10000.0);
1117 uint32_t fpsIntegerPart
= framesPerSecond
/ 10;
1118 uint32_t fpsDecimalPart
= framesPerSecond
% 10;
1119 // If this is updated too frequently to be useful, we can throttle it down
1120 // so that it only updates every 10th frame or so
1121 statusBar()->showMessage(QString("%1.%2 FPS").arg(fpsIntegerPart
).arg(fpsDecimalPart
));
1122 oldTimestamp
= timestamp
;
1124 if (M68KDebugHaltStatus())
1129 void MainWin::TogglePowerState(void)
1131 powerButtonOn
= !powerButtonOn
;
1134 // With the power off, we simulate white noise on the screen. :-)
1137 // Restore the mouse pointer, if hidden:
1138 if (!vjs
.softTypeDebugger
)
1139 videoWidget
->CheckAndRestoreMouseCursor();
1140 useCDAct
->setDisabled(false);
1141 palAct
->setDisabled(false);
1142 ntscAct
->setDisabled(false);
1143 pauseAct
->setChecked(false);
1144 pauseAct
->setDisabled(true);
1145 showUntunedTankCircuit
= true;
1146 DACPauseAudioThread();
1147 // This is just in case the ROM we were playing was in a narrow or wide
1148 // field mode, so the untuned tank sim doesn't look wrong. :-)
1151 if (plzDontKillMyComputer
)
1153 //if (!vjs.softTypeDebugger)
1155 // We have to do it line by line, because the texture pitch is not
1156 // the same as the picture buffer's pitch.
1157 for (uint32_t y
= 0; y
< videoWidget
->rasterHeight
; y
++)
1159 if (vjs
.hardwareTypeNTSC
)
1160 memcpy(videoWidget
->buffer
+ (y
* videoWidget
->textureWidth
), testPattern
+ (y
* VIRTUAL_SCREEN_WIDTH
), VIRTUAL_SCREEN_WIDTH
* sizeof(uint32_t));
1162 memcpy(videoWidget
->buffer
+ (y
* videoWidget
->textureWidth
), testPattern2
+ (y
* VIRTUAL_SCREEN_WIDTH
), VIRTUAL_SCREEN_WIDTH
* sizeof(uint32_t));
1169 useCDAct
->setDisabled(true);
1170 palAct
->setDisabled(true);
1171 ntscAct
->setDisabled(true);
1172 pauseAct
->setChecked(false);
1173 pauseAct
->setDisabled(false);
1174 showUntunedTankCircuit
= false;
1176 // Otherwise, we prepare for running regular software...
1179 // Should check for cartridgeLoaded here as well...!
1180 // We can clear it when toggling CDActive on, so that when we power cycle it
1181 // does the expected thing. Otherwise, if we use the file picker to insert a
1182 // cart, we expect to run the cart! Maybe have a RemoveCart function that only
1183 // works if the CD unit is active?
1184 setWindowTitle(QString("Virtual Jaguar " VJ_RELEASE_VERSION
" Rx - Now playing: Jaguar CD"));
1187 WriteLog("GUI: Resetting Jaguar...\n");
1189 DebuggerResetWindows();
1190 DACPauseAudioThread(false);
1195 void MainWin::ToggleRunState(void)
1197 startM68KTracing
= running
;
1202 frameAdvanceAct
->setDisabled(false);
1203 pauseAct
->setChecked(true);
1204 pauseAct
->setDisabled(false);
1205 if (vjs
.softTypeDebugger
)
1207 traceStepIntoAct
->setDisabled(false);
1208 traceStepOverAct
->setDisabled(false);
1209 restartAct
->setDisabled(false);
1210 m68kDasmWin
->Use68KPCAddress();
1211 GPUDasmWin
->UseGPUPCAddress();
1212 DSPDasmWin
->UseDSPPCAddress();
1215 //if (!vjs.softTypeDebugger)
1217 // Restore the mouse pointer, if hidden:
1218 videoWidget
->CheckAndRestoreMouseCursor();
1219 // frameAdvanceAct->setDisabled(false);
1221 for (uint32_t i
= 0; i
< (uint32_t)(videoWidget
->textureWidth
* 256); i
++)
1223 uint32_t pixel
= videoWidget
->buffer
[i
];
1224 uint8_t r
= (pixel
>> 24) & 0xFF, g
= (pixel
>> 16) & 0xFF, b
= (pixel
>> 8) & 0xFF;
1225 pixel
= ((r
+ g
+ b
) / 3) & 0x00FF;
1226 videoWidget
->buffer
[i
] = 0x000000FF | (pixel
<< 16) | (pixel
<< 8);
1229 videoWidget
->updateGL();
1231 cpuBrowseWin
->HoldBPM();
1232 cpuBrowseWin
->HandleBPMContinue();
1233 DebuggerRefreshWindows();
1238 frameAdvanceAct
->setDisabled(true);
1239 pauseAct
->setChecked(false);
1240 pauseAct
->setDisabled(false);
1241 if (vjs
.softTypeDebugger
)
1243 traceStepIntoAct
->setDisabled(true);
1244 traceStepOverAct
->setDisabled(true);
1245 restartAct
->setDisabled(true);
1248 cpuBrowseWin
->UnholdBPM();
1251 // Pause/unpause any running/non-running threads...
1252 DACPauseAudioThread(!running
);
1256 void MainWin::SetZoom100(void)
1263 void MainWin::SetZoom200(void)
1270 void MainWin::SetZoom300(void)
1277 void MainWin::SetNTSC(void)
1279 powerAct
->setIcon(powerRed
);
1280 timer
->setInterval(16);
1281 vjs
.hardwareTypeNTSC
= true;
1287 void MainWin::SetPAL(void)
1289 powerAct
->setIcon(powerGreen
);
1290 timer
->setInterval(20);
1291 vjs
.hardwareTypeNTSC
= false;
1297 void MainWin::ToggleBlur(void)
1299 vjs
.glFilter
= !vjs
.glFilter
;
1304 void MainWin::ShowAboutWin(void)
1310 void MainWin::ShowHelpWin(void)
1316 void MainWin::InsertCart(void)
1318 // Check to see if we did autorun, 'cause we didn't load anything in that
1320 if (!scannedSoftwareFolder
)
1322 filePickWin
->ScanSoftwareFolder(allowUnknownSoftware
);
1323 scannedSoftwareFolder
= true;
1326 // If the emulator is running, we pause it here and unpause it later
1327 // if we dismiss the file selector without choosing anything
1328 if (running
&& powerButtonOn
)
1331 pauseForFileSelector
= true;
1334 filePickWin
->show();
1338 void MainWin::Unpause(void)
1340 // Here we unpause the emulator if it was paused when we went into the file selector
1341 if (pauseForFileSelector
)
1343 pauseForFileSelector
= false;
1345 // Some nutter might have unpaused while in the file selector, so check for that
1352 // Jaguar initialisation and load software file
1353 void MainWin::LoadSoftware(QString file
)
1355 running
= false; // Prevent bad things(TM) from happening...
1356 pauseForFileSelector
= false; // Reset the file selector pause flag
1358 #ifndef NEWMODELSBIOSHANDLER
1359 uint8_t * biosPointer
= jaguarBootROM
;
1361 if (vjs
.hardwareTypeAlpine
|| vjs
.softTypeDebugger
)
1363 biosPointer
= jaguarDevBootROM2
;
1366 memcpy(jagMemSpace
+ 0xE00000, biosPointer
, 0x20000);
1368 SelectBIOS(vjs
.biosType
);
1371 powerAct
->setDisabled(false);
1372 powerAct
->setChecked(true);
1373 powerButtonOn
= false;
1376 // We have to load our software *after* the Jaguar RESET
1377 cartridgeLoaded
= JaguarLoadFile(file
.toUtf8().data());
1378 SET32(jaguarMainRAM
, 0, vjs
.DRAM_size
); // Set top of stack...
1380 // This is icky because we've already done it
1381 // it gets worse :-P
1382 if (!vjs
.useJaguarBIOS
)
1384 SET32(jaguarMainRAM
, 4, jaguarRunAddress
);
1389 // set the M68K in halt mode in case of a debug mode is used, so control is at user side
1390 if (vjs
.softTypeDebugger
)
1392 m68k_set_reg(M68K_REG_A6
, 0);
1393 m68kDasmWin
->SetAddress(jaguarRunAddress
);
1394 //pauseAct->setDisabled(false);
1395 //pauseAct->setChecked(true);
1401 // Prevent the Alpine mode to crash in case of software without a start address
1402 if (vjs
.hardwareTypeAlpine
&& !jaguarRunAddress
)
1408 if ((!vjs
.hardwareTypeAlpine
|| !vjs
.softTypeDebugger
) && !loadAndGo
&& jaguarRunAddress
)
1410 QString newTitle
= QString("Virtual Jaguar " VJ_RELEASE_VERSION
" Rx - Now playing: %1").arg(filePickWin
->GetSelectedPrettyName());
1411 setWindowTitle(newTitle
);
1416 void MainWin::ToggleCDUsage(void)
1418 CDActive
= !CDActive
;
1420 // Set up the Jaguar CD for execution, otherwise, clear memory
1422 memcpy(jagMemSpace
+ 0x800000, jaguarCDBootROM
, 0x40000);
1424 memset(jagMemSpace
+ 0x800000, 0xFF, 0x40000);
1429 void MainWin::NewBreakpointFunction(void)
1432 brkWin
->RefreshContents();
1437 void MainWin::DebuggerTraceStepInto(void)
1440 videoWidget
->updateGL();
1441 DebuggerRefreshWindows();
1443 #pragma message("Warning: !!! Need to verify the Step Into function !!!")
1445 #warning "!!! Need to verify the Step Into function !!!"
1451 void MainWin::DebuggerRestart(void)
1456 m68k_set_reg(M68K_REG_PC
, jaguarRunAddress
);
1457 m68k_set_reg(M68K_REG_SP
, vjs
.DRAM_size
);
1459 m68k_set_reg(M68K_REG_A6
, 0);
1461 DebuggerResetWindows();
1462 DebuggerRefreshWindows();
1464 #pragma message("Warning: !!! Need to verify the Restart function !!!")
1466 #warning "!!! Need to verify the Restart function !!!"
1472 void MainWin::DebuggerTraceStepOver(void)
1475 videoWidget
->updateGL();
1476 DebuggerRefreshWindows();
1478 #pragma message("Warning: !!! Need to verify the Step Over function !!!")
1480 #warning "!!! Need to verify the Step Over function !!!"
1485 // Advance / Execute for one frame
1486 void MainWin::FrameAdvance(void)
1488 //printf("Frame Advance...\n");
1490 // Execute 1 frame, then exit (only useful in Pause mode)
1492 //if (!vjs.softTypeDebugger)
1493 videoWidget
->updateGL();
1495 // Need to execute 1 frames' worth of DSP thread as well :-/
1497 //m68kDasmWin->Use68KPCAddress();
1500 #pragma message("Warning: !!! Need to execute the DSP thread for 1 frame too !!!")
1502 #warning "!!! Need to execute the DSP thread for 1 frame too !!!"
1507 void MainWin::SetFullScreen(bool state
/*= true*/)
1509 if (!vjs
.softTypeDebugger
)
1513 mainWinPosition
= pos();
1515 statusBar()->hide();
1521 // This is needed because the fullscreen may happen on a different
1522 // screen than screen 0:
1523 int screenNum
= QApplication::desktop()->screenNumber(videoWidget
);
1524 QRect r
= QApplication::desktop()->screenGeometry(screenNum
);
1525 double targetWidth
= (double)VIRTUAL_SCREEN_WIDTH
,
1526 targetHeight
= (double)(vjs
.hardwareTypeNTSC
? VIRTUAL_SCREEN_HEIGHT_NTSC
: VIRTUAL_SCREEN_HEIGHT_PAL
);
1527 double aspectRatio
= targetWidth
/ targetHeight
;
1528 // NOTE: Really should check here to see which dimension constrains the
1529 // other. Right now, we assume that height is the constraint.
1530 int newWidth
= (int)(aspectRatio
* (double)r
.height());
1531 videoWidget
->offset
= (r
.width() - newWidth
) / 2;
1532 videoWidget
->fullscreen
= true;
1533 videoWidget
->outputWidth
= newWidth
;
1534 videoWidget
->setFixedSize(r
.width(), r
.height());
1539 // Seems Qt is fussy about this: showNormal() has to go first, or it
1540 // will keep the window stuck in a psuedo-fullscreen mode with no way
1541 // to get out of it (except closing the app).
1544 // Reset the video widget to windowed mode
1545 videoWidget
->offset
= 0;
1546 videoWidget
->fullscreen
= false;
1548 statusBar()->show();
1555 move(mainWinPosition
);
1561 void MainWin::ToggleFullScreen(void)
1563 fullScreen
= !fullScreen
;
1564 SetFullScreen(fullScreen
);
1569 void MainWin::ShowExceptionVectorTableBrowserWin(void)
1571 exceptionvectortableBrowseWin
->show();
1572 exceptionvectortableBrowseWin
->RefreshContents();
1577 void MainWin::ShowLocalBrowserWin(void)
1579 LocalBrowseWin
->show();
1580 LocalBrowseWin
->RefreshContents();
1585 void MainWin::ShowCallStackBrowserWin(void)
1587 CallStackBrowseWin
->show();
1588 CallStackBrowseWin
->RefreshContents();
1592 void MainWin::ShowAllWatchBrowserWin(void)
1594 allWatchBrowseWin
->show();
1595 allWatchBrowseWin
->RefreshContents();
1599 void MainWin::ShowHeapAllocatorBrowserWin(void)
1601 heapallocatorBrowseWin
->show();
1602 heapallocatorBrowseWin
->RefreshContents();
1606 void MainWin::ShowMemoryBrowserWin(void)
1608 memBrowseWin
->show();
1609 memBrowseWin
->RefreshContents();
1613 void MainWin::ShowMemory1BrowserWin(int NumWin
)
1615 // for (int i = 0; i < vjs.nbrmemory1browserwindow; i++)
1617 mem1BrowseWin
[NumWin
]->show();
1618 mem1BrowseWin
[NumWin
]->RefreshContents(NumWin
);
1623 void MainWin::ShowEmuStatusWin(void)
1625 emuStatusWin
->show();
1626 emuStatusWin
->RefreshContents();
1630 void MainWin::ShowStackBrowserWin(void)
1632 stackBrowseWin
->show();
1633 stackBrowseWin
->RefreshContents();
1637 void MainWin::ShowCPUBrowserWin(void)
1639 cpuBrowseWin
->show();
1640 cpuBrowseWin
->RefreshContents();
1644 void MainWin::ShowOPBrowserWin(void)
1646 opBrowseWin
->show();
1647 opBrowseWin
->RefreshContents();
1651 void MainWin::ShowM68KDasmBrowserWin(void)
1653 m68kDasmBrowseWin
->show();
1654 m68kDasmBrowseWin
->RefreshContents();
1658 void MainWin::ShowRISCDasmBrowserWin(void)
1660 riscDasmBrowseWin
->show();
1661 riscDasmBrowseWin
->RefreshContents();
1665 void MainWin::ShowDasmWin(void)
1668 // DasmWin->RefreshContents();
1672 void MainWin::ShowVideoOutputWin(void)
1674 //VideoOutputWindowCentrale = mainWindowCentrale->addSubWindow(videoWidget);
1675 //VideoOutputWindowCentrale->setWindowTitle(QString(tr("Video output")));
1676 //VideoOutputWindowCentrale->show();
1677 //memBrowseWin->show();
1678 //VideoOutputWin->show();
1679 //VideoOutputWin->RefreshContents(videoWidget);
1683 void MainWin::ResizeMainWindow(void)
1685 if (!vjs
.softTypeDebugger
)
1687 videoWidget
->setFixedSize(zoomLevel
* VIRTUAL_SCREEN_WIDTH
,
1688 zoomLevel
* (vjs
.hardwareTypeNTSC
? VIRTUAL_SCREEN_HEIGHT_NTSC
: VIRTUAL_SCREEN_HEIGHT_PAL
));
1690 // Show the test pattern if user requested plzDontKillMyComputer mode
1691 if (!powerButtonOn
&& plzDontKillMyComputer
)
1693 for (uint32_t y
= 0; y
< videoWidget
->rasterHeight
; y
++)
1695 if (vjs
.hardwareTypeNTSC
)
1696 memcpy(videoWidget
->buffer
+ (y
* videoWidget
->textureWidth
), testPattern
+ (y
* VIRTUAL_SCREEN_WIDTH
), VIRTUAL_SCREEN_WIDTH
* sizeof(uint32_t));
1698 memcpy(videoWidget
->buffer
+ (y
* videoWidget
->textureWidth
), testPattern2
+ (y
* VIRTUAL_SCREEN_WIDTH
), VIRTUAL_SCREEN_WIDTH
* sizeof(uint32_t));
1708 void MainWin::ReadSettings(void)
1712 QSettings
settings("Underground Software", "Virtual Jaguar");
1714 //zoomLevel = settings.value("zoom", 2).toInt();
1715 allowUnknownSoftware
= settings
.value("showUnknownSoftware", false).toBool();
1716 lastEditedProfile
= settings
.value("lastEditedProfile", 0).toInt();
1718 vjs
.useJoystick
= settings
.value("useJoystick", false).toBool();
1719 vjs
.joyport
= settings
.value("joyport", 0).toInt();
1720 vjs
.hardwareTypeNTSC
= settings
.value("hardwareTypeNTSC", true).toBool();
1721 vjs
.frameSkip
= settings
.value("frameSkip", 0).toInt();
1722 vjs
.useJaguarBIOS
= settings
.value("useJaguarBIOS", false).toBool();
1723 vjs
.useRetailBIOS
= settings
.value("useRetailBIOS", false).toBool();
1724 vjs
.useDevBIOS
= settings
.value("useDevBIOS", false).toBool();
1725 vjs
.GPUEnabled
= settings
.value("GPUEnabled", true).toBool();
1726 vjs
.DSPEnabled
= settings
.value("DSPEnabled", true).toBool();
1727 vjs
.audioEnabled
= settings
.value("audioEnabled", true).toBool();
1728 vjs
.usePipelinedDSP
= settings
.value("usePipelinedDSP", false).toBool();
1729 vjs
.fullscreen
= settings
.value("fullscreen", false).toBool();
1730 vjs
.useOpenGL
= settings
.value("useOpenGL", true).toBool();
1731 vjs
.glFilter
= settings
.value("glFilterType", 1).toInt();
1732 vjs
.renderType
= settings
.value("renderType", 0).toInt();
1733 vjs
.biosType
= settings
.value("biosType", BT_M_SERIES
).toInt();
1734 vjs
.jaguarModel
= settings
.value("jaguarModel", JAG_M_SERIES
).toInt();
1735 vjs
.useFastBlitter
= settings
.value("useFastBlitter", false).toBool();
1736 strcpy(vjs
.EEPROMPath
, settings
.value("EEPROMs", QStandardPaths::writableLocation(QStandardPaths::DataLocation
).append("/eeproms/")).toString().toUtf8().data());
1737 strcpy(vjs
.ROMPath
, settings
.value("ROMs", QStandardPaths::writableLocation(QStandardPaths::DataLocation
).append("/software/")).toString().toUtf8().data());
1739 // Read settings from the Debugger mode
1740 settings
.beginGroup("debugger");
1741 strcpy(vjs
.debuggerROMPath
, settings
.value("DefaultROM", "").toString().toUtf8().data());
1742 vjs
.nbrdisasmlines
= settings
.value("NbrDisasmLines", 32).toUInt();
1743 vjs
.disasmopcodes
= settings
.value("DisasmOpcodes", true).toBool();
1744 vjs
.displayHWlabels
= settings
.value("DisplayHWLabels", true).toBool();
1745 vjs
.displayFullSourceFilename
= settings
.value("displayFullSourceFilename", true).toBool();
1746 vjs
.nbrmemory1browserwindow
= settings
.value("NbrMemory1BrowserWindow", MaxMemory1BrowserWindow
).toUInt();
1747 settings
.endGroup();
1749 // Read settings from the Alpine mode
1750 settings
.beginGroup("alpine");
1751 strcpy(vjs
.alpineROMPath
, settings
.value("DefaultROM", "").toString().toUtf8().data());
1752 strcpy(vjs
.absROMPath
, settings
.value("DefaultABS", "").toString().toUtf8().data());
1753 vjs
.refresh
= settings
.value("refresh", 60).toUInt();
1754 vjs
.allowWritesToROM
= settings
.value("writeROM", false).toBool();
1755 settings
.endGroup();
1757 // Read settings from the Keybindings
1758 settings
.beginGroup("keybindings");
1759 for (i
= 0; i
< KB_END
; i
++)
1761 strcpy(vjs
.KBContent
[i
].KBSettingValue
, settings
.value(KeyBindingsTable
[i
].KBNameSetting
, KeyBindingsTable
[i
].KBDefaultValue
).toString().toUtf8().data());
1763 settings
.endGroup();
1765 // Write important settings to the log file
1766 WriteLog("MainWin: Paths\n");
1767 WriteLog(" EEPROMPath = \"%s\"\n", vjs
.EEPROMPath
);
1768 WriteLog(" ROMPath = \"%s\"\n", vjs
.ROMPath
);
1769 WriteLog(" AlpineROMPath = \"%s\"\n", vjs
.alpineROMPath
);
1770 WriteLog("DebuggerROMPath = \"%s\"\n", vjs
.debuggerROMPath
);
1771 WriteLog(" absROMPath = \"%s\"\n", vjs
.absROMPath
);
1772 WriteLog(" Pipelined DSP = %s\n", (vjs
.usePipelinedDSP
? "ON" : "off"));
1775 // Keybindings in order of U, D, L, R, C, B, A, Op, Pa, 0-9, #, *
1776 vjs
.p1KeyBindings
[BUTTON_U
] = settings
.value("p1k_up", Qt::Key_S
).toInt();
1777 vjs
.p1KeyBindings
[BUTTON_D
] = settings
.value("p1k_down", Qt::Key_X
).toInt();
1778 vjs
.p1KeyBindings
[BUTTON_L
] = settings
.value("p1k_left", Qt::Key_A
).toInt();
1779 vjs
.p1KeyBindings
[BUTTON_R
] = settings
.value("p1k_right", Qt::Key_D
).toInt();
1780 vjs
.p1KeyBindings
[BUTTON_C
] = settings
.value("p1k_c", Qt::Key_J
).toInt();
1781 vjs
.p1KeyBindings
[BUTTON_B
] = settings
.value("p1k_b", Qt::Key_K
).toInt();
1782 vjs
.p1KeyBindings
[BUTTON_A
] = settings
.value("p1k_a", Qt::Key_L
).toInt();
1783 vjs
.p1KeyBindings
[BUTTON_OPTION
] = settings
.value("p1k_option", Qt::Key_O
).toInt();
1784 vjs
.p1KeyBindings
[BUTTON_PAUSE
] = settings
.value("p1k_pause", Qt::Key_P
).toInt();
1785 vjs
.p1KeyBindings
[BUTTON_0
] = settings
.value("p1k_0", Qt::Key_0
).toInt();
1786 vjs
.p1KeyBindings
[BUTTON_1
] = settings
.value("p1k_1", Qt::Key_1
).toInt();
1787 vjs
.p1KeyBindings
[BUTTON_2
] = settings
.value("p1k_2", Qt::Key_2
).toInt();
1788 vjs
.p1KeyBindings
[BUTTON_3
] = settings
.value("p1k_3", Qt::Key_3
).toInt();
1789 vjs
.p1KeyBindings
[BUTTON_4
] = settings
.value("p1k_4", Qt::Key_4
).toInt();
1790 vjs
.p1KeyBindings
[BUTTON_5
] = settings
.value("p1k_5", Qt::Key_5
).toInt();
1791 vjs
.p1KeyBindings
[BUTTON_6
] = settings
.value("p1k_6", Qt::Key_6
).toInt();
1792 vjs
.p1KeyBindings
[BUTTON_7
] = settings
.value("p1k_7", Qt::Key_7
).toInt();
1793 vjs
.p1KeyBindings
[BUTTON_8
] = settings
.value("p1k_8", Qt::Key_8
).toInt();
1794 vjs
.p1KeyBindings
[BUTTON_9
] = settings
.value("p1k_9", Qt::Key_9
).toInt();
1795 vjs
.p1KeyBindings
[BUTTON_d
] = settings
.value("p1k_pound", Qt::Key_Minus
).toInt();
1796 vjs
.p1KeyBindings
[BUTTON_s
] = settings
.value("p1k_star", Qt::Key_Equal
).toInt();
1798 vjs
.p2KeyBindings
[BUTTON_U
] = settings
.value("p2k_up", Qt::Key_Up
).toInt();
1799 vjs
.p2KeyBindings
[BUTTON_D
] = settings
.value("p2k_down", Qt::Key_Down
).toInt();
1800 vjs
.p2KeyBindings
[BUTTON_L
] = settings
.value("p2k_left", Qt::Key_Left
).toInt();
1801 vjs
.p2KeyBindings
[BUTTON_R
] = settings
.value("p2k_right", Qt::Key_Right
).toInt();
1802 vjs
.p2KeyBindings
[BUTTON_C
] = settings
.value("p2k_c", Qt::Key_Z
).toInt();
1803 vjs
.p2KeyBindings
[BUTTON_B
] = settings
.value("p2k_b", Qt::Key_X
).toInt();
1804 vjs
.p2KeyBindings
[BUTTON_A
] = settings
.value("p2k_a", Qt::Key_C
).toInt();
1805 vjs
.p2KeyBindings
[BUTTON_OPTION
] = settings
.value("p2k_option", Qt::Key_Apostrophe
).toInt();
1806 vjs
.p2KeyBindings
[BUTTON_PAUSE
] = settings
.value("p2k_pause", Qt::Key_Return
).toInt();
1807 vjs
.p2KeyBindings
[BUTTON_0
] = settings
.value("p2k_0", Qt::Key_0
).toInt();
1808 vjs
.p2KeyBindings
[BUTTON_1
] = settings
.value("p2k_1", Qt::Key_1
).toInt();
1809 vjs
.p2KeyBindings
[BUTTON_2
] = settings
.value("p2k_2", Qt::Key_2
).toInt();
1810 vjs
.p2KeyBindings
[BUTTON_3
] = settings
.value("p2k_3", Qt::Key_3
).toInt();
1811 vjs
.p2KeyBindings
[BUTTON_4
] = settings
.value("p2k_4", Qt::Key_4
).toInt();
1812 vjs
.p2KeyBindings
[BUTTON_5
] = settings
.value("p2k_5", Qt::Key_5
).toInt();
1813 vjs
.p2KeyBindings
[BUTTON_6
] = settings
.value("p2k_6", Qt::Key_6
).toInt();
1814 vjs
.p2KeyBindings
[BUTTON_7
] = settings
.value("p2k_7", Qt::Key_7
).toInt();
1815 vjs
.p2KeyBindings
[BUTTON_8
] = settings
.value("p2k_8", Qt::Key_8
).toInt();
1816 vjs
.p2KeyBindings
[BUTTON_9
] = settings
.value("p2k_9", Qt::Key_9
).toInt();
1817 vjs
.p2KeyBindings
[BUTTON_d
] = settings
.value("p2k_pound", Qt::Key_Slash
).toInt();
1818 vjs
.p2KeyBindings
[BUTTON_s
] = settings
.value("p2k_star", Qt::Key_Asterisk
).toInt();
1821 WriteLog("Read setting = Done\n");
1823 ReadProfiles(&settings
);
1828 // Default values will be used in case of no settings can be found
1830 #pragma message("Warning: !!! Need to check the window geometry to see if the positions are legal !!!")
1832 #warning "!!! Need to check the window geometry to see if the positions are legal !!!"
1834 // i.e., someone could drag it to another screen, close it, then disconnect that screen
1835 void MainWin::ReadUISettings(void)
1842 // Point on the emulator settings
1843 QSettings
settings("Underground Software", "Virtual Jaguar");
1844 settings
.beginGroup("ui");
1846 // Emulator main window UI information
1847 mainWinPosition
= settings
.value("pos", QPoint(200, 200)).toPoint();
1848 size
= settings
.value("size", QSize(400, 400)).toSize();
1850 move(mainWinPosition
);
1851 pos
= settings
.value("cartLoadPos", QPoint(200, 200)).toPoint();
1852 filePickWin
->move(pos
);
1854 // Video output information
1855 zoomLevel
= settings
.value("zoom", 2).toInt();
1857 // Alpine debug UI information (also needed by the Debugger)
1858 if (vjs
.hardwareTypeAlpine
|| vjs
.softTypeDebugger
)
1860 // CPU registers UI information
1861 pos
= settings
.value("cpuBrowseWinPos", QPoint(200, 200)).toPoint();
1862 cpuBrowseWin
->move(pos
);
1863 settings
.value("cpuBrowseWinIsVisible", false).toBool() ? ShowCPUBrowserWin() : void();
1865 // Memory browser UI information
1866 pos
= settings
.value("memBrowseWinPos", QPoint(200, 200)).toPoint();
1867 memBrowseWin
->move(pos
);
1868 settings
.value("memBrowseWinIsVisible", false).toBool() ? ShowMemoryBrowserWin() : void();
1870 // Stack browser UI information
1871 pos
= settings
.value("stackBrowseWinPos", QPoint(200, 200)).toPoint();
1872 stackBrowseWin
->move(pos
);
1873 settings
.value("stackBrowseWinIsVisible", false).toBool() ? ShowStackBrowserWin() : void();
1874 size
= settings
.value("stackBrowseWinSize", QSize(400, 400)).toSize();
1875 stackBrowseWin
->resize(size
);
1877 // Emulator status UI information
1878 pos
= settings
.value("emuStatusWinPos", QPoint(200, 200)).toPoint();
1879 emuStatusWin
->move(pos
);
1880 settings
.value("emuStatusWinIsVisible", false).toBool() ? ShowEmuStatusWin() : void();
1882 // OP (Object Processor) UI information
1883 pos
= settings
.value("opBrowseWinPos", QPoint(200, 200)).toPoint();
1884 opBrowseWin
->move(pos
);
1885 settings
.value("opBrowseWinIsVisible", false).toBool() ? ShowOPBrowserWin() : void();
1886 size
= settings
.value("opBrowseWinSize", QSize(400, 400)).toSize();
1887 opBrowseWin
->resize(size
);
1889 // RISC disassembly UI information
1890 pos
= settings
.value("riscDasmBrowseWinPos", QPoint(200, 200)).toPoint();
1891 riscDasmBrowseWin
->move(pos
);
1892 settings
.value("riscDasmBrowseWinIsVisible", false).toBool() ? ShowRISCDasmBrowserWin() : void();
1894 // M68k disassembly UI information
1895 pos
= settings
.value("m68kDasmBrowseWinPos", QPoint(200, 200)).toPoint();
1896 m68kDasmBrowseWin
->move(pos
);
1897 //settings.value("m68kDasmBrowseWinIsVisible", false).toBool() ? ShowM68KDasmBrowserWin() : void();
1899 #pragma message("Warning: !!! Need to check the M68k disassembly window position crashing !!!")
1901 #warning "!!! Need to check the M68k disassembly window position crashing !!!"
1905 // Debugger UI information
1906 if (vjs
.softTypeDebugger
)
1909 pos
= settings
.value("m68kDasmWinPos", QPoint(200, 200)).toPoint();
1910 m68kDasmWin
->move(pos
);
1911 //settings.value("m68kDasmWinIsVisible", false).toBool() ? m68kDasmWin->show() : m68kDasmWin->hide();
1912 pos
= settings
.value("GPUDasmWinPos", QPoint(200, 200)).toPoint();
1913 GPUDasmWin
->move(pos
);
1914 pos
= settings
.value("DSPDasmWinPos", QPoint(200, 200)).toPoint();
1915 DSPDasmWin
->move(pos
);
1917 // All watch browser UI information
1918 pos
= settings
.value("allWatchBrowseWinPos", QPoint(200, 200)).toPoint();
1919 allWatchBrowseWin
->move(pos
);
1920 settings
.value("allWatchBrowseWinIsVisible", false).toBool() ? ShowAllWatchBrowserWin() : void();
1921 size
= settings
.value("allWatchBrowseWinSize", QSize(400, 400)).toSize();
1922 allWatchBrowseWin
->resize(size
);
1924 // Local browser UI information
1925 pos
= settings
.value("LocalBrowseWinPos", QPoint(200, 200)).toPoint();
1926 LocalBrowseWin
->move(pos
);
1927 settings
.value("LocalBrowseWinIsVisible", false).toBool() ? ShowLocalBrowserWin() : void();
1928 size
= settings
.value("LocalBrowseWinSize", QSize(400, 400)).toSize();
1929 LocalBrowseWin
->resize(size
);
1931 // Heap memory allocation browser UI information
1932 pos
= settings
.value("heapallocatorBrowseWinPos", QPoint(200, 200)).toPoint();
1933 heapallocatorBrowseWin
->move(pos
);
1934 settings
.value("heapallocatorBrowseWinIsVisible", false).toBool() ? ShowHeapAllocatorBrowserWin() : void();
1935 size
= settings
.value("heapallocatorBrowseWinSize", QSize(400, 400)).toSize();
1936 heapallocatorBrowseWin
->resize(size
);
1938 // Exception Vector Table UI Information
1939 pos
= settings
.value("exceptionVectorTableBrowseWinPos", QPoint(200, 200)).toPoint();
1940 exceptionvectortableBrowseWin
->move(pos
);
1941 settings
.value("exceptionVectorTableBrowseWinIsVisible", false).toBool() ? ShowExceptionVectorTableBrowserWin() : void();
1942 size
= settings
.value("exceptionVectorTableBrowseWinSize", QSize(400, 400)).toSize();
1943 exceptionvectortableBrowseWin
->resize(size
);
1945 // Call Stack browser UI information
1946 pos
= settings
.value("CallStackBrowseWinPos", QPoint(200, 200)).toPoint();
1947 CallStackBrowseWin
->move(pos
);
1948 settings
.value("CallStackBrowseWinIsVisible", false).toBool() ? ShowCallStackBrowserWin() : void();
1949 size
= settings
.value("CallStackBrowseWinSize", QSize(400, 400)).toSize();
1950 CallStackBrowseWin
->resize(size
);
1952 // Memories browser UI information
1953 for (i
= 0; i
< vjs
.nbrmemory1browserwindow
; i
++)
1955 sprintf(mem1Name
, "mem1BrowseWinPos[%i]", (unsigned int)i
);
1956 pos
= settings
.value(mem1Name
, QPoint(200, 200)).toPoint();
1957 mem1BrowseWin
[i
]->move(pos
);
1958 sprintf(mem1Name
, "mem1BrowseWinIsVisible[%i]", (unsigned int)i
);
1959 settings
.value(mem1Name
, false).toBool() ? ShowMemory1BrowserWin((int)i
) : void();
1960 sprintf(mem1Name
, "mem1BrowseWinSize[%i]", (unsigned int)i
);
1961 size
= settings
.value(mem1Name
, QSize(400, 400)).toSize();
1962 mem1BrowseWin
[i
]->resize(size
);
1966 settings
.endGroup();
1968 WriteLog("Read UI setting = Done\n");
1972 // Save the settings
1973 void MainWin::WriteSettings(void)
1977 // Point on the emulator settings
1978 QSettings
settings("Underground Software", "Virtual Jaguar");
1979 //settings.setValue("pos", pos());
1980 //settings.setValue("size", size());
1981 //settings.setValue("cartLoadPos", filePickWin->pos());
1983 //settings.setValue("zoom", zoomLevel);
1984 settings
.setValue("showUnknownSoftware", allowUnknownSoftware
);
1985 settings
.setValue("lastEditedProfile", lastEditedProfile
);
1987 settings
.setValue("useJoystick", vjs
.useJoystick
);
1988 settings
.setValue("joyport", vjs
.joyport
);
1989 settings
.setValue("hardwareTypeNTSC", vjs
.hardwareTypeNTSC
);
1990 settings
.setValue("frameSkip", vjs
.frameSkip
);
1991 settings
.setValue("useJaguarBIOS", vjs
.useJaguarBIOS
);
1992 settings
.setValue("useRetailBIOS", vjs
.useRetailBIOS
);
1993 settings
.setValue("useDevBIOS", vjs
.useDevBIOS
);
1994 settings
.setValue("GPUEnabled", vjs
.GPUEnabled
);
1995 settings
.setValue("DSPEnabled", vjs
.DSPEnabled
);
1996 settings
.setValue("audioEnabled", vjs
.audioEnabled
);
1997 settings
.setValue("usePipelinedDSP", vjs
.usePipelinedDSP
);
1998 settings
.setValue("fullscreen", vjs
.fullscreen
);
1999 settings
.setValue("useOpenGL", vjs
.useOpenGL
);
2000 settings
.setValue("glFilterType", vjs
.glFilter
);
2001 settings
.setValue("renderType", vjs
.renderType
);
2002 settings
.setValue("jaguarModel", vjs
.jaguarModel
);
2003 settings
.setValue("biosType", vjs
.biosType
);
2004 settings
.setValue("useFastBlitter", vjs
.useFastBlitter
);
2005 settings
.setValue("JagBootROM", vjs
.jagBootPath
);
2006 settings
.setValue("CDBootROM", vjs
.CDBootPath
);
2007 settings
.setValue("EEPROMs", vjs
.EEPROMPath
);
2008 settings
.setValue("ROMs", vjs
.ROMPath
);
2010 // Write settings from the Alpine mode
2011 settings
.beginGroup("alpine");
2012 settings
.setValue("refresh", vjs
.refresh
);
2013 settings
.setValue("DefaultROM", vjs
.alpineROMPath
);
2014 settings
.setValue("DefaultABS", vjs
.absROMPath
);
2015 settings
.setValue("writeROM", vjs
.allowWritesToROM
);
2016 settings
.endGroup();
2018 // Write settings from the Debugger mode
2019 settings
.beginGroup("debugger");
2020 settings
.setValue("DisplayHWLabels", vjs
.displayHWlabels
);
2021 settings
.setValue("NbrDisasmLines", vjs
.nbrdisasmlines
);
2022 settings
.setValue("DisasmOpcodes", vjs
.disasmopcodes
);
2023 settings
.setValue("displayFullSourceFilename", vjs
.displayFullSourceFilename
);
2024 settings
.setValue("NbrMemory1BrowserWindow", (unsigned int)vjs
.nbrmemory1browserwindow
);
2025 settings
.setValue("DefaultROM", vjs
.debuggerROMPath
);
2026 settings
.endGroup();
2028 // Write settings from the Keybindings
2029 settings
.beginGroup("keybindings");
2030 for (i
= 0; i
< KB_END
; i
++)
2032 settings
.setValue(KeyBindingsTable
[i
].KBNameSetting
, vjs
.KBContent
[i
].KBSettingValue
);
2034 settings
.endGroup();
2037 settings
.setValue("p1k_up", vjs
.p1KeyBindings
[BUTTON_U
]);
2038 settings
.setValue("p1k_down", vjs
.p1KeyBindings
[BUTTON_D
]);
2039 settings
.setValue("p1k_left", vjs
.p1KeyBindings
[BUTTON_L
]);
2040 settings
.setValue("p1k_right", vjs
.p1KeyBindings
[BUTTON_R
]);
2041 settings
.setValue("p1k_c", vjs
.p1KeyBindings
[BUTTON_C
]);
2042 settings
.setValue("p1k_b", vjs
.p1KeyBindings
[BUTTON_B
]);
2043 settings
.setValue("p1k_a", vjs
.p1KeyBindings
[BUTTON_A
]);
2044 settings
.setValue("p1k_option", vjs
.p1KeyBindings
[BUTTON_OPTION
]);
2045 settings
.setValue("p1k_pause", vjs
.p1KeyBindings
[BUTTON_PAUSE
]);
2046 settings
.setValue("p1k_0", vjs
.p1KeyBindings
[BUTTON_0
]);
2047 settings
.setValue("p1k_1", vjs
.p1KeyBindings
[BUTTON_1
]);
2048 settings
.setValue("p1k_2", vjs
.p1KeyBindings
[BUTTON_2
]);
2049 settings
.setValue("p1k_3", vjs
.p1KeyBindings
[BUTTON_3
]);
2050 settings
.setValue("p1k_4", vjs
.p1KeyBindings
[BUTTON_4
]);
2051 settings
.setValue("p1k_5", vjs
.p1KeyBindings
[BUTTON_5
]);
2052 settings
.setValue("p1k_6", vjs
.p1KeyBindings
[BUTTON_6
]);
2053 settings
.setValue("p1k_7", vjs
.p1KeyBindings
[BUTTON_7
]);
2054 settings
.setValue("p1k_8", vjs
.p1KeyBindings
[BUTTON_8
]);
2055 settings
.setValue("p1k_9", vjs
.p1KeyBindings
[BUTTON_9
]);
2056 settings
.setValue("p1k_pound", vjs
.p1KeyBindings
[BUTTON_d
]);
2057 settings
.setValue("p1k_star", vjs
.p1KeyBindings
[BUTTON_s
]);
2059 settings
.setValue("p2k_up", vjs
.p2KeyBindings
[BUTTON_U
]);
2060 settings
.setValue("p2k_down", vjs
.p2KeyBindings
[BUTTON_D
]);
2061 settings
.setValue("p2k_left", vjs
.p2KeyBindings
[BUTTON_L
]);
2062 settings
.setValue("p2k_right", vjs
.p2KeyBindings
[BUTTON_R
]);
2063 settings
.setValue("p2k_c", vjs
.p2KeyBindings
[BUTTON_C
]);
2064 settings
.setValue("p2k_b", vjs
.p2KeyBindings
[BUTTON_B
]);
2065 settings
.setValue("p2k_a", vjs
.p2KeyBindings
[BUTTON_A
]);
2066 settings
.setValue("p2k_option", vjs
.p2KeyBindings
[BUTTON_OPTION
]);
2067 settings
.setValue("p2k_pause", vjs
.p2KeyBindings
[BUTTON_PAUSE
]);
2068 settings
.setValue("p2k_0", vjs
.p2KeyBindings
[BUTTON_0
]);
2069 settings
.setValue("p2k_1", vjs
.p2KeyBindings
[BUTTON_1
]);
2070 settings
.setValue("p2k_2", vjs
.p2KeyBindings
[BUTTON_2
]);
2071 settings
.setValue("p2k_3", vjs
.p2KeyBindings
[BUTTON_3
]);
2072 settings
.setValue("p2k_4", vjs
.p2KeyBindings
[BUTTON_4
]);
2073 settings
.setValue("p2k_5", vjs
.p2KeyBindings
[BUTTON_5
]);
2074 settings
.setValue("p2k_6", vjs
.p2KeyBindings
[BUTTON_6
]);
2075 settings
.setValue("p2k_7", vjs
.p2KeyBindings
[BUTTON_7
]);
2076 settings
.setValue("p2k_8", vjs
.p2KeyBindings
[BUTTON_8
]);
2077 settings
.setValue("p2k_9", vjs
.p2KeyBindings
[BUTTON_9
]);
2078 settings
.setValue("p2k_pound", vjs
.p2KeyBindings
[BUTTON_d
]);
2079 settings
.setValue("p2k_star", vjs
.p2KeyBindings
[BUTTON_s
]);
2082 WriteProfiles(&settings
);
2086 // Save the UI settings
2087 void MainWin::WriteUISettings(void)
2092 // Point on the emulator settings
2093 QSettings
settings("Underground Software", "Virtual Jaguar");
2094 settings
.beginGroup("ui");
2096 // Emulator UI information
2097 settings
.setValue("pos", pos());
2098 settings
.setValue("size", size());
2099 settings
.setValue("cartLoadPos", filePickWin
->pos());
2101 // Video output information
2102 settings
.setValue("zoom", zoomLevel
);
2104 // Alpine debug UI information (also needed by the Debugger)
2105 if (vjs
.hardwareTypeAlpine
|| vjs
.softTypeDebugger
)
2107 settings
.setValue("cpuBrowseWinPos", cpuBrowseWin
->pos());
2108 settings
.setValue("cpuBrowseWinIsVisible", cpuBrowseWin
->isVisible());
2109 settings
.setValue("memBrowseWinPos", memBrowseWin
->pos());
2110 settings
.setValue("memBrowseWinIsVisible", memBrowseWin
->isVisible());
2111 settings
.setValue("stackBrowseWinPos", stackBrowseWin
->pos());
2112 settings
.setValue("stackBrowseWinIsVisible", stackBrowseWin
->isVisible());
2113 settings
.setValue("stackBrowseWinSize", stackBrowseWin
->size());
2114 settings
.setValue("emuStatusWinPos", emuStatusWin
->pos());
2115 settings
.setValue("emuStatusWinIsVisible", emuStatusWin
->isVisible());
2116 settings
.setValue("opBrowseWinPos", opBrowseWin
->pos());
2117 settings
.setValue("opBrowseWinIsVisible", opBrowseWin
->isVisible());
2118 settings
.setValue("opBrowseWinSize", opBrowseWin
->size());
2119 settings
.setValue("riscDasmBrowseWinPos", riscDasmBrowseWin
->pos());
2120 settings
.setValue("riscDasmBrowseWinIsVisible", riscDasmBrowseWin
->isVisible());
2121 settings
.setValue("m68kDasmBrowseWinPos", m68kDasmBrowseWin
->pos());
2122 settings
.setValue("m68kDasmBrowseWinIsVisible", m68kDasmBrowseWin
->isVisible());
2125 // Debugger UI information
2126 if (vjs
.softTypeDebugger
)
2129 settings
.setValue("m68kDasmWinPos", m68kDasmWin
->pos());
2130 //settings.setValue("m68kDasmWinIsVisible", m68kDasmWin->isVisible());
2131 settings
.setValue("GPUDasmWinPos", GPUDasmWin
->pos());
2132 settings
.setValue("DSPDasmWinPos", DSPDasmWin
->pos());
2134 settings
.setValue("allWatchBrowseWinPos", allWatchBrowseWin
->pos());
2135 settings
.setValue("allWatchBrowseWinIsVisible", allWatchBrowseWin
->isVisible());
2136 settings
.setValue("allWatchBrowseWinSize", allWatchBrowseWin
->size());
2137 settings
.setValue("LocalBrowseWinPos", LocalBrowseWin
->pos());
2138 settings
.setValue("LocalBrowseWinIsVisible", LocalBrowseWin
->isVisible());
2139 settings
.setValue("LocalBrowseWinSize", LocalBrowseWin
->size());
2140 settings
.setValue("heapallocatorBrowseWinPos", heapallocatorBrowseWin
->pos());
2141 settings
.setValue("heapallocatorBrowseWinIsVisible", heapallocatorBrowseWin
->isVisible());
2142 settings
.setValue("heapallocatorBrowseWinSize", heapallocatorBrowseWin
->size());
2143 settings
.setValue("exceptionVectorTableBrowseWinPos", exceptionvectortableBrowseWin
->pos());
2144 settings
.setValue("exceptionVectorTableBrowseWinIsVisible", exceptionvectortableBrowseWin
->isVisible());
2145 settings
.setValue("exceptionVectorTableBrowseWinSize", exceptionvectortableBrowseWin
->size());
2146 settings
.setValue("CallStackBrowseWinPos", CallStackBrowseWin
->pos());
2147 settings
.setValue("CallStackBrowseWinIsVisible", CallStackBrowseWin
->isVisible());
2148 settings
.setValue("CallStackBrowseWinSize", CallStackBrowseWin
->size());
2149 for (i
= 0; i
< vjs
.nbrmemory1browserwindow
; i
++)
2151 sprintf(mem1Name
, "mem1BrowseWinPos[%i]", (unsigned int)i
);
2152 settings
.setValue(mem1Name
, mem1BrowseWin
[i
]->pos());
2153 sprintf(mem1Name
, "mem1BrowseWinIsVisible[%i]", (unsigned int)i
);
2154 settings
.setValue(mem1Name
, mem1BrowseWin
[i
]->isVisible());
2155 sprintf(mem1Name
, "mem1BrowseWinSize[%i]", (unsigned int)i
);
2156 settings
.setValue(mem1Name
, mem1BrowseWin
[i
]->size());
2160 settings
.endGroup();
2164 // Refresh alpine debug windows
2165 void MainWin::RefreshAlpineWindows(void)
2167 cpuBrowseWin
->RefreshContents();
2168 memBrowseWin
->RefreshContents();
2169 stackBrowseWin
->RefreshContents();
2170 emuStatusWin
->RefreshContents();
2171 opBrowseWin
->RefreshContents();
2172 riscDasmBrowseWin
->RefreshContents();
2173 m68kDasmBrowseWin
->RefreshContents();
2177 // Reset soft debugger windows
2178 void MainWin::DebuggerResetWindows(void)
2180 if (vjs
.softTypeDebugger
)
2182 allWatchBrowseWin
->Reset();
2183 heapallocatorBrowseWin
->Reset();
2185 //ResetAlpineWindows();
2190 // Refresh soft debugger & alpine debug windows
2191 void MainWin::DebuggerRefreshWindows(void)
2195 if (vjs
.softTypeDebugger
)
2197 m68kDasmWin
->RefreshContents();
2198 GPUDasmWin
->RefreshContents();
2199 DSPDasmWin
->RefreshContents();
2200 allWatchBrowseWin
->RefreshContents();
2201 LocalBrowseWin
->RefreshContents();
2202 CallStackBrowseWin
->RefreshContents();
2203 heapallocatorBrowseWin
->RefreshContents();
2204 for (i
= 0; i
< vjs
.nbrmemory1browserwindow
; i
++)
2206 mem1BrowseWin
[i
]->RefreshContents(i
);
2209 RefreshAlpineWindows();