ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/main_unix.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/main_unix.cpp (file contents):
Revision 1.3 by cebix, 1999-10-19T17:41:35Z vs.
Revision 1.7 by cebix, 1999-10-28T15:33:14Z

# Line 48 | Line 48
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";
# Line 87 | Line 91 | static struct sigaction timer_sa;                                      //
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);
# Line 132 | Line 141 | int main(int argc, char **argv)
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
# Line 143 | Line 156 | int main(int argc, char **argv)
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
# Line 252 | Line 265 | int main(int argc, char **argv)
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  
# Line 326 | Line 347 | void FlushCodeCache(void *start, uint32
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!)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines