From d6b7619878ecdd8a72a516709b52c7a944131fa6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 8 Aug 2023 00:24:20 +0200 Subject: [PATCH 1/3] Removed some duplicate variables in unix/unix_sdl.c, closes #3523. --- src/unix/unix_sdl.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/unix/unix_sdl.c b/src/unix/unix_sdl.c index 4cf723b00..e20abbcd6 100644 --- a/src/unix/unix_sdl.c +++ b/src/unix/unix_sdl.c @@ -51,9 +51,6 @@ int title_set = 0; int resize_pending = 0; int resize_w = 0; int resize_h = 0; -double mouse_sensitivity = 1.0; /* Unused. */ -double mouse_x_error = 0.0; /* Unused. */ -double mouse_y_error = 0.0; /* Unused. */ static uint8_t interpixels[17842176]; extern void RenderImGui(void); From b4aea2f7689c9b50901f51912392f2791567c522 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 8 Aug 2023 03:52:09 +0200 Subject: [PATCH 2/3] The PIC timer is no longer used to latch all IRQ updates on XT, but only those after writes to the mask register, which are now delayed for the duration of 1 CPU cycles, making the PCjr boot again, fixes #3500. --- src/pic.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/pic.c b/src/pic.c index 09ccf5d03..cb4cc109e 100644 --- a/src/pic.c +++ b/src/pic.c @@ -225,12 +225,7 @@ find_best_interrupt(pic_t *dev) static __inline void pic_update_pending_xt(void) { - if (find_best_interrupt(&pic) != -1) { - latched++; - if (latched == 1) - timer_on_auto(&pic_timer, 0.35); - } else if (latched == 0) - pic.int_pending = 0; + pic.int_pending = (find_best_interrupt(&pic) != -1); } static __inline void @@ -248,11 +243,7 @@ pic_callback(void *priv) { pic_t *dev = (pic_t *) priv; - dev->int_pending = 1; - - latched--; - if (latched > 0) - timer_on_auto(&pic_timer, 0.35); + update_pending(); } void @@ -501,7 +492,10 @@ pic_write(uint16_t addr, uint8_t val, void *priv) break; case STATE_NONE: dev->imr = val; - update_pending(); + if (is286) + update_pending(); + else + timer_on_auto(&pic_timer, .0 * ((10000000.0 * (double) xt_cpu_multi) / (double) cpu_s->rspeed)); break; default: From 87651a2cb3cdf5d5356f9248125a08de62637077 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 8 Aug 2023 06:51:24 +0200 Subject: [PATCH 3/3] More Linux compile fixes, fixes #3524. --- src/qt/qt_rendererstack.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qt/qt_rendererstack.cpp b/src/qt/qt_rendererstack.cpp index 93a6abe07..bb812bc03 100644 --- a/src/qt/qt_rendererstack.cpp +++ b/src/qt/qt_rendererstack.cpp @@ -73,8 +73,8 @@ RendererStack::RendererStack(QWidget *parent, int monitor_index) m_monitor_index = monitor_index; #if defined __unix__ && !defined __HAIKU__ - mousedata.mouse_type = getenv("EMU86BOX_MOUSE"), auto_mouse_type[16]; - if (!mousedata.mouse_type || (mouse_type[0] == '\0') || !stricmp(mousedata.mouse_type, "auto")) { + mousedata.mouse_type = getenv("EMU86BOX_MOUSE"), char auto_mouse_type[16]; + if (!mousedata.mouse_type || (mousedata.mouse_type[0] == '\0') || !stricmp(mousedata.mouse_type, "auto")) { if (QApplication::platformName().contains("wayland")) strcpy(auto_mouse_type, "wayland"); else if (QApplication::platformName() == "eglfs") @@ -87,17 +87,17 @@ RendererStack::RendererStack(QWidget *parent, int monitor_index) } # ifdef WAYLAND - if (!stricmp(mouse_type, "wayland")) { + if (!stricmp(mousedata.mouse_type, "wayland")) { wl_init(); this->mouse_capture_func = wl_mouse_capture; this->mouse_uncapture_func = wl_mouse_uncapture; } # endif # ifdef EVDEV_INPUT - if (!stricmp(mouse_type, "evdev")) + if (!stricmp(mousedata.mouse_type, "evdev")) evdev_init(); # endif - if (!stricmp(mouse_type, "xinput2")) { + if (!stricmp(mousedata.mouse_type, "xinput2")) { extern void xinput2_init(); extern void xinput2_exit(); xinput2_init();