This commit is contained in:
starfrost013
2025-02-11 23:23:39 +00:00
168 changed files with 8338 additions and 7945 deletions

View File

@@ -542,11 +542,12 @@ then
sudo sed -i -e 's/configure.env-append MAKE=/configure.env-append VULKAN_SDK=${prefix} MAKE=/g' "$qt5_portfile"
fi
# Patch openal-soft to use 1.23.1 on all targets instead of 1.24.1 on >=10.15 only,
# Patch openal-soft to use 1.23.1 on all targets instead of 1.24.2 on >=10.13 only,
# to prevent a symlink mismatch from having different versions on x86_64 and arm64.
# See: https://github.com/macports/macports-ports/commit/9b4903fc9c76769d476079e404c9a3b8a225f8aa
# https://github.com/macports/macports-ports/commit/788deb64dc0695e8d04afb32ed904947f2a7591b
openal_portfile="$macports/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/audio/openal-soft/Portfile"
sudo sed -i -e 's/if {${os.platform} ne "darwin" || ${os.major} >= 19}/if {0}/g' "$openal_portfile"
sudo sed -i -e 's/if {${os.platform} ne "darwin" ||/if {0 \&\&/g' "$openal_portfile"
# Patch wget to remove libproxy support, as it depends on shared-mime-info which
# fails to build for a 10.13 target, which we have to do despite wget only being

View File

@@ -11,7 +11,7 @@
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020-2021 David Hrdlička.
# Copyright 2021-2024 Jasmine Iwanek.
# Copyright 2021-2025 Jasmine Iwanek.
#
cmake_minimum_required(VERSION 3.16)

View File

@@ -56,6 +56,14 @@
},
"inherits": "base"
},
{
"name": "ultra_debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "UltraDebug",
"DEV_BRANCH": "ON"
},
"inherits": "base"
},
{
"name": "llvm-macos-aarch64.cmake",
"displayName": "MacOS clang regular",

View File

@@ -20,6 +20,8 @@ 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_ULTRADEBUG_INIT " -O0 -ggdb -g3")
string(APPEND CMAKE_CXX_FLAGS_ULTRADEBUG_INIT " -O0 -ggdb -g3")
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")
@@ -28,7 +30,7 @@ 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)
foreach(CONFIG RELEASE;DEBUG;ULTRADEBUG;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()

View File

@@ -2473,10 +2473,9 @@ acpi_init(const device_t *info)
{
acpi_t *dev;
dev = (acpi_t *) malloc(sizeof(acpi_t));
dev = (acpi_t *) calloc(1, sizeof(acpi_t));
if (dev == NULL)
return NULL;
memset(dev, 0x00, sizeof(acpi_t));
cpu_to_acpi = ACPI_TIMER_FREQ / cpuclock;
dev->vendor = info->local;

View File

@@ -460,11 +460,11 @@ const device_t mitsumi_cdrom_device = {
.name = "Mitsumi CD-ROM interface",
.internal_name = "mcd",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 1,
.local = 0,
.init = mitsumi_cdrom_init,
.close = mitsumi_cdrom_close,
.reset = NULL,
{ .available = NULL },
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL

View File

@@ -975,39 +975,24 @@ stpc_serial_init(UNUSED(const device_t *info))
static void
stpc_lpt_handlers(stpc_lpt_t *dev, uint8_t val)
{
uint8_t old_addr = (dev->reg1 & 0x03);
uint8_t new_addr = (val & 0x03);
const uint8_t new_addr = (val & 0x03);
switch (old_addr) {
case 0x1:
lpt3_remove();
break;
case 0x2:
lpt1_remove();
break;
case 0x3:
lpt2_remove();
break;
default:
break;
}
lpt1_remove();
switch (new_addr) {
case 0x1:
stpc_log("STPC: Remapping parallel port to LPT3\n");
lpt3_init(0x3bc);
lpt1_setup(LPT_MDA_ADDR);
break;
case 0x2:
stpc_log("STPC: Remapping parallel port to LPT1\n");
lpt1_init(0x378);
lpt1_setup(LPT1_ADDR);
break;
case 0x3:
stpc_log("STPC: Remapping parallel port to LPT2\n");
lpt2_init(0x278);
lpt1_setup(LPT2_ADDR);
break;
default:
@@ -1015,9 +1000,11 @@ stpc_lpt_handlers(stpc_lpt_t *dev, uint8_t val)
break;
}
dev->reg1 = (val & 0x08);
dev->reg1 |= new_addr;
dev->reg1 |= 0x84; /* reserved bits that default to 1; hardwired? */
if (dev != NULL) {
dev->reg1 = (val & 0x08);
dev->reg1 |= new_addr;
dev->reg1 |= 0x84; /* reserved bits that default to 1; hardwired? */
}
}
static void

View File

@@ -82,6 +82,8 @@
#include <86box/hdd.h>
#include <86box/hdc.h>
#include <86box/hdc_ide.h>
#include <86box/keyboard.h>
#include <86box/machine.h>
#include <86box/pic.h>
#include <86box/pci.h>
#include <86box/port_92.h>

View File

@@ -542,16 +542,16 @@ wd76c10_ser_par_cs_recalc(wd76c10_t *dev)
lpt1_remove();
switch ((dev->ser_par_cs >> 9) & 0x03) {
case 1:
lpt1_init(0x3bc);
lpt1_irq(7);
lpt1_setup(LPT_MDA_ADDR);
lpt1_irq(LPT1_IRQ);
break;
case 2:
lpt1_init(0x378);
lpt1_irq(7);
lpt1_setup(LPT1_ADDR);
lpt1_irq(LPT1_IRQ);
break;
case 3:
lpt1_init(0x278);
lpt1_irq(7);
lpt1_setup(LPT2_ADDR);
lpt1_irq(LPT1_IRQ);
break;
}
}

View File

@@ -21,8 +21,7 @@
#define MAX_INSTRUCTION_COUNT 50
static struct
{
static struct {
uint32_t pc;
int op_ssegs;
x86seg *op_ea_seg;

View File

@@ -8,8 +8,7 @@
#include "codegen_accumulate.h"
#include "codegen_ir.h"
static struct
{
static struct {
int count;
int dest_reg;
} acc_regs[] = {

View File

@@ -16,28 +16,29 @@
#include "codegen_ops_3dnow.h"
#include "codegen_ops_helpers.h"
#define ropParith(func) \
uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
int dest_reg = (fetchdat >> 3) & 7; \
\
uop_MMX_ENTER(ir); \
codegen_mark_code_present(block, cs + op_pc, 1); \
if ((fetchdat & 0xc0) == 0xc0) { \
int src_reg = fetchdat & 7; \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_MM(src_reg)); \
} else { \
x86seg *target_seg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_Q, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_temp0_Q); \
} \
\
codegen_mark_code_present(block, cs + op_pc + 1, 1); \
return op_pc + 2; \
#define ropParith(func) \
uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
int dest_reg = (fetchdat >> 3) & 7; \
\
uop_MMX_ENTER(ir); \
codegen_mark_code_present(block, cs + op_pc, 1); \
if ((fetchdat & 0xc0) == 0xc0) { \
int src_reg = fetchdat & 7; \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_MM(src_reg)); \
} else { \
x86seg *target_seg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_Q, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_temp0_Q); \
} \
\
codegen_mark_code_present(block, cs + op_pc + 1, 1); \
return op_pc + 2; \
}
// clang-format off

View File

@@ -815,41 +815,56 @@ ropJNLE_common(codeblock_t *block, ir_data_t *ir, uint32_t dest_addr, uint32_t n
}
}
#define ropJ(cond) \
uint32_t ropJ##cond##_8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) \
{ \
uint32_t offset = (int32_t) (int8_t) fastreadb(cs + op_pc); \
uint32_t dest_addr = op_pc + 1 + offset; \
int ret; \
\
if (!(op_32 & 0x100)) \
dest_addr &= 0xffff; \
ret = ropJ##cond##_common(block, ir, dest_addr, op_pc + 1); \
\
codegen_mark_code_present(block, cs + op_pc, 1); \
return ret ? dest_addr : (op_pc + 1); \
} \
uint32_t ropJ##cond##_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
uint32_t offset = (int32_t) (int16_t) fastreadw(cs + op_pc); \
uint32_t dest_addr = (op_pc + 2 + offset) & 0xffff; \
int ret; \
\
ret = ropJ##cond##_common(block, ir, dest_addr, op_pc + 2); \
\
codegen_mark_code_present(block, cs + op_pc, 2); \
return ret ? dest_addr : (op_pc + 2); \
} \
uint32_t ropJ##cond##_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
uint32_t offset = fastreadl(cs + op_pc); \
uint32_t dest_addr = op_pc + 4 + offset; \
int ret; \
\
ret = ropJ##cond##_common(block, ir, dest_addr, op_pc + 4); \
\
codegen_mark_code_present(block, cs + op_pc, 4); \
return ret ? dest_addr : (op_pc + 4); \
#define ropJ(cond) \
uint32_t ropJ##cond##_8(codeblock_t *block, \
ir_data_t *ir, \
UNUSED(uint8_t opcode), \
UNUSED(uint32_t fetchdat), \
uint32_t op_32, \
uint32_t op_pc) \
{ \
uint32_t offset = (int32_t) (int8_t) fastreadb(cs + op_pc); \
uint32_t dest_addr = op_pc + 1 + offset; \
int ret; \
\
if (!(op_32 & 0x100)) \
dest_addr &= 0xffff; \
ret = ropJ##cond##_common(block, ir, dest_addr, op_pc + 1); \
\
codegen_mark_code_present(block, cs + op_pc, 1); \
return ret ? dest_addr : (op_pc + 1); \
} \
uint32_t ropJ##cond##_16(codeblock_t *block, \
ir_data_t *ir, \
UNUSED(uint8_t opcode), \
UNUSED(uint32_t fetchdat), \
UNUSED(uint32_t op_32), \
uint32_t op_pc) \
{ \
uint32_t offset = (int32_t) (int16_t) fastreadw(cs + op_pc); \
uint32_t dest_addr = (op_pc + 2 + offset) & 0xffff; \
int ret; \
\
ret = ropJ##cond##_common(block, ir, dest_addr, op_pc + 2); \
\
codegen_mark_code_present(block, cs + op_pc, 2); \
return ret ? dest_addr : (op_pc + 2); \
} \
uint32_t ropJ##cond##_32(codeblock_t *block, \
ir_data_t *ir, \
UNUSED(uint8_t opcode), \
UNUSED(uint32_t fetchdat), \
UNUSED(uint32_t op_32), \
uint32_t op_pc) \
{ \
uint32_t offset = fastreadl(cs + op_pc); \
uint32_t dest_addr = op_pc + 4 + offset; \
int ret; \
\
ret = ropJ##cond##_common(block, ir, dest_addr, op_pc + 4); \
\
codegen_mark_code_present(block, cs + op_pc, 4); \
return ret ? dest_addr : (op_pc + 4); \
}
// clang-format off

View File

@@ -300,131 +300,139 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uin
return op_pc;
}
#define ropF_arith_mem(name, load_uop) \
uint32_t ropFADD##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
if ((cpu_state.npxc >> 10) & 3) \
return 0; \
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FADD(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFCOM##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \
uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \
uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \
\
return op_pc + 1; \
} \
uint32_t ropFCOMP##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \
uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \
uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \
fpu_POP(block, ir); \
\
return op_pc + 1; \
} \
uint32_t ropFDIV##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FDIV(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFDIVR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FDIV(ir, IREG_ST(0), IREG_temp0_D, IREG_ST(0)); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFMUL##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FMUL(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFSUB##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FSUB(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFSUBR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FSUB(ir, IREG_ST(0), IREG_temp0_D, IREG_ST(0)); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
#define ropF_arith_mem(name, load_uop) \
uint32_t ropFADD##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
if ((cpu_state.npxc >> 10) & 3) \
return 0; \
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FADD(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFCOM##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \
uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \
uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \
\
return op_pc + 1; \
} \
uint32_t ropFCOMP##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \
uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \
uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \
fpu_POP(block, ir); \
\
return op_pc + 1; \
} \
uint32_t ropFDIV##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FDIV(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFDIVR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FDIV(ir, IREG_ST(0), IREG_temp0_D, IREG_ST(0)); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFMUL##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FMUL(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFSUB##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FSUB(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFSUBR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_FSUB(ir, IREG_ST(0), IREG_temp0_D, IREG_ST(0)); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
}
// clang-format off
@@ -432,137 +440,145 @@ ropF_arith_mem(s, uop_MEM_LOAD_SINGLE)
ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE)
// clang-format on
#define ropFI_arith_mem(name, temp_reg) \
uint32_t ropFIADD##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FADD(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFICOM##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \
uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \
uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \
\
return op_pc + 1; \
} \
uint32_t ropFICOMP##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \
uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \
uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \
fpu_POP(block, ir); \
\
return op_pc + 1; \
} \
uint32_t ropFIDIV##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FDIV(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFIDIVR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FDIV(ir, IREG_ST(0), IREG_temp0_D, IREG_ST(0)); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFIMUL##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FMUL(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFISUB##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FSUB(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFISUBR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FSUB(ir, IREG_ST(0), IREG_temp0_D, IREG_ST(0)); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
#define ropFI_arith_mem(name, temp_reg) \
uint32_t ropFIADD##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FADD(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFICOM##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \
uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \
uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \
\
return op_pc + 1; \
} \
uint32_t ropFICOMP##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \
uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \
uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \
fpu_POP(block, ir); \
\
return op_pc + 1; \
} \
uint32_t ropFIDIV##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FDIV(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFIDIVR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FDIV(ir, IREG_ST(0), IREG_temp0_D, IREG_ST(0)); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFIMUL##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FMUL(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFISUB##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FSUB(ir, IREG_ST(0), IREG_ST(0), IREG_temp0_D); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
} \
uint32_t ropFISUBR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg; \
\
uop_FP_ENTER(ir); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
op_pc--; \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \
uop_FSUB(ir, IREG_ST(0), IREG_temp0_D, IREG_ST(0)); \
uop_MOV_IMM(ir, IREG_tag(0), TAG_VALID); \
\
return op_pc + 1; \
}
// clang-format off

View File

@@ -519,57 +519,61 @@ ropCWDE(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSE
return op_pc;
}
#define ropLxS(name, seg) \
uint32_t rop##name##_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg = NULL; \
int dest_reg = (fetchdat >> 3) & 7; \
\
if ((fetchdat & 0xc0) == 0xc0) \
return 0; \
\
codegen_mark_code_present(block, cs + op_pc, 1); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MEM_LOAD_REG_OFFSET(ir, IREG_temp1_W, ireg_seg_base(target_seg), IREG_eaaddr, 2); \
uop_LOAD_SEG(ir, seg, IREG_temp1_W); \
uop_MOV(ir, IREG_16(dest_reg), IREG_temp0_W); \
\
if (seg == &cpu_state.seg_ss) \
CPU_BLOCK_END(); \
\
return op_pc + 1; \
} \
uint32_t rop##name##_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg = NULL; \
int dest_reg = (fetchdat >> 3) & 7; \
\
if ((fetchdat & 0xc0) == 0xc0) \
return 0; \
\
codegen_mark_code_present(block, cs + op_pc, 1); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MEM_LOAD_REG_OFFSET(ir, IREG_temp1_W, ireg_seg_base(target_seg), IREG_eaaddr, 4); \
uop_LOAD_SEG(ir, seg, IREG_temp1_W); \
uop_MOV(ir, IREG_32(dest_reg), IREG_temp0); \
\
if (seg == &cpu_state.seg_ss) \
CPU_BLOCK_END(); \
\
return op_pc + 1; \
#define ropLxS(name, seg) \
uint32_t rop##name##_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg = NULL; \
int dest_reg = (fetchdat >> 3) & 7; \
\
if ((fetchdat & 0xc0) == 0xc0) \
return 0; \
\
codegen_mark_code_present(block, cs + op_pc, 1); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MEM_LOAD_REG_OFFSET(ir, IREG_temp1_W, ireg_seg_base(target_seg), IREG_eaaddr, 2); \
uop_LOAD_SEG(ir, seg, IREG_temp1_W); \
uop_MOV(ir, IREG_16(dest_reg), IREG_temp0_W); \
\
if (seg == &cpu_state.seg_ss) \
CPU_BLOCK_END(); \
\
return op_pc + 1; \
} \
uint32_t rop##name##_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
x86seg *target_seg = NULL; \
int dest_reg = (fetchdat >> 3) & 7; \
\
if ((fetchdat & 0xc0) == 0xc0) \
return 0; \
\
codegen_mark_code_present(block, cs + op_pc, 1); \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_MEM_LOAD_REG_OFFSET(ir, IREG_temp1_W, ireg_seg_base(target_seg), IREG_eaaddr, 4); \
uop_LOAD_SEG(ir, seg, IREG_temp1_W); \
uop_MOV(ir, IREG_32(dest_reg), IREG_temp0); \
\
if (seg == &cpu_state.seg_ss) \
CPU_BLOCK_END(); \
\
return op_pc + 1; \
}
// clang-format off
ropLxS(LDS, &cpu_state.seg_ds)
ropLxS(LES, &cpu_state.seg_es)
ropLxS(LFS, &cpu_state.seg_fs)
ropLxS(LGS, &cpu_state.seg_gs)
ropLxS(LSS, &cpu_state.seg_ss)
// clang-format on
uint32_t
ropCLC(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc)

View File

@@ -16,27 +16,28 @@
#include "codegen_ops_mmx_arith.h"
#include "codegen_ops_helpers.h"
#define ropParith(func) \
uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
int dest_reg = (fetchdat >> 3) & 7; \
\
uop_MMX_ENTER(ir); \
codegen_mark_code_present(block, cs + op_pc, 1); \
if ((fetchdat & 0xc0) == 0xc0) { \
int src_reg = fetchdat & 7; \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_MM(src_reg)); \
} else { \
x86seg *target_seg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_Q, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_temp0_Q); \
} \
\
return op_pc + 1; \
#define ropParith(func) \
uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
int dest_reg = (fetchdat >> 3) & 7; \
\
uop_MMX_ENTER(ir); \
codegen_mark_code_present(block, cs + op_pc, 1); \
if ((fetchdat & 0xc0) == 0xc0) { \
int src_reg = fetchdat & 7; \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_MM(src_reg)); \
} else { \
x86seg *target_seg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_Q, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_temp0_Q); \
} \
\
return op_pc + 1; \
}
// clang-format off

View File

@@ -16,27 +16,28 @@
#include "codegen_ops_mmx_cmp.h"
#include "codegen_ops_helpers.h"
#define ropPcmp(func) \
uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
int dest_reg = (fetchdat >> 3) & 7; \
\
uop_MMX_ENTER(ir); \
codegen_mark_code_present(block, cs + op_pc, 1); \
if ((fetchdat & 0xc0) == 0xc0) { \
int src_reg = fetchdat & 7; \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_MM(src_reg)); \
} else { \
x86seg *target_seg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_Q, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_temp0_Q); \
} \
\
return op_pc + 1; \
#define ropPcmp(func) \
uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
int dest_reg = (fetchdat >> 3) & 7; \
\
uop_MMX_ENTER(ir); \
codegen_mark_code_present(block, cs + op_pc, 1); \
if ((fetchdat & 0xc0) == 0xc0) { \
int src_reg = fetchdat & 7; \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_MM(src_reg)); \
} else { \
x86seg *target_seg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_Q, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_temp0_Q); \
} \
\
return op_pc + 1; \
}
// clang-format off

View File

@@ -16,27 +16,28 @@
#include "codegen_ops_mmx_pack.h"
#include "codegen_ops_helpers.h"
#define ropPpack(func) \
uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
int dest_reg = (fetchdat >> 3) & 7; \
\
uop_MMX_ENTER(ir); \
codegen_mark_code_present(block, cs + op_pc, 1); \
if ((fetchdat & 0xc0) == 0xc0) { \
int src_reg = fetchdat & 7; \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_MM(src_reg)); \
} else { \
x86seg *target_seg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_Q, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_temp0_Q); \
} \
\
return op_pc + 1; \
#define ropPpack(func) \
uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), \
uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \
{ \
int dest_reg = (fetchdat >> 3) & 7; \
\
uop_MMX_ENTER(ir); \
codegen_mark_code_present(block, cs + op_pc, 1); \
if ((fetchdat & 0xc0) == 0xc0) { \
int src_reg = fetchdat & 7; \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_MM(src_reg)); \
} else { \
x86seg *target_seg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
target_seg = codegen_generate_ea(ir, op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32, 0); \
codegen_check_seg_read(block, ir, target_seg); \
uop_MEM_LOAD_REG(ir, IREG_temp0_Q, ireg_seg_base(target_seg), IREG_eaaddr); \
uop_##func(ir, IREG_MM(dest_reg), IREG_MM(dest_reg), IREG_temp0_Q); \
} \
\
return op_pc + 1; \
}
// clang-format off

View File

@@ -196,61 +196,65 @@ ropPOP_L(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet
return op_pc + 1;
}
#define ROP_PUSH_SEG(seg) \
uint32_t ropPUSH_##seg##_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
int sp_reg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
sp_reg = LOAD_SP_WITH_OFFSET(ir, -2); \
uop_MEM_STORE_REG(ir, IREG_SS_base, sp_reg, IREG_##seg##_seg_W); \
SUB_SP(ir, 2); \
\
return op_pc; \
} \
uint32_t ropPUSH_##seg##_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
int sp_reg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
sp_reg = LOAD_SP_WITH_OFFSET(ir, -4); \
uop_MOVZX(ir, IREG_temp0, IREG_##seg##_seg_W); \
uop_MEM_STORE_REG(ir, IREG_SS_base, sp_reg, IREG_temp0); \
SUB_SP(ir, 4); \
\
return op_pc; \
#define ROP_PUSH_SEG(seg) \
uint32_t ropPUSH_##seg##_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), \
UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
int sp_reg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
sp_reg = LOAD_SP_WITH_OFFSET(ir, -2); \
uop_MEM_STORE_REG(ir, IREG_SS_base, sp_reg, IREG_##seg##_seg_W); \
SUB_SP(ir, 2); \
\
return op_pc; \
} \
uint32_t ropPUSH_##seg##_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), \
UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
int sp_reg; \
\
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
sp_reg = LOAD_SP_WITH_OFFSET(ir, -4); \
uop_MOVZX(ir, IREG_temp0, IREG_##seg##_seg_W); \
uop_MEM_STORE_REG(ir, IREG_SS_base, sp_reg, IREG_temp0); \
SUB_SP(ir, 4); \
\
return op_pc; \
}
#define ROP_POP_SEG(seg, rseg) \
uint32_t ropPOP_##seg##_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
\
if (stack32) \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, IREG_SS_base, IREG_ESP); \
else { \
uop_MOVZX(ir, IREG_eaaddr, IREG_SP); \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, IREG_SS_base, IREG_eaaddr); \
} \
uop_LOAD_SEG(ir, &rseg, IREG_temp0_W); \
ADD_SP(ir, 2); \
\
return op_pc; \
} \
uint32_t ropPOP_##seg##_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
\
if (stack32) \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, IREG_SS_base, IREG_ESP); \
else { \
uop_MOVZX(ir, IREG_eaaddr, IREG_SP); \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, IREG_SS_base, IREG_eaaddr); \
} \
uop_LOAD_SEG(ir, &rseg, IREG_temp0_W); \
ADD_SP(ir, 4); \
\
return op_pc; \
#define ROP_POP_SEG(seg, rseg) \
uint32_t ropPOP_##seg##_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), \
UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
\
if (stack32) \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, IREG_SS_base, IREG_ESP); \
else { \
uop_MOVZX(ir, IREG_eaaddr, IREG_SP); \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, IREG_SS_base, IREG_eaaddr); \
} \
uop_LOAD_SEG(ir, &rseg, IREG_temp0_W); \
ADD_SP(ir, 2); \
\
return op_pc; \
} \
uint32_t ropPOP_##seg##_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), \
UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \
{ \
uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \
\
if (stack32) \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, IREG_SS_base, IREG_ESP); \
else { \
uop_MOVZX(ir, IREG_eaaddr, IREG_SP); \
uop_MEM_LOAD_REG(ir, IREG_temp0_W, IREG_SS_base, IREG_eaaddr); \
} \
uop_LOAD_SEG(ir, &rseg, IREG_temp0_W); \
ADD_SP(ir, 4); \
\
return op_pc; \
}
// clang-format off

View File

@@ -741,7 +741,7 @@ setadc8(uint8_t a, uint8_t b)
cpu_state.flags |= C_FLAG;
if (!((a ^ b) & 0x80) && ((a ^ c) & 0x80))
cpu_state.flags |= V_FLAG;
if (((a & 0xF) + (b & 0xF)) & 0x10)
if (((a & 0xF) + (b & 0xF) + tempc) & 0x10)
cpu_state.flags |= A_FLAG;
}
static __inline void
@@ -755,7 +755,7 @@ setadc16(uint16_t a, uint16_t b)
cpu_state.flags |= C_FLAG;
if (!((a ^ b) & 0x8000) && ((a ^ c) & 0x8000))
cpu_state.flags |= V_FLAG;
if (((a & 0xF) + (b & 0xF)) & 0x10)
if (((a & 0xF) + (b & 0xF) + tempc) & 0x10)
cpu_state.flags |= A_FLAG;
}
static __inline void
@@ -785,7 +785,7 @@ setsbc8(uint8_t a, uint8_t b)
cpu_state.flags |= C_FLAG;
if ((a ^ b) & (a ^ c) & 0x80)
cpu_state.flags |= V_FLAG;
if (((a & 0xF) - (b & 0xF)) & 0x10)
if (((a & 0xF) - ((b & 0xF) + tempc)) & 0x10)
cpu_state.flags |= A_FLAG;
}
static __inline void
@@ -800,7 +800,7 @@ setsbc16(uint16_t a, uint16_t b)
cpu_state.flags |= C_FLAG;
if ((a ^ b) & (a ^ c) & 0x8000)
cpu_state.flags |= V_FLAG;
if (((a & 0xF) - (b & 0xF)) & 0x10)
if (((a & 0xF) - ((b & 0xF) + tempc)) & 0x10)
cpu_state.flags |= A_FLAG;
}

View File

@@ -158,6 +158,13 @@ device_add_common(const device_t *dev, void *p, void *params, int inst)
void *priv = NULL;
int16_t c;
/*
IMPORTANT: This is needed to gracefully handle machine
device addition if the relevant device is NULL.
*/
if (dev == NULL)
return NULL;
if (!device_available(dev)) {
wchar_t temp[512] = { 0 };
swprintf(temp, sizeof_w(temp),
@@ -883,7 +890,7 @@ machine_get_config_string(char *str)
return NULL;
}
const device_t*
const device_t *
device_context_get_device(void)
{
return device_current.dev;

View File

@@ -13,48 +13,49 @@
#
# Copyright 2020-2021 David Hrdlička.
# Copyright 2021 Andreas J. Reichel.
# Copyright 2021-2024 Jasmine Iwanek.
# Copyright 2021-2025 Jasmine Iwanek.
#
add_library(dev OBJECT
access_bus.c
bugger.c
cassette.c
cartridge.c
cassette.c
clock_ics9xxx.c
hasp.c
hwm.c
hwm_gl518sm.c
hwm_lm75.c
hwm_lm78.c
hwm_gl518sm.c
hwm_vt82c686.c
i2c.c
i2c_gpio.c
ibm_5161.c
isamem.c
isartc.c
../lpt.c
pci_bridge.c
postcard.c
serial.c
unittester.c
clock_ics9xxx.c
isapnp.c
i2c.c
i2c_gpio.c
smbus_piix4.c
smbus_ali7101.c
smbus_sis5595.c
keyboard.c
keyboard_xt.c
kbc_at.c
kbc_at_dev.c
keyboard.c
keyboard_at.c
keyboard_xt.c
../lpt.c
mouse.c
mouse_bus.c
mouse_serial.c
mouse_ps2.c
nec_mate_unk.c
phoenix_486_jumper.c
serial_passthrough.c
novell_cardkey.c
mouse_microtouch_touchscreen.c
mouse_ps2.c
mouse_serial.c
nec_mate_unk.c
novell_cardkey.c
pci_bridge.c
phoenix_486_jumper.c
postcard.c
serial.c
serial_passthrough.c
smbus_ali7101.c
smbus_piix4.c
smbus_sis5595.c
unittester.c
)
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT MSVC)

122
src/device/access_bus.c Normal file
View File

@@ -0,0 +1,122 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Implementation of the ACCESS.bus.
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2024-2025 Miran Grca.
*/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <86box/86box.h>
#include <86box/io.h>
#include <86box/device.h>
#include <86box/access_bus.h>
#include <86box/plat_unused.h>
static uint8_t
access_bus_in(uint16_t port, void *priv)
{
const access_bus_t *dev = (access_bus_t *) priv;
uint8_t ret = 0xff;
switch (port & 3) {
case 0:
ret = (dev->status & 0xbf);
break;
case 1:
ret = (dev->own_addr & 0x7f);
break;
case 2:
ret = dev->data;
break;
case 3:
ret = (dev->clock & 0x87);
break;
default:
break;
}
return ret;
}
static void
access_bus_out(uint16_t port, uint8_t val, void *priv)
{
access_bus_t *dev = (access_bus_t *) priv;
switch (port & 3) {
case 0:
dev->control = (val & 0xcf);
break;
case 1:
dev->own_addr = (val & 0x7f);
break;
case 2:
dev->data = val;
break;
case 3:
dev->clock &= 0x80;
dev->clock |= (val & 0x07);
break;
default:
break;
}
}
void
access_bus_handler(access_bus_t *dev, uint8_t enable, uint16_t base)
{
if (dev->enable && (dev->base >= 0x0100) && (dev->base <= 0x0ffc))
io_removehandler(dev->base, 0x0004,
access_bus_in, NULL, NULL, access_bus_out, NULL, NULL, dev);
dev->enable = enable;
dev->base = base;
if (dev->enable && (dev->base >= 0x0100) && (dev->base <= 0x0ffc))
io_sethandler(dev->base, 0x0004,
access_bus_in, NULL, NULL, access_bus_out, NULL, NULL, dev);
}
static void
access_bus_close(void *priv)
{
access_bus_t *dev = (access_bus_t *) priv;
free(dev);
}
static void *
access_bus_init(UNUSED(const device_t *info))
{
access_bus_t *dev = (access_bus_t *) calloc(1, sizeof(access_bus_t));
return dev;
}
const device_t access_bus_device = {
.name = "ACCESS.bus",
.internal_name = "access_bus",
.flags = 0,
.local = 0,
.init = access_bus_init,
.close = access_bus_close,
.reset = NULL,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};

File diff suppressed because it is too large Load Diff

View File

@@ -631,23 +631,24 @@ static const device_config_t ev170_config[] = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_string = NULL,
.default_int = 0x02C0,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "240H", .value = 0x0240 },
{ .description = "2C0H", .value = 0x02c0 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_string = NULL,
.default_int = -1,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = -1 },
@@ -656,6 +657,7 @@ static const device_config_t ev170_config[] = {
{ .description = "IRQ7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
@@ -681,15 +683,16 @@ static const device_config_t pii147_config[] = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_string = NULL,
.default_int = 0x0240,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Clock 1", .value = 0x0240 },
{ .description = "Clock 2", .value = 0x0340 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
@@ -715,9 +718,9 @@ static const device_config_t p5pak_config[] = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_string = NULL,
.default_int = -1,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", -1 },
@@ -726,6 +729,7 @@ static const device_config_t p5pak_config[] = {
{ .description = "IRQ5", 5 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
@@ -751,9 +755,9 @@ static const device_config_t a6pak_config[] = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_string = NULL,
.default_int = -1,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = -1 },
@@ -762,6 +766,7 @@ static const device_config_t a6pak_config[] = {
{ .description = "IRQ5", .value = 5 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
@@ -787,42 +792,44 @@ static const device_config_t mm58167_config[] = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_string = NULL,
.default_int = 0x02C0,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ "240H", 0x0240 },
{ "2C0H", 0x02c0 },
{ "340H", 0x0340 },
{ "" }
{ .description = "240H", .value = 0x0240 },
{ .description = "2C0H", .value = 0x02c0 },
{ .description = "340H", .value = 0x0340 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_string = NULL,
.default_int = -1,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ "Disabled", -1 },
{ "IRQ2", 2 },
{ "IRQ5", 5 },
{ "IRQ7", 7 },
{ "" }
{ .description = "Disabled", .value = -1 },
{ .description = "IRQ2", .value = 2 },
{ .description = "IRQ5", .value = 5 },
{ .description = "IRQ7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xcc000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xcc000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = -1 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CA00H", .value = 0xca000 },
@@ -846,6 +853,7 @@ static const device_config_t mm58167_config[] = {
{ .description = "EE00H", .value = 0xee000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -2187,14 +2187,14 @@ keyboard_at_close(void *priv)
static const device_config_t keyboard_at_config[] = {
// clang-format off
{
.name = "type",
.description = "Type",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 1,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "type",
.description = "Type",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 1,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "AT 84-key", .value = FLAG_AT | KBD_84_KEY },
{ .description = "AT 101/102/106-key", .value = FLAG_AT | KBD_101_KEY },
{ .description = "AT Korean", .value = FLAG_AT | KBD_KOREAN },
@@ -2203,7 +2203,8 @@ static const device_config_t keyboard_at_config[] = {
{ .description = "PS/2 106-key JIS", .value = FLAG_PS2 | KBD_JIS },
{ .description = "PS/2 Korean", .value = FLAG_PS2 | KBD_KOREAN },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "", .description = "", .type = CONFIG_END
@@ -2220,7 +2221,7 @@ const device_t keyboard_at_generic_device = {
.init = keyboard_at_init,
.close = keyboard_at_close,
.reset = NULL,
{ .poll = NULL },
.poll = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = keyboard_at_config

View File

@@ -686,66 +686,70 @@ bm_init(const device_t *info)
static const device_config_t lt_config[] = {
// clang-format off
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x23c,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x23c,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x230", .value = 0x230 },
{ .description = "0x234", .value = 0x234 },
{ .description = "0x238", .value = 0x238 },
{ .description = "0x23C", .value = 0x23c },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "hz",
.description = "Hz",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 45,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "hz",
.description = "Hz",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 45,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Non-timed (original)", .value = 0 },
{ .description = "30 Hz (JMP2 = 1)", .value = 30 },
{ .description = "45 Hz (JMP2 not populated)", .value = 45 },
{ .description = "60 Hz (JMP2 = 2)", .value = 60 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 2,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 2,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Two", .value = 2 },
{ .description = "Three", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
@@ -754,50 +758,53 @@ static const device_config_t lt_config[] = {
static const device_config_t ms_config[] = {
// clang-format off
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x23c,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x23c,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x230", .value = 0x230 },
{ .description = "0x234", .value = 0x234 },
{ .description = "0x238", .value = 0x238 },
{ .description = "0x23C", .value = 0x23c },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 2,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 2,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Two", .value = 2 },
{ .description = "Three", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -549,42 +549,49 @@ mtouch_close(void *priv)
static const device_config_t mtouch_config[] = {
// clang-format off
{
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "COM1", .value = 0 },
{ .description = "COM2", .value = 1 },
{ .description = "COM3", .value = 2 },
{ .description = "COM4", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "identity",
.description = "Controller",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "A3 - SMT2 Serial / SMT3(R)V", .value = 0 },
{ .description = "A4 - SMT2 PCBus", .value = 1 },
{ .description = "P5 - TouchPen 4(+)", .value = 2 },
{ .description = "Q1 - SMT3(R) Serial", .value = 3 }
}
.name = "identity",
.description = "Controller",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "A3 - SMT2 Serial / SMT3(R)V", .value = 0 },
{ .description = "A4 - SMT2 PCBus", .value = 1 },
{ .description = "P5 - TouchPen 4(+)", .value = 2 },
{ .description = "Q1 - SMT3(R) Serial", .value = 3 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "crosshair",
.description = "Show Crosshair",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
.name = "crosshair",
.description = "Show Crosshair",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -367,20 +367,21 @@ ps2_close(void *priv)
static const device_config_t ps2_config[] = {
// clang-format off
{
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 2,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 2,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Two", .value = 2 },
{ .description = "Three", .value = 3 },
{ .description = "Wheel", .value = 4 },
{ .description = "Five + Wheel", .value = 5 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "", .description = "", .type = CONFIG_END

View File

@@ -916,41 +916,47 @@ sermouse_init(const device_t *info)
static const device_config_t msssermouse_config[] = {
// clang-format off
{
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "COM1", .value = 0 },
{ .description = "COM2", .value = 1 },
{ .description = "COM3", .value = 2 },
{ .description = "COM4", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 2,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 2,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Two", .value = 2 },
{ .description = "Three", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "rts_toggle",
.description = "RTS toggle",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.name = "rts_toggle",
.description = "RTS toggle",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
@@ -959,35 +965,37 @@ static const device_config_t msssermouse_config[] = {
static const device_config_t mssermouse_config[] = {
// clang-format off
{
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "COM1", .value = 0 },
{ .description = "COM2", .value = 1 },
{ .description = "COM3", .value = 2 },
{ .description = "COM4", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 2,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 2,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Two", .value = 2 },
{ .description = "Three", .value = 3 },
{ .description = "Wheel", .value = 4 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
@@ -996,57 +1004,64 @@ static const device_config_t mssermouse_config[] = {
static const device_config_t ltsermouse_config[] = {
// clang-format off
{
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "COM1", .value = 0 },
{ .description = "COM2", .value = 1 },
{ .description = "COM3", .value = 2 },
{ .description = "COM4", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 2,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 2,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Two", .value = 2 },
{ .description = "Three", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "revision",
.description = "Revision",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "revision",
.description = "Revision",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "LOGIMOUSE R7 1.0", .value = 1 },
{ .description = "LOGIMOUSE R7 2.0", .value = 2 },
{ .description = "LOGIMOUSE C7 3.0", .value = 3 },
{ .description = "Logitech MouseMan", .value = 4 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "rts_toggle",
.description = "RTS toggle",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.name = "rts_toggle",
.description = "RTS toggle",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -693,20 +693,21 @@ wacom_close(void *priv)
static const device_config_t wacom_config[] = {
// clang-format off
{
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "COM1", .value = 0 },
{ .description = "COM2", .value = 1 },
{ .description = "COM3", .value = 2 },
{ .description = "COM4", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -27,8 +27,7 @@
#include <86box/plat.h>
#include <86box/novell_cardkey.h>
typedef struct novell_cardkey_t
{
typedef struct novell_cardkey_t {
char serial_number_str[13];
} novell_cardkey_t;
@@ -95,14 +94,15 @@ void novell_cardkey_close(void* priv)
static const device_config_t keycard_config[] = {
// clang-format off
{
.name = "serial_number",
.description = "Serial Number",
.type = CONFIG_STRING,
.name = "serial_number",
.description = "Serial Number",
.type = CONFIG_STRING,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = { { 0 } }
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -15,7 +15,7 @@
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016-2020 Miran Grca.
* Copyright 2016-2025 Miran Grca.
* Copyright 2017-2020 Fred N. van Kempen.
*/
#include <stdarg.h>
@@ -782,6 +782,20 @@ serial_setup(serial_t *dev, uint16_t addr, uint8_t irq)
dev->irq = irq;
}
void
serial_irq(serial_t *dev, const uint8_t irq)
{
if (dev == NULL)
return;
if (com_ports[dev->inst].enabled)
dev->irq = irq;
else
dev->irq = 0xff;
serial_log("Port %i IRQ = %02X\n", dev->inst, irq);
}
static void
serial_rcvr_d_empty_evt(void *priv)
{

View File

@@ -231,138 +231,129 @@ const char *serpt_mode_names[SERPT_MODES_MAX] = {
// clang-format off
static const device_config_t serial_passthrough_config[] = {
{
.name = "mode",
.description = "Passthrough Mode",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "mode",
.description = "Passthrough Mode",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
#ifdef _WIN32
{
.description = "Named Pipe (Server)",
.value = SERPT_MODE_VCON
},
{ .description = "Named Pipe (Server)", .value = SERPT_MODE_VCON },
#if 0 /* TODO */
{
.description = "Named Pipe (Client)",
.value = SERPT_MODE_VCON
},
#endif
#else
{
.description = "Pseudo Terminal/Virtual Console",
.value = SERPT_MODE_VCON
},
{ .description = "Named Pipe (Client)", .value = SERPT_MODE_VCON },
#endif
#else /* _WIN32 */
{ .description = "Pseudo Terminal/Virtual Console", .value = SERPT_MODE_VCON },
#endif /* _WIN32 */
#if 0 /* TODO */
{
.description = "TCP Server",
.value = SERPT_MODE_TCPSRV
},
{
.description = "TCP Client",
.value = SERPT_MODE_TCPCLNT
},
{ .description = "TCP Server", .value = SERPT_MODE_TCPSRV },
{ .description = "TCP Client", .value = SERPT_MODE_TCPCLNT },
#endif
{
.description = "Host Serial Passthrough",
.value = SERPT_MODE_HOSTSER
},
{
.description = ""
}
}
{ .description = "Host Serial Passthrough", .value = SERPT_MODE_HOSTSER },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "host_serial_path",
.description = "Host Serial Device",
.type = CONFIG_SERPORT,
.default_string = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } }
.name = "host_serial_path",
.description = "Host Serial Device",
.type = CONFIG_SERPORT,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
#ifdef _WIN32
{
.name = "named_pipe",
.description = "Name of pipe",
.type = CONFIG_STRING,
.name = "named_pipe",
.description = "Name of pipe",
.type = CONFIG_STRING,
.default_string = "\\\\.\\pipe\\86Box\\test",
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } }
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
#endif
#endif /* _WIN32 */
{
.name = "data_bits",
.description = "Data bits",
.type = CONFIG_SELECTION,
.default_string = "8",
.default_int = 8,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
.name = "data_bits",
.description = "Data bits",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 8,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
#if 0 /* Mentioned by WFW 3.1x, not supported, atleast on Linux */
{ .description = "4", .value = 4 },
#endif
{ .description = "5", .value = 5 },
{ .description = "6", .value = 6 },
{ .description = "7", .value = 7 },
{ .description = "8", .value = 8 }
}
{ .description = "8", .value = 8 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "stop_bits",
.description = "Stop bits",
.type = CONFIG_SELECTION,
.default_string = "1",
.default_int = 1,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
.name = "stop_bits",
.description = "Stop bits",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 1,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "1", .value = 1 },
#if 0
{ .description = "1.5", .value = 1.5 },
#endif
{ .description = "2", .value = 2 }
}
{ .description = "2", .value = 2 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "baudrate",
.description = "Baud Rate of Passthrough",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 115200,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
.name = "baudrate",
.description = "Baud Rate of Passthrough",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 115200,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
#if 0
{ .description = "256000", .value = 256000 },
{ .description = "128000", .value = 128000 },
{ .description = "256000", .value = 256000 },
{ .description = "128000", .value = 128000 },
#endif
{ .description = "115200", .value = 115200 },
{ .description = "57600", .value = 57600 },
{ .description = "56000", .value = 56000 },
{ .description = "38400", .value = 38400 },
{ .description = "19200", .value = 19200 },
{ .description = "14400", .value = 14400 },
{ .description = "9600", .value = 9600 },
{ .description = "7200", .value = 7200 },
{ .description = "4800", .value = 4800 },
{ .description = "2400", .value = 2400 },
{ .description = "1800", .value = 1800 },
{ .description = "1200", .value = 1200 },
{ .description = "600", .value = 600 },
{ .description = "300", .value = 300 },
{ .description = "150", .value = 150 },
{ .description = "115200", .value = 115200 },
{ .description = "57600", .value = 57600 },
{ .description = "56000", .value = 56000 },
{ .description = "38400", .value = 38400 },
{ .description = "19200", .value = 19200 },
{ .description = "14400", .value = 14400 },
{ .description = "9600", .value = 9600 },
{ .description = "7200", .value = 7200 },
{ .description = "4800", .value = 4800 },
{ .description = "2400", .value = 2400 },
{ .description = "1800", .value = 1800 },
{ .description = "1200", .value = 1200 },
{ .description = "600", .value = 600 },
{ .description = "300", .value = 300 },
{ .description = "150", .value = 150 },
#if 0
{ .description = "134.5", .value = 134.5 },
#endif
{ .description = "110", .value = 110 },
{ .description = "75", .value = 75 }
}
{ .description = "110", .value = 110 },
{ .description = "75", .value = 75 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -114,19 +114,6 @@ static struct unittester_state unittester_defaults = {
.cmd_id = UT_CMD_NOOP,
};
static const device_config_t unittester_config[] = {
// clang-format off
{
.name = "exit_enabled",
.description = "Enable 0x04 \"Exit 86Box\" command",
.type = CONFIG_BINARY,
.default_int = 1,
.default_string = ""
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};
/* Kept separate, as we will be reusing this object */
static bitmap_t *unittester_screen_buffer = NULL;
@@ -624,6 +611,23 @@ unittester_close(UNUSED(void *priv))
unittester_log("[UT] 86Box Unit Tester closed\n");
}
static const device_config_t unittester_config[] = {
// clang-format off
{
.name = "exit_enabled",
.description = "Enable 0x04 \"Exit 86Box\" command",
.type = CONFIG_BINARY,
.default_int = 1,
.default_string = NULL,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};
const device_t unittester_device = {
.name = "86Box Unit Tester",
.internal_name = "unittester",

View File

@@ -2902,6 +2902,25 @@ ide_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv)
}
}
static void *
ide_sec_init(const device_t *info)
{
/* Don't claim this channel again if it was already claimed. */
if (ide_boards[1])
return (NULL);
ide_board_init(1, HDC_SECONDARY_IRQ, HDC_SECONDARY_BASE, HDC_SECONDARY_SIDE, info->local, info->flags);
return (ide_boards[1]);
}
/* Close a standalone IDE unit. */
static void
ide_sec_close(UNUSED(void *priv))
{
ide_board_close(1);
}
static void *
ide_ter_init(const device_t *info)
{
@@ -2920,9 +2939,8 @@ ide_ter_init(const device_t *info)
if (irq == -1)
isapnp_add_card(ide_ter_pnp_rom, sizeof(ide_ter_pnp_rom),
ide_pnp_config_changed, NULL, NULL, NULL, (void *) 2);
} else {
} else
ide_board_init(2, irq, HDC_TERTIARY_BASE, HDC_TERTIARY_SIDE, 0, 0);
}
return (ide_boards[2]);
}
@@ -3004,10 +3022,10 @@ ide_init(const device_t *info)
switch (info->local) {
case 0 ... 5:
ide_board_init(0, 14, 0x1f0, 0x3f6, info->local, info->flags);
ide_board_init(0, HDC_PRIMARY_IRQ, HDC_PRIMARY_BASE, HDC_PRIMARY_SIDE, info->local, info->flags);
if (info->local & 1)
ide_board_init(1, 15, 0x170, 0x376, info->local, info->flags);
ide_board_init(1, HDC_SECONDARY_IRQ, HDC_SECONDARY_BASE, HDC_SECONDARY_SIDE, info->local, info->flags);
break;
default:
@@ -3122,8 +3140,8 @@ static void
mcide_mca_write(const int port, const uint8_t val, void *priv)
{
mcide_t *dev = (mcide_t *) priv;
uint16_t bases[4] = { 0x01f0, 0x0170, 0x01e8, 0x0168 };
int irqs[4] = { 10, 11, 14, 15 };
uint16_t bases[4] = { HDC_PRIMARY_BASE, HDC_SECONDARY_BASE, HDC_TERTIARY_BASE, HDC_QUATERNARY_BASE };
int irqs[4] = { HDC_QUATERNARY_IRQ, HDC_TERTIARY_IRQ, HDC_PRIMARY_IRQ, HDC_SECONDARY_IRQ };
if ((port >= 0x102) && (dev->pos_regs[port & 7] != val)) {
ide_log("IDE: mcawr(%04x, %02x) pos[2]=%02x pos[3]=%02x\n",
@@ -3275,6 +3293,20 @@ const device_t ide_isa_device = {
.config = NULL
};
const device_t ide_isa_sec_device = {
.name = "ISA PC/AT IDE Controller (Secondary)",
.internal_name = "ide_isa_sec",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = ide_sec_init,
.close = ide_sec_close,
.reset = ide_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t ide_isa_2ch_device = {
.name = "ISA PC/AT IDE Controller (Dual-Channel)",
.internal_name = "ide_isa_2ch",
@@ -3303,6 +3335,20 @@ const device_t ide_vlb_device = {
.config = NULL
};
const device_t ide_vlb_sec_device = {
.name = "VLB IDE Controller (Secondary)",
.internal_name = "ide_vlb_sec",
.flags = DEVICE_VLB | DEVICE_AT,
.local = 2,
.init = ide_sec_init,
.close = ide_sec_close,
.reset = ide_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t ide_vlb_2ch_device = {
.name = "VLB IDE Controller (Dual-Channel)",
.internal_name = "ide_vlb_2ch",
@@ -3331,6 +3377,20 @@ const device_t ide_pci_device = {
.config = NULL
};
const device_t ide_pci_sec_device = {
.name = "PCI IDE Controller (Secondary)",
.internal_name = "ide_pci_sec",
.flags = DEVICE_PCI | DEVICE_AT,
.local = 4,
.init = ide_sec_init,
.close = ide_sec_close,
.reset = ide_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t ide_pci_2ch_device = {
.name = "PCI IDE Controller (Dual-Channel)",
.internal_name = "ide_pci_2ch",
@@ -3359,18 +3419,17 @@ const device_t mcide_device = {
.config = NULL
};
// clang-format off
static const device_config_t ide_ter_config[] = {
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = HDC_TERTIARY_IRQ,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = HDC_TERTIARY_IRQ,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Plug and Play", .value = -1 },
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
@@ -3382,21 +3441,22 @@ static const device_config_t ide_ter_config[] = {
{ .description = "IRQ 11", .value = 11 },
{ .description = "IRQ 12", .value = 12 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t ide_qua_config[] = {
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = HDC_QUATERNARY_IRQ,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = HDC_QUATERNARY_IRQ,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Plug and Play", .value = -1 },
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
@@ -3408,7 +3468,8 @@ static const device_config_t ide_qua_config[] = {
{ .description = "IRQ 11", .value = 11 },
{ .description = "IRQ 12", .value = 12 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -10,7 +10,7 @@
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2020 Miran Grca.
* Copyright 2020-2025 Miran Grca.
*/
#include <stdarg.h>
#include <stdint.h>

View File

@@ -1914,335 +1914,356 @@ victor_v86p_available(void)
// clang-format off
static const device_config_t dtc_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xc8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CA00H", .value = 0xca000 },
{ .description = "D800H", .value = 0xd8000 },
{ .description = "F400H", .value = 0xf4000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t st11_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0320,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0320,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "320H", .value = 0x0320 },
{ .description = "324H", .value = 0x0324 },
{ .description = "328H", .value = 0x0328 },
{ .description = "32CH", .value = 0x032c },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xc8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "D000H", .value = 0xd0000 },
{ .description = "D800H", .value = 0xd8000 },
{ .description = "E000H", .value = 0xe0000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "revision",
.description = "BIOS Revision",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 19,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "revision",
.description = "BIOS Revision",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 19,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "v1.7", .value = 5 },
{ .description = "v2.0", .value = 19 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t wd_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xc8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0320,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0320,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "320H", .value = 0x0320 },
{ .description = "324H", .value = 0x0324 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t wd_nobios_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0320,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0320,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "320H", .value = 0x0320 },
{ .description = "324H", .value = 0x0324 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t wd_rll_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xc8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0320,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0320,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "320H", .value = 0x0320 },
{ .description = "324H", .value = 0x0324 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "translate",
.description = "Translate 26 -> 17",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "translate",
.description = "Translate 26 -> 17",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Off", .value = 0 },
{ .description = "On", .value = 1 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t wd1004a_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xc8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0320,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0320,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "320H", .value = 0x0320 },
{ .description = "324H", .value = 0x0324 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t wd1004_rll_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xc8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CA00H", .value = 0xca000 },
{ .description = "CC00H", .value = 0xcc000 },
{ .description = "CE00H", .value = 0xce000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0320,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0320,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "320H", .value = 0x0320 },
{ .description = "324H", .value = 0x0324 },
{ .description = "328H", .value = 0x0328 },
{ .description = "32CH", .value = 0x032c },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "translate",
.description = "Translate 26 -> 17",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "translate",
.description = "Translate 26 -> 17",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Off", .value = 0 },
{ .description = "On", .value = 1 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -1107,60 +1107,77 @@ xta_close(void *priv)
static const device_config_t wdxt150_config[] = {
// clang-format off
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0320,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0320,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "320H", .value = 0x0320 },
{ .description = "324H", .value = 0x0324 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xc8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CA00H", .value = 0xca000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "bios_rev",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.name = "bios_rev",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.default_string = "rev_1",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.bios = {
{ .name = "Revision 1.0", .internal_name = "rev_1", .bios_type = BIOS_NORMAL,
.files_no = 1, .local = 0, .size = 8192, .files = { WD_REV_1_BIOS_FILE, "" } },
{ .name = "Revision 2.0", .internal_name = "rev_2", .bios_type = BIOS_NORMAL,
.files_no = 1, .local = 0, .size = 8192, .files = { WD_REV_2_BIOS_FILE, "" } },
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.bios = {
{
.name = "Revision 1.0",
.internal_name = "rev_1",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 8192,
.files = { WD_REV_1_BIOS_FILE, "" }
},
{
.name = "Revision 2.0",
.internal_name = "rev_2",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 8192,
.files = { WD_REV_2_BIOS_FILE, "" }
},
{ .files_no = 0 }
},
},

View File

@@ -224,18 +224,33 @@ xtide_at_close(void *priv)
static const device_config_t xtide_config[] = {
// clang-format off
{
.name = "bios",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.name = "bios",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.default_string = "xt",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.bios = {
{ .name = "Regular XT", .internal_name = "xt", .bios_type = BIOS_NORMAL,
.files_no = 1, .local = 0, .size = 8192, .files = { ROM_PATH_XT, "" } },
{ .name = "XT+ (V20/V30/8018x)", .internal_name = "xt_plus", .bios_type = BIOS_NORMAL,
.files_no = 1, .local = 0, .size = 8192, .files = { ROM_PATH_XTP, "" } },
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = {
{
.name = "Regular XT",
.internal_name = "xt",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 8192,
.files = { ROM_PATH_XT, "" }
},
{
.name = "XT+ (V20/V30/8018x)",
.internal_name = "xt_plus",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 8192,
.files = { ROM_PATH_XTP, "" }
},
{ .files_no = 0 }
},
},
@@ -246,18 +261,33 @@ static const device_config_t xtide_config[] = {
static const device_config_t xtide_at_config[] = {
// clang-format off
{
.name = "bios",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.name = "bios",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.default_string = "at",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.bios = {
{ .name = "Regular AT", .internal_name = "at", .bios_type = BIOS_NORMAL,
.files_no = 1, .local = 0, .size = 8192, .files = { ROM_PATH_AT, "" } },
{ .name = "386", .internal_name = "at_386", .bios_type = BIOS_NORMAL,
.files_no = 1, .local = 0, .size = 8192, .files = { ROM_PATH_AT_386, "" } },
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = {
{
.name = "Regular AT",
.internal_name = "at",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 8192,
.files = { ROM_PATH_AT, "" }
},
{
.name = "386",
.internal_name = "at_386",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 8192,
.files = { ROM_PATH_AT_386, "" }
},
{ .files_no = 0 }
},
},

View File

@@ -63,22 +63,23 @@ lba_enhancer_available(void)
// clang-format off
static const device_config_t lba_enhancer_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CC00H", .value = 0xcc000 },
{ .description = "D000H", .value = 0xd0000 },
{ .description = "D400H", .value = 0xd4000 },
{ .description = "D800H", .value = 0xd8000 },
{ .description = "DC00H", .value = 0xdc000 },
{ .description = "" }
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xc8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CC00H", .value = 0xcc000 },
{ .description = "D000H", .value = 0xd0000 },
{ .description = "D400H", .value = 0xd4000 },
{ .description = "D800H", .value = 0xd8000 },
{ .description = "DC00H", .value = 0xdc000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -10,7 +10,7 @@
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2023 Miran Grca.
* Copyright 2023-2025 Miran Grca.
*/
#include <stdarg.h>
#include <stdint.h>
@@ -84,6 +84,31 @@ fifo_write(uint8_t val, void *priv)
}
}
void
fifo_write_tagged(uint8_t tag, uint8_t val, void *priv)
{
fifo_t *fifo = (fifo_t *) priv;
fifo->d_full = fifo->d_empty = 0;
fifo->d_ready = fifo->d_overrun = 0;
if (fifo->full)
fifo->overrun = 1;
else {
fifo->buf[fifo->end] = val;
fifo->tag[fifo->end] = tag;
fifo->end = (fifo->end + 1) % fifo->len;
if (fifo->end == fifo->start)
fifo->full = 1;
fifo->empty = 0;
if (fifo_get_count(fifo) >= fifo->trigger_len)
fifo->ready = 1;
}
}
void
fifo_write_evt(uint8_t val, void *priv)
{
@@ -122,6 +147,45 @@ fifo_write_evt(uint8_t val, void *priv)
}
}
void
fifo_write_evt_tagged(uint8_t tag, uint8_t val, void *priv)
{
fifo_t *fifo = (fifo_t *) priv;
fifo->d_full = fifo->d_empty = 0;
fifo->d_ready = fifo->d_overrun = 0;
if (fifo->full) {
fifo->d_overrun = (fifo->overrun != 1);
fifo->overrun = 1;
if (fifo->d_overrun && (fifo->d_overrun_evt != NULL))
fifo->d_overrun_evt(fifo->priv);
} else {
fifo->buf[fifo->end] = val;
fifo->tag[fifo->end] = tag;
fifo->end = (fifo->end + 1) % fifo->len;
if (fifo->end == fifo->start) {
fifo->d_full = (fifo->full != 1);
fifo->full = 1;
if (fifo->d_full && (fifo->d_full_evt != NULL))
fifo->d_full_evt(fifo->priv);
}
fifo->d_empty = (fifo->empty != 0);
fifo->empty = 0;
if (fifo->d_empty && (fifo->d_empty_evt != NULL))
fifo->d_empty_evt(fifo->priv);
if (fifo_get_count(fifo) >= fifo->trigger_len) {
fifo->d_ready = (fifo->ready != 1);
fifo->ready = 1;
if (fifo->d_ready && (fifo->d_ready_evt != NULL))
fifo->d_ready_evt(fifo->priv);
}
}
}
uint8_t
fifo_read(void *priv)
{
@@ -148,6 +212,35 @@ fifo_read(void *priv)
return ret;
}
uint8_t
fifo_read_tagged(uint8_t *tag, void *priv)
{
fifo_t *fifo = (fifo_t *) priv;
uint8_t ret = 0x00;
int count;
if (!fifo->empty) {
ret = fifo->buf[fifo->start];
*tag = fifo->tag[fifo->start];
fifo->start = (fifo->start + 1) % fifo->len;
fifo->full = 0;
count = fifo_get_count(fifo);
if (count < fifo->trigger_len) {
fifo->ready = 0;
if (count == 0)
fifo->empty = 1;
}
} else
*tag = 0x00;
return ret;
}
uint8_t
fifo_read_evt(void *priv)
{
@@ -187,6 +280,48 @@ fifo_read_evt(void *priv)
return ret;
}
uint8_t
fifo_read_evt_tagged(uint8_t *tag, void *priv)
{
fifo_t *fifo = (fifo_t *) priv;
uint8_t ret = 0x00;
int count;
fifo->d_full = fifo->d_empty = 0;
fifo->d_ready = 0;
if (!fifo->empty) {
ret = fifo->buf[fifo->start];
*tag = fifo->tag[fifo->start];
fifo->start = (fifo->start + 1) % fifo->len;
fifo->d_full = (fifo->full != 0);
fifo->full = 0;
if (fifo->d_full && (fifo->d_full_evt != NULL))
fifo->d_full_evt(fifo->priv);
count = fifo_get_count(fifo);
if (count < fifo->trigger_len) {
fifo->d_ready = (fifo->ready != 0);
fifo->ready = 0;
if (fifo->d_ready && (fifo->d_ready_evt != NULL))
fifo->d_ready_evt(fifo->priv);
if (count == 0) {
fifo->d_empty = (fifo->empty != 1);
fifo->empty = 1;
if (fifo->d_empty && (fifo->d_empty_evt != NULL))
fifo->d_empty_evt(fifo->priv);
}
}
} else
*tag = 0x00;
return ret;
}
void
fifo_clear_overrun(void *priv)
{

View File

@@ -157,9 +157,9 @@ static const device_config_t compaticard_i_config[] = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_string = NULL,
.default_int = 0x3f0,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x3f0", .value = 0x3f0 },
@@ -167,7 +167,8 @@ static const device_config_t compaticard_i_config[] = {
{ .description = "0x360", .value = 0x360 },
{ .description = "0x3e0", .value = 0x3e0 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
@@ -179,9 +180,9 @@ static const device_config_t compaticard_ii_config[] = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_string = NULL,
.default_int = 0x3f0,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x3f0", .value = 0x3f0 },
@@ -189,15 +190,16 @@ static const device_config_t compaticard_ii_config[] = {
{ .description = "0x360", .value = 0x360 },
{ .description = "0x3e0", .value = 0x3e0 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_string = NULL,
.default_int = 6,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
@@ -207,22 +209,24 @@ static const device_config_t compaticard_ii_config[] = {
{ .description = "IRQ 6", .value = 6 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "dma",
.description = "DMA channel",
.type = CONFIG_SELECTION,
.default_string = "",
.default_string = NULL,
.default_int = 2,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DMA 1", .value = 1 },
{ .description = "DMA 2", .value = 2 },
{ .description = "DMA 3", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
@@ -234,9 +238,9 @@ static const device_config_t compaticard_iv_config[] = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_string = NULL,
.default_int = 0x3f0,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x3f0", .value = 0x3f0 },
@@ -244,15 +248,16 @@ static const device_config_t compaticard_iv_config[] = {
{ .description = "0x360", .value = 0x360 },
{ .description = "0x3e0", .value = 0x3e0 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_string = NULL,
.default_int = 6,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
@@ -262,30 +267,32 @@ static const device_config_t compaticard_iv_config[] = {
{ .description = "IRQ 6", .value = 6 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "dma",
.description = "DMA channel",
.type = CONFIG_SELECTION,
.default_string = "",
.default_string = NULL,
.default_int = 2,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DMA 1", .value = 1 },
{ .description = "DMA 2", .value = 2 },
{ .description = "DMA 3", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address:",
.type = CONFIG_HEX20,
.default_string = "",
.default_string = NULL,
.default_int = 0xce000,
.file_filter = "",
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0 },
@@ -298,15 +305,20 @@ static const device_config_t compaticard_iv_config[] = {
{ .description = "E800H", .value = 0xe8000 },
{ .description = "EE00H", .value = 0xee000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
#if 0
{
.name = "autoboot_enabled",
.description = "Enable Autoboot",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
#endif
{ .name = "", .description = "", .type = CONFIG_END }

View File

@@ -109,18 +109,19 @@ b215_available(void)
static const device_config_t b215_config[] = {
// clang-format off
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xca000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xca000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "CA00H", .value = 0xca000 },
{ .description = "CC00H", .value = 0xcc000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -165,82 +165,61 @@ static const device_config_t monster_fdc_config[] = {
// clang-format off
#if 0
{
.name = "sec_enabled",
.description = "Enable Secondary Controller",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.name = "sec_enabled",
.description = "Enable Secondary Controller",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "sec_irq",
.description = "Secondary Controller IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 6,
.file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "IRQ 2",
.value = 2
},
{
.description = "IRQ 3",
.value = 3
},
{
.description = "IRQ 4",
.value = 4
},
{
.description = "IRQ 5",
.value = 5
},
{
.description = "IRQ 6",
.value = 6
},
{
.description = "IRQ 7",
.value = 7
},
{ .description = "" }
}
.name = "sec_irq",
.description = "Secondary Controller IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 6,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 6", .value = 6 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "sec_dma",
.description = "Secondary Controller DMA",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 2,
.file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "DMA 1",
.value = 1
},
{
.description = "DMA 2",
.value = 2
},
{
.description = "DMA 3",
.value = 3
},
{ .description = "" }
}
.name = "sec_dma",
.description = "Secondary Controller DMA",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 2,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DMA 1", .value = 1 },
{ .description = "DMA 2", .value = 2 },
{ .description = "DMA 3", .value = 3 },
{ .description = "" }
},
.bios = { { 0 } }
},
#endif
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xc8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0 },
{ .description = "C000H", .value = 0xc0000 },
{ .description = "C800H", .value = 0xc8000 },
@@ -249,30 +228,36 @@ static const device_config_t monster_fdc_config[] = {
{ .description = "E000H", .value = 0xe0000 },
{ .description = "E800H", .value = 0xe8000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
#if 0
{
.name = "bios_size",
.description = "BIOS Size:",
.type = CONFIG_HEX20,
.default_string = "32",
.default_int = 0xc8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_size",
.description = "BIOS Size:",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 32,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "8K", .value = 8 },
{ .description = "32K", .value = 32 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
#endif
{
.name = "rom_writes_enabled",
.description = "Enable BIOS extension ROM Writes",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.name = "rom_writes_enabled",
.description = "Enable BIOS extension ROM Writes",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -122,20 +122,21 @@ pii_158_available(void)
static const device_config_t pii_config[] = {
// clang-format off
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xce000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xce000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0 },
{ .description = "CA00H", .value = 0xca000 },
{ .description = "CC00H", .value = 0xcc000 },
{ .description = "CE00H", .value = 0xce000 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -88,18 +88,18 @@ static const joystick_if_t joystick_none = {
static const struct {
const joystick_if_t *joystick;
} joysticks[] = {
{ &joystick_none },
{ &joystick_2axis_2button },
{ &joystick_2axis_4button },
{ &joystick_2axis_6button },
{ &joystick_2axis_8button },
{ &joystick_3axis_2button },
{ &joystick_3axis_4button },
{ &joystick_4axis_4button },
{ &joystick_none },
{ &joystick_2axis_2button },
{ &joystick_2axis_4button },
{ &joystick_2axis_6button },
{ &joystick_2axis_8button },
{ &joystick_3axis_2button },
{ &joystick_3axis_4button },
{ &joystick_4axis_4button },
{ &joystick_ch_flightstick_pro },
{ &joystick_sw_pad },
{ &joystick_tm_fcs },
{ NULL }
{ &joystick_sw_pad },
{ &joystick_tm_fcs },
{ NULL }
};
static joystick_instance_t *joystick_instance[GAMEPORT_MAX] = { NULL, NULL };
@@ -613,38 +613,40 @@ const device_t gameport_20f_device = {
static const device_config_t tmacm_config[] = {
// clang-format off
{
.name = "port1_addr",
.description = "Port 1 Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0201,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "port1_addr",
.description = "Port 1 Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0201,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "201h", .value = 0x0201 },
{ .description = "203h", .value = 0x0203 },
{ .description = "205h", .value = 0x0205 },
{ .description = "207h", .value = 0x0207 },
{ .description = "Disabled", .value = 0x0000 },
{ "" }
}
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "port2_addr",
.description = "Port 2 Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0209,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "port2_addr",
.description = "Port 2 Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0209,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "209h", .value = 0x0209 },
{ .description = "20Bh", .value = 0x020B },
{ .description = "20Dh", .value = 0x020D },
{ .description = "20Fh", .value = 0x020F },
{ .description = "Disabled", .value = 0x0000 },
{ "" }
}
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -0,0 +1,37 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Definitions for the ACPI emulation.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2020-2025 Miran Grca.
*/
#ifndef ACCESS_BUS_H
#define ACCESS_BUS_H
#define AB_RST 0x80
typedef struct access_bus_t {
uint8_t control;
uint8_t status;
uint8_t own_addr;
uint8_t data;
uint8_t clock;
uint8_t enable;
uint16_t base;
} access_bus_t;
extern const device_t access_bus_device;
/* Functions */
extern void access_bus_handler(access_bus_t *dev, uint8_t enable, uint16_t base);
#endif /*ACCESS_BUS_H*/

View File

@@ -1,6 +1,3 @@
#ifndef FIFO_H
#define FIFO_H
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
@@ -13,8 +10,11 @@
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2023 Miran Grca.
* Copyright 2023-2025 Miran Grca.
*/
#ifndef FIFO_H
#define FIFO_H
#define FIFO(size) \
typedef struct { \
int start; \
@@ -37,6 +37,7 @@
void (*d_full_evt)(void *); \
void (*d_ready_evt)(void *); \
\
uint8_t tag[64]; \
uint8_t buf[size]; \
} fifo## size ##_t;
@@ -50,9 +51,13 @@ FIFO(64)
extern int fifo_get_count(void *priv);
extern void fifo_write(uint8_t val, void *priv);
extern void fifo_write_tagged(uint8_t tag, uint8_t val, void *priv);
extern void fifo_write_evt(uint8_t val, void *priv);
extern void fifo_write_evt_tagged(uint8_t tag, uint8_t val, void *priv);
extern uint8_t fifo_read(void *priv);
extern uint8_t fifo_read_tagged(uint8_t *tag, void *priv);
extern uint8_t fifo_read_evt(void *priv);
extern uint8_t fifo_read_evt_tagged(uint8_t *tag, void *priv);
extern void fifo_clear_overrun(void *priv);
extern int fifo_get_full(void *priv);
extern int fifo_get_d_full(void *priv);

View File

@@ -13,7 +13,7 @@
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016-2020 Miran Grca.
* Copyright 2016-2025 Miran Grca.
* Copyright 2017-2020 Fred N. van Kempen.
*/
#ifndef EMU_HDC_H
@@ -50,11 +50,13 @@ extern const device_t esdi_at_wd1007vse1_device; /* esdi_at */
extern const device_t esdi_ps2_device; /* esdi_mca */
extern const device_t ide_isa_device; /* isa_ide */
extern const device_t ide_isa_sec_device; /* isa_ide sec*/
extern const device_t ide_isa_2ch_device; /* isa_ide_2ch */
extern const device_t ide_isa_2ch_opt_device; /* isa_ide_2ch_opt */
extern const device_t ide_vlb_device; /* vlb_ide */
extern const device_t ide_vlb_sec_device; /* vlb_ide sec */
extern const device_t ide_vlb_2ch_device; /* vlb_ide_2ch */
extern const device_t ide_pci_device; /* pci_ide */
extern const device_t ide_pci_sec_device; /* pci_ide sec */
extern const device_t ide_pci_2ch_device; /* pci_ide_2ch */
extern const device_t ide_ali1489_device; /* ALi M1489 */

View File

@@ -25,17 +25,17 @@
#define IDE_BUS_MAX 4
#define IDE_CHAN_MAX 2
#define HDC_PRIMARY_BASE 0x01F0
#define HDC_PRIMARY_SIDE 0x03F6
#define HDC_PRIMARY_BASE 0x01f0
#define HDC_PRIMARY_SIDE 0x03f6
#define HDC_PRIMARY_IRQ 14
#define HDC_SECONDARY_BASE 0x0170
#define HDC_SECONDARY_SIDE 0x0376
#define HDC_SECONDARY_IRQ 15
#define HDC_TERTIARY_BASE 0x01E8
#define HDC_TERTIARY_SIDE 0x03EE
#define HDC_TERTIARY_BASE 0x01e8
#define HDC_TERTIARY_SIDE 0x03ee
#define HDC_TERTIARY_IRQ 11
#define HDC_QUATERNARY_BASE 0x0168
#define HDC_QUATERNARY_SIDE 0x036E
#define HDC_QUATERNARY_SIDE 0x036e
#define HDC_QUATERNARY_IRQ 10
enum {

View File

@@ -15,7 +15,7 @@
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2008-2019 Sarah Walker.
* Copyright 2016-2019 Miran Grca.
* Copyright 2016-2025 Miran Grca.
* Copyright 2017-2019 Fred N. van Kempen.
*/
@@ -194,8 +194,8 @@ typedef struct scancode {
extern "C" {
#endif
extern uint8_t keyboard_mode;
extern int keyboard_scan;
extern uint8_t keyboard_mode;
extern int keyboard_scan;
extern uint16_t scancode_map[768];
@@ -232,26 +232,26 @@ extern const device_t keyboard_xt_zenith_device;
extern const device_t keyboard_xt_hyundai_device;
extern const device_t keyboard_xtclone_device;
extern const device_t keyboard_at_device;
extern const device_t keyboard_at_siemens_device;
extern const device_t keyboard_at_ami_device;
extern const device_t keyboard_at_compaq_device;
extern const device_t keyboard_at_ncr_device;
extern const device_t keyboard_at_olivetti_device;
extern const device_t keyboard_at_siemens_device;
extern const device_t keyboard_at_tg_ami_device;
extern const device_t keyboard_at_toshiba_device;
extern const device_t keyboard_at_olivetti_device;
extern const device_t keyboard_at_ncr_device;
extern const device_t keyboard_at_compaq_device;
extern const device_t keyboard_ps2_device;
extern const device_t keyboard_ps2_ps1_device;
extern const device_t keyboard_ps2_ps1_pci_device;
extern const device_t keyboard_ps2_xi8088_device;
extern const device_t keyboard_ps2_ami_device;
extern const device_t keyboard_ps2_holtek_device;
extern const device_t keyboard_ps2_tg_ami_device;
extern const device_t keyboard_ps2_tg_ami_green_device;
extern const device_t keyboard_ps2_olivetti_device;
extern const device_t keyboard_ps2_phoenix_device;
extern const device_t keyboard_ps2_mca_1_device;
extern const device_t keyboard_ps2_mca_2_device;
extern const device_t keyboard_ps2_olivetti_device;
extern const device_t keyboard_ps2_phoenix_device;
extern const device_t keyboard_ps2_quadtel_device;
extern const device_t keyboard_ps2_tg_ami_device;
extern const device_t keyboard_ps2_tg_ami_green_device;
extern const device_t keyboard_ps2_pci_device;
extern const device_t keyboard_ps2_ami_pci_device;
extern const device_t keyboard_ps2_intel_ami_pci_device;

View File

@@ -31,33 +31,33 @@ typedef struct lpt_device_t {
} lpt_device_t;
extern void lpt_init(void);
extern void lpt_port_init(int i, uint16_t port);
extern void lpt_port_setup(int i, uint16_t port);
extern void lpt_port_irq(int i, uint8_t irq);
extern void lpt_port_remove(int i);
extern void lpt1_remove_ams(void);
#define lpt1_init(a) lpt_port_init(0, a)
#define lpt1_setup(a) lpt_port_setup(0, a)
#define lpt1_irq(a) lpt_port_irq(0, a)
#define lpt1_remove() lpt_port_remove(0)
#define lpt2_init(a) lpt_port_init(1, a)
#define lpt2_setup(a) lpt_port_setup(1, a)
#define lpt2_irq(a) lpt_port_irq(1, a)
#define lpt2_remove() lpt_port_remove(1)
#define lpt3_init(a) lpt_port_init(2, a)
#define lpt3_setup(a) lpt_port_setup(2, a)
#define lpt3_irq(a) lpt_port_irq(2, a)
#define lpt3_remove() lpt_port_remove(2)
#define lpt4_init(a) lpt_port_init(3, a)
#define lpt4_setup(a) lpt_port_setup(3, a)
#define lpt4_irq(a) lpt_port_irq(3, a)
#define lpt4_remove() lpt_port_remove(3)
#if 0
#define lpt5_init(a) lpt_port_init(4, a)
#define lpt5_setup(a) lpt_port_setup(4, a)
#define lpt5_irq(a) lpt_port_irq(4, a)
#define lpt5_remove() lpt_port_remove(4)
#define lpt6_init(a) lpt_port_init(5, a)
#define lpt6_setup(a) lpt_port_setup(5, a)
#define lpt6_irq(a) lpt_port_irq(5, a)
#define lpt6_remove() lpt_port_remove(5)
#endif

View File

@@ -173,20 +173,21 @@ enum {
MACHINE_TYPE_486 = 8,
MACHINE_TYPE_486_S2 = 9,
MACHINE_TYPE_486_S3 = 10,
MACHINE_TYPE_486_MISC = 11,
MACHINE_TYPE_SOCKET4 = 12,
MACHINE_TYPE_SOCKET5 = 13,
MACHINE_TYPE_SOCKET7_3V = 14,
MACHINE_TYPE_SOCKET7 = 15,
MACHINE_TYPE_SOCKETS7 = 16,
MACHINE_TYPE_SOCKET8 = 17,
MACHINE_TYPE_SLOT1 = 18,
MACHINE_TYPE_SLOT1_2 = 19,
MACHINE_TYPE_SLOT1_370 = 20,
MACHINE_TYPE_SLOT2 = 21,
MACHINE_TYPE_SOCKET370 = 22,
MACHINE_TYPE_MISC = 23,
MACHINE_TYPE_MAX = 24
MACHINE_TYPE_486_S3_PCI = 11,
MACHINE_TYPE_486_MISC = 12,
MACHINE_TYPE_SOCKET4 = 13,
MACHINE_TYPE_SOCKET5 = 14,
MACHINE_TYPE_SOCKET7_3V = 15,
MACHINE_TYPE_SOCKET7 = 16,
MACHINE_TYPE_SOCKETS7 = 17,
MACHINE_TYPE_SOCKET8 = 18,
MACHINE_TYPE_SLOT1 = 19,
MACHINE_TYPE_SLOT1_2 = 20,
MACHINE_TYPE_SLOT1_370 = 21,
MACHINE_TYPE_SLOT2 = 22,
MACHINE_TYPE_SOCKET370 = 23,
MACHINE_TYPE_MISC = 24,
MACHINE_TYPE_MAX = 25
};
enum {
@@ -320,27 +321,29 @@ typedef struct _machine_ {
int ram_granularity;
int nvrmask;
#ifdef EMU_DEVICE_H
const device_t *kbc_device;
const device_t *kbc_device;
#else
void *kbc_device;
void *kbc_device;
#endif /* EMU_DEVICE_H */
uint8_t kbc_p1;
uint32_t gpio;
uint32_t gpio_acpi;
uintptr_t kbc_params;
/* Bits 23-16: XOR mask, bits 15-8: OR mask, bits 7-0: AND mask. */
uint32_t kbc_p1;
uint32_t gpio;
uint32_t gpio_acpi;
#ifdef EMU_DEVICE_H
const device_t *device;
const device_t *fdc_device;
const device_t *sio_device;
const device_t *vid_device;
const device_t *snd_device;
const device_t *net_device;
const device_t *device;
const device_t *fdc_device;
const device_t *sio_device;
const device_t *vid_device;
const device_t *snd_device;
const device_t *net_device;
#else
void *device;
void *fdc_device;
void *sio_device;
void *vid_device;
void *snd_device;
void *net_device;
void *device;
void *fdc_device;
void *sio_device;
void *vid_device;
void *snd_device;
void *net_device;
#endif
} machine_t;

View File

@@ -16,7 +16,7 @@
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2008-2020 Sarah Walker.
* Copyright 2016-2020 Miran Grca.
* Copyright 2016-2025 Miran Grca.
* Copyright 2017-2020 Fred N. van Kempen.
*/
@@ -137,6 +137,7 @@ extern serial_t *serial_attach_ex_2(int port,
extern void serial_remove(serial_t *dev);
extern void serial_set_type(serial_t *dev, int type);
extern void serial_setup(serial_t *dev, uint16_t addr, uint8_t irq);
extern void serial_irq(serial_t *dev, uint8_t irq);
extern void serial_clear_fifo(serial_t *dev);
extern void serial_write_fifo(serial_t *dev, uint8_t dat);
extern void serial_set_next_inst(int ni);

View File

@@ -16,13 +16,20 @@
#ifndef EMU_SIO_H
#define EMU_SIO_H
extern void vt82c686_sio_write(uint8_t addr, uint8_t val, void *priv);
/* ACC Micro */
extern const device_t acc3221_device;
/* Acer / ALi */
extern const device_t ali5105_device;
extern const device_t ali5123_device;
extern const device_t f82c710_device;
/* Chips & Technologies */
extern const device_t f82c606_device;
extern const device_t f82c710_device;
/* SM(S)C */
extern const device_t fdc37c651_device;
extern const device_t fdc37c651_ide_device;
extern const device_t fdc37c661_device;
@@ -35,9 +42,12 @@ extern const device_t fdc37c665_ide_device;
extern const device_t fdc37c665_ide_pri_device;
extern const device_t fdc37c665_ide_sec_device;
extern const device_t fdc37c666_device;
extern const device_t fdc37c67x_device;
extern const device_t fdc37c669_device;
extern const device_t fdc37c669_370_device;
extern const device_t fdc37c67x_device;
extern const device_t fdc37c931apm_device;
extern const device_t fdc37c931apm_compaq_device;
extern const device_t fdc37c932fr_device;
@@ -46,22 +56,23 @@ extern const device_t fdc37c932_device;
extern const device_t fdc37c935_device;
extern const device_t fdc37c935_370_device;
extern const device_t fdc37c935_no_nvr_device;
extern const device_t fdc37m60x_device;
extern const device_t fdc37m60x_370_device;
/* ITE */
extern const device_t it8661f_device;
extern const device_t it8671f_device;
extern const device_t i82091aa_device;
extern const device_t i82091aa_398_device;
extern const device_t i82091aa_ide_pri_device;
extern const device_t i82091aa_ide_device;
extern const device_t pc87306_device;
extern const device_t pc87307_device;
extern const device_t pc87307_15c_device;
extern const device_t pc87307_both_device;
extern const device_t pc87309_device;
extern const device_t pc87309_15c_device;
/* National Semiconductors */
extern const device_t pc87310_device;
extern const device_t pc87310_ide_device;
extern const device_t pc87306_device;
extern const device_t pc87311_device;
extern const device_t pc87311_ide_device;
extern const device_t pc87332_device;
@@ -69,35 +80,66 @@ extern const device_t pc87332_398_device;
extern const device_t pc87332_398_ide_device;
extern const device_t pc87332_398_ide_sec_device;
extern const device_t pc87332_398_ide_fdcon_device;
extern const device_t pc87307_device;
extern const device_t pc87307_15c_device;
extern const device_t pc87307_both_device;
extern const device_t pc97307_device;
extern const device_t pc87309_device;
extern const device_t pc87309_15c_device;
/* LG Prime */
extern const device_t prime3b_device;
extern const device_t prime3b_ide_device;
extern const device_t prime3c_device;
extern const device_t prime3c_ide_device;
/* IBM PS/1 */
extern const device_t ps1_m2133_sio;
/* Super I/O Detect */
#ifdef USE_SIO_DETECT
extern const device_t sio_detect_device;
#endif /* USE_SIO_DETECT */
/* UMC */
extern const device_t um8663af_device;
extern const device_t um8663af_ide_device;
extern const device_t um8663af_sec_device;
extern const device_t um8663bf_device;
extern const device_t um8663bf_ide_device;
extern const device_t um8663bf_sec_device;
extern const device_t um8669f_device;
extern const device_t um8669f_ide_device;
extern const device_t um8669f_ide_sec_device;
/* VIA */
extern void vt82c686_sio_write(uint8_t addr, uint8_t val, void *priv);
extern const device_t via_vt82c686_sio_device;
/* VLSI */
extern const device_t vl82c113_device;
/* Winbond */
extern const device_t w83787f_88h_device;
extern const device_t w83787f_device;
extern const device_t w83787f_ide_device;
extern const device_t w83787f_ide_en_device;
extern const device_t w83787f_ide_sec_device;
extern const device_t w83877f_device;
extern const device_t w83877f_president_device;
extern const device_t w83877tf_device;
extern const device_t w83877tf_acorp_device;
#define TYPE_W83977EF 0x52F0
#define TYPE_W83977F 0x9771
#define TYPE_W83977TF 0x9773
#define TYPE_W83977ATF 0x9774
extern const device_t w83977f_device;
extern const device_t w83977f_370_device;
extern const device_t w83977tf_device;

View File

@@ -172,6 +172,7 @@ extern const device_t cs4235_device;
extern const device_t cs4235_onboard_device;
extern const device_t cs4236_onboard_device;
extern const device_t cs4236b_device;
extern const device_t cs4236b_onboard_device;
extern const device_t cs4237b_device;
extern const device_t cs4238b_device;

View File

@@ -15,7 +15,7 @@
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2008-2019 Sarah Walker.
* Copyright 2016-2019 Miran Grca.
* Copyright 2016-2025 Miran Grca.
*/
#include <stdarg.h>
#include <stdio.h>
@@ -145,6 +145,8 @@ io_sethandler_common(uint16_t base, int size,
q->next = NULL;
io_last[base + c] = q;
q = NULL;
}
}

View File

@@ -219,14 +219,14 @@ lpt_init(void)
lpt_ports[i].enable_irq = 0x10;
if (lpt_ports[i].enabled) {
lpt_port_init(i, default_ports[i]);
lpt_port_setup(i, default_ports[i]);
lpt_port_irq(i, default_irqs[i]);
}
}
}
void
lpt_port_init(int i, uint16_t port)
lpt_port_setup(int i, uint16_t port)
{
if (lpt_ports[i].enabled) {
if (lpt_ports[i].addr != 0xffff)

View File

@@ -66,7 +66,7 @@ machine_at_mr286_init(const machine_t *model)
}
static void
machine_at_headland_common_init(int type)
machine_at_headland_common_init(const machine_t *model, int type)
{
device_add(&keyboard_at_ami_device);
@@ -94,7 +94,7 @@ machine_at_tg286m_init(const machine_t *model)
machine_at_common_ide_init(model);
machine_at_headland_common_init(1);
machine_at_headland_common_init(model, 1);
return ret;
}
@@ -115,7 +115,7 @@ machine_at_ama932j_init(const machine_t *model)
if (gfxcard[0] == VID_INTERNAL)
device_add(&oti067_ama932j_device);
machine_at_headland_common_init(2);
machine_at_headland_common_init(model, 2);
device_add(&ali5105_device);
@@ -755,7 +755,7 @@ machine_at_acer100t_init(const machine_t *model)
device_add(&ali1409_device);
if (gfxcard[0] == VID_INTERNAL)
device_add(&oti077_acer100t_device);
device_add(&oti077_acer100t_device);
device_add(&ali5105_device);

View File

@@ -50,6 +50,7 @@
#include <86box/plat_unused.h>
#include <86box/sound.h>
/* 386DX */
int
machine_at_acc386_init(const machine_t *model)
{
@@ -252,7 +253,7 @@ machine_at_ecs386v_init(const machine_t *model)
int ret;
ret = bios_load_linear("roms/machines/ecs386v/PANDA_386V.BIN",
0x000f0000, 65536, 0);
0x000f0000, 65536, 0);
if (bios_only || !ret)
return ret;
@@ -1412,7 +1413,7 @@ machine_at_amis76_init(const machine_t *model)
{
int ret;
ret = bios_load_linear_inverted("roms/machines/s76p/S76P.ROM",
ret = bios_load_linear_inverted("roms/machines/s76p/S76P.ROM",
0x000e0000, 131072, 0);
if (bios_only || !ret)

View File

@@ -64,13 +64,13 @@ cbm_io_write(UNUSED(uint16_t port), uint8_t val, UNUSED(void *priv))
switch (val & 3) {
case 1:
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
break;
case 2:
lpt1_init(LPT1_ADDR);
lpt1_setup(LPT1_ADDR);
break;
case 3:
lpt1_init(LPT2_ADDR);
lpt1_setup(LPT2_ADDR);
break;
default:

View File

@@ -146,13 +146,13 @@ ps1_write(uint16_t port, uint8_t val, void *priv)
if (val & 0x10) {
switch ((val >> 5) & 3) {
case 0:
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
break;
case 1:
lpt1_init(LPT1_ADDR);
lpt1_setup(LPT1_ADDR);
break;
case 2:
lpt1_init(LPT2_ADDR);
lpt1_setup(LPT2_ADDR);
break;
default:
@@ -316,7 +316,7 @@ ps1_setup(int model)
ps->uart = device_add_inst(&ns16450_device, 1);
lpt1_remove();
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
mem_remap_top(384);

View File

@@ -64,13 +64,13 @@ ps2_write(uint16_t port, uint8_t val, void *priv)
if (val & 0x10) {
switch ((val >> 5) & 3) {
case 0:
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
break;
case 1:
lpt1_init(LPT1_ADDR);
lpt1_setup(LPT1_ADDR);
break;
case 2:
lpt1_init(LPT2_ADDR);
lpt1_setup(LPT2_ADDR);
break;
default:
@@ -167,7 +167,7 @@ ps2_isa_setup(int model, int cpu_type)
ps2->uart = device_add_inst(&ns16450_device, 1);
lpt1_remove();
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
device_add(&port_92_device);

View File

@@ -374,13 +374,13 @@ model_50_write(uint16_t port, uint8_t val)
if (val & 0x10) {
switch ((val >> 5) & 3) {
case 0:
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
break;
case 1:
lpt1_init(LPT1_ADDR);
lpt1_setup(LPT1_ADDR);
break;
case 2:
lpt1_init(LPT2_ADDR);
lpt1_setup(LPT2_ADDR);
break;
default:
@@ -506,13 +506,13 @@ model_55sx_write(uint16_t port, uint8_t val)
if (val & 0x10) {
switch ((val >> 5) & 3) {
case 0:
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
break;
case 1:
lpt1_init(LPT1_ADDR);
lpt1_setup(LPT1_ADDR);
break;
case 2:
lpt1_init(LPT2_ADDR);
lpt1_setup(LPT2_ADDR);
break;
default:
@@ -565,13 +565,13 @@ model_70_type3_write(uint16_t port, uint8_t val)
if (val & 0x10) {
switch ((val >> 5) & 3) {
case 0:
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
break;
case 1:
lpt1_init(LPT1_ADDR);
lpt1_setup(LPT1_ADDR);
break;
case 2:
lpt1_init(LPT2_ADDR);
lpt1_setup(LPT2_ADDR);
break;
default:
@@ -619,13 +619,13 @@ model_80_write(uint16_t port, uint8_t val)
if (val & 0x10) {
switch ((val >> 5) & 3) {
case 0:
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
break;
case 1:
lpt1_init(LPT1_ADDR);
lpt1_setup(LPT1_ADDR);
break;
case 2:
lpt1_init(LPT2_ADDR);
lpt1_setup(LPT2_ADDR);
break;
default:
@@ -846,7 +846,7 @@ ps2_mca_board_common_init(void)
ps2.setup = 0xff;
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
}
static uint8_t

View File

@@ -59,7 +59,7 @@ machine_xt_compaq_deskpro_init(const machine_t *model)
standalone_gameport_type = &gameport_device;
lpt1_remove();
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
return ret;
}
@@ -87,7 +87,7 @@ machine_xt_compaq_portable_init(const machine_t *model)
device_add(&gameport_device);
lpt1_remove();
lpt1_init(LPT_MDA_ADDR);
lpt1_setup(LPT_MDA_ADDR);
return ret;
}

View File

@@ -144,7 +144,7 @@ machine_xt_z184_init(const machine_t *model)
lpt1_remove(); /* only one parallel port */
lpt2_remove();
lpt1_init(0x278);
lpt1_setup(LPT2_ADDR);
device_add(&ns8250_device);
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
@@ -198,7 +198,7 @@ machine_xt_z159_init(const machine_t *model)
/* parallel port is on the memory board */
lpt1_remove(); /* only one parallel port */
lpt2_remove();
lpt1_init(0x278);
lpt1_setup(LPT2_ADDR);
return ret;
}

View File

@@ -31,12 +31,14 @@
#include <86box/rom.h>
#include <86box/device.h>
#include <86box/machine.h>
#include <86box/timer.h>
#include <86box/fdd.h>
#include <86box/fdc.h>
#include <86box/keyboard.h>
#include <86box/sound.h>
#include <86box/video.h>
#include <86box/plat_unused.h>
#include <86box/thread.h>
#include <86box/timer.h>
#include <86box/network.h>
// Temporarily here till we move everything out into the right files
@@ -79,6 +81,7 @@ const machine_filter_t machine_types[] = {
{ "[1992] i486 (Socket 168 and 1)", MACHINE_TYPE_486 },
{ "[1992] i486 (Socket 2)", MACHINE_TYPE_486_S2 },
{ "[1994] i486 (Socket 3)", MACHINE_TYPE_486_S3 },
{ "[1994] i486 (Socket 3 PCI)", MACHINE_TYPE_486_S3_PCI },
{ "[1992] i486 (Miscellaneous)", MACHINE_TYPE_486_MISC },
{ "[1993] Socket 4", MACHINE_TYPE_SOCKET4 },
{ "[1994] Socket 5", MACHINE_TYPE_SOCKET5 },
@@ -6862,7 +6865,7 @@ const machine_t machines[] = {
{
.name = "[OPTi 895] Packard Bell PB450",
.internal_name = "pb450",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_OPTI_895_802G,
.init = machine_at_pb450_init,
.p1_handler = NULL,
@@ -7387,7 +7390,7 @@ const machine_t machines[] = {
{
.name = "[ALi M1429G] MSI MS-4134",
.internal_name = "ms4134",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_ALI_M1429G,
.init = machine_at_ms4134_init,
.p1_handler = NULL,
@@ -7427,7 +7430,7 @@ const machine_t machines[] = {
{
.name = "[ALi M1429G] TriGem 486GP",
.internal_name = "tg486gp",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_ALI_M1429G,
.init = machine_at_tg486gp_init,
.p1_handler = NULL,
@@ -7467,7 +7470,7 @@ const machine_t machines[] = {
{
.name = "[ALi M1489] AAEON SBC-490",
.internal_name = "sbc490",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_ALI_M1489,
.init = machine_at_sbc490_init,
.p1_handler = NULL,
@@ -7508,7 +7511,7 @@ const machine_t machines[] = {
{
.name = "[ALi M1489] ABIT AB-PB4",
.internal_name = "abpb4",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_ALI_M1489,
.init = machine_at_abpb4_init,
.p1_handler = NULL,
@@ -7552,7 +7555,7 @@ const machine_t machines[] = {
{
.name = "[ALi M1489] AMI WinBIOS 486 PCI",
.internal_name = "win486pci",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_ALI_M1489,
.init = machine_at_win486pci_init,
.p1_handler = NULL,
@@ -7596,7 +7599,7 @@ const machine_t machines[] = {
{
.name = "[ALi M1489] MSI MS-4145",
.internal_name = "ms4145",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_ALI_M1489,
.init = machine_at_ms4145_init,
.p1_handler = NULL,
@@ -7636,7 +7639,7 @@ const machine_t machines[] = {
{
.name = "[ALi M1489] ESA TF-486",
.internal_name = "tf486",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_ALI_M1489,
.init = machine_at_tf486_init,
.p1_handler = NULL,
@@ -7676,7 +7679,7 @@ const machine_t machines[] = {
{
.name = "[ALi M1489] Acrosser AR-B1476",
.internal_name = "arb1476",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_ALI_M1489,
.init = machine_at_arb1476_init,
.p1_handler = NULL,
@@ -7716,7 +7719,7 @@ const machine_t machines[] = {
{
.name = "[OPTi 802G] IBM Aptiva 510/710/Vision",
.internal_name = "aptiva510",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_OPTI_895_802G,
.init = machine_at_aptiva510_init,
.p1_handler = NULL,
@@ -7756,7 +7759,7 @@ const machine_t machines[] = {
{
.name = "[OPTi 802G] IBM PC 330 (type 6573)",
.internal_name = "pc330_6573",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_OPTI_895_802G,
.init = machine_at_pc330_6573_init,
.p1_handler = NULL,
@@ -7796,7 +7799,7 @@ const machine_t machines[] = {
{
.name = "[i420EX] ASUS PVI-486AP4",
.internal_name = "486ap4",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_INTEL_420EX,
.init = machine_at_486ap4_init,
.p1_handler = NULL,
@@ -7836,7 +7839,7 @@ const machine_t machines[] = {
{
.name = "[i420EX] Intel Classic/PCI ED",
.internal_name = "ninja",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_INTEL_420EX,
.init = machine_at_ninja_init,
.p1_handler = NULL,
@@ -7876,7 +7879,7 @@ const machine_t machines[] = {
{
.name = "[i420EX] Anigma BAT4IP3e",
.internal_name = "bat4ip3e",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_INTEL_420EX,
.init = machine_at_bat4ip3e_init,
.p1_handler = NULL,
@@ -7916,7 +7919,7 @@ const machine_t machines[] = {
{
.name = "[i420EX] Advanced Integration Research 486PI",
.internal_name = "486pi",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_INTEL_420EX,
.init = machine_at_486pi_init,
.p1_handler = NULL,
@@ -7956,7 +7959,7 @@ const machine_t machines[] = {
{
.name = "[i420EX] ICS SB486P",
.internal_name = "sb486p",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_INTEL_420EX,
.init = machine_at_sb486p_init,
.p1_handler = NULL,
@@ -7996,7 +7999,7 @@ const machine_t machines[] = {
{
.name = "[i420TX] ASUS PCI/I-486SP3",
.internal_name = "486sp3",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_INTEL_420TX,
.init = machine_at_486sp3_init,
.p1_handler = NULL,
@@ -8036,7 +8039,7 @@ const machine_t machines[] = {
{
.name = "[i420TX] Intel Classic/PCI",
.internal_name = "alfredo",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_INTEL_420TX,
.init = machine_at_alfredo_init,
.p1_handler = NULL,
@@ -8076,7 +8079,7 @@ const machine_t machines[] = {
{
.name = "[i420TX] AMI Super Voyager PCI",
.internal_name = "amis76",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_INTEL_420TX,
.init = machine_at_amis76_init,
.p1_handler = NULL,
@@ -8117,7 +8120,7 @@ const machine_t machines[] = {
{
.name = "[i420ZX] ASUS PCI/I-486SP3G",
.internal_name = "486sp3g",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_INTEL_420ZX,
.init = machine_at_486sp3g_init,
.p1_handler = NULL,
@@ -8157,7 +8160,7 @@ const machine_t machines[] = {
{
.name = "[IMS 8848] J-Bond PCI400C-B",
.internal_name = "pci400cb",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_IMS_8848,
.init = machine_at_pci400cb_init,
.p1_handler = NULL,
@@ -8197,7 +8200,7 @@ const machine_t machines[] = {
{
.name = "[SiS 496] ASUS PVI-486SP3C",
.internal_name = "486sp3c",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_SIS_496,
.init = machine_at_486sp3c_init,
.p1_handler = NULL,
@@ -8237,7 +8240,7 @@ const machine_t machines[] = {
{
.name = "[SiS 496] Lucky Star LS-486E",
.internal_name = "ls486e",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_SIS_496,
.init = machine_at_ls486e_init,
.p1_handler = NULL,
@@ -8277,7 +8280,7 @@ const machine_t machines[] = {
{
.name = "[SiS 496] Micronics M4Li",
.internal_name = "m4li",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_SIS_496,
.init = machine_at_m4li_init,
.p1_handler = NULL,
@@ -8317,7 +8320,7 @@ const machine_t machines[] = {
{
.name = "[SiS 496] Rise Computer R418",
.internal_name = "r418",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_SIS_496,
.init = machine_at_r418_init,
.p1_handler = NULL,
@@ -8358,7 +8361,7 @@ const machine_t machines[] = {
{
.name = "[SiS 496] Soyo 4SAW2",
.internal_name = "4saw2",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_SIS_496,
.init = machine_at_4saw2_init,
.p1_handler = NULL,
@@ -8399,7 +8402,7 @@ const machine_t machines[] = {
{
.name = "[SiS 496] Zida Tomato 4DP",
.internal_name = "4dps",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_SIS_496,
.init = machine_at_4dps_init,
.p1_handler = NULL,
@@ -8439,7 +8442,7 @@ const machine_t machines[] = {
{
.name = "[SiS 496] MSI MS-4144",
.internal_name = "ms4144",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_SIS_496,
.init = machine_at_ms4144_init,
.p1_handler = NULL,
@@ -8479,7 +8482,7 @@ const machine_t machines[] = {
{
.name = "[UMC 8881] A-Trend ATC-1415",
.internal_name = "atc1415",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_UMC_UM8881,
.init = machine_at_atc1415_init,
.p1_handler = NULL,
@@ -8519,7 +8522,7 @@ const machine_t machines[] = {
{
.name = "[UMC 8881] ECS Elite UM8810P-AIO",
.internal_name = "ecs486",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_UMC_UM8881,
.init = machine_at_ecs486_init,
.p1_handler = NULL,
@@ -8559,7 +8562,7 @@ const machine_t machines[] = {
{
.name = "[UMC 8881] Epson ActionPC 2600",
.internal_name = "actionpc2600",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_UMC_UM8881,
.init = machine_at_actionpc2600_init,
.p1_handler = NULL,
@@ -8600,7 +8603,7 @@ const machine_t machines[] = {
{
.name = "[UMC 8881] Epson ActionTower 8400",
.internal_name = "actiontower8400",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_UMC_UM8881,
.init = machine_at_actiontower8400_init,
.p1_handler = NULL,
@@ -8641,7 +8644,7 @@ const machine_t machines[] = {
{
.name = "[UMC 8881] PC Chips M919",
.internal_name = "m919",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_UMC_UM8881,
.init = machine_at_m919_init,
.p1_handler = NULL,
@@ -8681,7 +8684,7 @@ const machine_t machines[] = {
{
.name = "[UMC 8881] Samsung SPC7700P-LW",
.internal_name = "spc7700plw",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_UMC_UM8881,
.init = machine_at_spc7700plw_init,
.p1_handler = NULL,
@@ -8721,7 +8724,7 @@ const machine_t machines[] = {
{
.name = "[UMC 8881] Shuttle HOT-433A",
.internal_name = "hot433a",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_UMC_UM8881,
.init = machine_at_hot433a_init,
.p1_handler = NULL,
@@ -8762,7 +8765,7 @@ const machine_t machines[] = {
{
.name = "[UMC 8881] Compaq Presario 7100/7200 Series 486",
.internal_name = "pl4600c",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_UMC_UM8881,
.init = machine_at_pl4600c_init,
.p1_handler = NULL,
@@ -8802,7 +8805,7 @@ const machine_t machines[] = {
{
.name = "[VIA VT82C496G] DFI G486VPA",
.internal_name = "g486vpa",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_VIA_VT82C496G,
.init = machine_at_g486vpa_init,
.p1_handler = NULL,
@@ -8842,7 +8845,7 @@ const machine_t machines[] = {
{
.name = "[VIA VT82C496G] FIC VIP-IO2",
.internal_name = "486vipio2",
.type = MACHINE_TYPE_486_S3,
.type = MACHINE_TYPE_486_S3_PCI,
.chipset = MACHINE_CHIPSET_VIA_VT82C496G,
.init = machine_at_486vipio2_init,
.p1_handler = NULL,
@@ -14169,7 +14172,7 @@ const machine_t machines[] = {
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = &s3_virge_325_onboard_pci_device,
.snd_device = &cs4236b_device,
.snd_device = &cs4236b_onboard_device,
.net_device = NULL
},
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
@@ -16222,8 +16225,8 @@ const machine_t machines[] = {
/* Saved copies - jumpers get applied to these.
We use also machine_gpio to store IBM PC/XT jumpers as they need more than one byte. */
static uint8_t machine_p1_default;
static uint8_t machine_p1;
static uint32_t machine_p1_default;
static uint32_t machine_p1;
static uint32_t machine_gpio_default;
static uint32_t machine_gpio;

View File

@@ -1154,30 +1154,31 @@ threec501_nic_close(void *priv)
static const device_config_t threec501_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x300,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x300,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x280", .value = 0x280 },
{ .description = "0x300", .value = 0x300 },
{ .description = "0x310", .value = 0x310 },
{ .description = "0x320", .value = 0x320 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2/9", .value = 9 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
@@ -1186,28 +1187,34 @@ static const device_config_t threec501_config[] = {
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DMA 1", .value = 1 },
{ .description = "DMA 2", .value = 2 },
{ .description = "DMA 3", .value = 3 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -654,14 +654,14 @@ threec503_nic_close(void *priv)
static const device_config_t threec503_config[] = {
// clang-format off
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x300,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x300,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x250", .value = 0x250 },
{ .description = "0x280", .value = 0x280 },
{ .description = "0x2a0", .value = 0x2a0 },
@@ -672,65 +672,68 @@ static const device_config_t threec503_config[] = {
{ .description = "0x350", .value = 0x350 },
{ .description = "", .value = 0 }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "", .value = 0 }
},
.bios = { { 0 } }
},
{
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "DMA 1", .value = 1 },
{ .description = "DMA 2", .value = 2 },
{ .description = "DMA 3", .value = 3 },
{ .description = "", .value = 0 }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "", .value = 0 }
},
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xCC000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xCC000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DC00", .value = 0xDC000 },
{ .description = "D800", .value = 0xD8000 },
{ .description = "C800", .value = 0xC8000 },
{ .description = "CC00", .value = 0xCC000 },
{ .description = "", .value = 0 }
{ .description = "", .value = 0 }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format off

View File

@@ -1531,30 +1531,31 @@ modem_close(void *priv)
// clang-format off
static const device_config_t modem_config[] = {
{
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "port",
.description = "Serial Port",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "COM1", .value = 0 },
{ .description = "COM2", .value = 1 },
{ .description = "COM3", .value = 2 },
{ .description = "COM4", .value = 3 },
{ .description = "" }
}
},
.bios = { { 0 } }
},
{
.name = "baudrate",
.description = "Baud Rate",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 115200,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
.name = "baudrate",
.description = "Baud Rate",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 115200,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "115200", .value = 115200 },
{ .description = "57600", .value = 57600 },
{ .description = "56000", .value = 56000 },
@@ -1569,32 +1570,44 @@ static const device_config_t modem_config[] = {
{ .description = "1200", .value = 1200 },
{ .description = "600", .value = 600 },
{ .description = "300", .value = 300 },
}
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "listen_port",
.description = "TCP/IP listening port",
.type = CONFIG_SPINNER,
.spinner =
{
.min = 0,
.name = "listen_port",
.description = "TCP/IP listening port",
.type = CONFIG_SPINNER,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = {
.min = 0,
.max = 32767
},
.default_int = 0
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "phonebook_file",
.description = "Phonebook File",
.type = CONFIG_FNAME,
.default_string = "",
.file_filter = "Text files (*.txt)|*.txt"
.name = "phonebook_file",
.description = "Phonebook File",
.type = CONFIG_FNAME,
.default_string = NULL,
.file_filter = "Text files (*.txt)|*.txt",
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "telnet_mode",
.description = "Telnet emulation",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.name = "telnet_mode",
.description = "Telnet emulation",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -1234,14 +1234,14 @@ de220p_available(void)
// clang-format off
static const device_config_t ne1000_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x300,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x300,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: Windows 95 .INF file. */
{ .description = "0x300", .value = 0x300 },
{ .description = "0x320", .value = 0x320 },
@@ -1249,16 +1249,17 @@ static const device_config_t ne1000_config[] = {
{ .description = "0x360", .value = 0x360 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: Windows 95 .INF file. */
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
@@ -1267,27 +1268,32 @@ static const device_config_t ne1000_config[] = {
{ .description = "IRQ 9", .value = 9 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t ne1000_compat_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x300,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x300,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: Windows 95 .INF file. */
{ .description = "0x200", .value = 0x200 },
{ .description = "0x220", .value = 0x220 },
@@ -1307,16 +1313,17 @@ static const device_config_t ne1000_compat_config[] = {
{ .description = "0x3e0", .value = 0x3e0 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: Windows 95 .INF file. */
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
@@ -1326,34 +1333,43 @@ static const device_config_t ne1000_compat_config[] = {
{ .description = "IRQ 9", .value = 9 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "mac_oui",
.description = "MAC Address OUI",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac_oui",
.description = "MAC Address OUI",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t ne2000_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x300,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x300,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: Windows 95 .INF file. */
{ .description = "0x300", .value = 0x300 },
{ .description = "0x320", .value = 0x320 },
@@ -1361,16 +1377,17 @@ static const device_config_t ne2000_config[] = {
{ .description = "0x360", .value = 0x360 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: Windows 95 .INF file. */
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
@@ -1379,43 +1396,49 @@ static const device_config_t ne2000_config[] = {
{ .description = "IRQ 9", .value = 9 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "D000", .value = 0xD0000 },
{ .description = "D800", .value = 0xD8000 },
{ .description = "C800", .value = 0xC8000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t ne2000_compat_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x300,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x300,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: Windows 95 .INF file. */
{ .description = "0x200", .value = 0x200 },
{ .description = "0x220", .value = 0x220 },
@@ -1435,16 +1458,17 @@ static const device_config_t ne2000_compat_config[] = {
{ .description = "0x3e0", .value = 0x3e0 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 10,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 10,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: Windows 95 .INF file - not giving impossible IRQ's
such as 6, 8, or 13. */
{ .description = "IRQ 3", .value = 3 },
@@ -1459,50 +1483,60 @@ static const device_config_t ne2000_compat_config[] = {
{ .description = "IRQ 15", .value = 15 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "mac_oui",
.description = "MAC Address OUI",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac_oui",
.description = "MAC Address OUI",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0x00000 },
{ .description = "D000", .value = 0xD0000 },
{ .description = "D800", .value = 0xD8000 },
{ .description = "C800", .value = 0xC8000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t ne2000_compat_8bit_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x320,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x320,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: board docs, https://github.com/skiselev/isa8_eth */
{ .description = "0x200", .value = 0x200 },
{ .description = "0x220", .value = 0x220 },
@@ -1522,16 +1556,17 @@ static const device_config_t ne2000_compat_8bit_config[] = {
{ .description = "0x3e0", .value = 0x3e0 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: board docs, https://github.com/skiselev/isa8_eth */
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
@@ -1540,30 +1575,39 @@ static const device_config_t ne2000_compat_8bit_config[] = {
{ .description = "IRQ 9", .value = 9 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "mac_oui",
.description = "MAC Address OUI",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac_oui",
.description = "MAC Address OUI",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
/* Source: board docs, https://github.com/skiselev/isa8_eth */
{ .description = "Disabled", .value = 0x00000 },
{ .description = "C000", .value = 0xC0000 },
@@ -1576,6 +1620,7 @@ static const device_config_t ne2000_compat_8bit_config[] = {
{ .description = "DC00", .value = 0xDC000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
@@ -1583,40 +1628,56 @@ static const device_config_t ne2000_compat_8bit_config[] = {
static const device_config_t rtl8019as_config[] = {
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t rtl8029as_config[] = {
{
.name = "bios",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.name = "bios",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t mca_mac_config[] = {
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -3088,62 +3088,68 @@ pcnet_close(void *priv)
// clang-format off
static const device_config_t pcnet_pci_config[] = {
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t pcnet_isa_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x300,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x300,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x300", .value = 0x300 },
{ .description = "0x320", .value = 0x320 },
{ .description = "0x340", .value = 0x340 },
{ .description = "0x360", .value = 0x360 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "IRQ 9", .value = 9 },
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "IRQ 9", .value = 9 },
{ .description = "IRQ 10", .value = 10 },
{ .description = "IRQ 11", .value = 11 },
{ .description = "IRQ 12", .value = 12 },
{ .description = "IRQ 15", .value = 15 },
{ .description = "" }
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DMA 0", .value = 0 },
{ .description = "DMA 3", .value = 3 },
{ .description = "DMA 5", .value = 5 },
@@ -3151,61 +3157,72 @@ static const device_config_t pcnet_isa_config[] = {
{ .description = "DMA 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t pcnet_vlb_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x300,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x300,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x300", .value = 0x300 },
{ .description = "0x320", .value = 0x320 },
{ .description = "0x340", .value = 0x340 },
{ .description = "0x360", .value = 0x360 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "IRQ 9", .value = 9 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "IRQ 9", .value = 9 },
{ .description = "IRQ 10", .value = 10 },
{ .description = "IRQ 11", .value = 11 },
{ .description = "IRQ 12", .value = 12 },
{ .description = "IRQ 15", .value = 15 },
{ .description = "" }
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -26,12 +26,12 @@
#include <stdarg.h>
#define HAVE_STDARG_H
#include <86box/86box.h>
#include <86box/timer.h>
#include <86box/lpt.h>
#include <86box/timer.h>
#include <86box/pit.h>
#include <86box/device.h>
#include <86box/thread.h>
#include <86box/timer.h>
#include <86box/network.h>
#include <86box/plat_unused.h>

View File

@@ -3315,11 +3315,15 @@ nic_close(void *priv)
// clang-format off
static const device_config_t rtl8139c_config[] = {
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -1664,29 +1664,41 @@ nic_close(void *priv)
// clang-format off
static const device_config_t dec_tulip_21143_config[] = {
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t dec_tulip_21140_config[] = {
{
.name = "bios",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.name = "bios",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -806,46 +806,48 @@ wd_close(void *priv)
// clang-format off
static const device_config_t wd8003_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x300,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x300,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x240", .value = 0x240 },
{ .description = "0x280", .value = 0x280 },
{ .description = "0x300", .value = 0x300 },
{ .description = "0x380", .value = 0x380 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2", .value = 2 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "ram_addr",
.description = "RAM Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xD0000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "ram_addr",
.description = "RAM Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xD0000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "C800", .value = 0xC8000 },
{ .description = "CC00", .value = 0xCC000 },
{ .description = "D000", .value = 0xD0000 },
@@ -854,27 +856,32 @@ static const device_config_t wd8003_config[] = {
{ .description = "DC00", .value = 0xDC000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t wd8003eb_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x280,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x280,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x200", .value = 0x200 },
{ .description = "0x220", .value = 0x220 },
{ .description = "0x240", .value = 0x240 },
@@ -887,32 +894,34 @@ static const device_config_t wd8003eb_config[] = {
{ .description = "0x380", .value = 0x380 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2/9", .value = 9 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "ram_addr",
.description = "RAM Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xD0000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "ram_addr",
.description = "RAM Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xD0000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "C000", .value = 0xC0000 },
{ .description = "C400", .value = 0xC4000 },
{ .description = "C800", .value = 0xC8000 },
@@ -923,27 +932,33 @@ static const device_config_t wd8003eb_config[] = {
{ .description = "DC00", .value = 0xDC000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "ram_size",
.description = "RAM size",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 8192,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "ram_size",
.description = "RAM size",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 8192,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "8 KB", .value = 8192 },
{ .description = "32 KB", .value = 32768 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
@@ -952,14 +967,14 @@ static const device_config_t wd8003eb_config[] = {
http://www.stack.nl/~marcolz/network/wd80x3.html#WD8013EBT */
static const device_config_t wd8013_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x280,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x280,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x200", .value = 0x200 },
{ .description = "0x220", .value = 0x220 },
{ .description = "0x240", .value = 0x240 },
@@ -972,16 +987,17 @@ static const device_config_t wd8013_config[] = {
{ .description = "0x380", .value = 0x380 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 3,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 3,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 2/9", .value = 9 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 4", .value = 4 },
@@ -992,16 +1008,17 @@ static const device_config_t wd8013_config[] = {
{ .description = "IRQ 15", .value = 15 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "ram_addr",
.description = "RAM Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xD0000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "ram_addr",
.description = "RAM Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xD0000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "C000", .value = 0xC0000 },
{ .description = "C400", .value = 0xC4000 },
{ .description = "C800", .value = 0xC8000 },
@@ -1012,63 +1029,78 @@ static const device_config_t wd8013_config[] = {
{ .description = "DC00", .value = 0xDC000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "ram_size",
.description = "RAM size",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 16384,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "ram_size",
.description = "RAM size",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 16384,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "16 KB", .value = 16384 },
{ .description = "64 KB", .value = 65536 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t wd8013epa_config[] = {
{
.name = "ram_size",
.description = "Initial RAM size",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 16384,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "ram_size",
.description = "Initial RAM size",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 16384,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "8 KB", .value = 8192 },
{ .description = "16 KB", .value = 16384 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t mca_mac_config[] = {
{
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = "",
.default_int = -1
.name = "mac",
.description = "MAC Address",
.type = CONFIG_MAC,
.default_string = NULL,
.default_int = -1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -26,8 +26,8 @@
#include <string.h>
#include <wchar.h>
#include <86box/86box.h>
#include <86box/lpt.h>
#include <86box/timer.h>
#include <86box/lpt.h>
#include <86box/pit.h>
#include <86box/path.h>
#include <86box/plat.h>

View File

@@ -1158,14 +1158,14 @@ aha_init(const device_t *info)
// clang-format off
static const device_config_t aha_154xb_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x334,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x334,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "None", .value = 0 },
{ .description = "0x330", .value = 0x330 },
{ .description = "0x334", .value = 0x334 },
@@ -1175,16 +1175,17 @@ static const device_config_t aha_154xb_config[] = {
{ .description = "0x134", .value = 0x134 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 11,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 11,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 9", .value = 9 },
{ .description = "IRQ 10", .value = 10 },
{ .description = "IRQ 11", .value = 11 },
@@ -1193,31 +1194,33 @@ static const device_config_t aha_154xb_config[] = {
{ .description = "IRQ 15", .value = 15 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 6,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 6,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DMA 5", .value = 5 },
{ .description = "DMA 6", .value = 6 },
{ .description = "DMA 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "hostid",
.description = "Host ID",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 7,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "hostid",
.description = "Host ID",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 7,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0", .value = 0 },
{ .description = "1", .value = 1 },
{ .description = "2", .value = 2 },
@@ -1228,16 +1231,17 @@ static const device_config_t aha_154xb_config[] = {
{ .description = "7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "D000H", .value = 0xd0000 },
@@ -1245,20 +1249,21 @@ static const device_config_t aha_154xb_config[] = {
{ .description = "DC00H", .value = 0xdc000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t aha_154x_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x334,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x334,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "None", .value = 0 },
{ .description = "0x330", .value = 0x330 },
{ .description = "0x334", .value = 0x334 },
@@ -1268,16 +1273,17 @@ static const device_config_t aha_154x_config[] = {
{ .description = "0x134", .value = 0x134 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 11,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 11,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 9", .value = 9 },
{ .description = "IRQ 10", .value = 10 },
{ .description = "IRQ 11", .value = 11 },
@@ -1286,52 +1292,55 @@ static const device_config_t aha_154x_config[] = {
{ .description = "IRQ 15", .value = 15 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 6,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 6,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DMA 5", .value = 5 },
{ .description = "DMA 6", .value = 6 },
{ .description = "DMA 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "D000H", .value = 0xd0000 },
{ .description = "D800H", .value = 0xd8000 },
{ .description = "DC00H", .value = 0xdc000 },
{ .description = "" }
},
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t aha_154xcf_config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x334,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x334,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "None", .value = 0 },
{ .description = "0x330", .value = 0x330 },
{ .description = "0x334", .value = 0x334 },
@@ -1341,16 +1350,17 @@ static const device_config_t aha_154xcf_config[] = {
{ .description = "0x134", .value = 0x134 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 11,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 11,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 9", .value = 9 },
{ .description = "IRQ 10", .value = 10 },
{ .description = "IRQ 11", .value = 11 },
@@ -1359,31 +1369,33 @@ static const device_config_t aha_154xcf_config[] = {
{ .description = "IRQ 15", .value = 15 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 6,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 6,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DMA 5", .value = 5 },
{ .description = "DMA 6", .value = 6 },
{ .description = "DMA 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CC00H", .value = 0xcc000 },
@@ -1393,44 +1405,64 @@ static const device_config_t aha_154xcf_config[] = {
{ .description = "DC00H", .value = 0xdc000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "fdc_addr",
.description = "FDC Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "fdc_addr",
.description = "FDC Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "None", .value = 0 },
{ .description = "0x3f0", .value = FDC_PRIMARY_ADDR },
{ .description = "0x370", .value = FDC_SECONDARY_ADDR },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t aha_154xcp_config[] = {
{
.name = "bios_rev",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.name = "bios_rev",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.default_string = "v1_02_en",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.bios = {
{ .name = "Version 1.02 (English)", .internal_name = "v1_02_en", .bios_type = BIOS_NORMAL,
.files_no = 2, .local = 0, .size = 32768, .files = { "roms/scsi/adaptec/aha1542cp102.bin",
"roms/scsi/adaptec/908301-00_f_mcode_17c9.u12", "" } },
{ .name = "Version 1.02 (German)", .internal_name = "v1_02_de", .bios_type = BIOS_NORMAL,
.files_no = 2, .local = 0, .size = 32768, .files = { "roms/scsi/adaptec/buff_1-0_bios.bin",
"roms/scsi/adaptec/buff_1-0_mcode.bin", "" } },
{ .name = "Version 1.03 (English)", .internal_name = "v1_03_en", .bios_type = BIOS_NORMAL,
.files_no = 2, .local = 0, .size = 32768, .files = { "roms/scsi/adaptec/aha1542cp103.bin",
"roms/scsi/adaptec/908301-00_g_mcode_144c.u12.bin", "" } },
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.bios = {
{
.name = "Version 1.02 (English)",
.internal_name = "v1_02_en",
.bios_type = BIOS_NORMAL,
.files_no = 2,
.local = 0,
.size = 32768,
.files = { "roms/scsi/adaptec/aha1542cp102.bin", "roms/scsi/adaptec/908301-00_f_mcode_17c9.u12", "" }
},
{
.name = "Version 1.02 (German)",
.internal_name = "v1_02_de",
.bios_type = BIOS_NORMAL,
.files_no = 2,
.local = 0,
.size = 32768,
.files = { "roms/scsi/adaptec/buff_1-0_bios.bin", "roms/scsi/adaptec/buff_1-0_mcode.bin", "" }
},
{
.name = "Version 1.03 (English)",
.internal_name = "v1_03_en",
.bios_type = BIOS_NORMAL,
.files_no = 2,
.local = 0,
.size = 32768,
.files = { "roms/scsi/adaptec/aha1542cp103.bin", "roms/scsi/adaptec/908301-00_g_mcode_144c.u12.bin", "" }
},
{ .files_no = 0 }
},
},

View File

@@ -1780,14 +1780,14 @@ buslogic_init(const device_t *info)
// clang-format off
static const device_config_t BT_ISA_Config[] = {
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x334,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x334,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "0x330", .value = 0x330 },
{ .description = "0x334", .value = 0x334 },
{ .description = "0x230", .value = 0x230 },
@@ -1796,16 +1796,17 @@ static const device_config_t BT_ISA_Config[] = {
{ .description = "0x134", .value = 0x134 },
{ .description = "", .value = 0 }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 11,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 11,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "IRQ 9", .value = 9 },
{ .description = "IRQ 10", .value = 10 },
{ .description = "IRQ 11", .value = 11 },
@@ -1814,48 +1815,55 @@ static const device_config_t BT_ISA_Config[] = {
{ .description = "IRQ 15", .value = 15 },
{ .description = "", 0 }
},
.bios = { { 0 } }
},
{
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 6,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 6,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "DMA 5", .value = 5 },
{ .description = "DMA 6", .value = 6 },
{ .description = "DMA 7", .value = 7 },
{ .description = "", .value = 0 }
},
.bios = { { 0 } }
},
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "D000H", .value = 0xd0000 },
{ .description = "D800H", .value = 0xd8000 },
{ .description = "", .value = 0 }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t BT958D_Config[] = {
{
.name = "bios",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.name = "bios",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -778,14 +778,14 @@ corel_ls2000_available(void)
// clang-format off
static const device_config_t ncr53c400_mmio_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xD8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xD8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CC00H", .value = 0xcc000 },
{ .description = "D000H", .value = 0xd0000 },
@@ -794,36 +794,38 @@ static const device_config_t ncr53c400_mmio_config[] = {
{ .description = "DC00H", .value = 0xdc000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "None", .value = -1 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t rt1000b_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xD8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xD8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CC00H", .value = 0xcc000 },
{ .description = "D000H", .value = 0xd0000 },
@@ -832,36 +834,53 @@ static const device_config_t rt1000b_config[] = {
{ .description = "DC00H", .value = 0xdc000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "None", .value = -1 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "bios_ver",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.name = "bios_ver",
.description = "BIOS Revision",
.type = CONFIG_BIOS,
.default_string = "v8_10r",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = {
{ .name = "Version 8.10R", .internal_name = "v8_10r", .bios_type = BIOS_NORMAL,
.files_no = 1, .local = 0, .size = 8192, .files = { RT1000B_810R_ROM, "" } },
{ .name = "Version 8.20R", .internal_name = "v8_20r", .bios_type = BIOS_NORMAL,
.files_no = 1, .local = 0, .size = 8192, .files = { RT1000B_820R_ROM, "" } },
{
.name = "Version 8.10R",
.internal_name = "v8_10r",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 8192,
.files = { RT1000B_810R_ROM, "" }
},
{
.name = "Version 8.20R",
.internal_name = "v8_20r",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 8192,
.files = { RT1000B_820R_ROM, "" }
},
{ .files_no = 0 }
},
},
@@ -870,34 +889,35 @@ static const device_config_t rt1000b_config[] = {
static const device_config_t rt1000b_mc_config[] = {
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "None", .value = -1 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
static const device_config_t t130b_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xD8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xD8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0 },
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CC00H", .value = 0xcc000 },
@@ -905,38 +925,41 @@ static const device_config_t t130b_config[] = {
{ .description = "DC00H", .value = 0xdc000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0350,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x0350,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "240H", .value = 0x0240 },
{ .description = "250H", .value = 0x0250 },
{ .description = "340H", .value = 0x0340 },
{ .description = "350H", .value = 0x0350 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "None", .value = -1 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};

View File

@@ -2663,19 +2663,20 @@ ncr53c8xx_close(void *priv)
static const device_config_t ncr53c8xx_pci_config[] = {
// clang-format off
{
.name = "bios",
.description = "BIOS Revision",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 1,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios",
.description = "BIOS Revision",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 1,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "SDMS 4.x BIOS", .value = 2 },
{ .description = "SDMS 3.x BIOS", .value = 1 },
{ .description = "Disable BIOS", .value = 0 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -2458,11 +2458,15 @@ esp_close(void *priv)
static const device_config_t bios_enable_config[] = {
// clang-format off
{
.name = "bios",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
.name = "bios",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -1231,18 +1231,19 @@ spock_available(void)
static const device_config_t spock_rom_config[] = {
// clang-format off
{
.name = "bios_ver",
.description = "BIOS Revision",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 1,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_ver",
.description = "BIOS Revision",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 1,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "1991 BIOS (>1GB)", .value = 1 },
{ .description = "1990 BIOS", .value = 0 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on

View File

@@ -554,43 +554,49 @@ t128_available(void)
// clang-format off
static const device_config_t t128_config[] = {
{
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = "",
.default_int = 0xD8000,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "bios_addr",
.description = "BIOS Address",
.type = CONFIG_HEX20,
.default_string = NULL,
.default_int = 0xD8000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "C800H", .value = 0xc8000 },
{ .description = "CC00H", .value = 0xcc000 },
{ .description = "D800H", .value = 0xd8000 },
{ .description = "DC00H", .value = 0xdc000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 5,
.file_filter = "",
.spinner = { 0 },
.selection = {
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 5,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "None", .value = -1 },
{ .description = "IRQ 3", .value = 3 },
{ .description = "IRQ 5", .value = 5 },
{ .description = "IRQ 7", .value = 7 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "boot",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
.name = "boot",
.description = "Enable BIOS",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 1,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
@@ -610,7 +616,6 @@ const device_t scsi_t128_device = {
.config = t128_config
};
const device_t scsi_t228_device = {
.name = "Trantor T228",
.internal_name = "t228",

View File

@@ -78,7 +78,7 @@ lpt1_handler(i82091aa_t *dev)
}
if ((dev->regs[0x20] & 0x01) && lpt_port)
lpt1_init(lpt_port);
lpt1_setup(lpt_port);
lpt1_irq((dev->regs[0x20] & 0x08) ? LPT1_IRQ : LPT2_IRQ);
}

View File

@@ -305,7 +305,7 @@ acc3221_lpt_handle(acc3221_t *dev)
lpt1_remove();
if (!(dev->regs[0xbe] & REG_BE_LPT1_DISABLE))
lpt1_init(dev->regs[0xbf] << 2);
lpt1_setup(dev->regs[0xbf] << 2);
}
static void
@@ -437,7 +437,7 @@ acc3221_reset(acc3221_t *dev)
serial_setup(dev->uart[1], COM2_ADDR, COM2_IRQ);
lpt1_remove();
lpt1_init(LPT1_ADDR);
lpt1_setup(LPT1_ADDR);
lpt1_irq(LPT1_IRQ);
fdc_reset(dev->fdc);

View File

@@ -93,7 +93,7 @@ ali5123_lpt_handler(ali5123_t *dev)
if (global_enable && local_enable) {
ld_port = make_port(dev, 3) & 0xFFFC;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FFC))
lpt1_init(ld_port);
lpt1_setup(ld_port);
}
lpt1_irq(lpt_irq);
}
@@ -133,8 +133,10 @@ ali5123_serial_handler(ali5123_t *dev, int uart)
}
static void
ali5123_reset(ali5123_t *dev)
ali5123_reset(void *priv)
{
ali5123_t *dev = (ali5123_t *) priv;
memset(dev->regs, 0, 48);
dev->regs[0x20] = 0x43;
@@ -490,7 +492,7 @@ const device_t ali5123_device = {
.local = 0x40,
.init = ali5123_init,
.close = ali5123_close,
.reset = NULL,
.reset = ali5123_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,

View File

@@ -104,7 +104,7 @@ f82c710_update_ports(upc_t *dev, int set)
if (dev->regs[0] & 8) {
lpt_addr = dev->regs[6] * 4;
lpt1_init(lpt_addr);
lpt1_setup(lpt_addr);
if ((lpt_addr == LPT1_ADDR) || (lpt_addr == LPT_MDA_ADDR))
lpt1_irq(LPT1_IRQ);
else if (lpt_addr == LPT2_ADDR)
@@ -215,7 +215,7 @@ f82c606_update_ports(upc_t *dev, int set)
}
if (dev->regs[0] & 8) {
lpt1_init(((uint16_t) dev->regs[6]) << 2);
lpt1_setup(((uint16_t) dev->regs[6]) << 2);
lpt1_irq(lpt1_int);
f82c710_log("LPT1 at %04X, IRQ %i\n", ((uint16_t) dev->regs[6]) << 2, lpt1_int);
}

View File

@@ -107,7 +107,7 @@ fdc37c669_lpt_handler(fdc37c669_t *dev)
lpt_port_remove(dev->id);
if ((dev->regs[0x01] & 0x04) && (dev->regs[0x23] >= 0x40))
lpt_port_init(dev->id, ((uint16_t) (dev->regs[0x23] & mask)) << 2);
lpt_port_setup(dev->id, ((uint16_t) (dev->regs[0x23] & mask)) << 2);
}
static void

View File

@@ -134,7 +134,7 @@ fdc37c67x_lpt_handler(fdc37c67x_t *dev)
if (global_enable && local_enable) {
ld_port = make_port(dev, 3) & 0xFFFC;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FFC))
lpt1_init(ld_port);
lpt1_setup(ld_port);
}
lpt1_irq(lpt_irq);
}

View File

@@ -111,16 +111,16 @@ lpt1_handler(fdc37c6xx_t *dev)
lpt1_remove();
switch (dev->regs[1] & 3) {
case 1:
lpt1_init(LPT_MDA_ADDR);
lpt1_irq(7);
lpt1_setup(LPT_MDA_ADDR);
lpt1_irq(LPT_MDA_IRQ);
break;
case 2:
lpt1_init(LPT1_ADDR);
lpt1_irq(7 /*5*/);
lpt1_setup(LPT1_ADDR);
lpt1_irq(LPT1_IRQ /*LPT2_IRQ*/);
break;
case 3:
lpt1_init(LPT2_ADDR);
lpt1_irq(7 /*5*/);
lpt1_setup(LPT2_ADDR);
lpt1_irq(LPT1_IRQ /*LPT2_IRQ*/);
break;
default:
@@ -252,7 +252,7 @@ fdc37c6xx_reset(fdc37c6xx_t *dev)
serial_setup(dev->uart[1], COM2_ADDR, COM2_IRQ);
lpt1_remove();
lpt1_init(LPT1_ADDR);
lpt1_setup(LPT1_ADDR);
fdc_reset(dev->fdc);
fdc_remove(dev->fdc);

View File

@@ -35,24 +35,15 @@
#include <86box/machine.h>
#include <86box/nvr.h>
#include <86box/apm.h>
#include <86box/access_bus.h>
#include <86box/acpi.h>
#include <86box/sio.h>
#include <86box/plat_unused.h>
#define AB_RST 0x80
typedef struct access_bus_t {
uint8_t control;
uint8_t status;
uint8_t own_addr;
uint8_t data;
uint8_t clock;
uint16_t base;
} access_bus_t;
typedef struct fdc37c93x_t {
uint8_t chip_id;
uint8_t is_apm;
uint8_t is_compaq;
uint8_t has_nvr;
uint8_t tries;
uint8_t port_370;
@@ -61,51 +52,56 @@ typedef struct fdc37c93x_t {
uint8_t regs[48];
uint8_t ld_regs[11][256];
uint16_t superio_base;
uint16_t fdc_base;
uint16_t lpt_base;
uint16_t nvr_pri_base;
uint16_t nvr_sec_base;
uint16_t kbc_base;
uint16_t gpio_base; /* Set to EA */
uint16_t auxio_base;
uint16_t nvr_sec_base;
uint16_t uart_base[2];
int locked;
int cur_reg;
fdc_t *fdc;
serial_t *uart[2];
access_bus_t *access_bus;
nvr_t *nvr;
acpi_t *acpi;
void *kbc;
serial_t *uart[2];
} fdc37c93x_t;
static void fdc37c93x_write(uint16_t port, uint8_t val, void *priv);
static uint8_t fdc37c93x_read(uint16_t port, void *priv);
static uint16_t
make_port_superio(fdc37c93x_t *dev)
make_port_superio(const fdc37c93x_t *dev)
{
uint16_t r0 = dev->regs[0x26];
uint16_t r1 = dev->regs[0x27];
const uint16_t r0 = dev->regs[0x26];
const uint16_t r1 = dev->regs[0x27];
uint16_t p = (r1 << 8) + r0;
const uint16_t p = (r1 << 8) + r0;
return p;
}
static uint16_t
make_port(fdc37c93x_t *dev, uint8_t ld)
make_port(const fdc37c93x_t *dev, const uint8_t ld)
{
uint16_t r0 = dev->ld_regs[ld][0x60];
uint16_t r1 = dev->ld_regs[ld][0x61];
const uint16_t r0 = dev->ld_regs[ld][0x60];
const uint16_t r1 = dev->ld_regs[ld][0x61];
uint16_t p = (r0 << 8) + r1;
const uint16_t p = (r0 << 8) + r1;
return p;
}
static uint16_t
make_port_sec(fdc37c93x_t *dev, uint8_t ld)
make_port_sec(const fdc37c93x_t *dev, const uint8_t ld)
{
uint16_t r0 = dev->ld_regs[ld][0x62];
uint16_t r1 = dev->ld_regs[ld][0x63];
const uint16_t r0 = dev->ld_regs[ld][0x62];
const uint16_t r1 = dev->ld_regs[ld][0x63];
uint16_t p = (r0 << 8) + r1;
const uint16_t p = (r0 << 8) + r1;
return p;
}
@@ -150,66 +146,91 @@ fdc37c93x_gpio_write(uint16_t port, uint8_t val, void *priv)
static void
fdc37c93x_superio_handler(fdc37c93x_t *dev)
{
io_removehandler(dev->superio_base, 0x0002,
fdc37c93x_read, NULL, NULL, fdc37c93x_write, NULL, NULL, dev);
dev->superio_base = make_port_superio(dev);
io_sethandler(dev->superio_base, 0x0002,
fdc37c93x_read, NULL, NULL, fdc37c93x_write, NULL, NULL, dev);
if (!dev->is_compaq) {
if (dev->superio_base != 0x0000)
io_removehandler(dev->superio_base, 0x0002,
fdc37c93x_read, NULL, NULL, fdc37c93x_write, NULL, NULL, dev);
dev->superio_base = make_port_superio(dev);
if (dev->superio_base != 0x0000)
io_sethandler(dev->superio_base, 0x0002,
fdc37c93x_read, NULL, NULL, fdc37c93x_write, NULL, NULL, dev);
}
}
static void
fdc37c93x_fdc_handler(fdc37c93x_t *dev)
{
uint16_t ld_port = 0;
uint8_t global_enable = !!(dev->regs[0x22] & (1 << 0));
uint8_t local_enable = !!dev->ld_regs[0][0x30];
const uint8_t global_enable = !!(dev->regs[0x22] & (1 << 0));
const uint8_t local_enable = !!dev->ld_regs[0][0x30];
const uint16_t old_base = dev->fdc_base;
fdc_remove(dev->fdc);
if (global_enable && local_enable) {
ld_port = make_port(dev, 0) & 0xFFF8;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FF8))
fdc_set_base(dev->fdc, ld_port);
dev->fdc_base = 0x0000;
if (global_enable && local_enable)
dev->fdc_base = make_port(dev, 0) & 0xfff8;
if (dev->fdc_base != old_base) {
if ((old_base >= 0x0100) && (old_base <= 0x0ff8))
fdc_remove(dev->fdc);
if ((dev->fdc_base >= 0x0100) && (dev->fdc_base <= 0x0ff8))
fdc_set_base(dev->fdc, dev->fdc_base);
}
}
static void
fdc37c93x_lpt_handler(fdc37c93x_t *dev)
{
uint16_t ld_port = 0;
uint8_t global_enable = !!(dev->regs[0x22] & (1 << 3));
uint8_t local_enable = !!dev->ld_regs[3][0x30];
uint8_t lpt_irq = dev->ld_regs[3][0x70];
const uint8_t global_enable = !!(dev->regs[0x22] & (1 << 3));
const uint8_t local_enable = !!dev->ld_regs[3][0x30];
uint8_t lpt_irq = dev->ld_regs[3][0x70];
const uint16_t old_base = dev->lpt_base;
if (lpt_irq > 15)
lpt_irq = 0xff;
lpt1_remove();
if (global_enable && local_enable) {
ld_port = make_port(dev, 3) & 0xFFFC;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FFC))
lpt1_init(ld_port);
dev->lpt_base = 0x0000;
if (global_enable && local_enable)
dev->lpt_base = make_port(dev, 3) & 0xfffc;
if (dev->lpt_base != old_base) {
if ((old_base >= 0x0100) && (old_base <= 0x0ffc))
lpt1_remove();
if ((dev->lpt_base >= 0x0100) && (dev->lpt_base <= 0x0ffc))
lpt1_setup(dev->lpt_base);
}
lpt1_irq(lpt_irq);
}
static void
fdc37c93x_serial_handler(fdc37c93x_t *dev, int uart)
fdc37c93x_serial_handler(fdc37c93x_t *dev, const int uart)
{
uint16_t ld_port = 0;
uint8_t uart_no = 4 + uart;
uint8_t global_enable = !!(dev->regs[0x22] & (1 << uart_no));
uint8_t local_enable = !!dev->ld_regs[uart_no][0x30];
const uint8_t uart_no = 4 + uart;
const uint8_t global_enable = !!(dev->regs[0x22] & (1 << uart_no));
const uint8_t local_enable = !!dev->ld_regs[uart_no][0x30];
const uint16_t old_base = dev->uart_base[uart];
serial_remove(dev->uart[uart]);
if (global_enable && local_enable) {
ld_port = make_port(dev, uart_no) & 0xFFF8;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FF8))
serial_setup(dev->uart[uart], ld_port, dev->ld_regs[uart_no][0x70]);
dev->uart_base[uart] = 0x0000;
if (global_enable && local_enable)
dev->uart_base[uart] = make_port(dev, uart_no) & 0xfff8;
if (dev->uart_base[uart] != old_base) {
if ((old_base >= 0x0100) && (old_base <= 0x0ff8))
serial_remove(dev->uart[uart]);
if ((dev->uart_base[uart] >= 0x0100) && (dev->uart_base[uart] <= 0x0ff8))
serial_setup(dev->uart[uart], dev->uart_base[uart], dev->ld_regs[uart_no][0x70]);
}
serial_irq(dev->uart[uart], dev->ld_regs[uart_no][0x70]);
}
static void
fdc37c93x_nvr_pri_handler(fdc37c93x_t *dev)
fdc37c93x_nvr_pri_handler(const fdc37c93x_t *dev)
{
uint8_t local_enable = !!dev->ld_regs[6][0x30];
@@ -224,18 +245,24 @@ fdc37c93x_nvr_pri_handler(fdc37c93x_t *dev)
static void
fdc37c93x_nvr_sec_handler(fdc37c93x_t *dev)
{
uint16_t ld_port = 0;
uint8_t local_enable = !!dev->ld_regs[6][0x30];
uint8_t local_enable = !!dev->ld_regs[6][0x30];
const uint16_t old_base = dev->nvr_sec_base;
local_enable &= (((dev->ld_regs[6][0xf0] & 0xe0) == 0x80) ||
((dev->ld_regs[6][0xf0] & 0xe0) == 0xe0));
nvr_at_sec_handler(0, dev->nvr_sec_base, dev->nvr);
if (local_enable) {
dev->nvr_sec_base = ld_port = make_port_sec(dev, 6) & 0xFFFE;
dev->nvr_sec_base = 0x0000;
if (local_enable)
dev->nvr_sec_base = make_port_sec(dev, 6) & 0xfffe;
if (dev->nvr_sec_base != old_base) {
if ((old_base > 0x0000) && (old_base <= 0x0ffe))
nvr_at_sec_handler(0, dev->nvr_sec_base, dev->nvr);
/* Datasheet erratum: First it says minimum address is 0x0100, but later implies that it's 0x0000
and that default is 0x0070, same as (unrelocatable) primary NVR. */
if (ld_port <= 0x0FFE)
if ((dev->nvr_sec_base > 0x0000) && (dev->nvr_sec_base <= 0x0ffe))
nvr_at_sec_handler(1, dev->nvr_sec_base, dev->nvr);
}
}
@@ -243,22 +270,32 @@ fdc37c93x_nvr_sec_handler(fdc37c93x_t *dev)
static void
fdc37c93x_kbc_handler(fdc37c93x_t *dev)
{
uint8_t local_enable = !!dev->ld_regs[7][0x30];
const uint8_t local_enable = !!dev->ld_regs[7][0x30];
const uint16_t old_base = dev->kbc_base;
kbc_at_handler(local_enable, dev->kbc);
dev->kbc_base = local_enable ? 0x0060 : 0x0000;
if (dev->kbc_base != old_base)
kbc_at_handler(local_enable, dev->kbc);
}
static void
fdc37c93x_auxio_handler(fdc37c93x_t *dev)
{
uint16_t ld_port = 0;
uint8_t local_enable = !!dev->ld_regs[8][0x30];
const uint8_t local_enable = !!dev->ld_regs[8][0x30];
const uint16_t old_base = dev->auxio_base;
io_removehandler(dev->auxio_base, 0x0001,
fdc37c93x_auxio_read, NULL, NULL, fdc37c93x_auxio_write, NULL, NULL, dev);
if (local_enable) {
dev->auxio_base = ld_port = make_port(dev, 8);
if ((ld_port >= 0x0100) && (ld_port <= 0x0FFF))
if (local_enable)
dev->auxio_base = make_port(dev, 8);
else
dev->auxio_base = 0x0000;
if (dev->auxio_base != old_base) {
if ((old_base >= 0x0100) && (old_base <= 0x0fff))
io_removehandler(old_base, 0x0001,
fdc37c93x_auxio_read, NULL, NULL, fdc37c93x_auxio_write, NULL, NULL, dev);
if ((dev->auxio_base >= 0x0100) && (dev->auxio_base <= 0x0fff))
io_sethandler(dev->auxio_base, 0x0001,
fdc37c93x_auxio_read, NULL, NULL, fdc37c93x_auxio_write, NULL, NULL, dev);
}
@@ -267,113 +304,55 @@ fdc37c93x_auxio_handler(fdc37c93x_t *dev)
static void
fdc37c93x_gpio_handler(fdc37c93x_t *dev)
{
uint16_t ld_port = 0;
uint8_t local_enable;
const uint8_t local_enable = !dev->locked && !!(dev->regs[0x03] & 0x80);
const uint16_t old_base = dev->gpio_base;
local_enable = !!(dev->regs[0x03] & 0x80);
dev->gpio_base = 0x0000;
io_removehandler(dev->gpio_base, 0x0002,
fdc37c93x_gpio_read, NULL, NULL, fdc37c93x_gpio_write, NULL, NULL, dev);
if (local_enable) {
switch (dev->regs[0x03] & 0x03) {
case 0:
ld_port = 0xe0;
break;
case 1:
ld_port = 0xe2;
break;
case 2:
ld_port = 0xe4;
break;
case 3:
ld_port = 0xea; /* Default */
break;
if (local_enable) switch (dev->regs[0x03] & 0x03) {
default:
break;
case 0:
dev->gpio_base = 0x00e0;
break;
case 1:
dev->gpio_base = 0x00e2;
break;
case 2:
dev->gpio_base = 0x00e4;
break;
case 3:
dev->gpio_base = 0x00ea; /* Default */
break;
}
default:
break;
}
dev->gpio_base = ld_port;
if (ld_port > 0x0000)
if (dev->gpio_base != old_base) {
if (old_base != 0x0000)
io_removehandler(old_base, 0x0002,
fdc37c93x_gpio_read, NULL, NULL, fdc37c93x_gpio_write, NULL, NULL, dev);
if (dev->gpio_base > 0x0000)
io_sethandler(dev->gpio_base, 0x0002,
fdc37c93x_gpio_read, NULL, NULL, fdc37c93x_gpio_write, NULL, NULL, dev);
}
}
static uint8_t
fdc37c93x_access_bus_read(uint16_t port, void *priv)
{
const access_bus_t *dev = (access_bus_t *) priv;
uint8_t ret = 0xff;
switch (port & 3) {
case 0:
ret = (dev->status & 0xBF);
break;
case 1:
ret = (dev->own_addr & 0x7F);
break;
case 2:
ret = dev->data;
break;
case 3:
ret = (dev->clock & 0x87);
break;
default:
break;
}
return ret;
}
static void
fdc37c93x_access_bus_write(uint16_t port, uint8_t val, void *priv)
{
access_bus_t *dev = (access_bus_t *) priv;
switch (port & 3) {
case 0:
dev->control = (val & 0xCF);
break;
case 1:
dev->own_addr = (val & 0x7F);
break;
case 2:
dev->data = val;
break;
case 3:
dev->clock &= 0x80;
dev->clock |= (val & 0x07);
break;
default:
break;
}
}
static void
fdc37c93x_access_bus_handler(fdc37c93x_t *dev)
{
uint16_t ld_port = 0;
uint8_t global_enable = !!(dev->regs[0x22] & (1 << 6));
uint8_t local_enable = !!dev->ld_regs[9][0x30];
const uint8_t global_enable = !!(dev->regs[0x22] & (1 << 6));
const uint8_t local_enable = !!dev->ld_regs[9][0x30];
const uint16_t ld_port = dev->access_bus->base = make_port(dev, 9);
io_removehandler(dev->access_bus->base, 0x0004,
fdc37c93x_access_bus_read, NULL, NULL, fdc37c93x_access_bus_write, NULL, NULL, dev->access_bus);
if (global_enable && local_enable) {
dev->access_bus->base = ld_port = make_port(dev, 9);
if ((ld_port >= 0x0100) && (ld_port <= 0x0FFC))
io_sethandler(dev->access_bus->base, 0x0004,
fdc37c93x_access_bus_read, NULL, NULL, fdc37c93x_access_bus_write, NULL, NULL, dev->access_bus);
}
access_bus_handler(dev->access_bus, global_enable && local_enable, ld_port);
}
static void
fdc37c93x_acpi_handler(fdc37c93x_t *dev)
{
uint16_t ld_port = 0;
uint8_t local_enable = !!dev->ld_regs[0x0a][0x30];
uint8_t sci_irq = dev->ld_regs[0x0a][0x70];
uint16_t ld_port;
const uint8_t local_enable = !!dev->ld_regs[0x0a][0x30];
const uint8_t sci_irq = dev->ld_regs[0x0a][0x70];
acpi_update_io_mapping(dev->acpi, 0x0000, local_enable);
if (local_enable) {
@@ -392,41 +371,49 @@ fdc37c93x_acpi_handler(fdc37c93x_t *dev)
acpi_set_irq_line(dev->acpi, sci_irq);
}
static void
fdc37c93x_state_change(fdc37c93x_t *dev, const uint8_t locked)
{
dev->locked = locked;
fdc_3f1_enable(dev->fdc, !locked);
fdc37c93x_gpio_handler(dev);
}
static void
fdc37c93x_write(uint16_t port, uint8_t val, void *priv)
{
fdc37c93x_t *dev = (fdc37c93x_t *) priv;
uint8_t index = (port & 1) ? 0 : 1;
uint8_t valxor = 0x00;
uint8_t keep = 0x00;
uint8_t valxor;
/* Compaq Presario 4500: Unlock at FB, Register at EA, Data at EB, Lock at F9. */
if ((port == 0xea) || (port == 0xf9) || (port == 0xfb))
if (port == 0xea)
index = 1;
else if (port == 0xeb)
index = 0;
if (index) {
if ((val == 0x55) && !dev->locked) {
if (port == 0xfb) {
fdc37c93x_state_change(dev, 1);
dev->tries = 0;
return;
} else if (port == 0xf9) {
fdc37c93x_state_change(dev, 0);
return;
} else if (index) {
if ((!dev->is_compaq) && (val == 0x55) && !dev->locked) {
if (dev->tries) {
dev->locked = 1;
fdc_3f1_enable(dev->fdc, 0);
fdc37c93x_state_change(dev, 1);
dev->tries = 0;
} else
dev->tries++;
} else {
if (dev->locked) {
if (val == 0xaa) {
dev->locked = 0;
fdc_3f1_enable(dev->fdc, 1);
return;
}
dev->cur_reg = val;
} else {
if (dev->tries)
dev->tries = 0;
} else if (dev->locked) {
if ((!dev->is_compaq) && (val == 0xaa)) {
fdc37c93x_state_change(dev, 0);
return;
}
}
dev->cur_reg = val;
} else if ((!dev->is_compaq) && dev->tries)
dev->tries = 0;
return;
} else {
if (dev->locked) {
@@ -436,6 +423,8 @@ fdc37c93x_write(uint16_t port, uint8_t val, void *priv)
return;
dev->regs[dev->cur_reg] = val;
} else {
uint8_t keep = 0x00;
valxor = val ^ dev->ld_regs[dev->regs[7]][dev->cur_reg];
if (((dev->cur_reg & 0xF0) == 0x70) && (dev->regs[7] < 4))
return;
@@ -479,9 +468,11 @@ fdc37c93x_write(uint16_t port, uint8_t val, void *priv)
if (dev->cur_reg < 48) {
switch (dev->cur_reg) {
case 0x02:
if (val == 0x02)
fdc37c93x_state_change(dev, 0);
break;
case 0x03:
if (valxor & 0x83)
fdc37c93x_gpio_handler(dev);
dev->regs[0x03] &= 0x83;
break;
case 0x22:
@@ -788,91 +779,95 @@ fdc37c93x_read(uint16_t port, void *priv)
static void
fdc37c93x_reset(fdc37c93x_t *dev)
{
memset(dev->regs, 0, 48);
memset(dev->regs, 0x00, sizeof(dev->regs));
dev->regs[0x03] = 0x03;
dev->regs[0x20] = dev->chip_id;
dev->regs[0x21] = 0x01;
dev->regs[0x22] = 0x39;
dev->regs[0x24] = 0x04;
if (dev->chip_id != 0x02) {
dev->regs[0x26] = dev->port_370 ? 0x70 : 0xF0;
dev->regs[0x27] = 0x03;
}
dev->regs[0x26] = dev->port_370 ? 0x70 : 0xf0;
dev->regs[0x27] = 0x03;
for (uint8_t i = 0; i < 11; i++)
memset(dev->ld_regs[i], 0, 256);
memset(dev->ld_regs, 0x00, sizeof(dev->ld_regs));
/* Logical device 0: FDD */
dev->ld_regs[0][0x30] = 0;
dev->ld_regs[0][0x60] = 3;
dev->ld_regs[0][0x61] = 0xF0;
dev->ld_regs[0][0x70] = 6;
dev->ld_regs[0][0x74] = 2;
dev->ld_regs[0][0xF0] = 0xE;
dev->ld_regs[0][0xF2] = 0xFF;
dev->ld_regs[0x00][0x30] = 0x00;
dev->ld_regs[0x00][0x60] = 0x03;
dev->ld_regs[0x00][0x61] = 0xf0;
dev->ld_regs[0x00][0x70] = 0x06;
dev->ld_regs[0x00][0x74] = 0x02;
dev->ld_regs[0x00][0xf0] = 0x0e;
dev->ld_regs[0x00][0xf2] = 0xff;
/* Logical device 1: IDE1 */
dev->ld_regs[1][0x30] = 0;
dev->ld_regs[1][0x60] = 1;
dev->ld_regs[1][0x61] = 0xF0;
dev->ld_regs[1][0x62] = 3;
dev->ld_regs[1][0x63] = 0xF6;
dev->ld_regs[1][0x70] = 0xE;
dev->ld_regs[1][0xF0] = 0xC;
dev->ld_regs[0x01][0x30] = 0x00;
dev->ld_regs[0x01][0x60] = 0x01;
dev->ld_regs[0x01][0x61] = 0xf0;
dev->ld_regs[0x01][0x62] = 0x03;
dev->ld_regs[0x01][0x63] = 0xf6;
dev->ld_regs[0x01][0x70] = 0x0e;
dev->ld_regs[0x01][0xf0] = 0x0c;
/* Logical device 2: IDE2 */
dev->ld_regs[2][0x30] = 0;
dev->ld_regs[2][0x60] = 1;
dev->ld_regs[2][0x61] = 0x70;
dev->ld_regs[2][0x62] = 3;
dev->ld_regs[2][0x63] = 0x76;
dev->ld_regs[2][0x70] = 0xF;
dev->ld_regs[0x02][0x30] = 0x00;
dev->ld_regs[0x02][0x60] = 0x01;
dev->ld_regs[0x02][0x61] = 0x70;
dev->ld_regs[0x02][0x62] = 0x03;
dev->ld_regs[0x02][0x63] = 0x76;
dev->ld_regs[0x02][0x70] = 0x0f;
/* Logical device 3: Parallel Port */
dev->ld_regs[3][0x30] = 0;
dev->ld_regs[3][0x60] = 3;
dev->ld_regs[3][0x61] = 0x78;
dev->ld_regs[3][0x70] = 7;
dev->ld_regs[3][0x74] = 4;
dev->ld_regs[3][0xF0] = 0x3C;
dev->ld_regs[0x03][0x30] = 0x00;
dev->ld_regs[0x03][0x60] = 0x03;
dev->ld_regs[0x03][0x61] = 0x78;
dev->ld_regs[0x03][0x70] = 0x07;
dev->ld_regs[0x03][0x74] = 0x04;
dev->ld_regs[0x03][0xf0] = 0x3c;
/* Logical device 4: Serial Port 1 */
dev->ld_regs[4][0x30] = 0;
dev->ld_regs[4][0x60] = 3;
dev->ld_regs[4][0x61] = 0xf8;
dev->ld_regs[4][0x70] = 4;
dev->ld_regs[4][0xF0] = 3;
serial_setup(dev->uart[0], COM1_ADDR, dev->ld_regs[4][0x70]);
dev->ld_regs[0x04][0x30] = 0x00;
dev->ld_regs[0x04][0x60] = 0x03;
dev->ld_regs[0x04][0x61] = 0xf8;
dev->ld_regs[0x04][0x70] = 0x04;
dev->ld_regs[0x04][0xf0] = 0x03;
serial_irq(dev->uart[0], dev->ld_regs[4][0x70]);
/* Logical device 5: Serial Port 2 */
dev->ld_regs[5][0x30] = 0;
dev->ld_regs[5][0x60] = 2;
dev->ld_regs[5][0x61] = 0xf8;
dev->ld_regs[5][0x70] = 3;
dev->ld_regs[5][0x74] = 4;
dev->ld_regs[5][0xF1] = 2;
dev->ld_regs[5][0xF2] = 3;
serial_setup(dev->uart[1], COM2_ADDR, dev->ld_regs[5][0x70]);
dev->ld_regs[0x05][0x30] = 0x00;
dev->ld_regs[0x05][0x60] = 0x02;
dev->ld_regs[0x05][0x61] = 0xf8;
dev->ld_regs[0x05][0x70] = 0x03;
dev->ld_regs[0x05][0x74] = 0x04;
dev->ld_regs[0x05][0xf1] = 0x02;
dev->ld_regs[0x05][0xf2] = 0x03;
serial_irq(dev->uart[1], dev->ld_regs[5][0x70]);
/* Logical device 6: RTC */
dev->ld_regs[6][0x30] = 0;
dev->ld_regs[6][0x60] = 0x70;
if (dev->chip_id != 0x02)
dev->ld_regs[6][0x63] = (dev->has_nvr) ? 0x70 : 0x00;
dev->ld_regs[6][0xF0] = 0;
dev->ld_regs[6][0xF4] = 3;
dev->ld_regs[0x06][0x30] = 0x00;
dev->ld_regs[0x06][0x63] = (dev->has_nvr) ? 0x70 : 0x00;
dev->ld_regs[0x06][0xf0] = 0x00;
dev->ld_regs[0x06][0xf4] = 0x03;
/* Logical device 7: Keyboard */
dev->ld_regs[7][0x30] = 0;
dev->ld_regs[7][0x61] = 0x60;
dev->ld_regs[7][0x70] = 1;
dev->ld_regs[0x07][0x30] = 0x00;
dev->ld_regs[0x07][0x61] = 0x60;
dev->ld_regs[0x07][0x70] = 0x01;
/* Logical device 8: Auxiliary I/O */
dev->ld_regs[0x08][0x30] = 0x00;
dev->ld_regs[0x08][0x60] = 0x00;
dev->ld_regs[0x08][0x61] = 0x00;
/* Logical device 9: ACCESS.bus */
dev->ld_regs[0x09][0x30] = 0x00;
dev->ld_regs[0x09][0x60] = 0x00;
dev->ld_regs[0x09][0x61] = 0x00;
/* Logical device A: ACPI */
dev->ld_regs[0x0a][0x30] = 0x00;
dev->ld_regs[0x0a][0x60] = 0x00;
dev->ld_regs[0x0a][0x61] = 0x00;
fdc37c93x_gpio_handler(dev);
fdc37c93x_lpt_handler(dev);
@@ -907,36 +902,6 @@ fdc37c93x_reset(fdc37c93x_t *dev)
dev->locked = 0;
}
static void
access_bus_close(void *priv)
{
access_bus_t *dev = (access_bus_t *) priv;
free(dev);
}
static void *
access_bus_init(UNUSED(const device_t *info))
{
access_bus_t *dev = (access_bus_t *) calloc(1, sizeof(access_bus_t));
return dev;
}
static const device_t access_bus_device = {
.name = "SMC FDC37C932FR ACCESS.bus",
.internal_name = "access_bus",
.flags = 0,
.local = 0x03,
.init = access_bus_init,
.close = access_bus_close,
.reset = NULL,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static void
fdc37c93x_close(void *priv)
{
@@ -948,19 +913,18 @@ fdc37c93x_close(void *priv)
static void *
fdc37c93x_init(const device_t *info)
{
int is_compaq;
fdc37c93x_t *dev = (fdc37c93x_t *) calloc(1, sizeof(fdc37c93x_t));
dev->fdc = device_add(&fdc_at_smc_device);
dev->uart[0] = device_add_inst(&ns16550_device, 1);
dev->uart[1] = device_add_inst(&ns16550_device, 2);
dev->uart[0] = device_add_inst(&ns16550_device, 1);
dev->uart[1] = device_add_inst(&ns16550_device, 2);
dev->chip_id = info->local & 0xff;
dev->is_apm = (info->local >> 8) & 0x01;
is_compaq = (info->local >> 8) & 0x02;
dev->has_nvr = !((info->local >> 8) & 0x04);
dev->port_370 = ((info->local >> 8) & 0x08);
dev->chip_id = info->local & 0xff;
dev->is_apm = (info->local >> 8) & 0x01;
dev->is_compaq = (info->local >> 8) & 0x02;
dev->has_nvr = !((info->local >> 8) & 0x04);
dev->port_370 = ((info->local >> 8) & 0x08);
dev->gpio_regs[0] = 0xff;
#if 0
@@ -981,7 +945,7 @@ fdc37c93x_init(const device_t *info)
if (dev->is_apm)
dev->acpi = device_add(&acpi_smc_device);
if (is_compaq) {
if (dev->is_compaq) {
io_sethandler(0x0ea, 0x0002,
fdc37c93x_read, NULL, NULL, fdc37c93x_write, NULL, NULL, dev);
io_sethandler(0x0f9, 0x0001,
@@ -992,6 +956,16 @@ fdc37c93x_init(const device_t *info)
dev->kbc = device_add(&keyboard_ps2_ami_pci_device);
/* Set the defaults here so the ports can be removed by fdc37c93x_reset(). */
dev->fdc_base = 0x03f0;
dev->lpt_base = 0x0378;
dev->uart_base[0] = 0x03f8;
dev->uart_base[1] = 0x02f8;
dev->nvr_pri_base = 0x0070;
dev->nvr_sec_base = 0x0070;
dev->kbc_base = 0x0060;
dev->gpio_base = 0x00ea;
fdc37c93x_reset(dev);
if (dev->chip_id == 0x02) {
@@ -1115,4 +1089,3 @@ const device_t fdc37c935_no_nvr_device = {
.force_redraw = NULL,
.config = NULL
};

View File

@@ -216,7 +216,7 @@ fdc37m60x_lpt_handler(fdc37m60x_t *dev)
lpt1_remove();
if (ENABLED(3) || (POWER_CONTROL & 0x08)) {
lpt1_init(BASE_ADDRESS(3));
lpt1_setup(BASE_ADDRESS(3));
lpt1_irq(IRQ(3) & 0xf);
fdc37m60x_log("SMC60x-LPT: BASE %04x IRQ %d\n", BASE_ADDRESS(3), IRQ(3) & 0xf);
}

View File

@@ -294,7 +294,7 @@ it8661f_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *pri
if (config->activate && (config->io[0].base != ISAPNP_IO_DISABLED)) {
it86x1f_log("IT86x1F: LPT enabled at port %04X IRQ %d\n", config->io[0].base, config->irq[0].irq);
lpt1_init(config->io[0].base);
lpt1_setup(config->io[0].base);
} else {
it86x1f_log("IT86x1F: LPT disabled\n");
}

View File

@@ -154,7 +154,7 @@ lpt1_handler(pc87306_t *dev)
lpt_irq = (dev->regs[0x1b] & 0x20) ? 7 : 5;
if (lpt_port)
lpt1_init(lpt_port);
lpt1_setup(lpt_port);
lpt1_irq(lpt_irq);
}
@@ -303,26 +303,26 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
}
break;
case 0x02:
if (valxor & 1) {
if (valxor & 0x01) {
lpt1_remove();
serial_remove(dev->uart[0]);
serial_remove(dev->uart[1]);
serial_remove(dev->uart[0x00]);
serial_remove(dev->uart[0x01]);
fdc_remove(dev->fdc);
if (!(val & 1)) {
if (dev->regs[0] & 1)
if (dev->regs[0x00] & 0x01)
lpt1_handler(dev);
if (dev->regs[0] & 2)
if (dev->regs[0x00] & 0x02)
serial_handler(dev, 0);
if (dev->regs[0] & 4)
if (dev->regs[0x00] & 0x04)
serial_handler(dev, 1);
if (dev->regs[0] & 8)
fdc_set_base(dev->fdc, (dev->regs[0] & 0x20) ? FDC_SECONDARY_ADDR : FDC_PRIMARY_ADDR);
if (dev->regs[0x00] & 0x08)
fdc_set_base(dev->fdc, (dev->regs[0x00] & 0x20) ? FDC_SECONDARY_ADDR : FDC_PRIMARY_ADDR);
}
}
if (valxor & 8) {
if (valxor & 0x08) {
lpt1_remove();
if ((dev->regs[0] & 1) && !(dev->regs[2] & 1))
if ((dev->regs[0x00] & 1) && !(dev->regs[0x02] & 1))
lpt1_handler(dev);
}
break;
@@ -359,7 +359,7 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
lpt1_handler(dev);
}
break;
case 0x1B:
case 0x1b:
if (valxor & 0x70) {
lpt1_remove();
if (!(val & 0x40))
@@ -368,7 +368,7 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
lpt1_handler(dev);
}
break;
case 0x1C:
case 0x1c:
if (valxor) {
serial_remove(dev->uart[0]);
serial_remove(dev->uart[1]);

View File

@@ -200,7 +200,7 @@ lpt1_handler(pc87307_t *dev)
irq = (dev->ld_regs[0x04][0x40] & 0x0f);
if (active && (addr <= 0xfffc)) {
lpt1_init(addr);
lpt1_setup(addr);
lpt1_irq(irq);
}
}

View File

@@ -137,7 +137,7 @@ lpt1_handler(pc87309_t *dev)
irq = (dev->ld_regs[0x01][0x40] & 0x0f);
if (active) {
lpt1_init(addr);
lpt1_setup(addr);
lpt1_irq(irq);
}
}

View File

@@ -106,7 +106,7 @@ lpt1_handler(pc87310_t *dev)
}
if (lpt_port)
lpt1_init(lpt_port);
lpt1_setup(lpt_port);
lpt1_irq(lpt_irq);
}

View File

@@ -220,7 +220,7 @@ pc87311_lpt_handler(pc87311_t *dev)
default:
break;
}
lpt1_init(dev->base);
lpt1_setup(dev->base);
lpt1_irq(dev->irq);
pc87311_log("PC87311-LPT: BASE %04x IRQ %01x\n", dev->base, dev->irq);
}

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