Added video output display in a specific window
[clinton/Virtual-Jaguar-Rx.git] / src / gui / mainwin.h
1 //
2 // mainwin.h: Header file
3 //
4 // by James Hammons
5 // (C) 2010 Underground Software
6 //
7 // Modified by Jean-Paul Mari
8 //
9
10 #ifndef __MAINWIN_H__
11 #define __MAINWIN_H__
12
13 //Hrm. uh??? I thought this wasn't the way to do this stuff...???
14 #include <QtWidgets/QtWidgets>
15 #include "tom.h"
16
17 #define RING_BUFFER_SIZE 32
18
19 // Main windows
20 class GLWidget;
21 //class VideoWindow;
22 class AboutWindow;
23 class HelpWindow;
24 class FilePickerWindow;
25 class VideoOutputWindow;
26 //class DasmWindow;
27 class EmuStatusWindow;
28
29 // Alpine
30 class MemoryBrowserWindow;
31 class StackBrowserWindow;
32 class CPUBrowserWindow;
33 class OPBrowserWindow;
34 class M68KDasmBrowserWindow;
35 class RISCDasmBrowserWindow;
36 class HWRegsBrowserWindow;
37
38 // Debugger
39 class SourcesWindow;
40 class m68KDasmWindow;
41 class GPUDasmWindow;
42 class DSPDasmWindow;
43 class AllWatchBrowserWindow;
44 class LocalBrowserWindow;
45 class CallStackBrowserWindow;
46 class HeapAllocatorBrowserWindow;
47 class Memory1BrowserWindow;
48 class BreakpointsWindow;
49 class NewFnctBreakpointWindow;
50 class ExceptionVectorTableBrowserWindow;
51 class FilesrcListWindow;
52 class CartFilesListWindow;
53 class SaveDumpAsWindow;
54
55
56 //
57 class MainWin: public QMainWindow
58 {
59 // All Qt apps require this macro for signal/slot functionality to work
60 Q_OBJECT
61
62 public:
63 // MainWin(QString);
64 MainWin(bool);
65 void LoadFile(QString);
66 void SyncUI(void);
67 void DebuggerRefreshWindows(void);
68 void ViewRefreshWindows(void);
69 void RefreshWindows(void);
70 void CommonRefreshWindows(void);
71 void AlpineRefreshWindows(void);
72 void DebuggerResetWindows(void);
73 void CommonResetWindows(void);
74 void CommonReset(void);
75 void DebuggerReset(void);
76
77 protected:
78 void closeEvent(QCloseEvent *);
79 void keyPressEvent(QKeyEvent *);
80 void keyReleaseEvent(QKeyEvent *);
81
82 private slots:
83 void Open(void);
84 void Configure(void);
85 void Timer(void);
86 void TogglePowerState(void);
87 void ToggleRunState(void);
88 void SetZoom100(void);
89 void SetZoom200(void);
90 void SetZoom300(void);
91 void SetNTSC(void);
92 void SetPAL(void);
93 void ToggleBlur(void);
94 void ShowAboutWin(void);
95 void ShowHelpWin(void);
96 void InsertCart(void);
97 void Unpause(void);
98 void LoadSoftware(QString);
99 void ToggleCDUsage(void);
100 void FrameAdvance(void);
101 void ToggleFullScreen(void);
102 void ShowEmuStatusWin(void);
103 void MakeScreenshot(void);
104 // Debugger
105 void DebuggerTraceStepOver(void);
106 void DebuggerTraceStepInto(void);
107 void DebuggerRestart(void);
108 void ShowAllWatchBrowserWin(void);
109 void ShowLocalBrowserWin(void);
110 void ShowCallStackBrowserWin(void);
111 void ShowHeapAllocatorBrowserWin(void);
112 void ShowMemory1BrowserWin(int NumWin);
113 void ShowExceptionVectorTableBrowserWin(void);
114 void ShowNewFunctionBreakpointWin(void);
115 void ShowBreakpointsWin(void);
116 void DeleteAllBreakpoints(void);
117 void DisableAllBreakpoints(void);
118 void ShowSaveDumpAsWin(void);
119 void SelectdasmtabWidget(const int);
120 void ShowVideoOutputWin(void);
121 //void ShowDasmWin(void);
122 void ShowCartFilesListWin(void);
123 // Alpine
124 void ShowMemoryBrowserWin(void);
125 void ShowStackBrowserWin(void);
126 void ShowCPUBrowserWin(void);
127 void ShowOPBrowserWin(void);
128 void ShowM68KDasmBrowserWin(void);
129 void ShowHWRegsBrowserWin(void);
130 void ShowRISCDasmBrowserWin(void);
131
132 private:
133 void HandleKeys(QKeyEvent *, bool);
134 void HandleGamepads(void);
135 void SetFullScreen(bool state = true);
136 void ResizeMainWindow(void);
137 void ReadUISettings(void);
138 void ReadSettings(void);
139 void WriteSettings(void);
140 void WriteUISettings(void);
141
142 private:
143 GLWidget *videoWidget;
144 QMdiArea *mainWindowCentrale;
145 QMdiSubWindow *VideoOutputWindowCentrale;
146 AboutWindow *aboutWin;
147 HelpWindow *helpWin;
148 FilePickerWindow *filePickWin;
149 EmuStatusWindow *emuStatusWin;
150 MemoryBrowserWindow *memBrowseWin;
151 StackBrowserWindow *stackBrowseWin;
152 CPUBrowserWindow *cpuBrowseWin;
153 OPBrowserWindow *opBrowseWin;
154 M68KDasmBrowserWindow *m68kDasmBrowseWin;
155 RISCDasmBrowserWindow *riscDasmBrowseWin;
156 HWRegsBrowserWindow *hwRegsBrowseWin;
157 VideoOutputWindow *VideoOutputWin;
158 AllWatchBrowserWindow *allWatchBrowseWin;
159 LocalBrowserWindow *LocalBrowseWin;
160 CallStackBrowserWindow *CallStackBrowseWin;
161 ExceptionVectorTableBrowserWindow *exceptionvectortableBrowseWin;
162 HeapAllocatorBrowserWindow *heapallocatorBrowseWin;
163 Memory1BrowserWindow **mem1BrowseWin;
164 //DasmWindow * DasmWin;
165 QTabWidget *dasmtabWidget;
166 //QDockWidget *dasmtabWidget;
167 SourcesWindow *SourcesWin;
168 m68KDasmWindow *m68kDasmWin;
169 GPUDasmWindow *GPUDasmWin;
170 DSPDasmWindow *DSPDasmWin;
171 FilesrcListWindow *FilesrcListWin;
172 BreakpointsWindow *BreakpointsWin;
173 NewFnctBreakpointWindow *NewFunctionBreakpointWin;
174 CartFilesListWindow *CartFilesListWin;
175 SaveDumpAsWindow *SaveDumpAsWin;
176 QTimer *timer;
177 bool running;
178 int zoomLevel;
179 bool powerButtonOn;
180 bool showUntunedTankCircuit;
181
182 public:
183 bool cartridgeLoaded;
184
185 private:
186 bool allowUnknownSoftware;
187 bool CDActive;
188 // bool alpineLoadSuccessful;
189 bool pauseForFileSelector;
190 bool loadAndGo;
191 bool keyHeld[8];
192 bool fullScreen;
193 bool scannedSoftwareFolder;
194
195 public:
196 bool plzDontKillMyComputer;
197 uint32_t oldTimestamp;
198 uint32_t ringBufferPointer;
199 uint32_t ringBuffer[RING_BUFFER_SIZE];
200
201 private:
202 QPoint mainWinPosition;
203 // QSize mainWinSize;
204 int lastEditedProfile;
205 QMenu *fileMenu;
206 QMenu *helpMenu;
207 QMenu *debugMenu, *debugWindowsMenu, *debugWindowsBrowsesMenu, *debugWindowsWatchMenu, *debugWindowOutputMenu, *debugWindowExceptionMenu, *debugWindowsMemoryMenu, *debugNewBreakpointMenu;
208 QMenu *viewMenu, *viewCartMenu;
209 QToolBar * toolbar;
210 QToolBar * debugbar;
211 QToolBar * debuggerbar;
212
213 QActionGroup * zoomActs;
214 QActionGroup * tvTypeActs;
215
216 QAction *quitAppAct;
217 QAction *powerAct;
218 QAction *pauseAct;
219 QAction *x1Act;
220 QAction *x2Act;
221 QAction *x3Act;
222 QAction *ntscAct;
223 QAction *palAct;
224 QAction *blurAct;
225 QAction *aboutAct;
226 QAction *helpAct;
227 QAction *filePickAct;
228 QAction *configAct;
229 QAction *emustatusAct;
230 QAction *useCDAct;
231 QAction *frameAdvanceAct;
232 QAction *fullScreenAct;
233 //QAction *DasmAct;
234 QAction *screenshotAct;
235
236 // Alpine
237 QAction *memBrowseAct;
238 QAction *stackBrowseAct;
239 QAction *cpuBrowseAct;
240 QAction *opBrowseAct;
241 QAction *m68kDasmBrowseAct;
242 QAction *hwRegsBrowseAct;
243 QAction *riscDasmBrowseAct;
244
245 // Debugger
246 QAction *traceStepOverAct;
247 QAction *traceStepIntoAct;
248 QAction *restartAct;
249 QAction *VideoOutputAct;
250 QAction *heapallocatorBrowseAct;
251 QAction *allWatchBrowseAct;
252 QAction *LocalBrowseAct;
253 QAction *CallStackBrowseAct;
254 QAction **mem1BrowseAct;
255 QAction *newFunctionBreakpointAct;
256 QAction *BreakpointsAct;
257 QAction *deleteAllBreakpointsAct;
258 QAction *disableAllBreakpointsAct;
259 QAction *saveDumpAsAct;
260 QAction *exceptionVectorTableBrowseAct;
261 QAction *CartFilesListAct;
262
263 QIcon powerGreen;
264 QIcon powerRed;
265 QIcon blur;
266 uint32_t testPattern[VIRTUAL_SCREEN_WIDTH * VIRTUAL_SCREEN_HEIGHT_PAL];
267 uint32_t testPattern2[VIRTUAL_SCREEN_WIDTH * VIRTUAL_SCREEN_HEIGHT_PAL];
268 };
269
270 #endif // __MAINWIN_H__