Merge branch '86Box:master' into nec-v20

This commit is contained in:
Jasmine Iwanek
2022-03-18 15:05:25 -04:00
committed by GitHub
50 changed files with 4314 additions and 494 deletions

View File

@@ -51,45 +51,26 @@ AppDir:
- libsndio7.0
- libwayland-client0
- libx11-6
- libx11-xcb1
- libxcb1
- libxcb-render0
- libxcb-shape0
- libxcb-shm0
- libxcb-xfixes0
- zlib1g
files:
exclude:
- etc
- lib/udev
- opt/libc/usr/share
- usr/bin
- usr/include
- usr/[a-km-rt-zA-Z]*
- usr/lib/*/libasound.so.*
- usr/lib/*.a
- usr/lib/cmake
- usr/lib/pkgconfig
- usr/sbin
- usr/share/aclocal
- usr/share/alsa
- usr/share/apport
- usr/share/bug
- usr/share/color
- usr/share/doc
- usr/share/doc-base
- usr/share/fontconfig
- usr/share/fonts
- usr/share/ghostscript
- usr/share/glib-2.0
- usr/share/info
- usr/share/libinput
- usr/share/libwacom
- usr/share/lintian
- usr/share/locale
- usr/share/man
- usr/share/metainfo
- usr/share/openal
- usr/share/pkgconfig
- usr/share/poppler
- usr/share/readline
- usr/share/rtmidi
- usr/share/sounds
- usr/share/X11
- usr/share/xml
- usr/s[a-gi-zA-Z]*
- usr/share/[a-hj-zA-Z]*
- usr/share/i[a-bd-zA-Z]*
- var
AppImage:
arch: !ENV '${arch_appimage}'

144
.ci/Jenkinsfile vendored
View File

@@ -12,7 +12,7 @@
*
* Authors: RichardG, <richardg867@gmail.com>
*
* Copyright 2021 RichardG.
* Copyright 2021-2022 RichardG.
*/
def repository = 'https://github.com/86Box/86Box.git'
@@ -84,8 +84,6 @@ def presetFlags = [
'Dev': '--preset=experimental -D CMAKE_BUILD_TYPE=Debug -D VNC=OFF'
]
def anyFailure = false
def gitClone(repository, branch) {
/* Clean workspace. */
cleanWs()
@@ -105,9 +103,9 @@ def gitClone(repository, branch) {
} else if (env.GIT_COMMIT != scmVars.GIT_COMMIT) {
/* Checkout the commit read from the polling log. */
if (isUnix())
sh "git checkout ${env.GIT_COMMIT} || exit 0"
sh returnStatus: true, script: "git checkout ${env.GIT_COMMIT}"
else
bat "git checkout ${env.GIT_COMMIT} || exit /b 0"
bat returnStatus: true, script: "git checkout ${env.GIT_COMMIT}"
}
println "[-] Using git commit [${env.GIT_COMMIT}]"
@@ -122,16 +120,23 @@ def gitClone(repository, branch) {
def removeDir(dir) {
if (isUnix())
sh "rm -rf \"$dir\" || exit 0"
return sh(returnStatus: true, script: "rm -rf \"$dir\"")
else
bat "if exist \"$dir\" rd /s /q \"$dir\" & exit /b 0"
return bat(returnStatus: true, script: "rd /s /q \"$dir\"")
}
def runBuild(args) {
if (isUnix())
sh "chmod u+x \"$WORKSPACE/.ci/build.sh\" && exec \"$WORKSPACE/.ci/build.sh\" $args"
return sh(returnStatus: true, script: "chmod u+x \"$WORKSPACE/.ci/build.sh\" && exec \"$WORKSPACE/.ci/build.sh\" $args")
else
bat "C:\\msys64\\msys2_shell.cmd -msys2 -defterm -here -no-start -c 'exec \"\$(cygpath -u \\'%WORKSPACE%\\')/.ci/build.sh\" $args'"
return bat(returnStatus: true, script: "C:\\msys64\\msys2_shell.cmd -msys2 -defterm -here -no-start -c 'exec \"\$(cygpath -u \\'%WORKSPACE%\\')/.ci/build.sh\" $args'")
}
def failStage() {
/* Force this stage to fail. */
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
def x = 1 / 0
}
}
pipeline {
@@ -142,7 +147,6 @@ pipeline {
}
options {
disableConcurrentBuilds()
quietPeriod(0)
}
@@ -155,6 +159,7 @@ pipeline {
stages {
stage('Source Tarball') {
agent none
failFast false
steps {
script {
@@ -178,78 +183,84 @@ pipeline {
/* Adding to the above, run a git clone as soon as possible on any node
to further avoid race conditions caused by busy node executor delays. */
node('!Windows') {
/* Run git clone. */
gitClone(repository, branch)
/* Clean workspace, in case this is running in a non-build node. */
cleanWs()
}
/* Create source tarball. */
node('Linux') {
try {
retry(10) {
node('citadel && !Windows') {
/* Run git clone. */
gitClone(repository, branch)
/* Switch to temp directory. */
dir("${env.WORKSPACE_TMP}/output") {
/* Run source tarball creation process. */
def packageName = "${env.JOB_BASE_NAME}-Source-b${env.BUILD_NUMBER}"
runBuild("-s \"$packageName\"")
/* Clean workspace, in case this is running in a non-build node. */
cleanWs()
}
}
/* Archive resulting artifacts. */
archiveArtifacts artifacts: "$packageName*"
}
/* Create source tarball. */
try {
retry(10) {
node('Linux') {
/* Run git clone. */
gitClone(repository, branch)
/* Clean up. */
removeDir("${env.WORKSPACE_TMP}/output")
} catch (e) {
/* Mark that a failure occurred. */
anyFailure = true
/* Switch to temp directory. */
dir("${env.WORKSPACE_TMP}/output") {
/* Run source tarball creation process. */
def packageName = "${env.JOB_BASE_NAME}-Source-b${env.BUILD_NUMBER}"
if (runBuild("-s \"$packageName\"") == 0) {
/* Archive resulting artifacts. */
archiveArtifacts artifacts: "$packageName*"
} else {
/* Fail this stage. */
failStage()
}
}
/* Force this stage to fail. */
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
throw e;
/* Clean up. */
removeDir("${env.WORKSPACE_TMP}/output")
}
}
} catch (e) {
/* Fail this stage. */
failStage()
}
/* Build here to avoid creating a redundant parent stage on the stage view. */
osArchs.each { os, thisOsArchs ->
def combinations = [:]
thisOsArchs.each { arch ->
def thisArchDynarecs = dynarecArchs[arch]
if (!thisArchDynarecs)
thisArchDynarecs = ['NoDR']
thisArchDynarecs.each { dynarec ->
presets.each { preset ->
node(os) {
stage("$os $arch $dynarec $preset") {
try {
/* Run git clone. */
gitClone(repository, branch)
def combination = "$os $arch $dynarec $preset"
combinations[combination] = {
catchError(buildResult: 'FAILURE', stageResult: 'SUCCESS') {
retry(10) {
node(os) {
stage(combination) {
/* Run git clone. */
gitClone(repository, branch)
/* Switch to output directory. */
dir("${env.WORKSPACE_TMP}/output") {
/* Run build process. */
def packageName = "${env.JOB_BASE_NAME}${dynarecSlugs[dynarec]}${presetSlugs[preset]}-$os-$arch-b${env.BUILD_NUMBER}"
dir("${dynarecNames[dynarec]}/$os - ${archNames[arch]}") {
runBuild("-b \"$packageName\" \"$arch\" ${presetFlags[preset]} ${dynarecFlags[dynarec]} ${osFlags[os]} -D \"BUILD_TYPE=$BUILD_TYPE\" -D \"EMU_BUILD=build ${env.BUILD_NUMBER}\" -D \"EMU_BUILD_NUM=${env.BUILD_NUMBER}\"")
/* Switch to output directory. */
dir("${env.WORKSPACE_TMP}/output") {
/* Run build process. */
def packageName = "${env.JOB_BASE_NAME}${dynarecSlugs[dynarec]}${presetSlugs[preset]}-$os-$arch-b${env.BUILD_NUMBER}"
def ret = -1
dir("${dynarecNames[dynarec]}/$os - ${archNames[arch]}") {
ret = runBuild("-b \"$packageName\" \"$arch\" ${presetFlags[preset]} ${dynarecFlags[dynarec]} ${osFlags[os]} -D \"BUILD_TYPE=$BUILD_TYPE\" -D \"EMU_BUILD=build ${env.BUILD_NUMBER}\" -D \"EMU_BUILD_NUM=${env.BUILD_NUMBER}\"")
}
if (ret == 0) {
/* Archive resulting artifacts. */
archiveArtifacts artifacts: "**/**/$packageName*"
} else {
/* Fail this stage. */
failStage()
}
}
/* Clean up. */
removeDir("${env.WORKSPACE_TMP}/output")
}
/* Archive resulting artifacts. */
archiveArtifacts artifacts: "**/**/$packageName*"
}
/* Clean up. */
removeDir("${env.WORKSPACE_TMP}/output")
} catch (e) {
/* Mark that a failure occurred. */
anyFailure = true
/* Force this stage to fail. */
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
throw e;
}
}
}
@@ -257,6 +268,7 @@ pipeline {
}
}
}
parallel combinations
}
}
}
@@ -266,12 +278,6 @@ pipeline {
post {
always {
script {
/* Mark build as failed if any step has failed. */
if (anyFailure) {
println "[!] Failing build because a build stage failed"
currentBuild.result = 'FAILURE'
}
/* Send out build notifications. */
if (!env.JOB_BASE_NAME.contains('TestBuildPleaseIgnore')) {
try {
@@ -287,7 +293,7 @@ pipeline {
scmWebUrl: commitBrowser
/* Notify IRC, which needs a node for whatever reason. */
node {
node('citadel') {
ircNotify()
}
} catch (e) {

View File

@@ -34,7 +34,7 @@
#
# Define common functions.
alias is_windows='[ ! -z "$MSYSTEM" ]'
alias is_windows='[ -n "$MSYSTEM" ]'
alias is_mac='uname -s | grep -q Darwin'
make_tar() {
@@ -62,7 +62,7 @@ make_tar() {
fi
# Make tar verbose if requested.
[ ! -z "$VERBOSE" ] && local compression_flag="$compression_flag -v"
[ -n "$VERBOSE" ] && local compression_flag="$compression_flag -v"
# tar is notorious for having many diverging implementations. For instance,
# the flags we use to strip UID/GID metadata can be --owner/group (GNU),
@@ -136,7 +136,7 @@ done
cmake_flags_extra=
# Check if mandatory arguments were specified.
if [ -z "$package_name" -a -z "$tarball_name" ] || [ ! -z "$package_name" -a -z "$arch" ]
if [ -z "$package_name" -a -z "$tarball_name" ] || [ -n "$package_name" -a -z "$arch" ]
then
echo '[!] Usage: build.sh -b {package_name} {architecture} [-t] [cmake_flags...]'
echo ' build.sh -s {source_tarball_name}'
@@ -147,7 +147,7 @@ fi
cd "$(dirname "$0")/.."
# Make source tarball if requested.
if [ ! -z "$tarball_name" ]
if [ -n "$tarball_name" ]
then
echo [-] Making source tarball [$tarball_name]
@@ -211,6 +211,107 @@ then
fi
echo [-] Using MSYSTEM [$MSYSTEM]
# Update keyring, as the package signing keys sometimes change.
echo [-] Updating package databases and keyring
yes | pacman -Sy --needed msys2-keyring
# Query installed packages.
pacman -Qe > pacman.txt
# Download the specified versions of architecture-specific dependencies.
echo -n [-] Downloading dependencies:
pkg_dir="/var/cache/pacman/pkg"
repo_base="https://repo.msys2.org/mingw/$(echo $MSYSTEM | tr '[:upper:]' '[:lower:]')"
cat .ci/dependencies_msys.txt | tr -d '\r' > deps.txt
pkgs=""
while IFS=" " read pkg version
do
prefixed_pkg="$MINGW_PACKAGE_PREFIX-$pkg"
installed_version=$(grep -E "^$prefixed_pkg " pacman.txt | cut -d " " -f 2)
if [ "$installed_version" != "$version" ] # installed_version will be empty if not installed
then
echo -n " [$pkg"
# Download package if not already present in the local cache.
pkg_tar="$prefixed_pkg-$version-any.pkg.tar"
if [ -s "$pkg_dir/$pkg_tar.xz" ]
then
pkg_fn="$pkg_tar.xz"
pkg_dest="$pkg_dir/$pkg_fn"
else
pkg_fn="$pkg_tar.zst"
pkg_dest="$pkg_dir/$pkg_fn"
if [ ! -s "$pkg_dest" ]
then
if ! wget -qO "$pkg_dest" "$repo_base/$pkg_fn"
then
rm -f "$pkg_dest"
pkg_fn="$pkg_tar.xz"
pkg_dest="$pkg_dir/$pkg_fn"
wget -qO "$pkg_dest" "$repo_base/$pkg_fn" || rm -f "$pkg_dest"
fi
if [ -s "$pkg_dest" ]
then
wget -qO "$pkg_dest.sig" "$repo_base/$pkg_fn.sig" || rm -f "$pkg_dest.sig"
[ ! -s "$pkg_dest.sig" ] && rm -f "$pkg_dest.sig"
fi
fi
fi
# Check if the cached package is valid.
if [ -s "$pkg_dest" ]
then
# Add cached zst package.
pkgs="$pkgs $pkg_fn"
else
# Not valid, remove if it exists.
rm -f "$pkg_dest" "$pkg_dest.sig"
echo -n " FAIL"
fi
echo -n "]"
fi
done < deps.txt
[ -z "$pkgs" ] && echo -n ' none required'
echo
# Install the downloaded architecture-specific dependencies.
echo [-] Installing dependencies through pacman
if [ -n "$pkgs" ]
then
pushd "$pkg_dir"
yes | pacman -U --needed $pkgs
if [ $? -ne 0 ]
then
# Install packages individually if installing them all together failed.
for pkg in $pkgs
do
yes | pacman -U --needed "$pkg"
done
fi
popd
# Query installed packages again.
pacman -Qe > pacman.txt
fi
# Install the latest versions for any missing packages (if the specified version couldn't be installed).
pkgs="make git"
while IFS=" " read pkg version
do
prefixed_pkg="$MINGW_PACKAGE_PREFIX-$pkg"
grep -qE "^$prefixed_pkg " pacman.txt || pkgs="$pkgs $prefixed_pkg"
done < deps.txt
rm -f pacman.txt deps.txt
yes | pacman -S --needed $pkgs
if [ $? -ne 0 ]
then
# Install packages individually if installing them all together failed.
for pkg in $pkgs
do
yes | pacman -S --needed "$pkg"
done
fi
# Point CMake to the toolchain file.
cmake_flags_extra="$cmake_flags_extra -D \"CMAKE_TOOLCHAIN_FILE=cmake/$toolchain.cmake\""
elif is_mac
@@ -227,7 +328,7 @@ else
esac
# Establish general dependencies.
pkgs="cmake pkg-config git imagemagick wget p7zip-full wayland-protocols tar gzip"
pkgs="cmake pkg-config git imagemagick wget p7zip-full wayland-protocols tar gzip file"
if [ "$(dpkg --print-architecture)" = "$arch_deb" ]
then
pkgs="$pkgs build-essential"
@@ -242,7 +343,7 @@ else
# ...and the ones we do want listed. Non-dev packages fill missing spots on the list.
libpkgs=""
longest_libpkg=0
for pkg in libc6-dev libstdc++6 libopenal-dev libfreetype6-dev libx11-dev libsdl2-dev libpng-dev librtmidi-dev qtdeclarative5-dev libwayland-dev libevdev-dev libglib2.0-dev libslirp-dev
for pkg in libc6-dev libstdc++6 libopenal-dev libfreetype6-dev libx11-dev libsdl2-dev libpng-dev librtmidi-dev qtdeclarative5-dev libwayland-dev libevdev-dev libglib2.0-dev libslirp-dev libfaudio-dev libaudio-dev libjack-jackd2-dev libpipewire-0.3-dev libsamplerate0-dev libsndio-dev
do
libpkgs="$libpkgs $pkg:$arch_deb"
length=$(echo -n $pkg | sed 's/-dev$//' | sed "s/qtdeclarative/qt/" | wc -c)
@@ -298,9 +399,6 @@ EOF
# Link against the system libslirp instead of compiling ours.
cmake_flags_extra="$cmake_flags_extra -D SLIRP_EXTERNAL=ON"
# Use OpenAL for Linux builds before FAudio builds are set up.
cmake_flags_extra="$cmake_flags_extra -D OPENAL=ON"
fi
# Clean workspace.
@@ -327,16 +425,16 @@ if [ "$CI" = "true" ]
then
# Backup strategy when running under Jenkins.
[ -z "$git_hash" ] && git_hash=$(echo $GIT_COMMIT | cut -c 1-8)
elif [ ! -z "$git_hash" ]
elif [ -n "$git_hash" ]
then
# Append + to denote a dirty tree.
git diff --quiet 2> /dev/null || git_hash="$git_hash+"
fi
[ ! -z "$git_hash" ] && cmake_flags_extra="$cmake_flags_extra -D \"EMU_GIT_HASH=$git_hash\""
[ -n "$git_hash" ] && cmake_flags_extra="$cmake_flags_extra -D \"EMU_GIT_HASH=$git_hash\""
# Add copyright year.
year=$(date +%Y)
[ ! -z "$year" ] && cmake_flags_extra="$cmake_flags_extra -D \"EMU_COPYRIGHT_YEAR=$year\""
[ -n "$year" ] && cmake_flags_extra="$cmake_flags_extra -D \"EMU_COPYRIGHT_YEAR=$year\""
# Run CMake.
echo [-] Running CMake with flags [$cmake_flags $cmake_flags_extra]
@@ -432,19 +530,42 @@ then
else
cwd_root=$(pwd)
# Build openal-soft 1.21.1 manually to fix audio issues. This is a temporary
# workaround until a newer version of openal-soft trickles down to Debian repos.
if [ -d "openal-soft-1.21.1" ]
if grep -q "OPENAL:BOOL=ON" build/CMakeCache.txt
then
rm -rf openal-soft-1.21.1/build/*
# Build openal-soft 1.21.1 manually to fix audio issues. This is a temporary
# workaround until a newer version of openal-soft trickles down to Debian repos.
if [ -d "openal-soft-1.21.1" ]
then
rm -rf openal-soft-1.21.1/build/*
else
wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.21.1.tar.gz | tar zxf -
fi
cd openal-soft-1.21.1/build
[ -e Makefile ] && make clean
cmake -G "Unix Makefiles" -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" ..
make -j$(nproc) install || exit 99
cd "$cwd_root"
# Build SDL2 without sound systems.
sdl_ss=OFF
else
wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.21.1.tar.gz | tar zxf -
# Build FAudio 22.03 manually to remove the dependency on GStreamer. This is a temporary
# workaround until a newer version of FAudio trickles down to Debian repos.
if [ -d "FAudio-22.03" ]
then
rm -rf FAudio-22.03/build
else
wget -qO - https://github.com/FNA-XNA/FAudio/archive/refs/tags/22.03.tar.gz | tar zxf -
fi
mkdir FAudio-22.03/build
cd FAudio-22.03/build
cmake -G "Unix Makefiles" -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" ..
make -j$(nproc) install || exit 99
cd "$cwd_root"
# Build SDL2 with sound systems.
sdl_ss=ON
fi
cd openal-soft-1.21.1/build
[ -e Makefile ] && make clean
cmake -G "Unix Makefiles" -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" ..
make -j$(nproc) install || exit 99
cd "$cwd_root"
# Build rtmidi without JACK support to remove the dependency on libjack.
if [ -d "rtmidi-4.0.0" ]
@@ -468,10 +589,10 @@ else
rm -rf sdlbuild
mkdir sdlbuild
cd sdlbuild
cmake -G "Unix Makefiles" -D SDL_DISKAUDIO=OFF -D SDL_DIRECTFB_SHARED=OFF -D SDL_OPENGL=OFF -D SDL_OPENGLES=OFF -D SDL_OSS=OFF -D SDL_ALSA=OFF \
-D SDL_ALSA_SHARED=OFF -D SDL_JACK=OFF -D SDL_JACK_SHARED=OFF -D SDL_ESD=OFF -D SDL_ESD_SHARED=OFF -D SDL_PIPEWIRE=OFF -D SDL_PIPEWIRE_SHARED=OFF \
-D SDL_PULSEAUDIO=OFF -D SDL_PULSEAUDIO_SHARED=OFF -D SDL_ARTS=OFF -D SDL_ARTS_SHARED=OFF -D SDL_NAS=OFF -D SDL_NAS_SHARED=OFF -D SDL_SNDIO=OFF \
-D SDL_SNDIO_SHARED=OFF -D SDL_FUSIONSOUND=OFF -D SDL_FUSIONSOUND_SHARED=OFF -D SDL_LIBSAMPLERATE=OFF -D SDL_LIBSAMPLERATE_SHARED=OFF -D SDL_X11=OFF \
cmake -G "Unix Makefiles" -D SDL_DISKAUDIO=OFF -D SDL_DIRECTFB_SHARED=OFF -D SDL_OPENGL=OFF -D SDL_OPENGLES=OFF -D SDL_OSS=OFF -D SDL_ALSA=$sdl_ss \
-D SDL_ALSA_SHARED=$sdl_ss -D SDL_JACK=$sdl_ss -D SDL_JACK_SHARED=$sdl_ss -D SDL_ESD=OFF -D SDL_ESD_SHARED=OFF -D SDL_PIPEWIRE=$sdl_ss -D SDL_PIPEWIRE_SHARED=$sdl_ss \
-D SDL_PULSEAUDIO=$sdl_ss -D SDL_PULSEAUDIO_SHARED=$sdl_ss -D SDL_ARTS=OFF -D SDL_ARTS_SHARED=OFF -D SDL_NAS=$sdl_ss -D SDL_NAS_SHARED=$sdl_ss -D SDL_SNDIO=$sdl_ss \
-D SDL_SNDIO_SHARED=$sdl_ss -D SDL_FUSIONSOUND=OFF -D SDL_FUSIONSOUND_SHARED=OFF -D SDL_LIBSAMPLERATE=$sdl_ss -D SDL_LIBSAMPLERATE_SHARED=$sdl_ss -D SDL_X11=OFF \
-D SDL_X11_SHARED=OFF -D SDL_WAYLAND=OFF -D SDL_WAYLAND_SHARED=OFF -D SDL_WAYLAND_LIBDECOR=OFF -D SDL_WAYLAND_LIBDECOR_SHARED=OFF \
-D SDL_WAYLAND_QT_TOUCH=OFF -D SDL_RPI=OFF -D SDL_VIVANTE=OFF -D SDL_VULKAN=OFF -D SDL_KMSDRM=OFF -D SDL_KMSDRM_SHARED=OFF -D SDL_OFFSCREEN=OFF \
-D SDL_HIDAPI_JOYSTICK=ON -D SDL_VIRTUAL_JOYSTICK=ON -D SDL_SHARED=ON -D SDL_STATIC=OFF -S "$cwd_root/SDL2-2.0.20" \
@@ -544,7 +665,7 @@ else
project_version=$(grep -oP '#define\s+EMU_VERSION\s+"\K([^"]+)' "build/src/include/$project_lower/version.h" 2> /dev/null)
[ -z "$project_version" ] && project_version=unknown
build_num=$(grep -oP '#define\s+EMU_BUILD_NUM\s+\K([0-9]+)' "build/src/include/$project_lower/version.h" 2> /dev/null)
[ ! -z "$build_num" -a "$build_num" != "0" ] && project_version="$project_version-b$build_num"
[ -n "$build_num" -a "$build_num" != "0" ] && project_version="$project_version-b$build_num"
# Download appimage-builder if necessary.
[ ! -e "appimage-builder.AppImage" ] && wget -qO appimage-builder.AppImage \

24
.ci/dependencies_msys.txt Normal file
View File

@@ -0,0 +1,24 @@
zlib 1.2.11-9
binutils 2.37-4
headers-git 9.0.0.6357.eac8c38c1-1
crt-git 9.0.0.6357.eac8c38c1-2
libwinpthread-git 9.0.0.6357.eac8c38c1-1
winpthreads-git 9.0.0.6357.eac8c38c1-1
winstorecompat-git 9.0.0.6357.eac8c38c1-1
gcc-libs 11.2.0-4
gcc-ada 11.2.0-4
gcc-fortran 11.2.0-4
gcc-libgfortran 11.2.0-4
gcc-objc 11.2.0-4
gcc 11.2.0-4
libgccjit 11.2.0-4
tools-git 9.0.0.6357.eac8c38c1-1
make 4.3-1
pkgconf 1.8.0-2
openal 1.21.1-3
libpng 1.6.37-6
freetype 2.11.1-1
SDL2 2.0.18-2
rtmidi 4.0.0-1
cmake 3.22.1-1
qt5-static 5.15.2-4

2
.gitignore vendored
View File

@@ -27,6 +27,8 @@ Makefile
# Build scripts
/archive_tmp
/static2dll.*
/pacman.txt
/deps.txt
/VERSION
*.zip
*.tar

View File

@@ -131,8 +131,9 @@ option(DINPUT "DirectInput"
option(CPPTHREADS "C++11 threads" ON)
option(NEW_DYNAREC "Use the PCem v15 (\"new\") dynamic recompiler" OFF)
option(MINITRACE "Enable Chrome tracing using the modified minitrace library" OFF)
option(GDBSTUB "Enable GDB stub server for debugging" OFF)
option(DEV_BRANCH "Development branch" OFF)
option(QT "QT GUI" ON)
option(QT "Qt GUI" ON)
# Development branch features
#

View File

@@ -93,6 +93,7 @@
#include <86box/ui.h>
#include <86box/plat.h>
#include <86box/version.h>
#include <86box/gdbstub.h>
/* Stuff that used to be globally declared in plat.h but is now extern there
@@ -736,6 +737,8 @@ usage:
if (lang_init)
lang_id = lang_init;
gdbstub_init();
/* All good! */
return(1);
}
@@ -1175,6 +1178,8 @@ pc_close(thread_t *ptr)
mo_close();
scsi_disk_close();
gdbstub_close();
}
@@ -1203,6 +1208,9 @@ pc_run(void)
/* Run a block of code. */
startblit();
cpu_exec(cpu_s->rspeed / 100);
#ifdef USE_GDBSTUB /* avoid a KBC FIFO overflow when CPU emulation is stalled */
if (gdbstub_step == GDBSTUB_EXEC)
#endif
mouse_process();
joystick_process();
endblit();

View File

@@ -23,6 +23,11 @@ if(CPPTHREADS)
target_sources(86Box PRIVATE thread.cpp)
endif()
if(GDBSTUB)
add_compile_definitions(USE_GDBSTUB)
target_sources(86Box PRIVATE gdbstub.c)
endif()
if(NEW_DYNAREC)
add_compile_definitions(USE_NEW_DYNAREC)
endif()

View File

@@ -85,8 +85,13 @@ RecompOpFn recomp_opcodes_0f[512] =
/*40*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*50*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
#if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM || defined __aarch64__ || defined _M_ARM64
/*60*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*70*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
#else
/*60*/ ropPUNPCKLBW, ropPUNPCKLWD, ropPUNPCKLDQ, ropPACKSSWB, ropPCMPGTB, ropPCMPGTW, ropPCMPGTD, ropPACKUSWB, ropPUNPCKHBW, ropPUNPCKHWD, ropPUNPCKHDQ, ropPACKSSDW, NULL, NULL, ropMOVD_r_d, ropMOVQ_r_q,
/*70*/ NULL, ropPSxxW_imm, ropPSxxD_imm, ropPSxxQ_imm, ropPCMPEQB, ropPCMPEQW, ropPCMPEQD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ropMOVD_d_r, ropMOVQ_q_r,
#endif
/*80*/ ropJO_16, ropJNO_16, ropJB_16, ropJNB_16, ropJE_16, ropJNE_16, ropJBE_16, ropJNBE_16, ropJS_16, ropJNS_16, ropJP_16, ropJNP_16, ropJL_16, ropJNL_16, ropJLE_16, ropJNLE_16,
/*90*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -107,8 +112,13 @@ RecompOpFn recomp_opcodes_0f[512] =
/*40*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*50*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
#if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM || defined __aarch64__ || defined _M_ARM64
/*60*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*70*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
#else
/*60*/ ropPUNPCKLBW, ropPUNPCKLWD, ropPUNPCKLDQ, ropPACKSSWB, ropPCMPGTB, ropPCMPGTW, ropPCMPGTD, ropPACKUSWB, ropPUNPCKHBW, ropPUNPCKHWD, ropPUNPCKHDQ, ropPACKSSDW, NULL, NULL, ropMOVD_r_d, ropMOVQ_r_q,
/*70*/ NULL, ropPSxxW_imm, ropPSxxD_imm, ropPSxxQ_imm, ropPCMPEQB, ropPCMPEQW, ropPCMPEQD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ropMOVD_d_r, ropMOVQ_q_r,
#endif
/*80*/ ropJO_32, ropJNO_32, ropJB_32, ropJNB_32, ropJE_32, ropJNE_32, ropJBE_32, ropJNBE_32, ropJS_32, ropJNS_32, ropJP_32, ropJNP_32, ropJL_32, ropJNL_32, ropJLE_32, ropJNLE_32,
/*90*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

View File

@@ -22,6 +22,7 @@
#include <86box/fdd.h>
#include <86box/fdc.h>
#include <86box/machine.h>
#include <86box/gdbstub.h>
#include "386_common.h"
#ifdef USE_NEW_DYNAREC
#include "codegen.h"
@@ -256,6 +257,11 @@ exec386(int cycs)
if (TIMER_VAL_LESS_THAN_VAL(timer_target, (uint32_t) tsc))
timer_process_inline();
#ifdef USE_GDBSTUB
if (gdbstub_instruction())
return;
#endif
}
}
}

View File

@@ -26,6 +26,7 @@
#include <86box/fdd.h>
#include <86box/fdc.h>
#include <86box/machine.h>
#include <86box/gdbstub.h>
#ifdef USE_DYNAREC
#include "codegen.h"
#ifdef USE_NEW_DYNAREC
@@ -858,6 +859,11 @@ exec386_dynarec(int cycs)
if (TIMER_VAL_LESS_THAN_VAL(timer_target, (uint32_t) tsc))
timer_process_inline();
}
#ifdef USE_GDBSTUB
if (gdbstub_instruction())
return;
#endif
}
cycles_main -= (cycles_start - cycles);

View File

@@ -19,6 +19,7 @@
#include <86box/mem.h>
#include <86box/nmi.h>
#include <86box/pic.h>
#include <86box/gdbstub.h>
#include "codegen.h"
#define CPU_BLOCK_END() cpu_block_end = 1

View File

@@ -34,6 +34,7 @@
#include <86box/pic.h>
#include <86box/ppi.h>
#include <86box/timer.h>
#include <86box/gdbstub.h>
/* Is the CPU 8088 or 8086. */
int is8086 = 0;
@@ -2833,5 +2834,10 @@ execx86(int cycs)
cpu_alu_op = 0;
}
#ifdef USE_GDBSTUB
if (gdbstub_instruction())
return;
#endif
}
}

View File

@@ -36,6 +36,7 @@
#include <86box/nmi.h>
#include <86box/pic.h>
#include <86box/pci.h>
#include <86box/gdbstub.h>
#ifdef USE_DYNAREC
# include "codegen.h"
#endif
@@ -1395,6 +1396,7 @@ cpu_set(void)
cpu_exec = exec386;
else
cpu_exec = execx86;
gdbstub_cpu_init();
}

View File

@@ -1,6 +1,10 @@
static int opINT3(uint32_t fetchdat)
{
int cycles_old = cycles; UN_USED(cycles_old);
#ifdef USE_GDBSTUB
if (gdbstub_int3())
return 1;
#endif
if ((cr0 & 1) && (cpu_state.eflags & VM_FLAG) && (IOPL != 3))
{
x86gpf(NULL,0);

View File

@@ -239,89 +239,25 @@ static __inline int64_t x87_fround(double b)
return 0LL;
}
#define BIAS80 16383
#define BIAS64 1023
#include "x87_ops_conv.h"
static __inline double x87_ld80()
{
int64_t exp64;
int64_t blah;
int64_t exp64final;
int64_t mant64;
int64_t sign;
struct {
int16_t begin;
union
{
double d;
uint64_t ll;
} eind;
} test;
test.eind.ll = readmeml(easeg,cpu_state.eaaddr);
test.eind.ll |= (uint64_t)readmeml(easeg,cpu_state.eaaddr+4)<<32;
test.begin = readmemw(easeg,cpu_state.eaaddr+8);
exp64 = (((test.begin&0x7fff) - BIAS80));
blah = ((exp64 >0)?exp64:-exp64)&0x3ff;
exp64final = ((exp64 >0)?blah:-blah) +BIAS64;
mant64 = (test.eind.ll >> 11) & (0xfffffffffffffll);
sign = (test.begin&0x8000)?1:0;
if ((test.begin & 0x7fff) == 0x7fff)
exp64final = 0x7ff;
if ((test.begin & 0x7fff) == 0)
exp64final = 0;
if (test.eind.ll & 0x400)
mant64++;
test.eind.ll = (sign <<63)|(exp64final << 52)| mant64;
return test.eind.d;
x87_conv_t test;
test.eind.ll = readmeml(easeg,cpu_state.eaaddr);
test.eind.ll |= (uint64_t)readmeml(easeg,cpu_state.eaaddr+4)<<32;
test.begin = readmemw(easeg,cpu_state.eaaddr+8);
return x87_from80(&test);
}
static __inline void x87_st80(double d)
{
int64_t sign80;
int64_t exp80;
int64_t exp80final;
int64_t mant80;
int64_t mant80final;
struct {
int16_t begin;
union
{
double d;
uint64_t ll;
} eind;
} test;
test.eind.d=d;
sign80 = (test.eind.ll&(0x8000000000000000ll))?1:0;
exp80 = test.eind.ll&(0x7ff0000000000000ll);
exp80final = (exp80>>52);
mant80 = test.eind.ll&(0x000fffffffffffffll);
mant80final = (mant80 << 11);
if (exp80final == 0x7ff) /*Infinity / Nan*/
{
exp80final = 0x7fff;
mant80final |= (0x8000000000000000ll);
}
else if (d != 0){ /* Zero is a special case */
/* Elvira wants the 8 and tcalc doesn't */
mant80final |= (0x8000000000000000ll);
/* Ca-cyber doesn't like this when result is zero. */
exp80final += (BIAS80 - BIAS64);
}
test.begin = (((int16_t)sign80)<<15)| (int16_t)exp80final;
test.eind.ll = mant80final;
writememl(easeg,cpu_state.eaaddr,test.eind.ll & 0xffffffff);
writememl(easeg,cpu_state.eaaddr+4,test.eind.ll>>32);
writememw(easeg,cpu_state.eaaddr+8,test.begin);
x87_conv_t test;
x87_to80(d, &test);
writememl(easeg,cpu_state.eaaddr,test.eind.ll & 0xffffffff);
writememl(easeg,cpu_state.eaaddr+4,test.eind.ll>>32);
writememw(easeg,cpu_state.eaaddr+8,test.begin);
}
static __inline void x87_st_fsave(int reg)

68
src/cpu/x87_ops_conv.h Normal file
View File

@@ -0,0 +1,68 @@
#define BIAS80 16383
#define BIAS64 1023
typedef struct {
int16_t begin;
union {
double d;
uint64_t ll;
} eind;
} x87_conv_t;
static __inline double x87_from80(x87_conv_t *test)
{
int64_t exp64;
int64_t blah;
int64_t exp64final;
int64_t mant64;
int64_t sign;
exp64 = (((test->begin&0x7fff) - BIAS80));
blah = ((exp64 >0)?exp64:-exp64)&0x3ff;
exp64final = ((exp64 >0)?blah:-blah) +BIAS64;
mant64 = (test->eind.ll >> 11) & (0xfffffffffffffll);
sign = (test->begin&0x8000)?1:0;
if ((test->begin & 0x7fff) == 0x7fff)
exp64final = 0x7ff;
if ((test->begin & 0x7fff) == 0)
exp64final = 0;
if (test->eind.ll & 0x400)
mant64++;
test->eind.ll = (sign <<63)|(exp64final << 52)| mant64;
return test->eind.d;
}
static __inline void x87_to80(double d, x87_conv_t *test)
{
int64_t sign80;
int64_t exp80;
int64_t exp80final;
int64_t mant80;
int64_t mant80final;
test->eind.d=d;
sign80 = (test->eind.ll&(0x8000000000000000ll))?1:0;
exp80 = test->eind.ll&(0x7ff0000000000000ll);
exp80final = (exp80>>52);
mant80 = test->eind.ll&(0x000fffffffffffffll);
mant80final = (mant80 << 11);
if (exp80final == 0x7ff) /*Infinity / Nan*/
{
exp80final = 0x7fff;
mant80final |= (0x8000000000000000ll);
}
else if (d != 0){ /* Zero is a special case */
/* Elvira wants the 8 and tcalc doesn't */
mant80final |= (0x8000000000000000ll);
/* Ca-cyber doesn't like this when result is zero. */
exp80final += (BIAS80 - BIAS64);
}
test->begin = (((int16_t)sign80)<<15)| (int16_t)exp80final;
test->eind.ll = mant80final;
}

View File

@@ -35,11 +35,11 @@
dma_t dma[8];
uint8_t dma_e;
uint8_t dma_m;
static uint8_t dmaregs[3][16];
static int dma_wp[2];
static uint8_t dma_m;
static uint8_t dma_stat;
static uint8_t dma_stat_rq;
static uint8_t dma_stat_rq_pc;

1699
src/gdbstub.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -66,6 +66,7 @@ typedef struct {
extern dma_t dma[8];
extern uint8_t dma_e;
extern uint8_t dma_m;
extern void dma_init(void);

View File

@@ -0,0 +1,78 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Definitions for the GDB stub server.
*
*
*
* Authors: RichardG, <richardg867@gmail.com>
*
* Copyright 2022 RichardG.
*/
#ifndef EMU_GDBSTUB_H
#define EMU_GDBSTUB_H
#include <86box/mem.h>
#define GDBSTUB_MEM_READ 0
#define GDBSTUB_MEM_WRITE 16
#define GDBSTUB_MEM_AWATCH 32
enum {
GDBSTUB_EXEC = 0,
GDBSTUB_SSTEP,
GDBSTUB_BREAK,
GDBSTUB_BREAK_SW,
GDBSTUB_BREAK_HW,
GDBSTUB_BREAK_RWATCH,
GDBSTUB_BREAK_WWATCH,
GDBSTUB_BREAK_AWATCH
};
#ifdef USE_GDBSTUB
# define GDBSTUB_MEM_ACCESS(addr, access, width) \
uint32_t gdbstub_page = addr >> MEM_GRANULARITY_BITS; \
if (gdbstub_watch_pages[gdbstub_page >> 6] & (1 << (gdbstub_page & 63))) { \
uint32_t gdbstub_addrs[width]; \
for (int gdbstub_i = 0; gdbstub_i < width; gdbstub_i++) \
gdbstub_addrs[gdbstub_i] = addr + gdbstub_i; \
gdbstub_mem_access(gdbstub_addrs, access | width); \
}
# define GDBSTUB_MEM_ACCESS_FAST(addrs, access, width) \
uint32_t gdbstub_page = addr >> MEM_GRANULARITY_BITS; \
if (gdbstub_watch_pages[gdbstub_page >> 6] & (1 << (gdbstub_page & 63))) \
gdbstub_mem_access(addrs, access | width);
extern int gdbstub_step, gdbstub_next_asap;
extern uint64_t gdbstub_watch_pages[(((uint32_t) -1) >> (MEM_GRANULARITY_BITS + 6)) + 1];
extern void gdbstub_cpu_init();
extern int gdbstub_instruction();
extern int gdbstub_int3();
extern void gdbstub_mem_access(uint32_t *addrs, int access);
extern void gdbstub_init();
extern void gdbstub_close();
#else
# define GDBSTUB_MEM_ACCESS(addr, access, width)
# define GDBSTUB_MEM_ACCESS_FAST(addrs, access, width)
# define gdbstub_step 0
# define gdbstub_next_asap 0
# define gdbstub_cpu_init()
# define gdbstub_instruction() 0
# define gdbstub_int3() 0
# define gdbstub_init()
# define gdbstub_close()
#endif
#endif

View File

@@ -613,6 +613,9 @@ extern int machine_at_s370sba_init(const machine_t *);
extern int machine_at_apas3_init(const machine_t *);
extern int machine_at_gt694va_init(const machine_t *);
extern int machine_at_cuv4xls_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_cuv4xls_get_device(void);
#endif
extern int machine_at_6via90ap_init(const machine_t *);
extern int machine_at_s1857_init(const machine_t *);
extern int machine_at_p6bap_init(const machine_t *);

View File

@@ -41,8 +41,9 @@ typedef struct {
int fm_vol_l, fm_vol_r;
uint8_t fmt_mask, wave_vol_mask;
uint8_t enable : 1, irq : 4, dma : 3;
int freq;
uint8_t enable : 1, irq : 4, dma : 3, adpcm_ref;
int8_t adpcm_step;
int freq, adpcm_data, adpcm_pos;
pc_timer_t timer_count;
uint64_t timer_latch;

View File

@@ -149,6 +149,8 @@ extern const device_t mpu401_device;
extern const device_t mpu401_mca_device;
extern uint8_t MPU401_ReadData(mpu_t *mpu);
extern void mpu401_write(uint16_t addr, uint8_t val, void *priv);
extern uint8_t mpu401_read(uint16_t addr, void *priv);
extern void mpu401_setirq(mpu_t *mpu, int irq);
extern void mpu401_change_addr(mpu_t *mpu, uint16_t addr);
extern void mpu401_init(mpu_t *mpu, uint16_t addr, int irq, int mode, int receive_input);

View File

@@ -120,6 +120,8 @@ typedef struct sb_ct1745_mixer_t {
uint8_t index;
uint8_t regs[256];
int output_filter; /* for clones */
} sb_ct1745_mixer_t;
typedef struct sb_t {
@@ -151,8 +153,13 @@ extern void sb_ct1345_mixer_write(uint16_t addr, uint8_t val, void *p);
extern uint8_t sb_ct1345_mixer_read(uint16_t addr, void *p);
extern void sb_ct1345_mixer_reset(sb_t *sb);
extern void sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *p);
extern uint8_t sb_ct1745_mixer_read(uint16_t addr, void *p);
extern void sb_ct1745_mixer_reset(sb_t* sb);
extern void sb_get_buffer_sbpro(int32_t *buffer, int len, void *p);
extern void sbpro_filter_cd_audio(int channel, double *buffer, void *p);
extern void sb16_awe32_filter_cd_audio(int channel, double *buffer, void *p);
extern void sb_close(void *p);
extern void sb_speed_changed(void *p);

View File

@@ -15,11 +15,16 @@ typedef struct sb_dsp_t {
int sb_subtype; /* which clone */
void *parent; /* "sb_t *" if default subtype, "azt2316a_t *" if aztech. */
int sb_8_length, sb_8_format, sb_8_autoinit, sb_8_pause, sb_8_enable, sb_8_autolen, sb_8_output;
int sb_8_length, sb_8_origlength, sb_8_format, sb_8_autoinit, sb_8_pause, sb_8_enable, sb_8_autolen, sb_8_output;
int sb_8_dmanum;
int sb_16_length, sb_16_format, sb_16_autoinit, sb_16_pause, sb_16_enable, sb_16_autolen, sb_16_output;
int sb_16_length, sb_16_origlength, sb_16_format, sb_16_autoinit, sb_16_pause, sb_16_enable, sb_16_autolen, sb_16_output;
int sb_16_dmanum;
int sb_pausetime;
int (*dma_readb)(void *priv),
(*dma_readw)(void *priv),
(*dma_writeb)(void *priv, uint8_t val),
(*dma_writew)(void *priv, uint16_t val);
void *dma_priv;
uint8_t sb_read_data[256];
int sb_read_wp, sb_read_rp;
@@ -36,6 +41,8 @@ typedef struct sb_dsp_t {
int midi_in_timestamp;
int sb_irqnum;
void (*irq_update)(void *priv, int set),
*irq_priv;
uint8_t sbe2;
int sbe2count;
@@ -53,7 +60,7 @@ typedef struct sb_dsp_t {
int sbdacpos;
int sbleftright;
int sbleftright, sbleftright_default;
int sbreset;
uint8_t sbreaddat;
@@ -123,4 +130,12 @@ void sb_dsp_set_stereo(sb_dsp_t *dsp, int stereo);
void sb_dsp_update(sb_dsp_t *dsp);
void sb_update_mask(sb_dsp_t *dsp, int irqm8, int irqm16, int irqm401);
void sb_dsp_irq_attach(sb_dsp_t *dsp, void (*irq_update)(void *priv, int set), void *priv);
void sb_dsp_dma_attach(sb_dsp_t *dsp,
int (*dma_readb)(void *priv),
int (*dma_readw)(void *priv),
int (*dma_writeb)(void *priv, uint8_t val),
int (*dma_writew)(void *priv, uint16_t val),
void *priv);
#endif /* SOUND_SND_SB_DSP_H */

View File

@@ -118,6 +118,8 @@ extern const device_t sb_pro_mcv_device;
extern const device_t sb_pro_compat_device;
extern const device_t sb_16_device;
extern const device_t sb_16_pnp_device;
extern const device_t sb_16_compat_device;
extern const device_t sb_16_compat_nompu_device;
extern const device_t sb_32_pnp_device;
extern const device_t sb_awe32_device;
extern const device_t sb_awe32_pnp_device;
@@ -138,6 +140,13 @@ extern const device_t cs4235_onboard_device;
extern const device_t cs4236b_device;
extern const device_t cs4237b_device;
extern const device_t cs4238b_device;
/* C-Media CMI8x38 */
extern const device_t cmi8338_device;
extern const device_t cmi8338_onboard_device;
extern const device_t cmi8738_device;
extern const device_t cmi8738_onboard_device;
extern const device_t cmi8738_6ch_onboard_device;
#endif
#endif /*EMU_SOUND_H*/

View File

@@ -673,7 +673,7 @@ io_trap_remap(void *handle, int enable, uint16_t addr, uint16_t size)
trap->base, trap->base + trap->size - 1, trap->enable, addr, addr + size - 1, enable);
/* Remove old I/O mapping. */
if (trap->enable && trap->base && trap->size) {
if (trap->enable && trap->size) {
io_removehandler(trap->base, trap->size,
io_trap_readb, io_trap_readw, io_trap_readl,
io_trap_writeb, io_trap_writew, io_trap_writel,
@@ -686,8 +686,8 @@ io_trap_remap(void *handle, int enable, uint16_t addr, uint16_t size)
trap->size = size;
/* Add new I/O mapping. */
if (trap->enable && trap->base && trap->size) {
io_sethandler(trap->base, trap->size,
if (trap->enable && trap->size) {
io_sethandler(trap->base, trap->size,
io_trap_readb, io_trap_readw, io_trap_readl,
io_trap_writeb, io_trap_writew, io_trap_writel,
trap);

View File

@@ -430,10 +430,20 @@ machine_at_cuv4xls_init(const machine_t *model)
spd_register(SPD_TYPE_SDRAM, 0xF, 1024);
device_add(&as99127f_device); /* fans: Chassis, CPU, Power; temperatures: MB, JTPWR, CPU */
if (sound_card_current == SOUND_INTERNAL)
device_add(&cmi8738_onboard_device);
return ret;
}
const device_t *
at_cuv4xls_get_device(void)
{
return &cmi8738_onboard_device;
}
int
machine_at_6via90ap_init(const machine_t *model)
{

View File

@@ -914,7 +914,7 @@ const machine_t machines[] = {
{ "[VIA Apollo Pro 133A] Acorp 6VIA90AP", "6via90ap", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 150000000, 1300, 3500, MACHINE_MULTIPLIER_FIXED, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_BUS_AC97 | MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_GAMEPORT, 16384,3145728, 8192, 255, machine_at_6via90ap_init, NULL },
/* Has the VIA VT82C686B southbridge with on-chip KBC identical to the VIA
VT82C42N. */
{ "[VIA Apollo Pro 133A] ASUS CUV4X-LS", "cuv4xls", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 150000000, 1300, 3500, 1.5, 8.0, (MACHINE_AGP & ~MACHINE_AT) | MACHINE_BUS_PS2 | MACHINE_BUS_AC97 | MACHINE_IDE_DUAL,16384,4194304, 8192, 255, machine_at_cuv4xls_init, NULL },
{ "[VIA Apollo Pro 133A] ASUS CUV4X-LS", "cuv4xls", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 150000000, 1300, 3500, 1.5, 8.0, (MACHINE_AGP & ~MACHINE_AT) | MACHINE_BUS_PS2 | MACHINE_BUS_AC97 | MACHINE_IDE_DUAL | MACHINE_SOUND, 16384,4194304, 8192, 255, machine_at_cuv4xls_init, at_cuv4xls_get_device },
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
firmware. */
{ "[VIA Apollo Pro 133A] BCM GT694VA", "gt694va", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_SOUND, 16384,3145728, 8192, 255, machine_at_gt694va_init, at_gt694va_get_device },

View File

@@ -36,6 +36,7 @@
#include <86box/mem.h>
#include <86box/plat.h>
#include <86box/rom.h>
#include <86box/gdbstub.h>
#ifdef USE_DYNAREC
# include "codegen_public.h"
#else
@@ -783,6 +784,8 @@ readmembl(uint32_t addr)
mem_mapping_t *map;
uint64_t a;
GDBSTUB_MEM_ACCESS(addr, GDBSTUB_MEM_READ, 1);
addr64 = (uint64_t) addr;
mem_logical_addr = addr;
@@ -811,6 +814,8 @@ writemembl(uint32_t addr, uint8_t val)
mem_mapping_t *map;
uint64_t a;
GDBSTUB_MEM_ACCESS(addr, GDBSTUB_MEM_WRITE, 1);
addr64 = (uint64_t) addr;
mem_logical_addr = addr;
@@ -842,6 +847,8 @@ readmembl_no_mmut(uint32_t addr, uint32_t a64)
{
mem_mapping_t *map;
GDBSTUB_MEM_ACCESS(addr, GDBSTUB_MEM_READ, 1);
mem_logical_addr = addr;
if (cr0 >> 31) {
@@ -866,6 +873,8 @@ writemembl_no_mmut(uint32_t addr, uint32_t a64, uint8_t val)
{
mem_mapping_t *map;
GDBSTUB_MEM_ACCESS(addr, GDBSTUB_MEM_WRITE, 1);
mem_logical_addr = addr;
if (page_lookup[addr >> 12] && page_lookup[addr >> 12]->write_b) {
@@ -896,6 +905,7 @@ readmemwl(uint32_t addr)
addr64a[0] = addr;
addr64a[1] = addr + 1;
GDBSTUB_MEM_ACCESS_FAST(addr64a, GDBSTUB_MEM_READ, 2);
mem_logical_addr = addr;
@@ -957,6 +967,7 @@ writememwl(uint32_t addr, uint16_t val)
addr64a[0] = addr;
addr64a[1] = addr + 1;
GDBSTUB_MEM_ACCESS_FAST(addr64a, GDBSTUB_MEM_WRITE, 2);
mem_logical_addr = addr;
@@ -1029,6 +1040,8 @@ readmemwl_no_mmut(uint32_t addr, uint32_t *a64)
{
mem_mapping_t *map;
GDBSTUB_MEM_ACCESS(addr, GDBSTUB_MEM_READ, 2);
mem_logical_addr = addr;
if (addr & 1) {
@@ -1076,6 +1089,8 @@ writememwl_no_mmut(uint32_t addr, uint32_t *a64, uint16_t val)
{
mem_mapping_t *map;
GDBSTUB_MEM_ACCESS(addr, GDBSTUB_MEM_WRITE, 2);
mem_logical_addr = addr;
if (addr & 1) {
@@ -1135,6 +1150,7 @@ readmemll(uint32_t addr)
for (i = 0; i < 4; i++)
addr64a[i] = (uint64_t) (addr + i);
GDBSTUB_MEM_ACCESS_FAST(addr64a, GDBSTUB_MEM_READ, 4);
mem_logical_addr = addr;
@@ -1214,6 +1230,7 @@ writememll(uint32_t addr, uint32_t val)
for (i = 0; i < 4; i++)
addr64a[i] = (uint64_t) (addr + i);
GDBSTUB_MEM_ACCESS_FAST(addr64a, GDBSTUB_MEM_WRITE, 4);
mem_logical_addr = addr;
@@ -1305,6 +1322,8 @@ readmemll_no_mmut(uint32_t addr, uint32_t *a64)
#ifndef NO_MMUT
mem_mapping_t *map;
GDBSTUB_MEM_ACCESS(addr, GDBSTUB_MEM_READ, 4);
mem_logical_addr = addr;
if (addr & 3) {
@@ -1361,6 +1380,8 @@ writememll_no_mmut(uint32_t addr, uint32_t *a64, uint32_t val)
#ifndef NO_MMUT
mem_mapping_t *map;
GDBSTUB_MEM_ACCESS(addr, GDBSTUB_MEM_WRITE, 4);
mem_logical_addr = addr;
if (addr & 3) {
@@ -1429,6 +1450,7 @@ readmemql(uint32_t addr)
for (i = 0; i < 8; i++)
addr64a[i] = (uint64_t) (addr + i);
GDBSTUB_MEM_ACCESS_FAST(addr64a, GDBSTUB_MEM_READ, 8);
mem_logical_addr = addr;
@@ -1496,6 +1518,7 @@ writememql(uint32_t addr, uint64_t val)
for (i = 0; i < 8; i++)
addr64a[i] = (uint64_t) (addr + i);
GDBSTUB_MEM_ACCESS_FAST(addr64a, GDBSTUB_MEM_WRITE, 8);
mem_logical_addr = addr;

View File

@@ -43,7 +43,7 @@ JoystickConfiguration::JoystickConfiguration(int type, int joystick_nr, QWidget
}
ui->comboBoxDevice->setCurrentIndex(joystick_state[joystick_nr].plat_joystick_nr);
setFixedSize(minimumSizeHint());
layout()->setSizeConstraint(QLayout::SetFixedSize);
}
JoystickConfiguration::~JoystickConfiguration()
@@ -82,7 +82,9 @@ int JoystickConfiguration::selectedPov(int pov) {
void JoystickConfiguration::on_comboBoxDevice_currentIndexChanged(int index) {
for (auto w : widgets) {
ui->ct->removeWidget(w);
w->deleteLater();
}
widgets.clear();
if (index == 0) {
return;
@@ -197,6 +199,4 @@ void JoystickConfiguration::on_comboBoxDevice_currentIndexChanged(int index) {
++row;
}
setFixedSize(minimumSizeHint());
}

View File

@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Joystick configuration</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="2">

View File

@@ -54,6 +54,7 @@ extern "C"
#include <86box/ui.h>
#include <86box/video.h>
#include <86box/discord.h>
#include <86box/gdbstub.h>
}
#include <thread>
@@ -95,6 +96,11 @@ main_thread_fn()
while (!is_quit && cpu_thread_run) {
/* See if it is time to run a frame of code. */
new_time = elapsed_timer.elapsed();
#ifdef USE_GDBSTUB
if (gdbstub_next_asap && (drawits <= 0))
drawits = 10;
else
#endif
drawits += (new_time - old_time);
old_time = new_time;
if (drawits > 0 && !dopause) {

View File

@@ -214,6 +214,11 @@ MainWindow::MainWindow(QWidget *parent) :
}
});
connect(qApp, &QGuiApplication::applicationStateChanged, [this](Qt::ApplicationState state) {
if (mouse_capture && state != Qt::ApplicationState::ApplicationActive)
emit setMouseCapture(false);
});
connect(this, &MainWindow::resizeContents, this, [this](int w, int h) {
if (!QApplication::platformName().contains("eglfs") && vid_resize == 0) {
w = qRound(w / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.));
@@ -243,7 +248,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(this, &MainWindow::updateStatusBarTip, status.get(), &MachineStatus::updateTip);
connect(this, &MainWindow::updateStatusBarActivity, status.get(), &MachineStatus::setActivity);
connect(this, &MainWindow::updateStatusBarEmpty, status.get(), &MachineStatus::setEmpty);
connect(this, &MainWindow::statusBarMessage, status.get(), &MachineStatus::message);
connect(this, &MainWindow::statusBarMessage, status.get(), &MachineStatus::message, Qt::QueuedConnection);
ui->actionKeyboard_requires_capture->setChecked(kbd_req_capture);
ui->actionRight_CTRL_is_left_ALT->setChecked(rctrl_is_lalt);
@@ -1265,6 +1270,8 @@ void MainWindow::on_actionFullscreen_triggered() {
} else {
if (video_fullscreen_first)
{
bool wasCaptured = mouse_capture == 1;
QMessageBox questionbox(QMessageBox::Icon::Information, tr("Entering fullscreen mode"), tr("Press Ctrl+Alt+PgDn to return to windowed mode."), QMessageBox::Ok, this);
QCheckBox *chkbox = new QCheckBox(tr("Don't show this message again"));
questionbox.setCheckBox(chkbox);
@@ -1275,6 +1282,10 @@ void MainWindow::on_actionFullscreen_triggered() {
});
questionbox.exec();
config_save();
/* (re-capture mouse after dialog. */
if (wasCaptured)
emit setMouseCapture(true);
}
video_fullscreen = 1;
setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
@@ -1305,22 +1316,27 @@ bool MainWindow::eventFilter(QObject* receiver, QEvent* event)
if (this->keyboardGrabber() == this) {
if (event->type() == QEvent::KeyPress) {
event->accept();
this->keyPressEvent((QKeyEvent*)event);
this->keyPressEvent((QKeyEvent *) event);
return true;
}
if (event->type() == QEvent::KeyRelease) {
event->accept();
this->keyReleaseEvent((QKeyEvent*)event);
this->keyReleaseEvent((QKeyEvent *) event);
return true;
}
}
if (receiver == this)
{
if (receiver == this) {
static auto curdopause = dopause;
if (event->type() == QEvent::WindowBlocked) { curdopause = dopause; plat_pause(1); }
else if (event->type() == QEvent::WindowUnblocked) { plat_pause(curdopause); }
if (event->type() == QEvent::WindowBlocked) {
curdopause = dopause;
plat_pause(1);
emit setMouseCapture(false);
} else if (event->type() == QEvent::WindowUnblocked) {
plat_pause(curdopause);
}
}
return QMainWindow::eventFilter(receiver, event);
}

View File

@@ -533,9 +533,11 @@ void ProgSettings::reloadStrings()
translatedstrings[IDS_2078] = QCoreApplication::translate("", "Press F8+F12 to release mouse").replace("F8+F12", MOUSE_CAPTURE_KEYSEQ).replace("CTRL-END", QLocale::system().name() == "de_DE" ? "Strg+Ende" : "CTRL-END").toStdWString();
translatedstrings[IDS_2079] = QCoreApplication::translate("", "Press F8+F12 or middle button to release mouse").replace("F8+F12", MOUSE_CAPTURE_KEYSEQ).replace("CTRL-END", QLocale::system().name() == "de_DE" ? "Strg+Ende" : "CTRL-END").toStdWString();
translatedstrings[IDS_2080] = QCoreApplication::translate("", "Failed to initialize FluidSynth").toStdWString();
translatedstrings[IDS_2130] = QCoreApplication::translate("", "Invalid configuration").toStdWString();
translatedstrings[IDS_4099] = QCoreApplication::translate("", "MFM/RLL or ESDI CD-ROM drives never existed").toStdWString();
translatedstrings[IDS_2093] = QCoreApplication::translate("", "Failed to set up PCap").toStdWString();
translatedstrings[IDS_2094] = QCoreApplication::translate("", "No PCap devices found").toStdWString();
translatedstrings[IDS_2095] = QCoreApplication::translate("", "Invalid PCap device").toStdWString();
translatedstrings[IDS_2110] = QCoreApplication::translate("", "Unable to initialize FreeType").toStdWString();
translatedstrings[IDS_2111] = QCoreApplication::translate("", "Unable to initialize SDL, libsdl2 is required").toStdWString();
translatedstrings[IDS_2129] = QCoreApplication::translate("", "Make sure libpcap is installed and that you are on a libpcap-compatible network connection.").toStdWString();
@@ -543,6 +545,7 @@ void ProgSettings::reloadStrings()
translatedstrings[IDS_2063] = QCoreApplication::translate("", "Machine \"%hs\" is not available due to missing ROMs in the roms/machines directory. Switching to an available machine.").toStdWString();
translatedstrings[IDS_2064] = QCoreApplication::translate("", "Video card \"%hs\" is not available due to missing ROMs in the roms/video directory. Switching to an available video card.").toStdWString();
translatedstrings[IDS_2128] = QCoreApplication::translate("", "Hardware not available").toStdWString();
translatedstrings[IDS_2142] = QCoreApplication::translate("", "Monitor in sleep mode").toStdWString();
translatedstrings[IDS_2120] = QCoreApplication::translate("", "No ROMs found").toStdWString();
translatedstrings[IDS_2056] = QCoreApplication::translate("", "86Box could not find any usable ROM images.\n\nPlease <a href=\"https://github.com/86Box/roms/releases/latest\">download</a> a ROM set and extract it into the \"roms\" directory.").replace("roms", ROMDIR).toStdWString();

View File

@@ -131,7 +131,7 @@ void ProgSettings::accept()
connect(main_window, &MainWindow::updateStatusBarTip, main_window->status.get(), &MachineStatus::updateTip);
connect(main_window, &MainWindow::updateStatusBarActivity, main_window->status.get(), &MachineStatus::setActivity);
connect(main_window, &MainWindow::updateStatusBarEmpty, main_window->status.get(), &MachineStatus::setEmpty);
connect(main_window, &MainWindow::statusBarMessage, main_window->status.get(), &MachineStatus::message);
connect(main_window, &MainWindow::statusBarMessage, main_window->status.get(), &MachineStatus::message, Qt::QueuedConnection);
QDialog::accept();
}

View File

@@ -98,8 +98,8 @@ void wl_mouse_capture(QWindow *window)
void wl_mouse_uncapture()
{
zwp_locked_pointer_v1_destroy(conf_pointer);
zwp_relative_pointer_v1_destroy(rel_pointer);
if (conf_pointer) zwp_locked_pointer_v1_destroy(conf_pointer);
if (rel_pointer) zwp_relative_pointer_v1_destroy(rel_pointer);
rel_pointer = nullptr;
conf_pointer = nullptr;
}

View File

@@ -16,7 +16,7 @@
add_library(snd OBJECT sound.c snd_opl.c snd_opl_nuked.c snd_resid.cc
midi.c snd_speaker.c snd_pssj.c snd_lpt_dac.c snd_ac97_codec.c snd_ac97_via.c
snd_lpt_dss.c snd_ps1.c snd_adlib.c snd_adlibgold.c snd_ad1848.c snd_audiopci.c
snd_azt2316a.c snd_cms.c snd_cs423x.c snd_gus.c snd_sb.c snd_sb_dsp.c
snd_azt2316a.c snd_cms.c snd_cmi8x38.c snd_cs423x.c snd_gus.c snd_sb.c snd_sb_dsp.c
snd_emu8k.c snd_mpu401.c snd_sn76489.c snd_ssi2001.c snd_wss.c snd_ym7128.c)
if(OPENAL)

View File

@@ -37,6 +37,10 @@
static int ad1848_vols_7bits[128];
static double ad1848_vols_5bits_aux_gain[32];
/* Borrowed from snd_sb_dsp */
extern int8_t scaleMap4[64];
extern uint8_t adjustMap4[64];
void
ad1848_setirq(ad1848_t *ad1848, int irq)
{
@@ -232,6 +236,7 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv)
case 9:
if (!ad1848->enable && (val & 0x41) == 0x01) {
ad1848->adpcm_pos = 0;
if (ad1848->timer_latch)
timer_set_delay_u64(&ad1848->timer_count, ad1848->timer_latch);
else
@@ -257,7 +262,8 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv)
break;
case 17:
if (ad1848->type >= AD1848_TYPE_CS4231) /* enable additional data formats on modes 2 and 3 */
/* Enable additional data formats on modes 2 and 3 where supported. */
if ((ad1848->type == AD1848_TYPE_CS4231) || (ad1848->type == AD1848_TYPE_CS4236))
ad1848->fmt_mask = (val & 0x40) ? 0xf0 : 0x70;
break;
@@ -414,6 +420,64 @@ ad1848_update(ad1848_t *ad1848)
}
}
static int16_t
ad1848_process_mulaw(uint8_t byte)
{
byte = ~byte;
int16_t dec = ((byte & 0x0f) << 3) + 0x84;
dec <<= (byte & 0x70) >> 4;
return (byte & 0x80) ? (0x84 - dec) : (dec - 0x84);
}
static int16_t
ad1848_process_alaw(uint8_t byte)
{
byte ^= 0x55;
int16_t dec = (byte & 0x0f) << 4;
int seg = (byte & 0x70) >> 4;
switch (seg) {
case 0:
dec |= 0x8;
break;
case 1:
dec |= 0x108;
break;
default:
dec |= 0x108;
dec <<= seg - 1;
break;
}
return (byte & 0x80) ? dec : -dec;
}
static int16_t
ad1848_process_adpcm(ad1848_t *ad1848)
{
int temp;
if (ad1848->adpcm_pos++ & 1) {
temp = (ad1848->adpcm_data & 0x0f) + ad1848->adpcm_step;
} else {
ad1848->adpcm_data = dma_channel_read(ad1848->dma);
temp = (ad1848->adpcm_data >> 4) + ad1848->adpcm_step;
}
if (temp < 0)
temp = 0;
else if (temp > 63)
temp = 63;
ad1848->adpcm_ref += scaleMap4[temp];
if (ad1848->adpcm_ref > 0xff)
ad1848->adpcm_ref = 0xff;
else if (ad1848->adpcm_ref < 0x00)
ad1848->adpcm_ref = 0x00;
ad1848->adpcm_step = (ad1848->adpcm_step + adjustMap4[temp]) & 0xff;
return (ad1848->adpcm_ref ^ 0x80) << 8;
}
static void
ad1848_poll(void *priv)
{
@@ -431,12 +495,21 @@ ad1848_poll(void *priv)
switch (ad1848->regs[8] & ad1848->fmt_mask) {
case 0x00: /* Mono, 8-bit PCM */
ad1848->out_l = ad1848->out_r = (dma_channel_read(ad1848->dma) ^ 0x80) * 256;
ad1848->out_l = ad1848->out_r = (dma_channel_read(ad1848->dma) ^ 0x80) << 8;
break;
case 0x10: /* Stereo, 8-bit PCM */
ad1848->out_l = (dma_channel_read(ad1848->dma) ^ 0x80) * 256;
ad1848->out_r = (dma_channel_read(ad1848->dma) ^ 0x80) * 256;
ad1848->out_l = (dma_channel_read(ad1848->dma) ^ 0x80) << 8;
ad1848->out_r = (dma_channel_read(ad1848->dma) ^ 0x80) << 8;
break;
case 0x20: /* Mono, 8-bit Mu-Law */
ad1848->out_l = ad1848->out_r = ad1848_process_mulaw(dma_channel_read(ad1848->dma));
break;
case 0x30: /* Stereo, 8-bit Mu-Law */
ad1848->out_l = ad1848_process_mulaw(dma_channel_read(ad1848->dma));
ad1848->out_r = ad1848_process_mulaw(dma_channel_read(ad1848->dma));
break;
case 0x40: /* Mono, 16-bit PCM little endian */
@@ -451,6 +524,26 @@ ad1848_poll(void *priv)
ad1848->out_r = (dma_channel_read(ad1848->dma) << 8) | temp;
break;
case 0x60: /* Mono, 8-bit A-Law */
ad1848->out_l = ad1848->out_r = ad1848_process_alaw(dma_channel_read(ad1848->dma));
break;
case 0x70: /* Stereo, 8-bit A-Law */
ad1848->out_l = ad1848_process_alaw(dma_channel_read(ad1848->dma));
ad1848->out_r = ad1848_process_alaw(dma_channel_read(ad1848->dma));
break;
/* 0x80 and 0x90 reserved */
case 0xa0: /* Mono, 4-bit ADPCM */
ad1848->out_l = ad1848->out_r = ad1848_process_adpcm(ad1848);
break;
case 0xb0: /* Stereo, 4-bit ADPCM */
ad1848->out_l = ad1848_process_adpcm(ad1848);
ad1848->out_r = ad1848_process_adpcm(ad1848);
break;
case 0xc0: /* Mono, 16-bit PCM big endian */
temp = dma_channel_read(ad1848->dma);
ad1848->out_l = ad1848->out_r = dma_channel_read(ad1848->dma) | (temp << 8);
@@ -462,6 +555,8 @@ ad1848_poll(void *priv)
temp = dma_channel_read(ad1848->dma);
ad1848->out_r = dma_channel_read(ad1848->dma) | (temp << 8);
break;
/* 0xe0 and 0xf0 reserved */
}
if (ad1848->regs[6] & 0x80)
@@ -475,7 +570,8 @@ ad1848_poll(void *priv)
ad1848->out_r = (ad1848->out_r * ad1848_vols_7bits[ad1848->regs[7] & ad1848->wave_vol_mask]) >> 16;
if (ad1848->count < 0) {
ad1848->count = ad1848->regs[15] | (ad1848->regs[14] << 8);
ad1848->count = ad1848->regs[15] | (ad1848->regs[14] << 8);
ad1848->adpcm_pos = 0;
if (!(ad1848->status & 0x01)) {
ad1848->status |= 0x01;
ad1848->regs[24] |= 0x10;
@@ -484,7 +580,8 @@ ad1848_poll(void *priv)
}
}
ad1848->count--;
if (!(ad1848->adpcm_pos & 7)) /* ADPCM counts down every 4 bytes */
ad1848->count--;
} else {
ad1848->out_l = ad1848->out_r = 0;
ad1848->cd_vol_l = ad1848->cd_vol_r = 0;
@@ -563,7 +660,10 @@ ad1848_init(ad1848_t *ad1848, uint8_t type)
ad1848->out_l = ad1848->out_r = 0;
ad1848->fm_vol_l = ad1848->fm_vol_r = 65536;
ad1848_updatevolmask(ad1848);
ad1848->fmt_mask = 0x70;
if (type == AD1848_TYPE_CS4235)
ad1848->fmt_mask = 0x50;
else
ad1848->fmt_mask = 0x70;
for (c = 0; c < 128; c++) {
attenuation = 0.0;

View File

@@ -2087,6 +2087,17 @@ static const device_config_t es1371_config[] = {
// clang-format on
};
static const device_config_t es1371_onboard_config[] = {
// clang-format off
{
"receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1
},
{
"", "", -1
}
// clang-format on
};
const device_t es1371_device = {
.name = "Ensoniq AudioPCI (ES1371)",
.internal_name = "es1371",
@@ -2112,5 +2123,5 @@ const device_t es1371_onboard_device = {
{ .available = NULL },
.speed_changed = es1371_speed_changed,
.force_redraw = NULL,
.config = NULL
.config = es1371_onboard_config
};

1525
src/sound/snd_cmi8x38.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -727,7 +727,7 @@ cs423x_init(const device_t *info)
case CRYSTAL_CS4237B:
case CRYSTAL_CS4238B:
/* Same WSS codec and EEPROM structure. */
dev->ad1848_type = AD1848_TYPE_CS4236;
dev->ad1848_type = (dev->type == CRYSTAL_CS4235) ? AD1848_TYPE_CS4235 : AD1848_TYPE_CS4236;
dev->pnp_offset = 0x4013;
/* Different Chip Version and ID registers, which shouldn't be reset by ad1848_init */
@@ -827,71 +827,71 @@ cs423x_speed_changed(void *priv)
}
const device_t cs4235_device = {
.name = "Crystal CS4235",
.name = "Crystal CS4235",
.internal_name = "cs4235",
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4235,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4235,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
{ .available = NULL },
.speed_changed = cs423x_speed_changed,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t cs4235_onboard_device = {
.name = "Crystal CS4235 (On-Board)",
.name = "Crystal CS4235 (On-Board)",
.internal_name = "cs4235_onboard",
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4235 | CRYSTAL_NOEEPROM,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4235 | CRYSTAL_NOEEPROM,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
{ .available = NULL },
.speed_changed = cs423x_speed_changed,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t cs4236b_device = {
.name = "Crystal CS4236B",
.name = "Crystal CS4236B",
.internal_name = "cs4236b",
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4236B,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4236B,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
{ .available = NULL },
.speed_changed = cs423x_speed_changed,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t cs4237b_device = {
.name = "Crystal CS4237B",
.name = "Crystal CS4237B",
.internal_name = "cs4237b",
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4237B,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4237B,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
{ .available = NULL },
.speed_changed = cs423x_speed_changed,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t cs4238b_device = {
.name = "Crystal CS4238B",
.name = "Crystal CS4238B",
.internal_name = "cs4238b",
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4238B,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
.flags = DEVICE_ISA | DEVICE_AT,
.local = CRYSTAL_CS4238B,
.init = cs423x_init,
.close = cs423x_close,
.reset = cs423x_reset,
{ .available = NULL },
.speed_changed = cs423x_speed_changed,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};

View File

@@ -1222,7 +1222,7 @@ MPU401_ReadData(mpu_t *mpu)
return ret;
}
static void
void
mpu401_write(uint16_t addr, uint8_t val, void *priv)
{
mpu_t *mpu = (mpu_t *) priv;
@@ -1241,7 +1241,7 @@ mpu401_write(uint16_t addr, uint8_t val, void *priv)
}
}
static uint8_t
uint8_t
mpu401_read(uint16_t addr, void *priv)
{
mpu_t *mpu = (mpu_t *) priv;

View File

@@ -376,9 +376,14 @@ sb_get_buffer_sb16_awe32(int32_t *buffer, int len, void *p)
in_r = (mixer->input_selector_right & INPUT_MIDI_L) ? ((int32_t) out_l) : 0 + (mixer->input_selector_right & INPUT_MIDI_R) ? ((int32_t) out_r)
: 0;
/* We divide by 3 to get the volume down to normal. */
out_l += (low_fir_sb16(0, 0, (double) sb->dsp.buffer[c]) * mixer->voice_l) / 3.0;
out_r += (low_fir_sb16(0, 1, (double) sb->dsp.buffer[c + 1]) * mixer->voice_r) / 3.0;
if (mixer->output_filter) {
/* We divide by 3 to get the volume down to normal. */
out_l += (low_fir_sb16(0, 0, (double) sb->dsp.buffer[c]) * mixer->voice_l) / 3.0;
out_r += (low_fir_sb16(0, 1, (double) sb->dsp.buffer[c + 1]) * mixer->voice_r) / 3.0;
} else {
out_l += (((double) sb->dsp.buffer[c]) * mixer->voice_l) / 3.0;
out_r += (((double) sb->dsp.buffer[c + 1]) * mixer->voice_r) / 3.0;
}
out_l *= mixer->master_l;
out_r *= mixer->master_r;
@@ -459,7 +464,7 @@ sb_get_buffer_sb16_awe32(int32_t *buffer, int len, void *p)
sb->emu8k.pos = 0;
}
static void
void
sb16_awe32_filter_cd_audio(int channel, double *buffer, void *p)
{
sb_t *sb = (sb_t *) p;
@@ -472,7 +477,10 @@ sb16_awe32_filter_cd_audio(int channel, double *buffer, void *p)
double bass_treble;
double output_gain = (channel ? mixer->output_gain_R : mixer->output_gain_L);
c = (low_fir_sb16(1, channel, *buffer) * cd) / 3.0;
if (mixer->output_filter)
c = (low_fir_sb16(1, channel, *buffer) * cd) / 3.0;
else
c = ((*buffer) * cd) / 3.0;
c *= master;
/* This is not exactly how one does bass/treble controls, but the end result is like it.
@@ -706,7 +714,7 @@ sb_ct1345_mixer_reset(sb_t *sb)
sb_ct1345_mixer_write(5, 0, sb);
}
static void
void
sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *p)
{
sb_t *sb = (sb_t *) p;
@@ -876,7 +884,7 @@ sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *p)
}
}
static uint8_t
uint8_t
sb_ct1745_mixer_read(uint16_t addr, void *p)
{
sb_t *sb = (sb_t *) p;
@@ -1046,7 +1054,7 @@ sb_ct1745_mixer_read(uint16_t addr, void *p)
return ret;
}
static void
void
sb_ct1745_mixer_reset(sb_t *sb)
{
sb_ct1745_mixer_write(4, 0, sb);
@@ -1756,11 +1764,10 @@ sb_16_init(const device_t *info)
&sb->opl);
}
sb->mixer_enabled = 1;
io_sethandler(addr + 4, 0x0002,
sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL,
sb);
sb->mixer_enabled = 1;
sb->mixer_sb16.output_filter = 1;
io_sethandler(addr + 4, 0x0002, sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL, sb);
sound_add_handler(sb_get_buffer_sb16_awe32, sb);
sound_set_cd_audio_filter(sb16_awe32_filter_cd_audio, sb);
@@ -1790,7 +1797,8 @@ sb_16_pnp_init(const device_t *info)
sb_dsp_init(&sb->dsp, SB16, SB_SUBTYPE_DEFAULT, sb);
sb_ct1745_mixer_reset(sb);
sb->mixer_enabled = 1;
sb->mixer_enabled = 1;
sb->mixer_sb16.output_filter = 1;
sound_add_handler(sb_get_buffer_sb16_awe32, sb);
sound_set_cd_audio_filter(sb16_awe32_filter_cd_audio, sb);
@@ -1811,6 +1819,28 @@ sb_16_pnp_init(const device_t *info)
return sb;
}
static void *
sb_16_compat_init(const device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
memset(sb, 0, sizeof(sb_t));
opl3_init(&sb->opl);
sb_dsp_init(&sb->dsp, SB16, SB_SUBTYPE_DEFAULT, sb);
sb_ct1745_mixer_reset(sb);
sb->mixer_enabled = 1;
sound_add_handler(sb_get_buffer_sb16_awe32, sb);
sb->mpu = (mpu_t *) malloc(sizeof(mpu_t));
memset(sb->mpu, 0, sizeof(mpu_t));
mpu401_init(sb->mpu, 0, 0, M_UART, info->local);
sb_dsp_set_mpu(&sb->dsp, sb->mpu);
return sb;
}
static int
sb_awe32_available()
{
@@ -1884,11 +1914,10 @@ sb_awe32_init(const device_t *info)
&sb->opl);
}
sb->mixer_enabled = 1;
io_sethandler(addr + 4, 0x0002,
sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL,
sb);
sb->mixer_enabled = 1;
sb->mixer_sb16.output_filter = 1;
io_sethandler(addr + 4, 0x0002, sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL, sb);
sound_add_handler(sb_get_buffer_sb16_awe32, sb);
sound_set_cd_audio_filter(sb16_awe32_filter_cd_audio, sb);
@@ -1922,7 +1951,8 @@ sb_awe32_pnp_init(const device_t *info)
sb_dsp_init(&sb->dsp, ((info->local == 2) || (info->local == 3) || (info->local == 4)) ? SBAWE64 : SBAWE32, SB_SUBTYPE_DEFAULT, sb);
sb_ct1745_mixer_reset(sb);
sb->mixer_enabled = 1;
sb->mixer_enabled = 1;
sb->mixer_sb16.output_filter = 1;
sound_add_handler(sb_get_buffer_sb16_awe32, sb);
sound_set_cd_audio_filter(sb16_awe32_filter_cd_audio, sb);
@@ -2394,225 +2424,253 @@ static const device_config_t sb_awe64_gold_config[] = {
// clang-format on
const device_t sb_1_device = {
.name = "Sound Blaster v1.0",
.name = "Sound Blaster v1.0",
.internal_name = "sb",
.flags = DEVICE_ISA,
.local = 0,
.init = sb_1_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = sb_1_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_config
.force_redraw = NULL,
.config = sb_config
};
const device_t sb_15_device = {
.name = "Sound Blaster v1.5",
.name = "Sound Blaster v1.5",
.internal_name = "sb1.5",
.flags = DEVICE_ISA,
.local = 0,
.init = sb_15_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = sb_15_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb15_config
.force_redraw = NULL,
.config = sb15_config
};
const device_t sb_mcv_device = {
.name = "Sound Blaster MCV",
.name = "Sound Blaster MCV",
.internal_name = "sbmcv",
.flags = DEVICE_MCA,
.local = 0,
.init = sb_mcv_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_MCA,
.local = 0,
.init = sb_mcv_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_mcv_config
.force_redraw = NULL,
.config = sb_mcv_config
};
const device_t sb_2_device = {
.name = "Sound Blaster v2.0",
.name = "Sound Blaster v2.0",
.internal_name = "sb2.0",
.flags = DEVICE_ISA,
.local = 0,
.init = sb_2_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = sb_2_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb2_config
.force_redraw = NULL,
.config = sb2_config
};
const device_t sb_pro_v1_device = {
.name = "Sound Blaster Pro v1",
.name = "Sound Blaster Pro v1",
.internal_name = "sbprov1",
.flags = DEVICE_ISA,
.local = 0,
.init = sb_pro_v1_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = sb_pro_v1_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_pro_config
.force_redraw = NULL,
.config = sb_pro_config
};
const device_t sb_pro_v2_device = {
.name = "Sound Blaster Pro v2",
.name = "Sound Blaster Pro v2",
.internal_name = "sbprov2",
.flags = DEVICE_ISA,
.local = 0,
.init = sb_pro_v2_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = sb_pro_v2_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_pro_config
.force_redraw = NULL,
.config = sb_pro_config
};
const device_t sb_pro_mcv_device = {
.name = "Sound Blaster Pro MCV",
.name = "Sound Blaster Pro MCV",
.internal_name = "sbpromcv",
.flags = DEVICE_MCA,
.local = 0,
.init = sb_pro_mcv_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_MCA,
.local = 0,
.init = sb_pro_mcv_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t sb_pro_compat_device = {
.name = "Sound Blaster Pro (Compatibility)",
.name = "Sound Blaster Pro (Compatibility)",
.internal_name = "sbpro_compat",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_pro_compat_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_pro_compat_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t sb_16_device = {
.name = "Sound Blaster 16",
.name = "Sound Blaster 16",
.internal_name = "sb16",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_16_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_16_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_16_config
.force_redraw = NULL,
.config = sb_16_config
};
const device_t sb_16_pnp_device = {
.name = "Sound Blaster 16 PnP",
.name = "Sound Blaster 16 PnP",
.internal_name = "sb16_pnp",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_16_pnp_init,
.close = sb_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_16_pnp_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_16_pnp_config
.force_redraw = NULL,
.config = sb_16_pnp_config
};
const device_t sb_16_compat_device = {
.name = "Sound Blaster 16 (Compatibility)",
.internal_name = "sb16_compat",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 1,
.init = sb_16_compat_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = NULL
};
const device_t sb_16_compat_nompu_device = {
.name = "Sound Blaster 16 (Compatibility - MPU-401 Off)",
.internal_name = "sb16_compat",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_16_compat_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = NULL
};
const device_t sb_32_pnp_device = {
.name = "Sound Blaster 32 PnP",
.name = "Sound Blaster 32 PnP",
.internal_name = "sb32_pnp",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
{ .available = sb_32_pnp_available },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_32_pnp_config
.force_redraw = NULL,
.config = sb_32_pnp_config
};
const device_t sb_awe32_device = {
.name = "Sound Blaster AWE32",
.name = "Sound Blaster AWE32",
.internal_name = "sbawe32",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_awe32_init,
.close = sb_awe32_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_awe32_init,
.close = sb_awe32_close,
.reset = NULL,
{ .available = sb_awe32_available },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_awe32_config
.force_redraw = NULL,
.config = sb_awe32_config
};
const device_t sb_awe32_pnp_device = {
.name = "Sound Blaster AWE32 PnP",
.name = "Sound Blaster AWE32 PnP",
.internal_name = "sbawe32_pnp",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 1,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 1,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
{ .available = sb_awe32_pnp_available },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_awe32_pnp_config
.force_redraw = NULL,
.config = sb_awe32_pnp_config
};
const device_t sb_awe64_value_device = {
.name = "Sound Blaster AWE64 Value",
.name = "Sound Blaster AWE64 Value",
.internal_name = "sbawe64_value",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 2,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 2,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
{ .available = sb_awe64_value_available },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_awe64_value_config
.force_redraw = NULL,
.config = sb_awe64_value_config
};
const device_t sb_awe64_device = {
.name = "Sound Blaster AWE64",
.name = "Sound Blaster AWE64",
.internal_name = "sbawe64",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 3,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 3,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
{ .available = sb_awe64_available },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_awe64_config
.force_redraw = NULL,
.config = sb_awe64_config
};
const device_t sb_awe64_gold_device = {
.name = "Sound Blaster AWE64 Gold",
.name = "Sound Blaster AWE64 Gold",
.internal_name = "sbawe64_gold",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 4,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 4,
.init = sb_awe32_pnp_init,
.close = sb_awe32_close,
.reset = NULL,
{ .available = sb_awe64_gold_available },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_awe64_gold_config
.force_redraw = NULL,
.config = sb_awe64_gold_config
};

View File

@@ -169,6 +169,16 @@ recalc_sb16_filter(int c, int playback_freq)
low_fir_sb16_coef[c][n] /= gain;
}
static void
sb_irq_update_pic(void *priv, int set)
{
sb_dsp_t *dsp = (sb_dsp_t *) priv;
if (set)
picint(1 << dsp->sb_irqnum);
else
picintc(1 << dsp->sb_irqnum);
}
void
sb_update_mask(sb_dsp_t *dsp, int irqm8, int irqm16, int irqm401)
{
@@ -185,7 +195,7 @@ sb_update_mask(sb_dsp_t *dsp, int irqm8, int irqm16, int irqm401)
dsp->sb_irqm401 = irqm401;
if (clear)
picintc(1 << dsp->sb_irqnum);
dsp->irq_update(dsp->irq_priv, 0);
}
void
@@ -210,9 +220,9 @@ sb_update_status(sb_dsp_t *dsp, int bit, int set)
}
if (set && !masked)
picint(1 << dsp->sb_irqnum);
dsp->irq_update(dsp->irq_priv, 1);
else if (!set)
picintc(1 << dsp->sb_irqnum);
dsp->irq_update(dsp->irq_priv, 0);
}
void
@@ -281,7 +291,7 @@ sb_dsp_reset(sb_dsp_t *dsp)
dsp->record_pos_read = 0;
dsp->record_pos_write = SB_DSP_REC_SAFEFTY_MARGIN;
picintc(1 << dsp->sb_irqnum);
dsp->irq_update(dsp->irq_priv, 0);
dsp->asp_data_len = 0;
}
@@ -339,7 +349,7 @@ sb_start_dma(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
dsp->sb_pausetime = -1;
if (dma8) {
dsp->sb_8_length = len;
dsp->sb_8_length = dsp->sb_8_origlength = len;
dsp->sb_8_format = format;
dsp->sb_8_autoinit = autoinit;
dsp->sb_8_pause = 0;
@@ -350,10 +360,10 @@ sb_start_dma(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
dsp->sb_8_output = 1;
if (!timer_is_enabled(&dsp->output_timer))
timer_set_delay_u64(&dsp->output_timer, dsp->sblatcho);
dsp->sbleftright = 0;
dsp->sbleftright = dsp->sbleftright_default;
dsp->sbdacpos = 0;
} else {
dsp->sb_16_length = len;
dsp->sb_16_length = dsp->sb_16_origlength = len;
dsp->sb_16_format = format;
dsp->sb_16_autoinit = autoinit;
dsp->sb_16_pause = 0;
@@ -370,7 +380,7 @@ void
sb_start_dma_i(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
{
if (dma8) {
dsp->sb_8_length = len;
dsp->sb_8_length = dsp->sb_8_origlength = len;
dsp->sb_8_format = format;
dsp->sb_8_autoinit = autoinit;
dsp->sb_8_pause = 0;
@@ -381,7 +391,7 @@ sb_start_dma_i(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
if (!timer_is_enabled(&dsp->input_timer))
timer_set_delay_u64(&dsp->input_timer, dsp->sblatchi);
} else {
dsp->sb_16_length = len;
dsp->sb_16_length = dsp->sb_16_origlength = len;
dsp->sb_16_format = format;
dsp->sb_16_autoinit = autoinit;
dsp->sb_16_pause = 0;
@@ -397,29 +407,31 @@ sb_start_dma_i(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
}
int
sb_8_read_dma(sb_dsp_t *dsp)
sb_8_read_dma(void *priv)
{
sb_dsp_t *dsp = (sb_dsp_t *) priv;
return dma_channel_read(dsp->sb_8_dmanum);
}
void
sb_8_write_dma(sb_dsp_t *dsp, uint8_t val)
int
sb_8_write_dma(void *priv, uint8_t val)
{
dma_channel_write(dsp->sb_8_dmanum, val);
sb_dsp_t *dsp = (sb_dsp_t *) priv;
return dma_channel_write(dsp->sb_8_dmanum, val) == DMA_NODATA;
}
int
sb_16_read_dma(sb_dsp_t *dsp)
sb_16_read_dma(void *priv)
{
sb_dsp_t *dsp = (sb_dsp_t *) priv;
return dma_channel_read(dsp->sb_16_dmanum);
}
int
sb_16_write_dma(sb_dsp_t *dsp, uint16_t val)
sb_16_write_dma(void *priv, uint16_t val)
{
int ret = dma_channel_write(dsp->sb_16_dmanum, val);
return (ret == DMA_NODATA);
sb_dsp_t *dsp = (sb_dsp_t *) priv;
return dma_channel_write(dsp->sb_16_dmanum, val) == DMA_NODATA;
}
void
@@ -469,12 +481,12 @@ sb_exec_command(sb_dsp_t *dsp)
sb_start_dma(dsp, 1, 0, 0, dsp->sb_data[0] + (dsp->sb_data[1] << 8));
break;
case 0x17: /* 2-bit ADPCM output with reference */
dsp->sbref = sb_8_read_dma(dsp);
dsp->sbref = dsp->dma_readb(dsp->dma_priv);
dsp->sbstep = 0;
/* Fall through */
case 0x16: /* 2-bit ADPCM output */
sb_start_dma(dsp, 1, 0, ADPCM_2, dsp->sb_data[0] + (dsp->sb_data[1] << 8));
dsp->sbdat2 = sb_8_read_dma(dsp);
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
dsp->sb_8_length--;
if (dsp->sb_command == 0x17)
dsp->sb_8_length--;
@@ -486,7 +498,7 @@ sb_exec_command(sb_dsp_t *dsp)
case 0x1F: /* 2-bit ADPCM autoinit output */
if (dsp->sb_type >= SB15) {
sb_start_dma(dsp, 1, 1, ADPCM_2, dsp->sb_data[0] + (dsp->sb_data[1] << 8));
dsp->sbdat2 = sb_8_read_dma(dsp);
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
dsp->sb_8_length--;
}
break;
@@ -581,23 +593,23 @@ sb_exec_command(sb_dsp_t *dsp)
dsp->sb_8_autolen = dsp->sb_data[0] + (dsp->sb_data[1] << 8);
break;
case 0x75: /* 4-bit ADPCM output with reference */
dsp->sbref = sb_8_read_dma(dsp);
dsp->sbref = dsp->dma_readb(dsp->dma_priv);
dsp->sbstep = 0;
/* Fall through */
case 0x74: /* 4-bit ADPCM output */
sb_start_dma(dsp, 1, 0, ADPCM_4, dsp->sb_data[0] + (dsp->sb_data[1] << 8));
dsp->sbdat2 = sb_8_read_dma(dsp);
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
dsp->sb_8_length--;
if (dsp->sb_command == 0x75)
dsp->sb_8_length--;
break;
case 0x77: /* 2.6-bit ADPCM output with reference */
dsp->sbref = sb_8_read_dma(dsp);
dsp->sbref = dsp->dma_readb(dsp->dma_priv);
dsp->sbstep = 0;
/* Fall through */
case 0x76: /* 2.6-bit ADPCM output */
sb_start_dma(dsp, 1, 0, ADPCM_26, dsp->sb_data[0] + (dsp->sb_data[1] << 8));
dsp->sbdat2 = sb_8_read_dma(dsp);
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
dsp->sb_8_length--;
if (dsp->sb_command == 0x77)
dsp->sb_8_length--;
@@ -605,14 +617,14 @@ sb_exec_command(sb_dsp_t *dsp)
case 0x7D: /* 4-bit ADPCM autoinit output */
if (dsp->sb_type >= SB15) {
sb_start_dma(dsp, 1, 1, ADPCM_4, dsp->sb_data[0] + (dsp->sb_data[1] << 8));
dsp->sbdat2 = sb_8_read_dma(dsp);
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
dsp->sb_8_length--;
}
break;
case 0x7F: /* 2.6-bit ADPCM autoinit output */
if (dsp->sb_type >= SB15) {
sb_start_dma(dsp, 1, 1, ADPCM_26, dsp->sb_data[0] + (dsp->sb_data[1] << 8));
dsp->sbdat2 = sb_8_read_dma(dsp);
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
dsp->sb_8_length--;
}
break;
@@ -757,7 +769,7 @@ sb_exec_command(sb_dsp_t *dsp)
}
dsp->sbe2 += sbe2dat[dsp->sbe2count & 3][8];
dsp->sbe2count++;
sb_8_write_dma(dsp, dsp->sbe2);
dsp->dma_writeb(dsp->dma_priv, dsp->sbe2);
break;
case 0xE3: /* DSP copyright */
if (dsp->sb_type >= SB16) {
@@ -1016,7 +1028,7 @@ sb_read(uint16_t a, void *priv)
}
break;
case 0xE: /* Read data ready */
picintc(1 << dsp->sb_irqnum);
dsp->irq_update(dsp->irq_priv, 0);
dsp->sb_irq8 = dsp->sb_irq16 = 0;
/* Only bit 7 is defined but aztech diagnostics fail if the others are set. Keep the original behavior to not interfere with what's already working. */
if (IS_AZTECH(dsp)) {
@@ -1030,7 +1042,7 @@ sb_read(uint16_t a, void *priv)
case 0xF: /* 16-bit ack */
dsp->sb_irq16 = 0;
if (!dsp->sb_irq8)
picintc(1 << dsp->sb_irqnum);
dsp->irq_update(dsp->irq_priv, 0);
sb_dsp_log("SB 16-bit ACK read 0xFF\n");
ret = 0xff;
break;
@@ -1108,6 +1120,16 @@ sb_dsp_init(sb_dsp_t *dsp, int type, int subtype, void *parent)
dsp->sb_16_dmanum = 5;
dsp->mpu = NULL;
dsp->sbleftright_default = 0;
dsp->irq_update = sb_irq_update_pic;
dsp->irq_priv = dsp;
dsp->dma_readb = sb_8_read_dma;
dsp->dma_readw = sb_16_read_dma;
dsp->dma_writeb = sb_8_write_dma;
dsp->dma_writew = sb_16_write_dma;
dsp->dma_priv = dsp;
sb_doreset(dsp);
timer_add(&dsp->output_timer, pollsb, dsp, 0);
@@ -1149,6 +1171,28 @@ sb_dsp_set_stereo(sb_dsp_t *dsp, int stereo)
dsp->stereo = stereo;
}
void
sb_dsp_irq_attach(sb_dsp_t *dsp, void (*irq_update)(void *priv, int set), void *priv)
{
dsp->irq_update = irq_update;
dsp->irq_priv = priv;
}
void
sb_dsp_dma_attach(sb_dsp_t *dsp,
int (*dma_readb)(void *priv),
int (*dma_readw)(void *priv),
int (*dma_writeb)(void *priv, uint8_t val),
int (*dma_writew)(void *priv, uint16_t val),
void *priv)
{
dsp->dma_readb = dma_readb;
dsp->dma_readw = dma_readw;
dsp->dma_writeb = dma_writeb;
dsp->dma_writew = dma_writew;
dsp->dma_priv = priv;
}
void
pollsb(void *p)
{
@@ -1162,13 +1206,13 @@ pollsb(void *p)
switch (dsp->sb_8_format) {
case 0x00: /* Mono unsigned */
data[0] = sb_8_read_dma(dsp);
data[0] = dsp->dma_readb(dsp->dma_priv);
/* Needed to prevent clicking in Worms, which programs the DSP to
auto-init DMA but programs the DMA controller to single cycle */
if (data[0] == DMA_NODATA)
break;
dsp->sbdat = (data[0] ^ 0x80) << 8;
if ((dsp->sb_type >= SBPRO) && (dsp->sb_type < SB16) && dsp->stereo) {
if (dsp->stereo) {
sb_dsp_log("pollsb: Mono unsigned, dsp->stereo, %s channel, %04X\n",
dsp->sbleftright ? "left" : "right", dsp->sbdat);
if (dsp->sbleftright)
@@ -1181,11 +1225,11 @@ pollsb(void *p)
dsp->sb_8_length--;
break;
case 0x10: /* Mono signed */
data[0] = sb_8_read_dma(dsp);
data[0] = dsp->dma_readb(dsp->dma_priv);
if (data[0] == DMA_NODATA)
break;
dsp->sbdat = data[0] << 8;
if ((dsp->sb_type >= SBPRO) && (dsp->sb_type < SB16) && dsp->stereo) {
if (dsp->stereo) {
sb_dsp_log("pollsb: Mono signed, dsp->stereo, %s channel, %04X\n",
dsp->sbleftright ? "left" : "right", data[0], dsp->sbdat);
if (dsp->sbleftright)
@@ -1198,8 +1242,8 @@ pollsb(void *p)
dsp->sb_8_length--;
break;
case 0x20: /* Stereo unsigned */
data[0] = sb_8_read_dma(dsp);
data[1] = sb_8_read_dma(dsp);
data[0] = dsp->dma_readb(dsp->dma_priv);
data[1] = dsp->dma_readb(dsp->dma_priv);
if ((data[0] == DMA_NODATA) || (data[1] == DMA_NODATA))
break;
dsp->sbdatl = (data[0] ^ 0x80) << 8;
@@ -1207,8 +1251,8 @@ pollsb(void *p)
dsp->sb_8_length -= 2;
break;
case 0x30: /* Stereo signed */
data[0] = sb_8_read_dma(dsp);
data[1] = sb_8_read_dma(dsp);
data[0] = dsp->dma_readb(dsp->dma_priv);
data[1] = dsp->dma_readb(dsp->dma_priv);
if ((data[0] == DMA_NODATA) || (data[1] == DMA_NODATA))
break;
dsp->sbdatl = data[0] << 8;
@@ -1241,11 +1285,11 @@ pollsb(void *p)
if (dsp->sbdacpos >= 2) {
dsp->sbdacpos = 0;
dsp->sbdat2 = sb_8_read_dma(dsp);
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
dsp->sb_8_length--;
}
if ((dsp->sb_type >= SBPRO) && (dsp->sb_type < SB16) && dsp->stereo) {
if (dsp->stereo) {
sb_dsp_log("pollsb: ADPCM 4, dsp->stereo, %s channel, %04X\n",
dsp->sbleftright ? "left" : "right", dsp->sbdat);
if (dsp->sbleftright)
@@ -1284,11 +1328,11 @@ pollsb(void *p)
dsp->sbdacpos++;
if (dsp->sbdacpos >= 3) {
dsp->sbdacpos = 0;
dsp->sbdat2 = sb_8_read_dma(dsp);
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
dsp->sb_8_length--;
}
if ((dsp->sb_type >= SBPRO) && (dsp->sb_type < SB16) && dsp->stereo) {
if (dsp->stereo) {
sb_dsp_log("pollsb: ADPCM 26, dsp->stereo, %s channel, %04X\n",
dsp->sbleftright ? "left" : "right", dsp->sbdat);
if (dsp->sbleftright)
@@ -1321,10 +1365,10 @@ pollsb(void *p)
dsp->sbdacpos++;
if (dsp->sbdacpos >= 4) {
dsp->sbdacpos = 0;
dsp->sbdat2 = sb_8_read_dma(dsp);
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
}
if ((dsp->sb_type >= SBPRO) && (dsp->sb_type < SB16) && dsp->stereo) {
if (dsp->stereo) {
sb_dsp_log("pollsb: ADPCM 2, dsp->stereo, %s channel, %04X\n",
dsp->sbleftright ? "left" : "right", dsp->sbdat);
if (dsp->sbleftright)
@@ -1339,7 +1383,7 @@ pollsb(void *p)
if (dsp->sb_8_length < 0) {
if (dsp->sb_8_autoinit)
dsp->sb_8_length = dsp->sb_8_autolen;
dsp->sb_8_length = dsp->sb_8_origlength = dsp->sb_8_autolen;
else {
dsp->sb_8_enable = 0;
timer_disable(&dsp->output_timer);
@@ -1352,22 +1396,22 @@ pollsb(void *p)
switch (dsp->sb_16_format) {
case 0x00: /* Mono unsigned */
data[0] = sb_16_read_dma(dsp);
data[0] = dsp->dma_readw(dsp->dma_priv);
if (data[0] == DMA_NODATA)
break;
dsp->sbdatl = dsp->sbdatr = data[0] ^ 0x8000;
dsp->sb_16_length--;
break;
case 0x10: /* Mono signed */
data[0] = sb_16_read_dma(dsp);
data[0] = dsp->dma_readw(dsp->dma_priv);
if (data[0] == DMA_NODATA)
break;
dsp->sbdatl = dsp->sbdatr = data[0];
dsp->sb_16_length--;
break;
case 0x20: /* Stereo unsigned */
data[0] = sb_16_read_dma(dsp);
data[1] = sb_16_read_dma(dsp);
data[0] = dsp->dma_readw(dsp->dma_priv);
data[1] = dsp->dma_readw(dsp->dma_priv);
if ((data[0] == DMA_NODATA) || (data[1] == DMA_NODATA))
break;
dsp->sbdatl = data[0] ^ 0x8000;
@@ -1375,8 +1419,8 @@ pollsb(void *p)
dsp->sb_16_length -= 2;
break;
case 0x30: /* Stereo signed */
data[0] = sb_16_read_dma(dsp);
data[1] = sb_16_read_dma(dsp);
data[0] = dsp->dma_readw(dsp->dma_priv);
data[1] = dsp->dma_readw(dsp->dma_priv);
if ((data[0] == DMA_NODATA) || (data[1] == DMA_NODATA))
break;
dsp->sbdatl = data[0];
@@ -1388,7 +1432,7 @@ pollsb(void *p)
if (dsp->sb_16_length < 0) {
sb_dsp_log("16DMA over %i\n", dsp->sb_16_autoinit);
if (dsp->sb_16_autoinit)
dsp->sb_16_length = dsp->sb_16_autolen;
dsp->sb_16_length = dsp->sb_16_origlength = dsp->sb_16_autolen;
else {
dsp->sb_16_enable = 0;
timer_disable(&dsp->output_timer);
@@ -1418,27 +1462,27 @@ sb_poll_i(void *p)
if (dsp->sb_8_enable && !dsp->sb_8_pause && dsp->sb_pausetime < 0 && !dsp->sb_8_output) {
switch (dsp->sb_8_format) {
case 0x00: /* Mono unsigned As the manual says, only the left channel is recorded */
sb_8_write_dma(dsp, (dsp->record_buffer[dsp->record_pos_read] >> 8) ^ 0x80);
dsp->dma_writeb(dsp->dma_priv, (dsp->record_buffer[dsp->record_pos_read] >> 8) ^ 0x80);
dsp->sb_8_length--;
dsp->record_pos_read += 2;
dsp->record_pos_read &= 0xFFFF;
break;
case 0x10: /* Mono signed As the manual says, only the left channel is recorded */
sb_8_write_dma(dsp, (dsp->record_buffer[dsp->record_pos_read] >> 8));
dsp->dma_writeb(dsp->dma_priv, (dsp->record_buffer[dsp->record_pos_read] >> 8));
dsp->sb_8_length--;
dsp->record_pos_read += 2;
dsp->record_pos_read &= 0xFFFF;
break;
case 0x20: /* Stereo unsigned */
sb_8_write_dma(dsp, (dsp->record_buffer[dsp->record_pos_read] >> 8) ^ 0x80);
sb_8_write_dma(dsp, (dsp->record_buffer[dsp->record_pos_read + 1] >> 8) ^ 0x80);
dsp->dma_writeb(dsp->dma_priv, (dsp->record_buffer[dsp->record_pos_read] >> 8) ^ 0x80);
dsp->dma_writeb(dsp->dma_priv, (dsp->record_buffer[dsp->record_pos_read + 1] >> 8) ^ 0x80);
dsp->sb_8_length -= 2;
dsp->record_pos_read += 2;
dsp->record_pos_read &= 0xFFFF;
break;
case 0x30: /* Stereo signed */
sb_8_write_dma(dsp, (dsp->record_buffer[dsp->record_pos_read] >> 8));
sb_8_write_dma(dsp, (dsp->record_buffer[dsp->record_pos_read + 1] >> 8));
dsp->dma_writeb(dsp->dma_priv, (dsp->record_buffer[dsp->record_pos_read] >> 8));
dsp->dma_writeb(dsp->dma_priv, (dsp->record_buffer[dsp->record_pos_read + 1] >> 8));
dsp->sb_8_length -= 2;
dsp->record_pos_read += 2;
dsp->record_pos_read &= 0xFFFF;
@@ -1447,7 +1491,7 @@ sb_poll_i(void *p)
if (dsp->sb_8_length < 0) {
if (dsp->sb_8_autoinit)
dsp->sb_8_length = dsp->sb_8_autolen;
dsp->sb_8_length = dsp->sb_8_origlength = dsp->sb_8_autolen;
else {
dsp->sb_8_enable = 0;
timer_disable(&dsp->input_timer);
@@ -1459,31 +1503,31 @@ sb_poll_i(void *p)
if (dsp->sb_16_enable && !dsp->sb_16_pause && (dsp->sb_pausetime < 0LL) && !dsp->sb_16_output) {
switch (dsp->sb_16_format) {
case 0x00: /* Unsigned mono. As the manual says, only the left channel is recorded */
if (sb_16_write_dma(dsp, dsp->record_buffer[dsp->record_pos_read] ^ 0x8000))
if (dsp->dma_writew(dsp->dma_priv, dsp->record_buffer[dsp->record_pos_read] ^ 0x8000))
return;
dsp->sb_16_length--;
dsp->record_pos_read += 2;
dsp->record_pos_read &= 0xFFFF;
break;
case 0x10: /* Signed mono. As the manual says, only the left channel is recorded */
if (sb_16_write_dma(dsp, dsp->record_buffer[dsp->record_pos_read]))
if (dsp->dma_writew(dsp->dma_priv, dsp->record_buffer[dsp->record_pos_read]))
return;
dsp->sb_16_length--;
dsp->record_pos_read += 2;
dsp->record_pos_read &= 0xFFFF;
break;
case 0x20: /* Unsigned stereo */
if (sb_16_write_dma(dsp, dsp->record_buffer[dsp->record_pos_read] ^ 0x8000))
if (dsp->dma_writew(dsp->dma_priv, dsp->record_buffer[dsp->record_pos_read] ^ 0x8000))
return;
sb_16_write_dma(dsp, dsp->record_buffer[dsp->record_pos_read + 1] ^ 0x8000);
dsp->dma_writew(dsp->dma_priv, dsp->record_buffer[dsp->record_pos_read + 1] ^ 0x8000);
dsp->sb_16_length -= 2;
dsp->record_pos_read += 2;
dsp->record_pos_read &= 0xFFFF;
break;
case 0x30: /* Signed stereo */
if (sb_16_write_dma(dsp, dsp->record_buffer[dsp->record_pos_read]))
if (dsp->dma_writew(dsp->dma_priv, dsp->record_buffer[dsp->record_pos_read]))
return;
sb_16_write_dma(dsp, dsp->record_buffer[dsp->record_pos_read + 1]);
dsp->dma_writew(dsp->dma_priv, dsp->record_buffer[dsp->record_pos_read + 1]);
dsp->sb_16_length -= 2;
dsp->record_pos_read += 2;
dsp->record_pos_read &= 0xFFFF;
@@ -1492,7 +1536,7 @@ sb_poll_i(void *p)
if (dsp->sb_16_length < 0) {
if (dsp->sb_16_autoinit)
dsp->sb_16_length = dsp->sb_16_autolen;
dsp->sb_16_length = dsp->sb_16_origlength = dsp->sb_16_autolen;
else {
dsp->sb_16_enable = 0;
timer_disable(&dsp->input_timer);

View File

@@ -139,6 +139,8 @@ static const SOUND_CARD sound_cards[] = {
{ &ncr_business_audio_device },
{ &sb_mcv_device },
{ &sb_pro_mcv_device },
{ &cmi8338_device },
{ &cmi8738_device },
{ &es1371_device },
{ &ad1881_device },
{ &cs4297a_device },

View File

@@ -32,6 +32,7 @@
#include <86box/timer.h>
#include <86box/nvr.h>
#include <86box/ui.h>
#include <86box/gdbstub.h>
static int first_use = 1;
static uint64_t StartingTime;
@@ -229,19 +230,23 @@ wchar_t* plat_get_string(int i)
switch (i)
{
case IDS_2077:
return L"Click to capture mouse.";
return L"Click to capture mouse";
case IDS_2078:
return L"Press CTRL-END to release mouse";
case IDS_2079:
return L"Press CTRL-END or middle button to release mouse";
case IDS_2080:
return L"Failed to initialize FluidSynth";
case IDS_2130:
return L"Invalid configuration";
case IDS_4099:
return L"MFM/RLL or ESDI CD-ROM drives never existed";
case IDS_2093:
return L"Failed to set up PCap";
case IDS_2094:
return L"No PCap devices found";
case IDS_2095:
return L"Invalid PCap device";
case IDS_2110:
return L"Unable to initialize FreeType";
case IDS_2111:
@@ -250,6 +255,8 @@ wchar_t* plat_get_string(int i)
return L"libfreetype is required for ESC/P printer emulation.";
case IDS_2132:
return L"libgs is required for automatic conversion of PostScript files to PDF.\n\nAny documents sent to the generic PostScript printer will be saved as PostScript (.ps) files.";
case IDS_2133:
return L"libfluidsynth is required for FluidSynth MIDI output.";
case IDS_2129:
return L"Make sure libpcap is installed and that you are on a libpcap-compatible network connection.";
case IDS_2114:
@@ -260,6 +267,8 @@ wchar_t* plat_get_string(int i)
return L"Video card \"%hs\" is not available due to missing ROMs in the roms/video directory. Switching to an available video card.";
case IDS_2128:
return L"Hardware not available";
case IDS_2142:
return L"Monitor in sleep mode";
}
return L"";
}
@@ -519,6 +528,11 @@ main_thread(void *param)
while (!is_quit && cpu_thread_run) {
/* See if it is time to run a frame of code. */
new_time = SDL_GetTicks();
#ifdef USE_GDBSTUB
if (gdbstub_next_asap && (drawits <= 0))
drawits = 10;
else
#endif
drawits += (new_time - old_time);
old_time = new_time;
if (drawits > 0 && !dopause) {

View File

@@ -660,7 +660,7 @@ SNDOBJ := sound.o \
snd_lpt_dac.o snd_lpt_dss.o \
snd_adlib.o snd_adlibgold.o snd_ad1848.o snd_audiopci.o \
snd_ac97_codec.o snd_ac97_via.o \
snd_azt2316a.o snd_cs423x.o \
snd_azt2316a.o snd_cs423x.o snd_cmi8x38.o \
snd_cms.o \
snd_gus.o \
snd_sb.o snd_sb_dsp.o \

View File

@@ -55,6 +55,7 @@
#include <86box/win_opengl.h>
#include <86box/win.h>
#include <86box/version.h>
#include <86box/gdbstub.h>
#ifdef MTR_ENABLED
#include <minitrace/minitrace.h>
#endif
@@ -525,6 +526,11 @@ main_thread(void *param)
while (!is_quit && cpu_thread_run) {
/* See if it is time to run a frame of code. */
new_time = GetTickCount();
#ifdef USE_GDBSTUB
if (gdbstub_next_asap && (drawits <= 0))
drawits = 10;
else
#endif
drawits += (new_time - old_time);
old_time = new_time;
if (drawits > 0 && !dopause) {