From a34dc15dc0a786461fd79d00b61f63372b6c9f23 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 30 Jan 2023 13:56:55 -0300 Subject: [PATCH 1/7] 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 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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);