Merge branch 'master' of https://github.com/86Box/86Box into qt
This commit is contained in:
@@ -28,3 +28,7 @@ indent_size = 2
|
|||||||
[**/CMakeLists.txt]
|
[**/CMakeLists.txt]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.cmake]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|||||||
20
cmake/flags-gcc-aarch64.cmake
Normal file
20
cmake/flags-gcc-aarch64.cmake
Normal 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS_INIT "-march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}")
|
||||||
|
set(CMAKE_CXX_FLAGS_INIT "-march=armv8-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS_INIT}")
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)
|
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "-march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS "-march=armv8-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS}")
|
|
||||||
@@ -1,4 +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.
|
||||||
|
#
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=hard ${CMAKE_C_FLAGS}")
|
set(CMAKE_C_FLAGS_INIT "-march=armv7-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}")
|
||||||
set(CMAKE_CXX_FLAGS "-march=armv7-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS_INIT "-march=armv7-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS_INIT}")
|
||||||
@@ -1,4 +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.
|
||||||
|
#
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "-m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS}")
|
set(CMAKE_C_FLAGS_INIT "-m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}")
|
||||||
set(CMAKE_CXX_FLAGS "-m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS_INIT "-m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}")
|
||||||
@@ -1,4 +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.
|
||||||
|
#
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake)
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "-m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS}")
|
set(CMAKE_C_FLAGS_INIT "-m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}")
|
||||||
set(CMAKE_CXX_FLAGS "-m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS_INIT "-m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_INIT}")
|
||||||
@@ -1,10 +1,25 @@
|
|||||||
set(CMAKE_CONFIGURATION_TYPES Debug;Release;Optimized)
|
#
|
||||||
|
# 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||||
|
# running old operating systems and software designed for IBM
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "-fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing")
|
set(CMAKE_CONFIGURATION_TYPES Debug;Release;Optimized)
|
||||||
set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
|
|
||||||
set(CMAKE_C_FLAGS_RELEASE "-g0 -O3")
|
set(CMAKE_C_FLAGS_INIT "-fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
|
set(CMAKE_CXX_FLAGS_INIT ${CMAKE_C_FLAGS_INIT})
|
||||||
set(CMAKE_C_FLAGS_DEBUG "-ggdb -Og")
|
set(CMAKE_C_FLAGS_RELEASE_INIT "-g0 -O3")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
|
set(CMAKE_CXX_FLAGS_RELEASE_INIT ${CMAKE_C_FLAGS_RELEASE_INIT})
|
||||||
set(CMAKE_C_FLAGS_OPTIMIZED "-march=native -mtune=native -O3 -ffp-contract=fast -flto")
|
set(CMAKE_C_FLAGS_DEBUG_INIT "-ggdb -Og")
|
||||||
set(CMAKE_CXX_FLAGS_OPTIMIZED ${CMAKE_C_FLAGS_OPTIMIZED})
|
set(CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_C_FLAGS_DEBUG_INIT})
|
||||||
|
set(CMAKE_C_FLAGS_OPTIMIZED_INIT "-march=native -mtune=native -O3 -ffp-contract=fast -flto")
|
||||||
|
set(CMAKE_CXX_FLAGS_OPTIMIZED_INIT ${CMAKE_C_FLAGS_OPTIMIZED_INIT})
|
||||||
30
cmake/llvm-win32-aarch64.cmake
Normal file
30
cmake/llvm-win32-aarch64.cmake
Normal 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?
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-arm64.cmake)
|
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER clang)
|
|
||||||
set(CMAKE_CXX_COMPILER clang++)
|
|
||||||
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)
|
|
||||||
@@ -1,10 +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)
|
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-i686.cmake)
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER clang)
|
# Use the GCC-compatible Clang executables in order to use our flags
|
||||||
set(CMAKE_CXX_COMPILER clang++)
|
set(CMAKE_C_COMPILER clang)
|
||||||
set(CMAKE_RC_COMPILER rc)
|
set(CMAKE_CXX_COMPILER clang++)
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER_TARGET i686-pc-windows-msvc)
|
# `llvm-rc` is barely usable as of LLVM 13, using MS' rc.exe for now
|
||||||
set(CMAKE_CXX_COMPILER_TARGET i686-pc-windows-msvc)
|
set(CMAKE_RC_COMPILER rc)
|
||||||
|
|
||||||
set(CMAKE_SYSTEM_PROCESSOR X86)
|
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?
|
||||||
@@ -1,10 +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)
|
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-x86_64.cmake)
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER clang)
|
# Use the GCC-compatible Clang executables in order to use our flags
|
||||||
set(CMAKE_CXX_COMPILER clang++)
|
set(CMAKE_C_COMPILER clang)
|
||||||
set(CMAKE_RC_COMPILER rc)
|
set(CMAKE_CXX_COMPILER clang++)
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER_TARGET x86_64-pc-windows-msvc)
|
# `llvm-rc` is barely usable as of LLVM 13, using MS' rc.exe for now
|
||||||
set(CMAKE_CXX_COMPILER_TARGET x86_64-pc-windows-msvc)
|
set(CMAKE_RC_COMPILER rc)
|
||||||
|
|
||||||
set(CMAKE_SYSTEM_PROCESSOR AMD64)
|
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?
|
||||||
@@ -129,7 +129,7 @@ serial_update_ints(serial_t *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stat && (dev->irq != 0xff) && ((dev->mctrl & 8) || (dev->type == SERIAL_8250_PCJR))) {
|
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);
|
picintlevel(1 << dev->irq);
|
||||||
else
|
else
|
||||||
picint(1 << dev->irq);
|
picint(1 << dev->irq);
|
||||||
@@ -151,9 +151,9 @@ serial_clear_timeout(serial_t *dev)
|
|||||||
static void
|
static void
|
||||||
write_fifo(serial_t *dev, uint8_t dat)
|
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. */
|
/* FIFO mode. */
|
||||||
timer_disable(&dev->timeout_timer);
|
timer_disable(&dev->timeout_timer);
|
||||||
/* Indicate overrun. */
|
/* Indicate overrun. */
|
||||||
@@ -189,7 +189,7 @@ write_fifo(serial_t *dev, uint8_t dat)
|
|||||||
void
|
void
|
||||||
serial_write_fifo(serial_t *dev, uint8_t dat)
|
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))
|
if (!(dev->mctrl & 0x10))
|
||||||
write_fifo(dev, dat);
|
write_fifo(dev, dat);
|
||||||
@@ -371,7 +371,7 @@ serial_write(uint16_t addr, uint8_t val, void *p)
|
|||||||
dev->int_status &= ~SERIAL_INT_TRANSMIT;
|
dev->int_status &= ~SERIAL_INT_TRANSMIT;
|
||||||
serial_update_ints(dev);
|
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. */
|
/* FIFO mode, begin transmitting. */
|
||||||
timer_on_auto(&dev->transmit_timer, dev->transmit_period);
|
timer_on_auto(&dev->transmit_timer, dev->transmit_period);
|
||||||
dev->transmit_enabled |= 1; /* Start moving. */
|
dev->transmit_enabled |= 1; /* Start moving. */
|
||||||
@@ -396,7 +396,7 @@ serial_write(uint16_t addr, uint8_t val, void *p)
|
|||||||
serial_update_ints(dev);
|
serial_update_ints(dev);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (dev->type >= SERIAL_NS16550) {
|
if (dev->type >= SERIAL_16550) {
|
||||||
if ((val ^ dev->fcr) & 0x01)
|
if ((val ^ dev->fcr) & 0x01)
|
||||||
serial_reset_fifo(dev);
|
serial_reset_fifo(dev);
|
||||||
dev->fcr = val & 0xf9;
|
dev->fcr = val & 0xf9;
|
||||||
@@ -500,7 +500,7 @@ serial_write(uint16_t addr, uint8_t val, void *p)
|
|||||||
serial_update_ints(dev);
|
serial_update_ints(dev);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (dev->type >= SERIAL_NS16450)
|
if (dev->type >= SERIAL_16450)
|
||||||
dev->scratch = val;
|
dev->scratch = val;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -522,7 +522,7 @@ serial_read(uint16_t addr, void *p)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dev->type >= SERIAL_NS16550) && dev->fifo_enabled) {
|
if ((dev->type >= SERIAL_16550) && dev->fifo_enabled) {
|
||||||
/* FIFO mode. */
|
/* FIFO mode. */
|
||||||
|
|
||||||
serial_clear_timeout(dev);
|
serial_clear_timeout(dev);
|
||||||
@@ -718,12 +718,12 @@ serial_set_next_inst(int ni)
|
|||||||
void
|
void
|
||||||
serial_standalone_init(void) {
|
serial_standalone_init(void) {
|
||||||
for ( ; next_inst < 4; )
|
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 = {
|
const device_t ns8250_device = {
|
||||||
"Intel 8250(-compatible) UART",
|
"National Semiconductor 8250(-compatible) UART",
|
||||||
0,
|
0,
|
||||||
SERIAL_8250,
|
SERIAL_8250,
|
||||||
serial_init, serial_close, NULL,
|
serial_init, serial_close, NULL,
|
||||||
@@ -731,8 +731,8 @@ const device_t i8250_device = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
const device_t i8250_pcjr_device = {
|
const device_t ns8250_pcjr_device = {
|
||||||
"Intel 8250(-compatible) UART for PCjr",
|
"National Semiconductor 8250(-compatible) UART for PCjr",
|
||||||
DEVICE_PCJR,
|
DEVICE_PCJR,
|
||||||
SERIAL_8250_PCJR,
|
SERIAL_8250_PCJR,
|
||||||
serial_init, serial_close, NULL,
|
serial_init, serial_close, NULL,
|
||||||
@@ -743,7 +743,7 @@ const device_t i8250_pcjr_device = {
|
|||||||
const device_t ns16450_device = {
|
const device_t ns16450_device = {
|
||||||
"National Semiconductor NS16450(-compatible) UART",
|
"National Semiconductor NS16450(-compatible) UART",
|
||||||
0,
|
0,
|
||||||
SERIAL_NS16450,
|
SERIAL_16450,
|
||||||
serial_init, serial_close, NULL,
|
serial_init, serial_close, NULL,
|
||||||
{ NULL }, serial_speed_changed, NULL,
|
{ NULL }, serial_speed_changed, NULL,
|
||||||
NULL
|
NULL
|
||||||
@@ -752,7 +752,43 @@ const device_t ns16450_device = {
|
|||||||
const device_t ns16550_device = {
|
const device_t ns16550_device = {
|
||||||
"National Semiconductor NS16550(-compatible) UART",
|
"National Semiconductor NS16550(-compatible) UART",
|
||||||
0,
|
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,
|
serial_init, serial_close, NULL,
|
||||||
{ NULL }, serial_speed_changed, NULL,
|
{ NULL }, serial_speed_changed, NULL,
|
||||||
NULL
|
NULL
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ const device_t gameport_device = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const device_t gameport_201_device = {
|
const device_t gameport_201_device = {
|
||||||
"Game port (port 201h only)",
|
"Game port (Port 201h only)",
|
||||||
0, 0x010201,
|
0, 0x010201,
|
||||||
gameport_init,
|
gameport_init,
|
||||||
gameport_close,
|
gameport_close,
|
||||||
@@ -463,6 +463,15 @@ const device_t gameport_208_device = {
|
|||||||
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 = {
|
const device_t gameport_pnp_device = {
|
||||||
"Game port (Plug and Play only)",
|
"Game port (Plug and Play only)",
|
||||||
0, 0x080000,
|
0, 0x080000,
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ extern "C" {
|
|||||||
extern const device_t gameport_device;
|
extern const device_t gameport_device;
|
||||||
extern const device_t gameport_201_device;
|
extern const device_t gameport_201_device;
|
||||||
extern const device_t gameport_208_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_device;
|
||||||
extern const device_t gameport_pnp_6io_device;
|
extern const device_t gameport_pnp_6io_device;
|
||||||
extern const device_t gameport_sio_device;
|
extern const device_t gameport_sio_device;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
typedef struct _nvr_ {
|
typedef struct _nvr_ {
|
||||||
char *fn; /* pathname of image file */
|
char *fn; /* pathname of image file */
|
||||||
uint16_t size; /* device configuration */
|
uint16_t size; /* device configuration */
|
||||||
int8_t irq, new;
|
int8_t irq, is_new;
|
||||||
|
|
||||||
uint8_t onesec_cnt;
|
uint8_t onesec_cnt;
|
||||||
pc_timer_t onesec_time;
|
pc_timer_t onesec_time;
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
*
|
*
|
||||||
* This file is part of the 86Box distribution.
|
* 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 EMU_SERIAL_H
|
||||||
|
|
||||||
|
|
||||||
#define SERIAL_8250 0
|
#define SERIAL_8250 0
|
||||||
#define SERIAL_8250_PCJR 1
|
#define SERIAL_8250_PCJR 1
|
||||||
#define SERIAL_NS16450 2
|
#define SERIAL_16450 2
|
||||||
#define SERIAL_NS16550 3
|
#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
|
#define SERIAL_FIFO_SIZE 16
|
||||||
|
|
||||||
@@ -39,8 +44,6 @@
|
|||||||
#define SERIAL4_ADDR 0x02e8
|
#define SERIAL4_ADDR 0x02e8
|
||||||
#define SERIAL4_IRQ 3
|
#define SERIAL4_IRQ 3
|
||||||
|
|
||||||
#define MAX_SERIAL 4
|
|
||||||
|
|
||||||
|
|
||||||
struct serial_device_s;
|
struct serial_device_s;
|
||||||
struct serial_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_set_clock_src(serial_t *dev, double clock_src);
|
||||||
extern void serial_reset_port(serial_t *dev);
|
extern void serial_reset_port(serial_t *dev);
|
||||||
|
|
||||||
extern const device_t i8250_device;
|
extern const device_t ns8250_device;
|
||||||
extern const device_t i8250_pcjr_device;
|
extern const device_t ns8250_pcjr_device;
|
||||||
extern const device_t ns16450_device;
|
extern const device_t ns16450_device;
|
||||||
extern const device_t ns16550_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*/
|
#endif /*EMU_SERIAL_H*/
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ machine_at_cmdpc_init(const machine_t *model)
|
|||||||
if (fdc_type == FDC_INTERNAL)
|
if (fdc_type == FDC_INTERNAL)
|
||||||
device_add(&fdc_at_device);
|
device_add(&fdc_at_device);
|
||||||
|
|
||||||
cmd_uart = device_add(&i8250_device);
|
cmd_uart = device_add(&ns8250_device);
|
||||||
|
|
||||||
cbm_io_init();
|
cbm_io_init();
|
||||||
|
|
||||||
|
|||||||
@@ -866,8 +866,8 @@ machine_pcjr_init(const machine_t *model)
|
|||||||
|
|
||||||
device_add(&fdc_pcjr_device);
|
device_add(&fdc_pcjr_device);
|
||||||
|
|
||||||
device_add(&i8250_pcjr_device);
|
device_add(&ns8250_pcjr_device);
|
||||||
serial_set_next_inst(MAX_SERIAL); /* So that serial_standalone_init() won't do anything. */
|
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,8 +153,8 @@ machine_xt_z184_init(const machine_t *model)
|
|||||||
lpt1_remove(); /* only one parallel port */
|
lpt1_remove(); /* only one parallel port */
|
||||||
lpt2_remove();
|
lpt2_remove();
|
||||||
lpt1_init(0x278);
|
lpt1_init(0x278);
|
||||||
device_add(&i8250_device);
|
device_add(&ns8250_device);
|
||||||
serial_set_next_inst(MAX_SERIAL); /* So that serial_standalone_init() won't do anything. */
|
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
|
||||||
|
|
||||||
device_add(&cga_device);
|
device_add(&cga_device);
|
||||||
|
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ nvr_load(void)
|
|||||||
path = nvr_path(saved_nvr->fn);
|
path = nvr_path(saved_nvr->fn);
|
||||||
nvr_log("NVR: loading from '%s'\n", path);
|
nvr_log("NVR: loading from '%s'\n", path);
|
||||||
fp = plat_fopen(path, "rb");
|
fp = plat_fopen(path, "rb");
|
||||||
saved_nvr->new = (fp == NULL);
|
saved_nvr->is_new = (fp == NULL);
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
/* Read NVR contents from file. */
|
/* Read NVR contents from file. */
|
||||||
if (fread(saved_nvr->regs, 1, saved_nvr->size, fp) != saved_nvr->size)
|
if (fread(saved_nvr->regs, 1, saved_nvr->size, fp) != saved_nvr->size)
|
||||||
@@ -270,7 +270,7 @@ nvr_load(void)
|
|||||||
(void)fclose(fp);
|
(void)fclose(fp);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
saved_nvr->new = 1;
|
saved_nvr->is_new = 1;
|
||||||
|
|
||||||
/* Get the local RTC running! */
|
/* Get the local RTC running! */
|
||||||
if (saved_nvr->start != NULL)
|
if (saved_nvr->start != NULL)
|
||||||
|
|||||||
22
src/nvr_at.c
22
src/nvr_at.c
@@ -565,11 +565,11 @@ static void
|
|||||||
nvr_reg_common_write(uint16_t reg, uint8_t val, nvr_t *nvr, local_t *local)
|
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))
|
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))
|
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))
|
if ((reg == 0x52) && (local->flags & FLAG_AMI_1995_HACK))
|
||||||
nvr->new = 0;
|
nvr->is_new = 0;
|
||||||
if ((reg >= 0x38) && (reg <= 0x3f) && local->wp[0])
|
if ((reg >= 0x38) && (reg <= 0x3f) && local->wp[0])
|
||||||
return;
|
return;
|
||||||
if ((reg >= 0xb8) && (reg <= 0xbf) && local->wp[1])
|
if ((reg >= 0xb8) && (reg <= 0xbf) && local->wp[1])
|
||||||
@@ -706,14 +706,14 @@ nvr_read(uint16_t addr, void *priv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x2c:
|
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;
|
ret = nvr->regs[local->addr[addr_id]] & 0x7f;
|
||||||
else
|
else
|
||||||
ret = nvr->regs[local->addr[addr_id]];
|
ret = nvr->regs[local->addr[addr_id]];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x2d:
|
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;
|
ret = nvr->regs[local->addr[addr_id]] & 0xf7;
|
||||||
else
|
else
|
||||||
ret = nvr->regs[local->addr[addr_id]];
|
ret = nvr->regs[local->addr[addr_id]];
|
||||||
@@ -721,7 +721,7 @@ nvr_read(uint16_t addr, void *priv)
|
|||||||
|
|
||||||
case 0x2e:
|
case 0x2e:
|
||||||
case 0x2f:
|
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++) {
|
for (i = 0x10; i <= 0x2d; i++) {
|
||||||
if (i == 0x2d)
|
if (i == 0x2d)
|
||||||
checksum += (nvr->regs[i] & 0xf7);
|
checksum += (nvr->regs[i] & 0xf7);
|
||||||
@@ -732,7 +732,7 @@ nvr_read(uint16_t addr, void *priv)
|
|||||||
ret = checksum >> 8;
|
ret = checksum >> 8;
|
||||||
else
|
else
|
||||||
ret = checksum & 0xff;
|
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++) {
|
for (i = 0x10; i <= 0x2d; i++) {
|
||||||
if (i == 0x2c)
|
if (i == 0x2c)
|
||||||
checksum += (nvr->regs[i] & 0x7f);
|
checksum += (nvr->regs[i] & 0x7f);
|
||||||
@@ -749,7 +749,7 @@ nvr_read(uint16_t addr, void *priv)
|
|||||||
|
|
||||||
case 0x3e:
|
case 0x3e:
|
||||||
case 0x3f:
|
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. */
|
/* The checksum at 3E-3F is for 37-3D and 40-7F. */
|
||||||
for (i = 0x37; i <= 0x3d; i++)
|
for (i = 0x37; i <= 0x3d; i++)
|
||||||
checksum += nvr->regs[i];
|
checksum += nvr->regs[i];
|
||||||
@@ -763,7 +763,7 @@ nvr_read(uint16_t addr, void *priv)
|
|||||||
ret = checksum >> 8;
|
ret = checksum >> 8;
|
||||||
else
|
else
|
||||||
ret = checksum & 0xff;
|
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. */
|
/* The checksum at 3E-3F is for 37-3D and 40-51. */
|
||||||
for (i = 0x37; i <= 0x3d; i++)
|
for (i = 0x37; i <= 0x3d; i++)
|
||||||
checksum += nvr->regs[i];
|
checksum += nvr->regs[i];
|
||||||
@@ -782,14 +782,14 @@ nvr_read(uint16_t addr, void *priv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x43:
|
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;
|
ret = nvr->regs[local->addr[addr_id]] | 0x02;
|
||||||
else
|
else
|
||||||
ret = nvr->regs[local->addr[addr_id]];
|
ret = nvr->regs[local->addr[addr_id]];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x52:
|
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;
|
ret = nvr->regs[local->addr[addr_id]] & 0xf3;
|
||||||
else
|
else
|
||||||
ret = nvr->regs[local->addr[addr_id]];
|
ret = nvr->regs[local->addr[addr_id]];
|
||||||
|
|||||||
Reference in New Issue
Block a user