48 |
|
#include <gtk/gtk.h> |
49 |
|
#endif |
50 |
|
|
51 |
< |
#if ENABLE_DGA |
51 |
> |
#if ENABLE_XF86_DGA |
52 |
|
#include <X11/Xlib.h> |
53 |
|
#include <X11/Xutil.h> |
54 |
|
#include <X11/extensions/xf86dga.h> |
55 |
|
#endif |
56 |
|
|
57 |
+ |
#if ENABLE_MON |
58 |
+ |
#include "mon.h" |
59 |
+ |
#endif |
60 |
+ |
|
61 |
|
|
62 |
|
// Constants |
63 |
|
const char ROM_FILE_NAME[] = "ROM"; |
91 |
|
static timer_t timer; // 60Hz timer |
92 |
|
#endif |
93 |
|
|
94 |
+ |
#if ENABLE_MON |
95 |
+ |
static struct sigaction sigint_sa; // sigaction for SIGINT handler |
96 |
+ |
static void sigint_handler(...); |
97 |
+ |
#endif |
98 |
+ |
|
99 |
|
|
100 |
|
// Prototypes |
101 |
|
static void *xpram_func(void *arg); |
141 |
|
for (int i=1; i<argc; i++) { |
142 |
|
if (strcmp(argv[i], "-display") == 0 && ++i < argc) |
143 |
|
x_display_name = argv[i]; |
144 |
+ |
else if (strcmp(argv[i], "-break") == 0 && ++i < argc) |
145 |
+ |
ROMBreakpoint = strtol(argv[i], NULL, 0); |
146 |
+ |
else if (strcmp(argv[i], "-rominfo") == 0) |
147 |
+ |
PrintROMInfo = true; |
148 |
|
} |
149 |
|
|
150 |
|
// Open display |
156 |
|
QuitEmulator(); |
157 |
|
} |
158 |
|
|
159 |
< |
#if ENABLE_DGA |
159 |
> |
#if ENABLE_XF86_DGA && !ENABLE_MON |
160 |
|
// Fork out, so we can return from fullscreen mode when things get ugly |
161 |
|
XF86DGAForkApp(DefaultScreen(x_display)); |
162 |
|
#endif |
265 |
|
} |
266 |
|
#endif |
267 |
|
|
268 |
+ |
#if ENABLE_MON |
269 |
+ |
// Setup SIGINT handler to enter mon |
270 |
+ |
sigemptyset(&sigint_sa.sa_mask); |
271 |
+ |
sigint_sa.sa_flags = 0; |
272 |
+ |
sigint_sa.sa_handler = sigint_handler; |
273 |
+ |
sigaction(SIGINT, &sigint_sa, NULL); |
274 |
+ |
#endif |
275 |
+ |
|
276 |
|
// Start 68k and jump to ROM boot routine |
277 |
|
Start680x0(); |
278 |
|
|
347 |
|
} |
348 |
|
#endif |
349 |
|
|
350 |
+ |
|
351 |
+ |
/* |
352 |
+ |
* SIGINT handler, enters mon |
353 |
+ |
*/ |
354 |
+ |
|
355 |
+ |
#if ENABLE_MON |
356 |
+ |
static void sigint_handler(...) |
357 |
+ |
{ |
358 |
+ |
char *arg[2] = {"rmon", NULL}; |
359 |
+ |
mon(1, arg); |
360 |
+ |
QuitEmulator(); |
361 |
+ |
} |
362 |
+ |
#endif |
363 |
+ |
|
364 |
|
|
365 |
|
/* |
366 |
|
* Interrupt flags (must be handled atomically!) |