From 9c1e6939b43e6f182ecb49df83ecd2612c1f5c3e Mon Sep 17 00:00:00 2001 From: cold-brewed Date: Sun, 11 Jun 2023 14:27:14 -0400 Subject: [PATCH 01/24] qt: Fix qt6 warning --- src/qt/qt_mediahistorymanager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qt/qt_mediahistorymanager.cpp b/src/qt/qt_mediahistorymanager.cpp index f71f74fbe..9d003f464 100644 --- a/src/qt/qt_mediahistorymanager.cpp +++ b/src/qt/qt_mediahistorymanager.cpp @@ -66,8 +66,8 @@ MediaHistoryManager::getHistoryListForDeviceIndex(int index, ui::MediaType type) if ((index >= 0) && (index < master_list[type].size())) { return master_list[type][index]; } else { - qWarning("Media device index %i for device type %s was requested but index %i is out of range (valid range: >= 0 && < %i)", - index, mediaTypeToString(type).toUtf8().constData(), index, master_list[type].size()); + qWarning("Media device index %i for device type %s was requested but index %i is out of range (valid range: >= 0 && < %lli)", + index, mediaTypeToString(type).toUtf8().constData(), index, static_cast(master_list[type].size())); } } // Failure gets an empty list @@ -88,8 +88,8 @@ MediaHistoryManager::getImageForSlot(int index, int slot, ui::MediaType type) if ((slot >= 0) && (slot < device_history.size())) { image_name = device_history[slot]; } else { - qWarning("Media history slot %i, index %i for device type %s was requested but slot %i is out of range (valid range: >= 0 && < %i, device_history.size() is %i)", - slot, index, mediaTypeToString(type).toUtf8().constData(), slot, maxDevicesSupported(type), device_history.size()); + qWarning("Media history slot %i, index %i for device type %s was requested but slot %i is out of range (valid range: >= 0 && < %i, device_history.size() is %lli)", + slot, index, mediaTypeToString(type).toUtf8().constData(), slot, maxDevicesSupported(type), static_cast(device_history.size())); } return image_name; } From cb9b72c31b7cd2ed282611727b1ab181f7b2c936 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 14 Jun 2023 22:40:09 +0200 Subject: [PATCH 02/24] Corrected the Flash and keyboard controller of the Shuttle HOT-433A. --- src/machine/m_at_386dx_486.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 7768202da..17e712a8f 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -1593,10 +1593,8 @@ machine_at_hot433_init(const machine_t *model) device_add(&umc_hb4_device); device_add(&umc_8886af_device); device_add(&um8669f_device); - // device_add(&intel_flash_bxt_device); - device_add(&sst_flash_29ee010_device); - // device_add(&keyboard_at_ami_device); - device_add(&keyboard_ps2_ami_device); + device_add(&winbond_flash_w29c010_device); + device_add(&keyboard_at_ami_device); return ret; } From 85938f4c9a13fcc6ea67b1759cb3ab3742c7e610 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 16 Jun 2023 23:28:03 -0300 Subject: [PATCH 03/24] Jenkins: Fix openal-soft AppImage build --- .ci/build.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 432599bd7..a816cd743 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -874,6 +874,11 @@ else cwd_root="$(pwd)" check_buildtag "libs.$arch_deb" + 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 + sed -i -e 's/ C;CXX/ IGNORED/' cmake/flags-gcc.cmake # workaround for dynamic c(xx)flags system overwriting library flags and breaking (at least) openal-soft + sed -i -e 's/_INIT / /g' cmake/flags-gcc.cmake # still append our own flags + if grep -q "OPENAL:BOOL=ON" build/CMakeCache.txt then # Build openal-soft 1.23.1 manually to fix audio issues. This is a temporary @@ -890,7 +895,7 @@ else 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 ALSOFT_UTILS=OFF -D ALSOFT_EXAMPLES=OFF -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 "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 @@ -939,8 +944,6 @@ else rm -rf "$cache_dir/fluidsynth-"* # remove old versions wget -qO - https://github.com/FluidSynth/fluidsynth/archive/refs/tags/v2.3.0.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" fi - 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-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" \ @@ -978,6 +981,7 @@ else -S "$prefix" -B "$prefix_build" || exit 99 cmake --build "$prefix_build" -j$(nproc) || exit 99 cmake --install "$prefix_build" || exit 99 + mv cmake/flags-gcc.cmake.old cmake/flags-gcc.cmake # Archive Discord Game SDK library. From c3717566c7dd53a8ca6547df436465c9cbbfc98e Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 16 Jun 2023 23:36:50 -0300 Subject: [PATCH 04/24] Jenkins: Overhaul the build script's dependency report system to be independent --- .ci/build.sh | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index a816cd743..ab7498368 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -156,7 +156,18 @@ do -p) shift - dep_report=1 + + # Check for lddtree and install it if required. + which lddtree > /dev/null || DEBIAN_FRONTEND=noninteractive sudo apt-get -y install pax-utils + + # Default to main binary. + binary="$1" + [ -z "$binary" ] && binary="archive_tmp/usr/local/bin/$project" + + # Run lddtree with AppImage lib directories included in the search path. + LD_LIBRARY_PATH=$(find "$(pwd)/archive_tmp" -type d -name lib -o -name lib64 | while read dir; do find "$dir" -type d; done | tr '\n' ':') \ + lddtree "$binary" + exit $? ;; -s) @@ -198,6 +209,7 @@ if [ -z "$package_name" -a -z "$tarball_name" ] || [ -n "$package_name" -a -z "$ then echo '[!] Usage: build.sh -b {package_name} {architecture} [-t] [cmake_flags...]' echo ' build.sh -s {source_tarball_name}' + echo 'Dep. tree: build.sh -p [archive_tmp/path/to/binary]' exit 100 fi @@ -316,7 +328,7 @@ then pacman -S --needed --noconfirm "$pkg" done fi - + # Clean pacman cache when running under Jenkins to save disk space. [ "$CI" = "true" ] && rm -rf /var/cache/pacman/pkg @@ -560,7 +572,6 @@ else # Establish general dependencies. pkgs="cmake ninja-build pkg-config git wget p7zip-full extra-cmake-modules wayland-protocols tar gzip file appstream" - [ $dep_report -ne 0 ] && pkgs="$pkgs pax-utils" if [ "$(dpkg --print-architecture)" = "$arch_deb" ] then pkgs="$pkgs build-essential" @@ -569,7 +580,7 @@ else if ! dpkg --print-foreign-architectures | grep -qE '^'"$arch_deb"'$' then sudo dpkg --add-architecture "$arch_deb" - + # Force an apt-get update. save_buildtag aptupdate "arch_$arch_deb" fi @@ -1146,16 +1157,6 @@ EOF # Remove appimage-builder binary on failure, just in case it's corrupted. [ $status -ne 0 ] && rm -f "$appimage_builder_binary" - - # Generate library dependency report if requested. - if [ $dep_report -ne 0 ] - then - echo '[-] Library dependency report:' - - # Run lddtree with AppImage lib directories included in the search path. - LD_LIBRARY_PATH=$(find "$(pwd)/archive_tmp" -type d -name lib -o -name lib64 | while read dir; do find "$dir" -type d; done | tr '\n' ':') \ - lddtree "archive_tmp/usr/local/bin/$project" 2>&1 | tee depreport.txt - fi fi # Check if the archival succeeded. From c8f57660a575f021a18891cf2732b8a5f7ee2c62 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 18 Jun 2023 15:31:04 -0300 Subject: [PATCH 05/24] Jenkins: Trigger openal-soft rebuild --- .ci/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/build.sh b/.ci/build.sh index ab7498368..e425cc65a 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -577,7 +577,7 @@ else pkgs="$pkgs build-essential" else # Add foreign architecture if required. - if ! dpkg --print-foreign-architectures | grep -qE '^'"$arch_deb"'$' + if ! dpkg --print-foreign-architectures | grep -Fx "$arch_deb" then sudo dpkg --add-architecture "$arch_deb" From 1e3154cb74a5b08643e96d8cfed1bcda38f11231 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 18 Jun 2023 23:46:10 +0200 Subject: [PATCH 06/24] Increased the size of the regs array in the Eteq ET6000 code. --- src/chipset/et6000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chipset/et6000.c b/src/chipset/et6000.c index eb42ac7cb..ca011e33c 100644 --- a/src/chipset/et6000.c +++ b/src/chipset/et6000.c @@ -35,7 +35,7 @@ typedef struct { - uint8_t index, regs[6]; + uint8_t index, regs[256]; } et6000_t; #ifdef ENABLE_ET6000_LOG From c183b1da3896d2666a4717b16f9c429cc68fcb66 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 18 Jun 2023 23:51:15 +0200 Subject: [PATCH 07/24] Added a specific NULL check to cdrom/cdrom_image_backend.c to please cppcheck. --- src/cdrom/cdrom_image_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cdrom/cdrom_image_backend.c b/src/cdrom/cdrom_image_backend.c index 1d39e8c82..5d8294213 100644 --- a/src/cdrom/cdrom_image_backend.c +++ b/src/cdrom/cdrom_image_backend.c @@ -768,7 +768,7 @@ cdi_add_track(cd_img_t *cdi, track_t *cur, uint64_t *shift, uint64_t prestart, u } /* First track (track number must be 1). */ - if (cdi->tracks_num == 0) { + if ((prev == NULL) || (cdi->tracks_num == 0)) { /* I guess this makes sure the structure is not filled with invalid data. */ if (cur->number != 1) return 0; From 29fe9b4d1e59b0924afa0606fae767a545b14ba7 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 18 Jun 2023 23:54:25 +0200 Subject: [PATCH 08/24] Added a sanity check to codegen_new/codegen.h. --- src/codegen_new/codegen.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/codegen_new/codegen.h b/src/codegen_new/codegen.h index 607a2e4ee..547f867e3 100644 --- a/src/codegen_new/codegen.h +++ b/src/codegen_new/codegen.h @@ -140,12 +140,16 @@ codeblock_tree_add(codeblock_t *new_block) block = block->right ? &codeblock[block->right] : NULL; } - if (a < old_block_cmp) - old_block->left = get_block_nr(new_block); - else - old_block->right = get_block_nr(new_block); + if (old_block != NULL) { + if (a < old_block_cmp) + old_block->left = get_block_nr(new_block); + else + old_block->right = get_block_nr(new_block); + + new_block->parent = get_block_nr(old_block); + } else + new_block->parent = BLOCK_INVALID; - new_block->parent = get_block_nr(old_block); new_block->left = new_block->right = BLOCK_INVALID; } } From b7c4973549b077228dbc73b8ea5b6cfab69d4ca2 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 18 Jun 2023 23:56:34 +0200 Subject: [PATCH 09/24] Fixed a off by one error in device.c. --- src/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 8c8ede245..2636634c3 100644 --- a/src/device.c +++ b/src/device.c @@ -142,7 +142,7 @@ device_add_common(const device_t *d, const device_t *cd, void *p, void *params, void *priv = NULL; int c; - for (c = 0; c < 256; c++) { + for (c = 0; c <= 256; c++) { if (!inst && (devices[c] == (device_t *) d)) { device_log("DEVICE: device already exists!\n"); return (NULL); From a0e720494940d9e9c629622cb04c8fea112552e6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 18 Jun 2023 23:58:05 +0200 Subject: [PATCH 10/24] And fixed it correctly. --- src/device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c index 2636634c3..a49c7f1e0 100644 --- a/src/device.c +++ b/src/device.c @@ -142,7 +142,7 @@ device_add_common(const device_t *d, const device_t *cd, void *p, void *params, void *priv = NULL; int c; - for (c = 0; c <= 256; c++) { + for (c = 0; c < 256; c++) { if (!inst && (devices[c] == (device_t *) d)) { device_log("DEVICE: device already exists!\n"); return (NULL); @@ -150,8 +150,10 @@ device_add_common(const device_t *d, const device_t *cd, void *p, void *params, if (devices[c] == NULL) break; } - if (c >= DEVICE_MAX) + if ((c >= DEVICE_MAX) || (c >= 256)) { fatal("DEVICE: too many devices\n"); + retrn NULL; + } /* Do this so that a chained device_add will not identify the same ID its master device is already trying to assign. */ From f57f3d883af568fa125026260ebe8af1aae60db9 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 00:01:46 +0200 Subject: [PATCH 11/24] Added a sanity check to hdd_seek_get_time(). --- src/disk/hdd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/disk/hdd.c b/src/disk/hdd.c index c4daf0f83..6135c31d8 100644 --- a/src/disk/hdd.c +++ b/src/disk/hdd.c @@ -161,6 +161,10 @@ hdd_seek_get_time(hard_disk_t *hdd, uint32_t dst_addr, uint8_t operation, uint8_ return HDD_OVERHEAD_TIME; hdd_zone_t *zone = NULL; + if (hdd->num_zones <= 0) { + fatal("hdd_seek_get_time(): hdd->num_zones < 0)\n"); + return 0.0; + } for (int i = 0; i < hdd->num_zones; i++) { zone = &hdd->zones[i]; if (zone->end_sector >= dst_addr) From 5c48f419c0d168dd444ba016833873d69ed63082 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 00:05:46 +0200 Subject: [PATCH 12/24] Fixed variable initialization in network/net_pcnet.c. --- src/network/net_pcnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/net_pcnet.c b/src/network/net_pcnet.c index 17dd506fc..b1ea475ae 100644 --- a/src/network/net_pcnet.c +++ b/src/network/net_pcnet.c @@ -1208,6 +1208,7 @@ pcnetReceiveNoSync(void *priv, uint8_t *buf, int size) uint32_t iRxDesc; int cbPacket; uint8_t buf1[60]; + RMD rmd = { 0 }; if (CSR_DRX(dev) || CSR_STOP(dev) || CSR_SPND(dev) || !size) return 0; @@ -1254,7 +1255,6 @@ pcnetReceiveNoSync(void *priv, uint8_t *buf, int size) iRxDesc = CSR_RCVRL(dev); while (iRxDesc-- > 0) { - RMD rmd; pcnetRmdLoad(dev, &rmd, PHYSADDR(dev, GCPhys), 0); GCPhys += cb; } From 997a068c95ca397a7493ddecfe17eb3bef06ab1f Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 00:07:30 +0200 Subject: [PATCH 13/24] Fixed an off-by-one error in sio/sio_it8661f.c. --- src/sio/sio_it8661f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sio/sio_it8661f.c b/src/sio/sio_it8661f.c index c7d4110be..9b3baa188 100644 --- a/src/sio/sio_it8661f.c +++ b/src/sio/sio_it8661f.c @@ -196,7 +196,7 @@ it8661_ldn(uint16_t addr, uint8_t val, it8661f_t *dev) break; case 1: case 2: - it8661_serial(LDN & 2, addr, val, dev); + it8661_serial((LDN & 2) - 1, addr, val, dev); break; case 3: it8661_lpt(addr, val, dev); From ef0c04ae3ada0ce44a74c155833665437f0f7211 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 00:09:24 +0200 Subject: [PATCH 14/24] Fixed a memory leak in sound/snd_ac97_codec.c. --- src/sound/snd_ac97_codec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sound/snd_ac97_codec.c b/src/sound/snd_ac97_codec.c index 51bc6bd2b..464e86f77 100644 --- a/src/sound/snd_ac97_codec.c +++ b/src/sound/snd_ac97_codec.c @@ -587,6 +587,7 @@ ac97_codec_init(const device_t *info) /* Associate this codec to the current controller. */ if (!ac97_codec || (ac97_codec_count <= 0)) { pclog("AC97 Codec %d: No controller to associate codec\n", ac97_codec_id); + free(dev); return NULL; } *ac97_codec = dev; From eb677b3d5a82bb13d06bf09b1f1e68c8bd6bf3c4 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 00:11:03 +0200 Subject: [PATCH 15/24] Fixed array out of bound accesses in video/vid_herculesplus.c. --- src/video/vid_herculesplus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/vid_herculesplus.c b/src/video/vid_herculesplus.c index 95d38f1c3..a5422fbc1 100644 --- a/src/video/vid_herculesplus.c +++ b/src/video/vid_herculesplus.c @@ -327,7 +327,7 @@ draw_char_ram4(herculesplus_t *dev, int x, uint8_t chr, uint8_t attr) if ((attr & 0x77) == 0) cfg = ibg; /* 'blank' attribute */ - buffer32->line[dev->displine][x * cw + i] = dev->cols[attr][blink][cfg]; + buffer32->line[dev->displine][x * cw + i] = dev->cols[attr][!!blink][cfg]; val = val << 1; } } @@ -423,7 +423,7 @@ draw_char_ram48(herculesplus_t *dev, int x, uint8_t chr, uint8_t attr) else cfg |= ibg; - buffer32->line[dev->displine][(x * cw) + i] = dev->cols[attr][blink][cfg]; + buffer32->line[dev->displine][(x * cw) + i] = dev->cols[attr][!!blink][cfg]; val = val << 1; } } From 95c900a5dc7e820b20e197ffef4f03d832248c49 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 00:12:19 +0200 Subject: [PATCH 16/24] Fixed off-by-one error in video/vid_ics2494.c. --- src/video/vid_ics2494.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/vid_ics2494.c b/src/video/vid_ics2494.c index 8bb4b0cb8..99a877a75 100644 --- a/src/video/vid_ics2494.c +++ b/src/video/vid_ics2494.c @@ -53,8 +53,8 @@ ics2494_getclock(int clock, void *p) { ics2494_t *ics2494 = (ics2494_t *) p; - if (clock > 16) - clock = 16; + if (clock > 15) + clock = 15; return ics2494->freq[clock]; } From c779956048fc544c3c236b2d8162325107de58e4 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 01:10:15 +0200 Subject: [PATCH 17/24] Fixed a compile-breaking mistake in src/device.c. --- src/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index a49c7f1e0..7d8f5e88e 100644 --- a/src/device.c +++ b/src/device.c @@ -152,7 +152,7 @@ device_add_common(const device_t *d, const device_t *cd, void *p, void *params, } if ((c >= DEVICE_MAX) || (c >= 256)) { fatal("DEVICE: too many devices\n"); - retrn NULL; + return NULL; } /* Do this so that a chained device_add will not identify the same ID From 98b4c1c309f8773ff3a5fa032d260c32e7f6fda2 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 01:27:44 +0200 Subject: [PATCH 18/24] Fixed the TriGem 486G so it is no longer hardcoded to the Paradise VGA BIOS. --- src/machine/m_at_386dx_486.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 17e712a8f..deaa540c4 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -1788,17 +1788,13 @@ machine_at_tg486gp_init(const machine_t *model) int machine_at_tg486g_init(const machine_t *model) { - int ret; + int ret, i; ret = bios_load_linear("roms/machines/tg486g/tg486g.bin", 0x000c0000, 262144, 0); if (bios_only || !ret) return ret; - else { - mem_mapping_set_addr(&bios_mapping, 0x0c0000, 0x40000); - mem_mapping_set_exec(&bios_mapping, rom); - } machine_at_common_init(model); device_add(&sis_85c471_device); @@ -1806,5 +1802,12 @@ machine_at_tg486g_init(const machine_t *model) device_add(&fdc37c651_ide_device); device_add(&keyboard_ps2_tg_ami_pci_device); + if (gfxcard[0] != VID_INTERNAL) { + for (i = 0; i < 32768; i++) + rom[i] = mem_readb_phys(0x000c0000 + i); + } + mem_mapping_set_addr(&bios_mapping, 0x0c0000, 0x40000); + mem_mapping_set_exec(&bios_mapping, rom); + return ret; } From a312c101292abd7c144739a8e869489419c0d218 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 01:35:30 +0200 Subject: [PATCH 19/24] Disabled excess logging in chipset/ali1429.c. --- src/chipset/ali1429.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chipset/ali1429.c b/src/chipset/ali1429.c index 138c7db93..e245603a9 100644 --- a/src/chipset/ali1429.c +++ b/src/chipset/ali1429.c @@ -166,7 +166,7 @@ ali1429_write(uint16_t addr, uint8_t val, void *priv) dev->cfg_locked = (val != 0xc5); if (!dev->cfg_locked) { - pclog("M1429: dev->regs[%02x] = %02x\n", dev->index, val); + ali1429_log("M1429: dev->regs[%02x] = %02x\n", dev->index, val); /* Common M1429 Registers */ switch (dev->index) { From 8b559f12712db0c66faabd8273f7ccabf6688978 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 19 Jun 2023 01:59:33 +0200 Subject: [PATCH 20/24] Fixed Y polarity in the MM Series packet format on the Logitech Serial Mouse. --- src/device/mouse_serial.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/device/mouse_serial.c b/src/device/mouse_serial.c index 58183e1df..37dc6b4a0 100644 --- a/src/device/mouse_serial.c +++ b/src/device/mouse_serial.c @@ -214,13 +214,14 @@ sermouse_data_mmseries(mouse_t *dev, int x, int y, int b) dev->data[0] = 0x80; if (x >= 0) dev->data[0] |= 0x10; - if (y >= 0) + /* It appears we have inverted Y polarity. */ + if (y < 0) dev->data[0] |= 0x08; dev->data[0] |= (b & 0x01) ? 0x04 : 0x00; /* left button */ dev->data[0] |= (b & 0x04) ? 0x02 : 0x00; /* middle button */ dev->data[0] |= (b & 0x02) ? 0x01 : 0x00; /* right button */ - dev->data[1] = abs(x); - dev->data[2] = abs(y); + dev->data[1] = abs(x) & 0x7f; + dev->data[2] = abs(y) & 0x7f; return 3; } From 00463a699185f14b6b6082718ab337df0907b44e Mon Sep 17 00:00:00 2001 From: cold-brewed Date: Mon, 19 Jun 2023 12:18:14 -0400 Subject: [PATCH 21/24] config: Fix loading of pcap network device --- src/config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config.c b/src/config.c index 4bcbaf7fa..3a66bc01d 100644 --- a/src/config.c +++ b/src/config.c @@ -866,6 +866,8 @@ load_network(void) ui_msgbox_header(MBX_ERROR, (wchar_t *) IDS_2096, (wchar_t *) IDS_2130); } strcpy(net_cards_conf[c].host_dev_name, "none"); + } else { + strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1); } } else { strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1); From 57c49d94f437040ebd13dcc01ddb8640ec9d7237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=99=E6=B2=99=E5=AE=AE=E7=B4=97=E5=A4=9C?= <117635969+kzmidze@users.noreply.github.com> Date: Tue, 20 Jun 2023 14:55:13 +0800 Subject: [PATCH 22/24] Update zh-TW.rc --- src/win/languages/zh-TW.rc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/win/languages/zh-TW.rc b/src/win/languages/zh-TW.rc index 1adf0c4ca..76d40d828 100644 --- a/src/win/languages/zh-TW.rc +++ b/src/win/languages/zh-TW.rc @@ -266,7 +266,7 @@ END #define STR_MACHINE_TYPE "機器類型:" #define STR_MACHINE "機型:" -#define STR_CONFIGURE "配置" +#define STR_CONFIGURE "設定" #define STR_CPU_TYPE "CPU 類型:" #define STR_CPU_SPEED "速度:" #define STR_FPU "浮點處理器 (FPU):" @@ -402,7 +402,7 @@ BEGIN IDS_2053 "速度" IDS_2054 "ZIP %03i %i (%s): %ls" IDS_2055 "ZIP 映像 (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0" - IDS_2056 "86Box 找不到任何可用的 ROM 映像。\n\n請下載ROM 包並將其解壓到 ""roms"" 資料夾。" + IDS_2056 "86Box 找不到任何可用的 ROM 映像。\n\n請下載 ROM 套件並將其解壓到 ""roms"" 資料夾。" IDS_2057 "(空)" IDS_2058 "ZIP 映像 (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0所有檔案 (*.*)\0*.*\0" IDS_2059 "加速" @@ -491,7 +491,7 @@ BEGIN #define LIB_NAME_PCAP "libpcap" #endif IDS_2130 "請確認 " LIB_NAME_PCAP " 已安裝且使用相容 " LIB_NAME_PCAP " 的網路連線。" - IDS_2131 "無效配置" + IDS_2131 "無效設定" #ifdef _WIN32 #define LIB_NAME_FREETYPE "freetype.dll" #else @@ -517,11 +517,11 @@ BEGIN IDS_2139 "不重設" IDS_2140 "磁光碟映像 (*.IM?;*.MDI)\0*.IM?;*.MDI\0所有檔案 (*.*)\0*.*\0" IDS_2141 "光碟映像 (*.ISO;*.CUE)\0*.ISO;*.CUE\0所有檔案 (*.*)\0*.*\0" - IDS_2142 "%hs 裝置配置" + IDS_2142 "%hs 裝置設定" IDS_2143 "顯示器處在睡眠狀態" IDS_2144 "OpenGL 著色器 (*.GLSL)\0*.GLSL\0所有檔案 (*.*)\0*.*\0" IDS_2145 "OpenGL 選項" - IDS_2146 "正在載入一個不受支援的配置" + IDS_2146 "正在載入一個不受支援的設定" IDS_2147 "此模擬電腦禁用了基於選定電腦的 CPU 類型過濾。\n\n能夠選中與所選機器本不相容的 CPU,但是可能會遇到與機器 BIOS 或其他軟體不相容的問題。\n\n啟用此設定不受官方支援,並且提交的任何錯誤報告可能會視為無效而關閉。" IDS_2148 "繼續" IDS_2149 "磁帶: %s" @@ -554,8 +554,8 @@ BEGIN IDS_4099 "不存在 MFM/RLL 或 ESDI CD-ROM 光碟機" IDS_4100 "自訂..." IDS_4101 "自訂 (大容量)..." - IDS_4102 "添加新硬碟" - IDS_4103 "添加已存在的硬碟" + IDS_4102 "增加新硬碟" + IDS_4103 "增加已存在的硬碟" IDS_4104 "HDI 磁碟映像不能超過 4 GB。" IDS_4105 "磁碟映像不能超過 127 GB。" IDS_4106 "硬碟映像 (*.HD?;*.IM?;*.VHD)\0*.HD?;*.IM?;*.VHD\0所有檔案 (*.*)\0*.*\0" From 1633ea464556f5cf8bb72ec6c6da2b30e85ffdc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=99=E6=B2=99=E5=AE=AE=E7=B4=97=E5=A4=9C?= <117635969+kzmidze@users.noreply.github.com> Date: Tue, 20 Jun 2023 20:50:13 +0800 Subject: [PATCH 23/24] Update zh-TW.po --- src/qt/languages/zh-TW.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qt/languages/zh-TW.po b/src/qt/languages/zh-TW.po index e1acd1fbc..f1bbfffd9 100644 --- a/src/qt/languages/zh-TW.po +++ b/src/qt/languages/zh-TW.po @@ -341,7 +341,7 @@ msgid "Machine:" msgstr "機型:" msgid "Configure" -msgstr "配置" +msgstr "設定" msgid "CPU type:" msgstr "CPU 類型:" @@ -650,7 +650,7 @@ msgid "ZIP images" msgstr "ZIP 映像" msgid "86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory." -msgstr "86Box 找不到任何可用的 ROM 映像。\n\n請下載ROM 包並將其解壓到 \"roms\" 資料夾。" +msgstr "86Box 找不到任何可用的 ROM 映像。\n\n請下載 ROM 套件並將其解壓到 \"roms\" 資料夾。" msgid "(empty)" msgstr "(空)" @@ -875,7 +875,7 @@ msgid "Make sure libpcap is installed and that you are on a libpcap-compatible n msgstr "請確認 libpcap 已安裝且使用相容 libpcap 的網路連線。" msgid "Invalid configuration" -msgstr "無效配置" +msgstr "無效設定" msgid "freetype.dll" msgstr "freetype.dll" @@ -923,7 +923,7 @@ msgid "CD-ROM images" msgstr "光碟映像" msgid "%hs Device Configuration" -msgstr "%hs 裝置配置" +msgstr "%hs 裝置設定" msgid "Monitor in sleep mode" msgstr "顯示器處在睡眠狀態" @@ -935,7 +935,7 @@ msgid "OpenGL options" msgstr "OpenGL 選項" msgid "You are loading an unsupported configuration" -msgstr "正在載入一個不受支援的配置" +msgstr "正在載入一個不受支援的設定" msgid "CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid." msgstr "此模擬電腦禁用了基於選定電腦的 CPU 類型過濾。\n\n能夠選中與所選機器本不相容的 CPU,但是可能會遇到與機器 BIOS 或其他軟體不相容的問題。\n\n啟用此設定不受官方支援,並且提交的任何錯誤報告可能會視為無效而關閉。" @@ -998,10 +998,10 @@ msgid "Custom (large)..." msgstr "自訂 (大容量)..." msgid "Add New Hard Disk" -msgstr "添加新硬碟" +msgstr "增加新硬碟" msgid "Add Existing Hard Disk" -msgstr "添加已存在的硬碟" +msgstr "增加已存在的硬碟" msgid "HDI disk images cannot be larger than 4 GB." msgstr "HDI 磁碟映像不能超過 4 GB。" From 2fe3bcd5d289e536dd288ded890fe3149e44729f Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 25 Jun 2023 22:20:11 +0200 Subject: [PATCH 24/24] Do the wraparounds properly on 64-bit binaries, fixes #3421. --- src/cpu/386_common.h | 41 +++++++++++++++++++++++++++++++++++++++++ src/mem/mem.c | 8 ++++++++ 2 files changed, 49 insertions(+) diff --git a/src/cpu/386_common.h b/src/cpu/386_common.h index 8b7fbbbd0..8cad28ae7 100644 --- a/src/cpu/386_common.h +++ b/src/cpu/386_common.h @@ -20,6 +20,7 @@ #define _386_COMMON_H_ #include + #include #define readmemb_n(s, a, b) ((readlookup2[(uint32_t) ((s) + (a)) >> 12] == (uintptr_t) LOOKUP_INV || (s) == 0xFFFFFFFF) ? readmembl_no_mmut((s) + (a), b) : *(uint8_t *) (readlookup2[(uint32_t) ((s) + (a)) >> 12] + (uintptr_t) ((s) + (a)))) #define readmemw_n(s, a, b) ((readlookup2[(uint32_t) ((s) + (a)) >> 12] == (uintptr_t) LOOKUP_INV || (s) == 0xFFFFFFFF || (((s) + (a)) & 1)) ? readmemwl_no_mmut((s) + (a), b) : *(uint16_t *) (readlookup2[(uint32_t) ((s) + (a)) >> 12] + (uint32_t) ((s) + (a)))) @@ -196,13 +197,21 @@ fastreadb(uint32_t a) uint8_t *t; if ((a >> 12) == pccache) +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return *((uint8_t *) (((uintptr_t) &pccache2[a] & 0x00000000ffffffffULL) | ((uintptr_t) &pccache2[0] & 0xffffffff00000000ULL))); +#else return *((uint8_t *) &pccache2[a]); +#endif t = getpccache(a); if (cpu_state.abrt) return 0; pccache = a >> 12; pccache2 = t; +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return *((uint8_t *) (((uintptr_t) &pccache2[a] & 0x00000000ffffffffULL) | ((uintptr_t) &pccache2[0] & 0xffffffff00000000ULL))); +#else return *((uint8_t *) &pccache2[a]); +#endif } static __inline uint16_t @@ -216,14 +225,22 @@ fastreadw(uint32_t a) return val; } if ((a >> 12) == pccache) +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return *((uint16_t *) (((uintptr_t) &pccache2[a] & 0x00000000ffffffffULL) | ((uintptr_t) &pccache2[0] & 0xffffffff00000000ULL))); +#else return *((uint16_t *) &pccache2[a]); +#endif t = getpccache(a); if (cpu_state.abrt) return 0; pccache = a >> 12; pccache2 = t; +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return *((uint16_t *) (((uintptr_t) &pccache2[a] & 0x00000000ffffffffULL) | ((uintptr_t) &pccache2[0] & 0xffffffff00000000ULL))); +#else return *((uint16_t *) &pccache2[a]); +#endif } static __inline uint32_t @@ -239,7 +256,11 @@ fastreadl(uint32_t a) pccache2 = t; pccache = a >> 12; } +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return *((uint32_t *) (((uintptr_t) &pccache2[a] & 0x00000000ffffffffULL) | ((uintptr_t) &pccache2[0] & 0xffffffff00000000ULL))); +#else return *((uint32_t *) &pccache2[a]); +#endif } val = fastreadw(a); val |= (fastreadw(a + 2) << 16); @@ -250,10 +271,18 @@ static __inline void * get_ram_ptr(uint32_t a) { if ((a >> 12) == pccache) +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return (void *) (((uintptr_t) &pccache2[a] & 0x00000000ffffffffULL) | ((uintptr_t) &pccache2[0] & 0xffffffff00000000ULL)); +#else return &pccache2[a]; +#endif else { uint8_t *t = getpccache(a); +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return (void *) (((uintptr_t) &t[a] & 0x00000000ffffffffULL) | ((uintptr_t) &t[0] & 0xffffffff00000000ULL)); +#else return &t[a]; +#endif } } @@ -271,14 +300,22 @@ fastreadw_fetch(uint32_t a) return val; } if ((a >> 12) == pccache) +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return *((uint16_t *) (((uintptr_t) &pccache2[a] & 0x00000000ffffffffULL) | ((uintptr_t) &pccache2[0] & 0xffffffff00000000ULL))); +#else return *((uint16_t *) &pccache2[a]); +#endif t = getpccache(a); if (cpu_state.abrt) return 0; pccache = a >> 12; pccache2 = t; +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return *((uint16_t *) (((uintptr_t) &pccache2[a] & 0x00000000ffffffffULL) | ((uintptr_t) &pccache2[0] & 0xffffffff00000000ULL))); +#else return *((uint16_t *) &pccache2[a]); +#endif } static __inline uint32_t @@ -294,7 +331,11 @@ fastreadl_fetch(uint32_t a) pccache2 = t; pccache = a >> 12; } +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + return *((uint32_t *) (((uintptr_t) &pccache2[a] & 0x00000000ffffffffULL) | ((uintptr_t) &pccache2[0] & 0xffffffff00000000ULL))); +#else return *((uint32_t *) &pccache2[a]); +#endif } val = fastreadw_fetch(a); if (opcode_length[val & 0xff] > 2) diff --git a/src/mem/mem.c b/src/mem/mem.c index 98acd8c97..3008e658c 100644 --- a/src/mem/mem.c +++ b/src/mem/mem.c @@ -657,6 +657,9 @@ uint8_t * getpccache(uint32_t a) { uint64_t a64 = (uint64_t) a; +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + uint8_t *p; +#endif uint32_t a2; a2 = a; @@ -677,7 +680,12 @@ getpccache(uint32_t a) cpu_prefetch_cycles = cpu_mem_prefetch_cycles; } +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) + p = &_mem_exec[a64 >> MEM_GRANULARITY_BITS][(uintptr_t) (a64 & MEM_GRANULARITY_PAGE) - (uintptr_t) (a2 & ~0xfff)]; + return (uint8_t *) (((uintptr_t) p & 0x00000000ffffffffULL) | ((uintptr_t) &_mem_exec[a64 >> MEM_GRANULARITY_BITS][0] & 0xffffffff00000000ULL)); +#else return &_mem_exec[a64 >> MEM_GRANULARITY_BITS][(uintptr_t) (a64 & MEM_GRANULARITY_PAGE) - (uintptr_t) (a2 & ~0xfff)]; +#endif } mem_log("Bad getpccache %08X%08X\n", (uint32_t) (a64 >> 32), (uint32_t) (a64 & 0xffffffffULL));