From 2ab207451cfa90829627caf9b0a86b1fec7dc5ca Mon Sep 17 00:00:00 2001 From: luennix Date: Sun, 29 Jan 2023 22:50:50 +0300 Subject: [PATCH 01/14] Moved DataExpert EXP8551 from Socket 5 to Socket 7 (Single Voltage), as it's supposed to be. --- src/machine/machine_table.c | 74 ++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 9ef1f5101..afc56c204 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -7772,43 +7772,6 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, - /* Has AMIKey H KBC firmware. */ - { - .name = "[i430FX] DataExpert EXP8551", - .internal_name = "exp8551", - .type = MACHINE_TYPE_SOCKET5, - .chipset = MACHINE_CHIPSET_INTEL_430FX, - .init = machine_at_exp8551_init, - .pad = 0, - .pad0 = 0, - .pad1 = MACHINE_AVAILABLE, - .pad2 = 0, - .cpu = { - .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, - .min_bus = 50000000, - .max_bus = 66666667, - .min_voltage = 3380, - .max_voltage = 3520, - .min_multi = 1.5, - .max_multi = 3.0 - }, - .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_GAMEPORT, - .ram = { - .min = 8192, - .max = 131072, - .step = 8192 - }, - .nvrmask = 127, - .kbc = KBC_UNKNOWN, - .kbc_p1 = 0, - .gpio = 0, - .device = NULL, - .vid_device = NULL, - .snd_device = NULL, - .net_device = NULL - }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ @@ -8191,6 +8154,43 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* Has AMIKey H KBC firmware. */ + { + .name = "[i430FX] DataExpert EXP8551", + .internal_name = "exp8551", + .type = MACHINE_TYPE_SOCKET7_3V, + .chipset = MACHINE_CHIPSET_INTEL_430FX, + .init = machine_at_exp8551_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET5_7, + .block = CPU_BLOCK_NONE, + .min_bus = 50000000, + .max_bus = 66666667, + .min_voltage = 3380, + .max_voltage = 3520, + .min_multi = 1.5, + .max_multi = 3.0 + }, + .bus_flags = MACHINE_PS2_PCI, + .flags = MACHINE_IDE_DUAL | MACHINE_GAMEPORT, + .ram = { + .min = 8192, + .max = 131072, + .step = 8192 + }, + .nvrmask = 127, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ From 915b8efe092c42771a7f94a56046f2c9deaa123f Mon Sep 17 00:00:00 2001 From: luennix Date: Sun, 29 Jan 2023 23:10:00 +0300 Subject: [PATCH 02/14] Also moved PC Partner MB500N to Socket 7 (Single Voltage) --- src/machine/machine_table.c | 74 ++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index afc56c204..eacd50562 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -7848,43 +7848,6 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, - /* Has a VIA VT82C42N KBC. */ - { - .name = "[i430FX] PC Partner MB500N", - .internal_name = "mb500n", - .type = MACHINE_TYPE_SOCKET5, - .chipset = MACHINE_CHIPSET_INTEL_430FX, - .init = machine_at_mb500n_init, - .pad = 0, - .pad0 = 0, - .pad1 = MACHINE_AVAILABLE, - .pad2 = 0, - .cpu = { - .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, - .min_bus = 50000000, - .max_bus = 66666667, - .min_voltage = 3380, - .max_voltage = 3520, - .min_multi = 1.5, - .max_multi = 3.0 - }, - .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, - .ram = { - .min = 8192, - .max = 131072, - .step = 8192 - }, - .nvrmask = 127, - .kbc = KBC_UNKNOWN, - .kbc_p1 = 0, - .gpio = 0, - .device = NULL, - .vid_device = NULL, - .snd_device = NULL, - .net_device = NULL - }, /* Has AMIKey Z(!) KBC firmware. */ { .name = "[i430FX] TriGem Hawk", @@ -8460,6 +8423,43 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* Has a VIA VT82C42N KBC. */ + { + .name = "[i430FX] PC Partner MB500N", + .internal_name = "mb500n", + .type = MACHINE_TYPE_SOCKET7_3V, + .chipset = MACHINE_CHIPSET_INTEL_430FX, + .init = machine_at_mb500n_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET5_7, + .block = CPU_BLOCK_NONE, + .min_bus = 50000000, + .max_bus = 66666667, + .min_voltage = 3380, + .max_voltage = 3520, + .min_multi = 1.5, + .max_multi = 3.0 + }, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_IDE_DUAL, + .ram = { + .min = 8192, + .max = 131072, + .step = 8192 + }, + .nvrmask = 127, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* Has an AMI 'H' KBC firmware (1992). */ { .name = "[i430FX] QDI FMB", From a34dc15dc0a786461fd79d00b61f63372b6c9f23 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 30 Jan 2023 13:56:55 -0300 Subject: [PATCH 03/14] Jenkins: Update openal-soft to 1.22.2 --- .ci/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 31e1d770f..af6a31abf 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -949,13 +949,13 @@ else if grep -q "OPENAL:BOOL=ON" build/CMakeCache.txt then - # Build openal-soft 1.21.1 manually to fix audio issues. This is a temporary + # Build openal-soft 1.22.2 manually to fix audio issues. This is a temporary # workaround until a newer version of openal-soft trickles down to Debian repos. - prefix="$cache_dir/openal-soft-1.21.1" + prefix="$cache_dir/openal-soft-1.22.2" if [ ! -d "$prefix" ] then rm -rf "$cache_dir/openal-soft-"* # remove old versions - wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.21.1.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" + wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.22.2.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" fi prefix_build="$prefix/build-$arch_deb" cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$toolchain_file" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix_build" || exit 99 From 3cb6e8d9aa5ecd263cfb49c4f4dc369b99e55b63 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 30 Jan 2023 15:20:37 -0300 Subject: [PATCH 04/14] Jenkins: Patch openal-soft to enable PipeWire --- .ci/build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/build.sh b/.ci/build.sh index af6a31abf..df1b097e9 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -951,11 +951,15 @@ else then # Build openal-soft 1.22.2 manually to fix audio issues. This is a temporary # workaround until a newer version of openal-soft trickles down to Debian repos. - prefix="$cache_dir/openal-soft-1.22.2" + prefix="$cache_dir/openal-soft-1.22.2-pwpatch" if [ ! -d "$prefix" ] then rm -rf "$cache_dir/openal-soft-"* # remove old versions wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.22.2.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" + + # Patches to build with the old PipeWire version in Debian. + sed -i -e 's/>=0.3.23//' "$prefix/CMakeLists.txt" + sed -i -e 's/PW_KEY_CONFIG_NAME/"config.name"/g' "$prefix/alc/backends/pipewire.cpp" fi prefix_build="$prefix/build-$arch_deb" cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$toolchain_file" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix_build" || exit 99 From 8493bde039b18bbad63e83fb75ae762a1a9d02e3 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 30 Jan 2023 15:35:10 -0300 Subject: [PATCH 05/14] Jenkins: Fix openal-soft prefix --- .ci/build.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index df1b097e9..83c5c48c2 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -951,16 +951,17 @@ else then # Build openal-soft 1.22.2 manually to fix audio issues. This is a temporary # workaround until a newer version of openal-soft trickles down to Debian repos. - prefix="$cache_dir/openal-soft-1.22.2-pwpatch" + prefix="$cache_dir/openal-soft-1.22.2" if [ ! -d "$prefix" ] then rm -rf "$cache_dir/openal-soft-"* # remove old versions wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.22.2.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" - - # Patches to build with the old PipeWire version in Debian. - sed -i -e 's/>=0.3.23//' "$prefix/CMakeLists.txt" - sed -i -e 's/PW_KEY_CONFIG_NAME/"config.name"/g' "$prefix/alc/backends/pipewire.cpp" fi + + # Patches to build with the old PipeWire version in Debian. + sed -i -e 's/>=0.3.23//' "$prefix/CMakeLists.txt" + sed -i -e 's/PW_KEY_CONFIG_NAME/"config.name"/g' "$prefix/alc/backends/pipewire.cpp" + prefix_build="$prefix/build-$arch_deb" cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$toolchain_file" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix_build" || exit 99 cmake --build "$prefix_build" -j$(nproc) || exit 99 From 934c5df8fd7bb878612ddc217704824dacae4a42 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 30 Jan 2023 18:26:14 -0300 Subject: [PATCH 06/14] Jenkins: Remove sound systems from FluidSynth as we don't use them --- .ci/build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 83c5c48c2..99d05bca4 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -1004,7 +1004,8 @@ else cmake --build "$prefix_build" -j$(nproc) || exit 99 cmake --install "$prefix_build" || exit 99 - # Build FluidSynth without JACK support to remove the dependency on libjack once again. + # Build FluidSynth without sound systems to remove the dependencies on libjack + # and other sound system libraries. We don't output audio through FluidSynth. prefix="$cache_dir/fluidsynth-2.3.0" if [ ! -d "$prefix" ] then @@ -1014,7 +1015,9 @@ else cp cmake/flags-gcc.cmake cmake/flags-gcc.cmake.old sed -i -e 's/ -Werror=.*\([" ]\)/\1/g' cmake/flags-gcc.cmake # temporary hack for -Werror=old-style-definition non-compliance on FluidSynth and SDL2 prefix_build="$prefix/build-$arch_deb" - cmake -G Ninja -D enable-jack=OFF -D enable-sdl2=$sdl_ss -D "CMAKE_TOOLCHAIN_FILE=$toolchain_file" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix_build" || exit 99 + cmake -G Ninja -D enable-dbus=OFF -D enable-jack=OFF -D enable-oss=OFF -D enable-sdl2=OFF -D enable-pulseaudio=OFF -D enable-pipewire=OFF -D enable-alsa=OFF \ + -D "CMAKE_TOOLCHAIN_FILE=$toolchain_file" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" \ + -S "$prefix" -B "$prefix_build" || exit 99 cmake --build "$prefix_build" -j$(nproc) || exit 99 cmake --install "$prefix_build" || exit 99 cp -p "$cwd_root/archive_tmp/usr/bin/fluidsynth" fluidsynth From 05874029284b5863ac7c8e2e5d1b8b3c0d92cdef Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 30 Jan 2023 19:04:49 -0300 Subject: [PATCH 07/14] Jenkins: Update appimage-builder to CI build to fix arm64 issues --- .ci/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/build.sh b/.ci/build.sh index 99d05bca4..947d49a20 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -1166,7 +1166,8 @@ EOF done < .ci/AppImageBuilder.yml # Download appimage-builder if necessary. - appimage_builder_url="https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-$(uname -m).AppImage" + #appimage_builder_url="https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-$(uname -m).AppImage" + appimage_builder_url="https://ci.86box.net/userContent/appimage-builder-1.1.1.dev32+g2709a3b-x86_64.AppImage" appimage_builder_binary="$cache_dir/$(basename "$appimage_builder_url")" if [ ! -e "$appimage_builder_binary" ] then From a8604a6b6ab117f8710a55fd2ac57a1525108d53 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 30 Jan 2023 22:37:55 -0300 Subject: [PATCH 08/14] Jenkins: Proper workaround for the appimage-builder interpreter issue --- .ci/build.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 947d49a20..b09e7c71b 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -1163,11 +1163,25 @@ EOF # Copy line. echo "$line" >> AppImageBuilder-generated.yml + + # Workaround for appimage-builder issues 272 and 283 (i686 and armhf are also missing) + if [ "$arch_appimage" != "x86_64" -a "$line" = " files:" ] + then + echo " include:" >> AppImageBuilder-generated.yml + for loader in "/lib/$libdir/ld-linux"*.so.* + do + for loader_copy in "$loader" "/lib/$(basename "$loader")" + do + mkdir -p "/runtime/compat$(dirname "$loader_copy")" + ln -s "$loader" "/runtime/compat$loader_copy" + echo " - /runtime/compat$loader_copy" >> AppImageBuilder-generated.yml + done + done + fi done < .ci/AppImageBuilder.yml # Download appimage-builder if necessary. - #appimage_builder_url="https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-$(uname -m).AppImage" - appimage_builder_url="https://ci.86box.net/userContent/appimage-builder-1.1.1.dev32+g2709a3b-x86_64.AppImage" + appimage_builder_url="https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-$(uname -m).AppImage" appimage_builder_binary="$cache_dir/$(basename "$appimage_builder_url")" if [ ! -e "$appimage_builder_binary" ] then @@ -1183,7 +1197,7 @@ EOF ln -s "$cache_dir/appimage-builder-cache" appimage-builder-cache # Run appimage-builder in extract-and-run mode for Docker compatibility. - # --appdir is a workaround for https://github.com/AppImageCrafters/appimage-builder/issues/270 + # --appdir is a workaround for appimage-builder issue 270 reported by us. for retry in 1 2 3 4 5 do project="$project" project_id="$project_id" project_version="$project_version" project_icon="$project_icon" arch_deb="$arch_deb" \ From a926ea1d8492938b07cf657b1d508d8210c3c2e2 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 31 Jan 2023 07:27:34 +0100 Subject: [PATCH 09/14] SiS 85c50x SMRAM fixes. --- src/chipset/sis_85c50x.c | 79 ++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 27 deletions(-) diff --git a/src/chipset/sis_85c50x.c b/src/chipset/sis_85c50x.c index 24fdd7788..8d7222d54 100644 --- a/src/chipset/sis_85c50x.c +++ b/src/chipset/sis_85c50x.c @@ -59,7 +59,7 @@ typedef struct sis_85c50x_t { pci_conf[256], pci_conf_sb[256], regs[256]; - smram_t *smram; + smram_t *smram[2]; port_92_t *port_92; } sis_85c50x_t; @@ -93,28 +93,41 @@ static void sis_85c50x_smm_recalc(sis_85c50x_t *dev) { /* NOTE: Naming mismatch - what the datasheet calls "host address" is what we call ram_base. */ - uint32_t ram_base = (dev->pci_conf[0x64] << 20) | ((dev->pci_conf[0x65] & 0x07) << 28); + uint32_t host_base = (dev->pci_conf[0x64] << 20) | ((dev->pci_conf[0x65] & 0x07) << 28); - smram_disable(dev->smram); + smram_disable_all(); - if ((((dev->pci_conf[0x65] & 0xe0) >> 5) != 0x00) && (ram_base == 0x00000000)) + if ((((dev->pci_conf[0x65] & 0xe0) >> 5) != 0x00) && (host_base == 0x00000000)) return; switch ((dev->pci_conf[0x65] & 0xe0) >> 5) { case 0x00: - smram_enable(dev->smram, 0xe0000, 0xe0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + sis_85c50x_log("SiS 50x SMRAM: 000E0000-000E7FFF -> 000E0000-000E7FFF\n"); + smram_enable(dev->smram[0], 0xe0000, 0xe0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); break; case 0x01: - smram_enable(dev->smram, 0xb0000, ram_base, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); + host_base |= 0x000b0000; + sis_85c50x_log("SiS 50x SMRAM: %08X-%08X -> 000B0000-000BFFFF\n", host_base, host_base + 0x10000 - 1); + smram_enable(dev->smram[0], host_base, 0xb0000, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); + smram_enable(dev->smram[1], host_base ^ 0x00100000, 0xb0000, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); break; case 0x02: - smram_enable(dev->smram, 0xa0000, ram_base, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); + host_base |= 0x000a0000; + sis_85c50x_log("SiS 50x SMRAM: %08X-%08X -> 000A0000-000AFFFF\n", host_base, host_base + 0x10000 - 1); + smram_enable(dev->smram[0], host_base, 0xa0000, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); + smram_enable(dev->smram[1], host_base ^ 0x00100000, 0xa0000, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); break; case 0x04: - smram_enable(dev->smram, 0xa0000, ram_base, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + host_base |= 0x000a0000; + sis_85c50x_log("SiS 50x SMRAM: %08X-%08X -> 000A0000-000AFFFF\n", host_base, host_base + 0x8000 - 1); + smram_enable(dev->smram[0], host_base, 0xa0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + smram_enable(dev->smram[1], host_base ^ 0x00100000, 0xa0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); break; case 0x06: - smram_enable(dev->smram, 0xb0000, ram_base, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + host_base |= 0x000b0000; + sis_85c50x_log("SiS 50x SMRAM: %08X-%08X -> 000B0000-000BFFFF\n", host_base, host_base + 0x8000 - 1); + smram_enable(dev->smram[0], host_base, 0xb0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + smram_enable(dev->smram[1], host_base ^ 0x00100000, 0xa0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); break; } } @@ -125,7 +138,9 @@ sis_85c50x_write(int func, int addr, uint8_t val, void *priv) sis_85c50x_t *dev = (sis_85c50x_t *) priv; uint8_t valxor = (val ^ dev->pci_conf[addr]); - switch (addr) { + sis_85c50x_log("85C501: [W] (%02X, %02X) = %02X\n", func, addr, val); + + if (func == 0x00) switch (addr) { case 0x04: /* Command - low byte */ dev->pci_conf[addr] = (dev->pci_conf[addr] & 0xb4) | (val & 0x4b); break; @@ -177,8 +192,8 @@ sis_85c50x_write(int func, int addr, uint8_t val, void *priv) break; case 0x5b: dev->pci_conf[addr] = val; - if (valxor & 0xc0) - port_92_set_features(dev->port_92, !!(val & 0x40), !!(val & 0x80)); + // if (valxor & 0xc0) + // port_92_set_features(dev->port_92, !!(val & 0x40), !!(val & 0x80)); break; case 0x60: /* SMI */ if ((dev->pci_conf[0x68] & 0x01) && !(dev->pci_conf[addr] & 0x02) && (val & 0x02)) { @@ -199,18 +214,20 @@ sis_85c50x_write(int func, int addr, uint8_t val, void *priv) dev->pci_conf[addr] &= ~(val); break; } - - sis_85c50x_log("85C501: dev->pci_conf[%02x] = %02x\n", addr, val); } static uint8_t sis_85c50x_read(int func, int addr, void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; + uint8_t ret = 0xff; - sis_85c50x_log("85C501: dev->pci_conf[%02x] (%02x)\n", addr, dev->pci_conf[addr]); + if (func == 0x00) + ret = dev->pci_conf[addr]; - return dev->pci_conf[addr]; + sis_85c50x_log("85C501: [R] (%02X, %02X) = %02X\n", func, addr, ret); + + return ret; } static void @@ -218,7 +235,9 @@ sis_85c50x_sb_write(int func, int addr, uint8_t val, void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; - switch (addr) { + sis_85c50x_log("85C503: [W] (%02X, %02X) = %02X\n", func, addr, val); + + if (func == 0x00) switch (addr) { case 0x04: /* Command */ dev->pci_conf_sb[addr] = val & 0x0f; break; @@ -246,17 +265,20 @@ sis_85c50x_sb_write(int func, int addr, uint8_t val, void *priv) dev->pci_conf_sb[addr] = val; break; } - - sis_85c50x_log("85C503: dev->pci_conf_sb[%02x] = %02x\n", addr, val); } static uint8_t sis_85c50x_sb_read(int func, int addr, void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; - sis_85c50x_log("85C503: dev->pci_conf_sb[%02x] (%02x)\n", addr, dev->pci_conf_sb[addr]); + uint8_t ret = 0xff; - return dev->pci_conf_sb[addr]; + if (func == 0x00) + ret = dev->pci_conf_sb[addr]; + + sis_85c50x_log("85C503: [W] (%02X, %02X) = %02X\n", func, addr, ret); + + return ret; } static void @@ -264,6 +286,8 @@ sis_85c50x_isa_write(uint16_t addr, uint8_t val, void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; + sis_85c50x_log("85C503 ISA: [W] (%04X) = %02X\n", addr, val); + switch (addr) { case 0x22: dev->index = val; @@ -279,7 +303,7 @@ sis_85c50x_isa_write(uint16_t addr, uint8_t val, void *priv) break; case 0x84: case 0x88: - case 0x9: + case 0x89: case 0x8a: case 0x8b: dev->regs[dev->index] = val; @@ -290,8 +314,6 @@ sis_85c50x_isa_write(uint16_t addr, uint8_t val, void *priv) } break; } - - sis_85c50x_log("85C501-ISA: dev->regs[%02x] = %02x\n", addr, val); } static uint8_t @@ -313,7 +335,7 @@ sis_85c50x_isa_read(uint16_t addr, void *priv) break; } - sis_85c50x_log("85C501-ISA: dev->regs[%02x] (%02x)\n", dev->index, ret); + sis_85c50x_log("85C503 ISA: [R] (%04X) = %02X\n", addr, ret); return ret; } @@ -370,7 +392,8 @@ sis_85c50x_close(void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; - smram_del(dev->smram); + smram_del(dev->smram[1]); + smram_del(dev->smram[0]); free(dev); } @@ -387,7 +410,9 @@ sis_85c50x_init(const device_t *info) pci_add_card(PCI_ADD_SOUTHBRIDGE, sis_85c50x_sb_read, sis_85c50x_sb_write, dev); io_sethandler(0x0022, 0x0002, sis_85c50x_isa_read, NULL, NULL, sis_85c50x_isa_write, NULL, NULL, dev); - dev->smram = smram_add(); + dev->smram[0] = smram_add(); + dev->smram[1] = smram_add(); + dev->port_92 = device_add(&port_92_device); sis_85c50x_reset(dev); From 2ddb5407a562e314174eb4b447f09199d0d5df7c Mon Sep 17 00:00:00 2001 From: luennix Date: Tue, 31 Jan 2023 13:13:25 +0300 Subject: [PATCH 10/14] Fixed mistakes when moving EXP8551 and MB500N. --- src/include/86box/machine.h | 4 +-- src/machine/m_at_socket5.c | 58 ----------------------------------- src/machine/m_at_socket7_3v.c | 58 +++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 4d5b535a8..e06b7fe3e 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -558,10 +558,8 @@ extern int machine_at_430nx_init(const machine_t *); extern int machine_at_acerv30_init(const machine_t *); extern int machine_at_apollo_init(const machine_t *); -extern int machine_at_exp8551_init(const machine_t *); extern int machine_at_zappa_init(const machine_t *); extern int machine_at_powermatev_init(const machine_t *); -extern int machine_at_mb500n_init(const machine_t *); extern int machine_at_hawk_init(const machine_t *); extern int machine_at_pat54pv_init(const machine_t *); @@ -574,12 +572,14 @@ extern int machine_at_sq588_init(const machine_t *); /* m_at_socket7_3v.c */ extern int machine_at_p54tp4xe_init(const machine_t *); extern int machine_at_p54tp4xe_mr_init(const machine_t *); +extern int machine_at_exp8551_init(const machine_t *); extern int machine_at_gw2katx_init(const machine_t *); extern int machine_at_thor_init(const machine_t *); extern int machine_at_mrthor_init(const machine_t *); extern int machine_at_endeavor_init(const machine_t *); extern int machine_at_ms5119_init(const machine_t *); extern int machine_at_pb640_init(const machine_t *); +extern int machine_at_mb500n_init(const machine_t *); extern int machine_at_fmb_init(const machine_t *); extern int machine_at_acerm3a_init(const machine_t *); diff --git a/src/machine/m_at_socket5.c b/src/machine/m_at_socket5.c index fa562a62c..1d0b523d3 100644 --- a/src/machine/m_at_socket5.c +++ b/src/machine/m_at_socket5.c @@ -160,35 +160,6 @@ machine_at_apollo_init(const machine_t *model) return ret; } -int -machine_at_exp8551_init(const machine_t *model) -{ - int ret; - - ret = bios_load_linear("roms/machines/exp8551/AMI20.BIO", - 0x000e0000, 131072, 0); - - if (bios_only || !ret) - return ret; - - machine_at_common_init(model); - - pci_init(PCI_CONFIG_TYPE_1); - pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&keyboard_ps2_ami_pci_device); - device_add(&i430fx_device); - device_add(&piix_device); - device_add(&w83787f_device); - device_add(&sst_flash_29ee010_device); - - return ret; -} - int machine_at_zappa_init(const machine_t *model) { @@ -246,35 +217,6 @@ machine_at_powermatev_init(const machine_t *model) return ret; } -int -machine_at_mb500n_init(const machine_t *model) -{ - int ret; - - ret = bios_load_linear("roms/machines/mb500n/031396s.bin", - 0x000e0000, 131072, 0); - - if (bios_only || !ret) - return ret; - - machine_at_common_init(model); - - pci_init(PCI_CONFIG_TYPE_1); - pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&keyboard_ps2_pci_device); - device_add(&i430fx_device); - device_add(&piix_no_mirq_device); - device_add(&fdc37c665_device); - device_add(&intel_flash_bxt_device); - - return ret; -} - int machine_at_hawk_init(const machine_t *model) { diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 7616d8a4a..03be14c37 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -120,6 +120,35 @@ machine_at_p54tp4xe_mr_init(const machine_t *model) return ret; } +int +machine_at_exp8551_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/exp8551/AMI20.BIO", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + device_add(&keyboard_ps2_ami_pci_device); + device_add(&i430fx_device); + device_add(&piix_device); + device_add(&w83787f_device); + device_add(&sst_flash_29ee010_device); + + return ret; +} + int machine_at_gw2katx_init(const machine_t *model) { @@ -267,6 +296,35 @@ machine_at_pb640_init(const machine_t *model) return ret; } +int +machine_at_mb500n_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/mb500n/031396s.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + device_add(&keyboard_ps2_pci_device); + device_add(&i430fx_device); + device_add(&piix_no_mirq_device); + device_add(&fdc37c665_device); + device_add(&intel_flash_bxt_device); + + return ret; +} + int machine_at_fmb_init(const machine_t *model) { From 887995df05d5e65c6978f2e69074412d378d62db Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 31 Jan 2023 13:39:38 -0300 Subject: [PATCH 11/14] Jenkins: Add debug prints to figure out appimage-builder continuing not to work properly on CI only --- .ci/build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.ci/build.sh b/.ci/build.sh index b09e7c71b..e10d254b1 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -1179,6 +1179,9 @@ EOF done fi done < .ci/AppImageBuilder.yml + echo = appimage-builder workaround list start = + grep /runtime/compat AppImageBuilder-generated.yml + echo = appimage-builder workaround list end = # Download appimage-builder if necessary. appimage_builder_url="https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-$(uname -m).AppImage" From 5b7ae72c334d6f9f0a59d4d2ae9eb46a68b4034b Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 31 Jan 2023 14:07:37 -0300 Subject: [PATCH 12/14] Jenkins: Fix /runtime workaround directory creation (not a fan) --- .ci/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index e10d254b1..63a957477 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -1167,6 +1167,9 @@ EOF # Workaround for appimage-builder issues 272 and 283 (i686 and armhf are also missing) if [ "$arch_appimage" != "x86_64" -a "$line" = " files:" ] then + # Some mild arbitrary code execution with a dummy package... + [ ! -d /runtime ] && sudo apt-get -y -o 'DPkg::Post-Invoke::=mkdir -p /runtime; chmod 777 /runtime' install libsixel1 > /dev/null 2>&1 + echo " include:" >> AppImageBuilder-generated.yml for loader in "/lib/$libdir/ld-linux"*.so.* do @@ -1179,9 +1182,6 @@ EOF done fi done < .ci/AppImageBuilder.yml - echo = appimage-builder workaround list start = - grep /runtime/compat AppImageBuilder-generated.yml - echo = appimage-builder workaround list end = # Download appimage-builder if necessary. appimage_builder_url="https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-$(uname -m).AppImage" From dd384432f0131eabf6dfb3e18f036c0e0a86c334 Mon Sep 17 00:00:00 2001 From: luennix Date: Tue, 31 Jan 2023 20:49:06 +0300 Subject: [PATCH 13/14] Add Gemlight GMB-P54SPS (SiS 501, Socket 5) --- src/include/86box/machine.h | 1 + src/machine/m_at_socket5.c | 29 +++++++++++++++++++++++++++++ src/machine/machine_table.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index e06b7fe3e..96d76b097 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -568,6 +568,7 @@ extern int machine_at_hot543_init(const machine_t *); extern int machine_at_p54sp4_init(const machine_t *); extern int machine_at_sq588_init(const machine_t *); +extern int machine_at_p54sps_init(const machine_t *); /* m_at_socket7_3v.c */ extern int machine_at_p54tp4xe_init(const machine_t *); diff --git a/src/machine/m_at_socket5.c b/src/machine/m_at_socket5.c index 1d0b523d3..842554713 100644 --- a/src/machine/m_at_socket5.c +++ b/src/machine/m_at_socket5.c @@ -344,3 +344,32 @@ machine_at_sq588_init(const machine_t *model) return ret; } + +int +machine_at_p54sps_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/p54sps/35s106.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x06, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x07, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + device_add(&sis_85c50x_device); + device_add(&ide_pci_2ch_device); + device_add(&keyboard_at_ami_device); + device_add(&w83787f_device); + device_add(&sst_flash_29ee010_device); + + return ret; +} diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index eacd50562..5bdd5b948 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -8040,6 +8040,43 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* This machine has a Winbond W83C842 KBC */ + { + .name = "[SiS 501] Gemlight GMB-P54SPS", + .internal_name = "p54sps", + .type = MACHINE_TYPE_SOCKET5, + .chipset = MACHINE_CHIPSET_SIS_501, + .init = machine_at_p54sps_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET5_7, + CPU_BLOCK(CPU_PENTIUMMMX), + .min_bus = 50000000, + .max_bus = 66666667, + .min_voltage = 3520, + .max_voltage = 3520, + .min_multi = 1.5, + .max_multi = 1.5 + }, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_IDE_DUAL, + .ram = { + .min = 8192, + .max = 131072, + .step = 8192 + }, + .nvrmask = 127, + .kbc = KBC_JETKEY_5_W83C42, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* Socket 7 (Single Voltage) machines */ /* 430FX */ From 91d5050a21940d89994bcca1f79ed0e09d7fdd5f Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 31 Jan 2023 18:29:29 -0300 Subject: [PATCH 14/14] Overhaul XInput2 handling to properly support absolute input devices, closes #2856 --- src/qt/xinput2_mouse.cpp | 119 ++++++++++++++++++++++++++------------- 1 file changed, 80 insertions(+), 39 deletions(-) diff --git a/src/qt/xinput2_mouse.cpp b/src/qt/xinput2_mouse.cpp index 7e49c2694..da7a2d1e0 100644 --- a/src/qt/xinput2_mouse.cpp +++ b/src/qt/xinput2_mouse.cpp @@ -11,11 +11,12 @@ * * * Authors: Cacodemon345 + * RichardG * - * Copyright 2022 Cacodemon345 + * Copyright 2022 Cacodemon345. + * Copyright 2023 RichardG. */ -/* Valuator parsing and duplicate event checking code from SDL2. */ #include #include #include @@ -43,20 +44,19 @@ extern "C" { #include <86box/plat.h> } -int xi2flides[2] = { 0, 0 }; - static Display *disp = nullptr; static QThread *procThread = nullptr; static XIEventMask ximask; static std::atomic exitfromthread = false; static std::atomic xi2_mouse_x = 0, xi2_mouse_y = 0, xi2_mouse_abs_x = 0, xi2_mouse_abs_y = 0; -static int xi2opcode = 0; -static double prev_rel_coords[2] = { 0., 0. }; -static Time prev_time = 0; +static int xi2opcode = 0; +static double prev_coords[2] = { 0.0 }; +static Time prev_time = 0; -// From SDL2. +/* Based on SDL2. */ static void -parse_valuators(const double *input_values, const unsigned char *mask, int mask_len, +parse_valuators(const double *input_values, + const unsigned char *mask, int mask_len, double *output_values, int output_values_len) { int i = 0, z = 0; @@ -64,11 +64,10 @@ parse_valuators(const double *input_values, const unsigned char *mask, int mask_ if (top > 16) top = 16; - memset(output_values, 0, output_values_len * sizeof(double)); + memset(output_values, 0, output_values_len * sizeof(output_values[0])); for (; i < top && z < output_values_len; i++) { if (XIMaskIsSet(mask, i)) { - const int value = (int) *input_values; - output_values[z] = value; + output_values[z] = *input_values; input_values++; } z++; @@ -92,8 +91,7 @@ xinput2_proc() XISetMask(ximask.mask, XI_RawButtonPress); XISetMask(ximask.mask, XI_RawButtonRelease); XISetMask(ximask.mask, XI_RawMotion); - if (XKeysymToKeycode(disp, XK_Home) == 69) - XISetMask(ximask.mask, XI_Motion); + XISetMask(ximask.mask, XI_Motion); XISelectEvents(disp, win, &ximask, 1); @@ -103,23 +101,77 @@ xinput2_proc() XGenericEventCookie *cookie = (XGenericEventCookie *) &ev.xcookie; XNextEvent(disp, (XEvent *) &ev); - if (XGetEventData(disp, cookie) && cookie->type == GenericEvent && cookie->extension == xi2opcode) { + if (XGetEventData(disp, cookie) && (cookie->type == GenericEvent) && (cookie->extension == xi2opcode)) { + const XIRawEvent *rawev = (const XIRawEvent *) cookie->data; + double coords[2] = { 0.0 }; + switch (cookie->evtype) { + case XI_Motion: + { + const XIDeviceEvent *devev = (const XIDeviceEvent *) cookie->data; + parse_valuators(devev->valuators.values, devev->valuators.mask, devev->valuators.mask_len, coords, 2); + + /* XIDeviceEvent and XIRawEvent share the XIEvent base struct, which + doesn't contain deviceid, but that's at the same offset on both. */ + goto common_motion; + } + case XI_RawMotion: { - const XIRawEvent *rawev = (const XIRawEvent *) cookie->data; - double relative_coords[2] = { 0., 0. }; - parse_valuators(rawev->raw_values, rawev->valuators.mask, - rawev->valuators.mask_len, relative_coords, 2); + parse_valuators(rawev->raw_values, rawev->valuators.mask, rawev->valuators.mask_len, coords, 2); +common_motion: + /* Ignore duplicated events. */ + if ((rawev->time == prev_time) && (coords[0] == prev_coords[0]) && (coords[1] == prev_coords[1])) + break; - if ((rawev->time == prev_time) && (relative_coords[0] == prev_rel_coords[0]) && (relative_coords[1] == prev_rel_coords[1])) { - break; // Ignore duplicated events. + /* SDL2 queries the device on every event, so doing that should be fine. */ + int i; + XIDeviceInfo *xidevinfo = XIQueryDevice(disp, rawev->deviceid, &i); + if (xidevinfo) { + /* Process the device's axes. */ + int axis = 0; + for (i = 0; i < xidevinfo->num_classes; i++) { + const XIValuatorClassInfo *v = (const XIValuatorClassInfo *) xidevinfo->classes[i]; + if (v->type == XIValuatorClass) { + /* Is this an absolute or relative axis? */ + if (v->mode == XIModeRelative) { + /* Set relative coordinates. */ + if (axis == 0) + xi2_mouse_x = xi2_mouse_x + coords[axis]; + else + xi2_mouse_y = xi2_mouse_y + coords[axis]; + } else { + /* Convert absolute value range to pixel granularity, then to relative coordinates. */ + int disp_screen = XDefaultScreen(disp), abs_conv; + double abs_div; + if (axis == 0) { + abs_div = (v->max - v->min) / (double) XDisplayWidth(disp, disp_screen); + if (abs_div <= 0) + abs_div = 1; + abs_conv = (coords[axis] - v->min) / abs_div; + + if (xi2_mouse_abs_x != 0) + xi2_mouse_x = xi2_mouse_x + (abs_conv - xi2_mouse_abs_x); + xi2_mouse_abs_x = abs_conv; + } else { + abs_div = (v->max - v->min) / (double) XDisplayHeight(disp, disp_screen); + if (abs_div <= 0) + abs_div = 1; + abs_conv = (coords[axis] - v->min) / abs_div; + + if (xi2_mouse_abs_y != 0) + xi2_mouse_y = xi2_mouse_y + (abs_conv - xi2_mouse_abs_y); + xi2_mouse_abs_y = abs_conv; + } + } + prev_coords[axis] = coords[axis]; + if (++axis >= 2) /* stop after X and Y processed */ + break; + } + } } - xi2_mouse_x = xi2_mouse_x + relative_coords[0]; - xi2_mouse_y = xi2_mouse_y + relative_coords[1]; - prev_rel_coords[0] = relative_coords[0]; - prev_rel_coords[1] = relative_coords[1]; - prev_time = rawev->time; + + prev_time = rawev->time; if (!mouse_capture) break; XWindowAttributes winattrib {}; @@ -128,19 +180,8 @@ xinput2_proc() XWarpPointer(disp, XRootWindow(disp, XScreenNumberOfScreen(winattrib.screen)), XRootWindow(disp, XScreenNumberOfScreen(winattrib.screen)), 0, 0, 0, 0, globalPoint.x(), globalPoint.y()); XFlush(disp); } - } - case XI_Motion: - { - if (XKeysymToKeycode(disp, XK_Home) == 69) { - // No chance we will get raw motion events on VNC. - const XIDeviceEvent *motionev = (const XIDeviceEvent *) cookie->data; - if (xi2_mouse_abs_x != 0 || xi2_mouse_abs_y != 0) { - xi2_mouse_x = xi2_mouse_x + (motionev->event_x - xi2_mouse_abs_x); - xi2_mouse_y = xi2_mouse_y + (motionev->event_y - xi2_mouse_abs_y); - } - xi2_mouse_abs_x = motionev->event_x; - xi2_mouse_abs_y = motionev->event_y; - } + + break; } } }