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.4 by cebix, 1999-10-26T16:28:37Z

# Line 54 | Line 54
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          }
147  
148          // Open display
# Line 252 | Line 263 | int main(int argc, char **argv)
263          }
264   #endif
265  
266 + #if ENABLE_MON
267 +        // Setup SIGINT handler to enter mon
268 +        sigemptyset(&sigint_sa.sa_mask);
269 +        sigint_sa.sa_flags = 0;
270 +        sigint_sa.sa_handler = sigint_handler;
271 +        sigaction(SIGINT, &sigint_sa, NULL);
272 + #endif
273 +
274          // Start 68k and jump to ROM boot routine
275          Start680x0();
276  
# Line 326 | Line 345 | void FlushCodeCache(void *start, uint32
345   }
346   #endif
347  
348 +
349 + /*
350 + *  SIGINT handler, enters mon
351 + */
352 +
353 + #if ENABLE_MON
354 + static void sigint_handler(...)
355 + {
356 +        char *arg[2] = {"rmon", NULL};
357 +        mon(1, arg);
358 +        QuitEmulator();
359 + }
360 + #endif
361 +
362  
363   /*
364   *  Interrupt flags (must be handled atomically!)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines