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