From e40d81dbf2c3035fa597edef83c23110d2ec038b Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 5 Feb 2015 08:44:16 -0800 Subject: [PATCH] VIDEO: Add proper WRU detection when SIM_VIDEO is used on OS X. --- sim_console.c | 8 ++++++++ sim_video.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sim_console.c b/sim_console.c index 63ae1d22..8814af99 100644 --- a/sim_console.c +++ b/sim_console.c @@ -2843,7 +2843,11 @@ runtty = cmdtty; runtty.c_lflag = runtty.c_lflag & ~(ECHO | ICANON); /* no echo or edit */ runtty.c_oflag = runtty.c_oflag & ~OPOST; /* no output edit */ runtty.c_iflag = runtty.c_iflag & ~ICRNL; /* no cr conversion */ +#if defined(USE_SIM_VIDEO) && defined(HAVE_LIBSDL) +runtty.c_cc[VINTR] = 0; /* OS X doesn't deliver SIGINT to main thread when enabled */ +#else runtty.c_cc[VINTR] = sim_int_char; /* interrupt */ +#endif runtty.c_cc[VQUIT] = 0; /* no quit */ runtty.c_cc[VERASE] = 0; runtty.c_cc[VKILL] = 0; @@ -2879,7 +2883,11 @@ static t_stat sim_os_ttrun (void) { if (!isatty (fileno (stdin))) /* skip if !tty */ return SCPE_OK; +#if defined(USE_SIM_VIDEO) && defined(HAVE_LIBSDL) +runtty.c_cc[VINTR] = 0; /* OS X doesn't deliver SIGINT to main thread when enabled */ +#else runtty.c_cc[VINTR] = sim_int_char; /* in case changed */ +#endif if (tcsetattr (0, TCSAFLUSH, &runtty) < 0) return SCPE_TTIERR; if (prior_norm) { /* at normal pri? */ diff --git a/sim_video.c b/sim_video.c index 3fdd97b6..71cfd7e2 100644 --- a/sim_video.c +++ b/sim_video.c @@ -41,7 +41,7 @@ t_bool vid_mouse_b2 = FALSE; t_bool vid_mouse_b3 = FALSE; char vid_release_key[64] = "Ctrl-Right-Shift"; -#if HAVE_LIBSDL +#if defined(HAVE_LIBSDL) #include #include