diff --git a/.ci/AppImageBuilder.yml b/.ci/AppImageBuilder.yml index 05a7b8fcb..3d83e2851 100644 --- a/.ci/AppImageBuilder.yml +++ b/.ci/AppImageBuilder.yml @@ -1,26 +1,26 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# Recipe file for appimage-builder. +# Recipe file for appimage-builder. # -# build.sh processes conditional comments based on CMakeCache -# options at the end of each line. For example, a line ending in: +# build.sh processes conditional comments based on CMakeCache +# options at the end of each line. For example, a line ending in: # -# # if QT:BOOL=ON +# # if QT:BOOL=ON # -# will be removed from the dynamically-generated copy of this -# file if "QT" is not a boolean option set to ON, either through -# a -D definition or the option's default value in CMakeLists. +# will be removed from the dynamically-generated copy of this +# file if "QT" is not a boolean option set to ON, either through +# a -D definition or the option's default value in CMakeLists. # # -# Authors: RichardG, +# Authors: RichardG, # -# Copyright 2022 RichardG. +# Copyright 2022 RichardG. # version: 1 @@ -45,7 +45,6 @@ AppDir: include: - libedit2 # if (CLI:BOOL=ON|QT:BOOL=OFF) - libevdev2 # if QT:BOOL=ON - - libfluidsynth2 - libfreetype6 - libgbm1 # if QT:BOOL=ON - libgl1 # if QT:BOOL=ON diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index d7b2f94aa..6ab63ea30 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Jenkins build pipeline definition. + * Jenkins build pipeline definition. * * * - * Authors: RichardG, + * Authors: RichardG, * - * Copyright 2021-2022 RichardG. + * Copyright 2021-2022 RichardG. */ /* ['main builds', 'branch builds'] */ diff --git a/.ci/build.sh b/.ci/build.sh index f0d91fe18..85420a3c6 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -1,18 +1,18 @@ #!/bin/sh # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# Jenkins build script. +# Jenkins build script. # # -# Authors: RichardG, +# Authors: RichardG, # -# Copyright 2021-2022 RichardG. +# Copyright 2021-2023 RichardG. # # @@ -949,14 +949,19 @@ else if grep -q "OPENAL:BOOL=ON" build/CMakeCache.txt then - # Build openal-soft 1.21.1 manually to fix audio issues. This is a temporary + # Build openal-soft 1.22.2 manually to fix audio issues. This is a temporary # workaround until a newer version of openal-soft trickles down to Debian repos. - prefix="$cache_dir/openal-soft-1.21.1" + prefix="$cache_dir/openal-soft-1.22.2" if [ ! -d "$prefix" ] then rm -rf "$cache_dir/openal-soft-"* # remove old versions - wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.21.1.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" + wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.22.2.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" fi + + # Patches to build with the old PipeWire version in Debian. + sed -i -e 's/>=0.3.23//' "$prefix/CMakeLists.txt" + sed -i -e 's/PW_KEY_CONFIG_NAME/"config.name"/g' "$prefix/alc/backends/pipewire.cpp" + prefix_build="$prefix/build-$arch_deb" cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$toolchain_file" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix_build" || exit 99 cmake --build "$prefix_build" -j$(nproc) || exit 99 @@ -986,7 +991,8 @@ else sdl_ui=OFF grep -qiE "^QT:BOOL=ON" build/CMakeCache.txt || sdl_ui=ON - # Build rtmidi without JACK support to remove the dependency on libjack. + # Build rtmidi without JACK support to remove the dependency on libjack, as + # the Debian libjack is very likely to be incompatible with the system jackd. prefix="$cache_dir/rtmidi-4.0.0" if [ ! -d "$prefix" ] then @@ -998,6 +1004,24 @@ else cmake --build "$prefix_build" -j$(nproc) || exit 99 cmake --install "$prefix_build" || exit 99 + # Build FluidSynth without sound systems to remove the dependencies on libjack + # and other sound system libraries. We don't output audio through FluidSynth. + prefix="$cache_dir/fluidsynth-2.3.0" + if [ ! -d "$prefix" ] + then + 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" \ + -S "$prefix" -B "$prefix_build" || exit 99 + cmake --build "$prefix_build" -j$(nproc) || exit 99 + cmake --install "$prefix_build" || exit 99 + cp -p "$cwd_root/archive_tmp/usr/bin/fluidsynth" fluidsynth + # Build SDL2 for joystick and FAudio support, with most components # disabled to remove the dependencies on PulseAudio and libdrm. prefix="$cache_dir/SDL2-2.0.20" @@ -1028,6 +1052,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. 7z e -y -o"archive_tmp/usr/lib" "$discord_zip" "lib/$arch_discord/discord_game_sdk.so" @@ -1138,6 +1163,27 @@ EOF # Copy line. echo "$line" >> AppImageBuilder-generated.yml + + # Workaround for appimage-builder issues 272 and 283 (i686 and armhf are also missing) + if [ "$arch_appimage" != "x86_64" -a "$line" = " files:" ] + then + # Some mild arbitrary code execution with a dummy package... + [ ! -d /runtime ] && sudo apt-get -y -o 'DPkg::Post-Invoke::=mkdir -p /runtime; chmod 777 /runtime' install libsixel1 > /dev/null 2>&1 + + echo " include:" >> AppImageBuilder-generated.yml + for loader in "/lib/$libdir/ld-linux"*.so.* + do + for loader_copy in "$loader" "/lib/$(basename "$loader")" + do + if [ ! -e "/runtime/compat$loader_copy" ] + then + mkdir -p "/runtime/compat$(dirname "$loader_copy")" + ln -s "$loader" "/runtime/compat$loader_copy" + fi + echo " - /runtime/compat$loader_copy" >> AppImageBuilder-generated.yml + done + done + fi done < .ci/AppImageBuilder.yml # Download appimage-builder if necessary. @@ -1157,7 +1203,7 @@ EOF ln -s "$cache_dir/appimage-builder-cache" appimage-builder-cache # Run appimage-builder in extract-and-run mode for Docker compatibility. - # --appdir is a workaround for https://github.com/AppImageCrafters/appimage-builder/issues/270 + # --appdir is a workaround for appimage-builder issue 270 reported by us. for retry in 1 2 3 4 5 do project="$project" project_id="$project_id" project_version="$project_version" project_icon="$project_icon" arch_deb="$arch_deb" \ diff --git a/.ci/static2dll.sh b/.ci/static2dll.sh index f6e5b63b9..030898752 100644 --- a/.ci/static2dll.sh +++ b/.ci/static2dll.sh @@ -1,18 +1,18 @@ #!/bin/sh # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# Script for converting MinGW static libraries into a DLL. +# Script for converting MinGW static libraries into a DLL. # # -# Authors: RichardG, +# Authors: RichardG, # -# Copyright 2021 RichardG. +# Copyright 2021 RichardG. # def_file="static2dll.def" diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 5b2573dde..e91259189 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -28,6 +28,9 @@ jobs: fail-fast: true matrix: build: +# - name: Regular +# debug: n +# dev: n - name: Debug debug: y dev: n @@ -44,14 +47,28 @@ jobs: new: y slug: -NDR environment: +# - msystem: MSYS +# clang: n +# x64: y - msystem: MINGW32 prefix: mingw-w64-i686 + clang: n x64: n - msystem: MINGW64 prefix: mingw-w64-x86_64 + clang: n x64: y +# - msystem: CLANG32 +# prefix: mingw-w64-clang-i686 +# clang: y +# x64: n +# - msystem: CLANG64 +# prefix: mingw-w64-clang-x86_64 +# clang: y +# x64: y - msystem: UCRT64 prefix: mingw-w64-ucrt-x86_64 + clang: n x64: y steps: @@ -65,6 +82,7 @@ jobs: make pacboy: >- gcc:p + clang:p pkg-config:p freetype:p SDL2:p @@ -80,6 +98,7 @@ jobs: DEV_BUILD=${{ matrix.build.dev }} DEBUG=${{ matrix.build.debug }} NEW_DYNAREC=${{ matrix.dynarec.new }} + CLANG=${{ matrix.environment.clang }} X64=${{ matrix.environment.x64 }} working-directory: ./src - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4596b51b8..be42cbae6 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -37,6 +37,8 @@ jobs: fail-fast: true matrix: build: +# - name: Regular +# preset: regular - name: Debug preset: debug slug: -Debug @@ -62,12 +64,20 @@ jobs: qt5-base:p qt5-tools:p environment: +# - msystem: MSYS +# toolchain: ./cmake/flags-gcc-x86_64.cmake - msystem: MINGW32 prefix: mingw-w64-i686 toolchain: ./cmake/flags-gcc-i686.cmake - msystem: MINGW64 prefix: mingw-w64-x86_64 toolchain: ./cmake/flags-gcc-x86_64.cmake +# - msystem: CLANG32 +# prefix: mingw-w64-clang-i686 +# toolchain: ./cmake/llvm-win32-i686.cmake +# - msystem: CLANG64 +# prefix: mingw-w64-clang-x86_64 +# toolchain: ./cmake/llvm-win32-x86_64.cmake - msystem: UCRT64 prefix: mingw-w64-ucrt-x86_64 toolchain: ./cmake/flags-gcc-x86_64.cmake @@ -122,6 +132,8 @@ jobs: fail-fast: true matrix: build: +# - name: Regular +# preset: regular - name: Debug preset: debug slug: -Debug @@ -219,6 +231,8 @@ jobs: fail-fast: true matrix: build: +# - name: Regular +# preset: regular - name: Debug preset: debug slug: -Debug @@ -280,6 +294,8 @@ jobs: fail-fast: true matrix: build: +# - name: Regular +# preset: regular - name: Debug preset: debug slug: -Debug diff --git a/.gitignore b/.gitignore index b4c67ef0a..0a21bf105 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ Makefile # Visual Studio Code /.vs /.vscode +/out # Windows resource compiler RC* diff --git a/CMakeLists.txt b/CMakeLists.txt index 74b2ad4b2..e4d5c4061 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # cmake_minimum_required(VERSION 3.16) @@ -116,6 +116,10 @@ if(WIN32) add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS) endif() +if(NOT (WIN32 OR APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Linux")) + set(DISCORD OFF) +endif() + set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 14) set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) @@ -138,6 +142,7 @@ option(MINITRACE "Enable Chrome tracing using the modified minitrace library" option(GDBSTUB "Enable GDB stub server for debugging" OFF) option(DEV_BRANCH "Development branch" OFF) option(QT "Qt GUI" ON) +option(DISCORD "Discord Rich Presence support" ON) # Development branch features # diff --git a/CMakePresets.json b/CMakePresets.json index 2cb84ee6f..d2980ed87 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,36 +1,52 @@ { - "version": 3, + "version": 2, "cmakeMinimumRequired": { "major": 3, - "minor": 21 + "minor": 20 }, "configurePresets": [ + { + "name": "base", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/artifacts", + "CMAKE_EXPORT_COMPILE_COMMANDS": true, + "DEV_BRANCH": "OFF", + "NEW_DYNAREC": "OFF", + "QT": "ON" + }, + "generator": "Ninja", + "hidden": true + }, { "name": "regular", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release", - "DEV_BRANCH": "OFF", - "NEW_DYNAREC": "OFF" + "CMAKE_BUILD_TYPE": "Release" }, - "generator": "Ninja" + "inherits": "base" }, { "name": "optimized", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Optimized", - "DEV_BRANCH": "OFF", - "NEW_DYNAREC": "OFF" + "CMAKE_BUILD_TYPE": "Optimized" }, - "generator": "Ninja" + "inherits": "base" }, { "name": "debug", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "DEV_BRANCH": "OFF", + "CMAKE_BUILD_TYPE": "Debug" + }, + "inherits": "base" + }, + { + "name": "development", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "DEV_BRANCH": "ON", "NEW_DYNAREC": "OFF" }, - "generator": "Ninja" + "inherits": "base" }, { "name": "experimental", @@ -39,7 +55,9 @@ "DEV_BRANCH": "ON", "NEW_DYNAREC": "ON" }, - "generator": "Ninja" + "inherits": "base" } - ] + ], + "buildPresets": [], + "testPresets": [] } diff --git a/README.md b/README.md index 46a7f08bb..05a2a9ed2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ 86Box ===== -[![Build Status](http://ci.86box.net/job/86Box/badge/icon)](http://ci.86box.net/job/86Box) +[![Build Status](https://ci.86box.net/job/86Box/badge/icon)](https://ci.86box.net/job/86Box/) **86Box** is a low level x86 emulator that runs older operating systems and software designed for IBM PC systems and compatibles from 1981 through fairly recent system designs based on the PCI bus. diff --git a/bumpversion.sh b/bumpversion.sh index ce3b7c4c8..87728603c 100644 --- a/bumpversion.sh +++ b/bumpversion.sh @@ -1,18 +1,18 @@ #!/bin/sh # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# Convenience script for changing the emulator's version. +# Convenience script for changing the emulator's version. # # -# Authors: RichardG, +# Authors: RichardG, # -# Copyright 2022 RichardG. +# Copyright 2022 RichardG. # # Parse arguments. diff --git a/cmake/flags-gcc-aarch64.cmake b/cmake/flags-gcc-aarch64.cmake index 34ddaf3e6..4344e2c81 100644 --- a/cmake/flags-gcc-aarch64.cmake +++ b/cmake/flags-gcc-aarch64.cmake @@ -1,20 +1,20 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file defining GCC compiler flags -# for AArch64 (ARM64) targets. +# CMake toolchain file defining GCC compiler flags +# for AArch64 (ARM64) targets. # -# Authors: David Hrdlička, +# Authors: David Hrdlička, # -# Copyright 2021 David Hrdlička. +# Copyright 2021 David Hrdlička. # string(APPEND CMAKE_C_FLAGS_INIT " -march=armv8-a") string(APPEND CMAKE_CXX_FLAGS_INIT " -march=armv8-a") -include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) \ No newline at end of file +include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) diff --git a/cmake/flags-gcc-armv7.cmake b/cmake/flags-gcc-armv7.cmake index e73f55edd..828fb1a21 100644 --- a/cmake/flags-gcc-armv7.cmake +++ b/cmake/flags-gcc-armv7.cmake @@ -1,20 +1,20 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file defining GCC compiler flags -# for ARMv7 targets. +# CMake toolchain file defining GCC compiler flags +# for ARMv7 targets. # -# Authors: David Hrdlička, +# Authors: David Hrdlička, # -# Copyright 2021 David Hrdlička. +# Copyright 2021 David Hrdlička. # string(APPEND CMAKE_C_FLAGS_INIT " -march=armv7-a -mfloat-abi=hard") string(APPEND CMAKE_CXX_FLAGS_INIT " -march=armv7-a -mfloat-abi=hard") -include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) \ No newline at end of file +include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) diff --git a/cmake/flags-gcc-i686.cmake b/cmake/flags-gcc-i686.cmake index 2d12b7937..3b3d72a16 100644 --- a/cmake/flags-gcc-i686.cmake +++ b/cmake/flags-gcc-i686.cmake @@ -1,17 +1,17 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file defining GCC compiler flags -# for 32-bit x86 targets. +# CMake toolchain file defining GCC compiler flags +# for 32-bit x86 targets. # -# Authors: David Hrdlička, +# Authors: David Hrdlička, # -# Copyright 2021 David Hrdlička. +# Copyright 2021 David Hrdlička. # string(APPEND CMAKE_C_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse -mstackrealign") diff --git a/cmake/flags-gcc-x86_64.cmake b/cmake/flags-gcc-x86_64.cmake index f9f39eb97..47928df42 100644 --- a/cmake/flags-gcc-x86_64.cmake +++ b/cmake/flags-gcc-x86_64.cmake @@ -1,17 +1,17 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file defining GCC compiler flags -# for 64-bit x86 targets. +# CMake toolchain file defining GCC compiler flags +# for 64-bit x86 targets. # -# Authors: David Hrdlička, +# Authors: David Hrdlička, # -# Copyright 2021 David Hrdlička. +# Copyright 2021 David Hrdlička. # string(APPEND CMAKE_C_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse -mstackrealign") diff --git a/cmake/flags-gcc.cmake b/cmake/flags-gcc.cmake index e1bf3650e..885353b87 100644 --- a/cmake/flags-gcc.cmake +++ b/cmake/flags-gcc.cmake @@ -1,16 +1,16 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file defining GCC compiler flags. +# CMake toolchain file defining GCC compiler flags. # -# Authors: David Hrdlička, +# Authors: David Hrdlička, # -# Copyright 2021 David Hrdlička. +# Copyright 2021 David Hrdlička. # # Define our flags diff --git a/cmake/llvm-macos-aarch64.cmake b/cmake/llvm-macos-aarch64.cmake index da9ccb449..df67ad45b 100644 --- a/cmake/llvm-macos-aarch64.cmake +++ b/cmake/llvm-macos-aarch64.cmake @@ -1,22 +1,22 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file defining Clang compiler flags -# for AArch64 (ARM64)-based Apple Silicon targets. +# CMake toolchain file defining Clang compiler flags +# for AArch64 (ARM64)-based Apple Silicon targets. # -# Authors: David Hrdlička, -# dob205 +# Authors: David Hrdlička, +# dob205 # -# Copyright 2021 David Hrdlička. -# Copyright 2022 dob205. +# Copyright 2021 David Hrdlička. +# Copyright 2022 dob205. # string(APPEND CMAKE_C_FLAGS_INIT " -march=armv8.5-a+simd") string(APPEND CMAKE_CXX_FLAGS_INIT " -march=armv8.5-a+simd") -include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) \ No newline at end of file +include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) diff --git a/cmake/llvm-win32-aarch64.cmake b/cmake/llvm-win32-aarch64.cmake index 4aacb248f..015a0dad0 100644 --- a/cmake/llvm-win32-aarch64.cmake +++ b/cmake/llvm-win32-aarch64.cmake @@ -1,16 +1,16 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file for Clang on Windows builds (ARM64 target). +# CMake toolchain file for Clang on Windows builds (ARM64 target). # -# Authors: David Hrdlička, +# Authors: David Hrdlička, # -# Copyright 2021 David Hrdlička. +# Copyright 2021 David Hrdlička. # include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-aarch64.cmake) @@ -27,4 +27,4 @@ set(CMAKE_CXX_COMPILER_TARGET aarch64-pc-windows-msvc) set(CMAKE_SYSTEM_PROCESSOR ARM64) -# TODO: set the vcpkg target triplet perhaps? \ No newline at end of file +# TODO: set the vcpkg target triplet perhaps? diff --git a/cmake/llvm-win32-arm.cmake b/cmake/llvm-win32-arm.cmake index 9d3488124..30c9877d4 100644 --- a/cmake/llvm-win32-arm.cmake +++ b/cmake/llvm-win32-arm.cmake @@ -1,16 +1,16 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file for Clang on Windows builds (ARM64 target). +# CMake toolchain file for Clang on Windows builds (ARM64 target). # -# Authors: David Hrdlička, +# Authors: David Hrdlička, # -# Copyright 2021 David Hrdlička. +# Copyright 2021 David Hrdlička. # include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-armv7.cmake) diff --git a/cmake/llvm-win32-i686.cmake b/cmake/llvm-win32-i686.cmake index 8221f8bc2..b69771407 100644 --- a/cmake/llvm-win32-i686.cmake +++ b/cmake/llvm-win32-i686.cmake @@ -1,16 +1,16 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file for Clang on Windows builds (x86 target). +# CMake toolchain file for Clang on Windows builds (x86 target). # -# Authors: David Hrdlička, +# Authors: David Hrdlička, # -# Copyright 2021 David Hrdlička. +# Copyright 2021 David Hrdlička. # include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-i686.cmake) @@ -27,4 +27,4 @@ set(CMAKE_CXX_COMPILER_TARGET i686-pc-windows-msvc) set(CMAKE_SYSTEM_PROCESSOR X86) -# TODO: set the vcpkg target triplet perhaps? \ No newline at end of file +# TODO: set the vcpkg target triplet perhaps? diff --git a/cmake/llvm-win32-x86_64.cmake b/cmake/llvm-win32-x86_64.cmake index 7caeb7836..da0cfd3f2 100644 --- a/cmake/llvm-win32-x86_64.cmake +++ b/cmake/llvm-win32-x86_64.cmake @@ -1,16 +1,16 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# CMake toolchain file for Clang on Windows builds (x64/AMD64 target). +# CMake toolchain file for Clang on Windows builds (x64/AMD64 target). # -# Authors: David Hrdlička, +# Authors: David Hrdlička, # -# Copyright 2021 David Hrdlička. +# Copyright 2021 David Hrdlička. # include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-x86_64.cmake) @@ -27,4 +27,4 @@ set(CMAKE_CXX_COMPILER_TARGET x86_64-pc-windows-msvc) set(CMAKE_SYSTEM_PROCESSOR AMD64) -# TODO: set the vcpkg target triplet perhaps? \ No newline at end of file +# TODO: set the vcpkg target triplet perhaps? diff --git a/debian/changelog b/debian/changelog index 0ec15e546..45b701f83 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ 86box (3.11.0-1) UNRELEASED; urgency=medium - * Initial release. + * Bump release. -- Jasmine Iwanek Sun, 18 Nov 2022 23:27:00 -0500 diff --git a/src/86box.c b/src/86box.c index 0e1e49fd2..20db78b33 100644 --- a/src/86box.c +++ b/src/86box.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -80,6 +80,7 @@ #include <86box/scsi.h> #include <86box/scsi_device.h> #include <86box/cdrom.h> +#include <86box/cdrom_interface.h> #include <86box/zip.h> #include <86box/mo.h> #include <86box/scsi_disk.h> @@ -96,6 +97,8 @@ #include <86box/version.h> #include <86box/gdbstub.h> #include <86box/machine_status.h> +#include <86box/apm.h> +#include <86box/acpi.h> // Disable c99-designator to avoid the warnings about int ng #ifdef __clang__ @@ -163,13 +166,9 @@ int bugger_enabled = 0; /* (C) enable ISAbug int postcard_enabled = 0; /* (C) enable POST card */ int isamem_type[ISAMEM_MAX] = { 0, 0, 0, 0 }; /* (C) enable ISA mem cards */ int isartc_type = 0; /* (C) enable ISA RTC card */ -int gfxcard = 0; /* (C) graphics/video card */ -int gfxcard_2 = 0; /* (C) graphics/video card */ +int gfxcard[2] = { 0, 0 }; /* (C) graphics/video card */ int show_second_monitors = 1; /* (C) show non-primary monitors */ int sound_is_float = 1; /* (C) sound uses FP values */ -int GAMEBLASTER = 0; /* (C) sound option */ -int GUS = 0; /* (C) sound option */ -int SSI2001 = 0; /* (C) sound option */ int voodoo_enabled = 0; /* (C) video option */ int ibm8514_enabled = 0; /* (C) video option */ int xga_enabled = 0; /* (C) video option */ @@ -869,34 +868,34 @@ pc_init_modules(void) } /* Make sure we have a usable video card. */ - if (!video_card_available(gfxcard)) { + if (!video_card_available(gfxcard[0])) { memset(tempc, 0, sizeof(tempc)); - device_get_name(video_card_getdevice(gfxcard), 0, tempc); + device_get_name(video_card_getdevice(gfxcard[0]), 0, tempc); swprintf(temp, sizeof(temp), plat_get_string(IDS_2064), tempc); c = 0; while (video_get_internal_name(c) != NULL) { - gfxcard = -1; + gfxcard[0] = -1; if (video_card_available(c)) { ui_msgbox_header(MBX_INFO, (wchar_t *) IDS_2129, temp); - gfxcard = c; + gfxcard[0] = c; config_save(); break; } c++; } - if (gfxcard == -1) { + if (gfxcard[0] == -1) { fatal("No available video cards\n"); exit(-1); return (0); } } - if (!video_card_available(gfxcard_2)) { + if (!video_card_available(gfxcard[1])) { char tempc[512] = { 0 }; - device_get_name(video_card_getdevice(gfxcard_2), 0, tempc); + device_get_name(video_card_getdevice(gfxcard[1]), 0, tempc); swprintf(temp, sizeof(temp), (wchar_t *) "Video card #2 \"%hs\" is not available due to missing ROMs in the roms/video directory. Disabling the second video card.", tempc); ui_msgbox_header(MBX_INFO, (wchar_t *) IDS_2129, temp); - gfxcard_2 = 0; + gfxcard[1] = 0; } atfullspeed = 0; @@ -1018,6 +1017,9 @@ pc_reset_hard_init(void) * modules that are. */ + /* Mark ACPI as unavailable */ + acpi_enabled = 0; + /* Reset the general machine support modules. */ io_init(); @@ -1068,6 +1070,10 @@ pc_reset_hard_init(void) /* Reset the Hard Disk Controller module. */ hdc_reset(); + + /* Reset the CD-ROM Controller module. */ + cdrom_interface_reset(); + /* Reset and reconfigure the SCSI layer. */ scsi_card_init(); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 476c27439..77de8aad9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,7 +19,7 @@ if(APPLE) endif() add_executable(86Box 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c - dma.c ddma.c discord.c nmi.c pic.c pit.c pit_fast.c port_6x.c port_92.c ppi.c pci.c + dma.c ddma.c nmi.c pic.c pit.c pit_fast.c port_6x.c port_92.c ppi.c pci.c mca.c usb.c fifo8.c device.c nvr.c nvr_at.c nvr_ps2.c machine_status.c ini.c) if(CMAKE_SYSTEM_NAME MATCHES "Linux") @@ -51,6 +51,11 @@ if(DEV_BRANCH) add_compile_definitions(DEV_BRANCH) endif() +if(DISCORD) + add_compile_definitions(DISCORD) + target_sources(86Box PRIVATE discord.c) +endif() + if(VNC) find_package(LibVNCServer) if(LibVNCServer_FOUND) diff --git a/src/Makefile.local b/src/Makefile.local index 4c6830afd..fdb2dcab3 100644 --- a/src/Makefile.local +++ b/src/Makefile.local @@ -1,32 +1,32 @@ # -# 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. +# 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. +# This file is part of the 86Box distribution. # -# Prefix for localizing the general Makefile.mingw for local -# settings, so we can avoid changing the main one for all of -# our local setups. +# Prefix for localizing the general Makefile.mingw for local +# settings, so we can avoid changing the main one for all of +# our local setups. # -# Author: Fred N. van Kempen, +# Authors: Fred N. van Kempen, # ######################################################################### -# Anything here will override defaults in Makefile.MinGW. # +# Anything here will override defaults in Makefile.MinGW. # ######################################################################### # Name of the executable. -#PROG := yourexe +#PROG := 86box.exe # Various compile-time options. # -DROM_TRACE=0xc800 traces ROM access from segment C800 # -DIO_TRACE=0x66 traces I/O on port 0x66 # -DIO_CATCH enables I/O range catch logs -STUFF := +STUFF := # Add feature selections here. # -DANSI_CFG forces the config file to ANSI encoding. @@ -168,31 +168,31 @@ STUFF := # -DENABLE_JOYSTICK_LOG=N sets logging level at N. # -DENABLE_SDL_LOG=N sets logging level at N. # -DENABLE_SETTINGS_LOG=N sets logging level at N. -EXTRAS := +EXTRAS := -AUTODEP := n -DEBUG := n -OPTIM := n -X64 := n -RELEASE := n -USB := n -VNC := n -RDP := n -DEV_BUILD := n -DEV_BRANCH := n -CIRRUS := n -NE1000 := n -NV_RIVA := n -OPENAL := y -FLUIDSYNTH := y -MUNT := y -PAS16 := n -DYNAREC := y +AUTODEP := n +DEBUG := n +OPTIM := n +X64 := n +RELEASE := n +USB := n +VNC := n +RDP := n +DEV_BUILD := n +DEV_BRANCH := n +CIRRUS := n +NE1000 := n +NV_RIVA := n +OPENAL := y +FLUIDSYNTH := y +MUNT := y +PAS16 := n +DYNAREC := y ######################################################################### -# Include the master Makefile.MinGW for the rest. # +# Include the master Makefile.MinGW for the rest. # ######################################################################### include win/Makefile.mingw diff --git a/src/acpi.c b/src/acpi.c index 5f9db8d05..2c5f2ff90 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -40,7 +40,9 @@ #include <86box/i2c.h> #include <86box/video.h> -int acpi_rtc_status = 0; +int acpi_rtc_status = 0; +atomic_int acpi_pwrbut_pressed = 0; +int acpi_enabled = 0; static double cpu_to_acpi; @@ -1516,6 +1518,21 @@ acpi_ali_soft_smi_status_write(acpi_t *dev, uint8_t soft_smi) dev->regs.ali_soft_smi = soft_smi; } +void +acpi_pwrbtn_timer(void* priv) +{ + acpi_t *dev = (acpi_t *) priv; + + timer_on_auto(&dev->pwrbtn_timer, 16. * 1000.); + if (acpi_pwrbut_pressed) { + acpi_pwrbut_pressed = 0; + if (dev->regs.pmen & PWRBTN_EN) { + dev->regs.pmsts |= PWRBTN_STS; + acpi_update_irq(dev); + } + } +} + static void acpi_apm_out(uint16_t port, uint8_t val, void *p) { @@ -1707,9 +1724,13 @@ acpi_init(const device_t *info) timer_add(&dev->timer, acpi_timer_overflow, dev, 0); timer_add(&dev->resume_timer, acpi_timer_resume, dev, 0); + timer_add(&dev->pwrbtn_timer, acpi_pwrbtn_timer, dev, 0); + + timer_on_auto(&dev->pwrbtn_timer, 16. * 1000.); acpi_reset(dev); + acpi_enabled = 1; return dev; } diff --git a/src/cdrom/CMakeLists.txt b/src/cdrom/CMakeLists.txt index c09a040bd..201cee7f6 100644 --- a/src/cdrom/CMakeLists.txt +++ b/src/cdrom/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(cdrom OBJECT cdrom.c cdrom_image_backend.c cdrom_image_viso.c cdrom_image.c cdrom_mitsumi.c) diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index dd1604801..31c5d2165 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -23,9 +23,12 @@ #include #define HAVE_STDARG_H #include <86box/86box.h> +#include <86box/device.h> #include <86box/config.h> #include <86box/cdrom.h> #include <86box/cdrom_image.h> +#include <86box/cdrom_interface.h> +#include <86box/cdrom_mitsumi.h> #include <86box/plat.h> #include <86box/scsi.h> #include <86box/scsi_device.h> @@ -43,9 +46,6 @@ #define MIN_SEEK 2000 #define MAX_SEEK 333333 -#define CD_BCD(x) (((x) % 10) | (((x) / 10) << 4)) -#define CD_DCB(x) ((((x) &0xf0) >> 4) * 10 + ((x) &0x0f)) - #pragma pack(push, 1) typedef struct { uint8_t user_data[2048], @@ -94,6 +94,8 @@ static uint8_t extra_buffer[296]; cdrom_t cdrom[CDROM_NUM]; +int cdrom_interface_current; + #ifdef ENABLE_CDROM_LOG int cdrom_do_log = ENABLE_CDROM_LOG; @@ -112,6 +114,145 @@ cdrom_log(const char *fmt, ...) # define cdrom_log(fmt, ...) #endif +static const device_t cdrom_interface_none_device = { + .name = "None", + .internal_name = "none", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +static const struct { + const device_t *device; +} controllers[] = { + // clang-format off + { &cdrom_interface_none_device }, + { NULL } + // clang-format on +}; + +/* Reset the CD-ROM Interface, whichever one that is. */ +void +cdrom_interface_reset(void) +{ + cdrom_log("CD-ROM Interface: reset(current=%d)\n", + cdrom_interface_current); + + /* If we have a valid controller, add its device. */ + if (!controllers[cdrom_interface_current].device) + return; + + device_add(controllers[cdrom_interface_current].device); +} + +char * +cdrom_interface_get_internal_name(int cdinterface) +{ + return device_get_internal_name(controllers[cdinterface].device); +} + +int +cdrom_interface_get_from_internal_name(char *s) +{ + int c = 0; + + while (controllers[c].device != NULL) { + if (!strcmp((char *) controllers[c].device->internal_name, s)) + return c; + c++; + } + + return 0; +} + +const device_t * +cdrom_interface_get_device(int cdinterface) +{ + return (controllers[cdinterface].device); +} + +int +cdrom_interface_has_config(int cdinterface) +{ + const device_t *dev = cdrom_interface_get_device(cdinterface); + + if (dev == NULL) + return (0); + + if (!device_has_config(dev)) + return (0); + + return (1); +} + +int +cdrom_interface_get_flags(int cdinterface) +{ + return (controllers[cdinterface].device->flags); +} + +int +cdrom_interface_available(int cdinterface) +{ + return (device_available(controllers[cdinterface].device)); +} + +char * +cdrom_getname(int type) +{ + return (char *) cdrom_drive_types[type].name; +} + +char * +cdrom_get_internal_name(int type) +{ + return (char *) cdrom_drive_types[type].internal_name; +} + +int +cdrom_get_from_internal_name(char *s) +{ + int c = 0; + + while (strlen(cdrom_drive_types[c].internal_name)) { + if (!strcmp((char *) cdrom_drive_types[c].internal_name, s)) + return c; + c++; + } + + return 0; +} + +void +cdrom_set_type(int model, int type) +{ + cdrom[model].type = type; +} + +int +cdrom_get_type(int model) +{ + return cdrom[model].type; +} + +static __inline int +bin2bcd(int x) +{ + return (x % 10) | ((x / 10) << 4); +} + +static __inline int +bcd2bin(int x) +{ + return (x >> 4) * 10 + (x & 0x0f); +} + int cdrom_lba_to_msf_accurate(int lba) { @@ -258,12 +399,26 @@ cdrom_stop(cdrom_t *dev) } void -cdrom_seek(cdrom_t *dev, uint32_t pos) +cdrom_seek(cdrom_t *dev, uint32_t pos, uint8_t vendor_type) { + int m, s, f; + if (!dev) return; - cdrom_log("CD-ROM %i: Seek to LBA %08X\n", dev->id, pos); + cdrom_log("CD-ROM %i: Seek to LBA %08X, vendor type = %02x.\n", dev->id, pos, vendor_type); + + switch (vendor_type) { + case 0x40: + m = bcd2bin((pos >> 24) & 0xff); + s = bcd2bin((pos >> 16) & 0xff); + f = bcd2bin((pos >> 8) & 0xff); + pos = MSFtoLBA(m, s, f) - 150; + break; + case 0x80: + pos = bcd2bin((pos >> 24) & 0xff); + break; + } dev->seek_pos = pos; cdrom_stop(dev); @@ -323,18 +478,6 @@ cdrom_audio_callback(cdrom_t *dev, int16_t *output, int len) return ret; } -static __inline int -bin2bcd(int x) -{ - return (x % 10) | ((x / 10) << 4); -} - -static __inline int -bcd2bin(int x) -{ - return (x >> 4) * 10 + (x & 0x0f); -} - static void msf_from_bcd(int *m, int *s, int *f) { @@ -365,20 +508,22 @@ cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf) /* Track-relative audio play. */ dev->ops->get_track_info(dev, ismsf & 0xff, 0, &ti); pos += MSFtoLBA(ti.m, ti.s, ti.f) - 150; - } else if (ismsf == 2) { + } else if ((ismsf == 2) || (ismsf == 3)) { dev->ops->get_track_info(dev, pos, 0, &ti); pos = MSFtoLBA(ti.m, ti.s, ti.f) - 150; - /* We have to end at the *end* of the specified track, - not at the beginning. */ - dev->ops->get_track_info(dev, len, 1, &ti); - len = MSFtoLBA(ti.m, ti.s, ti.f) - 150; + if (ismsf == 2) { + /* We have to end at the *end* of the specified track, + not at the beginning. */ + dev->ops->get_track_info(dev, len, 1, &ti); + len = MSFtoLBA(ti.m, ti.s, ti.f) - 150; + } } else if (ismsf == 1) { m = (pos >> 16) & 0xff; s = (pos >> 8) & 0xff; f = pos & 0xff; /* NEC CDR-260 speaks BCD. */ - if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) + if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) /*NEC*/ msf_from_bcd(&m, &s, &f); if (pos == 0xffffff) { @@ -392,7 +537,7 @@ cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf) f = len & 0xff; /* NEC CDR-260 speaks BCD. */ - if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) + if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) /*NEC*/ msf_from_bcd(&m, &s, &f); len = MSFtoLBA(m, s, f) - 150; @@ -434,33 +579,41 @@ cdrom_audio_track_search(cdrom_t *dev, uint32_t pos, int type, uint8_t playbit) switch (type) { case 0x00: if (pos == 0xffffffff) { - cdrom_log("CD-ROM %i: Search from current position\n", dev->id); + cdrom_log("CD-ROM %i: (type 0) Search from current position\n", dev->id); pos = dev->seek_pos; } + dev->seek_pos = pos; break; case 0x40: - m = CD_DCB((pos >> 24) & 0xff); - s = CD_DCB((pos >> 16) & 0xff); - f = CD_DCB((pos >> 8) & 0xff); + m = bcd2bin((pos >> 24) & 0xff); + s = bcd2bin((pos >> 16) & 0xff); + f = bcd2bin((pos >> 8) & 0xff); if (pos == 0xffffffff) { - cdrom_log("CD-ROM %i: Search from current position\n", dev->id); + cdrom_log("CD-ROM %i: (type 1) Search from current position\n", dev->id); pos = dev->seek_pos; } else pos = MSFtoLBA(m, s, f) - 150; + + dev->seek_pos = pos; + break; + case 0x80: + if (pos == 0xffffffff) { + cdrom_log("CD-ROM %i: (type 2) Search from current position\n", dev->id); + pos = dev->seek_pos; + } + dev->seek_pos = (pos >> 24) & 0xff; break; } /* Unlike standard commands, if there's a data track on an Audio CD (mixed mode) the playback continues with the audio muted (Toshiba CD-ROM SCSI-2 manual reference). */ - - dev->seek_pos = pos; dev->cd_buflen = 0; dev->cd_status = playbit ? CD_STATUS_PLAYING : CD_STATUS_PAUSED; return 1; } uint8_t -cdrom_toshiba_audio_play(cdrom_t *dev, uint32_t pos, int type) +cdrom_audio_play_toshiba(cdrom_t *dev, uint32_t pos, int type) { int m = 0, s = 0, f = 0; @@ -468,31 +621,85 @@ cdrom_toshiba_audio_play(cdrom_t *dev, uint32_t pos, int type) return 0; /*Preliminary support, revert if too incomplete*/ - cdrom_log("Toshiba Play Audio: MSF = %06x, cdstatus = %02x\n", pos, dev->cd_status); switch (type) { + case 0x00: + dev->cd_end = pos; + break; case 0x40: - m = CD_DCB((pos >> 24) & 0xff); - s = CD_DCB((pos >> 16) & 0xff); - f = CD_DCB((pos >> 8) & 0xff); + m = bcd2bin((pos >> 24) & 0xff); + s = bcd2bin((pos >> 16) & 0xff); + f = bcd2bin((pos >> 8) & 0xff); pos = MSFtoLBA(m, s, f) - 150; + dev->cd_end = pos; + break; + case 0x80: + dev->cd_end = (pos >> 24) & 0xff; break; case 0xc0: if (pos == 0xffffffff) { cdrom_log("CD-ROM %i: Playing from current position\n", dev->id); pos = dev->cd_end; } + dev->cd_end = pos; break; } + cdrom_log("Toshiba/NEC Play Audio: MSF = %06x, type = %02x, cdstatus = %02x\n", pos, type, dev->cd_status); + /* Unlike standard commands, if there's a data track on an Audio CD (mixed mode) the playback continues with the audio muted (Toshiba CD-ROM SCSI-2 manual reference). */ - dev->cd_end = pos; dev->cd_buflen = 0; dev->cd_status = CD_STATUS_PLAYING; return 1; } +uint8_t +cdrom_audio_scan(cdrom_t *dev, uint32_t pos, int type) +{ + int m = 0, s = 0, f = 0; + + if (dev->cd_status == CD_STATUS_DATA_ONLY) + return 0; + + cdrom_log("Audio Scan: MSF = %06x, type = %02x\n", pos, type); + switch (type) { + case 0x00: + if (pos == 0xffffffff) { + cdrom_log("CD-ROM %i: (type 0) Search from current position\n", dev->id); + pos = dev->seek_pos; + } + dev->seek_pos = pos; + break; + case 0x40: + m = bcd2bin((pos >> 24) & 0xff); + s = bcd2bin((pos >> 16) & 0xff); + f = bcd2bin((pos >> 8) & 0xff); + if (pos == 0xffffffff) { + cdrom_log("CD-ROM %i: (type 1) Search from current position\n", dev->id); + pos = dev->seek_pos; + } else + pos = MSFtoLBA(m, s, f) - 150; + + dev->seek_pos = pos; + break; + case 0x80: + dev->seek_pos = (pos >> 24) & 0xff; + break; + } + + /* Do this at this point, since it's at this point that we know the + actual LBA position to start playing from. */ + if (!(dev->ops->track_type(dev, pos) & CD_TRACK_AUDIO)) { + cdrom_log("CD-ROM %i: LBA %08X not on an audio track\n", dev->id, pos); + cdrom_stop(dev); + return 0; + } + + dev->cd_buflen = 0; + return 1; +} + void cdrom_audio_pause_resume(cdrom_t *dev, uint8_t resume) { @@ -509,7 +716,6 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf) uint32_t dat; dev->ops->get_subchannel(dev, dev->seek_pos, &subc); - cdrom_log("CD-ROM %i: Returned subchannel at %02i:%02i.%02i\n", subc.abs_m, subc.abs_s, subc.abs_f); if (dev->cd_status == CD_STATUS_DATA_ONLY) ret = 0x15; @@ -522,8 +728,12 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf) ret = 0x13; } - if (b[pos] > 1) + cdrom_log("CD-ROM %i: Returned subchannel at %02i:%02i.%02i, ret = %02x, seek pos = %08x, cd_end = %08x.\n", dev->id, subc.abs_m, subc.abs_s, subc.abs_f, ret, dev->seek_pos, dev->cd_end); + + if (b[pos] > 1) { + cdrom_log("B[%i] = %02x, ret = %02x.\n", pos, b[pos], ret); return ret; + } b[pos++] = subc.attr; b[pos++] = subc.track; @@ -533,7 +743,7 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf) b[pos] = 0; /* NEC CDR-260 speaks BCD. */ - if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) { + if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) /*NEC*/ { m = subc.abs_m; s = subc.abs_s; f = subc.abs_f; @@ -552,7 +762,7 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf) b[pos] = 0; /* NEC CDR-260 speaks BCD. */ - if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) { + if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) /*NEC*/ { m = subc.rel_m; s = subc.rel_s; f = subc.rel_f; @@ -583,6 +793,77 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf) return ret; } +void +cdrom_get_current_subchannel_sony(cdrom_t *dev, uint8_t *b, int msf) +{ + subchannel_t subc; + int pos = 0; + uint32_t dat; + + dev->ops->get_subchannel(dev, dev->seek_pos, &subc); + + cdrom_log("CD-ROM %i: Returned subchannel at %02i:%02i.%02i, seek pos = %08x, cd_end = %08x.\n", dev->id, subc.abs_m, subc.abs_s, subc.abs_f, dev->seek_pos, dev->cd_end); + + b[pos++] = subc.attr; + b[pos++] = subc.track; + b[pos++] = subc.index; + + if (msf) { + b[pos++] = subc.rel_m; + b[pos++] = subc.rel_s; + b[pos++] = subc.rel_f; + b[pos++] = subc.abs_m; + b[pos++] = subc.abs_s; + b[pos++] = subc.abs_f; + } else { + dat = MSFtoLBA(subc.rel_m, subc.rel_s, subc.rel_f); + b[pos++] = (dat >> 16) & 0xff; + b[pos++] = (dat >> 8) & 0xff; + b[pos++] = dat & 0xff; + dat = MSFtoLBA(subc.abs_m, subc.abs_s, subc.abs_f) - 150; + b[pos++] = (dat >> 16) & 0xff; + b[pos++] = (dat >> 8) & 0xff; + b[pos++] = dat & 0xff; + } +} + + +uint8_t +cdrom_get_audio_status_sony(cdrom_t *dev, uint8_t *b, int msf) +{ + uint8_t ret; + subchannel_t subc; + uint32_t dat; + + dev->ops->get_subchannel(dev, dev->seek_pos, &subc); + + if (dev->cd_status == CD_STATUS_DATA_ONLY) + ret = 0x05; + else { + if (dev->cd_status == CD_STATUS_PLAYING) + ret = dev->sound_on ? 0x00 : 0x02; + else if (dev->cd_status == CD_STATUS_PAUSED) + ret = 0x01; + else + ret = 0x03; + } + + if (msf) { + b[0] = 0; + b[1] = subc.abs_m; + b[2] = subc.abs_s; + b[3] = subc.abs_f; + } else { + dat = MSFtoLBA(subc.abs_m, subc.abs_s, subc.abs_f) - 150; + b[0] = (dat >> 24) & 0xff; + b[1] = (dat >> 16) & 0xff; + b[2] = (dat >> 8) & 0xff; + b[3] = dat & 0xff; + } + + return ret; +} + uint8_t cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b) { @@ -599,16 +880,14 @@ cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b) ret = (dev->cd_status == CD_STATUS_PLAYING) ? 0x00 : dev->audio_op; b[0] = subc.attr; - b[1] = CD_BCD(subc.track); - b[2] = CD_BCD(subc.index); - b[3] = CD_BCD(subc.rel_m); - b[4] = CD_BCD(subc.rel_s); - b[5] = CD_BCD(subc.rel_f); - b[6] = CD_BCD(subc.abs_m); - b[7] = CD_BCD(subc.abs_s); - b[8] = CD_BCD(subc.abs_f); - cdrom_log("CD-ROM %i: Returned subcode-q at %02i:%02i.%02i, track=%02x\n", dev->id, b[3], b[4], b[5], b[1]); - + b[1] = bin2bcd(subc.track); + b[2] = bin2bcd(subc.index); + b[3] = bin2bcd(subc.rel_m); + b[4] = bin2bcd(subc.rel_s); + b[5] = bin2bcd(subc.rel_f); + b[6] = bin2bcd(subc.abs_m); + b[7] = bin2bcd(subc.abs_s); + b[8] = bin2bcd(subc.abs_f); return ret; } @@ -670,7 +949,7 @@ read_toc_normal(cdrom_t *dev, unsigned char *b, unsigned char start_track, int m b[len++] = 0; /* NEC CDR-260 speaks BCD. */ - if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) { + if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) { /*NEC*/ m = ti.m; s = ti.s; f = ti.f; @@ -720,7 +999,7 @@ read_toc_session(cdrom_t *dev, unsigned char *b, int msf) b[len++] = 0; /* NEC CDR-260 speaks BCD. */ - if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) { + if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) { /*NEC*/ m = ti.m; s = ti.s; f = ti.f; @@ -778,6 +1057,74 @@ read_toc_raw(cdrom_t *dev, unsigned char *b) return len; } +static int +read_toc_sony(cdrom_t *dev, unsigned char *b, unsigned char start_track, int msf) +{ + track_info_t ti; + int i, len = 4; + int first_track, last_track; + uint32_t temp; + + cdrom_log("read_toc_sony(%08X, %08X, %02X, %i)\n", dev, b, start_track, msf); + + dev->ops->get_tracks(dev, &first_track, &last_track); + + /* Byte 2 = Number of the first track */ + dev->ops->get_track_info(dev, 1, 0, &ti); + b[2] = ti.number; + cdrom_log(" b[2] = %02X\n", b[2]); + + /* Byte 3 = Number of the last track before the lead-out track */ + dev->ops->get_track_info(dev, last_track, 0, &ti); + b[3] = ti.number; + cdrom_log(" b[3] = %02X\n", b[2]); + + if (start_track == 0x00) + first_track = 0; + else { + first_track = -1; + for (i = 0; i <= last_track; i++) { + dev->ops->get_track_info(dev, i + 1, 0, &ti); + if (ti.number >= start_track) { + first_track = i; + break; + } + } + } + cdrom_log(" first_track = %i, last_track = %i\n", first_track, last_track); + + /* No suitable starting track, return with error. */ + if (first_track == -1) { +#ifdef ENABLE_CDROM_LOG + cdrom_log(" [ERROR] No suitable track found\n"); +#endif + return -1; + } + + for (i = first_track; i <= last_track; i++) { + cdrom_log(" tracks(%i) = %02X, %02X, %i:%02i.%02i\n", i, ti.attr, ti.number, ti.m, ti.s, ti.f); + dev->ops->get_track_info(dev, i + 1, 0, &ti); + + b[len++] = ti.attr; + b[len++] = ti.number; /* track number */ + + if (msf) { + b[len++] = 0; + b[len++] = ti.m; + b[len++] = ti.s; + b[len++] = ti.f; + } else { + temp = MSFtoLBA(ti.m, ti.s, ti.f) - 150; + b[len++] = temp >> 24; + b[len++] = temp >> 16; + b[len++] = temp >> 8; + b[len++] = temp; + } + } + + return len; +} + int cdrom_read_toc(cdrom_t *dev, unsigned char *b, int type, unsigned char start_track, int msf, int max_len) { @@ -806,6 +1153,21 @@ cdrom_read_toc(cdrom_t *dev, unsigned char *b, int type, unsigned char start_tra return len; } +int +cdrom_read_toc_sony(cdrom_t *dev, unsigned char *b, unsigned char start_track, int msf, int max_len) +{ + int len; + + len = read_toc_sony(dev, b, start_track, msf); + + len = MIN(len, max_len); + + b[0] = (uint8_t) (((len - 2) >> 8) & 0xff); + b[1] = (uint8_t) ((len - 2) & 0xff); + + return len; +} + /* New API calls for Mitsumi CD-ROM. */ void cdrom_get_track_buffer(cdrom_t *dev, uint8_t *buf) @@ -841,7 +1203,7 @@ cdrom_get_q(cdrom_t *dev, uint8_t *buf, int *curtoctrk, uint8_t mode) dev->ops->get_track_info(dev, *curtoctrk, 0, &ti); buf[0] = (ti.attr << 4) & 0xf0; buf[1] = ti.number; - buf[2] = CD_BCD(*curtoctrk + 1); + buf[2] = bin2bcd(*curtoctrk + 1); buf[3] = ti.m; buf[4] = ti.s; buf[5] = ti.f; @@ -888,36 +1250,50 @@ cdrom_mitsumi_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len) return 1; } -void +uint8_t cdrom_read_disc_info_toc(cdrom_t *dev, unsigned char *b, unsigned char track, int type) { track_info_t ti; int first_track, last_track; + int m = 0, s = 0, f = 0; dev->ops->get_tracks(dev, &first_track, &last_track); - cdrom_log("Read DISC Info TOC Type = %d.\n", type); + cdrom_log("Read DISC Info TOC Type = %d, track = %d, first_track = %d, last_track = %d.\n", type, track, first_track, last_track); switch (type) { case 0: - b[0] = CD_BCD(first_track); - b[1] = CD_BCD(last_track); + b[0] = bin2bcd(first_track); + b[1] = bin2bcd(last_track); b[2] = 0; b[3] = 0; + cdrom_log("CD-ROM %i: Returned Toshiba/NEC disc information (type 0) at %02i:%02i\n", dev->id, b[0], b[1]); break; case 1: - dev->ops->get_track_info(dev, 0xAA, 0, &ti); - b[0] = CD_BCD(ti.m); - b[1] = CD_BCD(ti.s); - b[2] = CD_BCD(ti.f); + dev->ops->get_track_info(dev, 0xaa, 0, &ti); + m = ti.m; + s = ti.s; + f = ti.f; + msf_to_bcd(&m, &s, &f); + b[0] = m; + b[1] = s; + b[2] = f; b[3] = 0; + cdrom_log("CD-ROM %i: Returned Toshiba/NEC disc information (type 1) at %02i:%02i.%02i, track=%d\n", dev->id, b[0], b[1], b[2], bcd2bin(track)); break; case 2: - dev->ops->get_track_info(dev, CD_DCB(track), 0, &ti); - b[0] = CD_BCD(ti.m); - b[1] = CD_BCD(ti.s); - b[2] = CD_BCD(ti.f); + if (track > bin2bcd(last_track)) + return 0; + + dev->ops->get_track_info(dev, bcd2bin(track), 0, &ti); + m = ti.m; + s = ti.s; + f = ti.f; + msf_to_bcd(&m, &s, &f); + b[0] = m; + b[1] = s; + b[2] = f; b[3] = ti.attr; - cdrom_log("CD-ROM %i: Returned Toshiba disc information at %02i:%02i.%02i, track=%d\n", dev->id, b[0], b[1], b[2], CD_DCB(track)); + cdrom_log("CD-ROM %i: Returned Toshiba/NEC disc information (type 2) at %02i:%02i.%02i, track=%d, m=%02i,s=%02i,f=%02i, tno=%02x.\n", dev->id, b[0], b[1], b[2], bcd2bin(track), m, s, f, ti.attr); break; case 3: b[0] = 0x00; /*TODO: correct it further, mark it as CD-Audio/CD-ROM disc for now*/ @@ -926,6 +1302,8 @@ cdrom_read_disc_info_toc(cdrom_t *dev, unsigned char *b, unsigned char track, in b[3] = 0; break; } + + return 1; } static int @@ -1203,7 +1581,7 @@ read_mode2_xa_form2(cdrom_t *dev, int cdrom_sector_flags, uint32_t lba, uint32_t int cdrom_readsector_raw(cdrom_t *dev, uint8_t *buffer, int sector, int ismsf, int cdrom_sector_type, - int cdrom_sector_flags, int *len) + int cdrom_sector_flags, int *len, uint8_t vendor_type) { uint8_t *b, *temp_b; uint32_t msf, lba; @@ -1224,8 +1602,26 @@ cdrom_readsector_raw(cdrom_t *dev, uint8_t *buffer, int sector, int ismsf, int c lba = MSFtoLBA(m, s, f) - 150; msf = sector; } else { - lba = sector; - msf = cdrom_lba_to_msf_accurate(sector); + switch (vendor_type) { + case 0x00: + lba = sector; + msf = cdrom_lba_to_msf_accurate(sector); + break; + case 0x40: + m = bcd2bin((sector >> 24) & 0xff); + s = bcd2bin((sector >> 16) & 0xff); + f = bcd2bin((sector >> 8) & 0xff); + lba = MSFtoLBA(m, s, f) - 150; + msf = sector; + break; + case 0x80: + lba = bcd2bin((sector >> 24) & 0xff); + msf = sector; + break; + /* Never used values but the compiler complains. */ + default: + lba = msf = 0; + } } if (dev->ops->track_type) diff --git a/src/cdrom/cdrom_mitsumi.c b/src/cdrom/cdrom_mitsumi.c index a6ad860b3..e7e12bb94 100644 --- a/src/cdrom/cdrom_mitsumi.c +++ b/src/cdrom/cdrom_mitsumi.c @@ -28,6 +28,7 @@ #include <86box/pic.h> #include <86box/dma.h> #include <86box/cdrom.h> +#include <86box/cdrom_interface.h> #include <86box/cdrom_mitsumi.h> #include <86box/plat.h> #include <86box/sound.h> @@ -109,6 +110,7 @@ typedef struct { int drvmode; int cur_toc_track; int pos; + int newstat; } mcd_t; /* The addresses sent from the guest are absolute, ie. a LBA of 0 corresponds to a MSF of 00:00:00. Otherwise, the counter displayed by the guest is wrong: @@ -141,9 +143,11 @@ mitsumi_cdrom_log(const char *fmt, ...) static void mitsumi_cdrom_reset(mcd_t *dev) { - cdrom_t *cdrom = &cdrom[0]; + cdrom_t cdrom; + + cdrom.host_drive = 0; - dev->stat = cdrom->host_drive ? (STAT_READY | STAT_CHANGE) : 0; + dev->stat = cdrom.host_drive ? (STAT_READY | STAT_CHANGE) : 0; dev->cmdrd_count = 0; dev->cmdbuf_count = 0; dev->buf_count = 0; @@ -154,21 +158,19 @@ mitsumi_cdrom_reset(mcd_t *dev) dev->dmalen = COOKED_SECTOR_SIZE; dev->locked = 0; dev->change = 1; + dev->newstat = 1; dev->data = 0; } static int mitsumi_cdrom_read_sector(mcd_t *dev, int first) { - cdrom_t *cdrom = &cdrom[0]; + cdrom_t cdrom; uint8_t status; int ret; - if (cdrom == NULL) - return 0; - if (dev->drvmode == DRV_MODE_CDDA) { - status = cdrom_mitsumi_audio_play(cdrom, dev->readmsf, dev->readcount); + status = cdrom_mitsumi_audio_play(&cdrom, dev->readmsf, dev->readcount); if (status == 1) return status; else @@ -182,15 +184,15 @@ mitsumi_cdrom_read_sector(mcd_t *dev, int first) dev->data = 0; return 0; } - cdrom_stop(cdrom); - ret = cdrom_readsector_raw(cdrom, dev->buf, cdrom->seek_pos, 0, 2, 0x10, (int *) &dev->readcount); + cdrom_stop(&cdrom); + ret = cdrom_readsector_raw(&cdrom, dev->buf, cdrom.seek_pos, 0, 2, 0x10, (int *) &dev->readcount, 0); if (!ret) return 0; if (dev->mode & 0x40) { dev->buf[12] = CD_BCD((dev->readmsf >> 16) & 0xff); dev->buf[13] = CD_BCD((dev->readmsf >> 8) & 0xff); } - dev->readmsf = cdrom_lba_to_msf_accurate(cdrom->seek_pos + 1); + dev->readmsf = cdrom_lba_to_msf_accurate(cdrom.seek_pos + 1); dev->buf_count = dev->dmalen + 1; dev->buf_idx = 0; dev->data = 1; @@ -213,6 +215,7 @@ mitsumi_cdrom_in(uint16_t port, void *priv) mcd_t *dev = (mcd_t *) priv; uint8_t ret; + pclog("Mitsumi CD-ROM IN=%03x\n", port); switch (port & 1) { case 0: if (dev->cmdbuf_count) { @@ -225,16 +228,19 @@ mitsumi_cdrom_in(uint16_t port, void *priv) if (!dev->buf_count) mitsumi_cdrom_read_sector(dev, 0); + pclog("Read port 0: ret = %02x\n", ret); return ret; } + pclog("Read port 0: stat = %02x\n", dev->stat); return dev->stat; case 1: ret = 0; picintc(1 << dev->irq); if (!dev->buf_count || !dev->data || dev->enable_dma) ret |= FLAG_NODATA; - if (!dev->cmdbuf_count) + if (!dev->cmdbuf_count || !dev->newstat) ret |= FLAG_NOSTAT; + pclog("Read port 1: ret = %02x\n", ret | FLAG_UNK); return ret | FLAG_UNK; } @@ -245,8 +251,9 @@ static void mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv) { mcd_t *dev = (mcd_t *) priv; - cdrom_t *cdrom = &cdrom[0]; + cdrom_t cdrom; + pclog("Mitsumi CD-ROM OUT=%03x, val=%02x\n", port, val); switch (port & 1) { case 0: if (dev->cmdrd_count) { @@ -317,19 +324,19 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv) break; } if (!dev->cmdrd_count) - dev->stat = cdrom->host_drive ? (STAT_READY | (dev->change ? STAT_CHANGE : 0)) : 0; + dev->stat = cdrom.host_drive ? (STAT_READY | (dev->change ? STAT_CHANGE : 0)) : 0; return; } dev->cmd = val; dev->cmdbuf_idx = 0; dev->cmdrd_count = 0; dev->cmdbuf_count = 1; - dev->cmdbuf[0] = cdrom->host_drive ? (STAT_READY | (dev->change ? STAT_CHANGE : 0)) : 0; + dev->cmdbuf[0] = cdrom.host_drive ? (STAT_READY | (dev->change ? STAT_CHANGE : 0)) : 0; dev->data = 0; switch (val) { case CMD_GET_INFO: - if (cdrom->host_drive) { - cdrom_get_track_buffer(cdrom, &(dev->cmdbuf[1])); + if (cdrom.host_drive) { + cdrom_get_track_buffer(&cdrom, &(dev->cmdbuf[1])); dev->cmdbuf_count = 10; dev->readcount = 0; } else { @@ -338,8 +345,8 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv) } break; case CMD_GET_Q: - if (cdrom->host_drive) { - cdrom_get_q(cdrom, &(dev->cmdbuf[1]), &dev->cur_toc_track, dev->mode & MODE_GET_TOC); + if (cdrom.host_drive) { + cdrom_get_q(&cdrom, &(dev->cmdbuf[1]), &dev->cur_toc_track, dev->mode & MODE_GET_TOC); dev->cmdbuf_count = 11; dev->readcount = 0; } else { @@ -355,7 +362,7 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv) break; case CMD_STOPCDDA: case CMD_STOP: - cdrom_stop(cdrom); + cdrom_stop(&cdrom); dev->drvmode = DRV_MODE_STOP; dev->cur_toc_track = 0; break; @@ -364,7 +371,7 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv) break; case CMD_READ1X: case CMD_READ2X: - if (cdrom->host_drive) { + if (cdrom.host_drive) { dev->readcount = 0; dev->drvmode = (val == CMD_READ1X) ? DRV_MODE_CDDA : DRV_MODE_READ; dev->cmdrd_count = 6; @@ -380,13 +387,17 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv) dev->cmdbuf_count = 4; break; case CMD_EJECT: - cdrom_stop(cdrom); + cdrom_stop(&cdrom); cdrom_eject(0); dev->readcount = 0; break; case CMD_LOCK: dev->cmdrd_count = 1; break; + case CMD_SOFT_RESET: + pclog("Soft Reset\n"); + mitsumi_cdrom_reset(dev); + break; default: dev->cmdbuf[0] = dev->stat | STAT_CMD_CHECK; break; @@ -429,15 +440,15 @@ mitsumi_cdrom_close(void *priv) } const device_t mitsumi_cdrom_device = { - "Mitsumi CD-ROM interface", - "mcd", - DEVICE_ISA | DEVICE_AT, - 0, - mitsumi_cdrom_init, - mitsumi_cdrom_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "Mitsumi CD-ROM interface", + .internal_name = "mcd", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 1, + .init = mitsumi_cdrom_init, + .close = mitsumi_cdrom_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/CMakeLists.txt b/src/chipset/CMakeLists.txt index 47b9b30ce..0a6a5fbe5 100644 --- a/src/chipset/CMakeLists.txt +++ b/src/chipset/CMakeLists.txt @@ -10,10 +10,10 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # -add_library(chipset OBJECT 82c100.c acc2168.c cs8230.c ali1429.c ali1489.c ali1531.c ali1541.c ali1543.c +add_library(chipset OBJECT 82c100.c acc2168.c cs8230.c ali1429.c ali1435.c ali1489.c ali1531.c ali1541.c ali1543.c ali1621.c ali6117.c headland.c ims8848.c intel_82335.c contaq_82c59x.c cs4031.c intel_420ex.c intel_4x0.c intel_i450kx.c intel_sio.c intel_piix.c ../ioapic.c neat.c opti283.c opti291.c opti391.c opti495.c opti822.c opti895.c opti5x7.c scamp.c scat.c sis_85c310.c sis_85c4xx.c diff --git a/src/chipset/acc2168.c b/src/chipset/acc2168.c index 7332a28a3..765913672 100644 --- a/src/chipset/acc2168.c +++ b/src/chipset/acc2168.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Tiseno100 * * Copyright 2019 Sarah Walker. diff --git a/src/chipset/ali1429.c b/src/chipset/ali1429.c index 699769fa2..500b1c6a0 100644 --- a/src/chipset/ali1429.c +++ b/src/chipset/ali1429.c @@ -1,23 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the ALi M1429 chipset. + * Implementation of the ALi M1429 chipset. * - * Note: This chipset has no datasheet, everything were done via - * reverse engineering the BIOS of various machines using it. + * Note: This chipset has no datasheet, everything were done via + * reverse engineering the BIOS of various machines using it. * + * Authors: Tiseno100, + * Miran Grca, * - * - * Authors: Tiseno100, - * Miran Grca, - * - * Copyright 2020,2021 Tiseno100. - * Copyright 2021,2021 Miran Grca. + * Copyright 2020,2021 Tiseno100. + * Copyright 2021,2021 Miran Grca. */ /* @@ -66,14 +64,15 @@ Register 20h: Bits 2-1-0: Bus Clock Speed 0 0 0: 7.1519Mhz (ATCLK2) - 0 0 1: CLK2IN/4 - 0 1 0: CLK2IN/5 - 0 1 1: CLK2IN/6 - 1 0 0: CLK2IN/8 - 1 0 1: CLK2IN/10 - 1 1 0: CLK2IN/12 + 0 0 1: CLK2IN/4 + 0 1 0: CLK2IN/5 + 0 1 1: CLK2IN/6 + 1 0 0: CLK2IN/8 + 1 0 1: CLK2IN/10 + 1 1 0: CLK2IN/12 */ + #include #include #include @@ -95,11 +94,13 @@ #include <86box/smram.h> #include <86box/chipset.h> -#define GREEN dev->is_g /* Is G Variant */ +#define GREEN dev->is_g /* Is G Variant */ + #ifdef ENABLE_ALI1429_LOG int ali1429_do_log = ENABLE_ALI1429_LOG; + static void ali1429_log(const char *fmt, ...) { @@ -112,25 +113,27 @@ ali1429_log(const char *fmt, ...) } } #else -# define ali1429_log(fmt, ...) +#define ali1429_log(fmt, ...) #endif + typedef struct { - uint8_t is_g, index, cfg_locked, reg_57h, - regs[90]; + uint8_t is_g, index, cfg_locked, reg_57h, + regs[90]; } ali1429_t; + static void ali1429_shadow_recalc(ali1429_t *dev) { uint32_t base, i, can_write, can_read; - shadowbios = (dev->regs[0x13] & 0x40) && (dev->regs[0x14] & 0x01); + shadowbios = (dev->regs[0x13] & 0x40) && (dev->regs[0x14] & 0x01); shadowbios_write = (dev->regs[0x13] & 0x40) && (dev->regs[0x14] & 0x02); can_write = (dev->regs[0x14] & 0x02) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY; - can_read = (dev->regs[0x14] & 0x01) ? MEM_READ_INTERNAL : MEM_READ_EXTANY; + can_read = (dev->regs[0x14] & 0x01) ? MEM_READ_INTERNAL : MEM_READ_EXTANY; for (i = 0; i < 8; i++) { base = 0xc0000 + (i << 15); @@ -144,149 +147,149 @@ ali1429_shadow_recalc(ali1429_t *dev) flushmmucache_nopc(); } + static void ali1429_write(uint16_t addr, uint8_t val, void *priv) { - ali1429_t *dev = (ali1429_t *) priv; + ali1429_t *dev = (ali1429_t *)priv; switch (addr) { - case 0x22: - dev->index = val; - break; + case 0x22: + dev->index = val; + break; - case 0x23: + case 0x23: #ifdef ENABLE_ALI1429_LOG - if (dev->index != 0x03) - ali1429_log("M1429: dev->regs[%02x] = %02x\n", dev->index, val); + if (dev->index != 0x03) + ali1429_log("M1429: dev->regs[%02x] = %02x\n", dev->index, val); #endif - if (dev->index == 0x03) - dev->cfg_locked = !(val == 0xc5); + if (dev->index == 0x03) + dev->cfg_locked = (val != 0xc5); - if (!dev->cfg_locked) { - /* Common M1429 Registers */ - switch (dev->index) { - case 0x10: - case 0x11: - dev->regs[dev->index] = val; - break; + if (!dev->cfg_locked) { + pclog("M1429: dev->regs[%02x] = %02x\n", dev->index, val); - case 0x12: - dev->regs[dev->index] = val; - if (val & 4) - mem_remap_top(128); - else - mem_remap_top(0); - break; + /* Common M1429 Registers */ + switch (dev->index) { + case 0x10: case 0x11: + dev->regs[dev->index] = val; + break; - case 0x13: - case 0x14: - dev->regs[dev->index] = val; - ali1429_shadow_recalc(dev); - break; + case 0x12: + dev->regs[dev->index] = val; + if(val & 4) + mem_remap_top(128); + else + mem_remap_top(0); + break; - case 0x15: - case 0x16: - case 0x17: - dev->regs[dev->index] = val; - break; + case 0x13: case 0x14: + dev->regs[dev->index] = val; + ali1429_shadow_recalc(dev); + break; - case 0x18: - dev->regs[dev->index] = (val & 0x8f) | 0x20; - cpu_cache_ext_enabled = !!(val & 2); - cpu_update_waitstates(); - break; + case 0x15: case 0x16: + case 0x17: + dev->regs[dev->index] = val; + break; - case 0x19: - case 0x1a: - case 0x1e: - dev->regs[dev->index] = val; - break; + case 0x18: + dev->regs[dev->index] = (val & 0x8f) | 0x20; + cpu_cache_ext_enabled = !!(val & 2); + cpu_update_waitstates(); + break; - case 0x20: - dev->regs[dev->index] = val; + case 0x19: case 0x1a: + case 0x1e: + dev->regs[dev->index] = val; + break; - switch (val & 7) { - case 0: - case 7: /* Illegal */ - cpu_set_isa_speed(7159091); - break; + case 0x20: + dev->regs[dev->index] = val; - case 1: - cpu_set_isa_speed(cpu_busspeed / 4); - break; + switch(val & 7) { + case 0: case 7: /* Illegal */ + cpu_set_isa_speed(7159091); + break; - case 2: - cpu_set_isa_speed(cpu_busspeed / 5); - break; + case 1: + cpu_set_isa_speed(cpu_busspeed / 4); + break; - case 3: - cpu_set_isa_speed(cpu_busspeed / 6); - break; + case 2: + cpu_set_isa_speed(cpu_busspeed / 5); + break; - case 4: - cpu_set_isa_speed(cpu_busspeed / 8); - break; + case 3: + cpu_set_isa_speed(cpu_busspeed / 6); + break; - case 5: - cpu_set_isa_speed(cpu_busspeed / 10); - break; + case 4: + cpu_set_isa_speed(cpu_busspeed / 8); + break; - case 6: - cpu_set_isa_speed(cpu_busspeed / 12); - break; - } - break; + case 5: + cpu_set_isa_speed(cpu_busspeed / 10); + break; - case 0x21 ... 0x27: - dev->regs[dev->index] = val; - break; - } + case 6: + cpu_set_isa_speed(cpu_busspeed / 12); + break; + } + break; - /* M1429G Only Registers */ - if (GREEN) { - switch (dev->index) { - case 0x30 ... 0x41: - case 0x43: - case 0x45: - case 0x4a: - dev->regs[dev->index] = val; - break; + case 0x21 ... 0x27: + dev->regs[dev->index] = val; + break; + } - case 0x57: - dev->reg_57h = val; - break; - } - } - } - break; + /* M1429G Only Registers */ + if (GREEN) { + switch (dev->index) { + case 0x30 ... 0x41: + case 0x43: case 0x45: + case 0x4a: + dev->regs[dev->index] = val; + break; + + case 0x57: + dev->reg_57h = val; + break; + } + } + } + break; } } + static uint8_t ali1429_read(uint16_t addr, void *priv) { - ali1429_t *dev = (ali1429_t *) priv; - uint8_t ret = 0xff; + ali1429_t *dev = (ali1429_t *)priv; + uint8_t ret = 0xff; if ((addr == 0x23) && (dev->index >= 0x10) && (dev->index <= 0x4a)) - ret = dev->regs[dev->index]; + ret = dev->regs[dev->index]; else if ((addr == 0x23) && (dev->index == 0x57)) - ret = dev->reg_57h; + ret = dev->reg_57h; else if (addr == 0x22) - ret = dev->index; + ret = dev->index; return ret; } + static void ali1429_close(void *priv) { - ali1429_t *dev = (ali1429_t *) priv; + ali1429_t *dev = (ali1429_t *)priv; free(dev); } + static void ali1429_defaults(ali1429_t *dev) { @@ -305,27 +308,28 @@ ali1429_defaults(ali1429_t *dev) /* M1429G Default Registers */ if (GREEN) { - dev->regs[0x31] = 0x88; - dev->regs[0x32] = 0xc0; - dev->regs[0x38] = 0xe5; - dev->regs[0x40] = 0xe3; - dev->regs[0x41] = 2; - dev->regs[0x45] = 0x80; + dev->regs[0x31] = 0x88; + dev->regs[0x32] = 0xc0; + dev->regs[0x38] = 0xe5; + dev->regs[0x40] = 0xe3; + dev->regs[0x41] = 2; + dev->regs[0x45] = 0x80; } } + static void * ali1429_init(const device_t *info) { - ali1429_t *dev = (ali1429_t *) malloc(sizeof(ali1429_t)); + ali1429_t *dev = (ali1429_t *)malloc(sizeof(ali1429_t)); memset(dev, 0, sizeof(ali1429_t)); dev->cfg_locked = 1; - GREEN = info->local; + GREEN = info->local; /* M1429 Ports: - 22h Index Port - 23h Data Port + 22h Index Port + 23h Data Port */ io_sethandler(0x0022, 0x0002, ali1429_read, NULL, NULL, ali1429_write, NULL, NULL, dev); @@ -337,29 +341,29 @@ ali1429_init(const device_t *info) } const device_t ali1429_device = { - .name = "ALi M1429", + .name = "ALi M1429", .internal_name = "ali1429", - .flags = 0, - .local = 0, - .init = ali1429_init, - .close = ali1429_close, - .reset = NULL, + .flags = 0, + .local = 0, + .init = ali1429_init, + .close = ali1429_close, + .reset = NULL, { .available = NULL }, .speed_changed = NULL, - .force_redraw = NULL, - .config = NULL + .force_redraw = NULL, + .config = NULL }; const device_t ali1429g_device = { - .name = "ALi M1429G", + .name = "ALi M1429G", .internal_name = "ali1429g", - .flags = 0, - .local = 1, - .init = ali1429_init, - .close = ali1429_close, - .reset = NULL, + .flags = 0, + .local = 1, + .init = ali1429_init, + .close = ali1429_close, + .reset = NULL, { .available = NULL }, .speed_changed = NULL, - .force_redraw = NULL, - .config = NULL + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/ali1435.c b/src/chipset/ali1435.c new file mode 100644 index 000000000..4497ad338 --- /dev/null +++ b/src/chipset/ali1435.c @@ -0,0 +1,323 @@ +/* + * 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. + * + * Emulation of ALi M1435 chipset that acts as both the + * southbridge. + * + * + * + * Authors: Miran Grca, + * + * Copyright 2020 Miran Grca. + */ +#include +#include +#include +#include +#include +#include +#define HAVE_STDARG_H +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/apm.h> +#include <86box/dma.h> +#include <86box/mem.h> +#include <86box/smram.h> +#include <86box/pci.h> +#include <86box/timer.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/port_92.h> +#include <86box/hdc_ide.h> +#include <86box/hdc.h> +#include <86box/machine.h> +#include <86box/chipset.h> +#include <86box/spd.h> + + +#define MEM_STATE_SHADOW_R 0x01 +#define MEM_STATE_SHADOW_W 0x02 +#define MEM_STATE_SMRAM 0x04 + + +typedef struct +{ + uint8_t index, cfg_locked, + regs[16], pci_regs[256]; +} ali1435_t; + + +#define ENABLE_ALI1435_LOG 1 +#ifdef ENABLE_ALI1435_LOG +int ali1435_do_log = ENABLE_ALI1435_LOG; + + +static void +ali1435_log(const char *fmt, ...) +{ + va_list ap; + + if (ali1435_do_log) { + va_start(ap, fmt); + pclog_ex(fmt, ap); + va_end(ap); + } +} +#else +#define ali1435_log(fmt, ...) +#endif + + +/* NOTE: We cheat here. The real ALi M1435 uses a level to edge triggered IRQ converter + when the most siginificant bit is set. We work around that by manipulating the + emulated PIC's ELCR register. */ +static void +ali1435_update_irqs(ali1435_t *dev, int set) +{ + uint8_t val; + int i, reg; + int shift, irq; + int irq_map[8] = { -1, 5, 9, 10, 11, 12, 14, 15 }; + pic_t *temp_pic; + + for (i = 0; i < 4; i++) { + reg = 0x80 + (i >> 1); + shift = (i & 1) << 2; + val = (dev->pci_regs[reg] >> shift) & 0x0f; + irq = irq_map[val & 0x07]; + if (irq == -1) + continue; + temp_pic = (irq >= 8) ? &pic2 : &pic; + irq &= 7; + if (set && (val & 0x08)) + temp_pic->elcr |= (1 << irq); + else + temp_pic->elcr &= ~(1 << irq); + } +} + + +static void +ali1435_pci_write(int func, int addr, uint8_t val, void *priv) +{ + ali1435_t *dev = (ali1435_t *) priv; + int irq, irq_map[8] = { -1, 5, 9, 10, 11, 12, 14, 15 }; + + ali1435_log("ali1435_write(%02X, %02X, %02X)\n", func, addr, val); + + if (func > 0) + return; + + if ((addr < 0x04) || (addr == 0x06) || ((addr >= 0x08) && (addr <= 0x0b))) + return; + + if ((addr >= 0x0f) && (addr < 0x30)) + return; + + if ((addr >= 0x34) && (addr < 0x40)) + return; + + switch (addr) { + /* Dummy PCI Config */ + case 0x04: + dev->pci_regs[addr] = (val & 0x7f) | 0x07; + break; + + case 0x05: + dev->pci_regs[addr] = (val & 0x01); + break; + + /* Dummy PCI Status */ + case 0x07: + dev->pci_regs[addr] &= ~(val & 0xb8); + break; + + case 0x80: case 0x81: + dev->pci_regs[addr] = val; + ali1435_update_irqs(dev, 0); + irq = irq_map[val & 0x07]; + if (irq >= 0) { + ali1435_log("Set IRQ routing: INT %c -> %02X\n", 0x41 + ((addr & 0x01) << 1), irq); + pci_set_irq_routing(PCI_INTA + ((addr & 0x01) << 1), irq); + } else { + ali1435_log("Set IRQ routing: INT %c -> FF\n", 0x41 + ((addr & 0x01) << 1)); + pci_set_irq_routing(PCI_INTA + ((addr & 0x01) << 1), PCI_IRQ_DISABLED); + } + irq = irq_map[(val >> 4) & 0x07]; + if (irq >= 0) { + ali1435_log("Set IRQ routing: INT %c -> %02X\n", 0x42 + ((addr & 0x01) << 1), irq); + pci_set_irq_routing(PCI_INTB + ((addr & 0x01) << 1), irq); + } else { + ali1435_log("Set IRQ routing: INT %c -> FF\n", 0x42 + ((addr & 0x01) << 1)); + pci_set_irq_routing(PCI_INTB + ((addr & 0x01) << 1), PCI_IRQ_DISABLED); + } + ali1435_update_irqs(dev, 1); + break; + + default: + dev->pci_regs[addr] = val; + break; + } +} + + +static uint8_t +ali1435_pci_read(int func, int addr, void *priv) +{ + ali1435_t *dev = (ali1435_t *) priv; + uint8_t ret; + + ret = 0xff; + + if (func == 0) + ret = dev->pci_regs[addr]; + + ali1435_log("ali1435_read(%02X, %02X) = %02X\n", func, addr, ret); + + return ret; +} + + +static void +ali1435_write(uint16_t addr, uint8_t val, void *priv) +{ + ali1435_t *dev = (ali1435_t *)priv; + + switch (addr) { + case 0x22: + dev->index = val; + break; + + case 0x23: +/* #ifdef ENABLE_ALI1435_LOG + if (dev->index != 0x03) + ali1435_log("M1435: dev->regs[%02x] = %02x\n", dev->index, val); +#endif */ + + if (dev->index == 0x03) + dev->cfg_locked = (val != 0x69); + + if (!dev->cfg_locked) { + pclog("M1435: dev->regs[%02x] = %02x\n", dev->index, val); + + switch (dev->index) { + /* PCI Mechanism select? */ + case 0x00: + dev->regs[dev->index] = val; + pclog("PMC = %i\n", val != 0xc8); + pci_set_pmc(val != 0xc8); + break; + + /* ???? */ + case 0x06: + dev->regs[dev->index] = val; + break; + + /* ???? */ + case 0x07: + dev->regs[dev->index] = val; + break; + } + } + break; + } +} + + +static uint8_t +ali1435_read(uint16_t addr, void *priv) +{ + ali1435_t *dev = (ali1435_t *)priv; + uint8_t ret = 0xff; + + if ((addr == 0x23) && (dev->index < 0x10)) + ret = dev->regs[dev->index]; + else if (addr == 0x22) + ret = dev->index; + + return ret; +} + + +static void +ali1435_reset(void *priv) +{ + ali1435_t *dev = (ali1435_t *) priv; + + memset(dev->regs, 0, 16); + + dev->regs[0x00] = 0xff; + + pci_set_pmc(0); + + dev->cfg_locked = 1; + + memset(dev->pci_regs, 0, 256); + + dev->pci_regs[0x00] = 0x25; dev->pci_regs[0x01] = 0x10; /*ALi*/ + dev->pci_regs[0x02] = 0x35; dev->pci_regs[0x03] = 0x14; /*M1435*/ + dev->pci_regs[0x04] = 0x07; + dev->pci_regs[0x07] = 0x04; + dev->pci_regs[0x0b] = 0x06; + + dev->pci_regs[0x80] = 0x80; dev->pci_regs[0x81] = 0x00; + + pci_set_irq_routing(PCI_INTA, PCI_IRQ_DISABLED); + pci_set_irq_routing(PCI_INTB, PCI_IRQ_DISABLED); + pci_set_irq_routing(PCI_INTC, PCI_IRQ_DISABLED); + pci_set_irq_routing(PCI_INTD, PCI_IRQ_DISABLED); +} + + +static void +ali1435_close(void *p) +{ + ali1435_t *dev = (ali1435_t *)p; + + free(dev); +} + + +static void * +ali1435_init(const device_t *info) +{ + ali1435_t *dev = (ali1435_t *) malloc(sizeof(ali1435_t)); + memset(dev, 0, sizeof(ali1435_t)); + + dev->cfg_locked = 1; + + /* M1435 Ports: + 22h Index Port + 23h Data Port + */ + io_sethandler(0x0022, 0x0002, ali1435_read, NULL, NULL, ali1435_write, NULL, NULL, dev); + + pci_add_card(PCI_ADD_NORTHBRIDGE, ali1435_pci_read, ali1435_pci_write, dev); + + ali1435_reset(dev); + + /* pci_set_irq_level(PCI_INTA, 0); + pci_set_irq_level(PCI_INTB, 0); + pci_set_irq_level(PCI_INTC, 0); + pci_set_irq_level(PCI_INTD, 0); */ + + return dev; +} + +const device_t ali1435_device = { + .name = "Intel ALi M1435", + .internal_name = "ali1435", + .flags = DEVICE_PCI, + .local = 0x00, + .init = ali1435_init, + .close = ali1435_close, + .reset = ali1435_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/ali1489.c b/src/chipset/ali1489.c index 8a0cfd89a..70ff509ab 100644 --- a/src/chipset/ali1489.c +++ b/src/chipset/ali1489.c @@ -13,8 +13,8 @@ * Authors: Tiseno100, * Miran Grca, * - * Copyright 2020,2021 Tiseno100. - * Copyright 2020,2021 Miran Grca. + * Copyright 2020-2021 Tiseno100. + * Copyright 2020-2021 Miran Grca. */ #include #include diff --git a/src/chipset/cs8230.c b/src/chipset/cs8230.c index 49e7d71b6..edf4ac8c2 100644 --- a/src/chipset/cs8230.c +++ b/src/chipset/cs8230.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * * Copyright 2020 Sarah Walker. */ diff --git a/src/chipset/headland.c b/src/chipset/headland.c index c1881bede..8b8ee1562 100644 --- a/src/chipset/headland.c +++ b/src/chipset/headland.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Fred N. van Kempen, * Original by GreatPsycho for PCem. * Miran Grca, diff --git a/src/chipset/scamp.c b/src/chipset/scamp.c index ec7381cec..6e61db681 100644 --- a/src/chipset/scamp.c +++ b/src/chipset/scamp.c @@ -15,7 +15,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * * Copyright 2020 Sarah Walker. */ diff --git a/src/chipset/sis_85c4xx.c b/src/chipset/sis_85c4xx.c index ade5573f1..670a2cc83 100644 --- a/src/chipset/sis_85c4xx.c +++ b/src/chipset/sis_85c4xx.c @@ -13,7 +13,7 @@ * * Authors: Miran Grca, * - * Copyright 2019,2020 Miran Grca. + * Copyright 2019-2020 Miran Grca. */ #include #include diff --git a/src/chipset/sis_85c50x.c b/src/chipset/sis_85c50x.c index 24fdd7788..247ff1b96 100644 --- a/src/chipset/sis_85c50x.c +++ b/src/chipset/sis_85c50x.c @@ -59,7 +59,7 @@ typedef struct sis_85c50x_t { pci_conf[256], pci_conf_sb[256], regs[256]; - smram_t *smram; + smram_t *smram[2]; port_92_t *port_92; } sis_85c50x_t; @@ -93,28 +93,41 @@ static void sis_85c50x_smm_recalc(sis_85c50x_t *dev) { /* NOTE: Naming mismatch - what the datasheet calls "host address" is what we call ram_base. */ - uint32_t ram_base = (dev->pci_conf[0x64] << 20) | ((dev->pci_conf[0x65] & 0x07) << 28); + uint32_t host_base = (dev->pci_conf[0x64] << 20) | ((dev->pci_conf[0x65] & 0x07) << 28); - smram_disable(dev->smram); + smram_disable_all(); - if ((((dev->pci_conf[0x65] & 0xe0) >> 5) != 0x00) && (ram_base == 0x00000000)) + if ((((dev->pci_conf[0x65] & 0xe0) >> 5) != 0x00) && (host_base == 0x00000000)) return; switch ((dev->pci_conf[0x65] & 0xe0) >> 5) { case 0x00: - smram_enable(dev->smram, 0xe0000, 0xe0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + sis_85c50x_log("SiS 50x SMRAM: 000E0000-000E7FFF -> 000E0000-000E7FFF\n"); + smram_enable(dev->smram[0], 0xe0000, 0xe0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); break; case 0x01: - smram_enable(dev->smram, 0xb0000, ram_base, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); + host_base |= 0x000b0000; + sis_85c50x_log("SiS 50x SMRAM: %08X-%08X -> 000B0000-000BFFFF\n", host_base, host_base + 0x10000 - 1); + smram_enable(dev->smram[0], host_base, 0xb0000, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); + smram_enable(dev->smram[1], host_base ^ 0x00100000, 0xb0000, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); break; case 0x02: - smram_enable(dev->smram, 0xa0000, ram_base, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); + host_base |= 0x000a0000; + sis_85c50x_log("SiS 50x SMRAM: %08X-%08X -> 000A0000-000AFFFF\n", host_base, host_base + 0x10000 - 1); + smram_enable(dev->smram[0], host_base, 0xa0000, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); + smram_enable(dev->smram[1], host_base ^ 0x00100000, 0xa0000, 0x10000, (dev->pci_conf[0x65] & 0x10), 1); break; case 0x04: - smram_enable(dev->smram, 0xa0000, ram_base, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + host_base |= 0x000a0000; + sis_85c50x_log("SiS 50x SMRAM: %08X-%08X -> 000A0000-000AFFFF\n", host_base, host_base + 0x8000 - 1); + smram_enable(dev->smram[0], host_base, 0xa0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + smram_enable(dev->smram[1], host_base ^ 0x00100000, 0xa0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); break; case 0x06: - smram_enable(dev->smram, 0xb0000, ram_base, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + host_base |= 0x000b0000; + sis_85c50x_log("SiS 50x SMRAM: %08X-%08X -> 000B0000-000BFFFF\n", host_base, host_base + 0x8000 - 1); + smram_enable(dev->smram[0], host_base, 0xb0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); + smram_enable(dev->smram[1], host_base ^ 0x00100000, 0xa0000, 0x8000, (dev->pci_conf[0x65] & 0x10), 1); break; } } @@ -123,9 +136,10 @@ static void sis_85c50x_write(int func, int addr, uint8_t val, void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; - uint8_t valxor = (val ^ dev->pci_conf[addr]); - switch (addr) { + sis_85c50x_log("85C501: [W] (%02X, %02X) = %02X\n", func, addr, val); + + if (func == 0x00) switch (addr) { case 0x04: /* Command - low byte */ dev->pci_conf[addr] = (dev->pci_conf[addr] & 0xb4) | (val & 0x4b); break; @@ -177,8 +191,6 @@ sis_85c50x_write(int func, int addr, uint8_t val, void *priv) break; case 0x5b: dev->pci_conf[addr] = val; - if (valxor & 0xc0) - port_92_set_features(dev->port_92, !!(val & 0x40), !!(val & 0x80)); break; case 0x60: /* SMI */ if ((dev->pci_conf[0x68] & 0x01) && !(dev->pci_conf[addr] & 0x02) && (val & 0x02)) { @@ -199,18 +211,20 @@ sis_85c50x_write(int func, int addr, uint8_t val, void *priv) dev->pci_conf[addr] &= ~(val); break; } - - sis_85c50x_log("85C501: dev->pci_conf[%02x] = %02x\n", addr, val); } static uint8_t sis_85c50x_read(int func, int addr, void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; + uint8_t ret = 0xff; - sis_85c50x_log("85C501: dev->pci_conf[%02x] (%02x)\n", addr, dev->pci_conf[addr]); + if (func == 0x00) + ret = dev->pci_conf[addr]; - return dev->pci_conf[addr]; + sis_85c50x_log("85C501: [R] (%02X, %02X) = %02X\n", func, addr, ret); + + return ret; } static void @@ -218,7 +232,9 @@ sis_85c50x_sb_write(int func, int addr, uint8_t val, void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; - switch (addr) { + sis_85c50x_log("85C503: [W] (%02X, %02X) = %02X\n", func, addr, val); + + if (func == 0x00) switch (addr) { case 0x04: /* Command */ dev->pci_conf_sb[addr] = val & 0x0f; break; @@ -246,17 +262,20 @@ sis_85c50x_sb_write(int func, int addr, uint8_t val, void *priv) dev->pci_conf_sb[addr] = val; break; } - - sis_85c50x_log("85C503: dev->pci_conf_sb[%02x] = %02x\n", addr, val); } static uint8_t sis_85c50x_sb_read(int func, int addr, void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; - sis_85c50x_log("85C503: dev->pci_conf_sb[%02x] (%02x)\n", addr, dev->pci_conf_sb[addr]); + uint8_t ret = 0xff; - return dev->pci_conf_sb[addr]; + if (func == 0x00) + ret = dev->pci_conf_sb[addr]; + + sis_85c50x_log("85C503: [W] (%02X, %02X) = %02X\n", func, addr, ret); + + return ret; } static void @@ -264,6 +283,8 @@ sis_85c50x_isa_write(uint16_t addr, uint8_t val, void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; + sis_85c50x_log("85C503 ISA: [W] (%04X) = %02X\n", addr, val); + switch (addr) { case 0x22: dev->index = val; @@ -279,7 +300,7 @@ sis_85c50x_isa_write(uint16_t addr, uint8_t val, void *priv) break; case 0x84: case 0x88: - case 0x9: + case 0x89: case 0x8a: case 0x8b: dev->regs[dev->index] = val; @@ -290,8 +311,6 @@ sis_85c50x_isa_write(uint16_t addr, uint8_t val, void *priv) } break; } - - sis_85c50x_log("85C501-ISA: dev->regs[%02x] = %02x\n", addr, val); } static uint8_t @@ -313,7 +332,7 @@ sis_85c50x_isa_read(uint16_t addr, void *priv) break; } - sis_85c50x_log("85C501-ISA: dev->regs[%02x] (%02x)\n", dev->index, ret); + sis_85c50x_log("85C503 ISA: [R] (%04X) = %02X\n", addr, ret); return ret; } @@ -370,7 +389,8 @@ sis_85c50x_close(void *priv) { sis_85c50x_t *dev = (sis_85c50x_t *) priv; - smram_del(dev->smram); + smram_del(dev->smram[1]); + smram_del(dev->smram[0]); free(dev); } @@ -387,7 +407,9 @@ sis_85c50x_init(const device_t *info) pci_add_card(PCI_ADD_SOUTHBRIDGE, sis_85c50x_sb_read, sis_85c50x_sb_write, dev); io_sethandler(0x0022, 0x0002, sis_85c50x_isa_read, NULL, NULL, sis_85c50x_isa_write, NULL, NULL, dev); - dev->smram = smram_add(); + dev->smram[0] = smram_add(); + dev->smram[1] = smram_add(); + dev->port_92 = device_add(&port_92_device); sis_85c50x_reset(dev); diff --git a/src/chipset/via_apollo.c b/src/chipset/via_apollo.c index 99802b2b5..6ed6f21fe 100644 --- a/src/chipset/via_apollo.c +++ b/src/chipset/via_apollo.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Melissa Goad, * Tiseno100, diff --git a/src/chipset/via_pipc.c b/src/chipset/via_pipc.c index e6701ebfc..4f640920e 100644 --- a/src/chipset/via_pipc.c +++ b/src/chipset/via_pipc.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Melissa Goad, * RichardG, diff --git a/src/codegen/CMakeLists.txt b/src/codegen/CMakeLists.txt index 23936959e..3cb9de6ca 100644 --- a/src/codegen/CMakeLists.txt +++ b/src/codegen/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # if(DYNAREC) diff --git a/src/codegen/codegen.h b/src/codegen/codegen.h index af602427d..cb9df495b 100644 --- a/src/codegen/codegen.h +++ b/src/codegen/codegen.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2018 Sarah Walker. diff --git a/src/codegen/codegen_ops_x86-64.h b/src/codegen/codegen_ops_x86-64.h index 00518d9ba..77f7c02ab 100644 --- a/src/codegen/codegen_ops_x86-64.h +++ b/src/codegen/codegen_ops_x86-64.h @@ -82,7 +82,7 @@ load_param_1_reg_32(int reg) #if 0 static __inline void load_param_1_64(codeblock_t *block, uint64_t param) { - addbyte(0x48); + addbyte(0x48); # if _WIN64 addbyte(0xb9); /*MOVL $fetchdat,%ecx*/ # else diff --git a/src/codegen/codegen_x86.c b/src/codegen/codegen_x86.c index bd9793732..dbf76c2e4 100644 --- a/src/codegen/codegen_x86.c +++ b/src/codegen/codegen_x86.c @@ -11,7 +11,7 @@ * * * Authors: Fred N. van Kempen, - * Sarah Walker, + * Sarah Walker, * Miran Grca, * * Copyright 2018 Fred N. van Kempen. diff --git a/src/codegen_new/CMakeLists.txt b/src/codegen_new/CMakeLists.txt index 8c02060e4..038f1edd1 100644 --- a/src/codegen_new/CMakeLists.txt +++ b/src/codegen_new/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # if(DYNAREC) diff --git a/src/codegen_new/codegen_backend_arm_uops.c b/src/codegen_new/codegen_backend_arm_uops.c index 4cc0ff38d..d0b8b86c1 100644 --- a/src/codegen_new/codegen_backend_arm_uops.c +++ b/src/codegen_new/codegen_backend_arm_uops.c @@ -119,8 +119,8 @@ codegen_ADD(codeblock_t *block, uop_t *uop) static int codegen_ADD_IMM(codeblock_t *block, uop_t *uop) { - // host_arm_ADD_IMM(block, uop->dest_reg_a_real, uop->src_reg_a_real, uop->imm_data); - // return 0; +// host_arm_ADD_IMM(block, uop->dest_reg_a_real, uop->src_reg_a_real, uop->imm_data); +// return 0; int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg = HOST_REG_GET(uop->src_reg_a_real); int dest_size = IREG_GET_SIZE(uop->dest_reg_a_real), src_size = IREG_GET_SIZE(uop->src_reg_a_real); @@ -2597,8 +2597,8 @@ codegen_SUB(codeblock_t *block, uop_t *uop) return 0; - // host_arm_SUB_REG_LSL(block, uop->dest_reg_a_real, uop->src_reg_a_real, uop->src_reg_b_real, 0); - // return 0; +// host_arm_SUB_REG_LSL(block, uop->dest_reg_a_real, uop->src_reg_a_real, uop->src_reg_b_real, 0); +// return 0; } static int codegen_SUB_IMM(codeblock_t *block, uop_t *uop) diff --git a/src/config.c b/src/config.c index 49e6afca9..ddcd1cb55 100644 --- a/src/config.c +++ b/src/config.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * Overdoze, @@ -19,7 +19,7 @@ * Copyright 2008-2019 Sarah Walker. * Copyright 2016-2019 Miran Grca. * Copyright 2017-2019 Fred N. van Kempen. - * Copyright 2018,2019 David Hrdlička. + * Copyright 2018-2019 David Hrdlička. * * NOTE: Forcing config files to be in Unicode encoding breaks * it on Windows XP, and possibly also Vista. Use the @@ -61,6 +61,7 @@ #include <86box/scsi.h> #include <86box/scsi_device.h> #include <86box/cdrom.h> +#include <86box/cdrom_interface.h> #include <86box/zip.h> #include <86box/mo.h> #include <86box/sound.h> @@ -529,7 +530,7 @@ load_video(void) if (machine_has_flags(machine, MACHINE_VIDEO_ONLY)) { ini_section_delete_var(cat, "gfxcard"); - gfxcard = VID_INTERNAL; + gfxcard[0] = VID_INTERNAL; } else { p = ini_section_get_string(cat, "gfxcard", NULL); if (p == NULL) { @@ -543,9 +544,9 @@ load_video(void) free_p = 1; } if (!strcmp(p, "virge375_vbe20_pci")) /* migrate renamed cards */ - gfxcard = video_get_video_from_internal_name("virge385_pci"); + gfxcard[0] = video_get_video_from_internal_name("virge385_pci"); else - gfxcard = video_get_video_from_internal_name(p); + gfxcard[0] = video_get_video_from_internal_name(p); if (free_p) free(p); } @@ -559,7 +560,7 @@ load_video(void) p = ini_section_get_string(cat, "gfxcard_2", NULL); if (!p) p = "none"; - gfxcard_2 = video_get_video_from_internal_name(p); + gfxcard[1] = video_get_video_from_internal_name(p); } /* Load "Input Devices" section. */ @@ -667,9 +668,36 @@ load_sound(void) if ((p != NULL) && (!strcmp(p, "sbpci128") || !strcmp(p, "sb128pci"))) p = "es1371"; if (p != NULL) - sound_card_current = sound_card_get_from_internal_name(p); + sound_card_current[0] = sound_card_get_from_internal_name(p); else - sound_card_current = 0; + sound_card_current[0] = 0; + + p = ini_section_get_string(cat, "sndcard2", NULL); + /* FIXME: Hack to not break configs with the Sound Blaster 128 PCI set. */ + if ((p != NULL) && (!strcmp(p, "sbpci128") || !strcmp(p, "sb128pci"))) + p = "es1371"; + if (p != NULL) + sound_card_current[1] = sound_card_get_from_internal_name(p); + else + sound_card_current[1] = 0; + + p = ini_section_get_string(cat, "sndcard3", NULL); + /* FIXME: Hack to not break configs with the Sound Blaster 128 PCI set. */ + if ((p != NULL) && (!strcmp(p, "sbpci128") || !strcmp(p, "sb128pci"))) + p = "es1371"; + if (p != NULL) + sound_card_current[2] = sound_card_get_from_internal_name(p); + else + sound_card_current[2] = 0; + + p = ini_section_get_string(cat, "sndcard4", NULL); + /* FIXME: Hack to not break configs with the Sound Blaster 128 PCI set. */ + if ((p != NULL) && (!strcmp(p, "sbpci128") || !strcmp(p, "sb128pci"))) + p = "es1371"; + if (p != NULL) + sound_card_current[3] = sound_card_get_from_internal_name(p); + else + sound_card_current[3] = 0; p = ini_section_get_string(cat, "midi_device", NULL); if (p != NULL) @@ -685,10 +713,6 @@ load_sound(void) mpu401_standalone_enable = !!ini_section_get_int(cat, "mpu401_standalone", 0); - SSI2001 = !!ini_section_get_int(cat, "ssi2001", 0); - GAMEBLASTER = !!ini_section_get_int(cat, "gameblaster", 0); - GUS = !!ini_section_get_int(cat, "gus", 0); - memset(temp, '\0', sizeof(temp)); p = ini_section_get_string(cat, "sound_type", "float"); if (strlen(p) > 511) @@ -906,6 +930,15 @@ load_storage_controllers(void) p = NULL; } + p = ini_section_get_string(cat, "cdrom_interface", NULL); + if (p != NULL) + cdrom_interface_current = cdrom_interface_get_from_internal_name(p); + + if (free_p) { + free(p); + p = NULL; + } + ide_ter_enabled = !!ini_section_get_int(cat, "ide_ter", 0); ide_qua_enabled = !!ini_section_get_int(cat, "ide_qua", 0); @@ -1323,8 +1356,13 @@ load_floppy_and_cdrom_drives(void) sprintf(temp, "cdrom_%02i_speed", c + 1); cdrom[c].speed = ini_section_get_int(cat, temp, 8); - sprintf(temp, "cdrom_%02i_early", c + 1); - cdrom[c].early = ini_section_get_int(cat, temp, 0); + + sprintf(temp, "cdrom_%02i_type", c + 1); + p = ini_section_get_string(cat, temp, (c == 1) ? "86BOX_CD-ROM_1.00" : "none"); + cdrom_set_type(c, cdrom_get_from_internal_name(p)); + if (cdrom_get_type(c) > KNOWN_CDROM_DRIVE_TYPES) + cdrom_set_type(c, KNOWN_CDROM_DRIVE_TYPES); + ini_section_delete_var(cat, temp); /* Default values, needed for proper operation of the Settings dialog. */ cdrom[c].ide_channel = cdrom[c].scsi_device_id = c + 2; @@ -1815,7 +1853,7 @@ config_load(void) dpi_scale = 1; fpu_type = fpu_get_type(cpu_f, cpu, "none"); - gfxcard = video_get_video_from_internal_name("cga"); + gfxcard[0] = video_get_video_from_internal_name("cga"); vid_api = plat_vidapi("default"); vid_resize = 0; video_fullscreen_first = 1; @@ -2199,7 +2237,7 @@ save_video(void) ini_section_t cat = ini_find_or_create_section(config, "Video"); ini_section_set_string(cat, "gfxcard", - video_get_internal_name(gfxcard)); + video_get_internal_name(gfxcard[0])); if (voodoo_enabled == 0) ini_section_delete_var(cat, "voodoo"); @@ -2216,10 +2254,10 @@ save_video(void) else ini_section_set_int(cat, "xga", xga_enabled); - if (gfxcard_2 == 0) + if (gfxcard[1] == 0) ini_section_delete_var(cat, "gfxcard_2"); else - ini_section_set_string(cat, "gfxcard_2", video_get_internal_name(gfxcard_2)); + ini_section_set_string(cat, "gfxcard_2", video_get_internal_name(gfxcard[1])); if (show_second_monitors == 1) ini_section_delete_var(cat, "show_second_monitors"); @@ -2304,10 +2342,25 @@ save_sound(void) { ini_section_t cat = ini_find_or_create_section(config, "Sound"); - if (sound_card_current == 0) + if (sound_card_current[0] == 0) ini_section_delete_var(cat, "sndcard"); else - ini_section_set_string(cat, "sndcard", sound_card_get_internal_name(sound_card_current)); + ini_section_set_string(cat, "sndcard", sound_card_get_internal_name(sound_card_current[0])); + + if (sound_card_current[1] == 0) + ini_section_delete_var(cat, "sndcard2"); + else + ini_section_set_string(cat, "sndcard2", sound_card_get_internal_name(sound_card_current[1])); + + if (sound_card_current[2] == 0) + ini_section_delete_var(cat, "sndcard3"); + else + ini_section_set_string(cat, "sndcard3", sound_card_get_internal_name(sound_card_current[2])); + + if (sound_card_current[3] == 0) + ini_section_delete_var(cat, "sndcard4"); + else + ini_section_set_string(cat, "sndcard4", sound_card_get_internal_name(sound_card_current[3])); if (!strcmp(midi_out_device_get_internal_name(midi_output_device_current), "none")) ini_section_delete_var(cat, "midi_device"); @@ -2324,21 +2377,6 @@ save_sound(void) else ini_section_set_int(cat, "mpu401_standalone", mpu401_standalone_enable); - if (SSI2001 == 0) - ini_section_delete_var(cat, "ssi2001"); - else - ini_section_set_int(cat, "ssi2001", SSI2001); - - if (GAMEBLASTER == 0) - ini_section_delete_var(cat, "gameblaster"); - else - ini_section_set_int(cat, "gameblaster", GAMEBLASTER); - - if (GUS == 0) - ini_section_delete_var(cat, "gus"); - else - ini_section_set_int(cat, "gus", GUS); - if (sound_is_float == 1) ini_section_delete_var(cat, "sound_type"); else @@ -2478,6 +2516,12 @@ save_storage_controllers(void) ini_section_set_string(cat, "hdc", hdc_get_internal_name(hdc_current)); + if (cdrom_interface_current == 0) + ini_section_delete_var(cat, "cdrom_interface"); + else + ini_section_set_string(cat, "cdrom_interface", + cdrom_interface_get_internal_name(cdrom_interface_current)); + if (ide_ter_enabled == 0) ini_section_delete_var(cat, "ide_ter"); else @@ -2725,17 +2769,25 @@ save_floppy_and_cdrom_drives(void) ini_section_set_int(cat, temp, cdrom[c].speed); } - sprintf(temp, "cdrom_%02i_early", c + 1); - if ((cdrom[c].bus_type == 0) || (cdrom[c].early == 0)) { + sprintf(temp, "cdrom_%02i_type", c + 1); + if ((cdrom[c].bus_type == 0) || (cdrom[c].bus_type == CDROM_BUS_MITSUMI)) { ini_section_delete_var(cat, temp); } else { - ini_section_set_int(cat, temp, cdrom[c].early); + ini_section_set_string(cat, temp, + cdrom_get_internal_name(cdrom_get_type(c))); } sprintf(temp, "cdrom_%02i_parameters", c + 1); if (cdrom[c].bus_type == 0) { ini_section_delete_var(cat, temp); - } else { + } else { /*In case one wants an ATAPI drive on SCSI and vice-versa.*/ + if (cdrom[c].bus_type == CDROM_BUS_ATAPI) { + if (cdrom_drive_types[cdrom_get_type(c)].bus_type == BUS_TYPE_SCSI) + cdrom[c].bus_type = CDROM_BUS_SCSI; + } else if (cdrom[c].bus_type == CDROM_BUS_SCSI) { + if (cdrom_drive_types[cdrom_get_type(c)].bus_type == BUS_TYPE_IDE) + cdrom[c].bus_type = CDROM_BUS_ATAPI; + } sprintf(tmp2, "%u, %s", cdrom[c].sound_on, hdd_bus_to_string(cdrom[c].bus_type, 1)); ini_section_set_string(cat, temp, tmp2); diff --git a/src/cpu/386_common.h b/src/cpu/386_common.h index 6310ae642..f26eb7f98 100644 --- a/src/cpu/386_common.h +++ b/src/cpu/386_common.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. diff --git a/src/cpu/386_ops.h b/src/cpu/386_ops.h index ec46ba0ae..e345ee8d8 100644 --- a/src/cpu/386_ops.h +++ b/src/cpu/386_ops.h @@ -11,7 +11,7 @@ * * * Authors: Fred N. van Kempen, - * Sarah Walker, + * Sarah Walker, * leilei, * Miran Grca, * diff --git a/src/cpu/CMakeLists.txt b/src/cpu/CMakeLists.txt index e61d4bfcf..68baaf293 100644 --- a/src/cpu/CMakeLists.txt +++ b/src/cpu/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(cpu OBJECT cpu.c cpu_table.c fpu.c x86.c 808x.c 386.c 386_common.c diff --git a/src/cpu/codegen_timing_686.c b/src/cpu/codegen_timing_686.c index 9752b24c4..7d7f4042d 100644 --- a/src/cpu/codegen_timing_686.c +++ b/src/cpu/codegen_timing_686.c @@ -949,7 +949,7 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uin if (regmask & IMPL_ESP) regmask |= SRCDEP_ESP | DSTDEP_ESP; - agi_stall = check_agi(prev_deps, prev_opcode, prev_fetchdat, prev_op_32); + agi_stall = check_agi(prev_deps, prev_opcode, prev_fetchdat, prev_op_32); /*Second instruction in the pair*/ if ((timings[opcode] & PAIR_MASK) == PAIR_NP) @@ -992,7 +992,7 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uin if (!t_pair) fatal("Pairable 0 cycles! %02x %02x\n", opcode, prev_opcode); - agi_stall = check_agi(deps, opcode, fetchdat, op_32); + agi_stall = check_agi(deps, opcode, fetchdat, op_32); codegen_block_cycles += t_pair + agi_stall; decode_delay = (-t_pair) + 1 + agi_stall; @@ -1012,7 +1012,7 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uin /*Instruction not pairable*/ int agi_stall = 0; - agi_stall = check_agi(deps, opcode, fetchdat, op_32); + agi_stall = check_agi(deps, opcode, fetchdat, op_32); codegen_block_cycles += COUNT(timings[opcode], op_32) + decode_delay + agi_stall; decode_delay = (-COUNT(timings[opcode], op_32)) + 1 + agi_stall; diff --git a/src/cpu/codegen_timing_k6.c b/src/cpu/codegen_timing_k6.c index 6bb472144..6a59fc157 100644 --- a/src/cpu/codegen_timing_k6.c +++ b/src/cpu/codegen_timing_k6.c @@ -1,5 +1,5 @@ /*Most of the vector instructions here are a total guess. - Some of the timings are based on http://users.atw.hu/instlatx64/AuthenticAMD0000562_K6_InstLatX86.txt*/ + Some of the timings are based on http://http://web.archive.org/web/20181122095446/http://users.atw.hu/instlatx64/AuthenticAMD0000562_K6_InstLatX86.txt*/ #include #include #include diff --git a/src/cpu/codegen_timing_p6.c b/src/cpu/codegen_timing_p6.c index 19fa07de1..cf40e084e 100644 --- a/src/cpu/codegen_timing_p6.c +++ b/src/cpu/codegen_timing_p6.c @@ -23,10 +23,10 @@ typedef enum uop_type_t UOP_ALUP0, /*Executes in Port 0 ALU unit*/ UOP_LOAD, /*Executes in Load unit*/ UOP_STORED, /*Executes in Data Store unit*/ - UOP_STOREA, /*Executes in Address Store unit*/ + UOP_STOREA, /*Executes in Address Store unit*/ UOP_FLOAD, /*Executes in Load unit*/ UOP_FSTORED, /*Executes in Data Store unit*/ - UOP_FSTOREA, /*Executes in Address Store unit*/ + UOP_FSTOREA, /*Executes in Address Store unit*/ UOP_MLOAD, /*Executes in Load unit*/ UOP_MSTORED, /*Executes in Data Store unit*/ UOP_MSTOREA, /*Executes in Address Store unit*/ @@ -93,7 +93,7 @@ static const macro_op_t alu_store_op = .uop[1] = {.type = UOP_ALU, .latency = 1}, .uop[2] = {.type = UOP_STORED, .latency = 1}, .uop[3] = {.type = UOP_STOREA, .latency = 1} - }; +}; static const macro_op_t alup0_store_op = { .nr_uops = 4, @@ -162,8 +162,8 @@ static const macro_op_t loop_op = .decode_type = DECODE_COMPLEX, .uop[0] = {.type = UOP_ALU, .latency = 1}, .uop[1] = {.type = UOP_ALU, .latency = 1}, - .uop[2] = {.type = UOP_ALU, .latency = 1}, - .uop[3] = {.type = UOP_ALU, .latency = 1}, + .uop[2] = {.type = UOP_ALU, .latency = 1}, + .uop[3] = {.type = UOP_ALU, .latency = 1}, .uop[4] = {.type = UOP_BRANCH, .latency = 1} }; static const macro_op_t mov_reg_seg_op = @@ -219,7 +219,7 @@ static const macro_op_t push_seg_op = .uop[0] = {.type = UOP_LOAD, .latency = 1}, .uop[1] = {.type = UOP_STORED, .latency = 1}, .uop[2] = {.type = UOP_STOREA, .latency = 1}, - .uop[3] = {.type = UOP_ALU, .latency = 1} + .uop[3] = {.type = UOP_ALU, .latency = 1} }; static const macro_op_t stos_op = { @@ -1607,24 +1607,24 @@ static p6_unit_t *units; /*Pentium Pro has no MMX*/ static p6_unit_t ppro_units[] = { - {.uop_mask = (1 << UOP_ALU) | (1 << UOP_ALUP0) | (1 << UOP_FLOAT)}, /*Port 0*/ - {.uop_mask = (1 << UOP_ALU) | (1 << UOP_BRANCH)}, /*Port 1*/ - {.uop_mask = (1 << UOP_LOAD) | (1 << UOP_FLOAD)}, /*Port 2*/ - {.uop_mask = (1 << UOP_STORED) | (1 << UOP_FSTORED)}, /*Port 3*/ - {.uop_mask = (1 << UOP_STOREA) | (1 << UOP_FSTOREA)}, /*Port 4*/ + {.uop_mask = (1 << UOP_ALU) | (1 << UOP_ALUP0) | (1 << UOP_FLOAT)}, /*Port 0*/ + {.uop_mask = (1 << UOP_ALU) | (1 << UOP_BRANCH)}, /*Port 1*/ + {.uop_mask = (1 << UOP_LOAD) | (1 << UOP_FLOAD)}, /*Port 2*/ + {.uop_mask = (1 << UOP_STORED) | (1 << UOP_FSTORED)}, /*Port 3*/ + {.uop_mask = (1 << UOP_STOREA) | (1 << UOP_FSTOREA)}, /*Port 4*/ }; #define NR_PPRO_UNITS (sizeof(ppro_units) / sizeof(p6_unit_t)) /*Pentium II/Celeron assigns the multiplier to port 0, the shifter to port 1, and shares the MMX ALU*/ static p6_unit_t p2_units[] = { - {.uop_mask = (1 << UOP_ALU) | (1 << UOP_ALUP0) | (1 << UOP_FLOAT) | /*Port 0*/ - (1 << UOP_MMX) | (1 << UOP_MMX_MUL)}, - {.uop_mask = (1 << UOP_ALU) | (1 << UOP_BRANCH) | /*Port 1*/ - (1 << UOP_MMX) | (1 << UOP_MMX_SHIFT)}, - {.uop_mask = (1 << UOP_LOAD) | (1 << UOP_FLOAD) | (1 << UOP_MLOAD)}, /*Port 2*/ - {.uop_mask = (1 << UOP_STORED) | (1 << UOP_FSTORED) | (1 << UOP_MSTORED)}, /*Port 3*/ - {.uop_mask = (1 << UOP_STOREA) | (1 << UOP_FSTOREA) | (1 << UOP_MSTOREA)}, /*Port 4*/ + {.uop_mask = (1 << UOP_ALU) | (1 << UOP_ALUP0) | (1 << UOP_FLOAT) | /*Port 0*/ + (1 << UOP_MMX) | (1 << UOP_MMX_MUL)}, + {.uop_mask = (1 << UOP_ALU) | (1 << UOP_BRANCH) | /*Port 1*/ + (1 << UOP_MMX) | (1 << UOP_MMX_SHIFT)}, + {.uop_mask = (1 << UOP_LOAD) | (1 << UOP_FLOAD) | (1 << UOP_MLOAD)}, /*Port 2*/ + {.uop_mask = (1 << UOP_STORED) | (1 << UOP_FSTORED) | (1 << UOP_MSTORED)}, /*Port 3*/ + {.uop_mask = (1 << UOP_STOREA) | (1 << UOP_FSTOREA) | (1 << UOP_MSTOREA)}, /*Port 4*/ }; #define NR_P2_UNITS (sizeof(p2_units) / sizeof(p6_unit_t)) @@ -1790,7 +1790,7 @@ static void decode_instruction(const macro_op_t *ins, uint64_t deps, uint32_t fe uint32_t regmask_required; uint32_t regmask_modified; int c; - int d = 0; /*Complex decoder uOPs*/ + int d = 0; /*Complex decoder uOPs*/ int earliest_start = 0; decode_type_t decode_type = ins->decode_type; int instr_length = codegen_timing_instr_length(deps, fetchdat, op_32); @@ -1839,7 +1839,7 @@ static void decode_instruction(const macro_op_t *ins, uint64_t deps, uint32_t fe decode_buffer.uops[decode_buffer.nr_uops] = &ins->uop[0]; decode_buffer.earliest_start[decode_buffer.nr_uops] = earliest_start; decode_buffer.nr_uops = 2+d; - if (d) + if (d) decode_flush_p6(); } else if (decode_buffer.nr_uops) @@ -1869,7 +1869,7 @@ static void decode_instruction(const macro_op_t *ins, uint64_t deps, uint32_t fe decode_buffer.earliest_start[d] = earliest_start; else decode_buffer.earliest_start[d] = -1; - d++; + d++; if ((d == 3) && (ins->nr_uops > 4)) /*Ins. with >4 uOPs require the use of special units only present on 3 translate PLAs*/ { @@ -1878,10 +1878,10 @@ static void decode_instruction(const macro_op_t *ins, uint64_t deps, uint32_t fe decode_flush_p6(); /*The other two decoders are halted to preserve in-order issue*/ } } - if (d) - { - decode_buffer.nr_uops = d; - } + if (d) + { + decode_buffer.nr_uops = d; + } break; } @@ -1982,8 +1982,8 @@ void codegen_timing_p6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint switch (last_prefix) { case 0x0f: - ins_table = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f; - deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f; + ins_table = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f; + deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f; break; case 0xd8: diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 380da450e..d48ebe194 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -8,7 +8,7 @@ * * CPU type handler. * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * leilei, * Miran Grca, * Fred N. van Kempen, diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 307865629..25ff141a7 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * leilei, * Miran Grca, * diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index f9e86541c..3afaf055e 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * leilei, * Miran Grca, * Fred N. van Kempen, @@ -21,8 +21,8 @@ * Copyright 2016-2019 leilei. * Copyright 2016-2019 Miran Grca. * Copyright 2017-2020 Fred N. van Kempen. - * Copyright 2020 RichardG. - * Copyright 2021 dob205. + * Copyright 2020 RichardG. + * Copyright 2021 dob205. */ #include #include @@ -71,1089 +71,1086 @@ FPU fpus_internal[] = { const cpu_family_t cpu_families[] = { // clang-format off { - .package = CPU_PKG_8088, - .manufacturer = "Intel", - .name = "8088", - .internal_name = "8088", - .cpus = (const CPU[]) { - {"4.77", CPU_8088, fpus_8088, 4772728, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"7.16", CPU_8088, fpus_8088, 7159092, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"8", CPU_8088, fpus_8088, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, -// {"9.54", CPU_8088, fpus_8088, 9545456, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"10", CPU_8088, fpus_8088, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"12", CPU_8088, fpus_8088, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"16", CPU_8088, fpus_8088, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"", 0} - } + .package = CPU_PKG_8088, + .manufacturer = "Intel", + .name = "8088", + .internal_name = "8088", + .cpus = (const CPU[]) { + {"4.77", CPU_8088, fpus_8088, 4772728, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"7.16", CPU_8088, fpus_8088, 7159092, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"8", CPU_8088, fpus_8088, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, +// {"9.54", CPU_8088, fpus_8088, 9545456, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"10", CPU_8088, fpus_8088, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"12", CPU_8088, fpus_8088, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"16", CPU_8088, fpus_8088, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"", 0} + } }, { - .package = CPU_PKG_8088_EUROPC, - .manufacturer = "Intel", - .name = "8088", - .internal_name = "8088_europc", - .cpus = (const CPU[]) { - {"4.77", CPU_8088, fpus_8088, 4772728, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, - {"7.16", CPU_8088, fpus_8088, 7159092, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, - {"9.54", CPU_8088, fpus_8088, 9545456, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"", 0} - } + .package = CPU_PKG_8088_EUROPC, + .manufacturer = "Intel", + .name = "8088", + .internal_name = "8088_europc", + .cpus = (const CPU[]) { + {"4.77", CPU_8088, fpus_8088, 4772728, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, + {"7.16", CPU_8088, fpus_8088, 7159092, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, + {"9.54", CPU_8088, fpus_8088, 9545456, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"", 0} + } }, { - .package = CPU_PKG_8086, - .manufacturer = "Intel", - .name = "8086", - .internal_name = "8086", - .cpus = (const CPU[]) { - {"7.16", CPU_8086, fpus_8088, 7159092, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, - {"8", CPU_8086, fpus_8088, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"9.54", CPU_8086, fpus_8088, 9545456, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, - {"10", CPU_8086, fpus_8088, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"12", CPU_8086, fpus_8088, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"16", CPU_8086, fpus_8088, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, - {"", 0} - } + .package = CPU_PKG_8086, + .manufacturer = "Intel", + .name = "8086", + .internal_name = "8086", + .cpus = (const CPU[]) { + {"7.16", CPU_8086, fpus_8088, 7159092, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, + {"8", CPU_8086, fpus_8088, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"9.54", CPU_8086, fpus_8088, 9545456, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, + {"10", CPU_8086, fpus_8088, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"12", CPU_8086, fpus_8088, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"16", CPU_8086, fpus_8088, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, + {"", 0} + } }, { - .package = CPU_PKG_188, - .manufacturer = "Intel", - .name = "80188", - .internal_name = "80188", - .cpus = (const CPU[]) { - {"6", CPU_188, fpus_8088, 6000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"7.16", CPU_188, fpus_8088, 7159092, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, - {"8", CPU_188, fpus_8088, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"9.54", CPU_188, fpus_8088, 9545456, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, - {"10", CPU_188, fpus_8088, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"12", CPU_188, fpus_8088, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"16", CPU_188, fpus_8088, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, - {"20", CPU_188, fpus_8088, 20000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 3}, - {"25", CPU_188, fpus_8088, 25000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 3}, - {"", 0} - } + .package = CPU_PKG_188, + .manufacturer = "Intel", + .name = "80188", + .internal_name = "80188", + .cpus = (const CPU[]) { + {"6", CPU_188, fpus_8088, 6000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"7.16", CPU_188, fpus_8088, 7159092, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, + {"8", CPU_188, fpus_8088, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"9.54", CPU_188, fpus_8088, 9545456, 1, 5000, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, + {"10", CPU_188, fpus_8088, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"12", CPU_188, fpus_8088, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"16", CPU_188, fpus_8088, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, + {"20", CPU_188, fpus_8088, 20000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 3}, + {"25", CPU_188, fpus_8088, 25000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 3}, + {"", 0} + } }, { - .package = CPU_PKG_8088, - .manufacturer = "NEC", - .name = "V20", - .internal_name = "necv20", - .cpus = (const CPU[]) { - {"4.77", CPU_V20, fpus_8088, 4772728, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"7.16", CPU_V20, fpus_8088, 7159092, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"10", CPU_V20, fpus_8088, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"12", CPU_V20, fpus_8088, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"16", CPU_V20, fpus_8088, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, - {"", 0} - } + .package = CPU_PKG_8088, + .manufacturer = "NEC", + .name = "V20", + .internal_name = "necv20", + .cpus = (const CPU[]) { + {"4.77", CPU_V20, fpus_8088, 4772728, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"7.16", CPU_V20, fpus_8088, 7159092, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"10", CPU_V20, fpus_8088, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"12", CPU_V20, fpus_8088, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"16", CPU_V20, fpus_8088, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, + {"", 0} + } }, { - .package = CPU_PKG_186, - .manufacturer = "Intel", - .name = "80186", - .internal_name = "80186", - .cpus = (const CPU[]) { - {"6", CPU_186, fpus_80186, 6000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1}, - {"7.16", CPU_186, fpus_80186, 7159092, 1, 0, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, - {"8", CPU_186, fpus_80186, 8000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1}, - {"9.54", CPU_186, fpus_80186, 9545456, 1, 0, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, - {"10", CPU_186, fpus_80186, 10000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1}, - {"12", CPU_186, fpus_80186, 12000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1}, - {"16", CPU_186, fpus_80186, 16000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 2}, - {"20", CPU_186, fpus_80186, 20000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 3}, - {"25", CPU_186, fpus_80186, 25000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 3}, - {"", 0} - } + .package = CPU_PKG_186, + .manufacturer = "Intel", + .name = "80186", + .internal_name = "80186", + .cpus = (const CPU[]) { + {"6", CPU_186, fpus_80186, 6000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1}, + {"7.16", CPU_186, fpus_80186, 7159092, 1, 0, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, + {"8", CPU_186, fpus_80186, 8000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1}, + {"9.54", CPU_186, fpus_80186, 9545456, 1, 0, 0, 0, 0, CPU_ALTERNATE_XTAL, 0,0,0,0, 1}, + {"10", CPU_186, fpus_80186, 10000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1}, + {"12", CPU_186, fpus_80186, 12000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1}, + {"16", CPU_186, fpus_80186, 16000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 2}, + {"20", CPU_186, fpus_80186, 20000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 3}, + {"25", CPU_186, fpus_80186, 25000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 3}, + {"", 0} + } }, { - .package = CPU_PKG_8086, - .manufacturer = "NEC", - .name = "V30", - .internal_name = "necv30", - .cpus = (const CPU[]) { - {"5", CPU_V30, fpus_80186, 5000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"8", CPU_V30, fpus_80186, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"10", CPU_V30, fpus_80186, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"12", CPU_V30, fpus_80186, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"16", CPU_V30, fpus_80186, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, - {"", 0} - } + .package = CPU_PKG_8086, + .manufacturer = "NEC", + .name = "V30", + .internal_name = "necv30", + .cpus = (const CPU[]) { + {"5", CPU_V30, fpus_80186, 5000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"8", CPU_V30, fpus_80186, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"10", CPU_V30, fpus_80186, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"12", CPU_V30, fpus_80186, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"16", CPU_V30, fpus_80186, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, + {"", 0} + } }, { - .package = CPU_PKG_286, - .manufacturer = "Intel", - .name = "80286", - .internal_name = "286", - .cpus = (const CPU[]) { - {"6", CPU_286, fpus_80286, 6000000, 1, 5000, 0, 0, 0, 0, 2,2,2,2, 1}, - {"8", CPU_286, fpus_80286, 8000000, 1, 5000, 0, 0, 0, 0, 2,2,2,2, 1}, - {"10", CPU_286, fpus_80286, 10000000, 1, 5000, 0, 0, 0, 0, 2,2,2,2, 1}, - {"12", CPU_286, fpus_80286, 12500000, 1, 5000, 0, 0, 0, 0, 3,3,3,3, 2}, - {"16", CPU_286, fpus_80286, 16000000, 1, 5000, 0, 0, 0, 0, 3,3,3,3, 2}, - {"20", CPU_286, fpus_80286, 20000000, 1, 5000, 0, 0, 0, 0, 4,4,4,4, 3}, - {"25", CPU_286, fpus_80286, 25000000, 1, 5000, 0, 0, 0, 0, 4,4,4,4, 3}, - {"", 0} - } + .package = CPU_PKG_286, + .manufacturer = "Intel", + .name = "80286", + .internal_name = "286", + .cpus = (const CPU[]) { + {"6", CPU_286, fpus_80286, 6000000, 1, 5000, 0, 0, 0, 0, 2,2,2,2, 1}, + {"8", CPU_286, fpus_80286, 8000000, 1, 5000, 0, 0, 0, 0, 2,2,2,2, 1}, + {"10", CPU_286, fpus_80286, 10000000, 1, 5000, 0, 0, 0, 0, 2,2,2,2, 1}, + {"12", CPU_286, fpus_80286, 12500000, 1, 5000, 0, 0, 0, 0, 3,3,3,3, 2}, + {"16", CPU_286, fpus_80286, 16000000, 1, 5000, 0, 0, 0, 0, 3,3,3,3, 2}, + {"20", CPU_286, fpus_80286, 20000000, 1, 5000, 0, 0, 0, 0, 4,4,4,4, 3}, + {"25", CPU_286, fpus_80286, 25000000, 1, 5000, 0, 0, 0, 0, 4,4,4,4, 3}, + {"", 0} + } }, { - .package = CPU_PKG_386SX, - .manufacturer = "Intel", - .name = "i386SX", - .internal_name = "i386sx", - .cpus = (const CPU[]) { - {"16", CPU_386SX, fpus_80386, 16000000, 1, 5000, 0x2308, 0, 0, 0, 3,3,3,3, 2}, - {"20", CPU_386SX, fpus_80386, 20000000, 1, 5000, 0x2308, 0, 0, 0, 4,4,3,3, 3}, - {"25", CPU_386SX, fpus_80386, 25000000, 1, 5000, 0x2308, 0, 0, 0, 4,4,3,3, 3}, - {"33", CPU_386SX, fpus_80386, 33333333, 1, 5000, 0x2308, 0, 0, 0, 6,6,3,3, 4}, - {"40", CPU_386SX, fpus_80386, 40000000, 1, 5000, 0x2308, 0, 0, 0, 7,7,3,3, 5}, - {"", 0} - } + .package = CPU_PKG_386SX, + .manufacturer = "Intel", + .name = "i386SX", + .internal_name = "i386sx", + .cpus = (const CPU[]) { + {"16", CPU_386SX, fpus_80386, 16000000, 1, 5000, 0x2308, 0, 0, 0, 3,3,3,3, 2}, + {"20", CPU_386SX, fpus_80386, 20000000, 1, 5000, 0x2308, 0, 0, 0, 4,4,3,3, 3}, + {"25", CPU_386SX, fpus_80386, 25000000, 1, 5000, 0x2308, 0, 0, 0, 4,4,3,3, 3}, + {"33", CPU_386SX, fpus_80386, 33333333, 1, 5000, 0x2308, 0, 0, 0, 6,6,3,3, 4}, + {"40", CPU_386SX, fpus_80386, 40000000, 1, 5000, 0x2308, 0, 0, 0, 7,7,3,3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_386SX, - .manufacturer = "AMD", - .name = "Am386SX", - .internal_name = "am386sx", - .cpus = (const CPU[]) { - {"16", CPU_386SX, fpus_80386, 16000000, 1, 5000, 0x2308, 0, 0, 0, 3,3,3,3, 2}, - {"20", CPU_386SX, fpus_80386, 20000000, 1, 5000, 0x2308, 0, 0, 0, 4,4,3,3, 3}, - {"25", CPU_386SX, fpus_80386, 25000000, 1, 5000, 0x2308, 0, 0, 0, 4,4,3,3, 3}, - {"33", CPU_386SX, fpus_80386, 33333333, 1, 5000, 0x2308, 0, 0, 0, 6,6,3,3, 4}, - {"40", CPU_386SX, fpus_80386, 40000000, 1, 5000, 0x2308, 0, 0, 0, 7,7,3,3, 5}, - {"", 0} - } + .package = CPU_PKG_386SX, + .manufacturer = "AMD", + .name = "Am386SX", + .internal_name = "am386sx", + .cpus = (const CPU[]) { + {"16", CPU_386SX, fpus_80386, 16000000, 1, 5000, 0x2308, 0, 0, 0, 3,3,3,3, 2}, + {"20", CPU_386SX, fpus_80386, 20000000, 1, 5000, 0x2308, 0, 0, 0, 4,4,3,3, 3}, + {"25", CPU_386SX, fpus_80386, 25000000, 1, 5000, 0x2308, 0, 0, 0, 4,4,3,3, 3}, + {"33", CPU_386SX, fpus_80386, 33333333, 1, 5000, 0x2308, 0, 0, 0, 6,6,3,3, 4}, + {"40", CPU_386SX, fpus_80386, 40000000, 1, 5000, 0x2308, 0, 0, 0, 7,7,3,3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_386DX, - .manufacturer = "Intel", - .name = "i386DX", - .internal_name = "i386dx", - .cpus = (const CPU[]) { - {"16", CPU_386DX, fpus_80386, 16000000, 1, 5000, 0x0308, 0, 0, 0, 3,3,3,3, 2}, - {"20", CPU_386DX, fpus_80386, 20000000, 1, 5000, 0x0308, 0, 0, 0, 4,4,3,3, 3}, - {"25", CPU_386DX, fpus_80386, 25000000, 1, 5000, 0x0308, 0, 0, 0, 4,4,3,3, 3}, - {"33", CPU_386DX, fpus_80386, 33333333, 1, 5000, 0x0308, 0, 0, 0, 6,6,3,3, 4}, - {"40", CPU_386DX, fpus_80386, 40000000, 1, 5000, 0x0308, 0, 0, 0, 7,7,3,3, 5}, - {"", 0} - } + .package = CPU_PKG_386DX, + .manufacturer = "Intel", + .name = "i386DX", + .internal_name = "i386dx", + .cpus = (const CPU[]) { + {"16", CPU_386DX, fpus_80386, 16000000, 1, 5000, 0x0308, 0, 0, 0, 3,3,3,3, 2}, + {"20", CPU_386DX, fpus_80386, 20000000, 1, 5000, 0x0308, 0, 0, 0, 4,4,3,3, 3}, + {"25", CPU_386DX, fpus_80386, 25000000, 1, 5000, 0x0308, 0, 0, 0, 4,4,3,3, 3}, + {"33", CPU_386DX, fpus_80386, 33333333, 1, 5000, 0x0308, 0, 0, 0, 6,6,3,3, 4}, + {"40", CPU_386DX, fpus_80386, 40000000, 1, 5000, 0x0308, 0, 0, 0, 7,7,3,3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_386DX, - .manufacturer = "Intel", - .name = "RapidCAD", - .internal_name = "rapidcad", - .cpus = (const CPU[]) { - {"25", CPU_RAPIDCAD, fpus_internal, 25000000, 1, 5000, 0x0340, 0, 0, CPU_SUPPORTS_DYNAREC, 4,4,3,3, 3}, - {"33", CPU_RAPIDCAD, fpus_internal, 33333333, 1, 5000, 0x0340, 0, 0, CPU_SUPPORTS_DYNAREC, 6,6,3,3, 4}, - {"40", CPU_RAPIDCAD, fpus_internal, 40000000, 1, 5000, 0x0340, 0, 0, CPU_SUPPORTS_DYNAREC, 7,7,3,3, 5}, - {"", 0} - } + .package = CPU_PKG_386DX, + .manufacturer = "Intel", + .name = "RapidCAD", + .internal_name = "rapidcad", + .cpus = (const CPU[]) { + {"25", CPU_RAPIDCAD, fpus_internal, 25000000, 1, 5000, 0x0340, 0, 0, CPU_SUPPORTS_DYNAREC, 4,4,3,3, 3}, + {"33", CPU_RAPIDCAD, fpus_internal, 33333333, 1, 5000, 0x0340, 0, 0, CPU_SUPPORTS_DYNAREC, 6,6,3,3, 4}, + {"40", CPU_RAPIDCAD, fpus_internal, 40000000, 1, 5000, 0x0340, 0, 0, CPU_SUPPORTS_DYNAREC, 7,7,3,3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_386DX, - .manufacturer = "AMD", - .name = "Am386DX", - .internal_name = "am386dx", - .cpus = (const CPU[]) { - {"25", CPU_386DX, fpus_80386, 25000000, 1, 5000, 0x0308, 0, 0, 0, 4,4,3,3, 3}, - {"33", CPU_386DX, fpus_80386, 33333333, 1, 5000, 0x0308, 0, 0, 0, 6,6,3,3, 4}, - {"40", CPU_386DX, fpus_80386, 40000000, 1, 5000, 0x0308, 0, 0, 0, 7,7,3,3, 5}, - {"", 0} - } - }, - { - .package = CPU_PKG_M6117, - .manufacturer = "ALi", - .name = "M6117", - .internal_name = "m6117", - .cpus = (const CPU[]) { /* All timings and edx_reset values assumed. */ - {"33", CPU_386SX, fpus_none, 33333333, 1, 5000, 0x2308, 0, 0, 0, 6,6,3,3, 4}, - {"40", CPU_386SX, fpus_none, 40000000, 1, 5000, 0x2308, 0, 0, 0, 7,7,3,3, 5}, - {"", 0} - } - }, - { - .package = CPU_PKG_386SLC_IBM, - .manufacturer = "IBM", - .name = "386SLC", - .internal_name = "ibm386slc", - .cpus = (const CPU[]) { - {"16", CPU_IBM386SLC, fpus_80386, 16000000, 1, 5000, 0xA301, 0, 0, 0, 3,3,3,3, 2}, - {"20", CPU_IBM386SLC, fpus_80386, 20000000, 1, 5000, 0xA301, 0, 0, 0, 4,4,3,3, 3}, - {"25", CPU_IBM386SLC, fpus_80386, 25000000, 1, 5000, 0xA301, 0, 0, 0, 4,4,3,3, 3}, - {"", 0} - } + .package = CPU_PKG_386DX, + .manufacturer = "AMD", + .name = "Am386DX", + .internal_name = "am386dx", + .cpus = (const CPU[]) { + {"25", CPU_386DX, fpus_80386, 25000000, 1, 5000, 0x0308, 0, 0, 0, 4,4,3,3, 3}, + {"33", CPU_386DX, fpus_80386, 33333333, 1, 5000, 0x0308, 0, 0, 0, 6,6,3,3, 4}, + {"40", CPU_386DX, fpus_80386, 40000000, 1, 5000, 0x0308, 0, 0, 0, 7,7,3,3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_386SX, - .manufacturer = "Cyrix", - .name = "Cx486SLC", - .internal_name = "cx486slc", - .cpus = (const CPU[]) { - {"20", CPU_486SLC, fpus_80386, 20000000, 1, 5000, 0x400, 0, 0x0000, 0, 4,4,3,3, 3}, - {"25", CPU_486SLC, fpus_80386, 25000000, 1, 5000, 0x400, 0, 0x0000, 0, 4,4,3,3, 3}, - {"33", CPU_486SLC, fpus_80386, 33333333, 1, 5000, 0x400, 0, 0x0000, 0, 6,6,3,3, 4}, - {"", 0} - } + .package = CPU_PKG_M6117, + .manufacturer = "ALi", + .name = "M6117", + .internal_name = "m6117", + .cpus = (const CPU[]) { /* All timings and edx_reset values assumed. */ + {"33", CPU_386SX, fpus_none, 33333333, 1, 5000, 0x2308, 0, 0, 0, 6,6,3,3, 4}, + {"40", CPU_386SX, fpus_none, 40000000, 1, 5000, 0x2308, 0, 0, 0, 7,7,3,3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_386SX, - .manufacturer = "Cyrix", - .name = "Cx486SRx2", - .internal_name = "cx486srx2", - .cpus = (const CPU[]) { - {"32", CPU_486SLC, fpus_80386, 32000000, 2, 5000, 0x406, 0, 0x0006, 0, 6,6,6,6, 4}, - {"40", CPU_486SLC, fpus_80386, 40000000, 2, 5000, 0x406, 0, 0x0006, 0, 8,8,6,6, 6}, - {"50", CPU_486SLC, fpus_80386, 50000000, 2, 5000, 0x406, 0, 0x0006, 0, 8,8,6,6, 6}, - {"", 0} - } + .package = CPU_PKG_386SLC_IBM, + .manufacturer = "IBM", + .name = "386SLC", + .internal_name = "ibm386slc", + .cpus = (const CPU[]) { + {"16", CPU_IBM386SLC, fpus_80386, 16000000, 1, 5000, 0xA301, 0, 0, 0, 3,3,3,3, 2}, + {"20", CPU_IBM386SLC, fpus_80386, 20000000, 1, 5000, 0xA301, 0, 0, 0, 4,4,3,3, 3}, + {"25", CPU_IBM386SLC, fpus_80386, 25000000, 1, 5000, 0xA301, 0, 0, 0, 4,4,3,3, 3}, + {"", 0} + } }, { - .package = CPU_PKG_486SLC_IBM, - .manufacturer = "IBM", - .name = "486SLC", - .internal_name = "ibm486slc", - .cpus = (const CPU[]) { - {"33", CPU_IBM486SLC, fpus_80386, 33333333, 1, 5000, 0xA401, 0, 0, 0, 6,6,3,3, 4}, - {"", 0} - } + .package = CPU_PKG_386SX, + .manufacturer = "Cyrix", + .name = "Cx486SLC", + .internal_name = "cx486slc", + .cpus = (const CPU[]) { + {"20", CPU_486SLC, fpus_80386, 20000000, 1, 5000, 0x400, 0, 0x0000, 0, 4,4,3,3, 3}, + {"25", CPU_486SLC, fpus_80386, 25000000, 1, 5000, 0x400, 0, 0x0000, 0, 4,4,3,3, 3}, + {"33", CPU_486SLC, fpus_80386, 33333333, 1, 5000, 0x400, 0, 0x0000, 0, 6,6,3,3, 4}, + {"", 0} + } }, { - .package = CPU_PKG_486SLC_IBM, - .manufacturer = "IBM", - .name = "486SLC2", - .internal_name = "ibm486slc2", - .cpus = (const CPU[]) { - {"40", CPU_IBM486SLC, fpus_80386, 40000000, 2, 5000, 0xA421, 0, 0, 0, 7,7,6,6, 5}, - {"50", CPU_IBM486SLC, fpus_80386, 50000000, 2, 5000, 0xA421, 0, 0, 0, 8,8,6,6, 6}, - {"66", CPU_IBM486SLC, fpus_80386, 66666666, 2, 5000, 0xA421, 0, 0, 0, 12,12,6,6, 8}, - {"", 0} - } + .package = CPU_PKG_386SX, + .manufacturer = "Cyrix", + .name = "Cx486SRx2", + .internal_name = "cx486srx2", + .cpus = (const CPU[]) { + {"32", CPU_486SLC, fpus_80386, 32000000, 2, 5000, 0x406, 0, 0x0006, 0, 6,6,6,6, 4}, + {"40", CPU_486SLC, fpus_80386, 40000000, 2, 5000, 0x406, 0, 0x0006, 0, 8,8,6,6, 6}, + {"50", CPU_486SLC, fpus_80386, 50000000, 2, 5000, 0x406, 0, 0x0006, 0, 8,8,6,6, 6}, + {"", 0} + } }, { - .package = CPU_PKG_486SLC_IBM, - .manufacturer = "IBM", - .name = "486SLC3", - .internal_name = "ibm486slc3", - .cpus = (const CPU[]) { - {"60", CPU_IBM486SLC, fpus_80386, 60000000, 3, 5000, 0xA439, 0, 0, 0, 12,12,9,9, 7}, - {"75", CPU_IBM486SLC, fpus_80386, 75000000, 3, 5000, 0xA439, 0, 0, 0, 12,12,9,9, 9}, - {"100", CPU_IBM486SLC, fpus_80386, 100000000, 3, 5000, 0xA439, 0, 0, 0, 18,18,9,9, 12}, - {"", 0} - } + .package = CPU_PKG_486SLC_IBM, + .manufacturer = "IBM", + .name = "486SLC", + .internal_name = "ibm486slc", + .cpus = (const CPU[]) { + {"33", CPU_IBM486SLC, fpus_80386, 33333333, 1, 5000, 0xA401, 0, 0, 0, 6,6,3,3, 4}, + {"", 0} + } }, { - .package = CPU_PKG_486BL, - .manufacturer = "IBM", - .name = "486BL2", - .internal_name = "ibm486bl2", - .cpus = (const CPU[]) { - {"50", CPU_IBM486BL, fpus_80386, 50000000, 2, 5000, 0xA439, 0, 0, 0, 8,8,6,6, 6}, - {"66", CPU_IBM486BL, fpus_80386, 66666666, 2, 5000, 0xA439, 0, 0, 0, 12,12,6,6, 8}, - {"", 0} - } + .package = CPU_PKG_486SLC_IBM, + .manufacturer = "IBM", + .name = "486SLC2", + .internal_name = "ibm486slc2", + .cpus = (const CPU[]) { + {"40", CPU_IBM486SLC, fpus_80386, 40000000, 2, 5000, 0xA421, 0, 0, 0, 7,7,6,6, 5}, + {"50", CPU_IBM486SLC, fpus_80386, 50000000, 2, 5000, 0xA421, 0, 0, 0, 8,8,6,6, 6}, + {"66", CPU_IBM486SLC, fpus_80386, 66666666, 2, 5000, 0xA421, 0, 0, 0, 12,12,6,6, 8}, + {"", 0} + } }, { - .package = CPU_PKG_486BL, - .manufacturer = "IBM", - .name = "486BL3", - .internal_name = "ibm486bl3", - .cpus = (const CPU[]) { - {"75", CPU_IBM486BL, fpus_80386, 75000000, 3, 5000, 0xA439, 0, 0, 0, 12,12,9,9, 9}, - {"100", CPU_IBM486BL, fpus_80386, 100000000, 3, 5000, 0xA439, 0, 0, 0, 18,18,9,9, 12}, - {"", 0} - } + .package = CPU_PKG_486SLC_IBM, + .manufacturer = "IBM", + .name = "486SLC3", + .internal_name = "ibm486slc3", + .cpus = (const CPU[]) { + {"60", CPU_IBM486SLC, fpus_80386, 60000000, 3, 5000, 0xA439, 0, 0, 0, 12,12,9,9, 7}, + {"75", CPU_IBM486SLC, fpus_80386, 75000000, 3, 5000, 0xA439, 0, 0, 0, 12,12,9,9, 9}, + {"100", CPU_IBM486SLC, fpus_80386, 100000000, 3, 5000, 0xA439, 0, 0, 0, 18,18,9,9, 12}, + {"", 0} + } }, { - .package = CPU_PKG_386DX, - .manufacturer = "Cyrix", - .name = "Cx486DLC", - .internal_name = "cx486dlc", - .cpus = (const CPU[]) { - {"25", CPU_486DLC, fpus_80386, 25000000, 1, 5000, 0x401, 0, 0x0001, 0, 4, 4,3,3, 3}, - {"33", CPU_486DLC, fpus_80386, 33333333, 1, 5000, 0x401, 0, 0x0001, 0, 6, 6,3,3, 4}, - {"40", CPU_486DLC, fpus_80386, 40000000, 1, 5000, 0x401, 0, 0x0001, 0, 7, 7,3,3, 5}, - {"", 0} - } + .package = CPU_PKG_486BL, + .manufacturer = "IBM", + .name = "486BL2", + .internal_name = "ibm486bl2", + .cpus = (const CPU[]) { + {"50", CPU_IBM486BL, fpus_80386, 50000000, 2, 5000, 0xA439, 0, 0, 0, 8,8,6,6, 6}, + {"66", CPU_IBM486BL, fpus_80386, 66666666, 2, 5000, 0xA439, 0, 0, 0, 12,12,6,6, 8}, + {"", 0} + } }, { - .package = CPU_PKG_386DX, - .manufacturer = "Cyrix", - .name = "Cx486DRx2", - .internal_name = "cx486drx2", - .cpus = (const CPU[]) { - {"32", CPU_486DLC, fpus_80386, 32000000, 2, 5000, 0x407, 0, 0x0007, 0, 6, 6,6,6, 4}, - {"40", CPU_486DLC, fpus_80386, 40000000, 2, 5000, 0x407, 0, 0x0007, 0, 8, 8,6,6, 6}, - {"50", CPU_486DLC, fpus_80386, 50000000, 2, 5000, 0x407, 0, 0x0007, 0, 8, 8,6,6, 6}, - {"66", CPU_486DLC, fpus_80386, 66666666, 2, 5000, 0x407, 0, 0x0007, 0, 12,12,6,6, 8}, - {"", 0} - } + .package = CPU_PKG_486BL, + .manufacturer = "IBM", + .name = "486BL3", + .internal_name = "ibm486bl3", + .cpus = (const CPU[]) { + {"75", CPU_IBM486BL, fpus_80386, 75000000, 3, 5000, 0xA439, 0, 0, 0, 12,12,9,9, 9}, + {"100", CPU_IBM486BL, fpus_80386, 100000000, 3, 5000, 0xA439, 0, 0, 0, 18,18,9,9, 12}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Intel", - .name = "i486SX", - .internal_name = "i486sx", - .cpus = (const CPU[]) { - {"16", CPU_i486SX, fpus_486sx, 16000000, 1, 5000, 0x420, 0, 0, CPU_SUPPORTS_DYNAREC, 3, 3,3,3, 2}, - {"20", CPU_i486SX, fpus_486sx, 20000000, 1, 5000, 0x420, 0, 0, CPU_SUPPORTS_DYNAREC, 4, 4,3,3, 3}, - {"25", CPU_i486SX, fpus_486sx, 25000000, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 4, 4,3,3, 3}, - {"33", CPU_i486SX, fpus_486sx, 33333333, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6,3,3, 4}, - {"", 0} - } + .package = CPU_PKG_386DX, + .manufacturer = "Cyrix", + .name = "Cx486DLC", + .internal_name = "cx486dlc", + .cpus = (const CPU[]) { + {"25", CPU_486DLC, fpus_80386, 25000000, 1, 5000, 0x401, 0, 0x0001, 0, 4, 4,3,3, 3}, + {"33", CPU_486DLC, fpus_80386, 33333333, 1, 5000, 0x401, 0, 0x0001, 0, 6, 6,3,3, 4}, + {"40", CPU_486DLC, fpus_80386, 40000000, 1, 5000, 0x401, 0, 0x0001, 0, 7, 7,3,3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Intel", - .name = "i486SX (SL-Enhanced)", - .internal_name = "i486sx_slenh", - .cpus = (const CPU[]) { - {"25", CPU_i486SX_SLENH, fpus_486sx, 25000000, 1, 5000, 0x423, 0x423, 0, CPU_SUPPORTS_DYNAREC, 4, 4,3,3, 3}, - {"33", CPU_i486SX_SLENH, fpus_486sx, 33333333, 1, 5000, 0x42a, 0x42a, 0, CPU_SUPPORTS_DYNAREC, 6, 6,3,3, 4}, - {"", 0} - } + .package = CPU_PKG_386DX, + .manufacturer = "Cyrix", + .name = "Cx486DRx2", + .internal_name = "cx486drx2", + .cpus = (const CPU[]) { + {"32", CPU_486DLC, fpus_80386, 32000000, 2, 5000, 0x407, 0, 0x0007, 0, 6, 6,6,6, 4}, + {"40", CPU_486DLC, fpus_80386, 40000000, 2, 5000, 0x407, 0, 0x0007, 0, 8, 8,6,6, 6}, + {"50", CPU_486DLC, fpus_80386, 50000000, 2, 5000, 0x407, 0, 0x0007, 0, 8, 8,6,6, 6}, + {"66", CPU_486DLC, fpus_80386, 66666666, 2, 5000, 0x407, 0, 0x0007, 0, 12,12,6,6, 8}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Intel", - .name = "i486SX2", - .internal_name = "i486sx2", - .cpus = (const CPU[]) { - {"50", CPU_i486SX_SLENH, fpus_486sx, 50000000, 2, 5000, 0x45b, 0x45b, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, - {"66 (Q0569)", CPU_i486SX_SLENH, fpus_486sx, 66666666, 2, 5000, 0x45b, 0x45b, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 8}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Intel", + .name = "i486SX", + .internal_name = "i486sx", + .cpus = (const CPU[]) { + {"16", CPU_i486SX, fpus_486sx, 16000000, 1, 5000, 0x420, 0, 0, CPU_SUPPORTS_DYNAREC, 3, 3,3,3, 2}, + {"20", CPU_i486SX, fpus_486sx, 20000000, 1, 5000, 0x420, 0, 0, CPU_SUPPORTS_DYNAREC, 4, 4,3,3, 3}, + {"25", CPU_i486SX, fpus_486sx, 25000000, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 4, 4,3,3, 3}, + {"33", CPU_i486SX, fpus_486sx, 33333333, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6,3,3, 4}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Intel", - .name = "i486DX", - .internal_name = "i486dx", - .cpus = (const CPU[]) { - {"25", CPU_i486DX, fpus_internal, 25000000, 1, 5000, 0x404, 0, 0, CPU_SUPPORTS_DYNAREC, 4, 4,3,3, 3}, - {"33", CPU_i486DX, fpus_internal, 33333333, 1, 5000, 0x404, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6,3,3, 4}, - {"50", CPU_i486DX, fpus_internal, 50000000, 1, 5000, 0x411, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8,4,4, 6}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Intel", + .name = "i486SX (SL-Enhanced)", + .internal_name = "i486sx_slenh", + .cpus = (const CPU[]) { + {"25", CPU_i486SX_SLENH, fpus_486sx, 25000000, 1, 5000, 0x423, 0x423, 0, CPU_SUPPORTS_DYNAREC, 4, 4,3,3, 3}, + {"33", CPU_i486SX_SLENH, fpus_486sx, 33333333, 1, 5000, 0x42a, 0x42a, 0, CPU_SUPPORTS_DYNAREC, 6, 6,3,3, 4}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Intel", - .name = "i486DX (SL-Enhanced)", - .internal_name = "i486dx_slenh", - .cpus = (const CPU[]) { - {"33", CPU_i486DX_SLENH, fpus_internal, 33333333, 1, 5000, 0x414, 0x414, 0, CPU_SUPPORTS_DYNAREC, 6, 6,3,3, 4}, - {"50", CPU_i486DX_SLENH, fpus_internal, 50000000, 1, 5000, 0x414, 0x414, 0, CPU_SUPPORTS_DYNAREC, 8, 8,4,4, 6}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Intel", + .name = "i486SX2", + .internal_name = "i486sx2", + .cpus = (const CPU[]) { + {"50", CPU_i486SX_SLENH, fpus_486sx, 50000000, 2, 5000, 0x45b, 0x45b, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, + {"66 (Q0569)", CPU_i486SX_SLENH, fpus_486sx, 66666666, 2, 5000, 0x45b, 0x45b, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 8}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Intel", - .name = "i486DX2", - .internal_name = "i486dx2", - .cpus = (const CPU[]) { - {"40", CPU_i486DX, fpus_internal, 40000000, 2, 5000, 0x430, 0, 0, CPU_SUPPORTS_DYNAREC, 7, 7,6,6, 5}, - {"50", CPU_i486DX, fpus_internal, 50000000, 2, 5000, 0x433, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, - {"66", CPU_i486DX, fpus_internal, 66666666, 2, 5000, 0x433, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12,6,6, 8}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Intel", + .name = "i486DX", + .internal_name = "i486dx", + .cpus = (const CPU[]) { + {"25", CPU_i486DX, fpus_internal, 25000000, 1, 5000, 0x404, 0, 0, CPU_SUPPORTS_DYNAREC, 4, 4,3,3, 3}, + {"33", CPU_i486DX, fpus_internal, 33333333, 1, 5000, 0x404, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6,3,3, 4}, + {"50", CPU_i486DX, fpus_internal, 50000000, 1, 5000, 0x411, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8,4,4, 6}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Intel", - .name = "i486DX2 (SL-Enhanced)", - .internal_name = "i486dx2_slenh", - .cpus = (const CPU[]) { - {"40", CPU_i486DX_SLENH, fpus_internal, 40000000, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 7, 7,6,6, 5}, - {"50", CPU_i486DX_SLENH, fpus_internal, 50000000, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, - {"66", CPU_i486DX_SLENH, fpus_internal, 66666666, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 12,12,6,6, 8}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Intel", + .name = "i486DX (SL-Enhanced)", + .internal_name = "i486dx_slenh", + .cpus = (const CPU[]) { + {"33", CPU_i486DX_SLENH, fpus_internal, 33333333, 1, 5000, 0x414, 0x414, 0, CPU_SUPPORTS_DYNAREC, 6, 6,3,3, 4}, + {"50", CPU_i486DX_SLENH, fpus_internal, 50000000, 1, 5000, 0x414, 0x414, 0, CPU_SUPPORTS_DYNAREC, 8, 8,4,4, 6}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET3_PC330, - .manufacturer = "Intel", - .name = "i486DX2", - .internal_name = "i486dx2_pc330", - .cpus = (const CPU[]) { - {"50", CPU_i486DX_SLENH, fpus_internal, 50000000, 2, 5000, 0x470, 0x470, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, - {"66", CPU_i486DX_SLENH, fpus_internal, 66666666, 2, 5000, 0x470, 0x470, 0, CPU_SUPPORTS_DYNAREC, 12,12,6,6, 8}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Intel", + .name = "i486DX2", + .internal_name = "i486dx2", + .cpus = (const CPU[]) { + {"40", CPU_i486DX, fpus_internal, 40000000, 2, 5000, 0x430, 0, 0, CPU_SUPPORTS_DYNAREC, 7, 7,6,6, 5}, + {"50", CPU_i486DX, fpus_internal, 50000000, 2, 5000, 0x433, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, + {"66", CPU_i486DX, fpus_internal, 66666666, 2, 5000, 0x433, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12,6,6, 8}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1 | CPU_PKG_SOCKET3_PC330, /*OEM versions are 3.3V, Retail versions are 3.3V with a 5V regulator for installation in older boards. They are functionally identical*/ - .manufacturer = "Intel", - .name = "iDX4", - .internal_name = "idx4", - .cpus = (const CPU[]) { - {"75", CPU_i486DX_SLENH, fpus_internal, 75000000, 3.0, 5000, 0x480, 0x480, 0x0000, CPU_SUPPORTS_DYNAREC, 12,12, 9, 9, 9}, - {"100", CPU_i486DX_SLENH, fpus_internal, 100000000, 3.0, 5000, 0x483, 0x483, 0x0000, CPU_SUPPORTS_DYNAREC, 18,18, 9, 9, 12}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Intel", + .name = "i486DX2 (SL-Enhanced)", + .internal_name = "i486dx2_slenh", + .cpus = (const CPU[]) { + {"40", CPU_i486DX_SLENH, fpus_internal, 40000000, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 7, 7,6,6, 5}, + {"50", CPU_i486DX_SLENH, fpus_internal, 50000000, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, + {"66", CPU_i486DX_SLENH, fpus_internal, 66666666, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 12,12,6,6, 8}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET3 | CPU_PKG_SOCKET3_PC330, - .manufacturer = "Intel", - .name = "Pentium OverDrive", - .internal_name = "pentium_p24t", - .cpus = (const CPU[]) { - {"63", CPU_P24T, fpus_internal, 62500000, 2.5, 5000, 0x1531, 0x1531, 0x0000, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10,7,7, 15/2}, - {"83", CPU_P24T, fpus_internal, 83333333, 2.5, 5000, 0x1532, 0x1532, 0x0000, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15,8,8, 10}, - {"", 0} - } + .package = CPU_PKG_SOCKET3_PC330, + .manufacturer = "Intel", + .name = "i486DX2", + .internal_name = "i486dx2_pc330", + .cpus = (const CPU[]) { + {"50", CPU_i486DX_SLENH, fpus_internal, 50000000, 2, 5000, 0x470, 0x470, 0, CPU_SUPPORTS_DYNAREC, 8, 8,6,6, 6}, + {"66", CPU_i486DX_SLENH, fpus_internal, 66666666, 2, 5000, 0x470, 0x470, 0, CPU_SUPPORTS_DYNAREC, 12,12,6,6, 8}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "AMD", - .name = "Am486SX", - .internal_name = "am486sx", - .cpus = (const CPU[]) { - {"33", CPU_Am486SX, fpus_486sx, 33333333, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, - {"40", CPU_Am486SX, fpus_486sx, 40000000, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, - {"", 0} - } + .package = CPU_PKG_SOCKET1 | CPU_PKG_SOCKET3_PC330, /*OEM versions are 3.3V, Retail versions are 3.3V with a 5V regulator for installation in older boards. They are functionally identical*/ + .manufacturer = "Intel", + .name = "iDX4", + .internal_name = "idx4", + .cpus = (const CPU[]) { + {"75", CPU_i486DX_SLENH, fpus_internal, 75000000, 3.0, 5000, 0x480, 0x480, 0x0000, CPU_SUPPORTS_DYNAREC, 12,12, 9, 9, 9}, + {"100", CPU_i486DX_SLENH, fpus_internal, 100000000, 3.0, 5000, 0x483, 0x483, 0x0000, CPU_SUPPORTS_DYNAREC, 18,18, 9, 9, 12}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "AMD", - .name = "Am486SX2", - .internal_name = "am486sx2", - .cpus = (const CPU[]) { - {"50", CPU_Am486SX, fpus_486sx, 50000000, 2, 5000, 0x45b, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8, 6, 6, 6}, - {"66", CPU_Am486SX, fpus_486sx, 66666666, 2, 5000, 0x45b, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, - {"", 0} - } + .package = CPU_PKG_SOCKET3 | CPU_PKG_SOCKET3_PC330, + .manufacturer = "Intel", + .name = "Pentium OverDrive", + .internal_name = "pentium_p24t", + .cpus = (const CPU[]) { + {"63", CPU_P24T, fpus_internal, 62500000, 2.5, 5000, 0x1531, 0x1531, 0x0000, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10,7,7, 15/2}, + {"83", CPU_P24T, fpus_internal, 83333333, 2.5, 5000, 0x1532, 0x1532, 0x0000, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15,8,8, 10}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "AMD", - .name = "Am486DX", - .internal_name = "am486dx", - .cpus = (const CPU[]) { - {"33", CPU_Am486DX, fpus_internal, 33333333, 1, 5000, 0x412, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, - {"40", CPU_Am486DX, fpus_internal, 40000000, 1, 5000, 0x412, 0, 0, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "AMD", + .name = "Am486SX", + .internal_name = "am486sx", + .cpus = (const CPU[]) { + {"33", CPU_Am486SX, fpus_486sx, 33333333, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, + {"40", CPU_Am486SX, fpus_486sx, 40000000, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "AMD", - .name = "Am486DX2", - .internal_name = "am486dx2", - .cpus = (const CPU[]) { - {"50", CPU_Am486DX, fpus_internal, 50000000, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8, 6, 6, 6}, - {"66", CPU_Am486DX, fpus_internal, 66666666, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, - {"80", CPU_Am486DX, fpus_internal, 80000000, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "AMD", + .name = "Am486SX2", + .internal_name = "am486sx2", + .cpus = (const CPU[]) { + {"50", CPU_Am486SX, fpus_486sx, 50000000, 2, 5000, 0x45b, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8, 6, 6, 6}, + {"66", CPU_Am486SX, fpus_486sx, 66666666, 2, 5000, 0x45b, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "AMD", - .name = "Am486DXL", - .internal_name = "am486dxl", - .cpus = (const CPU[]) { - {"33", CPU_Am486DXL, fpus_internal, 33333333, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, - {"40", CPU_Am486DXL, fpus_internal, 40000000, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "AMD", + .name = "Am486DX", + .internal_name = "am486dx", + .cpus = (const CPU[]) { + {"33", CPU_Am486DX, fpus_internal, 33333333, 1, 5000, 0x412, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, + {"40", CPU_Am486DX, fpus_internal, 40000000, 1, 5000, 0x412, 0, 0, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "AMD", - .name = "Am486DXL2", - .internal_name = "am486dxl2", - .cpus = (const CPU[]) { - {"50", CPU_Am486DXL, fpus_internal, 50000000, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8, 6, 6, 6}, - {"66", CPU_Am486DXL, fpus_internal, 66666666, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, - {"80", CPU_Am486DXL, fpus_internal, 80000000, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, - {"", 0} - } - }, { - .package = CPU_PKG_SOCKET3, - .manufacturer = "AMD", - .name = "Am486DX4", - .internal_name = "am486dx4", - .cpus = (const CPU[]) { - {"75", CPU_Am486DX, fpus_internal, 75000000, 3.0, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12, 9, 9, 9}, - {"90", CPU_Am486DX, fpus_internal, 90000000, 3.0, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, - {"100", CPU_Am486DX, fpus_internal, 100000000, 3.0, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, - {"120", CPU_Am486DX, fpus_internal, 120000000, 3.0, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 21,21, 9, 9, 15}, - {"", 0} - } - }, - { - .package = CPU_PKG_SOCKET3, - .manufacturer = "AMD", - .name = "Am486DX2 (Enhanced)", - .internal_name = "am486dx2_slenh", - .cpus = (const CPU[]) { - {"66", CPU_ENH_Am486DX, fpus_internal, 66666666, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, - {"80", CPU_ENH_Am486DX, fpus_internal, 80000000, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "AMD", + .name = "Am486DX2", + .internal_name = "am486dx2", + .cpus = (const CPU[]) { + {"50", CPU_Am486DX, fpus_internal, 50000000, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8, 6, 6, 6}, + {"66", CPU_Am486DX, fpus_internal, 66666666, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, + {"80", CPU_Am486DX, fpus_internal, 80000000, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET3, - .manufacturer = "AMD", - .name = "Am486DX4 (Enhanced)", - .internal_name = "am486dx4_slenh", - .cpus = (const CPU[]) { - {"75", CPU_ENH_Am486DX, fpus_internal, 75000000, 3.0, 5000, 0x482, 0x482, 0, CPU_SUPPORTS_DYNAREC, 12,12, 9, 9, 9}, - {"100", CPU_ENH_Am486DX, fpus_internal, 100000000, 3.0, 5000, 0x482, 0x482, 0, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, - {"120", CPU_ENH_Am486DX, fpus_internal, 120000000, 3.0, 5000, 0x482, 0x482, 0, CPU_SUPPORTS_DYNAREC, 21,21, 9, 9, 15}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "AMD", + .name = "Am486DXL", + .internal_name = "am486dxl", + .cpus = (const CPU[]) { + {"33", CPU_Am486DXL, fpus_internal, 33333333, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, + {"40", CPU_Am486DXL, fpus_internal, 40000000, 1, 5000, 0x422, 0, 0, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET3, - .manufacturer = "AMD", - .name = "Am5x86", - .internal_name = "am5x86", - .cpus = (const CPU[]) { - {"P75", CPU_ENH_Am486DX, fpus_internal, 133333333, 4.0, 5000, 0x4e0, 0x4e0, 0, CPU_SUPPORTS_DYNAREC, 24,24,12,12, 16}, - {"P75+", CPU_ENH_Am486DX, fpus_internal, 150000000, 3.0, 5000, 0x482, 0x482, 0, CPU_SUPPORTS_DYNAREC, 28,28,12,12, 20},/*The rare P75+ was indeed a triple-clocked 150 MHz according to research*/ - {"P90", CPU_ENH_Am486DX, fpus_internal, 160000000, 4.0, 5000, 0x4e0, 0x4e0, 0, CPU_SUPPORTS_DYNAREC, 28,28,12,12, 20},/*160 MHz on a 40 MHz bus was a common overclock and "5x86/P90" was used by a number of BIOSes to refer to that configuration*/ - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "AMD", + .name = "Am486DXL2", + .internal_name = "am486dxl2", + .cpus = (const CPU[]) { + {"50", CPU_Am486DXL, fpus_internal, 50000000, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 8, 8, 6, 6, 6}, + {"66", CPU_Am486DXL, fpus_internal, 66666666, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, + {"80", CPU_Am486DXL, fpus_internal, 80000000, 2, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Cyrix", - .name = "Cx486S", - .internal_name = "cx486s", - .cpus = (const CPU[]) { - {"25", CPU_Cx486S, fpus_486sx, 25000000, 1.0, 5000, 0x420, 0, 0x0010, CPU_SUPPORTS_DYNAREC, 4, 4, 3, 3, 3}, - {"33", CPU_Cx486S, fpus_486sx, 33333333, 1.0, 5000, 0x420, 0, 0x0010, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, - {"40", CPU_Cx486S, fpus_486sx, 40000000, 1.0, 5000, 0x420, 0, 0x0010, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, - {"", 0} - } + .package = CPU_PKG_SOCKET3, + .manufacturer = "AMD", + .name = "Am486DX4", + .internal_name = "am486dx4", + .cpus = (const CPU[]) { + {"75", CPU_Am486DX, fpus_internal, 75000000, 3.0, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 12,12, 9, 9, 9}, + {"90", CPU_Am486DX, fpus_internal, 90000000, 3.0, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, + {"100", CPU_Am486DX, fpus_internal, 100000000, 3.0, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, + {"120", CPU_Am486DX, fpus_internal, 120000000, 3.0, 5000, 0x432, 0, 0, CPU_SUPPORTS_DYNAREC, 21,21, 9, 9, 15}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Cyrix", - .name = "Cx486DX", - .internal_name = "cx486dx", - .cpus = (const CPU[]) { - {"33", CPU_Cx486DX, fpus_internal, 33333333, 1.0, 5000, 0x430, 0, 0x051a, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, - {"40", CPU_Cx486DX, fpus_internal, 40000000, 1.0, 5000, 0x430, 0, 0x051a, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, - {"", 0} - } + .package = CPU_PKG_SOCKET3, + .manufacturer = "AMD", + .name = "Am486DX2 (Enhanced)", + .internal_name = "am486dx2_slenh", + .cpus = (const CPU[]) { + {"66", CPU_ENH_Am486DX, fpus_internal, 66666666, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, + {"80", CPU_ENH_Am486DX, fpus_internal, 80000000, 2, 5000, 0x435, 0x435, 0, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET1, - .manufacturer = "Cyrix", - .name = "Cx486DX2", - .internal_name = "cx486dx2", - .cpus = (const CPU[]) { - {"50", CPU_Cx486DX, fpus_internal, 50000000, 2.0, 5000, 0x430, 0, 0x081b, CPU_SUPPORTS_DYNAREC, 8, 8, 6, 6, 6}, - {"66", CPU_Cx486DX, fpus_internal, 66666666, 2.0, 5000, 0x430, 0, 0x0b1b, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, - {"80", CPU_Cx486DX, fpus_internal, 80000000, 2.0, 5000, 0x430, 0, 0x311b, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, - {"", 0} - } + .package = CPU_PKG_SOCKET3, + .manufacturer = "AMD", + .name = "Am486DX4 (Enhanced)", + .internal_name = "am486dx4_slenh", + .cpus = (const CPU[]) { + {"75", CPU_ENH_Am486DX, fpus_internal, 75000000, 3.0, 5000, 0x482, 0x482, 0, CPU_SUPPORTS_DYNAREC, 12,12, 9, 9, 9}, + {"100", CPU_ENH_Am486DX, fpus_internal, 100000000, 3.0, 5000, 0x482, 0x482, 0, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, + {"120", CPU_ENH_Am486DX, fpus_internal, 120000000, 3.0, 5000, 0x482, 0x482, 0, CPU_SUPPORTS_DYNAREC, 21,21, 9, 9, 15}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET3, - .manufacturer = "Cyrix", - .name = "Cx486DX4", - .internal_name = "cx486dx4", - .cpus = (const CPU[]) { - {"75", CPU_Cx486DX, fpus_internal, 75000000, 3.0, 5000, 0x480, 0, 0x361f, CPU_SUPPORTS_DYNAREC, 12,12, 9, 9, 9}, - {"100", CPU_Cx486DX, fpus_internal, 100000000, 3.0, 5000, 0x480, 0, 0x361f, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, - {"", 0} - } + .package = CPU_PKG_SOCKET3, + .manufacturer = "AMD", + .name = "Am5x86", + .internal_name = "am5x86", + .cpus = (const CPU[]) { + {"P75", CPU_ENH_Am486DX, fpus_internal, 133333333, 4.0, 5000, 0x4e0, 0x4e0, 0, CPU_SUPPORTS_DYNAREC, 24,24,12,12, 16}, + {"P75+", CPU_ENH_Am486DX, fpus_internal, 150000000, 3.0, 5000, 0x482, 0x482, 0, CPU_SUPPORTS_DYNAREC, 28,28,12,12, 20},/*The rare P75+ was indeed a triple-clocked 150 MHz according to research*/ + {"P90", CPU_ENH_Am486DX, fpus_internal, 160000000, 4.0, 5000, 0x4e0, 0x4e0, 0, CPU_SUPPORTS_DYNAREC, 28,28,12,12, 20},/*160 MHz on a 40 MHz bus was a common overclock and "5x86/P90" was used by a number of BIOSes to refer to that configuration*/ + {"", 0} + } }, { - .package = CPU_PKG_SOCKET3, - .manufacturer = "Cyrix", - .name = "Cx5x86", - .internal_name = "cx5x86", - .cpus = (const CPU[]) { - {"80", CPU_Cx5x86, fpus_internal, 80000000, 2.0, 5000, 0x480, 0, 0x002f, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, /*If we're including the Pentium 50, might as well include this*/ - {"100", CPU_Cx5x86, fpus_internal, 100000000, 3.0, 5000, 0x480, 0, 0x002f, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, - {"120", CPU_Cx5x86, fpus_internal, 120000000, 3.0, 5000, 0x480, 0, 0x002f, CPU_SUPPORTS_DYNAREC, 21,21, 9, 9, 15}, - {"133", CPU_Cx5x86, fpus_internal, 133333333, 4.0, 5000, 0x480, 0, 0x002f, CPU_SUPPORTS_DYNAREC, 24,24,12,12, 16}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Cyrix", + .name = "Cx486S", + .internal_name = "cx486s", + .cpus = (const CPU[]) { + {"25", CPU_Cx486S, fpus_486sx, 25000000, 1.0, 5000, 0x420, 0, 0x0010, CPU_SUPPORTS_DYNAREC, 4, 4, 3, 3, 3}, + {"33", CPU_Cx486S, fpus_486sx, 33333333, 1.0, 5000, 0x420, 0, 0x0010, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, + {"40", CPU_Cx486S, fpus_486sx, 40000000, 1.0, 5000, 0x420, 0, 0x0010, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_STPC, - .manufacturer = "ST", - .name = "STPC-DX", - .internal_name = "stpc_dx", - .cpus = (const CPU[]) { - {"66", CPU_STPC, fpus_internal, 66666666, 1.0, 3300, 0x430, 0, 0x051a, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, - {"75", CPU_STPC, fpus_internal, 75000000, 1.0, 3300, 0x430, 0, 0x051a, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Cyrix", + .name = "Cx486DX", + .internal_name = "cx486dx", + .cpus = (const CPU[]) { + {"33", CPU_Cx486DX, fpus_internal, 33333333, 1.0, 5000, 0x430, 0, 0x051a, CPU_SUPPORTS_DYNAREC, 6, 6, 3, 3, 4}, + {"40", CPU_Cx486DX, fpus_internal, 40000000, 1.0, 5000, 0x430, 0, 0x051a, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_STPC, - .manufacturer = "ST", - .name = "STPC-DX2", - .internal_name = "stpc_dx2", - .cpus = (const CPU[]) { - {"133", CPU_STPC, fpus_internal, 133333333, 2.0, 3300, 0x430, 0, 0x0b1b, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, - {"", 0} - } + .package = CPU_PKG_SOCKET1, + .manufacturer = "Cyrix", + .name = "Cx486DX2", + .internal_name = "cx486dx2", + .cpus = (const CPU[]) { + {"50", CPU_Cx486DX, fpus_internal, 50000000, 2.0, 5000, 0x430, 0, 0x081b, CPU_SUPPORTS_DYNAREC, 8, 8, 6, 6, 6}, + {"66", CPU_Cx486DX, fpus_internal, 66666666, 2.0, 5000, 0x430, 0, 0x0b1b, CPU_SUPPORTS_DYNAREC, 12,12, 6, 6, 8}, + {"80", CPU_Cx486DX, fpus_internal, 80000000, 2.0, 5000, 0x430, 0, 0x311b, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET4, - .manufacturer = "Intel", - .name = "Pentium", - .internal_name = "pentium_p5", - .cpus = (const CPU[]) { - {"50 (Q0399)", CPU_PENTIUM, fpus_internal, 50000000, 1, 5000, 0x513, 0x513, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 4, 4,3,3, 6}, - {"60", CPU_PENTIUM, fpus_internal, 60000000, 1, 5000, 0x517, 0x517, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6,3,3, 7}, - {"66", CPU_PENTIUM, fpus_internal, 66666666, 1, 5000, 0x517, 0x517, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6,3,3, 8}, - {"", 0} - } + .package = CPU_PKG_SOCKET3, + .manufacturer = "Cyrix", + .name = "Cx486DX4", + .internal_name = "cx486dx4", + .cpus = (const CPU[]) { + {"75", CPU_Cx486DX, fpus_internal, 75000000, 3.0, 5000, 0x480, 0, 0x361f, CPU_SUPPORTS_DYNAREC, 12,12, 9, 9, 9}, + {"100", CPU_Cx486DX, fpus_internal, 100000000, 3.0, 5000, 0x480, 0, 0x361f, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET4, - .manufacturer = "Intel", - .name = "Pentium OverDrive", - .internal_name = "pentium_p54c_od5v", - .cpus = (const CPU[]) { - {"100", CPU_PENTIUM, fpus_internal, 100000000, 2, 5000, 0x51A, 0x51A, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 8, 8,6,6, 12}, - {"120", CPU_PENTIUM, fpus_internal, 120000000, 2, 5000, 0x51A, 0x51A, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12,6,6, 14}, - {"133", CPU_PENTIUM, fpus_internal, 133333333, 2, 5000, 0x51A, 0x51A, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12,6,6, 16}, - {"", 0} - } + .package = CPU_PKG_SOCKET3, + .manufacturer = "Cyrix", + .name = "Cx5x86", + .internal_name = "cx5x86", + .cpus = (const CPU[]) { + {"80", CPU_Cx5x86, fpus_internal, 80000000, 2.0, 5000, 0x480, 0, 0x002f, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, /*If we're including the Pentium 50, might as well include this*/ + {"100", CPU_Cx5x86, fpus_internal, 100000000, 3.0, 5000, 0x480, 0, 0x002f, CPU_SUPPORTS_DYNAREC, 15,15, 9, 9, 12}, + {"120", CPU_Cx5x86, fpus_internal, 120000000, 3.0, 5000, 0x480, 0, 0x002f, CPU_SUPPORTS_DYNAREC, 21,21, 9, 9, 15}, + {"133", CPU_Cx5x86, fpus_internal, 133333333, 4.0, 5000, 0x480, 0, 0x002f, CPU_SUPPORTS_DYNAREC, 24,24,12,12, 16}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "Intel", - .name = "Pentium", - .internal_name = "pentium_p54c", - .cpus = (const CPU[]) { - {"75", CPU_PENTIUM, fpus_internal, 75000000, 1.5, 3520, 0x522, 0x522, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 7, 7,4,4, 9}, - {"90", CPU_PENTIUM, fpus_internal, 90000000, 1.5, 3520, 0x524, 0x524, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 21/2}, - {"100/50", CPU_PENTIUM, fpus_internal, 100000000, 2.0, 3520, 0x524, 0x524, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10,6,6, 12}, - {"100/66", CPU_PENTIUM, fpus_internal, 100000000, 1.5, 3520, 0x526, 0x526, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 12}, - {"120", CPU_PENTIUM, fpus_internal, 120000000, 2.0, 3520, 0x526, 0x526, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 14}, - {"133", CPU_PENTIUM, fpus_internal, 133333333, 2.0, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 16}, - {"150", CPU_PENTIUM, fpus_internal, 150000000, 2.5, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 35/2}, - {"166", CPU_PENTIUM, fpus_internal, 166666666, 2.5, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, - {"200", CPU_PENTIUM, fpus_internal, 200000000, 3.0, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, - {"", 0} - } + .package = CPU_PKG_STPC, + .manufacturer = "ST", + .name = "STPC-DX", + .internal_name = "stpc_dx", + .cpus = (const CPU[]) { + {"66", CPU_STPC, fpus_internal, 66666666, 1.0, 3300, 0x430, 0, 0x051a, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, + {"75", CPU_STPC, fpus_internal, 75000000, 1.0, 3300, 0x430, 0, 0x051a, CPU_SUPPORTS_DYNAREC, 7, 7, 3, 3, 5}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "Intel", - .name = "Pentium MMX", - .internal_name = "pentium_p55c", - .cpus = (const CPU[]) { - {"166", CPU_PENTIUMMMX, fpus_internal, 166666666, 2.5, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, - {"200", CPU_PENTIUMMMX, fpus_internal, 200000000, 3.0, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, - {"233", CPU_PENTIUMMMX, fpus_internal, 233333333, 3.5, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, - {"", 0} - } + .package = CPU_PKG_STPC, + .manufacturer = "ST", + .name = "STPC-DX2", + .internal_name = "stpc_dx2", + .cpus = (const CPU[]) { + {"133", CPU_STPC, fpus_internal, 133333333, 2.0, 3300, 0x430, 0, 0x0b1b, CPU_SUPPORTS_DYNAREC, 14,14, 6, 6, 10}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "Intel", - .name = "Mobile Pentium MMX", - .internal_name = "pentium_tillamook", - .cpus = (const CPU[]) { - {"120", CPU_PENTIUMMMX, fpus_internal, 120000000, 2.0, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 14}, - {"133", CPU_PENTIUMMMX, fpus_internal, 133333333, 2.0, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, - {"150", CPU_PENTIUMMMX, fpus_internal, 150000000, 2.5, 2800, 0x544, 0x544, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 35/2}, - {"166", CPU_PENTIUMMMX, fpus_internal, 166666666, 2.5, 2800, 0x544, 0x544, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, - {"200", CPU_PENTIUMMMX, fpus_internal, 200000000, 3.0, 2800, 0x581, 0x581, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, - {"233", CPU_PENTIUMMMX, fpus_internal, 233333333, 3.5, 2800, 0x581, 0x581, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, - {"266", CPU_PENTIUMMMX, fpus_internal, 266666666, 4.0, 2800, 0x582, 0x582, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, - {"300", CPU_PENTIUMMMX, fpus_internal, 300000000, 4.5, 2800, 0x582, 0x582, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27,13,13, 36}, - {"", 0} - } + .package = CPU_PKG_SOCKET4, + .manufacturer = "Intel", + .name = "Pentium", + .internal_name = "pentium_p5", + .cpus = (const CPU[]) { + {"50 (Q0399)", CPU_PENTIUM, fpus_internal, 50000000, 1, 5000, 0x513, 0x513, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 4, 4,3,3, 6}, + {"60", CPU_PENTIUM, fpus_internal, 60000000, 1, 5000, 0x517, 0x517, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6,3,3, 7}, + {"66", CPU_PENTIUM, fpus_internal, 66666666, 1, 5000, 0x517, 0x517, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6,3,3, 8}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "Intel", - .name = "Pentium OverDrive", - .internal_name = "pentium_p54c_od3v", - .cpus = (const CPU[]) { - {"125", CPU_PENTIUM, fpus_internal, 125000000, 3.0, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12,7,7, 15}, - {"150", CPU_PENTIUM, fpus_internal, 150000000, 2.5, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15,7,7, 35/2}, - {"166", CPU_PENTIUM, fpus_internal, 166666666, 2.5, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15,7,7, 20}, - {"", 0} - } + .package = CPU_PKG_SOCKET4, + .manufacturer = "Intel", + .name = "Pentium OverDrive", + .internal_name = "pentium_p54c_od5v", + .cpus = (const CPU[]) { + {"100", CPU_PENTIUM, fpus_internal, 100000000, 2, 5000, 0x51A, 0x51A, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 8, 8,6,6, 12}, + {"120", CPU_PENTIUM, fpus_internal, 120000000, 2, 5000, 0x51A, 0x51A, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12,6,6, 14}, + {"133", CPU_PENTIUM, fpus_internal, 133333333, 2, 5000, 0x51A, 0x51A, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12,6,6, 16}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "Intel", - .name = "Pentium OverDrive MMX", - .internal_name = "pentium_p55c_od", - .cpus = (const CPU[]) { - {"75", CPU_PENTIUMMMX, fpus_internal, 75000000, 1.5, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 7, 7,4,4, 9}, - {"125", CPU_PENTIUMMMX, fpus_internal, 125000000, 2.5, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12,7,7, 15}, - {"150/60", CPU_PENTIUMMMX, fpus_internal, 150000000, 2.5, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15,7,7, 35/2}, - {"166", CPU_PENTIUMMMX, fpus_internal, 166000000, 2.5, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15,7,7, 20}, - {"180", CPU_PENTIUMMMX, fpus_internal, 180000000, 3.0, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 18,18,9,9, 21}, - {"200", CPU_PENTIUMMMX, fpus_internal, 200000000, 3.0, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 18,18,9,9, 24}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "Intel", + .name = "Pentium", + .internal_name = "pentium_p54c", + .cpus = (const CPU[]) { + {"75", CPU_PENTIUM, fpus_internal, 75000000, 1.5, 3520, 0x522, 0x522, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 7, 7,4,4, 9}, + {"90", CPU_PENTIUM, fpus_internal, 90000000, 1.5, 3520, 0x524, 0x524, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 21/2}, + {"100/50", CPU_PENTIUM, fpus_internal, 100000000, 2.0, 3520, 0x524, 0x524, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10,6,6, 12}, + {"100/66", CPU_PENTIUM, fpus_internal, 100000000, 1.5, 3520, 0x526, 0x526, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 12}, + {"120", CPU_PENTIUM, fpus_internal, 120000000, 2.0, 3520, 0x526, 0x526, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 14}, + {"133", CPU_PENTIUM, fpus_internal, 133333333, 2.0, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 16}, + {"150", CPU_PENTIUM, fpus_internal, 150000000, 2.5, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 35/2}, + {"166", CPU_PENTIUM, fpus_internal, 166666666, 2.5, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, + {"200", CPU_PENTIUM, fpus_internal, 200000000, 3.0, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "IDT", - .name = "WinChip", - .internal_name = "winchip", - .cpus = (const CPU[]) { - {"75", CPU_WINCHIP, fpus_internal, 75000000, 1.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 8, 8, 4, 4, 9}, - {"90", CPU_WINCHIP, fpus_internal, 90000000, 1.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 9, 9, 4, 4, 21/2}, - {"100", CPU_WINCHIP, fpus_internal, 100000000, 1.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 9, 9, 4, 4, 12}, - {"120", CPU_WINCHIP, fpus_internal, 120000000, 2.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 12, 12, 6, 6, 14}, - {"133", CPU_WINCHIP, fpus_internal, 133333333, 2.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 12, 12, 6, 6, 16}, - {"150", CPU_WINCHIP, fpus_internal, 150000000, 2.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 15, 15, 7, 7, 35/2}, - {"166", CPU_WINCHIP, fpus_internal, 166666666, 2.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 15, 15, 7, 7, 40}, - {"180", CPU_WINCHIP, fpus_internal, 180000000, 3.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 21}, - {"200", CPU_WINCHIP, fpus_internal, 200000000, 3.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 24}, - {"225", CPU_WINCHIP, fpus_internal, 225000000, 3.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 27}, - {"240", CPU_WINCHIP, fpus_internal, 240000000, 4.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 24, 24, 12, 12, 28}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "Intel", + .name = "Pentium MMX", + .internal_name = "pentium_p55c", + .cpus = (const CPU[]) { + {"166", CPU_PENTIUMMMX, fpus_internal, 166666666, 2.5, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, + {"200", CPU_PENTIUMMMX, fpus_internal, 200000000, 3.0, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, + {"233", CPU_PENTIUMMMX, fpus_internal, 233333333, 3.5, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "IDT", - .name = "WinChip 2", - .internal_name = "winchip2", - .cpus = (const CPU[]) { - {"200", CPU_WINCHIP2, fpus_internal, 200000000, 3.0, 3520, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 3*8}, - {"225", CPU_WINCHIP2, fpus_internal, 225000000, 3.0, 3520, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 3*9}, - {"240", CPU_WINCHIP2, fpus_internal, 240000000, 4.0, 3520, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC, 24, 24, 12, 12, 30}, - {"250", CPU_WINCHIP2, fpus_internal, 250000000, 3.0, 3520, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC, 24, 24, 12, 12, 30}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "Intel", + .name = "Mobile Pentium MMX", + .internal_name = "pentium_tillamook", + .cpus = (const CPU[]) { + {"120", CPU_PENTIUMMMX, fpus_internal, 120000000, 2.0, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 14}, + {"133", CPU_PENTIUMMMX, fpus_internal, 133333333, 2.0, 2800, 0x543, 0x543, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, + {"150", CPU_PENTIUMMMX, fpus_internal, 150000000, 2.5, 2800, 0x544, 0x544, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 35/2}, + {"166", CPU_PENTIUMMMX, fpus_internal, 166666666, 2.5, 2800, 0x544, 0x544, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, + {"200", CPU_PENTIUMMMX, fpus_internal, 200000000, 3.0, 2800, 0x581, 0x581, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, + {"233", CPU_PENTIUMMMX, fpus_internal, 233333333, 3.5, 2800, 0x581, 0x581, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, + {"266", CPU_PENTIUMMMX, fpus_internal, 266666666, 4.0, 2800, 0x582, 0x582, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, + {"300", CPU_PENTIUMMMX, fpus_internal, 300000000, 4.5, 2800, 0x582, 0x582, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27,13,13, 36}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "IDT", - .name = "WinChip 2A", - .internal_name = "winchip2a", - .cpus = (const CPU[]) { - {"200", CPU_WINCHIP2, fpus_internal, 200000000, 3.0, 3520, 0x587, 0x587, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 3*8}, - {"233", CPU_WINCHIP2, fpus_internal, 233333333, 3.5, 3520, 0x587, 0x587, 0, CPU_SUPPORTS_DYNAREC, 21, 21, 9, 9, (7*8)/2}, - {"266", CPU_WINCHIP2, fpus_internal, 233333333, 7.0/3.0, 3520, 0x587, 0x587, 0, CPU_SUPPORTS_DYNAREC, 21, 21, 7, 7, 28}, - {"300", CPU_WINCHIP2, fpus_internal, 250000000, 2.5, 3520, 0x587, 0x587, 0, CPU_SUPPORTS_DYNAREC, 24, 24, 8, 8, 30}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "Intel", + .name = "Pentium OverDrive", + .internal_name = "pentium_p54c_od3v", + .cpus = (const CPU[]) { + {"125", CPU_PENTIUM, fpus_internal, 125000000, 3.0, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12,7,7, 15}, + {"150", CPU_PENTIUM, fpus_internal, 150000000, 2.5, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15,7,7, 35/2}, + {"166", CPU_PENTIUM, fpus_internal, 166666666, 2.5, 3520, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15,7,7, 20}, + {"", 0} + } + }, { + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "Intel", + .name = "Pentium OverDrive MMX", + .internal_name = "pentium_p55c_od", + .cpus = (const CPU[]) { + {"75", CPU_PENTIUMMMX, fpus_internal, 75000000, 1.5, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 7, 7,4,4, 9}, + {"125", CPU_PENTIUMMMX, fpus_internal, 125000000, 2.5, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12,7,7, 15}, + {"150/60", CPU_PENTIUMMMX, fpus_internal, 150000000, 2.5, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15,7,7, 35/2}, + {"166", CPU_PENTIUMMMX, fpus_internal, 166000000, 2.5, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15,7,7, 20}, + {"180", CPU_PENTIUMMMX, fpus_internal, 180000000, 3.0, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 18,18,9,9, 21}, + {"200", CPU_PENTIUMMMX, fpus_internal, 200000000, 3.0, 3520, 0x1542, 0x1542, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 18,18,9,9, 24}, + {"", 0} + } + }, { + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "IDT", + .name = "WinChip", + .internal_name = "winchip", + .cpus = (const CPU[]) { + {"75", CPU_WINCHIP, fpus_internal, 75000000, 1.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 8, 8, 4, 4, 9}, + {"90", CPU_WINCHIP, fpus_internal, 90000000, 1.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 9, 9, 4, 4, 21/2}, + {"100", CPU_WINCHIP, fpus_internal, 100000000, 1.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 9, 9, 4, 4, 12}, + {"120", CPU_WINCHIP, fpus_internal, 120000000, 2.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 12, 12, 6, 6, 14}, + {"133", CPU_WINCHIP, fpus_internal, 133333333, 2.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 12, 12, 6, 6, 16}, + {"150", CPU_WINCHIP, fpus_internal, 150000000, 2.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 15, 15, 7, 7, 35/2}, + {"166", CPU_WINCHIP, fpus_internal, 166666666, 2.5, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 15, 15, 7, 7, 40}, + {"180", CPU_WINCHIP, fpus_internal, 180000000, 3.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 21}, + {"200", CPU_WINCHIP, fpus_internal, 200000000, 3.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 24}, + {"225", CPU_WINCHIP, fpus_internal, 225000000, 3.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 27}, + {"240", CPU_WINCHIP, fpus_internal, 240000000, 4.0, 3520, 0x540, 0x540, 0, CPU_SUPPORTS_DYNAREC, 24, 24, 12, 12, 28}, + {"", 0} + } + }, { + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "IDT", + .name = "WinChip 2", + .internal_name = "winchip2", + .cpus = (const CPU[]) { + {"200", CPU_WINCHIP2, fpus_internal, 200000000, 3.0, 3520, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 3*8}, + {"225", CPU_WINCHIP2, fpus_internal, 225000000, 3.0, 3520, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 3*9}, + {"240", CPU_WINCHIP2, fpus_internal, 240000000, 4.0, 3520, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC, 24, 24, 12, 12, 30}, + {"250", CPU_WINCHIP2, fpus_internal, 250000000, 3.0, 3520, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC, 24, 24, 12, 12, 30}, + {"", 0} + } + }, { + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "IDT", + .name = "WinChip 2A", + .internal_name = "winchip2a", + .cpus = (const CPU[]) { + {"200", CPU_WINCHIP2, fpus_internal, 200000000, 3.0, 3520, 0x587, 0x587, 0, CPU_SUPPORTS_DYNAREC, 18, 18, 9, 9, 3*8}, + {"233", CPU_WINCHIP2, fpus_internal, 233333333, 3.5, 3520, 0x587, 0x587, 0, CPU_SUPPORTS_DYNAREC, 21, 21, 9, 9, (7*8)/2}, + {"266", CPU_WINCHIP2, fpus_internal, 233333333, 7.0/3.0, 3520, 0x587, 0x587, 0, CPU_SUPPORTS_DYNAREC, 21, 21, 7, 7, 28}, + {"300", CPU_WINCHIP2, fpus_internal, 250000000, 2.5, 3520, 0x587, 0x587, 0, CPU_SUPPORTS_DYNAREC, 24, 24, 8, 8, 30}, + {"", 0} + } }, #if defined(DEV_BRANCH) && defined(USE_AMD_K5) { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "AMD", - .name = "K5 (5k86)", - .internal_name = "k5_5k86", - .cpus = (const CPU[]) { - {"75 (P75)", CPU_K5, fpus_internal, 75000000, 1.5, 3520, 0x500, 0x500, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 7, 7,4,4, 9}, - {"90 (P90)", CPU_K5, fpus_internal, 90000000, 1.5, 3520, 0x500, 0x500, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 21/2}, - {"100 (P100)", CPU_K5, fpus_internal, 100000000, 1.5, 3520, 0x500, 0x500, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 12}, - {"90 (PR120)", CPU_5K86, fpus_internal, 120000000, 2.0, 3520, 0x511, 0x511, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 14}, - {"100 (PR133)", CPU_5K86, fpus_internal, 133333333, 2.0, 3520, 0x514, 0x514, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 16}, - {"105 (PR150)", CPU_5K86, fpus_internal, 150000000, 2.5, 3520, 0x524, 0x524, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15,7,7, 35/2}, - {"116.5 (PR166)", CPU_5K86, fpus_internal, 166666666, 2.5, 3520, 0x524, 0x524, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15,7,7, 20}, - {"133 (PR200)", CPU_5K86, fpus_internal, 200000000, 3.0, 3520, 0x534, 0x534, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18,9,9, 24}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "AMD", + .name = "K5 (5k86)", + .internal_name = "k5_5k86", + .cpus = (const CPU[]) { + {"75 (P75)", CPU_K5, fpus_internal, 75000000, 1.5, 3520, 0x500, 0x500, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 7, 7,4,4, 9}, + {"90 (P90)", CPU_K5, fpus_internal, 90000000, 1.5, 3520, 0x500, 0x500, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 21/2}, + {"100 (P100)", CPU_K5, fpus_internal, 100000000, 1.5, 3520, 0x500, 0x500, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 12}, + {"90 (PR120)", CPU_5K86, fpus_internal, 120000000, 2.0, 3520, 0x511, 0x511, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 14}, + {"100 (PR133)", CPU_5K86, fpus_internal, 133333333, 2.0, 3520, 0x514, 0x514, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 16}, + {"105 (PR150)", CPU_5K86, fpus_internal, 150000000, 2.5, 3520, 0x524, 0x524, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15,7,7, 35/2}, + {"116.5 (PR166)", CPU_5K86, fpus_internal, 166666666, 2.5, 3520, 0x524, 0x524, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15,7,7, 20}, + {"133 (PR200)", CPU_5K86, fpus_internal, 200000000, 3.0, 3520, 0x534, 0x534, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18,9,9, 24}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "AMD", - .name = "K5 (SSA/5)", - .internal_name = "k5_ssa5", - .cpus = (const CPU[]) { - {"75 (PR75)", CPU_K5, fpus_internal, 75000000, 1.5, 3520, 0x501, 0x501, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 7, 7,4,4, 9}, - {"90 (PR90)", CPU_K5, fpus_internal, 90000000, 1.5, 3520, 0x501, 0x501, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 21/2}, - {"100 (PR100)", CPU_K5, fpus_internal, 100000000, 1.5, 3520, 0x501, 0x501, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 12}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "AMD", + .name = "K5 (SSA/5)", + .internal_name = "k5_ssa5", + .cpus = (const CPU[]) { + {"75 (PR75)", CPU_K5, fpus_internal, 75000000, 1.5, 3520, 0x501, 0x501, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 7, 7,4,4, 9}, + {"90 (PR90)", CPU_K5, fpus_internal, 90000000, 1.5, 3520, 0x501, 0x501, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 21/2}, + {"100 (PR100)", CPU_K5, fpus_internal, 100000000, 1.5, 3520, 0x501, 0x501, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 12}, + {"", 0} + } }, #endif { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "AMD", - .name = "K6 (Model 6)", - .internal_name = "k6_m6", - .cpus = (const CPU[]) { - {"66", CPU_K6, fpus_internal, 66666666, 1.0, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 3, 3, 8}, /* out of spec */ - {"100", CPU_K6, fpus_internal, 100000000, 1.5, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ - {"133", CPU_K6, fpus_internal, 133333333, 2.0, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, /* out of spec */ - {"166", CPU_K6, fpus_internal, 166666666, 2.5, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, - {"200", CPU_K6, fpus_internal, 200000000, 3.0, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, - {"233", CPU_K6, fpus_internal, 233333333, 3.5, 3200, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "AMD", + .name = "K6 (Model 6)", + .internal_name = "k6_m6", + .cpus = (const CPU[]) { + {"66", CPU_K6, fpus_internal, 66666666, 1.0, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 3, 3, 8}, /* out of spec */ + {"100", CPU_K6, fpus_internal, 100000000, 1.5, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ + {"133", CPU_K6, fpus_internal, 133333333, 2.0, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, /* out of spec */ + {"166", CPU_K6, fpus_internal, 166666666, 2.5, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, + {"200", CPU_K6, fpus_internal, 200000000, 3.0, 2900, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, + {"233", CPU_K6, fpus_internal, 233333333, 3.5, 3200, 0x561, 0x561, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "AMD", - .name = "K6 (Model 7)", - .internal_name = "k6_m7", - .cpus = (const CPU[]) { - {"100", CPU_K6, fpus_internal, 100000000, 1.5, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ - {"133", CPU_K6, fpus_internal, 133333333, 2.0, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, /* out of spec */ - {"166", CPU_K6, fpus_internal, 166666666, 2.5, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, /* out of spec */ - {"200", CPU_K6, fpus_internal, 200000000, 3.0, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, - {"233", CPU_K6, fpus_internal, 233333333, 3.5, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, - {"266", CPU_K6, fpus_internal, 266666666, 4.0, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, - {"300", CPU_K6, fpus_internal, 300000000, 4.5, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27,13,13, 36}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "AMD", + .name = "K6 (Model 7)", + .internal_name = "k6_m7", + .cpus = (const CPU[]) { + {"100", CPU_K6, fpus_internal, 100000000, 1.5, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ + {"133", CPU_K6, fpus_internal, 133333333, 2.0, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, /* out of spec */ + {"166", CPU_K6, fpus_internal, 166666666, 2.5, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, /* out of spec */ + {"200", CPU_K6, fpus_internal, 200000000, 3.0, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, + {"233", CPU_K6, fpus_internal, 233333333, 3.5, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, + {"266", CPU_K6, fpus_internal, 266666666, 4.0, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, + {"300", CPU_K6, fpus_internal, 300000000, 4.5, 2200, 0x570, 0x570, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27,13,13, 36}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "AMD", - .name = "K6-2", - .internal_name = "k6_2", - .cpus = (const CPU[]) { - {"100", CPU_K6_2, fpus_internal, 100000000, 1.5, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ - {"133", CPU_K6_2, fpus_internal, 133333333, 2.0, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12, 12, 6, 6, 16}, /* out of spec */ - {"166", CPU_K6_2, fpus_internal, 166666666, 2.5, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15, 15, 7, 7, 20}, /* out of spec */ - {"200", CPU_K6_2, fpus_internal, 200000000, 3.0, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18, 18, 9, 9, 24}, /* out of spec */ - {"233", CPU_K6_2, fpus_internal, 233333333, 3.5, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21, 21, 10, 10, 28}, - {"266", CPU_K6_2, fpus_internal, 266666666, 4.0, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24, 24, 12, 12, 32}, - {"300", CPU_K6_2, fpus_internal, 300000000, 3.0, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27, 27, 9, 9, 36}, - {"333", CPU_K6_2, fpus_internal, 332500000, 3.5, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 30, 30, 11, 11, 40}, - {"350", CPU_K6_2C, fpus_internal, 350000000, 3.5, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32, 32, 11, 11, 42}, - {"366", CPU_K6_2C, fpus_internal, 366666666, 5.5, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 33, 33, 17, 17, 44}, - {"380", CPU_K6_2C, fpus_internal, 380000000, 4.0, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 34, 34, 12, 12, 46}, - {"400/66", CPU_K6_2C, fpus_internal, 400000000, 6.0, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, - {"400/100", CPU_K6_2C, fpus_internal, 400000000, 4.0, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, - {"450", CPU_K6_2C, fpus_internal, 450000000, 4.5, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41, 41, 14, 14, 54}, - {"475", CPU_K6_2C, fpus_internal, 475000000, 5.0, 2400, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 43, 43, 15, 15, 57}, - {"500", CPU_K6_2C, fpus_internal, 500000000, 5.0, 2400, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 45, 45, 15, 15, 60}, - {"533", CPU_K6_2C, fpus_internal, 533333333, 5.5, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 48, 48, 17, 17, 64}, - {"550", CPU_K6_2C, fpus_internal, 550000000, 5.5, 2300, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 50, 50, 17, 17, 66}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "AMD", + .name = "K6-2", + .internal_name = "k6_2", + .cpus = (const CPU[]) { + {"100", CPU_K6_2, fpus_internal, 100000000, 1.5, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ + {"133", CPU_K6_2, fpus_internal, 133333333, 2.0, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12, 12, 6, 6, 16}, /* out of spec */ + {"166", CPU_K6_2, fpus_internal, 166666666, 2.5, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15, 15, 7, 7, 20}, /* out of spec */ + {"200", CPU_K6_2, fpus_internal, 200000000, 3.0, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18, 18, 9, 9, 24}, /* out of spec */ + {"233", CPU_K6_2, fpus_internal, 233333333, 3.5, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21, 21, 10, 10, 28}, + {"266", CPU_K6_2, fpus_internal, 266666666, 4.0, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24, 24, 12, 12, 32}, + {"300", CPU_K6_2, fpus_internal, 300000000, 3.0, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27, 27, 9, 9, 36}, + {"333", CPU_K6_2, fpus_internal, 332500000, 3.5, 2200, 0x580, 0x580, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 30, 30, 11, 11, 40}, + {"350", CPU_K6_2C, fpus_internal, 350000000, 3.5, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32, 32, 11, 11, 42}, + {"366", CPU_K6_2C, fpus_internal, 366666666, 5.5, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 33, 33, 17, 17, 44}, + {"380", CPU_K6_2C, fpus_internal, 380000000, 4.0, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 34, 34, 12, 12, 46}, + {"400/66", CPU_K6_2C, fpus_internal, 400000000, 6.0, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, + {"400/100", CPU_K6_2C, fpus_internal, 400000000, 4.0, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, + {"450", CPU_K6_2C, fpus_internal, 450000000, 4.5, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41, 41, 14, 14, 54}, + {"475", CPU_K6_2C, fpus_internal, 475000000, 5.0, 2400, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 43, 43, 15, 15, 57}, + {"500", CPU_K6_2C, fpus_internal, 500000000, 5.0, 2400, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 45, 45, 15, 15, 60}, + {"533", CPU_K6_2C, fpus_internal, 533333333, 5.5, 2200, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 48, 48, 17, 17, 64}, + {"550", CPU_K6_2C, fpus_internal, 550000000, 5.5, 2300, 0x58c, 0x58c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 50, 50, 17, 17, 66}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "AMD", - .name = "K6-2+", - .internal_name = "k6_2p", - .cpus = (const CPU[]) { - {"100", CPU_K6_2P, fpus_internal, 100000000, 1.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ - {"133", CPU_K6_2P, fpus_internal, 133333333, 2.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12, 12, 6, 6, 16}, /* out of spec */ - {"166", CPU_K6_2P, fpus_internal, 166666666, 2.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15, 15, 7, 7, 20}, /* out of spec */ - {"200", CPU_K6_2P, fpus_internal, 200000000, 3.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18, 18, 9, 9, 24}, /* out of spec */ - {"233", CPU_K6_2P, fpus_internal, 233333333, 3.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21, 21, 10, 10, 28}, /* out of spec */ - {"266", CPU_K6_2P, fpus_internal, 266666666, 4.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24, 24, 12, 12, 32}, /* out of spec */ - {"300", CPU_K6_2P, fpus_internal, 300000000, 3.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27, 27, 9, 9, 36}, /* out of spec */ - {"333", CPU_K6_2P, fpus_internal, 332500000, 3.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 30, 30, 11, 11, 40}, /* out of spec */ - {"350", CPU_K6_2P, fpus_internal, 350000000, 3.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32, 32, 11, 11, 42}, /* out of spec */ - {"366", CPU_K6_2P, fpus_internal, 366666666, 5.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 33, 33, 17, 17, 44}, /* out of spec */ - {"380", CPU_K6_2P, fpus_internal, 380000000, 4.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 34, 34, 12, 12, 46}, /* out of spec */ - {"400/66", CPU_K6_2P, fpus_internal, 400000000, 6.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, /* out of spec */ - {"400/100", CPU_K6_2P, fpus_internal, 400000000, 4.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, /* out of spec */ - {"450", CPU_K6_2P, fpus_internal, 450000000, 4.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41, 41, 14, 14, 54}, - {"475", CPU_K6_2P, fpus_internal, 475000000, 5.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 43, 43, 15, 15, 57}, - {"500", CPU_K6_2P, fpus_internal, 500000000, 5.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 45, 45, 15, 15, 60}, - {"533", CPU_K6_2P, fpus_internal, 533333333, 5.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 48, 48, 17, 17, 64}, - {"550", CPU_K6_2P, fpus_internal, 550000000, 5.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 50, 50, 17, 17, 66}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "AMD", + .name = "K6-2+", + .internal_name = "k6_2p", + .cpus = (const CPU[]) { + {"100", CPU_K6_2P, fpus_internal, 100000000, 1.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ + {"133", CPU_K6_2P, fpus_internal, 133333333, 2.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12, 12, 6, 6, 16}, /* out of spec */ + {"166", CPU_K6_2P, fpus_internal, 166666666, 2.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15, 15, 7, 7, 20}, /* out of spec */ + {"200", CPU_K6_2P, fpus_internal, 200000000, 3.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18, 18, 9, 9, 24}, /* out of spec */ + {"233", CPU_K6_2P, fpus_internal, 233333333, 3.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21, 21, 10, 10, 28}, /* out of spec */ + {"266", CPU_K6_2P, fpus_internal, 266666666, 4.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24, 24, 12, 12, 32}, /* out of spec */ + {"300", CPU_K6_2P, fpus_internal, 300000000, 3.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27, 27, 9, 9, 36}, /* out of spec */ + {"333", CPU_K6_2P, fpus_internal, 332500000, 3.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 30, 30, 11, 11, 40}, /* out of spec */ + {"350", CPU_K6_2P, fpus_internal, 350000000, 3.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32, 32, 11, 11, 42}, /* out of spec */ + {"366", CPU_K6_2P, fpus_internal, 366666666, 5.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 33, 33, 17, 17, 44}, /* out of spec */ + {"380", CPU_K6_2P, fpus_internal, 380000000, 4.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 34, 34, 12, 12, 46}, /* out of spec */ + {"400/66", CPU_K6_2P, fpus_internal, 400000000, 6.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, /* out of spec */ + {"400/100", CPU_K6_2P, fpus_internal, 400000000, 4.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, /* out of spec */ + {"450", CPU_K6_2P, fpus_internal, 450000000, 4.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41, 41, 14, 14, 54}, + {"475", CPU_K6_2P, fpus_internal, 475000000, 5.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 43, 43, 15, 15, 57}, + {"500", CPU_K6_2P, fpus_internal, 500000000, 5.0, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 45, 45, 15, 15, 60}, + {"533", CPU_K6_2P, fpus_internal, 533333333, 5.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 48, 48, 17, 17, 64}, + {"550", CPU_K6_2P, fpus_internal, 550000000, 5.5, 2000, 0x5d4, 0x5d4, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 50, 50, 17, 17, 66}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "AMD", - .name = "K6-III", - .internal_name = "k6_3", - .cpus = (const CPU[]) { - {"100", CPU_K6_3, fpus_internal, 100000000, 1.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ - {"133", CPU_K6_3, fpus_internal, 133333333, 2.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12, 12, 6, 6, 16}, /* out of spec */ - {"166", CPU_K6_3, fpus_internal, 166666666, 2.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15, 15, 7, 7, 20}, /* out of spec */ - {"200", CPU_K6_3, fpus_internal, 200000000, 3.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18, 18, 9, 9, 24}, /* out of spec */ - {"233", CPU_K6_3, fpus_internal, 233333333, 3.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21, 21, 10, 10, 28}, /* out of spec */ - {"266", CPU_K6_3, fpus_internal, 266666666, 4.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24, 24, 12, 12, 32}, /* out of spec */ - {"300", CPU_K6_3, fpus_internal, 300000000, 3.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27, 27, 9, 9, 36}, /* out of spec */ - {"333", CPU_K6_3, fpus_internal, 332500000, 3.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 30, 30, 11, 11, 40}, /* out of spec */ - {"350", CPU_K6_3, fpus_internal, 350000000, 3.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32, 32, 11, 11, 42}, /* out of spec */ - {"366", CPU_K6_3, fpus_internal, 366666666, 5.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 33, 33, 17, 17, 44}, /* out of spec */ - {"380", CPU_K6_3, fpus_internal, 380000000, 4.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 34, 34, 12, 12, 46}, /* out of spec */ - {"400", CPU_K6_3, fpus_internal, 400000000, 4.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, - {"450", CPU_K6_3, fpus_internal, 450000000, 4.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41, 41, 14, 14, 54}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "AMD", + .name = "K6-III", + .internal_name = "k6_3", + .cpus = (const CPU[]) { + {"100", CPU_K6_3, fpus_internal, 100000000, 1.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ + {"133", CPU_K6_3, fpus_internal, 133333333, 2.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12, 12, 6, 6, 16}, /* out of spec */ + {"166", CPU_K6_3, fpus_internal, 166666666, 2.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15, 15, 7, 7, 20}, /* out of spec */ + {"200", CPU_K6_3, fpus_internal, 200000000, 3.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18, 18, 9, 9, 24}, /* out of spec */ + {"233", CPU_K6_3, fpus_internal, 233333333, 3.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21, 21, 10, 10, 28}, /* out of spec */ + {"266", CPU_K6_3, fpus_internal, 266666666, 4.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24, 24, 12, 12, 32}, /* out of spec */ + {"300", CPU_K6_3, fpus_internal, 300000000, 3.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27, 27, 9, 9, 36}, /* out of spec */ + {"333", CPU_K6_3, fpus_internal, 332500000, 3.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 30, 30, 11, 11, 40}, /* out of spec */ + {"350", CPU_K6_3, fpus_internal, 350000000, 3.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32, 32, 11, 11, 42}, /* out of spec */ + {"366", CPU_K6_3, fpus_internal, 366666666, 5.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 33, 33, 17, 17, 44}, /* out of spec */ + {"380", CPU_K6_3, fpus_internal, 380000000, 4.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 34, 34, 12, 12, 46}, /* out of spec */ + {"400", CPU_K6_3, fpus_internal, 400000000, 4.0, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, + {"450", CPU_K6_3, fpus_internal, 450000000, 4.5, 2200, 0x591, 0x591, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41, 41, 14, 14, 54}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "AMD", - .name = "K6-III+", - .internal_name = "k6_3p", - .cpus = (const CPU[]) { - {"100", CPU_K6_3P, fpus_internal, 100000000, 1.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 7, 7, 4, 4, 9}, /* out of spec */ - {"133", CPU_K6_3P, fpus_internal, 133333333, 2.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12, 12, 6, 6, 16}, /* out of spec */ - {"166", CPU_K6_3P, fpus_internal, 166666666, 2.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15, 15, 7, 7, 20}, /* out of spec */ - {"200", CPU_K6_3P, fpus_internal, 200000000, 3.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18, 18, 9, 9, 24}, /* out of spec */ - {"233", CPU_K6_3P, fpus_internal, 233333333, 3.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21, 21, 10, 10, 28}, /* out of spec */ - {"266", CPU_K6_3P, fpus_internal, 266666666, 4.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24, 24, 12, 12, 32}, /* out of spec */ - {"300", CPU_K6_3P, fpus_internal, 300000000, 3.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27, 27, 9, 9, 36}, /* out of spec */ - {"333", CPU_K6_3P, fpus_internal, 332500000, 3.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 30, 30, 11, 11, 40}, /* out of spec */ - {"350", CPU_K6_3P, fpus_internal, 350000000, 3.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32, 32, 11, 11, 42}, /* out of spec */ - {"366", CPU_K6_3P, fpus_internal, 366666666, 5.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 33, 33, 17, 17, 44}, /* out of spec */ - {"380", CPU_K6_3P, fpus_internal, 380000000, 4.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 34, 34, 12, 12, 46}, /* out of spec */ - {"400", CPU_K6_3P, fpus_internal, 400000000, 4.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, - {"450", CPU_K6_3P, fpus_internal, 450000000, 4.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41, 41, 14, 14, 54}, - {"475", CPU_K6_3P, fpus_internal, 475000000, 5.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 43, 43, 15, 15, 57}, - {"500", CPU_K6_3P, fpus_internal, 500000000, 5.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 45, 45, 15, 15, 60}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "AMD", + .name = "K6-III+", + .internal_name = "k6_3p", + .cpus = (const CPU[]) { + {"100", CPU_K6_3P, fpus_internal, 100000000, 1.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 7, 7, 4, 4, 9}, /* out of spec */ + {"133", CPU_K6_3P, fpus_internal, 133333333, 2.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12, 12, 6, 6, 16}, /* out of spec */ + {"166", CPU_K6_3P, fpus_internal, 166666666, 2.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15, 15, 7, 7, 20}, /* out of spec */ + {"200", CPU_K6_3P, fpus_internal, 200000000, 3.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18, 18, 9, 9, 24}, /* out of spec */ + {"233", CPU_K6_3P, fpus_internal, 233333333, 3.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21, 21, 10, 10, 28}, /* out of spec */ + {"266", CPU_K6_3P, fpus_internal, 266666666, 4.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24, 24, 12, 12, 32}, /* out of spec */ + {"300", CPU_K6_3P, fpus_internal, 300000000, 3.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27, 27, 9, 9, 36}, /* out of spec */ + {"333", CPU_K6_3P, fpus_internal, 332500000, 3.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 30, 30, 11, 11, 40}, /* out of spec */ + {"350", CPU_K6_3P, fpus_internal, 350000000, 3.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32, 32, 11, 11, 42}, /* out of spec */ + {"366", CPU_K6_3P, fpus_internal, 366666666, 5.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 33, 33, 17, 17, 44}, /* out of spec */ + {"380", CPU_K6_3P, fpus_internal, 380000000, 4.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 34, 34, 12, 12, 46}, /* out of spec */ + {"400", CPU_K6_3P, fpus_internal, 400000000, 4.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36, 36, 12, 12, 48}, + {"450", CPU_K6_3P, fpus_internal, 450000000, 4.5, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41, 41, 14, 14, 54}, + {"475", CPU_K6_3P, fpus_internal, 475000000, 5.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 43, 43, 15, 15, 57}, + {"500", CPU_K6_3P, fpus_internal, 500000000, 5.0, 2000, 0x5d0, 0x5d0, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 45, 45, 15, 15, 60}, + {"", 0} + } }, #if defined(DEV_BRANCH) && defined(USE_CYRIX_6X86) { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "Cyrix", - .name = "Cx6x86", - .internal_name = "cx6x86", - .cpus = (const CPU[]) { - {"P90", CPU_Cx6x86, fpus_internal, 80000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 8, 8, 6, 6, 10}, - {"PR120+", CPU_Cx6x86, fpus_internal, 100000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10, 6, 6, 12}, - {"PR133+", CPU_Cx6x86, fpus_internal, 110000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10, 6, 6, 14}, - {"PR150+", CPU_Cx6x86, fpus_internal, 120000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 14}, - {"PR166+", CPU_Cx6x86, fpus_internal, 133333333, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, - {"PR200+", CPU_Cx6x86, fpus_internal, 150000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 18}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "Cyrix", + .name = "Cx6x86", + .internal_name = "cx6x86", + .cpus = (const CPU[]) { + {"P90", CPU_Cx6x86, fpus_internal, 80000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 8, 8, 6, 6, 10}, + {"PR120+", CPU_Cx6x86, fpus_internal, 100000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10, 6, 6, 12}, + {"PR133+", CPU_Cx6x86, fpus_internal, 110000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10, 6, 6, 14}, + {"PR150+", CPU_Cx6x86, fpus_internal, 120000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 14}, + {"PR166+", CPU_Cx6x86, fpus_internal, 133333333, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, + {"PR200+", CPU_Cx6x86, fpus_internal, 150000000, 2.0, 3520, 0x520, 0x520, 0x1731, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 18}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "Cyrix", - .name = "Cx6x86L", - .internal_name = "cx6x86l", - .cpus = (const CPU[]) { - {"PR133+", CPU_Cx6x86L, fpus_internal, 110000000, 2.0, 2800, 0x540, 0x540, 0x2231, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10, 6, 6, 14}, - {"PR150+", CPU_Cx6x86L, fpus_internal, 120000000, 2.0, 2800, 0x540, 0x540, 0x2231, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 14}, - {"PR166+", CPU_Cx6x86L, fpus_internal, 133333333, 2.0, 2800, 0x540, 0x540, 0x2231, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, - {"PR200+", CPU_Cx6x86L, fpus_internal, 150000000, 2.0, 2800, 0x540, 0x540, 0x2231, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 18}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "Cyrix", + .name = "Cx6x86L", + .internal_name = "cx6x86l", + .cpus = (const CPU[]) { + {"PR133+", CPU_Cx6x86L, fpus_internal, 110000000, 2.0, 2800, 0x540, 0x540, 0x2231, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10, 6, 6, 14}, + {"PR150+", CPU_Cx6x86L, fpus_internal, 120000000, 2.0, 2800, 0x540, 0x540, 0x2231, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 14}, + {"PR166+", CPU_Cx6x86L, fpus_internal, 133333333, 2.0, 2800, 0x540, 0x540, 0x2231, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, + {"PR200+", CPU_Cx6x86L, fpus_internal, 150000000, 2.0, 2800, 0x540, 0x540, 0x2231, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 18}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "Cyrix", - .name = "Cx6x86MX", - .internal_name = "cx6x86mx", - .cpus = (const CPU[]) { - {"PR166", CPU_Cx6x86MX, fpus_internal, 133333333, 2.0, 2900, 0x600, 0x600, 0x0451, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, - {"PR200", CPU_Cx6x86MX, fpus_internal, 166666666, 2.5, 2900, 0x600, 0x600, 0x0452, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, - {"PR233", CPU_Cx6x86MX, fpus_internal, 187500000, 2.5, 2900, 0x600, 0x600, 0x0452, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 45/2}, - {"PR266", CPU_Cx6x86MX, fpus_internal, 208333333, 2.5, 2700, 0x600, 0x600, 0x0452, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 17,17, 7, 7, 25}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "Cyrix", + .name = "Cx6x86MX", + .internal_name = "cx6x86mx", + .cpus = (const CPU[]) { + {"PR166", CPU_Cx6x86MX, fpus_internal, 133333333, 2.0, 2900, 0x600, 0x600, 0x0451, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, + {"PR200", CPU_Cx6x86MX, fpus_internal, 166666666, 2.5, 2900, 0x600, 0x600, 0x0452, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, + {"PR233", CPU_Cx6x86MX, fpus_internal, 187500000, 2.5, 2900, 0x600, 0x600, 0x0452, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 45/2}, + {"PR266", CPU_Cx6x86MX, fpus_internal, 208333333, 2.5, 2700, 0x600, 0x600, 0x0452, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 17,17, 7, 7, 25}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET5_7, - .manufacturer = "Cyrix", - .name = "MII", - .internal_name = "mii", - .cpus = (const CPU[]) { - {"PR300", CPU_Cx6x86MX, fpus_internal, 233333333, 3.5, 2900, 0x601, 0x601, 0x0852, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,11,11, 28}, - {"PR333", CPU_Cx6x86MX, fpus_internal, 250000000, 3.0, 2900, 0x601, 0x601, 0x0853, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 23,23, 9, 9, 30}, - {"PR366", CPU_Cx6x86MX, fpus_internal, 250000000, 2.5, 2900, 0x601, 0x601, 0x0853, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 23,23, 7, 7, 30}, - {"PR400", CPU_Cx6x86MX, fpus_internal, 285000000, 3.0, 2900, 0x601, 0x601, 0x0853, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27, 9, 9, 34}, - {"PR433", CPU_Cx6x86MX, fpus_internal, 300000000, 3.0, 2900, 0x601, 0x601, 0x0853, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27, 9, 9, 36}, - {"", 0} - } + .package = CPU_PKG_SOCKET5_7, + .manufacturer = "Cyrix", + .name = "MII", + .internal_name = "mii", + .cpus = (const CPU[]) { + {"PR300", CPU_Cx6x86MX, fpus_internal, 233333333, 3.5, 2900, 0x601, 0x601, 0x0852, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,11,11, 28}, + {"PR333", CPU_Cx6x86MX, fpus_internal, 250000000, 3.0, 2900, 0x601, 0x601, 0x0853, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 23,23, 9, 9, 30}, + {"PR366", CPU_Cx6x86MX, fpus_internal, 250000000, 2.5, 2900, 0x601, 0x601, 0x0853, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 23,23, 7, 7, 30}, + {"PR400", CPU_Cx6x86MX, fpus_internal, 285000000, 3.0, 2900, 0x601, 0x601, 0x0853, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27, 9, 9, 34}, + {"PR433", CPU_Cx6x86MX, fpus_internal, 300000000, 3.0, 2900, 0x601, 0x601, 0x0853, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27, 9, 9, 36}, + {"", 0} + } }, #endif { - .package = CPU_PKG_SOCKET8, - .manufacturer = "Intel", - .name = "Pentium Pro", - .internal_name = "pentiumpro", - .cpus = (const CPU[]) { - {"60", CPU_PENTIUMPRO, fpus_internal, 60000000, 1.0, 3100, 0x612, 0x612, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 1, 1, 7}, /* out of spec */ - {"66", CPU_PENTIUMPRO, fpus_internal, 66666666, 1.0, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 1, 1, 8}, /* out of spec */ - {"90", CPU_PENTIUMPRO, fpus_internal, 90000000, 1.5, 3100, 0x612, 0x612, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 3, 3, 11}, /* out of spec */ - {"100", CPU_PENTIUMPRO, fpus_internal, 100000000, 1.5, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 3, 3, 12}, /* out of spec */ - {"120", CPU_PENTIUMPRO, fpus_internal, 120000000, 2.0, 3100, 0x612, 0x612, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 5, 5, 14}, /* out of spec */ - {"133", CPU_PENTIUMPRO, fpus_internal, 133333333, 2.0, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 5, 5, 16}, /* out of spec */ - {"150", CPU_PENTIUMPRO, fpus_internal, 150000000, 2.5, 3100, 0x612, 0x612, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 35/2}, - {"166", CPU_PENTIUMPRO, fpus_internal, 166666666, 2.5, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, - {"180", CPU_PENTIUMPRO, fpus_internal, 180000000, 3.0, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 21}, - {"200", CPU_PENTIUMPRO, fpus_internal, 200000000, 3.0, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, - {"", 0} - } + .package = CPU_PKG_SOCKET8, + .manufacturer = "Intel", + .name = "Pentium Pro", + .internal_name = "pentiumpro", + .cpus = (const CPU[]) { + {"60", CPU_PENTIUMPRO, fpus_internal, 60000000, 1.0, 3100, 0x612, 0x612, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 1, 1, 7}, /* out of spec */ + {"66", CPU_PENTIUMPRO, fpus_internal, 66666666, 1.0, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 1, 1, 8}, /* out of spec */ + {"90", CPU_PENTIUMPRO, fpus_internal, 90000000, 1.5, 3100, 0x612, 0x612, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 3, 3, 11}, /* out of spec */ + {"100", CPU_PENTIUMPRO, fpus_internal, 100000000, 1.5, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 3, 3, 12}, /* out of spec */ + {"120", CPU_PENTIUMPRO, fpus_internal, 120000000, 2.0, 3100, 0x612, 0x612, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 5, 5, 14}, /* out of spec */ + {"133", CPU_PENTIUMPRO, fpus_internal, 133333333, 2.0, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 5, 5, 16}, /* out of spec */ + {"150", CPU_PENTIUMPRO, fpus_internal, 150000000, 2.5, 3100, 0x612, 0x612, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 35/2}, + {"166", CPU_PENTIUMPRO, fpus_internal, 166666666, 2.5, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, + {"180", CPU_PENTIUMPRO, fpus_internal, 180000000, 3.0, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 21}, + {"200", CPU_PENTIUMPRO, fpus_internal, 200000000, 3.0, 3300, 0x617, 0x617, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET8, - .manufacturer = "Intel", - .name = "Pentium II OverDrive", - .internal_name = "pentium2_od", - .cpus = (const CPU[]) { - {"66", CPU_PENTIUM2D, fpus_internal, 66666666, 1.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6, 3, 3, 8}, /* out of spec */ - {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.5, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 9, 9, 4, 4, 12}, /* out of spec */ - {"133", CPU_PENTIUM2D, fpus_internal, 133333333, 2.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12, 6, 6, 16}, /* out of spec */ - {"166", CPU_PENTIUM2D, fpus_internal, 166666666, 2.5, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15, 7, 7, 20}, /* out of spec */ - {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 3.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 18,18, 9, 9, 24}, /* out of spec */ - {"233", CPU_PENTIUM2D, fpus_internal, 233333333, 3.5, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 21,21,10,10, 28}, /* out of spec */ - {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 24,24,12,12, 32}, /* out of spec */ - {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 5.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 27,27,13,13, 36}, - {"333", CPU_PENTIUM2D, fpus_internal, 333333333, 5.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 27,27,13,13, 40}, - {"", 0} - } + .package = CPU_PKG_SOCKET8, + .manufacturer = "Intel", + .name = "Pentium II OverDrive", + .internal_name = "pentium2_od", + .cpus = (const CPU[]) { + {"66", CPU_PENTIUM2D, fpus_internal, 66666666, 1.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6, 3, 3, 8}, /* out of spec */ + {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.5, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 9, 9, 4, 4, 12}, /* out of spec */ + {"133", CPU_PENTIUM2D, fpus_internal, 133333333, 2.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 12,12, 6, 6, 16}, /* out of spec */ + {"166", CPU_PENTIUM2D, fpus_internal, 166666666, 2.5, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 15,15, 7, 7, 20}, /* out of spec */ + {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 3.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 18,18, 9, 9, 24}, /* out of spec */ + {"233", CPU_PENTIUM2D, fpus_internal, 233333333, 3.5, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 21,21,10,10, 28}, /* out of spec */ + {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 24,24,12,12, 32}, /* out of spec */ + {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 5.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 27,27,13,13, 36}, + {"333", CPU_PENTIUM2D, fpus_internal, 333333333, 5.0, 3300, 0x1632, 0x1632, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 27,27,13,13, 40}, + {"", 0} + } }, { - .package = CPU_PKG_SLOT1, - .manufacturer = "Intel", - .name = "Pentium II (Klamath)", - .internal_name = "pentium2_klamath", - .cpus = (const CPU[]) { - {"66", CPU_PENTIUM2, fpus_internal, 66666666, 1.0, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 3, 3, 8}, /* out of spec */ - {"100", CPU_PENTIUM2, fpus_internal, 100000000, 1.5, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ - {"133", CPU_PENTIUM2, fpus_internal, 133333333, 2.0, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, /* out of spec */ - {"166", CPU_PENTIUM2, fpus_internal, 166666666, 2.5, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, /* out of spec */ - {"200", CPU_PENTIUM2, fpus_internal, 200000000, 3.0, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, /* out of spec */ - {"233", CPU_PENTIUM2, fpus_internal, 233333333, 3.5, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, - {"266", CPU_PENTIUM2, fpus_internal, 266666666, 4.0, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, - {"300", CPU_PENTIUM2, fpus_internal, 300000000, 4.5, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,12,12, 36}, - {"", 0} - } + .package = CPU_PKG_SLOT1, + .manufacturer = "Intel", + .name = "Pentium II (Klamath)", + .internal_name = "pentium2_klamath", + .cpus = (const CPU[]) { + {"66", CPU_PENTIUM2, fpus_internal, 66666666, 1.0, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 3, 3, 8}, /* out of spec */ + {"100", CPU_PENTIUM2, fpus_internal, 100000000, 1.5, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 4, 4, 12}, /* out of spec */ + {"133", CPU_PENTIUM2, fpus_internal, 133333333, 2.0, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, /* out of spec */ + {"166", CPU_PENTIUM2, fpus_internal, 166666666, 2.5, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, /* out of spec */ + {"200", CPU_PENTIUM2, fpus_internal, 200000000, 3.0, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, /* out of spec */ + {"233", CPU_PENTIUM2, fpus_internal, 233333333, 3.5, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,10,10, 28}, + {"266", CPU_PENTIUM2, fpus_internal, 266666666, 4.0, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, + {"300", CPU_PENTIUM2, fpus_internal, 300000000, 4.5, 2800, 0x634, 0x634, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,12,12, 36}, + {"", 0} + } }, { - .package = CPU_PKG_SLOT1, - .manufacturer = "Intel", - .name = "Pentium II (Deschutes)", - .internal_name = "pentium2_deschutes", - .cpus = (const CPU[]) { - {"66", CPU_PENTIUM2D, fpus_internal, 66666666, 1.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 3, 3, 8}, /* out of spec */ - {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 5, 5, 12}, /* out of spec */ - {"133", CPU_PENTIUM2D, fpus_internal, 133333333, 2.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, /* out of spec */ - {"166", CPU_PENTIUM2D, fpus_internal, 166666666, 2.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, /* out of spec */ - {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 3.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, /* out of spec */ - {"233", CPU_PENTIUM2D, fpus_internal, 233333333, 3.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,11,11, 28}, /* out of spec */ - {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, - {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,12,12, 36}, - {"333", CPU_PENTIUM2D, fpus_internal, 333333333, 5.0, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27,13,13, 40}, - {"350", CPU_PENTIUM2D, fpus_internal, 350000000, 3.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32,32,11,11, 42}, - {"400", CPU_PENTIUM2D, fpus_internal, 400000000, 4.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36,36,12,12, 48}, - {"450", CPU_PENTIUM2D, fpus_internal, 450000000, 4.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41,41,14,14, 54}, - {"", 0} - } + .package = CPU_PKG_SLOT1, + .manufacturer = "Intel", + .name = "Pentium II (Deschutes)", + .internal_name = "pentium2_deschutes", + .cpus = (const CPU[]) { + {"66", CPU_PENTIUM2D, fpus_internal, 66666666, 1.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 3, 3, 8}, /* out of spec */ + {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 5, 5, 12}, /* out of spec */ + {"133", CPU_PENTIUM2D, fpus_internal, 133333333, 2.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12, 6, 6, 16}, /* out of spec */ + {"166", CPU_PENTIUM2D, fpus_internal, 166666666, 2.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15, 7, 7, 20}, /* out of spec */ + {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 3.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 9, 9, 24}, /* out of spec */ + {"233", CPU_PENTIUM2D, fpus_internal, 233333333, 3.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,11,11, 28}, /* out of spec */ + {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,12,12, 32}, + {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,12,12, 36}, + {"333", CPU_PENTIUM2D, fpus_internal, 333333333, 5.0, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27,13,13, 40}, + {"350", CPU_PENTIUM2D, fpus_internal, 350000000, 3.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32,32,11,11, 42}, + {"400", CPU_PENTIUM2D, fpus_internal, 400000000, 4.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36,36,12,12, 48}, + {"450", CPU_PENTIUM2D, fpus_internal, 450000000, 4.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41,41,14,14, 54}, + {"", 0} + } }, { - .package = CPU_PKG_SLOT1, - .manufacturer = "Intel", - .name = "Celeron (Covington)", - .internal_name = "celeron_covington", - .cpus = (const CPU[]) { - {"66", CPU_PENTIUM2D, fpus_internal, 66666666, 1.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 6, 6, 8}, /* out of spec */ - {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 9, 9, 12}, /* out of spec */ - {"133", CPU_PENTIUM2D, fpus_internal, 133333333, 2.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,12,12, 16}, /* out of spec */ - {"166", CPU_PENTIUM2D, fpus_internal, 166666666, 2.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15,15,15, 20}, /* out of spec */ - {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 3.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18,18,18, 24}, /* out of spec */ - {"233", CPU_PENTIUM2D, fpus_internal, 233333333, 3.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,21,21, 28}, /* out of spec */ - {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x650, 0x650, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,24,24, 32}, - {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,25,25, 36}, - {"", 0} - } + .package = CPU_PKG_SLOT1, + .manufacturer = "Intel", + .name = "Celeron (Covington)", + .internal_name = "celeron_covington", + .cpus = (const CPU[]) { + {"66", CPU_PENTIUM2D, fpus_internal, 66666666, 1.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 6, 6, 6, 6, 8}, /* out of spec */ + {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 9, 9, 12}, /* out of spec */ + {"133", CPU_PENTIUM2D, fpus_internal, 133333333, 2.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,12,12, 16}, /* out of spec */ + {"166", CPU_PENTIUM2D, fpus_internal, 166666666, 2.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 15,15,15,15, 20}, /* out of spec */ + {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 3.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18,18,18, 24}, /* out of spec */ + {"233", CPU_PENTIUM2D, fpus_internal, 233333333, 3.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 21,21,21,21, 28}, /* out of spec */ + {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x650, 0x650, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 24,24,24,24, 32}, + {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x651, 0x651, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 25,25,25,25, 36}, + {"", 0} + } }, { - .package = CPU_PKG_SLOT2, - .manufacturer = "Intel", - .name = "Pentium II Xeon", - .internal_name = "pentium2_xeon", - .cpus = (const CPU[]) { - {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 3, 3, 12}, /* out of spec */ - {"150", CPU_PENTIUM2D, fpus_internal, 150000000, 1.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 14,14, 4, 4, 18}, /* out of spec */ - {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 2.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 6, 6, 24}, /* out of spec */ - {"250", CPU_PENTIUM2D, fpus_internal, 250000000, 2.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 22,22, 7, 7, 30}, /* out of spec */ - {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 3.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27, 9, 9, 36}, /* out of spec */ - {"350", CPU_PENTIUM2D, fpus_internal, 350000000, 3.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32,32,10,10, 42}, /* out of spec */ - {"400", CPU_PENTIUM2D, fpus_internal, 400000000, 4.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36,36,12,12, 48}, - {"450", CPU_PENTIUM2D, fpus_internal, 450000000, 4.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41,41,14,14, 54}, - {"", 0} - } + .package = CPU_PKG_SLOT2, + .manufacturer = "Intel", + .name = "Pentium II Xeon", + .internal_name = "pentium2_xeon", + .cpus = (const CPU[]) { + {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9, 3, 3, 12}, /* out of spec */ + {"150", CPU_PENTIUM2D, fpus_internal, 150000000, 1.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 14,14, 4, 4, 18}, /* out of spec */ + {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 2.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 18,18, 6, 6, 24}, /* out of spec */ + {"250", CPU_PENTIUM2D, fpus_internal, 250000000, 2.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 22,22, 7, 7, 30}, /* out of spec */ + {"300", CPU_PENTIUM2D, fpus_internal, 300000000, 3.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 27,27, 9, 9, 36}, /* out of spec */ + {"350", CPU_PENTIUM2D, fpus_internal, 350000000, 3.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 32,32,10,10, 42}, /* out of spec */ + {"400", CPU_PENTIUM2D, fpus_internal, 400000000, 4.0, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 36,36,12,12, 48}, + {"450", CPU_PENTIUM2D, fpus_internal, 450000000, 4.5, 2050, 0x652, 0x652, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 41,41,14,14, 54}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET370, - .manufacturer = "Intel", - .name = "Celeron (Mendocino)", - .internal_name = "celeron_mendocino", - .cpus = (const CPU[]) { - {"66", CPU_PENTIUM2D, fpus_internal, 66666666, 1.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6, 3, 3, 8}, /* out of spec */ - {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 8, 8, 4, 4, 12}, /* out of spec */ - {"133", CPU_PENTIUM2D, fpus_internal, 133333333, 2.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 11,11, 5, 5, 16}, /* out of spec */ - {"166", CPU_PENTIUM2D, fpus_internal, 166666666, 2.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 14,14, 7, 7, 20}, /* out of spec */ - {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 3.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 17,17, 8, 8, 24}, /* out of spec */ - {"233", CPU_PENTIUM2D, fpus_internal, 233333333, 3.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 19,19, 9, 9, 28}, /* out of spec */ - {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 22,22,11,11, 32}, /* out of spec */ - {"300A", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 25,25,12,12, 36}, - {"333", CPU_PENTIUM2D, fpus_internal, 333333333, 5.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 27,27,13,13, 40}, - {"366", CPU_PENTIUM2D, fpus_internal, 366666666, 5.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 33,33,17,17, 44}, - {"400", CPU_PENTIUM2D, fpus_internal, 400000000, 6.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 36,36,12,12, 48}, - {"433", CPU_PENTIUM2D, fpus_internal, 433333333, 6.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 39,39,13,13, 51}, - {"466", CPU_PENTIUM2D, fpus_internal, 466666666, 7.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 42,42,14,14, 56}, - {"500", CPU_PENTIUM2D, fpus_internal, 500000000, 7.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 45,45,15,15, 60}, - {"533", CPU_PENTIUM2D, fpus_internal, 533333333, 8.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 48,48,17,17, 64}, - {"", 0} - } + .package = CPU_PKG_SOCKET370, + .manufacturer = "Intel", + .name = "Celeron (Mendocino)", + .internal_name = "celeron_mendocino", + .cpus = (const CPU[]) { + {"66", CPU_PENTIUM2D, fpus_internal, 66666666, 1.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6, 3, 3, 8}, /* out of spec */ + {"100", CPU_PENTIUM2D, fpus_internal, 100000000, 1.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 8, 8, 4, 4, 12}, /* out of spec */ + {"133", CPU_PENTIUM2D, fpus_internal, 133333333, 2.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 11,11, 5, 5, 16}, /* out of spec */ + {"166", CPU_PENTIUM2D, fpus_internal, 166666666, 2.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 14,14, 7, 7, 20}, /* out of spec */ + {"200", CPU_PENTIUM2D, fpus_internal, 200000000, 3.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 17,17, 8, 8, 24}, /* out of spec */ + {"233", CPU_PENTIUM2D, fpus_internal, 233333333, 3.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 19,19, 9, 9, 28}, /* out of spec */ + {"266", CPU_PENTIUM2D, fpus_internal, 266666666, 4.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 22,22,11,11, 32}, /* out of spec */ + {"300A", CPU_PENTIUM2D, fpus_internal, 300000000, 4.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 25,25,12,12, 36}, + {"333", CPU_PENTIUM2D, fpus_internal, 333333333, 5.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 27,27,13,13, 40}, + {"366", CPU_PENTIUM2D, fpus_internal, 366666666, 5.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 33,33,17,17, 44}, + {"400", CPU_PENTIUM2D, fpus_internal, 400000000, 6.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 36,36,12,12, 48}, + {"433", CPU_PENTIUM2D, fpus_internal, 433333333, 6.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 39,39,13,13, 51}, + {"466", CPU_PENTIUM2D, fpus_internal, 466666666, 7.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 42,42,14,14, 56}, + {"500", CPU_PENTIUM2D, fpus_internal, 500000000, 7.5, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 45,45,15,15, 60}, + {"533", CPU_PENTIUM2D, fpus_internal, 533333333, 8.0, 2050, 0x665, 0x665, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC | CPU_FIXED_MULTIPLIER, 48,48,17,17, 64}, + {"", 0} + } }, { - .package = CPU_PKG_SOCKET370, - .manufacturer = "VIA", - .name = "Cyrix III", - .internal_name = "c3_samuel", - .cpus = (const CPU[]) { - {"66", CPU_CYRIX3S, fpus_internal, 66666666, 1.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6, 3, 3, 8}, /* out of multiplier range */ - {"100", CPU_CYRIX3S, fpus_internal, 100000000, 1.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 9, 9, 4, 4, 12}, /* out of multiplier range */ - {"133", CPU_CYRIX3S, fpus_internal, 133333333, 2.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 12, 12, 6, 6, 16}, /* out of multiplier range */ - {"166", CPU_CYRIX3S, fpus_internal, 166666666, 2.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 15, 15, 7, 7, 20}, /* out of multiplier range */ - {"200", CPU_CYRIX3S, fpus_internal, 200000000, 3.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 18, 18, 8, 8, 24}, /* out of multiplier range */ - {"233", CPU_CYRIX3S, fpus_internal, 233333333, 3.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 21, 21, 9, 9, 28}, /* out of multiplier range */ - {"266", CPU_CYRIX3S, fpus_internal, 266666666, 4.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 24, 24, 12, 12, 32}, /* out of multiplier range */ - {"300", CPU_CYRIX3S, fpus_internal, 300000000, 4.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 27, 27, 13, 13, 36}, /* out of spec */ - {"333", CPU_CYRIX3S, fpus_internal, 333333333, 5.0, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 30, 30, 15, 15, 40}, /* out of spec */ - {"366", CPU_CYRIX3S, fpus_internal, 366666666, 5.5, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 33, 33, 16, 16, 44}, /* out of spec */ - {"400", CPU_CYRIX3S, fpus_internal, 400000000, 6.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 36, 36, 17, 17, 48}, - {"433", CPU_CYRIX3S, fpus_internal, 433333333, 6.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 39, 39, 18, 18, 52}, /* out of spec */ - {"450", CPU_CYRIX3S, fpus_internal, 450000000, 4.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 41, 41, 14, 14, 54}, - {"466", CPU_CYRIX3S, fpus_internal, 466666666, 6.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 42, 42, 14, 14, 56}, /* out of spec */ - {"500", CPU_CYRIX3S, fpus_internal, 500000000, 5.0, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 45, 45, 15, 15, 60}, - {"533", CPU_CYRIX3S, fpus_internal, 533333333, 8.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 48, 48, 15, 15, 64}, /* out of spec */ - {"550", CPU_CYRIX3S, fpus_internal, 550000000, 5.5, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 50, 50, 17, 17, 66}, - {"600/100", CPU_CYRIX3S, fpus_internal, 600000000, 6.0, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 54, 54, 18, 18, 72}, - {"600/133", CPU_CYRIX3S, fpus_internal, 600000000, 4.5, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 54, 54, 13, 13, 72}, - {"650", CPU_CYRIX3S, fpus_internal, 650000000, 6.5, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 58, 58, 20, 20, 78}, - {"667", CPU_CYRIX3S, fpus_internal, 666666667, 5.0, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 60, 60, 16, 16, 80}, - {"700", CPU_CYRIX3S, fpus_internal, 700000000, 7.0, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 63, 63, 21, 21, 84}, - {"733", CPU_CYRIX3S, fpus_internal, 733333333, 5.5, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 66, 66, 18, 18, 88}, - {"", 0} - } + .package = CPU_PKG_SOCKET370, + .manufacturer = "VIA", + .name = "Cyrix III", + .internal_name = "c3_samuel", + .cpus = (const CPU[]) { + {"66", CPU_CYRIX3S, fpus_internal, 66666666, 1.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 6, 6, 3, 3, 8}, /* out of multiplier range */ + {"100", CPU_CYRIX3S, fpus_internal, 100000000, 1.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 9, 9, 4, 4, 12}, /* out of multiplier range */ + {"133", CPU_CYRIX3S, fpus_internal, 133333333, 2.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 12, 12, 6, 6, 16}, /* out of multiplier range */ + {"166", CPU_CYRIX3S, fpus_internal, 166666666, 2.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 15, 15, 7, 7, 20}, /* out of multiplier range */ + {"200", CPU_CYRIX3S, fpus_internal, 200000000, 3.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 18, 18, 8, 8, 24}, /* out of multiplier range */ + {"233", CPU_CYRIX3S, fpus_internal, 233333333, 3.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 21, 21, 9, 9, 28}, /* out of multiplier range */ + {"266", CPU_CYRIX3S, fpus_internal, 266666666, 4.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 24, 24, 12, 12, 32}, /* out of multiplier range */ + {"300", CPU_CYRIX3S, fpus_internal, 300000000, 4.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 27, 27, 13, 13, 36}, /* out of spec */ + {"333", CPU_CYRIX3S, fpus_internal, 333333333, 5.0, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 30, 30, 15, 15, 40}, /* out of spec */ + {"366", CPU_CYRIX3S, fpus_internal, 366666666, 5.5, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 33, 33, 16, 16, 44}, /* out of spec */ + {"400", CPU_CYRIX3S, fpus_internal, 400000000, 6.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 36, 36, 17, 17, 48}, + {"433", CPU_CYRIX3S, fpus_internal, 433333333, 6.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 39, 39, 18, 18, 52}, /* out of spec */ + {"450", CPU_CYRIX3S, fpus_internal, 450000000, 4.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 41, 41, 14, 14, 54}, + {"466", CPU_CYRIX3S, fpus_internal, 466666666, 6.5, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 42, 42, 14, 14, 56}, /* out of spec */ + {"500", CPU_CYRIX3S, fpus_internal, 500000000, 5.0, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 45, 45, 15, 15, 60}, + {"533", CPU_CYRIX3S, fpus_internal, 533333333, 8.0, 2050, 0x660, 0x660, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 48, 48, 15, 15, 64}, /* out of spec */ + {"550", CPU_CYRIX3S, fpus_internal, 550000000, 5.5, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 50, 50, 17, 17, 66}, + {"600/100", CPU_CYRIX3S, fpus_internal, 600000000, 6.0, 2050, 0x662, 0x662, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 54, 54, 18, 18, 72}, + {"600/133", CPU_CYRIX3S, fpus_internal, 600000000, 4.5, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 54, 54, 13, 13, 72}, + {"650", CPU_CYRIX3S, fpus_internal, 650000000, 6.5, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 58, 58, 20, 20, 78}, + {"667", CPU_CYRIX3S, fpus_internal, 666666667, 5.0, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 60, 60, 16, 16, 80}, + {"700", CPU_CYRIX3S, fpus_internal, 700000000, 7.0, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 63, 63, 21, 21, 84}, + {"733", CPU_CYRIX3S, fpus_internal, 733333333, 5.5, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 66, 66, 18, 18, 88}, + {"", 0} + } }, { - .package = 0, + .package = 0, } // clang-format on }; diff --git a/src/cpu/fpu.c b/src/cpu/fpu.c index f75d07231..0af010760 100644 --- a/src/cpu/fpu.c +++ b/src/cpu/fpu.c @@ -8,7 +8,7 @@ * * FPU type handler. * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2018 Sarah Walker. diff --git a/src/cpu/x86_ops.h b/src/cpu/x86_ops.h index a5e82d78e..ca4d83d69 100644 --- a/src/cpu/x86_ops.h +++ b/src/cpu/x86_ops.h @@ -11,7 +11,7 @@ * * * Authors: Fred N. van Kempen, - * Sarah Walker, + * Sarah Walker, * Miran Grca, * * Copyright 2018 Fred N. van Kempen. diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index c1e9e5b3d..5b0d8b73a 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2018 Sarah Walker. diff --git a/src/cpu/x87_ops.h b/src/cpu/x87_ops.h index ce4a4becc..c00cdff16 100644 --- a/src/cpu/x87_ops.h +++ b/src/cpu/x87_ops.h @@ -11,7 +11,7 @@ * * * Authors: Fred N. van Kempen, - * Sarah Walker, + * Sarah Walker, * leilei, * Miran Grca, * diff --git a/src/cpu/x87_ops_loadstore.h b/src/cpu/x87_ops_loadstore.h index 8d3c3f700..9cec01490 100644 --- a/src/cpu/x87_ops_loadstore.h +++ b/src/cpu/x87_ops_loadstore.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. diff --git a/src/crcspeed/crc64speed.c b/src/crcspeed/crc64speed.c index b1a7bbb94..e4cccdc69 100644 --- a/src/crcspeed/crc64speed.c +++ b/src/crcspeed/crc64speed.c @@ -124,7 +124,7 @@ static inline uint_fast64_t crc_reflect(uint_fast64_t data, size_t data_len) { * \return The updated crc value. ******************************************************************************/ uint64_t crc64(uint_fast64_t crc, const void *in_data, const uint64_t len) { - const uint8_t *data = in_data; + const uint8_t *data = (uint8_t *) in_data; bool bit; for (uint64_t offset = 0; offset < len; offset++) { @@ -152,7 +152,7 @@ uint64_t crc64(uint_fast64_t crc, const void *in_data, const uint64_t len) { /* Only for testing; doesn't support DUAL */ uint64_t crc64_lookup(uint64_t crc, const void *in_data, const uint64_t len) { - const uint8_t *data = in_data; + const uint8_t *data = (uint8_t *) in_data; for (size_t i = 0; i < len; i++) { crc = crc64_table[0][(uint8_t)crc ^ data[i]] ^ (crc >> 8); } @@ -167,7 +167,7 @@ bool crc64speed_init(void) { #else should_init(crc64_table_little, LITTLE1); #endif - crcspeed64little_init(crc64, dual ? crc64_table_little : crc64_table); + crcspeed64little_init(crc64, dual ? (uint64_t (*)[256]) crc64_table_little : crc64_table); return true; } @@ -178,7 +178,7 @@ bool crc64speed_init_big(void) { #else should_init(crc64_table_big, BIG1); #endif - crcspeed64big_init(crc64, dual ? crc64_table_big : crc64_table); + crcspeed64big_init(crc64, dual ? (uint64_t (*)[256]) crc64_table_big : crc64_table); return true; } @@ -189,7 +189,7 @@ uint64_t crc64speed(uint64_t crc, const void *s, const uint64_t l) { #else check_init(crc64_table_little, LITTLE1); #endif - return crcspeed64little(dual ? crc64_table_little : crc64_table, crc, + return crcspeed64little(dual ? (uint64_t (*)[256]) crc64_table_little : crc64_table, crc, (void *)s, l); } @@ -200,7 +200,7 @@ uint64_t crc64speed_big(uint64_t crc, const void *s, const uint64_t l) { #else check_init(crc64_table_big, BIG1); #endif - return crcspeed64big(dual ? crc64_table_big : crc64_table, crc, (void *)s, + return crcspeed64big(dual ? (uint64_t (*)[256]) crc64_table_big : crc64_table, crc, (void *)s, l); } diff --git a/src/device.c b/src/device.c index 95c62624c..25556eaff 100644 --- a/src/device.c +++ b/src/device.c @@ -13,7 +13,7 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2017-2019 Fred N. van Kempen. * Copyright 2016-2019 Miran Grca. diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt index 27e854387..5e9cdec07 100644 --- a/src/device/CMakeLists.txt +++ b/src/device/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(dev OBJECT bugger.c cassette.c cartridge.c hasp.c hwm.c hwm_lm75.c hwm_lm78.c hwm_gl518sm.c diff --git a/src/device/keyboard.c b/src/device/keyboard.c index a5503cc3b..74bf3f67e 100644 --- a/src/device/keyboard.c +++ b/src/device/keyboard.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index 542be0a24..c71213aa6 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -10,10 +10,10 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, - * EngiNerd + * EngiNerd, * * Copyright 2008-2020 Sarah Walker. * Copyright 2016-2020 Miran Grca. @@ -1291,8 +1291,8 @@ write64_generic(void *priv, uint8_t val) } else { if (((dev->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_NOREF) && ((dev->flags & KBC_VEN_MASK) != KBC_VEN_INTEL_AMI)) #if 0 - add_to_kbc_queue_front(dev, (dev->input_port | fixed_bits) & - (((dev->flags & KBC_VEN_MASK) == KBC_VEN_ACER) ? 0xeb : 0xef), 0, 0x00); + add_to_kbc_queue_front(dev, (dev->input_port | fixed_bits) & + (((dev->flags & KBC_VEN_MASK) == KBC_VEN_ACER) ? 0xeb : 0xef), 0, 0x00); #else add_to_kbc_queue_front(dev, ((dev->input_port | fixed_bits) & 0xf0) | (((dev->flags & KBC_VEN_MASK) == KBC_VEN_ACER) ? 0x08 : 0x0c), 0, 0x00); #endif @@ -1947,7 +1947,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv) val &= ~0x0c; val |= (dev->output_port & 0x0c); } - write_output(dev, val); + write_output(dev, val | 0x01); break; case 0xd2: /* write to keyboard output buffer */ @@ -2491,7 +2491,7 @@ kbd_init(const device_t *info) dev->flags = info->local; - video_reset(gfxcard); + video_reset(gfxcard[0]); kbd_reset(dev); io_sethandler(0x0060, 1, kbd_read, NULL, NULL, kbd_write, NULL, NULL, dev); diff --git a/src/device/keyboard_xt.c b/src/device/keyboard_xt.c index f6d02a4d4..fe523cd2f 100644 --- a/src/device/keyboard_xt.c +++ b/src/device/keyboard_xt.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * EngiNerd, @@ -126,219 +126,219 @@ const scancode scancode_xt[512] = { { {0x50, 0}, {0xd0, 0} }, { {0x51, 0}, {0xd1, 0} }, { {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*054*/ + { {0}, {0} }, { {0}, {0} }, /*054*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*058*/ + { {0}, {0} }, { {0}, {0} }, /*058*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*05c*/ + { {0}, {0} }, { {0}, {0} }, /*05c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*060*/ + { {0}, {0} }, { {0}, {0} }, /*060*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*064*/ + { {0}, {0} }, { {0}, {0} }, /*064*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*068*/ + { {0}, {0} }, { {0}, {0} }, /*068*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*06c*/ + { {0}, {0} }, { {0}, {0} }, /*06c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*070*/ + { {0}, {0} }, { {0}, {0} }, /*070*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*074*/ + { {0}, {0} }, { {0}, {0} }, /*074*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*078*/ + { {0}, {0} }, { {0}, {0} }, /*078*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*07c*/ + { {0}, {0} }, { {0}, {0} }, /*07c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*080*/ + { {0}, {0} }, { {0}, {0} }, /*080*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*084*/ + { {0}, {0} }, { {0}, {0} }, /*084*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*088*/ + { {0}, {0} }, { {0}, {0} }, /*088*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*08c*/ + { {0}, {0} }, { {0}, {0} }, /*08c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*090*/ + { {0}, {0} }, { {0}, {0} }, /*090*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*094*/ + { {0}, {0} }, { {0}, {0} }, /*094*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*098*/ + { {0}, {0} }, { {0}, {0} }, /*098*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*09c*/ + { {0}, {0} }, { {0}, {0} }, /*09c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a0*/ + { {0}, {0} }, { {0}, {0} }, /*0a0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a4*/ + { {0}, {0} }, { {0}, {0} }, /*0a4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a8*/ + { {0}, {0} }, { {0}, {0} }, /*0a8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0ac*/ + { {0}, {0} }, { {0}, {0} }, /*0ac*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b0*/ + { {0}, {0} }, { {0}, {0} }, /*0b0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b4*/ + { {0}, {0} }, { {0}, {0} }, /*0b4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b8*/ + { {0}, {0} }, { {0}, {0} }, /*0b8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0bc*/ + { {0}, {0} }, { {0}, {0} }, /*0bc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c0*/ + { {0}, {0} }, { {0}, {0} }, /*0c0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c4*/ + { {0}, {0} }, { {0}, {0} }, /*0c4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c8*/ + { {0}, {0} }, { {0}, {0} }, /*0c8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0cc*/ + { {0}, {0} }, { {0}, {0} }, /*0cc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d0*/ + { {0}, {0} }, { {0}, {0} }, /*0d0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d4*/ + { {0}, {0} }, { {0}, {0} }, /*0d4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d8*/ + { {0}, {0} }, { {0}, {0} }, /*0d8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0dc*/ + { {0}, {0} }, { {0}, {0} }, /*0dc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e0*/ + { {0}, {0} }, { {0}, {0} }, /*0e0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e4*/ + { {0}, {0} }, { {0}, {0} }, /*0e4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e8*/ + { {0}, {0} }, { {0}, {0} }, /*0e8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0ec*/ + { {0}, {0} }, { {0}, {0} }, /*0ec*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f0*/ + { {0}, {0} }, { {0}, {0} }, /*0f0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f4*/ + { {0}, {0} }, { {0}, {0} }, /*0f4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f8*/ + { {0}, {0} }, { {0}, {0} }, /*0f8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0fc*/ + { {0}, {0} }, { {0}, {0} }, /*0fc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*100*/ + { {0}, {0} }, { {0}, {0} }, /*100*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*104*/ + { {0}, {0} }, { {0}, {0} }, /*104*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*108*/ + { {0}, {0} }, { {0}, {0} }, /*108*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*10c*/ + { {0}, {0} }, { {0}, {0} }, /*10c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*110*/ + { {0}, {0} }, { {0}, {0} }, /*110*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*114*/ + { {0}, {0} }, { {0}, {0} }, /*114*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*118*/ + { {0}, {0} }, { {0}, {0} }, /*118*/ { {0x1c, 0}, {0x9c, 0} }, { {0x1d, 0}, {0x9d, 0} }, - { {0}, {0} }, { {0}, {0} }, /*11c*/ + { {0}, {0} }, { {0}, {0} }, /*11c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*120*/ + { {0}, {0} }, { {0}, {0} }, /*120*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*124*/ + { {0}, {0} }, { {0}, {0} }, /*124*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*128*/ + { {0}, {0} }, { {0}, {0} }, /*128*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*12c*/ + { {0}, {0} }, { {0}, {0} }, /*12c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*130*/ + { {0}, {0} }, { {0}, {0} }, /*130*/ { {0}, {0} }, { {0x35, 0}, {0xb5, 0} }, - { {0}, {0} }, { {0x37, 0}, {0xb7, 0} }, /*134*/ + { {0}, {0} }, { {0x37, 0}, {0xb7, 0} }, /*134*/ { {0x38, 0}, {0xb8, 0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*138*/ + { {0}, {0} }, { {0}, {0} }, /*138*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*13c*/ + { {0}, {0} }, { {0}, {0} }, /*13c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*140*/ + { {0}, {0} }, { {0}, {0} }, /*140*/ { {0}, {0} }, { {0}, {0} }, - { {0x46, 0}, {0xc6, 0} }, { {0x47, 0}, {0xc7, 0} }, /*144*/ + { {0x46, 0}, {0xc6, 0} }, { {0x47, 0}, {0xc7, 0} }, /*144*/ { {0x48, 0}, {0xc8, 0} }, { {0x49, 0}, {0xc9, 0} }, - { {0}, {0} }, { {0x4b, 0}, {0xcb, 0} }, /*148*/ + { {0}, {0} }, { {0x4b, 0}, {0xcb, 0} }, /*148*/ { {0}, {0} }, { {0x4d, 0}, {0xcd, 0} }, - { {0}, {0} }, { {0x4f, 0}, {0xcf, 0} }, /*14c*/ + { {0}, {0} }, { {0x4f, 0}, {0xcf, 0} }, /*14c*/ { {0x50, 0}, {0xd0, 0} }, { {0x51, 0}, {0xd1, 0} }, - { {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, /*150*/ + { {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, /*150*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*154*/ + { {0}, {0} }, { {0}, {0} }, /*154*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*158*/ + { {0}, {0} }, { {0}, {0} }, /*158*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*15c*/ + { {0}, {0} }, { {0}, {0} }, /*15c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*160*/ + { {0}, {0} }, { {0}, {0} }, /*160*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*164*/ + { {0}, {0} }, { {0}, {0} }, /*164*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*168*/ + { {0}, {0} }, { {0}, {0} }, /*168*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*16c*/ + { {0}, {0} }, { {0}, {0} }, /*16c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*170*/ + { {0}, {0} }, { {0}, {0} }, /*170*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*174*/ + { {0}, {0} }, { {0}, {0} }, /*174*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*148*/ + { {0}, {0} }, { {0}, {0} }, /*148*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*17c*/ + { {0}, {0} }, { {0}, {0} }, /*17c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*180*/ + { {0}, {0} }, { {0}, {0} }, /*180*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*184*/ + { {0}, {0} }, { {0}, {0} }, /*184*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*88*/ + { {0}, {0} }, { {0}, {0} }, /*88*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*18c*/ + { {0}, {0} }, { {0}, {0} }, /*18c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*190*/ + { {0}, {0} }, { {0}, {0} }, /*190*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*194*/ + { {0}, {0} }, { {0}, {0} }, /*194*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*198*/ + { {0}, {0} }, { {0}, {0} }, /*198*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*19c*/ + { {0}, {0} }, { {0}, {0} }, /*19c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a0*/ + { {0}, {0} }, { {0}, {0} }, /*1a0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a4*/ + { {0}, {0} }, { {0}, {0} }, /*1a4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a8*/ + { {0}, {0} }, { {0}, {0} }, /*1a8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1ac*/ + { {0}, {0} }, { {0}, {0} }, /*1ac*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b0*/ + { {0}, {0} }, { {0}, {0} }, /*1b0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b4*/ + { {0}, {0} }, { {0}, {0} }, /*1b4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b8*/ + { {0}, {0} }, { {0}, {0} }, /*1b8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1bc*/ + { {0}, {0} }, { {0}, {0} }, /*1bc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c0*/ + { {0}, {0} }, { {0}, {0} }, /*1c0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c4*/ + { {0}, {0} }, { {0}, {0} }, /*1c4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c8*/ + { {0}, {0} }, { {0}, {0} }, /*1c8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1cc*/ + { {0}, {0} }, { {0}, {0} }, /*1cc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d0*/ + { {0}, {0} }, { {0}, {0} }, /*1d0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d4*/ + { {0}, {0} }, { {0}, {0} }, /*1d4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d8*/ + { {0}, {0} }, { {0}, {0} }, /*1d8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1dc*/ + { {0}, {0} }, { {0}, {0} }, /*1dc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e0*/ + { {0}, {0} }, { {0}, {0} }, /*1e0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e4*/ + { {0}, {0} }, { {0}, {0} }, /*1e4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e8*/ + { {0}, {0} }, { {0}, {0} }, /*1e8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1ec*/ + { {0}, {0} }, { {0}, {0} }, /*1ec*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f0*/ + { {0}, {0} }, { {0}, {0} }, /*1f0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f4*/ + { {0}, {0} }, { {0}, {0} }, /*1f4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f8*/ + { {0}, {0} }, { {0}, {0} }, /*1f8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} } /*1fc*/ + { {0}, {0} }, { {0}, {0} } /*1fc*/ // clang-format on }; @@ -730,7 +730,7 @@ kbd_init(const device_t *info) key_queue_start = key_queue_end = 0; - video_reset(gfxcard); + video_reset(gfxcard[0]); if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) || (kbd->type == KBD_TYPE_PRAVETZ) || (kbd->type == KBD_TYPE_XT82) || diff --git a/src/device/mouse_bus.c b/src/device/mouse_bus.c index c0c57b7d0..3e9cd28e2 100644 --- a/src/device/mouse_bus.c +++ b/src/device/mouse_bus.c @@ -317,14 +317,14 @@ lt_write(uint16_t port, uint8_t val, void *priv) * This indicates the mode of operation of D7: * 1 = Mode set, 0 = Bit set/reset * D6,D5 = Mode selection (port A) - * 00 = Mode 0 = Basic I/O - * 01 = Mode 1 = Strobed I/O - * 10 = Mode 2 = Bi-dir bus + * 00 = Mode 0 = Basic I/O + * 01 = Mode 1 = Strobed I/O + * 10 = Mode 2 = Bi-dir bus * D4 = Port A direction (1 = input) * D3 = Port C (upper 4 bits) direction. (1 = input) * D2 = Mode selection (port B & C) - * 0 = Mode 0 = Basic I/O - * 1 = Mode 1 = Strobed I/O + * 0 = Mode 0 = Basic I/O + * 1 = Mode 1 = Strobed I/O * D1 = Port B direction (1 = input) * D0 = Port C (lower 4 bits) direction. (1 = input) * @@ -333,8 +333,8 @@ lt_write(uint16_t port, uint8_t val, void *priv) * being an output port and lower 4 bits an input port, and * enable the sucker. Courtesy Intel 8255 databook. Lars * - * 1001 1011 9B 1111 Default state - * 1001 0001 91 1001 Driver-initialized state + * 1001 1011 9B 1111 Default state + * 1001 0001 91 1001 Driver-initialized state * The only difference is - port C upper and port B go from * input to output. */ diff --git a/src/device/mouse_ps2.c b/src/device/mouse_ps2.c index 870d9ae5f..bdc999dc7 100644 --- a/src/device/mouse_ps2.c +++ b/src/device/mouse_ps2.c @@ -270,7 +270,7 @@ ps2_poll(int x, int y, int z, int b, double abs_x, double abs_y, void *priv) #if 0 if (!(dev->flags & FLAG_ENABLED)) - return(0xff); + return(0xff); #endif if (!mouse_scan) diff --git a/src/device/phoenix_486_jumper.c b/src/device/phoenix_486_jumper.c index bb1957690..d5e833404 100644 --- a/src/device/phoenix_486_jumper.c +++ b/src/device/phoenix_486_jumper.c @@ -8,6 +8,8 @@ * * Implementation of the Phoenix 486 Jumper Readout * + * + * * Authors: Tiseno100 * * Copyright 2020 Tiseno100 @@ -89,7 +91,7 @@ phoenix_486_jumper_reset(void *priv) dev->jumper = 0x00; else { dev->jumper = 0x9f; - if (gfxcard != 0x01) + if (gfxcard[0] != 0x01) dev->jumper |= 0x40; } } diff --git a/src/device/serial.c b/src/device/serial.c index 2434ca17c..dad2ed7f5 100644 --- a/src/device/serial.c +++ b/src/device/serial.c @@ -12,7 +12,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/disk/CMakeLists.txt b/src/disk/CMakeLists.txt index 6d3abfc83..7771a0b72 100644 --- a/src/disk/CMakeLists.txt +++ b/src/disk/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(hdd OBJECT hdd.c hdd_image.c hdd_table.c hdc.c hdc_st506_xt.c diff --git a/src/disk/hdc.c b/src/disk/hdc.c index 0e58b6473..bae818b9a 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -14,7 +14,7 @@ * Fred N. van Kempen, * * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. */ #include #include diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index 9df7725f1..66c7a0231 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/disk/hdc_esdi_mca.c b/src/disk/hdc_esdi_mca.c index 80290c745..f9af1e864 100644 --- a/src/disk/hdc_esdi_mca.c +++ b/src/disk/hdc_esdi_mca.c @@ -54,11 +54,11 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Fred N. van Kempen, * * Copyright 2008-2018 Sarah Walker. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. */ #include diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 2f544cfb9..c2595e3e4 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2020 Sarah Walker. @@ -537,7 +537,7 @@ ide_hd_identify(ide_t *ide) /* Bit 0 = The fields reported in words 54-58 are valid; Bit 1 = The fields reported in words 64-70 are valid; - Bit 2 = The fields reported in word 88 are valid. */ + Bit 2 = The fields reported in word 88 are valid. */ ide->buffer[53] = 1; if (ide->cfg_spt != 0) { @@ -1946,12 +1946,12 @@ ide_readb(uint16_t addr, void *priv) Direction: To device if set; From device if clear. - IO DRQ CoD - 0 1 1 Ready to accept command packet - 1 1 1 Message - ready to send message to host - 1 1 0 Data to host - 0 1 0 Data from host - 1 0 1 Status. */ + IO DRQ CoD + 0 1 1 Ready to accept command packet + 1 1 1 Message - ready to send message to host + 1 1 0 Data to host + 0 1 0 Data from host + 1 0 1 Status. */ case 0x2: /* Sector count */ if (ide->type == IDE_ATAPI) temp = ide->sc->phase; diff --git a/src/disk/hdc_ide_sff8038i.c b/src/disk/hdc_ide_sff8038i.c index 3809359b2..b5c75a756 100644 --- a/src/disk/hdc_ide_sff8038i.c +++ b/src/disk/hdc_ide_sff8038i.c @@ -12,7 +12,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2020 Sarah Walker. diff --git a/src/disk/hdc_st506_at.c b/src/disk/hdc_st506_at.c index d4edc4847..2eee8d294 100644 --- a/src/disk/hdc_st506_at.c +++ b/src/disk/hdc_st506_at.c @@ -14,7 +14,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Fred N. van Kempen, * * Copyright 2008-2019 Sarah Walker. diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index 88bf8c2c9..08f1329be 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -44,7 +44,7 @@ * * * Authors: Fred N. van Kempen, - * Sarah Walker, + * Sarah Walker, * * Copyright 2017-2019 Fred N. van Kempen. * Copyright 2008-2019 Sarah Walker. @@ -180,28 +180,28 @@ #define ERR_CRC_FAIL 0x32 /* CRC circuit failed test */ /* Controller commands. */ -#define CMD_TEST_DRIVE_READY 0x00 -#define CMD_RECALIBRATE 0x01 -/* reserved 0x02 */ -#define CMD_STATUS 0x03 -#define CMD_FORMAT_DRIVE 0x04 -#define CMD_VERIFY 0x05 -#define CMD_FORMAT_TRACK 0x06 -#define CMD_FORMAT_BAD_TRACK 0x07 -#define CMD_READ 0x08 -#define CMD_REASSIGN 0x09 -#define CMD_WRITE 0x0a -#define CMD_SEEK 0x0b -#define CMD_SPECIFY 0x0c -#define CMD_READ_ECC_BURST_LEN 0x0d -#define CMD_READ_BUFFER 0x0e -#define CMD_WRITE_BUFFER 0x0f -#define CMD_ALT_TRACK 0x11 -#define CMD_INQUIRY_ST11 0x12 /* ST-11 BIOS */ -#define CMD_V86P_POWEROFF 0x1a /* Victor V86P */ -#define CMD_RAM_DIAGNOSTIC 0xe0 -/* reserved 0xe1 */ -/* reserved 0xe2 */ +#define CMD_TEST_DRIVE_READY 0x00 +#define CMD_RECALIBRATE 0x01 +/* reserved 0x02 */ +#define CMD_STATUS 0x03 +#define CMD_FORMAT_DRIVE 0x04 +#define CMD_VERIFY 0x05 +#define CMD_FORMAT_TRACK 0x06 +#define CMD_FORMAT_BAD_TRACK 0x07 +#define CMD_READ 0x08 +#define CMD_REASSIGN 0x09 +#define CMD_WRITE 0x0a +#define CMD_SEEK 0x0b +#define CMD_SPECIFY 0x0c +#define CMD_READ_ECC_BURST_LEN 0x0d +#define CMD_READ_BUFFER 0x0e +#define CMD_WRITE_BUFFER 0x0f +#define CMD_ALT_TRACK 0x11 +#define CMD_INQUIRY_ST11 0x12 /* ST-11 BIOS */ +#define CMD_V86P_POWEROFF 0x1a /* Victor V86P */ +#define CMD_RAM_DIAGNOSTIC 0xe0 +/* reserved 0xe1 */ +/* reserved 0xe2 */ #define CMD_DRIVE_DIAGNOSTIC 0xe3 #define CMD_CTRLR_DIAGNOSTIC 0xe4 #define CMD_READ_LONG 0xe5 @@ -295,19 +295,19 @@ typedef struct { hd_type_t hd_types[4] = { // clang-format off - { 306, 4, MFM_SECTORS}, /* type 0 */ - { 612, 4, MFM_SECTORS}, /* type 16 */ - { 615, 4, MFM_SECTORS}, /* type 2 */ - { 306, 8, MFM_SECTORS} /* type 13 */ + { 306, 4, MFM_SECTORS}, /* type 0 */ + { 612, 4, MFM_SECTORS}, /* type 16 */ + { 615, 4, MFM_SECTORS}, /* type 2 */ + { 306, 8, MFM_SECTORS} /* type 13 */ // clang-format on }; hd_type_t hd_types_olivetti[16] = { // clang-format off { 697, 5, MFM_SECTORS}, - { 612, 4, MFM_SECTORS}, /* type 16 */ - { 612, 4, MFM_SECTORS}, /* type 16 */ - { 306, 4, MFM_SECTORS}, /* type 0 */ + { 612, 4, MFM_SECTORS}, /* type 16 */ + { 612, 4, MFM_SECTORS}, /* type 16 */ + { 306, 4, MFM_SECTORS}, /* type 0 */ { 612, 8, MFM_SECTORS}, { 820, 6, MFM_SECTORS}, { 820, 6, MFM_SECTORS}, @@ -317,8 +317,8 @@ hd_type_t hd_types_olivetti[16] = { {1024, 8, MFM_SECTORS}, {1024, 9, MFM_SECTORS}, { 872, 5, MFM_SECTORS}, - { 612, 4, MFM_SECTORS}, /* type 16 */ - { 612, 4, MFM_SECTORS}, /* type 16 */ + { 612, 4, MFM_SECTORS}, /* type 16 */ + { 612, 4, MFM_SECTORS}, /* type 16 */ { 306, 4, MFM_SECTORS} /* "not present" with the second hard disk */ // clang-format on }; @@ -375,10 +375,10 @@ get_sector(hdc_t *dev, drive_t *drive, off64_t *addr) #if 0 if (drive->cylinder != dev->cylinder) { # ifdef ENABLE_ST506_XT_LOG - st506_xt_log("ST506: get_sector: wrong cylinder\n"); + st506_xt_log("ST506: get_sector: wrong cylinder\n"); # endif - dev->error = ERR_ILLEGAL_ADDR; - return(0); + dev->error = ERR_ILLEGAL_ADDR; + return(0); } #endif @@ -653,7 +653,7 @@ st506_callback(void *priv) } case CMD_READ: #if 0 - case CMD_READ_LONG: + case CMD_READ_LONG: #endif switch (dev->state) { case STATE_START_COMMAND: @@ -749,7 +749,7 @@ st506_callback(void *priv) } case CMD_WRITE: #if 0 - case CMD_WRITE_LONG: + case CMD_WRITE_LONG: #endif switch (dev->state) { case STATE_START_COMMAND: diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index 589ec2789..ca7f01b9d 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -50,7 +50,7 @@ * * Based on my earlier HD20 driver for the EuroPC. * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 45b8dde54..72ad580ae 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -23,7 +23,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/disk/hdd_image.c b/src/disk/hdd_image.c index 1b59ac570..ba7cf18ba 100644 --- a/src/disk/hdd_image.c +++ b/src/disk/hdd_image.c @@ -14,7 +14,7 @@ * Fred N. van Kempen, * * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. */ #define _GNU_SOURCE #include diff --git a/src/disk/hdd_table.c b/src/disk/hdd_table.c index d75dc7e8d..12a0040ef 100644 --- a/src/disk/hdd_table.c +++ b/src/disk/hdd_table.c @@ -15,7 +15,7 @@ * Fred N. van Kempen, * * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. */ #include #include diff --git a/src/disk/zip.c b/src/disk/zip.c index 959a5fbbe..a0107d1ef 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -199,7 +199,8 @@ static const mode_sense_pages_t zip_250_mode_sense_pages_default = { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, { 0, 0 }, + { 0, 0 }, + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, @@ -2072,7 +2073,7 @@ zip_phase_data_out(scsi_common_t *sc) dev->buffer[2] = (i >> 8) & 0xff; dev->buffer[3] = i & 0xff; } else if (dev->current_cdb[1] & 4) { - /* CHS are 96,1,2048 (ZIP 100) and 239,1,2048 (ZIP 250) */ + /* CHS are 96, 1, 2048 (ZIP 100) and 239, 1, 2048 (ZIP 250) */ s = (i % 2048); h = ((i - s) / 2048) % 1; c = ((i - s) / 2048) / 1; diff --git a/src/dma.c b/src/dma.c index d8c4ea674..ecdc393ff 100644 --- a/src/dma.c +++ b/src/dma.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/floppy/CMakeLists.txt b/src/floppy/CMakeLists.txt index 70bae154e..89fbbf76f 100644 --- a/src/floppy/CMakeLists.txt +++ b/src/floppy/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(fdd OBJECT fdd.c fdc.c fdc_magitronic.c fdc_monster.c fdc_pii15xb.c diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 2abc4a8f5..0c35cfcb6 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2020 Sarah Walker. @@ -637,7 +637,7 @@ fdc_io_command_phase1(fdc_t *fdc, int out) pclog_toggle_suppr(); pclog("%02X ", fdc->processed_cmd); for (i = 0; i < fdc->pnum; i++) - pclog("%02X ", fdc->params[i]); + pclog("%02X ", fdc->params[i]); pclog("\n"); pclog_toggle_suppr(); #endif @@ -1329,9 +1329,9 @@ fdc_read(uint16_t addr, void *priv) * fdc_t on one of the motherboard's support chips. * * Confirmed: 00=1.44M 3.5 - * 10=2.88M 3.5 - * 20=1.2M 5.25 - * 30=1.2M 5.25 + * 10=2.88M 3.5 + * 20=1.2M 5.25 + * 30=1.2M 5.25 * * as reported by Configur.exe. */ @@ -2280,6 +2280,12 @@ fdc_reset(void *priv) } else if (fdc->flags & FDC_FLAG_SEC) { fdc->dma = 1; fdc->specify[1] = 0; + } else if (fdc->flags & FDC_FLAG_TER) { + fdc->dma = 1; + fdc->specify[1] = 0; + } else if (fdc->flags & FDC_FLAG_QUA) { + fdc->dma = 1; + fdc->specify[1] = 0; } else { fdc->dma = 1; fdc->specify[1] = 0; @@ -2297,6 +2303,10 @@ fdc_reset(void *priv) fdc_remove(fdc); if (fdc->flags & FDC_FLAG_SEC) { fdc_set_base(fdc, FDC_SECONDARY_ADDR); + } else if (fdc->flags & FDC_FLAG_TER) { + fdc_set_base(fdc, FDC_TERTIARY_ADDR); + } else if (fdc->flags & FDC_FLAG_QUA) { + fdc_set_base(fdc, FDC_QUATERNARY_ADDR); } else { fdc_set_base(fdc, (fdc->flags & FDC_FLAG_PCJR) ? FDC_PRIMARY_PCJR_ADDR : FDC_PRIMARY_ADDR); } @@ -2330,6 +2340,10 @@ fdc_init(const device_t *info) if (fdc->flags & FDC_FLAG_SEC) fdc->irq = FDC_SECONDARY_IRQ; + else if (fdc->flags & FDC_FLAG_TER) + fdc->irq = FDC_TERTIARY_IRQ; + else if (fdc->flags & FDC_FLAG_QUA) + fdc->irq = FDC_QUATERNARY_IRQ; else fdc->irq = FDC_PRIMARY_IRQ; @@ -2337,6 +2351,10 @@ fdc_init(const device_t *info) timer_add(&fdc->watchdog_timer, fdc_watchdog_poll, fdc, 0); else if (fdc->flags & FDC_FLAG_SEC) fdc->dma_ch = FDC_SECONDARY_DMA; + else if (fdc->flags & FDC_FLAG_TER) + fdc->dma_ch = FDC_TERTIARY_DMA; + else if (fdc->flags & FDC_FLAG_QUA) + fdc->dma_ch = FDC_QUATERNARY_DMA; else fdc->dma_ch = FDC_PRIMARY_DMA; @@ -2378,7 +2396,7 @@ const device_t fdc_xt_device = { const device_t fdc_xt_sec_device = { .name = "PC/XT Floppy Drive Controller (Secondary)", - .internal_name = "fdc_xt", + .internal_name = "fdc_xt_sec", .flags = FDC_FLAG_SEC, .local = 0, .init = fdc_init, @@ -2390,6 +2408,34 @@ const device_t fdc_xt_sec_device = { .config = NULL }; +const device_t fdc_xt_ter_device = { + .name = "PC/XT Floppy Drive Controller (Tertiary)", + .internal_name = "fdc_xt_ter", + .flags = FDC_FLAG_TER, + .local = 0, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t fdc_xt_qua_device = { + .name = "PC/XT Floppy Drive Controller (Quaternary)", + .internal_name = "fdc_xt_qua", + .flags = FDC_FLAG_QUA, + .local = 0, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + const device_t fdc_xt_t1x00_device = { .name = "PC/XT Floppy Drive Controller (Toshiba)", .internal_name = "fdc_xt_t1x00", @@ -2474,6 +2520,34 @@ const device_t fdc_at_sec_device = { .config = NULL }; +const device_t fdc_at_ter_device = { + .name = "PC/AT Floppy Drive Controller (Tertiary)", + .internal_name = "fdc_at_ter", + .flags = 0, + .local = FDC_FLAG_AT | FDC_FLAG_TER, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t fdc_at_qua_device = { + .name = "PC/AT Floppy Drive Controller (Quaternary)", + .internal_name = "fdc_at_qua", + .flags = 0, + .local = FDC_FLAG_AT | FDC_FLAG_QUA, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + const device_t fdc_at_actlow_device = { .name = "PC/AT Floppy Drive Controller (Active low)", .internal_name = "fdc_at_actlow", diff --git a/src/floppy/fdc_monster.c b/src/floppy/fdc_monster.c index 2cd1d9b05..ae5e1b290 100644 --- a/src/floppy/fdc_monster.c +++ b/src/floppy/fdc_monster.c @@ -39,6 +39,8 @@ typedef struct { rom_t bios_rom; + fdc_t *fdc_pri; + fdc_t *fdc_sec; } monster_fdc_t; static void @@ -57,14 +59,29 @@ monster_fdc_init(const device_t *info) dev = (monster_fdc_t *)malloc(sizeof(monster_fdc_t)); memset(dev, 0, sizeof(monster_fdc_t)); +#if 0 + uint8_t sec_irq = device_get_config_int("sec_irq"); + uint8_t sec_dma = device_get_config_int("sec_dma"); +#endif + if (BIOS_ADDR != 0) rom_init(&dev->bios_rom, ROM_MONSTER_FDC, BIOS_ADDR, 0x2000, 0x1ffff, 0, MEM_MAPPING_EXTERNAL); // Primary FDC - device_add(&fdc_at_device); + dev->fdc_pri = device_add(&fdc_at_device); +#if 0 // Secondary FDC - // device_add(&fdc_at_sec_device); + uint8_t sec_enabled = device_get_config_int("sec_enabled"); + if (sec_enabled) + dev->fdc_sec = device_add(&fdc_at_sec_device); + fdc_set_irq(dev->fdc_sec, sec_irq); + fdc_set_dma_ch(dev->fdc_sec, sec_dma); +#endif + +#if 0 + uint8_t rom_writes_enabled = device_get_config_int("rom_writes_enabled"); +#endif return dev; } @@ -76,7 +93,14 @@ static int monster_fdc_available(void) static const device_config_t monster_fdc_config[] = { // clang-format off -/* +#if 0 + { + .name = "sec_enabled", + .description = "Enable Secondary Controller", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, { .name = "sec_irq", .description = "Secondary Controller IRQ", @@ -137,7 +161,7 @@ static const device_config_t monster_fdc_config[] = { { .description = "" } } }, -*/ +#endif { .name = "bios_addr", .description = "BIOS Address:", @@ -157,7 +181,7 @@ static const device_config_t monster_fdc_config[] = { { .description = "" } } }, -/* +#if 0 { .name = "bios_size", .description = "BIOS Size:", @@ -172,8 +196,14 @@ static const device_config_t monster_fdc_config[] = { { .description = "" } } }, -*/ - // BIOS extension ROM writes: Enabled/Disabled + { + .name = "rom_writes_enabled", + .description = "Enable BIOS extension ROM Writes", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, +#endif { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/floppy/fdd.c b/src/floppy/fdd.c index a6ccb6da5..ee43256a4 100644 --- a/src/floppy/fdd.c +++ b/src/floppy/fdd.c @@ -10,13 +10,13 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * * Copyright 2008-2019 Sarah Walker. * Copyright 2016-2019 Miran Grca. - * Copyright 2018,2019 Fred N. van Kempen. + * Copyright 2018-2019 Fred N. van Kempen. */ #include #include @@ -40,17 +40,17 @@ #include <86box/fdc.h> /* Flags: - Bit 0: 300 rpm supported; - Bit 1: 360 rpm supported; - Bit 2: size (0 = 3.5", 1 = 5.25"); - Bit 3: sides (0 = 1, 1 = 2); - Bit 4: double density supported; - Bit 5: high density supported; - Bit 6: extended density supported; - Bit 7: double step for 40-track media; - Bit 8: invert DENSEL polarity; - Bit 9: ignore DENSEL; - Bit 10: drive is a PS/2 drive; + Bit 0: 300 rpm supported; + Bit 1: 360 rpm supported; + Bit 2: size (0 = 3.5", 1 = 5.25"); + Bit 3: sides (0 = 1, 1 = 2); + Bit 4: double density supported; + Bit 5: high density supported; + Bit 6: extended density supported; + Bit 7: double step for 40-track media; + Bit 8: invert DENSEL polarity; + Bit 9: ignore DENSEL; + Bit 10: drive is a PS/2 drive; */ #define FLAG_RPM_300 1 #define FLAG_RPM_360 2 @@ -146,49 +146,49 @@ static const struct } drive_types[] = { { /*None*/ - 0, 0, "None", "none" + 0, 0, "None", "none" }, { /*5.25" 1DD*/ - 43, FLAG_RPM_300 | FLAG_525 | FLAG_HOLE0, "5.25\" 180k", "525_1dd" + 43, FLAG_RPM_300 | FLAG_525 | FLAG_HOLE0, "5.25\" 180k", "525_1dd" }, { /*5.25" DD*/ - 43, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0, "5.25\" 360k", "525_2dd" + 43, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0, "5.25\" 360k", "525_2dd" }, { /*5.25" QD*/ - 86, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "5.25\" 720k", "525_2qd" + 86, FLAG_RPM_300 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "5.25\" 720k", "525_2qd" }, { /*5.25" HD PS/2*/ - 86, FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL | FLAG_PS2, "5.25\" 1.2M PS/2", "525_2hd_ps2" + 86, FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL | FLAG_PS2, "5.25\" 1.2M PS/2", "525_2hd_ps2" }, { /*5.25" HD*/ - 86, FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "5.25\" 1.2M", "525_2hd" + 86, FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "5.25\" 1.2M", "525_2hd" }, { /*5.25" HD Dual RPM*/ - 86, FLAG_RPM_300 | FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "5.25\" 1.2M 300/360 RPM", "525_2hd_dualrpm" + 86, FLAG_RPM_300 | FLAG_RPM_360 | FLAG_525 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "5.25\" 1.2M 300/360 RPM", "525_2hd_dualrpm" }, { /*3.5" 1DD*/ - 86, FLAG_RPM_300 | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 360k", "35_1dd" + 86, FLAG_RPM_300 | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 360k", "35_1dd" }, { /*3.5" DD*/ - 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 720k", "35_2dd" + 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_DOUBLE_STEP, "3.5\" 720k", "35_2dd" }, { /*3.5" HD PS/2*/ - 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL | FLAG_PS2, "3.5\" 1.44M PS/2", "35_2hd_ps2" + 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL | FLAG_PS2, "3.5\" 1.44M PS/2", "35_2hd_ps2" }, { /*3.5" HD*/ - 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "3.5\" 1.44M", "35_2hd" + 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "3.5\" 1.44M", "35_2hd" }, { /*3.5" HD PC-98*/ - 86, FLAG_RPM_300 | FLAG_RPM_360 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL, "3.5\" 1.25M PC-98", "35_2hd_nec" + 86, FLAG_RPM_300 | FLAG_RPM_360 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP | FLAG_INVERT_DENSEL, "3.5\" 1.25M PC-98", "35_2hd_nec" }, { /*3.5" HD 3-Mode*/ - 86, FLAG_RPM_300 | FLAG_RPM_360 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "3.5\" 1.44M 300/360 RPM", "35_2hd_3mode" + 86, FLAG_RPM_300 | FLAG_RPM_360 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_DOUBLE_STEP, "3.5\" 1.44M 300/360 RPM", "35_2hd_3mode" }, { /*3.5" ED*/ - 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_HOLE2 | FLAG_DOUBLE_STEP, "3.5\" 2.88M", "35_2ed" + 86, FLAG_RPM_300 | FLAG_DS | FLAG_HOLE0 | FLAG_HOLE1 | FLAG_HOLE2 | FLAG_DOUBLE_STEP, "3.5\" 2.88M", "35_2ed" }, { /*End of list*/ - -1, -1, "", "" + -1, -1, "", "" } }; diff --git a/src/floppy/fdd_86f.c b/src/floppy/fdd_86f.c index 7509dd3a5..0267cfe81 100644 --- a/src/floppy/fdd_86f.c +++ b/src/floppy/fdd_86f.c @@ -155,23 +155,23 @@ typedef struct { } sector_t; /* Disk flags: - * Bit 0 Has surface data (1 = yes, 0 = no) - * Bits 2, 1 Hole (3 = ED + 2000 kbps, 2 = ED, 1 = HD, 0 = DD) - * Bit 3 Sides (1 = 2 sides, 0 = 1 side) - * Bit 4 Write protect (1 = yes, 0 = no) - * Bits 6, 5 RPM slowdown (3 = 2%, 2 = 1.5%, 1 = 1%, 0 = 0%) - * Bit 7 Bitcell mode (1 = Extra bitcells count specified after - * disk flags, 0 = No extra bitcells) - * The maximum number of extra bitcells is 1024 (which - * after decoding translates to 64 bytes) - * Bit 8 Disk type (1 = Zoned, 0 = Fixed RPM) - * Bits 10, 9 Zone type (3 = Commodore 64 zoned, 2 = Apple zoned, - * 1 = Pre-Apple zoned #2, 0 = Pre-Apple zoned #1) - * Bit 11 Data and surface bits are stored in reverse byte endianness - * Bit 12 If bits 6, 5 are not 0, they specify % of speedup instead - * of slowdown; - * If bits 6, 5 are 0, and bit 7 is 1, the extra bitcell count - * specifies the entire bitcell count + * Bit 0 Has surface data (1 = yes, 0 = no) + * Bits 2, 1 Hole (3 = ED + 2000 kbps, 2 = ED, 1 = HD, 0 = DD) + * Bit 3 Sides (1 = 2 sides, 0 = 1 side) + * Bit 4 Write protect (1 = yes, 0 = no) + * Bits 6, 5 RPM slowdown (3 = 2%, 2 = 1.5%, 1 = 1%, 0 = 0%) + * Bit 7 Bitcell mode (1 = Extra bitcells count specified after + * disk flags, 0 = No extra bitcells) + * The maximum number of extra bitcells is 1024 (which + * after decoding translates to 64 bytes) + * Bit 8 Disk type (1 = Zoned, 0 = Fixed RPM) + * Bits 10, 9 Zone type (3 = Commodore 64 zoned, 2 = Apple zoned, + * 1 = Pre-Apple zoned #2, 0 = Pre-Apple zoned #1) + * Bit 11 Data and surface bits are stored in reverse byte endianness + * Bit 12 If bits 6, 5 are not 0, they specify % of speedup instead + * of slowdown; + * If bits 6, 5 are 0, and bit 7 is 1, the extra bitcell count + * specifies the entire bitcell count */ typedef struct { FILE *f; @@ -2732,14 +2732,14 @@ d86f_prepare_sector(int drive, int side, int prev_pos, uint8_t *id_buf, uint8_t * ((track << 1) + 1); * * - Any bits that differ are treated as thus: - * - Both are regular but contents differ -> Output is fuzzy; - * - One is regular and one is fuzzy -> Output is fuzzy; - * - Both are fuzzy -> Output is fuzzy; - * - Both are physical holes -> Output is a physical hole; - * - One is regular and one is a physical hole -> Output is fuzzy, - * the hole half is handled appropriately on writeback; - * - One is fuzzy and one is a physical hole -> Output is fuzzy, - * the hole half is handled appropriately on writeback; + * - Both are regular but contents differ -> Output is fuzzy; + * - One is regular and one is fuzzy -> Output is fuzzy; + * - Both are fuzzy -> Output is fuzzy; + * - Both are physical holes -> Output is a physical hole; + * - One is regular and one is a physical hole -> Output is fuzzy, + * the hole half is handled appropriately on writeback; + * - One is fuzzy and one is a physical hole -> Output is fuzzy, + * the hole half is handled appropriately on writeback; * - On write back, apart from the above notes, the final two tracks * are written; * - Destination ALWAYS has surface data even if the image does not. diff --git a/src/floppy/fdd_common.c b/src/floppy/fdd_common.c index 28dea0735..9c1f98c39 100644 --- a/src/floppy/fdd_common.c +++ b/src/floppy/fdd_common.c @@ -48,14 +48,14 @@ const double fdd_bit_rates_300[6] = { * single-RPM drive by setting the rate to 300 kbps. */ const uint8_t fdd_max_sectors[8][6] = { - { 26, 31, 38, 53, 64, 118 }, /* 128 */ - { 15, 19, 23, 32, 38, 73 }, /* 256 */ - { 7, 10, 12, 17, 22, 41 }, /* 512 */ - { 3, 5, 6, 9, 11, 22 }, /* 1024 */ - { 2, 2, 3, 4, 5, 11 }, /* 2048 */ - { 1, 1, 1, 2, 2, 5 }, /* 4096 */ - { 0, 0, 0, 1, 1, 3 }, /* 8192 */ - { 0, 0, 0, 0, 0, 1 } /* 16384 */ + { 26, 31, 38, 53, 64, 118 }, /* 128 */ + { 15, 19, 23, 32, 38, 73 }, /* 256 */ + { 7, 10, 12, 17, 22, 41 }, /* 512 */ + { 3, 5, 6, 9, 11, 22 }, /* 1024 */ + { 2, 2, 3, 4, 5, 11 }, /* 2048 */ + { 1, 1, 1, 2, 2, 5 }, /* 4096 */ + { 0, 0, 0, 1, 1, 3 }, /* 8192 */ + { 0, 0, 0, 0, 0, 1 } /* 16384 */ }; const uint8_t fdd_dmf_r[21] = { @@ -63,285 +63,290 @@ const uint8_t fdd_dmf_r[21] = { }; static const uint8_t fdd_gap3_sizes[5][8][48] = { - { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][0] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][0] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][1] */ - 0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][1] */ + 0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][2] */ - 0x00,0x00,0x6C,0x48,0x2A,0x08,0x02,0x01, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][2] */ + 0x00,0x00,0x6C,0x48,0x2A,0x08,0x02,0x01, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x83,0x26,0x00,0x00,0x00,0x00, /* [0][3] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x83,0x26,0x00,0x00,0x00,0x00, /* [0][3] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][4] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][4] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][5] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][5] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][6] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][6] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][7] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [0][7] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } }, - { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][0] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][0] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][1] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][1] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x54,0x1C,0x0E,0x00,0x00, /* [1][2] */ - 0x00,0x00,0x6C,0x48,0x2A,0x08,0x02,0x01, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x54,0x1C,0x0E,0x00,0x00, /* [1][2] */ + 0x00,0x00,0x6C,0x48,0x2A,0x08,0x02,0x01, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x79,0x06, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][3] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x79,0x06, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][3] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][4] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][4] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][5] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][5] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][6] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][6] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][7] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [1][7] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } }, - { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][0] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][0] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x32,0x0C,0x00,0x00,0x00,0x36, /* [2][1] */ - 0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x32,0x0C,0x00,0x00,0x00,0x36, /* [2][1] */ + 0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x58,0x50,0x2E,0x00,0x00,0x00,0x00,0x00, /* [2][2] */ - 0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x58,0x50,0x2E,0x00,0x00,0x00,0x00,0x00, /* [2][2] */ + 0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0xF0,0x74,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][3] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0xF0,0x74,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][3] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][4] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][4] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][5] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][5] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][6] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][6] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][7] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [2][7] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } }, - { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][0] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][0] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][1] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][1] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][2] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x53,0x4E,0x3D,0x2C, - 0x1C,0x0D,0x02,0x00,0x00,0x00,0x01,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][2] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x53,0x4E,0x3D,0x2C, + 0x1C,0x0D,0x02,0x00,0x00,0x00,0x01,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][3] */ - 0x00,0x00,0xF7,0xAF,0x6F,0x55,0x1F,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][3] */ + 0x00,0x00,0xF7,0xAF,0x6F,0x55,0x1F,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][4] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][4] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][5] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][5] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][6] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][6] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][7] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [3][7] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } }, - { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][0] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][0] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][1] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][1] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x92,0x54, /* [4][2] */ - 0x38,0x23,0x00,0x01,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x92,0x54, /* [4][2] */ + 0x38,0x23,0x00,0x01,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x74,0x24,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][3] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x74,0x24,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][3] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][4] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][4] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][5] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][5] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][6] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][6] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][7] */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* [4][7] */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } } }; diff --git a/src/floppy/fdd_fdi.c b/src/floppy/fdd_fdi.c index 5d09d8df2..64279c173 100644 --- a/src/floppy/fdd_fdi.c +++ b/src/floppy/fdd_fdi.c @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -298,7 +298,7 @@ fdi_seek(int drive, int track) #if 0 if (track > dev->lasttrack) - track = dev->lasttrack - 1; + track = dev->lasttrack - 1; #endif dev->track = track; diff --git a/src/floppy/fdd_img.c b/src/floppy/fdd_img.c index e0847c010..a9fc73a24 100644 --- a/src/floppy/fdd_img.c +++ b/src/floppy/fdd_img.c @@ -15,7 +15,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -66,21 +66,21 @@ typedef struct { } img_t; -static img_t *img[FDD_NUM]; -static fdc_t *img_fdc; +static img_t *img[FDD_NUM]; +static fdc_t *img_fdc; -static double bit_rate_300; -static char *ext; -static uint8_t first_byte, - second_byte, - third_byte, - fourth_byte; -static uint8_t fdf_suppress_final_byte = 0; /* This is hard-coded to 0 - - * if you really need to read - * those NT 3.1 Beta floppy - * images, change this to 1 - * and recompile. - */ +static double bit_rate_300; +static char *ext; +static uint8_t first_byte, + second_byte, + third_byte, + fourth_byte; +static uint8_t fdf_suppress_final_byte = 0; /* This is hard-coded to 0 - + * if you really need to read + * those NT 3.1 Beta floppy + * images, change this to 1 + * and recompile. + */ const uint8_t dmf_r[21] = { 12, 2, 13, 3, 14, 4, 15, 5, 16, 6, 17, 7, 18, 8, 19, 9, 20, 10, 21, 11, 1 }; @@ -90,197 +90,230 @@ const uint8_t xdf_gap3_sizes[2][2] = { { 60, 69 }, { 60, 50 } }; const uint16_t xdf_trackx_spos[2][8] = { { 0xA7F, 0xF02, 0x11B7, 0xB66, 0xE1B, 0x129E }, { 0x302, 0x7E2, 0xA52, 0x12DA, 0x572, 0xDFA, 0x106A, 0x154A } }; /* XDF: Layout of the sectors in the image. */ -const xdf_sector_t xdf_img_layout[2][2][46] = { { { {0x8100}, {0x8200}, {0x8300}, {0x8400}, {0x8500}, {0x8600}, {0x8700}, {0x8800}, - {0x8101}, {0x8201}, {0x0100}, {0x0200}, {0x0300}, {0x0400}, {0x0500}, {0x0600}, - {0x0700}, {0x0800}, { 0}, - {0x8301}, {0x8401}, {0x8501}, {0x8601}, {0x8701}, {0x8801}, {0x8901}, {0x8A01}, - {0x8B01}, {0x8C01}, {0x8D01}, {0x8E01}, {0x8F01}, {0x9001}, { 0}, { 0}, - { 0}, { 0}, { 0} }, - { {0x8300}, {0x8600}, {0x8201}, {0x8200}, {0x8601}, {0x8301} } - }, /* 5.25" 2HD */ - { { {0x8100}, {0x8200}, {0x8300}, {0x8400}, {0x8500}, {0x8600}, {0x8700}, {0x8800}, - {0x8900}, {0x8A00}, {0x8B00}, {0x8101}, {0x0100}, {0x0200}, {0x0300}, {0x0400}, - {0x0500}, {0x0600}, {0x0700}, {0x0800}, { 0}, { 0}, { 0}, - {0x8201}, {0x8301}, {0x8401}, {0x8501}, {0x8601}, {0x8701}, {0x8801}, {0x8901}, - {0x8A01}, {0x8B01}, {0x8C01}, {0x8D01}, {0x8E01}, {0x8F01}, { 0}, { 0}, - { 0}, { 0}, { 0}, {0x9001}, {0x9101}, {0x9201}, {0x9301} }, - { {0x8300}, {0x8400}, {0x8601}, {0x8200}, {0x8201}, {0x8600}, {0x8401}, {0x8301} } - } /* 3.5" 2HD */ - }; +const xdf_sector_t xdf_img_layout[2][2][46] = { + { + { + {0x8100}, {0x8200}, {0x8300}, {0x8400}, {0x8500}, {0x8600}, {0x8700}, {0x8800}, + {0x8101}, {0x8201}, {0x0100}, {0x0200}, {0x0300}, {0x0400}, {0x0500}, {0x0600}, + {0x0700}, {0x0800}, { 0}, + {0x8301}, {0x8401}, {0x8501}, {0x8601}, {0x8701}, {0x8801}, {0x8901}, {0x8A01}, + {0x8B01}, {0x8C01}, {0x8D01}, {0x8E01}, {0x8F01}, {0x9001}, { 0}, { 0}, + { 0}, { 0}, { 0} + }, + { {0x8300}, {0x8600}, {0x8201}, {0x8200}, {0x8601}, {0x8301} } + }, /* 5.25" 2HD */ + { + { + {0x8100}, {0x8200}, {0x8300}, {0x8400}, {0x8500}, {0x8600}, {0x8700}, {0x8800}, + {0x8900}, {0x8A00}, {0x8B00}, {0x8101}, {0x0100}, {0x0200}, {0x0300}, {0x0400}, + {0x0500}, {0x0600}, {0x0700}, {0x0800}, { 0}, { 0}, { 0}, + {0x8201}, {0x8301}, {0x8401}, {0x8501}, {0x8601}, {0x8701}, {0x8801}, {0x8901}, + {0x8A01}, {0x8B01}, {0x8C01}, {0x8D01}, {0x8E01}, {0x8F01}, { 0}, { 0}, + { 0}, { 0}, { 0}, {0x9001}, {0x9101}, {0x9201}, {0x9301} + }, + { {0x8300}, {0x8400}, {0x8601}, {0x8200}, {0x8201}, {0x8600}, {0x8401}, {0x8301} } + } /* 3.5" 2HD */ +}; /* XDF: Layout of the sectors on the disk's track. */ -const xdf_sector_t xdf_disk_layout[2][2][38] = { { { {0x0100}, {0x0200}, {0x8100}, {0x8800}, {0x8200}, {0x0300}, {0x8300}, {0x0400}, - {0x8400}, {0x0500}, {0x8500}, {0x0600}, {0x8600}, {0x0700}, {0x8700}, {0x0800}, - {0x8D01}, {0x8501}, {0x8E01}, {0x8601}, {0x8F01}, {0x8701}, {0x9001}, {0x8801}, - {0x8101}, {0x8901}, {0x8201}, {0x8A01}, {0x8301}, {0x8B01}, {0x8401}, {0x8C01} }, - { {0x8300}, {0x8200}, {0x8600}, {0x8201}, {0x8301}, {0x8601} } - }, /* 5.25" 2HD */ - { { {0x0100}, {0x8A00}, {0x8100}, {0x8B00}, {0x8200}, {0x0200}, {0x8300}, {0x0300}, - {0x8400}, {0x0400}, {0x8500}, {0x0500}, {0x8600}, {0x0600}, {0x8700}, {0x0700}, - {0x8800}, {0x0800}, {0x8900}, - {0x9001}, {0x8701}, {0x9101}, {0x8801}, {0x9201}, {0x8901}, {0x9301}, {0x8A01}, - {0x8101}, {0x8B01}, {0x8201}, {0x8C01}, {0x8301}, {0x8D01}, {0x8401}, {0x8E01}, - {0x8501}, {0x8F01}, {0x8601} }, - { {0x8300}, {0x8200}, {0x8400}, {0x8600}, {0x8401}, {0x8201}, {0x8301}, {0x8601} }, - }, /* 3.5" 2HD */ - }; +const xdf_sector_t xdf_disk_layout[2][2][38] = { + { + { + {0x0100}, {0x0200}, {0x8100}, {0x8800}, {0x8200}, {0x0300}, {0x8300}, {0x0400}, + {0x8400}, {0x0500}, {0x8500}, {0x0600}, {0x8600}, {0x0700}, {0x8700}, {0x0800}, + {0x8D01}, {0x8501}, {0x8E01}, {0x8601}, {0x8F01}, {0x8701}, {0x9001}, {0x8801}, + {0x8101}, {0x8901}, {0x8201}, {0x8A01}, {0x8301}, {0x8B01}, {0x8401}, {0x8C01} + }, + { {0x8300}, {0x8200}, {0x8600}, {0x8201}, {0x8301}, {0x8601} } + }, /* 5.25" 2HD */ + { + { + {0x0100}, {0x8A00}, {0x8100}, {0x8B00}, {0x8200}, {0x0200}, {0x8300}, {0x0300}, + {0x8400}, {0x0400}, {0x8500}, {0x0500}, {0x8600}, {0x0600}, {0x8700}, {0x0700}, + {0x8800}, {0x0800}, {0x8900}, + {0x9001}, {0x8701}, {0x9101}, {0x8801}, {0x9201}, {0x8901}, {0x9301}, {0x8A01}, + {0x8101}, {0x8B01}, {0x8201}, {0x8C01}, {0x8301}, {0x8D01}, {0x8401}, {0x8E01}, + {0x8501}, {0x8F01}, {0x8601} + }, + { {0x8300}, {0x8200}, {0x8400}, {0x8600}, {0x8401}, {0x8201}, {0x8301}, {0x8601} }, + }, /* 3.5" 2HD */ +}; /* First dimension is possible sector sizes (0 = 128, 7 = 16384), second is possible bit rates (250/360, 250, 300, 500/360, 500, 1000). */ /* Disks formatted at 250 kbps @ 360 RPM can be read with a 360 RPM single-RPM 5.25" drive by setting the rate to 250 kbps. Disks formatted at 300 kbps @ 300 RPM can be read with any 300 RPM single-RPM drive by setting the rate rate to 300 kbps. */ -static const uint8_t maximum_sectors[8][6] = { { 26, 31, 38, 53, 64, 118 }, /* 128 */ - { 15, 19, 23, 32, 38, 73 }, /* 256 */ - { 7, 10, 12, 17, 22, 41 }, /* 512 */ - { 3, 5, 6, 9, 11, 22 }, /* 1024 */ - { 2, 2, 3, 4, 5, 11 }, /* 2048 */ - { 1, 1, 1, 2, 2, 5 }, /* 4096 */ - { 0, 0, 0, 1, 1, 3 }, /* 8192 */ - { 0, 0, 0, 0, 0, 1 } }; /* 16384 */ +static const uint8_t maximum_sectors[8][6] = { + { 26, 31, 38, 53, 64, 118 }, /* 128 */ + { 15, 19, 23, 32, 38, 73 }, /* 256 */ + { 7, 10, 12, 17, 22, 41 }, /* 512 */ + { 3, 5, 6, 9, 11, 22 }, /* 1024 */ + { 2, 2, 3, 4, 5, 11 }, /* 2048 */ + { 1, 1, 1, 2, 2, 5 }, /* 4096 */ + { 0, 0, 0, 1, 1, 3 }, /* 8192 */ + { 0, 0, 0, 0, 0, 1 } /* 16384 */ +}; -static const uint8_t xdf_sectors[8][6] = { { 0, 0, 0, 0, 0, 0 }, /* 128 */ - { 0, 0, 0, 0, 0, 0 }, /* 256 */ - { 0, 0, 0, 19, 23, 0 }, /* 512 */ - { 0, 0, 0, 0, 0, 0 }, /* 1024 */ - { 0, 0, 0, 0, 0, 0 }, /* 2048 */ - { 0, 0, 0, 0, 0, 0 }, /* 4096 */ - { 0, 0, 0, 0, 0, 0 }, /* 8192 */ - { 0, 0, 0, 0, 0, 0 } }; /* 16384 */ +static const uint8_t xdf_sectors[8][6] = { + { 0, 0, 0, 0, 0, 0 }, /* 128 */ + { 0, 0, 0, 0, 0, 0 }, /* 256 */ + { 0, 0, 0, 19, 23, 0 }, /* 512 */ + { 0, 0, 0, 0, 0, 0 }, /* 1024 */ + { 0, 0, 0, 0, 0, 0 }, /* 2048 */ + { 0, 0, 0, 0, 0, 0 }, /* 4096 */ + { 0, 0, 0, 0, 0, 0 }, /* 8192 */ + { 0, 0, 0, 0, 0, 0 } /* 16384 */ +}; -static const uint8_t xdf_types[8][6] = { { 0, 0, 0, 0, 0, 0 }, /* 128 */ - { 0, 0, 0, 0, 0, 0 }, /* 256 */ - { 0, 0, 0, 1, 2, 0 }, /* 512 */ - { 0, 0, 0, 0, 0, 0 }, /* 1024 */ - { 0, 0, 0, 0, 0, 0 }, /* 2048 */ - { 0, 0, 0, 0, 0, 0 }, /* 4096 */ - { 0, 0, 0, 0, 0, 0 }, /* 8192 */ - { 0, 0, 0, 0, 0, 0 } }; /* 16384 */ +static const uint8_t xdf_types[8][6] = { + { 0, 0, 0, 0, 0, 0 }, /* 128 */ + { 0, 0, 0, 0, 0, 0 }, /* 256 */ + { 0, 0, 0, 1, 2, 0 }, /* 512 */ + { 0, 0, 0, 0, 0, 0 }, /* 1024 */ + { 0, 0, 0, 0, 0, 0 }, /* 2048 */ + { 0, 0, 0, 0, 0, 0 }, /* 4096 */ + { 0, 0, 0, 0, 0, 0 }, /* 8192 */ + { 0, 0, 0, 0, 0, 0 } /* 16384 */ +}; -static const double bit_rates_300[6] = { (250.0 * 300.0) / 360.0, 250.0, 300.0, (500.0 * 300.0) / 360.0, 500.0, 1000.0 }; +static const double bit_rates_300[6] = { (250.0 * 300.0) / 360.0, 250.0, 300.0, (500.0 * 300.0) / 360.0, 500.0, 1000.0 }; -static const uint8_t rates[6] = { 2, 2, 1, 4, 0, 3 }; +static const uint8_t rates[6] = { 2, 2, 1, 4, 0, 3 }; -static const uint8_t holes[6] = { 0, 0, 0, 1, 1, 2 }; +static const uint8_t holes[6] = { 0, 0, 0, 1, 1, 2 }; -const int gap3_sizes[5][8][48] = { { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][0] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][1] */ - 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][2] */ - 0x00, 0x00, 0x6C, 0x48, 0x2A, 0x08, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x26, 0x00, 0x00, 0x00, 0x00, /* [0][3] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][4] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][5] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][6] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][7] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, - { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][0] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][1] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x1C, 0x0E, 0x00, 0x00, /* [1][2] */ - 0x00, 0x00, 0x6C, 0x48, 0x2A, 0x08, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][3] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][4] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][5] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][6] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][7] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, - { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][0] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x0C, 0x00, 0x00, 0x00, 0x36, /* [2][1] */ - 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x50, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][2] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0xF0, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][3] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][4] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][5] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][6] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][7] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, - { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][0] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][1] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][2] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x53, 0x4E, 0x3D, 0x2C, 0x1C, 0x0D, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][3] */ - 0x00, 0x00, 0xF7, 0xAF, 0x6F, 0x55, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][4] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][5] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][6] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][7] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, - { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][0] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][1] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x54, /* [4][2] */ - 0x38, 0x23, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][3] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][4] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][5] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][6] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][7] */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }; +const int gap3_sizes[5][8][48] = { + { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][0] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][1] */ + 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][2] */ + 0x00, 0x00, 0x6C, 0x48, 0x2A, 0x08, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x26, 0x00, 0x00, 0x00, 0x00, /* [0][3] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][4] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][5] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][6] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [0][7] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } + }, + { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][0] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][1] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x1C, 0x0E, 0x00, 0x00, /* [1][2] */ + 0x00, 0x00, 0x6C, 0x48, 0x2A, 0x08, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][3] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][4] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][5] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][6] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [1][7] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } + }, + { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][0] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x0C, 0x00, 0x00, 0x00, 0x36, /* [2][1] */ + 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x50, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][2] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0xF0, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][3] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][4] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][5] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][6] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [2][7] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } + }, + { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][0] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][1] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][2] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x53, 0x4E, 0x3D, 0x2C, 0x1C, 0x0D, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][3] */ + 0x00, 0x00, 0xF7, 0xAF, 0x6F, 0x55, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][4] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][5] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][6] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [3][7] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } + }, + { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][0] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][1] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x54, /* [4][2] */ + 0x38, 0x23, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][3] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][4] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][5] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][6] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* [4][7] */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } + } +}; #ifdef ENABLE_IMG_LOG int img_do_log = ENABLE_IMG_LOG; @@ -856,8 +889,8 @@ img_load(int drive, char *fn) fseek(dev->f, 0x03, SEEK_SET); (void) !fread(&bpb_bps, 1, 2, dev->f); #if 0 - fseek(dev->f, 0x0B, SEEK_SET); - (void) !fread(&bpb_total, 1, 2, dev->f); + fseek(dev->f, 0x0B, SEEK_SET); + (void) !fread(&bpb_total, 1, 2, dev->f); #endif fseek(dev->f, 0x10, SEEK_SET); bpb_sectors = fgetc(dev->f); @@ -958,13 +991,13 @@ jump_if_fdf: img_log("BPB reports %i sides and %i bytes per sector (%i sectors total)\n", bpb_sides, bpb_bps, bpb_total); - /* Invalid conditions: */ - guess = (bpb_sides < 1); /* Sides < 1; */ - guess = guess || (bpb_sides > 2); /* Sides > 2; */ - guess = guess || !bps_is_valid(bpb_bps); /* Invalid number of bytes per sector; */ - guess = guess || !first_byte_is_valid(first_byte); /* Invalid first bytes; */ - guess = guess || !is_divisible(bpb_total, bpb_sectors); /* Total sectors not divisible by sectors per track; */ - guess = guess || !is_divisible(bpb_total, bpb_sides); /* Total sectors not divisible by sides. */ + /* Invalid conditions: */ + guess = (bpb_sides < 1); /* Sides < 1; */ + guess = guess || (bpb_sides > 2); /* Sides > 2; */ + guess = guess || !bps_is_valid(bpb_bps); /* Invalid number of bytes per sector; */ + guess = guess || !first_byte_is_valid(first_byte); /* Invalid first bytes; */ + guess = guess || !is_divisible(bpb_total, bpb_sectors); /* Total sectors not divisible by sectors per track; */ + guess = guess || !is_divisible(bpb_total, bpb_sides); /* Total sectors not divisible by sides. */ guess = guess || !fdd_get_check_bpb(drive); guess = guess && !fdi; guess = guess && !cqm; @@ -1069,10 +1102,10 @@ jump_if_fdf: dev->sectors = 42; dev->tracks = 80; #if 0 - } else if (size <= 3440640) { /*HD 1024 sector*/ - dev->sectors = 21; - dev->tracks = 80; - dev->sector_size = 3; + } else if (size <= 3440640) { /*HD 1024 sector*/ + dev->sectors = 21; + dev->tracks = 80; + dev->sector_size = 3; #endif } else if (size <= 3604480) { /*HD 1024 sector*/ dev->sectors = 22; diff --git a/src/floppy/fdd_td0.c b/src/floppy/fdd_td0.c index 4b478baba..bf2b643ff 100644 --- a/src/floppy/fdd_td0.c +++ b/src/floppy/fdd_td0.c @@ -668,27 +668,27 @@ td0_initialize(int drive) * from the CMOS. */ switch (header[6]) { - case 0: /* 5.25" 360k in 1.2M drive: 360 rpm + case 0: /* 5.25" 360k in 1.2M drive: 360 rpm CMOS Drive type: None, value probably reused by Teledisk */ - case 2: /* 5.25" 1.2M 360 rpm */ - case 5: /* 8"/5.25"/3.5" 1.25M 360 rpm */ + case 2: /* 5.25" 1.2M: 360 rpm */ + case 5: /* 8"/5.25"/3.5" 1.25M: 360 rpm */ dev->default_track_flags = (density == 1) ? 0x20 : 0x21; dev->max_sector_size = (density == 1) ? 6 : 5; /* 8192 or 4096 bytes. */ break; - case 1: /* 5.25" 360k: 300 rpm */ - case 3: /* 3.5" 720k: 300 rpm */ + case 1: /* 5.25" 360k: 300 rpm */ + case 3: /* 3.5" 720k: 300 rpm */ dev->default_track_flags = 0x02; dev->max_sector_size = 5; /* 4096 bytes. */ break; - case 4: /* 3.5" 1.44M: 300 rpm */ + case 4: /* 3.5" 1.44M: 300 rpm */ dev->default_track_flags = (density == 1) ? 0x00 : 0x02; dev->max_sector_size = (density == 1) ? 6 : 5; /* 8192 or 4096 bytes. */ break; - case 6: /* 3.5" 2.88M: 300 rpm */ + case 6: /* 3.5" 2.88M: 300 rpm */ dev->default_track_flags = (density == 1) ? 0x00 : ((density == 2) ? 0x03 : 0x02); dev->max_sector_size = (density == 1) ? 6 : ((density == 2) ? 7 : 5); /* 16384, 8192, or 4096 bytes. */ break; diff --git a/src/floppy/fdi2raw.c b/src/floppy/fdi2raw.c index b367db5c1..dcda6afc1 100644 --- a/src/floppy/fdi2raw.c +++ b/src/floppy/fdi2raw.c @@ -20,7 +20,7 @@ * * Copyright 2001-2004 Toni Wilen. * Copyright 2001-2004 Vincent Joguin. - * Copyright 2001 Thomas Harte. + * Copyright 2001-2016 Thomas Harte. */ #define STATIC_INLINE #include @@ -65,7 +65,7 @@ fdi2raw_log(const char *fmt, ...) #ifdef ENABLE_FDI2RAW_LOG # ifdef DEBUG static char * -datalog(uae_u8 *src, int len) +datalog(uint8_t *src, int len) { static char buf[1000]; static int offset; @@ -88,7 +88,7 @@ datalog(uae_u8 *src, int len) } # else static char * -datalog(uae_u8 *src, int len) +datalog(uint8_t *src, int len) { return ""; } @@ -130,37 +130,38 @@ fdi_malloc(int size) #define MAX_TRACKS 166 struct fdi_cache { - uae_u32 *avgp, *minp, *maxp; - uae_u8 *idxp; - int avg_free, idx_free, min_free, max_free; - uae_u32 totalavg, pulses, maxidx, indexoffset; - int weakbits; - int lowlevel; + uint32_t *avgp, *minp, *maxp; + uint8_t *idxp; + int avg_free, idx_free, min_free, max_free; + uint32_t totalavg, pulses, maxidx, indexoffset; + int weakbits; + int lowlevel; }; struct fdi { - uae_u8 *track_src_buffer; - uae_u8 *track_src; - int track_src_len; - uae_u8 *track_dst_buffer; - uae_u8 *track_dst; - uae_u16 *track_dst_buffer_timing; - uae_u8 track_len; - uae_u8 track_type; - int current_track; - int last_track; - int last_head; - int rotation_speed; - int bit_rate; - int disk_type; - int write_protect; - int err; - uae_u8 header[2048]; - int track_offsets[MAX_TRACKS]; - FILE *file; - int out; - int mfmsync_offset; - int *mfmsync_buffer; + uint8_t *track_src_buffer; + uint8_t *track_src; + int32_t track_src_len; + uint8_t *track_dst_buffer; + uint8_t *track_dst; + uint16_t *track_dst_buffer_timing; + uint8_t track_len; + uint8_t track_type; + int current_track; + int last_track; + int last_head; + int rotation_speed; + int bit_rate; + int disk_type; + bool write_protect; + int reversed_side; + int err; + uint8_t header[2048]; + int32_t track_offsets[MAX_TRACKS]; + FILE *file; + int out; + int mfmsync_offset; + int *mfmsync_buffer; /* sector described only */ int index_offset; int encoding_type; @@ -172,7 +173,7 @@ struct fdi { #define get_u32(x) ((((x)[0]) << 24) | (((x)[1]) << 16) | (((x)[2]) << 8) | ((x)[3])) #define get_u24(x) ((((x)[0]) << 16) | (((x)[1]) << 8) | ((x)[2])) STATIC_INLINE void -put_u32(uae_u8 *d, uae_u32 v) +put_u32(uint8_t *d, uint32_t v) { d[0] = v >> 24; d[1] = v >> 16; @@ -181,16 +182,16 @@ put_u32(uae_u8 *d, uae_u32 v) } struct node { - uae_u16 v; + uint16_t v; struct node *left; struct node *right; }; typedef struct node NODE; -static uae_u8 temp, temp2; +static uint8_t temp, temp2; -static uae_u8 * -expand_tree(uae_u8 *stream, NODE *node) +static uint8_t * +expand_tree(uint8_t *stream, NODE *node) { if (temp & temp2) { if (node->left) { @@ -208,7 +209,7 @@ expand_tree(uae_u8 *stream, NODE *node) } return stream; } else { - uae_u8 *stream_temp; + uint8_t *stream_temp; temp2 >>= 1; if (!temp2) { temp = *stream++; @@ -223,27 +224,27 @@ expand_tree(uae_u8 *stream, NODE *node) } } -static uae_u8 * -values_tree8(uae_u8 *stream, NODE *node) +static uint8_t * +values_tree8(uint8_t *stream, NODE *node) { if (node->left == 0) { node->v = *stream++; return stream; } else { - uae_u8 *stream_temp = values_tree8(stream, node->left); + uint8_t *stream_temp = values_tree8(stream, node->left); return values_tree8(stream_temp, node->right); } } -static uae_u8 * -values_tree16(uae_u8 *stream, NODE *node) +static uint8_t * +values_tree16(uint8_t *stream, NODE *node) { if (node->left == 0) { - uae_u16 high_8_bits = (*stream++) << 8; - node->v = high_8_bits | (*stream++); + uint16_t high_8_bits = (*stream++) << 8; + node->v = high_8_bits | (*stream++); return stream; } else { - uae_u8 *stream_temp = values_tree16(stream, node->left); + uint8_t *stream_temp = values_tree16(stream, node->left); return values_tree16(stream_temp, node->right); } } @@ -258,16 +259,18 @@ free_nodes(NODE *node) } } -static uae_u32 -sign_extend16(uae_u32 v) +/// @returns the 32-bit sign extended version of the 16-bit value in the low part of @c v. +static uint32_t +sign_extend16(uint32_t v) { if (v & 0x8000) v |= 0xffff0000; return v; } -static uae_u32 -sign_extend8(uae_u32 v) +/// @returns the 32-bit sign extended version of the 8-bit value in the low part of @c v. +static uint32_t +sign_extend8(uint32_t v) { if (v & 0x80) v |= 0xffffff00; @@ -275,12 +278,12 @@ sign_extend8(uae_u32 v) } static void -fdi_decode(uae_u8 *stream, int size, uae_u8 *out) +fdi_decode(uint8_t *stream, int size, uint8_t *out) { - int i; - uae_u8 sign_extend, sixteen_bit, sub_stream_shift; - NODE root; - NODE *current_node; + int i; + uint8_t sign_extend, sixteen_bit, sub_stream_shift; + NODE root; + NODE *current_node; memset(out, 0, size * 4); sub_stream_shift = 1; @@ -308,9 +311,9 @@ fdi_decode(uae_u8 *stream, int size, uae_u8 *out) /* sub-stream data decode */ temp2 = 0; for (i = 0; i < size; i++) { - uae_u32 v; - uae_u8 decode = 1; - current_node = &root; + uint32_t v; + uint8_t decode = 1; + current_node = &root; while (decode) { if (current_node->left == 0) { decode = 0; @@ -326,7 +329,7 @@ fdi_decode(uae_u8 *stream, int size, uae_u8 *out) current_node = current_node->left; } } - v = ((uae_u32 *) out)[i]; + v = ((uint32_t *) out)[i]; if (sign_extend) { if (sixteen_bit) v |= sign_extend16(current_node->v) << sub_stream_shift; @@ -335,7 +338,7 @@ fdi_decode(uae_u8 *stream, int size, uae_u8 *out) } else { v |= current_node->v << sub_stream_shift; } - ((uae_u32 *) out)[i] = v; + ((uint32_t *) out)[i] = v; } free_nodes(root.left); root.left = 0; @@ -363,7 +366,7 @@ zxx(FDI *fdi) #if 0 static void zyy (FDI *fdi) { - fdi2raw_log("track %d: unsupported track type 0x%02.2X\n", fdi->current_track, fdi->track_type); + fdi2raw_log("track %d: unsupported track type 0x%02.2X\n", fdi->current_track, fdi->track_type); } #endif /* empty track */ @@ -457,7 +460,7 @@ bit_dedrop(FDI *fdi) /* add one byte */ static void -byte_add(FDI *fdi, uae_u8 v) +byte_add(FDI *fdi, uint8_t v) { int i; for (i = 7; i >= 0; i--) @@ -465,14 +468,14 @@ byte_add(FDI *fdi, uae_u8 v) } /* add one word */ static void -word_add(FDI *fdi, uae_u16 v) +word_add(FDI *fdi, uint16_t v) { - byte_add(fdi, (uae_u8) (v >> 8)); - byte_add(fdi, (uae_u8) v); + byte_add(fdi, (uint8_t) (v >> 8)); + byte_add(fdi, (uint8_t) v); } /* add one byte and mfm encode it */ static void -byte_mfm_add(FDI *fdi, uae_u8 v) +byte_mfm_add(FDI *fdi, uint8_t v) { int i; for (i = 7; i >= 0; i--) @@ -480,7 +483,7 @@ byte_mfm_add(FDI *fdi, uae_u8 v) } /* add multiple bytes and mfm encode them */ static void -bytes_mfm_add(FDI *fdi, uae_u8 v, int len) +bytes_mfm_add(FDI *fdi, uint8_t v, int len) { int i; for (i = 0; i < len; i++) @@ -488,7 +491,7 @@ bytes_mfm_add(FDI *fdi, uae_u8 v, int len) } /* add one mfm encoded word and re-mfm encode it */ static void -word_post_mfm_add(FDI *fdi, uae_u16 v) +word_post_mfm_add(FDI *fdi, uint16_t v) { int i; for (i = 14; i >= 0; i -= 2) @@ -529,8 +532,8 @@ s04(FDI *fdi) static void s08(FDI *fdi) { - int bytes = *fdi->track_src++; - uae_u8 byte = *fdi->track_src++; + int bytes = *fdi->track_src++; + uint8_t byte = *fdi->track_src++; if (bytes == 0) bytes = 256; fdi2raw_log("s08:len=%d,data=%02.2X", bytes, byte); @@ -541,8 +544,8 @@ s08(FDI *fdi) static void s09(FDI *fdi) { - int bytes = *fdi->track_src++; - uae_u8 byte = *fdi->track_src++; + int bytes = *fdi->track_src++; + uint8_t byte = *fdi->track_src++; if (bytes == 0) bytes = 256; bit_drop_next(fdi); @@ -554,8 +557,8 @@ s09(FDI *fdi) static void s0a(FDI *fdi) { - int i, bits = (fdi->track_src[0] << 8) | fdi->track_src[1]; - uae_u8 b; + int i, bits = (fdi->track_src[0] << 8) | fdi->track_src[1]; + uint8_t b; fdi->track_src += 2; fdi2raw_log("s0a:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); while (bits >= 8) { @@ -575,8 +578,8 @@ s0a(FDI *fdi) static void s0b(FDI *fdi) { - int i, bits = ((fdi->track_src[0] << 8) | fdi->track_src[1]) + 65536; - uae_u8 b; + int i, bits = ((fdi->track_src[0] << 8) | fdi->track_src[1]) + 65536; + uint8_t b; fdi->track_src += 2; fdi2raw_log("s0b:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); while (bits >= 8) { @@ -596,8 +599,8 @@ s0b(FDI *fdi) static void s0c(FDI *fdi) { - int i, bits = (fdi->track_src[0] << 8) | fdi->track_src[1]; - uae_u8 b; + int i, bits = (fdi->track_src[0] << 8) | fdi->track_src[1]; + uint8_t b; fdi->track_src += 2; bit_drop_next(fdi); fdi2raw_log("s0c:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); @@ -618,8 +621,8 @@ s0c(FDI *fdi) static void s0d(FDI *fdi) { - int i, bits = ((fdi->track_src[0] << 8) | fdi->track_src[1]) + 65536; - uae_u8 b; + int i, bits = ((fdi->track_src[0] << 8) | fdi->track_src[1]) + 65536; + uint8_t b; fdi->track_src += 2; bit_drop_next(fdi); fdi2raw_log("s0d:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); @@ -643,7 +646,7 @@ s0d(FDI *fdi) /* just for testing integrity of Amiga sectors */ -/*static void rotateonebit (uae_u8 *start, uae_u8 *end, int shift) +/*static void rotateonebit (uint8_t *start, uint8_t *end, int shift) { if (shift == 0) return; @@ -654,21 +657,21 @@ s0d(FDI *fdi) } }*/ -/*static uae_u16 getmfmword (uae_u8 *mbuf) +/*static uint16_t getmfmword (uint8_t *mbuf) { - uae_u32 v; + uint32_t v; v = (mbuf[0] << 8) | (mbuf[1] << 0); if (check_offset == 0) - return v; + return (uint16_t)v; v <<= 8; v |= mbuf[2]; v >>= check_offset; - return v; + return (uint16_t)v; }*/ #define MFMMASK 0x55555555 -/*static uae_u32 getmfmlong (uae_u8 * mbuf) +/*static uint32_t getmfmlong (uint8_t * mbuf) { return ((getmfmword (mbuf) << 16) | getmfmword (mbuf + 2)) & MFMMASK; }*/ @@ -676,165 +679,165 @@ s0d(FDI *fdi) #if 0 static int amiga_check_track (FDI *fdi) { - int i, j, secwritten = 0; - int fwlen = fdi->out / 8; - int length = 2 * fwlen; - int drvsec = 11; - uae_u32 odd, even, chksum, id, dlong; - uae_u8 *secdata; - uae_u8 secbuf[544]; - uae_u8 bigmfmbuf[60000]; - uae_u8 *mbuf, *mbuf2, *mend; - char sectable[22]; - uae_u8 *raw = fdi->track_dst_buffer; - int slabel, off; - int ok = 1; + int i, j, secwritten = 0; + int fwlen = fdi->out / 8; + int length = 2 * fwlen; + int drvsec = 11; + uint32_t odd, even, chksum, id, dlong; + uint8_t *secdata; + uint8_t secbuf[544]; + uint8_t bigmfmbuf[60000]; + uint8_t *mbuf, *mbuf2, *mend; + char sectable[22]; + uint8_t *raw = fdi->track_dst_buffer; + int slabel, off; + int ok = 1; - memset (bigmfmbuf, 0, sizeof (bigmfmbuf)); - mbuf = bigmfmbuf; - check_offset = 0; - for (i = 0; i < (fdi->out + 7) / 8; i++) - *mbuf++ = raw[i]; - off = fdi->out & 7; + memset (bigmfmbuf, 0, sizeof (bigmfmbuf)); + mbuf = bigmfmbuf; + check_offset = 0; + for (i = 0; i < (fdi->out + 7) / 8; i++) + *mbuf++ = raw[i]; + off = fdi->out & 7; # if 1 - if (off > 0) { - mbuf--; - *mbuf &= ~((1 << (8 - off)) - 1); - } - j = 0; - while (i < (fdi->out + 7) / 8 + 600) { - *mbuf++ |= (raw[j] >> off) | ((raw[j + 1]) << (8 - off)); - j++; - i++; - } + if (off > 0) { + mbuf--; + *mbuf &= ~((1 << (8 - off)) - 1); + } + j = 0; + while (i < (fdi->out + 7) / 8 + 600) { + *mbuf++ |= (raw[j] >> off) | ((raw[j + 1]) << (8 - off)); + j++; + i++; + } # endif - mbuf = bigmfmbuf; + mbuf = bigmfmbuf; - memset (sectable, 0, sizeof (sectable)); - mend = bigmfmbuf + length; - mend -= (4 + 16 + 8 + 512); + memset (sectable, 0, sizeof (sectable)); + mend = bigmfmbuf + length; + mend -= (4 + 16 + 8 + 512); - while (secwritten < drvsec) { - int trackoffs; + while (secwritten < drvsec) { + int trackoffs; - for (;;) { - rotateonebit (bigmfmbuf, mend, 1); - if (getmfmword (mbuf) == 0) - break; - if (secwritten == 10) { - mbuf[0] = 0x44; - mbuf[1] = 0x89; - } - if (check_offset > 7) { - check_offset = 0; - mbuf++; - if (mbuf >= mend || *mbuf == 0) - break; - } - if (getmfmword (mbuf) == 0x4489) - break; - } - if (mbuf >= mend || *mbuf == 0) - break; + for (;;) { + rotateonebit (bigmfmbuf, mend, 1); + if (getmfmword (mbuf) == 0) + break; + if (secwritten == 10) { + mbuf[0] = 0x44; + mbuf[1] = 0x89; + } + if (check_offset > 7) { + check_offset = 0; + mbuf++; + if (mbuf >= mend || *mbuf == 0) + break; + } + if (getmfmword (mbuf) == 0x4489) + break; + } + if (mbuf >= mend || *mbuf == 0) + break; - rotateonebit (bigmfmbuf, mend, check_offset); - check_offset = 0; + rotateonebit (bigmfmbuf, mend, check_offset); + check_offset = 0; - while (getmfmword (mbuf) == 0x4489) - mbuf+= 1 * 2; - mbuf2 = mbuf + 8; + while (getmfmword (mbuf) == 0x4489) + mbuf+= 1 * 2; + mbuf2 = mbuf + 8; - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 2 * 2); - mbuf += 4 * 2; - id = (odd << 1) | even; + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 2 * 2); + mbuf += 4 * 2; + id = (odd << 1) | even; - trackoffs = (id & 0xff00) >> 8; - if (trackoffs + 1 > drvsec) { - fdi2raw_log("illegal sector offset %d\n",trackoffs); - ok = 0; - mbuf = mbuf2; - continue; - } - if ((id >> 24) != 0xff) { - fdi2raw_log("sector %d format type %02.2X?\n", trackoffs, id >> 24); - ok = 0; - } - chksum = odd ^ even; - slabel = 0; - for (i = 0; i < 4; i++) { - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 8 * 2); - mbuf += 2* 2; + trackoffs = (id & 0xff00) >> 8; + if (trackoffs + 1 > drvsec) { + fdi2raw_log("illegal sector offset %d\n",trackoffs); + ok = 0; + mbuf = mbuf2; + continue; + } + if ((id >> 24) != 0xff) { + fdi2raw_log("sector %d format type %02.2X?\n", trackoffs, id >> 24); + ok = 0; + } + chksum = odd ^ even; + slabel = 0; + for (i = 0; i < 4; i++) { + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 8 * 2); + mbuf += 2* 2; - dlong = (odd << 1) | even; - if (dlong) slabel = 1; - chksum ^= odd ^ even; - } - mbuf += 8 * 2; - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 2 * 2); - mbuf += 4 * 2; - if (((odd << 1) | even) != chksum) { - fdi2raw_log("sector %d header crc error\n", trackoffs); - ok = 0; - mbuf = mbuf2; - continue; - } - fdi2raw_log("sector %d header crc ok\n", trackoffs); - if (((id & 0x00ff0000) >> 16) != (uae_u32)fdi->current_track) { - fdi2raw_log("illegal track number %d <> %d\n",fdi->current_track,(id & 0x00ff0000) >> 16); - ok++; - mbuf = mbuf2; - continue; - } - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 2 * 2); - mbuf += 4 * 2; - chksum = (odd << 1) | even; - secdata = secbuf + 32; - for (i = 0; i < 128; i++) { - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 256 * 2); - mbuf += 2 * 2; - dlong = (odd << 1) | even; - *secdata++ = (uae_u8) (dlong >> 24); - *secdata++ = (uae_u8) (dlong >> 16); - *secdata++ = (uae_u8) (dlong >> 8); - *secdata++ = (uae_u8) dlong; - chksum ^= odd ^ even; - } - mbuf += 256 * 2; - if (chksum) { - fdi2raw_log("sector %d data checksum error\n",trackoffs); - ok = 0; - } else if (sectable[trackoffs]) { - fdi2raw_log("sector %d already found?\n", trackoffs); - mbuf = mbuf2; - } else { - fdi2raw_log("sector %d ok\n",trackoffs); - if (slabel) fdi2raw_log("(non-empty sector header)\n"); - sectable[trackoffs] = 1; - secwritten++; - if (trackoffs == 9) - mbuf += 0x228; - } - } - for (i = 0; i < drvsec; i++) { - if (!sectable[i]) { - fdi2raw_log("sector %d missing\n", i); - ok = 0; - } - } - return ok; + dlong = (odd << 1) | even; + if (dlong) slabel = 1; + chksum ^= odd ^ even; + } + mbuf += 8 * 2; + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 2 * 2); + mbuf += 4 * 2; + if (((odd << 1) | even) != chksum) { + fdi2raw_log("sector %d header crc error\n", trackoffs); + ok = 0; + mbuf = mbuf2; + continue; + } + fdi2raw_log("sector %d header crc ok\n", trackoffs); + if (((id & 0x00ff0000) >> 16) != (uint32_t)fdi->current_track) { + fdi2raw_log("illegal track number %d <> %d\n",fdi->current_track,(id & 0x00ff0000) >> 16); + ok++; + mbuf = mbuf2; + continue; + } + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 2 * 2); + mbuf += 4 * 2; + chksum = (odd << 1) | even; + secdata = secbuf + 32; + for (i = 0; i < 128; i++) { + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 256 * 2); + mbuf += 2 * 2; + dlong = (odd << 1) | even; + *secdata++ = (uint8_t) (dlong >> 24); + *secdata++ = (uint8_t) (dlong >> 16); + *secdata++ = (uint8_t) (dlong >> 8); + *secdata++ = (uint8_t) dlong; + chksum ^= odd ^ even; + } + mbuf += 256 * 2; + if (chksum) { + fdi2raw_log("sector %d data checksum error\n",trackoffs); + ok = 0; + } else if (sectable[trackoffs]) { + fdi2raw_log("sector %d already found?\n", trackoffs); + mbuf = mbuf2; + } else { + fdi2raw_log("sector %d ok\n",trackoffs); + if (slabel) fdi2raw_log("(non-empty sector header)\n"); + sectable[trackoffs] = 1; + secwritten++; + if (trackoffs == 9) + mbuf += 0x228; + } + } + for (i = 0; i < drvsec; i++) { + if (!sectable[i]) { + fdi2raw_log("sector %d missing\n", i); + ok = 0; + } + } + return ok; } #endif static void -amiga_data_raw(FDI *fdi, uae_u8 *secbuf, uae_u8 *crc, int len) +amiga_data_raw(FDI *fdi, uint8_t *secbuf, uint8_t *crc, int len) { - int i; - uae_u8 crcbuf[4]; + int i; + uint8_t crcbuf[4]; if (!crc) { memset(crcbuf, 0, 4); @@ -848,11 +851,11 @@ amiga_data_raw(FDI *fdi, uae_u8 *secbuf, uae_u8 *crc, int len) } static void -amiga_data(FDI *fdi, uae_u8 *secbuf) +amiga_data(FDI *fdi, uint8_t *secbuf) { - uae_u16 mfmbuf[4 + 512]; - uae_u32 dodd, deven, dck; - int i; + uint16_t mfmbuf[4 + 512]; + uint32_t dodd, deven, dck; + int i; for (i = 0; i < 512; i += 4) { deven = ((secbuf[i + 0] << 24) | (secbuf[i + 1] << 16) @@ -860,10 +863,10 @@ amiga_data(FDI *fdi, uae_u8 *secbuf) dodd = deven >> 1; deven &= 0x55555555; dodd &= 0x55555555; - mfmbuf[(i >> 1) + 4] = (uae_u16) (dodd >> 16); - mfmbuf[(i >> 1) + 5] = (uae_u16) dodd; - mfmbuf[(i >> 1) + 256 + 4] = (uae_u16) (deven >> 16); - mfmbuf[(i >> 1) + 256 + 5] = (uae_u16) deven; + mfmbuf[(i >> 1) + 4] = (uint16_t) (dodd >> 16); + mfmbuf[(i >> 1) + 5] = (uint16_t) dodd; + mfmbuf[(i >> 1) + 256 + 4] = (uint16_t) (deven >> 16); + mfmbuf[(i >> 1) + 256 + 5] = (uint16_t) deven; } dck = 0; for (i = 4; i < 4 + 512; i += 2) @@ -872,22 +875,22 @@ amiga_data(FDI *fdi, uae_u8 *secbuf) dodd >>= 1; deven &= 0x55555555; dodd &= 0x55555555; - mfmbuf[0] = (uae_u16) (dodd >> 16); - mfmbuf[1] = (uae_u16) dodd; - mfmbuf[2] = (uae_u16) (deven >> 16); - mfmbuf[3] = (uae_u16) deven; + mfmbuf[0] = (uint16_t) (dodd >> 16); + mfmbuf[1] = (uint16_t) dodd; + mfmbuf[2] = (uint16_t) (deven >> 16); + mfmbuf[3] = (uint16_t) deven; for (i = 0; i < 4 + 512; i++) word_post_mfm_add(fdi, mfmbuf[i]); } static void -amiga_sector_header(FDI *fdi, uae_u8 *header, uae_u8 *data, int sector, int untilgap) +amiga_sector_header(FDI *fdi, uint8_t *header, uint8_t *data, int sector, int untilgap) { - uae_u8 headerbuf[4], databuf[16]; - uae_u32 deven, dodd, hck; - uae_u16 mfmbuf[24]; - int i; + uint8_t headerbuf[4], databuf[16]; + uint32_t deven, dodd, hck; + uint16_t mfmbuf[24]; + int i; byte_mfm_add(fdi, 0); byte_mfm_add(fdi, 0); @@ -897,9 +900,9 @@ amiga_sector_header(FDI *fdi, uae_u8 *header, uae_u8 *data, int sector, int unti memcpy(headerbuf, header, 4); } else { headerbuf[0] = 0xff; - headerbuf[1] = (uae_u8) fdi->current_track; - headerbuf[2] = (uae_u8) sector; - headerbuf[3] = (uae_u8) untilgap; + headerbuf[1] = (uint8_t) fdi->current_track; + headerbuf[2] = (uint8_t) sector; + headerbuf[3] = (uint8_t) untilgap; } if (data) memcpy(databuf, data, 16); @@ -911,20 +914,20 @@ amiga_sector_header(FDI *fdi, uae_u8 *header, uae_u8 *data, int sector, int unti dodd = deven >> 1; deven &= 0x55555555; dodd &= 0x55555555; - mfmbuf[0] = (uae_u16) (dodd >> 16); - mfmbuf[1] = (uae_u16) dodd; - mfmbuf[2] = (uae_u16) (deven >> 16); - mfmbuf[3] = (uae_u16) deven; + mfmbuf[0] = (uint16_t) (dodd >> 16); + mfmbuf[1] = (uint16_t) dodd; + mfmbuf[2] = (uint16_t) (deven >> 16); + mfmbuf[3] = (uint16_t) deven; for (i = 0; i < 16; i += 4) { deven = ((databuf[i] << 24) | (databuf[i + 1] << 16) | (databuf[i + 2] << 8) | (databuf[i + 3])); dodd = deven >> 1; deven &= 0x55555555; dodd &= 0x55555555; - mfmbuf[(i >> 1) + 0 + 4] = (uae_u16) (dodd >> 16); - mfmbuf[(i >> 1) + 0 + 5] = (uae_u16) dodd; - mfmbuf[(i >> 1) + 8 + 4] = (uae_u16) (deven >> 16); - mfmbuf[(i >> 1) + 8 + 5] = (uae_u16) deven; + mfmbuf[(i >> 1) + 0 + 4] = (uint16_t) (dodd >> 16); + mfmbuf[(i >> 1) + 0 + 5] = (uint16_t) dodd; + mfmbuf[(i >> 1) + 8 + 4] = (uint16_t) (deven >> 16); + mfmbuf[(i >> 1) + 8 + 5] = (uint16_t) deven; } hck = 0; for (i = 0; i < 4 + 16; i += 2) @@ -933,10 +936,10 @@ amiga_sector_header(FDI *fdi, uae_u8 *header, uae_u8 *data, int sector, int unti dodd >>= 1; deven &= 0x55555555; dodd &= 0x55555555; - mfmbuf[20] = (uae_u16) (dodd >> 16); - mfmbuf[21] = (uae_u16) dodd; - mfmbuf[22] = (uae_u16) (deven >> 16); - mfmbuf[23] = (uae_u16) deven; + mfmbuf[20] = (uint16_t) (dodd >> 16); + mfmbuf[21] = (uint16_t) dodd; + mfmbuf[22] = (uint16_t) (deven >> 16); + mfmbuf[23] = (uint16_t) deven; for (i = 0; i < 4 + 16 + 4; i++) word_post_mfm_add(fdi, mfmbuf[i]); @@ -1018,11 +1021,11 @@ s27(FDI *fdi) /* IBM */ /* *** */ -static uae_u16 -ibm_crc(uae_u8 byte, int reset) +static uint16_t +ibm_crc(uint8_t byte, int reset) { - static uae_u16 crc; - int i; + static uint16_t crc; + int i; if (reset) crc = 0xcdb4; @@ -1042,11 +1045,11 @@ ibm_crc(uae_u8 byte, int reset) } static void -ibm_data(FDI *fdi, uae_u8 *data, uae_u8 *crc, int len) +ibm_data(FDI *fdi, uint8_t *data, uint8_t *crc, int len) { - int i; - uae_u8 crcbuf[2]; - uae_u16 crcv = 0; + int i; + uint8_t crcbuf[2]; + uint16_t crcv = 0; word_add(fdi, 0x4489); word_add(fdi, 0x4489); @@ -1059,20 +1062,20 @@ ibm_data(FDI *fdi, uae_u8 *data, uae_u8 *crc, int len) } if (!crc) { crc = crcbuf; - crc[0] = (uae_u8) (crcv >> 8); - crc[1] = (uae_u8) crcv; + crc[0] = (uint8_t) (crcv >> 8); + crc[1] = (uint8_t) crcv; } byte_mfm_add(fdi, crc[0]); byte_mfm_add(fdi, crc[1]); } static void -ibm_sector_header(FDI *fdi, uae_u8 *data, uae_u8 *crc, int secnum, int pre) +ibm_sector_header(FDI *fdi, uint8_t *data, uint8_t *crc, int secnum, int pre) { - uae_u8 secbuf[5]; - uae_u8 crcbuf[2]; - uae_u16 crcv; - int i; + uint8_t secbuf[5]; + uint8_t crcbuf[2]; + uint16_t crcv; + int i; if (pre) bytes_mfm_add(fdi, 0, 12); @@ -1081,9 +1084,9 @@ ibm_sector_header(FDI *fdi, uae_u8 *data, uae_u8 *crc, int secnum, int pre) word_add(fdi, 0x4489); secbuf[0] = 0xfe; if (secnum >= 0) { - secbuf[1] = (uae_u8) (fdi->current_track / 2); - secbuf[2] = (uae_u8) (fdi->current_track % 2); - secbuf[3] = (uae_u8) secnum; + secbuf[1] = (uint8_t) (fdi->current_track / 2); + secbuf[2] = (uint8_t) (fdi->current_track % 2); + secbuf[3] = (uint8_t) secnum; secbuf[4] = 2; } else { memcpy(secbuf + 1, data, 4); @@ -1096,8 +1099,8 @@ ibm_sector_header(FDI *fdi, uae_u8 *data, uae_u8 *crc, int secnum, int pre) if (crc) { memcpy(crcbuf, crc, 2); } else { - crcbuf[0] = (uae_u8) (crcv >> 8); - crcbuf[1] = (uae_u8) crcv; + crcbuf[0] = (uint8_t) (crcv >> 8); + crcbuf[1] = (uint8_t) crcv; } /* data */ for (i = 0; i < 5; i++) @@ -1276,8 +1279,8 @@ track_amiga(struct fdi *fdi, int first_sector, int max_sector) static void track_atari_st(struct fdi *fdi, int max_sector) { - int i, gap3 = 0; - uae_u8 *p = fdi->track_src; + int i, gap3 = 0; + uint8_t *p = fdi->track_src; switch (max_sector) { case 9: @@ -1301,8 +1304,8 @@ track_atari_st(struct fdi *fdi, int max_sector) static void track_pc(struct fdi *fdi, int max_sector) { - int i, gap3; - uae_u8 *p = fdi->track_src; + int i, gap3; + uint8_t *p = fdi->track_src; switch (max_sector) { case 8: @@ -1331,7 +1334,7 @@ track_pc(struct fdi *fdi, int max_sector) static void track_amiga_dd(struct fdi *fdi) { - uae_u8 *p = fdi->track_src; + uint8_t *p = fdi->track_src; track_amiga(fdi, fdi->track_len >> 4, 11); fdi->track_src = p + (fdi->track_len & 15) * 512; } @@ -1339,7 +1342,7 @@ track_amiga_dd(struct fdi *fdi) static void track_amiga_hd(struct fdi *fdi) { - uae_u8 *p = fdi->track_src; + uint8_t *p = fdi->track_src; track_amiga(fdi, 0, 22); fdi->track_src = p + fdi->track_len * 256; } @@ -1420,8 +1423,8 @@ static int handle_sectors_described_track(FDI *fdi) { #ifdef ENABLE_FDI2RAW_LOG - int oldout; - uae_u8 *start_src = fdi->track_src; + int oldout; + uint8_t *start_src = fdi->track_src; #endif fdi->encoding_type = *fdi->track_src++; fdi->index_offset = get_u32(fdi->track_src); @@ -1454,20 +1457,20 @@ handle_sectors_described_track(FDI *fdi) return fdi->out; } -static uae_u8 * -fdi_decompress(int pulses, uae_u8 *sizep, uae_u8 *src, int *dofree) +static uint8_t * +fdi_decompress(int pulses, uint8_t *sizep, uint8_t *src, int *dofree) { - uae_u32 size = get_u24(sizep); - uae_u32 *dst2; - int len = size & 0x3fffff; - uae_u8 *dst; - int mode = size >> 22, i; + uint32_t size = get_u24(sizep); + uint32_t *dst2; + int len = size & 0x3fffff; + uint8_t *dst; + int mode = size >> 22, i; *dofree = 0; if (mode == 0 && pulses * 2 > len) mode = 1; if (mode == 0) { - dst2 = (uae_u32 *) src; + dst2 = (uint32_t *) src; dst = src; for (i = 0; i < pulses; i++) { *dst2++ = get_u32(src); @@ -1484,7 +1487,7 @@ fdi_decompress(int pulses, uae_u8 *sizep, uae_u8 *src, int *dofree) } static void -dumpstream(int track, uae_u8 *stream, int len) +dumpstream(int track, uint8_t *stream, int len) { #if 0 char name[100]; @@ -1499,8 +1502,8 @@ dumpstream(int track, uae_u8 *stream, int len) static int bitoffset; -STATIC_INLINE void -addbit(uae_u8 *p, int bit) +static inline void +addbit(uint8_t *p, int bit) { int off1 = bitoffset / 8; int off2 = bitoffset % 8; @@ -1517,7 +1520,7 @@ struct pulse_sample { static int pulse_limitval = 15; /* tolerance of 15% */ static struct pulse_sample psarray[FDI_MAX_ARRAY]; static int array_index; -static unsigned long total; +static uint32_t total; static int totaldiv; static void @@ -1536,145 +1539,145 @@ init_array(uint32_t standard_MFM_2_bit_cell_size, int nb_of_bits) #if 0 -static void fdi2_decode (FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 *maxp, uae_u8 *idx, int maxidx, int *indexoffsetp, int pulses, int mfm) -{ - uint32_t adjust; - uint32_t adjusted_pulse; - uint32_t standard_MFM_2_bit_cell_size = totalavg / 50000; - uint32_t standard_MFM_8_bit_cell_size = totalavg / 12500; - int real_size, i, j, eodat, outstep; - int indexoffset = *indexoffsetp; - uae_u8 *d = fdi->track_dst_buffer; - uae_u16 *pt = fdi->track_dst_buffer_timing; - uae_u32 ref_pulse, pulse; - - /* detects a long-enough stable pulse coming just after another stable pulse */ - i = 1; - while ( (i < pulses) && ( (idx[i] < maxidx) - || (idx[i - 1] < maxidx) - || (avgp[i] < (standard_MFM_2_bit_cell_size - (standard_MFM_2_bit_cell_size / 4))) ) ) - i++; - if (i == pulses) { - fdi2raw_log("No stable and long-enough pulse in track.\n"); - return; - } - i--; - eodat = i; - adjust = 0; - total = 0; - totaldiv = 0; - init_array(standard_MFM_2_bit_cell_size, 2); - bitoffset = 0; - ref_pulse = 0; - outstep = 0; - while (outstep < 2) { - - /* calculates the current average bitrate from previous decoded data */ - uae_u32 avg_size = (total << 3) / totaldiv; /* this is the new average size for one MFM bit */ - /* uae_u32 avg_size = (uae_u32)((((float)total)*8.0) / ((float)totaldiv)); */ - /* you can try tighter ranges than 25%, or wider ranges. I would probably go for tighter... */ - if ((avg_size < (standard_MFM_8_bit_cell_size - (pulse_limitval * standard_MFM_8_bit_cell_size / 100))) || - (avg_size > (standard_MFM_8_bit_cell_size + (pulse_limitval * standard_MFM_8_bit_cell_size / 100)))) { - avg_size = standard_MFM_8_bit_cell_size; - } - /* this is to prevent the average value from going too far - * from the theoretical value, otherwise it could progressively go to (2 * - * real value), or (real value / 2), etc. */ - - /* gets the next long-enough pulse (this may require more than one pulse) */ - pulse = 0; - while (pulse < ((avg_size / 4) - (avg_size / 16))) { - int indx; - i++; - if (i >= pulses) - i = 0; - indx = idx[i]; - if (rand() <= (indx * RAND_MAX) / maxidx) { - pulse += avgp[i] - ref_pulse; - if (indx >= maxidx) - ref_pulse = 0; - else - ref_pulse = avgp[i]; - } - if (i == eodat) - outstep++; - if (outstep == 1 && indexoffset == i) - *indexoffsetp = bitoffset; - } - - /* gets the size in bits from the pulse width, considering the current average bitrate */ - adjusted_pulse = pulse; - real_size = 0; - while (adjusted_pulse >= avg_size) { - real_size += 4; - adjusted_pulse -= avg_size / 2; - } - adjusted_pulse <<= 3; - while (adjusted_pulse >= ((avg_size * 4) + (avg_size / 4))) { - real_size += 2; - adjusted_pulse -= avg_size * 2; - } - if (adjusted_pulse >= ((avg_size * 3) + (avg_size / 4))) { - if (adjusted_pulse <= ((avg_size * 4) - (avg_size / 4))) { - if ((2 * ((adjusted_pulse >> 2) - adjust)) <= ((2 * avg_size) - (avg_size / 4))) - real_size += 3; - else - real_size += 4; - } else - real_size += 4; - } else { - if (adjusted_pulse > ((avg_size * 3) - (avg_size / 4))) { - real_size += 3; - } else { - if (adjusted_pulse >= ((avg_size * 2) + (avg_size / 4))) { - if ((2 * ((adjusted_pulse >> 2) - adjust)) < (avg_size + (avg_size / 4))) - real_size += 2; - else - real_size += 3; - } else - real_size += 2; - } - } - - if (outstep == 1) { - for (j = real_size; j > 1; j--) - addbit (d, 0); - addbit (d, 1); - for (j = 0; j < real_size; j++) - *pt++ = (uae_u16)(pulse / real_size); - } - - /* prepares for the next pulse */ - adjust = ((real_size * avg_size)/8) - pulse; - total -= psarray[array_index].size; - totaldiv -= psarray[array_index].number_of_bits; - psarray[array_index].size = pulse; - psarray[array_index].number_of_bits = real_size; - total += pulse; - totaldiv += real_size; - array_index++; - if (array_index >= FDI_MAX_ARRAY) - array_index = 0; - } - - fdi->out = bitoffset; -} - -#else - -static void -fdi2_decode(FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 *maxp, uae_u8 *idx, int maxidx, int *indexoffsetp, int pulses, int mfm) +static void fdi2_decode (FDI *fdi, uint32_t totalavg, uint32_t *avgp, uint32_t *minp, uint32_t *maxp, uint8_t *idx, int maxidx, int *indexoffsetp, int pulses, int mfm) { uint32_t adjust; uint32_t adjusted_pulse; uint32_t standard_MFM_2_bit_cell_size = totalavg / 50000; uint32_t standard_MFM_8_bit_cell_size = totalavg / 12500; - int real_size, i, j, nexti, eodat, outstep, randval; - int indexoffset = *indexoffsetp; - uae_u8 *d = fdi->track_dst_buffer; - uae_u16 *pt = fdi->track_dst_buffer_timing; - uae_u32 ref_pulse, pulse; - long jitter; + int real_size, i, j, eodat, outstep; + int indexoffset = *indexoffsetp; + uint8_t *d = fdi->track_dst_buffer; + uint16_t *pt = fdi->track_dst_buffer_timing; + uint32_t ref_pulse, pulse; + + /* detects a long-enough stable pulse coming just after another stable pulse */ + i = 1; + while ( (i < pulses) && ( (idx[i] < maxidx) + || (idx[i - 1] < maxidx) + || (avgp[i] < (standard_MFM_2_bit_cell_size - (standard_MFM_2_bit_cell_size / 4))) ) ) + i++; + if (i == pulses) { + fdi2raw_log("No stable and long-enough pulse in track.\n"); + return; + } + i--; + eodat = i; + adjust = 0; + total = 0; + totaldiv = 0; + init_array(standard_MFM_2_bit_cell_size, 2); + bitoffset = 0; + ref_pulse = 0; + outstep = 0; + while (outstep < 2) { + + /* calculates the current average bitrate from previous decoded data */ + uint32_t avg_size = (total << 3) / totaldiv; /* this is the new average size for one MFM bit */ + /* uint32_t avg_size = (uint32_t)((((float)total)*8.0) / ((float)totaldiv)); */ + /* you can try tighter ranges than 25%, or wider ranges. I would probably go for tighter... */ + if ((avg_size < (standard_MFM_8_bit_cell_size - (pulse_limitval * standard_MFM_8_bit_cell_size / 100))) || + (avg_size > (standard_MFM_8_bit_cell_size + (pulse_limitval * standard_MFM_8_bit_cell_size / 100)))) { + avg_size = standard_MFM_8_bit_cell_size; + } + /* this is to prevent the average value from going too far + * from the theoretical value, otherwise it could progressively go to (2 * + * real value), or (real value / 2), etc. */ + + /* gets the next long-enough pulse (this may require more than one pulse) */ + pulse = 0; + while (pulse < ((avg_size / 4) - (avg_size / 16))) { + int indx; + i++; + if (i >= pulses) + i = 0; + indx = idx[i]; + if (rand() <= (indx * RAND_MAX) / maxidx) { + pulse += avgp[i] - ref_pulse; + if (indx >= maxidx) + ref_pulse = 0; + else + ref_pulse = avgp[i]; + } + if (i == eodat) + outstep++; + if (outstep == 1 && indexoffset == i) + *indexoffsetp = bitoffset; + } + + /* gets the size in bits from the pulse width, considering the current average bitrate */ + adjusted_pulse = pulse; + real_size = 0; + while (adjusted_pulse >= avg_size) { + real_size += 4; + adjusted_pulse -= avg_size / 2; + } + adjusted_pulse <<= 3; + while (adjusted_pulse >= ((avg_size * 4) + (avg_size / 4))) { + real_size += 2; + adjusted_pulse -= avg_size * 2; + } + if (adjusted_pulse >= ((avg_size * 3) + (avg_size / 4))) { + if (adjusted_pulse <= ((avg_size * 4) - (avg_size / 4))) { + if ((2 * ((adjusted_pulse >> 2) - adjust)) <= ((2 * avg_size) - (avg_size / 4))) + real_size += 3; + else + real_size += 4; + } else + real_size += 4; + } else { + if (adjusted_pulse > ((avg_size * 3) - (avg_size / 4))) { + real_size += 3; + } else { + if (adjusted_pulse >= ((avg_size * 2) + (avg_size / 4))) { + if ((2 * ((adjusted_pulse >> 2) - adjust)) < (avg_size + (avg_size / 4))) + real_size += 2; + else + real_size += 3; + } else + real_size += 2; + } + } + + if (outstep == 1) { + for (j = real_size; j > 1; j--) + addbit (d, 0); + addbit (d, 1); + for (j = 0; j < real_size; j++) + *pt++ = (uint16_t)(pulse / real_size); + } + + /* prepares for the next pulse */ + adjust = ((real_size * avg_size)/8) - pulse; + total -= psarray[array_index].size; + totaldiv -= psarray[array_index].number_of_bits; + psarray[array_index].size = pulse; + psarray[array_index].number_of_bits = real_size; + total += pulse; + totaldiv += real_size; + array_index++; + if (array_index >= FDI_MAX_ARRAY) + array_index = 0; + } + + fdi->out = bitoffset; +} + +#else + +static void +fdi2_decode(FDI *fdi, uint32_t totalavg, uint32_t *avgp, uint32_t *minp, uint32_t *maxp, uint8_t *idx, int maxidx, int *indexoffsetp, int pulses, int mfm) +{ + uint32_t adjust; + uint32_t adjusted_pulse; + uint32_t standard_MFM_2_bit_cell_size = totalavg / 50000; + uint32_t standard_MFM_8_bit_cell_size = totalavg / 12500; + int real_size, i, j, nexti, eodat, outstep, randval; + int indexoffset = *indexoffsetp; + uint8_t *d = fdi->track_dst_buffer; + uint16_t *pt = fdi->track_dst_buffer_timing; + uint32_t ref_pulse, pulse; + int32_t jitter; /* detects a long-enough stable pulse coming just after another stable pulse */ i = 1; @@ -1698,20 +1701,20 @@ fdi2_decode(FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 * while (outstep < 2) { /* calculates the current average bitrate from previous decoded data */ - uae_u32 avg_size = (total << (2 + mfm)) / totaldiv; /* this is the new average size for one MFM bit */ - /* uae_u32 avg_size = (uae_u32)((((float)total)*((float)(mfm+1))*4.0) / ((float)totaldiv)); */ + uint32_t avg_size = (uint32_t) ((total << (2 + mfm)) / totaldiv); /* this is the new average size for one MFM bit */ + /* uint32_t avg_size = (uint32_t)((((float)total)*((float)(mfm+1))*4.0) / ((float)totaldiv)); */ /* you can try tighter ranges than 25%, or wider ranges. I would probably go for tighter... */ if ((avg_size < (standard_MFM_8_bit_cell_size - (pulse_limitval * standard_MFM_8_bit_cell_size / 100))) || (avg_size > (standard_MFM_8_bit_cell_size + (pulse_limitval * standard_MFM_8_bit_cell_size / 100)))) { avg_size = standard_MFM_8_bit_cell_size; } - /* this is to prevent the average value from going too far + /* this is to prevent the average value from going too far * from the theoretical value, otherwise it could progressively go to (2 * * real value), or (real value / 2), etc. */ /* gets the next long-enough pulse (this may require more than one pulse) */ pulse = 0; while (pulse < ((avg_size / 4) - (avg_size / 16))) { - uae_u32 avg_pulse, min_pulse, max_pulse; + uint32_t avg_pulse, min_pulse, max_pulse; i++; if (i >= pulses) i = 0; @@ -1739,7 +1742,7 @@ fdi2_decode(FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 * randval = rand(); if (randval < (RAND_MAX / 2)) { if (randval > (RAND_MAX / 4)) { - if (randval <= (((3LL * RAND_MAX) / 8))) + if (randval <= (((3LL * (uint64_t) RAND_MAX) / 8))) randval = (2 * randval) - (RAND_MAX / 4); else randval = (4 * randval) - RAND_MAX; @@ -1748,7 +1751,7 @@ fdi2_decode(FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 * } else { randval -= RAND_MAX / 2; if (randval > (RAND_MAX / 4)) { - if (randval <= (((3LL * RAND_MAX) / 8))) + if (randval <= (((3LL * (uint64_t) RAND_MAX) / 8))) randval = (2 * randval) - (RAND_MAX / 4); else randval = (4 * randval) - RAND_MAX; @@ -1774,7 +1777,7 @@ fdi2_decode(FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 * randval = rand(); if (randval < (RAND_MAX / 2)) { if (randval > (RAND_MAX / 4)) { - if (randval <= (((3LL * RAND_MAX) / 8))) + if (randval <= (((3LL * (uint64_t) RAND_MAX) / 8))) randval = (2 * randval) - (RAND_MAX / 4); else randval = (4 * randval) - RAND_MAX; @@ -1783,7 +1786,7 @@ fdi2_decode(FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 * } else { randval -= RAND_MAX / 2; if (randval > (RAND_MAX / 4)) { - if (randval <= (((3LL * RAND_MAX) / 8))) + if (randval <= (((3LL * (uint64_t) RAND_MAX) / 8))) randval = (2 * randval) - (RAND_MAX / 4); else randval = (4 * randval) - RAND_MAX; @@ -1872,7 +1875,7 @@ fdi2_decode(FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 * addbit(d, 0); addbit(d, 1); for (j = 0; j < real_size; j++) - *pt++ = (uae_u16) (pulse / real_size); + *pt++ = (uint16_t) (pulse / real_size); } /* prepares for the next pulse */ @@ -1894,11 +1897,11 @@ fdi2_decode(FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 * #endif static void -fdi2_celltiming(FDI *fdi, uint32_t totalavg, int bitoffset, uae_u16 *out) +fdi2_celltiming(FDI *fdi, uint32_t totalavg, int bitoffset, uint16_t *out) { - uae_u16 *pt2, *pt; - double avg_bit_len; - int i; + uint16_t *pt2, *pt; + double avg_bit_len; + int i; avg_bit_len = (double) totalavg / (double) bitoffset; pt2 = fdi->track_dst_buffer_timing; @@ -1906,7 +1909,7 @@ fdi2_celltiming(FDI *fdi, uint32_t totalavg, int bitoffset, uae_u16 *out) for (i = 0; i < bitoffset / 8; i++) { double v = (pt2[0] + pt2[1] + pt2[2] + pt2[3] + pt2[4] + pt2[5] + pt2[6] + pt2[7]) / 8.0; v = 1000.0 * v / avg_bit_len; - *pt++ = (uae_u16) v; + *pt++ = (uint16_t) v; pt2 += 8; } *pt++ = out[0]; @@ -1916,14 +1919,14 @@ fdi2_celltiming(FDI *fdi, uint32_t totalavg, int bitoffset, uae_u16 *out) static int decode_lowlevel_track(FDI *fdi, int track, struct fdi_cache *cache) { - uae_u8 *p1; - uae_u32 *p2; - uae_u32 *avgp, *minp = 0, *maxp = 0; - uae_u8 *idxp = 0; - uae_u32 maxidx, totalavg, weakbits; - int i, j, len, pulses, indexoffset; - int avg_free, min_free = 0, max_free = 0, idx_free; - int idx_off1 = 0, idx_off2 = 0, idx_off3 = 0; + uint8_t *p1; + uint32_t *p2; + uint32_t *avgp, *minp = 0, *maxp = 0; + uint8_t *idxp = 0; + uint32_t maxidx, totalavg, weakbits; + int i, j, len, pulses, indexoffset; + int avg_free, min_free = 0, max_free = 0, idx_free; + int idx_off1 = 0, idx_off2 = 0, idx_off3 = 0; p1 = fdi->track_src; pulses = get_u32(p1); @@ -1931,15 +1934,15 @@ decode_lowlevel_track(FDI *fdi, int track, struct fdi_cache *cache) return -1; p1 += 4; len = 12; - avgp = (uae_u32 *) fdi_decompress(pulses, p1 + 0, p1 + len, &avg_free); - dumpstream(track, (uae_u8 *) avgp, pulses); + avgp = (uint32_t *) fdi_decompress(pulses, p1 + 0, p1 + len, &avg_free); + dumpstream(track, (uint8_t *) avgp, pulses); len += get_u24(p1 + 0) & 0x3fffff; if (!avgp) return -1; if (get_u24(p1 + 3) && get_u24(p1 + 6)) { - minp = (uae_u32 *) fdi_decompress(pulses, p1 + 3, p1 + len, &min_free); + minp = (uint32_t *) fdi_decompress(pulses, p1 + 3, p1 + len, &min_free); len += get_u24(p1 + 3) & 0x3fffff; - maxp = (uae_u32 *) fdi_decompress(pulses, p1 + 6, p1 + len, &max_free); + maxp = (uint32_t *) fdi_decompress(pulses, p1 + 6, p1 + len, &max_free); len += get_u24(p1 + 6) & 0x3fffff; /* Computes the real min and max values */ for (i = 0; i < pulses; i++) { @@ -2048,7 +2051,7 @@ decode_lowlevel_track(FDI *fdi, int track, struct fdi_cache *cache) } static unsigned char fdiid[] = { "Formatted Disk Image file" }; -static int bit_rate_table[16] = { 125, 150, 250, 300, 500, 1000 }; +static int bit_rate_table[16] = { 125, 150, 250, 300, 500, 1000 }; void fdi2raw_header_free(FDI *fdi) @@ -2106,13 +2109,13 @@ fdi2raw_get_bit_rate(FDI *fdi) return fdi->bit_rate; } -int +FDI2RawDiskType fdi2raw_get_type(FDI *fdi) { return fdi->disk_type; } -int +bool fdi2raw_get_write_protect(FDI *fdi) { return fdi->write_protect; @@ -2127,9 +2130,9 @@ fdi2raw_get_tpi(FDI *fdi) FDI * fdi2raw_header(FILE *f) { - int i, offset, oldseek; - uae_u8 type, size; - FDI *fdi; + long i, offset, oldseek; + uint8_t type, size; + FDI *fdi; fdi2raw_log("ALLOC: memory allocated %d\n", fdi_allocated); fdi = fdi_malloc(sizeof(FDI)); @@ -2167,7 +2170,7 @@ fdi2raw_header(FILE *f) fdi->last_head = fdi->header[144]; fdi->disk_type = fdi->header[145]; fdi->rotation_speed = fdi->header[146] + 128; - fdi->write_protect = fdi->header[147] & 1; + fdi->write_protect = !!(fdi->header[147] & 1); fdi2raw_log("FDI version %d.%d\n", fdi->header[140], fdi->header[141]); fdi2raw_log("last_track=%d rotation_speed=%d\n", fdi->last_track, fdi->rotation_speed); @@ -2197,8 +2200,8 @@ fdi2raw_header(FILE *f) return fdi; } -int -fdi2raw_loadrevolution_2(FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm) +static int +fdi2raw_loadrevolution_2(FDI *fdi, uint16_t *mfmbuf, uint16_t *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm) { struct fdi_cache *cache = &fdi->cache[track]; int len, i, idx; @@ -2216,8 +2219,8 @@ fdi2raw_loadrevolution_2(FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int tr *tracklength = len; for (i = 0; i < (len + 15) / (2 * 8); i++) { - uae_u8 *data = fdi->track_dst_buffer + i * 2; - *mfmbuf++ = 256 * *data + *(data + 1); + uint8_t *data = fdi->track_dst_buffer + i * 2; + *mfmbuf++ = 256 * *data + *(data + 1); } fdi2_celltiming(fdi, cache->totalavg, len, tracktiming); if (indexoffsetp) @@ -2226,18 +2229,20 @@ fdi2raw_loadrevolution_2(FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int tr } int -fdi2raw_loadrevolution(FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int mfm) +fdi2raw_loadrevolution(FDI *fdi, uint16_t *mfmbuf, uint16_t *tracktiming, int track, int *tracklength, int mfm) { + track ^= fdi->reversed_side; return fdi2raw_loadrevolution_2(fdi, mfmbuf, tracktiming, track, tracklength, 0, 0, mfm); } int -fdi2raw_loadtrack(FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm) +fdi2raw_loadtrack(FDI *fdi, uint16_t *mfmbuf, uint16_t *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm) { - uae_u8 *p; + uint8_t *p; int outlen, i; struct fdi_cache *cache = &fdi->cache[track]; + track ^= fdi->reversed_side; if (cache->lowlevel) return fdi2raw_loadrevolution_2(fdi, mfmbuf, tracktiming, track, tracklength, indexoffsetp, multirev, mfm); @@ -2305,8 +2310,8 @@ fdi2raw_loadtrack(FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, in return fdi2raw_loadrevolution_2(fdi, mfmbuf, tracktiming, track, tracklength, indexoffsetp, multirev, mfm); *tracklength = fdi->out; for (i = 0; i < ((*tracklength) + 15) / (2 * 8); i++) { - uae_u8 *data = fdi->track_dst_buffer + i * 2; - *mfmbuf++ = 256 * *data + *(data + 1); + uint8_t *data = fdi->track_dst_buffer + i * 2; + *mfmbuf++ = 256 * *data + *(data + 1); } } return outlen; diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 5ed136de5..83dcd4836 100644 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(game OBJECT gameport.c joystick_standard.c diff --git a/src/game/gameport.c b/src/game/gameport.c index ab8422070..f3557d158 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -11,7 +11,7 @@ * * * Authors: Miran Grca, - * Sarah Walker, + * Sarah Walker, * RichardG, * * Copyright 2016-2018 Miran Grca. diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index 0741e0360..f5785d6f4 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -11,7 +11,7 @@ * * * Authors: Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index 71c354945..55a28acee 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -11,7 +11,7 @@ * * * Authors: Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. diff --git a/src/game/joystick_sw_pad.c b/src/game/joystick_sw_pad.c index 647ca6a74..26e26474b 100644 --- a/src/game/joystick_sw_pad.c +++ b/src/game/joystick_sw_pad.c @@ -32,7 +32,7 @@ * * * Authors: Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. diff --git a/src/game/joystick_tm_fcs.c b/src/game/joystick_tm_fcs.c index 4364a432f..7bcb15742 100644 --- a/src/game/joystick_tm_fcs.c +++ b/src/game/joystick_tm_fcs.c @@ -11,7 +11,7 @@ * * * Authors: Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 1db37f1a4..b88fa24ef 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -107,16 +107,13 @@ extern int vid_cga_contrast, /* (C) video */ video_filter_method, /* (C) video */ video_vsync, /* (C) video */ video_framerate, /* (C) video */ - gfxcard; /* (C) graphics/video card */ + gfxcard[2]; /* (C) graphics/video card */ extern char video_shader[512]; /* (C) video */ extern int bugger_enabled, /* (C) enable ISAbugger */ postcard_enabled, /* (C) enable POST card */ isamem_type[], /* (C) enable ISA mem cards */ isartc_type; /* (C) enable ISA RTC card */ extern int sound_is_float, /* (C) sound uses FP values */ - GAMEBLASTER, /* (C) sound option */ - GUS, GUSMAX, /* (C) sound option */ - SSI2001, /* (C) sound option */ voodoo_enabled, /* (C) video option */ ibm8514_enabled, /* (C) video option */ xga_enabled; /* (C) video option */ diff --git a/src/include/86box/acpi.h b/src/include/86box/acpi.h index 4d2f2ac0d..18f40d874 100644 --- a/src/include/86box/acpi.h +++ b/src/include/86box/acpi.h @@ -18,7 +18,11 @@ #define ACPI_H #ifdef __cplusplus +#include +using atomic_int = std::atomic_int; extern "C" { +#else +#include #endif #define ACPI_TIMER_FREQ 3579545 @@ -90,7 +94,7 @@ typedef struct slot, irq_mode, irq_pin, irq_line, mirq_is_level; - pc_timer_t timer, resume_timer; + pc_timer_t timer, resume_timer, pwrbtn_timer; nvr_t *nvr; apm_t *apm; void *i2c, @@ -98,7 +102,9 @@ typedef struct } acpi_t; /* Global variables. */ -extern int acpi_rtc_status; +extern int acpi_rtc_status; +extern atomic_int acpi_pwrbut_pressed; +extern int acpi_enabled; extern const device_t acpi_ali_device; extern const device_t acpi_intel_device; diff --git a/src/include/86box/apm.h b/src/include/86box/apm.h index 2676fa198..854969f3d 100644 --- a/src/include/86box/apm.h +++ b/src/include/86box/apm.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the Advanced Power Management emulation. + * Definitions for the Advanced Power Management emulation. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2019 Miran Grca. + * Copyright 2019 Miran Grca. */ #ifndef APM_H #define APM_H diff --git a/src/include/86box/bswap.h b/src/include/86box/bswap.h index 22d25cf4a..9f3c51917 100644 --- a/src/include/86box/bswap.h +++ b/src/include/86box/bswap.h @@ -13,7 +13,7 @@ * Authors: Fred N. van Kempen, * neozeed, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * Copyright 2016-2018 neozeed. * * This program is free software; you can redistribute it and/or modify diff --git a/src/include/86box/bugger.h b/src/include/86box/bugger.h index b0a6a5469..57dabd172 100644 --- a/src/include/86box/bugger.h +++ b/src/include/86box/bugger.h @@ -1,25 +1,25 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the ISA Bus (de)Bugger expansion card - * sold as a DIY kit in the late 1980's in The Netherlands. - * This card was a assemble-yourself 8bit ISA addon card for - * PC and AT systems that had several tools to aid in low- - * level debugging (mostly for faulty BIOSes, bootloaders - * and system kernels...) + * Implementation of the ISA Bus (de)Bugger expansion card + * sold as a DIY kit in the late 1980's in The Netherlands. + * This card was a assemble-yourself 8bit ISA addon card for + * PC and AT systems that had several tools to aid in low- + * level debugging (mostly for faulty BIOSes, bootloaders + * and system kernels...) * - * Definitions for the BUGGER card. + * Definitions for the BUGGER card. * * * - * Author: Fred N. van Kempen, + * Authors: Fred N. van Kempen, * - * Copyright 1989-2018 Fred N. van Kempen. + * Copyright 1989-2018 Fred N. van Kempen. */ #ifndef BUGGER_H #define BUGGER_H diff --git a/src/include/86box/cartridge.h b/src/include/86box/cartridge.h index c07fe1cfd..2fa0a9358 100644 --- a/src/include/86box/cartridge.h +++ b/src/include/86box/cartridge.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the PCjr cartridge emulation. + * Definitions for the PCjr cartridge emulation. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2021 Miran Grca. + * Copyright 2021 Miran Grca. */ #ifndef EMU_CARTRIDGE_H #define EMU_CARTRIDGE_H diff --git a/src/include/86box/cdrom.h b/src/include/86box/cdrom.h index f5bfc9026..28e9cf14b 100644 --- a/src/include/86box/cdrom.h +++ b/src/include/86box/cdrom.h @@ -1,16 +1,16 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Generic CD-ROM drive core header. + * Generic CD-ROM drive core header. * - * Author: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2016-2019 Miran Grca. + * Copyright 2016-2019 Miran Grca. */ #ifndef EMU_CDROM_H #define EMU_CDROM_H @@ -60,6 +60,54 @@ enum { CDROM_BUS_USB }; +#define KNOWN_CDROM_DRIVE_TYPES 30 +#define BUS_TYPE_ALL 0 +#define BUS_TYPE_IDE 1 +#define BUS_TYPE_SCSI 2 + +static const struct +{ + const char vendor[9]; + const char model[17]; + const char revision[5]; + const char *name; + const char *internal_name; + const int bus_type; +} cdrom_drive_types[] = +{ + { "86BOX", "CD-ROM", "1.00", "(ATAPI/SCSI) 86BOX CD-ROM 1.00", "86BOX_CD-ROM_1.00", BUS_TYPE_ALL}, + { "AZT", "CDA46802I", "1.15", "(ATAPI) AZT CDA46802I 1.15", "AZT_CDA46802I_1.15", BUS_TYPE_IDE}, + { "BTC", "CD-ROM BCD36XH", "U1.0", "(ATAPI) BTC CD-ROM BCD36XH U1.0", "BTC_CD-ROM_BCD36XH_U1.0", BUS_TYPE_IDE}, + { "GOLDSTAR", "CRD-8160B", "3.14", "(ATAPI) GOLDSTAR CRD-8160B 3.14", "GOLDSTAR_CRD-8160B_3.14", BUS_TYPE_IDE}, + { "HITACHI", "CDR-8130", "0020", "(ATAPI) HITACHI CDR-8130 0020", "HITACHI_CDR-8130_0020", BUS_TYPE_IDE}, + { "KENWOOD", "CD-ROM UCR-421", "208E", "(ATAPI) KENWOOD CD-ROM UCR-421 208E", "KENWOOD_CD-ROM_UCR-421_208E", BUS_TYPE_IDE}, + { "MATSHITA", "CD-ROM CR-587", "7S13", "(ATAPI) MATSHITA CD-ROM CR-587 7S13", "MATSHITA_CD-ROM_CR-587_7S13", BUS_TYPE_IDE}, + { "MATSHITA", "CD-ROM CR-588", "LS15", "(ATAPI) MATSHITA CD-ROM CR-588 LS15", "MATSHITA_CD-ROM_CR-588_LS15", BUS_TYPE_IDE}, + { "MITSUMI", "CRMC-FX4820T", "D02A", "(ATAPI) MITSUMI CRMC-FX4820T D02A", "MITSUMI_CRMC-FX4820T_D02A", BUS_TYPE_IDE}, + { "NEC", "CD-ROM DRIVE:260", "1.00", "(ATAPI) NEC CD-ROM DRIVE:260 1.00", "NEC_CD-ROM_DRIVE260_1.00", BUS_TYPE_IDE}, + { "NEC", "CD-ROM DRIVE:260", "1.01", "(ATAPI) NEC CD-ROM DRIVE:260 1.01", "NEC_CD-ROM_DRIVE260_1.01", BUS_TYPE_IDE}, + { "NEC", "CDR-1300A", "1.05", "(ATAPI) NEC CDR-1300A 1.05", "NEC_CDR-1300A_1.05", BUS_TYPE_IDE}, + { "PHILIPS", "CD-ROM PCA403CD", "U31P", "(ATAPI) PHILIPS CD-ROM PCA403CD U31P", "PHILIPS_CD-ROM_PCA403CD_U31P", BUS_TYPE_IDE}, + { "SONY", "CD-ROM CDU76", "1.0i", "(ATAPI) SONY CD-ROM CDU76 1.0i", "SONY_CD-ROM_CDU76_1.0i", BUS_TYPE_IDE}, + { "SONY", "CD-ROM CDU311", "3.0h", "(ATAPI) SONY CD-ROM CDU311 3.0h", "SONY_CD-ROM_CDU311_3.0h", BUS_TYPE_IDE}, + { "TOSHIBA", "CD-ROM XM-5702B", "TA70", "(ATAPI) TOSHIBA CD-ROM XM-5702B TA70", "TOSHIBA_CD-ROM_XM-5702B_TA70", BUS_TYPE_IDE}, + { "CHINON", "CD-ROM CDS-431", "H42 ", "(SCSI) CHINON CD-ROM CDS-431 H42", "CHINON_CD-ROM_CDS-431_H42", BUS_TYPE_SCSI}, + { "DEC", "RRD45 (C) DEC", "0436", "(SCSI) DEC RRD45 0436", "DEC_RRD45_0436", BUS_TYPE_SCSI}, + { "MATSHITA", "CD-ROM CR-501", "1.0b", "(SCSI) MATSHITA CD-ROM CR-501 1.0b", "MATSHITA_CD-ROM_CR-501_1.0b", BUS_TYPE_SCSI}, + { "NEC", "CD-ROM DRIVE:74", "1.00", "(SCSI) NEC CD-ROM DRIVE:74 1.00", "NEC_CD-ROM_DRIVE74_1.00", BUS_TYPE_SCSI}, + { "NEC", "CD-ROM DRIVE:464", "1.05", "(SCSI) NEC CD-ROM DRIVE:464 1.05", "NEC_CD-ROM_DRIVE464_1.05", BUS_TYPE_SCSI}, + { "SONY", "CD-ROM CDU-541", "1.0i", "(SCSI) SONY CD-ROM CDU-541 1.0i", "SONY_CD-ROM_CDU-541_1.0i", BUS_TYPE_SCSI}, + { "SONY", "CD-ROM CDU-76S", "1.00", "(SCSI) SONY CD-ROM CDU-76S 1.00", "SONY_CD-ROM_CDU-76S_1.00", BUS_TYPE_SCSI}, + { "PHILIPS", "CDD2600", "1.07", "(SCSI) PHILIPS CDD2600 1.07", "PHILIPS_CDD2600_1.07", BUS_TYPE_SCSI}, + { "PIONEER", "CD-ROM DRM-604X", "2403", "(SCSI) PIONEER CD-ROM DRM-604X 2403", "PIONEER_CD-ROM_DRM-604X_2403", BUS_TYPE_SCSI}, + { "PLEXTOR", "CD-ROM PX-32TS", "1.03", "(SCSI) PLEXTOR CD-ROM PX-32TS 1.03", "PLEXTOR_CD-ROM_PX-32TS_1.03", BUS_TYPE_SCSI}, + { "TEAC", "CD-R55S", "1.0R", "(SCSI) TEAC CD-R55S 1.0R", "TEAC_CD-R55S_1.0R", BUS_TYPE_SCSI}, + { "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "(SCSI) TOSHIBA CD-ROM DRIVE:XM 3433", "TOSHIBA_CD-ROM_DRIVEXM_3433", BUS_TYPE_SCSI}, + { "TOSHIBA", "CD-ROM XM-3301TA", "0272", "(SCSI) TOSHIBA CD-ROM XM-3301TA 0272", "TOSHIBA_CD-ROM_XM-3301TA_0272", BUS_TYPE_SCSI}, + { "TOSHIBA", "CD-ROM XM-5701TA", "3136", "(SCSI) TOSHIBA CD-ROM XM-5701TA 3136", "TOSHIBA_CD-ROM_XM-5701TA_3136", BUS_TYPE_SCSI}, + { "", "", "", "", "", -1}, +}; + /* To shut up the GCC compilers. */ struct cdrom; @@ -113,7 +161,7 @@ typedef struct cdrom { uint32_t sound_on, cdrom_capacity, early, seek_pos, - seek_diff, cd_end; + seek_diff, cd_end, type; int host_drive, prev_host_drive, cd_buflen, audio_op; @@ -132,6 +180,13 @@ typedef struct cdrom { extern cdrom_t cdrom[CDROM_NUM]; +extern char *cdrom_getname(int type); + +extern char *cdrom_get_internal_name(int type); +extern int cdrom_get_from_internal_name(char *s); +extern void cdrom_set_type(int model, int type); +extern int cdrom_get_type(int model); + extern int cdrom_lba_to_msf_accurate(int lba); extern double cdrom_seek_time(cdrom_t *dev); extern void cdrom_stop(cdrom_t *dev); @@ -139,20 +194,24 @@ extern int cdrom_is_pre(cdrom_t *dev, uint32_t lba); extern int cdrom_audio_callback(cdrom_t *dev, int16_t *output, int len); extern uint8_t cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf); extern uint8_t cdrom_audio_track_search(cdrom_t *dev, uint32_t pos, int type, uint8_t playbit); -extern uint8_t cdrom_toshiba_audio_play(cdrom_t *dev, uint32_t pos, int type); +extern uint8_t cdrom_audio_play_toshiba(cdrom_t *dev, uint32_t pos, int type); extern void cdrom_audio_pause_resume(cdrom_t *dev, uint8_t resume); +extern uint8_t cdrom_audio_scan(cdrom_t *dev, uint32_t pos, int type); +extern uint8_t cdrom_get_audio_status_sony(cdrom_t *dev, uint8_t *b, int msf); extern uint8_t cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf); +extern void cdrom_get_current_subchannel_sony(cdrom_t *dev, uint8_t *b, int msf); extern uint8_t cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b); extern int cdrom_read_toc(cdrom_t *dev, unsigned char *b, int type, unsigned char start_track, int msf, int max_len); +extern int cdrom_read_toc_sony(cdrom_t *dev, unsigned char *b, unsigned char start_track, int msf, int max_len); extern void cdrom_get_track_buffer(cdrom_t *dev, uint8_t *buf); extern void cdrom_get_q(cdrom_t *dev, uint8_t *buf, int *curtoctrk, uint8_t mode); extern uint8_t cdrom_mitsumi_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len); extern int cdrom_readsector_raw(cdrom_t *dev, uint8_t *buffer, int sector, int ismsf, - int cdrom_sector_type, int cdrom_sector_flags, int *len); -extern void cdrom_read_disc_info_toc(cdrom_t *dev, unsigned char *b, unsigned char track, int type); + int cdrom_sector_type, int cdrom_sector_flags, int *len, uint8_t vendor_type); +extern uint8_t cdrom_read_disc_info_toc(cdrom_t *dev, unsigned char *b, unsigned char track, int type); -extern void cdrom_seek(cdrom_t *dev, uint32_t pos); +extern void cdrom_seek(cdrom_t *dev, uint32_t pos, uint8_t vendor_type); extern void cdrom_close_handler(uint8_t id); extern void cdrom_insert(uint8_t id); diff --git a/src/include/86box/cdrom_image.h b/src/include/86box/cdrom_image.h index b43e8cee3..c848af50d 100644 --- a/src/include/86box/cdrom_image.h +++ b/src/include/86box/cdrom_image.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * CD-ROM image file handling module header, translated to C - * from cdrom_dosbox.h. + * CD-ROM image file handling module header, translated to C + * from cdrom_dosbox.h. * - * Authors: RichardG, - * Miran Grca, + * Authors: RichardG, + * Miran Grca, * - * Copyright 2016-2022 RichardG. - * Copyright 2016-2022 Miran Grca. + * Copyright 2016-2022 RichardG. + * Copyright 2016-2022 Miran Grca. */ #ifndef CDROM_IMAGE_H #define CDROM_IMAGE_H diff --git a/src/include/86box/cdrom_image_backend.h b/src/include/86box/cdrom_image_backend.h index 2a581624d..511ca68eb 100644 --- a/src/include/86box/cdrom_image_backend.h +++ b/src/include/86box/cdrom_image_backend.h @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * CD-ROM image file handling module header , translated to C - * from cdrom_dosbox.h. + * CD-ROM image file handling module header , translated to C + * from cdrom_dosbox.h. * - * Authors: Miran Grca, - * Fred N. van Kempen, - * The DOSBox Team, + * Authors: Miran Grca, + * Fred N. van Kempen, + * The DOSBox Team, * - * Copyright 2016-2020 Miran Grca. - * Copyright 2017-2020 Fred N. van Kempen. - * Copyright 2002-2020 The DOSBox Team. + * Copyright 2016-2020 Miran Grca. + * Copyright 2017-2020 Fred N. van Kempen. + * Copyright 2002-2020 The DOSBox Team. */ #ifndef CDROM_IMAGE_BACKEND_H #define CDROM_IMAGE_BACKEND_H diff --git a/src/include/86box/cdrom_interface.h b/src/include/86box/cdrom_interface.h new file mode 100644 index 000000000..860a436e0 --- /dev/null +++ b/src/include/86box/cdrom_interface.h @@ -0,0 +1,31 @@ +/* + * 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 common CD-ROM interface controller handler. + * + * + * + * Authors: TheCollector1995 + * + * Copyright 2022 TheCollector1995. + */ +#ifndef EMU_CDROM_INTERFACE_H +#define EMU_CDROM_INTERFACE_H + +extern int cdrom_interface_current; + +extern void cdrom_interface_reset(void); + +extern char *cdrom_interface_get_internal_name(int cdinterface); +extern int cdrom_interface_get_from_internal_name(char *s); +extern int cdrom_interface_has_config(int cdinterface); +extern const device_t *cdrom_interface_get_device(int cdinterface); +extern int cdrom_interface_get_flags(int cdinterface); +extern int cdrom_interface_available(int cdinterface); + +#endif /*EMU_CDROM_INTERFACE_H*/ diff --git a/src/include/86box/cdrom_mitsumi.h b/src/include/86box/cdrom_mitsumi.h index 747668c5d..0b8a3a250 100644 --- a/src/include/86box/cdrom_mitsumi.h +++ b/src/include/86box/cdrom_mitsumi.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Mitsumi CD-ROM emulation for the ISA bus. + * Mitsumi CD-ROM emulation for the ISA bus. * * * - * Author: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2022 Miran Grca. + * Copyright 2022 Miran Grca. */ #ifndef CDROM_MITSUMI_H #define CDROM_MITSUMI_H diff --git a/src/include/86box/chipset.h b/src/include/86box/chipset.h index f76028d78..9d6bd64cf 100644 --- a/src/include/86box/chipset.h +++ b/src/include/86box/chipset.h @@ -12,7 +12,7 @@ * * Authors: Miran Grca, * - * Copyright 2019,2020 Miran Grca. + * Copyright 2019-2020 Miran Grca. */ #ifndef EMU_CHIPSET_H #define EMU_CHIPSET_H @@ -24,6 +24,7 @@ extern const device_t acc2168_device; extern const device_t ali1217_device; extern const device_t ali1429_device; extern const device_t ali1429g_device; +extern const device_t ali1435_device; extern const device_t ali1489_device; extern const device_t ali1531_device; extern const device_t ali1541_device; diff --git a/src/include/86box/clock.h b/src/include/86box/clock.h index 813c21af7..10155eabc 100644 --- a/src/include/86box/clock.h +++ b/src/include/86box/clock.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for clock generator chips. + * Definitions for clock generator chips. * * * - * Authors: RichardG, + * Authors: RichardG, * - * Copyright 2020 RichardG. + * Copyright 2020 RichardG. */ #ifndef EMU_CLOCK_H #define EMU_CLOCK_H diff --git a/src/include/86box/config.h b/src/include/86box/config.h index dd873d168..9738b049b 100644 --- a/src/include/86box/config.h +++ b/src/include/86box/config.h @@ -16,7 +16,7 @@ * Overdoze, * * Copyright 2008-2017 Sarah Walker. - * Copyright 2016,2017 Miran Grca. + * Copyright 2016-2017 Miran Grca. * Copyright 2017 Fred N. van Kempen. */ #ifndef EMU_CONFIG_H diff --git a/src/include/86box/ddma.h b/src/include/86box/ddma.h index 1f422ab65..ccc423d27 100644 --- a/src/include/86box/ddma.h +++ b/src/include/86box/ddma.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the Distributed DMA emulation. + * Definitions for the Distributed DMA emulation. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2020 Miran Grca. + * Copyright 2020 Miran Grca. */ #ifndef DDMA_H #define DDMA_H diff --git a/src/include/86box/device.h b/src/include/86box/device.h index 7e72a02dc..fe6e6f5fc 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -12,7 +12,7 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2017-2019 Fred N. van Kempen. * Copyright 2016-2019 Miran Grca. diff --git a/src/include/86box/discord.h b/src/include/86box/discord.h index 9a1467e08..358c95c9b 100644 --- a/src/include/86box/discord.h +++ b/src/include/86box/discord.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the Discord integration module. + * Definitions for the Discord integration module. * * * - * Authors: David Hrdlička, + * Authors: David Hrdlička, * - * Copyright 2019 David Hrdlička. + * Copyright 2019 David Hrdlička. */ #ifndef WIN_DISCORD_H #define WIN_DISCORD_H diff --git a/src/include/86box/dma.h b/src/include/86box/dma.h index f7a516a61..904d0b13b 100644 --- a/src/include/86box/dma.h +++ b/src/include/86box/dma.h @@ -12,7 +12,7 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2017-2020 Fred N. van Kempen. * Copyright 2016-2020 Miran Grca. diff --git a/src/include/86box/fdc.h b/src/include/86box/fdc.h index ec3136baa..09678b2e5 100644 --- a/src/include/86box/fdc.h +++ b/src/include/86box/fdc.h @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -53,6 +53,8 @@ extern int fdc_type; #define FDC_FLAG_UMC 0x400 /* UMC UM8398 */ #define FDC_FLAG_ALI 0x800 /* ALi M512x / M1543C */ #define FDC_FLAG_SEC 0x1000 /* Is Secondary */ +#define FDC_FLAG_TER 0x2000 /* Is Tertiary */ +#define FDC_FLAG_QUA 0x3000 /* Is Quaternary */ typedef struct { uint8_t dor, stat, command, processed_cmd, dat, st0, swap, dtl; @@ -187,12 +189,16 @@ extern uint8_t fdc_get_current_drive(void); #ifdef EMU_DEVICE_H extern const device_t fdc_xt_device; extern const device_t fdc_xt_sec_device; +extern const device_t fdc_xt_ter_device; +extern const device_t fdc_xt_qua_device; extern const device_t fdc_xt_t1x00_device; extern const device_t fdc_xt_tandy_device; extern const device_t fdc_xt_amstrad_device; extern const device_t fdc_pcjr_device; extern const device_t fdc_at_device; extern const device_t fdc_at_sec_device; +extern const device_t fdc_at_ter_device; +extern const device_t fdc_at_qua_device; extern const device_t fdc_at_actlow_device; extern const device_t fdc_at_ps1_device; extern const device_t fdc_at_smc_device; diff --git a/src/include/86box/fdc_ext.h b/src/include/86box/fdc_ext.h index 2287978c1..106235658 100644 --- a/src/include/86box/fdc_ext.h +++ b/src/include/86box/fdc_ext.h @@ -1,23 +1,23 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the NEC uPD-765 and compatible floppy disk - * controller. + * Implementation of the NEC uPD-765 and compatible floppy disk + * controller. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2008-2020 Sarah Walker. - * Copyright 2016-2020 Miran Grca. - * Copyright 2018-2020 Fred N. van Kempen. + * Copyright 2008-2020 Sarah Walker. + * Copyright 2016-2020 Miran Grca. + * Copyright 2018-2020 Fred N. van Kempen. */ #ifndef EMU_FDC_EXT_H #define EMU_FDC_EXT_H diff --git a/src/include/86box/fdd.h b/src/include/86box/fdd.h index f612466b3..19a2141d3 100644 --- a/src/include/86box/fdd.h +++ b/src/include/86box/fdd.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/include/86box/fdd_86f.h b/src/include/86box/fdd_86f.h index 88eeb035f..cc8035965 100644 --- a/src/include/86box/fdd_86f.h +++ b/src/include/86box/fdd_86f.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the 86F floppy image format. + * Definitions for the 86F floppy image format. * * * - * Authors: Miran Grca, - * Fred N. van Kempen, + * Authors: Miran Grca, + * Fred N. van Kempen, * - * Copyright 2016-2019 Miran Grca. - * Copyright 2018,2019 Fred N. van Kempen. + * Copyright 2016-2019 Miran Grca. + * Copyright 2018-2019 Fred N. van Kempen. */ #ifndef EMU_FLOPPY_86F_H #define EMU_FLOPPY_86F_H diff --git a/src/include/86box/fdd_common.h b/src/include/86box/fdd_common.h index 9c6f8853c..7673d9684 100644 --- a/src/include/86box/fdd_common.h +++ b/src/include/86box/fdd_common.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Shared code for all the floppy modules. + * Shared code for all the floppy modules. * * * - * Author: Fred N. van Kempen, + * Authors: Fred N. van Kempen, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. */ #ifndef FDD_COMMON_H #define FDD_COMMON_H diff --git a/src/include/86box/fdd_fdi.h b/src/include/86box/fdd_fdi.h index b984a8154..6b9461bad 100644 --- a/src/include/86box/fdd_fdi.h +++ b/src/include/86box/fdd_fdi.h @@ -1,23 +1,23 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the FDI floppy stream image format - * interface to the FDI2RAW module. + * Implementation of the FDI floppy stream image format + * interface to the FDI2RAW module. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. - * Copyright 2018 Fred N. van Kempen. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. + * Copyright 2018 Fred N. van Kempen. */ #ifndef EMU_FLOPPY_FDI_H #define EMU_FLOPPY_FDI_H diff --git a/src/include/86box/fdd_imd.h b/src/include/86box/fdd_imd.h index 806304093..f50ad865e 100644 --- a/src/include/86box/fdd_imd.h +++ b/src/include/86box/fdd_imd.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the IMD floppy image format. + * Definitions for the IMD floppy image format. * * * - * Authors: Miran Grca, - * Fred N. van Kempen, + * Authors: Miran Grca, + * Fred N. van Kempen, * - * Copyright 2016-2018 Miran Grca. - * Copyright 2018 Fred N. van Kempen. + * Copyright 2016-2018 Miran Grca. + * Copyright 2018 Fred N. van Kempen. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/include/86box/fdd_img.h b/src/include/86box/fdd_img.h index 7c36929c3..f0a639d88 100644 --- a/src/include/86box/fdd_img.h +++ b/src/include/86box/fdd_img.h @@ -1,23 +1,23 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the raw sector-based floppy image format, - * as well as the Japanese FDI, CopyQM, and FDF formats. + * Implementation of the raw sector-based floppy image format, + * as well as the Japanese FDI, CopyQM, and FDF formats. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. - * Copyright 2018 Fred N. van Kempen. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. + * Copyright 2018 Fred N. van Kempen. */ #ifndef EMU_FLOPPY_IMG_H #define EMU_FLOPPY_IMG_H diff --git a/src/include/86box/fdd_json.h b/src/include/86box/fdd_json.h index e86aad01a..7f3c9adb4 100644 --- a/src/include/86box/fdd_json.h +++ b/src/include/86box/fdd_json.h @@ -10,7 +10,7 @@ * * Authors: Fred N. van Kempen, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the diff --git a/src/include/86box/fdd_mfm.h b/src/include/86box/fdd_mfm.h index 36c6e6b8f..3a8494a26 100644 --- a/src/include/86box/fdd_mfm.h +++ b/src/include/86box/fdd_mfm.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the HxC MFM image format. + * Implementation of the HxC MFM image format. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2018 Miran Grca. + * Copyright 2018 Miran Grca. */ #ifndef EMU_FLOPPY_MFM_H #define EMU_FLOPPY_MFM_H diff --git a/src/include/86box/fdd_td0.h b/src/include/86box/fdd_td0.h index 56ff8f3c8..add6a07dd 100644 --- a/src/include/86box/fdd_td0.h +++ b/src/include/86box/fdd_td0.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the Teledisk floppy image format. + * Definitions for the Teledisk floppy image format. * * * - * Authors: Miran Grca, - * Fred N. van Kempen, + * Authors: Miran Grca, + * Fred N. van Kempen, * - * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2016-2018 Miran Grca. + * Copyright 2017-2018 Fred N. van Kempen. */ #ifndef EMU_FLOPPY_TD0_H #define EMU_FLOPPY_TD0_H diff --git a/src/include/86box/flash.h b/src/include/86box/flash.h index 21ba6b212..d161d416b 100644 --- a/src/include/86box/flash.h +++ b/src/include/86box/flash.h @@ -11,8 +11,10 @@ * * * Authors: Miran Grca, + * Jasmine Iwanek, * - * Copyright 2020 Miran Grca. + * Copyright 2020 Miran Grca. + * Copyright 2022-2023 Jasmine Iwanek. */ #ifndef EMU_FLASH_H @@ -26,10 +28,36 @@ extern const device_t intel_flash_bxb_device; extern const device_t sst_flash_29ee010_device; extern const device_t sst_flash_29ee020_device; + +extern const device_t winbond_flash_w29c512_device; extern const device_t winbond_flash_w29c010_device; extern const device_t winbond_flash_w29c020_device; +extern const device_t winbond_flash_w29c040_device; + +extern const device_t sst_flash_39sf512_device; extern const device_t sst_flash_39sf010_device; extern const device_t sst_flash_39sf020_device; extern const device_t sst_flash_39sf040_device; +extern const device_t sst_flash_39lf512_device; +extern const device_t sst_flash_39lf010_device; +extern const device_t sst_flash_39lf020_device; +extern const device_t sst_flash_39lf040_device; +extern const device_t sst_flash_39lf080_device; +extern const device_t sst_flash_39lf016_device; + +extern const device_t sst_flash_49lf002_device; +extern const device_t sst_flash_49lf020_device; +extern const device_t sst_flash_49lf020a_device; +extern const device_t sst_flash_49lf003_device; +extern const device_t sst_flash_49lf030_device; +extern const device_t sst_flash_49lf004_device; +extern const device_t sst_flash_49lf004c_device; +extern const device_t sst_flash_49lf040_device; +extern const device_t sst_flash_49lf008_device; +extern const device_t sst_flash_49lf008c_device; +extern const device_t sst_flash_49lf080_device; +extern const device_t sst_flash_49lf016_device; +extern const device_t sst_flash_49lf160_device; + #endif /*EMU_FLASH_H*/ diff --git a/src/include/86box/gameport.h b/src/include/86box/gameport.h index 07a51edc4..905130da0 100644 --- a/src/include/86box/gameport.h +++ b/src/include/86box/gameport.h @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the generic game port handlers. + * Definitions for the generic game port handlers. * * * - * Authors: Miran Grca, - * Sarah Walker, - * RichardG, + * Authors: Miran Grca, + * Sarah Walker, + * RichardG, * - * Copyright 2016-2018 Miran Grca. - * Copyright 2008-2018 Sarah Walker. - * Copyright 2021 RichardG. + * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2021 RichardG. */ #ifndef EMU_GAMEPORT_H #define EMU_GAMEPORT_H diff --git a/src/include/86box/hdc_ide.h b/src/include/86box/hdc_ide.h index da5fe1b32..e7bd8d7cf 100644 --- a/src/include/86box/hdc_ide.h +++ b/src/include/86box/hdc_ide.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the IDE emulation for hard disks and ATAPI - * CD-ROM devices. + * Implementation of the IDE emulation for hard disks and ATAPI + * CD-ROM devices. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Authors: Sarah Walker, + * Miran Grca, + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #ifndef EMU_IDE_H #define EMU_IDE_H diff --git a/src/include/86box/hdc_ide_sff8038i.h b/src/include/86box/hdc_ide_sff8038i.h index 5533319e1..b411ecf5d 100644 --- a/src/include/86box/hdc_ide_sff8038i.h +++ b/src/include/86box/hdc_ide_sff8038i.h @@ -1,19 +1,20 @@ /* - * 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. + * 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. * - * Emulation of the SFF-8038i IDE Bus Master. + * This file is part of the 86Box distribution. * - * Emulation core dispatcher. + * Emulation of the SFF-8038i IDE Bus Master. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Copyright 2008-2020 Sarah Walker. - * Copyright 2016-2020 Miran Grca. + * Authors: Sarah Walker, + * Miran Grca, + * + * Copyright 2008-2020 Sarah Walker. + * Copyright 2016-2020 Miran Grca. */ #ifndef EMU_HDC_IDE_SFF8038I_H diff --git a/src/include/86box/hdd.h b/src/include/86box/hdd.h index abb2aa388..58fff9ffd 100644 --- a/src/include/86box/hdd.h +++ b/src/include/86box/hdd.h @@ -1,19 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the hard disk image handler. + * Definitions for the hard disk image handler. * * * - * Authors: Miran Grca, - * Fred N. van Kempen, - * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Authors: Miran Grca, + * Fred N. van Kempen, + * + * Copyright 2016-2018 Miran Grca. + * Copyright 2017-2018 Fred N. van Kempen. */ #ifndef EMU_HDD_H #define EMU_HDD_H diff --git a/src/include/86box/i2c.h b/src/include/86box/i2c.h index 071e57729..20e2f8b30 100644 --- a/src/include/86box/i2c.h +++ b/src/include/86box/i2c.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the I2C handler. + * Definitions for the I2C handler. * * * - * Authors: RichardG, + * Authors: RichardG, * - * Copyright 2020 RichardG. + * Copyright 2020 RichardG. */ #ifndef EMU_I2C_H #define EMU_I2C_H diff --git a/src/include/86box/i8080.h b/src/include/86box/i8080.h index 9f85a85c0..a3f3fba64 100644 --- a/src/include/86box/i8080.h +++ b/src/include/86box/i8080.h @@ -1,16 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 8080 CPU emulation (header). + * 8080 CPU emulation (header). * - * Authors: Cacodemon345 * - * Copyright 2022 Cacodemon345 + * + * Authors: Cacodemon345 + * + * Copyright 2022 Cacodemon345 */ #include diff --git a/src/include/86box/ibm_5161.h b/src/include/86box/ibm_5161.h index 711773d6d..e189826a8 100644 --- a/src/include/86box/ibm_5161.h +++ b/src/include/86box/ibm_5161.h @@ -1,15 +1,18 @@ /* - * 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. + * 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. * - * Emulation of the IBM Expansion Unit (5161). + * This file is part of the 86Box distribution. + * + * Emulation of the IBM Expansion Unit (5161). * * * - * Author: Miran Grca, - * Copyright 2016-2018 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2016-2018 Miran Grca. */ #ifndef EMU_IBM_5161_H diff --git a/src/include/86box/ini.h b/src/include/86box/ini.h index d754d645b..5eca9ab8c 100644 --- a/src/include/86box/ini.h +++ b/src/include/86box/ini.h @@ -10,13 +10,13 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * Overdoze, * * Copyright 2008-2017 Sarah Walker. - * Copyright 2016,2017 Miran Grca. + * Copyright 2016-2017 Miran Grca. * */ #ifndef EMU_INI_H diff --git a/src/include/86box/io.h b/src/include/86box/io.h index 7e7b45912..b80b37a39 100644 --- a/src/include/86box/io.h +++ b/src/include/86box/io.h @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the I/O handler. + * Definitions for the I/O handler. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2008-2017 Sarah Walker. - * Copyright 2016,2017 Miran Grca. + * Copyright 2008-2017 Sarah Walker. + * Copyright 2016-2017 Miran Grca. */ #ifndef EMU_IO_H #define EMU_IO_H diff --git a/src/include/86box/isapnp.h b/src/include/86box/isapnp.h index abf3eb10d..9fff876dc 100644 --- a/src/include/86box/isapnp.h +++ b/src/include/86box/isapnp.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for ISA Plug and Play. + * Definitions for ISA Plug and Play. * * * - * Author: RichardG, + * Authors: RichardG, * - * Copyright 2021 RichardG. + * Copyright 2021 RichardG. */ #ifndef EMU_ISAPNP_H diff --git a/src/include/86box/joystick_ch_flightstick_pro.h b/src/include/86box/joystick_ch_flightstick_pro.h index 5bdedede9..b49800ecb 100644 --- a/src/include/86box/joystick_ch_flightstick_pro.h +++ b/src/include/86box/joystick_ch_flightstick_pro.h @@ -1,20 +1,20 @@ /* - * VARCem Virtual ARchaeological Computer EMulator. - * An emulator of (mostly) x86-based PC systems and devices, - * using the ISA,EISA,VLB,MCA and PCI system buses, roughly - * spanning the era between 1981 and 1995. + * 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 VARCem Project. + * This file is part of the 86Box distribution. * - * Definitions for the Flight Stick Pro driver. + * Definitions for the Flight Stick Pro driver. * * * - * Authors: Miran Grca, - * Sarah Walker, + * Authors: Miran Grca, + * Sarah Walker, * - * Copyright 2016-2018 Miran Grca. - * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/include/86box/joystick_standard.h b/src/include/86box/joystick_standard.h index ac2b7ea3f..c874677ea 100644 --- a/src/include/86box/joystick_standard.h +++ b/src/include/86box/joystick_standard.h @@ -11,7 +11,7 @@ * * * Authors: Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. diff --git a/src/include/86box/joystick_sw_pad.h b/src/include/86box/joystick_sw_pad.h index d5aef7ccb..a75d802de 100644 --- a/src/include/86box/joystick_sw_pad.h +++ b/src/include/86box/joystick_sw_pad.h @@ -6,12 +6,12 @@ * * This file is part of the 86Box distribution. * - * Definitions for the Sidewinder Pro driver. + * Definitions for the Sidewinder Pro driver. * * * * Authors: Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. diff --git a/src/include/86box/joystick_tm_fcs.h b/src/include/86box/joystick_tm_fcs.h index 74b3edd2e..65e734a40 100644 --- a/src/include/86box/joystick_tm_fcs.h +++ b/src/include/86box/joystick_tm_fcs.h @@ -6,12 +6,12 @@ * * This file is part of the 86Box distribution. * - * Definitions for the Flight Control System driver. + * Definitions for the Flight Control System driver. * * * * Authors: Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. diff --git a/src/include/86box/keyboard.h b/src/include/86box/keyboard.h index 0e384b39b..db18ac789 100644 --- a/src/include/86box/keyboard.h +++ b/src/include/86box/keyboard.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/include/86box/language.h b/src/include/86box/language.h index 90bfecc06..1fd5bdf61 100644 --- a/src/include/86box/language.h +++ b/src/include/86box/language.h @@ -1,21 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the language management module. - * - * NOTE: FIXME: Strings 2176 and 2193 are same. + * Definitions for the language management module. * * * - * Author: Fred N. van Kempen, + * Authors: Fred N. van Kempen, * - * Copyright 2017,2018 Fred N. van Kempen. - * Copyright 2022 Jasmine Iwanek. + * Copyright 2017-2018 Fred N. van Kempen. + * Copyright 2022 Jasmine Iwanek. */ #ifndef LANG_UAGE_H @@ -152,6 +150,18 @@ #define IDS_2160 2160 // "ACPI shutdown" #define IDS_2161 2161 // "Settings" #define IDS_2162 2162 // "Early drive" +#define IDS_2163 2163 // "no dynarec" +#define IDS_2164 2164 // "old dynarec" +#define IDS_2165 2165 // "new dynarec" +#ifdef USE_DYNAREC +# ifdef USE_NEW_DYNAREC +# define IDS_DYNAREC IDS_2165 +# else +# define IDS_DYNAREC IDS_2164 +# endif +#else +# define IDS_DYNAREC IDS_2163 +#endif #define IDS_4096 4096 // "Hard disk (%s)" #define IDS_4097 4097 // "%01i:%01i" @@ -260,7 +270,7 @@ #define IDS_LANG_ENUS IDS_7168 -#define STR_NUM_2048 115 +#define STR_NUM_2048 118 // UNUSED: #define STR_NUM_3072 11 #define STR_NUM_4096 40 #define STR_NUM_4352 6 diff --git a/src/include/86box/log.h b/src/include/86box/log.h index b736ef2b6..9d3568069 100644 --- a/src/include/86box/log.h +++ b/src/include/86box/log.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Main include file for the application. + * Main include file for the application. * * * - * Authors: Miran Grca, - * Fred N. van Kempen, + * Authors: Miran Grca, + * Fred N. van Kempen, * - * Copyright 2021 Miran Grca. - * Copyright 2021 Fred N. van Kempen. + * Copyright 2021 Miran Grca. + * Copyright 2021 Fred N. van Kempen. */ #ifndef EMU_LOG_H diff --git a/src/include/86box/lpt.h b/src/include/86box/lpt.h index 87bd90d48..cb8fc7cc6 100644 --- a/src/include/86box/lpt.h +++ b/src/include/86box/lpt.h @@ -11,10 +11,10 @@ #define LPT4_ADDR 0x0268 #define LPT4_IRQ 5 /* -#define LPT5_ADDR 0x027c -#define LPT5_IRQ 7 -#define LPT6_ADDR 0x026c -#define LPT6_IRQ 5 +#define LPT5_ADDR 0x027c +#define LPT5_IRQ 7 +#define LPT6_ADDR 0x026c +#define LPT6_IRQ 5 */ typedef struct diff --git a/src/include/86box/m_amstrad.h b/src/include/86box/m_amstrad.h index 1b99617ca..ef4e8b9ea 100644 --- a/src/include/86box/m_amstrad.h +++ b/src/include/86box/m_amstrad.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header of the emulation of the Amstrad series of PC's: - * PC1512, PC1640 and PC200, including their keyboard, mouse and - * video devices, as well as the PC2086 and PC3086 systems. + * Header of the emulation of the Amstrad series of PC's: + * PC1512, PC1640 and PC200, including their keyboard, mouse and + * video devices, as well as the PC2086 and PC3086 systems. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2019 Sarah Walker. + * Copyright 2008-2019 Sarah Walker. */ #ifndef MACHINE_AMSTRAD_H diff --git a/src/include/86box/m_at_t3100e.h b/src/include/86box/m_at_t3100e.h index aa545fc45..c25d171b9 100644 --- a/src/include/86box/m_at_t3100e.h +++ b/src/include/86box/m_at_t3100e.h @@ -12,9 +12,9 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. * diff --git a/src/include/86box/m_xt_t1000.h b/src/include/86box/m_xt_t1000.h index 452decc21..d8e8cd56b 100644 --- a/src/include/86box/m_xt_t1000.h +++ b/src/include/86box/m_xt_t1000.h @@ -12,9 +12,9 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. * diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 052e55abd..a6571a1fd 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -513,6 +513,9 @@ extern int machine_at_atc1415_init(const machine_t *); extern int machine_at_actionpc2600_init(const machine_t *); extern int machine_at_m919_init(const machine_t *); extern int machine_at_spc7700plw_init(const machine_t *); +extern int machine_at_ms4134_init(const machine_t *); +extern int machine_at_tg486gp_init(const machine_t *); +extern int machine_at_tg486g_init(const machine_t *); /* m_at_commodore.c */ extern int machine_at_cmdpc_init(const machine_t *); @@ -555,10 +558,8 @@ extern int machine_at_430nx_init(const machine_t *); extern int machine_at_acerv30_init(const machine_t *); extern int machine_at_apollo_init(const machine_t *); -extern int machine_at_exp8551_init(const machine_t *); extern int machine_at_zappa_init(const machine_t *); extern int machine_at_powermatev_init(const machine_t *); -extern int machine_at_mb500n_init(const machine_t *); extern int machine_at_hawk_init(const machine_t *); extern int machine_at_pat54pv_init(const machine_t *); @@ -567,16 +568,19 @@ extern int machine_at_hot543_init(const machine_t *); extern int machine_at_p54sp4_init(const machine_t *); extern int machine_at_sq588_init(const machine_t *); +extern int machine_at_p54sps_init(const machine_t *); /* m_at_socket7_3v.c */ extern int machine_at_p54tp4xe_init(const machine_t *); extern int machine_at_p54tp4xe_mr_init(const machine_t *); +extern int machine_at_exp8551_init(const machine_t *); extern int machine_at_gw2katx_init(const machine_t *); extern int machine_at_thor_init(const machine_t *); extern int machine_at_mrthor_init(const machine_t *); extern int machine_at_endeavor_init(const machine_t *); extern int machine_at_ms5119_init(const machine_t *); extern int machine_at_pb640_init(const machine_t *); +extern int machine_at_mb500n_init(const machine_t *); extern int machine_at_fmb_init(const machine_t *); extern int machine_at_acerm3a_init(const machine_t *); @@ -609,6 +613,7 @@ extern int machine_at_presario4500_init(const machine_t *); extern int machine_at_p55va_init(const machine_t *); extern int machine_at_brio80xx_init(const machine_t *); extern int machine_at_pb680_init(const machine_t *); +extern int machine_at_pb810_init(const machine_t *); extern int machine_at_mb520n_init(const machine_t *); extern int machine_at_i430vx_init(const machine_t *); @@ -707,6 +712,7 @@ extern int machine_at_cuv4xls_init(const machine_t *); 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 *); +extern int machine_at_p6bat_init(const machine_t *); /* m_at_misc.c */ extern int machine_at_vpc2007_init(const machine_t *); diff --git a/src/include/86box/mem.h b/src/include/86box/mem.h index f6252be09..f109776a6 100644 --- a/src/include/86box/mem.h +++ b/src/include/86box/mem.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Fred N. van Kempen, * Miran Grca, * diff --git a/src/include/86box/mo.h b/src/include/86box/mo.h index ea22f8f29..19c999ee3 100644 --- a/src/include/86box/mo.h +++ b/src/include/86box/mo.h @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of a generic Magneto-Optical Disk drive - * commands, for both ATAPI and SCSI usage. + * Implementation of a generic Magneto-Optical Disk drive + * commands, for both ATAPI and SCSI usage. * * * - * Authors: Natalia Portillo + * Authors: Natalia Portillo * Fred N. van Kempen, - * Miran Grca, + * Miran Grca, * - * Copyright 2020 Miran Grca. + * Copyright 2020 Miran Grca. */ #ifndef EMU_MO_H diff --git a/src/include/86box/mouse.h b/src/include/86box/mouse.h index 96acab74b..e6ad93e80 100644 --- a/src/include/86box/mouse.h +++ b/src/include/86box/mouse.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the mouse driver. + * Definitions for the mouse driver. * * * - * Authors: Miran Grca, - * Fred N. van Kempen, + * Authors: Miran Grca, + * Fred N. van Kempen, * - * Copyright 2016-2019 Miran Grca. - * Copyright 2017-2019 Fred N. van Kempen. + * Copyright 2016-2019 Miran Grca. + * Copyright 2017-2019 Fred N. van Kempen. */ #ifndef EMU_MOUSE_H diff --git a/src/include/86box/net_3c501.h b/src/include/86box/net_3c501.h index e45f9a82a..996720f8f 100644 --- a/src/include/86box/net_3c501.h +++ b/src/include/86box/net_3c501.h @@ -1,22 +1,23 @@ /* - * 86Box An emulator of (mostly) x86-based PC systems and devices, - * using the ISA, EISA, VLB, MCA, and PCI system buses, - * roughly spanning the era between 1981 and 1995. + * 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 Project. + * This file is part of the 86Box Project. * - * Implementation of the following network controller: - * - 3Com Etherlink 3c500/3c501 (ISA 8-bit). + * Implementation of the following network controller: + * - 3Com Etherlink 3c500/3c501 (ISA 8-bit). * * * * Based on @(#)Dev3C501.cpp Oracle (VirtualBox) * - * Authors: TheCollector1995, - * Oracle + * Authors: TheCollector1995, + * Oracle * - * Copyright 2022 TheCollector1995. - * Portions Copyright (C) 2022 Oracle and/or its affilitates. + * Copyright 2022 TheCollector1995. + * Portions Copyright (C) 2022 Oracle and/or its affilitates. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/include/86box/net_3c503.h b/src/include/86box/net_3c503.h index 147ae0f05..44024850f 100644 --- a/src/include/86box/net_3c503.h +++ b/src/include/86box/net_3c503.h @@ -1,3 +1,46 @@ +/* + * 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. + * + * Implementation of the following network controllers: + * - 3Com Etherlink II 3c503 (ISA 8-bit). + * + * + * + * Based on @(#)3c503.cpp Carl (MAME) + * + * Authors: TheCollector1995, + * Miran Grca, + * Fred N. van Kempen, + * Carl, + * + * Copyright 2018 TheCollector1995. + * Copyright 2018 Miran Grca. + * Copyright 2017-2018 Fred N. van Kempen. + * Portions Copyright (C) 2018 MAME Project + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the: + * + * Free Software Foundation, Inc. + * 59 Temple Place - Suite 330 + * Boston, MA 02111-1307 + * USA. + */ #ifndef NET_3C503_H #define NET_3C503_H diff --git a/src/include/86box/net_dp8390.h b/src/include/86box/net_dp8390.h index 7cb91d30a..4a172d4fe 100644 --- a/src/include/86box/net_dp8390.h +++ b/src/include/86box/net_dp8390.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. * - * Header of the emulation of the DP8390 Network Interface - * Controller used by the WD family, NE1000/NE2000 family, and - * 3Com 3C503 NIC's. + * Header of the emulation of the DP8390 Network Interface + * Controller used by the WD family, NE1000/NE2000 family, and + * 3Com 3C503 NIC's. * * * - * Authors: Miran Grca, - * Bochs project, + * Authors: Miran Grca, + * Bochs project, * - * Copyright 2016-2018 Miran Grca. - * Copyright 2008-2018 Bochs project. + * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Bochs project. */ #ifndef NET_DP8390_H diff --git a/src/include/86box/net_ne2000.h b/src/include/86box/net_ne2000.h index 73b5bd67d..350668ccb 100644 --- a/src/include/86box/net_ne2000.h +++ b/src/include/86box/net_ne2000.h @@ -12,7 +12,7 @@ * * Authors: Fred N. van Kempen, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/include/86box/net_pcnet.h b/src/include/86box/net_pcnet.h index f1db74045..ccdc7e832 100644 --- a/src/include/86box/net_pcnet.h +++ b/src/include/86box/net_pcnet.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. * - * Emulation of the AMD PCnet LANCE NIC controller for both the ISA - * and PCI buses. + * Emulation of the AMD PCnet LANCE NIC controller for both the ISA + * and PCI buses. * * * - * Authors: Miran Grca, - * TheCollector1995, - * Antony T Curtis + * Authors: Miran Grca, + * TheCollector1995, + * Antony T Curtis * - * Copyright 2004-2019 Antony T Curtis - * Copyright 2016-2019 Miran Grca. + * Copyright 2004-2019 Antony T Curtis + * Copyright 2016-2019 Miran Grca. */ #ifndef NET_PCNET_H diff --git a/src/include/86box/net_plip.h b/src/include/86box/net_plip.h index 890de3fd0..83c33e4c6 100644 --- a/src/include/86box/net_plip.h +++ b/src/include/86box/net_plip.h @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the PLIP parallel port network device. + * Definitions for the PLIP parallel port network device. * * * - * Author: RichardG, - * Copyright 2020 RichardG. + * Authors: RichardG, + * + * Copyright 2020 RichardG. */ #ifndef NET_PLIP_H diff --git a/src/include/86box/net_wd8003.h b/src/include/86box/net_wd8003.h index ee313c1a9..a0ea13287 100644 --- a/src/include/86box/net_wd8003.h +++ b/src/include/86box/net_wd8003.h @@ -1,26 +1,26 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the following network controllers: - * - SMC/WD 8003E (ISA 8-bit); - * - SMC/WD 8013EBT (ISA 16-bit); - * - SMC/WD 8013EP/A (MCA). + * Implementation of the following network controllers: + * - SMC/WD 8003E (ISA 8-bit); + * - SMC/WD 8013EBT (ISA 16-bit); + * - SMC/WD 8013EP/A (MCA). * * * - * Authors: Fred N. van Kempen, - * TheCollector1995, - * Miran Grca, - * Peter Grehan, + * Authors: Fred N. van Kempen, + * TheCollector1995, + * Miran Grca, + * Peter Grehan, * - * Copyright 2017,2018 Fred N. van Kempen. - * Copyright 2016-2018 Miran Grca. - * Portions Copyright (C) 2002 MandrakeSoft S.A. + * Copyright 2017-2018 Fred N. van Kempen. + * Copyright 2016-2018 Miran Grca. + * Portions Copyright (C) 2002 MandrakeSoft S.A. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/include/86box/nvr_ps2.h b/src/include/86box/nvr_ps2.h index 9fd0a7897..478d1be44 100644 --- a/src/include/86box/nvr_ps2.h +++ b/src/include/86box/nvr_ps2.h @@ -11,9 +11,9 @@ * * * Authors: Fred N. van Kempen, - * Sarah Walker, + * Sarah Walker, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * Copyright 2008-2018 Sarah Walker. * * This program is free software; you can redistribute it and/or modify diff --git a/src/include/86box/pci.h b/src/include/86box/pci.h index 5c24bebf2..c16d5a7e8 100644 --- a/src/include/86box/pci.h +++ b/src/include/86box/pci.h @@ -12,7 +12,7 @@ * * Authors: Miran Grca, * Fred N. van Kempen, - * Sarah Walker, + * Sarah Walker, * * Copyright 2016-2020 Miran Grca. * Copyright 2017-2020 Fred N. van Kempen. diff --git a/src/include/86box/pic.h b/src/include/86box/pic.h index d1295be4b..318ce2fad 100644 --- a/src/include/86box/pic.h +++ b/src/include/86box/pic.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header of the implementation of the Intel PIC chip emulation, - * partially ported from reenigne's XTCE. + * Header of the implementation of the Intel PIC chip emulation, + * partially ported from reenigne's XTCE. * - * Authors: Andrew Jenner, - * Miran Grca, + * Authors: Andrew Jenner, + * Miran Grca, * - * Copyright 2015-2020 Andrew Jenner. - * Copyright 2016-2020 Miran Grca. + * Copyright 2015-2020 Andrew Jenner. + * Copyright 2016-2020 Miran Grca. */ #ifndef EMU_PIC_H diff --git a/src/include/86box/pit.h b/src/include/86box/pit.h index f6eb4cc6d..d50e45967 100644 --- a/src/include/86box/pit.h +++ b/src/include/86box/pit.h @@ -1,18 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header of the implementation of the Intel 8253/8254 - * Programmable Interval Timer. + * Header of the implementation of the Intel 8253/8254 + * Programmable Interval Timer. * * * - * Author: Miran Grca, - * Copyright 2019,2020 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2019-2020 Miran Grca. */ #ifndef EMU_PIT_H diff --git a/src/include/86box/pit_fast.h b/src/include/86box/pit_fast.h index 317b8f13e..242fb4207 100644 --- a/src/include/86box/pit_fast.h +++ b/src/include/86box/pit_fast.h @@ -1,18 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header of the implementation of the Intel 8253/8254 - * Programmable Interval Timer. + * Header of the implementation of the Intel 8253/8254 + * Programmable Interval Timer. * * * - * Author: Miran Grca, - * Copyright 2019,2020 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2019-2020 Miran Grca. */ #ifndef EMU_PIT_FAST_H diff --git a/src/include/86box/plat_dir.h b/src/include/86box/plat_dir.h index 74caac23f..d55bc5046 100644 --- a/src/include/86box/plat_dir.h +++ b/src/include/86box/plat_dir.h @@ -1,24 +1,25 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the platform OpenDir module. + * Definitions for the platform OpenDir module. * * * - * Author: Fred N. van Kempen, - * Copyright 2017 Fred N. van Kempen. + * Authors: Fred N. van Kempen, + * + * Copyright 2017 Fred N. van Kempen. */ #ifndef PLAT_DIR_H #define PLAT_DIR_H -/* Windows needs the POSIX re-implementations */ -#if defined(_WIN32) +/* Windows and Termux needs the POSIX re-implementations */ +#if defined(_WIN32) || defined(__TERMUX__) # ifdef _MAX_FNAME # define MAXNAMLEN _MAX_FNAME # else diff --git a/src/include/86box/plat_dynld.h b/src/include/86box/plat_dynld.h index 6e20f6e27..986e72424 100644 --- a/src/include/86box/plat_dynld.h +++ b/src/include/86box/plat_dynld.h @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Define the Dynamic Module Loader interface. + * Define the Dynamic Module Loader interface. * * * - * Author: Fred N. van Kempen, - * Copyright 2017 Fred N. van Kempen + * Authors: Fred N. van Kempen, + * + * Copyright 2017 Fred N. van Kempen */ #ifndef PLAT_DYNLD_H diff --git a/src/include/86box/port_6x.h b/src/include/86box/port_6x.h index 927a15efa..7eb0c9a56 100644 --- a/src/include/86box/port_6x.h +++ b/src/include/86box/port_6x.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header for the implementation of Port 6x used by various - * machines. + * Header for the implementation of Port 6x used by various + * machines. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2021 Miran Grca. + * Copyright 2021 Miran Grca. */ #ifndef EMU_PORT_6X_H diff --git a/src/include/86box/port_92.h b/src/include/86box/port_92.h index 4d5aa031c..319b2b3ac 100644 --- a/src/include/86box/port_92.h +++ b/src/include/86box/port_92.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header for the implementation of Port 92 used by PS/2 - * machines and 386+ clones. + * Header for the implementation of Port 92 used by PS/2 + * machines and 386+ clones. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2019 Miran Grca. + * Copyright 2019 Miran Grca. */ #ifndef EMU_PORT_92_H diff --git a/src/include/86box/postcard.h b/src/include/86box/postcard.h index 0db2d6187..5ceb64ae3 100644 --- a/src/include/86box/postcard.h +++ b/src/include/86box/postcard.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of a port 80h POST diagnostic card. + * Implementation of a port 80h POST diagnostic card. * * * - * Author: RichardG, + * Authors: RichardG, * - * Copyright 2020 RichardG. + * Copyright 2020 RichardG. */ #ifndef POSTCARD_H diff --git a/src/include/86box/random.h b/src/include/86box/random.h index 089a49c4a..021969a54 100644 --- a/src/include/86box/random.h +++ b/src/include/86box/random.h @@ -1,18 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * A better random number generation, used for floppy weak bits - * and network MAC address generation. + * A better random number generation, used for floppy weak bits + * and network MAC address generation. * * * - * Author: Miran Grca, - * Copyright 2016,2017 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2016-2017 Miran Grca. */ #ifndef EMU_RANDOM_H diff --git a/src/include/86box/resource.h b/src/include/86box/resource.h index dc54b504f..967430216 100644 --- a/src/include/86box/resource.h +++ b/src/include/86box/resource.h @@ -1,24 +1,24 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Windows resource defines. + * Windows resource defines. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, - * David Hrdlička, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, + * David Hrdlička, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. - * Copyright 2018,2019 David Hrdlička. - * Copyright 2021-2022 Jasmine Iwanek. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. + * Copyright 2018-2019 David Hrdlička. + * Copyright 2021-2022 Jasmine Iwanek. */ #ifndef WIN_RESOURCE_H @@ -79,82 +79,89 @@ #define IDT_JOYSTICK 1718 /* Joystick: */ /* DLG_CFG_SOUND */ -#define IDT_SOUND 1719 /* Sound card: */ -#define IDT_MIDI_OUT 1720 /* MIDI Out Device: */ -#define IDT_MIDI_IN 1721 /* MIDI In Device: */ +#define IDT_SOUND1 1719 /* Sound card 1: */ +#define IDT_SOUND2 1720 /* Sound card 2: */ +#define IDT_SOUND3 1721 /* Sound card 3: */ +#define IDT_SOUND4 1722 /* Sound card 4: */ +#define IDT_MIDI_OUT 1723 /* MIDI Out Device: */ +#define IDT_MIDI_IN 1724 /* MIDI In Device: */ /* DLG_CFG_NETWORK */ -#define IDT_NET_TYPE 1722 /* Network type: */ -#define IDT_PCAP 1723 /* PCap device: */ -#define IDT_NET 1724 /* Network adapter: */ +#define IDT_NET_TYPE 1725 /* Network type: */ +#define IDT_PCAP 1726 /* PCap device: */ +#define IDT_NET 1727 /* Network adapter: */ +#define IDT_NET1 1728 /* Network adapter 1: */ +#define IDT_NET2 1729 /* Network adapter 2: */ +#define IDT_NET3 1730 /* Network adapter 3: */ +#define IDT_NET4 1731 /* Network adapter 4: */ /* DLG_CFG_PORTS */ -#define IDT_COM1 1725 /* COM1 Device: */ -#define IDT_COM2 1726 /* COM1 Device: */ -#define IDT_COM3 1727 /* COM1 Device: */ -#define IDT_COM4 1728 /* COM1 Device: */ +#define IDT_COM1 1732 /* COM1 Device: */ +#define IDT_COM2 1733 /* COM1 Device: */ +#define IDT_COM3 1734 /* COM1 Device: */ +#define IDT_COM4 1735 /* COM1 Device: */ -#define IDT_LPT1 1729 /* LPT1 Device: */ -#define IDT_LPT2 1730 /* LPT2 Device: */ -#define IDT_LPT3 1731 /* LPT3 Device: */ -#define IDT_LPT4 1732 /* LPT4 Device: */ +#define IDT_LPT1 1736 /* LPT1 Device: */ +#define IDT_LPT2 1737 /* LPT2 Device: */ +#define IDT_LPT3 1738 /* LPT3 Device: */ +#define IDT_LPT4 1739 /* LPT4 Device: */ /* DLG_CFG_STORAGE */ -#define IDT_HDC 1733 /* HD Controller: */ -#define IDT_FDC 1734 /* Ext FD Controller: */ -#define IDT_SCSI_1 1735 /* SCSI Board #1: */ -#define IDT_SCSI_2 1736 /* SCSI Board #2: */ -#define IDT_SCSI_3 1737 /* SCSI Board #3: */ -#define IDT_SCSI_4 1738 /* SCSI Board #4: */ +#define IDT_HDC 1740 /* HD Controller: */ +#define IDT_FDC 1741 /* Ext FD Controller: */ +#define IDT_SCSI_1 1742 /* SCSI Board #1: */ +#define IDT_SCSI_2 1743 /* SCSI Board #2: */ +#define IDT_SCSI_3 1744 /* SCSI Board #3: */ +#define IDT_SCSI_4 1745 /* SCSI Board #4: */ /* DLG_CFG_HARD_DISKS */ -#define IDT_HDD 1739 /* Hard disks: */ -#define IDT_BUS 1740 /* Bus: */ -#define IDT_CHANNEL 1741 /* Channel: */ -#define IDT_ID 1742 /* ID: */ -#define IDT_LUN 1743 /* LUN: */ -#define IDT_SPEED 1744 /* Speed: */ +#define IDT_HDD 1746 /* Hard disks: */ +#define IDT_BUS 1747 /* Bus: */ +#define IDT_CHANNEL 1748 /* Channel: */ +#define IDT_ID 1749 /* ID: */ +#define IDT_LUN 1750 /* LUN: */ +#define IDT_SPEED 1751 /* Speed: */ /* DLG_CFG_HARD_DISKS_ADD */ -#define IDT_SECTORS 1745 /* Sectors: */ -#define IDT_HEADS 1746 /* Heads: */ -#define IDT_CYLS 1747 /* Cylinders: */ -#define IDT_SIZE_MB 1748 /* Size (MB): */ -#define IDT_TYPE 1749 /* Type: */ -#define IDT_FILE_NAME 1750 /* File name: */ -#define IDT_IMG_FORMAT 1751 /* Image Format: */ -#define IDT_BLOCK_SIZE 1752 /* Block Size: */ -#define IDT_PROGRESS 1753 /* Progress: */ +#define IDT_SECTORS 1752 /* Sectors: */ +#define IDT_HEADS 1753 /* Heads: */ +#define IDT_CYLS 1754 /* Cylinders: */ +#define IDT_SIZE_MB 1755 /* Size (MB): */ +#define IDT_TYPE 1756 /* Type: */ +#define IDT_FILE_NAME 1757 /* File name: */ +#define IDT_IMG_FORMAT 1758 /* Image Format: */ +#define IDT_BLOCK_SIZE 1759 /* Block Size: */ +#define IDT_PROGRESS 1760 /* Progress: */ /* DLG_CFG_FLOPPY_AND_CDROM_DRIVES */ -#define IDT_FLOPPY_DRIVES 1754 /* Floppy drives: */ -#define IDT_FDD_TYPE 1755 /* Type: */ -#define IDT_CD_DRIVES 1756 /* CD-ROM drives: */ -#define IDT_CD_BUS 1757 /* Bus: */ -#define IDT_CD_ID 1758 /* ID: */ -#define IDT_CD_LUN 1759 /* LUN: */ -#define IDT_CD_CHANNEL 1760 /* Channel: */ -#define IDT_CD_SPEED 1761 /* Speed: */ +#define IDT_FLOPPY_DRIVES 1761 /* Floppy drives: */ +#define IDT_FDD_TYPE 1762 /* Type: */ +#define IDT_CD_DRIVES 1763 /* CD-ROM drives: */ +#define IDT_CD_BUS 1764 /* Bus: */ +#define IDT_CD_ID 1765 /* ID: */ +#define IDT_CD_LUN 1766 /* LUN: */ +#define IDT_CD_CHANNEL 1767 /* Channel: */ +#define IDT_CD_SPEED 1768 /* Speed: */ /* DLG_CFG_OTHER_REMOVABLE_DEVICES */ -#define IDT_MO_DRIVES 1762 /* MO drives: */ -#define IDT_MO_BUS 1763 /* Bus: */ -#define IDT_MO_ID 1764 /* ID: */ -#define IDT_MO_CHANNEL 1765 /* Channel */ -#define IDT_MO_TYPE 1766 /* Type: */ +#define IDT_MO_DRIVES 1769 /* MO drives: */ +#define IDT_MO_BUS 1770 /* Bus: */ +#define IDT_MO_ID 1771 /* ID: */ +#define IDT_MO_CHANNEL 1772 /* Channel */ +#define IDT_MO_TYPE 1773 /* Type: */ -#define IDT_ZIP_DRIVES 1767 /* ZIP drives: */ -#define IDT_ZIP_BUS 1768 /* Bus: */ -#define IDT_ZIP_ID 1769 /* ID: */ -#define IDT_ZIP_LUN 1770 /* LUN: */ -#define IDT_ZIP_CHANNEL 1771 /* Channel: */ +#define IDT_ZIP_DRIVES 1774 /* ZIP drives: */ +#define IDT_ZIP_BUS 1775 /* Bus: */ +#define IDT_ZIP_ID 1776 /* ID: */ +#define IDT_ZIP_LUN 1777 /* LUN: */ +#define IDT_ZIP_CHANNEL 1778 /* Channel: */ /* DLG_CFG_PERIPHERALS */ -#define IDT_ISARTC 1772 /* ISA RTC: */ -#define IDT_ISAMEM_1 1773 /* ISAMEM Board #1: */ -#define IDT_ISAMEM_2 1774 /* ISAMEM Board #2: */ -#define IDT_ISAMEM_3 1775 /* ISAMEM Board #3: */ -#define IDT_ISAMEM_4 1776 /* ISAMEM Board #4: */ +#define IDT_ISARTC 1779 /* ISA RTC: */ +#define IDT_ISAMEM_1 1780 /* ISAMEM Board #1: */ +#define IDT_ISAMEM_2 1781 /* ISAMEM Board #2: */ +#define IDT_ISAMEM_3 1782 /* ISAMEM Board #3: */ +#define IDT_ISAMEM_4 1783 /* ISAMEM Board #4: */ /* * To try to keep these organized, we now group the @@ -199,10 +206,10 @@ #define IDC_CONFIGURE_MOUSE 1034 #define IDC_SOUND 1040 /* sound config */ -#define IDC_COMBO_SOUND 1041 -#define IDC_CHECK_SSI 1042 -#define IDC_CHECK_CMS 1043 -#define IDC_CHECK_GUS 1044 +#define IDC_COMBO_SOUND1 1041 +#define IDC_COMBO_SOUND2 1042 +#define IDC_COMBO_SOUND3 1043 +#define IDC_COMBO_SOUND4 1044 #define IDC_COMBO_MIDI_OUT 1045 #define IDC_CHECK_MPU401 1046 #define IDC_CONFIGURE_MPU401 1047 @@ -215,109 +222,118 @@ #define IDC_RADIO_FM_DRV_NUKED 1054 #define IDC_RADIO_FM_DRV_YMFM 1055 -#define IDC_COMBO_NET_TYPE 1060 /* network config */ -#define IDC_COMBO_PCAP 1061 -#define IDC_COMBO_NET 1062 +#define IDC_COMBO_NET1_TYPE 1060 /* network config */ +#define IDC_COMBO_NET2_TYPE 1061 +#define IDC_COMBO_NET3_TYPE 1062 +#define IDC_COMBO_NET4_TYPE 1063 +#define IDC_COMBO_PCAP1 1064 +#define IDC_COMBO_PCAP2 1065 +#define IDC_COMBO_PCAP3 1066 +#define IDC_COMBO_PCAP4 1067 +#define IDC_COMBO_NET1 1068 +#define IDC_COMBO_NET2 1069 +#define IDC_COMBO_NET3 1070 +#define IDC_COMBO_NET4 1071 -#define IDC_COMBO_LPT1 1070 /* ports config */ -#define IDC_COMBO_LPT2 1071 -#define IDC_COMBO_LPT3 1072 -#define IDC_COMBO_LPT4 1073 -#define IDC_CHECK_SERIAL1 1074 -#define IDC_CHECK_SERIAL2 1075 -#define IDC_CHECK_SERIAL3 1076 -#define IDC_CHECK_SERIAL4 1077 -#define IDC_CHECK_PARALLEL1 1078 -#define IDC_CHECK_PARALLEL2 1079 -#define IDC_CHECK_PARALLEL3 1080 -#define IDC_CHECK_PARALLEL4 1081 +#define IDC_COMBO_LPT1 1080 /* ports config */ +#define IDC_COMBO_LPT2 1081 +#define IDC_COMBO_LPT3 1082 +#define IDC_COMBO_LPT4 1083 +#define IDC_CHECK_SERIAL1 1084 +#define IDC_CHECK_SERIAL2 1085 +#define IDC_CHECK_SERIAL3 1086 +#define IDC_CHECK_SERIAL4 1087 +#define IDC_CHECK_PARALLEL1 1088 +#define IDC_CHECK_PARALLEL2 1089 +#define IDC_CHECK_PARALLEL3 1090 +#define IDC_CHECK_PARALLEL4 1091 -#define IDC_OTHER_PERIPH 1082 /* storage controllers config */ -#define IDC_COMBO_HDC 1083 -#define IDC_CONFIGURE_HDC 1084 -#define IDC_CHECK_IDE_TER 1085 -#define IDC_BUTTON_IDE_TER 1086 -#define IDC_CHECK_IDE_QUA 1087 -#define IDC_BUTTON_IDE_QUA 1088 -#define IDC_GROUP_SCSI 1089 -#define IDC_COMBO_SCSI_1 1090 -#define IDC_COMBO_SCSI_2 1091 -#define IDC_COMBO_SCSI_3 1092 -#define IDC_COMBO_SCSI_4 1093 -#define IDC_CONFIGURE_SCSI_1 1094 -#define IDC_CONFIGURE_SCSI_2 1095 -#define IDC_CONFIGURE_SCSI_3 1096 -#define IDC_CONFIGURE_SCSI_4 1097 -#define IDC_CHECK_CASSETTE 1098 +#define IDC_OTHER_PERIPH 1110 /* storage controllers config */ +#define IDC_COMBO_HDC 1111 +#define IDC_CONFIGURE_HDC 1112 +#define IDC_CHECK_IDE_TER 1113 +#define IDC_BUTTON_IDE_TER 1114 +#define IDC_CHECK_IDE_QUA 1115 +#define IDC_BUTTON_IDE_QUA 1116 +#define IDC_GROUP_SCSI 1117 +#define IDC_COMBO_SCSI_1 1118 +#define IDC_COMBO_SCSI_2 1119 +#define IDC_COMBO_SCSI_3 1120 +#define IDC_COMBO_SCSI_4 1121 +#define IDC_CONFIGURE_SCSI_1 1122 +#define IDC_CONFIGURE_SCSI_2 1123 +#define IDC_CONFIGURE_SCSI_3 1124 +#define IDC_CONFIGURE_SCSI_4 1125 +#define IDC_CHECK_CASSETTE 1126 -#define IDC_HARD_DISKS 1100 /* hard disks config */ -#define IDC_LIST_HARD_DISKS 1101 -#define IDC_BUTTON_HDD_ADD_NEW 1102 -#define IDC_BUTTON_HDD_ADD 1103 -#define IDC_BUTTON_HDD_REMOVE 1104 -#define IDC_COMBO_HD_BUS 1105 -#define IDC_COMBO_HD_CHANNEL 1106 -#define IDC_COMBO_HD_ID 1107 -#define IDC_COMBO_HD_LUN 1108 -#define IDC_COMBO_HD_CHANNEL_IDE 1109 +#define IDC_HARD_DISKS 1130 /* hard disks config */ +#define IDC_LIST_HARD_DISKS 1131 +#define IDC_BUTTON_HDD_ADD_NEW 1132 +#define IDC_BUTTON_HDD_ADD 1133 +#define IDC_BUTTON_HDD_REMOVE 1134 +#define IDC_COMBO_HD_BUS 1135 +#define IDC_COMBO_HD_CHANNEL 1136 +#define IDC_COMBO_HD_ID 1137 +#define IDC_COMBO_HD_LUN 1138 +#define IDC_COMBO_HD_CHANNEL_IDE 1139 -#define IDC_EDIT_HD_FILE_NAME 1110 /* add hard disk dialog */ -#define IDC_EDIT_HD_SPT 1111 -#define IDC_EDIT_HD_HPC 1112 -#define IDC_EDIT_HD_CYL 1113 -#define IDC_EDIT_HD_SIZE 1114 -#define IDC_COMBO_HD_TYPE 1115 -#define IDC_PBAR_IMG_CREATE 1116 -#define IDC_COMBO_HD_IMG_FORMAT 1117 -#define IDC_COMBO_HD_BLOCK_SIZE 1118 +#define IDC_EDIT_HD_FILE_NAME 1140 /* add hard disk dialog */ +#define IDC_EDIT_HD_SPT 1141 +#define IDC_EDIT_HD_HPC 1142 +#define IDC_EDIT_HD_CYL 1143 +#define IDC_EDIT_HD_SIZE 1144 +#define IDC_COMBO_HD_TYPE 1145 +#define IDC_PBAR_IMG_CREATE 1146 +#define IDC_COMBO_HD_IMG_FORMAT 1147 +#define IDC_COMBO_HD_BLOCK_SIZE 1148 -#define IDC_REMOV_DEVICES 1120 /* floppy and cd-rom drives config */ -#define IDC_LIST_FLOPPY_DRIVES 1121 -#define IDC_COMBO_FD_TYPE 1122 -#define IDC_CHECKTURBO 1123 -#define IDC_CHECKBPB 1124 -#define IDC_LIST_CDROM_DRIVES 1125 -#define IDC_COMBO_CD_BUS 1126 -#define IDC_COMBO_CD_ID 1127 -#define IDC_COMBO_CD_LUN 1128 -#define IDC_COMBO_CD_CHANNEL_IDE 1129 -#define IDC_CHECKEARLY 1130 +#define IDC_REMOV_DEVICES 1150 /* floppy and cd-rom drives config */ +#define IDC_LIST_FLOPPY_DRIVES 1151 +#define IDC_COMBO_FD_TYPE 1152 +#define IDC_CHECKTURBO 1153 +#define IDC_CHECKBPB 1154 +#define IDC_LIST_CDROM_DRIVES 1155 +#define IDC_COMBO_CD_BUS 1156 +#define IDC_COMBO_CD_ID 1157 +#define IDC_COMBO_CD_LUN 1158 +#define IDC_COMBO_CD_CHANNEL_IDE 1159 +#define IDC_CHECKEARLY 1160 -#define IDC_LIST_ZIP_DRIVES 1140 /* other removable devices config */ -#define IDC_COMBO_ZIP_BUS 1141 -#define IDC_COMBO_ZIP_ID 1142 -#define IDC_COMBO_ZIP_LUN 1143 -#define IDC_COMBO_ZIP_CHANNEL_IDE 1144 -#define IDC_CHECK250 1145 -#define IDC_COMBO_CD_SPEED 1146 -#define IDC_LIST_MO_DRIVES 1147 -#define IDC_COMBO_MO_BUS 1148 -#define IDC_COMBO_MO_ID 1149 -#define IDC_COMBO_MO_LUN 1150 -#define IDC_COMBO_MO_CHANNEL_IDE 1151 -#define IDC_COMBO_MO_TYPE 1152 +#define IDC_LIST_ZIP_DRIVES 1170 /* other removable devices config */ +#define IDC_COMBO_ZIP_BUS 1171 +#define IDC_COMBO_ZIP_ID 1172 +#define IDC_COMBO_ZIP_LUN 1173 +#define IDC_COMBO_ZIP_CHANNEL_IDE 1174 +#define IDC_CHECK250 1175 +#define IDC_COMBO_CD_SPEED 1176 +#define IDC_LIST_MO_DRIVES 1177 +#define IDC_COMBO_MO_BUS 1178 +#define IDC_COMBO_MO_ID 1179 +#define IDC_COMBO_MO_LUN 1170 +#define IDC_COMBO_MO_CHANNEL_IDE 1181 +#define IDC_COMBO_MO_TYPE 1182 -#define IDC_CHECK_BUGGER 1160 /* other periph config */ -#define IDC_CHECK_POSTCARD 1161 -#define IDC_COMBO_ISARTC 1162 -#define IDC_CONFIGURE_ISARTC 1163 -#define IDC_COMBO_FDC 1164 -#define IDC_CONFIGURE_FDC 1165 -#define IDC_GROUP_ISAMEM 1166 -#define IDC_COMBO_ISAMEM_1 1167 -#define IDC_COMBO_ISAMEM_2 1168 -#define IDC_COMBO_ISAMEM_3 1169 -#define IDC_COMBO_ISAMEM_4 1170 -#define IDC_CONFIGURE_ISAMEM_1 1171 -#define IDC_CONFIGURE_ISAMEM_2 1172 -#define IDC_CONFIGURE_ISAMEM_3 1173 -#define IDC_CONFIGURE_ISAMEM_4 1174 +#define IDC_CHECK_BUGGER 1190 /* other periph config */ +#define IDC_CHECK_POSTCARD 1191 +#define IDC_COMBO_ISARTC 1192 +#define IDC_CONFIGURE_ISARTC 1193 +#define IDC_COMBO_FDC 1194 +#define IDC_CONFIGURE_FDC 1195 +#define IDC_GROUP_ISAMEM 1196 +#define IDC_COMBO_ISAMEM_1 1197 +#define IDC_COMBO_ISAMEM_2 1198 +#define IDC_COMBO_ISAMEM_3 1199 +#define IDC_COMBO_ISAMEM_4 1200 +#define IDC_CONFIGURE_ISAMEM_1 1201 +#define IDC_CONFIGURE_ISAMEM_2 1202 +#define IDC_CONFIGURE_ISAMEM_3 1203 +#define IDC_CONFIGURE_ISAMEM_4 1204 -#define IDC_SLIDER_GAIN 1180 /* sound gain dialog */ +#define IDC_SLIDER_GAIN 1210 /* sound gain dialog */ -#define IDC_EDIT_FILE_NAME 1200 /* new floppy image dialog */ -#define IDC_COMBO_DISK_SIZE 1201 -#define IDC_COMBO_RPM_MODE 1202 +#define IDC_EDIT_FILE_NAME 1220 /* new floppy image dialog */ +#define IDC_COMBO_DISK_SIZE 1221 +#define IDC_COMBO_RPM_MODE 1222 #define IDC_COMBO_LANG 1009 /* change language dialog */ #define IDC_COMBO_ICON 1010 @@ -329,19 +345,29 @@ #define IDC_CONFIG_BASE 1300 #define IDC_CONFIGURE_VID 1300 #define IDC_CONFIGURE_VID_2 1301 -#define IDC_CONFIGURE_SND 1302 -#define IDC_CONFIGURE_VOODOO 1303 -#define IDC_CONFIGURE_MOD 1304 -#define IDC_CONFIGURE_NET_TYPE 1305 -#define IDC_CONFIGURE_BUSLOGIC 1306 -#define IDC_CONFIGURE_PCAP 1307 -#define IDC_CONFIGURE_NET 1308 -#define IDC_CONFIGURE_MIDI_OUT 1309 -#define IDC_CONFIGURE_MIDI_IN 1310 -#define IDC_JOY1 1311 -#define IDC_JOY2 1312 -#define IDC_JOY3 1313 -#define IDC_JOY4 1314 +#define IDC_CONFIGURE_SND1 1302 +#define IDC_CONFIGURE_SND2 1303 +#define IDC_CONFIGURE_SND3 1304 +#define IDC_CONFIGURE_SND4 1305 +#define IDC_CONFIGURE_VOODOO 1306 +#define IDC_CONFIGURE_NET1_TYPE 1310 +#define IDC_CONFIGURE_NET2_TYPE 1311 +#define IDC_CONFIGURE_NET3_TYPE 1312 +#define IDC_CONFIGURE_NET4_TYPE 1313 +#define IDC_CONFIGURE_PCAP1 1314 +#define IDC_CONFIGURE_PCAP2 1315 +#define IDC_CONFIGURE_PCAP3 1316 +#define IDC_CONFIGURE_PCAP4 1317 +#define IDC_CONFIGURE_NET1 1318 +#define IDC_CONFIGURE_NET2 1319 +#define IDC_CONFIGURE_NET3 1320 +#define IDC_CONFIGURE_NET4 1321 +#define IDC_CONFIGURE_MIDI_OUT 1322 +#define IDC_CONFIGURE_MIDI_IN 1323 +#define IDC_JOY1 1330 +#define IDC_JOY2 1331 +#define IDC_JOY3 1332 +#define IDC_JOY4 1333 #define IDC_HDTYPE 1380 #define IDC_RENDER 1381 #define IDC_STATUS 1382 @@ -386,20 +412,27 @@ #define IDM_VID_SCALE_2X 40056 #define IDM_VID_SCALE_3X 40057 #define IDM_VID_SCALE_4X 40058 -#define IDM_VID_HIDPI 40059 -#define IDM_VID_FULLSCREEN 40060 -#define IDM_VID_FS_FULL 40061 -#define IDM_VID_FS_43 40062 -#define IDM_VID_FS_KEEPRATIO 40063 -#define IDM_VID_FS_INT 40064 -#define IDM_VID_SPECIFY_DIM 40065 -#define IDM_VID_FORCE43 40066 -#define IDM_VID_OVERSCAN 40067 -#define IDM_VID_INVERT 40069 -#define IDM_VID_CGACON 40070 -#define IDM_VID_GRAYCT_601 40075 -#define IDM_VID_GRAYCT_709 40076 -#define IDM_VID_GRAYCT_AVE 40077 +#define IDM_VID_SCALE_5X 40059 +#define IDM_VID_SCALE_6X 40060 +#define IDM_VID_SCALE_7X 40061 +#define IDM_VID_SCALE_8X 40062 +#define IDM_VID_SCALE_9X 40063 +#define IDM_VID_SCALE_10X 40064 + +#define IDM_VID_HIDPI 40065 +#define IDM_VID_FULLSCREEN 40066 +#define IDM_VID_FS_FULL 40067 +#define IDM_VID_FS_43 40068 +#define IDM_VID_FS_KEEPRATIO 40069 +#define IDM_VID_FS_INT 40070 +#define IDM_VID_SPECIFY_DIM 40071 +#define IDM_VID_FORCE43 40072 +#define IDM_VID_OVERSCAN 40073 +#define IDM_VID_INVERT 40074 +#define IDM_VID_CGACON 40075 +#define IDM_VID_GRAYCT_601 40076 +#define IDM_VID_GRAYCT_709 40077 +#define IDM_VID_GRAYCT_AVE 40078 #define IDM_VID_GRAY_RGB 40080 #define IDM_VID_GRAY_MONO 40081 #define IDM_VID_GRAY_AMBER 40082 diff --git a/src/include/86box/rom.h b/src/include/86box/rom.h index 82a1aef5f..91f813a95 100644 --- a/src/include/86box/rom.h +++ b/src/include/86box/rom.h @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the ROM image handler. + * Definitions for the ROM image handler. * * * - * Author: Fred N. van Kempen, - * Copyright 2018,2019 Fred N. van Kempen. + * Authors: Fred N. van Kempen, + * + * Copyright 2018-2019 Fred N. van Kempen. */ #ifndef EMU_ROM_H diff --git a/src/include/86box/scsi.h b/src/include/86box/scsi.h index 93a7fd010..d19497101 100644 --- a/src/include/86box/scsi.h +++ b/src/include/86box/scsi.h @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * SCSI controller handler header. + * SCSI controller handler header. * * * - * Authors: TheCollector1995, - * Miran Grca, - * Fred N. van Kempen, + * Authors: TheCollector1995, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2016-2018 TheCollector1995. - * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2016-2018 TheCollector1995. + * Copyright 2016-2018 Miran Grca. + * Copyright 2017-2018 Fred N. van Kempen. */ #ifndef EMU_SCSI_H #define EMU_SCSI_H diff --git a/src/include/86box/scsi_buslogic.h b/src/include/86box/scsi_buslogic.h index be865ec57..12bff6fdf 100644 --- a/src/include/86box/scsi_buslogic.h +++ b/src/include/86box/scsi_buslogic.h @@ -1,19 +1,20 @@ /* - * 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. + * 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. * - * Emulation of BusLogic BT-542B ISA and BT-958D PCI SCSI - * controllers. + * Emulation of BusLogic BT-542B ISA and BT-958D PCI SCSI + * controllers. * * * - * Authors: TheCollector1995, - * Miran Grca, - * Fred N. van Kempen, - * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Authors: TheCollector1995, + * Miran Grca, + * Fred N. van Kempen, + * + * Copyright 2016-2018 Miran Grca. + * Copyright 2017-2018 Fred N. van Kempen. */ #ifndef SCSI_BUSLOGIC_H diff --git a/src/include/86box/scsi_cdrom.h b/src/include/86box/scsi_cdrom.h index e991ccc36..6b94c2aa4 100644 --- a/src/include/86box/scsi_cdrom.h +++ b/src/include/86box/scsi_cdrom.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the CD-ROM drive with SCSI(-like) - * commands, for both ATAPI and SCSI usage. + * Implementation of the CD-ROM drive with SCSI(-like) + * commands, for both ATAPI and SCSI usage. * * * - * Author: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2018,2019 Miran Grca. + * Copyright 2018-2019 Miran Grca. */ #ifndef EMU_SCSI_CDROM_H @@ -49,6 +49,10 @@ typedef struct { packet_len, pos; double callback; + + mode_sense_pages_t ms_pages_saved_sony; + mode_sense_pages_t ms_drive_status_pages_saved; + int sony_vendor; } scsi_cdrom_t; #endif diff --git a/src/include/86box/scsi_device.h b/src/include/86box/scsi_device.h index 650215cb5..61048fb54 100644 --- a/src/include/86box/scsi_device.h +++ b/src/include/86box/scsi_device.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the generic SCSI device command handler. + * Definitions for the generic SCSI device command handler. * * * - * Authors: Miran Grca, - * Fred N. van Kempen, + * Authors: Miran Grca, + * Fred N. van Kempen, * - * Copyright 2016-2019 Miran Grca. - * Copyright 2017-2019 Fred N. van Kempen. + * Copyright 2016-2019 Miran Grca. + * Copyright 2017-2019 Fred N. van Kempen. */ #ifndef SCSI_DEVICE_H @@ -53,6 +53,8 @@ #define GPCMD_SEEK_6 0x0b #define GPCMD_IOMEGA_SET_PROTECTION_MODE 0x0c #define GPCMD_IOMEGA_EJECT 0x0d /* ATAPI only? */ +#define GPCMD_NO_OPERATION_TOSHIBA 0x0d /* Toshiba Vendor Unique command */ +#define GPCMD_NO_OPERATION_NEC 0x0d /* NEC Vendor Unique command */ #define GPCMD_INQUIRY 0x12 #define GPCMD_VERIFY_6 0x13 #define GPCMD_MODE_SELECT_6 0x15 @@ -64,7 +66,7 @@ #define GPCMD_PREVENT_REMOVAL 0x1e #define GPCMD_READ_FORMAT_CAPACITIES 0x23 #define GPCMD_READ_CDROM_CAPACITY 0x25 -#define GPCMD_CHINON_UNKNOWN 0x26 +#define GPCMD_UNKNOWN_CHINON 0x26 /*Chinon Vendor Unique command*/ #define GPCMD_READ_10 0x28 #define GPCMD_READ_GENERATION 0x29 #define GPCMD_WRITE_10 0x2a @@ -100,23 +102,51 @@ #define GPCMD_PLAY_CD_OLD 0xb4 #define GPCMD_READ_CD_OLD 0xb8 #define GPCMD_READ_CD_MSF 0xb9 -#define GPCMD_SCAN 0xba +#define GPCMD_AUDIO_SCAN 0xba #define GPCMD_SET_SPEED 0xbb #define GPCMD_PLAY_CD 0xbc #define GPCMD_MECHANISM_STATUS 0xbd #define GPCMD_READ_CD 0xbe #define GPCMD_SEND_DVD_STRUCTURE 0xbf /* This is for writing only, irrelevant to 86Box. */ -#define GPCMD_CHINON_EJECT 0xc0 /* Chinon Vendor Unique command */ -#define GPCMD_AUDIO_TRACK_SEARCH 0xc0 /* Toshiba Vendor Unique command */ -#define GPCMD_TOSHIBA_PLAY_AUDIO 0xc1 /* Toshiba Vendor Unique command */ +#define GPCMD_EJECT_CHINON 0xc0 /* Chinon Vendor Unique command */ +#define GPCMD_AUDIO_TRACK_SEARCH_TOSHIBA 0xc0 /* Toshiba Vendor Unique command */ +#define GPCMD_UNKNOWN_SONY 0xc0 /* Sony Vendor Unique command */ +#define GPCMD_PLAY_AUDIO_TOSHIBA 0xc1 /* Toshiba Vendor Unique command */ +#define GPCMD_READ_TOC_SONY 0xc1 /* Sony Vendor Unique command */ #define GPCMD_PAUSE_RESUME_ALT 0xc2 -#define GPCMD_STILL 0xc2 /* Toshiba Vendor Unique command */ -#define GPCMD_CADDY_EJECT 0xc4 /* Toshiba Vendor Unique command */ -#define GPCMD_CHINON_STOP 0xc6 /* Chinon Vendor Unique command */ -#define GPCMD_READ_SUBCODEQ_PLAYING_STATUS 0xc6 /* Toshiba Vendor Unique command */ +#define GPCMD_READ_SUBCHANNEL_MATSUSHITA 0xc2 /* Matsushita Vendor Unique command */ +#define GPCMD_READ_SUBCHANNEL_SONY 0xc2 /* Sony Vendor Unique command */ +#define GPCMD_STILL_TOSHIBA 0xc2 /* Toshiba Vendor Unique command */ +#define GPCMD_READ_TOC_MATSUSHITA 0xc3 /* Matsushita Vendor Unique command */ +#define GPCMD_READ_HEADER_SONY 0xc3 /* Sony Vendor Unique command */ +#define GPCMD_SET_STOP_TIME_TOSHIBA 0xc3 /* Toshiba Vendor Unique command */ +#define GPCMD_READ_HEADER_MATSUSHITA 0xc4 /* Matsushita Vendor Unique command */ +#define GPCMD_PLAYBACK_STATUS_TOSHIBA 0xc4 /* Sony Vendor Unique command */ +#define GPCMD_CADDY_EJECT_TOSHIBA 0xc4 /* Toshiba Vendor Unique command */ +#define GPCMD_PAUSE_SONY 0xc5 /* Sony Vendor Unique command */ +#define GPCMD_PLAY_AUDIO_MATSUSHITA 0xc5 /* Matsushita Vendor Unique command */ +#define GPCMD_STOP_CHINON 0xc6 /* Chinon Vendor Unique command */ +#define GPCMD_PLAT_TRACK_SONY 0xc6 /* Sony Vendor Unique command */ +#define GPCMD_READ_SUBCODEQ_PLAYING_STATUS_TOSHIBA 0xc6 /* Toshiba Vendor Unique command */ +#define GPCMD_PLAY_AUDIO_MSF_MATSUSHITA 0xc7 /* Matsushita Vendor Unique command*/ +#define GPCMD_PLAY_MSF_SONY 0xc7 /* Sony Vendor Unique command*/ #define GPCMD_READ_DISC_INFORMATION_TOSHIBA 0xc7 /* Toshiba Vendor Unique command */ -#define GPCMD_SCAN_ALT 0xcd /* Should be equivalent to 0xba */ +#define GPCMD_PLAY_AUDIO_TRACK_INDEX_MATSUSHITA 0xc8 /* Matsushita Vendor Unique command */ +#define GPCMD_PLAY_AUDIO_SONY 0xc8 /* Sony Vendor Unique command */ +#define GPCMD_PLAY_AUDIO_TRACK_RELATIVE_10_MATSUSHITA 0xc9 /*Matsushita Vendor Unique command */ +#define GPCMD_PLAYBACK_CONTROL_SONY 0xc9 /* Sony Vendor Unique command */ +#define GPCMD_PAUSE_RESUME_MATSUSHITA 0xcb /* Matsushita Vendor Unique command */ +#define GPCMD_SCAN_PIONEER 0xcd /* Should be equivalent to 0xba */ +#define GPCMD_AUDIO_TRACK_SEARCH_NEC 0xd8 /* NEC Vendor Unique command */ +#define GPCMD_PLAY_AUDIO_NEC 0xd9 /* NEC Vendor Unique command */ +#define GPCMD_STILL_NEC 0xda /* NEC Vendor Unique command */ #define GPCMD_SET_SPEED_ALT 0xda /* Should be equivalent to 0xbb */ +#define GPCMD_SET_STOP_TIME_NEC 0xdb /* NEC Vendor Unique command */ +#define GPCMD_CADDY_EJECT_NEC 0xdc /* NEC Vendor Unique command */ +#define GPCMD_READ_SUBCODEQ_PLAYING_STATUS_NEC 0xdd /* NEC Vendor Unique command */ +#define GPCMD_READ_DISC_INFORMATION_NEC 0xde /* NEC Vendor Unique command */ +#define GPCMD_PLAY_AUDIO_12_MATSUSHITA 0xe5 /* Matsushita Vendor Unique command */ +#define GPCMD_PLAY_AUDIO_TRACK_RELATIVE_12_MATSUSHITA 0xe9 /* Matsushita Vendor Unique command */ /* Mode page codes for mode sense/set */ #define GPMODE_R_W_ERROR_PAGE 0x01 @@ -125,6 +155,8 @@ #define GPMODE_RIGID_DISK_PAGE 0x04 /* Rigid disk geometry page */ #define GPMODE_FLEXIBLE_DISK_PAGE 0x05 #define GPMODE_CACHING_PAGE 0x08 +#define GPMODE_CDROM_PAGE_SONY 0x08 +#define GPMODE_CDROM_AUDIO_PAGE_SONY 0x09 #define GPMODE_CDROM_PAGE 0x0d #define GPMODE_CDROM_AUDIO_PAGE 0x0e #define GPMODE_CAPABILITIES_PAGE 0x2a @@ -139,6 +171,8 @@ #define GPMODEP_RIGID_DISK_PAGE 0x0000000000000010LL #define GPMODEP_FLEXIBLE_DISK_PAGE 0x0000000000000020LL #define GPMODEP_CACHING_PAGE 0x0000000000000100LL +#define GPMODEP_CDROM_PAGE_SONY 0x0000000000000200LL +#define GPMODEP_CDROM_AUDIO_PAGE_SONY 0x0000000000000400LL #define GPMODEP_CDROM_PAGE 0x0000000000002000LL #define GPMODEP_CDROM_AUDIO_PAGE 0x0000000000004000LL #define GPMODEP_CAPABILITIES_PAGE 0x0000040000000000LL diff --git a/src/include/86box/scsi_disk.h b/src/include/86box/scsi_disk.h index 94171e7ac..bff40a396 100644 --- a/src/include/86box/scsi_disk.h +++ b/src/include/86box/scsi_disk.h @@ -1,15 +1,16 @@ /* - * 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. + * 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. * - * Emulation of SCSI fixed and removable disks. + * Emulation of SCSI fixed and removable disks. * * * - * Author: Miran Grca, - * Copyright 2017,2018 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2017-2018 Miran Grca. */ #ifndef SCSI_DISK_H diff --git a/src/include/86box/scsi_ncr5380.h b/src/include/86box/scsi_ncr5380.h index 045e6bbe7..ecf5660ef 100644 --- a/src/include/86box/scsi_ncr5380.h +++ b/src/include/86box/scsi_ncr5380.h @@ -1,24 +1,24 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the NCR 5380 series of SCSI Host Adapters - * made by NCR. These controllers were designed for - * the ISA bus. + * Implementation of the NCR 5380 series of SCSI Host Adapters + * made by NCR. These controllers were designed for + * the ISA bus. * * * - * Authors: Sarah Walker, - * TheCollector1995, - * Fred N. van Kempen, + * Authors: Sarah Walker, + * TheCollector1995, + * Fred N. van Kempen, * - * Copyright 2017-2018 Sarah Walker. - * Copyright 2017-2018 TheCollector1995. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Sarah Walker. + * Copyright 2017-2018 TheCollector1995. + * Copyright 2017-2018 Fred N. van Kempen. */ #ifndef SCSI_NCR5380_H diff --git a/src/include/86box/scsi_ncr53c8xx.h b/src/include/86box/scsi_ncr53c8xx.h index 37c5a72bf..5149c2203 100644 --- a/src/include/86box/scsi_ncr53c8xx.h +++ b/src/include/86box/scsi_ncr53c8xx.h @@ -1,25 +1,25 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the NCR 53C810 and 53C875 SCSI Host - * Adapters made by NCR and later Symbios and LSI. These - * controllers were designed for the PCI bus. + * Implementation of the NCR 53C810 and 53C875 SCSI Host + * Adapters made by NCR and later Symbios and LSI. These + * controllers were designed for the PCI bus. * * * - * Authors: TheCollector1995, - * Miran Grca, - * Paul Brook (QEMU), - * Artyom Tarasenko (QEMU), + * Authors: TheCollector1995, + * Miran Grca, + * Paul Brook (QEMU), + * Artyom Tarasenko (QEMU), * - * Copyright 2006-2018 Paul Brook. - * Copyright 2009-2018 Artyom Tarasenko. - * Copyright 2017,2018 Miran Grca. + * Copyright 2006-2018 Paul Brook. + * Copyright 2009-2018 Artyom Tarasenko. + * Copyright 2017-2018 Miran Grca. */ #ifndef SCSI_NCR53C8XX_H diff --git a/src/include/86box/scsi_pcscsi.h b/src/include/86box/scsi_pcscsi.h index d0b5baf04..0ce353d33 100644 --- a/src/include/86box/scsi_pcscsi.h +++ b/src/include/86box/scsi_pcscsi.h @@ -1,25 +1,25 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the AMD PCscsi and Tekram DC-390 SCSI - * controllers using the NCR 53c9x series of chips. + * Implementation of the AMD PCscsi and Tekram DC-390 SCSI + * controllers using the NCR 53c9x series of chips. * * * * - * Authors: Fabrice Bellard (QEMU) - * Herve Poussineau (QEMU) - * TheCollector1995, - * Miran Grca, + * Authors: Fabrice Bellard (QEMU) + * Herve Poussineau (QEMU) + * TheCollector1995, + * Miran Grca, * - * Copyright 2005-2018 Fabrice Bellard. - * Copyright 2012-2018 Herve Poussineau. - * Copyright 2017,2018 Miran Grca. + * Copyright 2005-2018 Fabrice Bellard. + * Copyright 2012-2018 Herve Poussineau. + * Copyright 2017-2018 Miran Grca. */ #ifndef SCSI_PCSCSI_H diff --git a/src/include/86box/scsi_spock.h b/src/include/86box/scsi_spock.h index 3dae005db..bfa579c82 100644 --- a/src/include/86box/scsi_spock.h +++ b/src/include/86box/scsi_spock.h @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the IBM PS/2 SCSI controller with - * cache for MCA only. + * Implementation of the IBM PS/2 SCSI controller with + * cache for MCA only. * * * - * Authors: Sarah Walker, - * TheCollector1995, + * Authors: Sarah Walker, + * TheCollector1995, * - * Copyright 2020 Sarah Walker. - * Copyright 2020 TheCollector1995. + * Copyright 2020 Sarah Walker. + * Copyright 2020 TheCollector1995. */ #ifndef SCSI_SPOCK_H diff --git a/src/include/86box/scsi_x54x.h b/src/include/86box/scsi_x54x.h index 68a31e651..a20f1e788 100644 --- a/src/include/86box/scsi_x54x.h +++ b/src/include/86box/scsi_x54x.h @@ -1,24 +1,24 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header of the code common to the AHA-154x series of SCSI - * Host Adapters made by Adaptec, Inc. and the BusLogic series - * of SCSI Host Adapters made by Mylex. - * These controllers were designed for various buses. + * Header of the code common to the AHA-154x series of SCSI + * Host Adapters made by Adaptec, Inc. and the BusLogic series + * of SCSI Host Adapters made by Mylex. + * These controllers were designed for various buses. * * * - * Authors: TheCollector1995, - * Miran Grca, - * Fred N. van Kempen, + * Authors: TheCollector1995, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2016-2018 Miran Grca. + * Copyright 2017-2018 Fred N. van Kempen. */ #ifndef SCSI_X54X_H diff --git a/src/include/86box/serial.h b/src/include/86box/serial.h index 1394a1c53..ae48ee09f 100644 --- a/src/include/86box/serial.h +++ b/src/include/86box/serial.h @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/include/86box/sio.h b/src/include/86box/sio.h index 09b5b1c40..8b95b55b5 100644 --- a/src/include/86box/sio.h +++ b/src/include/86box/sio.h @@ -29,6 +29,7 @@ extern const device_t fdc37c663_device; extern const device_t fdc37c663_ide_device; extern const device_t fdc37c665_device; extern const device_t fdc37c665_ide_device; +extern const device_t fdc37c665_ide_pri_device; extern const device_t fdc37c666_device; extern const device_t fdc37c67x_device; extern const device_t fdc37c669_device; diff --git a/src/include/86box/smram.h b/src/include/86box/smram.h index 07537a7f6..84d1cbe8d 100644 --- a/src/include/86box/smram.h +++ b/src/include/86box/smram.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the SMRAM interface. + * Definitions for the SMRAM interface. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2016-2020 Miran Grca. + * Copyright 2016-2020 Miran Grca. */ #ifndef EMU_SMRAM_H diff --git a/src/include/86box/snd_ac97.h b/src/include/86box/snd_ac97.h index 600dd84d8..14d31dc40 100644 --- a/src/include/86box/snd_ac97.h +++ b/src/include/86box/snd_ac97.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for AC'97 audio emulation. + * Definitions for AC'97 audio emulation. * * * - * Authors: RichardG, + * Authors: RichardG, * - * Copyright 2021 RichardG. + * Copyright 2021 RichardG. */ #ifndef SOUND_AC97_H #define SOUND_AC97_H diff --git a/src/include/86box/snd_ad1848.h b/src/include/86box/snd_ad1848.h index bdf5022e5..76fc775db 100644 --- a/src/include/86box/snd_ad1848.h +++ b/src/include/86box/snd_ad1848.h @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for AD1848 / CS4248 / CS4231 (Windows Sound System) codec emulation. + * Definitions for AD1848 / CS4248 / CS4231 (Windows Sound System) codec emulation. * * * - * Authors: Sarah Walker, - * TheCollector1995, - * RichardG, + * Authors: Sarah Walker, + * TheCollector1995, + * RichardG, * - * Copyright 2008-2020 Sarah Walker. - * Copyright 2018-2020 TheCollector1995. - * Copyright 2021 RichardG. + * Copyright 2008-2020 Sarah Walker. + * Copyright 2018-2020 TheCollector1995. + * Copyright 2021 RichardG. */ #ifndef SOUND_AD1848_H diff --git a/src/include/86box/snd_mpu401.h b/src/include/86box/snd_mpu401.h index 96143b251..4afbc6b53 100644 --- a/src/include/86box/snd_mpu401.h +++ b/src/include/86box/snd_mpu401.h @@ -1,23 +1,24 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Roland MPU-401 emulation. + * Roland MPU-401 emulation. * * * - * Author: Sarah Walker, - * DOSBox Team, - * Miran Grca, - * TheCollector1995, - * Copyright 2008-2020 Sarah Walker. - * Copyright 2008-2020 DOSBox Team. - * Copyright 2016-2020 Miran Grca. - * Copyright 2016-2020 TheCollector1995. + * Authors: Sarah Walker, + * DOSBox Team, + * Miran Grca, + * TheCollector1995, + * + * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 DOSBox Team. + * Copyright 2016-2020 Miran Grca. + * Copyright 2016-2020 TheCollector1995. */ #ifndef SOUND_MPU401_H diff --git a/src/include/86box/snd_opl.h b/src/include/86box/snd_opl.h index 5caccf8fc..b4f26543d 100644 --- a/src/include/86box/snd_opl.h +++ b/src/include/86box/snd_opl.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the OPL interface. + * Definitions for the OPL interface. * - * Authors: Fred N. van Kempen, - * Miran Grca, + * Authors: Fred N. van Kempen, + * Miran Grca, * - * Copyright 2017-2020 Fred N. van Kempen. - * Copyright 2016-2020 Miran Grca. + * Copyright 2017-2020 Fred N. van Kempen. + * Copyright 2016-2020 Miran Grca. */ #ifndef SOUND_OPL_H #define SOUND_OPL_H diff --git a/src/include/86box/snd_opl_nuked.h b/src/include/86box/snd_opl_nuked.h index 635863407..f82e85b0e 100644 --- a/src/include/86box/snd_opl_nuked.h +++ b/src/include/86box/snd_opl_nuked.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the NukedOPL3 driver. + * Definitions for the NukedOPL3 driver. * - * Version: @(#)snd_opl_nuked.h 1.0.5 2020/07/16 + * Version: @(#)snd_opl_nuked.h 1.0.5 2020/07/16 * - * Authors: Fred N. van Kempen, - * Miran Grca, + * Authors: Fred N. van Kempen, + * Miran Grca, * - * Copyright 2017-2020 Fred N. van Kempen. - * Copyright 2016-2019 Miran Grca. + * Copyright 2017-2020 Fred N. van Kempen. + * Copyright 2016-2019 Miran Grca. */ #ifndef SOUND_OPL_NUKED_H diff --git a/src/include/86box/snd_sb.h b/src/include/86box/snd_sb.h index 577335976..88f2c74f1 100644 --- a/src/include/86box/snd_sb.h +++ b/src/include/86box/snd_sb.h @@ -8,7 +8,7 @@ * * Sound Blaster emulation. * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * TheCollector1995, * diff --git a/src/include/86box/snd_speaker.h b/src/include/86box/snd_speaker.h index 922603d98..516d20588 100644 --- a/src/include/86box/snd_speaker.h +++ b/src/include/86box/snd_speaker.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header of the emulation of the PC speaker. + * Header of the emulation of the PC speaker. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #ifndef SOUND_SPEAKER_H diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index 10303c3ca..f0bfad7c7 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2018 Sarah Walker. @@ -20,6 +20,8 @@ #ifndef EMU_SOUND_H #define EMU_SOUND_H +#define SOUND_CARD_MAX 4 /* currently we support up to 4 sound cards and a standalome MPU401 */ + extern int sound_gain; #define SOUNDBUFLEN (48000 / 50) @@ -38,7 +40,7 @@ extern int gated, speakon; extern int sound_pos_global; -extern int sound_card_current; +extern int sound_card_current[SOUND_CARD_MAX]; extern void sound_add_handler(void (*get_buffer)(int32_t *buffer, int len, void *p), diff --git a/src/include/86box/ui.h b/src/include/86box/ui.h index 70971ce19..9698f896c 100644 --- a/src/include/86box/ui.h +++ b/src/include/86box/ui.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Define the various UI functions. + * Define the various UI functions. * * * - * Authors: Miran Grca, - * Fred N. van Kempen, + * Authors: Miran Grca, + * Fred N. van Kempen, * - * Copyright 2016-2019 Miran Grca. - * Copyright 2017-2019 Fred N. van Kempen. + * Copyright 2016-2019 Miran Grca. + * Copyright 2017-2019 Fred N. van Kempen. */ #ifndef EMU_UI_H #define EMU_UI_H diff --git a/src/include/86box/usb.h b/src/include/86box/usb.h index 893a9f501..d0b169b6c 100644 --- a/src/include/86box/usb.h +++ b/src/include/86box/usb.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the Distributed DMA emulation. + * Definitions for the Distributed DMA emulation. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2020 Miran Grca. + * Copyright 2020 Miran Grca. */ #ifndef USB_H diff --git a/src/include/86box/version.h.in b/src/include/86box/version.h.in index b8cd9ed97..5ebf7dba9 100644 --- a/src/include/86box/version.h.in +++ b/src/include/86box/version.h.in @@ -1,58 +1,60 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for project version, branding, and external links. + * Definitions for project version, branding, and external links. * - * Authors: Miran Grca, * - * Copyright 2020 Miran Grca. + * + * Authors: Miran Grca, + * + * Copyright 2020 Miran Grca. */ #define _LSTR(s) L ## s #define LSTR(s) _LSTR(s) /* Version info. */ -#define EMU_NAME "@CMAKE_PROJECT_NAME@" -#define EMU_NAME_W LSTR(EMU_NAME) +#define EMU_NAME "@CMAKE_PROJECT_NAME@" +#define EMU_NAME_W LSTR(EMU_NAME) -#define EMU_VERSION "@CMAKE_PROJECT_VERSION@" -#define EMU_VERSION_W LSTR(EMU_VERSION) -#define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */ -#define EMU_VERSION_MAJ @CMAKE_PROJECT_VERSION_MAJOR@ -#define EMU_VERSION_MIN @CMAKE_PROJECT_VERSION_MINOR@ +#define EMU_VERSION "@CMAKE_PROJECT_VERSION@" +#define EMU_VERSION_W LSTR(EMU_VERSION) +#define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */ +#define EMU_VERSION_MAJ @CMAKE_PROJECT_VERSION_MAJOR@ +#define EMU_VERSION_MIN @CMAKE_PROJECT_VERSION_MINOR@ #define EMU_VERSION_PATCH @CMAKE_PROJECT_VERSION_PATCH@ -#cmakedefine EMU_BUILD "@EMU_BUILD@" -#define EMU_BUILD_NUM @EMU_BUILD_NUM@ -#cmakedefine EMU_GIT_HASH "@EMU_GIT_HASH@" +#cmakedefine EMU_BUILD "@EMU_BUILD@" +#define EMU_BUILD_NUM @EMU_BUILD_NUM@ +#cmakedefine EMU_GIT_HASH "@EMU_GIT_HASH@" #ifdef EMU_BUILD -# define EMU_BUILD_W LSTR(EMU_BUILD) -# define EMU_VERSION_FULL EMU_VERSION " [" EMU_BUILD "]" -# define EMU_VERSION_FULL_W EMU_VERSION_W L" [" EMU_BUILD_W L"]" +# define EMU_BUILD_W LSTR(EMU_BUILD) +# define EMU_VERSION_FULL EMU_VERSION " [" EMU_BUILD "]" +# define EMU_VERSION_FULL_W EMU_VERSION_W L" [" EMU_BUILD_W L"]" #else -# define EMU_VERSION_FULL EMU_VERSION -# define EMU_VERSION_FULL_W EMU_VERSION_W +# define EMU_VERSION_FULL EMU_VERSION +# define EMU_VERSION_FULL_W EMU_VERSION_W #endif #ifdef EMU_GIT_HASH -# define EMU_GIT_HASH_W LSTR(EMU_GIT_HASH) +# define EMU_GIT_HASH_W LSTR(EMU_GIT_HASH) #endif -#define COPYRIGHT_YEAR "@EMU_COPYRIGHT_YEAR@" +#define COPYRIGHT_YEAR "@EMU_COPYRIGHT_YEAR@" /* Web URL info. */ -#define EMU_SITE "86box.net" -#define EMU_SITE_W LSTR(EMU_SITE) -#define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest" -#define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL) +#define EMU_SITE "86box.net" +#define EMU_SITE_W LSTR(EMU_SITE) +#define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest" +#define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL) #ifdef RELEASE_BUILD -# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@/" +# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@/" #else -# define EMU_DOCS_URL "https://86box.readthedocs.io" +# define EMU_DOCS_URL "https://86box.readthedocs.io" #endif -#define EMU_DOCS_URL_W LSTR(EMU_DOCS_URL) +#define EMU_DOCS_URL_W LSTR(EMU_DOCS_URL) diff --git a/src/include/86box/vid_8514a.h b/src/include/86box/vid_8514a.h index be6c5d177..6463d0214 100644 --- a/src/include/86box/vid_8514a.h +++ b/src/include/86box/vid_8514a.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the 8514/A card from IBM for the MCA bus and - * generic ISA bus clones without vendor extensions. + * Emulation of the 8514/A card from IBM for the MCA bus and + * generic ISA bus clones without vendor extensions. * * * - * Authors: TheCollector1995 + * Authors: TheCollector1995 * - * Copyright 2022 TheCollector1995. + * Copyright 2022 TheCollector1995. */ #ifndef VIDEO_8514A_H diff --git a/src/include/86box/vid_cga.h b/src/include/86box/vid_cga.h index 4421840d6..39e1c24ef 100644 --- a/src/include/86box/vid_cga.h +++ b/src/include/86box/vid_cga.h @@ -1,19 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the old and new IBM CGA graphics cards. + * Emulation of the old and new IBM CGA graphics cards. * * * - * Author: Sarah Walker, - * Miran Grca, - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Authors: Sarah Walker, + * Miran Grca, + * + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #ifndef VIDEO_CGA_H diff --git a/src/include/86box/vid_cga_comp.h b/src/include/86box/vid_cga_comp.h index f4dd58b40..3c7916034 100644 --- a/src/include/86box/vid_cga_comp.h +++ b/src/include/86box/vid_cga_comp.h @@ -1,20 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * IBM CGA composite filter, borrowed from reenigne's DOSBox - * patch and ported to C. + * IBM CGA composite filter, borrowed from reenigne's DOSBox + * patch and ported to C. * * * - * Author: reenigne, - * Miran Grca, - * Copyright 2015-2018 reenigne. - * Copyright 2015-2018 Miran Grca. + * Authors: reenigne, + * Miran Grca, + * + * Copyright 2015-2018 reenigne. + * Copyright 2015-2018 Miran Grca. */ #ifndef VIDEO_CGA_COMP_H diff --git a/src/include/86box/vid_ddc.h b/src/include/86box/vid_ddc.h index b64759bac..144cca406 100644 --- a/src/include/86box/vid_ddc.h +++ b/src/include/86box/vid_ddc.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * DDC monitor emulation definitions. + * DDC monitor emulation definitions. * * * - * Authors: Sarah Walker, - * RichardG, + * Authors: Sarah Walker, + * RichardG, * - * Copyright 2008-2020 Sarah Walker. - * Copyright 2020 RichardG. + * Copyright 2008-2020 Sarah Walker. + * Copyright 2020 RichardG. */ #ifndef EMU_VID_DDC_H diff --git a/src/include/86box/vid_ega.h b/src/include/86box/vid_ega.h index 3b4797bf8..784f0c596 100644 --- a/src/include/86box/vid_ega.h +++ b/src/include/86box/vid_ega.h @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the EGA and Chips & Technologies SuperEGA - * graphics cards. + * Emulation of the EGA and Chips & Technologies SuperEGA + * graphics cards. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2020 Sarah Walker. - * Copyright 2016-2020 Miran Grca. + * Copyright 2008-2020 Sarah Walker. + * Copyright 2016-2020 Miran Grca. */ #ifndef VIDEO_EGA_H diff --git a/src/include/86box/vid_hercules.h b/src/include/86box/vid_hercules.h index 109d721ae..bbb4239aa 100644 --- a/src/include/86box/vid_hercules.h +++ b/src/include/86box/vid_hercules.h @@ -1,20 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Hercules graphics cards. + * Emulation of the Hercules graphics cards. * * * - * Author: Sarah Walker, - * Miran Grca, - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. - * Copyright 2021 Jasmine Iwanek. + * Authors: Sarah Walker, + * Miran Grca, + * Jasmine Iwanek, + * + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. + * Copyright 2021 Jasmine Iwanek. */ #ifndef VIDEO_HERCULES_H diff --git a/src/include/86box/vid_nga.h b/src/include/86box/vid_nga.h index 8dc0ad881..93786b15e 100644 --- a/src/include/86box/vid_nga.h +++ b/src/include/86box/vid_nga.h @@ -1,25 +1,25 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Olivetti OGC 8-bit ISA (GO708) and - * M21/M24/M28 16-bit bus (GO317/318/380/709) video cards. + * Emulation of the Olivetti OGC 8-bit ISA (GO708) and + * M21/M24/M28 16-bit bus (GO317/318/380/709) video cards. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, - * EngiNerd, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, + * EngiNerd, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. - * Copyright 2017-2019 Fred N. van Kempen. - * Copyright 2020 EngiNerd. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. + * Copyright 2017-2019 Fred N. van Kempen. + * Copyright 2020 EngiNerd. */ #ifndef VIDEO_NGA_H diff --git a/src/include/86box/vid_ogc.h b/src/include/86box/vid_ogc.h index 6e6447694..6b80f5859 100644 --- a/src/include/86box/vid_ogc.h +++ b/src/include/86box/vid_ogc.h @@ -1,25 +1,25 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Olivetti OGC 8-bit ISA (GO708) and - * M21/M24/M28 16-bit bus (GO317/318/380/709) video cards. + * Emulation of the Olivetti OGC 8-bit ISA (GO708) and + * M21/M24/M28 16-bit bus (GO317/318/380/709) video cards. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, - * EngiNerd, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, + * EngiNerd, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. - * Copyright 2017-2019 Fred N. van Kempen. - * Copyright 2020 EngiNerd. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. + * Copyright 2017-2019 Fred N. van Kempen. + * Copyright 2020 EngiNerd. */ #ifndef VIDEO_OGC_H diff --git a/src/include/86box/vid_pgc.h b/src/include/86box/vid_pgc.h index 3960598ab..12450c0d1 100644 --- a/src/include/86box/vid_pgc.h +++ b/src/include/86box/vid_pgc.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the PGC driver. + * Definitions for the PGC driver. * * * - * Authors: Fred N. van Kempen, - * John Elliott, + * Authors: Fred N. van Kempen, + * John Elliott, * - * Copyright 2019 Fred N. van Kempen. - * Copyright 2019 John Elliott. + * Copyright 2019 Fred N. van Kempen. + * Copyright 2019 John Elliott. */ #ifndef VID_PGC_H #define VID_PGC_H diff --git a/src/include/86box/vid_pgc_palette.h b/src/include/86box/vid_pgc_palette.h index ffcf6a9f0..a242e0cbd 100644 --- a/src/include/86box/vid_pgc_palette.h +++ b/src/include/86box/vid_pgc_palette.h @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Palette definitions for the PGC core. + * Palette definitions for the PGC core. * * * - * Authors: Fred N. van Kempen, - * John Elliott, + * Authors: Fred N. van Kempen, + * John Elliott, * - * Copyright 2019 Fred N. van Kempen. - * Copyright 2019 John Elliott. + * Copyright 2019 Fred N. van Kempen. + * Copyright 2019 John Elliott. */ #ifndef VID_PGC_PALETTE_H diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 3781d5530..31eabc064 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2020 Sarah Walker. @@ -33,6 +33,8 @@ # define FLAG_RAMDAC_SHIFT 64 # define FLAG_128K_MASK 128 +struct monitor_t; + typedef struct { int ena, x, y, xoff, yoff, cur_xsize, cur_ysize, @@ -170,6 +172,12 @@ typedef struct svga_t { uint32_t (*remap_func)(struct svga_t *svga, uint32_t in_addr); void *ramdac, *clock_gen; + + /* Monitor Index */ + uint8_t monitor_index; + + /* Pointer to monitor */ + monitor_t* monitor; } svga_t; extern int vga_on, ibm8514_on; diff --git a/src/include/86box/vid_svga_render.h b/src/include/86box/vid_svga_render.h index 04bd740b1..13ff527e0 100644 --- a/src/include/86box/vid_svga_render.h +++ b/src/include/86box/vid_svga_render.h @@ -1,19 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * SVGA renderers. + * SVGA renderers. * * * - * Author: Sarah Walker, - * Miran Grca, - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Authors: Sarah Walker, + * Miran Grca, + * + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #ifndef VIDEO_SVGA_RENDER_H diff --git a/src/include/86box/vid_vga.h b/src/include/86box/vid_vga.h index 44cc6b7c3..08a1a2591 100644 --- a/src/include/86box/vid_vga.h +++ b/src/include/86box/vid_vga.h @@ -1,20 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the IBM MDA + VGA graphics cards. + * Emulation of the IBM MDA + VGA graphics cards. * * * - * Author: Sarah Walker, - * Miran Grca, - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. - * Copyright 2021 Jasmine Iwanek. + * Authors: Sarah Walker, + * Miran Grca, + * Jasmine Iwanek, + * + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. + * Copyright 2021 Jasmine Iwanek. */ #ifndef VIDEO_VGA_H diff --git a/src/include/86box/vid_voodoo_banshee.h b/src/include/86box/vid_voodoo_banshee.h index 4d966ea3e..56fd47eeb 100644 --- a/src/include/86box/vid_voodoo_banshee.h +++ b/src/include/86box/vid_voodoo_banshee.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Banshee and 3 specific emulation. + * Voodoo Banshee and 3 specific emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_BANSHEE_H diff --git a/src/include/86box/vid_voodoo_banshee_blitter.h b/src/include/86box/vid_voodoo_banshee_blitter.h index 9f7a1825e..2d36f1566 100644 --- a/src/include/86box/vid_voodoo_banshee_blitter.h +++ b/src/include/86box/vid_voodoo_banshee_blitter.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Banshee and 3 specific emulation. + * Voodoo Banshee and 3 specific emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_BANSHEE_BLITTER_H diff --git a/src/include/86box/vid_voodoo_blitter.h b/src/include/86box/vid_voodoo_blitter.h index 2802c7d1e..981c0856d 100644 --- a/src/include/86box/vid_voodoo_blitter.h +++ b/src/include/86box/vid_voodoo_blitter.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * * Copyright 2008-2020 Sarah Walker. */ diff --git a/src/include/86box/vid_voodoo_common.h b/src/include/86box/vid_voodoo_common.h index e6d4ad5e4..7744ed08b 100644 --- a/src/include/86box/vid_voodoo_common.h +++ b/src/include/86box/vid_voodoo_common.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Graphics, 2, Banshee, 3 emulation. + * Voodoo Graphics, 2, Banshee, 3 emulation. * * * - * Authors: Sarah Walker, - * leilei + * Authors: Sarah Walker, + * leilei * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_COMMON_H @@ -506,6 +506,7 @@ typedef struct voodoo_t { uint8_t *vram, *changedvram; void *p; + uint8_t monitor_index; } voodoo_t; typedef struct voodoo_set_t { diff --git a/src/include/86box/vid_voodoo_display.h b/src/include/86box/vid_voodoo_display.h index e415f7824..25b3e9b1a 100644 --- a/src/include/86box/vid_voodoo_display.h +++ b/src/include/86box/vid_voodoo_display.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Graphics, 2, Banshee, 3 emulation. + * Voodoo Graphics, 2, Banshee, 3 emulation. * * * - * Authors: Sarah Walker, - * leilei + * Authors: Sarah Walker, + * leilei * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_DISPLAY_H diff --git a/src/include/86box/vid_voodoo_dither.h b/src/include/86box/vid_voodoo_dither.h index 2d674c5b4..3580cada2 100644 --- a/src/include/86box/vid_voodoo_dither.h +++ b/src/include/86box/vid_voodoo_dither.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Graphics and 2 specific emulation. + * Voodoo Graphics and 2 specific emulation. * * * - * Authors: Sarah Walker, - * leilei + * Authors: Sarah Walker, + * leilei * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_DITHER_H diff --git a/src/include/86box/vid_voodoo_fb.h b/src/include/86box/vid_voodoo_fb.h index 374474cc5..2138e83da 100644 --- a/src/include/86box/vid_voodoo_fb.h +++ b/src/include/86box/vid_voodoo_fb.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Graphics, 2, Banshee, 3 emulation. + * Voodoo Graphics, 2, Banshee, 3 emulation. * * * - * Authors: Sarah Walker, - * leilei + * Authors: Sarah Walker, + * leilei * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_FB_H diff --git a/src/include/86box/vid_voodoo_fifo.h b/src/include/86box/vid_voodoo_fifo.h index 86956cc5a..0073a295c 100644 --- a/src/include/86box/vid_voodoo_fifo.h +++ b/src/include/86box/vid_voodoo_fifo.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Graphics, 2, Banshee, 3 emulation. + * Voodoo Graphics, 2, Banshee, 3 emulation. * * * - * Authors: Sarah Walker, - * leilei + * Authors: Sarah Walker, + * leilei * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_FIFO_H diff --git a/src/include/86box/vid_voodoo_reg.h b/src/include/86box/vid_voodoo_reg.h index 13f7ae932..62738a8c5 100644 --- a/src/include/86box/vid_voodoo_reg.h +++ b/src/include/86box/vid_voodoo_reg.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Graphics, 2, Banshee, 3 emulation. + * Voodoo Graphics, 2, Banshee, 3 emulation. * * * - * Authors: Sarah Walker, - * leilei + * Authors: Sarah Walker, + * leilei * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_REG_H diff --git a/src/include/86box/vid_voodoo_setup.h b/src/include/86box/vid_voodoo_setup.h index be94f9533..d8820a7cb 100644 --- a/src/include/86box/vid_voodoo_setup.h +++ b/src/include/86box/vid_voodoo_setup.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Graphics, 2, Banshee, 3 emulation. + * Voodoo Graphics, 2, Banshee, 3 emulation. * * * - * Authors: Sarah Walker, - * leilei + * Authors: Sarah Walker, + * leilei * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_SETUP_H diff --git a/src/include/86box/vid_voodoo_texture.h b/src/include/86box/vid_voodoo_texture.h index 2e0af97a3..65eec54e4 100644 --- a/src/include/86box/vid_voodoo_texture.h +++ b/src/include/86box/vid_voodoo_texture.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Graphics, 2, Banshee, 3 emulation. + * Voodoo Graphics, 2, Banshee, 3 emulation. * * * - * Authors: Sarah Walker, - * leilei + * Authors: Sarah Walker, + * leilei * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #ifndef VIDEO_VOODOO_TEXTURE_H diff --git a/src/include/86box/video.h b/src/include/86box/video.h index abba64574..a49f3bf34 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -132,7 +132,6 @@ extern monitor_t monitors[MONITORS_NUM]; extern monitor_settings_t monitor_settings[MONITORS_NUM]; extern atomic_bool doresize_monitors[MONITORS_NUM]; extern int monitor_index_global; -extern int gfxcard_2; extern int show_second_monitors; extern int video_fullscreen_scale_maximized; diff --git a/src/include/86box/vnc.h b/src/include/86box/vnc.h index 7b82ce5d1..a63c53403 100644 --- a/src/include/86box/vnc.h +++ b/src/include/86box/vnc.h @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the VNC renderer. + * Definitions for the VNC renderer. * * * - * Author: Fred N. van Kempen, + * Authors: Fred N. van Kempen, * - * Copyright 2017 Fred N. van Kempen. + * Copyright 2017 Fred N. van Kempen. */ #ifndef EMU_VNC_H diff --git a/src/include/86box/win.h b/src/include/86box/win.h index 3174e24b2..99620cbeb 100644 --- a/src/include/86box/win.h +++ b/src/include/86box/win.h @@ -1,23 +1,23 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Platform support defintions for Win32. + * Platform support defintions for Win32. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. - * Copyright 2017-2019 Fred N. van Kempen. - * Copyright 2021 Laci bá' + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. + * Copyright 2017-2019 Fred N. van Kempen. + * Copyright 2021 Laci bá' */ #ifndef PLAT_WIN_H diff --git a/src/include/86box/win_opengl.h b/src/include/86box/win_opengl.h index 6192a68c1..80d3695ca 100644 --- a/src/include/86box/win_opengl.h +++ b/src/include/86box/win_opengl.h @@ -1,16 +1,16 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header file for OpenGL rendering module + * Header file for OpenGL rendering module * - * Authors: Teemu Korhonen + * Authors: Teemu Korhonen * - * Copyright 2021 Teemu Korhonen + * Copyright 2021 Teemu Korhonen */ #ifndef WIN_OPENGL_H diff --git a/src/include/86box/win_opengl_glslp.h b/src/include/86box/win_opengl_glslp.h index caf86a04f..6586cd526 100644 --- a/src/include/86box/win_opengl_glslp.h +++ b/src/include/86box/win_opengl_glslp.h @@ -1,16 +1,16 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header file for shader file parser. + * Header file for shader file parser. * - * Authors: Teemu Korhonen + * Authors: Teemu Korhonen * - * Copyright 2021 Teemu Korhonen + * Copyright 2021 Teemu Korhonen */ #ifndef WIN_OPENGL_GLSLP_H diff --git a/src/include/86box/win_sdl.h b/src/include/86box/win_sdl.h index 52902034d..69340e8b6 100644 --- a/src/include/86box/win_sdl.h +++ b/src/include/86box/win_sdl.h @@ -1,38 +1,38 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the libSDL2 rendering module. + * Definitions for the libSDL2 rendering module. * * * - * Authors: Fred N. van Kempen, - * Michael Drüing, + * Authors: Fred N. van Kempen, + * Michael Drüing, * - * Copyright 2018,2019 Fred N. van Kempen. - * Copyright 2018,2019 Michael Drüing. + * Copyright 2018-2019 Fred N. van Kempen. + * Copyright 2018-2019 Michael Drüing. * - * Redistribution and use in source and binary forms, with - * or without modification, are permitted provided that the - * following conditions are met: + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: * - * 1. Redistributions of source code must retain the entire - * above notice, this list of conditions and the following - * disclaimer. + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. * - * 3. Neither the name of the copyright holder nor the names - * of its contributors may be used to endorse or promote - * products derived from this software without specific - * prior written permission. + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT diff --git a/src/include/86box/zip.h b/src/include/86box/zip.h index 910436410..3981465ce 100644 --- a/src/include/86box/zip.h +++ b/src/include/86box/zip.h @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the Iomega ZIP drive with SCSI(-like) - * commands, for both ATAPI and SCSI usage. + * Implementation of the Iomega ZIP drive with SCSI(-like) + * commands, for both ATAPI and SCSI usage. * * * - * Author: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2018,2019 Miran Grca. + * Copyright 2018-2019 Miran Grca. */ #ifndef EMU_ZIP_H diff --git a/src/include/fdi2raw.h b/src/include/fdi2raw.h index 7a53d9d17..b848b26f2 100644 --- a/src/include/fdi2raw.h +++ b/src/include/fdi2raw.h @@ -1,51 +1,81 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the FDI floppy file format. + * Definitions for the FDI floppy file format. * * * - * Authors: Toni Wilen, - * and Vincent Joguin, - * Thomas Harte, + * Authors: Toni Wilen, + * and Vincent Joguin, + * Thomas Harte, * - * Copyright 2001-2004 Toni Wilen. - * Copyright 2001-2004 Vincent Joguin. - * Copyright 2001 Thomas Harte. + * Copyright 2001-2004 Toni Wilen. + * Copyright 2001-2004 Vincent Joguin. + * Copyright 2001-2016 Thomas Harte. */ #ifndef __FDI2RAW_H #define __FDI2RAW_H -#define uae_u8 uint8_t -#define uae_u16 uint16_t -#define uae_u32 uint32_t - +#include +#include #include + typedef struct fdi FDI; #ifdef __cplusplus extern "C" { #endif -extern int fdi2raw_loadtrack(FDI *, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffset, int *multirev, int mfm); +/*! + Attempts to parse and return an FDI header from the file @c file. -extern int fdi2raw_loadrevolution(FDI *, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int mfm); + @parameter file the file from which to attempt to read the FDI. + @returns a newly-allocated `FDI` if parsing succeeded; @c NULL otherwise. +*/ +extern FDI *fdi2raw_header(FILE *file); -extern FDI *fdi2raw_header(FILE *f); -extern void fdi2raw_header_free(FDI *); -extern int fdi2raw_get_last_track(FDI *); -extern int fdi2raw_get_num_sector(FDI *); -extern int fdi2raw_get_last_head(FDI *); -extern int fdi2raw_get_type(FDI *); -extern int fdi2raw_get_bit_rate(FDI *); -extern int fdi2raw_get_rotation(FDI *); -extern int fdi2raw_get_write_protect(FDI *); -extern int fdi2raw_get_tpi(FDI *); +/*! + Release all memory associated with @c file. +*/ +extern void fdi2raw_header_free(FDI *file); + +extern int fdi2raw_loadtrack(FDI *, uint16_t *mfmbuf, uint16_t *tracktiming, int track, int *tracklength, int *indexoffset, int *multirev, int mfm); +extern int fdi2raw_loadrevolution(FDI *, uint16_t *mfmbuf, uint16_t *tracktiming, int track, int *tracklength, int mfm); + +typedef enum { + FDI2RawDiskType8Inch = 0, + FDI2RawDiskType5_25Inch = 1, + FDI2RawDiskType3_5Inch = 2, + FDI2RawDiskType3Inch = 3, +} FDI2RawDiskType; + +/// @returns the disk type described by @c fdi. +extern FDI2RawDiskType fdi2raw_get_type(FDI *fdi); + +/// @returns the bit rate at which @c fdi is sampled if spinning at the intended rate, in Kbit/s. +extern int fdi2raw_get_bit_rate(FDI *fdi); + +/// @returns the intended rotation speed of @c fdi, in rotations per minute. +extern int fdi2raw_get_rotation(FDI *fdi); + +/// @returns whether the imaged disk was write protected. +extern bool fdi2raw_get_write_protect(FDI *fdi); + +/// @returns the final enumerated track represented in @c fdi. +extern int fdi2raw_get_last_track(FDI *fdi); + +/// @returns the final enumerated head represented in @c fdi. +extern int fdi2raw_get_last_head(FDI *fdi); + +/// @returns @c 22 if track 0 is a standard Amiga high-density; @c 11 otherwise. +extern int fdi2raw_get_num_sector(FDI *fdi); + +extern int fdi2raw_get_tpi(FDI *fdi); #ifdef __cplusplus } diff --git a/src/include/glad/glad.h b/src/include/glad/glad.h index 0b4d36656..5b2fd13f4 100644 --- a/src/include/glad/glad.h +++ b/src/include/glad/glad.h @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.34 on Sat Dec 4 18:46:02 2021. + OpenGL loader generated by glad 0.1.36 on Sat Jan 7 18:24:33 2023. Language/Generator: C/C++ Specification: gl diff --git a/src/include/minitrace/minitrace.h b/src/include/minitrace/minitrace.h index 2047eedb7..0335c9ac3 100644 --- a/src/include/minitrace/minitrace.h +++ b/src/include/minitrace/minitrace.h @@ -1,7 +1,7 @@ // Minitrace // // Copyright 2014 by Henrik Rydgård -// http://www.github.com/hrydgard/minitrace +// https://www.github.com/hrydgard/minitrace // Released under the MIT license. // // Ultra-light dependency free library for performance tracing C/C++ applications. @@ -71,13 +71,13 @@ const char *mtr_pool_string(const char *str); // Commented-out types will be supported in the future. typedef enum { - MTR_ARG_TYPE_NONE = 0, - MTR_ARG_TYPE_INT = 1, // I - // MTR_ARG_TYPE_FLOAT = 2, // TODO - // MTR_ARG_TYPE_DOUBLE = 3, // TODO - MTR_ARG_TYPE_STRING_CONST = 8, // C - MTR_ARG_TYPE_STRING_COPY = 9, - // MTR_ARG_TYPE_JSON_COPY = 10, + MTR_ARG_TYPE_NONE = 0, + MTR_ARG_TYPE_INT = 1, // I + // MTR_ARG_TYPE_FLOAT = 2, // TODO + // MTR_ARG_TYPE_DOUBLE = 3, // TODO + MTR_ARG_TYPE_STRING_CONST = 8, // C + MTR_ARG_TYPE_STRING_COPY = 9, + // MTR_ARG_TYPE_JSON_COPY = 10, } mtr_arg_type; // TODO: Add support for more than one argument (metadata) per event @@ -213,55 +213,55 @@ void internal_mtr_raw_event_arg(const char *category, const char *name, char ph, // These are optimized to use X events (combined B and E). Much easier to do in C++ than in C. class MTRScopedTrace { public: - MTRScopedTrace(const char *category, const char *name) - : category_(category), name_(name) { - start_time_ = mtr_time_s(); - } - ~MTRScopedTrace() { - internal_mtr_raw_event(category_, name_, 'X', &start_time_); - } + MTRScopedTrace(const char *category, const char *name) + : category_(category), name_(name) { + start_time_ = mtr_time_s(); + } + ~MTRScopedTrace() { + internal_mtr_raw_event(category_, name_, 'X', &start_time_); + } private: - const char *category_; - const char *name_; - double start_time_; + const char *category_; + const char *name_; + double start_time_; }; // Only outputs a block if execution time exceeded the limit. // TODO: This will effectively call mtr_time_s twice at the end, which is bad. class MTRScopedTraceLimit { public: - MTRScopedTraceLimit(const char *category, const char *name, double limit_s) - : category_(category), name_(name), limit_(limit_s) { - start_time_ = mtr_time_s(); - } - ~MTRScopedTraceLimit() { - double end_time = mtr_time_s(); - if (end_time - start_time_ >= limit_) { - internal_mtr_raw_event(category_, name_, 'X', &start_time_); - } - } + MTRScopedTraceLimit(const char *category, const char *name, double limit_s) + : category_(category), name_(name), limit_(limit_s) { + start_time_ = mtr_time_s(); + } + ~MTRScopedTraceLimit() { + double end_time = mtr_time_s(); + if (end_time - start_time_ >= limit_) { + internal_mtr_raw_event(category_, name_, 'X', &start_time_); + } + } private: - const char *category_; - const char *name_; - double start_time_; - double limit_; + const char *category_; + const char *name_; + double start_time_; + double limit_; }; class MTRScopedTraceArg { public: - MTRScopedTraceArg(const char *category, const char *name, mtr_arg_type arg_type, const char *arg_name, void *arg_value) - : category_(category), name_(name) { - internal_mtr_raw_event_arg(category, name, 'B', 0, arg_type, arg_name, arg_value); - } - ~MTRScopedTraceArg() { - internal_mtr_raw_event(category_, name_, 'E', 0); - } + MTRScopedTraceArg(const char *category, const char *name, mtr_arg_type arg_type, const char *arg_name, void *arg_value) + : category_(category), name_(name) { + internal_mtr_raw_event_arg(category, name, 'B', 0, arg_type, arg_name, arg_value); + } + ~MTRScopedTraceArg() { + internal_mtr_raw_event(category_, name_, 'E', 0); + } private: - const char *category_; - const char *name_; + const char *category_; + const char *name_; }; #endif diff --git a/src/include/slirp/libslirp-version.h b/src/include/slirp/libslirp-version.h index 1599206a5..b68906957 100644 --- a/src/include/slirp/libslirp-version.h +++ b/src/include/slirp/libslirp-version.h @@ -7,9 +7,9 @@ extern "C" { #endif #define SLIRP_MAJOR_VERSION 4 -#define SLIRP_MINOR_VERSION 3 -#define SLIRP_MICRO_VERSION 1 -#define SLIRP_VERSION_STRING "4.3.1-git-86Box" +#define SLIRP_MINOR_VERSION 7 +#define SLIRP_MICRO_VERSION 0 +#define SLIRP_VERSION_STRING "4.7.0-86Box" #define SLIRP_CHECK_VERSION(major,minor,micro) \ (SLIRP_MAJOR_VERSION > (major) || \ diff --git a/src/include/slirp/libslirp.h b/src/include/slirp/libslirp.h index 7c4340390..7a6c9a4da 100644 --- a/src/include/slirp/libslirp.h +++ b/src/include/slirp/libslirp.h @@ -8,6 +8,7 @@ #ifdef _WIN32 #include +#include #include #else #include @@ -31,8 +32,10 @@ extern "C" { #endif +/* Opaque structure containing the slirp state */ typedef struct Slirp Slirp; +/* Flags passed to SlirpAddPollCb and to be returned by SlirpGetREventsCb. */ enum { SLIRP_POLL_IN = 1 << 0, SLIRP_POLL_OUT = 1 << 1, @@ -47,38 +50,58 @@ typedef void (*SlirpTimerCb)(void *opaque); typedef int (*SlirpAddPollCb)(int fd, int events, void *opaque); typedef int (*SlirpGetREventsCb)(int idx, void *opaque); +typedef enum SlirpTimerId { + SLIRP_TIMER_RA, + SLIRP_TIMER_NUM, +} SlirpTimerId; + /* - * Callbacks from slirp + * Callbacks from slirp, to be set by the application. + * + * The opaque parameter is set to the opaque pointer given in the slirp_new / + * slirp_init call. */ typedef struct SlirpCb { /* - * Send an ethernet frame to the guest network. The opaque - * parameter is the one given to slirp_init(). The function - * doesn't need to send all the data and may return * Miran Grca, * Fred N. van Kempen, * Overdoze, @@ -19,7 +19,7 @@ * Copyright 2008-2019 Sarah Walker. * Copyright 2016-2019 Miran Grca. * Copyright 2017-2019 Fred N. van Kempen. - * Copyright 2018,2019 David Hrdlička. + * Copyright 2018-2019 David Hrdlička. * * NOTE: Forcing config files to be in Unicode encoding breaks * it on Windows XP, and possibly also Vista. Use the diff --git a/src/io.c b/src/io.c index cf934b895..0cd7cd87b 100644 --- a/src/io.c +++ b/src/io.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/mac/CMakeLists.txt b/src/mac/CMakeLists.txt index 9ad6206a8..bbdf1d5d5 100644 --- a/src/mac/CMakeLists.txt +++ b/src/mac/CMakeLists.txt @@ -38,9 +38,9 @@ set_source_files_properties(${APP_ICON_MACOSX} # Prepare long version string if(EMU_BUILD) - set(LONG_VER_STRING "${CMAKE_PROJECT_VERSION} [${EMU_BUILD}]") + set(LONG_VER_STRING "${CMAKE_PROJECT_VERSION} [${EMU_BUILD}]") else() - set(LONG_VER_STRING "${CMAKE_PROJECT_VERSION}") + set(LONG_VER_STRING "${CMAKE_PROJECT_VERSION}") endif() # Generate Info.plist diff --git a/src/machine/CMakeLists.txt b/src/machine/CMakeLists.txt index 1f356a91d..e88631044 100644 --- a/src/machine/CMakeLists.txt +++ b/src/machine/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(mch OBJECT machine.c machine_table.c m_xt.c m_xt_compaq.c diff --git a/src/machine/m_amstrad.c b/src/machine/m_amstrad.c index 5d64bda3b..a37427de1 100644 --- a/src/machine/m_amstrad.c +++ b/src/machine/m_amstrad.c @@ -31,7 +31,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * John Elliott, @@ -935,45 +935,45 @@ vid_speed_changed_200(void *priv) */ static unsigned char mapping1[256] = { // clang-format off -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ -/*00*/ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/*10*/ 2, 0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, -/*20*/ 2, 2, 0, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, -/*30*/ 2, 2, 2, 0, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2, 1, 1, -/*40*/ 2, 2, 1, 1, 0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, -/*50*/ 2, 2, 1, 1, 2, 0, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, -/*60*/ 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 1, 1, -/*70*/ 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 1, -/*80*/ 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, -/*90*/ 2, 2, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, -/*A0*/ 2, 2, 2, 1, 2, 2, 1, 1, 2, 2, 0, 1, 2, 2, 1, 1, -/*B0*/ 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 0, 2, 2, 1, 1, -/*C0*/ 2, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 0, 1, 1, 1, -/*D0*/ 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 0, 1, 1, -/*E0*/ 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 0, 1, -/*F0*/ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/*00*/ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +/*10*/ 2, 0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, +/*20*/ 2, 2, 0, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, +/*30*/ 2, 2, 2, 0, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2, 1, 1, +/*40*/ 2, 2, 1, 1, 0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, +/*50*/ 2, 2, 1, 1, 2, 0, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, +/*60*/ 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 1, 1, +/*70*/ 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 1, +/*80*/ 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, +/*90*/ 2, 2, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, +/*A0*/ 2, 2, 2, 1, 2, 2, 1, 1, 2, 2, 0, 1, 2, 2, 1, 1, +/*B0*/ 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 0, 2, 2, 1, 1, +/*C0*/ 2, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 0, 1, 1, 1, +/*D0*/ 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 0, 1, 1, +/*E0*/ 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 0, 1, +/*F0*/ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, // clang-format on }; static unsigned char mapping2[256] = { // clang-format off -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ -/*00*/ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -/*10*/ 1, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, -/*20*/ 1, 1, 3, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, -/*30*/ 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 2, 2, -/*40*/ 1, 1, 2, 2, 3, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, -/*50*/ 1, 1, 2, 2, 1, 3, 2, 2, 1, 1, 2, 2, 1, 2, 2, 2, -/*60*/ 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 2, 2, -/*70*/ 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, -/*80*/ 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, -/*90*/ 1, 1, 2, 2, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, -/*A0*/ 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 3, 2, 1, 1, 2, 2, -/*B0*/ 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 2, 2, -/*C0*/ 1, 1, 2, 2, 1, 2, 2, 2, 1, 1, 2, 2, 3, 2, 2, 2, -/*D0*/ 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 3, 2, 2, -/*E0*/ 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, -/*F0*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/*00*/ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +/*10*/ 1, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, +/*20*/ 1, 1, 3, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, +/*30*/ 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 2, 2, +/*40*/ 1, 1, 2, 2, 3, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, +/*50*/ 1, 1, 2, 2, 1, 3, 2, 2, 1, 1, 2, 2, 1, 2, 2, 2, +/*60*/ 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 2, 2, +/*70*/ 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, +/*80*/ 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, +/*90*/ 1, 1, 2, 2, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, +/*A0*/ 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 3, 2, 1, 1, 2, 2, +/*B0*/ 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 2, 2, +/*C0*/ 1, 1, 2, 2, 1, 2, 2, 2, 1, 1, 2, 2, 3, 2, 2, 2, +/*D0*/ 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 3, 2, 2, +/*E0*/ 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, +/*F0*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, // clang-format on }; @@ -1054,7 +1054,7 @@ vid_out_200(uint16_t addr, uint8_t val, void *priv) uint8_t old; switch (addr) { - /* MDA writes ============================================================== */ + /* MDA writes ============================================================== */ case 0x3b1: case 0x3b3: case 0x3b5: @@ -1087,7 +1087,7 @@ vid_out_200(uint16_t addr, uint8_t val, void *priv) nmi_raise(); return; - /* CGA writes ============================================================== */ + /* CGA writes ============================================================== */ case 0x03d1: case 0x03d3: case 0x03d5: @@ -1122,12 +1122,12 @@ vid_out_200(uint16_t addr, uint8_t val, void *priv) set_lcd_cols(val); return; - /* PC200 control port writes ============================================== */ + /* PC200 control port writes ============================================== */ case 0x03de: vid->crtc_index = 0x1f; - /* NMI only seems to be triggered if the value being written has the high - * bit set (enable NMI). So it only protects writes to this port if you - * let it? */ + /* NMI only seems to be triggered if the value being written has the high + * bit set (enable NMI). So it only protects writes to this port if you + * let it? */ if (val & 0x80) { vid->operation_ctrl = val; vid->crtc_index |= 0x40; @@ -2032,14 +2032,14 @@ kbd_write(uint16_t port, uint8_t val, void *priv) /* * PortB - System Control. * - * 7 Enable Status-1/Disable Keyboard Code on Port A. - * 6 Enable incoming Keyboard Clock. - * 5 Prevent external parity errors from causing NMI. - * 4 Disable parity checking of on-board system Ram. - * 3 Undefined (Not Connected). - * 2 Enable Port C LSB / Disable MSB. (See 1.8.3) - * 1 Speaker Drive. - * 0 8253 GATE 2 (Speaker Modulate). + * 7 Enable Status-1/Disable Keyboard Code on Port A. + * 6 Enable incoming Keyboard Clock. + * 5 Prevent external parity errors from causing NMI. + * 4 Disable parity checking of on-board system Ram. + * 3 Undefined (Not Connected). + * 2 Enable Port C LSB / Disable MSB. (See 1.8.3) + * 1 Speaker Drive. + * 0 8253 GATE 2 (Speaker Modulate). * * This register is controlled by BIOS and/or ROS. */ @@ -2097,14 +2097,14 @@ kbd_read(uint16_t port, void *priv) /* * PortA - System Status 1 * - * 7 Always 0 (KBD7) - * 6 Second Floppy disk drive installed (KBD6) - * 5 DDM1 - Default Display Mode bit 1 (KBD5) - * 4 DDM0 - Default Display Mode bit 0 (KBD4) - * 3 Always 1 (KBD3) - * 2 Always 1 (KBD2) - * 1 8087 NDP installed (KBD1) - * 0 Always 1 (KBD0) + * 7 Always 0 (KBD7) + * 6 Second Floppy disk drive installed (KBD6) + * 5 DDM1 - Default Display Mode bit 1 (KBD5) + * 4 DDM0 - Default Display Mode bit 0 (KBD4) + * 3 Always 1 (KBD3) + * 2 Always 1 (KBD2) + * 1 8087 NDP installed (KBD1) + * 0 Always 1 (KBD0) * * DDM00 * 00 unknown, external color? @@ -2137,27 +2137,27 @@ kbd_read(uint16_t port, void *priv) /* * PortC - System Status 2. * - * 7 On-board system RAM parity error. - * 6 External parity error (I/OCHCK from expansion bus). - * 5 8253 PIT OUT2 output. - * 4 Undefined (Not Connected). + * 7 On-board system RAM parity error. + * 6 External parity error (I/OCHCK from expansion bus). + * 5 8253 PIT OUT2 output. + * 4 Undefined (Not Connected). *------------------------------------------- - * LSB MSB (depends on PB2) + * LSB MSB (depends on PB2) *------------------------------------------- - * 3 RAM3 Undefined - * 2 RAM2 Undefined - * 1 RAM1 Undefined - * 0 RAM0 RAM4 + * 3 RAM3 Undefined + * 2 RAM2 Undefined + * 1 RAM1 Undefined + * 0 RAM0 RAM4 * * PC7 is forced to 0 when on-board system RAM parity * checking is disabled by PB4. * * RAM4:0 - * 01110 512K bytes on-board. - * 01111 544K bytes (32K external). - * 10000 576K bytes (64K external). - * 10001 608K bytes (96K external). - * 10010 640K bytes (128K external or fitted on-board). + * 01110 512K bytes on-board. + * 01111 544K bytes (32K external). + * 10000 576K bytes (64K external). + * 10001 608K bytes (96K external). + * 10010 640K bytes (128K external or fitted on-board). */ if (ams->pb & 0x04) ret = ams->stat2 & 0x0f; @@ -2226,14 +2226,14 @@ ams_read(uint16_t port, void *priv) case 0x0379: /* printer control, also set LK1-3. * per John Elliott's site, this is xor'ed with 0x07 - * 7 English Language. - * 6 German Language. - * 5 French Language. - * 4 Spanish Language. - * 3 Danish Language. - * 2 Swedish Language. - * 1 Italian Language. - * 0 Diagnostic Mode. + * 7 English Language. + * 6 German Language. + * 5 French Language. + * 4 Spanish Language. + * 3 Danish Language. + * 2 Swedish Language. + * 1 Italian Language. + * 0 Diagnostic Mode. */ ret = (lpt_read(port, &lpt_ports[0]) & 0xf8) | ams->language; break; @@ -2474,9 +2474,9 @@ machine_amstrad_init(const machine_t *model, int type) ams->language = 7; - video_reset(gfxcard); + video_reset(gfxcard[0]); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) switch (type) { case AMS_PC1512: loadfont("roms/machines/pc1512/40078", 8); diff --git a/src/machine/m_at.c b/src/machine/m_at.c index ccee2f1e7..92f8c0f5f 100644 --- a/src/machine/m_at.c +++ b/src/machine/m_at.c @@ -12,7 +12,7 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2017-2020 Fred N. van Kempen. * Copyright 2016-2020 Miran Grca. diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index ee117fa33..54e7d6b9e 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * EngiNerd * @@ -114,7 +114,7 @@ machine_at_ama932j_init(const machine_t *model) machine_at_common_ide_init(model); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&oti067_ama932j_device); machine_at_headland_common_init(2); @@ -420,7 +420,7 @@ machine_at_spc4620p_init(const machine_t *model) if (bios_only || !ret) return ret; - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&ati28800k_spc4620p_device); machine_at_scat_init(model, 1, 1); @@ -527,7 +527,7 @@ machine_at_wd76c10_init(const machine_t *model) machine_at_common_init(model); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(¶dise_wd90c11_megapc_device); device_add(&keyboard_ps2_quadtel_device); @@ -591,7 +591,7 @@ machine_at_cmdsl386sx25_init(const machine_t *model) if (bios_only || !ret) return ret; - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&gd5402_onboard_device); machine_at_scamp_common_init(model, 1); @@ -626,7 +626,7 @@ machine_at_spc6033p_init(const machine_t *model) if (bios_only || !ret) return ret; - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&ati28800k_spc6033p_device); machine_at_scamp_common_init(model, 1); @@ -711,7 +711,7 @@ machine_at_flytech386_init(const machine_t *model) device_add(&ali1217_device); device_add(&w83787f_ide_en_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&tvga8900d_device); device_add(&keyboard_ps2_device); @@ -833,7 +833,7 @@ machine_at_3302_init(const machine_t *model) if (fdc_type == FDC_INTERNAL) device_add(&fdc_at_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(¶dise_pvga1a_ncr3302_device); device_add(&keyboard_at_ncr_device); diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 1343b38ad..eeebbb784 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2010-2020 Sarah Walker. @@ -168,7 +168,7 @@ machine_at_valuepoint433_init(const machine_t *model) // hangs without the PS/2 machine_at_common_ide_init(model); device_add(&sis_85c461_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&et4000w32_onboard_device); device_add(&keyboard_ps2_device); @@ -310,7 +310,7 @@ machine_at_pb410a_init(const machine_t *model) device_add(&phoenix_486_jumper_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&ht216_32_pb410a_device); return ret; @@ -331,7 +331,7 @@ machine_at_vect486vl_init(const machine_t *model) // has HDC problems device_add(&vl82c480_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&gd5428_onboard_device); device_add(&keyboard_ps2_ami_device); @@ -355,7 +355,7 @@ machine_at_d824_init(const machine_t *model) device_add(&vl82c480_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&gd5428_onboard_device); device_add(&keyboard_ps2_device); @@ -378,7 +378,7 @@ machine_at_acera1g_init(const machine_t *model) machine_at_common_init(model); device_add(&ali1429g_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&gd5428_onboard_device); device_add(&keyboard_ps2_acer_pci_device); @@ -428,7 +428,7 @@ machine_at_decpclpv_init(const machine_t *model) device_add(&sis_85c461_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&s3_86c805_onboard_vlb_device); /* TODO: Phoenix MultiKey KBC */ @@ -635,10 +635,9 @@ machine_at_pc330_6573_init(const machine_t *model) /* doesn't like every CPU oth pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&opti802g_pci_device); device_add(&opti822_device); @@ -1003,10 +1002,10 @@ machine_at_alfredo_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); + pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&keyboard_ps2_pci_device); device_add(&sio_device); @@ -1033,9 +1032,9 @@ machine_at_ninja_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1 | PCI_NO_IRQ_STEERING); pci_register_slot(0x05, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 1, 2); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 2, 1); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 1, 2, 1); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 1, 2); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 2, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 1, 2, 1); device_add(&keyboard_ps2_intel_ami_pci_device); device_add(&intel_flash_bxt_ami_device); @@ -1061,13 +1060,13 @@ machine_at_486sp3_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x01, PCI_CARD_SCSI, 1, 2, 3, 4); /* 01 = SCSI */ - pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 03 = Slot 1 */ - pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */ - pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 05 = Slot 3 */ - pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 06 = Slot 4 */ + pci_register_slot(0x01, PCI_CARD_SCSI, 1, 2, 3, 4); /* 01 = SCSI */ + pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 03 = Slot 1 */ + pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */ + pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 05 = Slot 3 */ + pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 06 = Slot 4 */ pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */ + device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */ device_add(&sio_device); device_add(&fdc37c663_ide_device); device_add(&sst_flash_29ee010_device); @@ -1095,12 +1094,12 @@ machine_at_pci400cb_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 3, 2, 1); /* 0F = Slot 1 */ - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 0E = Slot 2 */ - pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 0D = Slot 3 */ - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 0C = Slot 4 */ - device_add(&keyboard_ps2_ami_pci_device); /* Assume AMI Megakey 1993 standalone ('P') - because of the Tekram machine below. */ + pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 3, 2, 1); /* 0F = Slot 1 */ + pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 0E = Slot 2 */ + pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 0D = Slot 3 */ + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 0C = Slot 4 */ + device_add(&keyboard_ps2_ami_pci_device); /* Assume AMI Megakey 1993 standalone ('P') + because of the Tekram machine below. */ device_add(&ims8848_device); @@ -1127,10 +1126,10 @@ machine_at_g486ip_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 03 = Slot 1 */ - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */ - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 05 = Slot 3 */ - device_add(&keyboard_ps2_ami_pci_device); /* AMI Megakey 1993 stanalone ('P') */ + pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 03 = Slot 1 */ + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */ + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 05 = Slot 3 */ + device_add(&keyboard_ps2_ami_pci_device); /* AMI Megakey 1993 stanalone ('P') */ device_add(&ims8848_device); @@ -1156,12 +1155,12 @@ machine_at_486sp3g_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_2); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x01, PCI_CARD_SCSI, 1, 2, 3, 4); /* 01 = SCSI */ - pci_register_slot(0x06, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 06 = Slot 1 */ - pci_register_slot(0x05, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 05 = Slot 2 */ - pci_register_slot(0x04, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 04 = Slot 3 */ + pci_register_slot(0x01, PCI_CARD_SCSI, 1, 2, 3, 4); /* 01 = SCSI */ + pci_register_slot(0x06, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 06 = Slot 1 */ + pci_register_slot(0x05, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 05 = Slot 2 */ + pci_register_slot(0x04, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 04 = Slot 3 */ pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */ + device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */ device_add(&sio_zb_device); device_add(&pc87332_398_ide_device); device_add(&sst_flash_29ee010_device); @@ -1188,11 +1187,11 @@ machine_at_486ap4_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1 | PCI_NO_IRQ_STEERING); /* Excluded: 5, 6, 7, 8 */ pci_register_slot(0x05, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 09 = Slot 1 */ - pci_register_slot(0x0a, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 0a = Slot 2 */ - pci_register_slot(0x0b, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 0b = Slot 3 */ - pci_register_slot(0x0c, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 0c = Slot 4 */ - device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */ + pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 09 = Slot 1 */ + pci_register_slot(0x0a, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 0a = Slot 2 */ + pci_register_slot(0x0b, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 0b = Slot 3 */ + pci_register_slot(0x0c, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 0c = Slot 4 */ + device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */ if (fdc_type == FDC_INTERNAL) device_add(&fdc_at_device); @@ -1217,10 +1216,10 @@ machine_at_g486vpa_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&via_vt82c49x_pci_ide_device); device_add(&via_vt82c505_device); @@ -1246,10 +1245,10 @@ machine_at_486vipio2_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&via_vt82c49x_pci_ide_device); device_add(&via_vt82c505_device); @@ -1275,9 +1274,9 @@ machine_at_abpb4_init(const machine_t *model) pci_init(PCI_CAN_SWITCH_TYPE); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&ali1489_device); device_add(&w83787f_device); @@ -1303,9 +1302,9 @@ machine_at_win486pci_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&ali1489_device); device_add(&prime3b_device); @@ -1329,10 +1328,10 @@ machine_at_ms4145_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&ali1489_device); device_add(&w83787f_device); @@ -1357,16 +1356,16 @@ machine_at_sbc490_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x01, PCI_CARD_VIDEO, 4, 1, 2, 3); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x01, PCI_CARD_VIDEO, 4, 1, 2, 3); device_add(&ali1489_device); device_add(&fdc37c665_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&tgui9440_onboard_pci_device); device_add(&keyboard_ps2_ami_device); @@ -1390,7 +1389,7 @@ machine_at_tf486_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); device_add(&ali1489_device); device_add(&w83977ef_device); @@ -1416,7 +1415,7 @@ machine_at_itoxstar_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x0B, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x0C, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x1F, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x1F, PCI_CARD_NORMAL, 1, 2, 3, 4); device_add(&w83977f_device); device_add(&keyboard_ps2_ami_pci_device); device_add(&stpc_client_device); @@ -1445,9 +1444,9 @@ machine_at_arb1423c_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x0B, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x0C, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x1F, PCI_CARD_NORMAL, 1, 0, 0, 0); - pci_register_slot(0x1E, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x1D, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x1F, PCI_CARD_NORMAL, 1, 0, 0, 0); + pci_register_slot(0x1E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x1D, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&w83977f_device); device_add(&keyboard_ps2_ami_pci_device); device_add(&stpc_consumer2_device); @@ -1472,9 +1471,9 @@ machine_at_arb1479_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x0B, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x0C, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x1F, PCI_CARD_NORMAL, 1, 0, 0, 0); - pci_register_slot(0x1E, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x1D, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x1F, PCI_CARD_NORMAL, 1, 0, 0, 0); + pci_register_slot(0x1E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x1D, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&w83977f_device); device_add(&keyboard_ps2_ami_pci_device); device_add(&stpc_consumer2_device); @@ -1499,9 +1498,9 @@ machine_at_pcm9340_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x0B, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x0C, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x1D, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x1E, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x1F, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x1D, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x1E, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x1F, PCI_CARD_NORMAL, 2, 3, 4, 1); device_add_inst(&w83977f_device, 1); device_add_inst(&w83977f_device, 2); device_add(&keyboard_ps2_ami_pci_device); @@ -1529,7 +1528,7 @@ machine_at_pcm5330_init(const machine_t *model) pci_register_slot(0x0C, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x0D, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x0E, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4); device_add(&stpc_serial_device); device_add(&w83977f_370_device); device_add(&keyboard_ps2_ami_pci_device); @@ -1555,10 +1554,10 @@ machine_at_ecs486_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x12, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x0F, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0F, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&umc_hb4_device); device_add(&umc_8886f_device); @@ -1586,10 +1585,10 @@ machine_at_hot433_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x12, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); device_add(&umc_hb4_device); device_add(&umc_8886af_device); @@ -1618,9 +1617,9 @@ machine_at_atc1415_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x12, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&umc_hb4_device); device_add(&umc_8886af_device); @@ -1649,10 +1648,10 @@ machine_at_actionpc2600_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x12, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); device_add(&umc_hb4_device); device_add(&umc_8886af_device); @@ -1679,9 +1678,9 @@ machine_at_m919_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x12, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&umc_hb4_device); device_add(&umc_8886af_device); @@ -1708,9 +1707,9 @@ machine_at_spc7700plw_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x12, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&umc_hb4_device); device_add(&umc_8886af_device); @@ -1720,3 +1719,94 @@ machine_at_spc7700plw_init(const machine_t *model) return ret; } + +int +machine_at_ms4134_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/ms4134/4alm001.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_ide_init(model); + + device_add(&ali1429g_device); + + device_add(&fdc37c665_ide_pri_device); + + pci_init(PCI_CAN_SWITCH_TYPE | PCI_ALWAYS_EXPOSE_DEV0); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + + pci_register_slot(0x0B, PCI_CARD_SCSI, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x10, PCI_CARD_NORMAL, 1, 2, 3, 4); + + device_add(&ali1435_device); + device_add(&sst_flash_29ee010_device); + + device_add(&keyboard_ps2_ami_device); + + return ret; +} + +int +machine_at_tg486gp_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/tg486gp/tg486gp.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_ide_init(model); + + device_add(&ali1429g_device); + + device_add(&fdc37c665_ide_pri_device); + + pci_init(PCI_CAN_SWITCH_TYPE | PCI_ALWAYS_EXPOSE_DEV0); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + + pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x10, PCI_CARD_NORMAL, 1, 2, 3, 4); + + device_add(&ali1435_device); + device_add(&sst_flash_29ee010_device); + + device_add(&keyboard_ps2_ami_device); + + return ret; +} + +int +machine_at_tg486g_init(const machine_t *model) +{ + int ret; + + 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); + device_add(&ide_isa_device); + device_add(&fdc37c651_ide_device); + device_add(&keyboard_ps2_intel_ami_pci_device); + + return ret; +} diff --git a/src/machine/m_at_commodore.c b/src/machine/m_at_commodore.c index 8eeabab19..3587db44a 100644 --- a/src/machine/m_at_commodore.c +++ b/src/machine/m_at_commodore.c @@ -12,9 +12,9 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. * diff --git a/src/machine/m_at_compaq.c b/src/machine/m_at_compaq.c index 74e853834..e74261b8a 100644 --- a/src/machine/m_at_compaq.c +++ b/src/machine/m_at_compaq.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * TheCollector1995, * @@ -527,9 +527,9 @@ compaq_plasma_recalcattrs(compaq_plasma_t *self) * Bit 0: Attributes 01-06, 08-0E are inverse video * Bit 1: Attributes 01-06, 08-0E are bold * Bit 2: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF - * are inverse video + * are inverse video * Bit 3: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF - * are bold */ + * are bold */ /* Set up colours */ amber = makecol(0xff, 0x7D, 0x00); @@ -686,8 +686,8 @@ const device_config_t compaq_plasma_config[] = { }, { .name = "rgb_type", - .description = "RGB type", - .type = CONFIG_SELECTION, + .description = "RGB type", + .type = CONFIG_SELECTION, .default_string = "", .default_int = 0, .file_filter = "", @@ -787,21 +787,21 @@ machine_at_compaq_init(const machine_t *model, int type) write_ram, write_ramw, write_raml, 0xa0000 + ram, MEM_MAPPING_INTERNAL, NULL); - video_reset(gfxcard); + video_reset(gfxcard[0]); switch (type) { case COMPAQ_PORTABLEII: break; case COMPAQ_PORTABLEIII: - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&compaq_plasma_device); break; case COMPAQ_PORTABLEIII386: if (hdc_current == 1) device_add(&ide_isa_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&compaq_plasma_device); break; diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index ec818871a..3cedb669a 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -461,7 +461,7 @@ machine_at_s1846_init(const machine_t *model) device_add(&intel_flash_bxt_device); spd_register(SPD_TYPE_SDRAM, 0x7, 256); - if (sound_card_current == SOUND_INTERNAL) { + if (sound_card_current[0] == SOUND_INTERNAL) { device_add(&es1371_onboard_device); device_add(&cs4297_device); /* found on other Tyan boards around the same time */ } @@ -606,7 +606,7 @@ machine_at_gt694va_init(const machine_t *model) hwm_values.fans[2] = 0; /* unused */ hwm_values.temperatures[2] = 0; /* unused */ - if (sound_card_current == SOUND_INTERNAL) { + if (sound_card_current[0] == SOUND_INTERNAL) { device_add(&es1371_onboard_device); device_add(&cs4297_device); /* assumed */ } @@ -654,7 +654,7 @@ machine_at_ms6168_common_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x14, PCI_CARD_SOUND, 3, 4, 1, 2); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 1, 2, 3, 4); pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); @@ -663,14 +663,14 @@ machine_at_ms6168_common_init(const machine_t *model) device_add(&piix4e_device); device_add(&w83977ef_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&voodoo_3_2000_agp_onboard_8m_device); device_add(&keyboard_ps2_ami_pci_device); device_add(&intel_flash_bxt_device); spd_register(SPD_TYPE_SDRAM, 0x3, 256); - if (sound_card_current == SOUND_INTERNAL) { + if (sound_card_current[0] == SOUND_INTERNAL) { device_add(&es1371_onboard_device); device_add(&cs4297_device); } diff --git a/src/machine/m_at_socket370.c b/src/machine/m_at_socket370.c index 1388eec3a..b8cc437a1 100644 --- a/src/machine/m_at_socket370.c +++ b/src/machine/m_at_socket370.c @@ -96,7 +96,7 @@ machine_at_s1857_init(const machine_t *model) pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); + pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); device_add(&i440bx_device); device_add(&piix4e_device); device_add(&keyboard_ps2_ami_pci_device); @@ -104,7 +104,7 @@ machine_at_s1857_init(const machine_t *model) device_add(&intel_flash_bxt_device); spd_register(SPD_TYPE_SDRAM, 0x7, 256); - if (sound_card_current == SOUND_INTERNAL) { + if (sound_card_current[0] == SOUND_INTERNAL) { device_add(&es1371_onboard_device); device_add(&cs4297_device); /* found on other Tyan boards around the same time */ } @@ -127,13 +127,13 @@ machine_at_p6bap_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 0, 0); - pci_register_slot(0x14, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 3, 5); + pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 5); + pci_register_slot(0x0a, PCI_CARD_NORMAL, 2, 3, 5, 1); + pci_register_slot(0x0b, PCI_CARD_NORMAL, 3, 5, 1, 2); + pci_register_slot(0x0c, PCI_CARD_NORMAL, 5, 1, 2, 3); + pci_register_slot(0x0d, PCI_CARD_NORMAL, 5, 3, 2, 1); + pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 5); device_add(&via_apro133a_device); /* Rebranded as ET82C693A */ device_add(&via_vt82c596b_device); /* Rebranded as ET82C696B */ device_add(&w83977ef_device); @@ -144,6 +144,42 @@ machine_at_p6bap_init(const machine_t *model) return ret; } +int +machine_at_p6bat_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/p6bat/bata+56.BIN", + 0x000c0000, 262144, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init_ex(model, 2); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 3, 5); + pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 5); + pci_register_slot(0x0a, PCI_CARD_NORMAL, 2, 3, 5, 1); + pci_register_slot(0x0b, PCI_CARD_NORMAL, 3, 5, 1, 2); + pci_register_slot(0x0c, PCI_CARD_NORMAL, 5, 1, 2, 3); + pci_register_slot(0x0d, PCI_CARD_NORMAL, 5, 3, 2, 1); + pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 5); + device_add(&via_apro133_device); + device_add(&via_vt82c596b_device); + device_add(&w83977ef_device); + device_add(&keyboard_ps2_ami_pci_device); + device_add(&sst_flash_39sf020_device); + spd_register(SPD_TYPE_SDRAM, 0x7, 256); + + if (sound_card_current[0] == SOUND_INTERNAL) { + device_add(&cmi8738_onboard_device); + } + + return ret; +} + int machine_at_cubx_init(const machine_t *model) { @@ -228,11 +264,11 @@ machine_at_ambx133_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); device_add(&i440bx_device); device_add(&piix4e_device); @@ -264,11 +300,11 @@ machine_at_awo671r_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); device_add(&i440bx_device); device_add(&piix4e_device); @@ -297,11 +333,11 @@ machine_at_63a1_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); /* Integrated Sound? */ + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); /* Integrated Sound? */ pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); device_add(&i440zx_device); device_add(&piix4e_device); @@ -377,7 +413,7 @@ 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) + if (sound_card_current[0] == SOUND_INTERNAL) device_add(&cmi8738_onboard_device); return ret; @@ -415,7 +451,7 @@ machine_at_6via90ap_init(const machine_t *model) hwm_values.temperatures[1] += 2; /* System offset */ hwm_values.temperatures[2] = 0; /* unused */ - if (sound_card_current == SOUND_INTERNAL) + if (sound_card_current[0] == SOUND_INTERNAL) device_add(&alc100_device); /* ALC100P identified on similar Acorp boards (694TA, 6VIA90A1) */ return ret; diff --git a/src/machine/m_at_socket4.c b/src/machine/m_at_socket4.c index d24933ff9..ef745d088 100644 --- a/src/machine/m_at_socket4.c +++ b/src/machine/m_at_socket4.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2010-2019 Sarah Walker. @@ -51,10 +51,10 @@ machine_at_premiere_common_init(const machine_t *model, int pci_switch) pci_init(PCI_CONFIG_TYPE_2 | pci_switch); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); + pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&keyboard_ps2_intel_ami_pci_device); device_add(&sio_zb_device); @@ -70,12 +70,12 @@ machine_at_award_common_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 03 = Slot 1 */ - pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */ - pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 05 = Slot 3 */ - pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 06 = Slot 4 */ - pci_register_slot(0x07, PCI_CARD_SCSI, 1, 2, 3, 4); /* 07 = SCSI */ + pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 03 = Slot 1 */ + pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */ + pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 05 = Slot 3 */ + pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 06 = Slot 4 */ + pci_register_slot(0x07, PCI_CARD_SCSI, 1, 2, 3, 4); /* 07 = SCSI */ pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); if (fdc_type == FDC_INTERNAL) @@ -97,10 +97,10 @@ machine_at_sp4_common_init(const machine_t *model) pci_register_slot(0x0D, PCI_CARD_IDE, 1, 2, 3, 4); /* Excluded: 02, 03*, 04*, 05*, 06*, 07*, 08* */ /* Slots: 09 (04), 0A (03), 0B (02), 0C (07) */ - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&sis_85c50x_device); device_add(&ide_cmd640_pci_device); device_add(&keyboard_ps2_ami_pci_device); @@ -123,10 +123,10 @@ machine_at_excaliburpci_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_2); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x03, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x03, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&fdc37c665_device); device_add(&keyboard_ps2_ami_pci_device); @@ -155,9 +155,9 @@ machine_at_p5mp3_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 05 = Slot 1 */ - pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */ - pci_register_slot(0x03, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 03 = Slot 3 */ + pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 05 = Slot 1 */ + pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */ + pci_register_slot(0x03, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 03 = Slot 3 */ pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&fdc_at_device); device_add(&keyboard_ps2_pci_device); @@ -187,10 +187,10 @@ machine_at_dellxp60_init(const machine_t *model) pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); /* Not: 00, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F. */ /* Yes: 01, 10, 11, 12, 13, 14. */ - pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 3, 2, 4); - pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 4, 3, 3); - pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 4, 3, 2); - pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 3, 2, 4); + pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 4, 3, 3); + pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 4, 3, 2); + pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 1, 3, 4); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430lx_device); device_add(&keyboard_ps2_intel_ami_pci_device); @@ -217,9 +217,9 @@ machine_at_opti560l_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_2); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x03, PCI_CARD_NORMAL, 4, 4, 3, 3); - pci_register_slot(0x07, PCI_CARD_NORMAL, 1, 4, 3, 2); - pci_register_slot(0x08, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x03, PCI_CARD_NORMAL, 4, 4, 3, 3); + pci_register_slot(0x07, PCI_CARD_NORMAL, 1, 4, 3, 2); + pci_register_slot(0x08, PCI_CARD_NORMAL, 2, 1, 3, 4); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430lx_device); device_add(&keyboard_ps2_intel_ami_pci_device); @@ -236,7 +236,8 @@ machine_at_ambradp60_init(const machine_t *model) int ret; ret = bios_load_linear_combined("roms/machines/ambradp60/1004AF1P.BIO", - "roms/machines/ambradp60/1004AF1P.BI1", 0x1c000, 128); + "roms/machines/ambradp60/1004AF1P.BI1", + 0x1c000, 128); if (bios_only || !ret) return ret; @@ -254,7 +255,8 @@ machine_at_valuepointp60_init(const machine_t *model) int ret; ret = bios_load_linear_combined("roms/machines/valuepointp60/1006AV0M.BIO", - "roms/machines/valuepointp60/1006AV0M.BI1", 0x1d000, 128); + "roms/machines/valuepointp60/1006AV0M.BI1", + 0x1d000, 128); if (bios_only || !ret) return ret; @@ -264,10 +266,10 @@ machine_at_valuepointp60_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); + pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&keyboard_ps2_ps1_pci_device); device_add(&sio_device); @@ -285,7 +287,8 @@ machine_at_revenge_init(const machine_t *model) int ret; ret = bios_load_linear_combined("roms/machines/revenge/1009af2_.bio", - "roms/machines/revenge/1009af2_.bi1", 0x1c000, 128); + "roms/machines/revenge/1009af2_.bi1", + 0x1c000, 128); if (bios_only || !ret) return ret; @@ -323,7 +326,8 @@ machine_at_pb520r_init(const machine_t *model) int ret; ret = bios_load_linear_combined("roms/machines/pb520r/1009bc0r.bio", - "roms/machines/pb520r/1009bc0r.bi1", 0x1d000, 128); + "roms/machines/pb520r/1009bc0r.bi1", + 0x1d000, 128); if (bios_only || !ret) return ret; @@ -332,16 +336,16 @@ machine_at_pb520r_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_2); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x03, PCI_CARD_VIDEO, 3, 3, 3, 3); - pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); + pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x03, PCI_CARD_VIDEO, 3, 3, 3, 3); + pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430lx_device); device_add(&ide_cmd640_pci_single_channel_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&gd5434_onboard_pci_device); device_add(&keyboard_ps2_pci_device); @@ -389,10 +393,10 @@ machine_at_p5vl_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 5, 6, 7, 8); - pci_register_slot(0x13, PCI_CARD_NORMAL, 9, 10, 11, 12); - pci_register_slot(0x14, PCI_CARD_NORMAL, 13, 14, 15, 16); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 5, 6, 7, 8); + pci_register_slot(0x13, PCI_CARD_NORMAL, 9, 10, 11, 12); + pci_register_slot(0x14, PCI_CARD_NORMAL, 13, 14, 15, 16); device_add(&opti5x7_pci_device); device_add(&opti822_device); @@ -422,11 +426,11 @@ machine_at_excaliburpci2_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&fdc37c665_device); device_add(&keyboard_ps2_ami_pci_device); device_add(&ide_cmd640_pci_legacy_only_device); diff --git a/src/machine/m_at_socket5.c b/src/machine/m_at_socket5.c index 55751ae43..842554713 100644 --- a/src/machine/m_at_socket5.c +++ b/src/machine/m_at_socket5.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2010-2019 Sarah Walker. @@ -48,7 +48,8 @@ machine_at_plato_init(const machine_t *model) int ret; ret = bios_load_linear_combined("roms/machines/plato/1016ax1_.bio", - "roms/machines/plato/1016ax1_.bi1", 0x1d000, 128); + "roms/machines/plato/1016ax1_.bi1", + 0x1d000, 128); if (bios_only || !ret) return ret; @@ -66,7 +67,8 @@ machine_at_ambradp90_init(const machine_t *model) int ret; ret = bios_load_linear_combined("roms/machines/ambradp90/1002AX1P.BIO", - "roms/machines/ambradp90/1002AX1P.BI1", 0x1d000, 128); + "roms/machines/ambradp90/1002AX1P.BI1", + 0x1d000, 128); if (bios_only || !ret) return ret; @@ -114,10 +116,10 @@ machine_at_acerv30_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&i430fx_device); device_add(&piix_device); device_add(&keyboard_ps2_acer_pci_device); @@ -144,10 +146,10 @@ machine_at_apollo_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&keyboard_ps2_ami_pci_device); device_add(&i430fx_device); @@ -158,42 +160,14 @@ machine_at_apollo_init(const machine_t *model) return ret; } -int -machine_at_exp8551_init(const machine_t *model) -{ - int ret; - - ret = bios_load_linear("roms/machines/exp8551/AMI20.BIO", - 0x000e0000, 131072, 0); - - if (bios_only || !ret) - return ret; - - machine_at_common_init(model); - - pci_init(PCI_CONFIG_TYPE_1); - pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&keyboard_ps2_ami_pci_device); - device_add(&i430fx_device); - device_add(&piix_device); - device_add(&w83787f_device); - device_add(&sst_flash_29ee010_device); - - return ret; -} - int machine_at_zappa_init(const machine_t *model) { int ret; ret = bios_load_linear_combined("roms/machines/zappa/1006bs0_.bio", - "roms/machines/zappa/1006bs0_.bi1", 0x20000, 128); + "roms/machines/zappa/1006bs0_.bi1", + 0x20000, 128); if (bios_only || !ret) return ret; @@ -202,9 +176,9 @@ machine_at_zappa_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&keyboard_ps2_intel_ami_pci_device); device_add(&i430fx_device); @@ -231,9 +205,9 @@ machine_at_powermatev_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x08, PCI_CARD_NORMAL, 0, 0, 0, 0); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); device_add(&keyboard_ps2_ami_pci_device); device_add(&i430fx_device); device_add(&piix_device); @@ -243,35 +217,6 @@ machine_at_powermatev_init(const machine_t *model) return ret; } -int -machine_at_mb500n_init(const machine_t *model) -{ - int ret; - - ret = bios_load_linear("roms/machines/mb500n/031396s.bin", - 0x000e0000, 131072, 0); - - if (bios_only || !ret) - return ret; - - machine_at_common_init(model); - - pci_init(PCI_CONFIG_TYPE_1); - pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&keyboard_ps2_pci_device); - device_add(&i430fx_device); - device_add(&piix_no_mirq_device); - device_add(&fdc37c665_device); - device_add(&intel_flash_bxt_device); - - return ret; -} - int machine_at_hawk_init(const machine_t *model) { @@ -288,9 +233,9 @@ machine_at_hawk_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&keyboard_ps2_ami_pci_device); device_add(&i430fx_device); @@ -338,10 +283,9 @@ machine_at_hot543_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&opti5x7_pci_device); device_add(&opti822_device); @@ -387,11 +331,11 @@ machine_at_sq588_init(const machine_t *model) pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); /* Correct: 0D (01), 0F (02), 11 (03), 13 (04) */ - pci_register_slot(0x02, PCI_CARD_IDE, 1, 2, 3, 4); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x02, PCI_CARD_IDE, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&sis_85c50x_device); device_add(&ide_cmd640_pci_single_channel_device); device_add(&keyboard_ps2_ami_pci_device); @@ -400,3 +344,32 @@ machine_at_sq588_init(const machine_t *model) return ret; } + +int +machine_at_p54sps_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/p54sps/35s106.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x06, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x07, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + device_add(&sis_85c50x_device); + device_add(&ide_pci_2ch_device); + device_add(&keyboard_at_ami_device); + device_add(&w83787f_device); + device_add(&sst_flash_29ee010_device); + + return ret; +} diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index a51c58b14..0e76ac1c9 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Melissa Goad, * @@ -35,6 +35,7 @@ #include <86box/keyboard.h> #include <86box/flash.h> #include <86box/sio.h> +#include <86box/sound.h> #include <86box/hwm.h> #include <86box/video.h> #include <86box/spd.h> @@ -57,7 +58,11 @@ machine_at_acerv35n_init(const machine_t *model) if (bios_only || !ret) return ret; - machine_at_common_init(model); + machine_at_common_init_ex(model, 2); + /* Yes, it's called amstrad_mega_pc_nvr_device, but it's basically the + standard AT NVR, just initialized to 0x00's (perhaps that should be the + default behavior?). */ + device_add(&amstrad_megapc_nvr_device); pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); @@ -95,11 +100,11 @@ machine_at_ap5vm_init(const machine_t *model) /* It seems there were plans for an on-board NCR 53C810 according to some clues left in the manual, but were latter scrapped. The BIOS still support that PCI device, though, so why not. */ - pci_register_slot(0x06, PCI_CARD_SCSI, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x06, PCI_CARD_SCSI, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430vx_device); device_add(&piix3_device); @@ -126,10 +131,10 @@ machine_at_p55t2p4_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430hx_device); device_add(&piix3_device); @@ -155,10 +160,10 @@ machine_at_m7shi_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); device_add(&i430hx_device); device_add(&piix3_device); @@ -188,11 +193,11 @@ machine_at_tc430hx_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430hx_device); device_add(&piix3_device); @@ -223,12 +228,12 @@ machine_at_equium5200_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 0, 0, 0); // riser + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 0, 0, 0); // riser device_add(&i430hx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); @@ -257,11 +262,11 @@ machine_at_pcv90_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430hx_device); device_add(&piix3_device); @@ -303,10 +308,10 @@ machine_at_p55tvp4_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430vx_device); device_add(&piix3_device); @@ -332,9 +337,9 @@ machine_at_5ivg_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430vx_device); device_add(&piix3_device); @@ -361,10 +366,10 @@ machine_at_8500tvxa_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 2, 1); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 3, 2, 1); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 2, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 3, 2, 1); device_add(&i430vx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); @@ -390,10 +395,10 @@ machine_at_presario2240_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x14, PCI_CARD_VIDEO, 3, 0, 0, 0); - pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x14, PCI_CARD_VIDEO, 3, 0, 0, 0); + pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&s3_trio64v2_dx_onboard_pci_device); device_add(&i430vx_device); @@ -421,10 +426,10 @@ machine_at_presario4500_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x14, PCI_CARD_VIDEO, 3, 0, 0, 0); - pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x14, PCI_CARD_VIDEO, 3, 0, 0, 0); + pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&s3_trio64v2_dx_onboard_pci_device); device_add(&i430vx_device); @@ -451,10 +456,10 @@ machine_at_p55va_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430vx_device); device_add(&piix3_device); @@ -480,10 +485,10 @@ machine_at_brio80xx_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x14, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x14, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); device_add(&i430vx_device); device_add(&piix3_device); @@ -513,10 +518,10 @@ machine_at_pb680_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430vx_device); device_add(&piix3_device); @@ -527,6 +532,38 @@ machine_at_pb680_init(const machine_t *model) return ret; } +int +machine_at_pb810_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/pb810/G400125I.BIN", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 3, 2, 4); + pci_register_slot(0x0b, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + + if (sound_card_current[0] == SOUND_INTERNAL) + device_add(&cs4237b_device); + + device_add(&i430vx_device); + device_add(&piix3_device); + device_add(&keyboard_ps2_device); + device_add(&fdc37c935_device); + device_add(&intel_flash_bxt_device); + + return ret; +} + int machine_at_mb520n_init(const machine_t *model) { @@ -542,10 +579,10 @@ machine_at_mb520n_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430vx_device); device_add(&piix3_device); @@ -571,10 +608,10 @@ machine_at_i430vx_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430vx_device); device_add(&piix3_device); @@ -600,12 +637,12 @@ machine_at_nupro592_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x14, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); /*Strongly suspect these are on-board slots*/ - pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x14, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); /*Strongly suspect these are on-board slots*/ + pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); /* PIIX4 */ device_add(&i430tx_device); device_add(&piix4_device); @@ -637,13 +674,13 @@ machine_at_tx97_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); /* PIIX4 */ - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); device_add(&i430tx_device); device_add(&piix4_device); device_add(&keyboard_ps2_ami_pci_device); @@ -691,11 +728,11 @@ machine_at_an430tx_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); /* PIIX4 */ - // pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); + // pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&i430tx_device); device_add(&piix4_device); device_add(&keyboard_ps2_ami_pci_device); @@ -722,13 +759,13 @@ machine_at_ym430tx_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); /* PIIX4 */ - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); device_add(&i430tx_device); device_add(&piix4_device); device_add(&keyboard_ps2_pci_device); @@ -754,10 +791,10 @@ machine_at_mb540n_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); /* PIIX4 */ device_add(&i430tx_device); device_add(&piix4_device); @@ -784,12 +821,12 @@ machine_at_56a5_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); /* PIIX4 */ - pci_register_slot(0x10, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x10, PCI_CARD_NORMAL, 1, 2, 3, 4); device_add(&i430tx_device); device_add(&piix4_device); device_add(&keyboard_ps2_pci_device); @@ -816,10 +853,10 @@ machine_at_p5mms98_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); /* PIIX4 */ - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&i430tx_device); device_add(&piix4_device); device_add(&keyboard_ps2_ami_pci_device); @@ -847,10 +884,10 @@ machine_at_ficva502_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); device_add(&via_vpx_device); device_add(&via_vt82c586b_device); @@ -966,15 +1003,15 @@ machine_at_m560_init(const machine_t *model) machine_at_common_init_ex(model, 2); pci_init(PCI_CONFIG_TYPE_1); - pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); pci_register_slot(0x0B, PCI_CARD_SOUTHBRIDGE_IDE, 1, 2, 3, 4); pci_register_slot(0x0C, PCI_CARD_SOUTHBRIDGE_PMU, 1, 2, 3, 4); pci_register_slot(0x0F, PCI_CARD_SOUTHBRIDGE_USB, 1, 2, 3, 4); - pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&ali1531_device); device_add(&ali1543_device); /* -5 */ device_add(&sst_flash_29ee010_device); @@ -997,16 +1034,16 @@ machine_at_ms5164_init(const machine_t *model) machine_at_common_init_ex(model, 2); pci_init(PCI_CONFIG_TYPE_1); - pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); pci_register_slot(0x0B, PCI_CARD_SOUTHBRIDGE_IDE, 5, 6, 0, 0); pci_register_slot(0x0C, PCI_CARD_SOUTHBRIDGE_PMU, 1, 2, 3, 4); pci_register_slot(0x0F, PCI_CARD_SOUTHBRIDGE_USB, 1, 2, 3, 4); - pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x07, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x07, PCI_CARD_NORMAL, 1, 2, 3, 4); device_add(&ali1531_device); device_add(&ali1543_device); /* -5 */ diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 09b142c83..55a5068d9 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Melissa Goad, * @@ -51,14 +51,14 @@ machine_at_thor_common_init(const machine_t *model, int mr) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 2, 1); - pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 3, 2, 1); + pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 2, 1); + pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 3, 2, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&s3_phoenix_trio64vplus_onboard_pci_device); // device_add(&keyboard_ps2_ami_pci_device); @@ -76,10 +76,10 @@ machine_at_p54tp4xe_common_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&keyboard_ps2_pci_device); device_add(&i430fx_device); @@ -120,13 +120,43 @@ machine_at_p54tp4xe_mr_init(const machine_t *model) return ret; } +int +machine_at_exp8551_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/exp8551/AMI20.BIO", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + device_add(&keyboard_ps2_ami_pci_device); + device_add(&i430fx_device); + device_add(&piix_device); + device_add(&w83787f_device); + device_add(&sst_flash_29ee010_device); + + return ret; +} + int machine_at_gw2katx_init(const machine_t *model) { int ret; ret = bios_load_linear_combined("roms/machines/gw2katx/1003CN0T.BIO", - "roms/machines/gw2katx/1003CN0T.BI1", 0x20000, 128); + "roms/machines/gw2katx/1003CN0T.BI1", + 0x20000, 128); if (bios_only || !ret) return ret; @@ -142,7 +172,8 @@ machine_at_thor_init(const machine_t *model) int ret; ret = bios_load_linear_combined("roms/machines/thor/1006cn0_.bio", - "roms/machines/thor/1006cn0_.bi1", 0x20000, 128); + "roms/machines/thor/1006cn0_.bi1", + 0x20000, 128); if (bios_only || !ret) return ret; @@ -174,7 +205,8 @@ machine_at_endeavor_init(const machine_t *model) int ret; ret = bios_load_linear_combined("roms/machines/endeavor/1006cb0_.bio", - "roms/machines/endeavor/1006cb0_.bi1", 0x1d000, 128); + "roms/machines/endeavor/1006cb0_.bi1", + 0x1d000, 128); if (bios_only || !ret) return ret; @@ -183,14 +215,14 @@ machine_at_endeavor_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&s3_phoenix_trio64_onboard_pci_device); device_add(&keyboard_ps2_intel_ami_pci_device); @@ -218,9 +250,9 @@ machine_at_ms5119_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0d, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0e, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0f, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0d, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0e, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0f, PCI_CARD_NORMAL, 3, 4, 1, 2); device_add(&i430fx_device); device_add(&piix_device); @@ -246,15 +278,15 @@ machine_at_pb640_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 3, 4); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 2, 1, 4); + pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 2, 1, 4); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430fx_rev02_device); device_add(&piix_rev02_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&gd5440_onboard_pci_device); device_add(&keyboard_ps2_intel_ami_pci_device); @@ -264,6 +296,35 @@ machine_at_pb640_init(const machine_t *model) return ret; } +int +machine_at_mb500n_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/mb500n/031396s.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + device_add(&keyboard_ps2_pci_device); + device_add(&i430fx_device); + device_add(&piix_no_mirq_device); + device_add(&fdc37c665_device); + device_add(&intel_flash_bxt_device); + + return ret; +} + int machine_at_fmb_init(const machine_t *model) { @@ -280,10 +341,10 @@ machine_at_fmb_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 2, 1); - pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 3, 2, 1); + pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 2, 1); + pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 3, 2, 1); device_add(&i430fx_device); device_add(&piix_no_mirq_device); @@ -310,11 +371,11 @@ machine_at_acerm3a_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x10, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x10, PCI_CARD_VIDEO, 4, 0, 0, 0); device_add(&i430hx_device); device_add(&piix3_device); device_add(&keyboard_ps2_pci_device); @@ -340,12 +401,12 @@ machine_at_ap53_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x06, PCI_CARD_VIDEO, 1, 2, 3, 4); + pci_register_slot(0x06, PCI_CARD_VIDEO, 1, 2, 3, 4); device_add(&i430hx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); @@ -370,10 +431,10 @@ machine_at_8500tuc_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); device_add(&i430hx_device); device_add(&piix3_device); @@ -399,10 +460,10 @@ machine_at_p55t2s_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430hx_device); device_add(&piix3_device); @@ -428,10 +489,10 @@ machine_at_p5vxb_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); device_add(&i430vx_device); device_add(&piix3_device); @@ -461,11 +522,11 @@ machine_at_gw2kte_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); device_add(&i430vx_device); device_add(&piix3_device); @@ -492,10 +553,10 @@ machine_at_ap5s_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 2, 1); - pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 3, 2, 1); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 2, 1); + pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 3, 2, 1); device_add(&sis_5511_device); device_add(&keyboard_ps2_ami_pci_device); @@ -521,10 +582,10 @@ machine_at_ms5124_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0xFE, 0xFF, 0, 0); - pci_register_slot(0x10, PCI_CARD_NORMAL, 0x41, 0x42, 0x43, 0x44); - pci_register_slot(0x11, PCI_CARD_NORMAL, 0x44, 0x41, 0x42, 0x43); - pci_register_slot(0x12, PCI_CARD_NORMAL, 0x43, 0x44, 0x41, 0x42); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 0x42, 0x43, 0x44, 0x41); + pci_register_slot(0x10, PCI_CARD_NORMAL, 0x41, 0x42, 0x43, 0x44); + pci_register_slot(0x11, PCI_CARD_NORMAL, 0x44, 0x41, 0x42, 0x43); + pci_register_slot(0x12, PCI_CARD_NORMAL, 0x43, 0x44, 0x41, 0x42); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 0x42, 0x43, 0x44, 0x41); device_add(&sis_5511_device); device_add(&keyboard_ps2_ami_pci_device); @@ -550,12 +611,12 @@ machine_at_vectra54_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x0F, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_VIDEO, 0, 0, 0, 0); - pci_register_slot(0x06, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x07, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0D, PCI_CARD_VIDEO, 0, 0, 0, 0); + pci_register_slot(0x06, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x07, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&s3_phoenix_trio64_onboard_pci_device); device_add(&keyboard_ps2_ami_pci_device); diff --git a/src/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index 5ffbec822..c1c95f197 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -55,13 +55,13 @@ machine_at_p6rp4_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x19, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x14, PCI_CARD_AGPBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x14, PCI_CARD_AGPBRIDGE, 0, 0, 0, 0); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_IDE, 0, 0, 0, 0); - pci_register_slot(0x07, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_IDE, 0, 0, 0, 0); + pci_register_slot(0x07, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&i450kx_device); device_add(&sio_zb_device); device_add(&ide_cmd646_device); @@ -89,10 +89,10 @@ machine_at_686nx_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); // Uses the AMIKEY keyboard controller @@ -118,10 +118,10 @@ machine_at_mb600n_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); @@ -147,11 +147,11 @@ machine_at_acerv60n_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 2, 3, 4, 1); device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_pci_device); @@ -180,10 +180,10 @@ machine_at_vs440fx_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i440fx_device); device_add(&piix3_device); @@ -214,10 +214,10 @@ machine_at_ap440fx_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_VIDEO, 3, 0, 0, 0); - pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 3, 2, 4); - pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 3, 4); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 2, 1, 4); + pci_register_slot(0x08, PCI_CARD_VIDEO, 3, 0, 0, 0); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 3, 2, 4); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 3, 4); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 2, 1, 4); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); device_add(&i440fx_device); device_add(&piix3_device); @@ -244,10 +244,10 @@ machine_at_8600ttc_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); @@ -273,10 +273,10 @@ machine_at_m6mi_init(const machine_t *model) pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_ami_pci_device); @@ -294,11 +294,11 @@ machine_at_p65up5_common_init(const machine_t *model, const device_t *northbridg pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); device_add(northbridge); device_add(&piix3_ioapic_device); device_add(&keyboard_ps2_ami_pci_device); diff --git a/src/machine/m_at_sockets7.c b/src/machine/m_at_sockets7.c index 381940a10..dab544707 100644 --- a/src/machine/m_at_sockets7.c +++ b/src/machine/m_at_sockets7.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Melissa Goad, * @@ -268,7 +268,7 @@ machine_at_ficva503a_init(const machine_t *model) hwm_values.temperatures[1] += 2; /* System offset */ hwm_values.temperatures[2] = 0; /* unused */ - if (sound_card_current == SOUND_INTERNAL) + if (sound_card_current[0] == SOUND_INTERNAL) device_add(&wm9701a_device); /* on daughtercard */ return ret; diff --git a/src/machine/m_at_t3100e.c b/src/machine/m_at_t3100e.c index 6b09b1e02..080f22977 100644 --- a/src/machine/m_at_t3100e.c +++ b/src/machine/m_at_t3100e.c @@ -55,8 +55,8 @@ * * Page mapped at 0xD000 0xD400 0xD800 0xDC00 * ------------------------------------------------------ - * Pages 0x00-0x7F 0x208 0x4208 0x8208 0xc208 - * Pages 0x80-0xFF 0x218 0x4218 0x8218 0xc218 + * Pages 0x00-0x7F 0x208 0x4208 0x8208 0xc208 + * Pages 0x80-0xFF 0x218 0x4218 0x8218 0xc218 * Pages 0x100-0x17F 0x258 0x4258 0x8258 0xc258 * Pages 0x180-0x1FF 0x268 0x4268 0x8268 0xc268 * @@ -121,9 +121,9 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. * diff --git a/src/machine/m_at_t3100e_vid.c b/src/machine/m_at_t3100e_vid.c index 30bbc488b..53571c49e 100644 --- a/src/machine/m_at_t3100e_vid.c +++ b/src/machine/m_at_t3100e_vid.c @@ -26,7 +26,7 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2017-2019 Fred N. van Kempen. * Copyright 2016-2019 Miran Grca. diff --git a/src/machine/m_elt.c b/src/machine/m_elt.c index 47e6f145d..0370b45a2 100644 --- a/src/machine/m_elt.c +++ b/src/machine/m_elt.c @@ -31,7 +31,6 @@ * USA. */ -// clang-format off #include #include #include @@ -51,7 +50,6 @@ #include <86box/rom.h> #include <86box/video.h> #include <86box/vid_cga.h> -// clang-format on static void elt_vid_off_poll(void *p) @@ -180,7 +178,7 @@ machine_elt_init(const machine_t *model) if (fdc_type == FDC_INTERNAL) device_add(&fdc_xt_device); - if (gfxcard == VID_INTERNAL) { + if (gfxcard[0] == VID_INTERNAL) { cga = device_add(&cga_device); io_removehandler(0x03d0, 0x0010, cga_in, NULL, NULL, cga_out, NULL, NULL, cga); io_sethandler(0x03d0, 0x0010, elt_vid_in, NULL, NULL, elt_vid_out, NULL, NULL, cga); diff --git a/src/machine/m_europc.c b/src/machine/m_europc.c index 3f78c8f49..b1368dd5d 100644 --- a/src/machine/m_europc.c +++ b/src/machine/m_europc.c @@ -293,50 +293,50 @@ rtc_reset(nvr_t *nvr) /* * EuroPC System Configuration: * - * [A] unknown + * [A] unknown * - * [B] 7 1 bootdrive extern - * 0 bootdribe intern - * 6:5 11 invalid hard disk type - * 10 hard disk installed, type 2 - * 01 hard disk installed, type 1 - * 00 hard disk not installed - * 4:3 11 invalid external drive type - * 10 external drive 720K - * 01 external drive 360K - * 00 external drive disabled - * 2 unknown - * 1:0 11 invalid internal drive type - * 10 internal drive 360K - * 01 internal drive 720K - * 00 internal drive disabled + * [B] 7 1 bootdrive extern + * 0 bootdrive intern + * 6:5 11 invalid hard disk type + * 10 hard disk installed, type 2 + * 01 hard disk installed, type 1 + * 00 hard disk not installed + * 4:3 11 invalid external drive type + * 10 external drive 720K + * 01 external drive 360K + * 00 external drive disabled + * 2 unknown + * 1:0 11 invalid internal drive type + * 10 internal drive 360K + * 01 internal drive 720K + * 00 internal drive disabled * - * [C] 7:6 unknown - * 5 monitor detection OFF - * 4 unknown - * 3:2 11 illegal memory size - * 10 512K - * 01 256K - * 00 640K - * 1:0 11 illegal game port - * 10 gameport as mouse port - * 01 gameport as joysticks - * 00 gameport disabled + * [C] 7:6 unknown + * 5 monitor detection OFF + * 4 unknown + * 3:2 11 illegal memory size + * 10 512K + * 01 256K + * 00 640K + * 1:0 11 illegal game port + * 10 gameport as mouse port + * 01 gameport as joysticks + * 00 gameport disabled * - * [D] 7:6 10 9MHz CPU speed - * 01 7MHz CPU speed - * 00 4.77 MHz CPU - * 5 unknown - * 4 external: color, internal: mono - * 3 unknown - * 2 internal video ON - * 1:0 11 mono - * 10 color80 - * 01 color40 - * 00 special (EGA,VGA etc) + * [D] 7:6 10 9MHz CPU speed + * 01 7MHz CPU speed + * 00 4.77 MHz CPU + * 5 unknown + * 4 external: color, internal: mono + * 3 unknown + * 2 internal video ON + * 1:0 11 mono + * 10 color80 + * 01 color40 + * 00 special (EGA,VGA etc) * - * [E] 7:4 unknown - * 3:0 country (00=Deutschland, 0A=ASCII) + * [E] 7:4 unknown + * 3:0 country (00=Deutschland, 0A=ASCII) */ nvr->regs[MRTC_CONF_A] = 0x00; /* CONFIG A */ nvr->regs[MRTC_CONF_B] = 0x0A; /* CONFIG B */ @@ -400,15 +400,15 @@ jim_set(europc_t *sys, uint8_t reg, uint8_t val) case 4: /* CPU Speed control */ switch (val & 0xc0) { case 0x00: /* 4.77 MHz */ - // cpu_set_clockscale(0, 1.0/2); + // cpu_set_clockscale(0, 1.0/2); break; case 0x40: /* 7.16 MHz */ - // cpu_set_clockscale(0, 3.0/4); + // cpu_set_clockscale(0, 3.0/4); break; default: /* 9.54 MHz */ - // cpu_set_clockscale(0, 1);break; + // cpu_set_clockscale(0, 1);break; break; } break; @@ -549,7 +549,7 @@ europc_boot(const device_t *info) * with values set by the user. */ b = (sys->nvr.regs[MRTC_CONF_D] & ~0x17); - video_reset(gfxcard); + video_reset(gfxcard[0]); if (video_is_cga()) b |= 0x12; /* external video, CGA80 */ else if (video_is_mda()) diff --git a/src/machine/m_pcjr.c b/src/machine/m_pcjr.c index 6446d5852..0b1f8ec58 100644 --- a/src/machine/m_pcjr.c +++ b/src/machine/m_pcjr.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -781,7 +781,7 @@ machine_pcjr_init(const machine_t *model) cpu_set(); /* Initialize the video controller. */ - video_reset(gfxcard); + video_reset(gfxcard[0]); loadfont("roms/video/mda/mda.rom", 0); mem_mapping_add(&pcjr->mapping, 0xb8000, 0x08000, vid_read, NULL, NULL, diff --git a/src/machine/m_ps1.c b/src/machine/m_ps1.c index 53e6928e8..d002ba6bd 100644 --- a/src/machine/m_ps1.c +++ b/src/machine/m_ps1.c @@ -24,7 +24,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -300,7 +300,7 @@ ps1_setup(int model) 0xfc0000, 0x40000, 0x3ffff, 0, MEM_MAPPING_EXTERNAL); /* Initialize the video controller. */ - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&ibm_ps1_2121_device); device_add(&fdc_at_ps1_device); diff --git a/src/machine/m_ps2_mca.c b/src/machine/m_ps2_mca.c index cfe6ba6bd..5057b65ea 100644 --- a/src/machine/m_ps2_mca.c +++ b/src/machine/m_ps2_mca.c @@ -12,7 +12,7 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2017-2019 Fred N. van Kempen. * Copyright 2016-2019 Miran Grca. @@ -950,7 +950,7 @@ ps2_mca_board_model_50_init(int slots) ps2_mca_mem_fffc_init(2); } - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&ps1vga_mca_device); } @@ -1008,7 +1008,7 @@ ps2_mca_board_model_55sx_init(int has_sec_nvram, int slots) ps2.planar_read = model_55sx_read; ps2.planar_write = model_55sx_write; - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&ps1vga_mca_device); model_55sx_mem_recalc(); @@ -1244,7 +1244,7 @@ ps2_mca_board_model_70_type34_init(int is_type4, int slots) } } - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&ps1vga_mca_device); } @@ -1318,7 +1318,7 @@ ps2_mca_board_model_80_type2_init(int is486) } } - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&ps1vga_mca_device); ps2.split_size = 0; diff --git a/src/machine/m_tandy.c b/src/machine/m_tandy.c index c7789de26..04f5e5381 100644 --- a/src/machine/m_tandy.c +++ b/src/machine/m_tandy.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. @@ -174,219 +174,219 @@ static const scancode scancode_tandy[512] = { { {0x50, 0}, {0xd0, 0} }, { {0x51, 0}, {0xd1, 0} }, { {0x52, 0}, {0xd2, 0} }, { {0x56, 0}, {0xd6, 0} }, { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*054*/ + { {0}, {0} }, { {0}, {0} }, /*054*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*058*/ + { {0}, {0} }, { {0}, {0} }, /*058*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*05c*/ + { {0}, {0} }, { {0}, {0} }, /*05c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*060*/ + { {0}, {0} }, { {0}, {0} }, /*060*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*064*/ + { {0}, {0} }, { {0}, {0} }, /*064*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*068*/ + { {0}, {0} }, { {0}, {0} }, /*068*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*06c*/ + { {0}, {0} }, { {0}, {0} }, /*06c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*070*/ + { {0}, {0} }, { {0}, {0} }, /*070*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*074*/ + { {0}, {0} }, { {0}, {0} }, /*074*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*078*/ + { {0}, {0} }, { {0}, {0} }, /*078*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*07c*/ + { {0}, {0} }, { {0}, {0} }, /*07c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*080*/ + { {0}, {0} }, { {0}, {0} }, /*080*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*084*/ + { {0}, {0} }, { {0}, {0} }, /*084*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*088*/ + { {0}, {0} }, { {0}, {0} }, /*088*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*08c*/ + { {0}, {0} }, { {0}, {0} }, /*08c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*090*/ + { {0}, {0} }, { {0}, {0} }, /*090*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*094*/ + { {0}, {0} }, { {0}, {0} }, /*094*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*098*/ + { {0}, {0} }, { {0}, {0} }, /*098*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*09c*/ + { {0}, {0} }, { {0}, {0} }, /*09c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a0*/ + { {0}, {0} }, { {0}, {0} }, /*0a0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a4*/ + { {0}, {0} }, { {0}, {0} }, /*0a4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a8*/ + { {0}, {0} }, { {0}, {0} }, /*0a8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0ac*/ + { {0}, {0} }, { {0}, {0} }, /*0ac*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b0*/ + { {0}, {0} }, { {0}, {0} }, /*0b0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b4*/ + { {0}, {0} }, { {0}, {0} }, /*0b4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b8*/ + { {0}, {0} }, { {0}, {0} }, /*0b8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0bc*/ + { {0}, {0} }, { {0}, {0} }, /*0bc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c0*/ + { {0}, {0} }, { {0}, {0} }, /*0c0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c4*/ + { {0}, {0} }, { {0}, {0} }, /*0c4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c8*/ + { {0}, {0} }, { {0}, {0} }, /*0c8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0cc*/ + { {0}, {0} }, { {0}, {0} }, /*0cc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d0*/ + { {0}, {0} }, { {0}, {0} }, /*0d0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d4*/ + { {0}, {0} }, { {0}, {0} }, /*0d4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d8*/ + { {0}, {0} }, { {0}, {0} }, /*0d8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0dc*/ + { {0}, {0} }, { {0}, {0} }, /*0dc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e0*/ + { {0}, {0} }, { {0}, {0} }, /*0e0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e4*/ + { {0}, {0} }, { {0}, {0} }, /*0e4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e8*/ + { {0}, {0} }, { {0}, {0} }, /*0e8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0ec*/ + { {0}, {0} }, { {0}, {0} }, /*0ec*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f0*/ + { {0}, {0} }, { {0}, {0} }, /*0f0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f4*/ + { {0}, {0} }, { {0}, {0} }, /*0f4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f8*/ + { {0}, {0} }, { {0}, {0} }, /*0f8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0fc*/ + { {0}, {0} }, { {0}, {0} }, /*0fc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*100*/ + { {0}, {0} }, { {0}, {0} }, /*100*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*104*/ + { {0}, {0} }, { {0}, {0} }, /*104*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*108*/ + { {0}, {0} }, { {0}, {0} }, /*108*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*10c*/ + { {0}, {0} }, { {0}, {0} }, /*10c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*110*/ + { {0}, {0} }, { {0}, {0} }, /*110*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*114*/ + { {0}, {0} }, { {0}, {0} }, /*114*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*118*/ + { {0}, {0} }, { {0}, {0} }, /*118*/ { {0x57, 0}, {0xd7, 0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*11c*/ + { {0}, {0} }, { {0}, {0} }, /*11c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*120*/ + { {0}, {0} }, { {0}, {0} }, /*120*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*124*/ + { {0}, {0} }, { {0}, {0} }, /*124*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*128*/ + { {0}, {0} }, { {0}, {0} }, /*128*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*12c*/ + { {0}, {0} }, { {0}, {0} }, /*12c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*130*/ + { {0}, {0} }, { {0}, {0} }, /*130*/ { {0}, {0} }, { {0x35, 0}, {0xb5, 0} }, - { {0}, {0} }, { {0x37, 0}, {0xb7, 0} }, /*134*/ + { {0}, {0} }, { {0x37, 0}, {0xb7, 0} }, /*134*/ { {0x38, 0}, {0xb8, 0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*138*/ + { {0}, {0} }, { {0}, {0} }, /*138*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*13c*/ + { {0}, {0} }, { {0}, {0} }, /*13c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*140*/ + { {0}, {0} }, { {0}, {0} }, /*140*/ { {0}, {0} }, { {0}, {0} }, - { {0x46, 0}, {0xc6, 0} }, { {0x47, 0}, {0xc7, 0} }, /*144*/ + { {0x46, 0}, {0xc6, 0} }, { {0x47, 0}, {0xc7, 0} }, /*144*/ { {0x29, 0}, {0xa9, 0} }, { {0x49, 0}, {0xc9, 0} }, - { {0}, {0} }, { {0x2b, 0}, {0xab, 0} }, /*148*/ + { {0}, {0} }, { {0x2b, 0}, {0xab, 0} }, /*148*/ { {0}, {0} }, { {0x4e, 0}, {0xce, 0} }, - { {0}, {0} }, { {0x4f, 0}, {0xcf, 0} }, /*14c*/ + { {0}, {0} }, { {0x4f, 0}, {0xcf, 0} }, /*14c*/ { {0x4a, 0}, {0xca, 0} }, { {0x51, 0}, {0xd1, 0} }, - { {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, /*150*/ + { {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, /*150*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*154*/ + { {0}, {0} }, { {0}, {0} }, /*154*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*158*/ + { {0}, {0} }, { {0}, {0} }, /*158*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*15c*/ + { {0}, {0} }, { {0}, {0} }, /*15c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*160*/ + { {0}, {0} }, { {0}, {0} }, /*160*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*164*/ + { {0}, {0} }, { {0}, {0} }, /*164*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*168*/ + { {0}, {0} }, { {0}, {0} }, /*168*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*16c*/ + { {0}, {0} }, { {0}, {0} }, /*16c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*170*/ + { {0}, {0} }, { {0}, {0} }, /*170*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*174*/ + { {0}, {0} }, { {0}, {0} }, /*174*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*148*/ + { {0}, {0} }, { {0}, {0} }, /*148*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*17c*/ + { {0}, {0} }, { {0}, {0} }, /*17c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*180*/ + { {0}, {0} }, { {0}, {0} }, /*180*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*184*/ + { {0}, {0} }, { {0}, {0} }, /*184*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*88*/ + { {0}, {0} }, { {0}, {0} }, /*188*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*18c*/ + { {0}, {0} }, { {0}, {0} }, /*18c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*190*/ + { {0}, {0} }, { {0}, {0} }, /*190*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*194*/ + { {0}, {0} }, { {0}, {0} }, /*194*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*198*/ + { {0}, {0} }, { {0}, {0} }, /*198*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*19c*/ + { {0}, {0} }, { {0}, {0} }, /*19c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a0*/ + { {0}, {0} }, { {0}, {0} }, /*1a0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a4*/ + { {0}, {0} }, { {0}, {0} }, /*1a4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a8*/ + { {0}, {0} }, { {0}, {0} }, /*1a8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1ac*/ + { {0}, {0} }, { {0}, {0} }, /*1ac*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b0*/ + { {0}, {0} }, { {0}, {0} }, /*1b0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b4*/ + { {0}, {0} }, { {0}, {0} }, /*1b4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b8*/ + { {0}, {0} }, { {0}, {0} }, /*1b8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1bc*/ + { {0}, {0} }, { {0}, {0} }, /*1bc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c0*/ + { {0}, {0} }, { {0}, {0} }, /*1c0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c4*/ + { {0}, {0} }, { {0}, {0} }, /*1c4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c8*/ + { {0}, {0} }, { {0}, {0} }, /*1c8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1cc*/ + { {0}, {0} }, { {0}, {0} }, /*1cc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d0*/ + { {0}, {0} }, { {0}, {0} }, /*1d0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d4*/ + { {0}, {0} }, { {0}, {0} }, /*1d4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d8*/ + { {0}, {0} }, { {0}, {0} }, /*1d8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1dc*/ + { {0}, {0} }, { {0}, {0} }, /*1dc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e0*/ + { {0}, {0} }, { {0}, {0} }, /*1e0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e4*/ + { {0}, {0} }, { {0}, {0} }, /*1e4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e8*/ + { {0}, {0} }, { {0}, {0} }, /*1e8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1ec*/ + { {0}, {0} }, { {0}, {0} }, /*1ec*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f0*/ + { {0}, {0} }, { {0}, {0} }, /*1f0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f4*/ + { {0}, {0} }, { {0}, {0} }, /*1f4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f8*/ + { {0}, {0} }, { {0}, {0} }, /*1f8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} } /*1fc*/ + { {0}, {0} }, { {0}, {0} } /*1fc*/ // clang-format on }; static uint8_t crtcmask[32] = { @@ -1437,7 +1437,7 @@ machine_tandy1k_init(const machine_t *model, int type) if (fdc_type == FDC_INTERNAL) device_add(&fdc_xt_tandy_device); - video_reset(gfxcard); + video_reset(gfxcard[0]); switch (type) { case TYPE_TANDY: diff --git a/src/machine/m_v86p.c b/src/machine/m_v86p.c index 03bfda842..af90ab629 100644 --- a/src/machine/m_v86p.c +++ b/src/machine/m_v86p.c @@ -90,7 +90,7 @@ machine_v86p_init(const machine_t *model) if (fdc_type == FDC_INTERNAL) device_add(&fdc_xt_device); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&f82c425_video_device); if (hdc_current <= 1) diff --git a/src/machine/m_xt_compaq.c b/src/machine/m_xt_compaq.c index 733063306..f5dca48a7 100644 --- a/src/machine/m_xt_compaq.c +++ b/src/machine/m_xt_compaq.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * TheCollector1995, * diff --git a/src/machine/m_xt_olivetti.c b/src/machine/m_xt_olivetti.c index c978e2caf..e9c24f88f 100644 --- a/src/machine/m_xt_olivetti.c +++ b/src/machine/m_xt_olivetti.c @@ -11,7 +11,7 @@ * - Supports MM58174 real-time clock emulation (M24) * - Supports MM58274 real-time clock emulation (M240) * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * EngiNerd @@ -889,219 +889,219 @@ const scancode scancode_olivetti_m24_deluxe[512] = { { {0x50, 0}, {0xd0, 0} }, { {0x51, 0}, {0xd1, 0} }, { {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, { {0}, {0} }, { {0}, {0} }, - { {0x5e, 0}, {0xde, 0} }, { {0x60, 0}, {0xe0, 0} }, /*054*/ + { {0x5e, 0}, {0xde, 0} }, { {0x60, 0}, {0xe0, 0} }, /*054*/ { {0x61, 0}, {0xe1, 0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*058*/ + { {0}, {0} }, { {0}, {0} }, /*058*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*05c*/ + { {0}, {0} }, { {0}, {0} }, /*05c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*060*/ + { {0}, {0} }, { {0}, {0} }, /*060*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*064*/ + { {0}, {0} }, { {0}, {0} }, /*064*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*068*/ + { {0}, {0} }, { {0}, {0} }, /*068*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*06c*/ + { {0}, {0} }, { {0}, {0} }, /*06c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*070*/ + { {0}, {0} }, { {0}, {0} }, /*070*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*074*/ + { {0}, {0} }, { {0}, {0} }, /*074*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*078*/ + { {0}, {0} }, { {0}, {0} }, /*078*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*07c*/ + { {0}, {0} }, { {0}, {0} }, /*07c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*080*/ + { {0}, {0} }, { {0}, {0} }, /*080*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*084*/ + { {0}, {0} }, { {0}, {0} }, /*084*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*088*/ + { {0}, {0} }, { {0}, {0} }, /*088*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*08c*/ + { {0}, {0} }, { {0}, {0} }, /*08c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*090*/ + { {0}, {0} }, { {0}, {0} }, /*090*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*094*/ + { {0}, {0} }, { {0}, {0} }, /*094*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*098*/ + { {0}, {0} }, { {0}, {0} }, /*098*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*09c*/ + { {0}, {0} }, { {0}, {0} }, /*09c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a0*/ + { {0}, {0} }, { {0}, {0} }, /*0a0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a4*/ + { {0}, {0} }, { {0}, {0} }, /*0a4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a8*/ + { {0}, {0} }, { {0}, {0} }, /*0a8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0ac*/ + { {0}, {0} }, { {0}, {0} }, /*0ac*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b0*/ + { {0}, {0} }, { {0}, {0} }, /*0b0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b4*/ + { {0}, {0} }, { {0}, {0} }, /*0b4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b8*/ + { {0}, {0} }, { {0}, {0} }, /*0b8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0bc*/ + { {0}, {0} }, { {0}, {0} }, /*0bc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c0*/ + { {0}, {0} }, { {0}, {0} }, /*0c0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c4*/ + { {0}, {0} }, { {0}, {0} }, /*0c4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c8*/ + { {0}, {0} }, { {0}, {0} }, /*0c8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0cc*/ + { {0}, {0} }, { {0}, {0} }, /*0cc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d0*/ + { {0}, {0} }, { {0}, {0} }, /*0d0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d4*/ + { {0}, {0} }, { {0}, {0} }, /*0d4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d8*/ + { {0}, {0} }, { {0}, {0} }, /*0d8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0dc*/ + { {0}, {0} }, { {0}, {0} }, /*0dc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e0*/ + { {0}, {0} }, { {0}, {0} }, /*0e0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e4*/ + { {0}, {0} }, { {0}, {0} }, /*0e4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e8*/ + { {0}, {0} }, { {0}, {0} }, /*0e8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0ec*/ + { {0}, {0} }, { {0}, {0} }, /*0ec*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f0*/ + { {0}, {0} }, { {0}, {0} }, /*0f0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f4*/ + { {0}, {0} }, { {0}, {0} }, /*0f4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f8*/ + { {0}, {0} }, { {0}, {0} }, /*0f8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0fc*/ + { {0}, {0} }, { {0}, {0} }, /*0fc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*100*/ + { {0}, {0} }, { {0}, {0} }, /*100*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*104*/ + { {0}, {0} }, { {0}, {0} }, /*104*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*108*/ + { {0}, {0} }, { {0}, {0} }, /*108*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*10c*/ + { {0}, {0} }, { {0}, {0} }, /*10c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*110*/ + { {0}, {0} }, { {0}, {0} }, /*110*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*114*/ + { {0}, {0} }, { {0}, {0} }, /*114*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*118*/ + { {0}, {0} }, { {0}, {0} }, /*118*/ { {0x57, 0}, {0xd7, 0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*11c*/ + { {0}, {0} }, { {0}, {0} }, /*11c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*120*/ + { {0}, {0} }, { {0}, {0} }, /*120*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*124*/ + { {0}, {0} }, { {0}, {0} }, /*124*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*128*/ + { {0}, {0} }, { {0}, {0} }, /*128*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*12c*/ + { {0}, {0} }, { {0}, {0} }, /*12c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*130*/ + { {0}, {0} }, { {0}, {0} }, /*130*/ { {0}, {0} }, { {0x5f, 0}, {0xdf, 0} }, - { {0}, {0} }, { {0x37, 0}, {0xb7, 0} }, /*134*/ + { {0}, {0} }, { {0x37, 0}, {0xb7, 0} }, /*134*/ { {0x66, 0}, {0xe6, 0} }, { {0x55, 0}, {0xd5, 0} }, - { {0}, {0} }, { {0}, {0} }, /*138*/ + { {0}, {0} }, { {0}, {0} }, /*138*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*13c*/ + { {0}, {0} }, { {0}, {0} }, /*13c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*140*/ + { {0}, {0} }, { {0}, {0} }, /*140*/ { {0}, {0} }, { {0}, {0} }, - { {0x46, 0}, {0xc6, 0} }, { {0x63, 0}, {0xe3, 0} }, /*144*/ + { {0x46, 0}, {0xc6, 0} }, { {0x63, 0}, {0xe3, 0} }, /*144*/ { {0x5b, 0}, {0xdb, 0} }, { {0x5c, 0}, {0xdc, 0} }, - { {0}, {0} }, { {0x58, 0}, {0xd8, 0} }, /*148*/ + { {0}, {0} }, { {0x58, 0}, {0xd8, 0} }, /*148*/ { {0}, {0} }, { {0x5a, 0}, {0xda, 0} }, - { {0}, {0} }, { {0x65, 0}, {0xe5, 0} }, /*14c*/ + { {0}, {0} }, { {0x65, 0}, {0xe5, 0} }, /*14c*/ { {0x59, 0}, {0xd9, 0} }, { {0x5d, 0}, {0xdd, 0} }, - { {0x62, 0}, {0xe2, 0} }, { {0x64, 0}, {0xe4, 0} }, /*150*/ + { {0x62, 0}, {0xe2, 0} }, { {0x64, 0}, {0xe4, 0} }, /*150*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*154*/ + { {0}, {0} }, { {0}, {0} }, /*154*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0x54, 0}, {0xd4, 0} }, /*158*/ + { {0}, {0} }, { {0x54, 0}, {0xd4, 0} }, /*158*/ { {0x67, 0}, {0xe7, 0} }, { {0x56, 0}, {0xd6, 0} }, - { {0}, {0} }, { {0}, {0} }, /*15c*/ + { {0}, {0} }, { {0}, {0} }, /*15c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*160*/ + { {0}, {0} }, { {0}, {0} }, /*160*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*164*/ + { {0}, {0} }, { {0}, {0} }, /*164*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*168*/ + { {0}, {0} }, { {0}, {0} }, /*168*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*16c*/ + { {0}, {0} }, { {0}, {0} }, /*16c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*170*/ + { {0}, {0} }, { {0}, {0} }, /*170*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*174*/ + { {0}, {0} }, { {0}, {0} }, /*174*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*148*/ + { {0}, {0} }, { {0}, {0} }, /*148*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*17c*/ + { {0}, {0} }, { {0}, {0} }, /*17c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*180*/ + { {0}, {0} }, { {0}, {0} }, /*180*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*184*/ + { {0}, {0} }, { {0}, {0} }, /*184*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*88*/ + { {0}, {0} }, { {0}, {0} }, /*188*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*18c*/ + { {0}, {0} }, { {0}, {0} }, /*18c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*190*/ + { {0}, {0} }, { {0}, {0} }, /*190*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*194*/ + { {0}, {0} }, { {0}, {0} }, /*194*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*198*/ + { {0}, {0} }, { {0}, {0} }, /*198*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*19c*/ + { {0}, {0} }, { {0}, {0} }, /*19c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a0*/ + { {0}, {0} }, { {0}, {0} }, /*1a0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a4*/ + { {0}, {0} }, { {0}, {0} }, /*1a4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a8*/ + { {0}, {0} }, { {0}, {0} }, /*1a8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1ac*/ + { {0}, {0} }, { {0}, {0} }, /*1ac*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b0*/ + { {0}, {0} }, { {0}, {0} }, /*1b0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b4*/ + { {0}, {0} }, { {0}, {0} }, /*1b4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b8*/ + { {0}, {0} }, { {0}, {0} }, /*1b8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1bc*/ + { {0}, {0} }, { {0}, {0} }, /*1bc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c0*/ + { {0}, {0} }, { {0}, {0} }, /*1c0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c4*/ + { {0}, {0} }, { {0}, {0} }, /*1c4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c8*/ + { {0}, {0} }, { {0}, {0} }, /*1c8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1cc*/ + { {0}, {0} }, { {0}, {0} }, /*1cc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d0*/ + { {0}, {0} }, { {0}, {0} }, /*1d0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d4*/ + { {0}, {0} }, { {0}, {0} }, /*1d4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d8*/ + { {0}, {0} }, { {0}, {0} }, /*1d8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1dc*/ + { {0}, {0} }, { {0}, {0} }, /*1dc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e0*/ + { {0}, {0} }, { {0}, {0} }, /*1e0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e4*/ + { {0}, {0} }, { {0}, {0} }, /*1e4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e8*/ + { {0}, {0} }, { {0}, {0} }, /*1e8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1ec*/ + { {0}, {0} }, { {0}, {0} }, /*1ec*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f0*/ + { {0}, {0} }, { {0}, {0} }, /*1f0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f4*/ + { {0}, {0} }, { {0}, {0} }, /*1f4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f8*/ + { {0}, {0} }, { {0}, {0} }, /*1f8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} } /*1fc*/ + { {0}, {0} }, { {0}, {0} } /*1fc*/ // clang-format on }; @@ -1156,219 +1156,219 @@ const scancode scancode_olivetti_m240[512] = { { {0x50, 0}, {0xd0, 0} }, { {0x51, 0}, {0xd1, 0} }, { {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*054*/ + { {0}, {0} }, { {0}, {0} }, /*054*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*058*/ + { {0}, {0} }, { {0}, {0} }, /*058*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*05c*/ + { {0}, {0} }, { {0}, {0} }, /*05c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*060*/ + { {0}, {0} }, { {0}, {0} }, /*060*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*064*/ + { {0}, {0} }, { {0}, {0} }, /*064*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*068*/ + { {0}, {0} }, { {0}, {0} }, /*068*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*06c*/ + { {0}, {0} }, { {0}, {0} }, /*06c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*070*/ + { {0}, {0} }, { {0}, {0} }, /*070*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*074*/ + { {0}, {0} }, { {0}, {0} }, /*074*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*078*/ + { {0}, {0} }, { {0}, {0} }, /*078*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*07c*/ + { {0}, {0} }, { {0}, {0} }, /*07c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*080*/ + { {0}, {0} }, { {0}, {0} }, /*080*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*084*/ + { {0}, {0} }, { {0}, {0} }, /*084*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*088*/ + { {0}, {0} }, { {0}, {0} }, /*088*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*08c*/ + { {0}, {0} }, { {0}, {0} }, /*08c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*090*/ + { {0}, {0} }, { {0}, {0} }, /*090*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*094*/ + { {0}, {0} }, { {0}, {0} }, /*094*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*098*/ + { {0}, {0} }, { {0}, {0} }, /*098*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*09c*/ + { {0}, {0} }, { {0}, {0} }, /*09c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a0*/ + { {0}, {0} }, { {0}, {0} }, /*0a0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a4*/ + { {0}, {0} }, { {0}, {0} }, /*0a4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0a8*/ + { {0}, {0} }, { {0}, {0} }, /*0a8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0ac*/ + { {0}, {0} }, { {0}, {0} }, /*0ac*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b0*/ + { {0}, {0} }, { {0}, {0} }, /*0b0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b4*/ + { {0}, {0} }, { {0}, {0} }, /*0b4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0b8*/ + { {0}, {0} }, { {0}, {0} }, /*0b8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0bc*/ + { {0}, {0} }, { {0}, {0} }, /*0bc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c0*/ + { {0}, {0} }, { {0}, {0} }, /*0c0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c4*/ + { {0}, {0} }, { {0}, {0} }, /*0c4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0c8*/ + { {0}, {0} }, { {0}, {0} }, /*0c8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0cc*/ + { {0}, {0} }, { {0}, {0} }, /*0cc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d0*/ + { {0}, {0} }, { {0}, {0} }, /*0d0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d4*/ + { {0}, {0} }, { {0}, {0} }, /*0d4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0d8*/ + { {0}, {0} }, { {0}, {0} }, /*0d8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0dc*/ + { {0}, {0} }, { {0}, {0} }, /*0dc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e0*/ + { {0}, {0} }, { {0}, {0} }, /*0e0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e4*/ + { {0}, {0} }, { {0}, {0} }, /*0e4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0e8*/ + { {0}, {0} }, { {0}, {0} }, /*0e8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0ec*/ + { {0}, {0} }, { {0}, {0} }, /*0ec*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f0*/ + { {0}, {0} }, { {0}, {0} }, /*0f0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f4*/ + { {0}, {0} }, { {0}, {0} }, /*0f4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0f8*/ + { {0}, {0} }, { {0}, {0} }, /*0f8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*0fc*/ + { {0}, {0} }, { {0}, {0} }, /*0fc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*100*/ + { {0}, {0} }, { {0}, {0} }, /*100*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*104*/ + { {0}, {0} }, { {0}, {0} }, /*104*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*108*/ + { {0}, {0} }, { {0}, {0} }, /*108*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*10c*/ + { {0}, {0} }, { {0}, {0} }, /*10c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*110*/ + { {0}, {0} }, { {0}, {0} }, /*110*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*114*/ + { {0}, {0} }, { {0}, {0} }, /*114*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*118*/ + { {0}, {0} }, { {0}, {0} }, /*118*/ { {0x1c, 0}, {0x9c, 0} }, { {0x1d, 0}, {0x9d, 0} }, - { {0}, {0} }, { {0}, {0} }, /*11c*/ + { {0}, {0} }, { {0}, {0} }, /*11c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*120*/ + { {0}, {0} }, { {0}, {0} }, /*120*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*124*/ + { {0}, {0} }, { {0}, {0} }, /*124*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*128*/ + { {0}, {0} }, { {0}, {0} }, /*128*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*12c*/ + { {0}, {0} }, { {0}, {0} }, /*12c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*130*/ + { {0}, {0} }, { {0}, {0} }, /*130*/ { {0}, {0} }, { {0x35, 0}, {0xb5, 0} }, - { {0}, {0} }, { {0x37, 0}, {0xb7, 0} }, /*134*/ + { {0}, {0} }, { {0x37, 0}, {0xb7, 0} }, /*134*/ { {0x38, 0}, {0xb8, 0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*138*/ + { {0}, {0} }, { {0}, {0} }, /*138*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*13c*/ + { {0}, {0} }, { {0}, {0} }, /*13c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*140*/ + { {0}, {0} }, { {0}, {0} }, /*140*/ { {0}, {0} }, { {0}, {0} }, - { {0x46, 0}, {0xc6, 0} }, { {0x47, 0}, {0xc7, 0} }, /*144*/ + { {0x46, 0}, {0xc6, 0} }, { {0x47, 0}, {0xc7, 0} }, /*144*/ { {0x48, 0}, {0xc8, 0} }, { {0x49, 0}, {0xc9, 0} }, - { {0}, {0} }, { {0x4b, 0}, {0xcb, 0} }, /*148*/ + { {0}, {0} }, { {0x4b, 0}, {0xcb, 0} }, /*148*/ { {0}, {0} }, { {0x4d, 0}, {0xcd, 0} }, - { {0}, {0} }, { {0x4f, 0}, {0xcf, 0} }, /*14c*/ + { {0}, {0} }, { {0x4f, 0}, {0xcf, 0} }, /*14c*/ { {0x50, 0}, {0xd0, 0} }, { {0x51, 0}, {0xd1, 0} }, - { {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, /*150*/ + { {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, /*150*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*154*/ + { {0}, {0} }, { {0}, {0} }, /*154*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*158*/ + { {0}, {0} }, { {0}, {0} }, /*158*/ { {0}, {0} }, { {0x54, 0}, {0xd4, 0} }, - { {0x56, 0}, {0xd6, 0} }, { {0x5c, 0}, {0xdc, 0} }, /*15c*/ + { {0x56, 0}, {0xd6, 0} }, { {0x5c, 0}, {0xdc, 0} }, /*15c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*160*/ + { {0}, {0} }, { {0}, {0} }, /*160*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*164*/ + { {0}, {0} }, { {0}, {0} }, /*164*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*168*/ + { {0}, {0} }, { {0}, {0} }, /*168*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*16c*/ + { {0}, {0} }, { {0}, {0} }, /*16c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*170*/ + { {0}, {0} }, { {0}, {0} }, /*170*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*174*/ + { {0}, {0} }, { {0}, {0} }, /*174*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*148*/ + { {0}, {0} }, { {0}, {0} }, /*148*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*17c*/ + { {0}, {0} }, { {0}, {0} }, /*17c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*180*/ + { {0}, {0} }, { {0}, {0} }, /*180*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*184*/ + { {0}, {0} }, { {0}, {0} }, /*184*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*88*/ + { {0}, {0} }, { {0}, {0} }, /*188*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*18c*/ + { {0}, {0} }, { {0}, {0} }, /*18c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*190*/ + { {0}, {0} }, { {0}, {0} }, /*190*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*194*/ + { {0}, {0} }, { {0}, {0} }, /*194*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*198*/ + { {0}, {0} }, { {0}, {0} }, /*198*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*19c*/ + { {0}, {0} }, { {0}, {0} }, /*19c*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a0*/ + { {0}, {0} }, { {0}, {0} }, /*1a0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a4*/ + { {0}, {0} }, { {0}, {0} }, /*1a4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1a8*/ + { {0}, {0} }, { {0}, {0} }, /*1a8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1ac*/ + { {0}, {0} }, { {0}, {0} }, /*1ac*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b0*/ + { {0}, {0} }, { {0}, {0} }, /*1b0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b4*/ + { {0}, {0} }, { {0}, {0} }, /*1b4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1b8*/ + { {0}, {0} }, { {0}, {0} }, /*1b8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1bc*/ + { {0}, {0} }, { {0}, {0} }, /*1bc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c0*/ + { {0}, {0} }, { {0}, {0} }, /*1c0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c4*/ + { {0}, {0} }, { {0}, {0} }, /*1c4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1c8*/ + { {0}, {0} }, { {0}, {0} }, /*1c8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1cc*/ + { {0}, {0} }, { {0}, {0} }, /*1cc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d0*/ + { {0}, {0} }, { {0}, {0} }, /*1d0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d4*/ + { {0}, {0} }, { {0}, {0} }, /*1d4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1d8*/ + { {0}, {0} }, { {0}, {0} }, /*1d8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1dc*/ + { {0}, {0} }, { {0}, {0} }, /*1dc*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e0*/ + { {0}, {0} }, { {0}, {0} }, /*1e0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e4*/ + { {0}, {0} }, { {0}, {0} }, /*1e4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1e8*/ + { {0}, {0} }, { {0}, {0} }, /*1e8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1ec*/ + { {0}, {0} }, { {0}, {0} }, /*1ec*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f0*/ + { {0}, {0} }, { {0}, {0} }, /*1f0*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f4*/ + { {0}, {0} }, { {0}, {0} }, /*1f4*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} }, /*1f8*/ + { {0}, {0} }, { {0}, {0} }, /*1f8*/ { {0}, {0} }, { {0}, {0} }, - { {0}, {0} }, { {0}, {0} } /*1fc*/ + { {0}, {0} }, { {0}, {0} } /*1fc*/ // clang-format on }; @@ -1807,9 +1807,9 @@ machine_xt_m24_init(const machine_t *model) mm58174_init(nvr, model->nvrmask + 1); - video_reset(gfxcard); + video_reset(gfxcard[0]); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&ogc_m24_device); pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt); @@ -1919,7 +1919,7 @@ machine_xt_m19_init(const machine_t *model) nmi_init(); - video_reset(gfxcard); + video_reset(gfxcard[0]); m19_vid_init(vid); device_add_ex(&m19_vid_device, vid); diff --git a/src/machine/m_xt_t1000.c b/src/machine/m_xt_t1000.c index f61ce639b..f632003ac 100644 --- a/src/machine/m_xt_t1000.c +++ b/src/machine/m_xt_t1000.c @@ -55,7 +55,7 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2018-2019 Fred N. van Kempen. * Copyright 2018-2019 Miran Grca. @@ -687,8 +687,8 @@ t1000_read_nvram(uint16_t addr, void *priv) tmp = fdc_read(0x03f7, t1000.fdc); tmp = (tmp & 0x80) >> 3; /* Bit 4 is changeline */ - tmp |= (sys->nvr_active & 0xc0); /* Bits 6,7 are r/w mode */ - tmp |= 0x2e; /* Bits 5,3,2,1 always 1 */ + tmp |= (sys->nvr_active & 0xc0); /* Bits 6, 7 are r/w mode */ + tmp |= 0x2e; /* Bits 5, 3, 2, 1 always 1 */ tmp |= (sys->nvr_active & 0x40) >> 6; /* Ready state */ break; } @@ -897,7 +897,7 @@ machine_xt_t1000_init(const machine_t *model) t1000_nvr_load(); nvr_set_ven_save(t1000_nvr_save); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&t1000_video_device); return ret; @@ -957,7 +957,7 @@ machine_xt_t1200_init(const machine_t *model) t1200_nvr_load(); nvr_set_ven_save(t1200_nvr_save); - if (gfxcard == VID_INTERNAL) + if (gfxcard[0] == VID_INTERNAL) device_add(&t1200_video_device); if (hdc_current <= 1) diff --git a/src/machine/m_xt_t1000_vid.c b/src/machine/m_xt_t1000_vid.c index 60fb59082..48c00d3c3 100644 --- a/src/machine/m_xt_t1000_vid.c +++ b/src/machine/m_xt_t1000_vid.c @@ -13,7 +13,7 @@ * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, + * Sarah Walker, * * Copyright 2018-2019 Fred N. van Kempen. * Copyright 2018-2019 Miran Grca. diff --git a/src/machine/m_xt_zenith.c b/src/machine/m_xt_zenith.c index 9e05f3077..e5cebe552 100644 --- a/src/machine/m_xt_zenith.c +++ b/src/machine/m_xt_zenith.c @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * TheCollector1995, * EngiNerd diff --git a/src/machine/machine.c b/src/machine/machine.c index 6b496b06a..7a69f4879 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -96,7 +96,7 @@ machine_init_ex(int m) /* Prepare some video-related things if we're using internal or no video. */ - video_pre_reset(gfxcard); + video_pre_reset(gfxcard[0]); /* Reset any ISA memory cards. */ isamem_reset(); @@ -112,7 +112,7 @@ machine_init_ex(int m) if (bios_only || !ret) return ret; - if (gfxcard != VID_NONE) { + if (gfxcard[0] != VID_NONE) { if (ibm8514_enabled) { ibm8514_device_add(); } @@ -122,7 +122,7 @@ machine_init_ex(int m) /* Reset the graphics card (or do nothing if it was already done by the machine's init function). */ - video_reset(gfxcard); + video_reset(gfxcard[0]); return ret; } diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 2807c1060..c65884b7e 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -13,7 +13,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -4312,7 +4312,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 16384, @@ -4350,7 +4350,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 16384, @@ -4387,7 +4387,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 16384, @@ -4424,7 +4424,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = 0, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 32768, @@ -4462,7 +4462,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 14336, @@ -4499,7 +4499,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_IDE | MACHINE_VIDEO, + .flags = MACHINE_IDE | MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 1024, .max = 14336, @@ -4536,7 +4536,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 512, .max = 8192, @@ -4573,7 +4573,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -4612,7 +4612,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_MCA, - .flags = MACHINE_VIDEO, + .flags = MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -4652,7 +4652,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 32768, @@ -4689,7 +4689,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 32768, @@ -4726,7 +4726,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 32768, @@ -4763,7 +4763,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_MCA, - .flags = MACHINE_VIDEO, + .flags = MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 2048, .max = 65536, @@ -4800,7 +4800,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_MCA, - .flags = MACHINE_VIDEO, + .flags = MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 2048, .max = 65536, @@ -4843,7 +4843,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 32768, @@ -4882,7 +4882,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -4920,7 +4920,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -4957,7 +4957,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -4994,7 +4994,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5032,7 +5032,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5069,7 +5069,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -5109,7 +5109,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_AT, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 64512, @@ -5148,7 +5148,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE | MACHINE_VIDEO, + .flags = MACHINE_IDE | MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 2048, .max = 32768, @@ -5185,7 +5185,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE | MACHINE_VIDEO, + .flags = MACHINE_IDE | MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 2048, .max = 32768, @@ -5226,7 +5226,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE | MACHINE_VIDEO, + .flags = MACHINE_IDE | MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 4096, .max = 36864, @@ -5263,7 +5263,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 4096, .max = 36864, @@ -5300,7 +5300,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 32768, @@ -5337,7 +5337,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 1024, .max = 32768, @@ -5374,7 +5374,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 32768, @@ -5412,7 +5412,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE | MACHINE_VIDEO, + .flags = MACHINE_IDE | MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5451,7 +5451,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5491,7 +5491,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5528,7 +5528,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5565,7 +5565,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5602,7 +5602,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5639,7 +5639,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5676,7 +5676,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_VLB, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5713,7 +5713,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5750,7 +5750,44 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, + .ram = { + .min = 1024, + .max = 65536, + .step = 1024 + }, + .nvrmask = 127, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, + /* TriGem AMIBIOS Pre-Color with TriGem AMI 'Z' keyboard controller */ + { + .name = "[SiS 471] TriGem 486G", + .internal_name = "tg486g", + .type = MACHINE_TYPE_486_S3, + .chipset = MACHINE_CHIPSET_SIS_471, + .init = machine_at_tg486g_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET3, + .block = CPU_BLOCK_NONE, + .min_bus = 0, + .max_bus = 0, + .min_voltage = 0, + .max_voltage = 0, + .min_multi = 0, + .max_multi = 0 + }, + .bus_flags = MACHINE_PS2_VLB, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5767,6 +5804,80 @@ const machine_t machines[] = { }, /* 486 machines which utilize the PCI bus */ + /* Machine with ALi M1429G chipset and M1435 southbridge */ + { + .name = "[ALi M1429G] MSI MS-4134", + .internal_name = "ms4134", + .type = MACHINE_TYPE_486_S3, + .chipset = MACHINE_CHIPSET_ALI_M1429G, + .init = machine_at_ms4134_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET3, + .block = CPU_BLOCK_NONE, + .min_bus = 0, + .max_bus = 0, + .min_voltage = 0, + .max_voltage = 0, + .min_multi = 0, + .max_multi = 0 + }, + .bus_flags = MACHINE_PS2_PCIV, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .ram = { + .min = 1024, + .max = 131072, + .step = 1024 + }, + .nvrmask = 255, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, + /* TriGem machine with M1429G and PhoenixBIOS */ + { + .name = "[ALi M1429G] TriGem 486GP", + .internal_name = "tg486gp", + .type = MACHINE_TYPE_486_S3, + .chipset = MACHINE_CHIPSET_ALI_M1429G, + .init = machine_at_tg486gp_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET3, + .block = CPU_BLOCK_NONE, + .min_bus = 0, + .max_bus = 0, + .min_voltage = 0, + .max_voltage = 0, + .min_multi = 0, + .max_multi = 0 + }, + .bus_flags = MACHINE_PS2_PCIV, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .ram = { + .min = 1024, + .max = 131072, + .step = 1024 + }, + .nvrmask = 255, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { .name = "[ALi M1489] AAEON SBC-490", @@ -5789,7 +5900,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5827,7 +5938,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5868,7 +5979,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5909,7 +6020,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5946,7 +6057,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -5983,7 +6094,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -6020,7 +6131,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCIV, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6057,7 +6168,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6094,7 +6205,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_SCSI, + .flags = MACHINE_IDE_DUAL | MACHINE_SCSI | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6131,7 +6242,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 2048, .max = 131072, @@ -6169,7 +6280,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_SCSI, + .flags = MACHINE_IDE_DUAL | MACHINE_SCSI | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6206,7 +6317,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 2048, .max = 131072, @@ -6243,7 +6354,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 2048, .max = 131072, @@ -6280,7 +6391,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCIV, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 261120, @@ -6317,7 +6428,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6354,7 +6465,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6391,7 +6502,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 261120, @@ -6429,7 +6540,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCIV, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 261120, @@ -6467,7 +6578,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 261120, @@ -6504,7 +6615,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 65536, @@ -6541,7 +6652,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6578,7 +6689,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 262144, @@ -6616,7 +6727,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCIV, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6653,7 +6764,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6690,7 +6801,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 262144, @@ -6727,7 +6838,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PCIV, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6764,7 +6875,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCIV, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -6805,7 +6916,7 @@ const machine_t machines[] = { .max_multi = 1.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 8192, .max = 131072, @@ -6843,7 +6954,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 32768, .max = 163840, @@ -6881,7 +6992,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 32768, .max = 163840, @@ -6919,7 +7030,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 32768, .max = 98304, @@ -6957,7 +7068,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 32768, .max = 131072, @@ -7001,7 +7112,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 131072, @@ -7038,7 +7149,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 196608, @@ -7075,7 +7186,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 131072, @@ -7112,7 +7223,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 131072, @@ -7151,7 +7262,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 131072, @@ -7188,7 +7299,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 131072, @@ -7225,7 +7336,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 131072, @@ -7262,7 +7373,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 131072, @@ -7299,7 +7410,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 139264, @@ -7340,7 +7451,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_VLB, - .flags = MACHINE_IDE, + .flags = MACHINE_IDE | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 65536, @@ -7379,7 +7490,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PCIV, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7418,7 +7529,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7455,7 +7566,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7495,7 +7606,7 @@ const machine_t machines[] = { .max_multi = 1.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 131072, @@ -7533,7 +7644,7 @@ const machine_t machines[] = { .max_multi = 1.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 131072, @@ -7570,10 +7681,10 @@ const machine_t machines[] = { .max_multi = 1.5 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, - .max = 131072, + .max = 262144, .step = 2048 }, .nvrmask = 127, @@ -7609,7 +7720,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7646,44 +7757,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, - .ram = { - .min = 8192, - .max = 131072, - .step = 8192 - }, - .nvrmask = 127, - .kbc = KBC_UNKNOWN, - .kbc_p1 = 0, - .gpio = 0, - .device = NULL, - .vid_device = NULL, - .snd_device = NULL, - .net_device = NULL - }, - /* Has AMIKey H KBC firmware. */ - { - .name = "[i430FX] DataExpert EXP8551", - .internal_name = "exp8551", - .type = MACHINE_TYPE_SOCKET5, - .chipset = MACHINE_CHIPSET_INTEL_430FX, - .init = machine_at_exp8551_init, - .pad = 0, - .pad0 = 0, - .pad1 = MACHINE_AVAILABLE, - .pad2 = 0, - .cpu = { - .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, - .min_bus = 50000000, - .max_bus = 66666667, - .min_voltage = 3380, - .max_voltage = 3520, - .min_multi = 1.5, - .max_multi = 3.0 - }, - .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_GAMEPORT, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7722,7 +7796,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7759,44 +7833,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, - .ram = { - .min = 8192, - .max = 131072, - .step = 8192 - }, - .nvrmask = 127, - .kbc = KBC_UNKNOWN, - .kbc_p1 = 0, - .gpio = 0, - .device = NULL, - .vid_device = NULL, - .snd_device = NULL, - .net_device = NULL - }, - /* Has a VIA VT82C42N KBC. */ - { - .name = "[i430FX] PC Partner MB500N", - .internal_name = "mb500n", - .type = MACHINE_TYPE_SOCKET5, - .chipset = MACHINE_CHIPSET_INTEL_430FX, - .init = machine_at_mb500n_init, - .pad = 0, - .pad0 = 0, - .pad1 = MACHINE_AVAILABLE, - .pad2 = 0, - .cpu = { - .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, - .min_bus = 50000000, - .max_bus = 66666667, - .min_voltage = 3380, - .max_voltage = 3520, - .min_multi = 1.5, - .max_multi = 3.0 - }, - .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7833,7 +7870,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7874,7 +7911,7 @@ const machine_t machines[] = { .max_multi = 1.5 }, .bus_flags = MACHINE_VLB, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM | MACHINE_ACPI, .ram = { .min = 2048, .max = 65536, @@ -7912,7 +7949,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PCIV, - .flags = MACHINE_FLAGS_NONE, + .flags = MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7951,7 +7988,7 @@ const machine_t machines[] = { .max_multi = 1.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -7988,7 +8025,7 @@ const machine_t machines[] = { .max_multi = 1.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8003,6 +8040,43 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* This machine has a Winbond W83C842 KBC */ + { + .name = "[SiS 501] Gemlight GMB-P54SPS", + .internal_name = "p54sps", + .type = MACHINE_TYPE_SOCKET5, + .chipset = MACHINE_CHIPSET_SIS_501, + .init = machine_at_p54sps_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET5_7, + CPU_BLOCK(CPU_PENTIUMMMX), + .min_bus = 50000000, + .max_bus = 66666667, + .min_voltage = 3520, + .max_voltage = 3520, + .min_multi = 1.5, + .max_multi = 1.5 + }, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, + .ram = { + .min = 8192, + .max = 131072, + .step = 8192 + }, + .nvrmask = 127, + .kbc = KBC_JETKEY_5_W83C42, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* Socket 7 (Single Voltage) machines */ /* 430FX */ @@ -8028,7 +8102,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8065,7 +8139,44 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, + .ram = { + .min = 8192, + .max = 131072, + .step = 8192 + }, + .nvrmask = 127, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, + /* Has AMIKey H KBC firmware. */ + { + .name = "[i430FX] DataExpert EXP8551", + .internal_name = "exp8551", + .type = MACHINE_TYPE_SOCKET7_3V, + .chipset = MACHINE_CHIPSET_INTEL_430FX, + .init = machine_at_exp8551_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET5_7, + .block = CPU_BLOCK_NONE, + .min_bus = 50000000, + .max_bus = 66666667, + .min_voltage = 3380, + .max_voltage = 3520, + .min_multi = 1.5, + .max_multi = 3.0 + }, + .bus_flags = MACHINE_PS2_PCI, + .flags = MACHINE_IDE_DUAL | MACHINE_GAMEPORT | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8104,7 +8215,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8142,7 +8253,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8181,7 +8292,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8220,7 +8331,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8259,7 +8370,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8296,7 +8407,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8334,7 +8445,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8349,6 +8460,43 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* Has a VIA VT82C42N KBC. */ + { + .name = "[i430FX] PC Partner MB500N", + .internal_name = "mb500n", + .type = MACHINE_TYPE_SOCKET7_3V, + .chipset = MACHINE_CHIPSET_INTEL_430FX, + .init = machine_at_mb500n_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET5_7, + .block = CPU_BLOCK_NONE, + .min_bus = 50000000, + .max_bus = 66666667, + .min_voltage = 3380, + .max_voltage = 3520, + .min_multi = 1.5, + .max_multi = 3.0 + }, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, + .ram = { + .min = 8192, + .max = 131072, + .step = 8192 + }, + .nvrmask = 127, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* Has an AMI 'H' KBC firmware (1992). */ { .name = "[i430FX] QDI FMB", @@ -8371,7 +8519,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8412,7 +8560,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 196608, @@ -8449,7 +8597,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -8486,7 +8634,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -8524,7 +8672,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -8563,7 +8711,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8602,7 +8750,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8641,7 +8789,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -8678,7 +8826,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -8718,7 +8866,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 196608, @@ -8755,7 +8903,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 262144, @@ -8792,7 +8940,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8831,7 +8979,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -8870,7 +9018,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 196608, @@ -8910,7 +9058,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 196608, @@ -8947,7 +9095,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -8986,7 +9134,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_SCSI, + .flags = MACHINE_IDE_DUAL | MACHINE_SCSI | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9023,7 +9171,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9061,7 +9209,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9098,7 +9246,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9136,7 +9284,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9173,7 +9321,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9210,7 +9358,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9247,7 +9395,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9286,7 +9434,44 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, + .ram = { + .min = 8192, + .max = 131072, + .step = 8192 + }, + .nvrmask = 127, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, + /* This machine has Phoenix MultiKey/42i KBC */ + { + .name = "[i430VX] Packard Bell PB810", + .internal_name = "pb810", + .type = MACHINE_TYPE_SOCKET7, + .chipset = MACHINE_CHIPSET_INTEL_430VX, + .init = machine_at_pb810_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SOCKET5_7, + .block = CPU_BLOCK_NONE, + .min_bus = 50000000, + .max_bus = 66666667, + .min_voltage = 2500, + .max_voltage = 3520, + .min_multi = 1.5, + .max_multi = 3.0 + }, + .bus_flags = MACHINE_PS2_PCI, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9324,7 +9509,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9362,7 +9547,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_GAMEPORT, + .flags = MACHINE_IDE_DUAL | MACHINE_GAMEPORT | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -9401,7 +9586,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 262144, @@ -9438,7 +9623,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 262144, @@ -9476,7 +9661,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 262144, @@ -9514,7 +9699,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 262144, @@ -9551,7 +9736,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 262144, @@ -9588,7 +9773,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 262144, @@ -9625,7 +9810,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 262144, @@ -9665,7 +9850,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -9705,7 +9890,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -9744,7 +9929,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 393216, @@ -9781,7 +9966,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 262144, @@ -9820,7 +10005,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -9857,7 +10042,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -9897,7 +10082,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 1024, .max = 1572864, @@ -9935,7 +10120,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 1024, .max = 1572864, @@ -9972,7 +10157,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 1024, .max = 1572864, @@ -10009,7 +10194,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 1024, .max = 1572864, @@ -10049,7 +10234,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10087,7 +10272,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10125,7 +10310,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_A97, - .flags = MACHINE_IDE_DUAL | MACHINE_SOUND, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -10163,7 +10348,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -10203,7 +10388,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -10242,7 +10427,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -10279,7 +10464,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10317,7 +10502,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10353,7 +10538,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -10392,7 +10577,7 @@ const machine_t machines[] = { .max_multi = 3.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 131072, @@ -10431,7 +10616,7 @@ const machine_t machines[] = { .max_multi = 3.5 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -10468,7 +10653,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -10507,7 +10692,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -10547,7 +10732,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 1024, .max = 1572864, @@ -10586,7 +10771,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10624,7 +10809,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -10664,7 +10849,7 @@ const machine_t machines[] = { .max_multi = 5.5 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10702,7 +10887,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10741,8 +10926,8 @@ const machine_t machines[] = { .min_multi = 3.0, .max_multi = 8.0 }, - .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .bus_flags = MACHINE_PS2_AGP, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -10782,7 +10967,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10820,7 +11005,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10858,7 +11043,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -10896,7 +11081,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -10934,7 +11119,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -10972,7 +11157,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -11010,7 +11195,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL | MACHINE_SOUND, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -11048,7 +11233,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -11088,7 +11273,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL | MACHINE_AV, + .flags = MACHINE_IDE_DUAL | MACHINE_AV | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -11126,7 +11311,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL | MACHINE_AV, + .flags = MACHINE_IDE_DUAL | MACHINE_AV | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -11166,7 +11351,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -11206,7 +11391,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -11244,7 +11429,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1572864, @@ -11282,7 +11467,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 2097152, @@ -11320,7 +11505,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL | MACHINE_SOUND, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 3145728, @@ -11361,7 +11546,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_NOISA, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 16384, .max = 2097152, @@ -11402,7 +11587,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -11417,6 +11602,45 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* VIA Apollo Pro */ + /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC + firmware. */ + { + .name = "[VIA Apollo Pro 133] ECS P6BAT-A+", + .internal_name = "p6bat", + .type = MACHINE_TYPE_SLOT1_370, + .chipset = MACHINE_CHIPSET_VIA_APOLLO_PRO_133, + .init = machine_at_p6bat_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SLOT1 | CPU_PKG_SOCKET370, + .block = CPU_BLOCK_NONE, + .min_bus = 66666667, + .max_bus = 133333333, + .min_voltage = 1300, + .max_voltage = 3500, + .min_multi = 1.5, + .max_multi = 8.0 + }, + .bus_flags = MACHINE_PS2_AGP, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI, + .ram = { + .min = 8192, + .max = 786432, + .step = 8192 + }, + .nvrmask = 255, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = &cmi8738_onboard_device, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* Slot 2 machines */ /* 440GX */ @@ -11443,7 +11667,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 16384, .max = 2097152, @@ -11481,7 +11705,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 16384, .max = 2097152, @@ -11522,7 +11746,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED, }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -11562,7 +11786,7 @@ const machine_t machines[] = { .max_multi = 8.0 /* limits assumed */ }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -11600,7 +11824,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -11638,7 +11862,7 @@ const machine_t machines[] = { .max_multi = 8.0 /* limits assumed */ }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -11678,7 +11902,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 524288, @@ -11718,7 +11942,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, @@ -11758,7 +11982,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 786432, @@ -11776,7 +12000,7 @@ const machine_t machines[] = { /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ { - .name = "[VIA Apollo Pro 133] ECS P6BAP", + .name = "[VIA Apollo Pro 133] ECS P6BAP-A+", .internal_name = "p6bap", .type = MACHINE_TYPE_SOCKET370, .chipset = MACHINE_CHIPSET_VIA_APOLLO_PRO_133, @@ -11796,7 +12020,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1572864, @@ -11834,7 +12058,7 @@ const machine_t machines[] = { .max_multi = MACHINE_MULTIPLIER_FIXED }, .bus_flags = MACHINE_PS2_A97, - .flags = MACHINE_IDE_DUAL | MACHINE_AG, + .flags = MACHINE_IDE_DUAL | MACHINE_AG | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 16384, .max = 3145728, @@ -11872,7 +12096,7 @@ const machine_t machines[] = { .max_multi = 8.0 }, .bus_flags = MACHINE_PS2_NOI97, - .flags = MACHINE_IDE_DUAL | MACHINE_SOUND, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 16384, .max = 4194304, @@ -11912,7 +12136,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI, .ram = { .min = 8192, .max = 1048576, diff --git a/src/mem/CMakeLists.txt b/src/mem/CMakeLists.txt index 1739d4807..6aad80544 100644 --- a/src/mem/CMakeLists.txt +++ b/src/mem/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(mem OBJECT catalyst_flash.c i2c_eeprom.c intel_flash.c mem.c rom.c diff --git a/src/mem/catalyst_flash.c b/src/mem/catalyst_flash.c index 043a24b37..5e473f540 100644 --- a/src/mem/catalyst_flash.c +++ b/src/mem/catalyst_flash.c @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. diff --git a/src/mem/intel_flash.c b/src/mem/intel_flash.c index 18b8a4b3d..f06b2426d 100644 --- a/src/mem/intel_flash.c +++ b/src/mem/intel_flash.c @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2020 Sarah Walker. diff --git a/src/mem/mem.c b/src/mem/mem.c index 4d5a5238b..1af83c844 100644 --- a/src/mem/mem.c +++ b/src/mem/mem.c @@ -8,7 +8,7 @@ * * Memory handling and MMU. * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/mem/rom.c b/src/mem/rom.c index 6c964f2c3..25ca1db71 100644 --- a/src/mem/rom.c +++ b/src/mem/rom.c @@ -14,7 +14,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/mem/sst_flash.c b/src/mem/sst_flash.c index 5ad110fa5..551e2da63 100644 --- a/src/mem/sst_flash.c +++ b/src/mem/sst_flash.c @@ -10,13 +10,15 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Melissa Goad, + * Jasmine Iwanek, * * Copyright 2008-2020 Sarah Walker. * Copyright 2016-2020 Miran Grca. - * Copyright 2020 Melissa Goad. + * Copyright 2020 Melissa Goad. + * Copyright 2022-2023 Jasmine Iwanek. */ #include #include @@ -67,23 +69,69 @@ static char flash_path[1024]; /* 1st cycle variant only on 39 */ #define SST 0xbf /* SST Manufacturer's ID */ + +#define SST29EE512 0x5d00 +#define SST29LE_VE512 0x3d00 #define SST29EE010 0x0700 #define SST29LE_VE010 0x0800 #define SST29EE020 0x1000 #define SST29LE_VE020 0x1200 + #define SST39SF512 0xb400 #define SST39SF010 0xb500 #define SST39SF020 0xb600 #define SST39SF040 0xb700 -#define WINBOND 0xda /* Winbond Manufacturer's ID */ -#define W29C010 0xC100 -#define W29C020 0x4500 +#define SST39LF512 0xd400 +#define SST39LF010 0xd500 +#define SST39LF020 0xd600 +#define SST39LF040 0xd700 +#define SST39LF080 0xd800 +#define SST39LF016 0xd900 -#define SIZE_512K 0x010000 -#define SIZE_1M 0x020000 -#define SIZE_2M 0x040000 -#define SIZE_4M 0x080000 +/* +// 16 wide +#define SST39WF400 0x272f +#define SST39WF400B 0x272e +#define SST39WF800 0x273f +#define SST39WF800B 0x273e +#define SST39WF1601 0xbf274b +#define SST39WF1602 0xbf274a + +#define SST39LF100 0x2788 +#define SST39LF200 0x2789 +#define SST39LF400 0x2780 +#define SST39LF800 0x2781 +#define SST39LF160 0x2782 +*/ + +#define SST49LF002 0x5700 +#define SST49LF020 0x6100 +#define SST49LF020A 0x5200 +#define SST49LF003 0x1b00 +#define SST49LF004 0x6000 +#define SST49LF004C 0x5400 +#define SST49LF040 0x5100 +#define SST49LF008 0x5a00 +#define SST49LF008C 0x5900 +#define SST49LF080 0x5b00 +#define SST49LF030 0x1c00 +#define SST49LF160 0x4c00 +#define SST49LF016 0x5c00 + +#define WINBOND 0xda /* Winbond Manufacturer's ID */ +#define W29C512 0xc800 +#define W29C010 0xc100 +#define W29C020 0x4500 +#define W29C040 0x4600 + +#define SIZE_512K 0x010000 +#define SIZE_1M 0x020000 +#define SIZE_2M 0x040000 +#define SIZE_3M 0x060000 +#define SIZE_4M 0x080000 +#define SIZE_8M 0x100000 +#define SIZE_16M 0x200000 static void sst_sector_erase(sst_t *dev, uint32_t addr) @@ -483,20 +531,6 @@ const device_t sst_flash_29ee010_device = { .config = NULL }; -const device_t winbond_flash_w29c010_device = { - .name = "Winbond W29C010 Flash BIOS", - .internal_name = "winbond_flash_w29c010", - .flags = 0, - .local = WINBOND | W29C010 | SIZE_1M, - .init = sst_init, - .close = sst_close, - .reset = NULL, - { .available = NULL }, - .speed_changed = NULL, - .force_redraw = NULL, - .config = NULL -}; - const device_t sst_flash_29ee020_device = { .name = "SST 29EE020 Flash BIOS", .internal_name = "sst_flash_29ee020", @@ -511,6 +545,34 @@ const device_t sst_flash_29ee020_device = { .config = NULL }; +const device_t winbond_flash_w29c512_device = { + .name = "Winbond W29C512 Flash BIOS", + .internal_name = "winbond_flash_w29c512", + .flags = 0, + .local = WINBOND | W29C010 | SIZE_512K, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t winbond_flash_w29c010_device = { + .name = "Winbond W29C010 Flash BIOS", + .internal_name = "winbond_flash_w29c010", + .flags = 0, + .local = WINBOND | W29C010 | SIZE_1M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + const device_t winbond_flash_w29c020_device = { .name = "Winbond W29C020 Flash BIOS", .internal_name = "winbond_flash_w29c020", @@ -525,6 +587,34 @@ const device_t winbond_flash_w29c020_device = { .config = NULL }; +const device_t winbond_flash_w29c040_device = { + .name = "Winbond W29C040 Flash BIOS", + .internal_name = "winbond_flash_w29c040", + .flags = 0, + .local = WINBOND | W29C040 | SIZE_4M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_39sf512_device = { + .name = "SST 39SF512 Flash BIOS", + .internal_name = "sst_flash_39sf512", + .flags = 0, + .local = SST | SST39SF512 | SIZE_512K, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + const device_t sst_flash_39sf010_device = { .name = "SST 39SF010 Flash BIOS", .internal_name = "sst_flash_39sf010", @@ -566,3 +656,278 @@ const device_t sst_flash_39sf040_device = { .force_redraw = NULL, .config = NULL }; + +const device_t sst_flash_39lf512_device = { + .name = "SST 39LF512 Flash BIOS", + .internal_name = "sst_flash_39lf512", + .flags = 0, + .local = SST | SST39LF512 | SIZE_512K, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_39lf010_device = { + .name = "SST 39LF010 Flash BIOS", + .internal_name = "sst_flash_39lf010", + .flags = 0, + .local = SST | SST39LF010 | SIZE_1M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_39lf020_device = { + .name = "SST 39LF020 Flash BIOS", + .internal_name = "sst_flash_39lf020", + .flags = 0, + .local = SST | SST39LF020 | SIZE_2M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_39lf040_device = { + .name = "SST 39LF040 Flash BIOS", + .internal_name = "sst_flash_39lf040", + .flags = 0, + .local = SST | SST39LF040 | SIZE_4M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_39lf080_device = { + .name = "SST 39LF080 Flash BIOS", + .internal_name = "sst_flash_39lf080", + .flags = 0, + .local = SST | SST39LF080 | SIZE_8M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_39lf016_device = { + .name = "SST 39LF016 Flash BIOS", + .internal_name = "sst_flash_39lf016", + .flags = 0, + .local = SST | SST39LF016 | SIZE_16M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +/* + * Firmware Hubs. The FWH signals are not implemented yet. Firmware Hubs do write cycles + * to read/write on the flash. SST Flashes still do traditional flashing via PP Mode. Our + * BIOS firmwares don't seem to utilize FWH R/W thus the FWH ports remain unknown for an + * implementation. We just contain the ID's so the BIOS can do ESCD & DMI writes with no + * worries. + */ + +const device_t sst_flash_49lf002_device = { + .name = "SST 49LF002 Firmware Hub", + .internal_name = "sst_flash_49lf002", + .flags = 0, + .local = SST | SST49LF002 | SIZE_2M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf020_device = { + .name = "SST 49LF020 Firmware Hub", + .internal_name = "sst_flash_49lf0020", + .flags = 0, + .local = SST | SST49LF020 | SIZE_2M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf020a_device = { + .name = "SST 49LF020A Firmware Hub", + .internal_name = "sst_flash_49lf0020a", + .flags = 0, + .local = SST | SST49LF020A | SIZE_2M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf003_device = { + .name = "SST 49LF003 Firmware Hub", + .internal_name = "sst_flash_49lf003", + .flags = 0, + .local = SST | SST49LF003 | SIZE_3M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf030_device = { + .name = "SST 49LF030 Firmware Hub", + .internal_name = "sst_flash_49lf030", + .flags = 0, + .local = SST | SST49LF030 | SIZE_3M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf004_device = { + .name = "SST 49LF004 Firmware Hub", + .internal_name = "sst_flash_49lf004", + .flags = 0, + .local = SST | SST49LF004 | SIZE_4M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf004c_device = { + .name = "SST 49LF004C Firmware Hub", + .internal_name = "sst_flash_49lf004c", + .flags = 0, + .local = SST | SST49LF004C | SIZE_4M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf040_device = { + .name = "SST 49LF040 Firmware Hub", + .internal_name = "sst_flash_49lf040", + .flags = 0, + .local = SST | SST49LF040 | SIZE_4M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf008_device = { + .name = "SST 49LF008 Firmware Hub", + .internal_name = "sst_flash_49lf008", + .flags = 0, + .local = SST | SST49LF008 | SIZE_8M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf008c_device = { + .name = "SST 49LF008C Firmware Hub", + .internal_name = "sst_flash_49lf008c", + .flags = 0, + .local = SST | SST49LF008C | SIZE_8M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf080_device = { + .name = "SST 49LF080 Firmware Hub", + .internal_name = "sst_flash_49lf080", + .flags = 0, + .local = SST | SST49LF080 | SIZE_8M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf016_device = { + .name = "SST 49LF016 Firmware Hub", + .internal_name = "sst_flash_49lf016", + .flags = 0, + .local = SST | SST49LF016 | SIZE_16M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t sst_flash_49lf160_device = { + + .name = "SST 49LF160 Firmware Hub", + .internal_name = "sst_flash_49lf160", + .flags = 0, + .local = SST | SST49LF160 | SIZE_16M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/minitrace/minitrace.c b/src/minitrace/minitrace.c index df68e7d79..0b2208605 100644 --- a/src/minitrace/minitrace.c +++ b/src/minitrace/minitrace.c @@ -1,6 +1,6 @@ // minitrace // Copyright 2014 by Henrik Rydgård -// http://www.github.com/hrydgard/minitrace +// https://www.github.com/hrydgard/minitrace // Released under the MIT license. // See minitrace.h for basic documentation. @@ -48,20 +48,20 @@ // Ugh, this struct is already pretty heavy. // Will probably need to move arguments to a second buffer to support more than one. typedef struct raw_event { - const char *name; - const char *cat; - void *id; - int64_t ts; - uint32_t pid; - uint32_t tid; - char ph; - mtr_arg_type arg_type; - const char *arg_name; - union { - const char *a_str; - int a_int; - double a_double; - }; + const char *name; + const char *cat; + void *id; + int64_t ts; + uint32_t pid; + uint32_t tid; + char ph; + mtr_arg_type arg_type; + const char *arg_name; + union { + const char *a_str; + int a_int; + double a_double; + }; } raw_event_t; static raw_event_t *event_buffer; @@ -74,7 +74,7 @@ static int events_in_progress = 0; static int64_t time_offset; static int first_line = 1; static FILE *f; -static __thread int cur_thread_id; // Thread local storage +static __thread int cur_thread_id; // Thread local storage static int cur_process_id; static pthread_mutex_t mutex; static pthread_mutex_t event_mutex; @@ -89,44 +89,44 @@ void mtr_flush_with_state(int); // Tiny portability layer. // Exposes: -// get_cur_thread_id() -// get_cur_process_id() -// mtr_time_s() -// pthread basics +// get_cur_thread_id() +// get_cur_process_id() +// mtr_time_s() +// pthread basics #ifdef _WIN32 static int get_cur_thread_id(void) { - return (int)GetCurrentThreadId(); + return (int)GetCurrentThreadId(); } static int get_cur_process_id(void) { - return (int)GetCurrentProcessId(); + return (int)GetCurrentProcessId(); } static uint64_t _frequency = 0; static uint64_t _starttime = 0; double mtr_time_s(void) { - if (_frequency == 0) { - QueryPerformanceFrequency((LARGE_INTEGER*)&_frequency); - QueryPerformanceCounter((LARGE_INTEGER*)&_starttime); - } - __int64 time; - QueryPerformanceCounter((LARGE_INTEGER*)&time); - return ((double) (time - _starttime) / (double) _frequency); + if (_frequency == 0) { + QueryPerformanceFrequency((LARGE_INTEGER*)&_frequency); + QueryPerformanceCounter((LARGE_INTEGER*)&_starttime); + } + __int64 time; + QueryPerformanceCounter((LARGE_INTEGER*)&time); + return ((double) (time - _starttime) / (double) _frequency); } // Ctrl+C handling for Windows console apps static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) { - if (atomic_load(&is_tracing) && fdwCtrlType == CTRL_C_EVENT) { - printf("Ctrl-C detected! Flushing trace and shutting down.\n\n"); - mtr_flush(); - mtr_shutdown(); - } - ExitProcess(1); + if (atomic_load(&is_tracing) && fdwCtrlType == CTRL_C_EVENT) { + printf("Ctrl-C detected! Flushing trace and shutting down.\n\n"); + mtr_flush(); + mtr_shutdown(); + } + ExitProcess(1); } void mtr_register_sigint_handler(void) { - // For console apps: - SetConsoleCtrlHandler(&CtrlHandler, TRUE); + // For console apps: + SetConsoleCtrlHandler(&CtrlHandler, TRUE); } HANDLE thread_handle; @@ -155,10 +155,10 @@ static void join_flushing_thread(void) { #else static inline int get_cur_thread_id(void) { - return (int)(intptr_t)pthread_self(); + return (int)(intptr_t)pthread_self(); } static inline int get_cur_process_id(void) { - return (int)getpid(); + return (int)getpid(); } static pthread_t thread_handle = 0; @@ -188,110 +188,110 @@ static void join_flushing_thread(void) { #if defined(BLACKBERRY) double mtr_time_s() { - struct timespec time; - clock_gettime(CLOCK_MONOTONIC, &time); // Linux must use CLOCK_MONOTONIC_RAW due to time warps - return time.tv_sec + time.tv_nsec / 1.0e9; + struct timespec time; + clock_gettime(CLOCK_MONOTONIC, &time); // Linux must use CLOCK_MONOTONIC_RAW due to time warps + return time.tv_sec + time.tv_nsec / 1.0e9; } #else double mtr_time_s(void) { - static time_t start; - struct timeval tv; - gettimeofday(&tv, NULL); - if (start == 0) { - start = tv.tv_sec; - } - tv.tv_sec -= start; - return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0; + static time_t start; + struct timeval tv; + gettimeofday(&tv, NULL); + if (start == 0) { + start = tv.tv_sec; + } + tv.tv_sec -= start; + return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0; } -#endif // !BLACKBERRY +#endif // !BLACKBERRY static void termination_handler(int signum) ATTR_NORETURN; static void termination_handler(int signum) { - (void) signum; - if (is_tracing) { - printf("Ctrl-C detected! Flushing trace and shutting down.\n\n"); - mtr_flush(); - fwrite("\n]}\n", 1, 4, f); - fclose(f); - } - exit(1); + (void) signum; + if (is_tracing) { + printf("Ctrl-C detected! Flushing trace and shutting down.\n\n"); + mtr_flush(); + fwrite("\n]}\n", 1, 4, f); + fclose(f); + } + exit(1); } void mtr_register_sigint_handler(void) { #ifndef MTR_ENABLED - return; + return; #endif - // Avoid altering set-to-be-ignored handlers while registering. - if (signal(SIGINT, &termination_handler) == SIG_IGN) - signal(SIGINT, SIG_IGN); + // Avoid altering set-to-be-ignored handlers while registering. + if (signal(SIGINT, &termination_handler) == SIG_IGN) + signal(SIGINT, SIG_IGN); } #endif void mtr_init_from_stream(void *stream) { #ifndef MTR_ENABLED - return; + return; #endif - event_buffer = (raw_event_t *)malloc(INTERNAL_MINITRACE_BUFFER_SIZE * sizeof(raw_event_t)); - flush_buffer = (raw_event_t *)malloc(INTERNAL_MINITRACE_BUFFER_SIZE * sizeof(raw_event_t)); - event_count = 0; - f = (FILE *)stream; - const char *header = "{\"traceEvents\":[\n"; - fwrite(header, 1, strlen(header), f); - time_offset = (uint64_t)(mtr_time_s() * 1000000); - first_line = 1; - pthread_mutex_init(&mutex, 0); - pthread_mutex_init(&event_mutex, 0); + event_buffer = (raw_event_t *)malloc(INTERNAL_MINITRACE_BUFFER_SIZE * sizeof(raw_event_t)); + flush_buffer = (raw_event_t *)malloc(INTERNAL_MINITRACE_BUFFER_SIZE * sizeof(raw_event_t)); + event_count = 0; + f = (FILE *)stream; + const char *header = "{\"traceEvents\":[\n"; + fwrite(header, 1, strlen(header), f); + time_offset = (uint64_t)(mtr_time_s() * 1000000); + first_line = 1; + pthread_mutex_init(&mutex, 0); + pthread_mutex_init(&event_mutex, 0); } void mtr_init(const char *json_file) { #ifndef MTR_ENABLED - return; + return; #endif - mtr_init_from_stream(fopen(json_file, "wb")); + mtr_init_from_stream(fopen(json_file, "wb")); } void mtr_shutdown(void) { - int i; + int i; #ifndef MTR_ENABLED - return; + return; #endif - mtr_flush_with_state(TRUE); + mtr_flush_with_state(TRUE); - fwrite("\n]}\n", 1, 4, f); - fclose(f); - pthread_mutex_destroy(&mutex); - pthread_mutex_destroy(&event_mutex); - f = 0; - free(event_buffer); - event_buffer = 0; - for (i = 0; i < STRING_POOL_SIZE; i++) { - if (str_pool[i]) { - free(str_pool[i]); - str_pool[i] = 0; - } - } + fwrite("\n]}\n", 1, 4, f); + fclose(f); + pthread_mutex_destroy(&mutex); + pthread_mutex_destroy(&event_mutex); + f = 0; + free(event_buffer); + event_buffer = 0; + for (i = 0; i < STRING_POOL_SIZE; i++) { + if (str_pool[i]) { + free(str_pool[i]); + str_pool[i] = 0; + } + } } const char *mtr_pool_string(const char *str) { - int i; - for (i = 0; i < STRING_POOL_SIZE; i++) { - if (!str_pool[i]) { - str_pool[i] = (char*)malloc(strlen(str) + 1); - strcpy(str_pool[i], str); - return str_pool[i]; - } else { - if (!strcmp(str, str_pool[i])) - return str_pool[i]; - } - } - return "string pool full"; + int i; + for (i = 0; i < STRING_POOL_SIZE; i++) { + if (!str_pool[i]) { + str_pool[i] = (char*)malloc(strlen(str) + 1); + strcpy(str_pool[i], str); + return str_pool[i]; + } else { + if (!strcmp(str, str_pool[i])) + return str_pool[i]; + } + } + return "string pool full"; } void mtr_start(void) { #ifndef MTR_ENABLED - return; + return; #endif #ifdef _WIN32 pthread_cond_init(&buffer_not_full_cond); @@ -301,19 +301,19 @@ void mtr_start(void) { pthread_cond_init(&buffer_full_cond, NULL); #endif atomic_store(&is_tracing, TRUE); - init_flushing_thread(); + init_flushing_thread(); } void mtr_stop(void) { #ifndef MTR_ENABLED - return; + return; #endif - atomic_store(&is_tracing, FALSE); - atomic_store(&stop_flushing_requested, TRUE); - pthread_cond_signal(&buffer_not_full_cond); - pthread_cond_signal(&buffer_full_cond); - join_flushing_thread(); - atomic_store(&stop_flushing_requested, FALSE); + atomic_store(&is_tracing, FALSE); + atomic_store(&stop_flushing_requested, TRUE); + pthread_cond_signal(&buffer_not_full_cond); + pthread_cond_signal(&buffer_full_cond); + join_flushing_thread(); + atomic_store(&stop_flushing_requested, FALSE); } // TODO: fwrite more than one line at a time. @@ -323,247 +323,248 @@ void mtr_stop(void) { // running at any point of time void mtr_flush_with_state(int is_last) { #ifndef MTR_ENABLED - return; + return; #endif - int i = 0; - char linebuf[1024]; - char arg_buf[1024]; - char id_buf[256]; - int event_count_copy = 0; - int events_in_progress_copy = 1; - raw_event_t *event_buffer_tmp = NULL; + int i = 0; + char linebuf[1024]; + char arg_buf[1024]; + char id_buf[256]; + int event_count_copy = 0; + int events_in_progress_copy = 1; + raw_event_t *event_buffer_tmp = NULL; - // small critical section to swap buffers - // - no any new events can be spawn while - // swapping since they tied to the same mutex - // - checks for any flushing in process - pthread_mutex_lock(&mutex); - // if not flushing already - if (is_flushing) { - pthread_mutex_unlock(&mutex); - return; - } - is_flushing = TRUE; - if(!is_last) { - while(event_count < INTERNAL_MINITRACE_BUFFER_SIZE && atomic_load(&is_tracing)) { - pthread_cond_wait(&buffer_full_cond, &mutex); - } - } - event_count_copy = event_count; - event_buffer_tmp = flush_buffer; - flush_buffer = event_buffer; - event_buffer = event_buffer_tmp; - event_count = 0; - // waiting for any unfinished events before swap - while (events_in_progress_copy != 0) { - pthread_mutex_lock(&event_mutex); - events_in_progress_copy = events_in_progress; - pthread_mutex_unlock(&event_mutex); - } - pthread_mutex_unlock(&mutex); - pthread_cond_signal(&buffer_not_full_cond); + // small critical section to swap buffers + // - no any new events can be spawn while + // swapping since they tied to the same mutex + // - checks for any flushing in process + pthread_mutex_lock(&mutex); + // if not flushing already + if (is_flushing) { + pthread_mutex_unlock(&mutex); + return; + } + is_flushing = TRUE; + if(!is_last) { + while(event_count < INTERNAL_MINITRACE_BUFFER_SIZE && atomic_load(&is_tracing)) { + pthread_cond_wait(&buffer_full_cond, &mutex); + } + } + event_count_copy = event_count; + event_buffer_tmp = flush_buffer; + flush_buffer = event_buffer; + event_buffer = event_buffer_tmp; + event_count = 0; + // waiting for any unfinished events before swap + while (events_in_progress_copy != 0) { + pthread_mutex_lock(&event_mutex); + events_in_progress_copy = events_in_progress; + pthread_mutex_unlock(&event_mutex); + } + pthread_mutex_unlock(&mutex); + pthread_cond_signal(&buffer_not_full_cond); - for (i = 0; i < event_count_copy; i++) { - raw_event_t *raw = &flush_buffer[i]; - int len; - switch (raw->arg_type) { - case MTR_ARG_TYPE_INT: - snprintf(arg_buf, ARRAY_SIZE(arg_buf), "\"%s\":%i", raw->arg_name, raw->a_int); - break; - case MTR_ARG_TYPE_STRING_CONST: - snprintf(arg_buf, ARRAY_SIZE(arg_buf), "\"%s\":\"%s\"", raw->arg_name, raw->a_str); - break; - case MTR_ARG_TYPE_STRING_COPY: - if (strlen(raw->a_str) > 700) { - snprintf(arg_buf, ARRAY_SIZE(arg_buf), "\"%s\":\"%.*s\"", raw->arg_name, 700, raw->a_str); - } else { - snprintf(arg_buf, ARRAY_SIZE(arg_buf), "\"%s\":\"%s\"", raw->arg_name, raw->a_str); - } - break; - case MTR_ARG_TYPE_NONE: - arg_buf[0] = '\0'; - break; - } - if (raw->id) { - switch (raw->ph) { - case 'S': - case 'T': - case 'F': - // TODO: Support full 64-bit pointers - snprintf(id_buf, ARRAY_SIZE(id_buf), ",\"id\":\"0x%08x\"", (uint32_t)(uintptr_t)raw->id); - break; - case 'X': - snprintf(id_buf, ARRAY_SIZE(id_buf), ",\"dur\":%i", (int)raw->a_double); - break; - } - } else { - id_buf[0] = 0; - } - const char *cat = raw->cat; + for (i = 0; i < event_count_copy; i++) { + raw_event_t *raw = &flush_buffer[i]; + int len; + switch (raw->arg_type) { + case MTR_ARG_TYPE_INT: + snprintf(arg_buf, ARRAY_SIZE(arg_buf), "\"%s\":%i", raw->arg_name, raw->a_int); + break; + case MTR_ARG_TYPE_STRING_CONST: + snprintf(arg_buf, ARRAY_SIZE(arg_buf), "\"%s\":\"%s\"", raw->arg_name, raw->a_str); + break; + case MTR_ARG_TYPE_STRING_COPY: + if (strlen(raw->a_str) > 700) { + snprintf(arg_buf, ARRAY_SIZE(arg_buf), "\"%s\":\"%.*s\"", raw->arg_name, 700, raw->a_str); + } else { + snprintf(arg_buf, ARRAY_SIZE(arg_buf), "\"%s\":\"%s\"", raw->arg_name, raw->a_str); + } + break; + case MTR_ARG_TYPE_NONE: + arg_buf[0] = '\0'; + break; + } + if (raw->id) { + switch (raw->ph) { + case 'S': + case 'T': + case 'F': + // TODO: Support full 64-bit pointers + snprintf(id_buf, ARRAY_SIZE(id_buf), ",\"id\":\"0x%08x\"", (uint32_t)(uintptr_t)raw->id); + break; + case 'X': + snprintf(id_buf, ARRAY_SIZE(id_buf), ",\"dur\":%i", (int)raw->a_double); + break; + } + } else { + id_buf[0] = 0; + } + const char *cat = raw->cat; #ifdef _WIN32 - // On Windows, we often end up with backslashes in category. - char temp[256]; - { - int len = (int)strlen(cat); - int i; - if (len > 255) len = 255; - for (i = 0; i < len; i++) { - temp[i] = cat[i] == '\\' ? '/' : cat[i]; - } - temp[len] = 0; - cat = temp; - } + // On Windows, we often end up with backslashes in category. + char temp[256]; + { + int len = (int)strlen(cat); + int i; + if (len > 255) len = 255; + for (i = 0; i < len; i++) { + temp[i] = cat[i] == '\\' ? '/' : cat[i]; + } + temp[len] = 0; + cat = temp; + } #endif - len = snprintf(linebuf, ARRAY_SIZE(linebuf), "%s{\"cat\":\"%s\",\"pid\":%i,\"tid\":%i,\"ts\":%" PRId64 ",\"ph\":\"%c\",\"name\":\"%s\",\"args\":{%s}%s}", - first_line ? "" : ",\n", - cat, raw->pid, raw->tid, raw->ts - time_offset, raw->ph, raw->name, arg_buf, id_buf); - fwrite(linebuf, 1, len, f); - first_line = 0; + len = snprintf(linebuf, ARRAY_SIZE(linebuf), "%s{\"cat\":\"%s\",\"pid\":%i,\"tid\":%i,\"ts\":%" PRId64 ",\"ph\":\"%c\",\"name\":\"%s\",\"args\":{%s}%s}", + first_line ? "" : ",\n", + cat, raw->pid, raw->tid, raw->ts - time_offset, raw->ph, raw->name, arg_buf, id_buf); + fwrite(linebuf, 1, len, f); + first_line = 0; - if (raw->arg_type == MTR_ARG_TYPE_STRING_COPY) { - free((void*)raw->a_str); - } - #ifdef MTR_COPY_EVENT_CATEGORY_AND_NAME - free(raw->name); - free(raw->cat); - #endif - } + if (raw->arg_type == MTR_ARG_TYPE_STRING_COPY) { + free((void*)raw->a_str); + } + #ifdef MTR_COPY_EVENT_CATEGORY_AND_NAME + free(raw->name); + free(raw->cat); + #endif + } - pthread_mutex_lock(&mutex); - is_flushing = is_last; - pthread_mutex_unlock(&mutex); + pthread_mutex_lock(&mutex); + is_flushing = is_last; + pthread_mutex_unlock(&mutex); } void mtr_flush(void) { - mtr_flush_with_state(FALSE); + mtr_flush_with_state(FALSE); } void internal_mtr_raw_event(const char *category, const char *name, char ph, void *id) { #ifndef MTR_ENABLED - return; + return; #endif - if (!atomic_load(&is_tracing)) { - return; - } - pthread_mutex_lock(&mutex); - while(event_count >= INTERNAL_MINITRACE_BUFFER_SIZE && atomic_load(&is_tracing)) { - pthread_cond_wait(&buffer_not_full_cond, &mutex); - } - raw_event_t *ev = &event_buffer[event_count]; - ++event_count; - pthread_mutex_lock(&event_mutex); - ++events_in_progress; - pthread_mutex_unlock(&event_mutex); - int local_event_count = event_count; - pthread_mutex_unlock(&mutex); - if(local_event_count >= INTERNAL_MINITRACE_BUFFER_SIZE) { - pthread_cond_signal(&buffer_full_cond); - } + if (!atomic_load(&is_tracing)) { + return; + } + pthread_mutex_lock(&mutex); + while(event_count >= INTERNAL_MINITRACE_BUFFER_SIZE && atomic_load(&is_tracing)) { + pthread_cond_wait(&buffer_not_full_cond, &mutex); - double ts = mtr_time_s(); + } + raw_event_t *ev = &event_buffer[event_count]; + ++event_count; + pthread_mutex_lock(&event_mutex); + ++events_in_progress; + pthread_mutex_unlock(&event_mutex); + int local_event_count = event_count; + pthread_mutex_unlock(&mutex); + if(local_event_count >= INTERNAL_MINITRACE_BUFFER_SIZE) { + pthread_cond_signal(&buffer_full_cond); + } - if (!cur_thread_id) { - cur_thread_id = get_cur_thread_id(); - } - if (!cur_process_id) { - cur_process_id = get_cur_process_id(); - } + double ts = mtr_time_s(); + + if (!cur_thread_id) { + cur_thread_id = get_cur_thread_id(); + } + if (!cur_process_id) { + cur_process_id = get_cur_process_id(); + } #ifdef MTR_COPY_EVENT_CATEGORY_AND_NAME - const size_t category_len = strlen(category); - ev->cat = malloc(category_len + 1); - strcpy(ev->cat, category); + const size_t category_len = strlen(category); + ev->cat = malloc(category_len + 1); + strcpy(ev->cat, category); - const size_t name_len = strlen(name); - ev->name = malloc(name_len + 1); - strcpy(ev->name, name); + const size_t name_len = strlen(name); + ev->name = malloc(name_len + 1); + strcpy(ev->name, name); #else - ev->cat = category; - ev->name = name; + ev->cat = category; + ev->name = name; #endif - ev->id = id; - ev->ph = ph; - if (ev->ph == 'X') { - double x; - memcpy(&x, id, sizeof(double)); - ev->ts = (int64_t)(x * 1000000); - ev->a_double = (ts - x) * 1000000; - } else { - ev->ts = (int64_t)(ts * 1000000); - } - ev->tid = cur_thread_id; - ev->pid = cur_process_id; - ev->arg_type = MTR_ARG_TYPE_NONE; + ev->id = id; + ev->ph = ph; + if (ev->ph == 'X') { + double x; + memcpy(&x, id, sizeof(double)); + ev->ts = (int64_t)(x * 1000000); + ev->a_double = (ts - x) * 1000000; + } else { + ev->ts = (int64_t)(ts * 1000000); + } + ev->tid = cur_thread_id; + ev->pid = cur_process_id; + ev->arg_type = MTR_ARG_TYPE_NONE; - pthread_mutex_lock(&event_mutex); - --events_in_progress; - pthread_mutex_unlock(&event_mutex); + pthread_mutex_lock(&event_mutex); + --events_in_progress; + pthread_mutex_unlock(&event_mutex); } void internal_mtr_raw_event_arg(const char *category, const char *name, char ph, void *id, mtr_arg_type arg_type, const char *arg_name, void *arg_value) { #ifndef MTR_ENABLED - return; + return; #endif - if (!atomic_load(&is_tracing)) { - return; - } - pthread_mutex_lock(&mutex); - while(event_count >= INTERNAL_MINITRACE_BUFFER_SIZE && atomic_load(&is_tracing)) { - pthread_cond_wait(&buffer_not_full_cond, &mutex); - } - raw_event_t *ev = &event_buffer[event_count]; - ++event_count; - pthread_mutex_lock(&event_mutex); - ++events_in_progress; - pthread_mutex_unlock(&event_mutex); - int local_event_count = event_count; - pthread_mutex_unlock(&mutex); - if(local_event_count >= INTERNAL_MINITRACE_BUFFER_SIZE) { - pthread_cond_signal(&buffer_full_cond); - } + if (!atomic_load(&is_tracing)) { + return; + } + pthread_mutex_lock(&mutex); + while(event_count >= INTERNAL_MINITRACE_BUFFER_SIZE && atomic_load(&is_tracing)) { + pthread_cond_wait(&buffer_not_full_cond, &mutex); + } + raw_event_t *ev = &event_buffer[event_count]; + ++event_count; + pthread_mutex_lock(&event_mutex); + ++events_in_progress; + pthread_mutex_unlock(&event_mutex); + int local_event_count = event_count; + pthread_mutex_unlock(&mutex); + if(local_event_count >= INTERNAL_MINITRACE_BUFFER_SIZE) { + pthread_cond_signal(&buffer_full_cond); + } - if (!cur_thread_id) { - cur_thread_id = get_cur_thread_id(); - } - if (!cur_process_id) { - cur_process_id = get_cur_process_id(); - } - double ts = mtr_time_s(); + if (!cur_thread_id) { + cur_thread_id = get_cur_thread_id(); + } + if (!cur_process_id) { + cur_process_id = get_cur_process_id(); + } + double ts = mtr_time_s(); #ifdef MTR_COPY_EVENT_CATEGORY_AND_NAME - const size_t category_len = strlen(category); - ev->cat = malloc(category_len + 1); - strcpy(ev->cat, category); + const size_t category_len = strlen(category); + ev->cat = malloc(category_len + 1); + strcpy(ev->cat, category); - const size_t name_len = strlen(name); - ev->name = malloc(name_len + 1); - strcpy(ev->name, name); + const size_t name_len = strlen(name); + ev->name = malloc(name_len + 1); + strcpy(ev->name, name); #else - ev->cat = category; - ev->name = name; + ev->cat = category; + ev->name = name; #endif - ev->id = id; - ev->ts = (int64_t)(ts * 1000000); - ev->ph = ph; - ev->tid = cur_thread_id; - ev->pid = cur_process_id; - ev->arg_type = arg_type; - ev->arg_name = arg_name; - switch (arg_type) { - case MTR_ARG_TYPE_INT: ev->a_int = (int)(uintptr_t)arg_value; break; - case MTR_ARG_TYPE_STRING_CONST: ev->a_str = (const char*)arg_value; break; - case MTR_ARG_TYPE_STRING_COPY: ev->a_str = strdup((const char*)arg_value); break; - case MTR_ARG_TYPE_NONE: break; - } + ev->id = id; + ev->ts = (int64_t)(ts * 1000000); + ev->ph = ph; + ev->tid = cur_thread_id; + ev->pid = cur_process_id; + ev->arg_type = arg_type; + ev->arg_name = arg_name; + switch (arg_type) { + case MTR_ARG_TYPE_INT: ev->a_int = (int)(uintptr_t)arg_value; break; + case MTR_ARG_TYPE_STRING_CONST: ev->a_str = (const char*)arg_value; break; + case MTR_ARG_TYPE_STRING_COPY: ev->a_str = strdup((const char*)arg_value); break; + case MTR_ARG_TYPE_NONE: break; + } - pthread_mutex_lock(&event_mutex); - --events_in_progress; - pthread_mutex_unlock(&event_mutex); + pthread_mutex_lock(&event_mutex); + --events_in_progress; + pthread_mutex_unlock(&event_mutex); } diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index dc03cb417..e14f979d3 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(net OBJECT network.c net_pcap.c net_slirp.c net_dp8390.c net_3c501.c diff --git a/src/network/net_3c501.c b/src/network/net_3c501.c index 19ad587c2..736edb85b 100644 --- a/src/network/net_3c501.c +++ b/src/network/net_3c501.c @@ -1,22 +1,23 @@ /* - * 86Box An emulator of (mostly) x86-based PC systems and devices, - * using the ISA, EISA, VLB, MCA, and PCI system buses, - * roughly spanning the era between 1981 and 1995. + * 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 Project. + * This file is part of the 86Box distribution. * - * Implementation of the following network controller: - * - 3Com Etherlink 3c500/3c501 (ISA 8-bit). + * Implementation of the following network controller: + * - 3Com Etherlink 3c500/3c501 (ISA 8-bit). * * * - * Based on @(#)Dev3C501.cpp Oracle (VirtualBox) + * Based on @(#)Dev3C501.cpp Oracle (VirtualBox) * - * Authors: TheCollector1995, - * Oracle + * Authors: TheCollector1995, + * Oracle * - * Copyright 2022 TheCollector1995. - * Portions Copyright (C) 2022 Oracle and/or its affilitates. + * Copyright 2022 TheCollector1995. + * Portions Copyright (C) 2022 Oracle and/or its affilitates. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/network/net_3c503.c b/src/network/net_3c503.c index 07dcc1a43..9e4f9c12b 100644 --- a/src/network/net_3c503.c +++ b/src/network/net_3c503.c @@ -1,9 +1,10 @@ /* - * 86Box An emulator of (mostly) x86-based PC systems and devices, - * using the ISA, EISA, VLB, MCA, and PCI system buses, - * roughly spanning the era between 1981 and 1995. + * 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 Project. + * This file is part of the 86Box distribution. * * Implementation of the following network controllers: * - 3Com Etherlink II 3c503 (ISA 8-bit). diff --git a/src/network/net_dp8390.c b/src/network/net_dp8390.c index 255749e4e..3b54fdb9d 100644 --- a/src/network/net_dp8390.c +++ b/src/network/net_dp8390.c @@ -44,11 +44,11 @@ dp8390_log(const char *fmt, ...) { va_list ap; - // if (dp8390_do_log >= lvl) { +// if (dp8390_do_log >= lvl) { va_start(ap, fmt); pclog_ex(fmt, ap); va_end(ap); - // } +// } } #else # define dp8390_log(lvl, fmt, ...) diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 66681206b..9a598538d 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -22,7 +22,7 @@ * Miran Grca, * Peter Grehan, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * Copyright 2016-2018 Miran Grca. * Portions Copyright (C) 2002 MandrakeSoft S.A. * diff --git a/src/network/net_slirp.c b/src/network/net_slirp.c index 35dfb52bb..7651464a2 100644 --- a/src/network/net_slirp.c +++ b/src/network/net_slirp.c @@ -493,15 +493,11 @@ const netdrv_t net_slirp_drv = { /* Stubs to stand in for the parts of libslirp we skip compiling. */ void ncsi_input(void *slirp, const uint8_t *pkt, int pkt_len) {} void ip6_init(void *slirp) {} -void ip6_cleanup(void *slirp) {} -void ip6_input(void *m) {} -int ip6_output(void *so, void *m, int fast) { return 0; } void in6_compute_ethaddr(struct in6_addr ip, uint8_t *eth) {} bool in6_equal(const void *a, const void *b) { return 0; } const struct in6_addr in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }; const struct in6_addr in6addr_loopback = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }; -int udp6_output(void *so, void *m, void *saddr, void *daddr) { return 0; } -void icmp6_send_error(void *m, uint8_t type, uint8_t code) {} -void ndp_send_ns(void *slirp, struct in6_addr addr) {} +void ndp_table_add(Slirp *slirp, struct in6_addr ip_addr, + uint8_t ethaddr[6]) {} /* IPv6 */ bool ndp_table_search(void *slirp, struct in6_addr ip_addr, uint8_t *out_ethaddr) { return 0; } void tftp_input(void *srcsas, void *m) {} diff --git a/src/network/pcap_if.c b/src/network/pcap_if.c index 69110cb34..56fa3eaf1 100644 --- a/src/network/pcap_if.c +++ b/src/network/pcap_if.c @@ -12,7 +12,7 @@ * * Authors: Fred N. van Kempen, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the diff --git a/src/network/slirp/CMakeLists.txt b/src/network/slirp/CMakeLists.txt index a2c82e642..60993ad84 100644 --- a/src/network/slirp/CMakeLists.txt +++ b/src/network/slirp/CMakeLists.txt @@ -10,20 +10,25 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # -add_library(slirp STATIC arp_table.c bootp.c cksum.c dnssearch.c if.c +add_library(slirp STATIC arp_table.c bootp.c cksum.c dhcpv6.c dnssearch.c if.c ip_icmp.c ip_input.c ip_output.c + ip6_icmp.c ip6_input.c ip6_output.c mbuf.c misc.c sbuf.c slirp.c socket.c tcp_input.c tcp_output.c tcp_subr.c tcp_timer.c - udp.c + udp.c udp6.c util.c version.c) if(WIN32) target_link_libraries(slirp wsock32 iphlpapi) endif() +if(APPLE) + target_link_libraries(slirp resolv) +endif() + # tinyglib conflicts with the real GLib used by Qt, let's just be safe if(QT AND UNIX AND NOT APPLE) set(SLIRP_TINYGLIB OFF) diff --git a/src/network/slirp/arp_table.c b/src/network/slirp/arp_table.c index 959e5b9ec..d0c9111d6 100644 --- a/src/network/slirp/arp_table.c +++ b/src/network/slirp/arp_table.c @@ -34,11 +34,16 @@ void arp_table_add(Slirp *slirp, uint32_t ip_addr, ~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr; ArpTable *arptbl = &slirp->arp_table; int i; +/* + char ethaddr_str[ETH_ADDRSTRLEN]; + char addr[INET_ADDRSTRLEN]; DEBUG_CALL("arp_table_add"); - DEBUG_ARG("ip = %s", inet_ntoa((struct in_addr){ .s_addr = ip_addr })); - DEBUG_ARG("hw addr = %02x:%02x:%02x:%02x:%02x:%02x", ethaddr[0], ethaddr[1], - ethaddr[2], ethaddr[3], ethaddr[4], ethaddr[5]); + DEBUG_ARG("ip = %s", inet_ntop(AF_INET, &(struct in_addr){ .s_addr = ip_addr }, + addr, sizeof(addr))); + DEBUG_ARG("hw addr = %s", slirp_ether_ntoa(ethaddr, ethaddr_str, + sizeof(ethaddr_str))); +*/ if (ip_addr == 0 || ip_addr == 0xffffffff || ip_addr == broadcast_addr) { /* Do not register broadcast addresses */ @@ -67,9 +72,14 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, ~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr; ArpTable *arptbl = &slirp->arp_table; int i; +/* + char ethaddr_str[ETH_ADDRSTRLEN]; + char addr[INET_ADDRSTRLEN]; DEBUG_CALL("arp_table_search"); - DEBUG_ARG("ip = %s", inet_ntoa((struct in_addr){ .s_addr = ip_addr })); + DEBUG_ARG("ip = %s", inet_ntop(AF_INET, &(struct in_addr){ .s_addr = ip_addr }, + addr, sizeof(addr))); +*/ /* If broadcast address */ if (ip_addr == 0 || ip_addr == 0xffffffff || ip_addr == broadcast_addr) { @@ -81,9 +91,11 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, for (i = 0; i < ARP_TABLE_SIZE; i++) { if (arptbl->table[i].ar_sip == ip_addr) { memcpy(out_ethaddr, arptbl->table[i].ar_sha, ETH_ALEN); - DEBUG_ARG("found hw addr = %02x:%02x:%02x:%02x:%02x:%02x", - out_ethaddr[0], out_ethaddr[1], out_ethaddr[2], - out_ethaddr[3], out_ethaddr[4], out_ethaddr[5]); +/* + DEBUG_ARG("found hw addr = %s", + slirp_ether_ntoa(out_ethaddr, ethaddr_str, + sizeof(ethaddr_str))); +*/ return 1; } } diff --git a/src/network/slirp/bootp.c b/src/network/slirp/bootp.c index 46e96810a..a0eb17a9d 100644 --- a/src/network/slirp/bootp.c +++ b/src/network/slirp/bootp.c @@ -34,6 +34,8 @@ #define LEASE_TIME (24 * 3600) +#define UEFI_HTTP_VENDOR_CLASS_ID "HTTPClient" + static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE }; #define DPRINTF(fmt, ...) DEBUG_CALL(fmt, ##__VA_ARGS__) @@ -92,21 +94,22 @@ found: return bc; } -static void dhcp_decode(const struct bootp_t *bp, int *pmsg_type, +static void dhcp_decode(const struct bootp_t *bp, + const uint8_t *bp_end, + int *pmsg_type, struct in_addr *preq_addr) { - const uint8_t *p, *p_end; + const uint8_t *p; int len, tag; *pmsg_type = 0; preq_addr->s_addr = htonl(0L); p = bp->bp_vend; - p_end = p + DHCP_OPT_LEN; if (memcmp(p, rfc1533_cookie, 4) != 0) return; p += 4; - while (p < p_end) { + while (p < bp_end) { tag = p[0]; if (tag == RFC1533_PAD) { p++; @@ -114,10 +117,10 @@ static void dhcp_decode(const struct bootp_t *bp, int *pmsg_type, break; } else { p++; - if (p >= p_end) + if (p >= bp_end) break; len = *p++; - if (p + len > p_end) { + if (p + len > bp_end) { break; } DPRINTF("dhcp: tag=%d len=%d\n", tag, len); @@ -144,7 +147,9 @@ static void dhcp_decode(const struct bootp_t *bp, int *pmsg_type, } } -static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) +static void bootp_reply(Slirp *slirp, + const struct bootp_t *bp, + const uint8_t *bp_end) { BOOTPClient *bc = NULL; struct mbuf *m; @@ -157,7 +162,7 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) uint8_t client_ethaddr[ETH_ALEN]; /* extract exact DHCP msg type */ - dhcp_decode(bp, &dhcp_msg_type, &preq_addr); + dhcp_decode(bp, bp_end, &dhcp_msg_type, &preq_addr); DPRINTF("bootp packet op=%d msgtype=%d", bp->bp_op, dhcp_msg_type); if (preq_addr.s_addr != htonl(0L)) DPRINTF(" req_addr=%08" PRIx32 "\n", ntohl(preq_addr.s_addr)); @@ -179,9 +184,10 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) return; } m->m_data += IF_MAXLINKHDR; + m_inc(m, sizeof(struct bootp_t) + DHCP_OPT_LEN); rbp = (struct bootp_t *)m->m_data; m->m_data += sizeof(struct udpiphdr); - memset(rbp, 0, sizeof(struct bootp_t)); + memset(rbp, 0, sizeof(struct bootp_t) + DHCP_OPT_LEN); if (dhcp_msg_type == DHCPDISCOVER) { if (preq_addr.s_addr != htonl(0L)) { @@ -235,7 +241,7 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) rbp->bp_siaddr = saddr.sin_addr; /* Server IP address */ q = rbp->bp_vend; - end = (uint8_t *)&rbp[1]; + end = rbp->bp_vend + DHCP_OPT_LEN; memcpy(q, rfc1533_cookie, 4); q += 4; @@ -336,6 +342,27 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) q += val; } } + + /* this allows to support UEFI HTTP boot: according to the UEFI + specification, DHCP server must send vendor class identifier option + set to "HTTPClient" string, when responding to DHCP requests as part + of the UEFI HTTP boot + + we assume that, if the bootfile parameter was configured as an http + URL, the user intends to perform UEFI HTTP boot, so send this option + automatically */ + if (slirp->bootp_filename && g_str_has_prefix(slirp->bootp_filename, "http://")) { + val = strlen(UEFI_HTTP_VENDOR_CLASS_ID); + if (q + val + 2 >= end) { + g_warning("DHCP packet size exceeded, " + "omitting vendor class id option."); + } else { + *q++ = RFC2132_VENDOR_CLASS_ID; + *q++ = val; + memcpy(q, UEFI_HTTP_VENDOR_CLASS_ID, val); + q += val; + } + } } else { static const char nak_msg[] = "requested address not available"; @@ -351,19 +378,21 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) q += sizeof(nak_msg) - 1; } assert(q < end); - *q = RFC1533_END; + *q++ = RFC1533_END; daddr.sin_addr.s_addr = 0xffffffffu; - m->m_len = sizeof(struct bootp_t) - sizeof(struct ip) - sizeof(struct udphdr); + assert(q <= end); + + m->m_len = sizeof(struct bootp_t) + (end - rbp->bp_vend) - sizeof(struct ip) - sizeof(struct udphdr); udp_output(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY); } void bootp_input(struct mbuf *m) { - struct bootp_t *bp = mtod(m, struct bootp_t *); + struct bootp_t *bp = mtod_check(m, sizeof(struct bootp_t)); - if (bp->bp_op == BOOTP_REQUEST) { - bootp_reply(m->slirp, bp); + if (!m->slirp->disable_dhcp && bp && bp->bp_op == BOOTP_REQUEST) { + bootp_reply(m->slirp, bp, m_end(m)); } } diff --git a/src/network/slirp/bootp.h b/src/network/slirp/bootp.h index a57fa51bc..cf7797fac 100644 --- a/src/network/slirp/bootp.h +++ b/src/network/slirp/bootp.h @@ -71,6 +71,7 @@ #define RFC2132_MAX_SIZE 57 #define RFC2132_RENEWAL_TIME 58 #define RFC2132_REBIND_TIME 59 +#define RFC2132_VENDOR_CLASS_ID 60 #define RFC2132_TFTP_SERVER_NAME 66 #define DHCPDISCOVER 1 @@ -114,7 +115,7 @@ struct bootp_t { uint8_t bp_hwaddr[16]; uint8_t bp_sname[64]; char bp_file[128]; - uint8_t bp_vend[DHCP_OPT_LEN]; + uint8_t bp_vend[]; }; typedef struct { diff --git a/src/network/slirp/cksum.c b/src/network/slirp/cksum.c index 4d08380a4..b1cb97b7e 100644 --- a/src/network/slirp/cksum.c +++ b/src/network/slirp/cksum.c @@ -47,7 +47,7 @@ { \ l_util.l = sum; \ sum = l_util.s[0] + l_util.s[1]; \ - (void)ADDCARRY(sum); \ + ADDCARRY(sum); \ } int cksum(struct mbuf *m, int len) diff --git a/src/network/slirp/debug.h b/src/network/slirp/debug.h index 47712bd78..0f9f3eff3 100644 --- a/src/network/slirp/debug.h +++ b/src/network/slirp/debug.h @@ -10,6 +10,7 @@ #define DBG_MISC (1 << 1) #define DBG_ERROR (1 << 2) #define DBG_TFTP (1 << 3) +#define DBG_VERBOSE_CALL (1 << 4) extern int slirp_debug; @@ -20,6 +21,13 @@ extern int slirp_debug; } \ } while (0) +#define DEBUG_VERBOSE_CALL(fmt, ...) \ + do { \ + if (G_UNLIKELY(slirp_debug & DBG_VERBOSE_CALL)) { \ + g_debug(fmt "...", ##__VA_ARGS__); \ + } \ + } while (0) + #define DEBUG_ARG(fmt, ...) \ do { \ if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \ diff --git a/src/network/slirp/if.c b/src/network/slirp/if.c index 23190b559..741473dc4 100644 --- a/src/network/slirp/if.c +++ b/src/network/slirp/if.c @@ -41,6 +41,8 @@ void if_init(Slirp *slirp) void if_output(struct socket *so, struct mbuf *ifm) { Slirp *slirp = ifm->slirp; + M_DUP_DEBUG(slirp, ifm, 0, 0); + struct mbuf *ifq; int on_fastq = 1; @@ -54,7 +56,7 @@ void if_output(struct socket *so, struct mbuf *ifm) * XXX Shouldn't need this, gotta change dtom() etc. */ if (ifm->m_flags & M_USEDLIST) { - remque(ifm); + slirp_remque(ifm); ifm->m_flags &= ~M_USEDLIST; } @@ -68,7 +70,8 @@ void if_output(struct socket *so, struct mbuf *ifm) */ if (so) { for (ifq = (struct mbuf *)slirp->if_batchq.qh_rlink; - (struct quehead *)ifq != &slirp->if_batchq; ifq = ifq->ifq_prev) { + (struct slirp_quehead *)ifq != &slirp->if_batchq; + ifq = ifq->ifq_prev) { if (so == ifq->ifq_so) { /* A match! */ ifm->ifq_so = so; @@ -98,7 +101,7 @@ void if_output(struct socket *so, struct mbuf *ifm) /* Create a new doubly linked list for this session */ ifm->ifq_so = so; ifs_init(ifm); - insque(ifm, ifq); + slirp_insque(ifm, ifq); diddit: if (so) { @@ -115,10 +118,10 @@ diddit: if (on_fastq && ((so->so_nqueued >= 6) && (so->so_nqueued - so->so_queued) >= 3)) { /* Remove from current queue... */ - remque(ifm->ifs_next); + slirp_remque(ifm->ifs_next); /* ...And insert in the new. That'll teach ya! */ - insque(ifm->ifs_next, &slirp->if_batchq); + slirp_insque(ifm->ifs_next, &slirp->if_batchq); } } @@ -143,7 +146,7 @@ void if_start(Slirp *slirp) bool from_batchq = false; struct mbuf *ifm, *ifm_next, *ifqt; - DEBUG_CALL("if_start"); + DEBUG_VERBOSE_CALL("if_start"); if (slirp->if_start_busy) { return; @@ -169,12 +172,12 @@ void if_start(Slirp *slirp) ifm = ifm_next; ifm_next = ifm->ifq_next; - if ((struct quehead *)ifm_next == &slirp->if_fastq) { + if ((struct slirp_quehead *)ifm_next == &slirp->if_fastq) { /* No more packets in fastq, switch to batchq */ ifm_next = batch_head; from_batchq = true; } - if ((struct quehead *)ifm_next == &slirp->if_batchq) { + if ((struct slirp_quehead *)ifm_next == &slirp->if_batchq) { /* end of batchq */ ifm_next = NULL; } @@ -187,13 +190,13 @@ void if_start(Slirp *slirp) /* Remove it from the queue */ ifqt = ifm->ifq_prev; - remque(ifm); + slirp_remque(ifm); /* If there are more packets for this session, re-queue them */ if (ifm->ifs_next != ifm) { struct mbuf *next = ifm->ifs_next; - insque(next, ifqt); + slirp_insque(next, ifqt); ifs_remque(ifm); if (!from_batchq) { ifm_next = next; diff --git a/src/network/slirp/ip.h b/src/network/slirp/ip.h index fba3defa1..c4203f635 100644 --- a/src/network/slirp/ip.h +++ b/src/network/slirp/ip.h @@ -75,7 +75,7 @@ typedef uint32_t n_long; /* long as received from the net */ #pragma pack(push, 1) #endif struct ip { -#if G_BYTE_ORDER == G_BIG_ENDIAN +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) uint8_t ip_v : 4, /* version */ ip_hl : 4; /* header length */ #else @@ -147,7 +147,7 @@ struct ip_timestamp { uint8_t ipt_code; /* IPOPT_TS */ uint8_t ipt_len; /* size of structure (variable) */ uint8_t ipt_ptr; /* index of current entry */ -#if G_BYTE_ORDER == G_BIG_ENDIAN +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) uint8_t ipt_oflw : 4, /* overflow counter */ ipt_flg : 4; /* flags, see below */ #else @@ -190,22 +190,28 @@ struct ip_timestamp { #define IP_MSS 576 /* default maximum segment size */ +#if GLIB_SIZEOF_VOID_P == 4 #if defined(_MSC_VER) && !defined (__clang__) #pragma pack(push, 1) #endif -#if GLIB_SIZEOF_VOID_P == 4 struct mbuf_ptr { struct mbuf *mptr; uint32_t dummy; } SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif #else +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct mbuf_ptr { struct mbuf *mptr; } SLIRP_PACKED; -#endif #if defined(_MSC_VER) && !defined (__clang__) #pragma pack(pop) #endif +#endif struct qlink { void *next, *prev; }; diff --git a/src/network/slirp/ip6.h b/src/network/slirp/ip6.h index 7210964d4..73a00b114 100644 --- a/src/network/slirp/ip6.h +++ b/src/network/slirp/ip6.h @@ -176,7 +176,7 @@ static inline void in6_compute_ethaddr(struct in6_addr ip, * Structure of an internet header, naked of options. */ struct ip6 { -#if G_BYTE_ORDER == G_BIG_ENDIAN +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) uint32_t ip_v : 4, /* version */ ip_tc_hi : 4, /* traffic class */ ip_tc_lo : 4, ip_fl_hi : 4, /* flow label */ diff --git a/src/network/slirp/ip6_icmp.c b/src/network/slirp/ip6_icmp.c index d9c872bc9..0d7ee69ca 100644 --- a/src/network/slirp/ip6_icmp.c +++ b/src/network/slirp/ip6_icmp.c @@ -10,25 +10,14 @@ #define NDP_Interval \ g_rand_int_range(slirp->grand, NDP_MinRtrAdvInterval, NDP_MaxRtrAdvInterval) -static void ra_timer_handler(void *opaque) -{ - Slirp *slirp = opaque; - - slirp->cb->timer_mod(slirp->ra_timer, - slirp->cb->clock_get_ns(slirp->opaque) / SCALE_MS + - NDP_Interval, - slirp->opaque); - ndp_send_ra(slirp); -} - -void icmp6_init(Slirp *slirp) +void icmp6_post_init(Slirp *slirp) { if (!slirp->in6_enabled) { return; } slirp->ra_timer = - slirp->cb->timer_new(ra_timer_handler, slirp, slirp->opaque); + slirp_timer_new(slirp, SLIRP_TIMER_RA, NULL); slirp->cb->timer_mod(slirp->ra_timer, slirp->cb->clock_get_ns(slirp->opaque) / SCALE_MS + NDP_Interval, @@ -69,7 +58,7 @@ static void icmp6_send_echoreply(struct mbuf *m, Slirp *slirp, struct ip6 *ip, ip6_output(NULL, t, 0); } -void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code) +void icmp6_forward_error(struct mbuf *m, uint8_t type, uint8_t code, struct in6_addr *src) { Slirp *slirp = m->slirp; struct mbuf *t; @@ -88,7 +77,7 @@ void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code) /* IPv6 packet */ struct ip6 *rip = mtod(t, struct ip6 *); - rip->ip_src = (struct in6_addr)LINKLOCAL_ADDR; + rip->ip_src = *src; rip->ip_dst = ip->ip_src; inet_ntop(AF_INET6, &rip->ip_dst, addrstr, INET6_ADDRSTRLEN); DEBUG_ARG("target = %s", addrstr); @@ -131,10 +120,16 @@ void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code) ip6_output(NULL, t, 0); } +void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code) +{ + struct in6_addr src = LINKLOCAL_ADDR; + icmp6_forward_error(m, type, code, &src); +} + /* * Send NDP Router Advertisement */ -void ndp_send_ra(Slirp *slirp) +static void ndp_send_ra(Slirp *slirp) { DEBUG_CALL("ndp_send_ra"); @@ -213,6 +208,15 @@ void ndp_send_ra(Slirp *slirp) ip6_output(NULL, t, 0); } +void ra_timer_handler(Slirp *slirp, void *unused) +{ + slirp->cb->timer_mod(slirp->ra_timer, + slirp->cb->clock_get_ns(slirp->opaque) / SCALE_MS + + NDP_Interval, + slirp->opaque); + ndp_send_ra(slirp); +} + /* * Send NDP Neighbor Solitication */ @@ -315,6 +319,8 @@ static void ndp_send_na(Slirp *slirp, struct ip6 *ip, struct icmp6 *icmp) static void ndp_input(struct mbuf *m, Slirp *slirp, struct ip6 *ip, struct icmp6 *icmp) { + g_assert(M_ROOMBEFORE(m) >= ETH_HLEN); + m->m_len += ETH_HLEN; m->m_data -= ETH_HLEN; struct ethhdr *eth = mtod(m, struct ethhdr *); @@ -377,9 +383,12 @@ static void ndp_input(struct mbuf *m, Slirp *slirp, struct ip6 *ip, */ void icmp6_input(struct mbuf *m) { + Slirp *slirp = m->slirp; + /* NDP reads the ethernet header for gratuitous NDP */ + M_DUP_DEBUG(slirp, m, 1, ETH_HLEN); + struct icmp6 *icmp; struct ip6 *ip = mtod(m, struct ip6 *); - Slirp *slirp = m->slirp; int hlen = sizeof(struct ip6); DEBUG_CALL("icmp6_input"); diff --git a/src/network/slirp/ip6_icmp.h b/src/network/slirp/ip6_icmp.h index 77772a76b..02761b726 100644 --- a/src/network/slirp/ip6_icmp.h +++ b/src/network/slirp/ip6_icmp.h @@ -35,7 +35,7 @@ struct ndp_rs { /* Router Solicitation Message */ struct ndp_ra { /* Router Advertisement Message */ uint8_t chl; /* Cur Hop Limit */ -#if G_BYTE_ORDER == G_BIG_ENDIAN +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) uint8_t M : 1, O : 1, reserved : 6; #else uint8_t reserved : 6, O : 1, M : 1; @@ -55,7 +55,7 @@ struct ndp_ns { /* Neighbor Solicitation Message */ G_STATIC_ASSERT(sizeof(struct ndp_ns) == 20); struct ndp_na { /* Neighbor Advertisement Message */ -#if G_BYTE_ORDER == G_BIG_ENDIAN +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) uint32_t R : 1, /* Router Flag */ S : 1, /* Solicited Flag */ O : 1, /* Override Flag */ @@ -124,9 +124,12 @@ struct ndpopt { union { unsigned char linklayer_addr[6]; /* Source/Target Link-layer */ #define ndpopt_linklayer ndpopt_body.linklayer_addr +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct prefixinfo { /* Prefix Information */ uint8_t prefix_length; -#if G_BYTE_ORDER == G_BIG_ENDIAN +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) uint8_t L : 1, A : 1, reserved1 : 6; #else uint8_t reserved1 : 6, A : 1, L : 1; @@ -136,12 +139,21 @@ struct ndpopt { uint32_t reserved2; struct in6_addr prefix; } SLIRP_PACKED prefixinfo; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif #define ndpopt_prefixinfo ndpopt_body.prefixinfo +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct rdnss { uint16_t reserved; uint32_t lifetime; struct in6_addr addr; } SLIRP_PACKED rdnss; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif #define ndpopt_rdnss ndpopt_body.rdnss } ndpopt_body; } SLIRP_PACKED; @@ -215,11 +227,12 @@ struct ndpopt { #define NDP_AdvPrefLifetime 14400 #define NDP_AdvAutonomousFlag 1 -void icmp6_init(Slirp *slirp); +void icmp6_post_init(Slirp *slirp); void icmp6_cleanup(Slirp *slirp); void icmp6_input(struct mbuf *); +void icmp6_forward_error(struct mbuf *m, uint8_t type, uint8_t code, struct in6_addr *src); void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code); -void ndp_send_ra(Slirp *slirp); void ndp_send_ns(Slirp *slirp, struct in6_addr addr); +void ra_timer_handler(Slirp *slirp, void *unused); #endif diff --git a/src/network/slirp/ip6_input.c b/src/network/slirp/ip6_input.c index a83e4f8e3..4aca08285 100644 --- a/src/network/slirp/ip6_input.c +++ b/src/network/slirp/ip6_input.c @@ -11,9 +11,9 @@ * IP initialization: fill in IP protocol switch table. * All protocols not implemented in kernel go to raw IP protocol handler. */ -void ip6_init(Slirp *slirp) +void ip6_post_init(Slirp *slirp) { - icmp6_init(slirp); + icmp6_post_init(slirp); } void ip6_cleanup(Slirp *slirp) @@ -23,8 +23,11 @@ void ip6_cleanup(Slirp *slirp) void ip6_input(struct mbuf *m) { - struct ip6 *ip6; Slirp *slirp = m->slirp; + /* NDP reads the ethernet header for gratuitous NDP */ + M_DUP_DEBUG(slirp, m, 1, TCPIPHDR_DELTA + 2 + ETH_HLEN); + + struct ip6 *ip6; if (!slirp->in6_enabled) { goto bad; diff --git a/src/network/slirp/ip6_output.c b/src/network/slirp/ip6_output.c index b86110662..834f1c0a3 100644 --- a/src/network/slirp/ip6_output.c +++ b/src/network/slirp/ip6_output.c @@ -15,6 +15,9 @@ */ int ip6_output(struct socket *so, struct mbuf *m, int fast) { + Slirp *slirp = m->slirp; + M_DUP_DEBUG(slirp, m, 0, 0); + struct ip6 *ip = mtod(m, struct ip6 *); DEBUG_CALL("ip6_output"); @@ -30,7 +33,10 @@ int ip6_output(struct socket *so, struct mbuf *m, int fast) ip->ip_fl_lo = 0; if (fast) { + /* We cannot fast-send non-multicast, we'd need a NDP NS */ + assert(IN6_IS_ADDR_MULTICAST(&ip->ip_dst)); if_encap(m->slirp, m); + m_free(m); } else { if_output(so, m); } diff --git a/src/network/slirp/ip_icmp.c b/src/network/slirp/ip_icmp.c index 13a0e5508..6ae523c69 100644 --- a/src/network/slirp/ip_icmp.c +++ b/src/network/slirp/ip_icmp.c @@ -85,13 +85,41 @@ void icmp_cleanup(Slirp *slirp) static int icmp_send(struct socket *so, struct mbuf *m, int hlen) { + Slirp *slirp = m->slirp; + M_DUP_DEBUG(slirp, m, 0, 0); + struct ip *ip = mtod(m, struct ip *); struct sockaddr_in addr; + /* + * The behavior of reading SOCK_DGRAM+IPPROTO_ICMP sockets is inconsistent + * between host OSes. On Linux, only the ICMP header and payload is + * included. On macOS/Darwin, the socket acts like a raw socket and + * includes the IP header as well. On other BSDs, SOCK_DGRAM+IPPROTO_ICMP + * sockets aren't supported at all, so we treat them like raw sockets. It + * isn't possible to detect this difference at runtime, so we must use an + * #ifdef to determine if we need to remove the IP header. + */ +#ifdef CONFIG_BSD + so->so_type = IPPROTO_IP; +#else + so->so_type = IPPROTO_ICMP; +#endif + so->s = slirp_socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP); + if (so->s == -1) { + if (errno == EAFNOSUPPORT + || errno == EPROTONOSUPPORT + || errno == EACCES) { + /* Kernel doesn't support or allow ping sockets. */ + so->so_type = IPPROTO_IP; + so->s = slirp_socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); + } + } if (so->s == -1) { return -1; } + so->slirp->cb->register_poll_fd(so->s, so->slirp->opaque); if (slirp_bind_outbound(so, AF_INET) != 0) { // bind failed - close socket @@ -104,14 +132,13 @@ static int icmp_send(struct socket *so, struct mbuf *m, int hlen) so->so_faddr = ip->ip_dst; so->so_laddr = ip->ip_src; so->so_iptos = ip->ip_tos; - so->so_type = IPPROTO_ICMP; so->so_state = SS_ISFCONNECTED; so->so_expire = curtime + SO_EXPIRE; addr.sin_family = AF_INET; addr.sin_addr = so->so_faddr; - insque(so, &so->slirp->icmp); + slirp_insque(so, &so->slirp->icmp); if (sendto(so->s, m->m_data + hlen, m->m_len - hlen, 0, (struct sockaddr *)&addr, sizeof(addr)) == -1) { @@ -136,10 +163,12 @@ void icmp_detach(struct socket *so) */ void icmp_input(struct mbuf *m, int hlen) { + Slirp *slirp = m->slirp; + M_DUP_DEBUG(slirp, m, 0, 0); + register struct icmp *icp; register struct ip *ip = mtod(m, struct ip *); int icmplen = ip->ip_len; - Slirp *slirp = m->slirp; DEBUG_CALL("icmp_input"); DEBUG_ARG("m = %p", m); @@ -176,10 +205,17 @@ void icmp_input(struct mbuf *m, int hlen) } else { struct socket *so; struct sockaddr_storage addr; - so = socreate(slirp); + int ttl; + + so = socreate(slirp, IPPROTO_ICMP); if (icmp_send(so, m, hlen) == 0) { + /* We could send this as ICMP, good! */ return; } + + /* We could not send this as ICMP, try to send it on UDP echo + * service (7), wishfully hoping that it is open there. */ + if (udp_attach(so, AF_INET) == -1) { DEBUG_MISC("icmp_input udp_attach errno = %d-%s", errno, strerror(errno)); @@ -195,7 +231,6 @@ void icmp_input(struct mbuf *m, int hlen) so->so_laddr = ip->ip_src; so->so_lport = htons(9); so->so_iptos = ip->ip_tos; - so->so_type = IPPROTO_ICMP; so->so_state = SS_ISFCONNECTED; /* Send the packet */ @@ -207,6 +242,19 @@ void icmp_input(struct mbuf *m, int hlen) return; } + /* + * Check for TTL + */ + ttl = ip->ip_ttl-1; + if (ttl <= 0) { + DEBUG_MISC("udp ttl exceeded"); + icmp_send_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, 0, + NULL); + udp_detach(so); + break; + } + setsockopt(so->s, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)); + if (sendto(so->s, icmp_ping_msg, strlen(icmp_ping_msg), 0, (struct sockaddr *)&addr, sockaddr_size(&addr)) == -1) { DEBUG_MISC("icmp_input udp sendto tx errno = %d-%s", errno, @@ -230,7 +278,7 @@ void icmp_input(struct mbuf *m, int hlen) default: m_free(m); - } /* swith */ + } /* switch */ end_error: /* m is m_free()'d xor put in a socket xor or given to ip_send */ @@ -256,8 +304,8 @@ end_error: */ #define ICMP_MAXDATALEN (IP_MSS - 28) -void icmp_send_error(struct mbuf *msrc, uint8_t type, uint8_t code, int minsize, - const char *message) +void icmp_forward_error(struct mbuf *msrc, uint8_t type, uint8_t code, int minsize, + const char *message, struct in_addr *src) { unsigned hlen, shlen, s_ip_len; register struct ip *ip; @@ -276,10 +324,12 @@ void icmp_send_error(struct mbuf *msrc, uint8_t type, uint8_t code, int minsize, goto end_error; ip = mtod(msrc, struct ip *); if (slirp_debug & DBG_MISC) { - char bufa[20], bufb[20]; - slirp_pstrcpy(bufa, sizeof(bufa), inet_ntoa(ip->ip_src)); - slirp_pstrcpy(bufb, sizeof(bufb), inet_ntoa(ip->ip_dst)); - DEBUG_MISC(" %.16s to %.16s", bufa, bufb); + char addr_src[INET_ADDRSTRLEN]; + char addr_dst[INET_ADDRSTRLEN]; + + inet_ntop(AF_INET, &ip->ip_src, addr_src, sizeof(addr_src)); + inet_ntop(AF_INET, &ip->ip_dst, addr_dst, sizeof(addr_dst)); + DEBUG_MISC(" %.16s to %.16s", addr_src, addr_dst); } if (ip->ip_off & IP_OFFMASK) goto end_error; /* Only reply to fragment 0 */ @@ -372,15 +422,21 @@ void icmp_send_error(struct mbuf *msrc, uint8_t type, uint8_t code, int minsize, ip->ip_ttl = MAXTTL; ip->ip_p = IPPROTO_ICMP; ip->ip_dst = ip->ip_src; /* ip addresses */ - ip->ip_src = m->slirp->vhost_addr; + ip->ip_src = *src; - (void)ip_output((struct socket *)NULL, m); + ip_output((struct socket *)NULL, m); end_error: return; } #undef ICMP_MAXDATALEN +void icmp_send_error(struct mbuf *msrc, uint8_t type, uint8_t code, int minsize, + const char *message) +{ + icmp_forward_error(msrc, type, code, minsize, message, &msrc->slirp->vhost_addr); +} + /* * Reflect the ip packet back to the source */ @@ -428,7 +484,7 @@ void icmp_reflect(struct mbuf *m) ip->ip_src = icmp_dst; } - (void)ip_output((struct socket *)NULL, m); + ip_output((struct socket *)NULL, m); } void icmp_receive(struct socket *so) @@ -446,31 +502,24 @@ void icmp_receive(struct socket *so) id = icp->icmp_id; len = recv(so->s, icp, M_ROOM(m), 0); - /* - * The behavior of reading SOCK_DGRAM+IPPROTO_ICMP sockets is inconsistent - * between host OSes. On Linux, only the ICMP header and payload is - * included. On macOS/Darwin, the socket acts like a raw socket and - * includes the IP header as well. On other BSDs, SOCK_DGRAM+IPPROTO_ICMP - * sockets aren't supported at all, so we treat them like raw sockets. It - * isn't possible to detect this difference at runtime, so we must use an - * #ifdef to determine if we need to remove the IP header. - */ -#ifdef CONFIG_BSD - if (len >= sizeof(struct ip)) { - struct ip *inner_ip = mtod(m, struct ip *); - int inner_hlen = inner_ip->ip_hl << 2; - if (inner_hlen > len) { + + if (so->so_type == IPPROTO_IP) { + if (len >= sizeof(struct ip)) { + struct ip *inner_ip = mtod(m, struct ip *); + int inner_hlen = inner_ip->ip_hl << 2; + if (inner_hlen > len) { + len = -1; + errno = -EINVAL; + } else { + len -= inner_hlen; + memmove(icp, (unsigned char *)icp + inner_hlen, len); + } + } else { len = -1; errno = -EINVAL; - } else { - len -= inner_hlen; - memmove(icp, (unsigned char *)icp + inner_hlen, len); } - } else { - len = -1; - errno = -EINVAL; } -#endif + icp->icmp_id = id; m->m_data -= hlen; diff --git a/src/network/slirp/ip_icmp.h b/src/network/slirp/ip_icmp.h index 84707db24..569a08306 100644 --- a/src/network/slirp/ip_icmp.h +++ b/src/network/slirp/ip_icmp.h @@ -157,6 +157,8 @@ struct icmp { void icmp_init(Slirp *slirp); void icmp_cleanup(Slirp *slirp); void icmp_input(struct mbuf *, int); +void icmp_forward_error(struct mbuf *msrc, uint8_t type, uint8_t code, int minsize, + const char *message, struct in_addr *src); void icmp_send_error(struct mbuf *msrc, uint8_t type, uint8_t code, int minsize, const char *message); void icmp_reflect(struct mbuf *); diff --git a/src/network/slirp/ip_input.c b/src/network/slirp/ip_input.c index e04d1506d..b0a64da19 100644 --- a/src/network/slirp/ip_input.c +++ b/src/network/slirp/ip_input.c @@ -71,6 +71,8 @@ void ip_cleanup(Slirp *slirp) void ip_input(struct mbuf *m) { Slirp *slirp = m->slirp; + M_DUP_DEBUG(slirp, m, 0, TCPIPHDR_DELTA); + register struct ip *ip; int hlen; @@ -251,7 +253,7 @@ static struct ip *ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp) goto dropfrag; } fp = mtod(t, struct ipq *); - insque(&fp->ip_link, &slirp->ipq.ip_link); + slirp_insque(&fp->ip_link, &slirp->ipq.ip_link); fp->ipq_ttl = IPFRAGTTL; fp->ipq_p = ip->ip_p; fp->ipq_id = ip->ip_id; @@ -348,7 +350,7 @@ insert: /* * If the fragments concatenated to an mbuf that's bigger than the total * size of the fragment and the mbuf was not already using an m_ext buffer, - * then an m_ext buffer was alloced. But fp->ipq_next points to the old + * then an m_ext buffer was allocated. But fp->ipq_next points to the old * buffer (in the mbuf), so we must point ip into the new buffer. */ if (m->m_flags & M_EXT) { @@ -360,8 +362,8 @@ insert: ip->ip_tos &= ~1; ip->ip_src = fp->ipq_src; ip->ip_dst = fp->ipq_dst; - remque(&fp->ip_link); - (void)m_free(dtom(slirp, fp)); + slirp_remque(&fp->ip_link); + m_free(dtom(slirp, fp)); m->m_len += (ip->ip_hl << 2); m->m_data -= (ip->ip_hl << 2); @@ -386,13 +388,13 @@ static void ip_freef(Slirp *slirp, struct ipq *fp) ip_deq(q); m_free(dtom(slirp, q)); } - remque(&fp->ip_link); - (void)m_free(dtom(slirp, fp)); + slirp_remque(&fp->ip_link); + m_free(dtom(slirp, fp)); } /* * Put an ip fragment on a reassembly chain. - * Like insque, but pointers in middle of structure. + * Like slirp_insque, but pointers in middle of structure. */ static void ip_enq(register struct ipasfrag *p, register struct ipasfrag *prev) { @@ -405,7 +407,7 @@ static void ip_enq(register struct ipasfrag *p, register struct ipasfrag *prev) } /* - * To ip_enq as remque is to insque. + * To ip_enq as slirp_remque is to slirp_insque. */ static void ip_deq(register struct ipasfrag *p) { diff --git a/src/network/slirp/ip_output.c b/src/network/slirp/ip_output.c index 22916a37d..4f6260591 100644 --- a/src/network/slirp/ip_output.c +++ b/src/network/slirp/ip_output.c @@ -51,6 +51,8 @@ int ip_output(struct socket *so, struct mbuf *m0) { Slirp *slirp = m0->slirp; + M_DUP_DEBUG(slirp, m0, 0, 0); + register struct ip *ip; register struct mbuf *m = m0; register int hlen = sizeof(struct ip); diff --git a/src/network/slirp/libslirp-version.h b/src/network/slirp/libslirp-version.h index 1599206a5..b68906957 100644 --- a/src/network/slirp/libslirp-version.h +++ b/src/network/slirp/libslirp-version.h @@ -7,9 +7,9 @@ extern "C" { #endif #define SLIRP_MAJOR_VERSION 4 -#define SLIRP_MINOR_VERSION 3 -#define SLIRP_MICRO_VERSION 1 -#define SLIRP_VERSION_STRING "4.3.1-git-86Box" +#define SLIRP_MINOR_VERSION 7 +#define SLIRP_MICRO_VERSION 0 +#define SLIRP_VERSION_STRING "4.7.0-86Box" #define SLIRP_CHECK_VERSION(major,minor,micro) \ (SLIRP_MAJOR_VERSION > (major) || \ diff --git a/src/network/slirp/libslirp.h b/src/network/slirp/libslirp.h index 7c4340390..7a6c9a4da 100644 --- a/src/network/slirp/libslirp.h +++ b/src/network/slirp/libslirp.h @@ -8,6 +8,7 @@ #ifdef _WIN32 #include +#include #include #else #include @@ -31,8 +32,10 @@ extern "C" { #endif +/* Opaque structure containing the slirp state */ typedef struct Slirp Slirp; +/* Flags passed to SlirpAddPollCb and to be returned by SlirpGetREventsCb. */ enum { SLIRP_POLL_IN = 1 << 0, SLIRP_POLL_OUT = 1 << 1, @@ -47,38 +50,58 @@ typedef void (*SlirpTimerCb)(void *opaque); typedef int (*SlirpAddPollCb)(int fd, int events, void *opaque); typedef int (*SlirpGetREventsCb)(int idx, void *opaque); +typedef enum SlirpTimerId { + SLIRP_TIMER_RA, + SLIRP_TIMER_NUM, +} SlirpTimerId; + /* - * Callbacks from slirp + * Callbacks from slirp, to be set by the application. + * + * The opaque parameter is set to the opaque pointer given in the slirp_new / + * slirp_init call. */ typedef struct SlirpCb { /* - * Send an ethernet frame to the guest network. The opaque - * parameter is the one given to slirp_init(). The function - * doesn't need to send all the data and may return m_usedlist.qh_link = slirp->m_usedlist.qh_rlink = &slirp->m_usedlist; } -void m_cleanup(Slirp *slirp) +static void m_cleanup_list(struct slirp_quehead *list_head) { struct mbuf *m, *next; - m = (struct mbuf *)slirp->m_usedlist.qh_link; - while ((struct quehead *)m != &slirp->m_usedlist) { + m = (struct mbuf *)list_head->qh_link; + while ((struct slirp_quehead *)m != list_head) { next = m->m_next; if (m->m_flags & M_EXT) { g_free(m->m_ext); @@ -43,12 +43,16 @@ void m_cleanup(Slirp *slirp) g_free(m); m = next; } - m = (struct mbuf *)slirp->m_freelist.qh_link; - while ((struct quehead *)m != &slirp->m_freelist) { - next = m->m_next; - g_free(m); - m = next; - } + list_head->qh_link = list_head; + list_head->qh_rlink = list_head; +} + +void m_cleanup(Slirp *slirp) +{ + m_cleanup_list(&slirp->m_usedlist); + m_cleanup_list(&slirp->m_freelist); + m_cleanup_list(&slirp->if_batchq); + m_cleanup_list(&slirp->if_fastq); } /* @@ -66,19 +70,19 @@ struct mbuf *m_get(Slirp *slirp) DEBUG_CALL("m_get"); - if (slirp->m_freelist.qh_link == &slirp->m_freelist) { + if (MBUF_DEBUG || slirp->m_freelist.qh_link == &slirp->m_freelist) { m = g_malloc(SLIRP_MSIZE(slirp->if_mtu)); slirp->mbuf_alloced++; - if (slirp->mbuf_alloced > MBUF_THRESH) + if (MBUF_DEBUG || slirp->mbuf_alloced > MBUF_THRESH) flags = M_DOFREE; m->slirp = slirp; } else { m = (struct mbuf *)slirp->m_freelist.qh_link; - remque(m); + slirp_remque(m); } /* Insert it in the used list */ - insque(m, &slirp->m_usedlist); + slirp_insque(m, &slirp->m_usedlist); m->m_flags = (flags | M_USEDLIST); /* Initialise it */ @@ -101,11 +105,12 @@ void m_free(struct mbuf *m) if (m) { /* Remove from m_usedlist */ if (m->m_flags & M_USEDLIST) - remque(m); + slirp_remque(m); /* If it's M_EXT, free() it */ if (m->m_flags & M_EXT) { g_free(m->m_ext); + m->m_flags &= ~M_EXT; } /* * Either free() it or put it on the free list @@ -114,7 +119,7 @@ void m_free(struct mbuf *m) m->slirp->mbuf_alloced--; g_free(m); } else if ((m->m_flags & M_FREELIST) == 0) { - insque(m, &m->slirp->m_freelist); + slirp_insque(m, &m->slirp->m_freelist); m->m_flags = M_FREELIST; /* Clobber other flags */ } } /* if(m) */ @@ -209,7 +214,7 @@ struct mbuf *dtom(Slirp *slirp, void *dat) /* bug corrected for M_EXT buffers */ for (m = (struct mbuf *)slirp->m_usedlist.qh_link; - (struct quehead *)m != &slirp->m_usedlist; m = m->m_next) { + (struct slirp_quehead *)m != &slirp->m_usedlist; m = m->m_next) { if (m->m_flags & M_EXT) { if ((char *)dat >= m->m_ext && (char *)dat < (m->m_ext + m->m_size)) return m; @@ -223,3 +228,55 @@ struct mbuf *dtom(Slirp *slirp, void *dat) return (struct mbuf *)0; } + +/* + * Duplicate the mbuf + * + * copy_header specifies whether the bytes before m_data should also be copied. + * header_size specifies how many bytes are to be reserved before m_data. + */ +struct mbuf *m_dup(Slirp *slirp, struct mbuf *m, + bool copy_header, + size_t header_size) +{ + struct mbuf *n; + int mcopy_result; + + /* The previous mbuf was supposed to have it already, we can check it along + * the way */ + assert(M_ROOMBEFORE(m) >= header_size); + + n = m_get(slirp); + m_inc(n, m->m_len + header_size); + + if (copy_header) { + m->m_len += header_size; + m->m_data -= header_size; + mcopy_result = m_copy(n, m, 0, m->m_len + header_size); + n->m_data += header_size; + m->m_len -= header_size; + m->m_data += header_size; + } else { + n->m_data += header_size; + mcopy_result = m_copy(n, m, 0, m->m_len); + } + g_assert(mcopy_result == 0); + + return n; +} + +void *mtod_check(struct mbuf *m, size_t len) +{ + if (m->m_len >= len) { + return m->m_data; + } + + DEBUG_ERROR("mtod failed"); + + return NULL; +} + +void *m_end(struct mbuf *m) +{ + return m->m_data + m->m_len; +} diff --git a/src/network/slirp/mbuf.h b/src/network/slirp/mbuf.h index 546e7852c..aedfc712e 100644 --- a/src/network/slirp/mbuf.h +++ b/src/network/slirp/mbuf.h @@ -73,6 +73,13 @@ */ #define M_FREEROOM(m) (M_ROOM(m) - (m)->m_len) +/* + * How much free room there is before m_data + */ +#define M_ROOMBEFORE(m) \ + (((m)->m_flags & M_EXT) ? (m)->m_data - (m)->m_ext \ + : (m)->m_data - (m)->m_dat) + struct mbuf { /* XXX should union some of these! */ /* header at beginning of each mbuf: */ @@ -117,11 +124,69 @@ void m_cat(register struct mbuf *, register struct mbuf *); void m_inc(struct mbuf *, int); void m_adj(struct mbuf *, int); int m_copy(struct mbuf *, struct mbuf *, int, int); +struct mbuf *m_dup(Slirp *slirp, struct mbuf *m, bool copy_header, size_t header_size); struct mbuf *dtom(Slirp *, void *); +void *mtod_check(struct mbuf *, size_t len); +void *m_end(struct mbuf *); static inline void ifs_init(struct mbuf *ifm) { ifm->ifs_next = ifm->ifs_prev = ifm; } +#ifdef SLIRP_DEBUG +# define MBUF_DEBUG 1 +#else +# ifdef HAVE_VALGRIND +# include +# define MBUF_DEBUG RUNNING_ON_VALGRIND +# else +# define MBUF_DEBUG 0 +# endif +#endif + +/* + * When a function is given an mbuf as well as the responsibility to free it, we + * want valgrind etc. to properly identify the new responsible for the + * free. Achieve this by making a new copy. For instance: + * + * f0(void) { + * struct mbuf *m = m_get(slirp); + * [...] + * switch (something) { + * case 1: + * f1(m); + * break; + * case 2: + * f2(m); + * break; + * [...] + * } + * } + * + * f1(struct mbuf *m) { + * M_DUP_DEBUG(m->slirp, m); + * [...] + * m_free(m); // but author of f1 might be forgetting this + * } + * + * f0 transfers the freeing responsibility to f1, f2, etc. Without the + * M_DUP_DEBUG call in f1, valgrind would tell us that it is f0 where the buffer + * was allocated, but it's difficult to know whether a leak is actually in f0, + * or in f1, or in f2, etc. Duplicating the mbuf in M_DUP_DEBUG each time the + * responsibility is transferred allows to immediately know where the leak + * actually is. + */ +#define M_DUP_DEBUG(slirp, m, copy_header, header_size) do { \ + if (MBUF_DEBUG) { \ + struct mbuf *__n; \ + __n = m_dup((slirp), (m), (copy_header), (header_size)); \ + m_free(m); \ + (m) = __n; \ + } else { \ + (void) (slirp); (void) (copy_header); \ + g_assert(M_ROOMBEFORE(m) >= (header_size)); \ + } \ +} while(0) + #endif diff --git a/src/network/slirp/misc.c b/src/network/slirp/misc.c index 3bea32ac1..220506328 100644 --- a/src/network/slirp/misc.c +++ b/src/network/slirp/misc.c @@ -15,22 +15,26 @@ extern gsize g_strlcpy(gchar* dest, const gchar* src, gsize dest_size); #endif #endif -extern inline void insque(void *a, void *b) +#ifdef __APPLE__ +#include +#endif + +extern inline void slirp_insque(void *a, void *b) { - register struct quehead *element = (struct quehead *)a; - register struct quehead *head = (struct quehead *)b; + register struct slirp_quehead *element = (struct slirp_quehead *)a; + register struct slirp_quehead *head = (struct slirp_quehead *)b; element->qh_link = head->qh_link; - head->qh_link = (struct quehead *)element; - element->qh_rlink = (struct quehead *)head; - ((struct quehead *)(element->qh_link))->qh_rlink = - (struct quehead *)element; + head->qh_link = (struct slirp_quehead *)element; + element->qh_rlink = (struct slirp_quehead *)head; + ((struct slirp_quehead *)(element->qh_link))->qh_rlink = + (struct slirp_quehead *)element; } -extern inline void remque(void *a) +extern inline void slirp_remque(void *a) { - register struct quehead *element = (struct quehead *)a; - ((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink; - ((struct quehead *)(element->qh_rlink))->qh_link = element->qh_link; + register struct slirp_quehead *element = (struct slirp_quehead *)a; + ((struct slirp_quehead *)(element->qh_link))->qh_rlink = element->qh_rlink; + ((struct slirp_quehead *)(element->qh_rlink))->qh_link = element->qh_link; element->qh_rlink = NULL; } @@ -89,7 +93,7 @@ static int slirp_socketpair_with_oob(int sv[2]) struct sockaddr_in addr = { .sin_family = AF_INET, .sin_port = 0, - .sin_addr.s_addr = INADDR_ANY, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK), }; socklen_t addrlen = sizeof(addr); int ret, s; @@ -143,11 +147,21 @@ static void fork_exec_child_setup(gpointer data) { #ifndef _WIN32 setsid(); + + /* Unblock all signals and leave our exec()-ee to block what it wants */ + sigset_t ss; + sigemptyset(&ss); + sigprocmask(SIG_SETMASK, &ss, NULL); + + /* POSIX is obnoxious about SIGCHLD specifically across exec() */ + signal(SIGCHLD, SIG_DFL); #endif } +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif #if !GLIB_CHECK_VERSION(2, 58, 0) typedef struct SlirpGSpawnFds { @@ -197,7 +211,9 @@ g_spawn_async_with_fds_slirp(const gchar *working_directory, gchar **argv, #define g_spawn_async_with_fds(wd, argv, env, f, c, d, p, ifd, ofd, efd, err) \ g_spawn_async_with_fds_slirp(wd, argv, env, f, c, d, p, ifd, ofd, efd, err) +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif int fork_exec(struct socket *so, const char *ex) { @@ -300,6 +316,7 @@ char *slirp_connection_info(Slirp *slirp) uint16_t dst_port; struct socket *so; const char *state; + char addr[INET_ADDRSTRLEN]; char buf[20]; g_string_append_printf(str, @@ -329,10 +346,11 @@ char *slirp_connection_info(Slirp *slirp) } slirp_fmt0(buf, sizeof(buf), " TCP[%s]", state); g_string_append_printf(str, "%-19s %3d %15s %5d ", buf, so->s, - src.sin_addr.s_addr ? inet_ntoa(src.sin_addr) : - "*", + src.sin_addr.s_addr ? + inet_ntop(AF_INET, &src.sin_addr, addr, sizeof(addr)) : "*", ntohs(src.sin_port)); - g_string_append_printf(str, "%15s %5d %5d %5d\n", inet_ntoa(dst_addr), + g_string_append_printf(str, "%15s %5d %5d %5d\n", + inet_ntop(AF_INET, &dst_addr, addr, sizeof(addr)), ntohs(dst_port), so->so_rcv.sb_cc, so->so_snd.sb_cc); } @@ -353,10 +371,11 @@ char *slirp_connection_info(Slirp *slirp) dst_port = so->so_fport; } g_string_append_printf(str, "%-19s %3d %15s %5d ", buf, so->s, - src.sin_addr.s_addr ? inet_ntoa(src.sin_addr) : - "*", + src.sin_addr.s_addr ? + inet_ntop(AF_INET, &src.sin_addr, addr, sizeof(addr)) : "*", ntohs(src.sin_port)); - g_string_append_printf(str, "%15s %5d %5d %5d\n", inet_ntoa(dst_addr), + g_string_append_printf(str, "%15s %5d %5d %5d\n", + inet_ntop(AF_INET, &dst_addr, addr, sizeof(addr)), ntohs(dst_port), so->so_rcv.sb_cc, so->so_snd.sb_cc); } @@ -367,15 +386,58 @@ char *slirp_connection_info(Slirp *slirp) src.sin_addr = so->so_laddr; dst_addr = so->so_faddr; g_string_append_printf(str, "%-19s %3d %15s - ", buf, so->s, - src.sin_addr.s_addr ? inet_ntoa(src.sin_addr) : - "*"); - g_string_append_printf(str, "%15s - %5d %5d\n", inet_ntoa(dst_addr), + src.sin_addr.s_addr ? + inet_ntop(AF_INET, &src.sin_addr, addr, sizeof(addr)) : "*"); + g_string_append_printf(str, "%15s - %5d %5d\n", + inet_ntop(AF_INET, &dst_addr, addr, sizeof(addr)), so->so_rcv.sb_cc, so->so_snd.sb_cc); } return g_string_free(str, false); } +char *slirp_neighbor_info(Slirp *slirp) +{ + GString *str = g_string_new(NULL); + ArpTable *arp_table = &slirp->arp_table; + NdpTable *ndp_table = &slirp->ndp_table; + char ip_addr[INET6_ADDRSTRLEN]; + char eth_addr[ETH_ADDRSTRLEN]; + const char *ip; + + g_string_append_printf(str, " %5s %-17s %s\n", + "Table", "MacAddr", "IP Address"); + + for (int i = 0; i < ARP_TABLE_SIZE; ++i) { + struct in_addr addr; + addr.s_addr = arp_table->table[i].ar_sip; + if (!addr.s_addr) { + continue; + } + ip = inet_ntop(AF_INET, &addr, ip_addr, sizeof(ip_addr)); + g_assert(ip != NULL); + g_string_append_printf(str, " %5s %-17s %s\n", "ARP", + slirp_ether_ntoa(arp_table->table[i].ar_sha, + eth_addr, sizeof(eth_addr)), + ip); + } + + for (int i = 0; i < NDP_TABLE_SIZE; ++i) { + if (in6_zero(&ndp_table->table[i].ip_addr)) { + continue; + } + ip = inet_ntop(AF_INET6, &ndp_table->table[i].ip_addr, ip_addr, + sizeof(ip_addr)); + g_assert(ip != NULL); + g_string_append_printf(str, " %5s %-17s %s\n", "NDP", + slirp_ether_ntoa(ndp_table->table[i].eth_addr, + eth_addr, sizeof(eth_addr)), + ip); + } + + return g_string_free(str, false); +} + int slirp_bind_outbound(struct socket *so, unsigned short af) { int ret = 0; diff --git a/src/network/slirp/ncsi-pkt.h b/src/network/slirp/ncsi-pkt.h index 7795ad83e..7694e68ff 100644 --- a/src/network/slirp/ncsi-pkt.h +++ b/src/network/slirp/ncsi-pkt.h @@ -40,6 +40,9 @@ #define __be32 uint32_t #define __be16 uint16_t +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_pkt_hdr { unsigned char mc_id; /* Management controller ID */ unsigned char revision; /* NCSI version - 0x01 */ @@ -49,64 +52,118 @@ struct ncsi_pkt_hdr { unsigned char channel; /* Network controller ID */ __be16 length; /* Payload length */ __be32 reserved1[2]; /* Reserved */ -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_pkt_hdr { struct ncsi_pkt_hdr common; /* Common NCSI packet header */ -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_pkt_hdr { struct ncsi_pkt_hdr common; /* Common NCSI packet header */ __be16 code; /* Response code */ __be16 reason; /* Response reason */ -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_aen_pkt_hdr { struct ncsi_pkt_hdr common; /* Common NCSI packet header */ unsigned char reserved2[3]; /* Reserved */ unsigned char type; /* AEN packet type */ -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* NCSI common command packet */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ __be32 checksum; /* Checksum */ unsigned char pad[26]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ __be32 checksum; /* Checksum */ unsigned char pad[22]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Select Package */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_sp_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ unsigned char reserved[3]; /* Reserved */ unsigned char hw_arbitration; /* HW arbitration */ __be32 checksum; /* Checksum */ unsigned char pad[22]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Disable Channel */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_dc_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ unsigned char reserved[3]; /* Reserved */ unsigned char ald; /* Allow link down */ __be32 checksum; /* Checksum */ unsigned char pad[22]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Reset Channel */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_rc_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ __be32 reserved; /* Reserved */ __be32 checksum; /* Checksum */ unsigned char pad[22]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* AEN Enable */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_ae_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ unsigned char reserved[3]; /* Reserved */ @@ -114,18 +171,30 @@ struct ncsi_cmd_ae_pkt { __be32 mode; /* AEN working mode */ __be32 checksum; /* Checksum */ unsigned char pad[18]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Set Link */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_sl_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ __be32 mode; /* Link working mode */ __be32 oem_mode; /* OEM link mode */ __be32 checksum; /* Checksum */ unsigned char pad[18]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Set VLAN Filter */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_svf_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ __be16 reserved; /* Reserved */ @@ -135,18 +204,30 @@ struct ncsi_cmd_svf_pkt { unsigned char enable; /* Enable or disable */ __be32 checksum; /* Checksum */ unsigned char pad[14]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Enable VLAN */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_ev_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ unsigned char reserved[3]; /* Reserved */ unsigned char mode; /* VLAN filter mode */ __be32 checksum; /* Checksum */ unsigned char pad[22]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Set MAC Address */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_sma_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ unsigned char mac[6]; /* MAC address */ @@ -154,23 +235,38 @@ struct ncsi_cmd_sma_pkt { unsigned char at_e; /* Addr type and operation */ __be32 checksum; /* Checksum */ unsigned char pad[18]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Enable Broadcast Filter */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_ebf_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ __be32 mode; /* Filter mode */ __be32 checksum; /* Checksum */ unsigned char pad[22]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Enable Global Multicast Filter */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_cmd_egmf_pkt { struct ncsi_cmd_pkt_hdr cmd; /* Command header */ __be32 mode; /* Global MC mode */ __be32 checksum; /* Checksum */ unsigned char pad[22]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Set NCSI Flow Control */ struct ncsi_cmd_snfc_pkt { @@ -179,9 +275,15 @@ struct ncsi_cmd_snfc_pkt { unsigned char mode; /* Flow control mode */ __be32 checksum; /* Checksum */ unsigned char pad[22]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Get Link Status */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_gls_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ __be32 status; /* Link status */ @@ -189,9 +291,15 @@ struct ncsi_rsp_gls_pkt { __be32 oem_status; /* OEM link status */ __be32 checksum; unsigned char pad[10]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Get Version ID */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_gvi_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ __be32 ncsi_version; /* NCSI version */ @@ -202,9 +310,15 @@ struct ncsi_rsp_gvi_pkt { __be16 pci_ids[4]; /* PCI IDs */ __be32 mf_id; /* Manufacture ID */ __be32 checksum; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Get Capabilities */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_gc_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ __be32 cap; /* Capabilities */ @@ -220,9 +334,15 @@ struct ncsi_rsp_gc_pkt { unsigned char vlan_mode; /* VLAN mode */ unsigned char channel_cnt; /* Channel count */ __be32 checksum; /* Checksum */ -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Get Parameters */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_gp_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ unsigned char mac_cnt; /* Number of MAC addr */ @@ -241,9 +361,15 @@ struct ncsi_rsp_gp_pkt { unsigned char mac[6]; /* Supported MAC addr */ __be16 vlan; /* Supported VLAN tags */ __be32 checksum; /* Checksum */ -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Get Controller Packet Statistics */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_gcps_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ __be32 cnt_hi; /* Counter cleared */ @@ -288,9 +414,15 @@ struct ncsi_rsp_gcps_pkt { __be32 rx_runt_pkts; /* Rx error runt packets */ __be32 rx_jabber_pkts; /* Rx error jabber packets */ __be32 checksum; /* Checksum */ -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Get NCSI Statistics */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_gns_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ __be32 rx_cmds; /* Rx NCSI commands */ @@ -301,9 +433,15 @@ struct ncsi_rsp_gns_pkt { __be32 tx_pkts; /* Tx NCSI packets */ __be32 tx_aen_pkts; /* Tx AEN packets */ __be32 checksum; /* Checksum */ -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Get NCSI Pass-through Statistics */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_gnpts_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ __be32 tx_pkts; /* Tx packets */ @@ -316,45 +454,78 @@ struct ncsi_rsp_gnpts_pkt { __be32 rx_us_err; /* Rx undersize errors */ __be32 rx_os_err; /* Rx oversize errors */ __be32 checksum; /* Checksum */ -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Get package status */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_gps_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ __be32 status; /* Hardware arbitration status */ __be32 checksum; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* Get package UUID */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_rsp_gpuuid_pkt { struct ncsi_rsp_pkt_hdr rsp; /* Response header */ unsigned char uuid[16]; /* UUID */ __be32 checksum; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* AEN: Link State Change */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_aen_lsc_pkt { struct ncsi_aen_pkt_hdr aen; /* AEN header */ __be32 status; /* Link status */ __be32 oem_status; /* OEM link status */ __be32 checksum; /* Checksum */ unsigned char pad[14]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* AEN: Configuration Required */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_aen_cr_pkt { struct ncsi_aen_pkt_hdr aen; /* AEN header */ __be32 checksum; /* Checksum */ unsigned char pad[22]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* AEN: Host Network Controller Driver Status Change */ +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif struct ncsi_aen_hncdsc_pkt { struct ncsi_aen_pkt_hdr aen; /* AEN header */ __be32 status; /* Status */ __be32 checksum; /* Checksum */ unsigned char pad[18]; -}; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif /* NCSI packet revision */ #define NCSI_PKT_REVISION 0x01 diff --git a/src/network/slirp/ncsi.c b/src/network/slirp/ncsi.c index 3c1dfef1f..f3427bd66 100644 --- a/src/network/slirp/ncsi.c +++ b/src/network/slirp/ncsi.c @@ -38,7 +38,7 @@ #include "ncsi-pkt.h" -static uint32_t ncsi_calculate_checksum(uint16_t *data, int len) +static uint32_t ncsi_calculate_checksum(uint8_t *data, int len) { uint32_t checksum = 0; int i; @@ -47,8 +47,8 @@ static uint32_t ncsi_calculate_checksum(uint16_t *data, int len) * 32-bit unsigned sum of the NC-SI packet header and NC-SI packet * payload interpreted as a series of 16-bit unsigned integer values. */ - for (i = 0; i < len / 2; i++) { - checksum += htons(data[i]); + for (i = 0; i < len; i += 2) { + checksum += (((uint16_t) data[i]) << 8) + data[i+1]; } checksum = (~checksum + 1); @@ -148,6 +148,10 @@ void ncsi_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) uint32_t checksum; uint32_t *pchecksum; + if (pkt_len < ETH_HLEN + sizeof(struct ncsi_pkt_hdr)) { + return; /* packet too short */ + } + memset(ncsi_reply, 0, sizeof(ncsi_reply)); memset(reh->h_dest, 0xff, ETH_ALEN); @@ -184,7 +188,7 @@ void ncsi_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) } /* Add the optional checksum at the end of the frame. */ - checksum = ncsi_calculate_checksum((uint16_t *)rnh, ncsi_rsp_len); + checksum = ncsi_calculate_checksum((uint8_t *)rnh, ncsi_rsp_len); pchecksum = (uint32_t *)((void *)rnh + ncsi_rsp_len); *pchecksum = htonl(checksum); ncsi_rsp_len += 4; diff --git a/src/network/slirp/ndp_table.c b/src/network/slirp/ndp_table.c index 110d6ea0e..fdb189d59 100644 --- a/src/network/slirp/ndp_table.c +++ b/src/network/slirp/ndp_table.c @@ -12,13 +12,14 @@ void ndp_table_add(Slirp *slirp, struct in6_addr ip_addr, char addrstr[INET6_ADDRSTRLEN]; NdpTable *ndp_table = &slirp->ndp_table; int i; + char ethaddr_str[ETH_ADDRSTRLEN]; inet_ntop(AF_INET6, &(ip_addr), addrstr, INET6_ADDRSTRLEN); DEBUG_CALL("ndp_table_add"); DEBUG_ARG("ip = %s", addrstr); - DEBUG_ARG("hw addr = %02x:%02x:%02x:%02x:%02x:%02x", ethaddr[0], ethaddr[1], - ethaddr[2], ethaddr[3], ethaddr[4], ethaddr[5]); + DEBUG_ARG("hw addr = %s", slirp_ether_ntoa(ethaddr, ethaddr_str, + sizeof(ethaddr_str))); if (IN6_IS_ADDR_MULTICAST(&ip_addr) || in6_zero(&ip_addr)) { /* Do not register multicast or unspecified addresses */ @@ -38,6 +39,10 @@ void ndp_table_add(Slirp *slirp, struct in6_addr ip_addr, /* No entry found, create a new one */ DEBUG_CALL(" create new entry"); + /* Save the first entry, it is the guest. */ + if (in6_zero(&ndp_table->guest_in6_addr)) { + ndp_table->guest_in6_addr = ip_addr; + } ndp_table->table[ndp_table->next_victim].ip_addr = ip_addr; memcpy(ndp_table->table[ndp_table->next_victim].eth_addr, ethaddr, ETH_ALEN); @@ -50,13 +55,19 @@ bool ndp_table_search(Slirp *slirp, struct in6_addr ip_addr, char addrstr[INET6_ADDRSTRLEN]; NdpTable *ndp_table = &slirp->ndp_table; int i; + char ethaddr_str[ETH_ADDRSTRLEN]; inet_ntop(AF_INET6, &(ip_addr), addrstr, INET6_ADDRSTRLEN); DEBUG_CALL("ndp_table_search"); DEBUG_ARG("ip = %s", addrstr); - assert(!in6_zero(&ip_addr)); + /* If unspecified address */ + if (in6_zero(&ip_addr)) { + /* return Ethernet broadcast address */ + memset(out_ethaddr, 0xff, ETH_ALEN); + return 1; + } /* Multicast address: fec0::abcd:efgh/8 -> 33:33:ab:cd:ef:gh */ if (IN6_IS_ADDR_MULTICAST(&ip_addr)) { @@ -66,18 +77,18 @@ bool ndp_table_search(Slirp *slirp, struct in6_addr ip_addr, out_ethaddr[3] = ip_addr.s6_addr[13]; out_ethaddr[4] = ip_addr.s6_addr[14]; out_ethaddr[5] = ip_addr.s6_addr[15]; - DEBUG_ARG("multicast addr = %02x:%02x:%02x:%02x:%02x:%02x", - out_ethaddr[0], out_ethaddr[1], out_ethaddr[2], - out_ethaddr[3], out_ethaddr[4], out_ethaddr[5]); + DEBUG_ARG("multicast addr = %s", + slirp_ether_ntoa(out_ethaddr, ethaddr_str, + sizeof(ethaddr_str))); return 1; } for (i = 0; i < NDP_TABLE_SIZE; i++) { if (in6_equal(&ndp_table->table[i].ip_addr, &ip_addr)) { memcpy(out_ethaddr, ndp_table->table[i].eth_addr, ETH_ALEN); - DEBUG_ARG("found hw addr = %02x:%02x:%02x:%02x:%02x:%02x", - out_ethaddr[0], out_ethaddr[1], out_ethaddr[2], - out_ethaddr[3], out_ethaddr[4], out_ethaddr[5]); + DEBUG_ARG("found hw addr = %s", + slirp_ether_ntoa(out_ethaddr, ethaddr_str, + sizeof(ethaddr_str))); return 1; } } diff --git a/src/network/slirp/sbuf.c b/src/network/slirp/sbuf.c index 2fb917614..b35709170 100644 --- a/src/network/slirp/sbuf.c +++ b/src/network/slirp/sbuf.c @@ -68,7 +68,7 @@ void sbappend(struct socket *so, struct mbuf *m) if (so->so_urgc) { sbappendsb(&so->so_rcv, m); m_free(m); - (void)sosendoob(so); + sosendoob(so); return; } diff --git a/src/network/slirp/slirp.c b/src/network/slirp/slirp.c index 021324cdb..0c2a20a9b 100644 --- a/src/network/slirp/slirp.c +++ b/src/network/slirp/slirp.c @@ -34,6 +34,37 @@ #undef if_mtu #endif +#if defined(_WIN32) + +#define INITIAL_DNS_ADDR_BUF_SIZE 32 * 1024 +#define REALLOC_RETRIES 5 + +// Broadcast site local DNS resolvers. We do not use these because they are +// highly unlikely to be valid. +// https://www.ietf.org/proceedings/52/I-D/draft-ietf-ipngwg-dns-discovery-03.txt +static const struct in6_addr SITE_LOCAL_DNS_BROADCAST_ADDRS[] = { + { + {{ + 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 + }} + }, + { + {{ + 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 + }} + }, + { + {{ + 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + }} + }, +}; + +#endif + int slirp_debug; /* Define to 1 if you want KEEPALIVE timers */ @@ -51,20 +82,17 @@ static const uint8_t special_ethaddr[ETH_ALEN] = { 0x52, 0x55, 0x00, unsigned curtime; static struct in_addr dns_addr; -#ifndef _WIN32 static struct in6_addr dns6_addr; -#endif +static uint32_t dns6_scope_id; static unsigned dns_addr_time; -#ifndef _WIN32 static unsigned dns6_addr_time; -#endif #define TIMEOUT_FAST 2 /* milliseconds */ #define TIMEOUT_SLOW 499 /* milliseconds */ /* for the aging of certain requests like DNS */ #define TIMEOUT_DEFAULT 1000 /* milliseconds */ -#ifdef _WIN32 +#if defined(_WIN32) int get_dns_addr(struct in_addr *pdns_addr) { @@ -111,8 +139,108 @@ int get_dns_addr(struct in_addr *pdns_addr) return 0; } +int is_site_local_dns_broadcast(struct in6_addr *address) +{ + int i; + for (i = 0; i < G_N_ELEMENTS(SITE_LOCAL_DNS_BROADCAST_ADDRS); i++) { + if (in6_equal(address, &SITE_LOCAL_DNS_BROADCAST_ADDRS[i])) { + return 1; + } + } + return 0; +} + +void print_dns_v6_address(struct in6_addr address) +{ + char address_str[INET6_ADDRSTRLEN] = ""; + if (inet_ntop(AF_INET6, &address, address_str, INET6_ADDRSTRLEN) + == NULL) { + DEBUG_ERROR("Failed to stringify IPv6 address for logging."); + return; + } + DEBUG_CALL("IPv6 DNS server found: %s", address_str); +} + +// Gets the first valid DNS resolver with an IPv6 address. +// Ignores any site local broadcast DNS servers, as these +// are on deprecated addresses and not generally expected +// to work. Further details at: +// https://www.ietf.org/proceedings/52/I-D/draft-ietf-ipngwg-dns-discovery-03.txt +int get_ipv6_dns_server(struct in6_addr *dns_server_address, uint32_t *scope_id) +{ + PIP_ADAPTER_ADDRESSES addresses = NULL; + PIP_ADAPTER_ADDRESSES address = NULL; + IP_ADAPTER_DNS_SERVER_ADDRESS *dns_server = NULL; + struct sockaddr_in6 *dns_v6_addr = NULL; + + ULONG buf_size = INITIAL_DNS_ADDR_BUF_SIZE; + DWORD res = ERROR_BUFFER_OVERFLOW; + int i; + + for (i = 0; i < REALLOC_RETRIES; i++) { + // If non null, we hit buffer overflow, free it so we can try again. + if (addresses != NULL) { + g_free(addresses); + } + + addresses = g_malloc(buf_size); + res = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX, NULL, + addresses, &buf_size); + + if (res != ERROR_BUFFER_OVERFLOW) { + break; + } + } + + if (res != NO_ERROR) { + DEBUG_ERROR("Failed to get IPv6 DNS addresses due to error %lX", res); + goto failure; + } + + address = addresses; + for (address = addresses; address != NULL; address = address->Next) { + for (dns_server = address->FirstDnsServerAddress; + dns_server != NULL; + dns_server = dns_server->Next) { + + if (dns_server->Address.lpSockaddr->sa_family != AF_INET6) { + continue; + } + + dns_v6_addr = (struct sockaddr_in6 *)dns_server->Address.lpSockaddr; + if (is_site_local_dns_broadcast(&dns_v6_addr->sin6_addr) == 0) { + print_dns_v6_address(dns_v6_addr->sin6_addr); + *dns_server_address = dns_v6_addr->sin6_addr; + *scope_id = dns_v6_addr->sin6_scope_id; + + g_free(addresses); + return 0; + } + } + } + + DEBUG_ERROR("No IPv6 DNS servers found.\n"); + +failure: + g_free(addresses); + return -1; +} + int get_dns6_addr(struct in6_addr *pdns6_addr, uint32_t *scope_id) { + if (!in6_zero(&dns6_addr) && (curtime - dns6_addr_time) < TIMEOUT_DEFAULT) { + *pdns6_addr = dns6_addr; + *scope_id = dns6_scope_id; + return 0; + } + + if (get_ipv6_dns_server(pdns6_addr, scope_id) == 0) { + dns6_addr = *pdns6_addr; + dns6_addr_time = curtime; + dns6_scope_id = *scope_id; + return 0; + } + return -1; } @@ -121,7 +249,122 @@ static void winsock_cleanup(void) WSACleanup(); } +#elif defined(__APPLE__) + +#include + +static int get_dns_addr_cached(void *pdns_addr, void *cached_addr, + socklen_t addrlen, unsigned *cached_time) +{ + if (curtime - *cached_time < TIMEOUT_DEFAULT) { + memcpy(pdns_addr, cached_addr, addrlen); + return 0; + } + return 1; +} + +static int get_dns_addr_libresolv(int af, void *pdns_addr, void *cached_addr, + socklen_t addrlen, + uint32_t *scope_id, uint32_t *cached_scope_id, + unsigned *cached_time) +{ + struct __res_state state; + union res_sockaddr_union servers[NI_MAXSERV]; + int count; + int found; + void *addr; + + // we only support IPv4 and IPv4, we assume it's one or the other + assert(af == AF_INET || af == AF_INET6); + + if (res_ninit(&state) != 0) { + return -1; + } + + count = res_getservers(&state, servers, NI_MAXSERV); + found = 0; + DEBUG_MISC("IP address of your DNS(s):"); + for (int i = 0; i < count; i++) { + if (af == servers[i].sin.sin_family) { + found++; + } + if (af == AF_INET) { + addr = &servers[i].sin.sin_addr; + } else { // af == AF_INET6 + addr = &servers[i].sin6.sin6_addr; + } + + // we use the first found entry + if (found == 1) { + memcpy(pdns_addr, addr, addrlen); + memcpy(cached_addr, addr, addrlen); + if (scope_id) { + *scope_id = 0; + } + if (cached_scope_id) { + *cached_scope_id = 0; + } + *cached_time = curtime; + } + + if (found > 3) { + DEBUG_MISC(" (more)"); + break; + } else if (slirp_debug & DBG_MISC) { + char s[INET6_ADDRSTRLEN]; + const char *res = inet_ntop(af, addr, s, sizeof(s)); + if (!res) { + res = " (string conversion error)"; + } + DEBUG_MISC(" %s", res); + } + } + + res_ndestroy(&state); + if (!found) + return -1; + return 0; +} + +int get_dns_addr(struct in_addr *pdns_addr) +{ + if (dns_addr.s_addr != 0) { + int ret; + ret = get_dns_addr_cached(pdns_addr, &dns_addr, sizeof(dns_addr), + &dns_addr_time); + if (ret <= 0) { + return ret; + } + } + return get_dns_addr_libresolv(AF_INET, pdns_addr, &dns_addr, + sizeof(dns_addr), NULL, NULL, &dns_addr_time); +} + +int get_dns6_addr(struct in6_addr *pdns6_addr, uint32_t *scope_id) +{ + if (!in6_zero(&dns6_addr)) { + int ret; + ret = get_dns_addr_cached(pdns6_addr, &dns6_addr, sizeof(dns6_addr), + &dns6_addr_time); + if (ret == 0) { + *scope_id = dns6_scope_id; + } + if (ret <= 0) { + return ret; + } + } + return get_dns_addr_libresolv(AF_INET6, pdns6_addr, &dns6_addr, + sizeof(dns6_addr), + scope_id, &dns6_scope_id, &dns6_addr_time); +} + +#else // !defined(_WIN32) && !defined(__APPLE__) + +#if defined(__HAIKU__) +#define RESOLV_CONF_PATH "/boot/system/settings/network/resolv.conf" #else +#define RESOLV_CONF_PATH "/etc/resolv.conf" +#endif static int get_dns_addr_cached(void *pdns_addr, void *cached_addr, socklen_t addrlen, struct stat *cached_stat, @@ -133,7 +376,7 @@ static int get_dns_addr_cached(void *pdns_addr, void *cached_addr, return 0; } old_stat = *cached_stat; - if (stat("/etc/resolv.conf", cached_stat) != 0) { + if (stat(RESOLV_CONF_PATH, cached_stat) != 0) { return -1; } if (cached_stat->st_dev == old_stat.st_dev && @@ -147,17 +390,22 @@ static int get_dns_addr_cached(void *pdns_addr, void *cached_addr, } static int get_dns_addr_resolv_conf(int af, void *pdns_addr, void *cached_addr, - socklen_t addrlen, uint32_t *scope_id, + socklen_t addrlen, + uint32_t *scope_id, uint32_t *cached_scope_id, unsigned *cached_time) { char buff[512]; char buff2[257]; FILE *f; int found = 0; - void *tmp_addr = alloca(addrlen); + union { + struct in_addr dns_addr; + struct in6_addr dns6_addr; + } tmp_addr; unsigned if_index; - f = fopen("/etc/resolv.conf", "r"); + assert(sizeof(tmp_addr) >= addrlen); + f = fopen(RESOLV_CONF_PATH, "r"); if (!f) return -1; @@ -172,16 +420,19 @@ static int get_dns_addr_resolv_conf(int af, void *pdns_addr, void *cached_addr, if_index = 0; } - if (!inet_pton(af, buff2, tmp_addr)) { + if (!inet_pton(af, buff2, &tmp_addr)) { continue; } /* If it's the first one, set it to dns_addr */ if (!found) { - memcpy(pdns_addr, tmp_addr, addrlen); - memcpy(cached_addr, tmp_addr, addrlen); + memcpy(pdns_addr, &tmp_addr, addrlen); + memcpy(cached_addr, &tmp_addr, addrlen); if (scope_id) { *scope_id = if_index; } + if (cached_scope_id) { + *cached_scope_id = if_index; + } *cached_time = curtime; } @@ -190,7 +441,7 @@ static int get_dns_addr_resolv_conf(int af, void *pdns_addr, void *cached_addr, break; } else if (slirp_debug & DBG_MISC) { char s[INET6_ADDRSTRLEN]; - const char *res = inet_ntop(af, tmp_addr, s, sizeof(s)); + const char *res = inet_ntop(af, &tmp_addr, s, sizeof(s)); if (!res) { res = " (string conversion error)"; } @@ -217,7 +468,8 @@ int get_dns_addr(struct in_addr *pdns_addr) } } return get_dns_addr_resolv_conf(AF_INET, pdns_addr, &dns_addr, - sizeof(dns_addr), NULL, &dns_addr_time); + sizeof(dns_addr), + NULL, NULL, &dns_addr_time); } int get_dns6_addr(struct in6_addr *pdns6_addr, uint32_t *scope_id) @@ -228,13 +480,16 @@ int get_dns6_addr(struct in6_addr *pdns6_addr, uint32_t *scope_id) int ret; ret = get_dns_addr_cached(pdns6_addr, &dns6_addr, sizeof(dns6_addr), &dns6_addr_stat, &dns6_addr_time); + if (ret == 0) { + *scope_id = dns6_scope_id; + } if (ret <= 0) { return ret; } } return get_dns_addr_resolv_conf(AF_INET6, pdns6_addr, &dns6_addr, - sizeof(dns6_addr), scope_id, - &dns6_addr_time); + sizeof(dns6_addr), + scope_id, &dns6_scope_id, &dns6_addr_time); } #endif @@ -267,11 +522,49 @@ static void slirp_init_once(void) { "misc", DBG_MISC }, { "error", DBG_ERROR }, { "tftp", DBG_TFTP }, + { "verbose_call", DBG_VERBOSE_CALL }, }; slirp_debug = g_parse_debug_string(debug, keys, G_N_ELEMENTS(keys)); } } +static void ra_timer_handler_cb(void *opaque) +{ + Slirp *slirp = opaque; + + return ra_timer_handler(slirp, NULL); +} + +void slirp_handle_timer(Slirp *slirp, SlirpTimerId id, void *cb_opaque) +{ +// g_return_if_fail(id >= 0 && id < SLIRP_TIMER_NUM); + + switch (id) { + case SLIRP_TIMER_RA: + return ra_timer_handler(slirp, cb_opaque); + default: + abort(); + } +} + +void *slirp_timer_new(Slirp *slirp, SlirpTimerId id, void *cb_opaque) +{ + g_return_val_if_fail(id >= 0 && id < SLIRP_TIMER_NUM, NULL); + + if (slirp->cfg_version >= 4 && slirp->cb->timer_new_opaque) { + return slirp->cb->timer_new_opaque(id, cb_opaque, slirp->opaque); + } + + switch (id) { + case SLIRP_TIMER_RA: + g_return_val_if_fail(cb_opaque == NULL, NULL); + return slirp->cb->timer_new(ra_timer_handler_cb, slirp, slirp->opaque); + + default: + abort(); + } +} + Slirp *slirp_new(const SlirpConfig *cfg, const SlirpCb *callbacks, void *opaque) { Slirp *slirp; @@ -291,6 +584,7 @@ Slirp *slirp_new(const SlirpConfig *cfg, const SlirpCb *callbacks, void *opaque) slirp_init_once(); + slirp->cfg_version = cfg->version; slirp->opaque = opaque; slirp->cb = callbacks; slirp->grand = g_rand_new(); @@ -301,7 +595,6 @@ Slirp *slirp_new(const SlirpConfig *cfg, const SlirpCb *callbacks, void *opaque) if_init(slirp); ip_init(slirp); - ip6_init(slirp); m_init(slirp); @@ -345,6 +638,17 @@ Slirp *slirp_new(const SlirpConfig *cfg, const SlirpCb *callbacks, void *opaque) slirp->disable_dns = false; } + if (cfg->version >= 4) { + slirp->disable_dhcp = cfg->disable_dhcp; + } else { + slirp->disable_dhcp = false; + } + + if (slirp->cfg_version >= 4 && slirp->cb->init_completed) { + slirp->cb->init_completed(slirp, slirp->opaque); + } + + ip6_post_init(slirp); return slirp; } @@ -501,7 +805,10 @@ void slirp_pollfds_fill(Slirp *slirp, uint32_t *timeout, /* * Set for reading (and urgent data) if we are connected, can - * receive more, and we have room for it XXX /2 ? + * receive more, and we have room for it. + * + * If sb is already half full, we will wait for the guest to consume it, + * and notify again in sbdrop() when the sb becomes less than half full. */ if (CONN_CANFRCV(so) && (so->so_snd.sb_cc < (so->so_snd.sb_datalen / 2))) { @@ -623,10 +930,16 @@ void slirp_pollfds_poll(Slirp *slirp, int select_error, continue; } +#ifndef __APPLE__ /* * Check for URG data * This will soread as well, so no need to - * test for SLIRP_POLL_IN below if this succeeds + * test for SLIRP_POLL_IN below if this succeeds. + * + * This is however disabled on MacOS, which apparently always + * reports data as PRI when it is the last data of the + * connection. We would then report it out of band, which the guest + * would most probably not be ready for. */ if (revents & SLIRP_POLL_PRI) { ret = sorecvoob(so); @@ -639,8 +952,10 @@ void slirp_pollfds_poll(Slirp *slirp, int select_error, /* * Check sockets for reading */ - else if (revents & - (SLIRP_POLL_IN | SLIRP_POLL_HUP | SLIRP_POLL_ERR)) { + else +#endif + if (revents & + (SLIRP_POLL_IN | SLIRP_POLL_HUP | SLIRP_POLL_ERR | SLIRP_POLL_PRI)) { /* * Check for incoming connections */ @@ -763,6 +1078,10 @@ static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) return; } + if (pkt_len < ETH_HLEN + sizeof(struct slirp_arphdr)) { + return; /* packet too short */ + } + ar_op = ntohs(ah->ar_op); switch (ar_op) { case ARPOP_REQUEST: @@ -953,6 +1272,7 @@ int if_encap(Slirp *slirp, struct mbuf *ifm) uint8_t ethaddr[ETH_ALEN]; const struct ip *iph = (const struct ip *)ifm->m_data; int ret; +// char ethaddr_str[ETH_ADDRSTRLEN]; if (ifm->m_len + ETH_HLEN > sizeof(buf)) { return 1; @@ -978,19 +1298,18 @@ int if_encap(Slirp *slirp, struct mbuf *ifm) } memcpy(eh->h_dest, ethaddr, ETH_ALEN); - DEBUG_ARG("src = %02x:%02x:%02x:%02x:%02x:%02x", eh->h_source[0], - eh->h_source[1], eh->h_source[2], eh->h_source[3], - eh->h_source[4], eh->h_source[5]); - DEBUG_ARG("dst = %02x:%02x:%02x:%02x:%02x:%02x", eh->h_dest[0], - eh->h_dest[1], eh->h_dest[2], eh->h_dest[3], eh->h_dest[4], - eh->h_dest[5]); +/* + DEBUG_ARG("src = %s", slirp_ether_ntoa(eh->h_source, ethaddr_str, + sizeof(ethaddr_str))); + DEBUG_ARG("dst = %s", slirp_ether_ntoa(eh->h_dest, ethaddr_str, + sizeof(ethaddr_str))); +*/ memcpy(buf + sizeof(struct ethhdr), ifm->m_data, ifm->m_len); slirp_send_packet_all(slirp, buf, ifm->m_len + ETH_HLEN); return 1; } /* Drop host forwarding rule, return 0 if found. */ -/* TODO: IPv6 */ int slirp_remove_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr, int host_port) { @@ -1004,7 +1323,10 @@ int slirp_remove_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr, addr_len = sizeof(addr); if ((so->so_state & SS_HOSTFWD) && getsockname(so->s, (struct sockaddr *)&addr, &addr_len) == 0 && - addr.sin_addr.s_addr == host_addr.s_addr && addr.sin_port == port) { + addr_len == sizeof(addr) && + addr.sin_family == AF_INET && + addr.sin_addr.s_addr == host_addr.s_addr && + addr.sin_port == port) { so->slirp->cb->unregister_poll_fd(so->s, so->slirp->opaque); closesocket(so->s); sofree(so); @@ -1015,7 +1337,6 @@ int slirp_remove_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr, return -1; } -/* TODO: IPv6 */ int slirp_add_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr, int host_port, struct in_addr guest_addr, int guest_port) { @@ -1034,6 +1355,83 @@ int slirp_add_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr, return 0; } +int slirp_remove_hostxfwd(Slirp *slirp, + const struct sockaddr *haddr, socklen_t haddrlen, + int flags) +{ + struct socket *so; + struct socket *head = (flags & SLIRP_HOSTFWD_UDP ? &slirp->udb : &slirp->tcb); + struct sockaddr_storage addr; + socklen_t addr_len; + + for (so = head->so_next; so != head; so = so->so_next) { + addr_len = sizeof(addr); + if ((so->so_state & SS_HOSTFWD) && + getsockname(so->s, (struct sockaddr *)&addr, &addr_len) == 0 && + sockaddr_equal(&addr, (const struct sockaddr_storage *) haddr)) { + so->slirp->cb->unregister_poll_fd(so->s, so->slirp->opaque); + closesocket(so->s); + sofree(so); + return 0; + } + } + + return -1; +} + +int slirp_add_hostxfwd(Slirp *slirp, + const struct sockaddr *haddr, socklen_t haddrlen, + const struct sockaddr *gaddr, socklen_t gaddrlen, + int flags) +{ + struct sockaddr_in gdhcp_addr; + int fwd_flags = SS_HOSTFWD; + + if (flags & SLIRP_HOSTFWD_V6ONLY) + fwd_flags |= SS_HOSTFWD_V6ONLY; + + if (gaddr->sa_family == AF_INET) { + const struct sockaddr_in *gaddr_in = (const struct sockaddr_in *) gaddr; + + if (gaddrlen < sizeof(struct sockaddr_in)) { + errno = EINVAL; + return -1; + } + + if (!gaddr_in->sin_addr.s_addr) { + gdhcp_addr = *gaddr_in; + gdhcp_addr.sin_addr = slirp->vdhcp_startaddr; + gaddr = (struct sockaddr *) &gdhcp_addr; + gaddrlen = sizeof(gdhcp_addr); + } + } else { + if (gaddrlen < sizeof(struct sockaddr_in6)) { + errno = EINVAL; + return -1; + } + + /* + * Libslirp currently only provides a stateless DHCPv6 server, thus + * we can't translate "addr-any" to the guest here. Instead, we defer + * performing the translation to when it's needed. See + * soassign_guest_addr_if_needed(). + */ + } + + if (flags & SLIRP_HOSTFWD_UDP) { + if (!udpx_listen(slirp, haddr, haddrlen, + gaddr, gaddrlen, + fwd_flags)) + return -1; + } else { + if (!tcpx_listen(slirp, haddr, haddrlen, + gaddr, gaddrlen, + fwd_flags)) + return -1; + } + return 0; +} + /* TODO: IPv6 */ static bool check_guestfwd(Slirp *slirp, struct in_addr *guest_addr, int guest_port) @@ -1158,6 +1556,8 @@ size_t slirp_socket_can_recv(Slirp *slirp, struct in_addr guest_addr, } if (!CONN_CANFRCV(so) || so->so_snd.sb_cc >= (so->so_snd.sb_datalen / 2)) { + /* If the sb is already half full, we will wait for the guest to consume it, + * and notify again in sbdrop() when the sb becomes less than half full. */ return 0; } diff --git a/src/network/slirp/slirp.h b/src/network/slirp/slirp.h index d996b53ed..e50c2ffe4 100644 --- a/src/network/slirp/slirp.h +++ b/src/network/slirp/slirp.h @@ -6,7 +6,7 @@ /* as defined in sdkddkver.h */ #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0600 /* Vista */ +#define _WIN32_WINNT 0x0600 /* Windows Vista */ #endif /* reduces the number of implicitly included headers */ #ifndef WIN32_LEAN_AND_MEAN @@ -20,10 +20,8 @@ #include #else -#if !defined(__HAIKU__) #define O_BINARY 0 #endif -#endif #ifndef _WIN32 #include @@ -37,12 +35,6 @@ #include #endif -/* Avoid conflicting with the libc insque() and remque(), which - have different prototypes. */ -#define insque slirp_insque -#define remque slirp_remque -#define quehead slirp_quehead - #include "debug.h" #include "util.h" @@ -88,9 +80,9 @@ struct slirp_arphdr { /* * Ethernet looks like this : This bit is variable sized however... */ - unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */ + uint8_t ar_sha[ETH_ALEN]; /* sender hardware address */ uint32_t ar_sip; /* sender IP address */ - unsigned char ar_tha[ETH_ALEN]; /* target hardware address */ + uint8_t ar_tha[ETH_ALEN]; /* target hardware address */ uint32_t ar_tip; /* target IP address */ } SLIRP_PACKED; #if defined(_MSC_VER) && !defined (__clang__) @@ -111,7 +103,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, uint8_t out_ethaddr[ETH_ALEN]); struct ndpentry { - unsigned char eth_addr[ETH_ALEN]; /* sender hardware address */ + uint8_t eth_addr[ETH_ALEN]; /* sender hardware address */ struct in6_addr ip_addr; /* sender IP address */ }; @@ -119,6 +111,12 @@ struct ndpentry { typedef struct NdpTable { struct ndpentry table[NDP_TABLE_SIZE]; + /* + * The table is a cache with old entries overwritten when the table fills. + * Preserve the first entry: it is the guest, which is needed for lazy + * hostfwd guest address assignment. + */ + struct in6_addr guest_in6_addr; int next_victim; } NdpTable; @@ -128,6 +126,8 @@ bool ndp_table_search(Slirp *slirp, struct in6_addr ip_addr, uint8_t out_ethaddr[ETH_ALEN]); struct Slirp { + int cfg_version; + unsigned time_fasttimo; unsigned last_slowtimo; bool do_slowtimo; @@ -141,6 +141,7 @@ struct Slirp { struct in6_addr vprefix_addr6; uint8_t vprefix_len; struct in6_addr vhost_addr6; + bool disable_dhcp; /* slirp will not reply to any DHCP requests */ struct in_addr vdhcp_startaddr; struct in_addr vnameserver_addr; struct in6_addr vnameserver_addr6; @@ -157,13 +158,13 @@ struct Slirp { bool disable_host_loopback; /* mbuf states */ - struct quehead m_freelist; - struct quehead m_usedlist; + struct slirp_quehead m_freelist; + struct slirp_quehead m_usedlist; int mbuf_alloced; /* if states */ - struct quehead if_fastq; /* fast queue (for interactive data) */ - struct quehead if_batchq; /* queue for non-interactive data */ + struct slirp_quehead if_fastq; /* fast queue (for interactive data) */ + struct slirp_quehead if_batchq; /* queue for non-interactive data */ bool if_start_busy; /* avoid if_start recursion */ /* ip states */ @@ -251,7 +252,7 @@ void ip_stripoptions(register struct mbuf *, struct mbuf *); int ip_output(struct socket *, struct mbuf *); /* ip6_input.c */ -void ip6_init(Slirp *); +void ip6_post_init(Slirp *); void ip6_cleanup(Slirp *); void ip6_input(struct mbuf *); @@ -287,5 +288,6 @@ struct socket *slirp_find_ctl_socket(Slirp *slirp, struct in_addr guest_addr, int guest_port); void slirp_send_packet_all(Slirp *slirp, const void *buf, size_t len); +void *slirp_timer_new(Slirp *slirp, SlirpTimerId id, void *cb_opaque); #endif diff --git a/src/network/slirp/socket.c b/src/network/slirp/socket.c index 36d005192..22144ffb8 100644 --- a/src/network/slirp/socket.c +++ b/src/network/slirp/socket.c @@ -8,6 +8,9 @@ #ifdef __sun__ #include #endif +#ifdef __linux__ +#include +#endif static void sofcantrcvmore(struct socket *so); static void sofcantsendmore(struct socket *so); @@ -38,15 +41,17 @@ struct socket *solookup(struct socket **last, struct socket *head, /* * Create a new socket, initialise the fields * It is the responsibility of the caller to - * insque() it into the correct linked-list + * slirp_insque() it into the correct linked-list */ -struct socket *socreate(Slirp *slirp) +struct socket *socreate(Slirp *slirp, int type) { struct socket *so = g_new(struct socket, 1); memset(so, 0, sizeof(struct socket)); + so->so_type = type; so->so_state = SS_NOFDREF; so->s = -1; + so->s_aux = -1; so->slirp = slirp; so->pollfds_idx = -1; @@ -56,11 +61,11 @@ struct socket *socreate(Slirp *slirp) /* * Remove references to so from the given message queue. */ -static void soqfree(struct socket *so, struct quehead *qh) +static void soqfree(struct socket *so, struct slirp_quehead *qh) { struct mbuf *ifq; - for (ifq = (struct mbuf *)qh->qh_link; (struct quehead *)ifq != qh; + for (ifq = (struct mbuf *)qh->qh_link; (struct slirp_quehead *)ifq != qh; ifq = ifq->ifq_next) { if (ifq->ifq_so == so) { struct mbuf *ifm; @@ -73,12 +78,16 @@ static void soqfree(struct socket *so, struct quehead *qh) } /* - * remque and free a socket, clobber cache + * slirp_remque and free a socket, clobber cache */ void sofree(struct socket *so) { Slirp *slirp = so->slirp; + if (so->s_aux != -1) { + closesocket(so->s_aux); + } + soqfree(so, &slirp->if_fastq); soqfree(so, &slirp->if_batchq); @@ -92,7 +101,7 @@ void sofree(struct socket *so) m_free(so->so_m); if (so->so_next && so->so_prev) - remque(so); /* crashes if so is not in a queue */ + slirp_remque(so); /* crashes if so is not in a queue */ if (so->so_tcpcb) { g_free(so->so_tcpcb); @@ -208,8 +217,8 @@ int soread(struct socket *so) errno, strerror(errno)); sofcantrcvmore(so); - if (err == ECONNRESET || err == ECONNREFUSED || err == ENOTCONN || - err == EPIPE) { + if (err == ECONNABORTED || err == ECONNRESET || err == ECONNREFUSED || + err == ENOTCONN || err == EPIPE) { tcp_drop(sototcpcb(so), err); } else { tcp_sockclosed(sototcpcb(so)); @@ -336,8 +345,8 @@ int sosendoob(struct socket *so) DEBUG_ARG("so = %p", so); DEBUG_ARG("sb->sb_cc = %d", sb->sb_cc); - if (so->so_urgc > 2048) - so->so_urgc = 2048; /* XXXX */ + if (so->so_urgc > sizeof(buff)) + so->so_urgc = sizeof(buff); /* XXXX */ if (sb->sb_rptr < sb->sb_wptr) { /* We can send it directly */ @@ -349,7 +358,7 @@ int sosendoob(struct socket *so) * we must copy all data to a linear buffer then * send it all */ - uint32_t urgc = so->so_urgc; + uint32_t urgc = so->so_urgc; /* Amount of room left in buff */ int len = (sb->sb_data + sb->sb_datalen) - sb->sb_rptr; if (len > urgc) { len = urgc; @@ -357,6 +366,7 @@ int sosendoob(struct socket *so) memcpy(buff, sb->sb_rptr, len); urgc -= len; if (urgc) { + /* We still have some room for the rest */ n = sb->sb_wptr - sb->sb_data; if (n > urgc) { n = urgc; @@ -365,7 +375,7 @@ int sosendoob(struct socket *so) len += n; } n = slirp_send(so, buff, len, (MSG_OOB)); /* |MSG_DONTWAIT)); */ -#ifdef DEBUG +#ifdef SLIRP_DEBUG if (n != len) { DEBUG_ERROR("Didn't send all data urgently XXXXX"); } @@ -493,12 +503,67 @@ void sorecvfrom(struct socket *so) struct sockaddr_storage addr; struct sockaddr_storage saddr, daddr; socklen_t addrlen = sizeof(struct sockaddr_storage); + char buff[256]; + +#ifdef __linux__ + ssize_t size; + struct msghdr msg; + struct iovec iov; + char control[1024]; + + /* First look for errors */ + memset(&msg, 0, sizeof(msg)); + msg.msg_name = &saddr; + msg.msg_namelen = sizeof(saddr); + msg.msg_control = control; + msg.msg_controllen = sizeof(control); + iov.iov_base = buff; + iov.iov_len = sizeof(buff); + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + + size = recvmsg(so->s, &msg, MSG_ERRQUEUE); + if (size >= 0) { + struct cmsghdr *cmsg; + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { + + if (cmsg->cmsg_level == IPPROTO_IP && + cmsg->cmsg_type == IP_RECVERR) { + struct sock_extended_err *ee = + (struct sock_extended_err *) CMSG_DATA(cmsg); + + if (ee->ee_origin == SO_EE_ORIGIN_ICMP) { + /* Got an ICMP error, forward it */ + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *) SO_EE_OFFENDER(ee); + icmp_forward_error(so->so_m, ee->ee_type, ee->ee_code, + 0, NULL, &sin->sin_addr); + } + } + else if (cmsg->cmsg_level == IPPROTO_IPV6 && + cmsg->cmsg_type == IPV6_RECVERR) { + struct sock_extended_err *ee = + (struct sock_extended_err *) CMSG_DATA(cmsg); + + if (ee->ee_origin == SO_EE_ORIGIN_ICMP6) { + /* Got an ICMPv6 error, forward it */ + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *) SO_EE_OFFENDER(ee); + icmp6_forward_error(so->so_m, ee->ee_type, ee->ee_code, + &sin6->sin6_addr); + } + } + } + return; + } +#endif DEBUG_CALL("sorecvfrom"); DEBUG_ARG("so = %p", so); if (so->so_type == IPPROTO_ICMP) { /* This is a "ping" reply */ - char buff[256]; int len; len = recvfrom(so->s, buff, 256, 0, (struct sockaddr *)&addr, &addrlen); @@ -533,9 +598,6 @@ void sorecvfrom(struct socket *so) DEBUG_MISC(" ioctlsocket errno = %d-%s\n", errno, strerror(errno)); return; } - if (n == 0) { - return; - } m = m_get(so->slirp); if (!m) { @@ -624,6 +686,28 @@ void sorecvfrom(struct socket *so) */ saddr = addr; sotranslate_in(so, &saddr); + + /* Perform lazy guest IP address resolution if needed. */ + if (so->so_state & SS_HOSTFWD) { + if (soassign_guest_addr_if_needed(so) < 0) { + DEBUG_MISC(" guest address not available yet"); + switch (so->so_lfamily) { + case AF_INET: + icmp_send_error(so->so_m, ICMP_UNREACH, + ICMP_UNREACH_HOST, 0, + "guest address not available yet"); + break; + case AF_INET6: + icmp6_send_error(so->so_m, ICMP6_UNREACH, + ICMP6_UNREACH_ADDRESS); + break; + default: + g_assert_not_reached(); + } + m_free(m); + return; + } + } daddr = so->lhost.ss; switch (so->so_ffamily) { @@ -679,32 +763,67 @@ int sosendto(struct socket *so, struct mbuf *m) /* * Listen for incoming TCP connections + * On failure errno contains the reason. */ -struct socket *tcp_listen(Slirp *slirp, uint32_t haddr, unsigned hport, - uint32_t laddr, unsigned lport, int flags) +struct socket *tcpx_listen(Slirp *slirp, + const struct sockaddr *haddr, socklen_t haddrlen, + const struct sockaddr *laddr, socklen_t laddrlen, + int flags) { - /* TODO: IPv6 */ - struct sockaddr_in addr; struct socket *so; int s, opt = 1; - socklen_t addrlen = sizeof(addr); - memset(&addr, 0, addrlen); + socklen_t addrlen; - DEBUG_CALL("tcp_listen"); - DEBUG_ARG("haddr = %s", inet_ntoa((struct in_addr){ .s_addr = haddr })); - DEBUG_ARG("hport = %d", ntohs(hport)); - DEBUG_ARG("laddr = %s", inet_ntoa((struct in_addr){ .s_addr = laddr })); - DEBUG_ARG("lport = %d", ntohs(lport)); + DEBUG_CALL("tcpx_listen"); + /* AF_INET6 addresses are bigger than AF_INET, so this is big enough. */ + char addrstr[INET6_ADDRSTRLEN]; + char portstr[6]; + int ret; + switch (haddr->sa_family) { + case AF_INET: + case AF_INET6: + ret = getnameinfo(haddr, haddrlen, addrstr, sizeof(addrstr), portstr, sizeof(portstr), NI_NUMERICHOST|NI_NUMERICSERV); + g_assert(ret == 0); + DEBUG_ARG("hfamily = INET"); + DEBUG_ARG("haddr = %s", addrstr); + DEBUG_ARG("hport = %s", portstr); + break; +#ifndef _WIN32 + case AF_UNIX: + DEBUG_ARG("hfamily = UNIX"); + DEBUG_ARG("hpath = %s", ((struct sockaddr_un *) haddr)->sun_path); + break; +#endif + default: + g_assert_not_reached(); + } + switch (laddr->sa_family) { + case AF_INET: + case AF_INET6: + ret = getnameinfo(laddr, laddrlen, addrstr, sizeof(addrstr), portstr, sizeof(portstr), NI_NUMERICHOST|NI_NUMERICSERV); + g_assert(ret == 0); + DEBUG_ARG("laddr = %s", addrstr); + DEBUG_ARG("lport = %s", portstr); + break; + default: + g_assert_not_reached(); + } DEBUG_ARG("flags = %x", flags); - so = socreate(slirp); + /* + * SS_HOSTFWD sockets can be accepted multiple times, so they can't be + * SS_FACCEPTONCE. Also, SS_HOSTFWD connections can be accepted and + * immediately closed if the guest address isn't available yet, which is + * incompatible with the "accept once" concept. Correct code will never + * request both, so disallow their combination by assertion. + */ + g_assert(!((flags & SS_HOSTFWD) && (flags & SS_FACCEPTONCE))); + + so = socreate(slirp, IPPROTO_TCP); /* Don't tcp_attach... we don't need so_snd nor so_rcv */ - if ((so->so_tcpcb = tcp_newtcpcb(so)) == NULL) { - g_free(so); - return NULL; - } - insque(so, &slirp->tcb); + so->so_tcpcb = tcp_newtcpcb(so); + slirp_insque(so, &slirp->tcb); /* * SS_FACCEPTONCE sockets must time out. @@ -714,20 +833,16 @@ struct socket *tcp_listen(Slirp *slirp, uint32_t haddr, unsigned hport, so->so_state &= SS_PERSISTENT_MASK; so->so_state |= (SS_FACCEPTCONN | flags); - so->so_lfamily = AF_INET; - so->so_lport = lport; /* Kept in network format */ - so->so_laddr.s_addr = laddr; /* Ditto */ - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = haddr; - addr.sin_port = hport; + sockaddr_copy(&so->lhost.sa, sizeof(so->lhost), laddr, laddrlen); - if (((s = slirp_socket(AF_INET, SOCK_STREAM, 0)) < 0) || + s = slirp_socket(haddr->sa_family, SOCK_STREAM, 0); + if ((s < 0) || + (haddr->sa_family == AF_INET6 && slirp_socket_set_v6only(s, (flags & SS_HOSTFWD_V6ONLY) != 0) < 0) || (slirp_socket_set_fast_reuse(s) < 0) || - (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) || + (bind(s, haddr, haddrlen) < 0) || (listen(s, 1) < 0)) { int tmperrno = errno; /* Don't clobber the real reason we failed */ - if (s >= 0) { closesocket(s); } @@ -741,22 +856,34 @@ struct socket *tcp_listen(Slirp *slirp, uint32_t haddr, unsigned hport, return NULL; } setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int)); - opt = 1; - setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(int)); + slirp_socket_set_nodelay(s); - getsockname(s, (struct sockaddr *)&addr, &addrlen); - so->so_ffamily = AF_INET; - so->so_fport = addr.sin_port; - if (addr.sin_addr.s_addr == 0 || - addr.sin_addr.s_addr == loopback_addr.s_addr) - so->so_faddr = slirp->vhost_addr; - else - so->so_faddr = addr.sin_addr; + addrlen = sizeof(so->fhost); + getsockname(s, &so->fhost.sa, &addrlen); + sotranslate_accept(so); so->s = s; return so; } +struct socket *tcp_listen(Slirp *slirp, uint32_t haddr, unsigned hport, + uint32_t laddr, unsigned lport, int flags) +{ + struct sockaddr_in hsa, lsa; + + memset(&hsa, 0, sizeof(hsa)); + hsa.sin_family = AF_INET; + hsa.sin_addr.s_addr = haddr; + hsa.sin_port = hport; + + memset(&lsa, 0, sizeof(lsa)); + lsa.sin_family = AF_INET; + lsa.sin_addr.s_addr = laddr; + lsa.sin_port = lport; + + return tcpx_listen(slirp, (const struct sockaddr *) &hsa, sizeof(hsa), (struct sockaddr *) &lsa, sizeof(lsa), flags); +} + /* * Various session state calls * XXX Should be #define's @@ -941,6 +1068,108 @@ void sotranslate_accept(struct socket *so) } break; + case AF_UNIX: { + /* Translate Unix socket to random ephemeral source port. We obtain + * this source port by binding to port 0 so that the OS allocates a + * port for us. If this fails, we fall back to choosing a random port + * with a random number generator. */ + int s; + struct sockaddr_in in_addr; + struct sockaddr_in6 in6_addr; + socklen_t in_addr_len; + + if (so->slirp->in_enabled) { + so->so_ffamily = AF_INET; + so->so_faddr = slirp->vhost_addr; + so->so_fport = 0; + + switch (so->so_type) { + case IPPROTO_TCP: + s = slirp_socket(PF_INET, SOCK_STREAM, 0); + break; + case IPPROTO_UDP: + s = slirp_socket(PF_INET, SOCK_DGRAM, 0); + break; + default: + g_assert_not_reached(); + break; + } + if (s < 0) { + g_error("Ephemeral slirp_socket() allocation failed"); + goto unix2inet_cont; + } + memset(&in_addr, 0, sizeof(in_addr)); + in_addr.sin_family = AF_INET; + in_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + in_addr.sin_port = htons(0); + if (bind(s, (struct sockaddr *) &in_addr, sizeof(in_addr))) { + g_error("Ephemeral bind() failed"); + closesocket(s); + goto unix2inet_cont; + } + in_addr_len = sizeof(in_addr); + if (getsockname(s, (struct sockaddr *) &in_addr, &in_addr_len)) { + g_error("Ephemeral getsockname() failed"); + closesocket(s); + goto unix2inet_cont; + } + so->s_aux = s; + so->so_fport = in_addr.sin_port; + +unix2inet_cont: + if (!so->so_fport) { + g_warning("Falling back to random port allocation"); + so->so_fport = htons(g_rand_int_range(slirp->grand, 49152, 65536)); + } + } else if (so->slirp->in6_enabled) { + so->so_ffamily = AF_INET6; + so->so_faddr6 = slirp->vhost_addr6; + so->so_fport6 = 0; + + switch (so->so_type) { + case IPPROTO_TCP: + s = slirp_socket(PF_INET6, SOCK_STREAM, 0); + break; + case IPPROTO_UDP: + s = slirp_socket(PF_INET6, SOCK_DGRAM, 0); + break; + default: + g_assert_not_reached(); + break; + } + if (s < 0) { + g_error("Ephemeral slirp_socket() allocation failed"); + goto unix2inet6_cont; + } + memset(&in6_addr, 0, sizeof(in6_addr)); + in6_addr.sin6_family = AF_INET6; + in6_addr.sin6_addr = in6addr_loopback; + in6_addr.sin6_port = htons(0); + if (bind(s, (struct sockaddr *) &in6_addr, sizeof(in6_addr))) { + g_error("Ephemeral bind() failed"); + closesocket(s); + goto unix2inet6_cont; + } + in_addr_len = sizeof(in6_addr); + if (getsockname(s, (struct sockaddr *) &in6_addr, &in_addr_len)) { + g_error("Ephemeral getsockname() failed"); + closesocket(s); + goto unix2inet6_cont; + } + so->s_aux = s; + so->so_fport6 = in6_addr.sin6_port; + +unix2inet6_cont: + if (!so->so_fport6) { + g_warning("Falling back to random port allocation"); + so->so_fport6 = htons(g_rand_int_range(slirp->grand, 49152, 65536)); + } + } else { + g_assert_not_reached(); + } + break; + } /* case AF_UNIX */ + default: break; } @@ -952,3 +1181,53 @@ void sodrop(struct socket *s, int num) s->slirp->cb->notify(s->slirp->opaque); } } + +/* + * Translate "addr-any" in so->lhost to the guest's actual address. + * Returns 0 for success, or -1 if the guest doesn't have an address yet + * with errno set to EHOSTUNREACH. + * + * The guest address is taken from the first entry in the ARP table for IPv4 + * and the first entry in the NDP table for IPv6. + * Note: The IPv4 path isn't exercised yet as all hostfwd "" guest translations + * are handled immediately by using slirp->vdhcp_startaddr. + */ +int soassign_guest_addr_if_needed(struct socket *so) +{ + Slirp *slirp = so->slirp; + /* AF_INET6 addresses are bigger than AF_INET, so this is big enough. */ + char addrstr[INET6_ADDRSTRLEN]; + char portstr[6]; + + g_assert(so->so_state & SS_HOSTFWD); + + switch (so->so_ffamily) { + case AF_INET: + if (so->so_laddr.s_addr == INADDR_ANY) { + g_assert_not_reached(); + } + break; + + case AF_INET6: + if (in6_zero(&so->so_laddr6)) { + int ret; + if (in6_zero(&slirp->ndp_table.guest_in6_addr)) { + errno = EHOSTUNREACH; + return -1; + } + so->so_laddr6 = slirp->ndp_table.guest_in6_addr; + ret = getnameinfo((const struct sockaddr *) &so->lhost.ss, + sizeof(so->lhost.ss), addrstr, sizeof(addrstr), + portstr, sizeof(portstr), + NI_NUMERICHOST|NI_NUMERICSERV); + g_assert(ret == 0); + DEBUG_MISC("%s: new ip = [%s]:%s", __func__, addrstr, portstr); + } + break; + + default: + break; + } + + return 0; +} diff --git a/src/network/slirp/socket.h b/src/network/slirp/socket.h index a6a1e5e21..ca8c103ec 100644 --- a/src/network/slirp/socket.h +++ b/src/network/slirp/socket.h @@ -6,16 +6,31 @@ #ifndef SLIRP_SOCKET_H #define SLIRP_SOCKET_H +#include + +#ifndef _WIN32 +#include +#endif + #include "misc.h" +#include "sbuf.h" #define SO_EXPIRE 240000 #define SO_EXPIREFAST 10000 +/* Helps unify some in/in6 routines. */ +union in4or6_addr { + struct in_addr addr4; + struct in6_addr addr6; +}; +typedef union in4or6_addr in4or6_addr; + /* * Our socket structure */ union slirp_sockaddr { + struct sockaddr sa; struct sockaddr_storage ss; struct sockaddr_in sin; struct sockaddr_in6 sin6; @@ -25,6 +40,8 @@ struct socket { struct socket *so_next, *so_prev; /* For a linked list of sockets */ int s; /* The actual socket */ + int s_aux; /* An auxiliary socket for miscellaneous use. Currently used to + * reserve OS ports in UNIX-to-inet translation. */ struct gfwd_list *guestfwd; int pollfds_idx; /* GPollFD GArray index */ @@ -55,7 +72,8 @@ struct socket { uint8_t so_iptos; /* Type of service */ uint8_t so_emu; /* Is the socket emulated? */ - uint8_t so_type; /* Type of socket, UDP or TCP */ + uint8_t so_type; /* Protocol of the socket. May be 0 if loading old + * states. */ int32_t so_state; /* internal state flags SS_*, below */ struct tcpcb *so_tcpcb; /* pointer to TCP protocol control block */ @@ -97,9 +115,10 @@ struct socket { #define SS_HOSTFWD 0x1000 /* Socket describes host->guest forwarding */ #define SS_INCOMING \ 0x2000 /* Connection was initiated by a host on the internet */ +#define SS_HOSTFWD_V6ONLY 0x4000 /* Only bind on v6 addresses */ -static inline int sockaddr_equal(struct sockaddr_storage *a, - struct sockaddr_storage *b) +static inline int sockaddr_equal(const struct sockaddr_storage *a, + const struct sockaddr_storage *b) { if (a->ss_family != b->ss_family) { return 0; @@ -107,17 +126,24 @@ static inline int sockaddr_equal(struct sockaddr_storage *a, switch (a->ss_family) { case AF_INET: { - struct sockaddr_in *a4 = (struct sockaddr_in *)a; - struct sockaddr_in *b4 = (struct sockaddr_in *)b; + const struct sockaddr_in *a4 = (const struct sockaddr_in *)a; + const struct sockaddr_in *b4 = (const struct sockaddr_in *)b; return a4->sin_addr.s_addr == b4->sin_addr.s_addr && a4->sin_port == b4->sin_port; } case AF_INET6: { - struct sockaddr_in6 *a6 = (struct sockaddr_in6 *)a; - struct sockaddr_in6 *b6 = (struct sockaddr_in6 *)b; + const struct sockaddr_in6 *a6 = (const struct sockaddr_in6 *)a; + const struct sockaddr_in6 *b6 = (const struct sockaddr_in6 *)b; return (in6_equal(&a6->sin6_addr, &b6->sin6_addr) && a6->sin6_port == b6->sin6_port); } +#ifndef _WIN32 + case AF_UNIX: { + const struct sockaddr_un *aun = (const struct sockaddr_un *)a; + const struct sockaddr_un *bun = (const struct sockaddr_un *)b; + return strncmp(aun->sun_path, bun->sun_path, sizeof(aun->sun_path)) == 0; + } +#endif default: g_assert_not_reached(); } @@ -125,21 +151,33 @@ static inline int sockaddr_equal(struct sockaddr_storage *a, return 0; } -static inline socklen_t sockaddr_size(struct sockaddr_storage *a) +static inline socklen_t sockaddr_size(const struct sockaddr_storage *a) { switch (a->ss_family) { case AF_INET: return sizeof(struct sockaddr_in); case AF_INET6: return sizeof(struct sockaddr_in6); +#ifndef _WIN32 + case AF_UNIX: + return sizeof(struct sockaddr_un); +#endif default: g_assert_not_reached(); } } +static inline void sockaddr_copy(struct sockaddr *dst, socklen_t dstlen, const struct sockaddr *src, socklen_t srclen) +{ + socklen_t len = sockaddr_size((const struct sockaddr_storage *) src); + g_assert(len <= srclen); + g_assert(len <= dstlen); + memcpy(dst, src, len); +} + struct socket *solookup(struct socket **, struct socket *, struct sockaddr_storage *, struct sockaddr_storage *); -struct socket *socreate(Slirp *); +struct socket *socreate(Slirp *, int); void sofree(struct socket *); int soread(struct socket *); int sorecvoob(struct socket *); @@ -148,6 +186,10 @@ int sowrite(struct socket *); void sorecvfrom(struct socket *); int sosendto(struct socket *, struct mbuf *); struct socket *tcp_listen(Slirp *, uint32_t, unsigned, uint32_t, unsigned, int); +struct socket *tcpx_listen(Slirp *slirp, + const struct sockaddr *haddr, socklen_t haddrlen, + const struct sockaddr *laddr, socklen_t laddrlen, + int flags); void soisfconnecting(register struct socket *); void soisfconnected(register struct socket *); void sofwdrain(struct socket *); @@ -159,6 +201,6 @@ int sotranslate_out(struct socket *, struct sockaddr_storage *); void sotranslate_in(struct socket *, struct sockaddr_storage *); void sotranslate_accept(struct socket *); void sodrop(struct socket *, int num); - +int soassign_guest_addr_if_needed(struct socket *so); #endif /* SLIRP_SOCKET_H */ diff --git a/src/network/slirp/state.c b/src/network/slirp/state.c index 22af77b25..870854747 100644 --- a/src/network/slirp/state.c +++ b/src/network/slirp/state.c @@ -344,7 +344,7 @@ int slirp_state_load(Slirp *slirp, int version_id, SlirpReadCb read_cb, while (slirp_istream_read_u8(&f)) { int ret; - struct socket *so = socreate(slirp); + struct socket *so = socreate(slirp, -1); ret = slirp_vmstate_load_state(&f, &vmstate_slirp_socket, so, version_id); diff --git a/src/network/slirp/tcp.h b/src/network/slirp/tcp.h index 9c4a6b693..211dfec39 100644 --- a/src/network/slirp/tcp.h +++ b/src/network/slirp/tcp.h @@ -55,7 +55,7 @@ struct tcphdr { uint16_t th_dport; /* destination port */ tcp_seq th_seq; /* sequence number */ tcp_seq th_ack; /* acknowledgement number */ -#if G_BYTE_ORDER == G_BIG_ENDIAN +#if (G_BYTE_ORDER == G_BIG_ENDIAN) && !defined(_MSC_VER) uint8_t th_off : 4, /* data offset */ th_x2 : 4; /* (unused) */ #else diff --git a/src/network/slirp/tcp_input.c b/src/network/slirp/tcp_input.c index d55b0c81d..ecca972ee 100644 --- a/src/network/slirp/tcp_input.c +++ b/src/network/slirp/tcp_input.c @@ -146,14 +146,14 @@ static int tcp_reass(register struct tcpcb *tp, register struct tcpiphdr *ti, } q = tcpiphdr_next(q); m = tcpiphdr_prev(q)->ti_mbuf; - remque(tcpiphdr2qlink(tcpiphdr_prev(q))); + slirp_remque(tcpiphdr2qlink(tcpiphdr_prev(q))); m_free(m); } /* * Stick new segment in its place. */ - insque(tcpiphdr2qlink(ti), tcpiphdr2qlink(tcpiphdr_prev(q))); + slirp_insque(tcpiphdr2qlink(ti), tcpiphdr2qlink(tcpiphdr_prev(q))); present: /* @@ -170,7 +170,7 @@ present: do { tp->rcv_nxt += ti->ti_len; flags = ti->ti_flags & TH_FIN; - remque(tcpiphdr2qlink(ti)); + slirp_remque(tcpiphdr2qlink(ti)); m = ti->ti_mbuf; ti = tcpiphdr_next(ti); if (so->so_state & SS_FCANTSENDMORE) @@ -215,6 +215,9 @@ void tcp_input(struct mbuf *m, int iphlen, struct socket *inso, DEBUG_CALL("tcp_input"); DEBUG_ARG("m = %p iphlen = %2d inso = %p", m, iphlen, inso); + memset(&lhost, 0, sizeof(struct sockaddr_storage)); + memset(&fhost, 0, sizeof(struct sockaddr_storage)); + /* * If called with m == 0, then we're continuing the connect */ @@ -233,6 +236,16 @@ void tcp_input(struct mbuf *m, int iphlen, struct socket *inso, goto cont_conn; } slirp = m->slirp; + switch (af) { + case AF_INET: + M_DUP_DEBUG(slirp, m, 0, + sizeof(struct tcpiphdr) - sizeof(struct ip) - sizeof(struct tcphdr)); + break; + case AF_INET6: + M_DUP_DEBUG(slirp, m, 0, + sizeof(struct tcpiphdr) - sizeof(struct ip6) - sizeof(struct tcphdr)); + break; + } ip = mtod(m, struct ip *); ip6 = mtod(m, struct ip6 *); @@ -407,7 +420,7 @@ findso: if ((tiflags & (TH_SYN | TH_FIN | TH_RST | TH_URG | TH_ACK)) != TH_SYN) goto dropwithreset; - so = socreate(slirp); + so = socreate(slirp, IPPROTO_TCP); tcp_attach(so); sbreserve(&so->so_snd, TCP_SNDSPACE); @@ -524,7 +537,7 @@ findso: * we don't need this.. XXX??? */ if (so->so_snd.sb_cc) - (void)tcp_output(tp); + tcp_output(tp); return; } @@ -775,7 +788,7 @@ findso: soisfconnected(so); tp->t_state = TCPS_ESTABLISHED; - (void)tcp_reass(tp, (struct tcpiphdr *)0, (struct mbuf *)0); + tcp_reass(tp, (struct tcpiphdr *)0, (struct mbuf *)0); /* * if we didn't have to retransmit the SYN, * use its rtt as our initial srtt & rtt var. @@ -977,7 +990,7 @@ findso: soisfconnected(so); } - (void)tcp_reass(tp, (struct tcpiphdr *)0, (struct mbuf *)0); + tcp_reass(tp, (struct tcpiphdr *)0, (struct mbuf *)0); tp->snd_wl1 = ti->ti_seq - 1; /* Avoid ack processing; snd_una==ti_ack => dup ack */ goto synrx_to_est; @@ -1040,7 +1053,7 @@ findso: tp->t_rtt = 0; tp->snd_nxt = ti->ti_ack; tp->snd_cwnd = tp->t_maxseg; - (void)tcp_output(tp); + tcp_output(tp); tp->snd_cwnd = tp->snd_ssthresh + tp->t_maxseg * tp->t_dupacks; if (SEQ_GT(onxt, tp->snd_nxt)) @@ -1048,7 +1061,7 @@ findso: goto drop; } else if (tp->t_dupacks > TCPREXMTTHRESH) { tp->snd_cwnd += tp->t_maxseg; - (void)tcp_output(tp); + tcp_output(tp); goto drop; } } else @@ -1332,7 +1345,7 @@ dodata: * Return any desired output. */ if (needoutput || (tp->t_flags & TF_ACKNOW)) { - (void)tcp_output(tp); + tcp_output(tp); } return; @@ -1345,7 +1358,7 @@ dropafterack: goto drop; m_free(m); tp->t_flags |= TF_ACKNOW; - (void)tcp_output(tp); + tcp_output(tp); return; dropwithreset: @@ -1399,7 +1412,7 @@ static void tcp_dooptions(struct tcpcb *tp, uint8_t *cp, int cnt, continue; memcpy((char *)&mss, (char *)cp + 2, sizeof(mss)); NTOHS(mss); - (void)tcp_mss(tp, mss); /* sets t_maxseg */ + tcp_mss(tp, mss); /* sets t_maxseg */ break; } } diff --git a/src/network/slirp/tcp_subr.c b/src/network/slirp/tcp_subr.c index a1016d90d..112448483 100644 --- a/src/network/slirp/tcp_subr.c +++ b/src/network/slirp/tcp_subr.c @@ -303,7 +303,7 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err) if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_state = TCPS_CLOSED; - (void)tcp_output(tp); + tcp_output(tp); } return (tcp_close(tp)); } @@ -329,7 +329,7 @@ struct tcpcb *tcp_close(struct tcpcb *tp) while (!tcpfrag_list_end(t, tp)) { t = tcpiphdr_next(t); m = tcpiphdr_prev(t)->ti_mbuf; - remque(tcpiphdr2qlink(tcpiphdr_prev(t))); + slirp_remque(tcpiphdr2qlink(tcpiphdr_prev(t))); m_free(m); } g_free(tp); @@ -421,7 +421,7 @@ int tcp_fconnect(struct socket *so, unsigned short af) struct sockaddr_storage addr; slirp_set_nonblock(s); - so->slirp->cb->register_poll_fd(so->s, so->slirp->opaque); + so->slirp->cb->register_poll_fd(s, so->slirp->opaque); slirp_socket_set_fast_reuse(s); opt = 1; setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt)); @@ -464,12 +464,54 @@ void tcp_connect(struct socket *inso) Slirp *slirp = inso->slirp; struct socket *so; struct sockaddr_storage addr; - socklen_t addrlen = sizeof(struct sockaddr_storage); + socklen_t addrlen; struct tcpcb *tp; - int s, opt; + int s, opt, ret; + /* AF_INET6 addresses are bigger than AF_INET, so this is big enough. */ + char addrstr[INET6_ADDRSTRLEN]; + char portstr[6]; DEBUG_CALL("tcp_connect"); DEBUG_ARG("inso = %p", inso); + switch (inso->lhost.ss.ss_family) { + case AF_INET: + addrlen = sizeof(struct sockaddr_in); + break; + case AF_INET6: + addrlen = sizeof(struct sockaddr_in6); + break; + default: + g_assert_not_reached(); + } + ret = getnameinfo((const struct sockaddr *) &inso->lhost.ss, addrlen, addrstr, sizeof(addrstr), portstr, sizeof(portstr), NI_NUMERICHOST|NI_NUMERICSERV); + g_assert(ret == 0); + DEBUG_ARG("ip = [%s]:%s", addrstr, portstr); + DEBUG_ARG("so_state = 0x%x", inso->so_state); + + /* Perform lazy guest IP address resolution if needed. */ + if (inso->so_state & SS_HOSTFWD) { + /* + * We can only reject the connection request by accepting it and + * then immediately closing it. Note that SS_FACCEPTONCE sockets can't + * get here. + */ + if (soassign_guest_addr_if_needed(inso) < 0) { + /* + * Guest address isn't available yet. We could either try to defer + * completing this connection request until the guest address is + * available, or punt. It's easier to punt. Otherwise we need to + * complicate the mechanism by which we're called to defer calling + * us again until the guest address is available. + */ + DEBUG_MISC(" guest address not available yet"); + addrlen = sizeof(addr); + s = accept(inso->s, (struct sockaddr *)&addr, &addrlen); + if (s >= 0) { + closesocket(s); + } + return; + } + } /* * If it's an SS_ACCEPTONCE socket, no need to socreate() @@ -479,7 +521,7 @@ void tcp_connect(struct socket *inso) /* FACCEPTONCE already have a tcpcb */ so = inso; } else { - so = socreate(slirp); + so = socreate(slirp, IPPROTO_TCP); tcp_attach(so); so->lhost = inso->lhost; so->so_ffamily = inso->so_ffamily; @@ -487,13 +529,14 @@ void tcp_connect(struct socket *inso) tcp_mss(sototcpcb(so), 0); + addrlen = sizeof(addr); s = accept(inso->s, (struct sockaddr *)&addr, &addrlen); if (s < 0) { tcp_close(sototcpcb(so)); /* This will sofree() as well */ return; } slirp_set_nonblock(s); - so->slirp->cb->register_poll_fd(so->s, so->slirp->opaque); + so->slirp->cb->register_poll_fd(s, so->slirp->opaque); slirp_socket_set_fast_reuse(s); opt = 1; setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int)); @@ -534,7 +577,7 @@ void tcp_connect(struct socket *inso) void tcp_attach(struct socket *so) { so->so_tcpcb = tcp_newtcpcb(so); - insque(so, &so->slirp->tcb); + slirp_insque(so, &so->slirp->tcb); } /* diff --git a/src/network/slirp/tcp_timer.c b/src/network/slirp/tcp_timer.c index 102023e7c..bc4db2d15 100644 --- a/src/network/slirp/tcp_timer.c +++ b/src/network/slirp/tcp_timer.c @@ -52,7 +52,7 @@ void tcp_fasttimo(Slirp *slirp) (tp->t_flags & TF_DELACK)) { tp->t_flags &= ~TF_DELACK; tp->t_flags |= TF_ACKNOW; - (void)tcp_output(tp); + tcp_output(tp); } } @@ -233,7 +233,7 @@ static struct tcpcb *tcp_timers(register struct tcpcb *tp, int timer) tp->snd_ssthresh = win * tp->t_maxseg; tp->t_dupacks = 0; } - (void)tcp_output(tp); + tcp_output(tp); break; /* @@ -243,7 +243,7 @@ static struct tcpcb *tcp_timers(register struct tcpcb *tp, int timer) case TCPT_PERSIST: tcp_setpersist(tp); tp->t_force = 1; - (void)tcp_output(tp); + tcp_output(tp); tp->t_force = 0; break; diff --git a/src/network/slirp/tcpip.h b/src/network/slirp/tcpip.h index d3df02149..a0fb2282f 100644 --- a/src/network/slirp/tcpip.h +++ b/src/network/slirp/tcpip.h @@ -88,8 +88,8 @@ struct tcpiphdr { /* This is the difference between the size of a tcpiphdr structure, and the * size of actual ip+tcp headers, rounded up since we need to align data. */ #define TCPIPHDR_DELTA \ - (MAX(0, (sizeof(struct tcpiphdr) - sizeof(struct ip) - \ - sizeof(struct tcphdr) + 3) & \ + (MAX(0, ((int) sizeof(struct tcpiphdr) - (int) sizeof(struct ip) - \ + (int) sizeof(struct tcphdr) + 3) & \ ~3)) /* diff --git a/src/network/slirp/tftp.c b/src/network/slirp/tftp.c index c6950ee10..a19c889d3 100644 --- a/src/network/slirp/tftp.c +++ b/src/network/slirp/tftp.c @@ -50,7 +50,7 @@ static void tftp_session_terminate(struct tftp_session *spt) } static int tftp_session_allocate(Slirp *slirp, struct sockaddr_storage *srcsas, - struct tftp_t *tp) + struct tftphdr *hdr) { struct tftp_session *spt; int k; @@ -75,7 +75,7 @@ found: memcpy(&spt->client_addr, srcsas, sockaddr_size(srcsas)); spt->fd = -1; spt->block_size = 512; - spt->client_port = tp->udp.uh_sport; + spt->client_port = hdr->udp.uh_sport; spt->slirp = slirp; tftp_session_update(spt); @@ -84,7 +84,7 @@ found: } static int tftp_session_find(Slirp *slirp, struct sockaddr_storage *srcsas, - struct tftp_t *tp) + struct tftphdr *hdr) { struct tftp_session *spt; int k; @@ -94,7 +94,7 @@ static int tftp_session_find(Slirp *slirp, struct sockaddr_storage *srcsas, if (tftp_session_in_use(spt)) { if (sockaddr_equal(&spt->client_addr, srcsas)) { - if (spt->client_port == tp->udp.uh_sport) { + if (spt->client_port == hdr->udp.uh_sport) { return k; } } @@ -148,13 +148,13 @@ static struct tftp_t *tftp_prep_mbuf_data(struct tftp_session *spt, } static void tftp_udp_output(struct tftp_session *spt, struct mbuf *m, - struct tftp_t *recv_tp) + struct tftphdr *hdr) { if (spt->client_addr.ss_family == AF_INET6) { struct sockaddr_in6 sa6, da6; sa6.sin6_addr = spt->slirp->vhost_addr6; - sa6.sin6_port = recv_tp->udp.uh_dport; + sa6.sin6_port = hdr->udp.uh_dport; da6.sin6_addr = ((struct sockaddr_in6 *)&spt->client_addr)->sin6_addr; da6.sin6_port = spt->client_port; @@ -163,7 +163,7 @@ static void tftp_udp_output(struct tftp_session *spt, struct mbuf *m, struct sockaddr_in sa4, da4; sa4.sin_addr = spt->slirp->vhost_addr; - sa4.sin_port = recv_tp->udp.uh_dport; + sa4.sin_port = hdr->udp.uh_dport; da4.sin_addr = ((struct sockaddr_in *)&spt->client_addr)->sin_addr; da4.sin_port = spt->client_port; @@ -185,14 +185,14 @@ static int tftp_send_oack(struct tftp_session *spt, const char *keys[], tp = tftp_prep_mbuf_data(spt, m); - tp->tp_op = htons(TFTP_OACK); + tp->hdr.tp_op = htons(TFTP_OACK); for (i = 0; i < nb; i++) { n += slirp_fmt0(tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%s", keys[i]); n += slirp_fmt0(tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%u", values[i]); } - m->m_len = G_SIZEOF_MEMBER(struct tftp_t, tp_op) + n; - tftp_udp_output(spt, m, recv_tp); + m->m_len = G_SIZEOF_MEMBER(struct tftp_t, hdr.tp_op) + n; + tftp_udp_output(spt, m, &recv_tp->hdr); return 0; } @@ -213,21 +213,21 @@ static void tftp_send_error(struct tftp_session *spt, uint16_t errorcode, tp = tftp_prep_mbuf_data(spt, m); - tp->tp_op = htons(TFTP_ERROR); + tp->hdr.tp_op = htons(TFTP_ERROR); tp->x.tp_error.tp_error_code = htons(errorcode); slirp_pstrcpy((char *)tp->x.tp_error.tp_msg, sizeof(tp->x.tp_error.tp_msg), msg); m->m_len = sizeof(struct tftp_t) - (TFTP_BLOCKSIZE_MAX + 2) + 3 + strlen(msg) - sizeof(struct udphdr); - tftp_udp_output(spt, m, recv_tp); + tftp_udp_output(spt, m, &recv_tp->hdr); out: tftp_session_terminate(spt); } static void tftp_send_next_block(struct tftp_session *spt, - struct tftp_t *recv_tp) + struct tftphdr *hdr) { struct mbuf *m; struct tftp_t *tp; @@ -241,7 +241,7 @@ static void tftp_send_next_block(struct tftp_session *spt, tp = tftp_prep_mbuf_data(spt, m); - tp->tp_op = htons(TFTP_DATA); + tp->hdr.tp_op = htons(TFTP_DATA); tp->x.tp_data.tp_block_nr = htons((spt->block_nr + 1) & 0xffff); nobytes = tftp_read_data(spt, spt->block_nr, tp->x.tp_data.tp_buf, @@ -259,7 +259,7 @@ static void tftp_send_next_block(struct tftp_session *spt, m->m_len = sizeof(struct tftp_t) - (TFTP_BLOCKSIZE_MAX - nobytes) - sizeof(struct udphdr); - tftp_udp_output(spt, m, recv_tp); + tftp_udp_output(spt, m, hdr); if (nobytes == spt->block_size) { tftp_session_update(spt); @@ -282,12 +282,12 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas, int nb_options = 0; /* check if a session already exists and if so terminate it */ - s = tftp_session_find(slirp, srcsas, tp); + s = tftp_session_find(slirp, srcsas, &tp->hdr); if (s >= 0) { tftp_session_terminate(&slirp->tftp_sessions[s]); } - s = tftp_session_allocate(slirp, srcsas, tp); + s = tftp_session_allocate(slirp, srcsas, &tp->hdr); if (s < 0) { return; @@ -413,29 +413,29 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas, } spt->block_nr = 0; - tftp_send_next_block(spt, tp); + tftp_send_next_block(spt, &tp->hdr); } static void tftp_handle_ack(Slirp *slirp, struct sockaddr_storage *srcsas, - struct tftp_t *tp, int pktlen) + struct tftphdr *hdr) { int s; - s = tftp_session_find(slirp, srcsas, tp); + s = tftp_session_find(slirp, srcsas, hdr); if (s < 0) { return; } - tftp_send_next_block(&slirp->tftp_sessions[s], tp); + tftp_send_next_block(&slirp->tftp_sessions[s], hdr); } static void tftp_handle_error(Slirp *slirp, struct sockaddr_storage *srcsas, - struct tftp_t *tp, int pktlen) + struct tftphdr *hdr) { int s; - s = tftp_session_find(slirp, srcsas, tp); + s = tftp_session_find(slirp, srcsas, hdr); if (s < 0) { return; @@ -446,19 +446,25 @@ static void tftp_handle_error(Slirp *slirp, struct sockaddr_storage *srcsas, void tftp_input(struct sockaddr_storage *srcsas, struct mbuf *m) { - struct tftp_t *tp = (struct tftp_t *)m->m_data; + struct tftphdr *hdr = mtod_check(m, sizeof(struct tftphdr)); - switch (ntohs(tp->tp_op)) { + if (hdr == NULL) { + return; + } + + switch (ntohs(hdr->tp_op)) { case TFTP_RRQ: - tftp_handle_rrq(m->slirp, srcsas, tp, m->m_len); + tftp_handle_rrq(m->slirp, srcsas, + mtod(m, struct tftp_t *), + m->m_len); break; case TFTP_ACK: - tftp_handle_ack(m->slirp, srcsas, tp, m->m_len); + tftp_handle_ack(m->slirp, srcsas, hdr); break; case TFTP_ERROR: - tftp_handle_error(m->slirp, srcsas, tp, m->m_len); + tftp_handle_error(m->slirp, srcsas, hdr); break; } } diff --git a/src/network/slirp/tftp.h b/src/network/slirp/tftp.h index 663485328..a0784885c 100644 --- a/src/network/slirp/tftp.h +++ b/src/network/slirp/tftp.h @@ -23,9 +23,19 @@ #if defined(_MSC_VER) && !defined (__clang__) #pragma pack(push, 1) #endif -struct tftp_t { +struct tftphdr { struct udphdr udp; uint16_t tp_op; +} SLIRP_PACKED; +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(pop) +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma pack(push, 1) +#endif +struct tftp_t { + struct tftphdr hdr; union { struct { uint16_t tp_block_nr; diff --git a/src/network/slirp/tinyglib.c b/src/network/slirp/tinyglib.c index 702c39ad7..7b1e27bc5 100644 --- a/src/network/slirp/tinyglib.c +++ b/src/network/slirp/tinyglib.c @@ -16,6 +16,7 @@ */ #include #include +#include /* Must be a function, as libslirp redefines it as a macro. */ gboolean @@ -28,6 +29,17 @@ g_spawn_async_with_fds(const gchar *working_directory, gchar **argv, return 0; } +/* Implementation borrowed from GLib itself. */ +gboolean +g_str_has_prefix (const gchar *str, + const gchar *prefix) +{ + g_return_val_if_fail (str != NULL, false); + g_return_val_if_fail (prefix != NULL, false); + + return strncmp (str, prefix, strlen (prefix)) == 0; +} + /* Needs bounds checking, but not really used by libslirp. */ GString * g_string_new(gchar *base) diff --git a/src/network/slirp/udp.c b/src/network/slirp/udp.c index 0ad44d7c0..bd4dbebde 100644 --- a/src/network/slirp/udp.c +++ b/src/network/slirp/udp.c @@ -67,6 +67,8 @@ void udp_cleanup(Slirp *slirp) void udp_input(register struct mbuf *m, int iphlen) { Slirp *slirp = m->slirp; + M_DUP_DEBUG(slirp, m, 0, 0); + register struct ip *ip; register struct udphdr *uh; int len; @@ -74,6 +76,7 @@ void udp_input(register struct mbuf *m, int iphlen) struct socket *so; struct sockaddr_storage lhost; struct sockaddr_in *lhost4; + int ttl; DEBUG_CALL("udp_input"); DEBUG_ARG("m = %p", m); @@ -93,7 +96,10 @@ void udp_input(register struct mbuf *m, int iphlen) /* * Get IP and UDP header together in first mbuf. */ - ip = mtod(m, struct ip *); + ip = mtod_check(m, iphlen + sizeof(struct udphdr)); + if (ip == NULL) { + goto bad; + } uh = (struct udphdr *)((char *)ip + iphlen); /* @@ -171,7 +177,7 @@ void udp_input(register struct mbuf *m, int iphlen) * If there's no socket for this packet, * create one */ - so = socreate(slirp); + so = socreate(slirp, IPPROTO_UDP); if (udp_attach(so, AF_INET) == -1) { DEBUG_MISC(" udp_attach errno = %d-%s", errno, strerror(errno)); sofree(so); @@ -202,6 +208,20 @@ void udp_input(register struct mbuf *m, int iphlen) m->m_len -= iphlen; m->m_data += iphlen; + /* + * Check for TTL + */ + ttl = save_ip.ip_ttl-1; + if (ttl <= 0) { + m->m_len += iphlen; + m->m_data -= iphlen; + *ip = save_ip; + DEBUG_MISC("udp ttl exceeded"); + icmp_send_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, 0, NULL); + goto bad; + } + setsockopt(so->s, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)); + /* * Now we sendto() the packet. */ @@ -230,14 +250,21 @@ bad: int udp_output(struct socket *so, struct mbuf *m, struct sockaddr_in *saddr, struct sockaddr_in *daddr, int iptos) { + Slirp *slirp = m->slirp; +// char addr[INET_ADDRSTRLEN]; + + M_DUP_DEBUG(slirp, m, 0, sizeof(struct udpiphdr)); + register struct udpiphdr *ui; int error = 0; +/* DEBUG_CALL("udp_output"); DEBUG_ARG("so = %p", so); DEBUG_ARG("m = %p", m); - DEBUG_ARG("saddr = %s", inet_ntoa(saddr->sin_addr)); - DEBUG_ARG("daddr = %s", inet_ntoa(daddr->sin_addr)); + DEBUG_ARG("saddr = %s", inet_ntop(AF_INET, &saddr->sin_addr, addr, sizeof(addr))); + DEBUG_ARG("daddr = %s", inet_ntop(AF_INET, &daddr->sin_addr, addr, sizeof(addr))); +*/ /* * Adjust for header @@ -288,9 +315,27 @@ int udp_attach(struct socket *so, unsigned short af) so->s = -1; return -1; } + +#ifdef __linux__ + { + int opt = 1; + switch (af) { + case AF_INET: + setsockopt(so->s, IPPROTO_IP, IP_RECVERR, &opt, sizeof(opt)); + break; + case AF_INET6: + setsockopt(so->s, IPPROTO_IPV6, IPV6_RECVERR, &opt, sizeof(opt)); + break; + default: + g_assert_not_reached(); + } + } +#endif + so->so_expire = curtime + SO_EXPIRE; - insque(so, &so->slirp->udb); + slirp_insque(so, &so->slirp->udb); } + so->slirp->cb->register_poll_fd(so->s, so->slirp->opaque); return (so->s); } @@ -321,45 +366,64 @@ static uint8_t udp_tos(struct socket *so) return 0; } -struct socket *udp_listen(Slirp *slirp, uint32_t haddr, unsigned hport, - uint32_t laddr, unsigned lport, int flags) +struct socket *udpx_listen(Slirp *slirp, + const struct sockaddr *haddr, socklen_t haddrlen, + const struct sockaddr *laddr, socklen_t laddrlen, + int flags) { - /* TODO: IPv6 */ - struct sockaddr_in addr; struct socket *so; - socklen_t addrlen = sizeof(struct sockaddr_in); + socklen_t addrlen; + int save_errno; - memset(&addr, 0, sizeof(addr)); - so = socreate(slirp); - so->s = slirp_socket(AF_INET, SOCK_DGRAM, 0); + so = socreate(slirp, IPPROTO_UDP); + so->s = slirp_socket(haddr->sa_family, SOCK_DGRAM, 0); if (so->s < 0) { + save_errno = errno; sofree(so); + errno = save_errno; return NULL; } + if (haddr->sa_family == AF_INET6) + slirp_socket_set_v6only(so->s, (flags & SS_HOSTFWD_V6ONLY) != 0); so->so_expire = curtime + SO_EXPIRE; - insque(so, &slirp->udb); + slirp_insque(so, &slirp->udb); - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = haddr; - addr.sin_port = hport; - - if (bind(so->s, (struct sockaddr *)&addr, addrlen) < 0) { + if (bind(so->s, haddr, haddrlen) < 0) { + save_errno = errno; udp_detach(so); + errno = save_errno; return NULL; } slirp_socket_set_fast_reuse(so->s); - getsockname(so->s, (struct sockaddr *)&addr, &addrlen); - so->fhost.sin = addr; + addrlen = sizeof(so->fhost); + getsockname(so->s, &so->fhost.sa, &addrlen); sotranslate_accept(so); - so->so_lfamily = AF_INET; - so->so_lport = lport; - so->so_laddr.s_addr = laddr; + + sockaddr_copy(&so->lhost.sa, sizeof(so->lhost), laddr, laddrlen); + if (flags != SS_FACCEPTONCE) so->so_expire = 0; - so->so_state &= SS_PERSISTENT_MASK; so->so_state |= SS_ISFCONNECTED | flags; return so; } + +struct socket *udp_listen(Slirp *slirp, uint32_t haddr, unsigned hport, + uint32_t laddr, unsigned lport, int flags) +{ + struct sockaddr_in hsa, lsa; + + memset(&hsa, 0, sizeof(hsa)); + hsa.sin_family = AF_INET; + hsa.sin_addr.s_addr = haddr; + hsa.sin_port = hport; + + memset(&lsa, 0, sizeof(lsa)); + lsa.sin_family = AF_INET; + lsa.sin_addr.s_addr = laddr; + lsa.sin_port = lport; + + return udpx_listen(slirp, (const struct sockaddr *) &hsa, sizeof(hsa), (struct sockaddr *) &lsa, sizeof(lsa), flags); +} diff --git a/src/network/slirp/udp.h b/src/network/slirp/udp.h index c3b83fdc5..47f4ed34d 100644 --- a/src/network/slirp/udp.h +++ b/src/network/slirp/udp.h @@ -34,6 +34,8 @@ #ifndef UDP_H #define UDP_H +#include "socket.h" + #define UDP_TTL 0x60 #define UDP_UDPDATALEN 16192 @@ -80,6 +82,10 @@ void udp_input(register struct mbuf *, int); int udp_attach(struct socket *, unsigned short af); void udp_detach(struct socket *); struct socket *udp_listen(Slirp *, uint32_t, unsigned, uint32_t, unsigned, int); +struct socket *udpx_listen(Slirp *, + const struct sockaddr *haddr, socklen_t haddrlen, + const struct sockaddr *laddr, socklen_t laddrlen, + int flags); int udp_output(struct socket *so, struct mbuf *m, struct sockaddr_in *saddr, struct sockaddr_in *daddr, int iptos); diff --git a/src/network/slirp/udp6.c b/src/network/slirp/udp6.c index 6f9486bbc..effdf77d0 100644 --- a/src/network/slirp/udp6.c +++ b/src/network/slirp/udp6.c @@ -11,12 +11,15 @@ void udp6_input(struct mbuf *m) { Slirp *slirp = m->slirp; + M_DUP_DEBUG(slirp, m, 0, 0); + struct ip6 *ip, save_ip; struct udphdr *uh; int iphlen = sizeof(struct ip6); int len; struct socket *so; struct sockaddr_in6 lhost; + int hop_limit; DEBUG_CALL("udp6_input"); DEBUG_ARG("m = %p", m); @@ -28,7 +31,10 @@ void udp6_input(struct mbuf *m) ip = mtod(m, struct ip6 *); m->m_len -= iphlen; m->m_data += iphlen; - uh = mtod(m, struct udphdr *); + uh = mtod_check(m, sizeof(struct udphdr)); + if (uh == NULL) { + goto bad; + } m->m_len += iphlen; m->m_data -= iphlen; @@ -89,7 +95,7 @@ void udp6_input(struct mbuf *m) if (so == NULL) { /* If there's no socket for this packet, create one. */ - so = socreate(slirp); + so = socreate(slirp, IPPROTO_UDP); if (udp_attach(so, AF_INET6) == -1) { DEBUG_MISC(" udp6_attach errno = %d-%s", errno, strerror(errno)); sofree(so); @@ -110,6 +116,20 @@ void udp6_input(struct mbuf *m) m->m_len -= iphlen; m->m_data += iphlen; + /* + * Check for TTL + */ + hop_limit = save_ip.ip_hl-1; + if (hop_limit <= 0) { + m->m_len += iphlen; + m->m_data -= iphlen; + *ip = save_ip; + DEBUG_MISC("udp ttl exceeded"); + icmp6_send_error(m, ICMP6_TIMXCEED, ICMP6_TIMXCEED_INTRANS); + goto bad; + } + setsockopt(so->s, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &hop_limit, sizeof(hop_limit)); + /* * Now we sendto() the packet. */ @@ -138,6 +158,9 @@ bad: int udp6_output(struct socket *so, struct mbuf *m, struct sockaddr_in6 *saddr, struct sockaddr_in6 *daddr) { + Slirp *slirp = m->slirp; + M_DUP_DEBUG(slirp, m, 0, sizeof(struct ip6) + sizeof(struct udphdr)); + struct ip6 *ip; struct udphdr *uh; diff --git a/src/network/slirp/util.c b/src/network/slirp/util.c index 8478c48d6..7297e5022 100644 --- a/src/network/slirp/util.c +++ b/src/network/slirp/util.c @@ -72,6 +72,7 @@ static void slirp_set_cloexec(int fd) /* * Opens a socket with FD_CLOEXEC set + * On failure errno contains the reason. */ int slirp_socket(int domain, int type, int protocol) { @@ -366,6 +367,7 @@ void slirp_pstrcpy(char *buf, int buf_size, const char *str) *q = '\0'; } +G_GNUC_PRINTF(3, 0) static int slirp_vsnprintf(char *str, size_t size, const char *format, va_list args) { @@ -427,3 +429,14 @@ int slirp_fmt0(char *str, size_t size, const char *format, ...) return rv; } + +const char *slirp_ether_ntoa(const uint8_t *addr, char *out_str, + size_t out_str_size) +{ + assert(out_str_size >= ETH_ADDRSTRLEN); + + slirp_fmt0(out_str, out_str_size, "%02x:%02x:%02x:%02x:%02x:%02x", + addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); + + return out_str; +} diff --git a/src/network/slirp/util.h b/src/network/slirp/util.h index 951bfc57d..0f0123a34 100644 --- a/src/network/slirp/util.h +++ b/src/network/slirp/util.h @@ -30,9 +30,6 @@ #include #include #include -#ifndef _WIN32 -#include -#endif #include #include #include @@ -40,7 +37,9 @@ #ifdef _WIN32 #include #include +#include #else +#include #include #include #include @@ -49,7 +48,7 @@ #if defined(_MSC_VER) && !defined(__clang__) #define SLIRP_PACKED #elif defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) && !defined(__clang__) -#define SLIRP_PACKED __attribute__((gcc_struct, packed)) +#define SLIRP_PACKED __attribute__((gcc_struct, packed)) #else #define SLIRP_PACKED __attribute__((packed)) #endif @@ -59,7 +58,8 @@ #endif #ifndef container_of -#define container_of(ptr, type, member) ((type *)((char *)(ptr) - offsetof(type, member))); +#define container_of(ptr, type, member) \ + ((type *) (((char *)(ptr)) - offsetof(type, member))); #endif #ifndef G_SIZEOF_MEMBER @@ -83,6 +83,7 @@ struct iovec { #define SCALE_MS 1000000 #define ETH_ALEN 6 +#define ETH_ADDRSTRLEN 18 /* "xx:xx:xx:xx:xx:xx", with trailing NUL */ #define ETH_HLEN 14 #define ETH_P_IP (0x0800) /* Internet Protocol packet */ #define ETH_P_ARP (0x0806) /* Address Resolution packet */ @@ -159,6 +160,11 @@ int slirp_inet_aton(const char *cp, struct in_addr *ia); int slirp_socket(int domain, int type, int protocol); void slirp_set_nonblock(int fd); +static inline int slirp_socket_set_v6only(int fd, int v) +{ + return setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &v, sizeof(v)); +} + static inline int slirp_socket_set_nodelay(int fd) { int v = 1; @@ -185,4 +191,11 @@ void slirp_pstrcpy(char *buf, int buf_size, const char *str); int slirp_fmt(char *str, size_t size, const char *format, ...) G_GNUC_PRINTF(3, 4); int slirp_fmt0(char *str, size_t size, const char *format, ...) G_GNUC_PRINTF(3, 4); +/* + * Pretty print a MAC address into out_str. + * As a convenience returns out_str. + */ +const char *slirp_ether_ntoa(const uint8_t *addr, char *out_str, + size_t out_str_len); + #endif diff --git a/src/network/slirp/vmstate.h b/src/network/slirp/vmstate.h index e6bed53a6..b1d40e892 100644 --- a/src/network/slirp/vmstate.h +++ b/src/network/slirp/vmstate.h @@ -175,6 +175,9 @@ enum VMStateFlags { * VMStateField.struct_version_id to tell which version of the * structure we are referencing to use. */ VMS_VSTRUCT = 0x8000, + + /* Marker for end of list */ + VMS_END = 0x10000 }; struct VMStateField { @@ -216,10 +219,17 @@ extern const VMStateInfo slirp_vmstate_info_nullptr; extern const VMStateInfo slirp_vmstate_info_buffer; extern const VMStateInfo slirp_vmstate_info_tmp; +#ifdef __GNUC__ #define type_check_array(t1, t2, n) ((t1(*)[n])0 - (t2 *)0) #define type_check_pointer(t1, t2) ((t1 **)0 - (t2 *)0) #define typeof_field(type, field) typeof(((type *)0)->field) #define type_check(t1, t2) ((t1 *)0 - (t2 *)0) +#else +#define type_check_array(t1, t2, n) 0 +#define type_check_pointer(t1, t2) 0 +#define typeof_field(type, field) (((type *)0)->field) +#define type_check(t1, t2) 0 +#endif #define vmstate_offset_value(_state, _field, _type) \ (offsetof(_state, _field) + type_check(_type, typeof_field(_state, _field))) @@ -388,6 +398,7 @@ extern const VMStateInfo slirp_vmstate_info_tmp; #define VMSTATE_END_OF_LIST() \ { \ + .flags = VMS_END, \ } -#endif +#endif /* VMSTATE_H_ */ diff --git a/src/nvr.c b/src/nvr.c index dccc6be40..4b073c48f 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -12,7 +12,7 @@ * David Hrdlička, * * Copyright 2017-2019 Fred N. van Kempen. - * Copyright 2018,2019 David Hrdlička. + * Copyright 2018-2019 David Hrdlička. * * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the diff --git a/src/nvr_at.c b/src/nvr_at.c index a881444c2..bd0bbe34e 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -194,7 +194,7 @@ * Authors: Fred N. van Kempen, * Miran Grca, * Mahod, - * Sarah Walker, + * Sarah Walker, * * Copyright 2017-2020 Fred N. van Kempen. * Copyright 2016-2020 Miran Grca. diff --git a/src/nvr_ps2.c b/src/nvr_ps2.c index b137cb81b..1ab97d8a3 100644 --- a/src/nvr_ps2.c +++ b/src/nvr_ps2.c @@ -11,9 +11,9 @@ * * * Authors: Fred N. van Kempen, - * Sarah Walker, + * Sarah Walker, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * Copyright 2008-2018 Sarah Walker. * * This program is free software; you can redistribute it and/or modify diff --git a/src/pci.c b/src/pci.c index 7b4464407..f9155e2e3 100644 --- a/src/pci.c +++ b/src/pci.c @@ -12,7 +12,7 @@ * * Authors: Miran Grca, * Fred N. van Kempen, - * Sarah Walker, + * Sarah Walker, * * Copyright 2016-2020 Miran Grca. * Copyright 2017-2020 Fred N. van Kempen. diff --git a/src/pic.c b/src/pic.c index b7ff54e37..bdff7f59c 100644 --- a/src/pic.c +++ b/src/pic.c @@ -587,9 +587,9 @@ picint_common(uint16_t num, int level, int set) if (num & 0x00ff) { if (level) - pic.lines |= (num >> 8); + pic.lines |= (num & 0x00ff); - pic.irr |= num; + pic.irr |= (num & 0x00ff); } } else { smi_irq_status &= ~num; @@ -600,8 +600,8 @@ picint_common(uint16_t num, int level, int set) } if (num & 0x00ff) { - pic.lines &= ~num; - pic.irr &= ~num; + pic.lines &= ~(num & 0x00ff); + pic.irr &= ~(num & 0x00ff); } } diff --git a/src/printer/CMakeLists.txt b/src/printer/CMakeLists.txt index dd07121df..ef7b1d5ec 100644 --- a/src/printer/CMakeLists.txt +++ b/src/printer/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(print OBJECT png.c prt_cpmap.c prt_escp.c prt_text.c prt_ps.c) diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index e7c9e0442..1cca57da0 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -13,8 +13,8 @@ * * Based on code by Frederic Weymann (originally for DosBox.) * - * Copyright 2018,2019 Michael Drüing. - * Copyright 2019,2019 Fred N. van Kempen. + * Copyright 2018-2019 Michael Drüing. + * Copyright 2019 Fred N. van Kempen. * * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the diff --git a/src/printer/prt_text.c b/src/printer/prt_text.c index b67d859b9..506261ccf 100644 --- a/src/printer/prt_text.c +++ b/src/printer/prt_text.c @@ -17,7 +17,7 @@ * * Authors: Fred N. van Kempen, * - * Copyright 2018,2019 Fred N. van Kempen. + * Copyright 2018-2019 Fred N. van Kempen. * * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the diff --git a/src/qt/evdev_mouse.cpp b/src/qt/evdev_mouse.cpp index c3d926285..4b487e65d 100644 --- a/src/qt/evdev_mouse.cpp +++ b/src/qt/evdev_mouse.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Linux/FreeBSD libevdev mouse input module. + * Linux/FreeBSD libevdev mouse input module. * * * - * Authors: Cacodemon345 + * Authors: Cacodemon345 * - * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Cacodemon345 */ #include "evdev_mouse.hpp" #include diff --git a/src/qt/languages/cs-CZ.po b/src/qt/languages/cs-CZ.po index d8fe563fe..5f85c4f81 100644 --- a/src/qt/languages/cs-CZ.po +++ b/src/qt/languages/cs-CZ.po @@ -406,8 +406,17 @@ msgstr "Joystick 3..." msgid "Joystick 4..." msgstr "Joystick 4..." -msgid "Sound card:" -msgstr "Zvuková karta:" +msgid "Sound card 1:" +msgstr "Zvuková karta 1:" + +msgid "Sound card 2:" +msgstr "Zvuková karta 2:" + +msgid "Sound card 3:" +msgstr "Zvuková karta 3:" + +msgid "Sound card 4:" +msgstr "Zvuková karta 4:" msgid "MIDI Out Device:" msgstr "MIDI výstup:" @@ -418,15 +427,6 @@ msgstr "MIDI vstup:" msgid "Standalone MPU-401" msgstr "Samostatný MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Použít zvuk FLOAT32" diff --git a/src/qt/languages/de-DE.po b/src/qt/languages/de-DE.po index 74fa56afa..efbd5f95e 100644 --- a/src/qt/languages/de-DE.po +++ b/src/qt/languages/de-DE.po @@ -406,8 +406,17 @@ msgstr "Joystick 3..." msgid "Joystick 4..." msgstr "Joystick 4..." -msgid "Sound card:" -msgstr "Soundkarte:" +msgid "Sound card 1:" +msgstr "Soundkarte 1:" + +msgid "Sound card 2:" +msgstr "Soundkarte 2:" + +msgid "Sound card 3:" +msgstr "Soundkarte 3:" + +msgid "Sound card 4:" +msgstr "Soundkarte 4:" msgid "MIDI Out Device:" msgstr "MIDI Out-Gerät:" @@ -418,15 +427,6 @@ msgstr "MIDI In-Gerät:" msgid "Standalone MPU-401" msgstr "Standalone-MPU-401-Gerät" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "FLOAT32-Wiedergabe benutzen" diff --git a/src/qt/languages/en-GB.po b/src/qt/languages/en-GB.po index 5575d9481..7613cf4b3 100644 --- a/src/qt/languages/en-GB.po +++ b/src/qt/languages/en-GB.po @@ -406,8 +406,17 @@ msgstr "Joystick 3..." msgid "Joystick 4..." msgstr "Joystick 4..." -msgid "Sound card:" -msgstr "Sound card:" +msgid "Sound card 1:" +msgstr "Sound card 1:" + +msgid "Sound card 2:" +msgstr "Sound card 2:" + +msgid "Sound card 3:" +msgstr "Sound card 3:" + +msgid "Sound card 4:" +msgstr "Sound card 4:" msgid "MIDI Out Device:" msgstr "MIDI Out Device:" @@ -418,15 +427,6 @@ msgstr "MIDI In Device:" msgid "Standalone MPU-401" msgstr "Standalone MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Use FLOAT32 sound" diff --git a/src/qt/languages/en-US.po b/src/qt/languages/en-US.po index e6652c057..bf822aceb 100644 --- a/src/qt/languages/en-US.po +++ b/src/qt/languages/en-US.po @@ -406,8 +406,17 @@ msgstr "Joystick 3..." msgid "Joystick 4..." msgstr "Joystick 4..." -msgid "Sound card:" -msgstr "Sound card:" +msgid "Sound card 1:" +msgstr "Sound card 1:" + +msgid "Sound card 2:" +msgstr "Sound card 2:" + +msgid "Sound card 3:" +msgstr "Sound card 3:" + +msgid "Sound card 4:" +msgstr "Sound card 4:" msgid "MIDI Out Device:" msgstr "MIDI Out Device:" @@ -418,15 +427,6 @@ msgstr "MIDI In Device:" msgid "Standalone MPU-401" msgstr "Standalone MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Use FLOAT32 sound" diff --git a/src/qt/languages/es-ES.po b/src/qt/languages/es-ES.po index 0a7014589..0c2bd6aa9 100644 --- a/src/qt/languages/es-ES.po +++ b/src/qt/languages/es-ES.po @@ -406,8 +406,17 @@ msgstr "Mando 3..." msgid "Joystick 4..." msgstr "Mando 4..." -msgid "Sound card:" -msgstr "Tarjeta de sonido:" +msgid "Sound card 1:" +msgstr "Tarjeta de sonido 1:" + +msgid "Sound card 2:" +msgstr "Tarjeta de sonido 2:" + +msgid "Sound card 3:" +msgstr "Tarjeta de sonido 3:" + +msgid "Sound card 4:" +msgstr "Tarjeta de sonido 4:" msgid "MIDI Out Device:" msgstr "Dispositivo MIDI de salida:" @@ -418,15 +427,6 @@ msgstr "Dispositivo MIDI de entrada:" msgid "Standalone MPU-401" msgstr "MPU-401 independiente" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Usar sonido FLOAT32" diff --git a/src/qt/languages/fi-FI.po b/src/qt/languages/fi-FI.po index a5284844d..6224472fa 100644 --- a/src/qt/languages/fi-FI.po +++ b/src/qt/languages/fi-FI.po @@ -406,8 +406,17 @@ msgstr "Peliohjain 3..." msgid "Joystick 4..." msgstr "Peliohjain 4..." -msgid "Sound card:" -msgstr "Äänikortti:" +msgid "Sound card 1:" +msgstr "Äänikortti 1:" + +msgid "Sound card 2:" +msgstr "Äänikortti 2:" + +msgid "Sound card 3:" +msgstr "Äänikortti 3:" + +msgid "Sound card 4:" +msgstr "Äänikortti 4:" msgid "MIDI Out Device:" msgstr "MIDI-ulostulo:" @@ -418,15 +427,6 @@ msgstr "MIDI-sisääntulo:" msgid "Standalone MPU-401" msgstr "Erillinen MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Käytä FLOAT32-ääntä" diff --git a/src/qt/languages/fr-FR.po b/src/qt/languages/fr-FR.po index 272d654c9..3ae18533d 100644 --- a/src/qt/languages/fr-FR.po +++ b/src/qt/languages/fr-FR.po @@ -406,8 +406,17 @@ msgstr "Manette 3..." msgid "Joystick 4..." msgstr "Manette 4..." -msgid "Sound card:" -msgstr "Carte son:" +msgid "Sound card 1:" +msgstr "Carte son 1:" + +msgid "Sound card 2:" +msgstr "Carte son 2:" + +msgid "Sound card 3:" +msgstr "Carte son 3:" + +msgid "Sound card 4:" +msgstr "Carte son 4:" msgid "MIDI Out Device:" msgstr "Sortie MIDI:" @@ -418,15 +427,6 @@ msgstr "Entrée MIDI:" msgid "Standalone MPU-401" msgstr "MPU-401 autonome" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Utiliser le son FLOAT32" diff --git a/src/qt/languages/hr-HR.po b/src/qt/languages/hr-HR.po index 244e78304..06c3ad8b5 100644 --- a/src/qt/languages/hr-HR.po +++ b/src/qt/languages/hr-HR.po @@ -406,8 +406,17 @@ msgstr "Palica za igru 3..." msgid "Joystick 4..." msgstr "Palica za igru 4..." -msgid "Sound card:" -msgstr "Zvučna kartica:" +msgid "Sound card 1:" +msgstr "Zvučna kartica 1:" + +msgid "Sound card 2:" +msgstr "Zvučna kartica 2:" + +msgid "Sound card 3:" +msgstr "Zvučna kartica 3:" + +msgid "Sound card 4:" +msgstr "Zvučna kartica 4:" msgid "MIDI Out Device:" msgstr "Izlazni uređaj MIDI:" @@ -418,15 +427,6 @@ msgstr "Ulazni uređaj MIDI:" msgid "Standalone MPU-401" msgstr "Samostalni MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Koristi FLOAT32 za zvuk" diff --git a/src/qt/languages/hu-HU.po b/src/qt/languages/hu-HU.po index c94e019f6..6658cbb00 100644 --- a/src/qt/languages/hu-HU.po +++ b/src/qt/languages/hu-HU.po @@ -406,8 +406,17 @@ msgstr "Játékvez. 3..." msgid "Joystick 4..." msgstr "Játékvez. 4..." -msgid "Sound card:" -msgstr "Hangkártya:" +msgid "Sound card 1:" +msgstr "Hangkártya 1:" + +msgid "Sound card 2:" +msgstr "Hangkártya 2:" + +msgid "Sound card 3:" +msgstr "Hangkártya 3:" + +msgid "Sound card 4:" +msgstr "Hangkártya 4:" msgid "MIDI Out Device:" msgstr "MIDI-kimenet:" @@ -418,15 +427,6 @@ msgstr "MIDI-bemenet:" msgid "Standalone MPU-401" msgstr "Különálló MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "FLOAT32 használata" diff --git a/src/qt/languages/it-IT.po b/src/qt/languages/it-IT.po index c1814eaeb..c02e3510f 100644 --- a/src/qt/languages/it-IT.po +++ b/src/qt/languages/it-IT.po @@ -406,8 +406,17 @@ msgstr "Joystick 3..." msgid "Joystick 4..." msgstr "Joystick 4..." -msgid "Sound card:" -msgstr "Scheda audio:" +msgid "Sound card 1:" +msgstr "Scheda audio 1:" + +msgid "Sound card 2:" +msgstr "Scheda audio 2:" + +msgid "Sound card 3:" +msgstr "Scheda audio 3:" + +msgid "Sound card 4:" +msgstr "Scheda audio 4:" msgid "MIDI Out Device:" msgstr "Uscita MIDI:" @@ -418,15 +427,6 @@ msgstr "Entrata MIDI:" msgid "Standalone MPU-401" msgstr "MPU-401 autonomo" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Usa suono FLOAT32" diff --git a/src/qt/languages/ja-JP.po b/src/qt/languages/ja-JP.po index 71b5d921f..420d34a2e 100644 --- a/src/qt/languages/ja-JP.po +++ b/src/qt/languages/ja-JP.po @@ -406,8 +406,17 @@ msgstr "ジョイスティック3..." msgid "Joystick 4..." msgstr "ジョイスティック4..." -msgid "Sound card:" -msgstr "サウンドカード:" +msgid "Sound card 1:" +msgstr "サウンドカード 1:" + +msgid "Sound card 2:" +msgstr "サウンドカード 2:" + +msgid "Sound card 3:" +msgstr "サウンドカード 3:" + +msgid "Sound card 4:" +msgstr "サウンドカード 4:" msgid "MIDI Out Device:" msgstr "MIDI出力デバイス:" @@ -418,15 +427,6 @@ msgstr "MIDI入力デバイス:" msgid "Standalone MPU-401" msgstr "独立型MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "FLOAT32サウンドを使用する" diff --git a/src/qt/languages/ko-KR.po b/src/qt/languages/ko-KR.po index 1ebabcfe4..6d189d8e3 100644 --- a/src/qt/languages/ko-KR.po +++ b/src/qt/languages/ko-KR.po @@ -406,8 +406,17 @@ msgstr "조이스틱 3..." msgid "Joystick 4..." msgstr "조이스틱 4..." -msgid "Sound card:" -msgstr "사운드 카드:" +msgid "Sound card 1:" +msgstr "사운드 카드 1:" + +msgid "Sound card 2:" +msgstr "사운드 카드 2:" + +msgid "Sound card 3:" +msgstr "사운드 카드 3:" + +msgid "Sound card 4:" +msgstr "사운드 카드 4:" msgid "MIDI Out Device:" msgstr "MIDI 출력 장치:" @@ -418,15 +427,6 @@ msgstr "MIDI 입력 장치:" msgid "Standalone MPU-401" msgstr "MPU-401 단독 사용" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "FLOAT32 사운드 사용" diff --git a/src/qt/languages/pl-PL.po b/src/qt/languages/pl-PL.po index c0884601c..26c652c87 100644 --- a/src/qt/languages/pl-PL.po +++ b/src/qt/languages/pl-PL.po @@ -406,8 +406,17 @@ msgstr "Joystick 3..." msgid "Joystick 4..." msgstr "Joystick 4..." -msgid "Sound card:" -msgstr "Karta dźwiękowa:" +msgid "Sound card 1:" +msgstr "Karta dźwiękowa 1:" + +msgid "Sound card 2:" +msgstr "Karta dźwiękowa 2:" + +msgid "Sound card 3:" +msgstr "Karta dźwiękowa 3:" + +msgid "Sound card 4:" +msgstr "Karta dźwiękowa 4:" msgid "MIDI Out Device:" msgstr "Urządzenie wyjściowe MIDI:" @@ -418,15 +427,6 @@ msgstr "Urządzenie wejściowe MIDI:" msgid "Standalone MPU-401" msgstr "Samodzielne urządzenie MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Użyj dźwięku FLOAT32" diff --git a/src/qt/languages/pt-BR.po b/src/qt/languages/pt-BR.po index d9ddcec83..0202b42a7 100644 --- a/src/qt/languages/pt-BR.po +++ b/src/qt/languages/pt-BR.po @@ -406,8 +406,17 @@ msgstr "Joystick 3..." msgid "Joystick 4..." msgstr "Joystick 4..." -msgid "Sound card:" -msgstr "Placa de som:" +msgid "Sound card 1:" +msgstr "Placa de som 1:" + +msgid "Sound card 2:" +msgstr "Placa de som 2:" + +msgid "Sound card 3:" +msgstr "Placa de som 3:" + +msgid "Sound card 4:" +msgstr "Placa de som 4:" msgid "MIDI Out Device:" msgstr "Disp. de saída MIDI:" @@ -418,15 +427,6 @@ msgstr "Disp. de entrada MIDI:" msgid "Standalone MPU-401" msgstr "MPU-401 autônomo" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Usar som FLOAT32" diff --git a/src/qt/languages/pt-PT.po b/src/qt/languages/pt-PT.po index 33501ecc7..a8ce8bbca 100644 --- a/src/qt/languages/pt-PT.po +++ b/src/qt/languages/pt-PT.po @@ -406,8 +406,17 @@ msgstr "Joystick 3..." msgid "Joystick 4..." msgstr "Joystick 4..." -msgid "Sound card:" -msgstr "Placa de som:" +msgid "Sound card 1:" +msgstr "Placa de som 1:" + +msgid "Sound card 2:" +msgstr "Placa de som 2:" + +msgid "Sound card 3:" +msgstr "Placa de som 3:" + +msgid "Sound card 4:" +msgstr "Placa de som 4:" msgid "MIDI Out Device:" msgstr "Disp. saída MIDI:" @@ -418,15 +427,6 @@ msgstr "Disp. entrada MIDI:" msgid "Standalone MPU-401" msgstr "MPU-401 autónomo" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Utilizar som FLOAT32" diff --git a/src/qt/languages/ru-RU.po b/src/qt/languages/ru-RU.po index 6cc388b58..a424c5f6f 100644 --- a/src/qt/languages/ru-RU.po +++ b/src/qt/languages/ru-RU.po @@ -406,8 +406,17 @@ msgstr "Джойстик 3..." msgid "Joystick 4..." msgstr "Джойстик 4..." -msgid "Sound card:" -msgstr "Звуковая карта:" +msgid "Sound card 1:" +msgstr "Звуковая карта 1:" + +msgid "Sound card 2:" +msgstr "Звуковая карта 2:" + +msgid "Sound card 3:" +msgstr "Звуковая карта 3:" + +msgid "Sound card 4:" +msgstr "Звуковая карта 4:" msgid "MIDI Out Device:" msgstr "MIDI Out устр-во:" @@ -418,15 +427,6 @@ msgstr "MIDI In устр-во:" msgid "Standalone MPU-401" msgstr "Отдельный MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "FLOAT32 звук" diff --git a/src/qt/languages/sl-SI.po b/src/qt/languages/sl-SI.po index 08060a790..ba11014d2 100644 --- a/src/qt/languages/sl-SI.po +++ b/src/qt/languages/sl-SI.po @@ -406,8 +406,17 @@ msgstr "Igralna palica 3..." msgid "Joystick 4..." msgstr "Igralna palica 4..." -msgid "Sound card:" -msgstr "Zvočna kartica:" +msgid "Sound card 1:" +msgstr "Zvočna kartica 1:" + +msgid "Sound card 2:" +msgstr "Zvočna kartica 2:" + +msgid "Sound card 3:" +msgstr "Zvočna kartica 3:" + +msgid "Sound card 4:" +msgstr "Zvočna kartica 4:" msgid "MIDI Out Device:" msgstr "Izhodna naprava MIDI:" @@ -418,15 +427,6 @@ msgstr "Vhodna naprava MIDI:" msgid "Standalone MPU-401" msgstr "Samostojen MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "Uporabi FLOAT32 za zvok" diff --git a/src/qt/languages/tr-TR.po b/src/qt/languages/tr-TR.po index 5c9ddbd4f..f9608e9d0 100644 --- a/src/qt/languages/tr-TR.po +++ b/src/qt/languages/tr-TR.po @@ -406,8 +406,17 @@ msgstr "Oyun kolu 3..." msgid "Joystick 4..." msgstr "Oyun kolu 4..." -msgid "Sound card:" -msgstr "Ses kartı:" +msgid "Sound card 1:" +msgstr "Ses kartı 1:" + +msgid "Sound card 2:" +msgstr "Ses kartı 2:" + +msgid "Sound card 3:" +msgstr "Ses kartı 3:" + +msgid "Sound card 4:" +msgstr "Ses kartı 4:" msgid "MIDI Out Device:" msgstr "MIDI Çıkış Cihazı:" @@ -418,15 +427,6 @@ msgstr "MIDI Giriş Cihazı:" msgid "Standalone MPU-401" msgstr "Bağımsız MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "FLOAT32 ses kullan" diff --git a/src/qt/languages/uk-UA.po b/src/qt/languages/uk-UA.po index c2a839542..0ebe3e5cc 100644 --- a/src/qt/languages/uk-UA.po +++ b/src/qt/languages/uk-UA.po @@ -406,8 +406,17 @@ msgstr "Джойстик 3..." msgid "Joystick 4..." msgstr "Джойстик 4..." -msgid "Sound card:" -msgstr "Звукова карта:" +msgid "Sound card 1:" +msgstr "Звукова карта 1:" + +msgid "Sound card 2:" +msgstr "Звукова карта 2:" + +msgid "Sound card 3:" +msgstr "Звукова карта 3:" + +msgid "Sound card 4:" +msgstr "Звукова карта 4:" msgid "MIDI Out Device:" msgstr "MIDI Out при-ій:" @@ -418,15 +427,6 @@ msgstr "MIDI In при-ій:" msgid "Standalone MPU-401" msgstr "Окремий MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "FLOAT32 звук" diff --git a/src/qt/languages/zh-CN.po b/src/qt/languages/zh-CN.po index 5c995ae8e..65977da27 100644 --- a/src/qt/languages/zh-CN.po +++ b/src/qt/languages/zh-CN.po @@ -406,8 +406,17 @@ msgstr "操纵杆 3..." msgid "Joystick 4..." msgstr "操纵杆 4..." -msgid "Sound card:" -msgstr "声卡:" +msgid "Sound card 1:" +msgstr "声卡 1:" + +msgid "Sound card 2:" +msgstr "声卡 2:" + +msgid "Sound card 3:" +msgstr "声卡 3:" + +msgid "Sound card 4:" +msgstr "声卡 4:" msgid "MIDI Out Device:" msgstr "MIDI 输出设备:" @@ -418,15 +427,6 @@ msgstr "MIDI 输入设备:" msgid "Standalone MPU-401" msgstr "独立 MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "使用单精度浮点 (FLOAT32)" diff --git a/src/qt/languages/zh-TW.po b/src/qt/languages/zh-TW.po index 587db5e0c..b61613b89 100644 --- a/src/qt/languages/zh-TW.po +++ b/src/qt/languages/zh-TW.po @@ -406,8 +406,17 @@ msgstr "搖桿 3..." msgid "Joystick 4..." msgstr "搖桿 4..." -msgid "Sound card:" -msgstr "音訊卡:" +msgid "Sound card 1:" +msgstr "音訊卡 1:" + +msgid "Sound card 2:" +msgstr "音訊卡 2:" + +msgid "Sound card 3:" +msgstr "音訊卡 3:" + +msgid "Sound card 4:" +msgstr "音訊卡 4:" msgid "MIDI Out Device:" msgstr "MIDI 輸出裝置:" @@ -418,15 +427,6 @@ msgstr "MIDI 輸入裝置:" msgid "Standalone MPU-401" msgstr "獨立 MPU-401" -msgid "Innovation SSI-2001" -msgstr "Innovation SSI-2001" - -msgid "CMS / Game Blaster" -msgstr "CMS / Game Blaster" - -msgid "Gravis Ultrasound" -msgstr "Gravis Ultrasound" - msgid "Use FLOAT32 sound" msgstr "使用單精度浮點 (FLOAT32)" diff --git a/src/qt/qt.c b/src/qt/qt.c index f1c6eee3f..c2a5396da 100644 --- a/src/qt/qt.c +++ b/src/qt/qt.c @@ -1,16 +1,16 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ /* * C functionality for Qt platform, where the C equivalent is not easily diff --git a/src/qt/qt_cdrom.c b/src/qt/qt_cdrom.c index d0ab0113e..6e28966b0 100644 --- a/src/qt/qt_cdrom.c +++ b/src/qt/qt_cdrom.c @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Handle the platform-side of CDROM/ZIP/MO drives. + * Handle the platform-side of CDROM/ZIP/MO drives. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2016-2018 Miran Grca. + * Copyright 2017-2018 Fred N. van Kempen. */ #include diff --git a/src/qt/qt_deviceconfig.cpp b/src/qt/qt_deviceconfig.cpp index 81f8b8493..257238316 100644 --- a/src/qt/qt_deviceconfig.cpp +++ b/src/qt/qt_deviceconfig.cpp @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Device configuration UI code. + * Device configuration UI code. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2021 Joakim L. Gilje - * Copyright 2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje + * Copyright 2022 Cacodemon345 */ #include "qt_deviceconfig.hpp" #include "ui_qt_deviceconfig.h" @@ -25,6 +25,8 @@ #include #include #include +#include +#include extern "C" { #include <86box/86box.h> @@ -61,6 +63,12 @@ DeviceConfig::ConfigureDevice(const _device_ *device, int instance, Settings *se device_context_t device_context; device_set_context(&device_context, device, instance); + auto device_label = new QLabel(device->name); + dc.ui->formLayout->addRow(device_label); + auto line = new QFrame; + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + dc.ui->formLayout->addRow(line); const auto *config = device->config; while (config->type != -1) { switch (config->type) { diff --git a/src/qt/qt_filefield.cpp b/src/qt/qt_filefield.cpp index 969d5ff29..b6db5e611 100644 --- a/src/qt/qt_filefield.cpp +++ b/src/qt/qt_filefield.cpp @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * File field widget. + * File field widget. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2021 Joakim L. Gilje - * Copyright 2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje + * Copyright 2022 Cacodemon345 */ #include "qt_filefield.hpp" #include "ui_qt_filefield.h" @@ -29,7 +29,7 @@ FileField::FileField(QWidget *parent) connect(ui->label, &QLineEdit::editingFinished, this, [this]() { fileName_ = ui->label->text(); - emit fileSelected(ui->label->text()); + emit fileSelected(ui->label->text(), true); }); this->setFixedWidth(this->sizeHint().width() + ui->pushButton->sizeHint().width()); } diff --git a/src/qt/qt_filefield.hpp b/src/qt/qt_filefield.hpp index 8520e3e57..ee011a38b 100644 --- a/src/qt/qt_filefield.hpp +++ b/src/qt/qt_filefield.hpp @@ -24,7 +24,7 @@ public: bool createFile() { return createFile_; } signals: - void fileSelected(const QString &fileName); + void fileSelected(const QString &fileName, bool precheck = false); private slots: void on_pushButton_clicked(); diff --git a/src/qt/qt_harddiskdialog.cpp b/src/qt/qt_harddiskdialog.cpp index eb8b3fd1a..e8ccccd6f 100644 --- a/src/qt/qt_harddiskdialog.cpp +++ b/src/qt/qt_harddiskdialog.cpp @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Hard disk dialog code. + * Hard disk dialog code. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2021 Joakim L. Gilje - * Copyright 2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje + * Copyright 2022 Cacodemon345 */ #include "qt_harddiskdialog.hpp" #include "ui_qt_harddiskdialog.h" @@ -51,6 +51,40 @@ HarddiskDialog::HarddiskDialog(bool existing, QWidget *parent) { ui->setupUi(this); + auto *model = ui->comboBoxFormat->model(); + model->insertRows(0, 6); + model->setData(model->index(0, 0), tr("Raw image (.img)")); + model->setData(model->index(1, 0), tr("HDI image (.hdi)")); + model->setData(model->index(2, 0), tr("HDX image (.hdx)")); + model->setData(model->index(3, 0), tr("Fixed-size VHD (.vhd)")); + model->setData(model->index(4, 0), tr("Dynamic-size VHD (.vhd)")); + model->setData(model->index(5, 0), tr("Differencing VHD (.vhd)")); + + model = ui->comboBoxBlockSize->model(); + model->insertRows(0, 2); + model->setData(model->index(0, 0), tr("Large blocks (2 MB)")); + model->setData(model->index(1, 0), tr("Small blocks (512 KB)")); + + ui->comboBoxBlockSize->hide(); + ui->labelBlockSize->hide(); + + Harddrives::populateBuses(ui->comboBoxBus->model()); + ui->comboBoxBus->setCurrentIndex(3); + + model = ui->comboBoxType->model(); + for (int i = 0; i < 127; i++) { + uint64_t size = ((uint64_t) hdd_table[i][0]) * hdd_table[i][1] * hdd_table[i][2]; + uint32_t size_mb = size >> 11LL; + // QString text = QString("%1 MiB (CHS: %2, %3, %4)").arg(size_mb).arg(hdd_table[i][0]).arg(hdd_table[i][1]).arg(hdd_table[i][2]); + QString text = QString::asprintf(tr("%u MB (CHS: %i, %i, %i)").toUtf8().constData(), (size_mb), (hdd_table[i][0]), (hdd_table[i][1]), (hdd_table[i][2])); + Models::AddEntry(model, text, i); + } + Models::AddEntry(model, tr("Custom..."), 127); + Models::AddEntry(model, tr("Custom (large)..."), 128); + + ui->lineEditSize->setValidator(new QIntValidator()); + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); + if (existing) { ui->fileField->setFilter(tr("Hard disk images") % util::DlgFilter({ "hd?", "im?", "vhd" }) % tr("All files") % util::DlgFilter({ "*" }, true)); @@ -85,40 +119,6 @@ HarddiskDialog::HarddiskDialog(bool existing, QWidget *parent) ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); }); } - - auto *model = ui->comboBoxFormat->model(); - model->insertRows(0, 6); - model->setData(model->index(0, 0), tr("Raw image (.img)")); - model->setData(model->index(1, 0), tr("HDI image (.hdi)")); - model->setData(model->index(2, 0), tr("HDX image (.hdx)")); - model->setData(model->index(3, 0), tr("Fixed-size VHD (.vhd)")); - model->setData(model->index(4, 0), tr("Dynamic-size VHD (.vhd)")); - model->setData(model->index(5, 0), tr("Differencing VHD (.vhd)")); - - model = ui->comboBoxBlockSize->model(); - model->insertRows(0, 2); - model->setData(model->index(0, 0), tr("Large blocks (2 MB)")); - model->setData(model->index(1, 0), tr("Small blocks (512 KB)")); - - ui->comboBoxBlockSize->hide(); - ui->labelBlockSize->hide(); - - Harddrives::populateBuses(ui->comboBoxBus->model()); - ui->comboBoxBus->setCurrentIndex(3); - - model = ui->comboBoxType->model(); - for (int i = 0; i < 127; i++) { - uint64_t size = ((uint64_t) hdd_table[i][0]) * hdd_table[i][1] * hdd_table[i][2]; - uint32_t size_mb = size >> 11LL; - // QString text = QString("%1 MiB (CHS: %2, %3, %4)").arg(size_mb).arg(hdd_table[i][0]).arg(hdd_table[i][1]).arg(hdd_table[i][2]); - QString text = QString::asprintf(tr("%u MB (CHS: %i, %i, %i)").toUtf8().constData(), (size_mb), (hdd_table[i][0]), (hdd_table[i][1]), (hdd_table[i][2])); - Models::AddEntry(model, text, i); - } - Models::AddEntry(model, tr("Custom..."), 127); - Models::AddEntry(model, tr("Custom (large)..."), 128); - - ui->lineEditSize->setValidator(new QIntValidator()); - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); } HarddiskDialog::~HarddiskDialog() @@ -499,7 +499,7 @@ HarddiskDialog::recalcSelection() } void -HarddiskDialog::onExistingFileSelected(const QString &fileName) +HarddiskDialog::onExistingFileSelected(const QString &fileName, bool precheck) { // TODO : Over to non-existing file selected /* @@ -531,7 +531,11 @@ HarddiskDialog::onExistingFileSelected(const QString &fileName) ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { - QMessageBox::critical(this, tr("Unable to read file"), tr("Make sure the file exists and is readable.")); + // No message box during precheck (performed when the file input loses focus and this function is called) + // If precheck is false, the file has been chosen from a file dialog and the alert should display. + if(!precheck) { + QMessageBox::critical(this, tr("Unable to read file"), tr("Make sure the file exists and is readable.")); + } return; } QByteArray fileNameUtf8 = fileName.toUtf8(); diff --git a/src/qt/qt_harddiskdialog.hpp b/src/qt/qt_harddiskdialog.hpp index a630bd8e2..0d5fa13bc 100644 --- a/src/qt/qt_harddiskdialog.hpp +++ b/src/qt/qt_harddiskdialog.hpp @@ -37,7 +37,7 @@ private slots: void on_comboBoxBus_currentIndexChanged(int index); void on_comboBoxFormat_currentIndexChanged(int index); void onCreateNewFile(); - void onExistingFileSelected(const QString &fileName); + void onExistingFileSelected(const QString &fileName, bool precheck); private: Ui::HarddiskDialog *ui; diff --git a/src/qt/qt_harddrive_common.cpp b/src/qt/qt_harddrive_common.cpp index 7d3beaa2b..55b7fa820 100644 --- a/src/qt/qt_harddrive_common.cpp +++ b/src/qt/qt_harddrive_common.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Common storage devices module. + * Common storage devices module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_harddrive_common.hpp" @@ -20,6 +20,7 @@ extern "C" { #include <86box/hdd.h> +#include <86box/cdrom.h> } #include @@ -48,14 +49,16 @@ void Harddrives::populateRemovableBuses(QAbstractItemModel *model) { model->removeRows(0, model->rowCount()); - model->insertRows(0, 3); + model->insertRows(0, 4); model->setData(model->index(0, 0), QObject::tr("Disabled")); model->setData(model->index(1, 0), QObject::tr("ATAPI")); model->setData(model->index(2, 0), QObject::tr("SCSI")); + model->setData(model->index(3, 0), QObject::tr("Mitsumi")); model->setData(model->index(0, 0), HDD_BUS_DISABLED, Qt::UserRole); model->setData(model->index(1, 0), HDD_BUS_ATAPI, Qt::UserRole); model->setData(model->index(2, 0), HDD_BUS_SCSI, Qt::UserRole); + model->setData(model->index(3, 0), CDROM_BUS_MITSUMI, Qt::UserRole); } void @@ -143,6 +146,9 @@ Harddrives::BusChannelName(uint8_t bus, uint8_t channel) case HDD_BUS_SCSI: busName = QString("SCSI (%1:%2)").arg(channel >> 4).arg(channel & 15, 2, 10, QChar('0')); break; + case CDROM_BUS_MITSUMI: + busName = QString("Mitsumi"); + break; } return busName; diff --git a/src/qt/qt_hardwarerenderer.cpp b/src/qt/qt_hardwarerenderer.cpp index f158e7d62..647827e85 100644 --- a/src/qt/qt_hardwarerenderer.cpp +++ b/src/qt/qt_hardwarerenderer.cpp @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Hardware renderer module. + * Hardware renderer module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * Teemu Korhonen * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2022 Cacodemon345 - * Copyright 2021-2022 Teemu Korhonen + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Teemu Korhonen */ #include "qt_hardwarerenderer.hpp" #include diff --git a/src/qt/qt_joystickconfiguration.cpp b/src/qt/qt_joystickconfiguration.cpp index a9c53c07e..e91cb9086 100644 --- a/src/qt/qt_joystickconfiguration.cpp +++ b/src/qt/qt_joystickconfiguration.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Joystick configuration UI module. + * Joystick configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_joystickconfiguration.hpp" #include "ui_qt_joystickconfiguration.h" diff --git a/src/qt/qt_machinestatus.cpp b/src/qt/qt_machinestatus.cpp index 23df27150..29b394114 100644 --- a/src/qt/qt_machinestatus.cpp +++ b/src/qt/qt_machinestatus.cpp @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Joystick configuration UI module. + * Joystick configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 */ #include "qt_machinestatus.hpp" @@ -29,6 +29,7 @@ extern uint64_t tsc; #include <86box/cartridge.h> #include <86box/cassette.h> #include <86box/cdrom.h> +#include <86box/cdrom_interface.h> #include <86box/fdd.h> #include <86box/hdc.h> #include <86box/scsi.h> @@ -300,6 +301,8 @@ MachineStatus::iterateCDROM(const std::function &cb) continue; if ((cdrom[i].bus_type == CDROM_BUS_SCSI) && !hasSCSI() && (scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) && (scsi_card_current[2] == 0) && (scsi_card_current[3] == 0)) continue; + if ((cdrom[i].bus_type == CDROM_BUS_MITSUMI) && (cdrom_interface_current == 0)) + continue; if (cdrom[i].bus_type != 0) { cb(i); } diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index b162e6abc..4b06fd69f 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Main entry point module + * Main entry point module * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * Teemu Korhonen * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2022 Cacodemon345 - * Copyright 2021-2022 Teemu Korhonen + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Teemu Korhonen */ #include #include @@ -52,7 +52,9 @@ extern "C" { #include <86box/plat.h> #include <86box/ui.h> #include <86box/video.h> -#include <86box/discord.h> +#ifdef DISCORD +# include <86box/discord.h> +#endif #include <86box/gdbstub.h> } @@ -196,7 +198,9 @@ main(int argc, char *argv[]) return 0; } +#ifdef DISCORD discord_load(); +#endif main_window = new MainWindow(); if (startMaximized) { @@ -270,12 +274,14 @@ main(int argc, char *argv[]) /* Set the PAUSE mode depending on the renderer. */ // plat_pause(0); QTimer onesec; - QTimer discordupdate; QObject::connect(&onesec, &QTimer::timeout, &app, [] { pc_onesec(); }); onesec.setTimerType(Qt::PreciseTimer); onesec.start(1000); + +#ifdef DISCORD + QTimer discordupdate; if (discord_loaded) { QTimer::singleShot(1000, &app, [] { if (enable_discord) { @@ -289,6 +295,7 @@ main(int argc, char *argv[]) }); discordupdate.start(1000); } +#endif /* Initialize the rendering window, or fullscreen. */ QTimer::singleShot(0, &app, [] { diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 10b92cb1d..41c363744 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1,24 +1,24 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Main window module. + * Main window module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * Teemu Korhonen * dob205 * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2022 Cacodemon345 - * Copyright 2021-2022 Teemu Korhonen - * Copyright 2022 dob205 + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Teemu Korhonen + * Copyright 2022 dob205 */ #include @@ -39,13 +39,18 @@ extern "C" { #include <86box/keyboard.h> #include <86box/plat.h> #include <86box/ui.h> -#include <86box/discord.h> +#ifdef DISCORD +# include <86box/discord.h> +#endif #include <86box/device.h> #include <86box/video.h> #include <86box/mouse.h> #include <86box/machine.h> #include <86box/vid_ega.h> #include <86box/version.h> +//#include <86box/acpi.h> /* Requires timer.h include, which conflicts with Qt headers */ +extern atomic_int acpi_pwrbut_pressed; +extern int acpi_enabled; #ifdef USE_VNC # include <86box/vnc.h> @@ -312,6 +317,10 @@ MainWindow::MainWindow(QWidget *parent) ui->actionEnable_Discord_integration->setChecked(enable_discord); ui->actionApply_fullscreen_stretch_mode_when_maximized->setChecked(video_fullscreen_scale_maximized); +#ifndef DISCORD + ui->actionEnable_Discord_integration->setVisible(false); +#endif + #if defined Q_OS_WINDOWS || defined Q_OS_MACOS /* Make the option visible only if ANGLE is loaded. */ ui->actionHardware_Renderer_OpenGL_ES->setVisible(QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES); @@ -740,6 +749,7 @@ MainWindow::destroyRendererMonitorSlot(int monitor_index) } config_save(); this->renderers[monitor_index].release()->deleteLater(); + ui->stackedWidget->switchRenderer((RendererStack::Renderer) vid_api); } } @@ -1688,6 +1698,8 @@ MainWindow::refreshMediaMenu() { mm->refresh(ui->menuMedia); status->refresh(ui->statusbar); + ui->actionMCA_devices->setVisible(machine_has_bus(machine, MACHINE_BUS_MCA)); + ui->actionACPI_Shutdown->setEnabled(!!acpi_enabled); } void @@ -2111,12 +2123,21 @@ MainWindow::on_actionAbout_86Box_triggered() { QMessageBox msgBox; msgBox.setTextFormat(Qt::RichText); - QString githash; + QString versioninfo; #ifdef EMU_GIT_HASH - githash = QString(" [%1]").arg(EMU_GIT_HASH); + versioninfo = QString(" [%1]").arg(EMU_GIT_HASH); #endif - githash.append(QString(" [%1]").arg(QSysInfo::buildCpuArchitecture())); - msgBox.setText(QString("%3%1%2").arg(EMU_VERSION_FULL, githash, tr("86Box v"))); +#ifdef USE_DYNAREC +# ifdef USE_NEW_DYNAREC +# define DYNAREC_STR "new dynarec" +# else +# define DYNAREC_STR "old dynarec" +# endif +#else +# define DYNAREC_STR "no dynarec" +#endif + versioninfo.append(QString(" [%1, %2]").arg(QSysInfo::buildCpuArchitecture(), tr(DYNAREC_STR))); + msgBox.setText(QString("%3%1%2").arg(EMU_VERSION_FULL, versioninfo, tr("86Box v"))); msgBox.setInformativeText(tr("An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, Tiseno100, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2 or later. See LICENSE for more information.")); msgBox.setWindowTitle("About 86Box"); msgBox.addButton("OK", QMessageBox::ButtonRole::AcceptRole); @@ -2298,11 +2319,13 @@ void MainWindow::on_actionEnable_Discord_integration_triggered(bool checked) { enable_discord = checked; +#ifdef DISCORD if (enable_discord) { discord_init(); discord_update_activity(dopause); } else discord_close(); +#endif } void @@ -2385,6 +2408,7 @@ MainWindow::on_actionShow_non_primary_monitors_triggered() monitor_settings[monitor_index].mon_window_h > 2048 ? 2048 : monitor_settings[monitor_index].mon_window_h); } secondaryRenderer->switchRenderer((RendererStack::Renderer) vid_api); + ui->stackedWidget->switchRenderer((RendererStack::Renderer) vid_api); } } else { for (int monitor_index = 1; monitor_index < MONITORS_NUM; monitor_index++) { @@ -2438,5 +2462,9 @@ void MainWindow::on_actionPen_triggered() { tablet_tool_type = 1; config_save(); -} +void MainWindow::on_actionACPI_Shutdown_triggered() +{ + acpi_pwrbut_pressed = 1; + +} diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index fb05a4588..bf4a30f1d 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -141,6 +141,8 @@ private slots: private slots: void on_actionCursor_Puck_triggered(); + void on_actionACPI_Shutdown_triggered(); + private slots: void on_actionShow_non_primary_monitors_triggered(); diff --git a/src/qt/qt_mainwindow.ui b/src/qt/qt_mainwindow.ui index 1a00df27a..5cfaea14c 100644 --- a/src/qt/qt_mainwindow.ui +++ b/src/qt/qt_mainwindow.ui @@ -751,7 +751,7 @@ - false + true @@ -764,7 +764,7 @@ ACPI Shutdown - false + true diff --git a/src/qt/qt_mediahistorymanager.cpp b/src/qt/qt_mediahistorymanager.cpp index 5564afd46..b895b46aa 100644 --- a/src/qt/qt_mediahistorymanager.cpp +++ b/src/qt/qt_mediahistorymanager.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Media history management module + * Media history management module * * * - * Authors: cold-brewed + * Authors: cold-brewed * - * Copyright 2022 The 86Box development team + * Copyright 2022 The 86Box development team */ #include diff --git a/src/qt/qt_mediahistorymanager.hpp b/src/qt/qt_mediahistorymanager.hpp index 507cbdf7f..f1942b81c 100644 --- a/src/qt/qt_mediahistorymanager.hpp +++ b/src/qt/qt_mediahistorymanager.hpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header for the media history management module + * Header for the media history management module * * * - * Authors: cold-brewed + * Authors: cold-brewed * - * Copyright 2022 The 86Box development team + * Copyright 2022 The 86Box development team */ #ifndef QT_MEDIAHISTORYMANAGER_HPP diff --git a/src/qt/qt_mediamenu.cpp b/src/qt/qt_mediamenu.cpp index e0c145981..e898ea9d9 100644 --- a/src/qt/qt_mediamenu.cpp +++ b/src/qt/qt_mediamenu.cpp @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Media menu UI module. + * Media menu UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * Teemu Korhonen * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2022 Cacodemon345 - * Copyright 2021-2022 Teemu Korhonen + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Teemu Korhonen */ #include "qt_progsettings.hpp" #include "qt_machinestatus.hpp" @@ -593,6 +593,9 @@ MediaMenu::cdromUpdateMenu(int i) case CDROM_BUS_SCSI: busName = "SCSI"; break; + case CDROM_BUS_MITSUMI: + busName = "Mitsumi"; + break; } // menu->setTitle(tr("CD-ROM %1 (%2): %3").arg(QString::number(i+1), busName, name.isEmpty() ? tr("(empty)") : name)); diff --git a/src/qt/qt_models_common.cpp b/src/qt/qt_models_common.cpp index 0e9856a50..ed6aeaa7d 100644 --- a/src/qt/qt_models_common.cpp +++ b/src/qt/qt_models_common.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Common storage devices module. + * Common storage devices module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_models_common.hpp" diff --git a/src/qt/qt_newfloppydialog.cpp b/src/qt/qt_newfloppydialog.cpp index cbb021963..479b6711f 100644 --- a/src/qt/qt_newfloppydialog.cpp +++ b/src/qt/qt_newfloppydialog.cpp @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Common storage devices module. + * Common storage devices module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * Teemu Korhonen * - * Copyright 2021 Joakim L. Gilje - * Copyright 2022 Cacodemon345 - * Copyright 2022 Teemu Korhonen + * Copyright 2021 Joakim L. Gilje + * Copyright 2022 Cacodemon345 + * Copyright 2022 Teemu Korhonen */ #include "qt_newfloppydialog.hpp" #include "ui_qt_newfloppydialog.h" diff --git a/src/qt/qt_opengloptions.cpp b/src/qt/qt_opengloptions.cpp index f90ba37c0..58030b467 100644 --- a/src/qt/qt_opengloptions.cpp +++ b/src/qt/qt_opengloptions.cpp @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * OpenGL renderer options for Qt + * OpenGL renderer options for Qt * - * Authors: - * Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * + * Authors: Teemu Korhonen + * + * Copyright 2022 Teemu Korhonen */ #include diff --git a/src/qt/qt_opengloptions.hpp b/src/qt/qt_opengloptions.hpp index b88cf4b07..64f761670 100644 --- a/src/qt/qt_opengloptions.hpp +++ b/src/qt/qt_opengloptions.hpp @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header for OpenGL renderer options + * Header for OpenGL renderer options * - * Authors: - * Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * + * Authors: Teemu Korhonen + * + * Copyright 2022 Teemu Korhonen */ #ifndef QT_OPENGLOPTIONS_HPP diff --git a/src/qt/qt_opengloptionsdialog.cpp b/src/qt/qt_opengloptionsdialog.cpp index c87989161..acb2ce9f2 100644 --- a/src/qt/qt_opengloptionsdialog.cpp +++ b/src/qt/qt_opengloptionsdialog.cpp @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * OpenGL renderer options dialog for Qt + * OpenGL renderer options dialog for Qt * - * Authors: - * Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * + * Authors: Teemu Korhonen + * + * Copyright 2022 Teemu Korhonen */ #include diff --git a/src/qt/qt_opengloptionsdialog.hpp b/src/qt/qt_opengloptionsdialog.hpp index 6b1c673bd..f34d74d75 100644 --- a/src/qt/qt_opengloptionsdialog.hpp +++ b/src/qt/qt_opengloptionsdialog.hpp @@ -1,17 +1,16 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header for OpenGL renderer options dialog + * Header for OpenGL renderer options dialog * - * Authors: - * Teemu Korhonen + * Authors: Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * Copyright 2022 Teemu Korhonen */ #ifndef QT_OPENGLOPTIONSDIALOG_H diff --git a/src/qt/qt_openglrenderer.cpp b/src/qt/qt_openglrenderer.cpp index a2f1ecad0..60aa998a9 100644 --- a/src/qt/qt_openglrenderer.cpp +++ b/src/qt/qt_openglrenderer.cpp @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * OpenGL renderer for Qt + * OpenGL renderer for Qt * - * Authors: - * Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * + * Authors: Teemu Korhonen + * + * Copyright 2022 Teemu Korhonen */ #include diff --git a/src/qt/qt_openglrenderer.hpp b/src/qt/qt_openglrenderer.hpp index c303ca614..27822600c 100644 --- a/src/qt/qt_openglrenderer.hpp +++ b/src/qt/qt_openglrenderer.hpp @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header file for OpenGL renderer + * Header file for OpenGL renderer * - * Authors: - * Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * + * Authors: Teemu Korhonen + * + * Copyright 2022 Teemu Korhonen */ #ifndef QT_OPENGLRENDERER_HPP diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index 0fe611cbe..695531d5c 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -1,21 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Common platform functions. + * Common platform functions. * * - * Authors: Joakim L. Gilje + * + * Authors: Joakim L. Gilje * Cacodemon345 * Teemu Korhonen * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2022 Cacodemon345 - * Copyright 2021-2022 Teemu Korhonen + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Teemu Korhonen */ #include @@ -102,7 +103,9 @@ extern "C" { #include <86box/rom.h> #include <86box/config.h> #include <86box/ui.h> -#include <86box/discord.h> +#ifdef DISCORD +# include <86box/discord.h> +#endif #include "../cpu/cpu.h" #include <86box/plat.h> @@ -376,7 +379,11 @@ plat_pause(int p) } else { ui_window_title(oldtitle); } + +#ifdef DISCORD discord_update_activity(dopause); +#endif + QTimer::singleShot(0, main_window, &MainWindow::updateUiPauseState); #ifdef Q_OS_WINDOWS diff --git a/src/qt/qt_progsettings.cpp b/src/qt/qt_progsettings.cpp index 3ee998002..4dda901d7 100644 --- a/src/qt/qt_progsettings.cpp +++ b/src/qt/qt_progsettings.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Program settings UI module. + * Program settings UI module. * * * * Authors: Cacodemon345 * - * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Cacodemon345 */ #include diff --git a/src/qt/qt_renderercommon.cpp b/src/qt/qt_renderercommon.cpp index 98fb27ca0..47bc33d51 100644 --- a/src/qt/qt_renderercommon.cpp +++ b/src/qt/qt_renderercommon.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Program settings UI module. + * Program settings UI module. * * * * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_renderercommon.hpp" diff --git a/src/qt/qt_rendererstack.cpp b/src/qt/qt_rendererstack.cpp index 4ff1866a2..3d5faff34 100644 --- a/src/qt/qt_rendererstack.cpp +++ b/src/qt/qt_rendererstack.cpp @@ -1,12 +1,12 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Program settings UI module. + * Program settings UI module. * * * @@ -14,9 +14,9 @@ * Cacodemon345 * Teemu Korhonen * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2021 Teemu Korhonen - * Copyright 2021-2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2021 Teemu Korhonen + * Copyright 2021-2022 Cacodemon345 */ #include "qt_rendererstack.hpp" #include "ui_qt_rendererstack.h" diff --git a/src/qt/qt_sdl.c b/src/qt/qt_sdl.c index 54eca952b..857ccf381 100644 --- a/src/qt/qt_sdl.c +++ b/src/qt/qt_sdl.c @@ -1,42 +1,42 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Rendering module for libSDL2 + * Rendering module for libSDL2 * - * NOTE: Given all the problems reported with FULLSCREEN use of SDL, - * we will not use that, but, instead, use a new window which - * coverrs the entire desktop. + * NOTE: Given all the problems reported with FULLSCREEN use of SDL, + * we will not use that, but, instead, use a new window which + * covers the entire desktop. * * * - * Authors: Fred N. van Kempen, - * Michael Drüing, + * Authors: Fred N. van Kempen, + * Michael Drüing, * - * Copyright 2018-2020 Fred N. van Kempen. - * Copyright 2018-2020 Michael Drüing. + * Copyright 2018-2020 Fred N. van Kempen. + * Copyright 2018-2020 Michael Drüing. * - * Redistribution and use in source and binary forms, with - * or without modification, are permitted provided that the - * following conditions are met: + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: * - * 1. Redistributions of source code must retain the entire - * above notice, this list of conditions and the following - * disclaimer. + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. * - * 3. Neither the name of the copyright holder nor the names - * of its contributors may be used to endorse or promote - * products derived from this software without specific - * prior written permission. + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT diff --git a/src/qt/qt_sdl.h b/src/qt/qt_sdl.h index 684e6ccd0..29804c278 100644 --- a/src/qt/qt_sdl.h +++ b/src/qt/qt_sdl.h @@ -1,38 +1,38 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Definitions for the libSDL2 rendering module. + * Definitions for the libSDL2 rendering module. * * * - * Authors: Fred N. van Kempen, - * Michael Drüing, + * Authors: Fred N. van Kempen, + * Michael Drüing, * - * Copyright 2018,2019 Fred N. van Kempen. - * Copyright 2018,2019 Michael Drüing. + * Copyright 2018-2019 Fred N. van Kempen. + * Copyright 2018-2019 Michael Drüing. * - * Redistribution and use in source and binary forms, with - * or without modification, are permitted provided that the - * following conditions are met: + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: * - * 1. Redistributions of source code must retain the entire - * above notice, this list of conditions and the following - * disclaimer. + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. * - * 3. Neither the name of the copyright holder nor the names - * of its contributors may be used to endorse or promote - * products derived from this software without specific - * prior written permission. + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT diff --git a/src/qt/qt_settings.cpp b/src/qt/qt_settings.cpp index b42b20786..f9a6b8e14 100644 --- a/src/qt/qt_settings.cpp +++ b/src/qt/qt_settings.cpp @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Program settings UI module. + * Program settings UI module. * * * * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 */ #include "qt_settings.hpp" #include "ui_qt_settings.h" diff --git a/src/qt/qt_settings_bus_tracking.cpp b/src/qt/qt_settings_bus_tracking.cpp index c22b8b10b..c6069e99e 100644 --- a/src/qt/qt_settings_bus_tracking.cpp +++ b/src/qt/qt_settings_bus_tracking.cpp @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Program settings UI module. + * Program settings UI module. * * * * Authors: Miran Grca * Cacodemon345 * - * Copyright 2022 Miran Grca - * Copyright 2022 Cacodemon345 + * Copyright 2022 Miran Grca + * Copyright 2022 Cacodemon345 */ #include #include diff --git a/src/qt/qt_settingsdisplay.cpp b/src/qt/qt_settingsdisplay.cpp index f01d7fc4d..e64dc74dd 100644 --- a/src/qt/qt_settingsdisplay.cpp +++ b/src/qt/qt_settingsdisplay.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Display settings UI module. + * Display settings UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsdisplay.hpp" #include "ui_qt_settingsdisplay.h" @@ -36,8 +36,8 @@ SettingsDisplay::SettingsDisplay(QWidget *parent) { ui->setupUi(this); - videoCard = gfxcard; - videoCard_2 = gfxcard_2; + videoCard[0] = gfxcard[0]; + videoCard[1] = gfxcard[1]; onCurrentMachineChanged(machine); } @@ -49,8 +49,8 @@ SettingsDisplay::~SettingsDisplay() void SettingsDisplay::save() { - gfxcard = ui->comboBoxVideo->currentData().toInt(); - gfxcard_2 = ui->comboBoxVideoSecondary->currentData().toInt(); + gfxcard[0] = ui->comboBoxVideo->currentData().toInt(); + gfxcard[1] = ui->comboBoxVideoSecondary->currentData().toInt(); voodoo_enabled = ui->checkBoxVoodoo->isChecked() ? 1 : 0; ibm8514_enabled = ui->checkBox8514->isChecked() ? 1 : 0; xga_enabled = ui->checkBoxXga->isChecked() ? 1 : 0; @@ -61,7 +61,7 @@ SettingsDisplay::onCurrentMachineChanged(int machineId) { // win_settings_video_proc, WM_INITDIALOG this->machineId = machineId; - auto curVideoCard = videoCard; + auto curVideoCard = videoCard[0]; auto *model = ui->comboBoxVideo->model(); auto removeRows = model->rowCount(); @@ -103,7 +103,7 @@ SettingsDisplay::onCurrentMachineChanged(int machineId) ui->pushButtonConfigureSecondary->setEnabled(true); } ui->comboBoxVideo->setCurrentIndex(selectedRow); - if (gfxcard_2 == 0) + if (gfxcard[1] == 0) ui->pushButtonConfigureSecondary->setEnabled(false); } @@ -136,9 +136,9 @@ SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) if (index < 0) { return; } - auto curVideoCard_2 = videoCard_2; - videoCard = ui->comboBoxVideo->currentData().toInt(); - ui->pushButtonConfigure->setEnabled(video_card_has_config(videoCard) > 0); + auto curVideoCard_2 = videoCard[1]; + videoCard[0] = ui->comboBoxVideo->currentData().toInt(); + ui->pushButtonConfigure->setEnabled(video_card_has_config(videoCard[0]) > 0); bool machineHasPci = machine_has_bus(machineId, MACHINE_BUS_PCI) > 0; ui->checkBoxVoodoo->setEnabled(machineHasPci); @@ -167,7 +167,7 @@ SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) ui->comboBoxVideoSecondary->setCurrentIndex(0); // TODO: Implement support for selecting non-MDA secondary cards properly when MDA cards are the primary ones. - if (video_card_get_flags(videoCard) == VIDEO_FLAG_TYPE_MDA) { + if (video_card_get_flags(videoCard[0]) == VIDEO_FLAG_TYPE_MDA) { ui->comboBoxVideoSecondary->setCurrentIndex(0); return; } @@ -178,7 +178,7 @@ SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) break; } - if (video_card_available(c) && device_is_valid(video_dev, machineId) && !(video_card_get_flags(c) == video_card_get_flags(videoCard))) { + if (video_card_available(c) && device_is_valid(video_dev, machineId) && !(video_card_get_flags(c) == video_card_get_flags(videoCard[0]) && (video_card_get_flags(c) != VIDEO_FLAG_TYPE_SPECIAL))) { ui->comboBoxVideoSecondary->addItem(name, c); if (c == curVideoCard_2) ui->comboBoxVideoSecondary->setCurrentIndex(ui->comboBoxVideoSecondary->count() - 1); @@ -187,7 +187,7 @@ SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) c++; } - if (videoCard_2 == 0 || (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0)) { + if (videoCard[1] == 0 || (machine_has_flags(machineId, MACHINE_VIDEO_ONLY) > 0)) { ui->comboBoxVideoSecondary->setCurrentIndex(0); ui->pushButtonConfigureSecondary->setEnabled(false); } @@ -212,8 +212,8 @@ SettingsDisplay::on_comboBoxVideoSecondary_currentIndexChanged(int index) ui->pushButtonConfigureSecondary->setEnabled(false); return; } - videoCard_2 = ui->comboBoxVideoSecondary->currentData().toInt(); - ui->pushButtonConfigureSecondary->setEnabled(index != 0 && video_card_has_config(videoCard_2) > 0); + videoCard[1] = ui->comboBoxVideoSecondary->currentData().toInt(); + ui->pushButtonConfigureSecondary->setEnabled(index != 0 && video_card_has_config(videoCard[1]) > 0); } void diff --git a/src/qt/qt_settingsdisplay.hpp b/src/qt/qt_settingsdisplay.hpp index c02e55ce0..8331bbb5b 100644 --- a/src/qt/qt_settingsdisplay.hpp +++ b/src/qt/qt_settingsdisplay.hpp @@ -35,9 +35,8 @@ private slots: private: Ui::SettingsDisplay *ui; - int machineId = 0; - int videoCard = 0; - int videoCard_2 = 0; + int machineId = 0; + int videoCard[2] = { 0, 0 }; }; #endif // QT_SETTINGSDISPLAY_HPP diff --git a/src/qt/qt_settingsfloppycdrom.cpp b/src/qt/qt_settingsfloppycdrom.cpp index 2eabe80ab..609c76fc0 100644 --- a/src/qt/qt_settingsfloppycdrom.cpp +++ b/src/qt/qt_settingsfloppycdrom.cpp @@ -1,25 +1,34 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Floppy/CD-ROM devices configuration UI module. + * Floppy/CD-ROM devices configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2021-2022 Cacodemon345 - * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsfloppycdrom.hpp" #include "ui_qt_settingsfloppycdrom.h" extern "C" { +#include +#include +#include +#include +#include +#include +#include +#define HAVE_STDARG_H +#include <86box/86box.h> #include <86box/timer.h> #include <86box/fdd.h> #include <86box/cdrom.h> @@ -59,6 +68,7 @@ setCDROMBus(QAbstractItemModel *model, const QModelIndex &idx, uint8_t bus, uint break; case CDROM_BUS_ATAPI: case CDROM_BUS_SCSI: + case CDROM_BUS_MITSUMI: icon = ProgSettings::loadIcon("/cdrom.ico"); break; } @@ -88,6 +98,18 @@ setCDROMEarly(QAbstractItemModel *model, const QModelIndex &idx, bool early) model->setData(i, early, Qt::UserRole); } +static void +setCDROMType(QAbstractItemModel *model, const QModelIndex &idx, int type) +{ + auto i = idx.siblingAtColumn(2); + if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() == CDROM_BUS_DISABLED) { + model->setData(i, QCoreApplication::translate("", "None")); + } else if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() != CDROM_BUS_MITSUMI) { + model->setData(i, QObject::tr(cdrom_getname(type))); + } + model->setData(i, type, Qt::UserRole); +} + SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent) : QWidget(parent) , ui(new Ui::SettingsFloppyCDROM) @@ -134,18 +156,36 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent) Models::AddEntry(model, QString("%1x").arg(i + 1), i + 1); } + model = ui->comboBoxCDROMType->model(); + i = 0; + while (true) { + QString name = tr(cdrom_getname(i)); + if (name.isEmpty()) { + break; + } + + Models::AddEntry(model, name, i); + ++i; + } + model = new QStandardItemModel(0, 3, this); ui->tableViewCDROM->setModel(model); model->setHeaderData(0, Qt::Horizontal, tr("Bus")); model->setHeaderData(1, Qt::Horizontal, tr("Speed")); - model->setHeaderData(2, Qt::Horizontal, tr("Earlier drive")); + model->setHeaderData(2, Qt::Horizontal, tr("Type")); model->insertRows(0, CDROM_NUM); for (int i = 0; i < CDROM_NUM; i++) { auto idx = model->index(i, 0); + int type = cdrom_get_type(i); setCDROMBus(model, idx, cdrom[i].bus_type, cdrom[i].res); setCDROMSpeed(model, idx.siblingAtColumn(1), cdrom[i].speed); - setCDROMEarly(model, idx.siblingAtColumn(2), cdrom[i].early); - Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, cdrom[i].bus_type == CDROM_BUS_ATAPI ? cdrom[i].ide_channel : cdrom[i].scsi_device_id); + setCDROMType(model, idx.siblingAtColumn(2), type); + if (cdrom[i].bus_type == CDROM_BUS_ATAPI) + Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, cdrom[i].ide_channel); + else if (cdrom[i].bus_type == CDROM_BUS_SCSI) + Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, cdrom[i].scsi_device_id); + else if (cdrom[i].bus_type == CDROM_BUS_MITSUMI) + Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, 0); } ui->tableViewCDROM->resizeColumnsToContents(); ui->tableViewCDROM->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); @@ -172,18 +212,18 @@ SettingsFloppyCDROM::save() /* Removable devices category */ model = ui->tableViewCDROM->model(); for (int i = 0; i < CDROM_NUM; i++) { - cdrom[i].is_dir = 0; - cdrom[i].priv = NULL; - cdrom[i].ops = NULL; - cdrom[i].image = NULL; - cdrom[i].insert = NULL; - cdrom[i].close = NULL; - cdrom[i].get_volume = NULL; + cdrom[i].is_dir = 0; + cdrom[i].priv = NULL; + cdrom[i].ops = NULL; + cdrom[i].image = NULL; + cdrom[i].insert = NULL; + cdrom[i].close = NULL; + cdrom[i].get_volume = NULL; cdrom[i].get_channel = NULL; - cdrom[i].bus_type = model->index(i, 0).data(Qt::UserRole).toUInt(); - cdrom[i].res = model->index(i, 0).data(Qt::UserRole + 1).toUInt(); - cdrom[i].speed = model->index(i, 1).data(Qt::UserRole).toUInt(); - cdrom[i].early = model->index(i, 2).data(Qt::UserRole).toUInt(); + cdrom[i].bus_type = model->index(i, 0).data(Qt::UserRole).toUInt(); + cdrom[i].res = model->index(i, 0).data(Qt::UserRole + 1).toUInt(); + cdrom[i].speed = model->index(i, 1).data(Qt::UserRole).toUInt(); + cdrom_set_type(i, model->index(i, 2).data(Qt::UserRole).toInt()); } } @@ -202,12 +242,12 @@ SettingsFloppyCDROM::onCDROMRowChanged(const QModelIndex ¤t) uint8_t bus = current.siblingAtColumn(0).data(Qt::UserRole).toUInt(); uint8_t channel = current.siblingAtColumn(0).data(Qt::UserRole + 1).toUInt(); uint8_t speed = current.siblingAtColumn(1).data(Qt::UserRole).toUInt(); - bool early = current.siblingAtColumn(2).data(Qt::UserRole).toBool(); + int type = current.siblingAtColumn(2).data(Qt::UserRole).toInt(); ui->comboBoxBus->setCurrentIndex(-1); - auto *model = ui->comboBoxBus->model(); - auto match = model->match(model->index(0, 0), Qt::UserRole, bus); - if (!match.isEmpty()) { + auto* model = ui->comboBoxBus->model(); + auto match = model->match(model->index(0, 0), Qt::UserRole, bus); + if (! match.isEmpty()) { ui->comboBoxBus->setCurrentIndex(match.first().row()); } @@ -218,7 +258,7 @@ SettingsFloppyCDROM::onCDROMRowChanged(const QModelIndex ¤t) } ui->comboBoxSpeed->setCurrentIndex(speed == 0 ? 7 : speed - 1); - ui->checkBoxEarlierDrive->setChecked(early); + ui->comboBoxCDROMType->setCurrentIndex(type); } void @@ -250,9 +290,10 @@ SettingsFloppyCDROM::on_comboBoxBus_currentIndexChanged(int index) int bus = ui->comboBoxBus->currentData().toInt(); bool enabled = (bus != CDROM_BUS_DISABLED); - ui->comboBoxChannel->setEnabled(enabled); - ui->comboBoxSpeed->setEnabled(enabled); - ui->checkBoxEarlierDrive->setEnabled(enabled); + ui->comboBoxChannel->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled); + ui->comboBoxSpeed->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled); + ui->comboBoxCDROMType->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled); + Harddrives::populateBusChannels(ui->comboBoxChannel->model(), bus); } @@ -266,14 +307,26 @@ SettingsFloppyCDROM::on_comboBoxSpeed_activated(int index) void SettingsFloppyCDROM::on_comboBoxBus_activated(int) { - auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0); + auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0); + uint8_t bus_type = ui->comboBoxBus->currentData().toUInt(); + Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt()); - ui->comboBoxChannel->setCurrentIndex(ui->comboBoxBus->currentData().toUInt() == CDROM_BUS_ATAPI ? Harddrives::busTrackClass->next_free_ide_channel() : Harddrives::busTrackClass->next_free_scsi_id()); + if (bus_type == CDROM_BUS_ATAPI) + ui->comboBoxChannel->setCurrentIndex(Harddrives::busTrackClass->next_free_ide_channel()); + else if (bus_type == CDROM_BUS_SCSI) + ui->comboBoxChannel->setCurrentIndex(Harddrives::busTrackClass->next_free_scsi_id()); + else if (bus_type == CDROM_BUS_MITSUMI) + ui->comboBoxChannel->setCurrentIndex(0); + setCDROMBus( ui->tableViewCDROM->model(), ui->tableViewCDROM->selectionModel()->currentIndex(), - ui->comboBoxBus->currentData().toUInt(), + bus_type, ui->comboBoxChannel->currentData().toUInt()); + setCDROMType( + ui->tableViewCDROM->model(), + ui->tableViewCDROM->selectionModel()->currentIndex(), + ui->comboBoxCDROMType->currentData().toUInt()); Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt()); } @@ -291,8 +344,12 @@ SettingsFloppyCDROM::on_comboBoxChannel_activated(int) } void -SettingsFloppyCDROM::on_checkBoxEarlierDrive_stateChanged(int arg1) +SettingsFloppyCDROM::on_comboBoxCDROMType_activated(int) { - auto idx = ui->tableViewCDROM->selectionModel()->currentIndex(); - setCDROMEarly(ui->tableViewCDROM->model(), idx.siblingAtColumn(2), (arg1 == Qt::Checked) ? true : false); + setCDROMType( + ui->tableViewCDROM->model(), + ui->tableViewCDROM->selectionModel()->currentIndex(), + ui->comboBoxCDROMType->currentData().toUInt()); + ui->tableViewCDROM->resizeColumnsToContents(); + ui->tableViewCDROM->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); } diff --git a/src/qt/qt_settingsfloppycdrom.hpp b/src/qt/qt_settingsfloppycdrom.hpp index 5c2920199..3d6dd0e45 100644 --- a/src/qt/qt_settingsfloppycdrom.hpp +++ b/src/qt/qt_settingsfloppycdrom.hpp @@ -17,6 +17,7 @@ public: void save(); private slots: + void on_comboBoxCDROMType_activated(int index); void on_comboBoxChannel_activated(int index); void on_comboBoxBus_activated(int index); void on_comboBoxSpeed_activated(int index); @@ -27,8 +28,6 @@ private slots: void onFloppyRowChanged(const QModelIndex ¤t); void onCDROMRowChanged(const QModelIndex ¤t); - void on_checkBoxEarlierDrive_stateChanged(int arg1); - private: Ui::SettingsFloppyCDROM *ui; }; diff --git a/src/qt/qt_settingsfloppycdrom.ui b/src/qt/qt_settingsfloppycdrom.ui index 6233e9e7b..7a025e7a6 100644 --- a/src/qt/qt_settingsfloppycdrom.ui +++ b/src/qt/qt_settingsfloppycdrom.ui @@ -35,6 +35,9 @@ + + QAbstractItemView::NoEditTriggers + QAbstractItemView::SingleSelection @@ -99,6 +102,9 @@ + + QAbstractItemView::NoEditTriggers + QAbstractItemView::SingleSelection @@ -115,16 +121,20 @@ + + + + Bus: + + + - + Channel: - - - @@ -132,25 +142,24 @@ - - + + - Bus: + Type: + + + - - - - Earlier drive - - + + diff --git a/src/qt/qt_settingsharddisks.cpp b/src/qt/qt_settingsharddisks.cpp index 1883797e5..1b6964898 100644 --- a/src/qt/qt_settingsharddisks.cpp +++ b/src/qt/qt_settingsharddisks.cpp @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Hard disk configuration UI module. + * Hard disk configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2021-2022 Cacodemon345 - * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsharddisks.hpp" #include "ui_qt_settingsharddisks.h" diff --git a/src/qt/qt_settingsharddisks.ui b/src/qt/qt_settingsharddisks.ui index b5ab110c9..ef351e5e7 100644 --- a/src/qt/qt_settingsharddisks.ui +++ b/src/qt/qt_settingsharddisks.ui @@ -28,6 +28,9 @@ + + QAbstractItemView::NoEditTriggers + QAbstractItemView::SingleSelection diff --git a/src/qt/qt_settingsinput.cpp b/src/qt/qt_settingsinput.cpp index 49d84037f..630fc705d 100644 --- a/src/qt/qt_settingsinput.cpp +++ b/src/qt/qt_settingsinput.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Mouse/Joystick configuration UI module. + * Mouse/Joystick configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsinput.hpp" #include "ui_qt_settingsinput.h" diff --git a/src/qt/qt_settingsmachine.cpp b/src/qt/qt_settingsmachine.cpp index 0d2ffa129..b88397e30 100644 --- a/src/qt/qt_settingsmachine.cpp +++ b/src/qt/qt_settingsmachine.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Machine selection and configuration UI module. + * Machine selection and configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsmachine.hpp" #include "ui_qt_settingsmachine.h" diff --git a/src/qt/qt_settingsnetwork.cpp b/src/qt/qt_settingsnetwork.cpp index cbddfab72..014e82ab3 100644 --- a/src/qt/qt_settingsnetwork.cpp +++ b/src/qt/qt_settingsnetwork.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Network devices configuration UI module. + * Network devices configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsnetwork.hpp" #include "ui_qt_settingsnetwork.h" diff --git a/src/qt/qt_settingsotherperipherals.cpp b/src/qt/qt_settingsotherperipherals.cpp index edffd360a..e0edd7358 100644 --- a/src/qt/qt_settingsotherperipherals.cpp +++ b/src/qt/qt_settingsotherperipherals.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Other peripherals configuration UI module. + * Other peripherals configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsotherperipherals.hpp" #include "ui_qt_settingsotherperipherals.h" diff --git a/src/qt/qt_settingsotherremovable.cpp b/src/qt/qt_settingsotherremovable.cpp index f625388ea..bb77046d2 100644 --- a/src/qt/qt_settingsotherremovable.cpp +++ b/src/qt/qt_settingsotherremovable.cpp @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Other removable devices configuration UI module. + * Other removable devices configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2021-2022 Cacodemon345 - * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsotherremovable.hpp" #include "ui_qt_settingsotherremovable.h" diff --git a/src/qt/qt_settingsotherremovable.ui b/src/qt/qt_settingsotherremovable.ui index a82c296ae..c57dd3ca2 100644 --- a/src/qt/qt_settingsotherremovable.ui +++ b/src/qt/qt_settingsotherremovable.ui @@ -35,6 +35,9 @@ + + QAbstractItemView::NoEditTriggers + QAbstractItemView::SingleSelection @@ -105,6 +108,9 @@ + + QAbstractItemView::NoEditTriggers + QAbstractItemView::SingleSelection diff --git a/src/qt/qt_settingsports.cpp b/src/qt/qt_settingsports.cpp index dfa2c8853..a4be440e5 100644 --- a/src/qt/qt_settingsports.cpp +++ b/src/qt/qt_settingsports.cpp @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Serial/Parallel ports configuration UI module. + * Serial/Parallel ports configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2022 Cacodemon345 - * Copyright 2022 Jasmine Iwanek - * Copyright 2021 Joakim L. Gilje + * Copyright 2022 Cacodemon345 + * Copyright 2022 Jasmine Iwanek + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsports.hpp" #include "ui_qt_settingsports.h" diff --git a/src/qt/qt_settingssound.cpp b/src/qt/qt_settingssound.cpp index 57686f7df..f792791c1 100644 --- a/src/qt/qt_settingssound.cpp +++ b/src/qt/qt_settingssound.cpp @@ -1,18 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Sound/MIDI devices configuration UI module. + * Sound/MIDI devices configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje + * Jasmine Iwanek * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje + * Copyright 2022-2023 Jasmine Iwanek */ #include "qt_settingssound.hpp" #include "ui_qt_settingssound.h" @@ -47,17 +49,17 @@ SettingsSound::~SettingsSound() void SettingsSound::save() { - sound_card_current = ui->comboBoxSoundCard->currentData().toInt(); + for (uint8_t i = 0; i < SOUND_CARD_MAX; ++i) { + auto *cbox = findChild(QString("comboBoxSoundCard%1").arg(i + 1)); + sound_card_current[i] = cbox->currentData().toInt(); + } + midi_output_device_current = ui->comboBoxMidiOut->currentData().toInt(); midi_input_device_current = ui->comboBoxMidiIn->currentData().toInt(); mpu401_standalone_enable = ui->checkBoxMPU401->isChecked() ? 1 : 0; - SSI2001 = ui->checkBoxSSI2001->isChecked() ? 1 : 0; - ; - GAMEBLASTER = ui->checkBoxCMS->isChecked() ? 1 : 0; - GUS = ui->checkBoxGUS->isChecked() ? 1 : 0; - ; + sound_is_float = ui->checkBoxFloat32->isChecked() ? 1 : 0; - ; + if (ui->radioButtonYMFM->isChecked()) fm_driver = FM_DRV_YMFM; else @@ -69,41 +71,45 @@ SettingsSound::onCurrentMachineChanged(int machineId) { this->machineId = machineId; - auto *model = ui->comboBoxSoundCard->model(); - auto removeRows = model->rowCount(); - int c = 0; - int selectedRow = 0; - while (true) { - /* Skip "internal" if machine doesn't have it. */ - if ((c == 1) && (machine_has_flags(machineId, MACHINE_SOUND) == 0)) { - c++; - continue; - } + int c = 0; + int selectedRow = 0; - auto *sound_dev = sound_card_getdevice(c); - QString name = DeviceConfig::DeviceName(sound_dev, sound_card_get_internal_name(c), 1); - if (name.isEmpty()) { - break; - } + for (uint8_t i = 0; i < SOUND_CARD_MAX; ++i) { + auto *cbox = findChild(QString("comboBoxSoundCard%1").arg(i + 1)); + auto *model = cbox->model(); + auto removeRows = model->rowCount(); + c = 0; + selectedRow = 0; - if (sound_card_available(c)) { - if (device_is_valid(sound_dev, machineId)) { + while (true) { + /* Skip "internal" if machine doesn't have it. */ + if ((c == 1) && (machine_has_flags(machineId, MACHINE_SOUND) == 0)) { + c++; + continue; + } + + auto name = DeviceConfig::DeviceName(sound_card_getdevice(c), sound_card_get_internal_name(c), 1); + if (name.isEmpty()) { + break; + } + + if (sound_card_available(c) && device_is_valid(sound_card_getdevice(c), machineId)) { int row = Models::AddEntry(model, name, c); - if (c == sound_card_current) { + if (c == sound_card_current[i]) { selectedRow = row - removeRows; } } + c++; } - c++; + model->removeRows(0, removeRows); + cbox->setEnabled(model->rowCount() > 0); + cbox->setCurrentIndex(-1); + cbox->setCurrentIndex(selectedRow); } - model->removeRows(0, removeRows); - ui->comboBoxSoundCard->setEnabled(model->rowCount() > 0); - ui->comboBoxSoundCard->setCurrentIndex(-1); - ui->comboBoxSoundCard->setCurrentIndex(selectedRow); - model = ui->comboBoxMidiOut->model(); - removeRows = model->rowCount(); + auto model = ui->comboBoxMidiOut->model(); + auto removeRows = model->rowCount(); c = 0; selectedRow = 0; while (true) { @@ -150,19 +156,8 @@ SettingsSound::onCurrentMachineChanged(int machineId) ui->comboBoxMidiIn->setCurrentIndex(selectedRow); ui->checkBoxMPU401->setChecked(mpu401_standalone_enable > 0); - ui->checkBoxSSI2001->setChecked(SSI2001 > 0); - ui->checkBoxCMS->setChecked(GAMEBLASTER > 0); - ui->checkBoxGUS->setChecked(GUS > 0); ui->checkBoxFloat32->setChecked(sound_is_float > 0); - bool hasIsa = machine_has_bus(machineId, MACHINE_BUS_ISA) > 0; - bool hasIsa16 = machine_has_bus(machineId, MACHINE_BUS_ISA16) > 0; - ui->checkBoxCMS->setEnabled(hasIsa); - ui->pushButtonConfigureCMS->setEnabled((GAMEBLASTER > 0) && hasIsa); - ui->checkBoxGUS->setEnabled(hasIsa16); - ui->pushButtonConfigureGUS->setEnabled((GUS > 0) && hasIsa16); - ui->checkBoxSSI2001->setEnabled(hasIsa); - ui->pushButtonConfigureSSI2001->setEnabled((SSI2001 > 0) && hasIsa); switch (fm_driver) { case FM_DRV_YMFM: ui->radioButtonYMFM->setChecked(true); @@ -192,18 +187,63 @@ allowMpu401(Ui::SettingsSound *ui) } void -SettingsSound::on_comboBoxSoundCard_currentIndexChanged(int index) +SettingsSound::on_comboBoxSoundCard1_currentIndexChanged(int index) { if (index < 0) { return; } - ui->pushButtonConfigureSoundCard->setEnabled(sound_card_has_config(ui->comboBoxSoundCard->currentData().toInt())); + ui->pushButtonConfigureSoundCard1->setEnabled(sound_card_has_config(ui->comboBoxSoundCard1->currentData().toInt())); } void -SettingsSound::on_pushButtonConfigureSoundCard_clicked() +SettingsSound::on_pushButtonConfigureSoundCard1_clicked() { - DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard->currentData().toInt()), 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard1->currentData().toInt()), 0, qobject_cast(Settings::settings)); +} + +void +SettingsSound::on_comboBoxSoundCard2_currentIndexChanged(int index) +{ + if (index < 0) { + return; + } + ui->pushButtonConfigureSoundCard2->setEnabled(sound_card_has_config(ui->comboBoxSoundCard2->currentData().toInt())); +} + +void +SettingsSound::on_pushButtonConfigureSoundCard2_clicked() +{ + DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard2->currentData().toInt()), 0, qobject_cast(Settings::settings)); +} + +void +SettingsSound::on_comboBoxSoundCard3_currentIndexChanged(int index) +{ + if (index < 0) { + return; + } + ui->pushButtonConfigureSoundCard3->setEnabled(sound_card_has_config(ui->comboBoxSoundCard3->currentData().toInt())); +} + +void +SettingsSound::on_pushButtonConfigureSoundCard3_clicked() +{ + DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard3->currentData().toInt()), 0, qobject_cast(Settings::settings)); +} + +void +SettingsSound::on_comboBoxSoundCard4_currentIndexChanged(int index) +{ + if (index < 0) { + return; + } + ui->pushButtonConfigureSoundCard4->setEnabled(sound_card_has_config(ui->comboBoxSoundCard4->currentData().toInt())); +} + +void +SettingsSound::on_pushButtonConfigureSoundCard4_clicked() +{ + DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard4->currentData().toInt()), 0, qobject_cast(Settings::settings)); } void @@ -246,24 +286,6 @@ SettingsSound::on_checkBoxMPU401_stateChanged(int state) ui->pushButtonConfigureMPU401->setEnabled(state == Qt::Checked); } -void -SettingsSound::on_checkBoxSSI2001_stateChanged(int state) -{ - ui->pushButtonConfigureSSI2001->setEnabled(state == Qt::Checked); -} - -void -SettingsSound::on_checkBoxCMS_stateChanged(int state) -{ - ui->pushButtonConfigureCMS->setEnabled(state == Qt::Checked); -} - -void -SettingsSound::on_checkBoxGUS_stateChanged(int state) -{ - ui->pushButtonConfigureGUS->setEnabled(state == Qt::Checked); -} - void SettingsSound::on_pushButtonConfigureMPU401_clicked() { @@ -273,21 +295,3 @@ SettingsSound::on_pushButtonConfigureMPU401_clicked() DeviceConfig::ConfigureDevice(&mpu401_device, 0, qobject_cast(Settings::settings)); } } - -void -SettingsSound::on_pushButtonConfigureSSI2001_clicked() -{ - DeviceConfig::ConfigureDevice(&ssi2001_device, 0, qobject_cast(Settings::settings)); -} - -void -SettingsSound::on_pushButtonConfigureCMS_clicked() -{ - DeviceConfig::ConfigureDevice(&cms_device, 0, qobject_cast(Settings::settings)); -} - -void -SettingsSound::on_pushButtonConfigureGUS_clicked() -{ - DeviceConfig::ConfigureDevice(&gus_device, 0, qobject_cast(Settings::settings)); -} diff --git a/src/qt/qt_settingssound.hpp b/src/qt/qt_settingssound.hpp index e0bc2e4f8..92b700c92 100644 --- a/src/qt/qt_settingssound.hpp +++ b/src/qt/qt_settingssound.hpp @@ -20,20 +20,20 @@ public slots: void onCurrentMachineChanged(int machineId); private slots: - void on_pushButtonConfigureGUS_clicked(); - void on_pushButtonConfigureCMS_clicked(); - void on_pushButtonConfigureSSI2001_clicked(); void on_pushButtonConfigureMPU401_clicked(); - void on_checkBoxGUS_stateChanged(int arg1); - void on_checkBoxCMS_stateChanged(int arg1); - void on_checkBoxSSI2001_stateChanged(int arg1); void on_checkBoxMPU401_stateChanged(int arg1); void on_pushButtonConfigureMidiIn_clicked(); void on_pushButtonConfigureMidiOut_clicked(); void on_comboBoxMidiIn_currentIndexChanged(int index); void on_comboBoxMidiOut_currentIndexChanged(int index); - void on_pushButtonConfigureSoundCard_clicked(); - void on_comboBoxSoundCard_currentIndexChanged(int index); + void on_pushButtonConfigureSoundCard1_clicked(); + void on_comboBoxSoundCard1_currentIndexChanged(int index); + void on_pushButtonConfigureSoundCard2_clicked(); + void on_comboBoxSoundCard2_currentIndexChanged(int index); + void on_pushButtonConfigureSoundCard3_clicked(); + void on_comboBoxSoundCard3_currentIndexChanged(int index); + void on_pushButtonConfigureSoundCard4_clicked(); + void on_comboBoxSoundCard4_currentIndexChanged(int index); private: Ui::SettingsSound *ui; diff --git a/src/qt/qt_settingssound.ui b/src/qt/qt_settingssound.ui index 9ae91dcd2..f85a09a0d 100644 --- a/src/qt/qt_settingssound.ui +++ b/src/qt/qt_settingssound.ui @@ -26,42 +26,73 @@ 0 - + MIDI In Device: - - - - Innovation SSI-2001 - - - - - - - Gravis Ultrasound - - - - Sound card: + Sound card #1: - + Configure - + + + + Sound card #2: + + + + + + + Configure + + + + + + + Sound card #3: + + + + + + + Configure + + + + + + + + Sound card #4: + + + + + + + Configure + + + + + + @@ -71,49 +102,35 @@ - + MIDI Out Device: - + Standalone MPU-401 - + Configure - + Configure - - - - Configure - - - - - - - CMS / Game Blaster - - - - + @@ -123,35 +140,21 @@ - + Configure - + Use FLOAT32 sound - - - - Configure - - - - - - - Configure - - - - + @@ -180,7 +183,7 @@ - + Qt::Vertical @@ -194,7 +197,37 @@ - + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + 0 diff --git a/src/qt/qt_settingsstoragecontrollers.cpp b/src/qt/qt_settingsstoragecontrollers.cpp index 2aecab568..a732e9820 100644 --- a/src/qt/qt_settingsstoragecontrollers.cpp +++ b/src/qt/qt_settingsstoragecontrollers.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Storage devices configuration UI module. + * Storage devices configuration UI module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * - * Copyright 2021 Joakim L. Gilje + * Copyright 2021 Joakim L. Gilje */ #include "qt_settingsstoragecontrollers.hpp" #include "ui_qt_settingsstoragecontrollers.h" @@ -25,6 +25,7 @@ extern "C" { #include <86box/hdc.h> #include <86box/hdc_ide.h> #include <86box/fdc_ext.h> +#include <86box/cdrom_interface.h> #include <86box/scsi.h> #include <86box/scsi_device.h> #include <86box/cassette.h> @@ -57,11 +58,12 @@ SettingsStorageControllers::save() auto *cbox = findChild(QString("comboBoxSCSI%1").arg(i + 1)); scsi_card_current[i] = cbox->currentData().toInt(); } - hdc_current = ui->comboBoxHD->currentData().toInt(); - fdc_type = ui->comboBoxFD->currentData().toInt(); - ide_ter_enabled = ui->checkBoxTertiaryIDE->isChecked() ? 1 : 0; - ide_qua_enabled = ui->checkBoxQuaternaryIDE->isChecked() ? 1 : 0; - cassette_enable = ui->checkBoxCassette->isChecked() ? 1 : 0; + hdc_current = ui->comboBoxHD->currentData().toInt(); + fdc_type = ui->comboBoxFD->currentData().toInt(); + cdrom_interface_current = ui->comboBoxCDInterface->currentData().toInt(); + ide_ter_enabled = ui->checkBoxTertiaryIDE->isChecked() ? 1 : 0; + ide_qua_enabled = ui->checkBoxQuaternaryIDE->isChecked() ? 1 : 0; + cassette_enable = ui->checkBoxCassette->isChecked() ? 1 : 0; } void @@ -131,6 +133,35 @@ SettingsStorageControllers::onCurrentMachineChanged(int machineId) ui->comboBoxFD->setCurrentIndex(-1); ui->comboBoxFD->setCurrentIndex(selectedRow); + /*CD interface controller config*/ + model = ui->comboBoxCDInterface->model(); + removeRows = model->rowCount(); + c = 0; + selectedRow = 0; + while (true) { + /* Skip "internal" if machine doesn't have it. */ + QString name = DeviceConfig::DeviceName(cdrom_interface_get_device(c), cdrom_interface_get_internal_name(c), 1); + if (name.isEmpty()) { + break; + } + + if (cdrom_interface_available(c)) { + auto *cdrom_interface_dev = cdrom_interface_get_device(c); + + if (device_is_valid(cdrom_interface_dev, machineId)) { + int row = Models::AddEntry(model, name, c); + if (c == cdrom_interface_current) { + selectedRow = row - removeRows; + } + } + } + c++; + } + model->removeRows(0, removeRows); + ui->comboBoxCDInterface->setEnabled(model->rowCount() > 0); + ui->comboBoxCDInterface->setCurrentIndex(-1); + ui->comboBoxCDInterface->setCurrentIndex(selectedRow); + for (int i = 0; i < SCSI_BUS_MAX; ++i) { auto *cbox = findChild(QString("comboBoxSCSI%1").arg(i + 1)); model = cbox->model(); @@ -187,6 +218,14 @@ SettingsStorageControllers::on_comboBoxFD_currentIndexChanged(int index) ui->pushButtonFD->setEnabled(hdc_has_config(ui->comboBoxFD->currentData().toInt()) > 0); } +void SettingsStorageControllers::on_comboBoxCDInterface_currentIndexChanged(int index) +{ + if (index < 0) { + return; + } + ui->pushButtonCDInterface->setEnabled(cdrom_interface_has_config(ui->comboBoxCDInterface->currentData().toInt()) > 0); +} + void SettingsStorageControllers::on_checkBoxTertiaryIDE_stateChanged(int arg1) { @@ -211,6 +250,12 @@ SettingsStorageControllers::on_pushButtonFD_clicked() DeviceConfig::ConfigureDevice(fdc_card_getdevice(ui->comboBoxFD->currentData().toInt()), 0, qobject_cast(Settings::settings)); } +void +SettingsStorageControllers::on_pushButtonCDInterface_clicked() +{ + DeviceConfig::ConfigureDevice(cdrom_interface_get_device(ui->comboBoxCDInterface->currentData().toInt()), 0, qobject_cast(Settings::settings)); +} + void SettingsStorageControllers::on_pushButtonTertiaryIDE_clicked() { diff --git a/src/qt/qt_settingsstoragecontrollers.hpp b/src/qt/qt_settingsstoragecontrollers.hpp index 7e9cd9d6c..5641889e4 100644 --- a/src/qt/qt_settingsstoragecontrollers.hpp +++ b/src/qt/qt_settingsstoragecontrollers.hpp @@ -32,10 +32,12 @@ private slots: void on_pushButtonTertiaryIDE_clicked(); void on_pushButtonFD_clicked(); void on_pushButtonHD_clicked(); + void on_pushButtonCDInterface_clicked(); void on_checkBoxQuaternaryIDE_stateChanged(int arg1); void on_checkBoxTertiaryIDE_stateChanged(int arg1); void on_comboBoxFD_currentIndexChanged(int index); void on_comboBoxHD_currentIndexChanged(int index); + void on_comboBoxCDInterface_currentIndexChanged(int index); private: Ui::SettingsStorageControllers *ui; diff --git a/src/qt/qt_settingsstoragecontrollers.ui b/src/qt/qt_settingsstoragecontrollers.ui index 30a59f982..558d4c441 100644 --- a/src/qt/qt_settingsstoragecontrollers.ui +++ b/src/qt/qt_settingsstoragecontrollers.ui @@ -49,6 +49,23 @@ + + + + CD-ROM Controller: + + + + + + + + + + Configure + + + @@ -69,21 +86,21 @@ - + Tertiary IDE Controller - + Quaternary IDE Controller - + false @@ -93,7 +110,7 @@ - + false diff --git a/src/qt/qt_softwarerenderer.cpp b/src/qt/qt_softwarerenderer.cpp index cd27e1c0e..a8c0229d3 100644 --- a/src/qt/qt_softwarerenderer.cpp +++ b/src/qt/qt_softwarerenderer.cpp @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Software renderer module. + * Software renderer module. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * Teemu Korhonen * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2022 Cacodemon345 - * Copyright 2021-2022 Teemu Korhonen + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Teemu Korhonen */ #include "qt_softwarerenderer.hpp" #include diff --git a/src/qt/qt_soundgain.cpp b/src/qt/qt_soundgain.cpp index 9283ae42e..725a5b115 100644 --- a/src/qt/qt_soundgain.cpp +++ b/src/qt/qt_soundgain.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Sound gain dialog UI module. + * Sound gain dialog UI module. * * * - * Authors: Cacodemon345 + * Authors: Cacodemon345 * - * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Cacodemon345 */ #include "qt_soundgain.hpp" #include "ui_qt_soundgain.h" diff --git a/src/qt/qt_specifydimensions.cpp b/src/qt/qt_specifydimensions.cpp index e2aa24a9b..c01ef2ae4 100644 --- a/src/qt/qt_specifydimensions.cpp +++ b/src/qt/qt_specifydimensions.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Specify dimensions UI module. + * Specify dimensions UI module. * * * - * Authors: Cacodemon345 + * Authors: Cacodemon345 * - * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Cacodemon345 */ #include "qt_specifydimensions.h" #include "ui_qt_specifydimensions.h" diff --git a/src/qt/qt_styleoverride.cpp b/src/qt/qt_styleoverride.cpp index 6efe523d9..7ec5a341c 100644 --- a/src/qt/qt_styleoverride.cpp +++ b/src/qt/qt_styleoverride.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Style override class. + * Style override class. * * * - * Authors: Teemu Korhonen + * Authors: Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * Copyright 2022 Teemu Korhonen */ #include "qt_styleoverride.hpp" diff --git a/src/qt/qt_ui.cpp b/src/qt/qt_ui.cpp index 305ec9ed5..9d52e596a 100644 --- a/src/qt/qt_ui.cpp +++ b/src/qt/qt_ui.cpp @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Common UI functions. + * Common UI functions. * * * - * Authors: Joakim L. Gilje + * Authors: Joakim L. Gilje * Cacodemon345 * - * Copyright 2021 Joakim L. Gilje - * Copyright 2021-2022 Cacodemon345 + * Copyright 2021 Joakim L. Gilje + * Copyright 2021-2022 Cacodemon345 */ #include diff --git a/src/qt/qt_unixmanagerfilter.cpp b/src/qt/qt_unixmanagerfilter.cpp index d1091198d..5d94584e6 100644 --- a/src/qt/qt_unixmanagerfilter.cpp +++ b/src/qt/qt_unixmanagerfilter.cpp @@ -1,19 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Source file for Unix VM-managers (client-side) + * Source file for Unix VM-managers (client-side) * - * Authors: - * Teemu Korhonen - Cacodemon345 * - * Copyright 2022 Teemu Korhonen - * Copyright 2022 Cacodemon345 + * + * Authors: Teemu Korhonen + * Cacodemon345 + * + * Copyright 2022 Teemu Korhonen + * Copyright 2022 Cacodemon345 */ #include "qt_unixmanagerfilter.hpp" diff --git a/src/qt/qt_unixmanagerfilter.hpp b/src/qt/qt_unixmanagerfilter.hpp index eca373b47..0587e06ee 100644 --- a/src/qt/qt_unixmanagerfilter.hpp +++ b/src/qt/qt_unixmanagerfilter.hpp @@ -1,19 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * * Header file for Unix VM-managers (client-side) * - * Authors: - * Teemu Korhonen - Cacodemon345 * - * Copyright 2022 Teemu Korhonen - * Copyright 2022 Cacodemon345 + * + * Authors: Teemu Korhonen + * Cacodemon345 + * + * Copyright 2022 Teemu Korhonen + * Copyright 2022 Cacodemon345 */ #ifndef QT_UNIXMANAGERFILTER_HPP diff --git a/src/qt/qt_util.cpp b/src/qt/qt_util.cpp index 876a4b047..b05b656bb 100644 --- a/src/qt/qt_util.cpp +++ b/src/qt/qt_util.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Utility functions. + * Utility functions. * * * - * Authors: Teemu Korhonen + * Authors: Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * Copyright 2022 Teemu Korhonen */ #include #include diff --git a/src/qt/qt_winmanagerfilter.cpp b/src/qt/qt_winmanagerfilter.cpp index d9a6208b1..0218ae5ba 100644 --- a/src/qt/qt_winmanagerfilter.cpp +++ b/src/qt/qt_winmanagerfilter.cpp @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Windows VM-managers native messages filter + * Windows VM-managers native messages filter * - * Authors: - * Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * + * Authors: Teemu Korhonen + * + * Copyright 2022 Teemu Korhonen */ #include "qt_winmanagerfilter.hpp" diff --git a/src/qt/qt_winmanagerfilter.hpp b/src/qt/qt_winmanagerfilter.hpp index cd141e93f..e8fb06d90 100644 --- a/src/qt/qt_winmanagerfilter.hpp +++ b/src/qt/qt_winmanagerfilter.hpp @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header file for Windows VM-managers native messages filter + * Header file for Windows VM-managers native messages filter * - * Authors: - * Teemu Korhonen * - * Copyright 2022 Teemu Korhonen + * + * Authors: Teemu Korhonen + * + * Copyright 2022 Teemu Korhonen */ #ifndef QT_WINDOWSMANAGERFILTER_HPP diff --git a/src/qt/qt_winrawinputfilter.cpp b/src/qt/qt_winrawinputfilter.cpp index 56d8c9ec9..88b723d4c 100644 --- a/src/qt/qt_winrawinputfilter.cpp +++ b/src/qt/qt_winrawinputfilter.cpp @@ -1,19 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Windows raw input native filter for QT + * Windows raw input native filter for QT * - * Authors: - * Teemu Korhonen - * Miran Grca, * - * Copyright 2021 Teemu Korhonen - * Copyright 2016-2018 Miran Grca. + * + * Authors: Teemu Korhonen + * Miran Grca, + * + * Copyright 2021 Teemu Korhonen + * Copyright 2016-2018 Miran Grca. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/qt/qt_winrawinputfilter.hpp b/src/qt/qt_winrawinputfilter.hpp index 252f7206c..6d23b83b7 100644 --- a/src/qt/qt_winrawinputfilter.hpp +++ b/src/qt/qt_winrawinputfilter.hpp @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Header file for windows raw input native filter for QT + * Header file for windows raw input native filter for QT * - * Authors: - * Teemu Korhonen * - * Copyright 2021 Teemu Korhonen + * + * Authors: Teemu Korhonen + * + * Copyright 2021 Teemu Korhonen * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/qt/win_dynld.c b/src/qt/win_dynld.c index 66fd0503d..88fb632bc 100644 --- a/src/qt/win_dynld.c +++ b/src/qt/win_dynld.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Try to load a support DLL. + * Try to load a support DLL. * * * - * Author: Fred N. van Kempen, + * Authors: Fred N. van Kempen, * - * Copyright 2017,2018 Fred N. van Kempen + * Copyright 2017-2018 Fred N. van Kempen */ #include #include diff --git a/src/qt/win_joystick_rawinput.c b/src/qt/win_joystick_rawinput.c index f41131b28..2976a54b9 100644 --- a/src/qt/win_joystick_rawinput.c +++ b/src/qt/win_joystick_rawinput.c @@ -1,20 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * RawInput joystick interface. + * RawInput joystick interface. * - * Authors: Sarah Walker, - * Miran Grca, - * GH Cao, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. - * Copyright 2020 GH Cao. + * + * Authors: Sarah Walker, + * Miran Grca, + * GH Cao, + * + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. + * Copyright 2020 GH Cao. */ #include #include diff --git a/src/qt/wl_mouse.cpp b/src/qt/wl_mouse.cpp index 4cc1b3169..9b23792c8 100644 --- a/src/qt/wl_mouse.cpp +++ b/src/qt/wl_mouse.cpp @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Wayland mouse input module. + * Wayland mouse input module. * * * - * Authors: Cacodemon345 + * Authors: Cacodemon345 * - * Copyright 2021-2022 Cacodemon345 + * Copyright 2021-2022 Cacodemon345 */ #include "wl_mouse.hpp" #include diff --git a/src/qt/xinput2_mouse.cpp b/src/qt/xinput2_mouse.cpp index 5017c78d2..e73f36869 100644 --- a/src/qt/xinput2_mouse.cpp +++ b/src/qt/xinput2_mouse.cpp @@ -1,21 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * X11 Xinput2 mouse input module. + * X11 Xinput2 mouse input module. * * * - * Authors: Cacodemon345 + * Authors: Cacodemon345 + * RichardG * - * Copyright 2022 Cacodemon345 + * Copyright 2022 Cacodemon345. + * Copyright 2023 RichardG. */ -/* Valuator parsing and duplicate event checking code from SDL2. */ #include #include #include @@ -43,20 +44,19 @@ extern "C" { #include <86box/plat.h> } -int xi2flides[2] = { 0, 0 }; - static Display *disp = nullptr; static QThread *procThread = nullptr; static XIEventMask ximask; static std::atomic exitfromthread = false; static std::atomic xi2_mouse_x = 0, xi2_mouse_y = 0, xi2_mouse_abs_x = 0, xi2_mouse_abs_y = 0; -static int xi2opcode = 0; -static double prev_rel_coords[2] = { 0., 0. }; -static Time prev_time = 0; +static int xi2opcode = 0; +static double prev_coords[2] = { 0.0 }; +static Time prev_time = 0; -// From SDL2. +/* Based on SDL2. */ static void -parse_valuators(const double *input_values, const unsigned char *mask, int mask_len, +parse_valuators(const double *input_values, + const unsigned char *mask, int mask_len, double *output_values, int output_values_len) { int i = 0, z = 0; @@ -64,11 +64,10 @@ parse_valuators(const double *input_values, const unsigned char *mask, int mask_ if (top > 16) top = 16; - memset(output_values, 0, output_values_len * sizeof(double)); + memset(output_values, 0, output_values_len * sizeof(output_values[0])); for (; i < top && z < output_values_len; i++) { if (XIMaskIsSet(mask, i)) { - const int value = (int) *input_values; - output_values[z] = value; + output_values[z] = *input_values; input_values++; } z++; @@ -77,23 +76,37 @@ parse_valuators(const double *input_values, const unsigned char *mask, int mask_ static bool exitthread = false; +static int +xinput2_get_xtest_pointer() +{ + /* The XTEST pointer events injected by VNC servers to move the cursor always report + absolute coordinates, despite XTEST declaring relative axes (related: SDL issue 1836). + This looks for the XTEST pointer so that we can assume it's absolute as a workaround. */ + int devs; + XIDeviceInfo *info = XIQueryDevice(disp, XIAllDevices, &devs), *dev; + for (int i = 0; i < devs; i++) { + dev = &info[i]; + if ((dev->use == XISlavePointer) && !strcmp(dev->name, "Virtual core XTEST pointer")) + return dev->deviceid; + } + return -1; +} + void xinput2_proc() { Window win; win = DefaultRootWindow(disp); + int xtest_pointer = xinput2_get_xtest_pointer(); + ximask.deviceid = XIAllMasterDevices; ximask.mask_len = XIMaskLen(XI_LASTEVENT); ximask.mask = (unsigned char *) calloc(ximask.mask_len, sizeof(unsigned char)); - XISetMask(ximask.mask, XI_RawKeyPress); - XISetMask(ximask.mask, XI_RawKeyRelease); - XISetMask(ximask.mask, XI_RawButtonPress); - XISetMask(ximask.mask, XI_RawButtonRelease); XISetMask(ximask.mask, XI_RawMotion); - if (XKeysymToKeycode(disp, XK_Home) == 69) - XISetMask(ximask.mask, XI_Motion); + XISetMask(ximask.mask, XI_Motion); + XISetMask(ximask.mask, XI_DeviceChanged); XISelectEvents(disp, win, &ximask, 1); @@ -103,23 +116,88 @@ xinput2_proc() XGenericEventCookie *cookie = (XGenericEventCookie *) &ev.xcookie; XNextEvent(disp, (XEvent *) &ev); - if (XGetEventData(disp, cookie) && cookie->type == GenericEvent && cookie->extension == xi2opcode) { + if (XGetEventData(disp, cookie) && (cookie->type == GenericEvent) && (cookie->extension == xi2opcode)) { + const XIRawEvent *rawev = (const XIRawEvent *) cookie->data; + double coords[2] = { 0.0 }; + switch (cookie->evtype) { + case XI_Motion: + { + const XIDeviceEvent *devev = (const XIDeviceEvent *) cookie->data; + parse_valuators(devev->valuators.values, devev->valuators.mask, devev->valuators.mask_len, coords, 2); + + /* XIDeviceEvent and XIRawEvent share the XIEvent base struct, which + doesn't contain deviceid, but that's at the same offset on both. */ + goto common_motion; + } + case XI_RawMotion: { - const XIRawEvent *rawev = (const XIRawEvent *) cookie->data; - double relative_coords[2] = { 0., 0. }; - parse_valuators(rawev->raw_values, rawev->valuators.mask, - rawev->valuators.mask_len, relative_coords, 2); + parse_valuators(rawev->raw_values, rawev->valuators.mask, rawev->valuators.mask_len, coords, 2); +common_motion: + /* Ignore duplicated events. */ + if ((rawev->time == prev_time) && (coords[0] == prev_coords[0]) && (coords[1] == prev_coords[1])) + break; - if ((rawev->time == prev_time) && (relative_coords[0] == prev_rel_coords[0]) && (relative_coords[1] == prev_rel_coords[1])) { - break; // Ignore duplicated events. + /* SDL2 queries the device on every event, so doing that should be fine. */ + int i; + XIDeviceInfo *xidevinfo = XIQueryDevice(disp, rawev->deviceid, &i); + if (xidevinfo) { + /* Process the device's axes. */ + int axis = 0; + for (i = 0; i < xidevinfo->num_classes; i++) { + const XIValuatorClassInfo *v = (const XIValuatorClassInfo *) xidevinfo->classes[i]; + if (v->type == XIValuatorClass) { + /* Is this an absolute or relative axis? */ + if ((v->mode == XIModeRelative) && (rawev->sourceid != xtest_pointer)) { + /* Set relative coordinates. */ + if (axis == 0) + xi2_mouse_x = xi2_mouse_x + coords[axis]; + else + xi2_mouse_y = xi2_mouse_y + coords[axis]; + } else { + /* Convert absolute value range to pixel granularity, then to relative coordinates. */ + int disp_screen = XDefaultScreen(disp); + double abs_div; + if (axis == 0) { + if (v->mode == XIModeRelative) { + /* XTEST axes have dummy min/max values because they're nominally relative, + but in practice, the injected absolute coordinates are already in pixels. */ + abs_div = coords[axis]; + } else { + abs_div = (v->max - v->min) / (double) XDisplayWidth(disp, disp_screen); + if (abs_div <= 0) + abs_div = 1; + abs_div = (coords[axis] - v->min) / abs_div; + } + + if (xi2_mouse_abs_x != 0) + xi2_mouse_x = xi2_mouse_x + (abs_div - xi2_mouse_abs_x); + xi2_mouse_abs_x = abs_div; + } else { + if (v->mode == XIModeRelative) { + /* Same as above. */ + abs_div = coords[axis]; + } else { + abs_div = (v->max - v->min) / (double) XDisplayHeight(disp, disp_screen); + if (abs_div <= 0) + abs_div = 1; + abs_div = (coords[axis] - v->min) / abs_div; + } + + if (xi2_mouse_abs_y != 0) + xi2_mouse_y = xi2_mouse_y + (abs_div - xi2_mouse_abs_y); + xi2_mouse_abs_y = abs_div; + } + } + prev_coords[axis] = coords[axis]; + if (++axis >= 2) /* stop after X and Y processed */ + break; + } + } } - xi2_mouse_x = xi2_mouse_x + relative_coords[0]; - xi2_mouse_y = xi2_mouse_y + relative_coords[1]; - prev_rel_coords[0] = relative_coords[0]; - prev_rel_coords[1] = relative_coords[1]; - prev_time = rawev->time; + + prev_time = rawev->time; if (!mouse_capture) break; XWindowAttributes winattrib {}; @@ -128,19 +206,16 @@ xinput2_proc() XWarpPointer(disp, XRootWindow(disp, XScreenNumberOfScreen(winattrib.screen)), XRootWindow(disp, XScreenNumberOfScreen(winattrib.screen)), 0, 0, 0, 0, globalPoint.x(), globalPoint.y()); XFlush(disp); } + + break; } - case XI_Motion: + + case XI_DeviceChanged: { - if (XKeysymToKeycode(disp, XK_Home) == 69) { - // No chance we will get raw motion events on VNC. - const XIDeviceEvent *motionev = (const XIDeviceEvent *) cookie->data; - if (xi2_mouse_abs_x != 0 || xi2_mouse_abs_y != 0) { - xi2_mouse_x = xi2_mouse_x + (motionev->event_x - xi2_mouse_abs_x); - xi2_mouse_y = xi2_mouse_y + (motionev->event_y - xi2_mouse_abs_y); - } - xi2_mouse_abs_x = motionev->event_x; - xi2_mouse_abs_y = motionev->event_y; - } + /* Re-scan for XTEST pointer, just in case. */ + xtest_pointer = xinput2_get_xtest_pointer(); + + break; } } } diff --git a/src/scsi/CMakeLists.txt b/src/scsi/CMakeLists.txt index 467affd5a..addde844e 100644 --- a/src/scsi/CMakeLists.txt +++ b/src/scsi/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(scsi OBJECT scsi.c scsi_device.c scsi_cdrom.c scsi_disk.c diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index 669d050bf..aec89d588 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -641,8 +641,8 @@ aha_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv) * their way of handling issues like these at the time.. * * Patch 1: emulate the I/O ADDR SW setting by patching a - * byte in the BIOS that indicates the I/O ADDR - * switch setting on the board. + * byte in the BIOS that indicates the I/O ADDR + * switch setting on the board. */ if (dev->rom_ioaddr != 0x0000) { /* Look up the I/O address in the table. */ @@ -789,8 +789,8 @@ aha_setbios(x54x_t *dev) * their way of handling issues like these at the time.. * * Patch 1: emulate the I/O ADDR SW setting by patching a - * byte in the BIOS that indicates the I/O ADDR - * switch setting on the board. + * byte in the BIOS that indicates the I/O ADDR + * switch setting on the board. */ if (dev->rom_ioaddr != 0x0000) { /* Look up the I/O address in the table. */ @@ -880,11 +880,11 @@ aha_initnvr(x54x_t *dev) dev->nvr[0] |= EE0_ALTFLOP; dev->nvr[1] = dev->Irq - 9; /* IRQ15 */ dev->nvr[1] |= (dev->DmaChannel << 4); /* DMA6 */ - dev->nvr[2] = (EE2_HABIOS | /* BIOS enabled */ - EE2_DYNSCAN | /* scan bus */ - EE2_EXT1G | EE2_RMVOK); /* Imm return on seek */ - dev->nvr[3] = SPEED_50; /* speed 5.0 MB/s */ - dev->nvr[6] = (EE6_TERM | /* host term enable */ + dev->nvr[2] = (EE2_HABIOS | /* BIOS enabled */ + EE2_DYNSCAN | /* scan bus */ + EE2_EXT1G | EE2_RMVOK); /* Imm return on seek */ + dev->nvr[3] = SPEED_50; /* speed 5.0 MB/s */ + dev->nvr[6] = (EE6_TERM | /* host term enable */ EE6_RSTBUS); /* reset SCSI bus on boot*/ } diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index c0b0575df..1e0f74d0f 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -1152,7 +1152,7 @@ BuslogicPCIRead(int func, int addr, void *p) case 0x13: return buslogic_pci_bar[0].addr_regs[3]; case 0x14: - // return (buslogic_pci_bar[1].addr_regs[0] & 0xe0); /*Memory space*/ + // return (buslogic_pci_bar[1].addr_regs[0] & 0xe0); /*Memory space*/ return 0x00; case 0x15: return buslogic_pci_bar[1].addr_regs[1] & 0xc0; diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index e736b879d..38693f590 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -62,7 +62,7 @@ typedef struct #pragma pack(pop) /* Table of all SCSI commands and their flags, needed for the new disc change / not ready handler. */ -const uint8_t scsi_cdrom_command_flags[0x100] = { +uint8_t scsi_cdrom_command_flags[0x100] = { IMPLEMENTED | CHECK_READY | NONDATA, /* 0x00 */ IMPLEMENTED | ALLOW_UA | NONDATA | SCSI_ONLY, /* 0x01 */ 0, /* 0x02 */ @@ -71,7 +71,9 @@ const uint8_t scsi_cdrom_command_flags[0x100] = { IMPLEMENTED | CHECK_READY, /* 0x08 */ 0, 0, /* 0x09-0x0A */ IMPLEMENTED | CHECK_READY | NONDATA, /* 0x0B */ - 0, 0, 0, 0, 0, 0, /* 0x0C-0x11 */ + 0, /* 0x0C */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0x0D */ + 0, 0, 0, 0, /* 0x0E-0x11 */ IMPLEMENTED | ALLOW_UA, /* 0x12 */ IMPLEMENTED | CHECK_READY | NONDATA | SCSI_ONLY, /* 0x13 */ 0, /* 0x14 */ @@ -81,9 +83,11 @@ const uint8_t scsi_cdrom_command_flags[0x100] = { IMPLEMENTED | CHECK_READY, /* 0x1B */ 0, 0, /* 0x1C-0x1D */ IMPLEMENTED | CHECK_READY, /* 0x1E */ - 0, 0, 0, 0, 0, 0, /* 0x1F-0x24 */ + 0, 0, 0, /* 0x1F-0x21*/ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0x22*/ + 0, 0, /* 0x23-0x24 */ IMPLEMENTED | CHECK_READY, /* 0x25 */ - IMPLEMENTED | CHECK_READY | SCSI_ONLY | EARLY_ONLY, /* 0x26 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0x26 */ 0, /* 0x27 */ IMPLEMENTED | CHECK_READY, /* 0x28 */ 0, 0, /* 0x29-0x2A */ @@ -143,21 +147,94 @@ const uint8_t scsi_cdrom_command_flags[0x100] = { IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC0 */ IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC1 */ IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC2 */ - 0, /* 0xC3 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC3 */ IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC4 */ - 0, /* 0xC5 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC5 */ IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC6 */ IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC7 */ - 0, 0, 0, 0, 0, /* 0xC8-0xCC */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC8 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xC9 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xCA */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xCB */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xCC */ IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xCD */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xCE-0xD9 */ - IMPLEMENTED | SCSI_ONLY, /* 0xDA */ - 0, 0, 0, 0, 0, /* 0xDB-0xDF */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0-0xEF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xCE-0xD7 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xD8 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xD9 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xDA */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xDB */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xDC */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xDD */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xDE */ + 0, /* 0xDF */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xE0 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xE1 */ + 0, /* 0xE2 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xE3 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xE4 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xE5 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xE6 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xE7 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xE8 */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xE9 */ + 0, /* 0xEA */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xEB */ + 0, /* 0xEC */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xED */ + IMPLEMENTED | CHECK_READY | SCSI_ONLY, /* 0xEE */ + 0, /* 0xEF */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* 0xF0-0xFF */ }; static uint64_t scsi_cdrom_mode_sense_page_flags = (GPMODEP_R_W_ERROR_PAGE | GPMODEP_DISCONNECT_PAGE | GPMODEP_CDROM_PAGE | GPMODEP_CDROM_AUDIO_PAGE | (1ULL << 0x0fULL) | GPMODEP_CAPABILITIES_PAGE | GPMODEP_ALL_PAGES); +static uint64_t scsi_cdrom_mode_sense_page_flags_sony = (GPMODEP_R_W_ERROR_PAGE | GPMODEP_DISCONNECT_PAGE | GPMODEP_CDROM_PAGE_SONY | GPMODEP_CDROM_AUDIO_PAGE_SONY | (1ULL << 0x0fULL) | GPMODEP_CAPABILITIES_PAGE | GPMODEP_ALL_PAGES); +static uint64_t scsi_cdrom_drive_status_page_flags = ((1ULL << 0x01ULL) | (1ULL << 0x02ULL) | (1ULL << 0x0fULL) | GPMODEP_ALL_PAGES); + +static const mode_sense_pages_t scsi_cdrom_drive_status_pages = { + {{ 0, 0 }, + { 0x01, 0, 2, 0x0f, 0xbf }, /*Drive Status Data Format*/ + { 0x02, 0, 1, 0}, /*Audio Play Status Format*/ + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }} +}; static const mode_sense_pages_t scsi_cdrom_mode_sense_pages_default = { {{ 0, 0 }, @@ -174,7 +251,7 @@ static const mode_sense_pages_t scsi_cdrom_mode_sense_pages_default = { { 0, 0 }, { 0, 0 }, { GPMODE_CDROM_PAGE, 6, 0, 1, 0, 60, 0, 75 }, - { 0x8E, 0xE, 4, 0, 0, 0, 0, 75, 1, 255, 2, 255, 0, 0, 0, 0 }, + { GPMODE_CDROM_AUDIO_PAGE | 0x80, 0xE, 4, 0, 0, 0, 0, 75, 1, 255, 2, 255, 0, 0, 0, 0 }, { 0x0F, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0 }, { 0, 0 }, @@ -220,7 +297,53 @@ static const mode_sense_pages_t scsi_cdrom_mode_sense_pages_default_scsi = { { 0, 0 }, { 0, 0 }, { GPMODE_CDROM_PAGE, 6, 0, 1, 0, 60, 0, 75 }, - { 0x8E, 0xE, 5, 4, 0, 128, 0, 75, 1, 255, 2, 255, 0, 0, 0, 0 }, + { GPMODE_CDROM_AUDIO_PAGE | 0x80, 0xE, 5, 4, 0, 128, 0, 75, 1, 255, 2, 255, 0, 0, 0, 0 }, + { 0x0F, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { GPMODE_CAPABILITIES_PAGE, 0x12, 0, 0, 1, 0, 0, 0, 2, 0xC2, 1, 0, 0, 0, 2, 0xC2, 0, 0, 0, 0 }} +}; + +static const mode_sense_pages_t scsi_cdrom_mode_sense_pages_default_sony_scsi = { + {{ 0, 0 }, + { GPMODE_R_W_ERROR_PAGE, 6, 0, 5, 0, 0, 0, 0 }, + { GPMODE_DISCONNECT_PAGE, 0x0e, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { GPMODE_CDROM_PAGE_SONY, 2, 1, 0 }, + { GPMODE_CDROM_AUDIO_PAGE_SONY | 0x80, 0xE, 5, 0, 0, 0, 0, 0, 1, 255, 2, 255, 0, 0, 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { GPMODE_CDROM_PAGE, 6, 0, 1, 0, 60, 0, 75 }, + { GPMODE_CDROM_AUDIO_PAGE | 0x80, 0xE, 5, 4, 0, 128, 0, 75, 1, 255, 2, 255, 0, 0, 0, 0 }, { 0x0F, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0 }, { 0, 0 }, @@ -266,7 +389,53 @@ static const mode_sense_pages_t scsi_cdrom_mode_sense_pages_changeable = { { 0, 0 }, { 0, 0 }, { GPMODE_CDROM_PAGE, 6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, - { 0x8E, 0xE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, + { GPMODE_CDROM_AUDIO_PAGE | 0x80, 0xE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, + { 0x0F, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { GPMODE_CAPABILITIES_PAGE, 0x12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }} +}; + +static const mode_sense_pages_t scsi_cdrom_mode_sense_pages_changeable_sony = { + {{ 0, 0 }, + { GPMODE_R_W_ERROR_PAGE, 6, 0xFF, 0xFF, 0, 0, 0, 0 }, + { GPMODE_DISCONNECT_PAGE, 0x0E, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { GPMODE_CDROM_PAGE_SONY, 2, 0xFF, 0xFF }, + { GPMODE_CDROM_AUDIO_PAGE_SONY | 0x80, 0xE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { GPMODE_CDROM_PAGE, 6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, + { GPMODE_CDROM_AUDIO_PAGE | 0x80, 0xE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, { 0x0F, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0 }, { 0, 0 }, @@ -303,6 +472,7 @@ static gesn_event_header_t *gesn_event_header; static void scsi_cdrom_command_complete(scsi_cdrom_t *dev); static void scsi_cdrom_mode_sense_load(scsi_cdrom_t *dev); +static void scsi_cdrom_drive_status_load(scsi_cdrom_t *dev); static void scsi_cdrom_init(scsi_cdrom_t *dev); @@ -352,7 +522,7 @@ scsi_cdrom_init(scsi_cdrom_t *dev) dev->sense[0] = 0xf0; dev->sense[7] = 10; - if (dev->early) + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00")) /*NEC only*/ dev->status = READY_STAT | DSC_STAT; else dev->status = 0; @@ -361,6 +531,8 @@ scsi_cdrom_init(scsi_cdrom_t *dev) scsi_cdrom_sense_key = scsi_cdrom_asc = scsi_cdrom_ascq = dev->unit_attention = 0; dev->drv->cur_speed = dev->drv->speed; scsi_cdrom_mode_sense_load(dev); + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403")) + scsi_cdrom_drive_status_load(dev); } /* Returns: 0 for none, 1 for PIO, 2 for DMA. */ @@ -411,7 +583,11 @@ scsi_cdrom_get_channel(void *p, int channel) if (!dev) return channel + 1; - return dev->ms_pages_saved.pages[GPMODE_CDROM_AUDIO_PAGE][channel ? 10 : 8]; + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) + return dev->ms_pages_saved_sony.pages[dev->sony_vendor ? GPMODE_CDROM_AUDIO_PAGE_SONY : GPMODE_CDROM_AUDIO_PAGE][channel ? 10 : 8]; + else + return dev->ms_pages_saved.pages[GPMODE_CDROM_AUDIO_PAGE][channel ? 10 : 8]; } static uint32_t @@ -421,7 +597,11 @@ scsi_cdrom_get_volume(void *p, int channel) if (!dev) return 255; - return dev->ms_pages_saved.pages[GPMODE_CDROM_AUDIO_PAGE][channel ? 11 : 9]; + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) + return dev->ms_pages_saved_sony.pages[dev->sony_vendor ? GPMODE_CDROM_AUDIO_PAGE_SONY : GPMODE_CDROM_AUDIO_PAGE][channel ? 11 : 9]; + else + return dev->ms_pages_saved.pages[GPMODE_CDROM_AUDIO_PAGE][channel ? 11 : 9]; } static void @@ -430,22 +610,37 @@ scsi_cdrom_mode_sense_load(scsi_cdrom_t *dev) FILE *f; char file_name[512]; - memset(&dev->ms_pages_saved, 0, sizeof(mode_sense_pages_t)); - if (dev->drv->bus_type == CDROM_BUS_SCSI) - memcpy(&dev->ms_pages_saved, &scsi_cdrom_mode_sense_pages_default_scsi, sizeof(mode_sense_pages_t)); - else - memcpy(&dev->ms_pages_saved, &scsi_cdrom_mode_sense_pages_default, sizeof(mode_sense_pages_t)); + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + memset(&dev->ms_pages_saved_sony, 0, sizeof(mode_sense_pages_t)); + memcpy(&dev->ms_pages_saved_sony, &scsi_cdrom_mode_sense_pages_default_sony_scsi, sizeof(mode_sense_pages_t)); - memset(file_name, 0, 512); - if (dev->drv->bus_type == CDROM_BUS_SCSI) - sprintf(file_name, "scsi_cdrom_%02i_mode_sense_bin", dev->id); - else - sprintf(file_name, "cdrom_%02i_mode_sense_bin", dev->id); - f = plat_fopen(nvr_path(file_name), "rb"); - if (f) { - if (fread(dev->ms_pages_saved.pages[GPMODE_CDROM_AUDIO_PAGE], 1, 0x10, f) != 0x10) - fatal("scsi_cdrom_mode_sense_load(): Error reading data\n"); - fclose(f); + memset(file_name, 0, 512); + sprintf(file_name, "scsi_cdrom_%02i_mode_sense_sony_bin", dev->id); + f = plat_fopen(nvr_path(file_name), "rb"); + if (f) { + if (fread(dev->ms_pages_saved_sony.pages[GPMODE_CDROM_AUDIO_PAGE_SONY], 1, 0x10, f) != 0x10) + fatal("scsi_cdrom_mode_sense_load(): Error reading data\n"); + fclose(f); + } + } else { + memset(&dev->ms_pages_saved, 0, sizeof(mode_sense_pages_t)); + if (dev->drv->bus_type == CDROM_BUS_SCSI) + memcpy(&dev->ms_pages_saved, &scsi_cdrom_mode_sense_pages_default_scsi, sizeof(mode_sense_pages_t)); + else + memcpy(&dev->ms_pages_saved, &scsi_cdrom_mode_sense_pages_default, sizeof(mode_sense_pages_t)); + + memset(file_name, 0, 512); + if (dev->drv->bus_type == CDROM_BUS_SCSI) + sprintf(file_name, "scsi_cdrom_%02i_mode_sense_bin", dev->id); + else + sprintf(file_name, "cdrom_%02i_mode_sense_bin", dev->id); + f = plat_fopen(nvr_path(file_name), "rb"); + if (f) { + if (fread(dev->ms_pages_saved.pages[GPMODE_CDROM_AUDIO_PAGE], 1, 0x10, f) != 0x10) + fatal("scsi_cdrom_mode_sense_load(): Error reading data\n"); + fclose(f); + } } } @@ -456,35 +651,116 @@ scsi_cdrom_mode_sense_save(scsi_cdrom_t *dev) char file_name[512]; memset(file_name, 0, 512); - if (dev->drv->bus_type == CDROM_BUS_SCSI) - sprintf(file_name, "scsi_cdrom_%02i_mode_sense_bin", dev->id); - else - sprintf(file_name, "cdrom_%02i_mode_sense_bin", dev->id); - f = plat_fopen(nvr_path(file_name), "wb"); - if (f) { - fwrite(dev->ms_pages_saved.pages[GPMODE_CDROM_AUDIO_PAGE], 1, 0x10, f); - fclose(f); + + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + sprintf(file_name, "scsi_cdrom_%02i_mode_sense_sony_bin", dev->id); + f = plat_fopen(nvr_path(file_name), "wb"); + if (f) { + fwrite(dev->ms_pages_saved_sony.pages[GPMODE_CDROM_AUDIO_PAGE_SONY], 1, 0x10, f); + fclose(f); + } + } else { + if (dev->drv->bus_type == CDROM_BUS_SCSI) + sprintf(file_name, "scsi_cdrom_%02i_mode_sense_bin", dev->id); + else + sprintf(file_name, "cdrom_%02i_mode_sense_bin", dev->id); + f = plat_fopen(nvr_path(file_name), "wb"); + if (f) { + fwrite(dev->ms_pages_saved.pages[GPMODE_CDROM_AUDIO_PAGE], 1, 0x10, f); + fclose(f); + } } } +/*SCSI Drive Status (Pioneer only)*/ +static void +scsi_cdrom_drive_status_load(scsi_cdrom_t *dev) +{ + memset(&dev->ms_drive_status_pages_saved, 0, sizeof(mode_sense_pages_t)); + memcpy(&dev->ms_drive_status_pages_saved, &scsi_cdrom_drive_status_pages, sizeof(mode_sense_pages_t)); +} + +static uint8_t +scsi_cdrom_drive_status_read(scsi_cdrom_t *dev, uint8_t page_control, uint8_t page, uint8_t pos) +{ + return dev->ms_drive_status_pages_saved.pages[page][pos]; +} + +static uint32_t +scsi_cdrom_drive_status(scsi_cdrom_t *dev, uint8_t *buf, uint32_t pos, uint8_t page) +{ + uint8_t page_control = (page >> 6) & 3; + int i = 0, j = 0; + + uint16_t msplen; + + page &= 0x3f; + + for (i = 0; i < 0x40; i++) { + if (page == i) { + if (scsi_cdrom_drive_status_page_flags & (1LL << ((uint64_t) (page & 0x3f)))) { + buf[pos++] = scsi_cdrom_drive_status_read(dev, page_control, i, 0); + msplen = (scsi_cdrom_drive_status_read(dev, page_control, i, 1) << 8); + msplen |= scsi_cdrom_drive_status_read(dev, page_control, i, 2); + buf[pos++] = (msplen >> 8) & 0xff; + buf[pos++] = msplen & 0xff; + scsi_cdrom_log("CD-ROM %i: DRIVE STATUS: Page [%02X] length %i\n", dev->id, i, msplen); + for (j = 0; j < msplen; j++) { + if (i == 0x01) { + buf[pos++] = scsi_cdrom_drive_status_read(dev, page_control, i, 3 + j); + if (!(j & 1)) { /*MSB of Drive Status*/ + if (dev->drv->ops) /*Bit 11 of Drive Status, */ + buf[pos] &= ~0x08; /*Disc is present*/ + else + buf[pos] |= 0x08; /*Disc not present*/ + } + } else if ((i == 0x02) && (j == 0)) { + buf[pos++] = ((dev->drv->cd_status == CD_STATUS_PLAYING) ? 0x01 : 0x00); + } else + buf[pos++] = scsi_cdrom_drive_status_read(dev, page_control, i, 3 + j); + } + } + } + } + + return pos; +} + /*SCSI Mode Sense 6/10*/ static uint8_t scsi_cdrom_mode_sense_read(scsi_cdrom_t *dev, uint8_t page_control, uint8_t page, uint8_t pos) { - switch (page_control) { - case 0: - case 3: - return dev->ms_pages_saved.pages[page][pos]; - break; - case 1: - return scsi_cdrom_mode_sense_pages_changeable.pages[page][pos]; - break; - case 2: - if (dev->drv->bus_type == CDROM_BUS_SCSI) - return scsi_cdrom_mode_sense_pages_default_scsi.pages[page][pos]; - else - return scsi_cdrom_mode_sense_pages_default.pages[page][pos]; - break; + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + switch (page_control) { + case 0: + case 3: + return dev->ms_pages_saved_sony.pages[page][pos]; + break; + case 1: + return scsi_cdrom_mode_sense_pages_changeable_sony.pages[page][pos]; + break; + case 2: + return scsi_cdrom_mode_sense_pages_default_sony_scsi.pages[page][pos]; + break; + } + } else { + switch (page_control) { + case 0: + case 3: + return dev->ms_pages_saved.pages[page][pos]; + break; + case 1: + return scsi_cdrom_mode_sense_pages_changeable.pages[page][pos]; + break; + case 2: + if (dev->drv->bus_type == CDROM_BUS_SCSI) + return scsi_cdrom_mode_sense_pages_default_scsi.pages[page][pos]; + else + return scsi_cdrom_mode_sense_pages_default.pages[page][pos]; + break; + } } return 0; @@ -526,14 +802,25 @@ scsi_cdrom_mode_sense(scsi_cdrom_t *dev, uint8_t *buf, uint32_t pos, uint8_t pag else { if ((i == GPMODE_CAPABILITIES_PAGE) && (j == 4)) { buf[pos] = scsi_cdrom_mode_sense_read(dev, page_control, i, 2 + j) & 0x1f; - /* The early CD-ROM drives we emulate (NEC CDR-260 for ATAPI and Toshiba CDS-431) are + /* The early CD-ROM drives we emulate (NEC CDR-260 for ATAPI and early vendor SCSI CD-ROM models) are caddy drives, the later ones are tray drives. */ - buf[pos++] |= (dev->early ? 0x00 : 0x20); + if (dev->drv->bus_type == CDROM_BUS_SCSI) { + buf[pos++] |= ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "86BOX_CD-ROM_1.00")) ? 0x20 : 0x00); + } else { + buf[pos++] |= ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00")) ? 0x00 : 0x20); + } } else if ((i == GPMODE_CAPABILITIES_PAGE) && (j >= 6) && (j <= 7)) { if (j & 1) buf[pos++] = ((dev->drv->speed * 176) & 0xff); else buf[pos++] = ((dev->drv->speed * 176) >> 8); + } else if ((i == GPMODE_CAPABILITIES_PAGE) && (j >= 8) && (j <= 9) && + (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403"))) { + if (j & 1) + buf[pos++] = ((dev->drv->speed * 176) & 0xff); + else + buf[pos++] = ((dev->drv->speed * 176) >> 8); } else if ((i == GPMODE_CAPABILITIES_PAGE) && (j >= 12) && (j <= 13)) { if (j & 1) buf[pos++] = ((dev->drv->cur_speed * 176) & 0xff); @@ -571,11 +858,10 @@ scsi_cdrom_update_request_length(scsi_cdrom_t *dev, int len, int block_len) that a media access comand does not DRQ in the middle of a sector. One of the drivers that relies on the correctness of this behavior is MTMCDAI.SYS (the Mitsumi CD-ROM driver) for DOS which uses the READ CD command to read data on some CD types. */ - if ((dev->current_cdb[0] == 0xb9) || (dev->current_cdb[0] == 0xbe)) { - /* Round to sector length. */ - dlen = ((double) dev->max_transfer_len) / ((double) block_len); - dev->max_transfer_len = ((uint16_t) floor(dlen)) * block_len; - } + + /* Round to sector length. */ + dlen = ((double) dev->max_transfer_len) / ((double) block_len); + dev->max_transfer_len = ((uint16_t) floor(dlen)) * block_len; } else { /* Round it to the nearest 2048 bytes. */ dev->max_transfer_len = (dev->max_transfer_len >> 11) << 11; @@ -642,7 +928,7 @@ scsi_cdrom_bus_speed(scsi_cdrom_t *dev) static void scsi_cdrom_command_common(scsi_cdrom_t *dev) { - double bytes_per_second, period; + double bytes_per_second = 0.0, period; dev->status = BUSY_STAT; dev->phase = 1; @@ -684,14 +970,44 @@ scsi_cdrom_command_common(scsi_cdrom_t *dev) case 0xb8: case 0xb9: case 0xbe: - case 0xc6: - case 0xc7: if (dev->current_cdb[0] == 0x42) dev->callback += 40.0; /* Account for seek time. */ bytes_per_second = 176.0 * 1024.0; bytes_per_second *= (double) dev->drv->cur_speed; break; + case 0xc6: + case 0xc7: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_DRIVEXM_3433"))) { + bytes_per_second = 176.0 * 1024.0; + bytes_per_second *= (double) dev->drv->cur_speed; + } + break; + case 0xc1: + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403")) { + bytes_per_second = 176.0 * 1024.0; + bytes_per_second *= (double) dev->drv->cur_speed; + } + break; + case 0xc2: + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403")) { + dev->callback += 40.0; + bytes_per_second = 176.0 * 1024.0; + bytes_per_second *= (double) dev->drv->cur_speed; + } + break; + case 0xc3: + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + bytes_per_second = 176.0 * 1024.0; + bytes_per_second *= (double) dev->drv->cur_speed; + } + break; + default: bytes_per_second = scsi_cdrom_bus_speed(dev); if (bytes_per_second == 0.0) { @@ -846,9 +1162,9 @@ scsi_cdrom_unit_attention(scsi_cdrom_t *dev) static void scsi_cdrom_buf_alloc(scsi_cdrom_t *dev, uint32_t len) { - scsi_cdrom_log("CD-ROM %i: Allocated buffer length: %i\n", dev->id, len); if (!dev->buffer) dev->buffer = (uint8_t *) malloc(len); + scsi_cdrom_log("CD-ROM %i: Allocated buffer length: %i, buffer = %p\n", dev->id, len, dev->buffer); } static void @@ -955,7 +1271,7 @@ scsi_cdrom_data_phase_error(scsi_cdrom_t *dev) } static int -scsi_cdrom_read_data(scsi_cdrom_t *dev, int msf, int type, int flags, int32_t *len) +scsi_cdrom_read_data(scsi_cdrom_t *dev, int msf, int type, int flags, int32_t *len, int vendor_type) { int ret = 0, data_pos = 0; int i = 0, temp_len = 0; @@ -980,10 +1296,10 @@ scsi_cdrom_read_data(scsi_cdrom_t *dev, int msf, int type, int flags, int32_t *l data than that. */ #if 0 if ((dev->sector_pos + dev->sector_len - 1) >= cdsize) { - scsi_cdrom_log("CD-ROM %i: Trying to read to beyond the end of disc (%i >= %i)\n", dev->id, - (dev->sector_pos + dev->sector_len - 1), cdsize); - scsi_cdrom_lba_out_of_range(dev); - return -1; + scsi_cdrom_log("CD-ROM %i: Trying to read to beyond the end of disc (%i >= %i)\n", dev->id, + (dev->sector_pos + dev->sector_len - 1), cdsize); + scsi_cdrom_lba_out_of_range(dev); + return -1; } #endif @@ -992,7 +1308,7 @@ scsi_cdrom_read_data(scsi_cdrom_t *dev, int msf, int type, int flags, int32_t *l for (i = 0; i < dev->requested_blocks; i++) { ret = cdrom_readsector_raw(dev->drv, dev->buffer + data_pos, - dev->sector_pos + i, msf, type, flags, &temp_len); + dev->sector_pos + i, msf, type, flags, &temp_len, vendor_type); data_pos += temp_len; dev->old_len += temp_len; @@ -1009,7 +1325,7 @@ scsi_cdrom_read_data(scsi_cdrom_t *dev, int msf, int type, int flags, int32_t *l } static int -scsi_cdrom_read_blocks(scsi_cdrom_t *dev, int32_t *len, int first_batch) +scsi_cdrom_read_blocks(scsi_cdrom_t *dev, int32_t *len, int first_batch, int vendor_type) { int ret = 0, msf = 0; int type = 0, flags = 0; @@ -1032,7 +1348,7 @@ scsi_cdrom_read_blocks(scsi_cdrom_t *dev, int32_t *len, int first_batch) scsi_cdrom_log("Reading %i blocks starting from %i...\n", dev->requested_blocks, dev->sector_pos); - ret = scsi_cdrom_read_data(dev, msf, type, flags, len); + ret = scsi_cdrom_read_data(dev, msf, type, flags, len, vendor_type); scsi_cdrom_log("Read %i bytes of blocks...\n", *len); @@ -1201,12 +1517,6 @@ scsi_cdrom_pre_execution_check(scsi_cdrom_t *dev, uint8_t *cdb) return 0; } - if (!dev->early && (scsi_cdrom_command_flags[cdb[0]] & EARLY_ONLY)) { - scsi_cdrom_log("CD-ROM %i: Attempting to execute SCSI-only command %02X over ATAPI\n", dev->id, cdb[0]); - scsi_cdrom_illegal_opcode(dev); - return 0; - } - if ((dev->drv->bus_type < CDROM_BUS_SCSI) && (scsi_cdrom_command_flags[cdb[0]] & SCSI_ONLY)) { scsi_cdrom_log("CD-ROM %i: Attempting to execute SCSI-only command %02X over ATAPI\n", dev->id, cdb[0]); scsi_cdrom_illegal_opcode(dev); @@ -1281,7 +1591,7 @@ static void scsi_cdrom_rezero(scsi_cdrom_t *dev) { dev->sector_pos = dev->sector_len = 0; - cdrom_seek(dev->drv, 0); + cdrom_seek(dev->drv, 0, 0); } void @@ -1392,10 +1702,8 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) int toc_format, block_desc = 0; int ret, format = 0; int real_pos, track = 0; -#ifdef USE_86BOX_CD - char device_identify[9] = { '8', '6', 'B', '_', 'C', 'D', '0', '0', 0 }; - char device_identify_ex[15] = { '8', '6', 'B', '_', 'C', 'D', '0', '0', ' ', 'v', '1', '.', '0', '0', 0 }; -#endif + char device_identify[9] = { '8', '6', 'B', '_', 'C', 'D', '0', '0', 0 }; + char device_identify_ex[15] = { '8', '6', 'B', '_', 'C', 'D', '0', '0', ' ', 'v', '1', '.', '0', '0', 0 }; int32_t blen = 0, *BufLen; uint8_t *b; uint32_t profiles[2] = { MMC_PROFILE_CD_ROM, MMC_PROFILE_DVD_ROM }; @@ -1413,16 +1721,15 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->packet_len = 0; dev->request_pos = 0; -#ifdef USE_86BOX_CD device_identify[7] = dev->id + 0x30; device_identify_ex[7] = dev->id + 0x30; device_identify_ex[10] = EMU_VERSION_EX[0]; device_identify_ex[12] = EMU_VERSION_EX[2]; device_identify_ex[13] = EMU_VERSION_EX[3]; -#endif memcpy(dev->current_cdb, cdb, 12); + dev->sony_vendor = 0; if (cdb[0] != 0) { scsi_cdrom_log("CD-ROM %i: Command 0x%02X, Sense Key %02X, Asc %02X, Ascq %02X, Unit attention: %i\n", @@ -1443,6 +1750,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) if (scsi_cdrom_pre_execution_check(dev, cdb) == 0) return; +begin: switch (cdb[0]) { case GPCMD_TEST_UNIT_READY: scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); @@ -1453,7 +1761,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) scsi_cdrom_stop(sc); dev->sector_pos = dev->sector_len = 0; dev->drv->seek_diff = dev->drv->seek_pos; - cdrom_seek(dev->drv, 0); + cdrom_seek(dev->drv, 0, 0); scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); break; @@ -1477,8 +1785,16 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) scsi_cdrom_data_command_finish(dev, 18, 18, cdb[4], 0); break; + case 0xDA: /*GPCMD_SPEED_ALT*/ + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE74_1.00") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE464_1.05")) { /*GPCMD_STILL_NEC*/ + scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); + cdrom_audio_pause_resume(dev->drv, 0x00); + dev->drv->audio_op = 0x01; + scsi_cdrom_command_complete(dev); + break; + } case GPCMD_SET_SPEED: - case GPCMD_SET_SPEED_ALT: dev->drv->cur_speed = (cdb[3] | (cdb[2] << 8)) / 176; if (dev->drv->cur_speed < 1) dev->drv->cur_speed = 1; @@ -1488,6 +1804,24 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) scsi_cdrom_command_complete(dev); break; + case 0xCD: + case GPCMD_AUDIO_SCAN: + scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); + + if ((dev->drv->host_drive < 1) || (dev->drv->cd_status <= CD_STATUS_DATA_ONLY)) { + scsi_cdrom_illegal_mode(dev); + break; + } + + pos = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5]; + ret = cdrom_audio_scan(dev->drv, pos, 0); + + if (ret) + scsi_cdrom_command_complete(dev); + else + scsi_cdrom_illegal_mode(dev); + break; + case GPCMD_MECHANISM_STATUS: scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); len = (cdb[7] << 16) | (cdb[8] << 8) | cdb[9]; @@ -1538,34 +1872,47 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) scsi_cdrom_set_buf_len(dev, BufLen, &len); scsi_cdrom_data_command_finish(dev, len, len, len, 0); - /* scsi_cdrom_log("CD-ROM %i: READ_TOC_PMA_ATIP format %02X, length %i (%i)\n", dev->id, - toc_format, ide->cylinder, dev->buffer[1]); */ return; - case GPCMD_READ_DISC_INFORMATION_TOSHIBA: + case 0xC7: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_PLAY_AUDIO_MSF_MATSUSHITA*/ + cdb[0] = GPCMD_PLAY_AUDIO_MSF; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { /*GPCMD_PLAY_MSF_SONY*/ + cdb[0] = GPCMD_PLAY_AUDIO_MSF; + dev->current_cdb[0] = cdb[0]; + dev->sony_vendor = 1; + goto begin; + break; + } /*GPCMD_READ_DISC_INFORMATION_TOSHIBA*/ + case 0xDE: /*GPCMD_READ_DISC_INFORMATION_NEC*/ scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); + scsi_cdrom_buf_alloc(dev, 4); - scsi_cdrom_buf_alloc(dev, 65536); - - if ((!dev->drv->ops) && ((cdb[1] & 3) == 2)) { + if (!dev->drv->ops) { scsi_cdrom_not_ready(dev); return; } - memset(dev->buffer, 0, 4); - - cdrom_read_disc_info_toc(dev->drv, dev->buffer, cdb[2], cdb[1] & 3); - + ret = cdrom_read_disc_info_toc(dev->drv, dev->buffer, cdb[2], cdb[1] & 3); len = 4; - scsi_cdrom_set_buf_len(dev, BufLen, &len); + if (!ret) { + scsi_cdrom_invalid_field(dev); + scsi_cdrom_buf_free(dev); + return; + } + scsi_cdrom_set_buf_len(dev, BufLen, &len); scsi_cdrom_data_command_finish(dev, len, len, len, 0); return; case GPCMD_READ_CD_OLD: /* IMPORTANT: Convert the command to new read CD for pass through purposes. */ - dev->current_cdb[0] = 0xbe; + dev->current_cdb[0] = GPCMD_READ_CD; /*FALLTHROUGH*/ case GPCMD_READ_6: @@ -1665,7 +2012,18 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->drv->seek_diff = ABS((int) (pos - dev->sector_pos)); - ret = scsi_cdrom_read_blocks(dev, &alloc_length, 1); + if ((cdb[0] == GPCMD_READ_10) || (cdb[0] == GPCMD_READ_12)) { + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE74_1.00") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE464_1.05") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_DRIVEXM_3433") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-3301TA_0272") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-5701TA_3136")) + ret = scsi_cdrom_read_blocks(dev, &alloc_length, 1, cdb[9] & 0xc0); + else + ret = scsi_cdrom_read_blocks(dev, &alloc_length, 1, 0); + } else + ret = scsi_cdrom_read_blocks(dev, &alloc_length, 1, 0); + if (ret <= 0) { scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); dev->packet_status = PHASE_COMPLETE; @@ -1733,10 +2091,19 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) scsi_cdrom_buf_alloc(dev, 65536); } - if (!(scsi_cdrom_mode_sense_page_flags & (1LL << (uint64_t) (cdb[2] & 0x3f)))) { - scsi_cdrom_invalid_field(dev); - scsi_cdrom_buf_free(dev); - return; + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + if (!(scsi_cdrom_mode_sense_page_flags_sony & (1LL << (uint64_t) (cdb[2] & 0x3f)))) { + scsi_cdrom_invalid_field(dev); + scsi_cdrom_buf_free(dev); + return; + } + } else { + if (!(scsi_cdrom_mode_sense_page_flags & (1LL << (uint64_t) (cdb[2] & 0x3f)))) { + scsi_cdrom_invalid_field(dev); + scsi_cdrom_buf_free(dev); + return; + } } memset(dev->buffer, 0, len); @@ -2031,9 +2398,16 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) scsi_cdrom_data_command_finish(dev, len, len, max_len, 0); break; - /* GPCMD_CHINON_EJECT on Chinon */ - case GPCMD_AUDIO_TRACK_SEARCH: - if (dev->early) { + case 0xC0: /*GPCMD_UNKNOWN_SONY*/ + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); + scsi_cdrom_command_complete(dev); + dev->sony_vendor = 1; + break; + } /*GPCMD_AUDIO_TRACK_SEARCH_TOSHIBA and GPCMD_EJECT_CHINON*/ + case 0xD8: /*GPCMD_AUDIO_TRACK_SEARCH_NEC*/ + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "CHINON_CD-ROM_CDS-431_H42"))) { scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); scsi_cdrom_stop(sc); cdrom_eject(dev->id); @@ -2055,14 +2429,51 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) } break; - case GPCMD_TOSHIBA_PLAY_AUDIO: + case 0xC1: /*GPCMD_READ_TOC_SONY*/ + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403")) { + scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); + + if (strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403")) { + dev->sony_vendor = 0; + } else { + msf = dev->ms_pages_saved_sony.pages[GPMODE_CDROM_PAGE_SONY][2] & 0x01; + dev->sony_vendor = 1; + } + + max_len = cdb[7]; + max_len <<= 8; + max_len |= cdb[8]; + + scsi_cdrom_buf_alloc(dev, 65536); + + if (!dev->drv->ops) { + scsi_cdrom_not_ready(dev); + return; + } + + len = cdrom_read_toc_sony(dev->drv, dev->buffer, cdb[5], msf, max_len); + if (len == -1) { + /* If the returned length is -1, this means cdrom_read_toc_sony() has encountered an error. */ + scsi_cdrom_invalid_field(dev); + scsi_cdrom_buf_free(dev); + return; + } + + scsi_cdrom_set_buf_len(dev, BufLen, &len); + + scsi_cdrom_data_command_finish(dev, len, len, len, 0); + return; + } /*GPCMD_PLAY_AUDIO_TOSHIBA*/ + case 0xD9: /*GPCMD_PLAY_AUDIO_NEC*/ scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); if ((dev->drv->host_drive < 1) || (dev->drv->cd_status <= CD_STATUS_DATA_ONLY)) { scsi_cdrom_illegal_mode(dev); break; } pos = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5]; - ret = cdrom_toshiba_audio_play(dev->drv, pos, cdb[9] & 0xc0); + ret = cdrom_audio_play_toshiba(dev->drv, pos, cdb[9] & 0xc0); if (ret) scsi_cdrom_command_complete(dev); @@ -2134,6 +2545,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) case GPCMD_READ_SUBCHANNEL: scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); + dev->sony_vendor = 0; max_len = cdb[7]; max_len <<= 8; @@ -2191,13 +2603,13 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->buffer[1] = 0x11; break; case CD_STATUS_PAUSED: - dev->buffer[1] = ((dev->drv->bus_type == CDROM_BUS_SCSI) && dev->early) ? 0x15 : 0x12; + dev->buffer[1] = ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "CHINON_CD-ROM_CDS-431_H42"))) ? 0x15 : 0x12; break; case CD_STATUS_DATA_ONLY: - dev->buffer[1] = ((dev->drv->bus_type == CDROM_BUS_SCSI) && dev->early) ? 0x00 : 0x15; + dev->buffer[1] = ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "CHINON_CD-ROM_CDS-431_H42"))) ? 0x00 : 0x15; break; default: - dev->buffer[1] = ((dev->drv->bus_type == CDROM_BUS_SCSI) && dev->early) ? 0x00 : 0x13; + dev->buffer[1] = ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "CHINON_CD-ROM_CDS-431_H42"))) ? 0x00 : 0x13; break; } @@ -2210,9 +2622,35 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) scsi_cdrom_data_command_finish(dev, len, len, len, 0); break; - /* GPCMD_CHINON_STOP on Chinon */ - case GPCMD_READ_SUBCODEQ_PLAYING_STATUS: - if (dev->early) { + case 0xC6: + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); + dev->sony_vendor = 1; + + msf = 3; + if ((cdb[5] != 1) || (cdb[8] != 1)) { + scsi_cdrom_illegal_mode(dev); + break; + } + pos = cdb[4]; + + if ((dev->drv->host_drive < 1) || (dev->drv->cd_status <= CD_STATUS_DATA_ONLY)) { + scsi_cdrom_illegal_mode(dev); + break; + } + + /* In this case, len is unused so just pass a fixed value of 1 intead. */ + ret = cdrom_audio_play(dev->drv, pos, 1 /*len*/, msf); + + if (ret) + scsi_cdrom_command_complete(dev); + else + scsi_cdrom_illegal_mode(dev); + break; + } /*GPCMD_READ_SUBCODEQ_PLAYING_STATUS_TOSHIBA and GPCMD_STOP_CHINON*/ + case 0xDD: /*GPCMD_READ_SUBCODEQ_PLAYING_STATUS_NEC*/ + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "CHINON_CD-ROM_CDS-431_H42"))) { scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); scsi_cdrom_stop(sc); scsi_cdrom_command_complete(dev); @@ -2220,8 +2658,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); alloc_length = cdb[1] & 0x1f; - - scsi_cdrom_buf_alloc(dev, alloc_length); + len = 10; if (!dev->drv->ops) { scsi_cdrom_not_ready(dev); @@ -2230,14 +2667,15 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) if (!alloc_length) { scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); - scsi_cdrom_log("CD-ROM %i: All done - callback set\n", dev->id); + scsi_cdrom_log("CD-ROM %i: Subcode Q All done - callback set\n", dev->id); dev->packet_status = PHASE_COMPLETE; dev->callback = 20.0 * CDROM_TIME; scsi_cdrom_set_callback(dev); break; } - len = alloc_length; + scsi_cdrom_buf_alloc(dev, len); + len = MIN(len, alloc_length); memset(dev->buffer, 0, len); dev->buffer[0] = cdrom_get_current_subcodeq_playstatus(dev->drv, &dev->buffer[1]); @@ -2284,7 +2722,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) } break; - case GPCMD_CHINON_UNKNOWN: + case 0x26: /*GPCMD_UNKNOWN_CHINON*/ scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); scsi_cdrom_stop(sc); scsi_cdrom_command_complete(dev); @@ -2313,7 +2751,43 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) scsi_cdrom_command_complete(dev); break; - case GPCMD_CADDY_EJECT: + case 0xC4: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_READ_HEADER_MATSUSHITA*/ + cdb[0] = GPCMD_READ_HEADER; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { /*GPCMD_PLAYBACK_STATUS_SONY*/ + scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); + dev->sony_vendor = 1; + + max_len = cdb[7]; + max_len <<= 8; + max_len |= cdb[8]; + msf = dev->ms_pages_saved_sony.pages[GPMODE_CDROM_PAGE_SONY][2] & 0x01; + + scsi_cdrom_buf_alloc(dev, 18); + + len = max_len; + + memset(dev->buffer, 0, 10); + dev->buffer[0] = 0x00; /*Reserved*/ + dev->buffer[1] = 0x00; /*Reserved*/ + dev->buffer[2] = cdb[7]; /*Audio Status data length*/ + dev->buffer[3] = cdb[8]; /*Audio Status data length*/ + dev->buffer[4] = cdrom_get_audio_status_sony(dev->drv, &dev->buffer[6], msf); /*Audio status*/ + dev->buffer[5] = 0x00; + + scsi_cdrom_log("Audio Status = %02x\n", dev->buffer[4]); + + len = MIN(len, max_len); + scsi_cdrom_set_buf_len(dev, BufLen, &len); + + scsi_cdrom_data_command_finish(dev, len, len, len, 0); + break; + } /*GPCMD_CADDY_EJECT_TOSHIBA and GPCMD_CADDY_EJECT_NEC*/ + case 0xDC: scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); scsi_cdrom_stop(sc); cdrom_eject(dev->id); @@ -2333,7 +2807,7 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) preamble_len = 4; size_idx = 3; - dev->buffer[idx++] = 05; + dev->buffer[idx++] = 5; dev->buffer[idx++] = cdb[2]; dev->buffer[idx++] = 0; @@ -2364,41 +2838,20 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->buffer[idx++] = 0x01; dev->buffer[idx++] = 0x00; dev->buffer[idx++] = 68; -#ifdef USE_86BOX_CD - ide_padstr8(dev->buffer + idx, 8, EMU_NAME); /* Vendor */ -#else - if (dev->drv->bus_type == CDROM_BUS_SCSI) { - if (dev->early) - ide_padstr8(dev->buffer + idx, 8, "CHINON"); /* Vendor */ - else - ide_padstr8(dev->buffer + idx, 8, "TOSHIBA"); /* Vendor */ - } else { - if (dev->early) - ide_padstr8(dev->buffer + idx, 8, "NEC"); /* Vendor */ - else if (machine_is_sony()) - ide_padstr8(dev->buffer + idx, 8, "SONY"); /* Vendor */ - else - ide_padstr8(dev->buffer + idx, 8, "HITACHI"); /* Vendor */ - } -#endif + + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "86BOX_CD-ROM_1.00"))) + ide_padstr8(dev->buffer + idx, 8, EMU_NAME); /* Vendor */ + else + ide_padstr8(dev->buffer + idx, 8, cdrom_drive_types[dev->drv->type].vendor); /* Vendor */ + idx += 8; -#ifdef USE_86BOX_CD - ide_padstr8(dev->buffer + idx, 40, device_identify_ex); /* Product */ -#else - if (dev->drv->bus_type == CDROM_BUS_SCSI) { - if (dev->early) - ide_padstr8(dev->buffer + idx, 40, "CD-ROM CDS-431"); /* Product */ - else - ide_padstr8(dev->buffer + idx, 40, "CD-ROM DRIVE:XM"); /* Product */ - } else { - if (dev->early) - ide_padstr8(dev->buffer + idx, 40, "CD-ROM DRIVE:260"); /* Product */ - else if (machine_is_sony()) - ide_padstr8(dev->buffer + idx, 40, "CD-ROM CDU76"); /* Product */ - else - ide_padstr8(dev->buffer + idx, 40, "CDR-8130"); /* Product */ - } -#endif + + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "86BOX_CD-ROM_1.00"))) + ide_padstr8(dev->buffer + idx, 40, device_identify_ex); /* Product */ + else + ide_padstr8(dev->buffer + idx, 40, cdrom_drive_types[dev->drv->type].model); /* Product */ + + idx += 40; ide_padstr8(dev->buffer + idx, 20, "53R141"); /* Serial */ idx += 20; @@ -2419,8 +2872,37 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->buffer[1] = 0x80; /*Removable*/ if (dev->drv->bus_type == CDROM_BUS_SCSI) { - dev->buffer[2] = 0x02; dev->buffer[3] = 0x02; + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "86BOX_CD-ROM_1.00"))) { + dev->buffer[2] = 0x05; + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_DRIVEXM_3433"))) { + dev->buffer[2] = 0x02; + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-3301TA_0272"))) { + dev->buffer[2] = 0x02; + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-5701TA_3136"))) { + dev->buffer[2] = 0x02; + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "CHINON_CD-ROM_CDS-431_H42"))) { + dev->buffer[3] = 0x01; + dev->buffer[2] = 0x02; + } else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i")) { + dev->buffer[3] = 0x01; + dev->buffer[2] = 0x02; + } else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + dev->buffer[3] = 0x01; + dev->buffer[2] = 0x02; + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { + dev->buffer[3] = 0x01; + dev->buffer[2] = 0x02; + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE74_1.00"))) { + dev->buffer[3] = 0x01; + dev->buffer[2] = 0x02; + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "DEC_RRD45_0436"))) { + dev->buffer[2] = 0x02; + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE464_1.05"))) { + dev->buffer[2] = 0x02; + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403"))) { + dev->buffer[2] = 0x02; + } } else { dev->buffer[2] = 0x00; dev->buffer[3] = 0x21; @@ -2428,47 +2910,57 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) dev->buffer[4] = 31; if (dev->drv->bus_type == CDROM_BUS_SCSI) { - dev->buffer[6] = 1; /* 16-bit transfers supported */ - dev->buffer[7] = 0x20; /* Wide bus supported */ + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "86BOX_CD-ROM_1.00"))) { + dev->buffer[6] = 0x01; /* 16-bit transfers supported */ + dev->buffer[7] = 0x20; /* Wide bus supported */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PLEXTOR_CD-ROM_PX-32TS_1.03"))) { + dev->buffer[6] = 0x01; /* 16-bit transfers supported */ + dev->buffer[7] = 0x20; /* Wide bus supported */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TEAC_CD-R55S_1.0R"))) { + dev->buffer[6] = 0x01; /* 16-bit transfers supported */ + dev->buffer[7] = 0x20; /* Wide bus supported */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "DEC_RRD45_0436"))) { + dev->buffer[7] = 0x98; /* Linked Command and Relative Addressing supported */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_DRIVEXM_3433"))) { + dev->buffer[4] = 91; /* Always 91 on Toshiba SCSI-2 CD-ROM drives from 1990*/ + dev->buffer[7] = 0x88; /* Linked Command and Relative Addressing supported */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-3301TA_0272"))) { + dev->buffer[4] = 91; /* Always 91 on Toshiba SCSI-2 CD-ROM drives from 1990*/ + dev->buffer[7] = 0x88; /* Linked Command and Relative Addressing supported */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-5701TA_3136"))) { + dev->buffer[4] = 91; /* Always 91 on Toshiba SCSI-2 CD-ROM drives from 1990*/ + dev->buffer[7] = 0x88; /* Linked Command and Relative Addressing supported */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403"))) { + dev->buffer[4] = 42; + } } -#ifdef USE_86BOX_CD - ide_padstr8(dev->buffer + 8, 8, EMU_NAME); /* Vendor */ - ide_padstr8(dev->buffer + 16, 16, device_identify); /* Product */ - ide_padstr8(dev->buffer + 32, 4, EMU_VERSION_EX); /* Revision */ -#else - if (dev->drv->bus_type == CDROM_BUS_SCSI) { - if (dev->early) { - ide_padstr8(dev->buffer + 8, 8, "CHINON"); /* Vendor */ - ide_padstr8(dev->buffer + 16, 16, "CD-ROM CDS-431"); /* Product */ - ide_padstr8(dev->buffer + 32, 4, "H42"); /* Revision */ - } else { - ide_padstr8(dev->buffer + 8, 8, "TOSHIBA"); /* Vendor */ - ide_padstr8(dev->buffer + 16, 16, "CD-ROM DRIVE:XM"); /* Product */ - ide_padstr8(dev->buffer + 32, 4, "3433"); /* Revision */ - } + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "86BOX_CD-ROM_1.00"))) { + ide_padstr8(dev->buffer + 8, 8, EMU_NAME); /* Vendor */ + ide_padstr8(dev->buffer + 16, 16, device_identify); /* Product */ + ide_padstr8(dev->buffer + 32, 4, EMU_VERSION_EX); /* Revision */ } else { - if (dev->early) { - ide_padstr8(dev->buffer + 8, 8, "NEC"); /* Vendor */ - ide_padstr8(dev->buffer + 16, 16, "CD-ROM DRIVE:260"); /* Product */ - ide_padstr8(dev->buffer + 32, 4, "1.01"); /* Revision */ - } else if (machine_is_sony()) { - ide_padstr8(dev->buffer + 8, 8, "SONY"); /* Vendor */ - ide_padstr8(dev->buffer + 16, 16, "CD-ROM CDU76"); /* Product */ - ide_padstr8(dev->buffer + 32, 4, "1.0i"); /* Revision */ - } else { - ide_padstr8(dev->buffer + 8, 8, "HITACHI"); /* Vendor */ - ide_padstr8(dev->buffer + 16, 16, "CDR-8130"); /* Product */ - ide_padstr8(dev->buffer + 32, 4, "0020"); /* Revision */ + ide_padstr8(dev->buffer + 8, 8, cdrom_drive_types[dev->drv->type].vendor); /* Vendor */ + ide_padstr8(dev->buffer + 16, 16, cdrom_drive_types[dev->drv->type].model); /* Product */ + ide_padstr8(dev->buffer + 32, 4, cdrom_drive_types[dev->drv->type].revision); /* Revision */ + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403"))) { + dev->buffer[36] = 0x20; + ide_padstr8(dev->buffer + 37, 10, "1993/01/01"); /* Date */ } } -#endif idx = 36; - - if (max_len == 96) { - dev->buffer[4] = 91; - idx = 96; + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_DRIVEXM_3433") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-3301TA_0272") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-5701TA_3136")) /*Toshiba only*/ + idx = 96; + else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403")) /*Pioneer only*/ + idx = 47; + else { + if (max_len == 96) { + dev->buffer[4] = 91; + idx = 96; + } } } @@ -2477,19 +2969,23 @@ atapi_out: len = idx; len = MIN(len, max_len); + scsi_cdrom_set_buf_len(dev, BufLen, &len); + scsi_cdrom_log("Inquiry = %d, max = %d, BufLen = %d.\n", len, max_len, *BufLen); scsi_cdrom_data_command_finish(dev, len, len, max_len, 0); break; + case 0x0D: /*GPCMD_NO_OPERATION_TOSHIBA and GPCMD_NO_OPERATION_NEC*/ + scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); + scsi_cdrom_command_complete(dev); + break; + case GPCMD_PREVENT_REMOVAL: scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); scsi_cdrom_command_complete(dev); break; -#if 0 - case GPCMD_PAUSE_RESUME_ALT: -#endif case GPCMD_PAUSE_RESUME: scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); cdrom_audio_pause_resume(dev->drv, cdb[8] & 0x01); @@ -2497,7 +2993,81 @@ atapi_out: scsi_cdrom_command_complete(dev); break; - case GPCMD_STILL: + case 0xC3: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_READ_TOC_MATSUSHITA*/ + cdb[0] = GPCMD_READ_TOC_PMA_ATIP; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { /*GPCMD_READ_HEADER_SONY*/ + scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); + dev->sony_vendor = 1; + + alloc_length = ((cdb[7] << 8) | cdb[8]); + scsi_cdrom_buf_alloc(dev, 4); + + dev->sector_len = 1; + dev->sector_pos = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5]; + real_pos = cdrom_lba_to_msf_accurate(dev->sector_pos); + dev->buffer[0] = ((real_pos >> 16) & 0xff); + dev->buffer[1] = ((real_pos >> 8) & 0xff); + dev->buffer[2] = real_pos & 0xff; + dev->buffer[3] = 1; /*2048 bytes user data*/ + + len = 4; + len = MIN(len, alloc_length); + + scsi_cdrom_set_buf_len(dev, BufLen, &len); + + scsi_cdrom_data_command_finish(dev, len, len, len, 0); + return; + } /*GPCMD_SET_STOP_TIME_TOSHIBA and GPCMD_SET_STOP_TIME_NEC*/ + case 0xDB: + scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); + scsi_cdrom_command_complete(dev); + break; + + case 0xC2: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_READ_SUBCHANNEL_MATSUSHITA*/ + cdb[0] = GPCMD_READ_SUBCHANNEL; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403")) { /*GPCMD_READ_SUBCHANNEL_SONY*/ + scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); + + dev->sony_vendor = !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403") ? 0 : 1; + + max_len = cdb[7]; + max_len <<= 8; + max_len |= cdb[8]; + if (strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403")) + msf = dev->ms_pages_saved_sony.pages[GPMODE_CDROM_PAGE_SONY][2] & 0x01; + + scsi_cdrom_buf_alloc(dev, 32); + + scsi_cdrom_log("CD-ROM %i: Getting sub-channel type (%s)\n", dev->id, msf ? "MSF" : "LBA"); + + if (!(cdb[2] & 0x40)) + alloc_length = 4; + else + alloc_length = 24; + + len = alloc_length; + + memset(dev->buffer, 0, 24); + cdrom_get_current_subchannel_sony(dev->drv, dev->buffer, msf); + + len = MIN(len, max_len); + scsi_cdrom_set_buf_len(dev, BufLen, &len); + + scsi_cdrom_data_command_finish(dev, len, len, len, 0); + break; + } + /*GPCMD_STILL_TOSHIBA*/ scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); cdrom_audio_pause_resume(dev->drv, 0x00); dev->drv->audio_op = 0x01; @@ -2517,7 +3087,18 @@ atapi_out: break; } dev->drv->seek_diff = ABS((int) (pos - dev->drv->seek_pos)); - cdrom_seek(dev->drv, pos); + if (cdb[0] == GPCMD_SEEK_10) { + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE74_1.00") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE464_1.05") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_DRIVEXM_3433") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-3301TA_0272") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-5701TA_3136")) + cdrom_seek(dev->drv, pos, cdb[9] & 0xc0); + else + cdrom_seek(dev->drv, pos, 0); + } else + cdrom_seek(dev->drv, pos, 0); + scsi_cdrom_command_complete(dev); break; @@ -2552,6 +3133,143 @@ atapi_out: scsi_cdrom_command_complete(dev); break; + case 0xC5: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_PLAY_AUDIO_MATSUSHITA*/ + cdb[0] = GPCMD_PLAY_AUDIO_10; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { /*GPCMD_PAUSE_SONY*/ + scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); + dev->sony_vendor = 1; + cdrom_audio_pause_resume(dev->drv, !(cdb[1] & 0x10)); + scsi_cdrom_command_complete(dev); + break; + } + case 0xC8: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_PLAY_AUDIO_TRACK_INDEX_MATSUSHITA*/ + cdb[0] = GPCMD_PLAY_AUDIO_TRACK_INDEX; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { /*GPCMD_PLAY_AUDIO_SONY*/ + cdb[0] = GPCMD_PLAY_AUDIO_10; + dev->current_cdb[0] = cdb[0]; + dev->sony_vendor = 1; + goto begin; + break; + } + case 0xC9: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_PLAY_AUDIO_TRACK_RELATIVE_10_MATSUSHITA*/ + cdb[0] = GPCMD_PLAY_AUDIO_TRACK_RELATIVE_10; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } else if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { /*GPCMD_PLAYBACK_CONTROL_SONY*/ + scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_OUT); + dev->sony_vendor = 1; + + len = (cdb[7] << 8) | cdb[8]; + scsi_cdrom_buf_alloc(dev, 65536); + + scsi_cdrom_set_buf_len(dev, BufLen, &len); + scsi_cdrom_data_command_finish(dev, len, len, len, 1); + break; + } + case 0xCA: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403"))) { /*GPCMD_PAUSE_PIONEER*/ + scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); + cdrom_audio_pause_resume(dev->drv, !(cdb[1] & 0x10)); + scsi_cdrom_command_complete(dev); + break; + } + case 0xCB: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_PAUSE_RESUME_MATSUSHITA*/ + cdb[0] = GPCMD_PAUSE_RESUME; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } + case 0xCC: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403"))) { + scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); + + max_len = cdb[7]; + max_len <<= 8; + max_len |= cdb[8]; + + scsi_cdrom_buf_alloc(dev, 18); + + len = max_len; + + memset(dev->buffer, 0, 10); + dev->buffer[0] = 0x00; /*Reserved*/ + dev->buffer[1] = 0x00; /*Reserved*/ + dev->buffer[2] = cdb[7]; /*Audio Status data length*/ + dev->buffer[3] = cdb[8]; /*Audio Status data length*/ + dev->buffer[4] = cdrom_get_audio_status_sony(dev->drv, &dev->buffer[6], msf); /*Audio status*/ + dev->buffer[5] = 0x00; + + scsi_cdrom_log("Audio Status = %02x\n", dev->buffer[4]); + + len = MIN(len, max_len); + scsi_cdrom_set_buf_len(dev, BufLen, &len); + + scsi_cdrom_data_command_finish(dev, len, len, len, 0); + break; + } + case 0xE0: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PIONEER_CD-ROM_DRM-604X_2403"))) { /*GPCMD_DRIVE_STATUS_PIONEER*/ + scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN); + + len = (cdb[9] | (cdb[8] << 8)); + scsi_cdrom_buf_alloc(dev, 65536); + + if (!(scsi_cdrom_drive_status_page_flags & (1LL << (uint64_t) (cdb[2] & 0x3f)))) { + scsi_cdrom_invalid_field(dev); + scsi_cdrom_buf_free(dev); + return; + } + + if (!len) { + scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS); + scsi_cdrom_log("CD-ROM %i: Drive Status All done - callback set\n", dev->id); + dev->packet_status = PHASE_COMPLETE; + dev->callback = 20.0 * CDROM_TIME; + scsi_cdrom_set_callback(dev); + break; + } + + memset(dev->buffer, 0, len); + alloc_length = len; + + len = scsi_cdrom_drive_status(dev, dev->buffer, 0, cdb[2]); + len = MIN(len, alloc_length); + + scsi_cdrom_set_buf_len(dev, BufLen, &len); + + scsi_cdrom_log("CD-ROM %i: Reading drive status page: %02X...\n", dev->id, cdb[2]); + + scsi_cdrom_data_command_finish(dev, len, len, alloc_length, 0); + return; + } + case 0xE5: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_PLAY_AUDIO_12_MATSUSHITA*/ + cdb[0] = GPCMD_PLAY_AUDIO_12; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } + case 0xE9: + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-501_1.0b"))) { /*GPCMD_PLAY_AUDIO_TRACK_RELATIVE_12_MATSUSHITA*/ + cdb[0] = GPCMD_PLAY_AUDIO_TRACK_RELATIVE_12; + dev->current_cdb[0] = cdb[0]; + goto begin; + break; + } default: scsi_cdrom_illegal_opcode(dev); break; @@ -2623,20 +3341,42 @@ scsi_cdrom_phase_data_out(scsi_common_t *sc) pos += 2; - if (!(scsi_cdrom_mode_sense_page_flags & (1LL << ((uint64_t) page)))) { - scsi_cdrom_log("CD-ROM %i: Unimplemented page %02X\n", dev->id, page); - error |= 1; + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + if (!(scsi_cdrom_mode_sense_page_flags_sony & (1LL << ((uint64_t) page)))) { + scsi_cdrom_log("CD-ROM %i: Unimplemented page %02X\n", dev->id, page); + error |= 1; + } else { + for (i = 0; i < page_len; i++) { + ch = scsi_cdrom_mode_sense_pages_changeable_sony.pages[page][i + 2]; + val = dev->buffer[pos + i]; + old_val = dev->ms_pages_saved_sony.pages[page][i + 2]; + if (val != old_val) { + if (ch) + dev->ms_pages_saved_sony.pages[page][i + 2] = val; + else { + scsi_cdrom_log("CD-ROM %i: Unchangeable value on position %02X on page %02X\n", dev->id, i + 2, page); + error |= 1; + } + } + } + } } else { - for (i = 0; i < page_len; i++) { - ch = scsi_cdrom_mode_sense_pages_changeable.pages[page][i + 2]; - val = dev->buffer[pos + i]; - old_val = dev->ms_pages_saved.pages[page][i + 2]; - if (val != old_val) { - if (ch) - dev->ms_pages_saved.pages[page][i + 2] = val; - else { - scsi_cdrom_log("CD-ROM %i: Unchangeable value on position %02X on page %02X\n", dev->id, i + 2, page); - error |= 1; + if (!(scsi_cdrom_mode_sense_page_flags & (1LL << ((uint64_t) page)))) { + scsi_cdrom_log("CD-ROM %i: Unimplemented page %02X\n", dev->id, page); + error |= 1; + } else { + for (i = 0; i < page_len; i++) { + ch = scsi_cdrom_mode_sense_pages_changeable.pages[page][i + 2]; + val = dev->buffer[pos + i]; + old_val = dev->ms_pages_saved.pages[page][i + 2]; + if (val != old_val) { + if (ch) + dev->ms_pages_saved.pages[page][i + 2] = val; + else { + scsi_cdrom_log("CD-ROM %i: Unchangeable value on position %02X on page %02X\n", dev->id, i + 2, page); + error |= 1; + } } } } @@ -2644,7 +3384,10 @@ scsi_cdrom_phase_data_out(scsi_common_t *sc) pos += page_len; - if (dev->drv->bus_type == CDROM_BUS_SCSI) + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) + val = scsi_cdrom_mode_sense_pages_default_sony_scsi.pages[page][0] & 0x80; + else if (dev->drv->bus_type == CDROM_BUS_SCSI) val = scsi_cdrom_mode_sense_pages_default_scsi.pages[page][0] & 0x80; else val = scsi_cdrom_mode_sense_pages_default.pages[page][0] & 0x80; @@ -2662,6 +3405,14 @@ scsi_cdrom_phase_data_out(scsi_common_t *sc) return 0; } break; + case 0xC9: + if (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-541_1.0i") || + !strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU-76S_1.00")) { + for (i = 0; i < 18; i++) { + dev->ms_pages_saved_sony.pages[GPMODE_CDROM_AUDIO_PAGE_SONY][i] = dev->buffer[i]; + } + } + break; } scsi_cdrom_command_stop((scsi_common_t *) dev); @@ -2732,43 +3483,72 @@ scsi_cdrom_get_timings(int ide_has_dma, int type) static void scsi_cdrom_identify(ide_t *ide, int ide_has_dma) { -#ifdef USE_86BOX_CD scsi_cdrom_t *dev; - char device_identify[9] = { '8', '6', 'B', '_', 'C', 'D', '0', '0', 0 }; + char device_identify[9] = { '8', '6', 'B', '_', 'C', 'D', '0', '0', 0 }; dev = (scsi_cdrom_t *) ide->sc; device_identify[7] = dev->id + 0x30; scsi_cdrom_log("ATAPI Identify: %s\n", device_identify); -#else - scsi_cdrom_t *dev = (scsi_cdrom_t *) ide->sc; -#endif - if (dev->early) + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01")) || (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) /*NEC only*/ ide->buffer[0] = 0x8000 | (5 << 8) | 0x80 | (1 << 5); /* ATAPI device, CD-ROM drive, removable media, interrupt DRQ */ else ide->buffer[0] = 0x8000 | (5 << 8) | 0x80 | (2 << 5); /* ATAPI device, CD-ROM drive, removable media, accelerated DRQ */ - ide_padstr((char *) (ide->buffer + 10), "", 20); /* Serial Number */ -#ifdef USE_86BOX_CD - ide_padstr((char *) (ide->buffer + 23), EMU_VERSION_EX, 8); /* Firmware */ - ide_padstr((char *) (ide->buffer + 27), device_identify, 40); /* Model */ -#else - if (dev->early) { -# ifdef WRONG - ide_padstr((char *) (ide->buffer + 23), "1.01 ", 8); /* Firmware */ - ide_padstr((char *) (ide->buffer + 27), "NEC CD-ROM DRIVE:260 ", 40); /* Model */ -# else - ide_padstr((char *) (ide->buffer + 23), ".110 ", 8); /* Firmware */ - ide_padstr((char *) (ide->buffer + 27), "EN C DCR-MOD IREV2:06 ", 40); /* Model */ -# endif - } else if (machine_is_sony()) { - ide_padstr((char *) (ide->buffer + 23), "1.0i ", 8); /* Firmware */ - ide_padstr((char *) (ide->buffer + 27), "CD-ROM CDU76 ", 40); /* Model */ + ide_padstr((char *) (ide->buffer + 10), "", 20); /* Serial Number */ + + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "86BOX_CD-ROM_1.00"))) { + ide_padstr((char *) (ide->buffer + 23), EMU_VERSION_EX, 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), device_identify, 40); /* Model */ } else { - ide_padstr((char *) (ide->buffer + 23), "0020 ", 8); /* Firmware */ - ide_padstr((char *) (ide->buffer + 27), "HITACHI CDR-8130 ", 40); /* Model */ + if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01"))) { + ide_padstr((char *) (ide->buffer + 23), ".110 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "EN C DCR-MOD IREV2:06 ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) { + ide_padstr((char *) (ide->buffer + 23), ".100 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "EN C DCR-MOD IREV2:06 ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "AZT_CDA46802I_1.15"))) { + ide_padstr((char *) (ide->buffer + 23), "1.15 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "AZT CDA46802I ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "HITACHI_CDR-8130_0020"))) { + ide_padstr((char *) (ide->buffer + 23), "0020 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "HITACHI CDR-8130 ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU76_1.0i"))) { + ide_padstr((char *) (ide->buffer + 23), "1.0i ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "SONY CD-ROM CDU76 ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "SONY_CD-ROM_CDU311_3.0h"))) { + ide_padstr((char *) (ide->buffer + 23), "3.0h ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "SONY CD-ROM CDU311 ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CDR-1300A_1.05"))) { + ide_padstr((char *) (ide->buffer + 23), "1.05 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "NEC CDR-1300A ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "TOSHIBA_CD-ROM_XM-5702B_TA70"))) { + ide_padstr((char *) (ide->buffer + 23), "TA70 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "TOSHIBA CD-ROM XM-5702B ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "GOLDSTAR_CRD-8160B_3.14"))) { + ide_padstr((char *) (ide->buffer + 23), "3.14 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "GOLDSTAR CRD-8160B ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-587_7S13"))) { + ide_padstr((char *) (ide->buffer + 23), "7S13 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "MATSHITA CD-ROM CR-587 ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MATSHITA_CD-ROM_CR-588_LS15"))) { + ide_padstr((char *) (ide->buffer + 23), "LS15 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "MATSHITA CD-ROM CR-588 ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "MITSUMI_CRMC-FX4820T_D02A"))) { + ide_padstr((char *) (ide->buffer + 23), "D02A ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "MITSUMI CRMC-FX4820T ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "PHILIPS_CD-ROM_PCA403CD_U31P"))) { + ide_padstr((char *) (ide->buffer + 23), "U31P ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "PHILIPS CD-ROM PCA403CD ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "BTC_CD-ROM_BCD36XH_U1.0"))) { + ide_padstr((char *) (ide->buffer + 23), "U1.0 ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "BTC CD-ROM BCD36XH ", 40); /* Model */ + } else if ((!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "KENWOOD_CD-ROM_UCR-421_208E"))) { + ide_padstr((char *) (ide->buffer + 23), "208E ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "KENWOOD CD-ROM UCR-421 ", 40); /* Model */ + } } -#endif + ide->buffer[49] = 0x200; /* LBA supported */ ide->buffer[126] = 0xfffe; /* Interpret zero byte count limit as maximum length */ @@ -2815,7 +3595,6 @@ scsi_cdrom_drive_reset(int c) dev->drv = drv; dev->cur_lun = SCSI_LUN_USE_CDB; - dev->early = dev->drv->early; drv->insert = scsi_cdrom_insert; drv->get_volume = scsi_cdrom_get_volume; @@ -2854,7 +3633,8 @@ scsi_cdrom_drive_reset(int c) id->phase_data_out = scsi_cdrom_phase_data_out; id->command_stop = scsi_cdrom_command_stop; id->bus_master_error = scsi_cdrom_bus_master_error; - id->interrupt_drq = dev->early; + id->interrupt_drq = (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || + (!strcmp(cdrom_drive_types[dev->drv->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))); ide_atapi_attach(id); } diff --git a/src/scsi/scsi_ncr5380.c b/src/scsi/scsi_ncr5380.c index 668f9ea9f..c01d0bf36 100644 --- a/src/scsi/scsi_ncr5380.c +++ b/src/scsi/scsi_ncr5380.c @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * TheCollector1995, * Fred N. van Kempen, * @@ -598,7 +598,7 @@ ncr_write(uint16_t port, uint8_t val, void *priv) break; case 2: /* Mode register */ - ncr_log("Write: Mode register, val=%02x\n", val & MODE_DMA); + ncr_log("Write: Mode register, val=%02x.\n", val); if ((val & MODE_ARBITRATE) && !(ncr->mode & MODE_ARBITRATE)) { ncr->icr &= ~ICR_ARB_LOST; ncr->icr |= ICR_ARB_IN_PROGRESS; @@ -741,12 +741,7 @@ ncr_read(uint16_t port, void *priv) break; case 2: /* Mode register */ - if (((ncr->mode & 0x30) == 0x30) && ((ncr_dev->type == 1) && (ncr_dev->bios_ver == 1))) - ncr->mode = 0; - if (((ncr->mode & 0x20) == 0x20) && (ncr_dev->type == 0)) - ncr->mode = 0; - - ncr_log("Read: Mode register\n"); + ncr_log("Read: Mode register = %02x.\n", ncr->mode); ret = ncr->mode; break; @@ -761,10 +756,10 @@ ncr_read(uint16_t port, void *priv) ncr_bus_read(ncr_dev); ncr_log("NCR cur bus stat=%02x\n", ncr->cur_bus & 0xff); ret |= (ncr->cur_bus & 0xff); - if ((ncr->icr & ICR_SEL) && ((ncr_dev->type == 1) && (ncr_dev->bios_ver == 1))) - ret |= 0x02; - if ((ncr->icr & ICR_BSY) && ((ncr_dev->type == 1) && (ncr_dev->bios_ver == 1))) - ret |= 0x40; + if (ncr->icr & ICR_SEL) + ret |= BUS_SEL; + if (ncr->icr & ICR_BSY) + ret |= BUS_BSY; break; case 5: /* Bus and Status register */ @@ -783,9 +778,9 @@ ncr_read(uint16_t port, void *priv) ncr_bus_read(ncr_dev); bus = ncr->cur_bus; - if ((bus & BUS_ACK) || ((ncr->icr & ICR_ACK) && ((ncr_dev->type == 1) && (ncr_dev->bios_ver == 1)))) + if ((bus & BUS_ACK) || (ncr->icr & ICR_ACK)) ret |= STATUS_ACK; - if ((bus & BUS_ATN) || ((ncr->icr & ICR_ATN) && ((ncr_dev->type == 1) && (ncr_dev->bios_ver == 1)))) + if ((bus & BUS_ATN) || (ncr->icr & ICR_ATN)) ret |= 0x02; if ((bus & BUS_REQ) && (ncr->mode & MODE_DMA)) { @@ -885,6 +880,13 @@ memio_read(uint32_t addr, void *priv) ncr_log("NCR status ctrl read=%02x\n", ncr_dev->status_ctrl & STATUS_BUFFER_NOT_READY); if (!ncr_dev->ncr_busy) ret |= STATUS_53C80_ACCESSIBLE; + if (ncr->mode & 0x30) { /*Parity bits*/ + if (!(ncr->mode & MODE_DMA)) { /*This is to avoid RTBios 8.10R BIOS problems with the hard disk and detection.*/ + ret |= 0x01; /*If the parity bits are set, bit 0 of the 53c400 status port should be set as well.*/ + ncr->mode = 0; /*Required by RTASPI10.SYS otherwise it won't initialize.*/ + } + } + ncr_log("NCR 53c400 status = %02x.\n", ret); break; case 0x3981: /* block counter register*/ @@ -948,6 +950,7 @@ memio_write(uint32_t addr, uint8_t val, void *priv) case 0x3980: switch (addr) { case 0x3980: /* Control */ + ncr_log("NCR 53c400 control = %02x, mode = %02x.\n", val, ncr->mode); if ((val & CTRL_DATA_DIR) && !(ncr_dev->status_ctrl & CTRL_DATA_DIR)) { ncr_dev->buffer_host_pos = MIN(128, dev->buffer_length); ncr_dev->status_ctrl |= STATUS_BUFFER_NOT_READY; diff --git a/src/scsi/scsi_spock.c b/src/scsi/scsi_spock.c index ab970f17a..f8dc3282e 100644 --- a/src/scsi/scsi_spock.c +++ b/src/scsi/scsi_spock.c @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * TheCollector1995, * * Copyright 2020 Sarah Walker. @@ -126,9 +126,10 @@ typedef struct { get_pos_info_t get_pos_info; scb_t scb; - int adapter_reset; int scb_id; int adapter_id; + int assign; + int present[8]; int cmd_status; int cir_status; @@ -380,7 +381,7 @@ spock_read(uint16_t port, void *p) break; } - spock_log("spock_read: port=%04x val=%02x %04x(%05x):%04x %02x\n", port, temp, CS, cs, cpu_state.pc, BH); + spock_log("spock_read: port=%04x val=%02x %04x(%05x):%04x.\n", port, temp, CS, cs, cpu_state.pc); return temp; } @@ -436,11 +437,14 @@ spock_get_len(spock_t *scsi, scb_t *scb) static void spock_process_imm_cmd(spock_t *scsi) { - int i; + int i, j = 0; int adapter_id, phys_id, lun_id; + scsi->assign = 0; + switch (scsi->command & CMD_MASK) { case CMD_ASSIGN: + scsi->assign = 1; adapter_id = (scsi->command >> 16) & 15; phys_id = (scsi->command >> 20) & 7; lun_id = (scsi->command >> 24) & 7; @@ -458,10 +462,10 @@ spock_process_imm_cmd(spock_t *scsi) if (phys_id != scsi->adapter_id) { scsi->dev_id[adapter_id].phys_id = phys_id; scsi->dev_id[adapter_id].lun_id = lun_id; - spock_log("Assign: adapter dev=%x scsi ID=%i LUN=%i\n", adapter_id, scsi->dev_id[adapter_id].phys_id, scsi->dev_id[adapter_id].lun_id); + spock_log("Assign: adapter dev=%x scsi ID=%i LUN=%i.\n", adapter_id, scsi->dev_id[adapter_id].phys_id, scsi->dev_id[adapter_id].lun_id); spock_set_irq(scsi, scsi->attention & 0x0f, IRQ_TYPE_IMM_CMD_COMPLETE); } else { /*Can not assign adapter*/ - spock_log("Assign: PUN=%d, cannot assign adapter\n", phys_id); + spock_log("Assign: PUN=%d, cannot assign adapter.\n", phys_id); spock_set_irq(scsi, scsi->attention & 0x0f, IRQ_TYPE_COMMAND_FAIL); } } @@ -481,18 +485,25 @@ spock_process_imm_cmd(spock_t *scsi) spock_set_irq(scsi, scsi->attention & 0x0f, IRQ_TYPE_IMM_CMD_COMPLETE); break; case CMD_RESET: - spock_log("Reset Command\n"); + spock_log("Reset Command, attention = %d.\n", scsi->attention & 0x0f); if ((scsi->attention & 0x0f) == 0x0f) { /*Adapter reset*/ - for (i = 0; i < 8; i++) + for (i = 0; i < 8; i++) { scsi_device_reset(&scsi_devices[scsi->bus][i]); - spock_log("Adapter Reset\n"); + } - if (!scsi->adapter_reset) /*The early 1990 bios must have its boot drive - set to ID 6 according https://www.ardent-tool.com/IBM_SCSI/SCSI-A.html */ - scsi->adapter_reset = 1; + for (i = 6; i > -1; i--) { + if (scsi_device_present(&scsi_devices[scsi->bus][i])) { + spock_log("Adapter Reset, SCSI reset present devices=%d, phys ID=%d, type=%04x.\n", j, scsi->dev_id[i].phys_id, scsi_devices[scsi->bus][i].type); + scsi->present[j] = i; + j++; + } else { + spock_log("Adapter Reset, SCSI reset not present devices=%d, phys ID=%d, type=%04x.\n", j, scsi->dev_id[i].phys_id, scsi_devices[scsi->bus][i].type); + } + } scsi->scb_state = 0; } + spock_set_irq(scsi, scsi->attention & 0x0f, IRQ_TYPE_IMM_CMD_COMPLETE); break; @@ -505,7 +516,7 @@ spock_process_imm_cmd(spock_t *scsi) static void spock_execute_cmd(spock_t *scsi, scb_t *scb) { - int c; + int c, j = 0; int old_scb_state; if (scsi->in_reset) { @@ -519,9 +530,9 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) if (scsi->in_reset == 1) { scsi->basic_ctrl |= CTRL_IRQ_ENA; - spock_set_irq(scsi, 0x0f, IRQ_TYPE_RESET_COMPLETE); - } else - spock_set_irq(scsi, 0x0f, IRQ_TYPE_RESET_COMPLETE); + } + + spock_set_irq(scsi, 0x0f, IRQ_TYPE_RESET_COMPLETE); /*Reset device mappings*/ for (c = 0; c < 7; c++) { @@ -532,6 +543,16 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) scsi->dev_id[c].phys_id = -1; scsi->in_reset = 0; + + for (c = 6; c > -1; c--) { + if (scsi_device_present(&scsi_devices[scsi->bus][c])) { + spock_log("Reset, SCSI reset present devices=%d, phys ID=%d, type=%04x.\n", j, scsi->dev_id[c].phys_id, scsi_devices[scsi->bus][c].type); + scsi->present[j] = c; + j++; + } else { + spock_log("Reset, SCSI reset not present devices=%d, phys ID=%d, type=%04x.\n", j, scsi->dev_id[c].phys_id, scsi_devices[scsi->bus][c].type); + } + } return; } @@ -584,11 +605,11 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) " SCB chain address = %08x\n" " Block count = %04x\n" " Block length = %04x\n" - " SCB id = %d, Phys id = %d\n", + " SCB id = %d, Phys id = %d, Spock CMD = %08x, CMD Mask = %02x.\n", scb->command, scb->enable, scb->lba_addr, scb->sge.sys_buf_addr, scb->sge.sys_buf_byte_count, scb->term_status_block_addr, scb->scb_chain_addr, - scb->block_count, scb->block_length, scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id); + scb->block_count, scb->block_length, scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id, scsi->command, scb->command & 0xc0); switch (scb->command & CMD_MASK) { case CMD_GET_COMPLETE_STATUS: @@ -662,10 +683,7 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) break; case CMD_DEVICE_INQUIRY: - if (scb->command != CMD_DEVICE_INQUIRY) - scsi->cdb_id = scsi->scb_id; - else - scsi->cdb_id = scsi->dev_id[scsi->scb_id].phys_id; + scsi->cdb_id = scsi->assign ? scsi->dev_id[scsi->scb_id].phys_id : scsi->present[scsi->scb_id]; spock_log("Device Inquiry, ID=%d\n", scsi->cdb_id); scsi->cdb[0] = GPCMD_INQUIRY; scsi->cdb[1] = scsi->dev_id[scsi->scb_id].lun_id << 5; /*LUN*/ @@ -681,12 +699,9 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) return; case CMD_SEND_OTHER_SCSI: - if (scb->command != CMD_SEND_OTHER_SCSI) - scsi->cdb_id = scsi->scb_id; - else - scsi->cdb_id = scsi->dev_id[scsi->scb_id].phys_id; - spock_log("Send Other SCSI, SCB ID=%d, PHYS ID=%d, reset=%d\n", scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id, scsi->adapter_reset); + scsi->cdb_id = scsi->assign ? scsi->dev_id[scsi->scb_id].phys_id : scsi->present[scsi->scb_id]; dma_bm_read(scsi->scb_addr + 0x18, scsi->cdb, 12, 2); + spock_log("Send Other SCSI, SCB ID=%d, PHYS ID=%d\n", scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id); scsi->cdb[1] = (scsi->cdb[1] & 0x1f) | (scsi->dev_id[scsi->scb_id].lun_id << 5); /*Patch correct LUN into command*/ scsi->cdb_len = (scb->lba_addr & 0xff) ? (scb->lba_addr & 0xff) : 6; scsi->scsi_state = SCSI_STATE_SELECT; @@ -694,11 +709,8 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) return; case CMD_READ_DEVICE_CAPACITY: - if (scb->command != CMD_READ_DEVICE_CAPACITY) - scsi->cdb_id = scsi->scb_id; - else - scsi->cdb_id = scsi->dev_id[scsi->scb_id].phys_id; - spock_log("Device Capacity, SCB ID=%d, PHYS ID=%d, reset=%d\n", scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id, scsi->adapter_reset); + scsi->cdb_id = scsi->assign ? scsi->dev_id[scsi->scb_id].phys_id : scsi->present[scsi->scb_id]; + spock_log("Device Capacity, SCB ID=%d, PHYS ID=%d\n", scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id); scsi->cdb[0] = GPCMD_READ_CDROM_CAPACITY; scsi->cdb[1] = scsi->dev_id[scsi->scb_id].lun_id << 5; /*LUN*/ scsi->cdb[2] = 0; /*LBA*/ @@ -715,11 +727,8 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) return; case CMD_READ_DATA: - if (scb->command != CMD_READ_DATA) - scsi->cdb_id = scsi->scb_id; - else - scsi->cdb_id = scsi->dev_id[scsi->scb_id].phys_id; - spock_log("Device Read Data, SCB ID=%d, PHYS ID=%d, reset=%d\n", scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id, scsi->adapter_reset); + scsi->cdb_id = scsi->assign ? scsi->dev_id[scsi->scb_id].phys_id : scsi->present[scsi->scb_id]; + spock_log("Device Read Data, SCB ID=%d, PHYS ID=%d\n", scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id); scsi->cdb[0] = GPCMD_READ_10; scsi->cdb[1] = scsi->dev_id[scsi->scb_id].lun_id << 5; /*LUN*/ scsi->cdb[2] = (scb->lba_addr >> 24) & 0xff; /*LBA*/ @@ -736,10 +745,7 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) return; case CMD_WRITE_DATA: - if (scb->command != CMD_WRITE_DATA) - scsi->cdb_id = scsi->scb_id; - else - scsi->cdb_id = scsi->dev_id[scsi->scb_id].phys_id; + scsi->cdb_id = scsi->assign ? scsi->dev_id[scsi->scb_id].phys_id : scsi->present[scsi->scb_id]; spock_log("Device Write Data\n"); scsi->cdb[0] = GPCMD_WRITE_10; scsi->cdb[1] = scsi->dev_id[scsi->scb_id].lun_id << 5; /*LUN*/ @@ -757,10 +763,7 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) return; case CMD_VERIFY: - if (scb->command != CMD_VERIFY) - scsi->cdb_id = scsi->scb_id; - else - scsi->cdb_id = scsi->dev_id[scsi->scb_id].phys_id; + scsi->cdb_id = scsi->assign ? scsi->dev_id[scsi->scb_id].phys_id : scsi->present[scsi->scb_id]; spock_log("Device Verify\n"); scsi->cdb[0] = GPCMD_VERIFY_10; scsi->cdb[1] = scsi->dev_id[scsi->scb_id].lun_id << 5; /*LUN*/ @@ -779,10 +782,7 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) return; case CMD_REQUEST_SENSE: - if (scb->command != CMD_REQUEST_SENSE) - scsi->cdb_id = scsi->scb_id; - else - scsi->cdb_id = scsi->dev_id[scsi->scb_id].phys_id; + scsi->cdb_id = scsi->assign ? scsi->dev_id[scsi->scb_id].phys_id : scsi->present[scsi->scb_id]; spock_log("Device Request Sense, ID=%d\n", scsi->cdb_id); scsi->cdb[0] = GPCMD_REQUEST_SENSE; scsi->cdb[1] = scsi->dev_id[scsi->scb_id].lun_id << 5; /*LUN*/ @@ -802,7 +802,7 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) if (scsi_device_present(&scsi_devices[scsi->bus][scsi->cdb_id])) { if (scsi->last_status == SCSI_STATUS_OK) { scsi->scb_state = 3; - spock_log("Status is Good on device ID %d, reset = %d\n", scsi->scb_id, scsi->adapter_reset); + spock_log("Status is Good on device ID %d, cdb id = %d.\n", scsi->scb_id, scsi->cdb_id); } else if (scsi->last_status == SCSI_STATUS_CHECK_CONDITION) { uint16_t term_stat_block_addr7 = (0xc << 8) | 2; uint16_t term_stat_block_addr8 = 0x20; @@ -811,7 +811,7 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) spock_set_irq(scsi, scsi->scb_id, IRQ_TYPE_COMMAND_FAIL); scsi->scb_state = 0; - spock_log("Status Check Condition on device ID %d, reset = %d\n", scsi->scb_id, scsi->adapter_reset); + spock_log("Status Check Condition on device ID %d, cdb id = %d.\n", scsi->attention & 0x0f, scsi->cdb_id); dma_bm_write(scb->term_status_block_addr + 0x7 * 2, (uint8_t *) &term_stat_block_addr7, 2, 2); dma_bm_write(scb->term_status_block_addr + 0x8 * 2, (uint8_t *) &term_stat_block_addr8, 2, 2); dma_bm_write(scb->term_status_block_addr + 0xb * 2, (uint8_t *) &term_stat_block_addrb, 2, 2); @@ -822,7 +822,7 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) uint16_t term_stat_block_addr8 = 0x10; spock_set_irq(scsi, scsi->scb_id, IRQ_TYPE_COMMAND_FAIL); scsi->scb_state = 0; - spock_log("Status Check Condition on device ID %d on no device, reset = %d\n", scsi->scb_id, scsi->adapter_reset); + spock_log("Status Check Condition on device ID %d on no device\n", scsi->scb_id); dma_bm_write(scb->term_status_block_addr + 0x7 * 2, (uint8_t *) &term_stat_block_addr7, 2, 2); dma_bm_write(scb->term_status_block_addr + 0x8 * 2, (uint8_t *) &term_stat_block_addr8, 2, 2); } @@ -837,7 +837,7 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb) } else { spock_set_irq(scsi, scsi->scb_id, IRQ_TYPE_SCB_COMPLETE); scsi->scb_state = 0; - spock_log("Complete SCB\n"); + spock_log("Complete SCB ID = %d.\n", scsi->attention & 0x0f); } break; } @@ -856,12 +856,12 @@ spock_process_scsi(spock_t *scsi, scb_t *scb) break; case SCSI_STATE_SELECT: - spock_log("Selecting ID %d\n", scsi->cdb_id); + spock_log("Selecting ID %d, SCB ID %d, LUN %d, adapter id = %d.\n", scsi->cdb_id, scsi->scb_id, scsi->dev_id[scsi->scb_id].lun_id, scsi->attention); if ((scsi->cdb_id != (uint8_t) -1) && scsi_device_present(&scsi_devices[scsi->bus][scsi->cdb_id])) { scsi->scsi_state = SCSI_STATE_SEND_COMMAND; - spock_log("Device selected at ID %i\n", scsi->cdb_id); + spock_log("Device selected at ID %i.\n", scsi->cdb_id); } else { - spock_log("Device selection failed at ID %i\n", scsi->cdb_id); + spock_log("Device selection failed at ID %i.\n", scsi->cdb_id); scsi->scsi_state = SCSI_STATE_IDLE; if (!scsi->cmd_timer) { spock_log("Callback to reset\n"); @@ -985,6 +985,7 @@ spock_callback(void *priv) scsi->cir[3] = scsi->cir_pending[3]; scsi->cir_status = 0; + spock_log("SCSI attention = %02x.\n", scsi->attention_pending); switch (scsi->attention >> 4) { case 1: /*Immediate command*/ scsi->cmd_status = 0x0a; @@ -1007,7 +1008,7 @@ spock_callback(void *priv) scsi->scb_addr = scsi->cir[0] | (scsi->cir[1] << 8) | (scsi->cir[2] << 16) | (scsi->cir[3] << 24); scsi->scb_id = scsi->attention & 0x0f; scsi->cmd_timer = SPOCK_TIME * 2; - spock_log("Start SCB at ID = %d\n", scsi->scb_id); + spock_log("Start SCB at ID = %d, attention = %02x\n", scsi->scb_id, scsi->attention >> 4); scsi->scb_state = 1; break; @@ -1019,7 +1020,7 @@ spock_callback(void *priv) case 0x0e: /*EOI*/ scsi->irq_status = 0; - spock_clear_irq(scsi, scsi->attention & 0xf); + spock_clear_irq(scsi, scsi->attention & 0x0f); break; } } @@ -1049,10 +1050,9 @@ spock_mca_write(int port, uint8_t val, void *priv) if (scsi->pos_regs[2] & 1) { io_sethandler((((scsi->pos_regs[2] >> 1) & 7) * 8) + 0x3540, 0x0008, spock_read, spock_readw, NULL, spock_write, spock_writew, NULL, scsi); - if ((scsi->pos_regs[2] >> 4) == 0x0f) - mem_mapping_disable(&scsi->bios_rom.mapping); - else { + if ((scsi->pos_regs[2] & 0xf0) != 0xf0) { mem_mapping_set_addr(&scsi->bios_rom.mapping, ((scsi->pos_regs[2] >> 4) * 0x2000) + 0xc0000, 0x8000); + mem_mapping_enable(&scsi->bios_rom.mapping); } } } @@ -1089,10 +1089,10 @@ spock_mca_reset(void *priv) scsi->basic_ctrl = 0; /* Reset all devices on controller reset. */ - for (i = 0; i < 8; i++) + for (i = 0; i < 8; i++) { scsi_device_reset(&scsi_devices[scsi->bus][i]); - - scsi->adapter_reset = 0; + scsi->present[i] = 0; + } } static void * @@ -1162,12 +1162,12 @@ static const device_config_t spock_rom_config[] = { // clang-format off { .name = "bios_ver", - .description = "BIOS Version", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 1, - .file_filter = "", - .spinner = { 0 }, + .description = "BIOS Version", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, .selection = { { .description = "1991 BIOS (>1GB)", .value = 1 }, { .description = "1990 BIOS", .value = 0 }, @@ -1175,7 +1175,7 @@ static const device_config_t spock_rom_config[] = { }, }, { .name = "", .description = "", .type = CONFIG_END } - // clang-format on +// clang-format on }; const device_t spock_device = { diff --git a/src/scsi/scsi_x54x.c b/src/scsi/scsi_x54x.c index 45854a0ba..ae049d921 100644 --- a/src/scsi/scsi_x54x.c +++ b/src/scsi/scsi_x54x.c @@ -1312,14 +1312,14 @@ x54x_in(uint16_t port, void *priv) case 3: /* Bits according to ASPI4DOS.SYS v3.36: - 0 Not checked - 1 Must be 0 - 2 Must be 0-0-0-1 - 3 Must be 0 - 4 Must be 0-1-0-0 - 5 Must be 0 - 6 Not checked - 7 Not checked + 0 Not checked + 1 Must be 0 + 2 Must be 0-0-0-1 + 3 Must be 0 + 4 Must be 0-1-0-0 + 5 Must be 0 + 6 Not checked + 7 Not checked */ if (dev->flags & X54X_INT_GEOM_WRITABLE) ret = dev->Geometry; diff --git a/src/sio/CMakeLists.txt b/src/sio/CMakeLists.txt index bf38efe57..15411d3e6 100644 --- a/src/sio/CMakeLists.txt +++ b/src/sio/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(sio OBJECT sio_acc3221.c sio_ali5123.c sio_f82c710.c sio_82091aa.c diff --git a/src/sio/sio_82091aa.c b/src/sio/sio_82091aa.c index 1a7910cab..52a8809e9 100644 --- a/src/sio/sio_82091aa.c +++ b/src/sio/sio_82091aa.c @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Intel 82091AA Super I/O chip. + * Emulation of the Intel 82091AA Super I/O chip. * * * - * Author: Miran Grca, - * Copyright 2020 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2020 Miran Grca. */ #include #include diff --git a/src/sio/sio_acc3221.c b/src/sio/sio_acc3221.c index dd0c247f0..f5c671c3a 100644 --- a/src/sio/sio_acc3221.c +++ b/src/sio/sio_acc3221.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the ACC 3221-SP Super I/O Chip. + * Implementation of the ACC 3221-SP Super I/O Chip. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2019 Sarah Walker. + * Copyright 2019 Sarah Walker. */ #include #include @@ -40,31 +40,31 @@ typedef struct acc3221_t { } acc3221_t; /* Configuration Register Index, BE (R/W): - Bit Function - 7 PIRQ 5 polarity. + Bit Function + 7 PIRQ 5 polarity. 1 = active high, default 0 = active low - 6 PIRQ 7 polarity. + 6 PIRQ 7 polarity. 1 = active high, default 0 = active low - 5 Primary Parallel Port Extended Mode + 5 Primary Parallel Port Extended Mode 0 = Compatible mode, default 1 = Extended/Bidirectional mode. - 4 Primary Parallel Port Disable + 4 Primary Parallel Port Disable 1 = Disable, 0 = Enable Power Up Default is set by pin 120 (3221-DP)/pin 96 (3221-SP) - 3 Primary Parallel Port Power Down + 3 Primary Parallel Port Power Down 1 = Power Down, default = 0 - 2** Secondary Parallel Port Extended + 2** Secondary Parallel Port Extended Mode 0 = Compatible mode, default 1 = Extended/Bidirectional mode. - 1** Secondary Parallel Port Disable + 1** Secondary Parallel Port Disable 1 = Disable, 0 = Enable Power Up Default is set by pin 77 (3221-DP) - 0** Secondary Parallel Port Power Down + 0** Secondary Parallel Port Power Down 1 = Power Down 0 = Enable, default Note: Power Up not applicable to 3221-EP. */ @@ -72,41 +72,41 @@ typedef struct acc3221_t { #define REG_BE_LPT2_DISABLE (3 << 0) /* 3221-DP/EP only */ /* Configuration Register Index, BF (R/W): - Bit Function - 7-0 The 8 most significant address bits of + Bit Function + 7-0 The 8 most significant address bits of the primary parallel port (A9-2) Default 9E (LPT2, at 278-27B) */ /* Configuration Register Index, DA (R/W)**: - Bit Function - 7-0 The 8 most significant address bits of + Bit Function + 7-0 The 8 most significant address bits of the secondary parallel port (A9-2) Default DE (LPT1, at 378-37B) */ /* Configuration Register Index, DB (R/W): - Bit Function - 7 SIRQ4 polarity. + Bit Function + 7 SIRQ4 polarity. 1 = active high; default 0 = active low - 6 SIRQ3 polarity. + 6 SIRQ3 polarity. 1 = active high; default 0 = active low - 5 SXTAL clock off. 1 = SCLK off, + 5 SXTAL clock off. 1 = SCLK off, 0 = SCKL on, default - 4 Primary serial port disable + 4 Primary serial port disable 1 = Disable, 0 = Enable Power Up default is set by pin 116 (3221-DP)/pin 93 (3221-SP) - 3 Primary serial port power down + 3 Primary serial port power down 1 = Power down, 0 = Enable Power Up default is set by pin 116 (3221-DP)/pin 93 (3221-SP) - 2 Reserved - 1 Secondary serial port disable + 2 Reserved + 1 Secondary serial port disable 1 = Disable, 0 = Enable Power Up default is set by pin 121 (3221-DP)/pin 97 (3221-SP) - 0 Secondary serial port power down + 0 Secondary serial port power down 1 = Power down, 0 = Enable Power Up default is set by pin 121 (3221-DP)/pin 97 (3221-SP) @@ -115,57 +115,57 @@ typedef struct acc3221_t { #define REG_DB_SERIAL2_DISABLE (3 << 0) /* Configuration Register Index, DC (R/W): - Bit Function - 7-1 The MSB of the Primary Serial Port + Bit Function + 7-1 The MSB of the Primary Serial Port Address (bits A9-3). Default = 7F (COM1, at 3F8-3FF). - 0 When this bit is set to 1, bit A2 of + 0 When this bit is set to 1, bit A2 of primary parallel port is decoded. Default is 0. */ /* Configuration Register Index, DD (R/W): - Bit Function - 7-1 The MSB of the Secondary Serial Port + Bit Function + 7-1 The MSB of the Secondary Serial Port Address (bits A9-3). Default = 5F (COM2, at 2F8-2FF). - 0** When this bit is set to 1, bit A2 of + 0** When this bit is set to 1, bit A2 of secondary parallel port is decoded. Default is 0. */ /* Configuration Register Index, DE (R/W): - Bit Function - 7-6 SIRQ3 source - b7 b6 - 0 0 Disabled, tri-stated - 0 1 Disabled, tri-stated** - 1 0 Primary serial port - 1 1 Secondary serial port, + Bit Function + 7-6 SIRQ3 source + b7 b6 + 0 0 Disabled, tri-stated + 0 1 Disabled, tri-stated** + 1 0 Primary serial port + 1 1 Secondary serial port, default - 5-4 SIRQ4 source - b5 b4 - 0 0 Disabled, tri-stated - 0 1 Disabled, tri-stated** - 1 0 Primary serial port, + 5-4 SIRQ4 source + b5 b4 + 0 0 Disabled, tri-stated + 0 1 Disabled, tri-stated** + 1 0 Primary serial port, default - 1 1 Secondary serial port + 1 1 Secondary serial port - 3-2** PIRQ7 source - b3 b2 - 0 0 Diabled, tri-stated, + 3-2** PIRQ7 source + b3 b2 + 0 0 Diabled, tri-stated, default - 0 1 Primary serial port - 1 0 Primary parallel port - 1 1 Secondary parallel + 0 1 Primary serial port + 1 0 Primary parallel port + 1 1 Secondary parallel port Note: Bits 3-2 are reserved in 3221-SP. - 1-0 PIRQ5 source - b1 b0 - 0 0 Disabled, tri-stated - 0 1 Secondary serial port - 1 0 Primary parallel port, + 1-0 PIRQ5 source + b1 b0 + 0 0 Disabled, tri-stated + 0 1 Secondary serial port + 1 0 Primary parallel port, default - 1 1 Secondary parallel + 1 1 Secondary parallel port** */ #define REG_DE_SIRQ3_SOURCE (3 << 6) #define REG_DE_SIRQ3_SERIAL1 (1 << 6) @@ -183,48 +183,48 @@ typedef struct acc3221_t { #define REG_DE_PIRQ5_LPT2 (3 << 0) /* Configuration Register Index, DF (R/W)**: - Bit Function - 7-6 Reserved - 5 RTC interface disable + Bit Function + 7-6 Reserved + 5 RTC interface disable 1 = /RTCCS disabled 0 = /RTCCS enabled, default - 4 Disable Modem Select + 4 Disable Modem Select 1 = Moden CS disabled, default 0 = Modem CS enabled 3-2 - b3 b2 - 1 1 Reserved - 1 0 Modem port address + b3 b2 + 1 1 Reserved + 1 0 Modem port address = 3E8-3EF (default) - 0 1 Modem port address: + 0 1 Modem port address: 2F8-2FF - 0 0 Modem port address: + 0 0 Modem port address: 3F8-3FF 1-0 - b1 b0 - 1 1 Reserved - 1 0 Mode 2, EISA Mode - 0 1 Mode 1, AT BUS, - 0 0 Mode 0, Two parallel + b1 b0 + 1 1 Reserved + 1 0 Mode 2, EISA Mode + 0 1 Mode 1, AT BUS, + 0 0 Mode 0, Two parallel ports, default */ /* Configuration Register Index, FA (R/W)**: - Bit Function - 7 General purpose I/O register, Bit 7 - 6 General purpose I/O register, Bit 6 - 5 General purpose I/O register, Bit 5 - 4 General purpose I/O register, Bit 4 - 3 General purpose I/O register, Bit 3 - 2 General purpose I/O register, Bit 2 - 1 General purpose I/O register, Bit 1 - 0 General purpose I/O register, Bit 0 */ + Bit Function + 7 General purpose I/O register, Bit 7 + 6 General purpose I/O register, Bit 6 + 5 General purpose I/O register, Bit 5 + 4 General purpose I/O register, Bit 4 + 3 General purpose I/O register, Bit 3 + 2 General purpose I/O register, Bit 2 + 1 General purpose I/O register, Bit 1 + 0 General purpose I/O register, Bit 0 */ /* Configuration Register Index, FB (R/W)**: - Bit Function - 7 Reserved - 6** 0/2 EXG (Read Only) + Bit Function + 7 Reserved + 6** 0/2 EXG (Read Only) In mode 1 and mode 2 operation, when the third floppy drive is installed, pin @@ -234,7 +234,7 @@ typedef struct acc3221_t { disable the third floppy drive. 1 = Third floppy drive enabled 0 = Third floppy drive disabled - 5** EXTFDD (Read Only) + 5** EXTFDD (Read Only) In mode 1 and mode 2 operation, when the third floppy drive is installed and @@ -246,7 +246,7 @@ typedef struct acc3221_t { drive 2. 1 = Third floppy drive as drive 0 (bootable) 0 = Third floppy drive as drive 2 - 4** MS + 4** MS In mode 1 and mode 2, t his bit is to control the output pin MS to support a special 3 1/2", 1.2M drive. When this @@ -254,45 +254,45 @@ typedef struct acc3221_t { a low signal. When this bit is set to low (0), the MS pin sends a high signal to support a 3 1/2", 1.2M drive. - 3 FDC, Clock disable + 3 FDC, Clock disable 0 = enable, default 1 = disable - 2 Reserved - 1 FDC disable + 2 Reserved + 1 FDC disable 0 = enable, 1= disable Power Upd efault set by pin 117 (3221- DP)/pin 94 (3221-SP) - 0 FDC address + 0 FDC address 0 = Primary, default 1 = Secondary Note: Bits 6-4 are reserved in 3221-SP. */ #define REG_FB_FDC_DISABLE (1 << 1) /* Configuration Register Index, FB (R/W)**: - Bit Function - 7** Disable general chip select 1 + Bit Function + 7** Disable general chip select 1 1 = disable, default 0 = enable - 6** Disable general chip select 2 + 6** Disable general chip select 2 1 = disable, default 0 = enable - 5** Enable SA2 decoding for general chip + 5** Enable SA2 decoding for general chip select 1 1 = enable 0 = disable, default - 4** Enable SA2 decoding for general chip + 4** Enable SA2 decoding for general chip select 2 1 = enable 0 = disable, default - 3 Reserved - 2 IDE XT selected + 3 Reserved + 2 IDE XT selected 0 = IDE AT interface, default 1 = IDE XT interface - 1 IDE disable, 1 = IDE disable + 1 IDE disable, 1 = IDE disable 0 = IDE enable Power Up default set by pin 13 (3221- DP)/pin 13 (3221-SP) - 0 Secondary IDE + 0 Secondary IDE 1 = secondary 0 = primary, default Note: Bits 6-4 are reserved in 3221-SP. */ diff --git a/src/sio/sio_ali5123.c b/src/sio/sio_ali5123.c index 5c52bbc88..ec5afdc98 100644 --- a/src/sio/sio_ali5123.c +++ b/src/sio/sio_ali5123.c @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the ALi M5123/1543C Super I/O Chip. + * Implementation of the ALi M5123/1543C Super I/O Chip. * * * - * Author: Miran Grca, - * Copyright 2016-2018 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2016-2018 Miran Grca. */ #include #include @@ -65,7 +66,7 @@ static void ali5123_fdc_handler(ali5123_t *dev) { uint16_t ld_port = 0; - uint8_t global_enable = !!(dev->regs[0x22] & (1 << 0)); + uint8_t global_enable = !(dev->regs[0x22] & (1 << 0)); uint8_t local_enable = !!dev->ld_regs[0][0x30]; fdc_remove(dev->fdc); @@ -80,7 +81,7 @@ static void ali5123_lpt_handler(ali5123_t *dev) { uint16_t ld_port = 0; - uint8_t global_enable = !!(dev->regs[0x22] & (1 << 3)); + uint8_t global_enable = !(dev->regs[0x22] & (1 << 3)); uint8_t local_enable = !!dev->ld_regs[3][0x30]; uint8_t lpt_irq = dev->ld_regs[3][0x70]; @@ -99,9 +100,10 @@ ali5123_lpt_handler(ali5123_t *dev) static void ali5123_serial_handler(ali5123_t *dev, int uart) { + uint8_t uart_nos[2][3]= { { 4, 5, 0xb }, { 4, 0xb, 5 } }; uint16_t ld_port = 0; - uint8_t uart_no = (uart == 2) ? 0x0b : (4 + uart); - uint8_t global_enable = !!(dev->regs[0x22] & (1 << uart_no)); + uint8_t uart_no = uart_nos[!!(dev->regs[0x2d] & 0x20)][uart]; + uint8_t global_enable = !(dev->regs[0x22] & (1 << (4 + uart))); uint8_t local_enable = !!dev->ld_regs[uart_no][0x30]; uint8_t mask = (uart == 1) ? 0x04 : 0x05; @@ -206,8 +208,7 @@ ali5123_write(uint16_t port, uint8_t val, void *priv) { ali5123_t *dev = (ali5123_t *) priv; uint8_t index = (port & 1) ? 0 : 1; - uint8_t valxor = 0x00, keep = 0x00; - uint8_t cur_ld; + uint8_t valxor = 0x00, cur_ld = dev->regs[7]; if (index) { if (((val == 0x51) && (!dev->tries) && (!dev->locked)) || ((val == 0x23) && (dev->tries) && (!dev->locked))) { @@ -235,27 +236,23 @@ ali5123_write(uint16_t port, uint8_t val, void *priv) if (dev->locked) { if (dev->cur_reg < 48) { valxor = val ^ dev->regs[dev->cur_reg]; - if ((val == 0x1f) || (val == 0x20) || (val == 0x21)) + if ((val >= 0x1f) && (val <= 0x21)) return; dev->regs[dev->cur_reg] = val; } else { - valxor = val ^ dev->ld_regs[dev->regs[7]][dev->cur_reg]; - if (((dev->cur_reg & 0xf0) == 0x70) && (dev->regs[7] < 4)) + valxor = val ^ dev->ld_regs[cur_ld][dev->cur_reg]; + if (((dev->cur_reg & 0xf0) == 0x70) && (cur_ld < 4)) return; /* Block writes to some logical devices. */ - if (dev->regs[7] > 0x0c) + if (cur_ld > 0x0c) return; - else - switch (dev->regs[7]) { - case 0x01: - case 0x02: - case 0x06: - case 0x08: - case 0x09: - case 0x0a: - return; - } - dev->ld_regs[dev->regs[7]][dev->cur_reg] = val | keep; + else switch (cur_ld) { + case 0x01: case 0x02: + case 0x06: + case 0x08 ... 0x0a: + return; + } + dev->ld_regs[cur_ld][dev->cur_reg] = val; } } else return; @@ -280,16 +277,18 @@ ali5123_write(uint16_t port, uint8_t val, void *priv) if (valxor & 0x40) ali5123_serial_handler(dev, 2); break; + case 0x2d: + if (valxor & 0x20) { + ali5123_serial_handler(dev, 1); + ali5123_serial_handler(dev, 2); + } + break; } return; } cur_ld = dev->regs[7]; - if ((dev->regs[7] == 5) && (dev->regs[0x2d] & 0x20)) - cur_ld = 0x0b; - else if ((dev->regs[7] == 0x0b) && (dev->regs[0x2d] & 0x20)) - cur_ld = 5; switch (cur_ld) { case 0: /* FDD */ @@ -298,7 +297,7 @@ ali5123_write(uint16_t port, uint8_t val, void *priv) case 0x60: case 0x61: if ((dev->cur_reg == 0x30) && (val & 0x01)) - dev->regs[0x22] |= 0x01; + dev->regs[0x22] &= ~0x01; if (valxor) ali5123_fdc_handler(dev); break; @@ -338,7 +337,7 @@ ali5123_write(uint16_t port, uint8_t val, void *priv) case 0x61: case 0x70: if ((dev->cur_reg == 0x30) && (val & 0x01)) - dev->regs[0x22] |= 0x08; + dev->regs[0x22] &= ~0x08; if (valxor) ali5123_lpt_handler(dev); break; @@ -353,7 +352,7 @@ ali5123_write(uint16_t port, uint8_t val, void *priv) case 0x70: case 0xf0: if ((dev->cur_reg == 0x30) && (val & 0x01)) - dev->regs[0x22] |= 0x10; + dev->regs[0x22] &= ~0x10; if (valxor) ali5123_serial_handler(dev, 0); break; @@ -368,9 +367,9 @@ ali5123_write(uint16_t port, uint8_t val, void *priv) case 0x70: case 0xf0: if ((dev->cur_reg == 0x30) && (val & 0x01)) - dev->regs[0x22] |= 0x20; + dev->regs[0x22] &= ~((dev->regs[0x2d] & 0x20) ? 0x40 : 0x20); if (valxor) - ali5123_serial_handler(dev, 1); + ali5123_serial_handler(dev, (dev->regs[0x2d] & 0x20) ? 2 : 1); break; } break; @@ -383,9 +382,9 @@ ali5123_write(uint16_t port, uint8_t val, void *priv) case 0x70: case 0xf0: if ((dev->cur_reg == 0x30) && (val & 0x01)) - dev->regs[0x22] |= 0x40; + dev->regs[0x22] &= ~((dev->regs[0x2d] & 0x20) ? 0x20 : 0x40); if (valxor) - ali5123_serial_handler(dev, 2); + ali5123_serial_handler(dev, (dev->regs[0x2d] & 0x20) ? 1 : 2); break; } break; @@ -410,11 +409,6 @@ ali5123_read(uint16_t port, void *priv) ret = dev->regs[dev->cur_reg]; } else { cur_ld = dev->regs[7]; - if ((dev->regs[7] == 5) && (dev->regs[0x2d] & 0x20)) - cur_ld = 0x0b; - else if ((dev->regs[7] == 0x0b) && (dev->regs[0x2d] & 0x20)) - cur_ld = 5; - ret = dev->ld_regs[cur_ld][dev->cur_reg]; } } diff --git a/src/sio/sio_detect.c b/src/sio/sio_detect.c index 871ad1a0a..36c12cd54 100644 --- a/src/sio/sio_detect.c +++ b/src/sio/sio_detect.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Super I/O chip detection code. + * Super I/O chip detection code. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2016-2018 Miran Grca. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/sio/sio_f82c710.c b/src/sio/sio_f82c710.c index eccf799f4..ad347fb03 100644 --- a/src/sio/sio_f82c710.c +++ b/src/sio/sio_f82c710.c @@ -1,28 +1,30 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the Chips & Technologies F82C710 Universal Peripheral - * Controller (UPC) and 82C606 CHIPSpak Multifunction Controller. + * Implementation of the Chips & Technologies F82C710 Universal Peripheral + * Controller (UPC) and 82C606 CHIPSpak Multifunction Controller. * - * Relevant literature: + * Relevant literature: * - * [1] Chips and Technologies, Inc., - * 82C605/82C606 CHIPSpak/CHIPSport MULTIFUNCTION CONTROLLERS, - * PRELIMINARY Data Sheet, Revision 1, May 1987. - * + * [1] Chips and Technologies, Inc., + * 82C605/82C606 CHIPSpak/CHIPSport MULTIFUNCTION CONTROLLERS, + * PRELIMINARY Data Sheet, Revision 1, May 1987. + * * - * Authors: Sarah Walker, - * Eluan Costa Miranda - * Lubomir Rintel * - * Copyright 2020 Sarah Walker. - * Copyright 2020 Eluan Costa Miranda. - * Copyright 2021 Lubomir Rintel. + * + * Authors: Sarah Walker, + * Eluan Costa Miranda + * Lubomir Rintel + * + * Copyright 2020 Sarah Walker. + * Copyright 2020 Eluan Costa Miranda. + * Copyright 2021 Lubomir Rintel. */ #include #include diff --git a/src/sio/sio_fdc37c669.c b/src/sio/sio_fdc37c669.c index 81d9647c0..a8bc4d700 100644 --- a/src/sio/sio_fdc37c669.c +++ b/src/sio/sio_fdc37c669.c @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the SMC FDC37C669 Super I/O Chip. + * Implementation of the SMC FDC37C669 Super I/O Chip. * * * - * Author: Miran Grca, - * Copyright 2016-2018 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/sio/sio_fdc37c67x.c b/src/sio/sio_fdc37c67x.c index e728a8ffb..af8a89bf5 100644 --- a/src/sio/sio_fdc37c67x.c +++ b/src/sio/sio_fdc37c67x.c @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the SMC FDC37C67X Super I/O Chip. + * Implementation of the SMC FDC37C67X Super I/O Chip. * * * - * Author: Miran Grca, - * Copyright 2016-2018 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2016-2018 Miran Grca. */ #include #include @@ -171,13 +172,13 @@ fdc37c67x_sio_handler(fdc37c67x_t *dev) { #if 0 if (dev->sio_base) { - io_removehandler(dev->sio_base, 0x0002, - fdc37c67x_read, NULL, NULL, fdc37c67x_write, NULL, NULL, dev); + io_removehandler(dev->sio_base, 0x0002, + fdc37c67x_read, NULL, NULL, fdc37c67x_write, NULL, NULL, dev); } dev->sio_base = (((uint16_t) dev->regs[0x27]) << 8) | dev->regs[0x26]; if (dev->sio_base) { - io_sethandler(dev->sio_base, 0x0002, - fdc37c67x_read, NULL, NULL, fdc37c67x_write, NULL, NULL, dev); + io_sethandler(dev->sio_base, 0x0002, + fdc37c67x_read, NULL, NULL, fdc37c67x_write, NULL, NULL, dev); } #endif } diff --git a/src/sio/sio_fdc37c6xx.c b/src/sio/sio_fdc37c6xx.c index 9484ae680..8400ca1e0 100644 --- a/src/sio/sio_fdc37c6xx.c +++ b/src/sio/sio_fdc37c6xx.c @@ -11,7 +11,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2020 Sarah Walker. @@ -216,7 +216,7 @@ static uint8_t fdc37c6xx_read(uint16_t port, void *priv) { fdc37c6xx_t *dev = (fdc37c6xx_t *) priv; - uint8_t ret = 0x00; + uint8_t ret = 0xff; if (dev->tries == 2) { if (port == 0x3f1) @@ -437,6 +437,20 @@ const device_t fdc37c665_ide_device = { .config = NULL }; +const device_t fdc37c665_ide_pri_device = { + .name = "SMC FDC37C665 Super I/O (With Primary IDE)", + .internal_name = "fdc37c665_ide_pri", + .flags = 0, + .local = 0x165, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + const device_t fdc37c666_device = { .name = "SMC FDC37C666 Super I/O", .internal_name = "fdc37c666", diff --git a/src/sio/sio_fdc37c93x.c b/src/sio/sio_fdc37c93x.c index afc1642a5..55464ec98 100644 --- a/src/sio/sio_fdc37c93x.c +++ b/src/sio/sio_fdc37c93x.c @@ -1,18 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the SMC FDC37C932FR and FDC37C935 Super - * I/O Chips. + * Implementation of the SMC FDC37C932FR and FDC37C935 Super + * I/O Chips. * * * - * Author: Miran Grca, - * Copyright 2016-2018 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/sio/sio_fdc37m60x.c b/src/sio/sio_fdc37m60x.c index d74db6207..e29734c51 100644 --- a/src/sio/sio_fdc37m60x.c +++ b/src/sio/sio_fdc37m60x.c @@ -1,15 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the SMSC FDC37M60x Super I/O + * Emulation of the SMSC FDC37M60x Super I/O * - * Authors: Tiseno100 - * Copyright 2020 Tiseno100 + * + * + * Authors: Tiseno100 + * + * Copyright 2020 Tiseno100 */ #include #include diff --git a/src/sio/sio_it8661f.c b/src/sio/sio_it8661f.c index 98340aaa5..c7d4110be 100644 --- a/src/sio/sio_it8661f.c +++ b/src/sio/sio_it8661f.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Implementation of the ITE IT8661F chipset. + * Implementation of the ITE IT8661F chipset. * - * Note: This Super I/O is partially incomplete and intended only for having the intended machine to function + * Note: This Super I/O is partially incomplete and intended only for having the intended machine to function * - * Authors: Tiseno100 + * Authors: Tiseno100 * - * Copyright 2021 Tiseno100 + * Copyright 2021 Tiseno100 * */ #include diff --git a/src/sio/sio_pc87306.c b/src/sio/sio_pc87306.c index 18b9a9357..8755775de 100644 --- a/src/sio/sio_pc87306.c +++ b/src/sio/sio_pc87306.c @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the NatSemi PC87306 Super I/O chip. + * Emulation of the NatSemi PC87306 Super I/O chip. * * * - * Author: Miran Grca, - * Copyright 2016-2018 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2016-2018 Miran Grca. */ #include #include @@ -365,7 +366,7 @@ pc87306_reset(pc87306_t *dev) /* 0 = 360 rpm @ 500 kbps for 3.5" - 1 = Default, 300 rpm @ 500,300,250,1000 kbps for 3.5" + 1 = Default, 300 rpm @ 500, 300, 250, 1000 kbps for 3.5" */ lpt1_remove(); lpt1_handler(dev); diff --git a/src/sio/sio_pc87307.c b/src/sio/sio_pc87307.c index ecdb13c5b..6f773a8e1 100644 --- a/src/sio/sio_pc87307.c +++ b/src/sio/sio_pc87307.c @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the NatSemi PC87307 Super I/O chip. + * Emulation of the NatSemi PC87307 Super I/O chip. * * * - * Author: Miran Grca, - * Copyright 2020 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2020 Miran Grca. */ #include #include @@ -534,7 +535,7 @@ pc87307_reset(pc87307_t *dev) /* 0 = 360 rpm @ 500 kbps for 3.5" - 1 = Default, 300 rpm @ 500,300,250,1000 kbps for 3.5" + 1 = Default, 300 rpm @ 500, 300, 250, 1000 kbps for 3.5" */ lpt1_remove(); serial_remove(dev->uart[0]); diff --git a/src/sio/sio_pc87309.c b/src/sio/sio_pc87309.c index 8d7ff7065..70ed57229 100644 --- a/src/sio/sio_pc87309.c +++ b/src/sio/sio_pc87309.c @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the NatSemi PC87309 Super I/O chip. + * Emulation of the NatSemi PC87309 Super I/O chip. * * * - * Author: Miran Grca, - * Copyright 2020 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2020 Miran Grca. */ #include #include @@ -421,7 +422,7 @@ pc87309_reset(pc87309_t *dev) /* 0 = 360 rpm @ 500 kbps for 3.5" - 1 = Default, 300 rpm @ 500,300,250,1000 kbps for 3.5" + 1 = Default, 300 rpm @ 500, 300, 250, 1000 kbps for 3.5" */ lpt1_remove(); serial_remove(dev->uart[0]); diff --git a/src/sio/sio_pc87310.c b/src/sio/sio_pc87310.c index 5b5267191..eacbadf89 100644 --- a/src/sio/sio_pc87310.c +++ b/src/sio/sio_pc87310.c @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the NatSemi PC87310 Super I/O chip. + * Emulation of the NatSemi PC87310 Super I/O chip. * * * - * Author: Miran Grca, - * Tiseno100 - * EngiNerd + * Authors: Miran Grca, + * Tiseno100 + * EngiNerd * - * Copyright 2020 Miran Grca. - * Copyright 2020 Tiseno100 - * Copyright 2021 EngiNerd. + * Copyright 2020 Miran Grca. + * Copyright 2020 Tiseno100 + * Copyright 2021 EngiNerd. */ #include #include @@ -210,7 +210,7 @@ pc87310_reset(pc87310_t *dev) dev->tries = 0; /* 0 = 360 rpm @ 500 kbps for 3.5" - 1 = Default, 300 rpm @ 500,300,250,1000 kbps for 3.5" + 1 = Default, 300 rpm @ 500, 300, 250, 1000 kbps for 3.5" */ lpt1_remove(); lpt1_handler(dev); diff --git a/src/sio/sio_pc87311.c b/src/sio/sio_pc87311.c index 2c098d5ab..c795da8a9 100644 --- a/src/sio/sio_pc87311.c +++ b/src/sio/sio_pc87311.c @@ -1,15 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the National Semiconductor PC87311 Super I/O + * Emulation of the National Semiconductor PC87311 Super I/O * - * Authors: Tiseno100 - * Copyright 2020 Tiseno100 + * + * + * Authors: Tiseno100 + * + * Copyright 2020 Tiseno100 */ #include #include diff --git a/src/sio/sio_pc87332.c b/src/sio/sio_pc87332.c index 71f7584f4..64dd86665 100644 --- a/src/sio/sio_pc87332.c +++ b/src/sio/sio_pc87332.c @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the NatSemi PC87332 Super I/O chip. + * Emulation of the NatSemi PC87332 Super I/O chip. * * * - * Author: Miran Grca, - * Copyright 2020 Miran Grca. + * Authors: Miran Grca, + * + * Copyright 2020 Miran Grca. */ #include #include @@ -276,7 +277,7 @@ pc87332_reset(pc87332_t *dev) /* 0 = 360 rpm @ 500 kbps for 3.5" - 1 = Default, 300 rpm @ 500,300,250,1000 kbps for 3.5" + 1 = Default, 300 rpm @ 500, 300, 250, 1000 kbps for 3.5" */ lpt1_remove(); lpt1_handler(dev); diff --git a/src/sio/sio_prime3b.c b/src/sio/sio_prime3b.c index b0267f0a0..a204fde5b 100644 --- a/src/sio/sio_prime3b.c +++ b/src/sio/sio_prime3b.c @@ -1,15 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Goldstar Prime3B Super I/O + * Emulation of the Goldstar Prime3B Super I/O * - * Authors: Tiseno100 - * Copyright 2021 Tiseno100 + * + * + * Authors: Tiseno100 + * + * Copyright 2021 Tiseno100 */ #include #include diff --git a/src/sio/sio_prime3c.c b/src/sio/sio_prime3c.c index 303a10967..eae3fe1b2 100644 --- a/src/sio/sio_prime3c.c +++ b/src/sio/sio_prime3c.c @@ -1,15 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the LG Prime3C Super I/O + * Emulation of the LG Prime3C Super I/O * - * Authors: Tiseno100 - * Copyright 2020 Tiseno100 + * + * + * Authors: Tiseno100 + * + * Copyright 2020 Tiseno100 */ #include #include diff --git a/src/sio/sio_um8669f.c b/src/sio/sio_um8669f.c index 954e7c45c..bd153a9e4 100644 --- a/src/sio/sio_um8669f.c +++ b/src/sio/sio_um8669f.c @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the UMC UM8669F Super I/O chip. + * Emulation of the UMC UM8669F Super I/O chip. * * * - * Authors: Sarah Walker, - * Miran Grca, - * RichardG, + * Authors: Sarah Walker, + * Miran Grca, + * RichardG, * - * Copyright 2008-2021 Sarah Walker. - * Copyright 2016-2021 Miran Grca. - * Copyright 2021 RichardG. + * Copyright 2008-2021 Sarah Walker. + * Copyright 2016-2021 Miran Grca. + * Copyright 2021 RichardG. */ #include #include @@ -69,27 +69,27 @@ static uint8_t um8669f_pnp_rom[] = { }; static const isapnp_device_config_t um8669f_pnp_defaults[] = { { - .activate = 1, - .io = { { .base = FDC_PRIMARY_ADDR }, }, - .irq = { { .irq = FDC_PRIMARY_IRQ }, }, - .dma = { { .dma = FDC_PRIMARY_DMA }, } + .activate = 1, + .io = { { .base = FDC_PRIMARY_ADDR }, }, + .irq = { { .irq = FDC_PRIMARY_IRQ }, }, + .dma = { { .dma = FDC_PRIMARY_DMA }, } }, { - .activate = 1, - .io = { { .base = COM1_ADDR }, }, - .irq = { { .irq = COM1_IRQ }, } + .activate = 1, + .io = { { .base = COM1_ADDR }, }, + .irq = { { .irq = COM1_IRQ }, } }, { - .activate = 1, - .io = { { .base = COM2_ADDR }, }, - .irq = { { .irq = COM2_IRQ }, } + .activate = 1, + .io = { { .base = COM2_ADDR }, }, + .irq = { { .irq = COM2_IRQ }, } }, { - .activate = 1, - .io = { { .base = LPT1_ADDR }, }, - .irq = { { .irq = LPT1_IRQ }, } + .activate = 1, + .io = { { .base = LPT1_ADDR }, }, + .irq = { { .irq = LPT1_IRQ }, } }, { - .activate = 0 + .activate = 0 }, { - .activate = 0, - .io = { { .base = 0x200 }, } + .activate = 0, + .io = { { .base = 0x200 }, } } }; diff --git a/src/sio/sio_vt82c686.c b/src/sio/sio_vt82c686.c index 00617e4ea..c7f9c28bc 100644 --- a/src/sio/sio_vt82c686.c +++ b/src/sio/sio_vt82c686.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the VIA VT82C686A/B integrated Super I/O. + * Emulation of the VIA VT82C686A/B integrated Super I/O. * * * - * Author: RichardG, + * Authors: RichardG, * - * Copyright 2020 RichardG. + * Copyright 2020 RichardG. */ #include #include diff --git a/src/sio/sio_w83787f.c b/src/sio/sio_w83787f.c index ce6c20386..722f1eef8 100644 --- a/src/sio/sio_w83787f.c +++ b/src/sio/sio_w83787f.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Winbond W83787F/IF Super I/O Chip. + * Emulation of the Winbond W83787F/IF Super I/O Chip. * - * Winbond W83787F Super I/O Chip - * Used by the Award 430HX + * Winbond W83787F Super I/O Chip + * Used by the Award 430HX * * * - * Author: Miran Grca, - * Copyright 2020 Miran Grca. + * Authors: Miran Grca, + * Copyright 2020 Miran Grca. */ #include #include diff --git a/src/sio/sio_w83877f.c b/src/sio/sio_w83877f.c index 28ab95f46..4f8b45118 100644 --- a/src/sio/sio_w83877f.c +++ b/src/sio/sio_w83877f.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Winbond W83877F Super I/O Chip. + * Emulation of the Winbond W83877F Super I/O Chip. * - * Winbond W83877F Super I/O Chip - * Used by the Award 430HX + * Winbond W83877F Super I/O Chip + * Used by the Award 430HX * * * - * Author: Miran Grca, - * Copyright 2016-2020 Miran Grca. + * Authors: Miran Grca, + * Copyright 2016-2020 Miran Grca. */ #include #include diff --git a/src/sio/sio_w83977f.c b/src/sio/sio_w83977f.c index e214f883d..1b6105840 100644 --- a/src/sio/sio_w83977f.c +++ b/src/sio/sio_w83977f.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Winbond W83977F Super I/O Chip. + * Emulation of the Winbond W83977F Super I/O Chip. * - * Winbond W83977F Super I/O Chip - * Used by the Award 430TX + * Winbond W83977F Super I/O Chip + * Used by the Award 430TX * * * - * Author: Miran Grca, - * Copyright 2016-2020 Miran Grca. + * Authors: Miran Grca, + * Copyright 2016-2020 Miran Grca. */ #include #include diff --git a/src/sound/CMakeLists.txt b/src/sound/CMakeLists.txt index 66672d547..10b8903bc 100644 --- a/src/sound/CMakeLists.txt +++ b/src/sound/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(snd OBJECT sound.c snd_opl.c snd_opl_nuked.c snd_opl_ymfm.cpp snd_resid.cc diff --git a/src/sound/midi.c b/src/sound/midi.c index 93fa62891..0cc8f2b38 100644 --- a/src/sound/midi.c +++ b/src/sound/midi.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Bit, * DOSBox Team, diff --git a/src/sound/openal.c b/src/sound/openal.c index 2153d4c2b..48e4ee818 100644 --- a/src/sound/openal.c +++ b/src/sound/openal.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. diff --git a/src/sound/resid-fp/CMakeLists.txt b/src/sound/resid-fp/CMakeLists.txt index 5ec9130d7..699fcae54 100644 --- a/src/sound/resid-fp/CMakeLists.txt +++ b/src/sound/resid-fp/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(resid-fp STATIC convolve-sse.cc convolve.cc envelope.cc extfilt.cc diff --git a/src/sound/snd_ad1848.c b/src/sound/snd_ad1848.c index 558024fb5..f9bc337c1 100644 --- a/src/sound/snd_ad1848.c +++ b/src/sound/snd_ad1848.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * TheCollector1995, * RichardG, * diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index ecac7f05a..7d029a169 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * RichardG, * Miran Grca, * diff --git a/src/sound/snd_mpu401.c b/src/sound/snd_mpu401.c index a31c48a7b..328c3c688 100644 --- a/src/sound/snd_mpu401.c +++ b/src/sound/snd_mpu401.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * DOSBox Team, * Miran Grca, * TheCollector1995, diff --git a/src/sound/snd_optimc.c b/src/sound/snd_optimc.c index 7a76d3258..f83161bce 100644 --- a/src/sound/snd_optimc.c +++ b/src/sound/snd_optimc.c @@ -40,7 +40,7 @@ #include <86box/rom.h> static int optimc_wss_dma[4] = { 0, 0, 1, 3 }; -static int optimc_wss_irq[4] = { 7, 9, 10, 11 }; +static int optimc_wss_irq[8] = { 5, 7, 9, 10, 11, 12, 14, 15 }; enum optimc_local_flags { OPTIMC_CS4231 = 0x100, @@ -101,7 +101,7 @@ optimc_wss_write(uint16_t addr, uint8_t val, void *priv) return; optimc->wss_config = val; ad1848_setdma(&optimc->ad1848, optimc_wss_dma[val & 3]); - ad1848_setirq(&optimc->ad1848, optimc_wss_irq[val & 3]); + ad1848_setirq(&optimc->ad1848, optimc_wss_irq[(val >> 3) & 7]); } static void diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 7660ace90..d67701180 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * TheCollector1995, * diff --git a/src/sound/snd_speaker.c b/src/sound/snd_speaker.c index 34d32c110..774e4d650 100644 --- a/src/sound/snd_speaker.c +++ b/src/sound/snd_speaker.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. diff --git a/src/sound/snd_wss.c b/src/sound/snd_wss.c index 8a325e5c3..9e37dd745 100644 --- a/src/sound/snd_wss.c +++ b/src/sound/snd_wss.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * TheCollector1995, * * Copyright 2012-2018 Sarah Walker. diff --git a/src/sound/sound.c b/src/sound/sound.c index cda851137..ecbb7e1a9 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2020 Sarah Walker. @@ -51,7 +51,7 @@ typedef struct { void *priv; } sound_handler_t; -int sound_card_current = 0; +int sound_card_current[SOUND_CARD_MAX] = { 0, 0, 0, 0}; int sound_pos_global = 0; int sound_gain = 0; @@ -79,30 +79,31 @@ static void (*filter_cd_audio)(int channel, double *buffer, void *p) = NULL; static void *filter_cd_audio_p = NULL; static const device_t sound_none_device = { - "None", - "none", - 0, - 0, - NULL, - NULL, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "None", + .internal_name = "none", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; + static const device_t sound_internal_device = { - "Internal", - "internal", - 0, - 0, - NULL, - NULL, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "Internal", + .internal_name = "internal", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; static const SOUND_CARD sound_cards[] = { @@ -115,8 +116,10 @@ static const SOUND_CARD sound_cards[] = { { &adgold_device }, { &azt2316a_device }, { &azt1605_device }, + { &cms_device }, { &cs4235_device }, { &cs4236b_device }, + { &gus_device }, { &sb_1_device }, { &sb_15_device }, { &sb_2_device }, @@ -130,6 +133,7 @@ static const SOUND_CARD sound_cards[] = { { &sb_awe64_value_device }, { &sb_awe64_device }, { &sb_awe64_gold_device }, + { &ssi2001_device }, #if defined(DEV_BRANCH) && defined(USE_PAS16) { &pas16_device }, #endif @@ -214,8 +218,14 @@ sound_card_get_from_internal_name(char *s) void sound_card_init(void) { - if (sound_cards[sound_card_current].device) - device_add(sound_cards[sound_card_current].device); + if (sound_cards[sound_card_current[0]].device) + device_add(sound_cards[sound_card_current[0]].device); + if (sound_cards[sound_card_current[1]].device) + device_add(sound_cards[sound_card_current[1]].device); + if (sound_cards[sound_card_current[2]].device) + device_add(sound_cards[sound_card_current[2]].device); + if (sound_cards[sound_card_current[3]].device) + device_add(sound_cards[sound_card_current[3]].device); } void @@ -511,15 +521,6 @@ sound_card_reset(void) if (mpu401_standalone_enable) mpu401_device_add(); - - if (GUS) - device_add(&gus_device); - - if (GAMEBLASTER) - device_add(&cms_device); - - if (SSI2001) - device_add(&ssi2001_device); } void diff --git a/src/unix/assets/86Box.spec b/src/unix/assets/86Box.spec index 414a38a96..9fac0dde4 100644 --- a/src/unix/assets/86Box.spec +++ b/src/unix/assets/86Box.spec @@ -12,7 +12,7 @@ # After a successful build, you can install the RPMs as follows: # sudo dnf install RPMS/$(uname -m)/86Box-3* RPMS/noarch/86Box-roms* -%global romver v3.7 +%global romver v3.11 Name: 86Box Version: 3.11 diff --git a/src/unix/unix.c b/src/unix/unix.c index 04c9de48b..7916ab044 100644 --- a/src/unix/unix.c +++ b/src/unix/unix.c @@ -624,11 +624,11 @@ ui_msgbox_header(int flags, void *header, void *message) SDL_MessageBoxData msgdata; SDL_MessageBoxButtonData msgbtn; if (!header) - header = (flags & MBX_ANSI) ? "86Box" : L"86Box"; + header = (void *) (flags & MBX_ANSI) ? "86Box" : L"86Box"; if (header <= (void *) 7168) - header = plat_get_string(header); + header = (void *) plat_get_string((int) header); if (message <= (void *) 7168) - message = plat_get_string(message); + message = (void *) plat_get_string((int) message); msgbtn.buttonid = 1; msgbtn.text = "OK"; msgbtn.flags = 0; @@ -1074,7 +1074,7 @@ monitor_thread(void *param) #endif } -extern int gfxcard_2; +extern int gfxcard[2]; int main(int argc, char **argv) { @@ -1089,7 +1089,7 @@ main(int argc, char **argv) return 6; } - gfxcard_2 = 0; + gfxcard[1] = 0; eventthread = SDL_ThreadID(); blitmtx = SDL_CreateMutex(); if (!blitmtx) { diff --git a/src/unix/unix_cdrom.c b/src/unix/unix_cdrom.c index bbeed0149..79a649eb5 100644 --- a/src/unix/unix_cdrom.c +++ b/src/unix/unix_cdrom.c @@ -10,12 +10,12 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. */ #include diff --git a/src/video/CMakeLists.txt b/src/video/CMakeLists.txt index a5ea1059a..b37e81134 100644 --- a/src/video/CMakeLists.txt +++ b/src/video/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # add_library(vid OBJECT agpgart.c video.c vid_table.c vid_cga.c vid_cga_comp.c diff --git a/src/video/agpgart.c b/src/video/agpgart.c index 0a594a8d3..523fcc996 100644 --- a/src/video/agpgart.c +++ b/src/video/agpgart.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * AGP Graphics Address Remapping Table remapping emulation. + * AGP Graphics Address Remapping Table remapping emulation. * * * - * Authors: RichardG, + * Authors: RichardG, * - * Copyright 2021 RichardG. + * Copyright 2021 RichardG. */ #include #include diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index 88dcee020..f7f3ce607 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the 8514/A card from IBM for the MCA bus and - * generic ISA bus clones without vendor extensions. + * Emulation of the 8514/A card from IBM for the MCA bus and + * generic ISA bus clones without vendor extensions. * * * - * Authors: TheCollector1995. + * Authors: TheCollector1995. * - * Copyright 2022 TheCollector1995. + * Copyright 2022 TheCollector1995. */ #include #include diff --git a/src/video/vid_ati18800.c b/src/video/vid_ati18800.c index 2fb58aa5b..3781ef567 100644 --- a/src/video/vid_ati18800.c +++ b/src/video/vid_ati18800.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * ATI 18800 emulation (VGA Edge-16) + * ATI 18800 emulation (VGA Edge-16) * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2020 Sarah Walker. - * Copyright 2016-2020 Miran Grca. + * Copyright 2008-2020 Sarah Walker. + * Copyright 2016-2020 Miran Grca. */ #include #include diff --git a/src/video/vid_ati28800.c b/src/video/vid_ati28800.c index 06b61d41f..352ce2f7d 100644 --- a/src/video/vid_ati28800.c +++ b/src/video/vid_ati28800.c @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * ATI 28800 emulation (VGA Charger and Korean VGA) + * ATI 28800 emulation (VGA Charger and Korean VGA) * * * - * Authors: Sarah Walker, - * Miran Grca, - * greatpsycho, + * Authors: Sarah Walker, + * Miran Grca, + * greatpsycho, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. - * Copyright 2018 greatpsycho. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. + * Copyright 2018 greatpsycho. */ #include #include diff --git a/src/video/vid_ati68860_ramdac.c b/src/video/vid_ati68860_ramdac.c index 1bf74067a..49fad5815 100644 --- a/src/video/vid_ati68860_ramdac.c +++ b/src/video/vid_ati68860_ramdac.c @@ -1,40 +1,40 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * ATI 68860 RAMDAC emulation (for Mach64) + * ATI 68860 RAMDAC emulation (for Mach64) * - * ATI 68860/68880 Truecolor DACs: - * REG08 (R/W): - * bit 0-? Always 2 ?? + * ATI 68860/68880 Truecolor DACs: + * REG08 (R/W): + * bit 0-? Always 2 ?? * - * REG0A (R/W): - * bit 0-? Always 1Dh ?? + * REG0A (R/W): + * bit 0-? Always 1Dh ?? * - * REG0B (R/W): (GMR ?) - * bit 0-7 Mode. 82h: 4bpp, 83h: 8bpp, - * A0h: 15bpp, A1h: 16bpp, C0h: 24bpp, - * E3h: 32bpp (80h for VGA modes ?) + * REG0B (R/W): (GMR ?) + * bit 0-7 Mode. 82h: 4bpp, 83h: 8bpp, + * A0h: 15bpp, A1h: 16bpp, C0h: 24bpp, + * E3h: 32bpp (80h for VGA modes ?) * - * REG0C (R/W): Device Setup Register A - * bit 0 Controls 6/8bit DAC. 0: 8bit DAC/LUT, 1: 6bit DAC/LUT - * 2-3 Depends on Video memory (= VRAM width ?) . - * 1: Less than 1Mb, 2: 1Mb, 3: > 1Mb - * 5-6 Always set ? - * 7 If set can remove "snow" in some cases - * (A860_Delay_L ?) ?? + * REG0C (R/W): Device Setup Register A + * bit 0 Controls 6/8bit DAC. 0: 8bit DAC/LUT, 1: 6bit DAC/LUT + * 2-3 Depends on Video memory (= VRAM width ?) . + * 1: Less than 1Mb, 2: 1Mb, 3: > 1Mb + * 5-6 Always set ? + * 7 If set can remove "snow" in some cases + * (A860_Delay_L ?) ?? * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_ati_eeprom.c b/src/video/vid_ati_eeprom.c index 15696be63..f1840a698 100644 --- a/src/video/vid_ati_eeprom.c +++ b/src/video/vid_ati_eeprom.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the EEPROM on select ATI cards. + * Emulation of the EEPROM on select ATI cards. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2020 Sarah Walker. - * Copyright 2016-2020 Miran Grca. + * Copyright 2008-2020 Sarah Walker. + * Copyright 2016-2020 Miran Grca. */ #include #include diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index c2aa2b6ad..d67ff876b 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * ATi Mach64 graphics card emulation. + * ATi Mach64 graphics card emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_att20c49x_ramdac.c b/src/video/vid_att20c49x_ramdac.c index 81cde31a4..1874afce9 100644 --- a/src/video/vid_att20c49x_ramdac.c +++ b/src/video/vid_att20c49x_ramdac.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of a AT&T 20c490/491 and 492/493 RAMDAC. + * Emulation of a AT&T 20c490/491 and 492/493 RAMDAC. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_att2xc498_ramdac.c b/src/video/vid_att2xc498_ramdac.c index 5983677db..2dab4b903 100644 --- a/src/video/vid_att2xc498_ramdac.c +++ b/src/video/vid_att2xc498_ramdac.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of a AT&T 2xc498 RAMDAC. + * Emulation of a AT&T 2xc498 RAMDAC. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_av9194.c b/src/video/vid_av9194.c index 20d39f247..f8ebc89de 100644 --- a/src/video/vid_av9194.c +++ b/src/video/vid_av9194.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * AV9194 clock generator emulation. + * AV9194 clock generator emulation. * - * Used by the S3 86c801 (V7-Mirage) card. + * Used by the S3 86c801 (V7-Mirage) card. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2016-2018 Miran Grca. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_bt48x_ramdac.c b/src/video/vid_bt48x_ramdac.c index 05ade0cc3..daf840df8 100644 --- a/src/video/vid_bt48x_ramdac.c +++ b/src/video/vid_bt48x_ramdac.c @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Brooktree BT484-485A true colour RAMDAC - * family. + * Emulation of the Brooktree BT484-485A true colour RAMDAC + * family. * * * - * Authors: Miran Grca, - * TheCollector1995, + * Authors: Miran Grca, + * TheCollector1995, * - * Copyright 2016-2018 Miran Grca. - * Copyright 2018 TheCollector1995. + * Copyright 2016-2018 Miran Grca. + * Copyright 2018 TheCollector1995. */ #include #include diff --git a/src/video/vid_cga.c b/src/video/vid_cga.c index 8dba373df..6ed81f616 100644 --- a/src/video/vid_cga.c +++ b/src/video/vid_cga.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the old and new IBM CGA graphics cards. + * Emulation of the old and new IBM CGA graphics cards. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_cga_comp.c b/src/video/vid_cga_comp.c index 077084000..ad9f673fb 100644 --- a/src/video/vid_cga_comp.c +++ b/src/video/vid_cga_comp.c @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * IBM CGA composite filter, borrowed from reenigne's DOSBox - * patch and ported to C. + * IBM CGA composite filter, borrowed from reenigne's DOSBox + * patch and ported to C. * * * - * Authors: reenigne, - * Miran Grca, + * Authors: reenigne, + * Miran Grca, * - * Copyright 2015-2019 reenigne. - * Copyright 2015-2019 Miran Grca. + * Copyright 2015-2019 reenigne. + * Copyright 2015-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index c3fd19e58..d402050c7 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -16,7 +16,7 @@ * TheCollector1995, * * Copyright 2016-2020 Miran Grca. - * Copyright 2020 tonioni. + * Copyright 2020 tonioni. * Copyright 2016-2020 TheCollector1995. */ #include @@ -525,7 +525,7 @@ gd54xx_overlay_draw(svga_t *svga, int displine) uint8_t *src2 = &svga->vram[(svga->ma - (svga->hdisp * bytesperpix)) & svga->vram_display_mask]; int occl, ckval; - p = &((uint32_t *) buffer32->line[displine])[gd54xx->overlay.region1size + svga->x_add]; + p = &((uint32_t *) svga->monitor->target_buffer->line[displine])[gd54xx->overlay.region1size + svga->x_add]; src2 += gd54xx->overlay.region1size * bytesperpix; OVERLAY_SAMPLE(); @@ -1858,16 +1858,16 @@ gd54xx_hwcursor_draw(svga_t *svga, int displine) break; case 1: /* The pixel is shown in the cursor background color */ - ((uint32_t *) buffer32->line[displine])[offset + svga->x_add] = bgcol; + ((uint32_t *) svga->monitor->target_buffer->line[displine])[offset + svga->x_add] = bgcol; break; case 2: /* The pixel is shown as the inverse of the original screen pixel (XOR cursor) */ - ((uint32_t *) buffer32->line[displine])[offset + svga->x_add] ^= 0xffffff; + ((uint32_t *) svga->monitor->target_buffer->line[displine])[offset + svga->x_add] ^= 0xffffff; break; case 3: /* The pixel is shown in the cursor foreground color */ - ((uint32_t *) buffer32->line[displine])[offset + svga->x_add] = fgcol; + ((uint32_t *) svga->monitor->target_buffer->line[displine])[offset + svga->x_add] = fgcol; break; } } @@ -2219,7 +2219,7 @@ gd54xx_readw_linear(uint32_t addr, void *p) temp |= (svga_readb_linear(addr, svga) << 8); if (svga->fast) - cycles -= video_timing_read_w; + cycles -= svga->monitor->mon_video_timing_read_w; return temp; case 3: @@ -2268,7 +2268,7 @@ gd54xx_readl_linear(uint32_t addr, void *p) temp |= (svga_readb_linear(addr + 2, svga) << 24); if (svga->fast) - cycles -= video_timing_read_l; + cycles -= svga->monitor->mon_video_timing_read_l; return temp; case 2: @@ -2278,7 +2278,7 @@ gd54xx_readl_linear(uint32_t addr, void *p) temp |= (svga_readb_linear(addr, svga) << 24); if (svga->fast) - cycles -= video_timing_read_l; + cycles -= svga->monitor->mon_video_timing_read_l; return temp; case 3: @@ -2454,7 +2454,7 @@ gd54xx_writew_linear(uint32_t addr, uint16_t val, void *p) svga_writeb_linear(addr, val >> 8, svga); if (svga->fast) - cycles -= video_timing_write_w; + cycles -= svga->monitor->mon_video_timing_write_w; case 3: return; } @@ -4267,7 +4267,7 @@ gd54xx_force_redraw(void *p) { gd54xx_t *gd54xx = (gd54xx_t *) p; - gd54xx->svga.fullchange = changeframecount; + gd54xx->svga.fullchange = gd54xx->svga.monitor->mon_changeframecount; } // clang-format off diff --git a/src/video/vid_colorplus.c b/src/video/vid_colorplus.c index a343087d4..ae24d8ff0 100644 --- a/src/video/vid_colorplus.c +++ b/src/video/vid_colorplus.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Plantronics ColorPlus emulation. + * Plantronics ColorPlus emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_compaq_cga.c b/src/video/vid_compaq_cga.c index da4006339..68255e746 100644 --- a/src/video/vid_compaq_cga.c +++ b/src/video/vid_compaq_cga.c @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Compaq CGA graphics cards. + * Emulation of the Compaq CGA graphics cards. * * * - * Authors: John Elliott, - * Sarah Walker, - * Miran Grca, + * Authors: John Elliott, + * Sarah Walker, + * Miran Grca, * - * Copyright 2016-2019 John Elliott. - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2016-2019 John Elliott. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_ddc.c b/src/video/vid_ddc.c index b263448fc..f6c4d4dac 100644 --- a/src/video/vid_ddc.c +++ b/src/video/vid_ddc.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * DDC monitor emulation. + * DDC monitor emulation. * * * - * Authors: RichardG, + * Authors: RichardG, * - * Copyright 2020 RichardG. + * Copyright 2020 RichardG. */ #include #include diff --git a/src/video/vid_ega.c b/src/video/vid_ega.c index af1c06335..bfac7d503 100644 --- a/src/video/vid_ega.c +++ b/src/video/vid_ega.c @@ -1,21 +1,21 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the EGA and Chips & Technologies SuperEGA - * graphics cards. + * Emulation of the EGA and Chips & Technologies SuperEGA + * graphics cards. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_ega_render.c b/src/video/vid_ega_render.c index a9699dbf9..b2d5cb5c1 100644 --- a/src/video/vid_ega_render.c +++ b/src/video/vid_ega_render.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * EGA renderers. + * EGA renderers. * * * - * Author: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_et3000.c b/src/video/vid_et3000.c index 1d6288d9c..d107afe5c 100644 --- a/src/video/vid_et3000.c +++ b/src/video/vid_et3000.c @@ -1,16 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Tseng Labs ET3000. + * Emulation of the Tseng Labs ET3000. * - * Authors: Miran Grca, * - * Copyright 2016-2018 Miran Grca. + * + * Authors: Miran Grca, + * + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index 5d0691514..4020c0523 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -13,9 +13,9 @@ * Authors: Fred N. van Kempen, * Miran Grca, * GreatPsycho, - * Sarah Walker, + * Sarah Walker, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2018 Fred N. van Kempen. * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. * diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index eb604f4ea..2f6e6497c 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -12,7 +12,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. diff --git a/src/video/vid_f82c425.c b/src/video/vid_f82c425.c index 3fea0c1bd..15f4ce496 100644 --- a/src/video/vid_f82c425.c +++ b/src/video/vid_f82c425.c @@ -1,36 +1,36 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Chips & Technologies 82C425 display controller emulation, - * with support for 640x200 LCD and SMARTMAP text contrast - * enhancement. + * Chips & Technologies 82C425 display controller emulation, + * with support for 640x200 LCD and SMARTMAP text contrast + * enhancement. * - * Relevant literature: + * Relevant literature: * - * [1] Chips and Technologies, Inc., 82C425 CGA LCD/CRT Controller, - * Data Sheet, Revision No. 2.2, September 1991. - * + * [1] Chips and Technologies, Inc., 82C425 CGA LCD/CRT Controller, + * Data Sheet, Revision No. 2.2, September 1991. + * * - * [2] Pleva et al., COLOR TO MONOCHROME CONVERSION, - * U.S. Patent 4,977,398, Dec. 11, 1990. - * + * [2] Pleva et al., COLOR TO MONOCHROME CONVERSION, + * U.S. Patent 4,977,398, Dec. 11, 1990. + * * - * Based on Toshiba T1000 plasma display emulation code. + * Based on Toshiba T1000 plasma display emulation code. * - * Authors: Fred N. van Kempen, - * Miran Grca, - * Sarah Walker, - * Lubomir Rintel, + * Authors: Fred N. van Kempen, + * Miran Grca, + * Sarah Walker, + * Lubomir Rintel, * - * Copyright 2018,2019 Fred N. van Kempen. - * Copyright 2018,2019 Miran Grca. - * Copyright 2018,2019 Sarah Walker. - * Copyright 2021 Lubomir Rintel. + * Copyright 2018-2019 Fred N. van Kempen. + * Copyright 2018-2019 Miran Grca. + * Copyright 2018-2019 Sarah Walker. + * Copyright 2021 Lubomir Rintel. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/video/vid_genius.c b/src/video/vid_genius.c index 5c13e3415..cbf4eabfe 100644 --- a/src/video/vid_genius.c +++ b/src/video/vid_genius.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * MDSI Genius VHR emulation. + * MDSI Genius VHR emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_hercules.c b/src/video/vid_hercules.c index 550f05338..5920ff27d 100644 --- a/src/video/vid_hercules.c +++ b/src/video/vid_hercules.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Hercules emulation. + * Hercules emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_herculesplus.c b/src/video/vid_herculesplus.c index ea569cd3e..6561f9429 100644 --- a/src/video/vid_herculesplus.c +++ b/src/video/vid_herculesplus.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Hercules Plus emulation. + * Hercules Plus emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index 72d101e2b..255a9e8b8 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Video 7 VGA 1024i emulation. + * Video 7 VGA 1024i emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2019 Sarah Walker. - * Copyright 2019 Miran Grca. + * Copyright 2019 Sarah Walker. + * Copyright 2019 Miran Grca. */ #include #include diff --git a/src/video/vid_ibm_rgb528_ramdac.c b/src/video/vid_ibm_rgb528_ramdac.c index 2f050e7c7..adfc6ea39 100644 --- a/src/video/vid_ibm_rgb528_ramdac.c +++ b/src/video/vid_ibm_rgb528_ramdac.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the IBM RGB 528 true colour RAMDAC. + * Emulation of the IBM RGB 528 true colour RAMDAC. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2020 Miran Grca. + * Copyright 2020 Miran Grca. */ #include #include diff --git a/src/video/vid_icd2061.c b/src/video/vid_icd2061.c index 85740144c..3fafb65d9 100644 --- a/src/video/vid_icd2061.c +++ b/src/video/vid_icd2061.c @@ -1,24 +1,24 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * ICD2061 clock generator emulation. - * Also emulates the ICS9161 which is the same as the ICD2016, - * but without the need for tuning (which is irrelevant in - * emulation anyway). + * ICD2061 clock generator emulation. + * Also emulates the ICS9161 which is the same as the ICD2016, + * but without the need for tuning (which is irrelevant in + * emulation anyway). * - * Used by ET4000w32/p (Diamond Stealth 32) and the S3 - * Vision964 family. + * Used by ET4000w32/p (Diamond Stealth 32) and the S3 + * Vision964 family. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2016-2018 Miran Grca. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_ics2494.c b/src/video/vid_ics2494.c index d3a40cc8b..8bb4b0cb8 100644 --- a/src/video/vid_ics2494.c +++ b/src/video/vid_ics2494.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * ICS2494 clock generator emulation. + * ICS2494 clock generator emulation. * - * Used by the AMI S3 924. + * Used by the AMI S3 924. * * * - * Authors: Miran Grca, + * Authors: Miran Grca, * - * Copyright 2020 Miran Grca. + * Copyright 2020 Miran Grca. */ #include #include diff --git a/src/video/vid_ics2595.c b/src/video/vid_ics2595.c index 77c46b6c3..10fc5ba39 100644 --- a/src/video/vid_ics2595.c +++ b/src/video/vid_ics2595.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * ICS2595 clock chip emulation. Used by ATI Mach64. + * ICS2595 clock chip emulation. Used by ATI Mach64. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_im1024.c b/src/video/vid_im1024.c index 9e08ce583..12d884127 100644 --- a/src/video/vid_im1024.c +++ b/src/video/vid_im1024.c @@ -1,50 +1,50 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the ImageManager 1024 video controller. + * Emulation of the ImageManager 1024 video controller. * - * Just enough of the Vermont Microsystems IM-1024 is implemented - * to support the Windows 1.03 driver. Functions are partially - * implemented or hardwired to the behavior expected by the - * Windows driver. + * Just enough of the Vermont Microsystems IM-1024 is implemented + * to support the Windows 1.03 driver. Functions are partially + * implemented or hardwired to the behavior expected by the + * Windows driver. * - * One major difference seems to be that in hex mode, coordinates - * are passed as 2-byte integer words rather than 4-byte - * fixed-point fractions. + * One major difference seems to be that in hex mode, coordinates + * are passed as 2-byte integer words rather than 4-byte + * fixed-point fractions. * - * It is unknown what triggers this, so for now it's always on. + * It is unknown what triggers this, so for now it's always on. * - * As well as the usual PGC ring buffer at 0xC6000, the IM1024 - * appears to have an alternate method of passing commands. This - * is enabled by setting 0xC6330 to 1, and then: + * As well as the usual PGC ring buffer at 0xC6000, the IM1024 + * appears to have an alternate method of passing commands. This + * is enabled by setting 0xC6330 to 1, and then: * - * CX = count to write - * SI -> bytes to write + * CX = count to write + * SI -> bytes to write * - * Set pending bytes to 0 - * Read [C6331]. This gives number of bytes that can be written: - * 0xFF => 0, 0xFE => 1, 0xFD => 2 etc. - * Write that number of bytes to C6000. - * If there are more to come, go back to reading [C6331]. + * Set pending bytes to 0 + * Read [C6331]. This gives number of bytes that can be written: + * 0xFF => 0, 0xFE => 1, 0xFD => 2 etc. + * Write that number of bytes to C6000. + * If there are more to come, go back to reading [C6331]. * - * As far as can be determined, at least one byte is always - * written; there is no provision to pause if the queue is full. + * As far as can be determined, at least one byte is always + * written; there is no provision to pause if the queue is full. * - * This is implemented by holding a FIFO of unlimited depth in - * the IM1024 to receive the data. + * This is implemented by holding a FIFO of unlimited depth in + * the IM1024 to receive the data. * * * - * Authors: Fred N. van Kempen, - * John Elliott, + * Authors: Fred N. van Kempen, + * John Elliott, * - * Copyright 2019 Fred N. van Kempen. - * Copyright 2019 John Elliott. + * Copyright 2019 Fred N. van Kempen. + * Copyright 2019 John Elliott. */ #include #include diff --git a/src/video/vid_incolor.c b/src/video/vid_incolor.c index 6bf98ab86..68673c061 100644 --- a/src/video/vid_incolor.c +++ b/src/video/vid_incolor.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Hercules InColor emulation. + * Hercules InColor emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_mda.c b/src/video/vid_mda.c index 5ace70058..57e91637c 100644 --- a/src/video/vid_mda.c +++ b/src/video/vid_mda.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * MDA emulation. + * MDA emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index 6da9a7c0f..56dcf9605 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -1,17 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Matrox MGA graphics card emulation. + * Matrox MGA graphics card emulation. * * * - * Author: Sarah Walker, - * Copyright 2008-2020 Sarah Walker. + * Authors: Sarah Walker, + * + * Copyright 2008-2020 Sarah Walker. */ #include #include @@ -847,7 +848,7 @@ mystique_recalctimings(svga_t *svga) mystique_t *mystique = (mystique_t *) svga->p; int clk_sel = (svga->miscout >> 2) & 3; - svga->clock = (cpuclock * (float) (1ull << 32)) / svga->getclock(clk_sel & 2, svga->clock_gen); + svga->clock = (cpuclock * (float) (1ull << 32)) / svga->getclock(clk_sel & 3, svga->clock_gen); if (mystique->crtcext_regs[1] & CRTCX_R1_HTOTAL8) svga->htotal += 0x100; @@ -895,7 +896,9 @@ mystique_recalctimings(svga_t *svga) svga->ma = svga->maback = (svga->maback - (mystique->ma_latch_old << 2)) + (svga->ma_latch << 2); mystique->ma_latch_old = svga->ma_latch; } - + + svga->rowoffset <<= 1; + switch (mystique->xmulctrl & XMULCTRL_DEPTH_MASK) { case XMULCTRL_DEPTH_8: case XMULCTRL_DEPTH_2G8V16: diff --git a/src/video/vid_nga.c b/src/video/vid_nga.c index 86173f198..e2e8fdc9c 100644 --- a/src/video/vid_nga.c +++ b/src/video/vid_nga.c @@ -1,24 +1,24 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the NCR NGA (K511, K201) video cards. + * Emulation of the NCR NGA (K511, K201) video cards. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, - * EngiNerd, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, + * EngiNerd, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. - * Copyright 2017-2019 Fred N. van Kempen. - * Copyright 2020 EngiNerd. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. + * Copyright 2017-2019 Fred N. van Kempen. + * Copyright 2020 EngiNerd. */ #include diff --git a/src/video/vid_oak_oti.c b/src/video/vid_oak_oti.c index 742bbafb0..cc07dc0a4 100644 --- a/src/video/vid_oak_oti.c +++ b/src/video/vid_oak_oti.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Oak OTI037C/67/077 emulation. + * Oak OTI037C/67/077 emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_ogc.c b/src/video/vid_ogc.c index eddc6da8d..38d993216 100644 --- a/src/video/vid_ogc.c +++ b/src/video/vid_ogc.c @@ -1,25 +1,25 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Olivetti OGC 8-bit ISA (GO708) and - * M21/M24/M28 16-bit bus (GO317/318/380/709) video cards. + * Emulation of the Olivetti OGC 8-bit ISA (GO708) and + * M21/M24/M28 16-bit bus (GO317/318/380/709) video cards. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, - * EngiNerd, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, + * EngiNerd, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. - * Copyright 2017-2019 Fred N. van Kempen. - * Copyright 2020 EngiNerd. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. + * Copyright 2017-2019 Fred N. van Kempen. + * Copyright 2020 EngiNerd. */ #include diff --git a/src/video/vid_paradise.c b/src/video/vid_paradise.c index 3d82d459a..f2ec8aeb2 100644 --- a/src/video/vid_paradise.c +++ b/src/video/vid_paradise.c @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Paradise VGA emulation - * PC2086, PC3086 use PVGA1A - * MegaPC uses W90C11A + * Paradise VGA emulation + * PC2086, PC3086 use PVGA1A + * MegaPC uses W90C11A * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_pgc.c b/src/video/vid_pgc.c index eb28540fc..74a20145c 100644 --- a/src/video/vid_pgc.c +++ b/src/video/vid_pgc.c @@ -1,56 +1,56 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * This implements just enough of the Professional Graphics - * Controller to act as a basis for the Vermont Microsystems - * IM-1024. + * This implements just enough of the Professional Graphics + * Controller to act as a basis for the Vermont Microsystems + * IM-1024. * - * PGC features implemented include: - * > The CGA-compatible display modes - * > Switching to and from native mode - * > Communicating with the host PC + * PGC features implemented include: + * > The CGA-compatible display modes + * > Switching to and from native mode + * > Communicating with the host PC * - * Numerous features are implemented partially or not at all, - * such as: - * > 2D drawing - * > 3D drawing - * > Command lists - * Some of these are marked TODO. + * Numerous features are implemented partially or not at all, + * such as: + * > 2D drawing + * > 3D drawing + * > Command lists + * Some of these are marked TODO. * - * The PGC has two display modes: CGA (in which it appears in - * the normal CGA memory and I/O ranges) and native (in which - * all functions are accessed through reads and writes to 1K - * of memory at 0xC6000). + * The PGC has two display modes: CGA (in which it appears in + * the normal CGA memory and I/O ranges) and native (in which + * all functions are accessed through reads and writes to 1K + * of memory at 0xC6000). * - * The PGC's 8088 processor monitors this buffer and executes - * instructions left there for it. We simulate this behavior - * with a separate thread. + * The PGC's 8088 processor monitors this buffer and executes + * instructions left there for it. We simulate this behavior + * with a separate thread. * - * **NOTE** This driver is not finished yet: + * **NOTE** This driver is not finished yet: * - * - cursor will blink at very high speed if used on a machine - * with clock greater than 4.77MHz. We should "scale down" - * this speed, to become relative to a 4.77MHz-based system. + * - cursor will blink at very high speed if used on a machine + * with clock greater than 4.77MHz. We should "scale down" + * this speed, to become relative to a 4.77MHz-based system. * - * - pgc_plot() should be overloaded by clones if they support - * modes other than WRITE and INVERT, like the IM-1024. + * - pgc_plot() should be overloaded by clones if they support + * modes other than WRITE and INVERT, like the IM-1024. * - * - test it with the Windows 1.x driver? + * - test it with the Windows 1.x driver? * - * This is expected to be done shortly. + * This is expected to be done shortly. * * * - * Authors: Fred N. van Kempen, - * John Elliott, + * Authors: Fred N. van Kempen, + * John Elliott, * - * Copyright 2019 Fred N. van Kempen. - * Copyright 2019 John Elliott. + * Copyright 2019 Fred N. van Kempen. + * Copyright 2019 John Elliott. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/video/vid_rtg310x.c b/src/video/vid_rtg310x.c index 10f97cf4f..6f317426b 100644 --- a/src/video/vid_rtg310x.c +++ b/src/video/vid_rtg310x.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Realtek RTG series of VGA ISA chips. + * Emulation of the Realtek RTG series of VGA ISA chips. * * * - * Authors: TheCollector1995, + * Authors: TheCollector1995, * - * Copyright 2021 TheCollector1995. + * Copyright 2021 TheCollector1995. */ #include #include diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index b17f0e50b..c3eaa36a8 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. @@ -1776,7 +1776,7 @@ s3_accel_write_fifo_l(s3_t *s3, uint32_t addr, uint32_t val) case 0x8180: s3->streams.pri_ctrl = val; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x8184: s3->streams.chroma_ctrl = val; @@ -1806,37 +1806,37 @@ s3_accel_write_fifo_l(s3_t *s3, uint32_t addr, uint32_t val) case 0x81c0: s3->streams.pri_fb0 = val & 0x3fffff; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81c4: s3->streams.pri_fb1 = val & 0x3fffff; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81c8: s3->streams.pri_stride = val & 0xfff; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81cc: s3->streams.buffer_ctrl = val; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81d0: s3->streams.sec_fb0 = val; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81d4: s3->streams.sec_fb1 = val; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81d8: s3->streams.sec_stride = val; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81dc: s3->streams.overlay_ctrl = val; @@ -1864,28 +1864,28 @@ s3_accel_write_fifo_l(s3_t *s3, uint32_t addr, uint32_t val) s3->streams.pri_x = (val >> 16) & 0x7ff; s3->streams.pri_y = val & 0x7ff; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81f4: s3->streams.pri_size = val; s3->streams.pri_w = (val >> 16) & 0x7ff; s3->streams.pri_h = val & 0x7ff; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81f8: s3->streams.sec_start = val; s3->streams.sec_x = (val >> 16) & 0x7ff; s3->streams.sec_y = val & 0x7ff; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x81fc: s3->streams.sec_size = val; s3->streams.sec_w = (val >> 16) & 0x7ff; s3->streams.sec_h = val & 0x7ff; svga_recalctimings(svga); - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; break; case 0x8504: @@ -2891,7 +2891,7 @@ s3_out(uint16_t addr, uint8_t val, void *p) if ((((svga->crtc[0x67] & 0xc) != 0xc) && (s3->chip >= S3_TRIO64V)) || (s3->chip < S3_TRIO64V)) svga->ma_latch |= (s3->ma_ext << 16); } else { - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; svga_recalctimings(svga); } } @@ -3626,10 +3626,10 @@ s3_accel_out(uint16_t port, uint8_t val, void *p) s3->accel.advfunc_cntl = val; if ((s3->chip > S3_86C805) && ((svga->crtc[0x50] & 0xc1) == 0x80)) { s3->width = (val & 4) ? 1600 : 800; - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; svga_recalctimings(svga); } else if (s3->chip <= S3_86C805) { - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; svga_recalctimings(svga); } if (s3->chip > S3_86C924) @@ -5653,16 +5653,16 @@ polygon_setup(s3_t *s3) #define WRITE(addr, dat) \ if (s3->bpp == 0 && !s3->color_16bit) { \ svga->vram[dword_remap(svga, addr) & s3->vram_mask] = dat; \ - svga->changedvram[(dword_remap(svga, addr) & s3->vram_mask) >> 12] = changeframecount; \ + svga->changedvram[(dword_remap(svga, addr) & s3->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ } else if (s3->bpp == 1 || s3->color_16bit) { \ vram_w[dword_remap_w(svga, addr) & (s3->vram_mask >> 1)] = dat; \ - svga->changedvram[(dword_remap_w(svga, addr) & (s3->vram_mask >> 1)) >> 11] = changeframecount; \ + svga->changedvram[(dword_remap_w(svga, addr) & (s3->vram_mask >> 1)) >> 11] = svga->monitor->mon_changeframecount; \ } else if (s3->bpp == 2) { \ svga->vram[dword_remap(svga, addr) & s3->vram_mask] = dat; \ - svga->changedvram[(dword_remap(svga, addr) & s3->vram_mask) >> 12] = changeframecount; \ + svga->changedvram[(dword_remap(svga, addr) & s3->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ } else { \ vram_l[dword_remap_l(svga, addr) & (s3->vram_mask >> 2)] = dat; \ - svga->changedvram[(dword_remap_l(svga, addr) & (s3->vram_mask >> 2)) >> 10] = changeframecount; \ + svga->changedvram[(dword_remap_l(svga, addr) & (s3->vram_mask >> 2)) >> 10] = svga->monitor->mon_changeframecount; \ } static __inline void @@ -8554,7 +8554,7 @@ s3_force_redraw(void *p) { s3_t *s3 = (s3_t *) p; - s3->svga.fullchange = changeframecount; + s3->svga.fullchange = s3->svga.monitor->mon_changeframecount; } static const device_config_t s3_orchid_86c911_config[] = { diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index 99661d309..376abb68c 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * S3 ViRGE emulation. + * S3 ViRGE emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_sc1148x_ramdac.c b/src/video/vid_sc1148x_ramdac.c index 936ff308d..873f66e92 100644 --- a/src/video/vid_sc1148x_ramdac.c +++ b/src/video/vid_sc1148x_ramdac.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of Sierra SC1148x RAMDACs and clones (e.g.: Winbond). + * Emulation of Sierra SC1148x RAMDACs and clones (e.g.: Winbond). * - * Used by the S3 911 and 924 chips. + * Used by the S3 911 and 924 chips. * * * - * Authors: TheCollector1995, + * Authors: TheCollector1995, * - * Copyright 2020 TheCollector1995. + * Copyright 2020 TheCollector1995. */ #include #include diff --git a/src/video/vid_sc1502x_ramdac.c b/src/video/vid_sc1502x_ramdac.c index 202091449..3a3b3a863 100644 --- a/src/video/vid_sc1502x_ramdac.c +++ b/src/video/vid_sc1502x_ramdac.c @@ -1,22 +1,22 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of a Sierra SC1502X RAMDAC. + * Emulation of a Sierra SC1502X RAMDAC. * - * Used by the TLIVESA1 driver for ET4000. + * Used by the TLIVESA1 driver for ET4000. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_sdac_ramdac.c b/src/video/vid_sdac_ramdac.c index 58d6b164c..45fe714ec 100644 --- a/src/video/vid_sdac_ramdac.c +++ b/src/video/vid_sdac_ramdac.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 87C716 'SDAC' true colour RAMDAC emulation. + * 87C716 'SDAC' true colour RAMDAC emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_sigma.c b/src/video/vid_sigma.c index d8fa55ce3..0e1833b1e 100644 --- a/src/video/vid_sigma.c +++ b/src/video/vid_sigma.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Sigma Color 400 emulation. + * Sigma Color 400 emulation. * * * - * Authors: John Elliott, + * Authors: John Elliott, * - * Copyright 2018 John Elliott. + * Copyright 2018 John Elliott. */ #include #include diff --git a/src/video/vid_stg_ramdac.c b/src/video/vid_stg_ramdac.c index 161cf1177..78a477acb 100644 --- a/src/video/vid_stg_ramdac.c +++ b/src/video/vid_stg_ramdac.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * STG1702 true colour RAMDAC emulation. + * STG1702 true colour RAMDAC emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 21d0b50ee..704c6f612 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -13,7 +13,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. @@ -84,24 +84,24 @@ void svga_set_override(svga_t *svga, int val) { if (svga->override && !val) - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; svga->override = val; if (!val) { /* Override turned off, restore overscan X and Y per the CRTC. */ if (enable_overscan) { - overscan_y = (svga->rowcount + 1) << 1; + svga->monitor->mon_overscan_y = (svga->rowcount + 1) << 1; - if (overscan_y < 16) - overscan_y = 16; + if (svga->monitor->mon_overscan_y < 16) + svga->monitor->mon_overscan_y = 16; } - overscan_x = (svga->seqregs[1] & 1) ? 16 : 18; + svga->monitor->mon_overscan_x = (svga->seqregs[1] & 1) ? 16 : 18; if (svga->seqregs[1] & 8) - overscan_x <<= 1; + svga->monitor->mon_overscan_x <<= 1; } else - overscan_x = overscan_y = 16; + svga->monitor->mon_overscan_x = svga->monitor->mon_overscan_y = 16; /* Override turned off, fix overcan X and Y to 16. */ } @@ -124,11 +124,11 @@ svga_out(uint16_t addr, uint8_t val, void *p) } } else { if ((svga->attraddr == 0x13) && (svga->attrregs[0x13] != val)) - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; o = svga->attrregs[svga->attraddr & 31]; svga->attrregs[svga->attraddr & 31] = val; if (svga->attraddr < 16) - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; if (svga->attraddr == 0x10 || svga->attraddr == 0x14 || svga->attraddr < 0x10) { for (c = 0; c < 16; c++) { if (svga->attrregs[0x10] & 0x80) { @@ -137,7 +137,7 @@ svga_out(uint16_t addr, uint8_t val, void *p) svga->egapal[c] = (svga->attrregs[c] & 0x3f) | ((svga->attrregs[0x14] & 0xc) << 4); } } - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; } /* Recalculate timings on change of attribute register 0x11 (overscan border color) too. */ @@ -150,7 +150,7 @@ svga_out(uint16_t addr, uint8_t val, void *p) svga_recalctimings(svga); } else if (svga->attraddr == 0x12) { if ((val & 0xf) != svga->plane_mask) - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; svga->plane_mask = val & 0xf; } } @@ -211,7 +211,7 @@ svga_out(uint16_t addr, uint8_t val, void *p) case 0x3c9: if (svga->adv_flags & FLAG_RAMDAC_SHIFT) val <<= 2; - svga->fullchange = changeframecount; + svga->fullchange = svga->monitor->mon_changeframecount; switch (svga->dac_pos) { case 0: svga->dac_r = val; @@ -455,7 +455,8 @@ svga_recalctimings(svga_t *svga) svga->hdisp++; svga->htotal = svga->crtc[0]; - svga->htotal += 6; /*+6 is required for Tyrian*/ + /* +5 has been verified by Sergi to be correct - +6 must have been an off by one error. */ + svga->htotal += 5; /*+6 is required for Tyrian*/ svga->rowoffset = svga->crtc[0x13]; @@ -552,19 +553,19 @@ svga_recalctimings(svga_t *svga) svga->char_width = (svga->seqregs[1] & 1) ? 8 : 9; if (enable_overscan) { - overscan_y = (svga->rowcount + 1) << 1; + svga->monitor->mon_overscan_y = (svga->rowcount + 1) << 1; - if (overscan_y < 16) - overscan_y = 16; + if (svga->monitor->mon_overscan_y < 16) + svga->monitor->mon_overscan_y = 16; } if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) { - overscan_x = (svga->seqregs[1] & 1) ? 16 : 18; + svga->monitor->mon_overscan_x = (svga->seqregs[1] & 1) ? 16 : 18; if (svga->seqregs[1] & 8) - overscan_x <<= 1; + svga->monitor->mon_overscan_x <<= 1; } else - overscan_x = 16; + svga->monitor->mon_overscan_x = 16; if (vga_on) { if (svga->recalctimings_ex) { @@ -577,8 +578,8 @@ svga_recalctimings(svga_t *svga) xga_recalctimings(svga); } - svga->y_add = (overscan_y >> 1) - (svga->crtc[8] & 0x1f); - svga->x_add = (overscan_x >> 1); + svga->y_add = (svga->monitor->mon_overscan_y >> 1) - (svga->crtc[8] & 0x1f); + svga->x_add = (svga->monitor->mon_overscan_x >> 1); if (svga->vblankstart < svga->dispend) svga->dispend = svga->vblankstart; @@ -631,10 +632,10 @@ svga_do_render(svga_t *svga) if (!svga->override) { svga->render(svga); - svga->x_add = (overscan_x >> 1); + svga->x_add = (svga->monitor->mon_overscan_x >> 1); svga_render_overscan_left(svga); svga_render_overscan_right(svga); - svga->x_add = (overscan_x >> 1) - svga->scrollcache; + svga->x_add = (svga->monitor->mon_overscan_x >> 1) - svga->scrollcache; } if (svga->overlay_on) { @@ -719,7 +720,7 @@ svga_poll(void *p) svga->ma &= svga->vram_display_mask; if (svga->firstline == 2000) { svga->firstline = svga->displine; - video_wait_for_buffer(); + video_wait_for_buffer_monitor(svga->monitor_index); } if (svga->hwcursor_on || svga->dac_hwcursor_on || svga->overlay_on) { @@ -813,7 +814,7 @@ svga_poll(void *p) svga->sc = 0; if (svga->attrregs[0x10] & 0x20) { svga->scrollcache = 0; - svga->x_add = (overscan_x >> 1); + svga->x_add = (svga->monitor->mon_overscan_x >> 1); } } } @@ -870,7 +871,7 @@ svga_poll(void *p) svga->oddeven ^= 1; - changeframecount = svga->interlace ? 3 : 2; + svga->monitor->mon_changeframecount = svga->interlace ? 3 : 2; svga->vslines = 0; if (svga->interlace && svga->oddeven) @@ -909,7 +910,7 @@ svga_poll(void *p) if ((svga->seqregs[1] & 8) || (svga->render == svga_render_8bpp_lowres)) svga->scrollcache <<= 1; - svga->x_add = (overscan_x >> 1) - svga->scrollcache; + svga->x_add = (svga->monitor->mon_overscan_x >> 1) - svga->scrollcache; svga->linecountff = 0; @@ -938,6 +939,8 @@ svga_init(const device_t *info, svga_t *svga, void *p, int memsize, int c, d, e; svga->p = p; + svga->monitor_index = monitor_index_global; + svga->monitor = &monitors[svga->monitor_index]; for (c = 0; c < 256; c++) { e = c; @@ -951,8 +954,8 @@ svga_init(const device_t *info, svga_t *svga, void *p, int memsize, svga->attrregs[0x11] = 0; svga->overscan_color = 0x000000; - overscan_x = 16; - overscan_y = 32; + svga->monitor->mon_overscan_x = 16; + svga->monitor->mon_overscan_y = 32; svga->x_add = 8; svga->y_add = 16; @@ -1075,7 +1078,7 @@ svga_write_common(uint32_t addr, uint8_t val, uint8_t linear, void *p) if (svga->adv_flags & FLAG_ADDR_BY8) writemask2 = svga->seqregs[2]; - cycles -= video_timing_write_b; + cycles -= svga->monitor->mon_video_timing_write_b; if (!linear) { if (xga_enabled) { @@ -1136,7 +1139,7 @@ svga_write_common(uint32_t addr, uint8_t val, uint8_t linear, void *p) addr &= svga->vram_mask; - svga->changedvram[addr >> 12] = changeframecount; + svga->changedvram[addr >> 12] = svga->monitor->mon_changeframecount; count = 4; if (svga->adv_flags & FLAG_LATCH8) @@ -1276,7 +1279,7 @@ svga_read_common(uint32_t addr, uint8_t linear, void *p) if (svga->adv_flags & FLAG_ADDR_BY8) readplane = svga->gdcreg[4] & 7; - cycles -= video_timing_read_b; + cycles -= svga->monitor->mon_video_timing_read_b; if (!linear) { if (xga_enabled) { @@ -1405,11 +1408,11 @@ svga_doblit(int wx, int wy, svga_t *svga) int i, j; int xs_temp, ys_temp; - y_add = (enable_overscan) ? overscan_y : 0; - x_add = (enable_overscan) ? overscan_x : 0; - y_start = (enable_overscan) ? 0 : (overscan_y >> 1); - x_start = (enable_overscan) ? 0 : (overscan_x >> 1); - bottom = (overscan_y >> 1) + (svga->crtc[8] & 0x1f); + y_add = (enable_overscan) ? svga->monitor->mon_overscan_y : 0; + x_add = (enable_overscan) ? svga->monitor->mon_overscan_x : 0; + y_start = (enable_overscan) ? 0 : (svga->monitor->mon_overscan_y >> 1); + x_start = (enable_overscan) ? 0 : (svga->monitor->mon_overscan_x >> 1); + bottom = (svga->monitor->mon_overscan_y >> 1) + (svga->crtc[8] & 0x1f); if (svga->vertical_linedbl) { y_add <<= 1; @@ -1432,12 +1435,12 @@ svga_doblit(int wx, int wy, svga_t *svga) if (ys_temp < 32) ys_temp = 200; - if ((svga->crtc[0x17] & 0x80) && ((xs_temp != xsize) || (ys_temp != ysize) || video_force_resize_get())) { + if ((svga->crtc[0x17] & 0x80) && ((xs_temp != svga->monitor->mon_xsize) || (ys_temp != svga->monitor->mon_ysize) || video_force_resize_get_monitor(svga->monitor_index))) { /* Screen res has changed.. fix up, and let them know. */ - xsize = xs_temp; - ysize = ys_temp; + svga->monitor->mon_xsize = xs_temp; + svga->monitor->mon_ysize = ys_temp; - if ((xsize > 1984) || (ysize > 2016)) { + if ((svga->monitor->mon_xsize > 1984) || (svga->monitor->mon_ysize > 2016)) { /* 2048x2048 is the biggest safe render texture, to account for overscan, we suppress overscan starting from x 1984 and y 2016. */ x_add = 0; @@ -1449,30 +1452,30 @@ svga_doblit(int wx, int wy, svga_t *svga) /* Block resolution changes while in DPMS mode to avoid getting a bogus screen width (320). We're already rendering a blank screen anyway. */ if (!svga->dpms) - set_screen_size(xsize + x_add, ysize + y_add); + set_screen_size_monitor(svga->monitor->mon_xsize + x_add, svga->monitor->mon_ysize + y_add, svga->monitor_index); - if (video_force_resize_get()) - video_force_resize_set(0); + if (video_force_resize_get_monitor(svga->monitor_index)) + video_force_resize_set_monitor(0, svga->monitor_index); } if ((wx >= 160) && ((wy + 1) >= 120)) { /* Draw (overscan_size - scroll size) lines of overscan on top and bottom. */ for (i = 0; i < svga->y_add; i++) { - p = &buffer32->line[i & 0x7ff][0]; + p = &svga->monitor->target_buffer->line[i & 0x7ff][0]; - for (j = 0; j < (xsize + x_add); j++) + for (j = 0; j < (svga->monitor->mon_xsize + x_add); j++) p[j] = svga->overscan_color; } for (i = 0; i < bottom; i++) { - p = &buffer32->line[(ysize + svga->y_add + i) & 0x7ff][0]; + p = &svga->monitor->target_buffer->line[(svga->monitor->mon_ysize + svga->y_add + i) & 0x7ff][0]; - for (j = 0; j < (xsize + x_add); j++) + for (j = 0; j < (svga->monitor->mon_xsize + x_add); j++) p[j] = svga->overscan_color; } } - video_blit_memtoscreen(x_start, y_start, xsize + x_add, ysize + y_add); + video_blit_memtoscreen_monitor(x_start, y_start, svga->monitor->mon_xsize + x_add, svga->monitor->mon_ysize + y_add, svga->monitor_index); if (svga->vertical_linedbl) svga->vertical_linedbl >>= 1; @@ -1492,7 +1495,7 @@ svga_writeb_linear(uint32_t addr, uint8_t val, void *p) if (addr >= svga->vram_max) return; addr &= svga->vram_mask; - svga->changedvram[addr >> 12] = changeframecount; + svga->changedvram[addr >> 12] = svga->monitor->mon_changeframecount; *(uint8_t *) &svga->vram[addr] = val; } @@ -1507,7 +1510,7 @@ svga_writew_common(uint32_t addr, uint16_t val, uint8_t linear, void *p) return; } - cycles -= video_timing_write_w; + cycles -= svga->monitor->mon_video_timing_write_w; if (!linear) { addr = svga_decode_addr(svga, addr, 1); @@ -1521,12 +1524,12 @@ svga_writew_common(uint32_t addr, uint16_t val, uint8_t linear, void *p) uint32_t addr2 = svga->translate_address(addr, p); if (addr2 < svga->vram_max) { svga->vram[addr2 & svga->vram_mask] = val & 0xff; - svga->changedvram[addr2 >> 12] = changeframecount; + svga->changedvram[addr2 >> 12] = svga->monitor->mon_changeframecount; } addr2 = svga->translate_address(addr + 1, p); if (addr2 < svga->vram_max) { svga->vram[addr2 & svga->vram_mask] = (val >> 8) & 0xff; - svga->changedvram[addr2 >> 12] = changeframecount; + svga->changedvram[addr2 >> 12] = svga->monitor->mon_changeframecount; } return; } @@ -1534,7 +1537,7 @@ svga_writew_common(uint32_t addr, uint16_t val, uint8_t linear, void *p) return; addr &= svga->vram_mask; - svga->changedvram[addr >> 12] = changeframecount; + svga->changedvram[addr >> 12] = svga->monitor->mon_changeframecount; *(uint16_t *) &svga->vram[addr] = val; } @@ -1563,7 +1566,7 @@ svga_writel_common(uint32_t addr, uint32_t val, uint8_t linear, void *p) return; } - cycles -= video_timing_write_l; + cycles -= svga->monitor->mon_video_timing_write_l; if (!linear) { addr = svga_decode_addr(svga, addr, 1); @@ -1577,22 +1580,22 @@ svga_writel_common(uint32_t addr, uint32_t val, uint8_t linear, void *p) uint32_t addr2 = svga->translate_address(addr, p); if (addr2 < svga->vram_max) { svga->vram[addr2 & svga->vram_mask] = val & 0xff; - svga->changedvram[addr2 >> 12] = changeframecount; + svga->changedvram[addr2 >> 12] = svga->monitor->mon_changeframecount; } addr2 = svga->translate_address(addr + 1, p); if (addr2 < svga->vram_max) { svga->vram[addr2 & svga->vram_mask] = (val >> 8) & 0xff; - svga->changedvram[addr2 >> 12] = changeframecount; + svga->changedvram[addr2 >> 12] = svga->monitor->mon_changeframecount; } addr2 = svga->translate_address(addr + 2, p); if (addr2 < svga->vram_max) { svga->vram[addr2 & svga->vram_mask] = (val >> 16) & 0xff; - svga->changedvram[addr2 >> 12] = changeframecount; + svga->changedvram[addr2 >> 12] = svga->monitor->mon_changeframecount; } addr2 = svga->translate_address(addr + 3, p); if (addr2 < svga->vram_max) { svga->vram[addr2 & svga->vram_mask] = (val >> 24) & 0xff; - svga->changedvram[addr2 >> 12] = changeframecount; + svga->changedvram[addr2 >> 12] = svga->monitor->mon_changeframecount; } return; } @@ -1600,7 +1603,7 @@ svga_writel_common(uint32_t addr, uint32_t val, uint8_t linear, void *p) return; addr &= svga->vram_mask; - svga->changedvram[addr >> 12] = changeframecount; + svga->changedvram[addr >> 12] = svga->monitor->mon_changeframecount; *(uint32_t *) &svga->vram[addr] = val; } @@ -1639,7 +1642,7 @@ svga_readw_common(uint32_t addr, uint8_t linear, void *p) if (!svga->fast) return svga_read_common(addr, linear, p) | (svga_read_common(addr + 1, linear, p) << 8); - cycles -= video_timing_read_w; + cycles -= svga->monitor->mon_video_timing_read_w; if (!linear) { addr = svga_decode_addr(svga, addr, 0); @@ -1686,7 +1689,7 @@ svga_readl_common(uint32_t addr, uint8_t linear, void *p) return svga_read_common(addr, linear, p) | (svga_read_common(addr + 1, linear, p) << 8) | (svga_read_common(addr + 2, linear, p) << 16) | (svga_read_common(addr + 3, linear, p) << 24); } - cycles -= video_timing_read_l; + cycles -= svga->monitor->mon_video_timing_read_l; if (!linear) { addr = svga_decode_addr(svga, addr, 0); diff --git a/src/video/vid_svga_render.c b/src/video/vid_svga_render.c index c67a46e0d..81621681f 100644 --- a/src/video/vid_svga_render.c +++ b/src/video/vid_svga_render.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * SVGA renderers. + * SVGA renderers. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include @@ -67,7 +67,7 @@ svga_render_blank(svga_t *svga) break; } - uint32_t *line_ptr = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + uint32_t *line_ptr = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; uint32_t line_width = (uint32_t) (svga->hdisp + svga->scrollcache) * char_width * sizeof(uint32_t); memset(line_ptr, 0, line_width); } @@ -83,7 +83,7 @@ svga_render_overscan_left(svga_t *svga) if (svga->scrblank || (svga->hdisp == 0)) return; - uint32_t *line_ptr = buffer32->line[svga->displine + svga->y_add]; + uint32_t *line_ptr = svga->monitor->target_buffer->line[svga->displine + svga->y_add]; for (i = 0; i < svga->x_add; i++) *line_ptr++ = svga->overscan_color; } @@ -99,7 +99,7 @@ svga_render_overscan_right(svga_t *svga) if (svga->scrblank || (svga->hdisp == 0)) return; - uint32_t *line_ptr = &buffer32->line[svga->displine + svga->y_add][svga->x_add + svga->hdisp]; + uint32_t *line_ptr = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add + svga->hdisp]; right = (overscan_x >> 1); for (i = 0; i < right; i++) *line_ptr++ = svga->overscan_color; @@ -124,7 +124,7 @@ svga_render_text_40(svga_t *svga) svga->lastline_draw = svga->displine; if (svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; xinc = (svga->seqregs[1] & 1) ? 16 : 18; for (x = 0; x < (svga->hdisp + svga->scrollcache); x += xinc) { @@ -198,7 +198,7 @@ svga_render_text_80(svga_t *svga) svga->lastline_draw = svga->displine; if (svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; xinc = (svga->seqregs[1] & 1) ? 8 : 9; for (x = 0; x < (svga->hdisp + svga->scrollcache); x += xinc) { @@ -271,7 +271,7 @@ svga_render_text_80_ksc5601(svga_t *svga) svga->lastline_draw = svga->displine; if (svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; xinc = (svga->seqregs[1] & 1) ? 8 : 9; @@ -394,7 +394,7 @@ svga_render_2bpp_lowres(svga_t *svga) changed_offset = ((svga->ma << 1) + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12; if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -442,7 +442,7 @@ svga_render_2bpp_lowres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -491,7 +491,7 @@ svga_render_2bpp_highres(svga_t *svga) changed_offset = ((svga->ma << 1) + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12; if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -539,7 +539,7 @@ svga_render_2bpp_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -588,7 +588,7 @@ svga_render_2bpp_headland_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -641,7 +641,7 @@ svga_render_4bpp_lowres(svga_t *svga) if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -701,7 +701,7 @@ svga_render_4bpp_lowres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -759,7 +759,7 @@ svga_render_4bpp_highres(svga_t *svga) changed_offset = (svga->ma + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12; if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -819,7 +819,7 @@ svga_render_4bpp_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -874,7 +874,7 @@ svga_render_8bpp_lowres(svga_t *svga) if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -897,7 +897,7 @@ svga_render_8bpp_lowres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -946,7 +946,7 @@ svga_render_8bpp_highres(svga_t *svga) if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -974,7 +974,7 @@ svga_render_8bpp_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1026,7 +1026,7 @@ svga_render_8bpp_tseng_lowres(svga_t *svga) return; if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1068,7 +1068,7 @@ svga_render_8bpp_tseng_highres(svga_t *svga) return; if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1129,7 +1129,7 @@ svga_render_15bpp_lowres(svga_t *svga) if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1153,7 +1153,7 @@ svga_render_15bpp_lowres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1200,7 +1200,7 @@ svga_render_15bpp_highres(svga_t *svga) if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1230,7 +1230,7 @@ svga_render_15bpp_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1281,7 +1281,7 @@ svga_render_15bpp_mix_lowres(svga_t *svga) return; if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1316,7 +1316,7 @@ svga_render_15bpp_mix_highres(svga_t *svga) return; if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1361,7 +1361,7 @@ svga_render_16bpp_lowres(svga_t *svga) if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1383,7 +1383,7 @@ svga_render_16bpp_lowres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1430,7 +1430,7 @@ svga_render_16bpp_highres(svga_t *svga) if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1460,7 +1460,7 @@ svga_render_16bpp_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1526,14 +1526,14 @@ svga_render_24bpp_lowres(svga_t *svga) fg = svga->vram[svga->ma] | (svga->vram[svga->ma + 1] << 8) | (svga->vram[svga->ma + 2] << 16); svga->ma += 3; svga->ma &= svga->vram_display_mask; - buffer32->line[svga->displine + svga->y_add][(x << 1) + svga->x_add] = buffer32->line[svga->displine + svga->y_add][(x << 1) + 1 + svga->x_add] = fg; + svga->monitor->target_buffer->line[svga->displine + svga->y_add][(x << 1) + svga->x_add] = svga->monitor->target_buffer->line[svga->displine + svga->y_add][(x << 1) + 1 + svga->x_add] = fg; } } } else { changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1588,7 +1588,7 @@ svga_render_24bpp_highres(svga_t *svga) if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1615,7 +1615,7 @@ svga_render_24bpp_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1677,14 +1677,14 @@ svga_render_32bpp_lowres(svga_t *svga) dat = svga->vram[svga->ma] | (svga->vram[svga->ma + 1] << 8) | (svga->vram[svga->ma + 2] << 16); svga->ma += 4; svga->ma &= svga->vram_display_mask; - buffer32->line[svga->displine + svga->y_add][(x << 1) + svga->x_add] = buffer32->line[svga->displine + svga->y_add][(x << 1) + 1 + svga->x_add] = dat; + svga->monitor->target_buffer->line[svga->displine + svga->y_add][(x << 1) + svga->x_add] = svga->monitor->target_buffer->line[svga->displine + svga->y_add][(x << 1) + 1 + svga->x_add] = dat; } } } else { changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1724,7 +1724,7 @@ svga_render_32bpp_highres(svga_t *svga) if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->changedvram[(svga->ma >> 12) + 2] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1741,7 +1741,7 @@ svga_render_32bpp_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1781,7 +1781,7 @@ svga_render_ABGR8888_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; @@ -1820,7 +1820,7 @@ svga_render_RGBA8888_highres(svga_t *svga) changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add]; if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; diff --git a/src/video/vid_table.c b/src/video/vid_table.c index ab2eb5c96..fb6624ced 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -163,10 +163,10 @@ video_cards[] = { { &et4000w32p_pci_device }, { &gd5430_pci_device, }, { &gd5434_pci_device }, - { &gd5436_pci_device }, + { &gd5436_pci_device, VIDEO_FLAG_TYPE_SPECIAL }, { &gd5440_pci_device }, - { &gd5446_pci_device }, - { &gd5446_stb_pci_device }, + { &gd5446_pci_device, VIDEO_FLAG_TYPE_SPECIAL }, + { &gd5446_stb_pci_device,VIDEO_FLAG_TYPE_SPECIAL }, { &gd5480_pci_device }, { &s3_spea_mercury_lite_86c928_pci_device }, { &s3_diamond_stealth64_964_pci_device }, @@ -331,7 +331,7 @@ video_reset(int card) if ((video_get_type() != VIDEO_FLAG_TYPE_NONE) && was_reset) return; - vid_table_log("VIDEO: reset (gfxcard=%d, internal=%d)\n", + vid_table_log("VIDEO: reset (gfxcard[0]=%d, internal=%d)\n", card, machine_has_flags(machine, MACHINE_VIDEO) ? 1 : 0); monitor_index_global = 0; @@ -349,12 +349,11 @@ video_reset(int card) if (!(card == VID_NONE) && !machine_has_flags(machine, MACHINE_VIDEO_ONLY) - && gfxcard_2 != 0 - && (video_cards[gfxcard_2].flags != video_cards[gfxcard].flags) - && device_is_valid(video_card_getdevice(gfxcard_2), machine)) { + && gfxcard[1] != 0 + && device_is_valid(video_card_getdevice(gfxcard[1]), machine)) { video_monitor_init(1); monitor_index_global = 1; - device_add(video_cards[gfxcard_2].device); + device_add(video_cards[gfxcard[1]].device); monitor_index_global = 0; } diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index dd39daf8e..f2475888b 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -1,59 +1,59 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Trident TGUI9400CXi and TGUI9440 emulation. + * Trident TGUI9400CXi and TGUI9440 emulation. * - * TGUI9400CXi has extended write modes, controlled by extended - * GDC registers : + * TGUI9400CXi has extended write modes, controlled by extended + * GDC registers : * - * GDC[0x10] - Control - * bit 0 - pixel width (1 = 16 bit, 0 = 8 bit) - * bit 1 - mono->colour expansion (1 = enabled, - * 0 = disabled) - * bit 2 - mono->colour expansion transparency - * (1 = transparent, 0 = opaque) - * bit 3 - extended latch copy - * GDC[0x11] - Background colour (low byte) - * GDC[0x12] - Background colour (high byte) - * GDC[0x14] - Foreground colour (low byte) - * GDC[0x15] - Foreground colour (high byte) - * GDC[0x17] - Write mask (low byte) - * GDC[0x18] - Write mask (high byte) + * GDC[0x10] - Control + * bit 0 - pixel width (1 = 16 bit, 0 = 8 bit) + * bit 1 - mono->colour expansion (1 = enabled, + * 0 = disabled) + * bit 2 - mono->colour expansion transparency + * (1 = transparent, 0 = opaque) + * bit 3 - extended latch copy + * GDC[0x11] - Background colour (low byte) + * GDC[0x12] - Background colour (high byte) + * GDC[0x14] - Foreground colour (low byte) + * GDC[0x15] - Foreground colour (high byte) + * GDC[0x17] - Write mask (low byte) + * GDC[0x18] - Write mask (high byte) * - * Mono->colour expansion will expand written data 8:1 to 8/16 - * consecutive bytes. - * MSB is processed first. On word writes, low byte is processed - * first. 1 bits write foreground colour, 0 bits write background - * colour unless transparency is enabled. - * If the relevant bit is clear in the write mask then the data - * is not written. + * Mono->colour expansion will expand written data 8:1 to 8/16 + * consecutive bytes. + * MSB is processed first. On word writes, low byte is processed + * first. 1 bits write foreground colour, 0 bits write background + * colour unless transparency is enabled. + * If the relevant bit is clear in the write mask then the data + * is not written. * - * With 16-bit pixel width, each bit still expands to one byte, - * so the TGUI driver doubles up monochrome data. + * With 16-bit pixel width, each bit still expands to one byte, + * so the TGUI driver doubles up monochrome data. * - * While there is room in the register map for three byte colours, - * I don't believe 24-bit colour is supported. The TGUI9440 - * blitter has the same limitation. + * While there is room in the register map for three byte colours, + * I don't believe 24-bit colour is supported. The TGUI9440 + * blitter has the same limitation. * - * I don't think double word writes are supported. + * I don't think double word writes are supported. * - * Extended latch copy uses an internal 16 byte latch. Reads load - * the latch, writing writes out 16 bytes. I don't think the - * access size or host data has any affect, but the Windows 3.1 - * driver always reads bytes and write words of 0xffff. + * Extended latch copy uses an internal 16 byte latch. Reads load + * the latch, writing writes out 16 bytes. I don't think the + * access size or host data has any affect, but the Windows 3.1 + * driver always reads bytes and write words of 0xffff. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #include diff --git a/src/video/vid_ti_cf62011.c b/src/video/vid_ti_cf62011.c index 417f85861..f804a6dde 100644 --- a/src/video/vid_ti_cf62011.c +++ b/src/video/vid_ti_cf62011.c @@ -1,56 +1,56 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the TI CF62011 SVGA chip. + * Emulation of the TI CF62011 SVGA chip. * - * This chip was used in several of IBM's later machines, such - * as the PS/1 Model 2121, and a number of PS/2 models. As noted - * in an article on Usenet: + * This chip was used in several of IBM's later machines, such + * as the PS/1 Model 2121, and a number of PS/2 models. As noted + * in an article on Usenet: * - * "In the early 90s IBM looked for some cheap VGA card to - * substitute the (relatively) expensive XGA-2 adapter for - * *servers*, where the primary purpose is supervision of the - * machine rather than real *work* with it in Hi-Res. It was - * just to supply a base video, where a XGA-2 were a waste of - * potential. They had a contract with TI for some DSPs in - * multimedia already (the MWave for instance is based on - * TI-DSPs as well as many Thinkpad internal chipsets) and TI - * offered them a rather cheap – and inexpensive – chipset - * and combined it with a cheap clock oscillator and an Inmos - * RAMDAC. That chipset was already pretty much outdated at - * that time but IBM decided it would suffice for that low - * end purpose. + * "In the early 90s IBM looked for some cheap VGA card to + * substitute the (relatively) expensive XGA-2 adapter for + * *servers*, where the primary purpose is supervision of the + * machine rather than real *work* with it in Hi-Res. It was + * just to supply a base video, where a XGA-2 were a waste of + * potential. They had a contract with TI for some DSPs in + * multimedia already (the MWave for instance is based on + * TI-DSPs as well as many Thinkpad internal chipsets) and TI + * offered them a rather cheap – and inexpensive – chipset + * and combined it with a cheap clock oscillator and an Inmos + * RAMDAC. That chipset was already pretty much outdated at + * that time but IBM decided it would suffice for that low + * end purpose. * - * Driver support was given under DOS and OS/2 only for base - * functions like selection of the vertical refresh and few - * different modes only. Not even the Win 3.x support has - * been finalized. Technically the adapter could do better - * than VGA, but its video BIOS is largely undocumented and - * intentionally crippled down to a few functions." + * Driver support was given under DOS and OS/2 only for base + * functions like selection of the vertical refresh and few + * different modes only. Not even the Win 3.x support has + * been finalized. Technically the adapter could do better + * than VGA, but its video BIOS is largely undocumented and + * intentionally crippled down to a few functions." * - * This chip is reportedly the same one as used in the MCA - * IBM SVGA Adapter/A (ID 090EEh), which mostly had faster - * VRAM and RAMDAC. The VESA DOS graphics driver for that - * card can be used: m95svga.exe + * This chip is reportedly the same one as used in the MCA + * IBM SVGA Adapter/A (ID 090EEh), which mostly had faster + * VRAM and RAMDAC. The VESA DOS graphics driver for that + * card can be used: m95svga.exe * - * The controller responds at ports in the range 0x2100-0x210F, - * which are the same as the XGA. It supports up to 1MB of VRAM, - * but we lock it down to 512K. The PS/1 2122 had 256K. + * The controller responds at ports in the range 0x2100-0x210F, + * which are the same as the XGA. It supports up to 1MB of VRAM, + * but we lock it down to 512K. The PS/1 2122 had 256K. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. + * Copyright 2017-2018 Fred N. van Kempen. */ #include #include diff --git a/src/video/vid_tkd8001_ramdac.c b/src/video/vid_tkd8001_ramdac.c index 225c91c4b..66c2ca922 100644 --- a/src/video/vid_tkd8001_ramdac.c +++ b/src/video/vid_tkd8001_ramdac.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Trident TKD8001 RAMDAC emulation. + * Trident TKD8001 RAMDAC emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_tvga.c b/src/video/vid_tvga.c index ed249f618..384770ba4 100644 --- a/src/video/vid_tvga.c +++ b/src/video/vid_tvga.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Trident TVGA (8900D) emulation. + * Trident TVGA (8900D) emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_tvp3026_ramdac.c b/src/video/vid_tvp3026_ramdac.c index cde953b01..2ea60d520 100644 --- a/src/video/vid_tvp3026_ramdac.c +++ b/src/video/vid_tvp3026_ramdac.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Emulation of the Texas Instruments TVP3026 true colour RAMDAC - * family. + * Emulation of the Texas Instruments TVP3026 true colour RAMDAC + * family. * * - * TODO: Clock and other parts. + * TODO: Clock and other parts. * - * Authors: TheCollector1995, + * Authors: TheCollector1995, * - * Copyright 2021 TheCollector1995. + * Copyright 2021 TheCollector1995. */ #include #include diff --git a/src/video/vid_vga.c b/src/video/vid_vga.c index e581f237c..ac26c2b5d 100644 --- a/src/video/vid_vga.c +++ b/src/video/vid_vga.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * IBM VGA emulation. + * IBM VGA emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/vid_voodoo.c b/src/video/vid_voodoo.c index 326ff9879..cb5491c03 100644 --- a/src/video/vid_voodoo.c +++ b/src/video/vid_voodoo.c @@ -1,19 +1,19 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Graphics, 2, Banshee, 3 emulation. + * Voodoo Graphics, 2, Banshee, 3 emulation. * * * - * Authors: Sarah Walker, - * leilei + * Authors: Sarah Walker, + * leilei * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include diff --git a/src/video/vid_voodoo_banshee.c b/src/video/vid_voodoo_banshee.c index 386ac8575..f451c4b58 100644 --- a/src/video/vid_voodoo_banshee.c +++ b/src/video/vid_voodoo_banshee.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Voodoo Banshee and 3 specific emulation. + * Voodoo Banshee and 3 specific emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include @@ -453,7 +453,7 @@ banshee_render_16bpp_tiled(svga_t *svga) { banshee_t *banshee = (banshee_t *) svga->p; int x; - uint32_t *p = &((uint32_t *) buffer32->line[svga->displine + svga->y_add])[svga->x_add]; + uint32_t *p = &((uint32_t *) svga->monitor->target_buffer->line[svga->displine + svga->y_add])[svga->x_add]; uint32_t addr; int drawn = 0; @@ -1602,6 +1602,10 @@ banshee_read_linear(uint32_t addr, void *p) cycles -= voodoo->read_time; + if ((banshee->pci_regs[0x30] & 0x01) && addr >= banshee->bios_rom.mapping.base && addr < (banshee->bios_rom.mapping.base + banshee->bios_rom.sz)) + { + return rom_read(addr & (banshee->bios_rom.sz - 1), &banshee->bios_rom); + } addr &= svga->decode_mask; if (addr >= voodoo->tile_base) { int x, y; @@ -1616,7 +1620,7 @@ banshee_read_linear(uint32_t addr, void *p) if (addr >= svga->vram_max) return 0xff; - cycles -= video_timing_read_b; + cycles -= svga->monitor->mon_video_timing_read_b; // banshee_log("read_linear: addr=%08x val=%02x\n", addr, svga->vram[addr & svga->vram_mask]); @@ -1634,6 +1638,10 @@ banshee_read_linear_w(uint32_t addr, void *p) return banshee_read_linear(addr, p) | (banshee_read_linear(addr + 1, p) << 8); cycles -= voodoo->read_time; + if ((banshee->pci_regs[0x30] & 0x01) && addr >= banshee->bios_rom.mapping.base && addr < (banshee->bios_rom.mapping.base + banshee->bios_rom.sz)) + { + return rom_readw(addr & (banshee->bios_rom.sz - 1), &banshee->bios_rom); + } addr &= svga->decode_mask; if (addr >= voodoo->tile_base) { int x, y; @@ -1648,7 +1656,7 @@ banshee_read_linear_w(uint32_t addr, void *p) if (addr >= svga->vram_max) return 0xff; - cycles -= video_timing_read_w; + cycles -= svga->monitor->mon_video_timing_read_w; // banshee_log("read_linear: addr=%08x val=%02x\n", addr, svga->vram[addr & svga->vram_mask]); @@ -1667,6 +1675,10 @@ banshee_read_linear_l(uint32_t addr, void *p) cycles -= voodoo->read_time; + if ((banshee->pci_regs[0x30] & 0x01) && addr >= banshee->bios_rom.mapping.base && addr < (banshee->bios_rom.mapping.base + banshee->bios_rom.sz)) + { + return rom_readl(addr & (banshee->bios_rom.sz - 1), &banshee->bios_rom); + } addr &= svga->decode_mask; if (addr >= voodoo->tile_base) { int x, y; @@ -1681,7 +1693,7 @@ banshee_read_linear_l(uint32_t addr, void *p) if (addr >= svga->vram_max) return 0xff; - cycles -= video_timing_read_l; + cycles -= svga->monitor->mon_video_timing_read_l; // banshee_log("read_linear: addr=%08x val=%02x\n", addr, svga->vram[addr & svga->vram_mask]); @@ -1712,7 +1724,7 @@ banshee_write_linear(uint32_t addr, uint8_t val, void *p) if (addr >= svga->vram_max) return; - cycles -= video_timing_write_b; + cycles -= svga->monitor->mon_video_timing_write_b; svga->changedvram[addr >> 12] = changeframecount; svga->vram[addr & svga->vram_mask] = val; @@ -1747,7 +1759,7 @@ banshee_write_linear_w(uint32_t addr, uint16_t val, void *p) if (addr >= svga->vram_max) return; - cycles -= video_timing_write_w; + cycles -= svga->monitor->mon_video_timing_write_w; svga->changedvram[addr >> 12] = changeframecount; *(uint16_t *) &svga->vram[addr & svga->vram_mask] = val; @@ -1790,7 +1802,7 @@ banshee_write_linear_l(uint32_t addr, uint32_t val, void *p) if (addr >= svga->vram_max) return; - cycles -= video_timing_write_l; + cycles -= svga->monitor->mon_video_timing_write_l; svga->changedvram[addr >> 12] = changeframecount; *(uint32_t *) &svga->vram[addr & svga->vram_mask] = val; @@ -1862,7 +1874,7 @@ banshee_hwcursor_draw(svga_t *svga, int displine) if (x_off > -8) { for (xx = 0; xx < 8; xx++) { if (plane0[x >> 3] & (1 << 7)) - ((uint32_t *) buffer32->line[displine])[x_off + xx + svga->x_add] = (plane1[x >> 3] & (1 << 7)) ? col1 : col0; + ((uint32_t *) svga->monitor->target_buffer->line[displine])[x_off + xx + svga->x_add] = (plane1[x >> 3] & (1 << 7)) ? col1 : col0; plane0[x >> 3] <<= 1; plane1[x >> 3] <<= 1; @@ -1877,9 +1889,9 @@ banshee_hwcursor_draw(svga_t *svga, int displine) if (x_off > -8) { for (xx = 0; xx < 8; xx++) { if (!(plane0[x >> 3] & (1 << 7))) - ((uint32_t *) buffer32->line[displine])[x_off + xx + svga->x_add] = (plane1[x >> 3] & (1 << 7)) ? col1 : col0; + ((uint32_t *) svga->monitor->target_buffer->line[displine])[x_off + xx + svga->x_add] = (plane1[x >> 3] & (1 << 7)) ? col1 : col0; else if (plane1[x >> 3] & (1 << 7)) - ((uint32_t *) buffer32->line[displine])[x_off + xx + svga->x_add] ^= 0xffffff; + ((uint32_t *) svga->monitor->target_buffer->line[displine])[x_off + xx + svga->x_add] ^= 0xffffff; plane0[x >> 3] <<= 1; plane1[x >> 3] <<= 1; @@ -2204,7 +2216,7 @@ banshee_overlay_draw(svga_t *svga, int displine) // pclog("displine=%i addr=%08x %08x %08x %08x\n", displine, svga->overlay_latch.addr, src_addr, voodoo->overlay.vidOverlayDvdy, *(uint32_t *)src); // if (src_addr >= 0x800000) // fatal("overlay out of range!\n"); - p = &((uint32_t *) buffer32->line[displine])[svga->overlay_latch.x + svga->x_add]; + p = &((uint32_t *) svga->monitor->target_buffer->line[displine])[svga->overlay_latch.x + svga->x_add]; if (banshee->voodoo->scrfilter && banshee->voodoo->scrfilterEnabled) skip_filtering = ((banshee->vidProcCfg & VIDPROCCFG_FILTER_MODE_MASK) != VIDPROCCFG_FILTER_MODE_BILINEAR && !(banshee->vidProcCfg & VIDPROCCFG_H_SCALE_ENABLE) && !(banshee->vidProcCfg & VIDPROCCFG_FILTER_MODE_DITHER_4X4) && !(banshee->vidProcCfg & VIDPROCCFG_FILTER_MODE_DITHER_2X2)); diff --git a/src/video/vid_voodoo_blitter.c b/src/video/vid_voodoo_blitter.c index 00847554a..f60d9e184 100644 --- a/src/video/vid_voodoo_blitter.c +++ b/src/video/vid_voodoo_blitter.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 3DFX Voodoo emulation. + * 3DFX Voodoo emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include diff --git a/src/video/vid_voodoo_display.c b/src/video/vid_voodoo_display.c index 40e0b2ce9..822085127 100644 --- a/src/video/vid_voodoo_display.c +++ b/src/video/vid_voodoo_display.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 3DFX Voodoo emulation. + * 3DFX Voodoo emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include @@ -495,6 +495,7 @@ void voodoo_callback(void *p) { voodoo_t *voodoo = (voodoo_t *) p; + monitor_t* monitor = &monitors[voodoo->monitor_index]; if (voodoo->fbiInit0 & FBIINIT0_VGA_PASS) { if (voodoo->line < voodoo->v_disp) { @@ -518,7 +519,7 @@ voodoo_callback(void *p) } if (draw_voodoo->dirty_line[draw_line]) { - uint32_t *p = &buffer32->line[voodoo->line + 8][8]; + uint32_t *p = &monitor->target_buffer->line[voodoo->line + 8][8]; uint16_t *src = (uint16_t *) &draw_voodoo->fb_mem[draw_voodoo->front_offset + draw_line * draw_voodoo->row_width]; int x; @@ -526,14 +527,14 @@ voodoo_callback(void *p) if (voodoo->line < voodoo->dirty_line_low) { voodoo->dirty_line_low = voodoo->line; - video_wait_for_buffer(); + video_wait_for_buffer_monitor(voodoo->monitor_index); } if (voodoo->line > voodoo->dirty_line_high) voodoo->dirty_line_high = voodoo->line; /* Draw left overscan. */ for (x = 0; x < 8; x++) - buffer32->line[voodoo->line + 8][x] = 0x00000000; + monitor->target_buffer->line[voodoo->line + 8][x] = 0x00000000; if (voodoo->scrfilter && voodoo->scrfilterEnabled) { uint8_t *fil = malloc((voodoo->h_disp) * 3); /* interleaved 24-bit RGB */ @@ -556,7 +557,7 @@ voodoo_callback(void *p) /* Draw right overscan. */ for (x = 0; x < 8; x++) - buffer32->line[voodoo->line + 8][voodoo->h_disp + x + 8] = 0x00000000; + monitor->target_buffer->line[voodoo->line + 8][voodoo->h_disp + x + 8] = 0x00000000; } } } diff --git a/src/video/vid_voodoo_fb.c b/src/video/vid_voodoo_fb.c index 705c16853..f4a4edca6 100644 --- a/src/video/vid_voodoo_fb.c +++ b/src/video/vid_voodoo_fb.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 3DFX Voodoo emulation. + * 3DFX Voodoo emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include diff --git a/src/video/vid_voodoo_fifo.c b/src/video/vid_voodoo_fifo.c index d90c12bb5..646e5876c 100644 --- a/src/video/vid_voodoo_fifo.c +++ b/src/video/vid_voodoo_fifo.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 3DFX Voodoo emulation. + * 3DFX Voodoo emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include diff --git a/src/video/vid_voodoo_reg.c b/src/video/vid_voodoo_reg.c index 3d5580d04..51b9568b8 100644 --- a/src/video/vid_voodoo_reg.c +++ b/src/video/vid_voodoo_reg.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 3DFX Voodoo emulation. + * 3DFX Voodoo emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include diff --git a/src/video/vid_voodoo_render.c b/src/video/vid_voodoo_render.c index ec16b3a32..4b09cfadb 100644 --- a/src/video/vid_voodoo_render.c +++ b/src/video/vid_voodoo_render.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 3DFX Voodoo emulation. + * 3DFX Voodoo emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include diff --git a/src/video/vid_voodoo_setup.c b/src/video/vid_voodoo_setup.c index f98ddb450..40018ddf8 100644 --- a/src/video/vid_voodoo_setup.c +++ b/src/video/vid_voodoo_setup.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 3DFX Voodoo emulation. + * 3DFX Voodoo emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include diff --git a/src/video/vid_voodoo_texture.c b/src/video/vid_voodoo_texture.c index 9d1149c65..4f81f6d00 100644 --- a/src/video/vid_voodoo_texture.c +++ b/src/video/vid_voodoo_texture.c @@ -1,18 +1,18 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * 3DFX Voodoo emulation. + * 3DFX Voodoo emulation. * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * - * Copyright 2008-2020 Sarah Walker. + * Copyright 2008-2020 Sarah Walker. */ #include #include diff --git a/src/video/vid_wy700.c b/src/video/vid_wy700.c index e492523db..1a4babb99 100644 --- a/src/video/vid_wy700.c +++ b/src/video/vid_wy700.c @@ -1,20 +1,20 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Wyse-700 emulation. + * Wyse-700 emulation. * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. */ #include #include diff --git a/src/video/video.c b/src/video/video.c index 096ea89e1..d0e9ebb2c 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -1,52 +1,52 @@ /* - * 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. + * 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. + * This file is part of the 86Box distribution. * - * Main video-rendering module. + * Main video-rendering module. * - * Video timing settings - + * Video timing settings - * - * 8-bit - 1mb/sec - * B = 8 ISA clocks - * W = 16 ISA clocks - * L = 32 ISA clocks + * 8-bit - 1mb/sec + * B = 8 ISA clocks + * W = 16 ISA clocks + * L = 32 ISA clocks * - * Slow 16-bit - 2mb/sec - * B = 6 ISA clocks - * W = 8 ISA clocks - * L = 16 ISA clocks + * Slow 16-bit - 2mb/sec + * B = 6 ISA clocks + * W = 8 ISA clocks + * L = 16 ISA clocks * - * Fast 16-bit - 4mb/sec - * B = 3 ISA clocks - * W = 3 ISA clocks - * L = 6 ISA clocks + * Fast 16-bit - 4mb/sec + * B = 3 ISA clocks + * W = 3 ISA clocks + * L = 6 ISA clocks * - * Slow VLB/PCI - 8mb/sec (ish) - * B = 4 bus clocks - * W = 8 bus clocks - * L = 16 bus clocks + * Slow VLB/PCI - 8mb/sec (ish) + * B = 4 bus clocks + * W = 8 bus clocks + * L = 16 bus clocks * - * Mid VLB/PCI - - * B = 4 bus clocks - * W = 5 bus clocks - * L = 10 bus clocks + * Mid VLB/PCI - + * B = 4 bus clocks + * W = 5 bus clocks + * L = 10 bus clocks * - * Fast VLB/PCI - - * B = 3 bus clocks - * W = 3 bus clocks - * L = 4 bus clocks + * Fast VLB/PCI - + * B = 3 bus clocks + * W = 3 bus clocks + * L = 4 bus clocks * * * - * Authors: Sarah Walker, - * Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * - * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. */ #include #define PNG_DEBUG 0 diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 53cfb9b71..f452c2c9e 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -240,44 +240,33 @@ VPATH := $(EXPATH) . $(CODEGEN) minitrace cpu \ sound/munt/srchelper sound/munt/srchelper/srctools/src \ sound/resid-fp sound/ymfm \ scsi video network network/slirp win + +WINDRES := windres +STRIP := strip ifeq ($(X64), y) TOOL_PREFIX := x86_64-w64-mingw32- else - TOOL_PREFIX := i686-w64-mingw32- -endif -WINDRES := windres -STRIP := strip -ifeq ($(ARM64), y) - WINDRES := aarch64-w64-mingw32-windres - STRIP := aarch64-w64-mingw32-strip -endif -ifeq ($(ARM), y) - WINDRES := armv7-w64-mingw32-windres - STRIP := armv7-w64-mingw32-strip -endif -ifeq ($(CLANG), y) - CPP := clang++ - CC := clang ifeq ($(ARM64), y) - CPP := aarch64-w64-mingw32-clang++ - CC := aarch64-w64-mingw32-clang + TOOL_PREFIX := aarch64-w64-mingw32- + WINDRES := ${TOOL_PREFIX}windres + STRIP := ${TOOL_PREFIX}strip endif ifeq ($(ARM), y) - CPP := armv7-w64-mingw32-clang++ - CC := armv7-w64-mingw32-clang + TOOL_PREFIX := armv7-w64-mingw32- + WINDRES := ${TOOL_PREFIX}windres + STRIP := ${TOOL_PREFIX}strip endif + TOOL_PREFIX := i686-w64-mingw32- +endif + +ifeq ($(CLANG), y) + CPP := ${TOOL_PREFIX}clang++ + CC := ${TOOL_PREFIX}clang else CPP := ${TOOL_PREFIX}g++ CC := ${TOOL_PREFIX}gcc - ifeq ($(ARM64), y) - CPP := aarch64-w64-mingw32-g++ - CC := aarch64-w64-mingw32-gcc - endif - ifeq ($(ARM), y) - CPP := armv7-w64-mingw32-g++ - CC := armv7-w64-mingw32-gcc - endif endif + DEPS = -MMD -MF $*.d -c $< DEPFILE := win/.depends @@ -549,7 +538,7 @@ CPUOBJ := $(DYNARECOBJ) \ CHIPSETOBJ := 82c100.o acc2168.o \ contaq_82c59x.o \ cs4031.o cs8230.o \ - ali1429.o ali1489.o ali1531.o ali1541.o ali1543.o ali1621.o ali6117.o \ + ali1429.o ali1435.o ali1489.o ali1531.o ali1541.o ali1543.o ali1621.o ali6117.o \ gc100.o headland.o \ ims8848.o intel_82335.o intel_420ex.o intel_4x0.o intel_i450kx.o intel_sio.o intel_piix.o \ ioapic.o \ @@ -649,16 +638,17 @@ SCSIOBJ := scsi.o scsi_device.o \ scsi_ncr5380.o scsi_ncr53c8xx.o \ scsi_pcscsi.o scsi_spock.o -SLIRPOBJ := arp_table.o bootp.o cksum.o dnssearch.o if.o \ - ip_icmp.o ip_input.o ip_output.o \ - mbuf.o misc.o sbuf.o slirp.o socket.o \ - tcp_input.o tcp_output.o tcp_subr.o tcp_timer.o \ - udp.o \ - util.o version.o \ +SLIRPOBJ := net_slirp.o tinyglib.o \ + arp_table.o bootp.o cksum.o dhcpv6.o dnssearch.o if.o \ + ip_icmp.o ip_input.o ip_output.o \ + ip6_icmp.o ip6_input.o ip6_output.o \ + mbuf.o misc.o sbuf.o slirp.o socket.o \ + tcp_input.o tcp_output.o tcp_subr.o tcp_timer.o \ + udp.o udp6.o \ + util.o version.o \ NETOBJ := network.o \ net_pcap.o \ - net_slirp.o tinyglib.o \ ${SLIRPOBJ} \ net_dp8390.o net_3c501.o \ net_3c503.o net_ne2000.o \ diff --git a/src/win/glad.c b/src/win/glad.c index f3ceb1148..7c282ebee 100644 --- a/src/win/glad.c +++ b/src/win/glad.c @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.34 on Sat Dec 4 18:46:02 2021. + OpenGL loader generated by glad 0.1.36 on Sat Jan 7 18:24:33 2023. Language/Generator: C/C++ Specification: gl @@ -21,10 +21,10 @@ https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.0&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_debug_output&extensions=GL_ARB_sync */ -#include #include #include #include +#include static void *get_proc(const char *namez); diff --git a/src/win/languages/cs-CZ.rc b/src/win/languages/cs-CZ.rc index 9b49fc01d..c888fe954 100644 --- a/src/win/languages/cs-CZ.rc +++ b/src/win/languages/cs-CZ.rc @@ -53,10 +53,16 @@ BEGIN MENUITEM "&Dodržovat poměr stran 4:3", IDM_VID_FORCE43 POPUP "&Násobek zvětšení okna" BEGIN - MENUITEM "&0.5x", IDM_VID_SCALE_1X - MENUITEM "&1x", IDM_VID_SCALE_2X - MENUITEM "1.&5x", IDM_VID_SCALE_3X - MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&0.5x", IDM_VID_SCALE_1X + MENUITEM "&1x", IDM_VID_SCALE_2X + MENUITEM "1.&5x", IDM_VID_SCALE_3X + MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Metoda &filtrování" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Pořídit &screenshot\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Předvolby...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Povolit integraci s &Discordem", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Zesílení zvuku", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Joystick 3..." #define STR_JOY4 "Joystick 4..." -#define STR_SOUND "Zvuková karta:" +#define STR_SOUND1 "Zvuková karta 1:" +#define STR_SOUND2 "Zvuková karta 2:" +#define STR_SOUND3 "Zvuková karta 3:" +#define STR_SOUND4 "Zvuková karta 4:" #define STR_MIDI_OUT "MIDI výstup:" #define STR_MIDI_IN "MIDI vstup:" #define STR_MPU401 "Samostatný MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Použít zvuk FLOAT32" #define STR_FM_DRIVER "FM synth driver" #define STR_FM_DRV_NUKED "Nuked (přesnější)" #define STR_FM_DRV_YMFM "YMFM (rychlejší)" -#define STR_NET_TYPE "Druh sítě:" +#define STR_NET_TYPE "Druh sítě:" #define STR_PCAP "PCap zařízení:" #define STR_NET "Síťový adaptér:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Zařízení na COM1:" #define STR_COM2 "Zařízení na COM2:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "Vypnout skrze rozhraní ACPI" IDS_2161 "Nastavení" IDS_2162 "Časná mechanika" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/de-DE.rc b/src/win/languages/de-DE.rc index 74199b6da..3768898a5 100644 --- a/src/win/languages/de-DE.rc +++ b/src/win/languages/de-DE.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1,&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Filteringmethode" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "S&creenshot aufnehmen\tStrg+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Einstellungen...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "&Discord-Integration aktivieren", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Klangverstärkung...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Joystick 3..." #define STR_JOY4 "Joystick 4..." -#define STR_SOUND "Soundkarte:" +#define STR_SOUND1 "Soundkarte 1:" +#define STR_SOUND2 "Soundkarte 2:" +#define STR_SOUND3 "Soundkarte 3:" +#define STR_SOUND4 "Soundkarte 4:" #define STR_MIDI_OUT "MIDI Out-Gerät:" #define STR_MIDI_IN "MIDI In-Gerät:" #define STR_MPU401 "Standalone-MPU-401-Gerät" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "FLOAT32-Wiedergabe benutzen" #define STR_FM_DRIVER "FM-Synth-Treiber" #define STR_FM_DRV_NUKED "Nuked (genauer)" #define STR_FM_DRV_YMFM "YMFM (schneller)" -#define STR_NET_TYPE "Netzwerktyp:" +#define STR_NET_TYPE "Netzwerktyp:" #define STR_PCAP "PCap-Gerät:" #define STR_NET "Netzwerkadapter:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1-Gerät:" #define STR_COM2 "COM2-Gerät:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI-basiertes Herunterfahren" IDS_2161 "Optionen" IDS_2162 "Früheres Laufwerk" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/dialogs.rc b/src/win/languages/dialogs.rc index 0f74ef10b..5a150324c 100644 --- a/src/win/languages/dialogs.rc +++ b/src/win/languages/dialogs.rc @@ -320,58 +320,64 @@ DLG_CFG_SOUND DIALOG DISCARDABLE CFG_PANE_LEFT, CFG_PANE_TOP, CFG_PANE_WIDTH, C STYLE DS_CONTROL | WS_CHILD FONT FONT_SIZE, FONT_NAME BEGIN - LTEXT STR_SOUND, IDT_SOUND, + LTEXT STR_SOUND1, IDT_SOUND1, CFG_HMARGIN, CFG_VMARGIN, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT - COMBOBOX IDC_COMBO_SOUND, + COMBOBOX IDC_COMBO_SOUND1, CFG_COMBO_BOX_LEFT, 7, CFG_COMBO_BTN_WIDTH, CFG_COMBO_HEIGHT, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SND, + PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SND1, CFG_COMBO_BTN_LEFT, 6, CFG_BTN_WIDTH, CFG_BTN_HEIGHT - LTEXT STR_MIDI_OUT, IDT_MIDI_OUT, + LTEXT STR_SOUND2, IDT_SOUND2, CFG_HMARGIN, 28, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT - COMBOBOX IDC_COMBO_MIDI_OUT, + COMBOBOX IDC_COMBO_SOUND2, CFG_COMBO_BOX_LEFT, 26, CFG_COMBO_BTN_WIDTH, CFG_COMBO_HEIGHT, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SND2, + CFG_COMBO_BTN_LEFT, 25, CFG_BTN_WIDTH, CFG_BTN_HEIGHT + + LTEXT STR_SOUND3, IDT_SOUND3, + CFG_HMARGIN, 48, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT + COMBOBOX IDC_COMBO_SOUND3, + CFG_COMBO_BOX_LEFT, 46, CFG_COMBO_BTN_WIDTH, CFG_COMBO_HEIGHT, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SND3, + CFG_COMBO_BTN_LEFT, 45, CFG_BTN_WIDTH, CFG_BTN_HEIGHT + + LTEXT STR_SOUND4, IDT_SOUND4, + CFG_HMARGIN, 68, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT + COMBOBOX IDC_COMBO_SOUND4, + CFG_COMBO_BOX_LEFT, 66, CFG_COMBO_BTN_WIDTH, CFG_COMBO_HEIGHT, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SND4, + CFG_COMBO_BTN_LEFT, 65, CFG_BTN_WIDTH, CFG_BTN_HEIGHT + + LTEXT STR_MIDI_OUT, IDT_MIDI_OUT, + CFG_HMARGIN, 88, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT + COMBOBOX IDC_COMBO_MIDI_OUT, + CFG_COMBO_BOX_LEFT, 86, CFG_COMBO_BTN_WIDTH, CFG_COMBO_HEIGHT, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_MIDI_OUT, - CFG_COMBO_BTN_LEFT, 25, CFG_BTN_WIDTH, CFG_BTN_HEIGHT + CFG_COMBO_BTN_LEFT, 85, CFG_BTN_WIDTH, CFG_BTN_HEIGHT LTEXT STR_MIDI_IN, IDT_MIDI_IN, - CFG_HMARGIN, 47, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT + CFG_HMARGIN, 108, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT COMBOBOX IDC_COMBO_MIDI_IN, - CFG_COMBO_BOX_LEFT, 45, CFG_COMBO_BTN_WIDTH, CFG_COMBO_HEIGHT, + CFG_COMBO_BOX_LEFT, 105, CFG_COMBO_BTN_WIDTH, CFG_COMBO_HEIGHT, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_MIDI_IN, - CFG_COMBO_BTN_LEFT, 44, CFG_BTN_WIDTH, CFG_BTN_HEIGHT + CFG_COMBO_BTN_LEFT, 105, CFG_BTN_WIDTH, CFG_BTN_HEIGHT CONTROL STR_MPU401,IDC_CHECK_MPU401, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - CFG_HMARGIN, 66, 199, CFG_CHECKBOX_HEIGHT + CFG_HMARGIN, 126, 199, CFG_CHECKBOX_HEIGHT PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_MPU401, - CFG_COMBO_BTN_LEFT, 64, CFG_BTN_WIDTH, CFG_BTN_HEIGHT + CFG_COMBO_BTN_LEFT, 125, CFG_BTN_WIDTH, CFG_BTN_HEIGHT - CONTROL STR_SSI,IDC_CHECK_SSI, - "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - CFG_HMARGIN, 84, 95, CFG_CHECKBOX_HEIGHT - PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SSI, - CFG_COMBO_BTN_LEFT, 82, CFG_BTN_WIDTH, CFG_BTN_HEIGHT - - CONTROL STR_CMS,IDC_CHECK_CMS, - "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - CFG_HMARGIN, 102, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT - PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_CMS, - CFG_COMBO_BTN_LEFT, 100, CFG_BTN_WIDTH, CFG_BTN_HEIGHT - - CONTROL STR_GUS,IDC_CHECK_GUS, - "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - CFG_HMARGIN, 120, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT - PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_GUS, - CFG_COMBO_BTN_LEFT, 118, CFG_BTN_WIDTH, CFG_BTN_HEIGHT - CONTROL STR_FLOAT, IDC_CHECK_FLOAT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - CFG_HMARGIN, 138, 104, CFG_CHECKBOX_HEIGHT + CFG_HMARGIN, 138, 194, CFG_CHECKBOX_HEIGHT GROUPBOX STR_FM_DRIVER, IDC_FM_DRIVER, CFG_HMARGIN, 154, 110, 42 @@ -391,22 +397,22 @@ FONT FONT_SIZE, FONT_NAME BEGIN LTEXT STR_NET_TYPE, IDT_NET_TYPE, CFG_HMARGIN, CFG_VMARGIN, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT - COMBOBOX IDC_COMBO_NET_TYPE, + COMBOBOX IDC_COMBO_NET1_TYPE, CFG_COMBO_BOX_LEFT, 7, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT STR_PCAP, IDT_PCAP, CFG_HMARGIN, 28, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT - COMBOBOX IDC_COMBO_PCAP, + COMBOBOX IDC_COMBO_PCAP1, CFG_COMBO_BOX_LEFT, 26, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT STR_NET, IDT_NET, CFG_HMARGIN, 47, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT - COMBOBOX IDC_COMBO_NET, + COMBOBOX IDC_COMBO_NET1, CFG_COMBO_BOX_LEFT, 45, CFG_COMBO_BTN_WIDTH, CFG_COMBO_HEIGHT, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_NET, + PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_NET1, CFG_COMBO_BTN_LEFT, 44, CFG_BTN_WIDTH, CFG_BTN_HEIGHT END @@ -958,13 +964,13 @@ END #undef STR_JOY3 #undef STR_JOY4 -#undef STR_SOUND +#undef STR_SOUND1 +#undef STR_SOUND2 +#undef STR_SOUND3 +#undef STR_SOUND4 #undef STR_MIDI_OUT #undef STR_MIDI_IN #undef STR_MPU401 -#undef STR_SSI -#undef STR_CMS -#undef STR_GUS #undef STR_FLOAT #undef STR_FM_DRIVER #undef STR_FM_DRV_NUKED diff --git a/src/win/languages/en-GB.rc b/src/win/languages/en-GB.rc index dc0ec3627..a16c7977f 100644 --- a/src/win/languages/en-GB.rc +++ b/src/win/languages/en-GB.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Filter method" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Take s&creenshot\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Preferences...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Enable &Discord integration", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "Sound &gain...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Joystick 3..." #define STR_JOY4 "Joystick 4..." -#define STR_SOUND "Sound card:" +#define STR_SOUND1 "Sound card 1:" +#define STR_SOUND2 "Sound card 2:" +#define STR_SOUND3 "Sound card 3:" +#define STR_SOUND4 "Sound card 4:" #define STR_MIDI_OUT "MIDI Out Device:" #define STR_MIDI_IN "MIDI In Device:" #define STR_MPU401 "Standalone MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Use FLOAT32 sound" #define STR_FM_DRIVER "FM synth driver" #define STR_FM_DRV_NUKED "Nuked (more accurate)" #define STR_FM_DRV_YMFM "YMFM (faster)" -#define STR_NET_TYPE "Network type:" +#define STR_NET_TYPE "Network type:" #define STR_PCAP "PCap device:" #define STR_NET "Network adapter:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1 Device:" #define STR_COM2 "COM2 Device:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI shutdown" IDS_2161 "Settings" IDS_2162 "Earlier drive" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/en-US.rc b/src/win/languages/en-US.rc index d166b1d0c..42070879d 100644 --- a/src/win/languages/en-US.rc +++ b/src/win/languages/en-US.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Filter method" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Take s&creenshot\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Preferences...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Enable &Discord integration", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "Sound &gain...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Joystick 3..." #define STR_JOY4 "Joystick 4..." -#define STR_SOUND "Sound card:" +#define STR_SOUND1 "Sound card 1:" +#define STR_SOUND2 "Sound card 2:" +#define STR_SOUND3 "Sound card 3:" +#define STR_SOUND4 "Sound card 4:" #define STR_MIDI_OUT "MIDI Out Device:" #define STR_MIDI_IN "MIDI In Device:" #define STR_MPU401 "Standalone MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Use FLOAT32 sound" #define STR_FM_DRIVER "FM synth driver" #define STR_FM_DRV_NUKED "Nuked (more accurate)" #define STR_FM_DRV_YMFM "YMFM (faster)" -#define STR_NET_TYPE "Network type:" +#define STR_NET_TYPE "Network type:" #define STR_PCAP "PCap device:" #define STR_NET "Network adapter:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1 Device:" #define STR_COM2 "COM2 Device:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI shutdown" IDS_2161 "Settings" IDS_2162 "Earlier drive" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/es-ES.rc b/src/win/languages/es-ES.rc index faba0638c..8be2db827 100644 --- a/src/win/languages/es-ES.rc +++ b/src/win/languages/es-ES.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "&Método de filtrado" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Tomar c&aptura\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Preferencias...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Habilitar integración con &Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Ganancia de sonido...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Mando 3..." #define STR_JOY4 "Mando 4..." -#define STR_SOUND "Tarjeta de sonido:" +#define STR_SOUND1 "Tarjeta de sonido 1:" +#define STR_SOUND2 "Tarjeta de sonido 2:" +#define STR_SOUND3 "Tarjeta de sonido 3:" +#define STR_SOUND4 "Tarjeta de sonido 4:" #define STR_MIDI_OUT "Dispositivo MIDI de salida:" #define STR_MIDI_IN "Dispositivo MIDI de entrada:" #define STR_MPU401 "MPU-401 independiente" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Usar sonido FLOAT32" #define STR_FM_DRIVER "Controlador de sintet. FM" #define STR_FM_DRV_NUKED "Nuked (más preciso)" #define STR_FM_DRV_YMFM "YMFM (más rápido)" -#define STR_NET_TYPE "Tipo de red:" +#define STR_NET_TYPE "Tipo de red:" #define STR_PCAP "Dispositivo PCap:" #define STR_NET "Adaptador de red:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Dispositivo COM1:" #define STR_COM2 "Dispositivo COM2:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI shutdown" IDS_2161 "Settings" IDS_2162 "Unidad anterior" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/fi-FI.rc b/src/win/languages/fi-FI.rc index 127508bdd..9f2f14187 100644 --- a/src/win/languages/fi-FI.rc +++ b/src/win/languages/fi-FI.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "&Suodatusmetodi" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Ota &kuvakaappaus\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Sovellusasetukset...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Käytä &Discord-integraatiota", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Äänitasot...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,13 +292,13 @@ END #define STR_JOY3 "Peliohjain 3..." #define STR_JOY4 "Peliohjain 4..." -#define STR_SOUND "Äänikortti:" +#define STR_SOUND1 "Äänikortti 1:" +#define STR_SOUND2 "Äänikortti 2:" +#define STR_SOUND3 "Äänikortti 3:" +#define STR_SOUND4 "Äänikortti 4:" #define STR_MIDI_OUT "MIDI-ulostulo:" #define STR_MIDI_IN "MIDI-sisääntulo:" #define STR_MPU401 "Erillinen MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Käytä FLOAT32-ääntä" #define STR_FM_DRIVER "FM-syntetisaattoriohjain" #define STR_FM_DRV_NUKED "Nuked (tarkempi)" @@ -299,6 +307,10 @@ END #define STR_NET_TYPE "Verkon tyyppi:" #define STR_PCAP "PCap-laite:" #define STR_NET "Verkkokortti:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1-laite:" #define STR_COM2 "COM2-laite:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI-sammutus" IDS_2161 "Asetukset" IDS_2162 "Aiemmat asemat" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/fr-FR.rc b/src/win/languages/fr-FR.rc index c7cdf65d7..fcd4d480a 100644 --- a/src/win/languages/fr-FR.rc +++ b/src/win/languages/fr-FR.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Methode Filtre" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Copie &Ecran\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Préférences...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Activer intégration &Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Gain Son...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Manette 3..." #define STR_JOY4 "Manette 4..." -#define STR_SOUND "Carte son:" +#define STR_SOUND1 "Carte son 1:" +#define STR_SOUND2 "Carte son 2:" +#define STR_SOUND3 "Carte son 3:" +#define STR_SOUND4 "Carte son 4:" #define STR_MIDI_OUT "Sortie MIDI:" #define STR_MIDI_IN "Entrée MIDI:" #define STR_MPU401 "MPU-401 autonome" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Utiliser le son FLOAT32" #define STR_FM_DRIVER "Pilote de synthétiseur FM" #define STR_FM_DRV_NUKED "Nuked (plus précis)" #define STR_FM_DRV_YMFM "YMFM (plus rapide)" -#define STR_NET_TYPE "Type de réseau:" +#define STR_NET_TYPE "Type de réseau:" #define STR_PCAP "Dispositif PCap:" #define STR_NET "Adaptateur de réseau:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Dispositif COM1:" #define STR_COM2 "Dispositif COM2:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI shutdown" IDS_2161 "Settings" IDS_2162 "Lecteur plus tôt" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/hr-HR.rc b/src/win/languages/hr-HR.rc index f2952bbcf..fe0f9dad5 100644 --- a/src/win/languages/hr-HR.rc +++ b/src/win/languages/hr-HR.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1,&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Metoda filtriranja" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Napravi &snimku zaslona\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Postavke...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Omogući integraciju sa programom &Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Pojačanje zvuka...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Palica za igru 3..." #define STR_JOY4 "Palica za igru 4..." -#define STR_SOUND "Zvučna kartica:" +#define STR_SOUND1 "Zvučna kartica 1:" +#define STR_SOUND2 "Zvučna kartica 2:" +#define STR_SOUND3 "Zvučna kartica 3:" +#define STR_SOUND4 "Zvučna kartica 4:" #define STR_MIDI_OUT "Izlazni uređaj MIDI:" #define STR_MIDI_IN "Ulazni uređaj MIDI:" #define STR_MPU401 "Samostalni MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Koristi FLOAT32 za zvuk" #define STR_FM_DRIVER "Drajver za FM sintisajzer" #define STR_FM_DRV_NUKED "Nuked (precizniji)" #define STR_FM_DRV_YMFM "YMFM (brži)" -#define STR_NET_TYPE "Tip mreže:" +#define STR_NET_TYPE "Tip mreže:" #define STR_PCAP "Uređaj PCap:" #define STR_NET "Mrežna kartica:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Uređaj COM1:" #define STR_COM2 "Uređaj COM2:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI bazirano gašenje" IDS_2161 "Postavke" IDS_2162 "Raniji pogon" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/hu-HU.rc b/src/win/languages/hu-HU.rc index 0ffa215c0..f23e3c35a 100644 --- a/src/win/languages/hu-HU.rc +++ b/src/win/languages/hu-HU.rc @@ -62,6 +62,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1,&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Szűrési mód" BEGIN @@ -109,7 +115,9 @@ BEGIN MENUITEM "&Képernyőkép készítése\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Beállítások...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "&Discord integráció engedélyezése", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Hangerőszabályzó...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -289,21 +297,25 @@ END #define STR_JOY3 "Játékvez. 3..." #define STR_JOY4 "Játékvez. 4..." -#define STR_SOUND "Hangkártya:" +#define STR_SOUND1 "Hangkártya 1:" +#define STR_SOUND2 "Hangkártya 2:" +#define STR_SOUND3 "Hangkártya 3:" +#define STR_SOUND4 "Hangkártya 4:" #define STR_MIDI_OUT "MIDI-kimenet:" #define STR_MIDI_IN "MIDI-bemenet:" #define STR_MPU401 "Különálló MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "FLOAT32 használata" #define STR_FM_DRIVER "FM szintetizátor meghajtó" #define STR_FM_DRV_NUKED "Nuked (pontosabb)" #define STR_FM_DRV_YMFM "YMFM (gyorsabb)" -#define STR_NET_TYPE "Hálózati típusa:" +#define STR_NET_TYPE "Hálózati típusa:" #define STR_PCAP "PCap eszköz:" #define STR_NET "Hálózati kártya:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1 eszköz:" #define STR_COM2 "COM2 eszköz:" @@ -526,6 +538,9 @@ BEGIN IDS_2160 "ACPI shutdown" IDS_2161 "Settings" IDS_2162 "Korábbi meghajtó" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/it-IT.rc b/src/win/languages/it-IT.rc index 960e9e205..6335c690f 100644 --- a/src/win/languages/it-IT.rc +++ b/src/win/languages/it-IT.rc @@ -58,6 +58,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Metodo filtro" BEGIN @@ -105,7 +111,9 @@ BEGIN MENUITEM "Cattura schermata\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Preferenze...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Abilita &integrazione Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "Guadagno &suono...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -285,21 +293,25 @@ END #define STR_JOY3 "Joystick 3..." #define STR_JOY4 "Joystick 4..." -#define STR_SOUND "Scheda audio:" +#define STR_SOUND1 "Scheda audio 1:" +#define STR_SOUND2 "Scheda audio 2:" +#define STR_SOUND3 "Scheda audio 3:" +#define STR_SOUND4 "Scheda audio 4:" #define STR_MIDI_OUT "Uscita MIDI:" #define STR_MIDI_IN "Entrata MIDI:" #define STR_MPU401 "MPU-401 autonomo" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Usa suono FLOAT32" #define STR_FM_DRIVER "Driver sint. FM" #define STR_FM_DRV_NUKED "Nuked (più accurato)" #define STR_FM_DRV_YMFM "YMFM (più veloce)" -#define STR_NET_TYPE "Tipo di rete:" +#define STR_NET_TYPE "Tipo di rete:" #define STR_PCAP "Dispositivo PCap:" #define STR_NET "Scheda di rete:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Dispositivo COM1:" #define STR_COM2 "Dispositivo COM2:" @@ -523,6 +535,9 @@ BEGIN IDS_2160 "ACPI shutdown" IDS_2161 "Settings" IDS_2162 "Unità anteriore" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/ja-JP.rc b/src/win/languages/ja-JP.rc index edcf3f668..1de5e1f42 100644 --- a/src/win/languages/ja-JP.rc +++ b/src/win/languages/ja-JP.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "1x(&1)", IDM_VID_SCALE_2X MENUITEM "1.5x(&5)", IDM_VID_SCALE_3X MENUITEM "2x(&2)", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "フィルター方式" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "スクリーンショットを撮る(&C)\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "環境設定(&P)...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Discordとの連携機能(&D)", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "音量を調節(&G)...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "ジョイスティック3..." #define STR_JOY4 "ジョイスティック4..." -#define STR_SOUND "サウンドカード:" +#define STR_SOUND1 "サウンドカード 1:" +#define STR_SOUND2 "サウンドカード 2:" +#define STR_SOUND3 "サウンドカード 3:" +#define STR_SOUND4 "サウンドカード 4:" #define STR_MIDI_OUT "MIDI出力デバイス:" #define STR_MIDI_IN "MIDI入力デバイス:" #define STR_MPU401 "独立型MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "FLOAT32サウンドを使用する" #define STR_FM_DRIVER "FMシンセドライバー" #define STR_FM_DRV_NUKED "Nuked (高精度化)" #define STR_FM_DRV_YMFM "YMFM (より速く)" -#define STR_NET_TYPE "ネットワークタイプ:" +#define STR_NET_TYPE "ネットワークタイプ:" #define STR_PCAP "PCapデバイス:" #define STR_NET "ネットワークアダプター:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1デバイス:" #define STR_COM2 "COM2デバイス:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPIシャットダウン" IDS_2161 "設定" IDS_2162 "アーリードライブ" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/ko-KR.rc b/src/win/languages/ko-KR.rc index a5f0cfe57..b96e21fa1 100644 --- a/src/win/languages/ko-KR.rc +++ b/src/win/languages/ko-KR.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "1배(&1)", IDM_VID_SCALE_2X MENUITEM "1.5배(&5)", IDM_VID_SCALE_3X MENUITEM "2배(&2)", IDM_VID_SCALE_4X + MENUITEM "&3배", IDM_VID_SCALE_5X + MENUITEM "&4배", IDM_VID_SCALE_6X + MENUITEM "&5배", IDM_VID_SCALE_7X + MENUITEM "&6배", IDM_VID_SCALE_8X + MENUITEM "&7배", IDM_VID_SCALE_9X + MENUITEM "&8배", IDM_VID_SCALE_10X END POPUP "필터 형식" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "스크린샷 찍기(&C)\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "환경설정(&P)...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "디스코드 연동 활성화하기(&D)", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "음량 증폭(&G)...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "조이스틱 3..." #define STR_JOY4 "조이스틱 4..." -#define STR_SOUND "사운드 카드:" +#define STR_SOUND1 "사운드 카드 1:" +#define STR_SOUND2 "사운드 카드 2:" +#define STR_SOUND3 "사운드 카드 3:" +#define STR_SOUND4 "사운드 카드 4:" #define STR_MIDI_OUT "MIDI 출력 장치:" #define STR_MIDI_IN "MIDI 입력 장치:" #define STR_MPU401 "MPU-401 단독 사용" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "FLOAT32 사운드 사용" #define STR_FM_DRIVER "FM 신디사이저 드라이버" #define STR_FM_DRV_NUKED "Nuked (더 정확한)" #define STR_FM_DRV_YMFM "YMFM (더 빠르게)" -#define STR_NET_TYPE "네트워크 종류:" +#define STR_NET_TYPE "네트워크 종류:" #define STR_PCAP "PCap 장치:" #define STR_NET "네트워크 어댑터:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1 장치:" #define STR_COM2 "COM2 장치:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI 종료" IDS_2161 "설정" IDS_2162 "이전 드라이브" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/pl-PL.rc b/src/win/languages/pl-PL.rc index ec59c5ef1..e4e6a4963 100644 --- a/src/win/languages/pl-PL.rc +++ b/src/win/languages/pl-PL.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Metoda filtrowania" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Zrób &zrzut ekranu\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Preferencje...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Włącz integrację z &Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "Wzmocnienie &dźwięku...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Joystick 3..." #define STR_JOY4 "Joystick 4..." -#define STR_SOUND "Karta dźwiękowa:" +#define STR_SOUND1 "Karta dźwiękowa 1:" +#define STR_SOUND2 "Karta dźwiękowa 2:" +#define STR_SOUND3 "Karta dźwiękowa 3:" +#define STR_SOUND4 "Karta dźwiękowa 4:" #define STR_MIDI_OUT "Urządzenie wyjściowe MIDI:" #define STR_MIDI_IN "Urządzenie wejściowe MIDI:" #define STR_MPU401 "Samodzielne urządzenie MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Użyj dźwięku FLOAT32" #define STR_FM_DRIVER "Sterownik syntezy FM" #define STR_FM_DRV_NUKED "Nuked (dokładniejszy)" #define STR_FM_DRV_YMFM "YMFM (szybszy)" -#define STR_NET_TYPE "Rodzaj sieci:" +#define STR_NET_TYPE "Rodzaj sieci:" #define STR_PCAP "Urządzenie PCap:" #define STR_NET "Karta sieciowa:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Urządzenie COM1:" #define STR_COM2 "Urządzenie COM2:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "Wyłączenie ACPI" IDS_2161 "Ustawienia" IDS_2162 "Wcześniejszy napęd" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/pt-BR.rc b/src/win/languages/pt-BR.rc index 8d16a2a48..7a08080bc 100644 --- a/src/win/languages/pt-BR.rc +++ b/src/win/languages/pt-BR.rc @@ -60,6 +60,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1,&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Método de filtragem" BEGIN @@ -107,7 +113,9 @@ BEGIN MENUITEM "Capturar &tela\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Preferências...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Ativar integração com o &Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Ganho de som...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -287,13 +295,13 @@ END #define STR_JOY3 "Joystick 3..." #define STR_JOY4 "Joystick 4..." -#define STR_SOUND "Placa de som:" +#define STR_SOUND1 "Placa de som 1:" +#define STR_SOUND2 "Placa de som 2:" +#define STR_SOUND3 "Placa de som 3:" +#define STR_SOUND4 "Placa de som 4:" #define STR_MIDI_OUT "Disp. saída MIDI:" #define STR_MIDI_IN "Disp. entrada MIDI:" #define STR_MPU401 "MPU-401 autônomo" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Usar som FLOAT32" #define STR_FM_DRIVER "Controlador de sint. FM" #define STR_FM_DRV_NUKED "Nuked (mais preciso)" @@ -302,6 +310,10 @@ END #define STR_NET_TYPE "Tipo de rede:" #define STR_PCAP "Dispositivo PCap:" #define STR_NET "Adaptador de rede:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Dispositivo COM1:" #define STR_COM2 "Dispositivo COM2:" @@ -525,6 +537,9 @@ BEGIN IDS_2160 "Desligamento por ACPI" IDS_2161 "Configurações" IDS_2162 "Unidade anterior" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/pt-PT.rc b/src/win/languages/pt-PT.rc index 704262b3d..74968da02 100644 --- a/src/win/languages/pt-PT.rc +++ b/src/win/languages/pt-PT.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Método de filtragem" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Gravar imagem de ecrã\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Preferências...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Ativar integração com &Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Ganho de som...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Joystick 3..." #define STR_JOY4 "Joystick 4..." -#define STR_SOUND "Placa de som:" +#define STR_SOUND1 "Placa de som 1:" +#define STR_SOUND2 "Placa de som 2:" +#define STR_SOUND3 "Placa de som 3:" +#define STR_SOUND4 "Placa de som 4:" #define STR_MIDI_OUT "Disp. saída MIDI:" #define STR_MIDI_IN "Disp. entrada MIDI:" #define STR_MPU401 "MPU-401 autónomo" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Utilizar som FLOAT32" #define STR_FM_DRIVER "Controlador de sint. FM" #define STR_FM_DRV_NUKED "Nuked (mais exacto)" #define STR_FM_DRV_YMFM "YMFM (mais rápido)" -#define STR_NET_TYPE "Tipo de rede:" +#define STR_NET_TYPE "Tipo de rede:" #define STR_PCAP "Dispositivo PCap:" #define STR_NET "Placa de rede:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Dispositivo COM1:" #define STR_COM2 "Dispositivo COM2:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "Encerramento ACPI" IDS_2161 "Definições" IDS_2162 "Unidade anterior" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/ru-RU.rc b/src/win/languages/ru-RU.rc index 667cfafa6..790738148 100644 --- a/src/win/languages/ru-RU.rc +++ b/src/win/languages/ru-RU.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Метод фильтрации" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Сделать с&криншот\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Параметры...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Включить интеграцию &Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Усиление звука...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Джойстик 3..." #define STR_JOY4 "Джойстик 4..." -#define STR_SOUND "Звуковая карта:" +#define STR_SOUND1 "Звуковая карта 1:" +#define STR_SOUND2 "Звуковая карта 2:" +#define STR_SOUND3 "Звуковая карта 3:" +#define STR_SOUND4 "Звуковая карта 4:" #define STR_MIDI_OUT "MIDI Out устр-во:" #define STR_MIDI_IN "MIDI In устр-во:" #define STR_MPU401 "Отдельный MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "FLOAT32 звук" #define STR_FM_DRIVER "Драйвер FM-синтезатора" #define STR_FM_DRV_NUKED "Nuked (более точный)" #define STR_FM_DRV_YMFM "YMFM (быстрей)" -#define STR_NET_TYPE "Тип сети:" +#define STR_NET_TYPE "Тип сети:" #define STR_PCAP "Устройство PCap:" #define STR_NET "Сетевая карта:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Устройство COM1:" #define STR_COM2 "Устройство COM2:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "Сигнал завершения ACPI" IDS_2161 "Настройки машины" IDS_2162 "Предыдущий дисковод" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/sl-SI.rc b/src/win/languages/sl-SI.rc index 3bdf357f4..317cf51b8 100644 --- a/src/win/languages/sl-SI.rc +++ b/src/win/languages/sl-SI.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "&Metoda filtriranja" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "&Zajemi posnetek zaslona\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Možnosti...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Omogoči integracijo s programom &Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Ojačanje zvoka...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Igralna palica 3..." #define STR_JOY4 "Igralna palica 4..." -#define STR_SOUND "Zvočna kartica:" +#define STR_SOUND1 "Zvočna kartica 1:" +#define STR_SOUND2 "Zvočna kartica 2:" +#define STR_SOUND3 "Zvočna kartica 3:" +#define STR_SOUND4 "Zvočna kartica 4:" #define STR_MIDI_OUT "Izhodna naprava MIDI:" #define STR_MIDI_IN "Vhodna naprava MIDI:" #define STR_MPU401 "Samostojen MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "Uporabi FLOAT32 za zvok" #define STR_FM_DRIVER "Gonilnik sintetizacije FM" #define STR_FM_DRV_NUKED "Nuked (točnejši)" #define STR_FM_DRV_YMFM "YMFM (hitrejši)" -#define STR_NET_TYPE "Vrsta omrežja:" +#define STR_NET_TYPE "Vrsta omrežja:" #define STR_PCAP "Naprava PCap:" #define STR_NET "Omrežna kartica:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Naprava COM1:" #define STR_COM2 "Naprava COM2:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "Zaustavitev ACPI" IDS_2161 "Nastavitve" IDS_2162 "Zgodnejši pogon" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/tr-TR.rc b/src/win/languages/tr-TR.rc index 858bf0a01..04a0f9abc 100644 --- a/src/win/languages/tr-TR.rc +++ b/src/win/languages/tr-TR.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "&Filtre metodu" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "&Ekran görüntüsü al\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Tercihler...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "&Discord entegrasyonunu etkinleştir", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Ses yükseltici...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Oyun kolu 3..." #define STR_JOY4 "Oyun kolu 4..." -#define STR_SOUND "Ses kartı:" +#define STR_SOUND1 "Ses kartı 1:" +#define STR_SOUND2 "Ses kartı 2:" +#define STR_SOUND3 "Ses kartı 3:" +#define STR_SOUND4 "Ses kartı 4:" #define STR_MIDI_OUT "MIDI Çıkış Cihazı:" #define STR_MIDI_IN "MIDI Giriş Cihazı:" #define STR_MPU401 "Bağımsız MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "FLOAT32 ses kullan" #define STR_FM_DRIVER "FM sentez sürücüsü" #define STR_FM_DRV_NUKED "Nuked (daha doğru)" #define STR_FM_DRV_YMFM "YMFM (daha hızlı)" -#define STR_NET_TYPE "Ağ tipi:" +#define STR_NET_TYPE "Ağ tipi:" #define STR_PCAP "PCap cihazı:" #define STR_NET "Ağ cihazı:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1 Cihazı:" #define STR_COM2 "COM2 Cihazı:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI kapatma" IDS_2161 "Ayarlar" IDS_2162 "Daha erken sürüş" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/uk-UA.rc b/src/win/languages/uk-UA.rc index 9f7f92cbe..d8c5f1106 100644 --- a/src/win/languages/uk-UA.rc +++ b/src/win/languages/uk-UA.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "&1x", IDM_VID_SCALE_2X MENUITEM "1.&5x", IDM_VID_SCALE_3X MENUITEM "&2x", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "Метод фільтрації" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "Зробити &знімок\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "&Параметри...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "Увімкнути інтеграцію &Discord", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "&Посилення звуку...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "Джойстик 3..." #define STR_JOY4 "Джойстик 4..." -#define STR_SOUND "Звукова карта:" +#define STR_SOUND1 "Звукова карта 1:" +#define STR_SOUND2 "Звукова карта 2:" +#define STR_SOUND3 "Звукова карта 3:" +#define STR_SOUND4 "Звукова карта 4:" #define STR_MIDI_OUT "MIDI Out при-ій:" #define STR_MIDI_IN "MIDI In при-ій:" #define STR_MPU401 "Окремий MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "FLOAT32 звук" #define STR_FM_DRIVER "Драйвер FM-синтезатора" #define STR_FM_DRV_NUKED "Nuked (більш точний)" #define STR_FM_DRV_YMFM "YMFM (швидший)" -#define STR_NET_TYPE "Тип мережі:" +#define STR_NET_TYPE "Тип мережі:" #define STR_PCAP "Пристрій PCap:" #define STR_NET "Мережева карта:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "Пристрій COM1:" #define STR_COM2 "Пристрій COM2:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "Сигнал завершення ACPI" IDS_2161 "Налаштування машини" IDS_2162 "Більш ранній дисковод" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/zh-CN.rc b/src/win/languages/zh-CN.rc index 88a7e9055..72d67e880 100644 --- a/src/win/languages/zh-CN.rc +++ b/src/win/languages/zh-CN.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "1x(&1)", IDM_VID_SCALE_2X MENUITEM "1.5x(&5)", IDM_VID_SCALE_3X MENUITEM "2x(&2)", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "过滤方式" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "截图(&C)\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "首选项(&P)...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "启用 Discord 集成(&D)", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "音量增益(&G)...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "操纵杆 3..." #define STR_JOY4 "操纵杆 4..." -#define STR_SOUND "声卡:" +#define STR_SOUND1 "声卡 1:" +#define STR_SOUND2 "声卡 2:" +#define STR_SOUND3 "声卡 3:" +#define STR_SOUND4 "声卡 4:" #define STR_MIDI_OUT "MIDI 输出设备:" #define STR_MIDI_IN "MIDI 输入设备:" #define STR_MPU401 "独立 MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "使用单精度浮点 (FLOAT32)" #define STR_FM_DRIVER "调频合成器驱动器" #define STR_FM_DRV_NUKED "Nuked (更准确)" #define STR_FM_DRV_YMFM "YMFM (更快)" -#define STR_NET_TYPE "网络类型:" +#define STR_NET_TYPE "网络类型:" #define STR_PCAP "PCap 设备:" #define STR_NET "网络适配器:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1 设备:" #define STR_COM2 "COM2 设备:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI 关机" IDS_2161 "设置" IDS_2162 "早先的驱动器" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/languages/zh-TW.rc b/src/win/languages/zh-TW.rc index e06f8525c..9cbb7c70e 100644 --- a/src/win/languages/zh-TW.rc +++ b/src/win/languages/zh-TW.rc @@ -57,6 +57,12 @@ BEGIN MENUITEM "1x(&1)", IDM_VID_SCALE_2X MENUITEM "1.5x(&5)", IDM_VID_SCALE_3X MENUITEM "2x(&2)", IDM_VID_SCALE_4X + MENUITEM "&3x", IDM_VID_SCALE_5X + MENUITEM "&4x", IDM_VID_SCALE_6X + MENUITEM "&5x", IDM_VID_SCALE_7X + MENUITEM "&6x", IDM_VID_SCALE_8X + MENUITEM "&7x", IDM_VID_SCALE_9X + MENUITEM "&8x", IDM_VID_SCALE_10X END POPUP "過濾方式" BEGIN @@ -104,7 +110,9 @@ BEGIN MENUITEM "擷圖(&C)\tCtrl+F11", IDM_ACTION_SCREENSHOT MENUITEM SEPARATOR MENUITEM "首選項(&P)...", IDM_PREFERENCES +#ifdef DISCORD MENUITEM "啟用 Discord 整合(&D)", IDM_DISCORD +#endif MENUITEM SEPARATOR MENUITEM "音量增益(&G)...", IDM_SND_GAIN #ifdef MTR_ENABLED @@ -284,21 +292,25 @@ END #define STR_JOY3 "搖桿 3..." #define STR_JOY4 "搖桿 4..." -#define STR_SOUND "音訊卡:" +#define STR_SOUND1 "音訊卡 1:" +#define STR_SOUND2 "音訊卡 2:" +#define STR_SOUND3 "音訊卡 3:" +#define STR_SOUND4 "音訊卡 4:" #define STR_MIDI_OUT "MIDI 輸出裝置:" #define STR_MIDI_IN "MIDI 輸入裝置:" #define STR_MPU401 "獨立 MPU-401" -#define STR_SSI "Innovation SSI-2001" -#define STR_CMS "CMS / Game Blaster" -#define STR_GUS "Gravis Ultrasound" #define STR_FLOAT "使用單精度浮點 (FLOAT32)" #define STR_FM_DRIVER "調頻合成器驅動器" #define STR_FM_DRV_NUKED "Nuked (更準確)" #define STR_FM_DRV_YMFM "YMFM (更快)" -#define STR_NET_TYPE "網路類型:" +#define STR_NET_TYPE "網路類型:" #define STR_PCAP "PCap 裝置:" #define STR_NET "網路配接器:" +#define STR_NET1 "Network card 1:" +#define STR_NET2 "Network card 2:" +#define STR_NET3 "Network card 3:" +#define STR_NET4 "Network card 4:" #define STR_COM1 "COM1 裝置:" #define STR_COM2 "COM2 裝置:" @@ -522,6 +534,9 @@ BEGIN IDS_2160 "ACPI 關機" IDS_2161 "設定" IDS_2162 "早先的光碟機" + IDS_2163 "no dynarec" + IDS_2164 "old dynarec" + IDS_2165 "new dynarec" END STRINGTABLE DISCARDABLE diff --git a/src/win/win.c b/src/win/win.c index 3d46054a6..69561036d 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -488,8 +488,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow) return (1); } - extern int gfxcard_2; - gfxcard_2 = 0; + extern int gfxcard[2]; + gfxcard[1] = 0; /* Create console window. */ if (force_debug) { diff --git a/src/win/win_about.c b/src/win/win_about.c index c343eb7f0..f0c692b75 100644 --- a/src/win/win_about.c +++ b/src/win/win_about.c @@ -45,9 +45,22 @@ AboutDialogCreate(HWND hwnd) wchar_t emu_version[256]; i = swprintf(emu_version, sizeof(emu_version), L"%ls v%ls", EMU_NAME_W, EMU_VERSION_FULL_W); #ifdef EMU_GIT_HASH - swprintf(&emu_version[i], sizeof(emu_version) - i, L" [%ls]", EMU_GIT_HASH_W); + i += swprintf(&emu_version[i], sizeof(emu_version) - i, L" [%ls]", EMU_GIT_HASH_W); #endif +#if defined(__arm__) || defined(__TARGET_ARCH_ARM) +# define ARCH_STR L"arm" +#elif defined(__aarch64__) || defined(_M_ARM64) +# define ARCH_STR L"arm64" +#elif defined(__i386) || defined(__i386__) || defined(_M_IX86) +# define ARCH_STR L"i386" +#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64) +# define ARCH_STR L"x86_64" +#else +# define ARCH_STR L"unknown" +#endif + swprintf(&emu_version[i], sizeof(emu_version) - i, L" [%ls, %ls]", ARCH_STR, plat_get_string(IDS_DYNAREC)); + tdconfig.cbSize = sizeof(tdconfig); tdconfig.hwndParent = hwnd; tdconfig.hInstance = hinstance; diff --git a/src/win/win_cdrom.c b/src/win/win_cdrom.c index 00195bcda..bfd62383a 100644 --- a/src/win/win_cdrom.c +++ b/src/win/win_cdrom.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * diff --git a/src/win/win_devconf.c b/src/win/win_devconf.c index c867dab9f..5a833d5e5 100644 --- a/src/win/win_devconf.c +++ b/src/win/win_devconf.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2018 Sarah Walker. diff --git a/src/win/win_icon.c b/src/win/win_icon.c index d23a325ff..64acc44b0 100644 --- a/src/win/win_icon.c +++ b/src/win/win_icon.c @@ -9,6 +9,7 @@ * Implement the application's icon changing system. * * + * * Authors: Laci bá' * * Copyright 2021 Laci bá'. diff --git a/src/win/win_joystick.cpp b/src/win/win_joystick.cpp index ab9a2907e..42ab8bd69 100644 --- a/src/win/win_joystick.cpp +++ b/src/win/win_joystick.cpp @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * * Copyright 2008-2019 Sarah Walker. diff --git a/src/win/win_joystick_rawinput.c b/src/win/win_joystick_rawinput.c index efaf76f01..2976a54b9 100644 --- a/src/win/win_joystick_rawinput.c +++ b/src/win/win_joystick_rawinput.c @@ -8,7 +8,9 @@ * * RawInput joystick interface. * - * Authors: Sarah Walker, + * + * + * Authors: Sarah Walker, * Miran Grca, * GH Cao, * diff --git a/src/win/win_joystick_xinput.c b/src/win/win_joystick_xinput.c index caf8f3452..2f98e5241 100644 --- a/src/win/win_joystick_xinput.c +++ b/src/win/win_joystick_xinput.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * GH Cao, * diff --git a/src/win/win_mouse.c b/src/win/win_mouse.c index 4490328a9..1a914aa9b 100644 --- a/src/win/win_mouse.c +++ b/src/win/win_mouse.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * GH Cao, * diff --git a/src/win/win_opengl.c b/src/win/win_opengl.c index d9a492927..586632aaa 100644 --- a/src/win/win_opengl.c +++ b/src/win/win_opengl.c @@ -15,6 +15,8 @@ * (UI) options * More error handling * + * + * * Authors: Teemu Korhonen * * Copyright 2021 Teemu Korhonen @@ -63,7 +65,7 @@ typedef LONG atomic_flag; static const int INIT_WIDTH = 640; static const int INIT_HEIGHT = 400; -static const int BUFFERPIXELS = 4194304; /* Same size as render_buffer, pow(2048+64,2). */ +static const int BUFFERPIXELS = 4194304; /* Same size as render_buffer, pow(2048 + 64, 2). */ static const int BUFFERBYTES = 16777216; /* Pixel is 4 bytes. */ static const int BUFFERCOUNT = 3; /* How many buffers to use for pixel transfer (2-3 is commonly recommended). */ static const int ROW_LENGTH = 2048; /* Source buffer row lenght (including padding) */ diff --git a/src/win/win_opengl_glslp.c b/src/win/win_opengl_glslp.c index c3d40a56e..47cc755dc 100644 --- a/src/win/win_opengl_glslp.c +++ b/src/win/win_opengl_glslp.c @@ -11,6 +11,8 @@ * * TODO: Read .glslp files for multipass shaders and settings. * + * + * * Authors: Teemu Korhonen * * Copyright 2021 Teemu Korhonen diff --git a/src/win/win_settings.c b/src/win/win_settings.c index d6e0c0693..37a8aafb0 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -14,7 +14,7 @@ * David Hrdlička, * * Copyright 2016-2019 Miran Grca. - * Copyright 2018,2019 David Hrdlička. + * Copyright 2018-2019 David Hrdlička. * Copyright 2021 Laci bá' * Copyright 2021-2022 Jasmine Iwanek. */ @@ -93,18 +93,20 @@ static int temp_dynarec; #endif /* Video category */ -static int temp_gfxcard, temp_gfxcard_2, temp_ibm8514, temp_voodoo, temp_xga; +static int temp_gfxcard[2], temp_ibm8514, temp_voodoo, temp_xga; /* Input devices category */ static int temp_mouse, temp_joystick; /* Sound category */ -static int temp_sound_card, temp_midi_output_device, temp_midi_input_device, temp_mpu401, temp_SSI2001, temp_GAMEBLASTER, temp_GUS; +static int temp_sound_card[SOUND_CARD_MAX]; +static int temp_midi_output_device, temp_midi_input_device, temp_mpu401; static int temp_float, temp_fm_driver; /* Network category */ -static int temp_net_type, temp_net_card; -static char temp_pcap_dev[128]; +static int temp_net_type[NET_CARD_MAX]; +static int temp_net_card[NET_CARD_MAX]; +static char temp_pcap_dev[NET_CARD_MAX][128]; /* Ports category */ static int temp_lpt_devices[PARALLEL_MAX]; @@ -324,8 +326,8 @@ win_settings_init(void) temp_sync = time_sync; /* Video category */ - temp_gfxcard = gfxcard; - temp_gfxcard_2 = gfxcard_2; + temp_gfxcard[0] = gfxcard[0]; + temp_gfxcard[1] = gfxcard[1]; temp_voodoo = voodoo_enabled; temp_ibm8514 = ibm8514_enabled; temp_xga = xga_enabled; @@ -335,24 +337,24 @@ win_settings_init(void) temp_joystick = joystick_type; /* Sound category */ - temp_sound_card = sound_card_current; + for (i = 0; i < SOUND_CARD_MAX; i++) + temp_sound_card[i] = sound_card_current[i]; temp_midi_output_device = midi_output_device_current; temp_midi_input_device = midi_input_device_current; temp_mpu401 = mpu401_standalone_enable; - temp_SSI2001 = SSI2001; - temp_GAMEBLASTER = GAMEBLASTER; - temp_GUS = GUS; temp_float = sound_is_float; temp_fm_driver = fm_driver; /* Network category */ - temp_net_type = net_cards_conf[0].net_type; - memset(temp_pcap_dev, 0, sizeof(temp_pcap_dev)); -#ifdef ENABLE_SETTINGS_LOG - assert(sizeof(temp_pcap_dev) == sizeof(net_cards_conf[0].host_dev_name)); -#endif - memcpy(temp_pcap_dev, net_cards_conf[0].host_dev_name, sizeof(net_cards_conf[0].host_dev_name)); - temp_net_card = net_cards_conf[0].device_num; + for (i = 0; i < NET_CARD_MAX; i++) { + temp_net_type[i] = net_cards_conf[i].net_type; + memset(temp_pcap_dev[i], 0, sizeof(temp_pcap_dev[i])); +# ifdef ENABLE_SETTINGS_LOG + assert(sizeof(temp_pcap_dev[i]) == sizeof(net_cards_conf[i].host_dev_name)); +# endif + memcpy(temp_pcap_dev[i], net_cards_conf[i].host_dev_name, sizeof(net_cards_conf[i].host_dev_name)); + temp_net_card[i] = net_cards_conf[i].device_num; + } /* Ports category */ for (i = 0; i < PARALLEL_MAX; i++) { @@ -451,8 +453,8 @@ win_settings_changed(void) i = i || (temp_sync != time_sync); /* Video category */ - i = i || (gfxcard != temp_gfxcard); - i = i || (gfxcard_2 != temp_gfxcard_2); + i = i || (gfxcard[0] != temp_gfxcard[0]); + i = i || (gfxcard[1] != temp_gfxcard[1]); i = i || (voodoo_enabled != temp_voodoo); i = i || (ibm8514_enabled != temp_ibm8514); i = i || (xga_enabled != temp_xga); @@ -462,20 +464,20 @@ win_settings_changed(void) i = i || (joystick_type != temp_joystick); /* Sound category */ - i = i || (sound_card_current != temp_sound_card); + for (j = 0; j < SOUND_CARD_MAX; j++) + i = i || (sound_card_current[j] != temp_sound_card[j]); i = i || (midi_output_device_current != temp_midi_output_device); i = i || (midi_input_device_current != temp_midi_input_device); i = i || (mpu401_standalone_enable != temp_mpu401); - i = i || (SSI2001 != temp_SSI2001); - i = i || (GAMEBLASTER != temp_GAMEBLASTER); - i = i || (GUS != temp_GUS); i = i || (sound_is_float != temp_float); i = i || (fm_driver != temp_fm_driver); /* Network category */ - i = i || (net_cards_conf[i].net_type != temp_net_type); - i = i || strcmp(temp_pcap_dev, net_cards_conf[0].host_dev_name); - i = i || (net_cards_conf[0].device_num != temp_net_card); + for (j = 0; j < NET_CARD_MAX; j++) { + i = i || (net_cards_conf[j].net_type != temp_net_type[j]); + i = i || strcmp(temp_pcap_dev[j], net_cards_conf[j].host_dev_name); + i = i || (net_cards_conf[j].device_num != temp_net_card[j]); + } /* Ports category */ for (j = 0; j < PARALLEL_MAX; j++) { @@ -544,8 +546,8 @@ win_settings_save(void) time_sync = temp_sync; /* Video category */ - gfxcard = temp_gfxcard; - gfxcard_2 = temp_gfxcard_2; + gfxcard[0] = temp_gfxcard[0]; + gfxcard[1] = temp_gfxcard[1]; voodoo_enabled = temp_voodoo; ibm8514_enabled = temp_ibm8514; xga_enabled = temp_xga; @@ -555,21 +557,21 @@ win_settings_save(void) joystick_type = temp_joystick; /* Sound category */ - sound_card_current = temp_sound_card; + for (i = 0; i < SOUND_CARD_MAX; i++) + sound_card_current[i] = temp_sound_card[i]; midi_output_device_current = temp_midi_output_device; midi_input_device_current = temp_midi_input_device; mpu401_standalone_enable = temp_mpu401; - SSI2001 = temp_SSI2001; - GAMEBLASTER = temp_GAMEBLASTER; - GUS = temp_GUS; sound_is_float = temp_float; fm_driver = temp_fm_driver; /* Network category */ - net_cards_conf[i].net_type = temp_net_type; - memset(net_cards_conf[0].host_dev_name, '\0', sizeof(net_cards_conf[0].host_dev_name)); - strcpy(net_cards_conf[0].host_dev_name, temp_pcap_dev); - net_cards_conf[0].device_num = temp_net_card; + for (i = 0; i < NET_CARD_MAX; i++) { + net_cards_conf[i].net_type = temp_net_type[i]; + memset(net_cards_conf[i].host_dev_name, '\0', sizeof(net_cards_conf[i].host_dev_name)); + strcpy(net_cards_conf[i].host_dev_name, temp_pcap_dev[i]); + net_cards_conf[i].device_num = temp_net_card[i]; + } /* Ports category */ for (i = 0; i < PARALLEL_MAX; i++) { @@ -1088,7 +1090,7 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) else settings_add_string(hdlg, IDC_COMBO_VIDEO, (LPARAM) device_name); settings_list_to_device[0][d] = c; - if ((c == 0) || (c == temp_gfxcard)) + if ((c == 0) || (c == temp_gfxcard[0])) settings_set_cur_sel(hdlg, IDC_COMBO_VIDEO, d); d++; } @@ -1103,7 +1105,7 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(e)); // Secondary Video Card - c = 0; + c = d = 0; settings_reset_content(hdlg, IDC_COMBO_VIDEO_2); while (1) { @@ -1118,15 +1120,20 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) if (!device_name[0]) break; + if ((c > 1) && (video_card_get_flags(c) == video_card_get_flags(temp_gfxcard[0]))) { + c++; + continue; + } + if (video_card_available(c) && device_is_valid(video_card_getdevice(c), temp_machine)) { if (c == 0) // "None" settings_add_string(hdlg, IDC_COMBO_VIDEO_2, win_get_string(IDS_2104)); else if (c == 1) // "Internal" settings_add_string(hdlg, IDC_COMBO_VIDEO_2, win_get_string(IDS_2119)); - else if (video_card_get_flags(c) != video_card_get_flags(gfxcard)) + else settings_add_string(hdlg, IDC_COMBO_VIDEO_2, (LPARAM) device_name); settings_list_to_device[1][d] = c; - if ((c == 0) || (c == temp_gfxcard_2)) + if ((c == 0) || (c == temp_gfxcard[1])) settings_set_cur_sel(hdlg, IDC_COMBO_VIDEO_2, d); d++; } @@ -1156,13 +1163,56 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_COMBO_VIDEO: - temp_gfxcard = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)]; - settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(temp_gfxcard)); + temp_gfxcard[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)]; + settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(temp_gfxcard[0])); + + // Secondary Video Card + c = d = 0; + settings_reset_content(hdlg, IDC_COMBO_VIDEO_2); + + while (1) { + /* Skip "internal" if machine doesn't have it. */ + if ((c == 1) && !machine_has_flags(temp_machine, MACHINE_VIDEO)) { + c++; + continue; + } + + generate_device_name(video_card_getdevice(c), video_get_internal_name(c), 1); + + if (!device_name[0]) + break; + + if ((c > 1) && (video_card_get_flags(c) == video_card_get_flags(temp_gfxcard[0]))) { + c++; + continue; + } + + if (video_card_available(c) && device_is_valid(video_card_getdevice(c), temp_machine)) { + if (c == 0) // "None" + settings_add_string(hdlg, IDC_COMBO_VIDEO_2, win_get_string(IDS_2104)); + else if (c == 1) // "Internal" + settings_add_string(hdlg, IDC_COMBO_VIDEO_2, win_get_string(IDS_2119)); + else + settings_add_string(hdlg, IDC_COMBO_VIDEO_2, (LPARAM) device_name); + settings_list_to_device[1][d] = c; + if ((c == 0) || (c == temp_gfxcard[1])) + settings_set_cur_sel(hdlg, IDC_COMBO_VIDEO_2, d); + d++; + } + + c++; + + settings_process_messages(); + } + + settings_enable_window(hdlg, IDC_COMBO_VIDEO_2, !machine_has_flags(temp_machine, MACHINE_VIDEO_ONLY)); + e = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)]; + settings_enable_window(hdlg, IDC_CONFIGURE_VID_2, video_card_has_config(e)); break; case IDC_COMBO_VIDEO_2: - temp_gfxcard_2 = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)]; - settings_enable_window(hdlg, IDC_CONFIGURE_VID_2, video_card_has_config(temp_gfxcard_2)); + temp_gfxcard[1] = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)]; + settings_enable_window(hdlg, IDC_CONFIGURE_VID_2, video_card_has_config(temp_gfxcard[1])); break; case IDC_CHECK_VOODOO: @@ -1184,31 +1234,30 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) break; case IDC_BUTTON_XGA: - if (machine_has_bus(temp_machine, MACHINE_BUS_MCA) > 0) { + if (machine_has_bus(temp_machine, MACHINE_BUS_MCA) > 0) temp_deviceconfig |= deviceconfig_open(hdlg, (void *) &xga_device); - } else { + else temp_deviceconfig |= deviceconfig_open(hdlg, (void *) &xga_isa_device); - } break; case IDC_CONFIGURE_VID: - temp_gfxcard = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)]; - temp_deviceconfig |= deviceconfig_open(hdlg, (void *) video_card_getdevice(temp_gfxcard)); + temp_gfxcard[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)]; + temp_deviceconfig |= deviceconfig_open(hdlg, (void *) video_card_getdevice(temp_gfxcard[0])); break; case IDC_CONFIGURE_VID_2: - temp_gfxcard_2 = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)]; - temp_deviceconfig |= deviceconfig_open(hdlg, (void *) video_card_getdevice(temp_gfxcard_2)); + temp_gfxcard[1] = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)]; + temp_deviceconfig |= deviceconfig_open(hdlg, (void *) video_card_getdevice(temp_gfxcard[1])); break; } return FALSE; case WM_SAVESETTINGS: - temp_gfxcard = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)]; - temp_gfxcard_2 = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)]; - temp_voodoo = settings_get_check(hdlg, IDC_CHECK_VOODOO); - temp_ibm8514 = settings_get_check(hdlg, IDC_CHECK_IBM8514); - temp_xga = settings_get_check(hdlg, IDC_CHECK_XGA); + temp_gfxcard[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)]; + temp_gfxcard[1] = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO_2)]; + temp_voodoo = settings_get_check(hdlg, IDC_CHECK_VOODOO); + temp_ibm8514 = settings_get_check(hdlg, IDC_CHECK_IBM8514); + temp_xga = settings_get_check(hdlg, IDC_CHECK_XGA); default: return FALSE; @@ -1349,16 +1398,16 @@ static BOOL CALLBACK #endif win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) { - int c, d; + uint16_t c, d; LPTSTR lptsTemp; - const device_t *sound_dev; + const device_t *sound_dev[SOUND_CARD_MAX]; switch (message) { case WM_INITDIALOG: lptsTemp = (LPTSTR) malloc(512 * sizeof(WCHAR)); c = d = 0; - settings_reset_content(hdlg, IDC_COMBO_SOUND); + settings_reset_content(hdlg, IDC_COMBO_SOUND1); while (1) { /* Skip "internal" if machine doesn't have it. */ if ((c == 1) && !machine_has_flags(temp_machine, MACHINE_SOUND)) { @@ -1372,18 +1421,18 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) break; if (sound_card_available(c)) { - sound_dev = sound_card_getdevice(c); + sound_dev[0] = sound_card_getdevice(c); - if (device_is_valid(sound_dev, temp_machine)) { + if (device_is_valid(sound_dev[0], temp_machine)) { if (c == 0) - settings_add_string(hdlg, IDC_COMBO_SOUND, win_get_string(IDS_2104)); + settings_add_string(hdlg, IDC_COMBO_SOUND1, win_get_string(IDS_2104)); else if (c == 1) - settings_add_string(hdlg, IDC_COMBO_SOUND, win_get_string(IDS_2119)); + settings_add_string(hdlg, IDC_COMBO_SOUND1, win_get_string(IDS_2119)); else - settings_add_string(hdlg, IDC_COMBO_SOUND, (LPARAM) device_name); + settings_add_string(hdlg, IDC_COMBO_SOUND1, (LPARAM) device_name); settings_list_to_device[0][d] = c; - if ((c == 0) || (c == temp_sound_card)) - settings_set_cur_sel(hdlg, IDC_COMBO_SOUND, d); + if ((c == 0) || (c == temp_sound_card[0])) + settings_set_cur_sel(hdlg, IDC_COMBO_SOUND1, d); d++; } } @@ -1391,8 +1440,119 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) c++; } - settings_enable_window(hdlg, IDC_COMBO_SOUND, d); - settings_enable_window(hdlg, IDC_CONFIGURE_SND, sound_card_has_config(temp_sound_card)); + settings_enable_window(hdlg, IDC_COMBO_SOUND1, d); + settings_enable_window(hdlg, IDC_CONFIGURE_SND1, sound_card_has_config(temp_sound_card[0])); + + c = d = 0; + settings_reset_content(hdlg, IDC_COMBO_SOUND2); + while (1) { + /* Skip "internal" */ + if (c == 1) { + c++; + continue; + } + + generate_device_name(sound_card_getdevice(c), sound_card_get_internal_name(c), 1); + + if (!device_name[0]) + break; + + if (sound_card_available(c)) { + sound_dev[1] = sound_card_getdevice(c); + + if (device_is_valid(sound_dev[1], temp_machine)) { + if (c == 0) + settings_add_string(hdlg, IDC_COMBO_SOUND2, win_get_string(IDS_2104)); + else if (c == 1) + settings_add_string(hdlg, IDC_COMBO_SOUND2, win_get_string(IDS_2119)); + else + settings_add_string(hdlg, IDC_COMBO_SOUND2, (LPARAM) device_name); + settings_list_to_device[0][d] = c; + if ((c == 0) || (c == temp_sound_card[1])) + settings_set_cur_sel(hdlg, IDC_COMBO_SOUND2, d); + d++; + } + } + + c++; + } + + settings_enable_window(hdlg, IDC_COMBO_SOUND2, d); + settings_enable_window(hdlg, IDC_CONFIGURE_SND2, sound_card_has_config(temp_sound_card[1])); + + c = d = 0; + settings_reset_content(hdlg, IDC_COMBO_SOUND3); + while (1) { + /* Skip "internal" */ + if (c == 1) { + c++; + continue; + } + + generate_device_name(sound_card_getdevice(c), sound_card_get_internal_name(c), 1); + + if (!device_name[0]) + break; + + if (sound_card_available(c)) { + sound_dev[2] = sound_card_getdevice(c); + + if (device_is_valid(sound_dev[2], temp_machine)) { + if (c == 0) + settings_add_string(hdlg, IDC_COMBO_SOUND3, win_get_string(IDS_2104)); + else if (c == 1) + settings_add_string(hdlg, IDC_COMBO_SOUND3, win_get_string(IDS_2119)); + else + settings_add_string(hdlg, IDC_COMBO_SOUND3, (LPARAM) device_name); + settings_list_to_device[0][d] = c; + if ((c == 0) || (c == temp_sound_card[2])) + settings_set_cur_sel(hdlg, IDC_COMBO_SOUND3, d); + d++; + } + } + + c++; + } + + settings_enable_window(hdlg, IDC_COMBO_SOUND3, d); + settings_enable_window(hdlg, IDC_CONFIGURE_SND3, sound_card_has_config(temp_sound_card[2])); + + c = d = 0; + settings_reset_content(hdlg, IDC_COMBO_SOUND4); + while (1) { + /* Skip "internal" */ + if (c == 1) { + c++; + continue; + } + + generate_device_name(sound_card_getdevice(c), sound_card_get_internal_name(c), 1); + + if (!device_name[0]) + break; + + if (sound_card_available(c)) { + sound_dev[3] = sound_card_getdevice(c); + + if (device_is_valid(sound_dev[3], temp_machine)) { + if (c == 0) + settings_add_string(hdlg, IDC_COMBO_SOUND4, win_get_string(IDS_2104)); + else if (c == 1) + settings_add_string(hdlg, IDC_COMBO_SOUND4, win_get_string(IDS_2119)); + else + settings_add_string(hdlg, IDC_COMBO_SOUND4, (LPARAM) device_name); + settings_list_to_device[0][d] = c; + if ((c == 0) || (c == temp_sound_card[3])) + settings_set_cur_sel(hdlg, IDC_COMBO_SOUND4, d); + d++; + } + } + + c++; + } + + settings_enable_window(hdlg, IDC_COMBO_SOUND4, d); + settings_enable_window(hdlg, IDC_CONFIGURE_SND4, sound_card_has_config(temp_sound_card[3])); c = d = 0; settings_reset_content(hdlg, IDC_COMBO_MIDI_OUT); @@ -1444,15 +1604,6 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) settings_set_check(hdlg, IDC_CHECK_MPU401, temp_mpu401); settings_enable_window(hdlg, IDC_CHECK_MPU401, mpu401_standalone_allow()); settings_enable_window(hdlg, IDC_CONFIGURE_MPU401, mpu401_standalone_allow() && temp_mpu401); - settings_enable_window(hdlg, IDC_CHECK_CMS, machine_has_bus(temp_machine, MACHINE_BUS_ISA)); - settings_set_check(hdlg, IDC_CHECK_CMS, temp_GAMEBLASTER); - settings_enable_window(hdlg, IDC_CONFIGURE_CMS, machine_has_bus(temp_machine, MACHINE_BUS_ISA) && temp_GAMEBLASTER); - settings_enable_window(hdlg, IDC_CHECK_GUS, machine_has_bus(temp_machine, MACHINE_BUS_ISA16)); - settings_set_check(hdlg, IDC_CHECK_GUS, temp_GUS); - settings_enable_window(hdlg, IDC_CONFIGURE_GUS, machine_has_bus(temp_machine, MACHINE_BUS_ISA16) && temp_GUS); - settings_enable_window(hdlg, IDC_CHECK_SSI, machine_has_bus(temp_machine, MACHINE_BUS_ISA)); - settings_set_check(hdlg, IDC_CHECK_SSI, temp_SSI2001); - settings_enable_window(hdlg, IDC_CONFIGURE_SSI, machine_has_bus(temp_machine, MACHINE_BUS_ISA) && temp_SSI2001); settings_set_check(hdlg, IDC_CHECK_FLOAT, temp_float); if (temp_fm_driver == FM_DRV_YMFM) @@ -1466,17 +1617,56 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_COMMAND: switch (LOWORD(wParam)) { - case IDC_COMBO_SOUND: - temp_sound_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND)]; - settings_enable_window(hdlg, IDC_CONFIGURE_SND, sound_card_has_config(temp_sound_card)); + case IDC_COMBO_SOUND1: + temp_sound_card[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND1)]; + settings_enable_window(hdlg, IDC_CONFIGURE_SND1, sound_card_has_config(temp_sound_card[0])); settings_set_check(hdlg, IDC_CHECK_MPU401, temp_mpu401); settings_enable_window(hdlg, IDC_CHECK_MPU401, mpu401_standalone_allow()); settings_enable_window(hdlg, IDC_CONFIGURE_MPU401, mpu401_standalone_allow() && temp_mpu401); break; - case IDC_CONFIGURE_SND: - temp_sound_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND)]; - temp_deviceconfig |= deviceconfig_open(hdlg, (void *) sound_card_getdevice(temp_sound_card)); + case IDC_CONFIGURE_SND1: + temp_sound_card[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND1)]; + temp_deviceconfig |= deviceconfig_open(hdlg, (void *) sound_card_getdevice(temp_sound_card[0])); + break; + + case IDC_COMBO_SOUND2: + temp_sound_card[1] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND2)]; + settings_enable_window(hdlg, IDC_CONFIGURE_SND2, sound_card_has_config(temp_sound_card[1])); + settings_set_check(hdlg, IDC_CHECK_MPU401, temp_mpu401); + settings_enable_window(hdlg, IDC_CHECK_MPU401, mpu401_standalone_allow()); + settings_enable_window(hdlg, IDC_CONFIGURE_MPU401, mpu401_standalone_allow() && temp_mpu401); + break; + + case IDC_CONFIGURE_SND2: + temp_sound_card[1] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND2)]; + temp_deviceconfig |= deviceconfig_open(hdlg, (void *) sound_card_getdevice(temp_sound_card[1])); + break; + + case IDC_COMBO_SOUND3: + temp_sound_card[2] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND3)]; + settings_enable_window(hdlg, IDC_CONFIGURE_SND3, sound_card_has_config(temp_sound_card[2])); + settings_set_check(hdlg, IDC_CHECK_MPU401, temp_mpu401); + settings_enable_window(hdlg, IDC_CHECK_MPU401, mpu401_standalone_allow()); + settings_enable_window(hdlg, IDC_CONFIGURE_MPU401, mpu401_standalone_allow() && temp_mpu401); + break; + + case IDC_CONFIGURE_SND3: + temp_sound_card[2] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND3)]; + temp_deviceconfig |= deviceconfig_open(hdlg, (void *) sound_card_getdevice(temp_sound_card[2])); + break; + + case IDC_COMBO_SOUND4: + temp_sound_card[3] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND4)]; + settings_enable_window(hdlg, IDC_CONFIGURE_SND4, sound_card_has_config(temp_sound_card[3])); + settings_set_check(hdlg, IDC_CHECK_MPU401, temp_mpu401); + settings_enable_window(hdlg, IDC_CHECK_MPU401, mpu401_standalone_allow()); + settings_enable_window(hdlg, IDC_CONFIGURE_MPU401, mpu401_standalone_allow() && temp_mpu401); + break; + + case IDC_CONFIGURE_SND4: + temp_sound_card[3] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND4)]; + temp_deviceconfig |= deviceconfig_open(hdlg, (void *) sound_card_getdevice(temp_sound_card[3])); break; case IDC_COMBO_MIDI_OUT: @@ -1514,46 +1704,17 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) case IDC_CONFIGURE_MPU401: temp_deviceconfig |= deviceconfig_open(hdlg, machine_has_bus(temp_machine, MACHINE_BUS_MCA) ? (void *) &mpu401_mca_device : (void *) &mpu401_device); break; - - case IDC_CHECK_CMS: - temp_GAMEBLASTER = settings_get_check(hdlg, IDC_CHECK_CMS); - - settings_enable_window(hdlg, IDC_CONFIGURE_CMS, temp_GAMEBLASTER); - break; - - case IDC_CONFIGURE_CMS: - temp_deviceconfig |= deviceconfig_open(hdlg, &cms_device); - break; - - case IDC_CHECK_GUS: - temp_GUS = settings_get_check(hdlg, IDC_CHECK_GUS); - settings_enable_window(hdlg, IDC_CONFIGURE_GUS, temp_GUS); - break; - - case IDC_CONFIGURE_GUS: - temp_deviceconfig |= deviceconfig_open(hdlg, (void *) &gus_device); - break; - - case IDC_CHECK_SSI: - temp_SSI2001 = settings_get_check(hdlg, IDC_CHECK_SSI); - - settings_enable_window(hdlg, IDC_CONFIGURE_SSI, temp_SSI2001); - break; - - case IDC_CONFIGURE_SSI: - temp_deviceconfig |= deviceconfig_open(hdlg, &ssi2001_device); - break; } return FALSE; case WM_SAVESETTINGS: - temp_sound_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND)]; + temp_sound_card[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND1)]; + temp_sound_card[1] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND2)]; + temp_sound_card[2] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND3)]; + temp_sound_card[3] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND4)]; temp_midi_output_device = settings_list_to_midi[settings_get_cur_sel(hdlg, IDC_COMBO_MIDI_OUT)]; temp_midi_input_device = settings_list_to_midi_in[settings_get_cur_sel(hdlg, IDC_COMBO_MIDI_IN)]; temp_mpu401 = settings_get_check(hdlg, IDC_CHECK_MPU401); - temp_GAMEBLASTER = settings_get_check(hdlg, IDC_CHECK_CMS); - temp_GUS = settings_get_check(hdlg, IDC_CHECK_GUS); - temp_SSI2001 = settings_get_check(hdlg, IDC_CHECK_SSI); temp_float = settings_get_check(hdlg, IDC_CHECK_FLOAT); if (settings_get_check(hdlg, IDC_RADIO_FM_DRV_NUKED)) temp_fm_driver = FM_DRV_NUKED; @@ -1849,10 +2010,16 @@ network_recalc_combos(HWND hdlg) { ignore_change = 1; - settings_enable_window(hdlg, IDC_COMBO_PCAP, temp_net_type == NET_TYPE_PCAP); - settings_enable_window(hdlg, IDC_COMBO_NET, - (temp_net_type == NET_TYPE_SLIRP) || ((temp_net_type == NET_TYPE_PCAP) && (network_dev_to_id(temp_pcap_dev) > 0))); - settings_enable_window(hdlg, IDC_CONFIGURE_NET, network_card_has_config(temp_net_card) && ((temp_net_type == NET_TYPE_SLIRP) || ((temp_net_type == NET_TYPE_PCAP) && (network_dev_to_id(temp_pcap_dev) > 0)))); +#if 0 + for (uint8_t i = 0; i < NET_CARD_MAX; i++) { +#endif + settings_enable_window(hdlg, IDC_COMBO_PCAP1, temp_net_type[0] == NET_TYPE_PCAP); + settings_enable_window(hdlg, IDC_COMBO_NET1, + (temp_net_type[0] == NET_TYPE_SLIRP) || ((temp_net_type[0] == NET_TYPE_PCAP) && (network_dev_to_id(temp_pcap_dev[0]) > 0))); + settings_enable_window(hdlg, IDC_CONFIGURE_NET1, network_card_has_config(temp_net_card[0]) && ((temp_net_type[0] == NET_TYPE_SLIRP) || ((temp_net_type[0] == NET_TYPE_PCAP) && (network_dev_to_id(temp_pcap_dev[0]) > 0)))); +#if 0 + } +#endif ignore_change = 0; } @@ -1871,90 +2038,120 @@ win_settings_network_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: lptsTemp = (LPTSTR) malloc(512 * sizeof(WCHAR)); - settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"None"); - settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"SLiRP"); - settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"PCap"); - settings_set_cur_sel(hdlg, IDC_COMBO_NET_TYPE, temp_net_type); - settings_enable_window(hdlg, IDC_COMBO_PCAP, temp_net_type == NET_TYPE_PCAP); +#if 0 + for (uint8_t i = 0; i < NET_CARD_MAX; i++) { +#endif + settings_add_string(hdlg, IDC_COMBO_NET1_TYPE, (LPARAM) L"None"); + settings_add_string(hdlg, IDC_COMBO_NET1_TYPE, (LPARAM) L"SLiRP"); + settings_add_string(hdlg, IDC_COMBO_NET1_TYPE, (LPARAM) L"PCap"); + settings_set_cur_sel(hdlg, IDC_COMBO_NET1_TYPE, temp_net_type[0]); + settings_enable_window(hdlg, IDC_COMBO_PCAP1, temp_net_type[0] == NET_TYPE_PCAP); - for (c = 0; c < network_ndev; c++) { - mbstowcs(lptsTemp, network_devs[c].description, strlen(network_devs[c].description) + 1); - settings_add_string(hdlg, IDC_COMBO_PCAP, (LPARAM) lptsTemp); - } - settings_set_cur_sel(hdlg, IDC_COMBO_PCAP, network_dev_to_id(temp_pcap_dev)); + for (c = 0; c < network_ndev; c++) { + mbstowcs(lptsTemp, network_devs[c].description, strlen(network_devs[c].description) + 1); + settings_add_string(hdlg, IDC_COMBO_PCAP1, (LPARAM) lptsTemp); + } + settings_set_cur_sel(hdlg, IDC_COMBO_PCAP1, network_dev_to_id(temp_pcap_dev[0])); - /* NIC config */ - c = d = 0; - settings_reset_content(hdlg, IDC_COMBO_NET); - while (1) { - generate_device_name(network_card_getdevice(c), network_card_get_internal_name(c), 1); + /* NIC config */ + c = d = 0; + settings_reset_content(hdlg, IDC_COMBO_NET1); + while (1) { + generate_device_name(network_card_getdevice(c), network_card_get_internal_name(c), 1); - if (device_name[0] == L'\0') - break; + if (device_name[0] == L'\0') + break; - if (network_card_available(c) && device_is_valid(network_card_getdevice(c), temp_machine)) { - if (c == 0) - settings_add_string(hdlg, IDC_COMBO_NET, win_get_string(IDS_2104)); - else - settings_add_string(hdlg, IDC_COMBO_NET, (LPARAM) device_name); - settings_list_to_device[0][d] = c; - if ((c == 0) || (c == temp_net_card)) - settings_set_cur_sel(hdlg, IDC_COMBO_NET, d); - d++; + if (network_card_available(c) && device_is_valid(network_card_getdevice(c), temp_machine)) { + if (c == 0) + settings_add_string(hdlg, IDC_COMBO_NET1, win_get_string(IDS_2104)); + else + settings_add_string(hdlg, IDC_COMBO_NET1, (LPARAM) device_name); + settings_list_to_device[0][d] = c; + if ((c == 0) || (c == temp_net_card[0])) + settings_set_cur_sel(hdlg, IDC_COMBO_NET1, d); + d++; + } + + c++; } - c++; + settings_enable_window(hdlg, IDC_COMBO_NET1, d); + network_recalc_combos(hdlg); + free(lptsTemp); +#if 0 } - - settings_enable_window(hdlg, IDC_COMBO_NET, d); - network_recalc_combos(hdlg); - free(lptsTemp); - +#endif return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { - case IDC_COMBO_NET_TYPE: + case IDC_COMBO_NET1_TYPE: +#if 0 + case IDC_COMBO_NET2_TYPE: + case IDC_COMBO_NET3_TYPE: + case IDC_COMBO_NET4_TYPE: +#endif if (ignore_change) return FALSE; - temp_net_type = settings_get_cur_sel(hdlg, IDC_COMBO_NET_TYPE); + temp_net_type[0] = settings_get_cur_sel(hdlg, IDC_COMBO_NET1_TYPE); network_recalc_combos(hdlg); break; - case IDC_COMBO_PCAP: + case IDC_COMBO_PCAP1: +#if 0 + case IDC_COMBO_PCAP2: + case IDC_COMBO_PCAP3: + case IDC_COMBO_PCAP4: +#endif if (ignore_change) return FALSE; - memset(temp_pcap_dev, '\0', sizeof(temp_pcap_dev)); - strcpy(temp_pcap_dev, network_devs[settings_get_cur_sel(hdlg, IDC_COMBO_PCAP)].device); + memset(temp_pcap_dev[0], '\0', sizeof(temp_pcap_dev[0])); + strcpy(temp_pcap_dev[0], network_devs[settings_get_cur_sel(hdlg, IDC_COMBO_PCAP1)].device); network_recalc_combos(hdlg); break; - case IDC_COMBO_NET: + case IDC_COMBO_NET1: +#if 0 + case IDC_COMBO_NET2: + case IDC_COMBO_NET3: + case IDC_COMBO_NET4: +#endif if (ignore_change) return FALSE; - temp_net_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET)]; + temp_net_card[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET1)]; network_recalc_combos(hdlg); break; - case IDC_CONFIGURE_NET: + case IDC_CONFIGURE_NET1: +#if 0 + case IDC_CONFIGURE_NET2: + case IDC_CONFIGURE_NET3: + case IDC_CONFIGURE_NET4: +#endif if (ignore_change) return FALSE; - temp_net_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET)]; - temp_deviceconfig |= deviceconfig_open(hdlg, (void *) network_card_getdevice(temp_net_card)); + temp_net_card[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET1)]; + temp_deviceconfig |= deviceconfig_open(hdlg, (void *) network_card_getdevice(temp_net_card[0])); break; } return FALSE; case WM_SAVESETTINGS: - temp_net_type = settings_get_cur_sel(hdlg, IDC_COMBO_NET_TYPE); - memset(temp_pcap_dev, '\0', sizeof(temp_pcap_dev)); - strcpy(temp_pcap_dev, network_devs[settings_get_cur_sel(hdlg, IDC_COMBO_PCAP)].device); - temp_net_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET)]; - +#if 0 + for (uint8_t i = 0; i < NET_CARD_MAX; i++) { +#endif + temp_net_type[0] = settings_get_cur_sel(hdlg, IDC_COMBO_NET1_TYPE); + memset(temp_pcap_dev[0], '\0', sizeof(temp_pcap_dev[0])); + strcpy(temp_pcap_dev[0], network_devs[settings_get_cur_sel(hdlg, IDC_COMBO_PCAP1)].device); + temp_net_card[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET1)]; +#if 0 + } +#endif default: return FALSE; } diff --git a/src/win/win_specify_dim.c b/src/win/win_specify_dim.c index 184c39d4f..30698fac6 100644 --- a/src/win/win_specify_dim.c +++ b/src/win/win_specify_dim.c @@ -130,6 +130,12 @@ SpecifyDimensionsDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM EnableMenuItem(hmenu, IDM_VID_SCALE_2X, vid_resize ? MF_GRAYED : MF_ENABLED); EnableMenuItem(hmenu, IDM_VID_SCALE_3X, vid_resize ? MF_GRAYED : MF_ENABLED); EnableMenuItem(hmenu, IDM_VID_SCALE_4X, vid_resize ? MF_GRAYED : MF_ENABLED); + EnableMenuItem(hmenu, IDM_VID_SCALE_5X, vid_resize ? MF_GRAYED : MF_ENABLED); + EnableMenuItem(hmenu, IDM_VID_SCALE_6X, vid_resize ? MF_GRAYED : MF_ENABLED); + EnableMenuItem(hmenu, IDM_VID_SCALE_7X, vid_resize ? MF_GRAYED : MF_ENABLED); + EnableMenuItem(hmenu, IDM_VID_SCALE_8X, vid_resize ? MF_GRAYED : MF_ENABLED); + EnableMenuItem(hmenu, IDM_VID_SCALE_9X, vid_resize ? MF_GRAYED : MF_ENABLED); + EnableMenuItem(hmenu, IDM_VID_SCALE_10X, vid_resize ? MF_GRAYED : MF_ENABLED); scrnsz_x = fixed_size_x; scrnsz_y = fixed_size_y; diff --git a/src/win/win_thread.c b/src/win/win_thread.c index 97ea3a56c..c110779f2 100644 --- a/src/win/win_thread.c +++ b/src/win/win_thread.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Fred N. van Kempen, * * Copyright 2008-2018 Sarah Walker. diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 0e1ca6700..3144c8ef3 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -10,7 +10,7 @@ * * * - * Authors: Sarah Walker, + * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * @@ -44,7 +44,9 @@ #include <86box/ui.h> #include <86box/win.h> #include <86box/version.h> -#include <86box/discord.h> +#ifdef DISCORD +# include <86box/discord.h> +#endif #ifdef MTR_ENABLED # include @@ -276,6 +278,12 @@ ResetAllMenus(void) CheckMenuItem(menuMain, IDM_VID_SCALE_1X + 1, MF_UNCHECKED); CheckMenuItem(menuMain, IDM_VID_SCALE_1X + 2, MF_UNCHECKED); CheckMenuItem(menuMain, IDM_VID_SCALE_1X + 3, MF_UNCHECKED); + CheckMenuItem(menuMain, IDM_VID_SCALE_1X + 4, MF_UNCHECKED); + CheckMenuItem(menuMain, IDM_VID_SCALE_1X + 5, MF_UNCHECKED); + CheckMenuItem(menuMain, IDM_VID_SCALE_1X + 6, MF_UNCHECKED); + CheckMenuItem(menuMain, IDM_VID_SCALE_1X + 7, MF_UNCHECKED); + CheckMenuItem(menuMain, IDM_VID_SCALE_1X + 8, MF_UNCHECKED); + CheckMenuItem(menuMain, IDM_VID_SCALE_1X + 9, MF_UNCHECKED); CheckMenuItem(menuMain, IDM_VID_HIDPI, MF_UNCHECKED); CheckMenuItem(menuMain, IDM_VID_CGACON, MF_UNCHECKED); @@ -316,10 +324,13 @@ ResetAllMenus(void) video_set_filter_menu(menuMain); +#ifdef DISCORD if (discord_loaded) CheckMenuItem(menuMain, IDM_DISCORD, enable_discord ? MF_CHECKED : MF_UNCHECKED); else EnableMenuItem(menuMain, IDM_DISCORD, MF_DISABLED); +#endif + #ifdef MTR_ENABLED EnableMenuItem(menuMain, IDM_ACTION_END_TRACE, MF_DISABLED); #endif @@ -820,6 +831,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) config_save(); break; +#ifdef DISCORD case IDM_DISCORD: if (!discord_loaded) break; @@ -831,6 +843,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } else discord_close(); break; +#endif default: media_menu_proc(hwnd, message, wParam, lParam); @@ -1212,6 +1225,7 @@ ui_init(int nCmdShow) return (0); } +#ifdef DISCORD if (!discord_load()) { enable_discord = 0; } else if (enable_discord) { @@ -1221,6 +1235,7 @@ ui_init(int nCmdShow) /* Update Discord status */ discord_update_activity(dopause); } +#endif /* Create our main window's class and register it. */ wincl.hInstance = hinstance; @@ -1451,9 +1466,11 @@ ui_init(int nCmdShow) plat_setfullscreen(0); } +#ifdef DISCORD /* Run Discord API callbacks */ if (enable_discord) discord_run_callbacks(); +#endif } timeEndPeriod(1); @@ -1471,8 +1488,10 @@ ui_init(int nCmdShow) win_mouse_close(); +#ifdef DISCORD /* Shut down the Discord integration */ discord_close(); +#endif if (user32_handle != NULL) dynld_close(user32_handle); @@ -1521,9 +1540,11 @@ plat_pause(int p) CheckMenuItem(menuMain, IDM_ACTION_PAUSE, (dopause) ? MF_CHECKED : MF_UNCHECKED); +#ifdef DISCORD /* Update Discord status */ if (enable_discord) discord_update_activity(dopause); +#endif /* Update the toolbar */ ToolBarUpdatePause(p); diff --git a/vcpkg.json b/vcpkg.json index 46ab6bff3..c9fd8eceb 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,7 +2,7 @@ "name": "86box", "version-string": "3.11", "homepage": "https://86box.net/", - "documentation": "http://86box.readthedocs.io/", + "documentation": "https://86box.readthedocs.io/", "license": "GPL-2.0-or-later", "dependencies": [ "freetype",