Merge remote-tracking branch 'upstream/master' into feature/ich2

This commit is contained in:
Jasmine Iwanek
2023-06-24 08:09:55 -04:00
16 changed files with 69 additions and 49 deletions

View File

@@ -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,16 +572,15 @@ 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"
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"
# Force an apt-get update.
save_buildtag aptupdate "arch_$arch_deb"
fi
@@ -874,6 +885,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 +906,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 +955,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 +992,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.
@@ -1142,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.

View File

@@ -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;

View File

@@ -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) {

View File

@@ -35,7 +35,7 @@
typedef struct
{
uint8_t index, regs[6];
uint8_t index, regs[256];
} et6000_t;
#ifdef ENABLE_ET6000_LOG

View File

@@ -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;
}
}

View File

@@ -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);

View File

@@ -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");
return NULL;
}
/* Do this so that a chained device_add will not identify the same ID
its master device is already trying to assign. */

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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;
}
@@ -1790,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);
@@ -1808,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;
}

View File

@@ -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;
}

View File

@@ -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<long long>(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<long long>(device_history.size()));
}
return image_name;
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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];
}