Merge branch 'master' of ssh://github.com/86Box/86Box into cleanup30

This commit is contained in:
RichardG867
2021-12-28 15:33:38 -03:00
165 changed files with 4085 additions and 3285 deletions

View File

@@ -20,3 +20,15 @@ tab_width = 8
[*.manifest]
indent_style = space
indent_size = 2
[*.yml]
indent_style = space
indent_size = 2
[**/CMakeLists.txt]
indent_style = space
indent_size = 4
[*.cmake]
indent_style = space
indent_size = 4

View File

@@ -84,7 +84,7 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: '86Box-${{ matrix.build.name }}-MSYS2-${{ matrix.environment.msystem }}-${{ github.sha }}'
path: build/artifacts/bin/**
path: build/artifacts/**
vs2019:
name: VS2019 ${{ matrix.build.name }} ${{ matrix.target-arch }} build (${{ matrix.toolset }})
@@ -130,7 +130,7 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: '86Box-${{ matrix.build.name }}-VS2019-${{ matrix.target-arch }}-${{ matrix.toolset }}-${{ github.sha }}'
path: build/artifacts/bin/**
path: build/artifacts/**
linux:
name: "Linux GCC 11"

2
.gitignore vendored
View File

@@ -5,7 +5,6 @@
CMakeFiles
Makefile
*.a
*.cmake
/src/*.exe
/src/86Box
/src/include/86box/version.h
@@ -22,7 +21,6 @@ Makefile
/src/*.log
/src/*.dmp
/src/nvr/
/src/printer/
/src/roms/
/src/screenshots/

View File

@@ -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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2020,2021 David Hrdlička.
#
cmake_minimum_required(VERSION 3.15)
@@ -18,106 +18,146 @@ cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
cmake_policy(SET CMP0079 NEW)
if(VCPKG_TOOLCHAIN AND VCPKG_TARGET_TRIPLET MATCHES "static")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
project(86Box
VERSION 3.2
DESCRIPTION "Emulator of x86-based systems"
HOMEPAGE_URL "https://86box.net"
LANGUAGES C CXX)
include(CPack)
include(CMakeDependentOption)
# Basic build options
if(WIN32)
if(VCPKG_TOOLCHAIN)
# For vcpkg builds we have to respect the linking method used by the
# specified triplet.
set(NO_STATIC_OPTION ON)
if(VCPKG_TARGET_TRIPLET MATCHES "-windows-static$")
# `-static` triplet, use static linking
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(STATIC_BUILD ON)
elseif(VCPKG_TARGET_TRIPLET MATCHES "-windows-static-md$")
# `-static-md` triplet, use static linking with dynamic CRT
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
set(STATIC_BUILD ON)
elseif()
# Regular triplet, use dynamic linking
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
set(STATIC_BUILD OFF)
endif()
endif()
# Prefer static builds on Windows
set(PREFER_STATIC ON)
# Default value for the `WIN32` target property, which specifies whether
# to build the application for the Windows GUI or console subsystem
option(CMAKE_WIN32_EXECUTABLE "Build a Windows GUI executable" ON)
else()
# Prefer dynamic builds everywhere else
set(PREFER_STATIC OFF)
endif()
project(86Box
VERSION 3.1
DESCRIPTION "Emulator of x86-based systems"
HOMEPAGE_URL "https://86box.net"
LANGUAGES C CXX)
if(APPLE)
option(CMAKE_MACOSX_BUNDLE "Build a macOS bundle (.app)" ON)
endif()
if(NOT NO_STATIC_OPTION)
if(PREFER_STATIC)
option(STATIC_BUILD "Static build" ON)
else()
option(STATIC_BUILD "Static build" OFF)
endif()
endif()
# Detect the target architecture by trying to compile `src/arch_detect.c`
try_compile(RESULT_VAR ${CMAKE_BINARY_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/src/arch_detect.c" OUTPUT_VARIABLE ARCH)
string(REGEX MATCH "ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")
string(REPLACE "ARCH " "" ARCH "${ARCH}")
if (NOT ARCH)
set(ARCH unknown)
set(ARCH unknown)
endif()
include(CPack)
include(CMakeDependentOption)
add_compile_definitions(CMAKE)
add_compile_definitions("$<$<CONFIG:Debug>:DEBUG>")
if(WIN32)
# Disables *_s function warnings
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
# Disables *_s function warnings
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
# Disables POSIX name warnings
add_compile_definitions(_CRT_NONSTDC_NO_WARNINGS)
# Disables POSIX name warnings
add_compile_definitions(_CRT_NONSTDC_NO_WARNINGS)
# Disables WinSock deprecation warnings
add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS)
# Disables WinSock deprecation warnings
add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
set(CMAKE_CXX_STANDARD 11)
option(RELEASE "Release build" OFF)
option(USB "USB support" OFF)
option(DYNAREC "Dynamic recompiler" ON)
option(FLUIDSYNTH "FluidSynth" ON)
option(MUNT "MUNT" ON)
option(VRAMDUMP "Video RAM dumping" OFF)
option(DINPUT "DirectInput" OFF)
option(DISCORD "Discord integration" ON)
# Optional features
#
# Option Description Def.
# ------ ----------- ----
option(RELEASE "Release build" OFF)
option(USB "USB support" OFF)
option(DYNAREC "Dynamic recompiler" ON)
option(FLUIDSYNTH "FluidSynth" ON)
option(MUNT "MUNT" ON)
option(VRAMDUMP "Video RAM dumping" OFF)
option(DINPUT "DirectInput" OFF)
option(CPPTHREADS "C++11 threads" ON)
option(NEW_DYNAREC "Use the PCem v15 (\"new\") dynamic recompiler" OFF)
option(MINITRACE "Enable Chrome tracing using the modified minitrace library" OFF)
option(DEV_BRANCH "Development branch" OFF)
option(NEW_DYNAREC "Use the PCem v15 (\"new\") dynamic recompiler" OFF)
# Development branch features
#
# Option Description Def. Condition Otherwise
# ------ ----------- ---- --------- ---------
cmake_dependent_option(AMD_K5 "AMD K5" ON "DEV_BRANCH" OFF)
cmake_dependent_option(CYRIX_6X86 "Cyrix 6x86" ON "DEV_BRANCH" OFF)
cmake_dependent_option(GUSMAX "Gravis UltraSound MAX" ON "DEV_BRANCH" OFF)
cmake_dependent_option(LASERXT "VTech Laser XT" ON "DEV_BRANCH" OFF)
cmake_dependent_option(MGA "Matrox Mystique graphics adapters" ON "DEV_BRANCH" OFF)
cmake_dependent_option(NO_SIO "Machines without emulated Super I/O chips" ON "DEV_BRANCH" OFF)
cmake_dependent_option(OLIVETTI "Olivetti M290" ON "DEV_BRANCH" OFF)
cmake_dependent_option(OPEN_AT "OpenAT" ON "DEV_BRANCH" OFF)
cmake_dependent_option(PAS16 "Pro Audio Spectrum 16" OFF "DEV_BRANCH" OFF)
cmake_dependent_option(SIO_DETECT "Super I/O Detection Helper" ON "DEV_BRANCH" OFF)
cmake_dependent_option(VGAWONDER "ATI VGA Wonder (ATI-18800)" ON "DEV_BRANCH" OFF)
cmake_dependent_option(VNC "VNC renderer" OFF "DEV_BRANCH" OFF)
cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF)
option(MINITRACE "Enable Chrome tracing using the modified minitrace library" OFF)
option(DEV_BRANCH "Development branch" OFF)
CMAKE_DEPENDENT_OPTION(AMD_K5 "AMD K5" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(CYRIX_6X86 "Cyrix 6x86" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(GUSMAX "Gravis UltraSound MAX" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(HEDAKA "Hedaka HED-919" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(I450KX "Intel i450KX" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(LASERXT "VTech Laser XT" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(MGA "Matrox Mystique graphics adapters" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(NO_SIO "Machines without emulated Super I/O chips" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(OLIVETTI "Olivetti M290" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(OPEN_AT "OpenAT" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(OPENGL "OpenGL 3.3 Core renderer" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(PAS16 "Pro Audio Spectrum 16" OFF "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(PS2M70T4 "IBM PS/2 model 70 (type 4)" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(S3TRIO3D2X "S3 Trio3D/2X" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(SIO_DETECT "Super I/O Detection Helper" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(M154X "ALi ALADDiN IV" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(M6117 "ALi M6117" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(VGAWONDER "ATI VGA Wonder (ATI-18800)" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(VNC "VNC renderer" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF)
CMAKE_DEPENDENT_OPTION(VECT486VL "HP Vectra 486VL" ON "DEV_BRANCH" OFF)
# Determine the build type
set(RELEASE_BUILD OFF)
set(BETA_BUILD OFF)
set(ALPHA_BUILD OFF)
string(TOLOWER "${BUILD_TYPE}" BUILD_TYPE_LOWER)
if(BUILD_TYPE_LOWER STREQUAL "release")
add_compile_definitions(RELEASE_BUILD)
# Release build
set(RELEASE_BUILD ON)
add_compile_definitions(RELEASE_BUILD)
elseif(BUILD_TYPE_LOWER STREQUAL "beta")
add_compile_definitions(BETA_BUILD)
# Beta build
set(BETA_BUILD ON)
add_compile_definitions(BETA_BUILD)
elseif(BUILD_TYPE_LOWER STREQUAL "alpha")
add_compile_definitions(ALPHA_BUILD)
# Alpha build
set(ALPHA_BUILD ON)
add_compile_definitions(ALPHA_BUILD)
endif()
# HACK: Avoid a MSVC2019 compiler bug on ARM64 Debug builds
if(MSVC_TOOLSET_VERSION GREATER_EQUAL 142 AND ARCH STREQUAL "arm64")
# Define a cache option in case somebody wants to disable this workaround
set(AVOID_LNK1322 ON CACHE BOOL "Prevent LNK1322 on MSVC2019 ARM64 debug builds")
if(AVOID_LNK1322)
message(STATUS "Working around LNK1322 (86Box#1268)")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Gy")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Gy")
endif()
# Variables introduced by richardg867 for versioning stuff
if(NOT CMAKE_PROJECT_VERSION_PATCH)
set(CMAKE_PROJECT_VERSION_PATCH 0)
endif()
# HACK: MinGW and macOS <10.15 does not have `timespec_get`
include(CheckSymbolExists)
check_symbol_exists(timespec_get time.h HAS_TIMESPEC_GET)
if(HAS_TIMESPEC_GET)
add_compile_definitions(HAS_TIMESPEC_GET)
if(NOT EMU_BUILD_NUM)
set(EMU_BUILD_NUM 0)
endif()
if(NOT EMU_COPYRIGHT_YEAR)
set(EMU_COPYRIGHT_YEAR 2021)
endif()
add_subdirectory(src)

View File

@@ -1,4 +1,4 @@
86Box
86Box [![Build Status](http://ci.86box.net/job/86Box/badge/icon)](http://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.
@@ -28,15 +28,6 @@ It is also recommended to use a manager application with 86Box for easier handli
However, it is also possible to use 86Box on its own with the `--vmpath`/`-P` command line option.
Downloads
---------
The latest stable version of 86Box is **v3.0**, which was released on December 1, 2021, and is available from our [GitHub repository](https://github.com/86Box/86Box/releases/tag/v3.0).
### Automatic builds
We also offer automatic builds, which are built from the latest source code and contain the latest bugfixes and improvements, but may not be as stable and/or optimized as stable builds.
[![Build Status](http://ci.86box.net/job/86Box/badge/icon)](http://ci.86box.net/job/86Box)
Getting started
---------------
See [our documentation](https://86box.readthedocs.io/en/latest/index.html) for an overview of the emulator's features and user interface.

View File

@@ -0,0 +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.
#
# This file is part of the 86Box distribution.
#
# CMake toolchain file defining GCC compiler flags
# for AArch64 (ARM64) targets.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 David Hrdlička.
#
string(APPEND CMAKE_C_FLAGS_INIT " -march=armv8-a -mfloat-abi=hard")
string(APPEND CMAKE_CXX_FLAGS_INIT " -march=armv8-a -mfloat-abi=hard")
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)

View File

@@ -0,0 +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.
#
# This file is part of the 86Box distribution.
#
# CMake toolchain file defining GCC compiler flags
# for ARMv7 targets.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 David Hrdlička.
#
string(APPEND CMAKE_C_FLAGS_INIT " -march=armv7-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}")
string(APPEND CMAKE_CXX_FLAGS_INIT " -march=armv7-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS_INIT}")
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)

View File

@@ -0,0 +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.
#
# This file is part of the 86Box distribution.
#
# CMake toolchain file defining GCC compiler flags
# for 32-bit x86 targets.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 David Hrdlička.
#
string(APPEND CMAKE_C_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}")
string(APPEND CMAKE_CXX_FLAGS_INIT " -m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}")
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)

View File

@@ -0,0 +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.
#
# This file is part of the 86Box distribution.
#
# CMake toolchain file defining GCC compiler flags
# for 64-bit x86 targets.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 David Hrdlička.
#
string(APPEND CMAKE_C_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}")
string(APPEND CMAKE_CXX_FLAGS_INIT " -m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}")
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)

35
cmake/flags-gcc.cmake Normal file
View File

@@ -0,0 +1,35 @@
#
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for 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.
#
# CMake toolchain file defining GCC compiler flags.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 David Hrdlička.
#
# Define our flags
string(APPEND CMAKE_C_FLAGS_INIT " -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing")
string(APPEND CMAKE_CXX_FLAGS_INIT " -fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -g0 -O3")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -g0 -O3")
string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -ggdb -Og")
string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " -ggdb -Og")
string(APPEND CMAKE_C_FLAGS_OPTIMIZED_INIT " -march=native -mtune=native -O3 -ffp-contract=fast -flto")
string(APPEND CMAKE_CXX_FLAGS_OPTIMIZED_INIT " -march=native -mtune=native -O3 -ffp-contract=fast -flto")
# Set up the variables
foreach(LANG C;CXX)
set(CMAKE_${LANG}_FLAGS "$ENV{${LANG}FLAGS} ${CMAKE_${LANG}_FLAGS_INIT}" CACHE STRING "Flags used by the ${LANG} compiler during all build types.")
mark_as_advanced(CMAKE_${LANG}_FLAGS)
foreach(CONFIG RELEASE;DEBUG;OPTIMIZED)
set(CMAKE_${LANG}_FLAGS_${CONFIG} "${CMAKE_${LANG}_FLAGS_${CONFIG}_INIT}" CACHE STRING "Flags used by the ${LANG} compiler during ${CONFIG} builds.")
mark_as_advanced(CMAKE_${LANG}_FLAGS_${CONFIG})
endforeach()
endforeach()

View File

@@ -0,0 +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.
#
# This file is part of the 86Box distribution.
#
# CMake toolchain file for Clang on Windows builds (ARM64 target).
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 David Hrdlička.
#
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-aarch64.cmake)
# Use the GCC-compatible Clang executables in order to use our flags
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
# `llvm-rc` is barely usable as of LLVM 13, using MS' rc.exe for now
set(CMAKE_RC_COMPILER rc)
set(CMAKE_C_COMPILER_TARGET aarch64-pc-windows-msvc)
set(CMAKE_CXX_COMPILER_TARGET aarch64-pc-windows-msvc)
set(CMAKE_SYSTEM_PROCESSOR ARM64)
# TODO: set the vcpkg target triplet perhaps?

View File

@@ -0,0 +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.
#
# This file is part of the 86Box distribution.
#
# CMake toolchain file for Clang on Windows builds (x86 target).
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 David Hrdlička.
#
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-i686.cmake)
# Use the GCC-compatible Clang executables in order to use our flags
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
# `llvm-rc` is barely usable as of LLVM 13, using MS' rc.exe for now
set(CMAKE_RC_COMPILER rc)
set(CMAKE_C_COMPILER_TARGET i686-pc-windows-msvc)
set(CMAKE_CXX_COMPILER_TARGET i686-pc-windows-msvc)
set(CMAKE_SYSTEM_PROCESSOR X86)
# TODO: set the vcpkg target triplet perhaps?

View File

@@ -0,0 +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.
#
# This file is part of the 86Box distribution.
#
# CMake toolchain file for Clang on Windows builds (x64/AMD64 target).
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 David Hrdlička.
#
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-x86_64.cmake)
# Use the GCC-compatible Clang executables in order to use our flags
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
# `llvm-rc` is barely usable as of LLVM 13, using MS' rc.exe for now
set(CMAKE_RC_COMPILER rc)
set(CMAKE_C_COMPILER_TARGET x86_64-pc-windows-msvc)
set(CMAKE_CXX_COMPILER_TARGET x86_64-pc-windows-msvc)
set(CMAKE_SYSTEM_PROCESSOR AMD64)
# TODO: set the vcpkg target triplet perhaps?

View File

@@ -28,6 +28,8 @@
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <stdatomic.h>
#ifndef _WIN32
#include <pwd.h>
#endif
@@ -90,14 +92,13 @@
#include <86box/video.h>
#include <86box/ui.h>
#include <86box/plat.h>
#include <86box/plat_midi.h>
#include <86box/version.h>
/* Stuff that used to be globally declared in plat.h but is now extern there
and declared here instead. */
int dopause; /* system is paused */
int doresize; /* screen resize requested */
atomic_flag doresize; /* screen resize requested */
volatile int is_quit; /* system exit requested */
uint64_t timer_freq;
char emu_version[200]; /* version ID string */
@@ -1041,7 +1042,7 @@ pc_reset_hard_init(void)
/* Reset the CPU module. */
resetx86();
dma_reset();
pic_reset();
pci_pic_reset();
cpu_cache_int_enabled = cpu_cache_ext_enabled = 0;
atfullspeed = 0;
@@ -1286,9 +1287,7 @@ set_screen_size(int x, int y)
/* If the resolution has changed, let the main thread handle it. */
if ((owsx != scrnsz_x) || (owsy != scrnsz_y))
doresize = 1;
else
doresize = 0;
atomic_flag_clear(&doresize);
}

View File

@@ -1,138 +1,90 @@
#
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for IBM
# PC systems and compatibles from 1981 through fairly recent
# system designs based on the PCI bus.
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for 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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# dob205
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# dob205
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2021 dob205.
# Copyright 2020,2021 David Hrdlička.
# Copyright 2021 dob205.
#
# Prepare the macOS app bundle icon depending on the release channel
set(APP_ICON_MACOSX)
if (APPLE)
if(RELEASE_BUILD)
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/release/86Box.icns)
elseif(BETA_BUILD)
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/beta/86Box.icns)
elseif(ALPHA_BUILD)
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/dev/86Box.icns)
else()
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/branch/86Box.icns)
endif()
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
endif()
# WIN32 marks us as a GUI app on Windows
# MACOSX_BUNDLE prepares a macOS application bundle including with the app icon
add_executable(86Box WIN32 MACOSX_BUNDLE 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c
dma.c ddma.c nmi.c pic.c pit.c port_6x.c port_92.c ppi.c pci.c mca.c usb.c
device.c nvr.c nvr_at.c nvr_ps2.c rtmidi_midi.cpp ${APP_ICON_MACOSX})
dma.c ddma.c nmi.c pic.c pit.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)
if(APPLE)
target_link_libraries(86Box "-framework AppKit")
if(CPPTHREADS)
target_sources(86Box PRIVATE thread.cpp)
endif()
if(NEW_DYNAREC)
add_compile_definitions(USE_NEW_DYNAREC)
add_compile_definitions(USE_NEW_DYNAREC)
endif()
if(RELEASE)
add_compile_definitions(RELEASE_BUILD)
add_compile_definitions(RELEASE_BUILD)
endif()
if(DYNAREC)
add_compile_definitions(USE_DYNAREC)
add_compile_definitions(USE_DYNAREC)
endif()
if(VRAMDUMP)
add_compile_definitions(ENABLE_VRAM_DUMP)
add_compile_definitions(ENABLE_VRAM_DUMP)
endif()
if(DEV_BRANCH)
add_compile_definitions(DEV_BRANCH)
add_compile_definitions(DEV_BRANCH)
endif()
if(VNC)
add_compile_definitions(USE_VNC)
add_library(vnc OBJECT vnc.c vnc_keymap.c)
target_link_libraries(86Box vnc vncserver)
if (WIN32)
target_link_libraries(86Box ws2_32)
endif()
add_compile_definitions(USE_VNC)
add_library(vnc OBJECT vnc.c vnc_keymap.c)
target_link_libraries(86Box vnc vncserver)
if (WIN32)
target_link_libraries(86Box ws2_32)
endif()
endif()
target_link_libraries(86Box cpu chipset mch dev mem fdd game cdrom zip mo hdd
net print scsi sio snd vid voodoo plat ui)
net print scsi sio snd vid voodoo plat ui)
if(WIN32 AND ARCH STREQUAL "i386")
if(MSVC)
target_link_options(86Box PRIVATE "/LARGEADDRESSAWARE")
else()
target_link_options(86Box PRIVATE "LINKER:--large-address-aware")
endif()
if(MINGW)
target_link_options(86Box PRIVATE "LINKER:--large-address-aware")
else()
target_link_options(86Box PRIVATE "LINKER:/LARGEADDRESSAWARE")
endif()
endif()
if(MINGW)
target_link_options(86Box PRIVATE "-static")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dll.a")
if(STATIC_BUILD)
if(MINGW OR UNIX)
target_link_options(86Box PRIVATE "-static")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif()
endif()
# Variables introduced by richardg867 for versioning stuff
if(NOT CMAKE_PROJECT_VERSION_PATCH)
set(CMAKE_PROJECT_VERSION_PATCH 0)
endif()
if(NOT EMU_BUILD_NUM)
set(EMU_BUILD_NUM 0)
endif()
if(NOT EMU_COPYRIGHT_YEAR)
set(EMU_COPYRIGHT_YEAR 2021)
endif()
#some macOS specific configuration steps
if(APPLE)
# Force using the newest library if it's installed by homebrew
set(CMAKE_FIND_FRAMEWORK LAST)
# Force using the newest library if it's installed by homebrew
set(CMAKE_FIND_FRAMEWORK LAST)
# prepare stuff for macOS app bundles
set(CMAKE_MACOSX_BUNDLE 1)
# setting our compilation target to macOS 10.13 High Sierra
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
# set the Info.plist properly
set_target_properties(86Box PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/Info.plist.in)
set(MACOSX_BUNDLE_GUI_IDENTIFIER net.86Box.86Box)
set(MACOSX_BUNDLE_BUNDLE_NAME 86Box)
set(MACOSX_BUNDLE_BUNDLE_VERSION 3.1.${EMU_BUILD_NUM})
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "3.1.${EMU_BUILD_NUM}")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "3.1.${EMU_BUILD_NUM}")
set(MACOSX_BUNDLE_ICON_FILE 86Box.icns)
set(MACOSX_BUNDLE_INFO_STRING "A emulator of old computers")
set(MACOSX_BUNDLE_COPYRIGHT "© 2007-${EMU_COPYRIGHT_YEAR} 86Box contributors")
# preparing the code signing for easier distribution, Apple dev certificate needed at one point
#set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES")
#set(XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-")
#set(XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_SOURCE_DIR}/mac/codesign/dev/app.entitlements)
# setting our compilation target to macOS 10.13 High Sierra
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
endif()
find_package(Freetype REQUIRED)
include_directories(${FREETYPE_INCLUDE_DIRS})
if(APPLE)
target_link_libraries(86Box Freetype::Freetype) # bundles freetype for the macOS app bundle
# Freetype is dynamically loaded by the emulator, however, we link it
# on macOS so it gets copied to the bundle by the installation process
target_link_libraries(86Box Freetype::Freetype)
endif()
find_package(OpenAL REQUIRED)
@@ -141,16 +93,12 @@ target_link_libraries(86Box ${OPENAL_LIBRARY})
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
if(MINGW)
target_link_libraries(86Box SDL2::SDL2-static)
elseif(WIN32)
target_link_libraries(86Box SDL2::SDL2)
if(STATIC_BUILD AND TARGET SDL2::SDL2-static)
target_link_libraries(86Box SDL2::SDL2-static)
elseif(TARGET SDL2::SDL2)
target_link_libraries(86Box SDL2::SDL2)
else()
if (TARGET SDL2::SDL2)
target_link_libraries(86Box SDL2::SDL2)
else()
target_link_libraries(86Box ${SDL2_LIBRARIES})
endif()
target_link_libraries(86Box ${SDL2_LIBRARIES})
endif()
find_package(PNG REQUIRED)
@@ -158,17 +106,17 @@ include_directories(${PNG_INCLUDE_DIRS})
target_link_libraries(86Box PNG::PNG)
if(VCPKG_TOOLCHAIN)
# vcpkg includes a config file for rtmidi
find_package(RtMidi REQUIRED)
target_link_libraries(86Box RtMidi::rtmidi)
# vcpkg includes a config file for rtmidi
find_package(RtMidi REQUIRED)
target_link_libraries(86Box RtMidi::rtmidi)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(RTMIDI REQUIRED IMPORTED_TARGET rtmidi)
target_link_libraries(86Box PkgConfig::RTMIDI)
find_package(PkgConfig REQUIRED)
pkg_check_modules(RTMIDI REQUIRED IMPORTED_TARGET rtmidi)
target_link_libraries(86Box PkgConfig::RTMIDI)
if(WIN32)
target_link_libraries(PkgConfig::RTMIDI INTERFACE winmm)
endif()
if(WIN32)
target_link_libraries(PkgConfig::RTMIDI INTERFACE winmm)
endif()
endif()
configure_file(include/86box/version.h.in include/86box/version.h @ONLY)
@@ -176,9 +124,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
include_directories(include)
if(NEW_DYNAREC)
include_directories(cpu codegen_new)
include_directories(cpu codegen_new)
else()
include_directories(cpu codegen)
include_directories(cpu codegen)
endif()
add_subdirectory(cdrom)
@@ -186,9 +134,9 @@ add_subdirectory(chipset)
add_subdirectory(cpu)
if(NEW_DYNAREC)
add_subdirectory(codegen_new)
add_subdirectory(codegen_new)
else()
add_subdirectory(codegen)
add_subdirectory(codegen)
endif()
if(MINITRACE)
@@ -197,30 +145,43 @@ if(MINITRACE)
target_link_libraries(86Box minitrace)
endif()
if(APPLE)
install(TARGETS 86Box DESTINATION "bin")
if(WIN32 OR (APPLE AND CMAKE_MACOSX_BUNDLE))
# Copy the binary to the root of the install prefix on Windows and macOS
install(TARGETS 86Box DESTINATION ".")
else()
install(TARGETS 86Box)
# On Linux we want to copy the binary to the `bin` folder.
install(TARGETS 86Box)
endif()
# adjustments for macOS app bundles
# Install our dependencies to the macOS bundle
if(APPLE)
set(APPS ${CMAKE_CURRENT_BINARY_DIR}/86Box.app)
install(CODE "
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"\" \"\")"
COMPONENT Runtime)
install(CODE "
include(BundleUtilities)
get_filename_component(CMAKE_INSTALL_PREFIX_ABSOLUTE \${CMAKE_INSTALL_PREFIX} ABSOLUTE)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/86Box.app\" \"\" \"\")"
COMPONENT Runtime)
endif()
# Install our dependencies if using vcpkg
if(VCPKG_TOOLCHAIN)
x_vcpkg_install_local_dependencies(TARGETS 86Box DESTINATION "bin")
x_vcpkg_install_local_dependencies(TARGETS 86Box DESTINATION ".")
endif()
# Install the PDB file on Windows builds
if(MSVC)
install(FILES $<TARGET_PDB_FILE:86Box>
CONFIGURATIONS Debug RelWithDebInfo
DESTINATION "bin")
# CMake fully supports PDB files on MSVC-compatible compilers
install(FILES $<TARGET_PDB_FILE:86Box>
CONFIGURATIONS Debug RelWithDebInfo
DESTINATION ".")
elseif(WIN32)
# Other compilers/linkers (such as Clang in GCC-compatible mode) also
# emit PDB files when targeting Windows, however, CMake only supports
# the relevant properties with MSVC and clones. Try to install
# the PDB file assuming it's in the same path as the EXE.
install(FILES "$<TARGET_FILE_DIR:86Box>/$<TARGET_FILE_BASE_NAME:86Box>.pdb"
CONFIGURATIONS Debug RelWithDebInfo
DESTINATION "."
OPTIONAL)
endif()
add_subdirectory(device)
@@ -236,10 +197,10 @@ add_subdirectory(scsi)
add_subdirectory(sound)
add_subdirectory(video)
if(APPLE)
add_subdirectory(mac)
add_subdirectory(unix)
add_subdirectory(mac)
add_subdirectory(unix)
elseif(WIN32)
add_subdirectory(win)
add_subdirectory(win)
else()
add_subdirectory(unix)
add_subdirectory(unix)
endif()

View File

@@ -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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2020,2021 David Hrdlička.
#
add_library(cdrom OBJECT cdrom.c cdrom_image_backend.c cdrom_image.c)

View File

@@ -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.
#
# CMake build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# 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
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
sis_85c496.c sis_85c50x.c sis_5511.c sis_5571.c via_vt82c49x.c via_vt82c505.c sis_85c310.c
sis_85c4xx.c sis_85c496.c sis_85c50x.c gc100.c stpc.c umc_8886.c umc_hb4.c via_apollo.c
via_pipc.c vl82c480.c wd76c10.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
sis_85c496.c sis_85c50x.c sis_5511.c sis_5571.c via_vt82c49x.c via_vt82c505.c sis_85c310.c
sis_85c4xx.c sis_85c496.c sis_85c50x.c gc100.c stpc.c umc_8886.c umc_hb4.c via_apollo.c
via_pipc.c vl82c480.c wd76c10.c)
if(OLIVETTI)
target_sources(chipset PRIVATE olivetti_eva.c)
target_sources(chipset PRIVATE olivetti_eva.c)
endif()

View File

@@ -143,6 +143,8 @@ sis_85c496_recalcmapping(sis_85c496_t *dev)
} else
mem_set_mem_state_both(base, 0x8000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
}
flushmmucache_nopc();
}
@@ -240,13 +242,8 @@ sis_85c49x_pci_write(int func, int addr, uint8_t val, void *priv)
break;
case 0x45: /* Shadow Configure */
dev->pci_conf[addr] = val & 0x0f;
if (valxor & 0x03) {
if (valxor & 0x03)
sis_85c496_recalcmapping(dev);
if ((old == 0x0a) && (val == 0x09))
flushmmucache_nopc();
else
flushmmucache();
}
break;
case 0x46: /* Cacheable Control */
dev->pci_conf[addr] = val;

View File

@@ -180,6 +180,7 @@ vt82c505_reset(void *priv)
}
pic_reset();
pic_set_pci_flag(1);
}

View File

@@ -1,31 +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.
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for 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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2020,2021 David Hrdlička.
#
if(DYNAREC)
add_library(dynarec OBJECT codegen.c codegen_ops.c)
add_library(dynarec OBJECT codegen.c codegen_ops.c)
if(ARCH STREQUAL "i386")
target_sources(dynarec PRIVATE codegen_x86.c
codegen_accumulate_x86.c)
elseif(ARCH STREQUAL "x86_64")
target_sources(dynarec PRIVATE codegen_x86-64.c
codegen_accumulate_x86-64.c)
else()
message(SEND_ERROR
"Dynarec is incompatible with target platform ${ARCH}")
endif()
if(ARCH STREQUAL "i386")
target_sources(dynarec PRIVATE codegen_x86.c
codegen_accumulate_x86.c)
elseif(ARCH STREQUAL "x86_64")
target_sources(dynarec PRIVATE codegen_x86-64.c
codegen_accumulate_x86-64.c)
else()
message(SEND_ERROR
"Dynarec is incompatible with target platform ${ARCH}")
endif()
target_link_libraries(86Box dynarec cgt)
target_link_libraries(86Box dynarec cgt)
endif()

View File

@@ -1,51 +1,51 @@
#
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for IBM
# PC systems and compatibles from 1981 through fairly recent
# system designs based on the PCI bus.
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for 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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2020,2021 David Hrdlička.
#
if(DYNAREC)
add_library(dynarec OBJECT codegen.c codegen_accumulate.c
codegen_allocator.c codegen_block.c codegen_ir.c codegen_ops.c
codegen_ops_3dnow.c codegen_ops_branch.c codegen_ops_arith.c
codegen_ops_fpu_arith.c codegen_ops_fpu_constant.c
codegen_ops_fpu_loadstore.c codegen_ops_fpu_misc.c
codegen_ops_helpers.c codegen_ops_jump.c codegen_ops_logic.c
codegen_ops_misc.c codegen_ops_mmx_arith.c codegen_ops_mmx_cmp.c
codegen_ops_mmx_loadstore.c codegen_ops_mmx_logic.c
codegen_ops_mmx_pack.c codegen_ops_mmx_shift.c codegen_ops_mov.c
codegen_ops_shift.c codegen_ops_stack.c codegen_reg.c)
add_library(dynarec OBJECT codegen.c codegen_accumulate.c
codegen_allocator.c codegen_block.c codegen_ir.c codegen_ops.c
codegen_ops_3dnow.c codegen_ops_branch.c codegen_ops_arith.c
codegen_ops_fpu_arith.c codegen_ops_fpu_constant.c
codegen_ops_fpu_loadstore.c codegen_ops_fpu_misc.c
codegen_ops_helpers.c codegen_ops_jump.c codegen_ops_logic.c
codegen_ops_misc.c codegen_ops_mmx_arith.c codegen_ops_mmx_cmp.c
codegen_ops_mmx_loadstore.c codegen_ops_mmx_logic.c
codegen_ops_mmx_pack.c codegen_ops_mmx_shift.c codegen_ops_mov.c
codegen_ops_shift.c codegen_ops_stack.c codegen_reg.c)
if(ARCH STREQUAL "i386")
target_sources(dynarec PRIVATE codegen_backend_x86.c
codegen_backend_x86_ops.c codegen_backend_x86_ops_fpu.c
codegen_backend_x86_ops_sse.c
codegen_backend_x86_uops.c)
elseif(ARCH STREQUAL "x86_64")
target_sources(dynarec PRIVATE codegen_backend_x86-64.c
codegen_backend_x86-64_ops.c
codegen_backend_x86-64_ops_sse.c
codegen_backend_x86-64_uops.c)
elseif(ARCH STREQUAL "arm64")
target_sources(dynarec PRIVATE codegen_backend_arm64.c
codegen_backend_arm64_ops.c codegen_backend_arm64_uops.c
codegen_backend_arm64_imm.c)
elseif(ARCH STREQUAL "arm")
target_sources(dynarec PRIVATE codegen_backend_arm.c
codegen_backend_arm_ops.c codegen_backend_arm_uops.c)
else()
message(SEND_ERROR
"Dynarec is incompatible with target platform ${ARCH}")
endif()
if(ARCH STREQUAL "i386")
target_sources(dynarec PRIVATE codegen_backend_x86.c
codegen_backend_x86_ops.c codegen_backend_x86_ops_fpu.c
codegen_backend_x86_ops_sse.c
codegen_backend_x86_uops.c)
elseif(ARCH STREQUAL "x86_64")
target_sources(dynarec PRIVATE codegen_backend_x86-64.c
codegen_backend_x86-64_ops.c
codegen_backend_x86-64_ops_sse.c
codegen_backend_x86-64_uops.c)
elseif(ARCH STREQUAL "arm64")
target_sources(dynarec PRIVATE codegen_backend_arm64.c
codegen_backend_arm64_ops.c codegen_backend_arm64_uops.c
codegen_backend_arm64_imm.c)
elseif(ARCH STREQUAL "arm")
target_sources(dynarec PRIVATE codegen_backend_arm.c
codegen_backend_arm_ops.c codegen_backend_arm_uops.c)
else()
message(SEND_ERROR
"Dynarec is incompatible with target platform ${ARCH}")
endif()
target_link_libraries(86Box dynarec cgt)
target_link_libraries(86Box dynarec cgt)
endif()

View File

@@ -64,7 +64,6 @@
#include <86box/snd_mpu401.h>
#include <86box/video.h>
#include <86box/plat.h>
#include <86box/plat_midi.h>
#include <86box/plat_dir.h>
#include <86box/ui.h>
@@ -645,6 +644,8 @@ load_machine(void)
machine = machine_get_machine_from_internal_name("s1857");
else if (! strcmp(p, "63a"))
machine = machine_get_machine_from_internal_name("63a1");
else if (! strcmp(p, "4sa2"))
machine = machine_get_machine_from_internal_name("4saw2");
else if (! strcmp(p, "award386dx")) /* ...merged machines... */
machine = machine_get_machine_from_internal_name("award495");
else if (! strcmp(p, "ami386dx"))
@@ -657,6 +658,8 @@ load_machine(void)
machine = machine_get_machine_from_internal_name("ami495");
else if (! strcmp(p, "mr486"))
machine = machine_get_machine_from_internal_name("mr495");
else if (! strcmp(p, "ibmps1_2121_isa"))
machine = machine_get_machine_from_internal_name("ibmps1_2121");
else if (! strcmp(p, "fw6400gx_s1"))
machine = machine_get_machine_from_internal_name("fw6400gx");
else if (! strcmp(p, "p54vl"))
@@ -831,9 +834,9 @@ load_machine(void)
mem_size = config_get_int(cat, "mem_size", 64);
#if 0
if (mem_size < (((machines[machine].flags & MACHINE_AT) &&
if (mem_size < ((machine_has_bus(machine, MACHINE_AT) &&
(machines[machine].ram_granularity < 128)) ? machines[machine].min_ram*1024 : machines[machine].min_ram))
mem_size = (((machines[machine].flags & MACHINE_AT) && (machines[machine].ram_granularity < 128)) ? machines[machine].min_ram*1024 : machines[machine].min_ram);
mem_size = (((machine_has_bus(machine, MACHINE_AT) && (machines[machine].ram_granularity < 128)) ? machines[machine].min_ram*1024 : machines[machine].min_ram);
#endif
if (mem_size > 2097152)
@@ -859,10 +862,6 @@ load_machine(void)
/* Remove this after a while.. */
config_delete_var(cat, "nvr_path");
config_delete_var(cat, "enable_sync");
/* Set up the architecture flags. */
AT = IS_AT(machine);
PCI = IS_ARCH(machine, MACHINE_BUS_PCI);
}
@@ -874,13 +873,13 @@ load_video(void)
char *p;
int free_p = 0;
if (machines[machine].flags & MACHINE_VIDEO_ONLY) {
if (machine_has_flags(machine, MACHINE_VIDEO_ONLY)) {
config_delete_var(cat, "gfxcard");
gfxcard = VID_INTERNAL;
} else {
p = config_get_string(cat, "gfxcard", NULL);
if (p == NULL) {
if (machines[machine].flags & MACHINE_VIDEO) {
if (machine_has_flags(machine, MACHINE_VIDEO)) {
p = (char *)malloc((strlen("internal")+1)*sizeof(char));
strcpy(p, "internal");
} else {
@@ -915,15 +914,30 @@ load_input_devices(void)
p = config_get_string(cat, "joystick_type", NULL);
if (p != NULL) {
if (!strcmp(p, "standard_2button"))
joystick_type = joystick_get_from_internal_name("2axis_2button");
else if (!strcmp(p, "standard_4button"))
joystick_type = joystick_get_from_internal_name("2axis_4button");
else if (!strcmp(p, "standard_6button"))
joystick_type = joystick_get_from_internal_name("2axis_6button");
else if (!strcmp(p, "standard_8button"))
joystick_type = joystick_get_from_internal_name("2axis_8button");
joystick_type = joystick_get_from_internal_name(p);
if (!joystick_type) {
/* Try to read an integer for backwards compatibility with old configs */
c = config_get_int(cat, "joystick_type", 8);
if ((c >= 0) && (c < 8))
/* "None" was type 8 instead of 0 previously, shift the number accordingly */
joystick_type = c + 1;
else
joystick_type = 0;
switch (c) {
case 0: case 1: case 2: case 3: /* 2-axis joysticks */
joystick_type = c + 1;
break;
case 4: case 5: case 6: case 7: /* other joysticks */
joystick_type = c + 3;
break;
default: /* "None" (8) or invalid value */
joystick_type = 0;
break;
}
}
} else
joystick_type = 0;
@@ -1120,7 +1134,7 @@ load_storage_controllers(void)
p = config_get_string(cat, "hdc", NULL);
if (p == NULL) {
if (machines[machine].flags & MACHINE_HDC) {
if (machine_has_flags(machine, MACHINE_HDC)) {
p = (char *)malloc((strlen("internal")+1)*sizeof(char));
strcpy(p, "internal");
} else {
@@ -1150,7 +1164,8 @@ load_storage_controllers(void)
ide_ter_enabled = !!config_get_int(cat, "ide_ter", 0);
ide_qua_enabled = !!config_get_int(cat, "ide_qua", 0);
cassette_enable = !!config_get_int(cat, "cassette_enabled", AT ? 0 : 1);
/* TODO: Re-enable by default after we actually have a proper machine flag for this. */
cassette_enable = !!config_get_int(cat, "cassette_enabled", 0);
p = config_get_string(cat, "cassette_file", "");
if (strlen(p) > 511)
fatal("load_storage_controllers(): strlen(p) > 511\n");
@@ -1948,7 +1963,7 @@ load_other_peripherals(void)
p = config_get_string(cat, "hdc", NULL);
if (p == NULL) {
if (machines[machine].flags & MACHINE_HDC) {
if (machine_has_flags(machine, MACHINE_HDC)) {
p = (char *)malloc((strlen("internal")+1)*sizeof(char));
strcpy(p, "internal");
} else {
@@ -2025,10 +2040,6 @@ config_load(void)
machine = machine_get_machine_from_internal_name("ibmpc");
dpi_scale = 1;
/* Set up the architecture flags. */
AT = IS_AT(machine);
PCI = IS_ARCH(machine, MACHINE_BUS_PCI);
fpu_type = fpu_get_type(cpu_f, cpu, "none");
gfxcard = video_get_video_from_internal_name("cga");
vid_api = plat_vidapi("default");
@@ -2060,7 +2071,8 @@ config_load(void)
for (i = 0; i < ISAMEM_MAX; i++)
isamem_type[i] = 0;
cassette_enable = AT ? 0 : 1;
/* TODO: Re-enable by default when we have a proper machine flag for this. */
cassette_enable = 0;
memset(cassette_fname, 0x00, sizeof(cassette_fname));
memcpy(cassette_mode, "load", strlen("load") + 1);
cassette_pos = 0;

View File

@@ -189,7 +189,7 @@ exec386(int cycs)
loadcs(readmemw(0, addr + 2));
}
} else if (nmi && nmi_enable && nmi_mask) {
if (AT && (cpu_fast_off_flags & 0x20000000))
if (is486 && (cpu_fast_off_flags & 0x20000000))
cpu_fast_off_count = cpu_fast_off_val + 1;
cpu_state.oldpc = cpu_state.pc;

View File

@@ -794,7 +794,7 @@ exec386_dynarec(int cycs)
if (smi_line)
enter_smm_check(0);
else if (nmi && nmi_enable && nmi_mask) {
if (AT && (cpu_fast_off_flags & 0x20000000))
if (is486 && (cpu_fast_off_flags & 0x20000000))
cpu_fast_off_count = cpu_fast_off_val + 1;
#ifndef USE_NEW_DYNAREC

View File

@@ -570,15 +570,9 @@ reset_808x(int hard)
pfq_clear();
}
if (AT) {
load_cs(0xF000);
cpu_state.pc = 0xFFF0;
rammask = cpu_16bitbus ? 0xFFFFFF : 0xFFFFFFFF;
} else {
load_cs(0xFFFF);
cpu_state.pc = 0;
rammask = 0xfffff;
}
load_cs(0xFFFF);
cpu_state.pc = 0;
rammask = 0xfffff;
prefetching = 1;
cpu_alu_op = 0;

View File

@@ -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.
#
# CMake build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# 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 386_dynarec.c
386_dynarec_ops.c x86seg.c x87.c x87_timings.c)
386_dynarec_ops.c x86seg.c x87.c x87_timings.c)
if(AMD_K5)
target_compile_definitions(cpu PRIVATE USE_AMD_K5)
target_compile_definitions(cpu PRIVATE USE_AMD_K5)
endif()
if(CYRIX_6X86)
target_compile_definitions(cpu PRIVATE USE_CYRIX_6X86)
target_compile_definitions(cpu PRIVATE USE_CYRIX_6X86)
endif()
if(DYNAREC)
add_library(cgt OBJECT codegen_timing_486.c codegen_timing_686.c
codegen_timing_common.c codegen_timing_k6.c
codegen_timing_pentium.c codegen_timing_p6.c
codegen_timing_winchip.c codegen_timing_winchip2.c)
add_library(cgt OBJECT codegen_timing_486.c codegen_timing_686.c
codegen_timing_common.c codegen_timing_k6.c
codegen_timing_pentium.c codegen_timing_p6.c
codegen_timing_winchip.c codegen_timing_winchip2.c)
endif()

View File

@@ -56,10 +56,12 @@ enum {
CPUID_TSC = (1 << 4),
CPUID_MSR = (1 << 5),
CPUID_PAE = (1 << 6),
CPUID_MCE = (1 << 7),
CPUID_CMPXCHG8B = (1 << 8),
CPUID_AMDSEP = (1 << 10),
CPUID_SEP = (1 << 11),
CPUID_MTRR = (1 << 12),
CPUID_MCA = (1 << 14),
CPUID_CMOV = (1 << 15),
CPUID_MMX = (1 << 23),
CPUID_FXSR = (1 << 24)
@@ -1616,7 +1618,7 @@ cpu_CPUID(void)
} else if (EAX == 1) {
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B;
} else
EAX = EBX = ECX = EDX = 0;
break;
@@ -1631,7 +1633,7 @@ cpu_CPUID(void)
} else if (EAX == 1) {
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B;
} else
EAX = EBX = ECX = EDX = 0;
break;
@@ -1645,14 +1647,14 @@ cpu_CPUID(void)
} else if (EAX == 1) {
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B;
} else if (EAX == 0x80000000) {
EAX = 0x80000005;
EBX = ECX = EDX = 0;
} else if (EAX == 0x80000001) {
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B;
} else if (EAX == 0x80000002) {
EAX = 0x2D444D41;
EBX = 0x7428354B;
@@ -1682,14 +1684,14 @@ cpu_CPUID(void)
} else if (EAX == 1) {
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B | CPUID_MMX;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_MMX;
} else if (EAX == 0x80000000) {
EAX = 0x80000005;
EBX = ECX = EDX = 0;
} else if (EAX == 0x80000001) {
EAX = CPUID + 0x100;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B | CPUID_AMDSEP | CPUID_MMX;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_AMDSEP | CPUID_MMX;
} else if (EAX == 0x80000002) {
EAX = 0x2D444D41;
EBX = 0x6D74364B;
@@ -1729,14 +1731,14 @@ cpu_CPUID(void)
case 1:
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B | CPUID_MMX;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_MMX;
break;
case 0x80000000:
EAX = 0x80000005;
break;
case 0x80000001:
EAX = CPUID + 0x100;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B | CPUID_AMDSEP | CPUID_MMX | CPUID_3DNOW;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_AMDSEP | CPUID_MMX | CPUID_3DNOW;
break;
case 0x80000002: /* Processor name string */
EAX = 0x2d444d41; /* AMD-K6(tm) 3D pr */
@@ -1772,14 +1774,14 @@ cpu_CPUID(void)
case 1:
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B | CPUID_MMX;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_MMX;
break;
case 0x80000000:
EAX = 0x80000006;
break;
case 0x80000001:
EAX = CPUID + 0x100;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B | CPUID_AMDSEP | CPUID_MMX | CPUID_3DNOW;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_AMDSEP | CPUID_MMX | CPUID_3DNOW;
break;
case 0x80000002: /* Processor name string */
EAX = 0x2d444d41; /* AMD-K6(tm) 3D+ P */
@@ -1819,14 +1821,14 @@ cpu_CPUID(void)
case 1:
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B | CPUID_MMX;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_MMX;
break;
case 0x80000000:
EAX = 0x80000007;
break;
case 0x80000001:
EAX = CPUID + 0x100;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B | CPUID_AMDSEP | CPUID_MMX | CPUID_3DNOW;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_AMDSEP | CPUID_MMX | CPUID_3DNOW;
break;
case 0x80000002: /* Processor name string */
EAX = 0x2d444d41; /* AMD-K6(tm)-III P */
@@ -1869,7 +1871,7 @@ cpu_CPUID(void)
} else if (EAX == 1) {
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_CMPXCHG8B | CPUID_MMX;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_MMX;
} else
EAX = EBX = ECX = EDX = 0;
break;
@@ -1941,7 +1943,7 @@ cpu_CPUID(void)
} else if (EAX == 1) {
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_PAE | CPUID_CMPXCHG8B | CPUID_MTRR | CPUID_SEP | CPUID_CMOV;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_PAE | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_MTRR | CPUID_MCA | CPUID_SEP | CPUID_CMOV;
} else if (EAX == 2) {
EAX = 0x00000001;
EBX = ECX = 0;
@@ -1959,7 +1961,7 @@ cpu_CPUID(void)
} else if (EAX == 1) {
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_PAE | CPUID_CMPXCHG8B | CPUID_MMX | CPUID_MTRR | CPUID_SEP | CPUID_CMOV;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_PAE | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_MMX | CPUID_MTRR | CPUID_MCA | CPUID_SEP | CPUID_CMOV;
} else if (EAX == 2) {
EAX = 0x00000001;
EBX = ECX = 0;
@@ -1977,7 +1979,7 @@ cpu_CPUID(void)
} else if (EAX == 1) {
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_PAE | CPUID_CMPXCHG8B | CPUID_MMX | CPUID_MTRR | CPUID_SEP | CPUID_FXSR | CPUID_CMOV;
EDX = CPUID_FPU | CPUID_VME | CPUID_PSE | CPUID_TSC | CPUID_MSR | CPUID_PAE | CPUID_MCE | CPUID_CMPXCHG8B | CPUID_MMX | CPUID_MTRR | CPUID_MCA | CPUID_SEP | CPUID_FXSR | CPUID_CMOV;
} else if (EAX == 2) {
EAX = 0x00000001;
EBX = ECX = 0;
@@ -2003,7 +2005,7 @@ cpu_CPUID(void)
case 1:
EAX = CPUID;
EBX = ECX = 0;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_MMX | CPUID_MTRR;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_MMX | CPUID_MTRR;
if (cpu_has_feature(CPU_FEATURE_CX8))
EDX |= CPUID_CMPXCHG8B;
break;
@@ -2012,7 +2014,7 @@ cpu_CPUID(void)
break;
case 0x80000001:
EAX = CPUID;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_MMX | CPUID_MTRR | CPUID_3DNOW;
EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_MCE | CPUID_MMX | CPUID_MTRR | CPUID_3DNOW;
if (cpu_has_feature(CPU_FEATURE_CX8))
EDX |= CPUID_CMPXCHG8B;
break;
@@ -2124,6 +2126,8 @@ cpu_RDMSR(void)
case CPU_CYRIX3S:
EAX = EDX = 0;
switch (ECX) {
case 0x00: case 0x01:
break;
case 0x10:
EAX = tsc & 0xffffffff;
EDX = tsc >> 32;
@@ -2209,6 +2213,9 @@ cpu_RDMSR(void)
case CPU_K6_3P:
EAX = EDX = 0;
switch (ECX) {
case 0x00000000:
case 0x00000001:
break;
case 0x0000000e:
EAX = msr.tr12;
break;
@@ -2289,6 +2296,8 @@ amd_k_invalid_rdmsr:
#endif
EAX = EDX = 0;
switch (ECX) {
case 0x00: case 0x01:
break;
case 0x10:
EAX = tsc & 0xffffffff;
EDX = tsc >> 32;
@@ -2302,6 +2311,8 @@ amd_k_invalid_rdmsr:
case CPU_PENTIUM2D:
EAX = EDX = 0;
switch (ECX) {
case 0x00: case 0x01:
break;
case 0x10:
EAX = tsc & 0xffffffff;
EDX = tsc >> 32;
@@ -2310,8 +2321,10 @@ amd_k_invalid_rdmsr:
if (cpu_s->cpu_type != CPU_PENTIUM2D)
goto i686_invalid_rdmsr;
EAX = msr.ecx17 & 0xffffffff;
EDX = msr.ecx17 >> 32;
if (cpu_f->package == CPU_PKG_SLOT2)
EDX |= 0x80000;
else if (cpu_f->package == CPU_PKG_SOCKET370)
EDX |= 0x100000;
break;
case 0x1B:
EAX = msr.apic_base & 0xffffffff;
@@ -2404,7 +2417,14 @@ amd_k_invalid_rdmsr:
EDX = 0x00000000;
break;
case 0x179:
EAX = EDX = 0x00000000;
EAX = 0x00000105;
EDX = 0x00000000;
break;
case 0x17a:
break;
case 0x17b:
EAX = msr.mcg_ctl & 0xffffffff;
EDX = msr.mcg_ctl >> 32;
break;
case 0x186:
EAX = msr.ecx186 & 0xffffffff;
@@ -2455,21 +2475,14 @@ amd_k_invalid_rdmsr:
EAX = msr.mtrr_deftype & 0xffffffff;
EDX = msr.mtrr_deftype >> 32;
break;
case 0x404:
EAX = msr.ecx404 & 0xffffffff;
EDX = msr.ecx404 >> 32;
break;
case 0x408:
EAX = msr.ecx408 & 0xffffffff;
EDX = msr.ecx408 >> 32;
break;
case 0x40c:
EAX = msr.ecx40c & 0xffffffff;
EDX = msr.ecx40c >> 32;
break;
case 0x400: case 0x404: case 0x408: case 0x40c:
case 0x410:
EAX = msr.ecx410 & 0xffffffff;
EDX = msr.ecx410 >> 32;
EAX = msr.mca_ctl[(ECX - 0x400) >> 2] & 0xffffffff;
EDX = msr.mca_ctl[(ECX - 0x400) >> 2] >> 32;
break;
case 0x401: case 0x402: case 0x405: case 0x406:
case 0x407: case 0x409: case 0x40d: case 0x40e:
case 0x411: case 0x412:
break;
case 0x570:
EAX = msr.ecx570 & 0xffffffff;
@@ -2575,6 +2588,8 @@ cpu_WRMSR(void)
case CPU_CYRIX3S:
switch (ECX) {
case 0x00: case 0x01:
break;
case 0x10:
tsc = EAX | ((uint64_t)EDX << 32);
break;
@@ -2629,6 +2644,8 @@ cpu_WRMSR(void)
case CPU_K6_2P:
case CPU_K6_3P:
switch (ECX) {
case 0x00: case 0x01:
break;
case 0x0e:
msr.tr12 = EAX & 0x228;
break;
@@ -2702,6 +2719,8 @@ amd_k_invalid_wrmsr:
#endif
cpu_log("WRMSR: ECX = %08X, val = %08X%08X\n", ECX, EDX, EAX);
switch (ECX) {
case 0x00: case 0x01:
break;
case 0x10:
tsc = EAX | ((uint64_t)EDX << 32);
break;
@@ -2722,15 +2741,13 @@ amd_k_invalid_wrmsr:
case CPU_PENTIUM2:
case CPU_PENTIUM2D:
switch (ECX) {
case 0x00: case 0x01:
if (EAX || EDX)
x86gpf(NULL, 0);
break;
case 0x10:
tsc = EAX | ((uint64_t)EDX << 32);
break;
case 0x17:
if (cpu_s->cpu_type != CPU_PENTIUM2D)
goto i686_invalid_wrmsr;
msr.ecx17 = EAX | ((uint64_t)EDX << 32);
break;
case 0x1b:
cpu_log("APIC_BASE write: %08X%08X\n", EDX, EAX);
// msr.apic_base = EAX | ((uint64_t)EDX << 32);
@@ -2779,6 +2796,13 @@ amd_k_invalid_wrmsr:
break;
case 0x179:
break;
case 0x17a:
if (EAX || EDX)
x86gpf(NULL, 0);
break;
case 0x17b:
msr.mcg_ctl = EAX | ((uint64_t)EDX << 32);
break;
case 0x186:
msr.ecx186 = EAX | ((uint64_t)EDX << 32);
break;
@@ -2816,17 +2840,15 @@ amd_k_invalid_wrmsr:
case 0x2ff:
msr.mtrr_deftype = EAX | ((uint64_t)EDX << 32);
break;
case 0x404:
msr.ecx404 = EAX | ((uint64_t)EDX << 32);
break;
case 0x408:
msr.ecx408 = EAX | ((uint64_t)EDX << 32);
break;
case 0x40c:
msr.ecx40c = EAX | ((uint64_t)EDX << 32);
break;
case 0x400: case 0x404: case 0x408: case 0x40c:
case 0x410:
msr.ecx410 = EAX | ((uint64_t)EDX << 32);
msr.mca_ctl[(ECX - 0x400) >> 2] = EAX | ((uint64_t)EDX << 32);
break;
case 0x401: case 0x402: case 0x405: case 0x406:
case 0x407: case 0x409: case 0x40d: case 0x40e:
case 0x411: case 0x412:
if (EAX || EDX)
x86gpf(NULL, 0);
break;
case 0x570:
msr.ecx570 = EAX | ((uint64_t)EDX << 32);

View File

@@ -236,7 +236,6 @@ typedef struct {
uint32_t cesr; /* 0x00000011 */
/* Pentium Pro, Pentium II Klamath, and Pentium II Deschutes MSR's */
uint64_t ecx17; /* 0x00000017 - Only on Pentium II Deschutes */
uint64_t apic_base; /* 0x0000001b - Should the Pentium not also have this? */
uint64_t ecx79; /* 0x00000079 */
@@ -262,6 +261,9 @@ typedef struct {
uint32_t sysenter_esp; /* 0x00000175 - SYSENTER/SYSEXIT MSR's */
uint32_t sysenter_eip; /* 0x00000176 - SYSENTER/SYSEXIT MSR's */
/* Pentium Pro, Pentium II Klamath, and Pentium II Deschutes MSR's */
uint64_t mcg_ctl; /* 0x0000017b - Machine Check Architecture */
/* Pentium Pro, Pentium II Klamath, and Pentium II Deschutes MSR's */
uint64_t ecx186, ecx187; /* 0x00000186, 0x00000187 */
uint64_t ecx1e0; /* 0x000001e0 */
@@ -283,10 +285,7 @@ typedef struct {
uint64_t mtrr_deftype; /* 0x000002ff */
/* Pentium Pro, Pentium II Klamath, and Pentium II Deschutes MSR's */
uint64_t ecx404; /* 0x00000404 - Model Identification MSR's used by some Acer BIOSes */
uint64_t ecx408; /* 0x00000408 */
uint64_t ecx40c; /* 0x0000040c */
uint64_t ecx410; /* 0x00000410 */
uint64_t mca_ctl[5]; /* 0x00000400, 0x00000404, 0x00000408, 0x0000040c, 0x00000410 - Machine Check Architecture */
uint64_t ecx570; /* 0x00000570 */
/* IBM 386SLC, 486SLC, and 486BL MSR's */

View File

@@ -245,6 +245,9 @@ reset_common(int hard)
pci_reset();
if (!hard && soft_reset_pci) {
dma_reset();
/* TODO: Hack, but will do for time being, because all AT machines currently are 286+,
and vice-versa. */
dma_set_at(is286);
device_reset_all();
}
}
@@ -264,15 +267,9 @@ reset_common(int hard)
cpu_state.eflags = 0;
cgate32 = 0;
if (is286) {
if (AT) {
loadcs(0xF000);
cpu_state.pc = 0xFFF0;
rammask = cpu_16bitbus ? 0xFFFFFF : 0xFFFFFFFF;
} else {
loadcs(0xFFFF);
cpu_state.pc = 0;
rammask = 0xfffff;
}
loadcs(0xF000);
cpu_state.pc = 0xFFF0;
rammask = cpu_16bitbus ? 0xFFFFFF : 0xFFFFFFFF;
}
idt.base = 0;
cpu_state.flags = 2;
@@ -353,6 +350,9 @@ void
hardresetx86(void)
{
dma_reset();
/* TODO: Hack, but will do for time being, because all AT machines currently are 286+,
and vice-versa. */
dma_set_at(is286);
device_reset_all();
cpu_alt_reset = 0;

View File

@@ -83,8 +83,8 @@ seg_reset(x86seg *s)
if (s == &cpu_state.seg_cs) {
if (!cpu_inited)
fatal("seg_reset(&cpu_state.seg.cs) without an initialized CPU\n");
s->base = AT ? (cpu_16bitbus ? 0x00ff0000 : 0xffff0000) : 0x000ffff0;
s->seg = AT ? 0xf000 : 0xffff;
s->base = is286 ? (cpu_16bitbus ? 0x00ff0000 : 0xffff0000) : 0x000ffff0;
s->seg = is286 ? 0xf000 : 0xffff;
} else {
s->base = 0;
s->seg = 0;

View File

@@ -646,29 +646,29 @@ device_set_config_mac(const char *s, int val)
int
device_is_valid(const device_t *device, int mflags)
device_is_valid(const device_t *device, int m)
{
if (device == NULL) return(1);
if ((device->flags & DEVICE_AT) && !(mflags & MACHINE_BUS_ISA16)) return(0);
if ((device->flags & DEVICE_AT) && !machine_has_bus(m, MACHINE_BUS_ISA16)) return(0);
if ((device->flags & DEVICE_CBUS) && !(mflags & MACHINE_BUS_CBUS)) return(0);
if ((device->flags & DEVICE_CBUS) && !machine_has_bus(m, MACHINE_BUS_CBUS)) return(0);
if ((device->flags & DEVICE_ISA) && !(mflags & MACHINE_BUS_ISA)) return(0);
if ((device->flags & DEVICE_ISA) && !machine_has_bus(m, MACHINE_BUS_ISA)) return(0);
if ((device->flags & DEVICE_MCA) && !(mflags & MACHINE_BUS_MCA)) return(0);
if ((device->flags & DEVICE_MCA) && !machine_has_bus(m, MACHINE_BUS_MCA)) return(0);
if ((device->flags & DEVICE_EISA) && !(mflags & MACHINE_BUS_EISA)) return(0);
if ((device->flags & DEVICE_EISA) && !machine_has_bus(m, MACHINE_BUS_EISA)) return(0);
if ((device->flags & DEVICE_VLB) && !(mflags & MACHINE_BUS_VLB)) return(0);
if ((device->flags & DEVICE_VLB) && !machine_has_bus(m, MACHINE_BUS_VLB)) return(0);
if ((device->flags & DEVICE_PCI) && !(mflags & MACHINE_BUS_PCI)) return(0);
if ((device->flags & DEVICE_PCI) && !machine_has_bus(m, MACHINE_BUS_PCI)) return(0);
if ((device->flags & DEVICE_AGP) && !(mflags & MACHINE_BUS_AGP)) return(0);
if ((device->flags & DEVICE_AGP) && !machine_has_bus(m, MACHINE_BUS_AGP)) return(0);
if ((device->flags & DEVICE_PS2) && !(mflags & MACHINE_BUS_PS2)) return(0);
if ((device->flags & DEVICE_PS2) && !machine_has_bus(m, MACHINE_BUS_PS2)) return(0);
if ((device->flags & DEVICE_AC97) && !(mflags & MACHINE_BUS_AC97)) return(0);
if ((device->flags & DEVICE_AC97) && !machine_has_bus(m, MACHINE_BUS_AC97)) return(0);
return(1);
}

View File

@@ -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.
#
# CMake build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# 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
hwm_vt82c686.c ibm_5161.c isamem.c isartc.c ../lpt.c pci_bridge.c
postcard.c serial.c clock_ics9xxx.c isapnp.c i2c.c i2c_gpio.c
smbus_piix4.c smbus_ali7101.c keyboard.c keyboard_xt.c keyboard_at.c
mouse.c mouse_bus.c mouse_serial.c mouse_ps2.c phoenix_486_jumper.c)
hwm_vt82c686.c ibm_5161.c isamem.c isartc.c ../lpt.c pci_bridge.c
postcard.c serial.c clock_ics9xxx.c isapnp.c i2c.c i2c_gpio.c
smbus_piix4.c smbus_ali7101.c keyboard.c keyboard_xt.c keyboard_at.c
mouse.c mouse_bus.c mouse_serial.c mouse_ps2.c phoenix_486_jumper.c)
if(LASERXT)
target_compile_definitions(dev PRIVATE USE_LASERXT)
target_compile_definitions(dev PRIVATE USE_LASERXT)
endif()

View File

@@ -194,7 +194,7 @@ cart_reset(void)
cart_image_close(1);
cart_image_close(0);
if (!(machines[machine].flags & MACHINE_CARTRIDGE))
if (!machine_has_cartridge(machine))
return;
for (i = 0; i < 2; i++) {

View File

@@ -82,6 +82,8 @@
#include <86box/plat.h>
#include <86box/isamem.h>
#include "cpu.h"
#define ISAMEM_DEBUG 0
@@ -455,7 +457,7 @@ dev->frame_addr = 0xE0000;
isamem_log(")\n");
/* Force (back to) 8-bit bus if needed. */
if ((!AT) && (dev->flags & FLAG_WIDE)) {
if ((!is286) && (dev->flags & FLAG_WIDE)) {
isamem_log("ISAMEM: not AT+ system, forcing 8-bit mode!\n");
dev->flags &= ~FLAG_WIDE;
}
@@ -559,7 +561,7 @@ dev->frame_addr = 0xE0000;
* real mode (so, not by DOS, for example) but it can be used in
* protected mode.
*/
if (AT && addr > 0 && tot > 0) {
if (is286 && addr > 0 && tot > 0) {
t = tot;
isamem_log("ISAMEM: RAM at %05iKB (%iKB)\n", addr>>10, t>>10);

View File

@@ -26,6 +26,8 @@
#include <86box/machine.h>
#include <86box/keyboard.h>
#include "cpu.h"
int keyboard_scan;
void (*keyboard_send)(uint16_t val);
@@ -103,7 +105,8 @@ key_process(uint16_t scan, int down)
if (!down && codes[scan].brk[0] == 0)
return;
if (AT && ((keyboard_mode & 3) == 3)) {
/* TODO: The keyboard controller needs to report the AT flag to us here. */
if (is286 && ((keyboard_mode & 3) == 3)) {
if (!keyboard_set3_all_break && !down && !(keyboard_set3_flags[codes[scan].mk[0]] & 2))
return;
}
@@ -212,7 +215,8 @@ keyboard_do_break(uint16_t scan)
{
scancode *codes = scan_table;
if (AT && ((keyboard_mode & 3) == 3)) {
/* TODO: The keyboard controller needs to report the AT flag to us here. */
if (is286 && ((keyboard_mode & 3) == 3)) {
if (!keyboard_set3_all_break &&
!recv_key[scan] &&
!(keyboard_set3_flags[codes[scan].mk[0]] & 2))

View File

@@ -1063,7 +1063,7 @@ write_output(atkbd_t *dev, uint8_t val)
val |= ((dev->mem[0] << 4) & 0x10);
/*IRQ 12*/
if ((dev->output_port ^ val) & 0x20) {
if ((old ^ val) & 0x20) {
if (val & 0x20)
picint(1 << 12);
else
@@ -1071,26 +1071,23 @@ write_output(atkbd_t *dev, uint8_t val)
}
/*IRQ 1*/
if ((dev->output_port ^ val) & 0x10) {
if ((old ^ val) & 0x10) {
if (val & 0x10)
picint(1 << 1);
else
picintc(1 << 1);
}
if ((dev->output_port ^ val) & 0x02) { /*A20 enable change*/
if ((old ^ val) & 0x02) { /*A20 enable change*/
mem_a20_key = val & 0x02;
mem_a20_recalc();
flushmmucache();
}
/* Do this here to avoid an infinite reset loop. */
dev->output_port = val;
/* 0 holds the CPU in the RESET state, 1 releases it. To simplify this,
we just do everything on release. */
if ((val & 0x01) && !(old & 0x01)) {
if (val & 0x01) {
if ((old ^ val) & 0x01) { /*Reset*/
if (! (val & 0x01)) { /* Pin 0 selected. */
/* Pin 0 selected. */
kbd_log("write_output(): Pulse reset!\n");
softresetx86(); /*Pulse reset!*/
@@ -1098,6 +1095,9 @@ write_output(atkbd_t *dev, uint8_t val)
flushmmucache();
}
}
/* Do this here to avoid an infinite reset loop. */
dev->output_port = val;
}
@@ -1464,7 +1464,7 @@ write64_ami(void *priv, uint8_t val)
case 0xb0: case 0xb1: case 0xb2: case 0xb3:
/* set KBC lines P10-P13 (input port bits 0-3) low */
kbd_log("ATkbc: set KBC lines P10-P13 (input port bits 0-3) low\n");
if (!PCI || (val > 0xb1))
if (!(dev->flags & DEVICE_PCI) || (val > 0xb1))
dev->input_port &= ~(1 << (val & 0x03));
add_data(dev, 0x00);
return 0;
@@ -1472,7 +1472,7 @@ write64_ami(void *priv, uint8_t val)
case 0xb4: case 0xb5:
/* set KBC lines P22-P23 (output port bits 2-3) low */
kbd_log("ATkbc: set KBC lines P22-P23 (output port bits 2-3) low\n");
if (! PCI)
if (! (dev->flags & DEVICE_PCI))
write_output(dev, dev->output_port & ~(4 << (val & 0x01)));
add_data(dev, 0x00);
return 0;
@@ -1480,7 +1480,7 @@ write64_ami(void *priv, uint8_t val)
case 0xb8: case 0xb9: case 0xba: case 0xbb:
/* set KBC lines P10-P13 (input port bits 0-3) high */
kbd_log("ATkbc: set KBC lines P10-P13 (input port bits 0-3) high\n");
if (!PCI || (val > 0xb9)) {
if (!(dev->flags & DEVICE_PCI) || (val > 0xb9)) {
dev->input_port |= (1 << (val & 0x03));
add_data(dev, 0x00);
}
@@ -1489,7 +1489,7 @@ write64_ami(void *priv, uint8_t val)
case 0xbc: case 0xbd:
/* set KBC lines P22-P23 (output port bits 2-3) high */
kbd_log("ATkbc: set KBC lines P22-P23 (output port bits 2-3) high\n");
if (! PCI)
if (! (dev->flags & DEVICE_PCI))
write_output(dev, dev->output_port | (4 << (val & 0x01)));
add_data(dev, 0x00);
return 0;

View File

@@ -755,9 +755,6 @@ kbd_init(const device_t *info)
/* Switch 2 - 8087 FPU. */
if (hasfpu)
kbd->pd |= 0x02;
/* Switch 1 - always off. */
kbd->pd |= 0x01;
} else if (kbd-> type == 9) {
/* Zenith Data Systems Z-151
* SW2 switch settings:

View File

@@ -111,15 +111,15 @@ postcard_init(const device_t *info)
{
postcard_reset();
if (machines[machine].flags & MACHINE_MCA)
if (machine_has_bus(machine, MACHINE_BUS_MCA))
postcard_port = 0x680; /* MCA machines */
else if (strstr(machines[machine].name, " PS/2 ") || strstr(machines[machine].name, " PS/1 "))
else if (strstr(machines[machine].name, " PS/2 ") || strstr(machine_getname_ex(machine), " PS/1 "))
postcard_port = 0x190; /* ISA PS/2 machines */
else if (strstr(machines[machine].name, " IBM XT "))
postcard_port = 0x60; /* IBM XT */
else if (strstr(machines[machine].name, " IBM PCjr"))
postcard_port = 0x10; /* IBM PCjr */
else if (strstr(machines[machine].name, " Compaq ") && !(machines[machine].flags & MACHINE_PCI))
else if (strstr(machines[machine].name, " Compaq ") && !machine_has_bus(machine, MACHINE_BUS_PCI))
postcard_port = 0x84; /* ISA Compaq machines */
else
postcard_port = 0x80; /* AT and clone machines */

View File

@@ -129,7 +129,7 @@ serial_update_ints(serial_t *dev)
}
if (stat && (dev->irq != 0xff) && ((dev->mctrl & 8) || (dev->type == SERIAL_8250_PCJR))) {
if (dev->type >= SERIAL_NS16450)
if (dev->type >= SERIAL_16450)
picintlevel(1 << dev->irq);
else
picint(1 << dev->irq);
@@ -151,9 +151,9 @@ serial_clear_timeout(serial_t *dev)
static void
write_fifo(serial_t *dev, uint8_t dat)
{
serial_log("write_fifo(%08X, %02X, %i, %i)\n", dev, dat, (dev->type >= SERIAL_NS16550) && dev->fifo_enabled, dev->rcvr_fifo_pos & 0x0f);
serial_log("write_fifo(%08X, %02X, %i, %i)\n", dev, dat, (dev->type >= SERIAL_16550) && dev->fifo_enabled, dev->rcvr_fifo_pos & 0x0f);
if ((dev->type >= SERIAL_NS16550) && dev->fifo_enabled) {
if ((dev->type >= SERIAL_16550) && dev->fifo_enabled) {
/* FIFO mode. */
timer_disable(&dev->timeout_timer);
/* Indicate overrun. */
@@ -189,7 +189,7 @@ write_fifo(serial_t *dev, uint8_t dat)
void
serial_write_fifo(serial_t *dev, uint8_t dat)
{
serial_log("serial_write_fifo(%08X, %02X, %i, %i)\n", dev, dat, (dev->type >= SERIAL_NS16550) && dev->fifo_enabled, dev->rcvr_fifo_pos & 0x0f);
serial_log("serial_write_fifo(%08X, %02X, %i, %i)\n", dev, dat, (dev->type >= SERIAL_16550) && dev->fifo_enabled, dev->rcvr_fifo_pos & 0x0f);
if (!(dev->mctrl & 0x10))
write_fifo(dev, dat);
@@ -371,7 +371,7 @@ serial_write(uint16_t addr, uint8_t val, void *p)
dev->int_status &= ~SERIAL_INT_TRANSMIT;
serial_update_ints(dev);
if ((dev->type >= SERIAL_NS16550) && dev->fifo_enabled && (dev->xmit_fifo_pos < 16)) {
if ((dev->type >= SERIAL_16550) && dev->fifo_enabled && (dev->xmit_fifo_pos < 16)) {
/* FIFO mode, begin transmitting. */
timer_on_auto(&dev->transmit_timer, dev->transmit_period);
dev->transmit_enabled |= 1; /* Start moving. */
@@ -396,7 +396,7 @@ serial_write(uint16_t addr, uint8_t val, void *p)
serial_update_ints(dev);
break;
case 2:
if (dev->type >= SERIAL_NS16550) {
if (dev->type >= SERIAL_16550) {
if ((val ^ dev->fcr) & 0x01)
serial_reset_fifo(dev);
dev->fcr = val & 0xf9;
@@ -500,7 +500,7 @@ serial_write(uint16_t addr, uint8_t val, void *p)
serial_update_ints(dev);
break;
case 7:
if (dev->type >= SERIAL_NS16450)
if (dev->type >= SERIAL_16450)
dev->scratch = val;
break;
}
@@ -522,7 +522,7 @@ serial_read(uint16_t addr, void *p)
break;
}
if ((dev->type >= SERIAL_NS16550) && dev->fifo_enabled) {
if ((dev->type >= SERIAL_16550) && dev->fifo_enabled) {
/* FIFO mode. */
serial_clear_timeout(dev);
@@ -718,12 +718,12 @@ serial_set_next_inst(int ni)
void
serial_standalone_init(void) {
for ( ; next_inst < 4; )
device_add_inst(&i8250_device, next_inst + 1);
device_add_inst(&ns8250_device, next_inst + 1);
};
const device_t i8250_device = {
"Intel 8250(-compatible) UART",
const device_t ns8250_device = {
"National Semiconductor 8250(-compatible) UART",
0,
SERIAL_8250,
serial_init, serial_close, NULL,
@@ -731,8 +731,8 @@ const device_t i8250_device = {
NULL
};
const device_t i8250_pcjr_device = {
"Intel 8250(-compatible) UART for PCjr",
const device_t ns8250_pcjr_device = {
"National Semiconductor 8250(-compatible) UART for PCjr",
DEVICE_PCJR,
SERIAL_8250_PCJR,
serial_init, serial_close, NULL,
@@ -743,7 +743,7 @@ const device_t i8250_pcjr_device = {
const device_t ns16450_device = {
"National Semiconductor NS16450(-compatible) UART",
0,
SERIAL_NS16450,
SERIAL_16450,
serial_init, serial_close, NULL,
{ NULL }, serial_speed_changed, NULL,
NULL
@@ -752,7 +752,43 @@ const device_t ns16450_device = {
const device_t ns16550_device = {
"National Semiconductor NS16550(-compatible) UART",
0,
SERIAL_NS16550,
SERIAL_16550,
serial_init, serial_close, NULL,
{ NULL }, serial_speed_changed, NULL,
NULL
};
const device_t ns16650_device = {
"Startech Semiconductor 16650(-compatible) UART",
0,
SERIAL_16650,
serial_init, serial_close, NULL,
{ NULL }, serial_speed_changed, NULL,
NULL
};
const device_t ns16750_device = {
"Texas Instruments 16750(-compatible) UART",
0,
SERIAL_16750,
serial_init, serial_close, NULL,
{ NULL }, serial_speed_changed, NULL,
NULL
};
const device_t ns16850_device = {
"Exar Corporation NS16850(-compatible) UART",
0,
SERIAL_16850,
serial_init, serial_close, NULL,
{ NULL }, serial_speed_changed, NULL,
NULL
};
const device_t ns16950_device = {
"Oxford Semiconductor NS16950(-compatible) UART",
0,
SERIAL_16950,
serial_init, serial_close, NULL,
{ NULL }, serial_speed_changed, NULL,
NULL

View File

@@ -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.
#
# CMake build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# 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
hdc_st506_at.c hdc_xta.c hdc_esdi_at.c hdc_esdi_mca.c hdc_xtide.c
hdc_ide.c hdc_ide_opti611.c hdc_ide_cmd640.c hdc_ide_cmd646.c hdc_ide_sff8038i.c)
hdc_st506_at.c hdc_xta.c hdc_esdi_at.c hdc_esdi_mca.c hdc_xtide.c
hdc_ide.c hdc_ide_opti611.c hdc_ide_cmd640.c hdc_ide_cmd646.c hdc_ide_sff8038i.c)
add_library(zip OBJECT zip.c)

View File

@@ -445,7 +445,7 @@ ide_get_max(ide_t *ide, int type)
switch(type) {
case TYPE_PIO: /* PIO */
if (!ide_boards[ide->board]->force_ata3 && (ide_bm[ide->board] != NULL))
return 1;
return 4;
return 0; /* Maximum PIO 0 for legacy PIO-only drive. */
case TYPE_SDMA: /* SDMA */

View File

@@ -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.
#
# CMake build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2020,2021 David Hrdlička.
#
add_library(minivhd STATIC cwalk.c libxml2_encoding.c minivhd_convert.c
minivhd_create.c minivhd_io.c minivhd_manage.c minivhd_struct_rw.c
minivhd_util.c)
minivhd_create.c minivhd_io.c minivhd_manage.c minivhd_struct_rw.c
minivhd_util.c)

View File

@@ -46,6 +46,7 @@ static uint8_t dma_stat_rq_pc;
static uint8_t dma_command[2];
static uint8_t dma_req_is_soft;
static uint8_t dma_advanced;
static uint8_t dma_at;
static uint8_t dma_buffer[65536];
static uint16_t dma_sg_base;
static uint16_t dma16_buffer[65536];
@@ -910,7 +911,7 @@ dma_page_write(uint16_t addr, uint8_t val, void *priv)
dma[addr].ab = (dma[addr].ab & 0xff01ffff & dma_mask) | (dma[addr].page << 16);
dma[addr].ac = (dma[addr].ac & 0xff01ffff & dma_mask) | (dma[addr].page << 16);
} else {
dma[addr].page = (AT) ? val : val & 0xf;
dma[addr].page = (dma_at) ? val : val & 0xf;
dma[addr].ab = (dma[addr].ab & 0xff00ffff & dma_mask) | (dma[addr].page << 16);
dma[addr].ac = (dma[addr].ac & 0xff00ffff & dma_mask) | (dma[addr].page << 16);
}
@@ -1002,6 +1003,13 @@ dma_set_mask(uint32_t mask)
}
void
dma_set_at(uint8_t at)
{
dma_at = at;
}
void
dma_reset(void)
{
@@ -1034,6 +1042,8 @@ dma_reset(void)
dma_sg_base = 0x0400;
dma_mask = 0x00ffffff;
dma_at = is286;
}
@@ -1310,7 +1320,7 @@ _dma_write(uint32_t addr, uint8_t val, dma_t *dma_c)
dma_bm_write(addr, &val, 1, dma_transfer_size(dma_c));
} else {
mem_writeb_phys(addr, val);
if (AT)
if (dma_at)
mem_invalidate_range(addr, addr);
}
}
@@ -1387,7 +1397,7 @@ dma_channel_read(int channel)
if ((dma_c->mode & 0xC) != 8)
return(DMA_NODATA);
if (!AT && !channel)
if (!dma_at && !channel)
refreshread();
if (! dma_c->size) {
@@ -1689,6 +1699,6 @@ dma_bm_write(uint32_t PhysAddress, const uint8_t *DataWrite, uint32_t TotalSize,
mem_write_phys((void *) bytes, PhysAddress + n, TransferSize);
}
if (AT)
if (dma_at)
mem_invalidate_range(PhysAddress, PhysAddress + TotalSize - 1);
}

116
src/fifo8.c Normal file
View File

@@ -0,0 +1,116 @@
/*
* Generic FIFO component, implemented as a circular buffer.
*
* Copyright (c) 2012 Peter A. G. Crosthwaite
*
* 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <assert.h>
#include <86box/86box.h>
#include <86box/fifo8.h>
void fifo8_create(Fifo8 *fifo, uint32_t capacity)
{
fifo->data = (uint8_t *)malloc(capacity);
memset(fifo->data, 0, capacity);
fifo->capacity = capacity;
fifo->head = 0;
fifo->num = 0;
}
void fifo8_destroy(Fifo8 *fifo)
{
if (fifo->data) {
free(fifo->data);
fifo->data = NULL;
}
}
void fifo8_push(Fifo8 *fifo, uint8_t data)
{
assert(fifo->num < fifo->capacity);
fifo->data[(fifo->head + fifo->num) % fifo->capacity] = data;
fifo->num++;
}
void fifo8_push_all(Fifo8 *fifo, const uint8_t *data, uint32_t num)
{
uint32_t start, avail;
assert(fifo->num + num <= fifo->capacity);
start = (fifo->head + fifo->num) % fifo->capacity;
if (start + num <= fifo->capacity) {
memcpy(&fifo->data[start], data, num);
} else {
avail = fifo->capacity - start;
memcpy(&fifo->data[start], data, avail);
memcpy(&fifo->data[0], &data[avail], num - avail);
}
fifo->num += num;
}
uint8_t fifo8_pop(Fifo8 *fifo)
{
uint8_t ret;
assert(fifo->num > 0);
ret = fifo->data[fifo->head++];
fifo->head %= fifo->capacity;
fifo->num--;
return ret;
}
const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *num)
{
uint8_t *ret;
assert(max > 0 && max <= fifo->num);
*num = MIN(fifo->capacity - fifo->head, max);
ret = &fifo->data[fifo->head];
fifo->head += *num;
fifo->head %= fifo->capacity;
fifo->num -= *num;
return ret;
}
void fifo8_reset(Fifo8 *fifo)
{
fifo->num = 0;
fifo->head = 0;
}
int fifo8_is_empty(Fifo8 *fifo)
{
return (fifo->num == 0);
}
int fifo8_is_full(Fifo8 *fifo)
{
return (fifo->num == fifo->capacity);
}
uint32_t fifo8_num_free(Fifo8 *fifo)
{
return fifo->capacity - fifo->num;
}
uint32_t fifo8_num_used(Fifo8 *fifo)
{
return fifo->num;
}

View File

@@ -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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2020,2021 David Hrdlička.
#
add_library(fdd OBJECT fdd.c fdc.c fdc_magitronic.c fdc_pii15xb.c fdi2raw.c fdd_common.c
fdd_86f.c fdd_fdi.c fdd_imd.c fdd_img.c fdd_json.c fdd_mfm.c fdd_td0.c)
fdd_86f.c fdd_fdi.c fdd_imd.c fdd_img.c fdd_json.c fdd_mfm.c fdd_td0.c)

View File

@@ -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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2020,2021 David Hrdlička.
#
add_library(game OBJECT gameport.c joystick_standard.c
joystick_ch_flightstick_pro.c joystick_sw_pad.c joystick_tm_fcs.c)
joystick_ch_flightstick_pro.c joystick_sw_pad.c joystick_tm_fcs.c)

View File

@@ -80,16 +80,18 @@ static const struct {
const char *internal_name;
const joystick_if_t *joystick;
} joysticks[] = {
{ "none", &joystick_none },
{ "standard_2button", &joystick_standard },
{ "standard_4button", &joystick_standard_4button },
{ "standard_6button", &joystick_standard_6button },
{ "standard_8button", &joystick_standard_8button },
{ "4axis_4button", &joystick_4axis_4button },
{ "none", &joystick_none },
{ "2axis_2button", &joystick_2axis_2button },
{ "2axis_4button", &joystick_2axis_4button },
{ "2axis_6button", &joystick_2axis_6button },
{ "2axis_8button", &joystick_2axis_8button },
{ "3axis_2button", &joystick_3axis_2button },
{ "3axis_4button", &joystick_3axis_4button },
{ "4axis_4button", &joystick_4axis_4button },
{ "ch_flighstick_pro", &joystick_ch_flightstick_pro },
{ "sidewinder_pad", &joystick_sw_pad },
{ "thrustmaster_fcs", &joystick_tm_fcs },
{ "", NULL }
{ "", NULL }
};
static joystick_instance_t *joystick_instance = NULL;
@@ -360,7 +362,7 @@ gameport_add(const device_t *gameport_type)
{
/* Prevent a standalone game port from being added later on, unless this
is an unused Super I/O game port (no MACHINE_GAMEPORT machine flag). */
if (!(gameport_type->local & GAMEPORT_SIO) || (machines[machine].flags & MACHINE_GAMEPORT))
if (!(gameport_type->local & GAMEPORT_SIO) || machine_has_flags(machine, MACHINE_GAMEPORT))
standalone_gameport_type = NULL;
/* Add game port device. */
@@ -444,7 +446,7 @@ const device_t gameport_device = {
};
const device_t gameport_201_device = {
"Game port (port 201h only)",
"Game port (Port 201h only)",
0, 0x010201,
gameport_init,
gameport_close,
@@ -452,6 +454,24 @@ const device_t gameport_201_device = {
NULL
};
const device_t gameport_208_device = {
"Game port (Port 208h-20fh)",
0, 0x080208,
gameport_init,
gameport_close,
NULL, { NULL }, NULL,
NULL
};
const device_t gameport_209_device = {
"Game port (Port 209h only)",
0, 0x010209,
gameport_init,
gameport_close,
NULL, { NULL }, NULL,
NULL
};
const device_t gameport_pnp_device = {
"Game port (Plug and Play only)",
0, 0x080000,

View File

@@ -145,6 +145,26 @@ static int joystick_standard_read_axis_4button(void *p, int axis)
}
}
static int joystick_standard_read_axis_3axis(void *p, int axis)
{
if (!JOYSTICK_PRESENT(0))
return AXIS_NOT_PRESENT;
switch (axis)
{
case 0:
return joystick_state[0].axis[0];
case 1:
return joystick_state[0].axis[1];
case 2:
return joystick_state[0].axis[2];
case 3:
return 0;
default:
return 0;
}
}
static int joystick_standard_read_axis_4axis(void *p, int axis)
{
if (!JOYSTICK_PRESENT(0))
@@ -216,9 +236,9 @@ static void joystick_standard_a0_over(void *p)
{
}
const joystick_if_t joystick_standard =
const joystick_if_t joystick_2axis_2button =
{
"Standard 2-button joystick(s)",
"2-axis, 2-button joystick(s)",
joystick_standard_init,
joystick_standard_close,
joystick_standard_read,
@@ -232,9 +252,9 @@ const joystick_if_t joystick_standard =
{"X axis", "Y axis"},
{"Button 1", "Button 2"}
};
const joystick_if_t joystick_standard_4button =
const joystick_if_t joystick_2axis_4button =
{
"Standard 4-button joystick",
"2-axis, 4-button joystick",
joystick_standard_init,
joystick_standard_close,
joystick_standard_read_4button,
@@ -248,9 +268,41 @@ const joystick_if_t joystick_standard_4button =
{"X axis", "Y axis"},
{"Button 1", "Button 2", "Button 3", "Button 4"}
};
const joystick_if_t joystick_3axis_2button =
{
"3-axis, 2-button joystick",
joystick_standard_init,
joystick_standard_close,
joystick_standard_read,
joystick_standard_write,
joystick_standard_read_axis_3axis,
joystick_standard_a0_over,
3,
2,
0,
1,
{"X axis", "Y axis", "Z axis"},
{"Button 1", "Button 2"}
};
const joystick_if_t joystick_3axis_4button =
{
"3-axis, 4-button joystick",
joystick_standard_init,
joystick_standard_close,
joystick_standard_read_4button,
joystick_standard_write,
joystick_standard_read_axis_3axis,
joystick_standard_a0_over,
3,
4,
0,
1,
{"X axis", "Y axis", "Z axis"},
{"Button 1", "Button 2", "Button 3", "Button 4"}
};
const joystick_if_t joystick_4axis_4button =
{
"4-axis 4-button joystick",
"4-axis, 4-button joystick",
joystick_standard_init,
joystick_standard_close,
joystick_standard_read_4button,
@@ -264,9 +316,9 @@ const joystick_if_t joystick_4axis_4button =
{"X axis", "Y axis", "Z axis", "zX axis"},
{"Button 1", "Button 2", "Button 3", "Button 4"}
};
const joystick_if_t joystick_standard_6button =
const joystick_if_t joystick_2axis_6button =
{
"Standard 6-button joystick",
"2-axis, 6-button joystick",
joystick_standard_init,
joystick_standard_close,
joystick_standard_read_4button,
@@ -280,9 +332,9 @@ const joystick_if_t joystick_standard_6button =
{"X axis", "Y axis"},
{"Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6"}
};
const joystick_if_t joystick_standard_8button =
const joystick_if_t joystick_2axis_8button =
{
"Standard 8-button joystick",
"2-axis, 8-button joystick",
joystick_standard_init,
joystick_standard_close,
joystick_standard_read_4button,

View File

@@ -15,7 +15,7 @@
* connected
* - Packet preceeded by high data (currently 50us), and
* followed by low data (currently 160us) - timings are
* probably wrong, but good enoughfor everything I've tried
* probably wrong, but good enough for everything I've tried
* - Analog inputs are only used to time ID packet request.
* If A0 timing out is followed after ~64us by another 0x201
* write then an ID packet is triggered
@@ -259,7 +259,7 @@ static void sw_a0_over(void *p)
{
sw_data *sw = (sw_data *)p;
timer_set_delay_u64(&sw->trigger_timer, TIMER_USEC * 10000);
timer_set_delay_u64(&sw->trigger_timer, TIMER_USEC * 10000);
}
const joystick_if_t joystick_sw_pad =
@@ -273,7 +273,7 @@ const joystick_if_t joystick_sw_pad =
sw_a0_over,
2,
10,
0,
0,
4,
{"X axis", "Y axis"},
{"A", "B", "C", "X", "Y", "Z", "L", "R", "Start", "M"}

View File

@@ -145,7 +145,7 @@ extern void device_speed_changed(void);
extern void device_force_redraw(void);
extern void device_get_name(const device_t *d, int bus, char *name);
extern int device_is_valid(const device_t *, int machine_flags);
extern int device_is_valid(const device_t *, int m);
extern int device_get_config_int(const char *name);
extern int device_get_config_int_ex(const char *s, int dflt_int);

View File

@@ -98,6 +98,8 @@ extern void dma_bm_write(uint32_t PhysAddress, const uint8_t *DataWrite, uint32_
void dma_set_params(uint8_t advanced, uint32_t mask);
void dma_set_mask(uint32_t mask);
void dma_set_at(uint8_t at);
void dma_ext_mode_init(void);
void dma_high_page_init(void);

149
src/include/86box/fifo8.h Normal file
View File

@@ -0,0 +1,149 @@
#ifndef EMU_FIFO8_H
#define EMU_FIFO8_H
typedef struct {
/* All fields are private */
uint8_t *data;
uint32_t capacity;
uint32_t head;
uint32_t num;
} Fifo8;
/**
* fifo8_create:
* @fifo: struct Fifo8 to initialise with new FIFO
* @capacity: capacity of the newly created FIFO
*
* Create a FIFO of the specified size. Clients should call fifo8_destroy()
* when finished using the fifo. The FIFO is initially empty.
*/
extern void fifo8_create(Fifo8 *fifo, uint32_t capacity);
/**
* fifo8_destroy:
* @fifo: FIFO to cleanup
*
* Cleanup a FIFO created with fifo8_create(). Frees memory created for FIFO
*storage. The FIFO is no longer usable after this has been called.
*/
extern void fifo8_destroy(Fifo8 *fifo);
/**
* fifo8_push:
* @fifo: FIFO to push to
* @data: data byte to push
*
* Push a data byte to the FIFO. Behaviour is undefined if the FIFO is full.
* Clients are responsible for checking for fullness using fifo8_is_full().
*/
extern void fifo8_push(Fifo8 *fifo, uint8_t data);
/**
* fifo8_push_all:
* @fifo: FIFO to push to
* @data: data to push
* @size: number of bytes to push
*
* Push a byte array to the FIFO. Behaviour is undefined if the FIFO is full.
* Clients are responsible for checking the space left in the FIFO using
* fifo8_num_free().
*/
extern void fifo8_push_all(Fifo8 *fifo, const uint8_t *data, uint32_t num);
/**
* fifo8_pop:
* @fifo: fifo to pop from
*
* Pop a data byte from the FIFO. Behaviour is undefined if the FIFO is empty.
* Clients are responsible for checking for emptyness using fifo8_is_empty().
*
* Returns: The popped data byte.
*/
extern uint8_t fifo8_pop(Fifo8 *fifo);
/**
* fifo8_pop_buf:
* @fifo: FIFO to pop from
* @max: maximum number of bytes to pop
* @num: actual number of returned bytes
*
* Pop a number of elements from the FIFO up to a maximum of max. The buffer
* containing the popped data is returned. This buffer points directly into
* the FIFO backing store and data is invalidated once any of the fifo8_* APIs
* are called on the FIFO.
*
* The function may return fewer bytes than requested when the data wraps
* around in the ring buffer; in this case only a contiguous part of the data
* is returned.
*
* The number of valid bytes returned is populated in *num; will always return
* at least 1 byte. max must not be 0 or greater than the number of bytes in
* the FIFO.
*
* Clients are responsible for checking the availability of requested data
* using fifo8_num_used().
*
* Returns: A pointer to popped data.
*/
extern const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *num);
/**
* fifo8_reset:
* @fifo: FIFO to reset
*
* Reset a FIFO. All data is discarded and the FIFO is emptied.
*/
extern void fifo8_reset(Fifo8 *fifo);
/**
* fifo8_is_empty:
* @fifo: FIFO to check
*
* Check if a FIFO is empty.
*
* Returns: True if the fifo is empty, false otherwise.
*/
extern int fifo8_is_empty(Fifo8 *fifo);
/**
* fifo8_is_full:
* @fifo: FIFO to check
*
* Check if a FIFO is full.
*
* Returns: True if the fifo is full, false otherwise.
*/
extern int fifo8_is_full(Fifo8 *fifo);
/**
* fifo8_num_free:
* @fifo: FIFO to check
*
* Return the number of free bytes in the FIFO.
*
* Returns: Number of free bytes.
*/
extern uint32_t fifo8_num_free(Fifo8 *fifo);
/**
* fifo8_num_used:
* @fifo: FIFO to check
*
* Return the number of used bytes in the FIFO.
*
* Returns: Number of used bytes.
*/
extern uint32_t fifo8_num_used(Fifo8 *fifo);
#endif /* EMU_FIFO8_H */

View File

@@ -108,6 +108,8 @@ extern "C" {
#ifdef EMU_DEVICE_H
extern const device_t gameport_device;
extern const device_t gameport_201_device;
extern const device_t gameport_208_device;
extern const device_t gameport_209_device;
extern const device_t gameport_pnp_device;
extern const device_t gameport_pnp_6io_device;
extern const device_t gameport_sio_device;

View File

@@ -35,8 +35,10 @@
* USA.
*/
extern const joystick_if_t joystick_standard;
extern const joystick_if_t joystick_standard_4button;
extern const joystick_if_t joystick_2axis_2button;
extern const joystick_if_t joystick_2axis_4button;
extern const joystick_if_t joystick_3axis_2button;
extern const joystick_if_t joystick_3axis_4button;
extern const joystick_if_t joystick_4axis_4button;
extern const joystick_if_t joystick_standard_6button;
extern const joystick_if_t joystick_standard_8button;
extern const joystick_if_t joystick_2axis_6button;
extern const joystick_if_t joystick_2axis_8button;

View File

@@ -125,6 +125,8 @@
#define IDS_2149 2149 // "Cassette images (*.PCM;*.RAW;*..."
#define IDS_2150 2150 // "Cartridge %i: %ls"
#define IDS_2151 2151 // "Cartridge images (*.JRC)\0*.JRC\0..."
#define IDS_2152 2152 // "Error initializing renderer"
#define IDS_2153 2153 // "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
#define IDS_4096 4096 // "Hard disk (%s)"
#define IDS_4097 4097 // "%01i:%01i"
@@ -233,7 +235,7 @@
#define IDS_LANG_ENUS IDS_7168
#define STR_NUM_2048 104
#define STR_NUM_2048 106
#define STR_NUM_3072 11
#define STR_NUM_4096 40
#define STR_NUM_4352 6

View File

@@ -85,8 +85,8 @@
#define MACHINE_SCSI_DUAL 0x18000000 /* sys has int dual SCSI - mark as both pri and sec SCSI */
#define MACHINE_CARTRIDGE 0x20000000 /* sys has two cartridge bays */
#define IS_ARCH(m, a) (machines[m].flags & (a)) ? 1 : 0;
#define IS_AT(m) ((machines[m].flags & 0x00000FC8) && !(machines[m].flags & MACHINE_PC98)) ? 1 : 0;
#define IS_ARCH(m, a) ((machines[m].flags & (a)) ? 1 : 0)
#define IS_AT(m) (((machines[m].flags & 0x00000FC8) && !(machines[m].flags & MACHINE_PC98)) ? 1 : 0)
#define CPU_BLOCK(...) (const uint8_t[]) {__VA_ARGS__, 0}
#define MACHINE_MULTIPLIER_FIXED -1, -1
@@ -182,13 +182,13 @@ extern const machine_type_t machine_types[];
extern const machine_t machines[];
extern int bios_only;
extern int machine;
extern int AT, PCI;
/* Core functions. */
extern int machine_count(void);
extern int machine_available(int m);
extern char *machine_getname(void);
extern char *machine_getname_ex(int m);
extern char *machine_get_internal_name(void);
extern int machine_get_machine_from_internal_name(char *s);
extern void machine_init(void);
@@ -197,6 +197,13 @@ extern const device_t *machine_getdevice(int m);
#endif
extern char *machine_get_internal_name_ex(int m);
extern int machine_get_nvrmask(int m);
extern int machine_has_flags(int m, int flags);
extern int machine_has_bus(int m, int bus_flags);
extern int machine_has_cartridge(int m);
extern int machine_get_min_ram(int m);
extern int machine_get_max_ram(int m);
extern int machine_get_ram_granularity(int m);
extern int machine_get_type(int m);
extern void machine_close(void);
@@ -351,7 +358,7 @@ extern int machine_at_greenb_init(const machine_t *);
extern int machine_at_r418_init(const machine_t *);
extern int machine_at_ls486e_init(const machine_t *);
extern int machine_at_4dps_init(const machine_t *);
extern int machine_at_4sa2_init(const machine_t *);
extern int machine_at_4saw2_init(const machine_t *);
extern int machine_at_m4li_init(const machine_t *);
extern int machine_at_alfredo_init(const machine_t *);
extern int machine_at_ninja_init(const machine_t *);

View File

@@ -95,7 +95,8 @@ extern void midi_in_sysex(uint8_t *buffer, uint32_t len);
#define MIDI_INPUT_INTERNAL_NAME "midi_in"
#ifdef EMU_DEVICE_H
extern const device_t system_midi_device;
extern const device_t rtmidi_device;
extern const device_t rtmidi_input_device;
#ifdef USE_FLUIDSYNTH
extern const device_t fluidsynth_device;
#endif

View File

@@ -1 +0,0 @@
extern const device_t midi_input_device;

View File

@@ -0,0 +1,13 @@
#ifdef __cplusplus
extern "C"
{
#endif
extern int rtmidi_get_num_devs(void);
extern void rtmidi_get_dev_name(int num, char *s);
extern int rtmidi_in_get_num_devs(void);
extern void rtmidi_in_get_dev_name(int num, char *s);
#ifdef __cplusplus
}
#endif

View File

@@ -1 +0,0 @@
extern const device_t system_midi_device;

View File

@@ -67,7 +67,7 @@
typedef struct _nvr_ {
char *fn; /* pathname of image file */
uint16_t size; /* device configuration */
int8_t irq, new;
int8_t irq, is_new;
uint8_t onesec_cnt;
pc_timer_t onesec_time;
@@ -112,6 +112,7 @@ extern int nvr_save(void);
extern int nvr_is_leap(int year);
extern int nvr_get_days(int month, int year);
extern void nvr_time_sync();
extern void nvr_time_get(struct tm *);
extern void nvr_time_set(struct tm *);

View File

@@ -98,8 +98,6 @@ extern void pci_set_irq_level(int pci_int, int level);
extern void pci_enable_mirq(int mirq);
extern void pci_set_mirq_routing(int mirq, int irq);
extern uint8_t pci_use_mirq(uint8_t mirq);
extern int pci_irq_is_level(int irq);
extern void pci_set_mirq(uint8_t mirq, int level);
@@ -127,6 +125,8 @@ extern void trc_write(uint16_t port, uint8_t val, void *priv);
extern void pci_bridge_set_ctl(void *priv, uint8_t ctl);
extern void pci_pic_reset(void);
#ifdef EMU_DEVICE_H
extern const device_t dec21150_device;

View File

@@ -45,6 +45,7 @@ extern void pic_elcr_write(uint16_t port, uint8_t val, void *priv);
extern uint8_t pic_elcr_read(uint16_t port, void *priv);
extern void pic_set_shadow(int sh);
extern void pic_set_pci_flag(int pci);
extern void pic_set_pci(void);
extern void pic_init(void);
extern void pic_init_pcjr(void);

View File

@@ -63,13 +63,18 @@ extern int strnicmp(const char* s1, const char* s2, size_t n);
#ifdef __cplusplus
#include <atomic>
#define atomic_flag_t std::atomic_flag
extern "C" {
#else
#include <stdatomic.h>
#define atomic_flag_t atomic_flag
#endif
/* Global variables residing in the platform module. */
extern int dopause, /* system is paused */
doresize, /* screen resize requested */
mouse_capture; /* mouse is captured in app */
extern atomic_flag_t doresize; /* screen resize requested */
extern volatile int is_quit; /* system exit requested */
#ifdef MTR_ENABLED
@@ -165,7 +170,7 @@ typedef void event_t;
typedef void mutex_t;
extern thread_t *thread_create(void (*thread_func)(void *param), void *param);
extern int thread_wait(thread_t *arg, int timeout);
extern int thread_wait(thread_t *arg);
extern event_t *thread_create_event(void);
extern void thread_set_event(event_t *arg);
extern void thread_reset_event(event_t *arg);
@@ -175,7 +180,6 @@ extern void thread_destroy_event(event_t *arg);
#define MUTEX_DEFAULT_SPIN_COUNT 1024
extern mutex_t *thread_create_mutex(void);
extern mutex_t *thread_create_mutex_with_spin_count(unsigned int spin_count);
extern void thread_close_mutex(mutex_t *arg);
extern int thread_wait_mutex(mutex_t *arg);
extern int thread_release_mutex(mutex_t *mutex);

View File

@@ -1,15 +0,0 @@
extern void plat_midi_init(void);
extern void plat_midi_close(void);
extern void plat_midi_play_msg(uint8_t *msg);
extern void plat_midi_play_sysex(uint8_t *sysex, unsigned int len);
extern int plat_midi_write(uint8_t val);
extern int plat_midi_get_num_devs(void);
extern void plat_midi_get_dev_name(int num, char *s);
extern void plat_midi_input_init(void);
extern void plat_midi_input_close(void);
extern int plat_midi_in_get_num_devs(void);
extern void plat_midi_in_get_dev_name(int num, char *s);

View File

@@ -27,6 +27,7 @@
extern const device_t dc390_pci_device;
extern const device_t ncr53c90_mca_device;
#endif /*SCSI_BUSLOGIC_H*/

View File

@@ -6,7 +6,8 @@
*
* This file is part of the 86Box distribution.
*
* Definitions for the NS8250/16450/16550 UART emulation.
* Definitions for the NS8250/16450/16550/16650/16750/16850/16950
* UART emulation.
*
*
*
@@ -22,10 +23,14 @@
# define EMU_SERIAL_H
#define SERIAL_8250 0
#define SERIAL_8250 0
#define SERIAL_8250_PCJR 1
#define SERIAL_NS16450 2
#define SERIAL_NS16550 3
#define SERIAL_16450 2
#define SERIAL_16550 3
#define SERIAL_16650 4
#define SERIAL_16750 5
#define SERIAL_16850 6
#define SERIAL_16950 7
#define SERIAL_FIFO_SIZE 16
@@ -39,8 +44,6 @@
#define SERIAL4_ADDR 0x02e8
#define SERIAL4_IRQ 3
#define MAX_SERIAL 4
struct serial_device_s;
struct serial_s;
@@ -89,10 +92,14 @@ extern void serial_standalone_init(void);
extern void serial_set_clock_src(serial_t *dev, double clock_src);
extern void serial_reset_port(serial_t *dev);
extern const device_t i8250_device;
extern const device_t i8250_pcjr_device;
extern const device_t ns8250_device;
extern const device_t ns8250_pcjr_device;
extern const device_t ns16450_device;
extern const device_t ns16550_device;
extern const device_t ns16650_device;
extern const device_t ns16750_device;
extern const device_t ns16850_device;
extern const device_t ns16950_device;
#endif /*EMU_SERIAL_H*/

View File

@@ -66,6 +66,11 @@ typedef struct sb_dsp_t
int sb_irqm8, sb_irqm16, sb_irqm401;
uint8_t sb_asp_regs[256];
uint8_t sb_asp_mode;
uint8_t sb_asp_ram[2048];
int sb_asp_ram_index;
uint8_t sb_8051_ram[256];
int sbenable, sb_enable_i;

View File

@@ -66,6 +66,7 @@ extern void ui_status_update(void);
extern int ui_sb_find_part(int tag);
extern void ui_sb_set_ready(int ready);
extern void ui_sb_update_panes(void);
extern void ui_sb_update_text(void);
extern void ui_sb_update_tip(int meaning);
extern void ui_sb_timer_callback(int pane);
extern void ui_sb_update_icon(int tag, int val);

View File

@@ -1,23 +1,24 @@
/*
OpenGL loader generated by glad 0.1.34 on Tue Apr 27 15:16:07 2021.
OpenGL loader generated by glad 0.1.34 on Sat Dec 4 18:46:02 2021.
Language/Generator: C/C++
Specification: gl
APIs: gl=3.3
APIs: gl=3.0
Profile: core
Extensions:
GL_ARB_buffer_storage,
GL_ARB_debug_output
GL_ARB_debug_output,
GL_ARB_sync
Loader: True
Local files: False
Omit khrplatform: False
Reproducible: False
Commandline:
--profile="core" --api="gl=3.3" --generator="c" --spec="gl" --extensions="GL_ARB_buffer_storage,GL_ARB_debug_output"
--profile="core" --api="gl=3.0" --generator="c" --spec="gl" --extensions="GL_ARB_buffer_storage,GL_ARB_debug_output,GL_ARB_sync"
Online:
https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.3&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_debug_output
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
*/
@@ -811,147 +812,6 @@ typedef void (APIENTRY *GLVULKANPROCNV)(void);
#define GL_RG32I 0x823B
#define GL_RG32UI 0x823C
#define GL_VERTEX_ARRAY_BINDING 0x85B5
#define GL_SAMPLER_2D_RECT 0x8B63
#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
#define GL_SAMPLER_BUFFER 0x8DC2
#define GL_INT_SAMPLER_2D_RECT 0x8DCD
#define GL_INT_SAMPLER_BUFFER 0x8DD0
#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
#define GL_TEXTURE_BUFFER 0x8C2A
#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
#define GL_TEXTURE_RECTANGLE 0x84F5
#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
#define GL_R8_SNORM 0x8F94
#define GL_RG8_SNORM 0x8F95
#define GL_RGB8_SNORM 0x8F96
#define GL_RGBA8_SNORM 0x8F97
#define GL_R16_SNORM 0x8F98
#define GL_RG16_SNORM 0x8F99
#define GL_RGB16_SNORM 0x8F9A
#define GL_RGBA16_SNORM 0x8F9B
#define GL_SIGNED_NORMALIZED 0x8F9C
#define GL_PRIMITIVE_RESTART 0x8F9D
#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
#define GL_COPY_READ_BUFFER 0x8F36
#define GL_COPY_WRITE_BUFFER 0x8F37
#define GL_UNIFORM_BUFFER 0x8A11
#define GL_UNIFORM_BUFFER_BINDING 0x8A28
#define GL_UNIFORM_BUFFER_START 0x8A29
#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
#define GL_UNIFORM_TYPE 0x8A37
#define GL_UNIFORM_SIZE 0x8A38
#define GL_UNIFORM_NAME_LENGTH 0x8A39
#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
#define GL_UNIFORM_OFFSET 0x8A3B
#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
#define GL_INVALID_INDEX 0xFFFFFFFF
#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
#define GL_LINES_ADJACENCY 0x000A
#define GL_LINE_STRIP_ADJACENCY 0x000B
#define GL_TRIANGLES_ADJACENCY 0x000C
#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
#define GL_PROGRAM_POINT_SIZE 0x8642
#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
#define GL_GEOMETRY_SHADER 0x8DD9
#define GL_GEOMETRY_VERTICES_OUT 0x8916
#define GL_GEOMETRY_INPUT_TYPE 0x8917
#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
#define GL_CONTEXT_PROFILE_MASK 0x9126
#define GL_DEPTH_CLAMP 0x864F
#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
#define GL_LAST_VERTEX_CONVENTION 0x8E4E
#define GL_PROVOKING_VERTEX 0x8E4F
#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
#define GL_OBJECT_TYPE 0x9112
#define GL_SYNC_CONDITION 0x9113
#define GL_SYNC_STATUS 0x9114
#define GL_SYNC_FLAGS 0x9115
#define GL_SYNC_FENCE 0x9116
#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
#define GL_UNSIGNALED 0x9118
#define GL_SIGNALED 0x9119
#define GL_ALREADY_SIGNALED 0x911A
#define GL_TIMEOUT_EXPIRED 0x911B
#define GL_CONDITION_SATISFIED 0x911C
#define GL_WAIT_FAILED 0x911D
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
#define GL_SAMPLE_POSITION 0x8E50
#define GL_SAMPLE_MASK 0x8E51
#define GL_SAMPLE_MASK_VALUE 0x8E52
#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
#define GL_TEXTURE_SAMPLES 0x9106
#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
#define GL_MAX_INTEGER_SAMPLES 0x9110
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
#define GL_SRC1_COLOR 0x88F9
#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
#define GL_ANY_SAMPLES_PASSED 0x8C2F
#define GL_SAMPLER_BINDING 0x8919
#define GL_RGB10_A2UI 0x906F
#define GL_TEXTURE_SWIZZLE_R 0x8E42
#define GL_TEXTURE_SWIZZLE_G 0x8E43
#define GL_TEXTURE_SWIZZLE_B 0x8E44
#define GL_TEXTURE_SWIZZLE_A 0x8E45
#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
#define GL_TIME_ELAPSED 0x88BF
#define GL_TIMESTAMP 0x8E28
#define GL_INT_2_10_10_10_REV 0x8D9F
#ifndef GL_VERSION_1_0
#define GL_VERSION_1_0 1
GLAPI int GLAD_GL_VERSION_1_0;
@@ -1843,285 +1703,6 @@ typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC)(GLuint array);
GLAPI PFNGLISVERTEXARRAYPROC glad_glIsVertexArray;
#define glIsVertexArray glad_glIsVertexArray
#endif
#ifndef GL_VERSION_3_1
#define GL_VERSION_3_1 1
GLAPI int GLAD_GL_VERSION_3_1;
typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
GLAPI PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced;
#define glDrawArraysInstanced glad_glDrawArraysInstanced
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
GLAPI PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced;
#define glDrawElementsInstanced glad_glDrawElementsInstanced
typedef void (APIENTRYP PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer);
GLAPI PFNGLTEXBUFFERPROC glad_glTexBuffer;
#define glTexBuffer glad_glTexBuffer
typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index);
GLAPI PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex;
#define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex
typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
GLAPI PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData;
#define glCopyBufferSubData glad_glCopyBufferSubData
typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
GLAPI PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices;
#define glGetUniformIndices glad_glGetUniformIndices
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
GLAPI PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv;
#define glGetActiveUniformsiv glad_glGetActiveUniformsiv
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
GLAPI PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName;
#define glGetActiveUniformName glad_glGetActiveUniformName
typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar *uniformBlockName);
GLAPI PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex;
#define glGetUniformBlockIndex glad_glGetUniformBlockIndex
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
GLAPI PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv;
#define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
GLAPI PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName;
#define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName
typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
GLAPI PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding;
#define glUniformBlockBinding glad_glUniformBlockBinding
#endif
#ifndef GL_VERSION_3_2
#define GL_VERSION_3_2 1
GLAPI int GLAD_GL_VERSION_3_2;
typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
GLAPI PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex;
#define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
GLAPI PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex;
#define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex;
#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
GLAPI PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex;
#define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex
typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC)(GLenum mode);
GLAPI PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex;
#define glProvokingVertex glad_glProvokingVertex
typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags);
GLAPI PFNGLFENCESYNCPROC glad_glFenceSync;
#define glFenceSync glad_glFenceSync
typedef GLboolean (APIENTRYP PFNGLISSYNCPROC)(GLsync sync);
GLAPI PFNGLISSYNCPROC glad_glIsSync;
#define glIsSync glad_glIsSync
typedef void (APIENTRYP PFNGLDELETESYNCPROC)(GLsync sync);
GLAPI PFNGLDELETESYNCPROC glad_glDeleteSync;
#define glDeleteSync glad_glDeleteSync
typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
GLAPI PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync;
#define glClientWaitSync glad_glClientWaitSync
typedef void (APIENTRYP PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
GLAPI PFNGLWAITSYNCPROC glad_glWaitSync;
#define glWaitSync glad_glWaitSync
typedef void (APIENTRYP PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 *data);
GLAPI PFNGLGETINTEGER64VPROC glad_glGetInteger64v;
#define glGetInteger64v glad_glGetInteger64v
typedef void (APIENTRYP PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
GLAPI PFNGLGETSYNCIVPROC glad_glGetSynciv;
#define glGetSynciv glad_glGetSynciv
typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 *data);
GLAPI PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v;
#define glGetInteger64i_v glad_glGetInteger64i_v
typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64 *params);
GLAPI PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v;
#define glGetBufferParameteri64v glad_glGetBufferParameteri64v
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level);
GLAPI PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture;
#define glFramebufferTexture glad_glFramebufferTexture
typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
GLAPI PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample;
#define glTexImage2DMultisample glad_glTexImage2DMultisample
typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
GLAPI PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample;
#define glTexImage3DMultisample glad_glTexImage3DMultisample
typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat *val);
GLAPI PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv;
#define glGetMultisamplefv glad_glGetMultisamplefv
typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask);
GLAPI PFNGLSAMPLEMASKIPROC glad_glSampleMaski;
#define glSampleMaski glad_glSampleMaski
#endif
#ifndef GL_VERSION_3_3
#define GL_VERSION_3_3 1
GLAPI int GLAD_GL_VERSION_3_3;
typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
GLAPI PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed;
#define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed
typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar *name);
GLAPI PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex;
#define glGetFragDataIndex glad_glGetFragDataIndex
typedef void (APIENTRYP PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint *samplers);
GLAPI PFNGLGENSAMPLERSPROC glad_glGenSamplers;
#define glGenSamplers glad_glGenSamplers
typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint *samplers);
GLAPI PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers;
#define glDeleteSamplers glad_glDeleteSamplers
typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC)(GLuint sampler);
GLAPI PFNGLISSAMPLERPROC glad_glIsSampler;
#define glIsSampler glad_glIsSampler
typedef void (APIENTRYP PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler);
GLAPI PFNGLBINDSAMPLERPROC glad_glBindSampler;
#define glBindSampler glad_glBindSampler
typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param);
GLAPI PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri;
#define glSamplerParameteri glad_glSamplerParameteri
typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint *param);
GLAPI PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv;
#define glSamplerParameteriv glad_glSamplerParameteriv
typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param);
GLAPI PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf;
#define glSamplerParameterf glad_glSamplerParameterf
typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat *param);
GLAPI PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv;
#define glSamplerParameterfv glad_glSamplerParameterfv
typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint *param);
GLAPI PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv;
#define glSamplerParameterIiv glad_glSamplerParameterIiv
typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint *param);
GLAPI PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv;
#define glSamplerParameterIuiv glad_glSamplerParameterIuiv
typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint *params);
GLAPI PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv;
#define glGetSamplerParameteriv glad_glGetSamplerParameteriv
typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint *params);
GLAPI PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv;
#define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv
typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat *params);
GLAPI PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv;
#define glGetSamplerParameterfv glad_glGetSamplerParameterfv
typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint *params);
GLAPI PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv;
#define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv
typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target);
GLAPI PFNGLQUERYCOUNTERPROC glad_glQueryCounter;
#define glQueryCounter glad_glQueryCounter
typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64 *params);
GLAPI PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v;
#define glGetQueryObjecti64v glad_glGetQueryObjecti64v
typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64 *params);
GLAPI PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v;
#define glGetQueryObjectui64v glad_glGetQueryObjectui64v
typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor);
GLAPI PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor;
#define glVertexAttribDivisor glad_glVertexAttribDivisor
typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
GLAPI PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui;
#define glVertexAttribP1ui glad_glVertexAttribP1ui
typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
GLAPI PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv;
#define glVertexAttribP1uiv glad_glVertexAttribP1uiv
typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
GLAPI PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui;
#define glVertexAttribP2ui glad_glVertexAttribP2ui
typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
GLAPI PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv;
#define glVertexAttribP2uiv glad_glVertexAttribP2uiv
typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
GLAPI PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui;
#define glVertexAttribP3ui glad_glVertexAttribP3ui
typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
GLAPI PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv;
#define glVertexAttribP3uiv glad_glVertexAttribP3uiv
typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
GLAPI PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui;
#define glVertexAttribP4ui glad_glVertexAttribP4ui
typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
GLAPI PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv;
#define glVertexAttribP4uiv glad_glVertexAttribP4uiv
typedef void (APIENTRYP PFNGLVERTEXP2UIPROC)(GLenum type, GLuint value);
GLAPI PFNGLVERTEXP2UIPROC glad_glVertexP2ui;
#define glVertexP2ui glad_glVertexP2ui
typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC)(GLenum type, const GLuint *value);
GLAPI PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv;
#define glVertexP2uiv glad_glVertexP2uiv
typedef void (APIENTRYP PFNGLVERTEXP3UIPROC)(GLenum type, GLuint value);
GLAPI PFNGLVERTEXP3UIPROC glad_glVertexP3ui;
#define glVertexP3ui glad_glVertexP3ui
typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC)(GLenum type, const GLuint *value);
GLAPI PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv;
#define glVertexP3uiv glad_glVertexP3uiv
typedef void (APIENTRYP PFNGLVERTEXP4UIPROC)(GLenum type, GLuint value);
GLAPI PFNGLVERTEXP4UIPROC glad_glVertexP4ui;
#define glVertexP4ui glad_glVertexP4ui
typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC)(GLenum type, const GLuint *value);
GLAPI PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv;
#define glVertexP4uiv glad_glVertexP4uiv
typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC)(GLenum type, GLuint coords);
GLAPI PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui;
#define glTexCoordP1ui glad_glTexCoordP1ui
typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC)(GLenum type, const GLuint *coords);
GLAPI PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv;
#define glTexCoordP1uiv glad_glTexCoordP1uiv
typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC)(GLenum type, GLuint coords);
GLAPI PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui;
#define glTexCoordP2ui glad_glTexCoordP2ui
typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC)(GLenum type, const GLuint *coords);
GLAPI PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv;
#define glTexCoordP2uiv glad_glTexCoordP2uiv
typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC)(GLenum type, GLuint coords);
GLAPI PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui;
#define glTexCoordP3ui glad_glTexCoordP3ui
typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC)(GLenum type, const GLuint *coords);
GLAPI PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv;
#define glTexCoordP3uiv glad_glTexCoordP3uiv
typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC)(GLenum type, GLuint coords);
GLAPI PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui;
#define glTexCoordP4ui glad_glTexCoordP4ui
typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC)(GLenum type, const GLuint *coords);
GLAPI PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv;
#define glTexCoordP4uiv glad_glTexCoordP4uiv
typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC)(GLenum texture, GLenum type, GLuint coords);
GLAPI PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui;
#define glMultiTexCoordP1ui glad_glMultiTexCoordP1ui
typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC)(GLenum texture, GLenum type, const GLuint *coords);
GLAPI PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv;
#define glMultiTexCoordP1uiv glad_glMultiTexCoordP1uiv
typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC)(GLenum texture, GLenum type, GLuint coords);
GLAPI PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui;
#define glMultiTexCoordP2ui glad_glMultiTexCoordP2ui
typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC)(GLenum texture, GLenum type, const GLuint *coords);
GLAPI PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv;
#define glMultiTexCoordP2uiv glad_glMultiTexCoordP2uiv
typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC)(GLenum texture, GLenum type, GLuint coords);
GLAPI PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui;
#define glMultiTexCoordP3ui glad_glMultiTexCoordP3ui
typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC)(GLenum texture, GLenum type, const GLuint *coords);
GLAPI PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv;
#define glMultiTexCoordP3uiv glad_glMultiTexCoordP3uiv
typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC)(GLenum texture, GLenum type, GLuint coords);
GLAPI PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui;
#define glMultiTexCoordP4ui glad_glMultiTexCoordP4ui
typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC)(GLenum texture, GLenum type, const GLuint *coords);
GLAPI PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv;
#define glMultiTexCoordP4uiv glad_glMultiTexCoordP4uiv
typedef void (APIENTRYP PFNGLNORMALP3UIPROC)(GLenum type, GLuint coords);
GLAPI PFNGLNORMALP3UIPROC glad_glNormalP3ui;
#define glNormalP3ui glad_glNormalP3ui
typedef void (APIENTRYP PFNGLNORMALP3UIVPROC)(GLenum type, const GLuint *coords);
GLAPI PFNGLNORMALP3UIVPROC glad_glNormalP3uiv;
#define glNormalP3uiv glad_glNormalP3uiv
typedef void (APIENTRYP PFNGLCOLORP3UIPROC)(GLenum type, GLuint color);
GLAPI PFNGLCOLORP3UIPROC glad_glColorP3ui;
#define glColorP3ui glad_glColorP3ui
typedef void (APIENTRYP PFNGLCOLORP3UIVPROC)(GLenum type, const GLuint *color);
GLAPI PFNGLCOLORP3UIVPROC glad_glColorP3uiv;
#define glColorP3uiv glad_glColorP3uiv
typedef void (APIENTRYP PFNGLCOLORP4UIPROC)(GLenum type, GLuint color);
GLAPI PFNGLCOLORP4UIPROC glad_glColorP4ui;
#define glColorP4ui glad_glColorP4ui
typedef void (APIENTRYP PFNGLCOLORP4UIVPROC)(GLenum type, const GLuint *color);
GLAPI PFNGLCOLORP4UIVPROC glad_glColorP4uiv;
#define glColorP4uiv glad_glColorP4uiv
typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC)(GLenum type, GLuint color);
GLAPI PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui;
#define glSecondaryColorP3ui glad_glSecondaryColorP3ui
typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC)(GLenum type, const GLuint *color);
GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv;
#define glSecondaryColorP3uiv glad_glSecondaryColorP3uiv
#endif
#define GL_MAP_PERSISTENT_BIT 0x0040
#define GL_MAP_COHERENT_BIT 0x0080
#define GL_DYNAMIC_STORAGE_BIT 0x0100
@@ -2151,6 +1732,21 @@ GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv;
#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
#define GL_OBJECT_TYPE 0x9112
#define GL_SYNC_CONDITION 0x9113
#define GL_SYNC_STATUS 0x9114
#define GL_SYNC_FLAGS 0x9115
#define GL_SYNC_FENCE 0x9116
#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
#define GL_UNSIGNALED 0x9118
#define GL_SIGNALED 0x9119
#define GL_ALREADY_SIGNALED 0x911A
#define GL_TIMEOUT_EXPIRED 0x911B
#define GL_CONDITION_SATISFIED 0x911C
#define GL_WAIT_FAILED 0x911D
#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
#ifndef GL_ARB_buffer_storage
#define GL_ARB_buffer_storage 1
GLAPI int GLAD_GL_ARB_buffer_storage;
@@ -2174,6 +1770,31 @@ typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei
GLAPI PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB;
#define glGetDebugMessageLogARB glad_glGetDebugMessageLogARB
#endif
#ifndef GL_ARB_sync
#define GL_ARB_sync 1
GLAPI int GLAD_GL_ARB_sync;
typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags);
GLAPI PFNGLFENCESYNCPROC glad_glFenceSync;
#define glFenceSync glad_glFenceSync
typedef GLboolean (APIENTRYP PFNGLISSYNCPROC)(GLsync sync);
GLAPI PFNGLISSYNCPROC glad_glIsSync;
#define glIsSync glad_glIsSync
typedef void (APIENTRYP PFNGLDELETESYNCPROC)(GLsync sync);
GLAPI PFNGLDELETESYNCPROC glad_glDeleteSync;
#define glDeleteSync glad_glDeleteSync
typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
GLAPI PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync;
#define glClientWaitSync glad_glClientWaitSync
typedef void (APIENTRYP PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
GLAPI PFNGLWAITSYNCPROC glad_glWaitSync;
#define glWaitSync glad_glWaitSync
typedef void (APIENTRYP PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 *data);
GLAPI PFNGLGETINTEGER64VPROC glad_glGetInteger64v;
#define glGetInteger64v glad_glGetInteger64v
typedef void (APIENTRYP PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
GLAPI PFNGLGETSYNCIVPROC glad_glGetSynciv;
#define glGetSynciv glad_glGetSynciv
#endif
#ifdef __cplusplus
}

View File

@@ -20,9 +20,9 @@
#define EMU_NAME "86Box"
#define EMU_NAME_W LSTR(EMU_NAME)
#define EMU_VERSION "3.1"
#define EMU_VERSION "3.2"
#define EMU_VERSION_W LSTR(EMU_VERSION)
#define EMU_VERSION_EX "3.01"
#define EMU_VERSION_EX "3.02"
#define EMU_VERSION_MAJ 3
#define EMU_VERSION_MIN 0
#define EMU_VERSION_PATCH 0

View File

@@ -1,3 +1,53 @@
include_directories("./mac")
target_sources(86Box PUBLIC "./macOSXGlue.m")
#
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for 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.
#
# CMake build script.
#
# Authors: dob205,
# Jerome Vernet
# David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 dob205.
# Copyright 2021 Jerome Vernet.
# Copyright 2021 David Hrdlička.
#
# Pick the bundle icon depending on the release channel
if(RELEASE_BUILD)
set(APP_ICON_MACOSX icons/release/86Box.icns)
elseif(BETA_BUILD)
set(APP_ICON_MACOSX icons/beta/86Box.icns)
elseif(ALPHA_BUILD)
set(APP_ICON_MACOSX icons/dev/86Box.icns)
else()
set(APP_ICON_MACOSX icons/branch/86Box.icns)
endif()
target_link_libraries(86Box "-framework AppKit")
target_sources(86Box PRIVATE macOSXGlue.m ${APP_ICON_MACOSX})
# Make sure the icon is copied to the bundle
set_source_files_properties(${APP_ICON_MACOSX}
TARGET_DIRECTORY 86Box
PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
# Prepare long version string
if(EMU_BUILD)
set(LONG_VER_STRING "${CMAKE_PROJECT_VERSION} [${EMU_BUILD}]")
else()
set(LONG_VER_STRING "${CMAKE_PROJECT_VERSION}")
endif()
# Generate Info.plist
configure_file(Info.plist.in Info.plist @ONLY)
set_target_properties(86Box
PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
#set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES")
#set(XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-")
#set(XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_SOURCE_DIR}/mac/codesign/dev/app.entitlements)

View File

@@ -7,29 +7,29 @@
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<string>An emulator of old computers</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<string>86Box.icns</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<string>net.86Box.86Box</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<string>@LONG_VER_STRING@</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<string>86Box</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<string>@CMAKE_PROJECT_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<string>@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@.@CMAKE_PROJECT_VERSION_PATCH@.@EMU_BUILD_NUM@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<string>© 2007-@EMU_COPYRIGHT_YEAR@ 86Box contributors</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>

View File

@@ -1,42 +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.
#
# CMake build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# 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
m_xt_philips.c
m_xt_t1000.c m_xt_t1000_vid.c m_xt_xi8088.c m_xt_zenith.c m_pcjr.c
m_amstrad.c m_europc.c m_xt_olivetti.c m_tandy.c m_v86p.c
m_at.c m_at_commodore.c
m_at_t3100e.c m_at_t3100e_vid.c m_ps1.c m_ps1_hdc.c m_ps2_isa.c
m_ps2_mca.c m_at_compaq.c m_at_286_386sx.c m_at_386dx_486.c
m_at_socket4.c m_at_socket5.c m_at_socket7_3v.c m_at_socket7.c
m_at_sockets7.c m_at_socket8.c m_at_slot1.c m_at_slot2.c m_at_socket370.c
m_at_misc.c)
m_xt_philips.c
m_xt_t1000.c m_xt_t1000_vid.c m_xt_xi8088.c m_xt_zenith.c m_pcjr.c
m_amstrad.c m_europc.c m_xt_olivetti.c m_tandy.c m_v86p.c
m_at.c m_at_commodore.c
m_at_t3100e.c m_at_t3100e_vid.c m_ps1.c m_ps1_hdc.c m_ps2_isa.c
m_ps2_mca.c m_at_compaq.c m_at_286_386sx.c m_at_386dx_486.c
m_at_socket4.c m_at_socket5.c m_at_socket7_3v.c m_at_socket7.c
m_at_sockets7.c m_at_socket8.c m_at_slot1.c m_at_slot2.c m_at_socket370.c
m_at_misc.c)
if(LASERXT)
target_sources(mch PRIVATE m_xt_laserxt.c)
target_compile_definitions(mch PRIVATE USE_LASERXT)
target_sources(mch PRIVATE m_xt_laserxt.c)
target_compile_definitions(mch PRIVATE USE_LASERXT)
endif()
if(NO_SIO)
target_compile_definitions(mch PRIVATE NO_SIO)
target_compile_definitions(mch PRIVATE NO_SIO)
endif()
if(OPEN_AT)
target_compile_definitions(mch PRIVATE USE_OPEN_AT)
endif()
if(M154X)
target_compile_definitions(mch PRIVATE USE_M154X)
target_compile_definitions(mch PRIVATE USE_OPEN_AT)
endif()

View File

@@ -1025,11 +1025,11 @@ machine_at_486sp3c_init(const machine_t *model)
int
machine_at_4sa2_init(const machine_t *model)
machine_at_4saw2_init(const machine_t *model)
{
int ret;
ret = bios_load_linear("roms/machines/4sa2/4saw0911.bin",
ret = bios_load_linear("roms/machines/4saw2/4saw0911.bin",
0x000e0000, 131072, 0);
if (bios_only || !ret)

View File

@@ -112,7 +112,7 @@ machine_at_cmdpc_init(const machine_t *model)
if (fdc_type == FDC_INTERNAL)
device_add(&fdc_at_device);
cmd_uart = device_add(&i8250_device);
cmd_uart = device_add(&ns8250_device);
cbm_io_init();

View File

@@ -866,8 +866,8 @@ machine_pcjr_init(const machine_t *model)
device_add(&fdc_pcjr_device);
device_add(&i8250_pcjr_device);
serial_set_next_inst(MAX_SERIAL); /* So that serial_standalone_init() won't do anything. */
device_add(&ns8250_pcjr_device);
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
return ret;
}

View File

@@ -82,9 +82,8 @@ static struct
uint8_t memory_bank[8];
uint8_t io_id;
uint16_t planar_id;
mem_mapping_t shadow_mapping;
uint16_t planar_id;
mem_mapping_t split_mapping;
mem_mapping_t expansion_mapping;
mem_mapping_t cache_mapping;
@@ -203,7 +202,7 @@ static uint32_t ps2_read_cache_raml(uint32_t addr, void *priv)
}
static void ps2_write_cache_ram(uint32_t addr, uint8_t val, void *priv)
{
ps2_mca_log("ps2_write_cache_ram: addr=%08x val=%02x %04x:%04x %i\n", addr, val, CS,cpu_state.pc, ins);
ps2_mca_log("ps2_write_cache_ram: addr=%08x val=%02x %04x:%04x %i\n", addr, val, CS,cpu_state.pc);
ps2_cache[addr] = val;
}
@@ -212,37 +211,6 @@ void ps2_cache_clean(void)
memset(ps2_cache_valid, 0, sizeof(ps2_cache_valid));
}
static uint8_t ps2_read_shadow_ram(uint32_t addr, void *priv)
{
addr = (addr & 0x1ffff) + 0xe0000;
return mem_read_ram(addr, priv);
}
static uint16_t ps2_read_shadow_ramw(uint32_t addr, void *priv)
{
addr = (addr & 0x1ffff) + 0xe0000;
return mem_read_ramw(addr, priv);
}
static uint32_t ps2_read_shadow_raml(uint32_t addr, void *priv)
{
addr = (addr & 0x1ffff) + 0xe0000;
return mem_read_raml(addr, priv);
}
static void ps2_write_shadow_ram(uint32_t addr, uint8_t val, void *priv)
{
addr = (addr & 0x1ffff) + 0xe0000;
mem_write_ram(addr, val, priv);
}
static void ps2_write_shadow_ramw(uint32_t addr, uint16_t val, void *priv)
{
addr = (addr & 0x1ffff) + 0xe0000;
mem_write_ramw(addr, val, priv);
}
static void ps2_write_shadow_raml(uint32_t addr, uint32_t val, void *priv)
{
addr = (addr & 0x1ffff) + 0xe0000;
mem_write_raml(addr, val, priv);
}
static uint8_t ps2_read_split_ram(uint32_t addr, void *priv)
{
addr = (addr % (ps2.split_size << 10)) + ps2.split_phys;
@@ -430,6 +398,85 @@ static void model_50_write(uint16_t port, uint8_t val)
}
}
static void model_55sx_mem_recalc(void)
{
int i, j, state, enabled_mem = 0;
int base = 0, remap_size = (ps2.option[3] & 0x10) ? 384 : 256;
int bit_mask = 0x00, max_rows = 4;
int bank_to_rows[16] = { 4, 2, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0 };
ps2_mca_log("%02X %02X\n", ps2.option[1], ps2.option[3]);
mem_remap_top(remap_size);
mem_set_mem_state(0x00000000, (mem_size + 384) * 1024, MEM_READ_EXTERNAL | MEM_WRITE_EXTERNAL);
mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_DISABLED);
for (i = 0; i < 2; i++)
{
max_rows = bank_to_rows[(ps2.memory_bank[i] >> 4) & 0x0f];
if (max_rows == 0)
continue;
for (j = 0; j < max_rows; j++)
{
if (ps2.memory_bank[i] & (1 << j)) {
ps2_mca_log("Set memory at %06X-%06X to internal\n", (base * 1024), (base * 1024) + (((base > 0) ? 1024 : 640) * 1024) - 1);
mem_set_mem_state(base * 1024, ((base > 0) ? 1024 : 640) * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
enabled_mem += 1024;
bit_mask |= (1 << (j + (i << 2)));
}
base += 1024;
}
}
ps2_mca_log("Enabled memory: %i kB (%02X)\n", enabled_mem, bit_mask);
if (ps2.option[3] & 0x10)
{
/* Enable ROM. */
ps2_mca_log("Enable ROM\n");
state = MEM_READ_EXTANY;
}
else
{
/* Disable ROM. */
if ((ps2.option[1] & 1) && !(ps2.option[3] & 0x20) && (bit_mask & 0x01))
{
/* Disable RAM between 640 kB and 1 MB. */
ps2_mca_log("Disable ROM, enable RAM\n");
state = MEM_READ_INTERNAL;
}
else
{
ps2_mca_log("Disable ROM, disable RAM\n");
state = MEM_READ_DISABLED;
}
}
/* Write always disabled. */
state |= MEM_WRITE_DISABLED;
mem_set_mem_state(0xe0000, 0x20000, state);
/* if (!(ps2.option[3] & 0x08))
{
ps2_mca_log("Memory not yet configured\n");
return;
} */
ps2_mca_log("Enable shadow mapping at %06X-%06X\n", (mem_size * 1024), (mem_size * 1024) + (remap_size * 1024) - 1);
if ((ps2.option[1] & 1) && !(ps2.option[3] & 0x20) && (bit_mask & 0x01)) {
ps2_mca_log("Set memory at %06X-%06X to internal\n", (mem_size * 1024), (mem_size * 1024) + (remap_size * 1024) - 1);
mem_set_mem_state(mem_size * 1024, remap_size * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
}
flushmmucache_nopc();
}
static void model_55sx_write(uint16_t port, uint8_t val)
{
switch (port)
@@ -467,38 +514,20 @@ static void model_55sx_write(uint16_t port, uint8_t val)
ps2.option[0] = val;
break;
case 0x103:
ps2_mca_log("Write POS1: %02X\n", val);
ps2.option[1] = val;
break;
model_55sx_mem_recalc();
break;
case 0x104:
ps2.memory_bank[ps2.option[3] & 7] &= ~0xf;
ps2.memory_bank[ps2.option[3] & 7] |= (val & 0xf);
ps2_mca_log("Write memory bank %i %02x\n", ps2.option[3] & 7, val);
ps2_mca_log("Write memory bank %i: %02X\n", ps2.option[3] & 7, val);
model_55sx_mem_recalc();
break;
case 0x105:
ps2_mca_log("Write POS3 %02x\n", val);
ps2_mca_log("Write POS3: %02X\n", val);
ps2.option[3] = val;
shadowbios = !(val & 0x10);
shadowbios_write = val & 0x10;
if (shadowbios)
{
mem_set_mem_state(0xe0000, 0x20000, MEM_READ_INTERNAL | MEM_WRITE_DISABLED);
mem_set_mem_state((mem_size+256) * 1024, 128 * 1024, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
mem_mapping_disable(&ps2.shadow_mapping);
}
else
{
mem_set_mem_state(0xe0000, 0x20000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL);
mem_set_mem_state((mem_size+256) * 1024, 128 * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
mem_mapping_enable(&ps2.shadow_mapping);
}
if ((ps2.option[1] & 1) && !(ps2.option[3] & 0x20))
mem_set_mem_state(mem_size * 1024, 256 * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
else
mem_set_mem_state(mem_size * 1024, 256 * 1024, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
flushmmucache_nopc();
model_55sx_mem_recalc();
break;
case 0x106:
ps2.subaddr_lo = val;
@@ -833,13 +862,8 @@ static void ps2_mca_mem_fffc_init(int start_mb)
{
uint32_t planar_size, expansion_start;
if (start_mb == 2) {
planar_size = 0x160000;
expansion_start = 0x260000;
} else {
planar_size = (start_mb - 1) << 20;
expansion_start = start_mb << 20;
}
planar_size = (start_mb - 1) << 20;
expansion_start = start_mb << 20;
mem_mapping_set_addr(&ram_high_mapping, 0x100000, planar_size);
@@ -890,6 +914,36 @@ static void ps2_mca_mem_fffc_init(int start_mb)
mem_mapping_disable(&ps2.expansion_mapping);
}
static void ps2_mca_mem_d071_init(int start_mb)
{
uint32_t planar_size, expansion_start;
planar_size = (start_mb - 1) << 20;
expansion_start = start_mb << 20;
mem_mapping_set_addr(&ram_high_mapping, 0x100000, planar_size);
ps2.mem_pos_regs[0] = 0xd0;
ps2.mem_pos_regs[1] = 0x71;
ps2.mem_pos_regs[4] = (mem_size / 1024) - start_mb;
mca_add(ps2_mem_expansion_read, ps2_mem_expansion_write, ps2_mem_expansion_feedb, NULL, NULL);
mem_mapping_add(&ps2.expansion_mapping,
expansion_start,
(mem_size - (start_mb << 10)) << 10,
mem_read_ram,
mem_read_ramw,
mem_read_raml,
mem_write_ram,
mem_write_ramw,
mem_write_raml,
&ram[expansion_start],
MEM_MAPPING_INTERNAL,
NULL);
mem_mapping_disable(&ps2.expansion_mapping);
}
static void ps2_mca_board_model_50_init()
{
ps2_mca_board_common_init();
@@ -914,22 +968,9 @@ static void ps2_mca_board_model_50_init()
static void ps2_mca_board_model_55sx_init()
{
ps2_mca_board_common_init();
mem_mapping_add(&ps2.shadow_mapping,
(mem_size+256) * 1024,
128*1024,
ps2_read_shadow_ram,
ps2_read_shadow_ramw,
ps2_read_shadow_raml,
ps2_write_shadow_ram,
ps2_write_shadow_ramw,
ps2_write_shadow_raml,
&ram[0xe0000],
MEM_MAPPING_INTERNAL,
NULL);
mem_remap_top(256);
ps2.option[1] = 0x00;
ps2.option[2] = 0x00;
ps2.option[3] = 0x10;
memset(ps2.memory_bank, 0xf0, 8);
@@ -975,9 +1016,11 @@ static void ps2_mca_board_model_55sx_init()
if (gfxcard == VID_INTERNAL)
device_add(&ps1vga_mca_device);
model_55sx_mem_recalc();
}
static void mem_encoding_update()
static void mem_encoding_update(void)
{
mem_mapping_disable(&ps2.split_mapping);
@@ -987,6 +1030,8 @@ static void mem_encoding_update()
mem_set_mem_state(1 << 20, (mem_size << 10) - (1 << 20), MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
ps2.split_addr = ((uint32_t) (ps2.mem_regs[0] & 0xf)) << 20;
if (!ps2.split_addr)
ps2.split_addr = 1 << 20;
if (ps2.mem_regs[1] & 2) {
mem_set_mem_state(0xe0000, 0x20000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL);
@@ -1192,14 +1237,22 @@ static void ps2_mca_board_model_70_type34_init(int is_type4, int slots)
if (ps2.planar_id == 0xfff9) {
if (mem_size > 4096)
{
/* Only 4 MB supported on planar, create a memory expansion card for the rest */
ps2_mca_mem_fffc_init(4);
/* Only 4 MB supported on planar, create a memory expansion card for the rest */
if (mem_size > 12288) {
ps2_mca_mem_d071_init(4);
} else {
ps2_mca_mem_fffc_init(4);
}
}
} else {
if (mem_size > 8192)
{
/* Only 8 MB supported on planar, create a memory expansion card for the rest */
ps2_mca_mem_fffc_init(8);
/* Only 8 MB supported on planar, create a memory expansion card for the rest */
if (mem_size > 16384)
ps2_mca_mem_d071_init(8);
else {
ps2_mca_mem_fffc_init(8);
}
}
}
@@ -1270,8 +1323,12 @@ static void ps2_mca_board_model_80_type2_init(int is486)
if ((mem_size > 4096) && !is486)
{
/* Only 4 MB supported on planar, create a memory expansion card for the rest */
ps2_mca_mem_fffc_init(4);
/* Only 4 MB supported on planar, create a memory expansion card for the rest */
if (mem_size > 12288)
ps2_mca_mem_d071_init(4);
else {
ps2_mca_mem_fffc_init(4);
}
}
if (gfxcard == VID_INTERNAL)

View File

@@ -153,8 +153,8 @@ machine_xt_z184_init(const machine_t *model)
lpt1_remove(); /* only one parallel port */
lpt2_remove();
lpt1_init(0x278);
device_add(&i8250_device);
serial_set_next_inst(MAX_SERIAL); /* So that serial_standalone_init() won't do anything. */
device_add(&ns8250_device);
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
device_add(&cga_device);

View File

@@ -44,7 +44,7 @@
int bios_only = 0;
int machine;
int AT, PCI;
// int AT, PCI;
#ifdef ENABLE_MACHINE_LOG
@@ -81,8 +81,8 @@ machine_init_ex(int m)
gameport_instance_id = 0;
/* Set up the architecture flags. */
AT = IS_AT(machine);
PCI = IS_ARCH(machine, MACHINE_BUS_PCI);
// AT = IS_AT(machine);
// PCI = IS_ARCH(machine, MACHINE_BUS_PCI);
cpu_set();
pc_speed_changed();
@@ -146,5 +146,5 @@ machine_common_init(const machine_t *model)
pic_init();
dma_init();
pit_common_init(!!AT, pit_irq0_timer, NULL);
pit_common_init(!!IS_AT(machine), pit_irq0_timer, NULL);
}

View File

@@ -309,11 +309,11 @@ const machine_t machines[] = {
/* 386DX machines which utilize the MCA bus */
/* Has IBM PS/2 Type 1 KBC firmware. */
{ "[MCA] IBM PS/2 model 70 (type 3)", "ibmps2_m70_type3", MACHINE_TYPE_386DX, CPU_PKG_386DX | CPU_PKG_486BL, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 2048, 16384, 2048, 63, machine_ps2_model_70_type3_init, NULL },
{ "[MCA] IBM PS/2 model 70 (type 3)", "ibmps2_m70_type3", MACHINE_TYPE_386DX, CPU_PKG_386DX | CPU_PKG_486BL, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 2048, 65536, 2048, 63, machine_ps2_model_70_type3_init, NULL },
/* Has IBM PS/2 Type 1 KBC firmware. */
{ "[MCA] IBM PS/2 model 80", "ibmps2_m80", MACHINE_TYPE_386DX, CPU_PKG_386DX | CPU_PKG_486BL, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 1024, 12288, 1024, 63, machine_ps2_model_80_init, NULL },
{ "[MCA] IBM PS/2 model 80 (type 2)", "ibmps2_m80", MACHINE_TYPE_386DX, CPU_PKG_386DX | CPU_PKG_486BL | CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 1024, 65536, 1024, 63, machine_ps2_model_80_init, NULL },
/* Has IBM PS/2 Type 1 KBC firmware. */
{ "[MCA] IBM PS/2 model 80 (type 3)", "ibmps2_m80_type3", MACHINE_TYPE_386DX, CPU_PKG_386DX | CPU_PKG_486BL, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 2048, 12288, 2048, 63, machine_ps2_model_80_axx_init, NULL },
{ "[MCA] IBM PS/2 model 80 (type 3)", "ibmps2_m80_type3", MACHINE_TYPE_386DX, CPU_PKG_386DX | CPU_PKG_486BL | CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 2048, 65536, 2048, 63, machine_ps2_model_80_axx_init, NULL },
/* 386DX/486 machines */
/* The BIOS sends commands C9 without a parameter and D5, both of which are
@@ -366,9 +366,8 @@ const machine_t machines[] = {
{ "[ACC 2168] Packard Bell PB410A", "pb410a", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 4096, 36864, 1024, 127, machine_at_pb410a_init, NULL },
/* Uses an ACER/NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware (V4.01H). */
{ "[ALi M1429G] Acer A1G", "acera1g", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 4096, 36864, 1024, 127, machine_at_acera1g_init, at_acera1g_get_device },
/* There are two similar BIOS strings with -H, and one with -U, so I'm going to
give it an AMIKey H KBC firmware. */
{ "[ALi M1429G] Kaimei 486", "win486", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_winbios1429_init, NULL },
/* This has an AMIKey-2, which is an updated version of type 'H'. */
{ "[ALi M1429G] Kaimei SA-486 VL-BUS M.B.", "win486", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_winbios1429_init, NULL },
/* Uses an Intel KBC with Phoenix MultiKey KBC firmware. */
{ "[SiS 461] DEC DECpc LPV", "decpclpv", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 32768, 1024, 127, machine_at_decpclpv_init, NULL },
/* Uses an NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware. */
@@ -447,7 +446,7 @@ const machine_t machines[] = {
{ "[SiS 496] Rise Computer R418", "r418", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_r418_init, NULL },
/* This has a Holtek KBC and the BIOS does not send a single non-standard KBC command, so it
must be an ASIC that clones the standard IBM PS/2 KBC. */
{ "[SiS 496] Soyo 4SA2", "4sa2", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, CPU_BLOCK(CPU_i486SX, CPU_i486DX, CPU_Am486SX, CPU_Am486DX), 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_4sa2_init, NULL },
{ "[SiS 496] Soyo 4SAW2", "4saw2", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, CPU_BLOCK(CPU_i486SX, CPU_i486DX, CPU_Am486SX, CPU_Am486DX), 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_4saw2_init, NULL },
/* According to MrKsoft, his real 4DPS has an AMIKey-2, which is an updated version
of type 'H'. */
{ "[SiS 496] Zida Tomato 4DP", "4dps", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_4dps_init, NULL },
@@ -921,7 +920,7 @@ const machine_t machines[] = {
/* Miscellaneous/Fake/Hypervisor machines */
/* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC
firmware. */
{ "[i440BX] Microsoft Virtual PC 2007", "vpc2007", MACHINE_TYPE_MISC, CPU_PKG_SLOT1, CPU_BLOCK(CPU_PENTIUM2, CPU_CYRIX3S), 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_vpc2007_init, NULL },
{ "[i440BX] Microsoft Virtual PC 2007", "vpc2007", MACHINE_TYPE_MISC, CPU_PKG_SLOT1, CPU_BLOCK(CPU_PENTIUM2, CPU_CYRIX3S), 0, 66666667, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_vpc2007_init, NULL },
{ NULL, NULL, MACHINE_TYPE_NONE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL }
};
@@ -979,6 +978,59 @@ machine_get_nvrmask(int m)
}
int
machine_has_flags(int m, int flags)
{
return(machines[m].flags & flags);
}
int
machine_has_bus(int m, int bus_flags)
{
return(machines[m].flags & bus_flags);
}
int
machine_has_cartridge(int m)
{
return(machine_has_flags(m, MACHINE_CARTRIDGE) ? 1 : 0);
}
int
machine_get_min_ram(int m)
{
return(machines[m].min_ram);
}
int
machine_get_max_ram(int m)
{
#if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64))
return MIN(((int) machines[m].max_ram), 2097152);
#else
return MIN(((int) machines[m].max_ram), 3145728);
#endif
}
int
machine_get_ram_granularity(int m)
{
return(machines[m].ram_granularity);
}
int
machine_get_type(int m)
{
return(machines[m].type);
}
int
machine_get_machine_from_internal_name(char *s)
{

View File

@@ -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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# 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
smram.c spd.c sst_flash.c)
smram.c spd.c sst_flash.c)

View File

@@ -1802,7 +1802,7 @@ mem_read_ram(uint32_t addr, void *priv)
mem_log("Read B %02X from %08X\n", ram[addr], addr);
#endif
if (is286 || AT)
if (is286)
addreadlookup(mem_logical_addr, addr);
return ram[addr];
@@ -1817,7 +1817,7 @@ mem_read_ramw(uint32_t addr, void *priv)
mem_log("Read W %04X from %08X\n", *(uint16_t *)&ram[addr], addr);
#endif
if (is286 || AT)
if (is286)
addreadlookup(mem_logical_addr, addr);
return *(uint16_t *)&ram[addr];
@@ -1832,7 +1832,7 @@ mem_read_raml(uint32_t addr, void *priv)
mem_log("Read L %08X from %08X\n", *(uint32_t *)&ram[addr], addr);
#endif
if (is286 || AT)
if (is286)
addreadlookup(mem_logical_addr, addr);
return *(uint32_t *)&ram[addr];
@@ -2076,7 +2076,7 @@ mem_write_ram(uint32_t addr, uint8_t val, void *priv)
if ((addr >= 0xa0000) && (addr <= 0xbffff))
mem_log("Write B %02X to %08X\n", val, addr);
#endif
if (is286 || AT) {
if (is286) {
addwritelookup(mem_logical_addr, addr);
mem_write_ramb_page(addr, val, &pages[addr >> 12]);
} else
@@ -2091,7 +2091,7 @@ mem_write_ramw(uint32_t addr, uint16_t val, void *priv)
if ((addr >= 0xa0000) && (addr <= 0xbffff))
mem_log("Write W %04X to %08X\n", val, addr);
#endif
if (is286 || AT) {
if (is286) {
addwritelookup(mem_logical_addr, addr);
mem_write_ramw_page(addr, val, &pages[addr >> 12]);
} else
@@ -2106,7 +2106,7 @@ mem_write_raml(uint32_t addr, uint32_t val, void *priv)
if ((addr >= 0xa0000) && (addr <= 0xbffff))
mem_log("Write L %08X to %08X\n", val, addr);
#endif
if (is286 || AT) {
if (is286) {
addwritelookup(mem_logical_addr, addr);
mem_write_raml_page(addr, val, &pages[addr >> 12]);
} else
@@ -2118,7 +2118,7 @@ static uint8_t
mem_read_remapped(uint32_t addr, void *priv)
{
addr = 0xA0000 + (addr - remap_start_addr);
if (is286 || AT)
if (is286)
addreadlookup(mem_logical_addr, addr);
return ram[addr];
}
@@ -2128,7 +2128,7 @@ static uint16_t
mem_read_remappedw(uint32_t addr, void *priv)
{
addr = 0xA0000 + (addr - remap_start_addr);
if (is286 || AT)
if (is286)
addreadlookup(mem_logical_addr, addr);
return *(uint16_t *)&ram[addr];
}
@@ -2138,7 +2138,7 @@ static uint32_t
mem_read_remappedl(uint32_t addr, void *priv)
{
addr = 0xA0000 + (addr - remap_start_addr);
if (is286 || AT)
if (is286)
addreadlookup(mem_logical_addr, addr);
return *(uint32_t *)&ram[addr];
}
@@ -2149,7 +2149,7 @@ mem_write_remapped(uint32_t addr, uint8_t val, void *priv)
{
uint32_t oldaddr = addr;
addr = 0xA0000 + (addr - remap_start_addr);
if (is286 || AT) {
if (is286) {
addwritelookup(mem_logical_addr, addr);
mem_write_ramb_page(addr, val, &pages[oldaddr >> 12]);
} else
@@ -2162,7 +2162,7 @@ mem_write_remappedw(uint32_t addr, uint16_t val, void *priv)
{
uint32_t oldaddr = addr;
addr = 0xA0000 + (addr - remap_start_addr);
if (is286 || AT) {
if (is286) {
addwritelookup(mem_logical_addr, addr);
mem_write_ramw_page(addr, val, &pages[oldaddr >> 12]);
} else
@@ -2175,7 +2175,7 @@ mem_write_remappedl(uint32_t addr, uint32_t val, void *priv)
{
uint32_t oldaddr = addr;
addr = 0xA0000 + (addr - remap_start_addr);
if (is286 || AT) {
if (is286) {
addwritelookup(mem_logical_addr, addr);
mem_write_raml_page(addr, val, &pages[oldaddr >> 12]);
} else
@@ -2537,12 +2537,12 @@ mem_set_access(uint8_t bitmap, int mode, uint32_t base, uint32_t size, uint16_t
void
mem_a20_init(void)
{
if (AT) {
if (is286) {
rammask = cpu_16bitbus ? 0xefffff : 0xffefffff;
flushmmucache();
mem_a20_state = mem_a20_key | mem_a20_alt;
} else {
rammask = is286 ? 0xffffff : 0xfffff;
rammask = 0xfffff;
flushmmucache();
mem_a20_key = mem_a20_alt = mem_a20_state = 0;
}
@@ -2665,7 +2665,7 @@ mem_reset(void)
* We re-allocate the table on each (hard) reset, as the
* memory amount could have changed.
*/
if (AT) {
if (is286) {
if (cpu_16bitbus) {
/* 80286/386SX; maximum address space is 16MB. */
m = 4096;
@@ -2674,13 +2674,8 @@ mem_reset(void)
m = 1048576;
}
} else {
if (is286) {
/* 80286; maximum address space is 16MB. */
m = 4096;
} else {
/* 8088/86; maximum address space is 1MB. */
m = 256;
}
/* 8088/86; maximum address space is 1MB. */
m = 256;
}
/*
@@ -2877,8 +2872,8 @@ mem_a20_recalc(void)
{
int state;
if (! AT) {
rammask = is286 ? 0xffffff : 0xfffff;
if (! is286) {
rammask = 0xfffff;
flushmmucache();
mem_a20_key = mem_a20_alt = mem_a20_state = 0;
@@ -2887,10 +2882,10 @@ mem_a20_recalc(void)
state = mem_a20_key | mem_a20_alt;
if (state && !mem_a20_state) {
rammask = (AT && cpu_16bitbus) ? 0xffffff : 0xffffffff;
rammask = (cpu_16bitbus) ? 0xffffff : 0xffffffff;
flushmmucache();
} else if (!state && mem_a20_state) {
rammask = (AT && cpu_16bitbus) ? 0xefffff : 0xffefffff;
rammask = (cpu_16bitbus) ? 0xefffff : 0xffefffff;
flushmmucache();
}

View File

@@ -422,7 +422,7 @@ bios_add(void)
if (/*AT && */cpu_s) {
temp_cpu_type = cpu_s->cpu_type;
temp_cpu_16bitbus = (temp_cpu_type == CPU_286 || temp_cpu_type == CPU_386SX || temp_cpu_type == CPU_486SLC || temp_cpu_type == CPU_IBM386SLC || temp_cpu_type == CPU_IBM486SLC );
temp_is286 = (temp_cpu_type == CPU_286);
temp_is286 = (temp_cpu_type >= CPU_286);
}
if (biosmask > 0x1ffff) {
@@ -444,7 +444,7 @@ bios_add(void)
MEM_READ_ROMCS | MEM_WRITE_ROMCS);
}
if (temp_is286 || AT) {
if (temp_is286) {
mem_mapping_add(&bios_high_mapping, biosaddr | (temp_cpu_16bitbus ? 0x00f00000 : 0xfff00000), biosmask + 1,
bios_read,bios_readw,bios_readl,
NULL,NULL,NULL,

View File

@@ -406,7 +406,7 @@ spd_write_drbs_interleaved(uint8_t *regs, uint8_t reg_min, uint8_t reg_max, uint
{
uint8_t row, dimm;
uint8_t drb;
uint16_t size, size_acc;
uint16_t size, size_acc = 0;
uint16_t rows[SPD_MAX_SLOTS];
/* No SPD: split SIMMs into pairs as if they were "DIMM"s. */

View File

@@ -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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# 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_3c503.c
net_ne2000.c net_pcnet.c net_wd8003.c net_plip.c)
net_ne2000.c net_pcnet.c net_wd8003.c net_plip.c)
add_subdirectory(slirp)
target_link_libraries(86Box slirp)

View File

@@ -172,6 +172,7 @@ poll_thread(void *arg)
thread_set_event(poll_state);
/* Create a waitable event. */
pcap_log("PCAP: Creating event...\n");
evt = thread_create_event();
/* As long as the channel is open.. */
@@ -185,8 +186,6 @@ poll_thread(void *arg)
if (pcap == NULL)
break;
/* Wait for the next packet to arrive. */
tx = network_tx_queue_check();
if (network_get_wait() || (poll_card->set_link_state && poll_card->set_link_state(poll_card->priv)) || (poll_card->wait && poll_card->wait(poll_card->priv)))
data = NULL;
else
@@ -208,11 +207,14 @@ poll_thread(void *arg)
}
}
/* Wait for the next packet to arrive. */
tx = network_tx_queue_check();
if (tx)
network_do_tx();
/* If we did not get anything, wait a while. */
if ((data == NULL) && !tx)
if (!tx)
thread_wait_event(evt, 10);
/* Release ownership of the device. */
@@ -224,7 +226,8 @@ poll_thread(void *arg)
thread_destroy_event(evt);
pcap_log("PCAP: polling stopped.\n");
thread_set_event(poll_state);
if (poll_state != NULL)
thread_set_event(poll_state);
}

View File

@@ -63,6 +63,8 @@
#include <86box/net_wd8003.h>
#include <86box/bswap.h>
#include "cpu.h"
/* Board type codes in card ID */
#define WE_TYPE_WD8003 0x01
#define WE_TYPE_WD8003S 0x02
@@ -668,7 +670,7 @@ wd_init(const device_t *info)
dev->board_chip |= WE_ID_EXTRA_RAM;
dev->bit16 = 2;
if (AT)
if (is286)
dev->bit16 |= 1;
else {
dev->bit16 |= 0;

View File

@@ -49,6 +49,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdarg.h>
#include <stdatomic.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@@ -107,7 +108,7 @@ int nic_do_log = ENABLE_NIC_LOG;
/* Local variables. */
static volatile int net_wait = 0;
static volatile atomic_int net_wait = 0;
static mutex_t *network_mutex;
static uint8_t *network_mac;
static uint8_t network_timer_active = 0;
@@ -388,8 +389,8 @@ network_attach(void *dev, uint8_t *mac, NETRXCB rx, NETWAITCB wait, NETSETLINKST
network_set_wait(0);
/* Create the network events. */
poll_data.wake_poll_thread = thread_create_event();
poll_data.poll_complete = thread_create_event();
poll_data.wake_poll_thread = thread_create_event();
/* Activate the platform module. */
switch(network_type) {
@@ -671,9 +672,7 @@ network_card_get_from_internal_name(char *s)
void
network_set_wait(int wait)
{
network_wait(1);
net_wait = wait;
network_wait(0);
}
@@ -682,8 +681,6 @@ network_get_wait(void)
{
int ret;
network_wait(1);
ret = net_wait;
network_wait(0);
return ret;
}

View File

@@ -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.
#
# CMake build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2020,2021 David Hrdlička.
#
add_library(slirp STATIC tinyglib.c arp_table.c bootp.c cksum.c dnssearch.c if.c ip_icmp.c
ip_input.c ip_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 util.c version.c)
ip_input.c ip_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 util.c version.c)
#target_link_libraries(slirp wsock32 iphlpapi)
#target_link_libraries(slirp)

View File

@@ -166,8 +166,6 @@ onesec_timer(void *priv)
void
nvr_init(nvr_t *nvr)
{
struct tm *tm;
time_t now;
int c;
/* Set up the NVR file's name. */
@@ -178,15 +176,7 @@ nvr_init(nvr_t *nvr)
/* Initialize the internal clock as needed. */
memset(&intclk, 0x00, sizeof(intclk));
if (time_sync & TIME_SYNC_ENABLED) {
/* Get the current time of day, and convert to local time. */
(void)time(&now);
if(time_sync & TIME_SYNC_UTC)
tm = gmtime(&now);
else
tm = localtime(&now);
/* Set the internal clock. */
nvr_time_set(tm);
nvr_time_sync();
} else {
/* Reset the internal clock to 1980/01/01 00:00. */
intclk.tm_mon = 1;
@@ -262,7 +252,7 @@ nvr_load(void)
path = nvr_path(saved_nvr->fn);
nvr_log("NVR: loading from '%s'\n", path);
fp = plat_fopen(path, "rb");
saved_nvr->new = (fp == NULL);
saved_nvr->is_new = (fp == NULL);
if (fp != NULL) {
/* Read NVR contents from file. */
if (fread(saved_nvr->regs, 1, saved_nvr->size, fp) != saved_nvr->size)
@@ -270,7 +260,7 @@ nvr_load(void)
(void)fclose(fp);
}
} else
saved_nvr->new = 1;
saved_nvr->is_new = 1;
/* Get the local RTC running! */
if (saved_nvr->start != NULL)
@@ -325,6 +315,24 @@ nvr_close(void)
}
void
nvr_time_sync(void)
{
struct tm *tm;
time_t now;
/* Get the current time of day, and convert to local time. */
(void)time(&now);
if(time_sync & TIME_SYNC_UTC)
tm = gmtime(&now);
else
tm = localtime(&now);
/* Set the internal clock. */
nvr_time_set(tm);
}
/* Get current time from internal clock. */
void
nvr_time_get(struct tm *tm)

View File

@@ -565,11 +565,11 @@ static void
nvr_reg_common_write(uint16_t reg, uint8_t val, nvr_t *nvr, local_t *local)
{
if ((reg == 0x2c) && (local->flags & FLAG_AMI_1994_HACK))
nvr->new = 0;
nvr->is_new = 0;
if ((reg == 0x2d) && (local->flags & FLAG_AMI_1992_HACK))
nvr->new = 0;
nvr->is_new = 0;
if ((reg == 0x52) && (local->flags & FLAG_AMI_1995_HACK))
nvr->new = 0;
nvr->is_new = 0;
if ((reg >= 0x38) && (reg <= 0x3f) && local->wp[0])
return;
if ((reg >= 0xb8) && (reg <= 0xbf) && local->wp[1])
@@ -706,14 +706,14 @@ nvr_read(uint16_t addr, void *priv)
break;
case 0x2c:
if (!nvr->new && (local->flags & FLAG_AMI_1994_HACK))
if (!nvr->is_new && (local->flags & FLAG_AMI_1994_HACK))
ret = nvr->regs[local->addr[addr_id]] & 0x7f;
else
ret = nvr->regs[local->addr[addr_id]];
break;
case 0x2d:
if (!nvr->new && (local->flags & FLAG_AMI_1992_HACK))
if (!nvr->is_new && (local->flags & FLAG_AMI_1992_HACK))
ret = nvr->regs[local->addr[addr_id]] & 0xf7;
else
ret = nvr->regs[local->addr[addr_id]];
@@ -721,7 +721,7 @@ nvr_read(uint16_t addr, void *priv)
case 0x2e:
case 0x2f:
if (!nvr->new && (local->flags & FLAG_AMI_1992_HACK)) {
if (!nvr->is_new && (local->flags & FLAG_AMI_1992_HACK)) {
for (i = 0x10; i <= 0x2d; i++) {
if (i == 0x2d)
checksum += (nvr->regs[i] & 0xf7);
@@ -732,7 +732,7 @@ nvr_read(uint16_t addr, void *priv)
ret = checksum >> 8;
else
ret = checksum & 0xff;
} else if (!nvr->new && (local->flags & FLAG_AMI_1994_HACK)) {
} else if (!nvr->is_new && (local->flags & FLAG_AMI_1994_HACK)) {
for (i = 0x10; i <= 0x2d; i++) {
if (i == 0x2c)
checksum += (nvr->regs[i] & 0x7f);
@@ -749,7 +749,7 @@ nvr_read(uint16_t addr, void *priv)
case 0x3e:
case 0x3f:
if (!nvr->new && (local->flags & FLAG_AMI_1995_HACK)) {
if (!nvr->is_new && (local->flags & FLAG_AMI_1995_HACK)) {
/* The checksum at 3E-3F is for 37-3D and 40-7F. */
for (i = 0x37; i <= 0x3d; i++)
checksum += nvr->regs[i];
@@ -763,7 +763,7 @@ nvr_read(uint16_t addr, void *priv)
ret = checksum >> 8;
else
ret = checksum & 0xff;
} else if (!nvr->new && (local->flags & FLAG_P6RP4_HACK)) {
} else if (!nvr->is_new && (local->flags & FLAG_P6RP4_HACK)) {
/* The checksum at 3E-3F is for 37-3D and 40-51. */
for (i = 0x37; i <= 0x3d; i++)
checksum += nvr->regs[i];
@@ -782,14 +782,14 @@ nvr_read(uint16_t addr, void *priv)
break;
case 0x43:
if (!nvr->new && (local->flags & FLAG_P6RP4_HACK))
if (!nvr->is_new && (local->flags & FLAG_P6RP4_HACK))
ret = nvr->regs[local->addr[addr_id]] | 0x02;
else
ret = nvr->regs[local->addr[addr_id]];
break;
case 0x52:
if (!nvr->new && (local->flags & FLAG_AMI_1995_HACK))
if (!nvr->is_new && (local->flags & FLAG_AMI_1995_HACK))
ret = nvr->regs[local->addr[addr_id]] & 0xf3;
else
ret = nvr->regs[local->addr[addr_id]];

View File

@@ -74,7 +74,6 @@ static int trc_reg = 0;
static void pci_reset_regs(void);
// #define ENABLE_PCI_LOG 1
#ifdef ENABLE_PCI_LOG
int pci_do_log = ENABLE_PCI_LOG;
@@ -487,19 +486,6 @@ pci_set_mirq_routing(int mirq, int irq)
}
uint8_t
pci_use_mirq(uint8_t mirq)
{
if (!PCI || !pci_mirqs[mirq].enabled)
return 0;
if (pci_mirqs[mirq].irq_line & 0x80)
return 0;
return 1;
}
void
pci_set_mirq(uint8_t mirq, int level)
{
@@ -768,6 +754,14 @@ pci_reset_regs(void)
}
void
pci_pic_reset(void)
{
pic_reset();
pic_set_pci_flag(last_pci_card > 0);
}
static void
pci_reset_hard(void)
{
@@ -783,7 +777,7 @@ pci_reset_hard(void)
}
}
pic_reset();
pci_pic_reset();
}
@@ -864,6 +858,8 @@ trc_reset(uint8_t val)
{
if (val & 2) {
dma_reset();
dma_set_at(1);
device_reset_all();
cpu_alt_reset = 0;
@@ -923,8 +919,6 @@ pci_init(int type)
{
int c;
PCI = 1;
pci_slots_clear();
pci_reset_hard();
@@ -972,6 +966,8 @@ pci_init(int type)
pci_mirqs[c].enabled = 0;
pci_mirqs[c].irq_line = PCI_IRQ_DISABLED;
}
pic_set_pci_flag(1);
}
@@ -1066,11 +1062,6 @@ pci_add_card(uint8_t add_type, uint8_t (*read)(int func, int addr, void *priv),
if (add_type < PCI_ADD_AGP)
pci_log("pci_add_card(): Adding PCI CARD at specific slot %02X [SPECIFIC]\n", add_type);
if (! PCI) {
pci_log("pci_add_card(): Adding PCI CARD failed (non-PCI machine) [%s]\n", (add_type == PCI_ADD_NORMAL) ? "NORMAL" : ((add_type == PCI_ADD_AGP) ? "AGP" : ((add_type == PCI_ADD_VIDEO) ? "VIDEO" : ((add_type == PCI_ADD_SCSI) ? "SCSI" : ((add_type == PCI_ADD_SOUND) ? "SOUND" : "SPECIFIC")))));
return 0xff;
}
if (! last_pci_card) {
pci_log("pci_add_card(): Adding PCI CARD failed (no PCI slots) [%s]\n", (add_type == PCI_ADD_NORMAL) ? "NORMAL" : ((add_type == PCI_ADD_AGP) ? "AGP" : ((add_type == PCI_ADD_VIDEO) ? "VIDEO" : ((add_type == PCI_ADD_SCSI) ? "SCSI" : ((add_type == PCI_ADD_SOUND) ? "SOUND" : "SPECIFIC")))));
return 0xff;

View File

@@ -52,7 +52,8 @@ pic_t pic, pic2;
static pc_timer_t pic_timer;
static int shadow = 0, elcr_enabled = 0,
tmr_inited = 0, latched = 0;
tmr_inited = 0, latched = 0,
pic_pci = 0;
static uint16_t smi_irq_mask = 0x0000,
smi_irq_status = 0x0000;
@@ -292,6 +293,9 @@ pic_reset()
pic.at = pic2.at = is_at;
smi_irq_mask = smi_irq_status = 0x0000;
shadow = 0;
pic_pci = 0;
}
@@ -302,6 +306,13 @@ pic_set_shadow(int sh)
}
void
pic_set_pci_flag(int pci)
{
pic_pci = pci;
}
static uint8_t
pic_level_triggered(pic_t *dev, int irq)
{
@@ -487,7 +498,7 @@ pic_write(uint16_t addr, uint8_t val, void *priv)
} else {
if (val & 0x10) {
/* Treat any write with any of the bits 7 to 5 set as invalid if PCI. */
if (PCI && (val & 0xe0))
if (pic_pci && (val & 0xe0))
return;
dev->icw1 = val;

View File

@@ -154,6 +154,8 @@ ctr_tick(ctr_t *ctr)
/* This is true for all modes */
ctr_load_count(ctr);
ctr->state = 2;
if ((ctr->m & 0x07) == 0x01)
ctr_set_out(ctr, 0);
return;
}

View File

@@ -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 build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# 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)

View File

@@ -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.
#
# CMake build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# 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
scsi_x54x.c scsi_aha154x.c scsi_buslogic.c scsi_ncr5380.c
scsi_ncr53c8xx.c scsi_pcscsi.c scsi_spock.c)
scsi_x54x.c scsi_aha154x.c scsi_buslogic.c scsi_ncr5380.c
scsi_ncr53c8xx.c scsi_pcscsi.c scsi_spock.c)

View File

@@ -72,11 +72,11 @@ static SCSI_CARD scsi_cards[] = {
{ "t128", &scsi_t128_device, },
{ "t130b", &scsi_t130b_device, },
#ifdef WALTJE
{ "scsiat", &scsi_scsiat_device, },
{ "wd33c93", &scsi_wd33c93_device, },
#endif
{ "aha1640", &aha1640_device, },
{ "bt640a", &buslogic_640a_device, },
{ "ncr53c90", &ncr53c90_mca_device, },
{ "spock", &spock_device, },
{ "bt958d", &buslogic_pci_device, },
{ "ncr53c810", &ncr53c810_pci_device, },
@@ -167,7 +167,7 @@ scsi_card_init(void)
/* On-board SCSI controllers get the first bus, so if one is present,
increase our instance number here. */
if (machines[machine].flags & MACHINE_SCSI)
if (machine_has_flags(machine, MACHINE_SCSI))
max--;
/* Do not initialize any controllers if we have do not have any SCSI

File diff suppressed because it is too large Load Diff

View File

@@ -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.
#
# CMake build script.
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
# Copyright 2020,2021 David Hrdlička.
#
add_library(sio OBJECT sio_acc3221.c sio_f82c710.c sio_82091aa.c sio_fdc37c6xx.c
sio_fdc37c67x.c sio_fdc37c669.c sio_fdc37c93x.c sio_fdc37m60x.c
sio_it8661f.c
sio_pc87306.c sio_pc87307.c sio_pc87309.c sio_pc87310.c sio_pc87311.c sio_pc87332.c
sio_prime3b.c sio_prime3c.c
sio_w83787f.c sio_w83877f.c sio_w83977f.c sio_um8669f.c
sio_vt82c686.c)
sio_fdc37c67x.c sio_fdc37c669.c sio_fdc37c93x.c sio_fdc37m60x.c
sio_it8661f.c
sio_pc87306.c sio_pc87307.c sio_pc87309.c sio_pc87310.c sio_pc87311.c sio_pc87332.c
sio_prime3b.c sio_prime3c.c
sio_w83787f.c sio_w83877f.c sio_w83977f.c sio_um8669f.c
sio_vt82c686.c)
if(SIO_DETECT)
target_sources(sio PRIVATE sio_detect.c)
target_sources(sio PRIVATE sio_detect.c)
endif()

Some files were not shown because too many files have changed in this diff Show More