diff --git a/.ci/build.sh b/.ci/build.sh index 326952186..0af94132a 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e0527c60..c62a2babc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ # Authors: David Hrdlička, # # Copyright 2020-2021 David Hrdlička. -# Copyright 2021-2024 Jasmine Iwanek. +# Copyright 2021-2025 Jasmine Iwanek. # cmake_minimum_required(VERSION 3.16) diff --git a/CMakePresets.json b/CMakePresets.json index c7bcba52a..30feab8ab 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -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", diff --git a/cmake/flags-gcc.cmake b/cmake/flags-gcc.cmake index 885353b87..90eb52cd1 100644 --- a/cmake/flags-gcc.cmake +++ b/cmake/flags-gcc.cmake @@ -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() diff --git a/src/acpi.c b/src/acpi.c index 2850a340d..b33653663 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -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; diff --git a/src/cdrom/cdrom_mitsumi.c b/src/cdrom/cdrom_mitsumi.c index 19fa06e23..7ef8a04b2 100644 --- a/src/cdrom/cdrom_mitsumi.c +++ b/src/cdrom/cdrom_mitsumi.c @@ -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 diff --git a/src/chipset/stpc.c b/src/chipset/stpc.c index 23cc56bd3..13dbd97e9 100644 --- a/src/chipset/stpc.c +++ b/src/chipset/stpc.c @@ -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 diff --git a/src/chipset/umc_8886.c b/src/chipset/umc_8886.c index f96480c2c..0ed062450 100644 --- a/src/chipset/umc_8886.c +++ b/src/chipset/umc_8886.c @@ -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> diff --git a/src/chipset/wd76c10.c b/src/chipset/wd76c10.c index d7d8b0fe2..a375c8eb6 100644 --- a/src/chipset/wd76c10.c +++ b/src/chipset/wd76c10.c @@ -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; } } diff --git a/src/codegen_new/codegen.c b/src/codegen_new/codegen.c index a3f4ede8f..39ab69b3d 100644 --- a/src/codegen_new/codegen.c +++ b/src/codegen_new/codegen.c @@ -21,8 +21,7 @@ #define MAX_INSTRUCTION_COUNT 50 -static struct -{ +static struct { uint32_t pc; int op_ssegs; x86seg *op_ea_seg; diff --git a/src/codegen_new/codegen_accumulate.c b/src/codegen_new/codegen_accumulate.c index 29b05ad77..087d9c797 100644 --- a/src/codegen_new/codegen_accumulate.c +++ b/src/codegen_new/codegen_accumulate.c @@ -8,8 +8,7 @@ #include "codegen_accumulate.h" #include "codegen_ir.h" -static struct -{ +static struct { int count; int dest_reg; } acc_regs[] = { diff --git a/src/codegen_new/codegen_ops_3dnow.c b/src/codegen_new/codegen_ops_3dnow.c index 03af718d1..e827d0d27 100644 --- a/src/codegen_new/codegen_ops_3dnow.c +++ b/src/codegen_new/codegen_ops_3dnow.c @@ -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 diff --git a/src/codegen_new/codegen_ops_branch.c b/src/codegen_new/codegen_ops_branch.c index 1e2589f8b..2039b6d79 100644 --- a/src/codegen_new/codegen_ops_branch.c +++ b/src/codegen_new/codegen_ops_branch.c @@ -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 diff --git a/src/codegen_new/codegen_ops_fpu_arith.c b/src/codegen_new/codegen_ops_fpu_arith.c index 43d243c0f..1568852df 100644 --- a/src/codegen_new/codegen_ops_fpu_arith.c +++ b/src/codegen_new/codegen_ops_fpu_arith.c @@ -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 diff --git a/src/codegen_new/codegen_ops_misc.c b/src/codegen_new/codegen_ops_misc.c index c709dffc9..91e0f5d63 100644 --- a/src/codegen_new/codegen_ops_misc.c +++ b/src/codegen_new/codegen_ops_misc.c @@ -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) diff --git a/src/codegen_new/codegen_ops_mmx_arith.c b/src/codegen_new/codegen_ops_mmx_arith.c index 8fd1d1651..f01d64273 100644 --- a/src/codegen_new/codegen_ops_mmx_arith.c +++ b/src/codegen_new/codegen_ops_mmx_arith.c @@ -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 diff --git a/src/codegen_new/codegen_ops_mmx_cmp.c b/src/codegen_new/codegen_ops_mmx_cmp.c index e00e56472..cf0cededb 100644 --- a/src/codegen_new/codegen_ops_mmx_cmp.c +++ b/src/codegen_new/codegen_ops_mmx_cmp.c @@ -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 diff --git a/src/codegen_new/codegen_ops_mmx_pack.c b/src/codegen_new/codegen_ops_mmx_pack.c index 18377e142..c62aa10d0 100644 --- a/src/codegen_new/codegen_ops_mmx_pack.c +++ b/src/codegen_new/codegen_ops_mmx_pack.c @@ -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 diff --git a/src/codegen_new/codegen_ops_stack.c b/src/codegen_new/codegen_ops_stack.c index 057cccb0f..fca9c9efa 100644 --- a/src/codegen_new/codegen_ops_stack.c +++ b/src/codegen_new/codegen_ops_stack.c @@ -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 diff --git a/src/cpu/x86_flags.h b/src/cpu/x86_flags.h index e82041783..7d5c41ca8 100644 --- a/src/cpu/x86_flags.h +++ b/src/cpu/x86_flags.h @@ -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; } diff --git a/src/device.c b/src/device.c index 55552ead4..d7c80be7a 100644 --- a/src/device.c +++ b/src/device.c @@ -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; diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt index c9da627ef..bbbab22fd 100644 --- a/src/device/CMakeLists.txt +++ b/src/device/CMakeLists.txt @@ -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) diff --git a/src/device/access_bus.c b/src/device/access_bus.c new file mode 100644 index 000000000..951454e19 --- /dev/null +++ b/src/device/access_bus.c @@ -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, + * + * Copyright 2024-2025 Miran Grca. + */ +#include +#include +#include +#include +#include +#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 +}; diff --git a/src/device/isamem.c b/src/device/isamem.c index 5cac31c7f..45a0413be 100644 --- a/src/device/isamem.c +++ b/src/device/isamem.c @@ -851,32 +851,34 @@ isamem_close(void *priv) static const device_config_t ibmxt_32k_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 32, - .file_filter = "", - .spinner = { - .min = 32, - .max = 576, - .step = 32 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 32, + .file_filter = NULL, + .spinner = { + .min = 32, + .max = 576, + .step = 32 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 64, - .file_filter = "", - .spinner = { - .min = 0, - .max = 608, - .step = 32 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 64, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 608, + .step = 32 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -899,32 +901,34 @@ static const device_t ibmxt_32k_device = { static const device_config_t ibmxt_64k_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 64, - .file_filter = "", - .spinner = { - .min = 64, - .max = 576, - .step = 64 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 64, + .file_filter = NULL, + .spinner = { + .min = 64, + .max = 576, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 64, - .file_filter = "", - .spinner = { - .min = 0, - .max = 576, - .step = 64 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 64, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 576, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -947,32 +951,34 @@ static const device_t ibmxt_64k_device = { static const device_config_t ibmxt_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 128, - .file_filter = "", - .spinner = { - .min = 64, - .max = 576, - .step = 64 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 128, + .file_filter = NULL, + .spinner = { + .min = 64, + .max = 576, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 256, - .file_filter = "", - .spinner = { - .min = 0, - .max = 576, - .step = 64 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 256, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 576, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -995,32 +1001,34 @@ static const device_t ibmxt_device = { static const device_config_t genericxt_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 16, - .file_filter = "", - .spinner = { - .min = 0, - .max = 640, - .step = 16 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 16, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 640, + .step = 16 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { - .min = 0, - .max = 624, - .step = 16 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 624, + .step = 16 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1044,32 +1052,34 @@ static const device_t genericxt_device = { static const device_config_t msramcard_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 64, - .file_filter = "", - .spinner = { - .min = 0, - .max = 256, - .step = 64 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 64, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 256, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { - .min = 0, - .max = 624, - .step = 64 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 624, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1092,32 +1102,34 @@ static const device_t msramcard_device = { static const device_config_t mssystemcard_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 64, - .file_filter = "", - .spinner = { - .min = 0, - .max = 256, - .step = 64 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 64, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 256, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { - .min = 0, - .max = 624, - .step = 64 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 624, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1154,32 +1166,34 @@ static const device_t ibmat_128k_device = { static const device_config_t ibmat_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 512, - .file_filter = "", - .spinner = { - .min = 0, - .max = 12288, - .step = 512 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 12288, + .step = 512 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 1024, - .file_filter = "", - .spinner = { - .min = 0, - .max = 15872, - .step = 512 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 15872, + .step = 512 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1202,32 +1216,34 @@ static const device_t ibmat_device = { static const device_config_t genericat_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 512, - .file_filter = "", - .spinner = { - .min = 0, - .max = 16384, - .step = 128 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 16384, + .step = 128 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 1024, - .file_filter = "", - .spinner = { - .min = 0, - .max = 15872, - .step = 128 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 15872, + .step = 128 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1251,32 +1267,34 @@ static const device_t genericat_device = { static const device_config_t p5pak_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 128, - .file_filter = "", - .spinner = { - .min = 0, - .max = 384, - .step = 64 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 128, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 384, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 512, - .file_filter = "", - .spinner = { - .min = 64, - .max = 576, - .step = 64 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { + .min = 64, + .max = 576, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1299,32 +1317,34 @@ static const device_t p5pak_device = { static const device_config_t a6pak_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 64, - .file_filter = "", - .spinner = { - .min = 0, - .max = 384, - .step = 64 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 64, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 384, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 256, - .file_filter = "", - .spinner = { - .min = 64, - .max = 512, - .step = 64 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 256, + .file_filter = NULL, + .spinner = { + .min = 64, + .max = 512, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1347,28 +1367,29 @@ static const device_t a6pak_device = { static const device_config_t ems5150_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 256, - .file_filter = "", - .spinner = { - .min = 0, - .max = 2048, - .step = 64 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 256, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 2048, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "Disabled", .value = 0x0000 }, { .description = "Board 1", .value = 0x0208 }, { .description = "Board 2", .value = 0x020a }, @@ -1376,6 +1397,7 @@ static const device_config_t ems5150_config[] = { { .description = "Board 4", .value = 0x020e }, { .description = "" } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1398,98 +1420,104 @@ static const device_t ems5150_device = { static const device_config_t ev159_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 512, - .file_filter = "", - .spinner = { - .min = 0, - .max = 3072, - .step = 512 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 3072, + .step = 512 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { - .min = 0, - .max = 16128, - .step = 128 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 16128, + .step = 128 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "length", - .description = "Contiguous Size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { - .min = 0, - .max = 16384, - .step = 128 + .name = "length", + .description = "Contiguous Size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 16384, + .step = 128 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "width", - .description = "I/O Width", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "width", + .description = "I/O Width", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "8-bit", .value = 0 }, { .description = "16-bit", .value = 1 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "speed", - .description = "Transfer Speed", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "speed", + .description = "Transfer Speed", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "Standard (150ns)", .value = 0 }, { .description = "High-Speed (120ns)", .value = 1 }, { .description = "" } - } + }, + .bios = { { 0 } } }, { - .name = "ems", - .description = "EMS mode", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "ems", + .description = "EMS mode", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "Disabled", .value = 0 }, { .description = "Enabled", .value = 1 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x0258, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x0258, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "208H", .value = 0x0208 }, { .description = "218H", .value = 0x0218 }, { .description = "258H", .value = 0x0258 }, @@ -1499,16 +1527,17 @@ static const device_config_t ev159_config[] = { { .description = "2E8H", .value = 0x02E8 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "base2", - .description = "Address for > 2 MB", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x0268, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "base2", + .description = "Address for > 2 MB", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x0268, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "208H", .value = 0x0208 }, { .description = "218H", .value = 0x0218 }, { .description = "258H", .value = 0x0258 }, @@ -1518,6 +1547,7 @@ static const device_config_t ev159_config[] = { { .description = "2E8H", .value = 0x02E8 }, { .description = "" } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1540,70 +1570,74 @@ static const device_t ev159_device = { static const device_config_t ev165a_config[] = { // clang-format off { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 256, - .file_filter = "", - .spinner = { - .min = 0, - .max = 2048, - .step = 256 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 256, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 2048, + .step = 256 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 64, - .file_filter = "", - .spinner = { - .min = 64, - .max = 640, - .step = 64 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 64, + .file_filter = NULL, + .spinner = { + .min = 64, + .max = 640, + .step = 64 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "length", .description = "Contiguous Size", .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { - .min = 0, - .max = 2048, - .step = 256 + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 2048, + .step = 256 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "ems", - .description = "EMS mode", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "ems", + .description = "EMS mode", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "Disabled", .value = 0 }, { .description = "Enabled", .value = 1 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x0258, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x0258, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "208H", .value = 0x0208 }, { .description = "218H", .value = 0x0218 }, { .description = "258H", .value = 0x0258 }, @@ -1613,6 +1647,7 @@ static const device_config_t ev165a_config[] = { { .description = "2E8H", .value = 0x02E8 }, { .description = "" } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1635,48 +1670,51 @@ static const device_t ev165a_device = { static const device_config_t brxt_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x0268, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x0268, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "208H", .value = 0x0208 }, { .description = "218H", .value = 0x0218 }, { .description = "258H", .value = 0x0258 }, { .description = "268H", .value = 0x0268 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "frame", - .description = "Frame Address", - .type = CONFIG_HEX20, - .default_string = "", - .default_int = 0xD0000, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { .description = "D000H", .value = 0xD0000 }, - { .description = "E000H", .value = 0xE0000 }, - { .description = "" } + .name = "frame", + .description = "Frame Address", + .type = CONFIG_HEX20, + .default_string = NULL, + .default_int = 0xD0000, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "D000H", .value = 0xD0000 }, + { .description = "E000H", .value = 0xE0000 }, + { .description = "" } }, + .bios = { { 0 } } }, { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 512, - .file_filter = "", - .spinner = { - .min = 0, - .max = 2048, - .step = 512 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 2048, + .step = 512 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1700,89 +1738,96 @@ static const device_t brxt_device = { static const device_config_t brat_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x0268, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x0268, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "208H", .value = 0x0208 }, { .description = "218H", .value = 0x0218 }, { .description = "258H", .value = 0x0258 }, { .description = "268H", .value = 0x0268 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "frame", - .description = "Frame Address", - .type = CONFIG_HEX20, - .default_string = "", - .default_int = 0xD0000, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "frame", + .description = "Frame Address", + .type = CONFIG_HEX20, + .default_string = NULL, + .default_int = 0xD0000, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "D000H", .value = 0xD0000 }, { .description = "E000H", .value = 0xE0000 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "width", - .description = "I/O Width", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 8, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "width", + .description = "I/O Width", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 8, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "8-bit", .value = 8 }, { .description = "16-bit", .value = 16 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "speed", - .description = "Transfer Speed", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "speed", + .description = "Transfer Speed", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "Standard", .value = 0 }, { .description = "High-Speed", .value = 1 }, { .description = "" } - } + }, + .bios = { { 0 } } }, { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 512, - .file_filter = "", - .spinner = { - .min = 0, - .max = 4096, - .step = 512 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 4096, + .step = 512 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { - .min = 0, - .max = 14336, - .step = 512 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 14336, + .step = 512 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1806,66 +1851,69 @@ static const device_t brat_device = { static const device_config_t lotech_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x0260, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x0260, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "260H", .value = 0x0260 }, { .description = "264H", .value = 0x0264 }, { .description = "268H", .value = 0x0268 }, { .description = "26CH", .value = 0x026C }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "frame", - .description = "Frame Address", - .type = CONFIG_HEX20, - .default_string = "", - .default_int = 0xe0000, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "frame", + .description = "Frame Address", + .type = CONFIG_HEX20, + .default_string = NULL, + .default_int = 0xe0000, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "C000H", .value = 0xC0000 }, { .description = "D000H", .value = 0xD0000 }, { .description = "E000H", .value = 0xE0000 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 2048, - .file_filter = "", - .spinner = { - .min = 512, - .max = 4096, - .step = 512 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 2048, + .file_filter = NULL, + .spinner = { + .min = 512, + .max = 4096, + .step = 512 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; static const device_t lotech_ems_device = { - .name = "Lo-tech EMS Board", + .name = "Lo-tech EMS Board", .internal_name = "lotechems", - .flags = DEVICE_ISA, - .local = ISAMEM_LOTECH_EMS_CARD, - .init = isamem_init, - .close = isamem_close, - .reset = NULL, + .flags = DEVICE_ISA, + .local = ISAMEM_LOTECH_EMS_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, .available = NULL, .speed_changed = NULL, - .force_redraw = NULL, - .config = lotech_config + .force_redraw = NULL, + .config = lotech_config }; #ifdef USE_ISAMEM_RAMPAGE @@ -1874,14 +1922,14 @@ static const device_t lotech_ems_device = { static const device_config_t rampage_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x0218, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x0218, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "208H", .value = 0x0208 }, { .description = "218H", .value = 0x0218 }, { .description = "258H", .value = 0x0258 }, @@ -1891,33 +1939,37 @@ static const device_config_t rampage_config[] = { { .description = "2E8H", .value = 0x02E8 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 256, /* Technically 128k, but banks 2-7 must be 256, headaches elsewise */ - .file_filter = "", - .spinner = { - .min = 256, - .max = 2048, - .step = 256 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 256, /* Technically 128k, but banks 2-7 must be 256, headaches elsewise */ + .file_filter = NULL, + .spinner = { + .min = 256, + .max = 2048, + .step = 256 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "start", - .description = "Start Address", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 640, - .file_filter = "", - .spinner = { - .min = 0, - .max = 640, - .step = 64 + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 640, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 640, + .step = 64 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1942,14 +1994,14 @@ static const device_t rampage_device = { static const device_config_t iab_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x0258, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x0258, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "208H", .value = 0x0208 }, { .description = "218H", .value = 0x0218 }, { .description = "258H", .value = 0x0258 }, @@ -1959,64 +2011,69 @@ static const device_config_t iab_config[] = { { .description = "2E8H", .value = 0x02E8 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "frame", - .description = "Frame Address", - .type = CONFIG_HEX20, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "frame", + .description = "Frame Address", + .type = CONFIG_HEX20, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "Disabled", .value = 0x00000 }, { .description = "C000H", .value = 0xC0000 }, { .description = "D000H", .value = 0xD0000 }, { .description = "E000H", .value = 0xE0000 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "width", - .description = "I/O Width", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 8, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "width", + .description = "I/O Width", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 8, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "8-bit", .value = 8 }, { .description = "16-bit", .value = 16 }, { .description = "" } }, + .bios = { { 0 } } }, { - .name = "speed", - .description = "Transfer Speed", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "speed", + .description = "Transfer Speed", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "Standard", .value = 0 }, { .description = "High-Speed", .value = 1 }, { .description = "" } - } + }, + .bios = { { 0 } } }, { - .name = "size", - .description = "Memory size", - .type = CONFIG_SPINNER, - .default_string = "", - .default_int = 128, - .file_filter = "", - .spinner = { - .min = 0, - .max = 8192, - .step = 128 + .name = "size", + .description = "Memory size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 128, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 8192, + .step = 128 }, - .selection = { { 0 } } + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/device/isartc.c b/src/device/isartc.c index f24ffb72b..63ce0b065 100644 --- a/src/device/isartc.c +++ b/src/device/isartc.c @@ -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 diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index af3d5d5fc..9b3f06098 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -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 diff --git a/src/device/mouse_bus.c b/src/device/mouse_bus.c index b56a3cc18..c0f161dbd 100644 --- a/src/device/mouse_bus.c +++ b/src/device/mouse_bus.c @@ -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 diff --git a/src/device/mouse_microtouch_touchscreen.c b/src/device/mouse_microtouch_touchscreen.c index 24d5de1fb..15b42bfdd 100644 --- a/src/device/mouse_microtouch_touchscreen.c +++ b/src/device/mouse_microtouch_touchscreen.c @@ -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 diff --git a/src/device/mouse_ps2.c b/src/device/mouse_ps2.c index 53af97b78..9afc75410 100644 --- a/src/device/mouse_ps2.c +++ b/src/device/mouse_ps2.c @@ -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 diff --git a/src/device/mouse_serial.c b/src/device/mouse_serial.c index c64be5a6d..be9bc62e1 100644 --- a/src/device/mouse_serial.c +++ b/src/device/mouse_serial.c @@ -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 diff --git a/src/device/mouse_wacom_tablet.c b/src/device/mouse_wacom_tablet.c index d74e58411..79b674e07 100644 --- a/src/device/mouse_wacom_tablet.c +++ b/src/device/mouse_wacom_tablet.c @@ -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 diff --git a/src/device/novell_cardkey.c b/src/device/novell_cardkey.c index 34b6390d1..8820addde 100644 --- a/src/device/novell_cardkey.c +++ b/src/device/novell_cardkey.c @@ -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 diff --git a/src/device/serial.c b/src/device/serial.c index 0ba60551c..823d07c1f 100644 --- a/src/device/serial.c +++ b/src/device/serial.c @@ -15,7 +15,7 @@ * Authors: Miran Grca, * Fred N. van Kempen, * - * Copyright 2016-2020 Miran Grca. + * Copyright 2016-2025 Miran Grca. * Copyright 2017-2020 Fred N. van Kempen. */ #include @@ -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) { diff --git a/src/device/serial_passthrough.c b/src/device/serial_passthrough.c index bb2378a22..256f9eaa9 100644 --- a/src/device/serial_passthrough.c +++ b/src/device/serial_passthrough.c @@ -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 } }; diff --git a/src/device/unittester.c b/src/device/unittester.c index 5f0fa5712..0e864aa0b 100644 --- a/src/device/unittester.c +++ b/src/device/unittester.c @@ -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", diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 592649c0e..3683c8671 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -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 } }; diff --git a/src/disk/hdc_ide_w83769f.c b/src/disk/hdc_ide_w83769f.c index 9c0f744b2..7829c5b92 100644 --- a/src/disk/hdc_ide_w83769f.c +++ b/src/disk/hdc_ide_w83769f.c @@ -10,7 +10,7 @@ * * Authors: Miran Grca, * - * Copyright 2020 Miran Grca. + * Copyright 2020-2025 Miran Grca. */ #include #include diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index 789e7e6c4..536fd76c0 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -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 } }; diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index 553e53b48..b01d80c61 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -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 } }, }, diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 7ec7695b3..4c071e596 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -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 } }, }, diff --git a/src/disk/lba_enhancer.c b/src/disk/lba_enhancer.c index 8e8bc480d..429611b2d 100644 --- a/src/disk/lba_enhancer.c +++ b/src/disk/lba_enhancer.c @@ -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 } }; diff --git a/src/fifo.c b/src/fifo.c index f51809fd8..8afb5640f 100644 --- a/src/fifo.c +++ b/src/fifo.c @@ -10,7 +10,7 @@ * * Authors: Miran Grca, * - * Copyright 2023 Miran Grca. + * Copyright 2023-2025 Miran Grca. */ #include #include @@ -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) { diff --git a/src/floppy/fdc_compaticard.c b/src/floppy/fdc_compaticard.c index 4abc4abac..741105927 100644 --- a/src/floppy/fdc_compaticard.c +++ b/src/floppy/fdc_compaticard.c @@ -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 } diff --git a/src/floppy/fdc_magitronic.c b/src/floppy/fdc_magitronic.c index 2b708a121..17e556e0f 100644 --- a/src/floppy/fdc_magitronic.c +++ b/src/floppy/fdc_magitronic.c @@ -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 diff --git a/src/floppy/fdc_monster.c b/src/floppy/fdc_monster.c index 51fb108d6..1b0e2fbac 100644 --- a/src/floppy/fdc_monster.c +++ b/src/floppy/fdc_monster.c @@ -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 diff --git a/src/floppy/fdc_pii15xb.c b/src/floppy/fdc_pii15xb.c index 587eb64fa..4e6a8367c 100644 --- a/src/floppy/fdc_pii15xb.c +++ b/src/floppy/fdc_pii15xb.c @@ -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 diff --git a/src/game/gameport.c b/src/game/gameport.c index 39193af88..90986a655 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -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 diff --git a/src/include/86box/access_bus.h b/src/include/86box/access_bus.h new file mode 100644 index 000000000..333a1d4a5 --- /dev/null +++ b/src/include/86box/access_bus.h @@ -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, + * + * 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*/ diff --git a/src/include/86box/fifo.h b/src/include/86box/fifo.h index f87f932e0..f8f07d9b5 100644 --- a/src/include/86box/fifo.h +++ b/src/include/86box/fifo.h @@ -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, * - * 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); diff --git a/src/include/86box/hdc.h b/src/include/86box/hdc.h index 110804244..e798f2464 100644 --- a/src/include/86box/hdc.h +++ b/src/include/86box/hdc.h @@ -13,7 +13,7 @@ * Authors: Miran Grca, * Fred N. van Kempen, * - * 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 */ diff --git a/src/include/86box/hdc_ide.h b/src/include/86box/hdc_ide.h index 0280cf301..6af4d92e6 100644 --- a/src/include/86box/hdc_ide.h +++ b/src/include/86box/hdc_ide.h @@ -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 { diff --git a/src/include/86box/keyboard.h b/src/include/86box/keyboard.h index 225ab3936..ec5c05775 100644 --- a/src/include/86box/keyboard.h +++ b/src/include/86box/keyboard.h @@ -15,7 +15,7 @@ * Fred N. van Kempen, * * 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; diff --git a/src/include/86box/lpt.h b/src/include/86box/lpt.h index 4e95b64c3..674d6340f 100644 --- a/src/include/86box/lpt.h +++ b/src/include/86box/lpt.h @@ -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 diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index f4f3f8834..f39187dd9 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -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; diff --git a/src/include/86box/serial.h b/src/include/86box/serial.h index a205c7cec..31c77ce5a 100644 --- a/src/include/86box/serial.h +++ b/src/include/86box/serial.h @@ -16,7 +16,7 @@ * Fred N. van Kempen, * * 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); diff --git a/src/include/86box/sio.h b/src/include/86box/sio.h index 2dbe97ab0..7fcb376b9 100644 --- a/src/include/86box/sio.h +++ b/src/include/86box/sio.h @@ -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; diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index ba6ac2f83..a30095c66 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -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; diff --git a/src/io.c b/src/io.c index fd87089d0..27f8503b0 100644 --- a/src/io.c +++ b/src/io.c @@ -15,7 +15,7 @@ * Fred N. van Kempen, * * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2016-2025 Miran Grca. */ #include #include @@ -145,6 +145,8 @@ io_sethandler_common(uint16_t base, int size, q->next = NULL; io_last[base + c] = q; + + q = NULL; } } diff --git a/src/lpt.c b/src/lpt.c index 3f1c5eb7b..26174d96b 100644 --- a/src/lpt.c +++ b/src/lpt.c @@ -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) diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index c3dc5c772..cb2a04d07 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -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); diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 656db503b..3d152065b 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -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) diff --git a/src/machine/m_at_commodore.c b/src/machine/m_at_commodore.c index 0b45fe60c..b9615c064 100644 --- a/src/machine/m_at_commodore.c +++ b/src/machine/m_at_commodore.c @@ -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: diff --git a/src/machine/m_ps1.c b/src/machine/m_ps1.c index 92846c401..130481394 100644 --- a/src/machine/m_ps1.c +++ b/src/machine/m_ps1.c @@ -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); diff --git a/src/machine/m_ps2_isa.c b/src/machine/m_ps2_isa.c index 7d024c335..8a2760f15 100644 --- a/src/machine/m_ps2_isa.c +++ b/src/machine/m_ps2_isa.c @@ -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); diff --git a/src/machine/m_ps2_mca.c b/src/machine/m_ps2_mca.c index 632381ca1..35f3ed125 100644 --- a/src/machine/m_ps2_mca.c +++ b/src/machine/m_ps2_mca.c @@ -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 diff --git a/src/machine/m_xt_compaq.c b/src/machine/m_xt_compaq.c index ed1b3e26c..f8c0b6a19 100644 --- a/src/machine/m_xt_compaq.c +++ b/src/machine/m_xt_compaq.c @@ -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; } diff --git a/src/machine/m_xt_zenith.c b/src/machine/m_xt_zenith.c index 833529ffb..6c5d556f2 100644 --- a/src/machine/m_xt_zenith.c +++ b/src/machine/m_xt_zenith.c @@ -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; } diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 82b0082fe..458b54013 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -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; diff --git a/src/network/net_3c501.c b/src/network/net_3c501.c index 73dd5ef62..f5809afb1 100644 --- a/src/network/net_3c501.c +++ b/src/network/net_3c501.c @@ -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 } }; diff --git a/src/network/net_3c503.c b/src/network/net_3c503.c index cd5016147..b35e0d453 100644 --- a/src/network/net_3c503.c +++ b/src/network/net_3c503.c @@ -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 diff --git a/src/network/net_modem.c b/src/network/net_modem.c index 83dfe04d7..62621391c 100644 --- a/src/network/net_modem.c +++ b/src/network/net_modem.c @@ -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 } }; diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 2f6c60d51..dd3a12047 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -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 } }; diff --git a/src/network/net_pcnet.c b/src/network/net_pcnet.c index 5487486b4..3272033cf 100644 --- a/src/network/net_pcnet.c +++ b/src/network/net_pcnet.c @@ -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 } }; diff --git a/src/network/net_plip.c b/src/network/net_plip.c index f80effeec..8c46213c6 100644 --- a/src/network/net_plip.c +++ b/src/network/net_plip.c @@ -26,12 +26,12 @@ #include #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> diff --git a/src/network/net_rtl8139.c b/src/network/net_rtl8139.c index 74b041b35..5138b5168 100644 --- a/src/network/net_rtl8139.c +++ b/src/network/net_rtl8139.c @@ -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 } }; diff --git a/src/network/net_tulip.c b/src/network/net_tulip.c index 2c3aab379..7d988368c 100644 --- a/src/network/net_tulip.c +++ b/src/network/net_tulip.c @@ -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 } }; diff --git a/src/network/net_wd8003.c b/src/network/net_wd8003.c index 1e5496851..1ca8d8697 100644 --- a/src/network/net_wd8003.c +++ b/src/network/net_wd8003.c @@ -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 } }; diff --git a/src/printer/prt_ps.c b/src/printer/prt_ps.c index 1a9d5c0e8..1298018ee 100644 --- a/src/printer/prt_ps.c +++ b/src/printer/prt_ps.c @@ -26,8 +26,8 @@ #include #include #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> diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index b6a1698c5..4f3d1d1e7 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -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 } }, }, diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index b235f2c3c..c4745e2df 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -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 } }; diff --git a/src/scsi/scsi_ncr53c400.c b/src/scsi/scsi_ncr53c400.c index d8008cf02..10934880f 100644 --- a/src/scsi/scsi_ncr53c400.c +++ b/src/scsi/scsi_ncr53c400.c @@ -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 } }; diff --git a/src/scsi/scsi_ncr53c8xx.c b/src/scsi/scsi_ncr53c8xx.c index d26da3bb3..f87f22452 100644 --- a/src/scsi/scsi_ncr53c8xx.c +++ b/src/scsi/scsi_ncr53c8xx.c @@ -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 diff --git a/src/scsi/scsi_pcscsi.c b/src/scsi/scsi_pcscsi.c index 012d5524b..7c991bdb1 100644 --- a/src/scsi/scsi_pcscsi.c +++ b/src/scsi/scsi_pcscsi.c @@ -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 diff --git a/src/scsi/scsi_spock.c b/src/scsi/scsi_spock.c index cbf6ff205..d6a26b7d0 100644 --- a/src/scsi/scsi_spock.c +++ b/src/scsi/scsi_spock.c @@ -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 diff --git a/src/scsi/scsi_t128.c b/src/scsi/scsi_t128.c index ff5f584f1..a40d803f1 100644 --- a/src/scsi/scsi_t128.c +++ b/src/scsi/scsi_t128.c @@ -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", diff --git a/src/sio/sio_82091aa.c b/src/sio/sio_82091aa.c index 76c7ba3f5..d3cd5017a 100644 --- a/src/sio/sio_82091aa.c +++ b/src/sio/sio_82091aa.c @@ -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); } diff --git a/src/sio/sio_acc3221.c b/src/sio/sio_acc3221.c index d52949d46..203b1c1f1 100644 --- a/src/sio/sio_acc3221.c +++ b/src/sio/sio_acc3221.c @@ -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); diff --git a/src/sio/sio_ali5123.c b/src/sio/sio_ali5123.c index 5380e065a..398d00839 100644 --- a/src/sio/sio_ali5123.c +++ b/src/sio/sio_ali5123.c @@ -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, diff --git a/src/sio/sio_f82c710.c b/src/sio/sio_f82c710.c index 8882f16e0..a7aa101c6 100644 --- a/src/sio/sio_f82c710.c +++ b/src/sio/sio_f82c710.c @@ -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); } diff --git a/src/sio/sio_fdc37c669.c b/src/sio/sio_fdc37c669.c index 7f97e79b0..3be28c6ba 100644 --- a/src/sio/sio_fdc37c669.c +++ b/src/sio/sio_fdc37c669.c @@ -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 diff --git a/src/sio/sio_fdc37c67x.c b/src/sio/sio_fdc37c67x.c index f0fb8cd64..931734048 100644 --- a/src/sio/sio_fdc37c67x.c +++ b/src/sio/sio_fdc37c67x.c @@ -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); } diff --git a/src/sio/sio_fdc37c6xx.c b/src/sio/sio_fdc37c6xx.c index 530fff216..0f3460565 100644 --- a/src/sio/sio_fdc37c6xx.c +++ b/src/sio/sio_fdc37c6xx.c @@ -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); diff --git a/src/sio/sio_fdc37c93x.c b/src/sio/sio_fdc37c93x.c index 42908ecaf..8d8f76cb6 100644 --- a/src/sio/sio_fdc37c93x.c +++ b/src/sio/sio_fdc37c93x.c @@ -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 }; - diff --git a/src/sio/sio_fdc37m60x.c b/src/sio/sio_fdc37m60x.c index 671b3581b..11d2f3349 100644 --- a/src/sio/sio_fdc37m60x.c +++ b/src/sio/sio_fdc37m60x.c @@ -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); } diff --git a/src/sio/sio_it86x1f.c b/src/sio/sio_it86x1f.c index 1cde8657e..b3553bf54 100644 --- a/src/sio/sio_it86x1f.c +++ b/src/sio/sio_it86x1f.c @@ -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"); } diff --git a/src/sio/sio_pc87306.c b/src/sio/sio_pc87306.c index 33cb0d865..41d69b0cc 100644 --- a/src/sio/sio_pc87306.c +++ b/src/sio/sio_pc87306.c @@ -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]); diff --git a/src/sio/sio_pc87307.c b/src/sio/sio_pc87307.c index eba0748c9..ae21d34af 100644 --- a/src/sio/sio_pc87307.c +++ b/src/sio/sio_pc87307.c @@ -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); } } diff --git a/src/sio/sio_pc87309.c b/src/sio/sio_pc87309.c index 1b790bc6b..da53802c1 100644 --- a/src/sio/sio_pc87309.c +++ b/src/sio/sio_pc87309.c @@ -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); } } diff --git a/src/sio/sio_pc87310.c b/src/sio/sio_pc87310.c index 674db6364..5bd595f05 100644 --- a/src/sio/sio_pc87310.c +++ b/src/sio/sio_pc87310.c @@ -106,7 +106,7 @@ lpt1_handler(pc87310_t *dev) } if (lpt_port) - lpt1_init(lpt_port); + lpt1_setup(lpt_port); lpt1_irq(lpt_irq); } diff --git a/src/sio/sio_pc87311.c b/src/sio/sio_pc87311.c index 1f38e6aa8..b560ef425 100644 --- a/src/sio/sio_pc87311.c +++ b/src/sio/sio_pc87311.c @@ -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); } diff --git a/src/sio/sio_pc87332.c b/src/sio/sio_pc87332.c index f746306bd..d9fb0b211 100644 --- a/src/sio/sio_pc87332.c +++ b/src/sio/sio_pc87332.c @@ -77,7 +77,7 @@ lpt1_handler(pc87332_t *dev) } if (lpt_port) - lpt1_init(lpt_port); + lpt1_setup(lpt_port); lpt1_irq(lpt_irq); } diff --git a/src/sio/sio_prime3b.c b/src/sio/sio_prime3b.c index 2cadda2ab..1cc0be3aa 100644 --- a/src/sio/sio_prime3b.c +++ b/src/sio/sio_prime3b.c @@ -176,7 +176,7 @@ prime3b_lpt_handler(prime3b_t *dev) { uint16_t lpt_base = (ASR & 2) ? LPT_MDA_ADDR : (!(ASR & 1) ? LPT1_ADDR : LPT2_ADDR); lpt1_remove(); - lpt1_init(lpt_base); + lpt1_setup(lpt_base); lpt1_irq(LPT1_IRQ); prime3b_log("Prime3B-LPT: Enabled with base %03x\n", lpt_base); } diff --git a/src/sio/sio_prime3c.c b/src/sio/sio_prime3c.c index e646a3653..f70f9f372 100644 --- a/src/sio/sio_prime3c.c +++ b/src/sio/sio_prime3c.c @@ -241,7 +241,7 @@ prime3c_lpt_handler(prime3c_t *dev) lpt1_remove(); if (!(FUNCTION_SELECT & 0x03)) { - lpt1_init(LPT_BASE_ADDRESS << 2); + lpt1_setup(LPT_BASE_ADDRESS << 2); lpt1_irq(FDC_LPT_IRQ & 0xf); prime3c_log("Prime3C-LPT: BASE %04x IRQ %02x\n", LPT_BASE_ADDRESS << 2, FDC_LPT_IRQ & 0xf); } diff --git a/src/sio/sio_um8663f.c b/src/sio/sio_um8663f.c index 79cb37da4..54f12dda6 100644 --- a/src/sio/sio_um8663f.c +++ b/src/sio/sio_um8663f.c @@ -106,12 +106,12 @@ um8663f_lpt_handler(um8663f_t *dev) if (dev->regs[0] & 0x08) { switch ((dev->regs[1] >> 3) & 0x01) { case 0x01: - lpt1_init(LPT1_ADDR); - lpt1_irq(7); + lpt1_setup(LPT1_ADDR); + lpt1_irq(LPT1_IRQ); break; case 0x00: - lpt1_init(LPT2_ADDR); - lpt1_irq(5); + lpt1_setup(LPT2_ADDR); + lpt1_irq(LPT2_IRQ); break; default: @@ -231,7 +231,7 @@ um8663f_reset(void *priv) 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); diff --git a/src/sio/sio_um8669f.c b/src/sio/sio_um8669f.c index b3d5259a2..6da9ef6e9 100644 --- a/src/sio/sio_um8669f.c +++ b/src/sio/sio_um8669f.c @@ -207,7 +207,7 @@ um8669f_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *pri if (config->activate && (config->io[0].base != ISAPNP_IO_DISABLED)) { um8669f_log("UM8669F: 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 { um8669f_log("UM8669F: LPT disabled\n"); } diff --git a/src/sio/sio_vt82c686.c b/src/sio/sio_vt82c686.c index fa0bf3c63..0e874210d 100644 --- a/src/sio/sio_vt82c686.c +++ b/src/sio/sio_vt82c686.c @@ -86,7 +86,7 @@ vt82c686_lpt_handler(vt82c686_t *dev) lpt1_remove(); if (((dev->regs[0x02] & 0x03) != 0x03) && !(dev->regs[0x0f] & 0x11) && (io_base >= 0x100) && (io_base <= io_mask)) - lpt1_init(io_base); + lpt1_setup(io_base); if (dev->lpt_irq) { lpt1_irq(dev->lpt_irq); diff --git a/src/sio/sio_w83787f.c b/src/sio/sio_w83787f.c index ea5169afc..f4971ddce 100644 --- a/src/sio/sio_w83787f.c +++ b/src/sio/sio_w83787f.c @@ -197,7 +197,7 @@ w83787f_lpt_handler(w83787f_t *dev) lpt1_remove(); if (enable) { - lpt1_init(addr); + lpt1_setup(addr); lpt1_irq(irq); } } @@ -378,7 +378,7 @@ w83787f_reset(w83787f_t *dev) uint16_t hefere = dev->reg_init & 0x0100; lpt1_remove(); - lpt1_init(LPT1_ADDR); + lpt1_setup(LPT1_ADDR); lpt1_irq(LPT1_IRQ); memset(dev->regs, 0, 0x2A); diff --git a/src/sio/sio_w83877f.c b/src/sio/sio_w83877f.c index 90a3dba1b..7c92d6e71 100644 --- a/src/sio/sio_w83877f.c +++ b/src/sio/sio_w83877f.c @@ -168,7 +168,7 @@ w83877f_lpt_handler(w83877f_t *dev) lpt1_remove(); if (!(dev->regs[4] & 0x80) && (dev->regs[0x23] & 0xc0)) - lpt1_init(make_port(dev, 0x23)); + lpt1_setup(make_port(dev, 0x23)); lpt_irq = 0xff; diff --git a/src/sio/sio_w83977f.c b/src/sio/sio_w83977f.c index 1d743cc64..fd177bc19 100644 --- a/src/sio/sio_w83977f.c +++ b/src/sio/sio_w83977f.c @@ -112,14 +112,14 @@ w83977f_lpt_handler(w83977f_t *dev) lpt2_remove(); if ((dev->dev_regs[1][0x00] & 0x01) && (dev->regs[0x22] & 0x08) && (io_base >= 0x100) && (io_base <= io_mask)) - lpt2_init(io_base); + lpt2_setup(io_base); lpt2_irq(dev->dev_regs[1][0x40] & 0x0f); } else { lpt1_remove(); if ((dev->dev_regs[1][0x00] & 0x01) && (dev->regs[0x22] & 0x08) && (io_base >= 0x100) && (io_base <= io_mask)) - lpt1_init(io_base); + lpt1_setup(io_base); lpt1_irq(dev->dev_regs[1][0x40] & 0x0f); } diff --git a/src/sound/midi_fluidsynth.c b/src/sound/midi_fluidsynth.c index 6ba017cd1..027c85b79 100644 --- a/src/sound/midi_fluidsynth.c +++ b/src/sound/midi_fluidsynth.c @@ -319,153 +319,195 @@ fluidsynth_close(void *priv) static const device_config_t fluidsynth_config[] = { // clang-format off { - .name = "sound_font", - .description = "SoundFont", - .type = CONFIG_FNAME, - .default_string = "", - .file_filter = "SF2 Sound Fonts (*.sf2)|*.sf2" + .name = "sound_font", + .description = "SoundFont", + .type = CONFIG_FNAME, + .default_string = NULL, + .default_int = 0, + .file_filter = "SF2 Sound Fonts (*.sf2)|*.sf2", + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "output_gain", - .description = "Output Gain", - .type = CONFIG_SPINNER, - .spinner = { - .min = 0, + .name = "output_gain", + .description = "Output Gain", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 100, + .file_filter = NULL, + .spinner = { + .min = 0, .max = 100 }, - .default_int = 100 + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "chorus", - .description = "Chorus", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "chorus", + .description = "Chorus", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "chorus_voices", - .description = "Chorus Voices", - .type = CONFIG_SPINNER, + .name = "chorus_voices", + .description = "Chorus Voices", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 3, + .file_filter = NULL, .spinner = { - .min = 0, + .min = 0, .max = 99 }, - .default_int = 3 + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "chorus_level", - .description = "Chorus Level", - .type = CONFIG_SPINNER, - .spinner = { - .min = 0, + .name = "chorus_level", + .description = "Chorus Level", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 20, + .file_filter = NULL, + .spinner = { + .min = 0, .max = 100 }, - .default_int = 20 + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "chorus_speed", - .description = "Chorus Speed", - .type = CONFIG_SPINNER, + .name = "chorus_speed", + .description = "Chorus Speed", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 30, + .file_filter = NULL, .spinner = { - .min = 10, + .min = 10, .max = 500 }, - .default_int = 30 + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "chorus_depth", - .description = "Chorus Depth", - .type = CONFIG_SPINNER, + .name = "chorus_depth", + .description = "Chorus Depth", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 80, + .file_filter = NULL, .spinner = { - .min = 0, + .min = 0, .max = 2560 }, - .default_int = 80 + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "chorus_waveform", - .description = "Chorus Waveform", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "Sine", - .value = 0 - }, - { - .description = "Triangle", - .value = 1 - } + .name = "chorus_waveform", + .description = "Chorus Waveform", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Sine", .value = 0 }, + { .description = "Triangle", .value = 1 }, + { .description = "" } }, - .default_int = 0 + .bios = { { 0 } } }, { - .name = "reverb", - .description = "Reverb", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "reverb", + .description = "Reverb", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "reverb_room_size", - .description = "Reverb Room Size", - .type = CONFIG_SPINNER, + .name = "reverb_room_size", + .description = "Reverb Room Size", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 20, + .file_filter = NULL, .spinner = { - .min = 0, + .min = 0, .max = 100 }, - .default_int = 20 + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "reverb_damping", - .description = "Reverb Damping", - .type = CONFIG_SPINNER, + .name = "reverb_damping", + .description = "Reverb Damping", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, .spinner = { - .min = 0, + .min = 0, .max = 100 }, - .default_int = 0 + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "reverb_width", - .description = "Reverb Width", - .type = CONFIG_SPINNER, - .spinner = { - .min = 0, + .name = "reverb_width", + .description = "Reverb Width", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 5, + .file_filter = NULL, + .spinner = { + .min = 0, .max = 1000 }, - .default_int = 5 + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "reverb_level", - .description = "Reverb Level", - .type = CONFIG_SPINNER, - .spinner = { - .min = 0, + .name = "reverb_level", + .description = "Reverb Level", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 90, + .file_filter = NULL, + .spinner = { + .min = 0, .max = 100 }, - .default_int = 90 + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "interpolation", - .description = "Interpolation Method", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "None", - .value = 0 - }, - { - .description = "Linear", - .value = 1 - }, - { - .description = "4th Order", - .value = 2 - }, - { - .description = "7th Order", - .value = 3 - } + .name = "interpolation", + .description = "Interpolation Method", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "None", .value = 0 }, + { .description = "Linear", .value = 1 }, + { .description = "4th Order", .value = 2 }, + { .description = "7th Order", .value = 3 }, + { .description = "" } }, - .default_int = 2 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -484,4 +526,3 @@ const device_t fluidsynth_device = { .force_redraw = NULL, .config = fluidsynth_config }; - diff --git a/src/sound/midi_mt32.c b/src/sound/midi_mt32.c index ab2165c52..67f1d26c8 100644 --- a/src/sound/midi_mt32.c +++ b/src/sound/midi_mt32.c @@ -377,42 +377,60 @@ mt32_close(void *priv) static const device_config_t mt32_config[] = { // clang-format off { - .name = "output_gain", - .description = "Output Gain", - .type = CONFIG_SPINNER, - .spinner = { + .name = "output_gain", + .description = "Output Gain", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 100, + .file_filter = NULL, + .spinner = { + .min = 0, + .max = 100 + }, + .selection = { { 0 } } + }, + { + .name = "reverb", + .description = "Reverb", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } } + }, + { + .name = "reverb_output_gain", + .description = "Reverb Output Gain", + .type = CONFIG_SPINNER, + .default_string = NULL, + .default_int = 100, + .file_filter = NULL, + .spinner = { .min = 0, .max = 100 }, - .default_int = 100 + .selection = { { 0 } } }, { - .name = "reverb", - .description = "Reverb", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "reversed_stereo", + .description = "Reversed stereo", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } } }, { - .name = "reverb_output_gain", - .description = "Reverb Output Gain", - .type = CONFIG_SPINNER, - .spinner = { - .min = 0, - .max = 100 - }, - .default_int = 100 - }, - { - .name = "reversed_stereo", - .description = "Reversed stereo", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .name = "nice_ramp", - .description = "Nice ramp", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "nice_ramp", + .description = "Nice ramp", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/sound/midi_rtmidi.cpp b/src/sound/midi_rtmidi.cpp index 9da3fdb91..11203c3f2 100644 --- a/src/sound/midi_rtmidi.cpp +++ b/src/sound/midi_rtmidi.cpp @@ -231,11 +231,15 @@ rtmidi_in_get_dev_name(int num, char *s) static const device_config_t system_midi_config[] = { // clang-format off { - .name = "midi", - .description = "MIDI Output Device", - .type = CONFIG_MIDI_OUT, - .default_string = "", - .default_int = 0 + .name = "midi", + .description = "MIDI Output Device", + .type = CONFIG_MIDI_OUT, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -244,32 +248,48 @@ static const device_config_t system_midi_config[] = { static const device_config_t midi_input_config[] = { // clang-format off { - .name = "midi_input", - .description = "MIDI Input Device", - .type = CONFIG_MIDI_IN, - .default_string = "", - .default_int = 0 + .name = "midi_input", + .description = "MIDI Input Device", + .type = CONFIG_MIDI_IN, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "realtime", - .description = "MIDI Real time", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "realtime", + .description = "MIDI Real time", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "thruchan", - .description = "MIDI Thru", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "thruchan", + .description = "MIDI Thru", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "clockout", - .description = "MIDI Clockout", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "clockout", + .description = "MIDI Clockout", + .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 diff --git a/src/sound/snd_ad1848.c b/src/sound/snd_ad1848.c index d870b4588..87755a96c 100644 --- a/src/sound/snd_ad1848.c +++ b/src/sound/snd_ad1848.c @@ -167,6 +167,7 @@ ad1848_read(uint16_t addr, void *priv) { ad1848_t *ad1848 = (ad1848_t *) priv; uint8_t ret = 0xff; + uint8_t temp = 0; switch (addr & 3) { case 0: /* Index */ @@ -207,10 +208,22 @@ ad1848_read(uint16_t addr, void *priv) ret = ad1848->regs[18 + ad1848->xindex]; break; - case 26: - /* Backdoor to the Joystick Control register on CS4235+. */ + case 23 ... 24: + case 29: + /* Backdoor to control indirect registers on CS4235+. */ + if (ad1848->type >= AD1848_TYPE_CS4235) { + temp = ad1848->cram_read(3, ad1848->cram_priv); + ad1848->cram_write(3, (ad1848->xindex == 23) ? 2 : ((ad1848->xindex == 24) ? 8 : 9), ad1848->cram_priv); + ret = ad1848->cram_read(4, ad1848->cram_priv); + ad1848->cram_write(3, temp, ad1848->cram_priv); + } + break; + + case 26 ... 28: + case 30: + /* Backdoor to control registers on CS4235+. */ if (ad1848->type >= AD1848_TYPE_CS4235) - ret = ad1848->cram_read(0, ad1848->cram_priv); + ret = ad1848->cram_read((ad1848->xindex == 30) ? 7 : (ad1848->xindex - 26), ad1848->cram_priv); break; default: @@ -303,30 +316,35 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv) case 18: case 19: if (ad1848->type >= AD1848_TYPE_CS4236B) { - if ((ad1848->xregs[4] & 0x14) == 0x14) { /* FM remapping */ - ad1848->xregs[ad1848->index - 12] = val; /* real FM volume on extended registers 6 and 7 */ - temp = 1; + if (ad1848->type >= AD1848_TYPE_CS4235) { + if (ad1848->xregs[18] & 0x20) /* AUX1 remapping */ + ad1848->regs[ad1848->index & 3] = val; /* also controls AUX1 on registers 2 and 3 */ + } else { + if ((ad1848->xregs[4] & 0x14) == 0x14) { /* FM remapping */ + ad1848->xregs[6 | (ad1848->index & 1)] = val; /* real FM volume on extended registers 6 and 7 */ + temp = 1; - if (ad1848->index == 18) { - if (val & 0x80) - ad1848->fm_vol_l = 0; - else - ad1848->fm_vol_l = ad1848_vols_7bits[val & 0x3f]; - } else { - if (val & 0x80) - ad1848->fm_vol_r = 0; - else - ad1848->fm_vol_r = ad1848_vols_7bits[val & 0x3f]; + if (ad1848->index == 18) { + if (val & 0x80) + ad1848->fm_vol_l = 0; + else + ad1848->fm_vol_l = ad1848_vols_7bits[val & 0x3f]; + } else { + if (val & 0x80) + ad1848->fm_vol_r = 0; + else + ad1848->fm_vol_r = ad1848_vols_7bits[val & 0x3f]; + } + } + if (ad1848->wten && !(ad1848->xregs[4] & 0x08)) { /* wavetable remapping */ + ad1848->xregs[16 | (ad1848->index & 1)] = val; /* real wavetable volume on extended registers 16 and 17 */ + temp = 1; } - } - if (ad1848->wten && !(ad1848->xregs[4] & 0x08)) { /* wavetable remapping */ - ad1848->xregs[ad1848->index - 2] = val; /* real wavetable volume on extended registers 16 and 17 */ - temp = 1; - } - /* Stop here if any remapping is enabled. */ - if (temp) - return; + /* Stop here if any remapping is enabled. */ + if (temp) + return; + } /* HACK: the Windows 9x driver's "Synth" control writes to this register with no remapping, even if internal FM is enabled. */ @@ -366,9 +384,11 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv) switch (ad1848->xindex) { case 0 ... 1: - /* Remapped line volume. */ - ad1848->regs[18 + ad1848->xindex] = val; - return; + if (ad1848->type < AD1848_TYPE_CS4235) { + /* Remapped line volume. */ + ad1848->regs[18 | ad1848->xindex] = val; + } + break; case 6: if (val & 0x80) @@ -389,13 +409,25 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv) updatefreq = 1; break; + case 23 ... 24: + case 29: + /* Backdoor to control indirect registers on CS4235+. */ + if (ad1848->type >= AD1848_TYPE_CS4235) { + temp = ad1848->cram_read(3, ad1848->cram_priv); + ad1848->cram_write(3, (ad1848->xindex == 23) ? 2 : ((ad1848->xindex == 24) ? 8 : 9), ad1848->cram_priv); + ad1848->cram_write(4, val, ad1848->cram_priv); + ad1848->cram_write(3, temp, ad1848->cram_priv); + } + break; + case 25: return; - case 26: - /* Backdoor to the Joystick Control register on CS4235+. */ + case 26 ... 28: + case 30: + /* Backdoor to control registers on CS4235+. */ if (ad1848->type >= AD1848_TYPE_CS4235) - ad1848->cram_write(0, val, ad1848->cram_priv); + ad1848->cram_write((ad1848->xindex == 30) ? 7 : (ad1848->xindex - 26), val, ad1848->cram_priv); break; default: @@ -747,7 +779,8 @@ ad1848_init(ad1848_t *ad1848, uint8_t type) ad1848->regs[30] = ad1848->regs[31] = 0; if (type >= AD1848_TYPE_CS4236B) { - ad1848->xregs[0] = ad1848->xregs[1] = 0xe8; + if (type < AD1848_TYPE_CS4235) + ad1848->xregs[0] = ad1848->xregs[1] = 0xe8; ad1848->xregs[2] = ad1848->xregs[3] = 0xcf; ad1848->xregs[4] = 0x84; ad1848->xregs[5] = 0; diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index 8a809803d..360da3fec 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -1192,73 +1192,69 @@ adgold_close(void *priv) static const device_config_t adgold_config[] = { // clang-format off { - .name = "irq", - .description = "IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 7, - .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 = "" } - } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 7, + .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 = "" } + }, + .bios = { { 0 } } }, { - .name = "dma", - .description = "Low DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 1, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + .name = "dma", + .description = "Low DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "gameport", - .description = "Enable Game port", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "gameport", + .description = "Enable Game port", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "surround", - .description = "Surround module", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "surround", + .description = "Surround module", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .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 diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index 9e520bcf5..f8a6e4153 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -2737,11 +2737,15 @@ es137x_speed_changed(void *priv) static const device_config_t es1370_config[] = { // clang-format off { - .name = "receive_input", - .description = "Receive input (MIDI)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive input (MIDI)", + .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 @@ -2750,28 +2754,30 @@ static const device_config_t es1370_config[] = { static const device_config_t es1371_config[] = { // clang-format off { - .name = "codec", - .description = "Codec", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "Asahi Kasei AK4540", - .value = AC97_CODEC_AK4540 - }, - { - .description = "TriTech TR28023 / Creative CT1297", - .value = AC97_CODEC_TR28023 - }, - { .description = "" } + .name = "codec", + .description = "Codec", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = AC97_CODEC_TR28023, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Asahi Kasei AK4540", .value = AC97_CODEC_AK4540 }, + { .description = "TriTech TR28023 / Creative CT1297", .value = AC97_CODEC_TR28023 }, + { .description = "" } }, - .default_int = AC97_CODEC_TR28023 + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .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 @@ -2780,32 +2786,31 @@ static const device_config_t es1371_config[] = { static const device_config_t es1373_config[] = { // clang-format off { - .name = "codec", - .description = "Codec", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "Crystal CS4297A", - .value = AC97_CODEC_CS4297A - }, - { - .description = "SigmaTel STAC9721T", - .value = AC97_CODEC_STAC9721 - }, - { - .description = "TriTech TR28023 / Creative CT1297", - .value = AC97_CODEC_TR28023 - }, + .name = "codec", + .description = "Codec", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = AC97_CODEC_CS4297A, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Crystal CS4297A", .value = AC97_CODEC_CS4297A }, + { .description = "SigmaTel STAC9721T", .value = AC97_CODEC_STAC9721 }, + { .description = "TriTech TR28023 / Creative CT1297", .value = AC97_CODEC_TR28023 }, { .description = "" } }, - .default_int = AC97_CODEC_CS4297A + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .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 @@ -2814,32 +2819,31 @@ static const device_config_t es1373_config[] = { static const device_config_t ct5880_config[] = { // clang-format off { - .name = "codec", - .description = "Codec", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "SigmaTel STAC9708T", - .value = AC97_CODEC_STAC9708 - }, - { - .description = "SigmaTel STAC9721T (stereo)", - .value = AC97_CODEC_STAC9721 - }, - { - .description = "TriTech TR28023 / Creative CT1297", - .value = AC97_CODEC_TR28023 - }, - { .description = "" } + .name = "codec", + .description = "Codec", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = AC97_CODEC_STAC9708, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "SigmaTel STAC9708T", .value = AC97_CODEC_STAC9708 }, + { .description = "SigmaTel STAC9721T (stereo)", .value = AC97_CODEC_STAC9721 }, + { .description = "TriTech TR28023 / Creative CT1297", .value = AC97_CODEC_TR28023 }, + { .description = "" } }, - .default_int = AC97_CODEC_STAC9708 + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .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 @@ -2848,11 +2852,14 @@ static const device_config_t ct5880_config[] = { static const device_config_t es1371_onboard_config[] = { // clang-format off { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/sound/snd_azt2316a.c b/src/sound/snd_azt2316a.c index dfbab2bd3..ea682a82c 100644 --- a/src/sound/snd_azt2316a.c +++ b/src/sound/snd_azt2316a.c @@ -1315,142 +1315,127 @@ azt_speed_changed(void *priv) static const device_config_t azt1605_config[] = { // clang-format off { - .name = "codec", - .description = "CODEC", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "CS4248", - .value = AD1848_TYPE_CS4248 - }, - { - .description = "CS4231", - .value = AD1848_TYPE_CS4231 - }, + .name = "codec", + .description = "CODEC", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = AD1848_TYPE_CS4248, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "CS4248", .value = AD1848_TYPE_CS4248 }, + { .description = "CS4231", .value = AD1848_TYPE_CS4231 }, + { .description = "" } }, - .default_int = AD1848_TYPE_CS4248 + .bios = { { 0 } } }, { - .name = "wss_interrupt_after_config", - .description = "Raise CODEC interrupt on CODEC setup (needed by some drivers)", - .type = CONFIG_BINARY, - .default_int = 0 + .name = "wss_interrupt_after_config", + .description = "Raise CODEC interrupt on CODEC setup (needed by some drivers)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "addr", - .description = "SB Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "Use EEPROM setting", - .value = 0 - }, - { - .description = "" - } - } - }, - { - .name = "sb_dma8", - .description = "SB low DMA", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "DMA 0", - .value = 0 - }, - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { - .description = "" - } + .name = "addr", + .description = "SB Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x220", .value = 0x220 }, + { .description = "0x240", .value = 0x240 }, + { .description = "Use EEPROM setting", .value = 0 }, + { .description = "" } }, - .default_int = 1 + .bios = { { 0 } } }, { - .name = "wss_irq", - .description = "WSS IRQ", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "IRQ 11", - .value = 11 - }, - { - .description = "IRQ 10", - .value = 10 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { - .description = "" - } + .name = "sb_dma8", + .description = "SB low DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 0", .value = 0 }, + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } }, - .default_int = 10 + .bios = { { 0 } } }, - { - .name = "wss_dma", - .description = "WSS DMA", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "DMA 0", - .value = 0 - }, - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { - .description = "" - } - }, - .default_int = 0 + { + .name = "wss_irq", + .description = "WSS IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 10, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "" } }, - { - .name = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "wss_dma", + .description = "WSS DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 0", .value = 0 }, + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .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 @@ -1459,119 +1444,111 @@ static const device_config_t azt1605_config[] = { static const device_config_t azt2316a_config[] = { // clang-format off { - .name = "codec", - .description = "CODEC", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "CS4248", - .value = AD1848_TYPE_CS4248 - }, - { - .description = "CS4231", - .value = AD1848_TYPE_CS4231 - }, + .name = "codec", + .description = "CODEC", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = AD1848_TYPE_CS4248, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "CS4248", .value = AD1848_TYPE_CS4248 }, + { .description = "CS4231", .value = AD1848_TYPE_CS4231 }, + { .description = "" } }, - .default_int = AD1848_TYPE_CS4248 + .bios = { { 0 } } }, { - .name = "wss_interrupt_after_config", - .description = "Raise CODEC interrupt on CODEC setup (needed by some drivers)", - .type = CONFIG_BINARY, - .default_int = 0 + .name = "wss_interrupt_after_config", + .description = "Raise CODEC interrupt on CODEC setup (needed by some drivers)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "addr", - .description = "SB Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "Use EEPROM setting", - .value = 0 - }, - { - .description = "" - } - } - }, - { - .name = "wss_irq", - .description = "WSS IRQ", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "IRQ 11", - .value = 11 - }, - { - .description = "IRQ 10", - .value = 10 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { - .description = "" - } + .name = "addr", + .description = "SB Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x220", .value = 0x220 }, + { .description = "0x240", .value = 0x240 }, + { .description = "Use EEPROM setting", .value = 0 }, + { .description = "" } }, - .default_int = 10 + .bios = { { 0 } } }, { - .name = "wss_dma", - .description = "WSS DMA", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "DMA 0", - .value = 0 - }, - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { - .description = "" - } + .name = "wss_irq", + .description = "WSS IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 10, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "" } }, - .default_int = 0 + .bios = { { 0 } } }, { - .name = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "wss_dma", + .description = "WSS DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 0", .value = 0 }, + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "receive_input401", + .description = "Receive MIDI input", + .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 diff --git a/src/sound/snd_cmi8x38.c b/src/sound/snd_cmi8x38.c index 5f75d0dc3..a41f53865 100644 --- a/src/sound/snd_cmi8x38.c +++ b/src/sound/snd_cmi8x38.c @@ -1508,11 +1508,15 @@ cmi8x38_close(void *priv) static const device_config_t cmi8x38_config[] = { // clang-format off { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .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 @@ -1521,18 +1525,26 @@ static const device_config_t cmi8x38_config[] = { static const device_config_t cmi8738_config[] = { // clang-format off { - .name = "six_channel", - .description = "6CH variant (6-channel)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "six_channel", + .description = "6CH variant (6-channel)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .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 diff --git a/src/sound/snd_cms.c b/src/sound/snd_cms.c index f8db04fed..66dff80f3 100644 --- a/src/sound/snd_cms.c +++ b/src/sound/snd_cms.c @@ -200,42 +200,23 @@ cms_close(void *priv) static const device_config_t cms_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x220, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x210", - .value = 0x210 - }, - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x230", - .value = 0x230 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "0x250", - .value = 0x250 - }, - { - .description = "0x260", - .value = 0x260 - }, - { - .description = "" - } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x220, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x210", .value = 0x210 }, + { .description = "0x220", .value = 0x220 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x250", .value = 0x250 }, + { .description = "0x260", .value = 0x260 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/sound/snd_cs423x.c b/src/sound/snd_cs423x.c index bef57d992..f5458eaf0 100644 --- a/src/sound/snd_cs423x.c +++ b/src/sound/snd_cs423x.c @@ -606,8 +606,8 @@ cs423x_get_buffer(int32_t *buffer, int len, void *priv) /* Output audio from the WSS codec, and also the OPL if we're in charge of it. */ ad1848_update(&dev->ad1848); - /* Don't output anything if the analog section is powered down. */ - if (!(dev->indirect_regs[2] & 0xa4) && !(dev->indirect_regs[9] & 0x04)) { + /* Don't output anything if the analog section or DAC is powered down. */ + if (!(dev->regs[2] & 0xb4) && !(dev->indirect_regs[9] & 0x04)) { for (int c = 0; c < len * 2; c += 2) { buffer[c] += dev->ad1848.buffer[c] / 2; buffer[c + 1] += dev->ad1848.buffer[c + 1] / 2; @@ -626,8 +626,9 @@ cs423x_get_music_buffer(int32_t *buffer, int len, void *priv) if (dev->opl_wss) { const int32_t *opl_buf = dev->sb->opl.update(dev->sb->opl.priv); - /* Don't output anything if the analog section or DAC2 (CS4235+) is powered down. */ - if (!(dev->indirect_regs[2] & 0xa4) && !(dev->indirect_regs[9] & 0x06)) { + /* Don't output anything if the analog section, DAC (DAC2 instead on CS4235+) or FM synth is powered down. */ + uint8_t bpd_mask = (dev->type >= CRYSTAL_CS4235) ? 0xb1 : 0xb5; + if (!(dev->regs[2] & bpd_mask) && !(dev->indirect_regs[9] & 0x06)) { for (int c = 0; c < len * 2; c += 2) { buffer[c] += (opl_buf[c] * dev->ad1848.fm_vol_l) >> 16; buffer[c + 1] += (opl_buf[c + 1] * dev->ad1848.fm_vol_r) >> 16; @@ -654,9 +655,10 @@ cs423x_pnp_enable(cs423x_t *dev, uint8_t update_rom, uint8_t update_hwconfig) Disable the PnP key disabling mechanism until someone figures something out. */ #if 0 isapnp_enable_card(dev->pnp_card, ((dev->ram_data[0x4002] & 0x20) || !dev->pnp_enable) ? ISAPNP_CARD_NO_KEY : ISAPNP_CARD_ENABLE); -#endif +#else if ((dev->ram_data[0x4002] & 0x20) || !dev->pnp_enable) pclog("CS423x: Attempted to disable PnP key\n"); +#endif } /* Update some register bits based on the config data in RAM if requested. */ @@ -684,14 +686,20 @@ cs423x_pnp_enable(cs423x_t *dev, uint8_t update_rom, uint8_t update_hwconfig) else dev->ad1848.xregs[4] &= ~0x10; - /* Update VCEN. */ if (dev->type == CRYSTAL_CS4236) { + /* Update VCEN. */ if (dev->ram_data[0x4002] & 0x04) dev->regs[4] |= 0x40; else dev->regs[4] &= ~0x40; } + if (dev->type >= CRYSTAL_CS4235) { + /* Update X18 and X19 values. */ + dev->ad1848.xregs[18] = (dev->ad1848.xregs[18] & ~0x3e) | (dev->ram_data[0x400b] & 0x3e); + dev->ad1848.xregs[19] = dev->ram_data[0x4005]; + } + /* Inform WSS codec of the changes. */ ad1848_updatevolmask(&dev->ad1848); } @@ -818,23 +826,10 @@ cs423x_load_defaults(cs423x_t *dev, uint8_t *dest) dest[4] = 0x43; /* code base byte */ break; - case CRYSTAL_CS4236B: - dest[22] = 0x35; /* default PnP ID */ - break; - - case CRYSTAL_CS4237B: - dest[22] = 0x37; /* default PnP ID */ - break; - - case CRYSTAL_CS4238B: - dest[22] = 0x38; /* default PnP ID */ - break; - case CRYSTAL_CS4235: case CRYSTAL_CS4239: dest[4] = 0x05; /* code base byte */ dest[12] = 0x08; /* external decode length */ - dest[22] = 0x36; /* default PnP ID - explicitly stated to be the CS4236 non-B one */ break; } break; @@ -904,13 +899,15 @@ cs423x_init(const device_t *info) case CRYSTAL_CS4238B: case CRYSTAL_CS4235: case CRYSTAL_CS4239: - /* Same WSS codec and EEPROM structure. */ + /* Different WSS codec families. */ dev->ad1848_type = (dev->type >= CRYSTAL_CS4235) ? AD1848_TYPE_CS4235 : ((dev->type >= CRYSTAL_CS4236B) ? AD1848_TYPE_CS4236B : AD1848_TYPE_CS4236); - dev->pnp_offset = 0x4013; - /* Different Chip Version and ID registers (N/A on CS4236), which shouldn't be reset by ad1848_init. */ + /* Different Chip Version and ID values (N/A on CS4236), which shouldn't be reset by ad1848_init. */ dev->ad1848.xregs[25] = dev->type; + /* Same EEPROM structure. */ + dev->pnp_offset = 0x4013; + if (!(info->local & CRYSTAL_NOEEPROM)) { /* Start a new EEPROM with the default configuration data. */ cs423x_load_defaults(dev, &dev->eeprom_data[4]); @@ -1117,6 +1114,20 @@ const device_t cs4236b_device = { .config = NULL }; +const device_t cs4236b_onboard_device = { + .name = "Crystal CS4236B", + .internal_name = "cs4236b", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CRYSTAL_CS4236B | CRYSTAL_NOEEPROM, + .init = cs423x_init, + .close = cs423x_close, + .reset = cs423x_reset, + .available = cs423x_available, + .speed_changed = cs423x_speed_changed, + .force_redraw = NULL, + .config = NULL +}; + const device_t cs4237b_device = { .name = "Crystal CS4237B", .internal_name = "cs4237b", diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index 9dcf0f00b..f2651c72f 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -1431,92 +1431,67 @@ gus_speed_changed(void *priv) static const device_config_t gus_config[] = { // clang-format off { - .name = "type", - .description = "GUS type", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "Classic", - .value = GUS_CLASSIC - }, + .name = "type", + .description = "GUS type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Classic", .value = GUS_CLASSIC }, #ifdef USE_GUSMAX - { - .description = "MAX", - .value = GUS_MAX - }, + { .description = "MAX", .value = GUS_MAX }, #endif /*USE_GUSMAX */ - { NULL } + { NULL } }, + .bios = { { 0 } } }, { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x220, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "210H", - .value = 0x210 - }, - { - .description = "220H", - .value = 0x220 - }, - { - .description = "230H", - .value = 0x230 - }, - { - .description = "240H", - .value = 0x240 - }, - { - .description = "250H", - .value = 0x250 - }, - { - .description = "260H", - .value = 0x260 - }, + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x220, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "210H", .value = 0x210 }, + { .description = "220H", .value = 0x220 }, + { .description = "230H", .value = 0x230 }, + { .description = "240H", .value = 0x240 }, + { .description = "250H", .value = 0x250 }, + { .description = "260H", .value = 0x260 }, + { NULL } }, + .bios = { { 0 } } }, { - .name = "gus_ram", - "Memory size", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "256 KB", - .value = 0 - }, - { - .description = "512 KB", - .value = 1 - }, - { - .description = "1 MB", - .value = 2 - }, - { NULL } - } + .name = "gus_ram", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 0 }, + { .description = "512 KB", .value = 1 }, + { .description = "1 MB", .value = 2 }, + { NULL } + }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .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 off diff --git a/src/sound/snd_lpt_dac.c b/src/sound/snd_lpt_dac.c index 812a649a8..0462818a0 100644 --- a/src/sound/snd_lpt_dac.c +++ b/src/sound/snd_lpt_dac.c @@ -7,10 +7,10 @@ #include "cpu.h" #include <86box/86box.h> #include <86box/filters.h> +#include <86box/timer.h> #include <86box/lpt.h> #include <86box/machine.h> #include <86box/sound.h> -#include <86box/timer.h> #include <86box/plat_unused.h> typedef struct lpt_dac_t { diff --git a/src/sound/snd_lpt_dss.c b/src/sound/snd_lpt_dss.c index 06160ce4c..875230518 100644 --- a/src/sound/snd_lpt_dss.c +++ b/src/sound/snd_lpt_dss.c @@ -7,10 +7,10 @@ #include "cpu.h" #include <86box/86box.h> #include <86box/filters.h> +#include <86box/timer.h> #include <86box/lpt.h> #include <86box/machine.h> #include <86box/sound.h> -#include <86box/timer.h> #include <86box/plat_unused.h> typedef struct dss_t { diff --git a/src/sound/snd_mpu401.c b/src/sound/snd_mpu401.c index 09d1757eb..bec2ed39c 100644 --- a/src/sound/snd_mpu401.c +++ b/src/sound/snd_mpu401.c @@ -1804,106 +1804,59 @@ mpu401_standalone_close(void *priv) static const device_config_t mpu401_standalone_config[] = { // clang-format off { - .name = "base", - .description = "MPU-401 Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x330, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x230", - .value = 0x230 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "0x250", - .value = 0x250 - }, - { - .description = "0x300", - .value = 0x300 - }, - { - .description = "0x320", - .value = 0x320 - }, - { - .description = "0x330", - .value = 0x330 - }, - { - .description = "0x332", - .value = 0x332 - }, - { - .description = "0x334", - .value = 0x334 - }, - { - .description = "0x336", - .value = 0x336 - }, - { - .description = "0x340", - .value = 0x340 - }, - { - .description = "0x350", - .value = 0x350 - }, - { .description = "" } - } + .name = "base", + .description = "MPU-401 Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x330, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x220", .value = 0x220 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x250", .value = 0x250 }, + { .description = "0x300", .value = 0x300 }, + { .description = "0x320", .value = 0x320 }, + { .description = "0x330", .value = 0x330 }, + { .description = "0x332", .value = 0x332 }, + { .description = "0x334", .value = 0x334 }, + { .description = "0x336", .value = 0x336 }, + { .description = "0x340", .value = 0x340 }, + { .description = "0x350", .value = 0x350 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "irq", - .description = "MPU-401 IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 2, - .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 = "irq", + .description = "MPU-401 IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .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 = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .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 @@ -1912,46 +1865,34 @@ static const device_config_t mpu401_standalone_config[] = { static const device_config_t mpu401_standalone_mca_config[] = { // clang-format off { - .name = "irq", - .description = "MPU-401 IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 9, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .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 = "IRQ 9", - .value = 9 - }, - { .description = "" } - } + .name = "irq", + .description = "MPU-401 IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 9, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .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 = "IRQ 9", .value = 9 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .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 diff --git a/src/sound/snd_opl2board.c b/src/sound/snd_opl2board.c index a76b6bf4d..632ad85f1 100644 --- a/src/sound/snd_opl2board.c +++ b/src/sound/snd_opl2board.c @@ -167,13 +167,15 @@ opl2board_device_close(void *priv) static const device_config_t opl2board_config[] = { { - .name = "host_serial_path", - .description = "Host Serial Device", - .type = CONFIG_SERPORT, + .name = "host_serial_path", + .description = "Host Serial Device", + .type = CONFIG_SERPORT, .default_string = "", - .file_filter = NULL, - .spinner = { 0 }, - .selection = { { 0 } } + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/sound/snd_optimc.c b/src/sound/snd_optimc.c index 7058d918c..d5c01dbaf 100644 --- a/src/sound/snd_optimc.c +++ b/src/sound/snd_optimc.c @@ -456,18 +456,26 @@ mirosound_pcm10_available(void) static const device_config_t optimc_config[] = { // clang-format off { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .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 diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index 05df32322..ddb135357 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -2401,25 +2401,37 @@ pas16_close(void *priv) static const device_config_t pas16_config[] = { { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 0b09a7b2e..7de8ec824 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -245,40 +245,23 @@ pssj_close(void *priv) static const device_config_t pssj_isa_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x2C0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x0C0", - .value = 0x0C0 - }, - { - .description = "0x0E0", - .value = 0x0E0 - }, - { - .description = "0x1C0", - .value = 0x1C0 - }, - { - .description = "0x1E0", - .value = 0x1E0 - }, - { - .description = "0x2C0", - .value = 0x2C0 - }, - { - .description = "0x2E0", - .value = 0x2E0 - }, - { .description = "" } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x2C0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x0C0", .value = 0x0C0 }, + { .description = "0x0E0", .value = 0x0E0 }, + { .description = "0x1C0", .value = 0x1C0 }, + { .description = "0x1E0", .value = 0x1E0 }, + { .description = "0x2C0", .value = 0x2C0 }, + { .description = "0x2E0", .value = 0x2E0 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index ea961a6d3..ca233b252 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -4081,211 +4081,165 @@ sb_speed_changed(void *priv) // clang-format off static const device_config_t sb_config[] = { { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x220, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x210", - .value = 0x210 - }, - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x230", - .value = 0x230 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "0x250", - .value = 0x250 - }, - { - .description = "0x260", - .value = 0x260 - }, - { .description = "" } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x220, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x210", .value = 0x210 }, + { .description = "0x220", .value = 0x220 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x250", .value = 0x250 }, + { .description = "0x260", .value = 0x260 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "irq", - .description = "IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 7, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "IRQ 2", - .value = 2 - }, - { - .description = "IRQ 3", - .value = 3 - }, - { - .description = "IRQ 5", - .value = 5 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { .description = "" } - } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 7, + .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 = "dma", - .description = "DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 1, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 - }, + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .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 sb15_config[] = { { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x220, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x210", - .value = 0x210 - }, - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x230", - .value = 0x230 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "0x250", - .value = 0x250 - }, - { - .description = "0x260", - .value = 0x260 - }, - { .description = "" } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x220, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x210", .value = 0x210 }, + { .description = "0x220", .value = 0x220 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x250", .value = 0x250 }, + { .description = "0x260", .value = 0x260 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "irq", .description = "IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 7, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "IRQ 2", - .value = 2 - }, - { - .description = "IRQ 3", - .value = 3 - }, - { - .description = "IRQ 5", - .value = 5 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { .description = "" } - } + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 7, + .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 = "dma", - .description = "DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 1, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "cms", - .description = "Enable CMS", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "cms", + .description = "Enable CMS", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; @@ -4294,1064 +4248,888 @@ static const device_config_t sb2_config[] = { { .name = "base", .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x220, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x240", - .value = 0x240 - }, - { .description = "" } - } + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x220, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x220", .value = 0x220 }, + { .description = "0x240", .value = 0x240 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "mixaddr", - .description = "Mixer", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "Disabled", - .value = 0 - }, - { - .description = "0x250", - .value = 0x250 - }, - { - .description = "0x260", - .value = 0x260 - }, - { .description = "" } - } + .name = "mixaddr", + .description = "Mixer", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "0x250", .value = 0x250 }, + { .description = "0x260", .value = 0x260 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "irq", - .description = "IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 5, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "IRQ 2", - .value = 2 - }, - { - .description = "IRQ 3", - .value = 3 - }, - { - .description = "IRQ 5", - .value = 5 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { .description = "" } - } + .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 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "dma", - .description = "DMA", - .type = CONFIG_SELECTION, + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, .default_string = "", - .default_int = 1, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "cms", - .description = "Enable CMS", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "cms", + .description = "Enable CMS", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .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 sb_mcv_config[] = { { - .name = "irq", - .description = "IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 7, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "IRQ 2", - .value = 2 - }, - { - .description = "IRQ 3", - .value = 3 - }, - { - .description = "IRQ 5", - .value = 5 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { .description = "" } - } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 7, + .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 = "dma", - .description = "DMA", - .type = CONFIG_SELECTION, + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, .default_string = "", - .default_int = 1, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .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 sb_pro_config[] = { { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x220, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x240", - .value = 0x240 - }, - { .description = "" } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x220, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x220", .value = 0x220 }, + { .description = "0x240", .value = 0x240 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "irq", - .description = "IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 7, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "IRQ 2", - .value = 2 - }, - { - .description = "IRQ 5", - .value = 5 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { - .description = "IRQ 10", - .value = 10 - }, - { .description = "" } - } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 7, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "dma", - .description = "DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 1, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 0", - .value = 0 - }, - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 0", .value = 0 }, + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .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 sb_pro_mcv_config[] = { { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .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 sb_16_config[] = { { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x220, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "0x260", - .value = 0x260 - }, - { - .description = "0x280", - .value = 0x280 - }, - { .description = "" } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x220, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x220", .value = 0x220 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x260", .value = 0x260 }, + { .description = "0x280", .value = 0x280 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "base401", - .description = "MPU-401 Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x330, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "Disabled", - .value = 0 - }, - { - .description = "0x300", - .value = 0x300 - }, - { - .description = "0x330", - .value = 0x330 - }, - { .description = "" } - } + .name = "base401", + .description = "MPU-401 Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x330, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "0x300", .value = 0x300 }, + { .description = "0x330", .value = 0x330 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "irq", - .description = "IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 5, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "IRQ 2", - .value = 2 - }, - { - .description = "IRQ 5", - .value = 5 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { - .description = "IRQ 10", - .value = 10 - }, - { .description = "" } - } + .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 = "IRQ 7", .value = 7 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "dma", - .description = "Low DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 1, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 0", - .value = 0 - }, - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + .name = "dma", + .description = "Low DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 0", .value = 0 }, + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "dma16", - .description = "High DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 5, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 5", - .value = 5 - }, - { - .description = "DMA 6", - .value = 6 - }, - { - .description = "DMA 7", - .value = 7 - }, - { .description = "" } - } + .name = "dma16", + .description = "High DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 5, + .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 = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_16_pnp_config[] = { { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_goldfinch_config[] = { { - .name = "onboard_ram", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "None", - .value = 0 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "4 MB", - .value = 4096 - }, - { - .description = "8 MB", - .value = 8192 - }, - { - .description = "16 MB", - .value = 16384 - }, - { - .description = "28 MB", - .value = 28672 - }, - { .description = "" } - } + .name = "onboard_ram", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "None", .value = 0 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "2 MB", .value = 2048 }, + { .description = "4 MB", .value = 4096 }, + { .description = "8 MB", .value = 8192 }, + { .description = "16 MB", .value = 16384 }, + { .description = "28 MB", .value = 28672 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_32_pnp_config[] = { { - .name = "onboard_ram", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "None", - .value = 0 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "8 MB", - .value = 8192 - }, - { - .description = "28 MB", - .value = 28672 - }, - { .description = "" } - } + .name = "onboard_ram", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "None", .value = 0 }, + { .description = "512 KB", .value = 512 }, + { .description = "2 MB", .value = 2048 }, + { .description = "8 MB", .value = 8192 }, + { .description = "28 MB", .value = 28672 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe32_config[] = { { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x220, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "0x260", - .value = 0x260 - }, - { - .description = "0x280", - .value = 0x280 - }, - { .description = "" } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x220, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x220", .value = 0x220 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x260", .value = 0x260 }, + { .description = "0x280", .value = 0x280 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "emu_base", - .description = "EMU8000 Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x620, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x620", - .value = 0x620 - }, - { - .description = "0x640", - .value = 0x640 - }, - { - .description = "0x660", - .value = 0x660 - }, - { - .description = "0x680", - .value = 0x680 - }, - { .description = ""} - } + .name = "emu_base", + .description = "EMU8000 Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x620, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x620", .value = 0x620 }, + { .description = "0x640", .value = 0x640 }, + { .description = "0x660", .value = 0x660 }, + { .description = "0x680", .value = 0x680 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "base401", - .description = "MPU-401 Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x330, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "Disabled", - .value = 0 - }, - { - .description = "0x300", - .value = 0x300 - }, - { - .description = "0x330", - .value = 0x330 - }, - { .description = "" } - } + .name = "base401", + .description = "MPU-401 Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x330, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "0x300", .value = 0x300 }, + { .description = "0x330", .value = 0x330 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "irq", - .description = "IRQ", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 5, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "IRQ 2", - .value = 2 - }, - { - .description = "IRQ 5", - .value = 5 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { - .description = "IRQ 10", - .value = 10 - }, - { .description = "" } - } + .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 = "IRQ 7", .value = 7 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "dma", - .description = "Low DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 1, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 0", - .value = 0 - }, - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + .name = "dma", + .description = "Low DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "DMA 0", .value = 0 }, + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "dma16", - .description = "High DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 5, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "DMA 5", - .value = 5 - }, - { - .description = "DMA 6", - .value = 6 - }, - { - .description = "DMA 7", - .value = 7 - }, - { .description = "" } - } + .name = "dma16", + .description = "High DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 5, + .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 = "onboard_ram", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 512, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "None", - .value = 0 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "8 MB", - .value = 8192 - }, - { - .description = "28 MB", - .value = 28672 - }, - { "" } - } + .name = "onboard_ram", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "None", .value = 0 }, + { .description = "512 KB", .value = 512 }, + { .description = "2 MB", .value = 2048 }, + { .description = "8 MB", .value = 8192 }, + { .description = "28 MB", .value = 28672 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe32_pnp_config[] = { { - .name = "onboard_ram", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 512, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "None", - .value = 0 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "8 MB", - .value = 8192 - }, - { - .description = "28 MB", - .value = 28672 - }, - { .description = "" } - } + .name = "onboard_ram", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "None", .value = 0 }, + { .description = "512 KB", .value = 512 }, + { .description = "2 MB", .value = 2048 }, + { .description = "8 MB", .value = 8192 }, + { .description = "28 MB", .value = 28672 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe64_value_config[] = { { - .name = "onboard_ram", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 512, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "4 MB", - .value = 4096 - }, - { - .description = "8 MB", - .value = 8192 - }, - { - .description = "12 MB", - .value = 12288 - }, - { - .description = "16 MB", - .value = 16384 - }, - { - .description = "20 MB", - .value = 20480 - }, - { - .description = "24 MB", - .value = 24576 - }, - { - .description = "28 MB", - .value = 28672 - }, - { .description = "" } - } + .name = "onboard_ram", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "2 MB", .value = 2048 }, + { .description = "4 MB", .value = 4096 }, + { .description = "8 MB", .value = 8192 }, + { .description = "12 MB", .value = 12288 }, + { .description = "16 MB", .value = 16384 }, + { .description = "20 MB", .value = 20480 }, + { .description = "24 MB", .value = 24576 }, + { .description = "28 MB", .value = 28672 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe64_config[] = { { - .name = "onboard_ram", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 1024, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "4 MB", - .value = 4096 - }, - { - .description = "8 MB", - .value = 8192 - }, - { - .description = "12 MB", - .value = 12288 - }, - { - .description = "16 MB", - .value = 16384 - }, - { - .description = "20 MB", - .value = 20480 - }, - { - .description = "24 MB", - .value = 24576 - }, - { - .description = "28 MB", - .value = 28672 - }, - { .description = "" } - } + .name = "onboard_ram", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1 MB", .value = 1024 }, + { .description = "2 MB", .value = 2048 }, + { .description = "4 MB", .value = 4096 }, + { .description = "8 MB", .value = 8192 }, + { .description = "12 MB", .value = 12288 }, + { .description = "16 MB", .value = 16384 }, + { .description = "20 MB", .value = 20480 }, + { .description = "24 MB", .value = 24576 }, + { .description = "28 MB", .value = 28672 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe64_gold_config[] = { { - .name = "onboard_ram", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 4096, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "4 MB", - .value = 4096 - }, - { - .description = "8 MB", - .value = 8192 - }, - { - .description = "12 MB", - .value = 12288 - }, - { - .description = "16 MB", - .value = 16384 - }, - { - .description = "20 MB", - .value = 20480 - }, - { - .description = "24 MB", - .value = 24576 - }, - { - .description = "28 MB", - .value = 28672 - }, - { .description = "" } - } + .name = "onboard_ram", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4096, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "4 MB", .value = 4096 }, + { .description = "8 MB", .value = 8192 }, + { .description = "12 MB", .value = 12288 }, + { .description = "16 MB", .value = 16384 }, + { .description = "20 MB", .value = 20480 }, + { .description = "24 MB", .value = 24576 }, + { .description = "28 MB", .value = 28672 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; @@ -5361,120 +5139,80 @@ static const device_config_t ess_688_config[] = { .name = "base", .description = "Address", .type = CONFIG_HEX16, - .default_string = "", + .default_string = NULL, .default_int = 0x220, - .file_filter = "", + .file_filter = NULL, .spinner = { 0 }, .selection = { - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x230", - .value = 0x230 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "0x250", - .value = 0x250 - }, - { .description = "" } - } + { .description = "0x220", .value = 0x220 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x250", .value = 0x250 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "irq", .description = "IRQ", .type = CONFIG_SELECTION, - .default_string = "", + .default_string = NULL, .default_int = 5, - .file_filter = "", + .file_filter = NULL, .spinner = { 0 }, .selection = { - { - .description = "IRQ 2", - .value = 2 - }, - { - .description = "IRQ 5", - .value = 5 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { - .description = "IRQ 10", - .value = 10 - }, - { .description = "" } - } + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "dma", .description = "DMA", .type = CONFIG_SELECTION, - .default_string = "", + .default_string = NULL, .default_int = 1, - .file_filter = "", + .file_filter = NULL, .spinner = { 0 }, .selection = { - { - .description = "DMA 0", - .value = 0 - }, - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + { .description = "DMA 0", .value = 0 }, + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "ide_ctrl", .description = "IDE Controller", .type = CONFIG_HEX16, - .default_string = "", + .default_string = NULL, .default_int = 0x0000, - .file_filter = "", + .file_filter = NULL, .spinner = { 0 }, .selection = { - { - .description = "Disabled", - .value = 0x0000 - }, - { - .description = "0x170, IRQ 15", - .value = 0xf170 - }, - { - .description = "0x1E8, IRQ 11", - .value = 0xb1e8 - }, - { - .description = "0x168, IRQ 9", - .value = 0x9168 - }, - { - .description = "0x168, IRQ 10", - .value = 0xa168 - }, - { .description = "" } - } + { .description = "Disabled", .value = 0x0000 }, + { .description = "0x170, IRQ 15", .value = 0xf170 }, + { .description = "0x1E8, IRQ 11", .value = 0xb1e8 }, + { .description = "0x168, IRQ 9", .value = 0x9168 }, + { .description = "0x168, IRQ 10", .value = 0xa168 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "receive_input", .description = "Receive MIDI input", .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; @@ -5484,170 +5222,154 @@ static const device_config_t ess_1688_config[] = { .name = "base", .description = "Address", .type = CONFIG_HEX16, - .default_string = "", + .default_string = NULL, .default_int = 0x220, - .file_filter = "", + .file_filter = NULL, .spinner = { 0 }, .selection = { - { - .description = "0x220", - .value = 0x220 - }, - { - .description = "0x230", - .value = 0x230 - }, - { - .description = "0x240", - .value = 0x240 - }, - { - .description = "0x250", - .value = 0x250 - }, - { .description = "" } - } + { .description = "0x220", .value = 0x220 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x250", .value = 0x250 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "irq", .description = "IRQ", .type = CONFIG_SELECTION, - .default_string = "", + .default_string = NULL, .default_int = 5, - .file_filter = "", + .file_filter = NULL, .spinner = { 0 }, .selection = { - { - .description = "IRQ 2", - .value = 2 - }, - { - .description = "IRQ 5", - .value = 5 - }, - { - .description = "IRQ 7", - .value = 7 - }, - { - .description = "IRQ 10", - .value = 10 - }, - { .description = "" } - } + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "dma", .description = "DMA", .type = CONFIG_SELECTION, - .default_string = "", + .default_string = NULL, .default_int = 1, - .file_filter = "", + .file_filter = NULL, .spinner = { 0 }, .selection = { - { - .description = "DMA 0", - .value = 0 - }, - { - .description = "DMA 1", - .value = 1 - }, - { - .description = "DMA 3", - .value = 3 - }, - { .description = "" } - } + { .description = "DMA 0", .value = 0 }, + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 3", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "ide_ctrl", .description = "IDE Controller", .type = CONFIG_HEX16, - .default_string = "", + .default_string = NULL, .default_int = 0x0000, - .file_filter = "", + .file_filter = NULL, .spinner = { 0 }, .selection = { - { - .description = "Disabled", - .value = 0x0000 - }, - { - .description = "0x170, IRQ 15", - .value = 0xf170 - }, - { - .description = "0x1E8, IRQ 11", - .value = 0xb1e8 - }, - { - .description = "0x168, IRQ 9", - .value = 0x9168 - }, - { - .description = "0x168, IRQ 10", - .value = 0xa168 - }, - { .description = "" } - } + { .description = "Disabled", .value = 0x0000 }, + { .description = "0x170, IRQ 15", .value = 0xf170 }, + { .description = "0x1E8, IRQ 11", .value = 0xb1e8 }, + { .description = "0x168, IRQ 9", .value = 0x9168 }, + { .description = "0x168, IRQ 10", .value = 0xa168 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 0 + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t ess_688_pnp_config[] = { { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, + .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 ess_1688_pnp_config[] = { { - .name = "control_pc_speaker", - .description = "Control PC speaker", - .type = CONFIG_BINARY, + .name = "control_pc_speaker", + .description = "Control PC speaker", + .type = CONFIG_BINARY, .default_string = "", - .default_int = 0 + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input", - .description = "Receive MIDI input", - .type = CONFIG_BINARY, + .name = "receive_input", + .description = "Receive MIDI input", + .type = CONFIG_BINARY, .default_string = "", - .default_int = 1 + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "receive_input401", - .description = "Receive MIDI input (MPU-401)", - .type = CONFIG_BINARY, + .name = "receive_input401", + .description = "Receive MIDI input (MPU-401)", + .type = CONFIG_BINARY, .default_string = "", - .default_int = 0 + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index 89064bea4..569d698d5 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -268,40 +268,23 @@ sn76489_device_close(void *priv) static const device_config_t tndy_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x0C0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x0C0", - .value = 0x0C0 - }, - { - .description = "0x0E0", - .value = 0x0E0 - }, - { - .description = "0x1C0", - .value = 0x1C0 - }, - { - .description = "0x1E0", - .value = 0x1E0 - }, - { - .description = "0x2C0", - .value = 0x2C0 - }, - { - .description = "0x2E0", - .value = 0x2E0 - }, - { .description = "" } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x0C0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x0C0", .value = 0x0C0 }, + { .description = "0x0E0", .value = 0x0E0 }, + { .description = "0x1C0", .value = 0x1C0 }, + { .description = "0x1E0", .value = 0x1E0 }, + { .description = "0x2C0", .value = 0x2C0 }, + { .description = "0x2E0", .value = 0x2E0 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/sound/snd_ssi2001.c b/src/sound/snd_ssi2001.c index 0e1bbd96c..f1620b817 100644 --- a/src/sound/snd_ssi2001.c +++ b/src/sound/snd_ssi2001.c @@ -136,39 +136,32 @@ entertainer_close(void *priv) static const device_config_t ssi2001_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x280, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x280", - .value = 0x280 - }, - { - .description = "0x2A0", - .value = 0x2A0 - }, - { - .description = "0x2C0", - .value = 0x2C0 - }, - { - .description = "0x2E0", - .value = 0x2E0 - }, - { .description = "" } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x280, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x280", .value = 0x280 }, + { .description = "0x2A0", .value = 0x2A0 }, + { .description = "0x2C0", .value = 0x2C0 }, + { .description = "0x2E0", .value = 0x2E0 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "gameport", - .description = "Enable Game port", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "gameport", + .description = "Enable Game port", + .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 off @@ -177,11 +170,15 @@ static const device_config_t ssi2001_config[] = { static const device_config_t entertainer_config[] = { // clang-format off { - .name = "gameport", - .description = "Enable Game port", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "gameport", + .description = "Enable Game port", + .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 off diff --git a/src/sound/snd_wss.c b/src/sound/snd_wss.c index 0f37cbf27..c55e5f57b 100644 --- a/src/sound/snd_wss.c +++ b/src/sound/snd_wss.c @@ -245,39 +245,32 @@ wss_speed_changed(void *priv) static const device_config_t wss_config[] = { // clang-format off { - .name = "base", - .description = "Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x530, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "0x530", - .value = 0x530 - }, - { - .description = "0x604", - .value = 0x604 - }, - { - .description = "0xe80", - .value = 0xe80 - }, - { - .description = "0xf40", - .value = 0xf40 - }, - { .description = "" } - } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x530, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x530", .value = 0x530 }, + { .description = "0x604", .value = 0x604 }, + { .description = "0xe80", .value = 0xe80 }, + { .description = "0xf40", .value = 0xf40 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "opl", - .description = "Enable OPL", - .type = CONFIG_BINARY, - .default_string = "", - .default_int = 1 + .name = "opl", + .description = "Enable OPL", + .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 diff --git a/src/video/CMakeLists.txt b/src/video/CMakeLists.txt index 2a90957b2..cf65f2519 100644 --- a/src/video/CMakeLists.txt +++ b/src/video/CMakeLists.txt @@ -16,22 +16,70 @@ # todo: Split nv stuff into its own file... -add_library(vid OBJECT agpgart.c video.c vid_table.c vid_cga.c vid_cga_comp.c - vid_compaq_cga.c vid_mda.c vid_hercules.c vid_herculesplus.c - vid_incolor.c vid_colorplus.c vid_genius.c vid_pgc.c vid_im1024.c - vid_sigma.c vid_wy700.c vid_ega.c vid_ega_render.c vid_svga.c vid_8514a.c - vid_svga_render.c vid_ddc.c vid_vga.c vid_ati_eeprom.c vid_ati18800.c - vid_ati28800.c vid_ati_mach8.c vid_ati_mach64.c vid_ati68875_ramdac.c - vid_ati68860_ramdac.c vid_bt481_ramdac.c vid_bt48x_ramdac.c vid_chips_69000.c - vid_av9194.c vid_icd2061.c vid_ics2494.c vid_ics2595.c vid_cl54xx.c - vid_et3000.c vid_et4000.c vid_sc1148x_ramdac.c vid_sc1502x_ramdac.c - vid_et4000w32.c vid_stg_ramdac.c vid_ht216.c vid_oak_oti.c vid_paradise.c - vid_rtg310x.c vid_f82c425.c vid_ti_cf62011.c vid_tvga.c vid_tgui9440.c - vid_tkd8001_ramdac.c vid_att20c49x_ramdac.c vid_s3.c vid_s3_virge.c - vid_ibm_rgb528_ramdac.c vid_sdac_ramdac.c vid_ogc.c vid_mga.c vid_nga.c - vid_tvp3026_ramdac.c vid_att2xc498_ramdac.c vid_xga.c +add_library(vid OBJECT + agpgart.c + video.c + vid_table.c + vid_cga.c + vid_cga_comp.c + vid_compaq_cga.c + vid_mda.c + vid_hercules.c + vid_herculesplus.c + vid_incolor.c + vid_colorplus.c + vid_genius.c + vid_pgc.c + vid_im1024.c + vid_sigma.c + vid_wy700.c + vid_ega.c + vid_ega_render.c + vid_svga.c + vid_8514a.c + vid_svga_render.c + vid_ddc.c + vid_vga.c + vid_ati_eeprom.c + vid_ati18800.c + vid_ati28800.c + vid_ati_mach8.c + vid_ati_mach64.c + vid_ati68875_ramdac.c + vid_ati68860_ramdac.c + vid_bt481_ramdac.c + vid_bt48x_ramdac.c + vid_chips_69000.c + vid_av9194.c + vid_icd2061.c + vid_ics2494.c + vid_ics2595.c + vid_cl54xx.c + vid_et3000.c + vid_et4000.c + vid_sc1148x_ramdac.c + vid_sc1502x_ramdac.c + vid_et4000w32.c + vid_stg_ramdac.c + vid_ht216.c + vid_oak_oti.c + vid_paradise.c + vid_rtg310x.c + vid_f82c425.c + vid_ti_cf62011.c + vid_tvga.c vid_tgui9440.c + vid_tkd8001_ramdac.c + vid_att20c49x_ramdac.c + vid_s3.c vid_s3_virge.c + vid_ibm_rgb528_ramdac.c + vid_sdac_ramdac.c + vid_ogc.c + vid_mga.c + vid_nga.c + vid_tvp3026_ramdac.c + vid_att2xc498_ramdac.c + vid_xga.c vid_bochs_vbe.c - nv/nv_base.c nv/nv_rivatimer.c nv/nv3/nv3_core.c @@ -75,7 +123,6 @@ add_library(vid OBJECT agpgart.c video.c vid_table.c vid_cga.c vid_cga_comp.c nv/nv3/classes/nv3_class_017_d3d5_tri_zeta_buffer.c nv/nv3/classes/nv3_class_018_point_zeta_buffer.c nv/nv3/classes/nv3_class_01c_image_in_memory.c - ) if(G100) @@ -86,10 +133,19 @@ if(XL24) target_compile_definitions(vid PRIVATE USE_XL24) endif() -add_library(voodoo OBJECT vid_voodoo.c vid_voodoo_banshee.c - vid_voodoo_banshee_blitter.c vid_voodoo_blitter.c vid_voodoo_display.c - vid_voodoo_fb.c vid_voodoo_fifo.c vid_voodoo_reg.c vid_voodoo_render.c - vid_voodoo_setup.c vid_voodoo_texture.c) +add_library(voodoo OBJECT + vid_voodoo.c + vid_voodoo_banshee.c + vid_voodoo_banshee_blitter.c + vid_voodoo_blitter.c + vid_voodoo_display.c + vid_voodoo_fb.c + vid_voodoo_fifo.c + vid_voodoo_reg.c + vid_voodoo_render.c + vid_voodoo_setup.c + vid_voodoo_texture.c +) if(NOT MSVC AND (ARCH STREQUAL "i386" OR ARCH STREQUAL "x86_64")) target_compile_options(voodoo PRIVATE "-msse2") diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index 1c81e8166..09b054895 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -47,7 +47,6 @@ # undef CLAMP #endif - #define BIOS_MACH8_ROM_PATH "roms/video/mach8/11301113140_4k.BIN" static void ibm8514_accel_outb(uint16_t port, uint8_t val, void *priv); @@ -84,14 +83,14 @@ CLAMP(int16_t in, int16_t min, int16_t max) return in; } -#define WRITE8(addr, var, val) \ - switch ((addr) & 1) { \ - case 0: \ - var = (var & 0xff00) | (val); \ - break; \ - case 1: \ - var = (var & 0x00ff) | ((val) << 8); \ - break; \ +#define WRITE8(addr, var, val) \ + switch ((addr) & 1) { \ + case 0: \ + var = (var & 0xff00) | (val); \ + break; \ + case 1: \ + var = (var & 0x00ff) | ((val) << 8); \ + break; \ } #define READ8(addr, var) \ @@ -105,139 +104,139 @@ CLAMP(int16_t in, int16_t min, int16_t max) } -#define READ_PIXTRANS_WORD(cx, n) \ - if ((cmd <= 1) || (cmd == 5)) { \ +#define READ_PIXTRANS_WORD(cx, n) \ + if ((cmd <= 1) || (cmd == 5)) { \ temp = dev->vram[((dev->accel.cy * dev->pitch) + (cx) + (n)) & dev->vram_mask]; \ temp |= (dev->vram[((dev->accel.cy * dev->pitch) + (cx) + (n + 1)) & dev->vram_mask] << 8); \ - } else { \ - temp = dev->vram[(dev->accel.dest + (cx) + (n)) & dev->vram_mask]; \ - temp |= (dev->vram[(dev->accel.dest + (cx) + (n + 1)) & dev->vram_mask] << 8); \ - } \ + } else { \ + temp = dev->vram[(dev->accel.dest + (cx) + (n)) & dev->vram_mask]; \ + temp |= (dev->vram[(dev->accel.dest + (cx) + (n + 1)) & dev->vram_mask] << 8); \ + } \ -#define READ(addr, dat) \ - if (dev->bpp) \ +#define READ(addr, dat) \ + if (dev->bpp) \ dat = vram_w[(addr) & (dev->vram_mask >> 1)]; \ - else \ + else \ dat = (dev->vram[(addr) & (dev->vram_mask)]); \ -#define READ_HIGH(addr, dat) \ +#define READ_HIGH(addr, dat) \ dat |= (dev->vram[(addr) & (dev->vram_mask)] << 8); -#define MIX(mixmode, dest_dat, src_dat) \ - { \ - switch ((mixmode) ? (dev->accel.frgd_mix & 0x1f) : (dev->accel.bkgd_mix & 0x1f)) { \ - case 0x00: \ - dest_dat = ~dest_dat; \ - break; \ - case 0x01: \ - dest_dat = 0; \ - break; \ - case 0x02: \ - dest_dat = ~0; \ - break; \ - case 0x03: \ - dest_dat = dest_dat; \ - break; \ - case 0x04: \ - dest_dat = ~src_dat; \ - break; \ - case 0x05: \ - dest_dat = src_dat ^ dest_dat; \ - break; \ - case 0x06: \ - dest_dat = ~(src_dat ^ dest_dat); \ - break; \ - case 0x07: \ - dest_dat = src_dat; \ - break; \ - case 0x08: \ - dest_dat = ~(src_dat & dest_dat); \ - break; \ - case 0x09: \ - dest_dat = ~src_dat | dest_dat; \ - break; \ - case 0x0a: \ - dest_dat = src_dat | ~dest_dat; \ - break; \ - case 0x0b: \ - dest_dat = src_dat | dest_dat; \ - break; \ - case 0x0c: \ - dest_dat = src_dat & dest_dat; \ - break; \ - case 0x0d: \ - dest_dat = src_dat & ~dest_dat; \ - break; \ - case 0x0e: \ - dest_dat = ~src_dat & dest_dat; \ - break; \ - case 0x0f: \ - dest_dat = ~(src_dat | dest_dat); \ - break; \ - case 0x10: \ - dest_dat = MIN(src_dat, dest_dat); \ - break; \ - case 0x11: \ - dest_dat = dest_dat - src_dat; \ - break; \ - case 0x12: \ - dest_dat = src_dat - dest_dat; \ - break; \ - case 0x13: \ - dest_dat = src_dat + dest_dat; \ - break; \ - case 0x14: \ - dest_dat = MAX(src_dat, dest_dat); \ - break; \ - case 0x15: \ - dest_dat = (dest_dat - src_dat) >> 1; \ - break; \ - case 0x16: \ - dest_dat = (src_dat - dest_dat) >> 1; \ - break; \ - case 0x17: \ - dest_dat = (dest_dat + src_dat) >> 1; \ - break; \ - case 0x18: \ - dest_dat = MAX(0, (dest_dat - src_dat)); \ - break; \ - case 0x19: \ - dest_dat = MAX(0, (dest_dat - src_dat)); \ - break; \ - case 0x1a: \ - dest_dat = MAX(0, (src_dat - dest_dat)); \ - break; \ - case 0x1b: \ - if (dev->bpp) \ - dest_dat = MIN(0xffff, (dest_dat + src_dat)); \ - else \ - dest_dat = MIN(0xff, (dest_dat + src_dat)); \ - break; \ - case 0x1c: \ - dest_dat = MAX(0, (dest_dat - src_dat)) / 2; \ - break; \ - case 0x1d: \ - dest_dat = MAX(0, (dest_dat - src_dat)) / 2; \ - break; \ - case 0x1e: \ - dest_dat = MAX(0, (src_dat - dest_dat)) / 2; \ - break; \ - case 0x1f: \ - if (dev->bpp) \ +#define MIX(mixmode, dest_dat, src_dat) \ + { \ + switch ((mixmode) ? (dev->accel.frgd_mix & 0x1f) : (dev->accel.bkgd_mix & 0x1f)) { \ + case 0x00: \ + dest_dat = ~dest_dat; \ + break; \ + case 0x01: \ + dest_dat = 0; \ + break; \ + case 0x02: \ + dest_dat = ~0; \ + break; \ + case 0x03: \ + dest_dat = dest_dat; \ + break; \ + case 0x04: \ + dest_dat = ~src_dat; \ + break; \ + case 0x05: \ + dest_dat = src_dat ^ dest_dat; \ + break; \ + case 0x06: \ + dest_dat = ~(src_dat ^ dest_dat); \ + break; \ + case 0x07: \ + dest_dat = src_dat; \ + break; \ + case 0x08: \ + dest_dat = ~(src_dat & dest_dat); \ + break; \ + case 0x09: \ + dest_dat = ~src_dat | dest_dat; \ + break; \ + case 0x0a: \ + dest_dat = src_dat | ~dest_dat; \ + break; \ + case 0x0b: \ + dest_dat = src_dat | dest_dat; \ + break; \ + case 0x0c: \ + dest_dat = src_dat & dest_dat; \ + break; \ + case 0x0d: \ + dest_dat = src_dat & ~dest_dat; \ + break; \ + case 0x0e: \ + dest_dat = ~src_dat & dest_dat; \ + break; \ + case 0x0f: \ + dest_dat = ~(src_dat | dest_dat); \ + break; \ + case 0x10: \ + dest_dat = MIN(src_dat, dest_dat); \ + break; \ + case 0x11: \ + dest_dat = dest_dat - src_dat; \ + break; \ + case 0x12: \ + dest_dat = src_dat - dest_dat; \ + break; \ + case 0x13: \ + dest_dat = src_dat + dest_dat; \ + break; \ + case 0x14: \ + dest_dat = MAX(src_dat, dest_dat); \ + break; \ + case 0x15: \ + dest_dat = (dest_dat - src_dat) >> 1; \ + break; \ + case 0x16: \ + dest_dat = (src_dat - dest_dat) >> 1; \ + break; \ + case 0x17: \ + dest_dat = (dest_dat + src_dat) >> 1; \ + break; \ + case 0x18: \ + dest_dat = MAX(0, (dest_dat - src_dat)); \ + break; \ + case 0x19: \ + dest_dat = MAX(0, (dest_dat - src_dat)); \ + break; \ + case 0x1a: \ + dest_dat = MAX(0, (src_dat - dest_dat)); \ + break; \ + case 0x1b: \ + if (dev->bpp) \ + dest_dat = MIN(0xffff, (dest_dat + src_dat)); \ + else \ + dest_dat = MIN(0xff, (dest_dat + src_dat)); \ + break; \ + case 0x1c: \ + dest_dat = MAX(0, (dest_dat - src_dat)) / 2; \ + break; \ + case 0x1d: \ + dest_dat = MAX(0, (dest_dat - src_dat)) / 2; \ + break; \ + case 0x1e: \ + dest_dat = MAX(0, (src_dat - dest_dat)) / 2; \ + break; \ + case 0x1f: \ + if (dev->bpp) \ dest_dat = (0xffff < (src_dat + dest_dat)) ? 0xffff : ((src_dat + dest_dat) / 2); \ - else \ - dest_dat = (0xff < (src_dat + dest_dat)) ? 0xff : ((src_dat + dest_dat) / 2); \ - break; \ - } \ + else \ + dest_dat = (0xff < (src_dat + dest_dat)) ? 0xff : ((src_dat + dest_dat) / 2); \ + break; \ + } \ } -#define WRITE(addr, dat) \ - if (dev->bpp) { \ - vram_w[((addr)) & (dev->vram_mask >> 1)] = dat; \ +#define WRITE(addr, dat) \ + if (dev->bpp) { \ + vram_w[((addr)) & (dev->vram_mask >> 1)] = dat; \ dev->changedvram[(((addr)) & (dev->vram_mask >> 1)) >> 11] = changeframecount; \ - } else { \ - dev->vram[((addr)) & (dev->vram_mask)] = dat; \ - dev->changedvram[(((addr)) & (dev->vram_mask)) >> 12] = changeframecount; \ + } else { \ + dev->vram[((addr)) & (dev->vram_mask)] = dat; \ + dev->changedvram[(((addr)) & (dev->vram_mask)) >> 12] = changeframecount; \ } int ibm8514_active = 0; @@ -3977,52 +3976,44 @@ ibm8514_force_redraw(void *priv) // clang-format off static const device_config_t isa_ext8514_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1024, - .selection = { - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "extensions", - .description = "Vendor", - .type = CONFIG_SELECTION, - .default_int = 0, - .selection = { - { - .description = "IBM", - .value = 0 - }, - { - .description = "ATI", - .value = 1 - }, - { - .description = "" - } - } + .name = "extensions", + .description = "Vendor", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "IBM", .value = 0 }, + { .description = "ATI", .value = 1 }, + { .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 = "CC00h", .value = 0xcc000 }, @@ -4035,8 +4026,9 @@ static const device_config_t isa_ext8514_config[] = { { .description = "DA00h", .value = 0xda000 }, { .description = "DC00h", .value = 0xdc000 }, { .description = "DE00h", .value = 0xde000 }, - { .description = "" } + { .description = "" } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; @@ -4044,76 +4036,67 @@ static const device_config_t isa_ext8514_config[] = { // clang-format off static const device_config_t mca_ext8514_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1024, - .selection = { - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "extensions", - .description = "Vendor", - .type = CONFIG_SELECTION, - .default_int = 0, - .selection = { - { - .description = "IBM", - .value = 0 - }, - { - .description = "ATI", - .value = 1 - }, - { - .description = "" - } - } + .name = "extensions", + .description = "Vendor", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "IBM", .value = 0 }, + { .description = "ATI", .value = 1 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; // clang-format off const device_t gen8514_isa_device = { - .name = "IBM 8514/A clone (ISA)", + .name = "IBM 8514/A clone (ISA)", .internal_name = "8514_isa", - .flags = DEVICE_AT | DEVICE_ISA, - .local = 0, - .init = ibm8514_init, - .close = ibm8514_close, - .reset = NULL, + .flags = DEVICE_AT | DEVICE_ISA, + .local = 0, + .init = ibm8514_init, + .close = ibm8514_close, + .reset = NULL, .available = NULL, .speed_changed = ibm8514_speed_changed, - .force_redraw = ibm8514_force_redraw, - .config = isa_ext8514_config + .force_redraw = ibm8514_force_redraw, + .config = isa_ext8514_config }; const device_t ibm8514_mca_device = { - .name = "IBM 8514/A (MCA)", + .name = "IBM 8514/A (MCA)", .internal_name = "8514_mca", - .flags = DEVICE_MCA, - .local = 0, - .init = ibm8514_init, - .close = ibm8514_close, - .reset = NULL, + .flags = DEVICE_MCA, + .local = 0, + .init = ibm8514_init, + .close = ibm8514_close, + .reset = NULL, .available = NULL, .speed_changed = ibm8514_speed_changed, - .force_redraw = ibm8514_force_redraw, - .config = mca_ext8514_config + .force_redraw = ibm8514_force_redraw, + .config = mca_ext8514_config }; - void ibm8514_device_add(void) { diff --git a/src/video/vid_ati18800.c b/src/video/vid_ati18800.c index 59688087f..9a9be6ff6 100644 --- a/src/video/vid_ati18800.c +++ b/src/video/vid_ati18800.c @@ -329,23 +329,19 @@ ati18800_force_redraw(void *priv) static const device_config_t ati18800_wonder_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "" - } - } + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_ati28800.c b/src/video/vid_ati28800.c index 4c039d9e6..156e95425 100644 --- a/src/video/vid_ati28800.c +++ b/src/video/vid_ati28800.c @@ -744,27 +744,20 @@ ati28800_force_redraw(void *priv) // clang-format off static const device_config_t ati28800_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; @@ -772,27 +765,20 @@ static const device_config_t ati28800_config[] = { #ifdef USE_XL24 static const device_config_t ati28800_wonderxl_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index b3a544fc1..9b7a67f31 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -1508,16 +1508,16 @@ mach64_start_line(mach64_t *mach64) mach64->accel.op = OP_LINE; } -#define READ(addr, dat, width) \ - if (width == 0) \ - dat = svga->vram[((addr)) & mach64->vram_mask]; \ - else if (width == 1) \ - dat = *(uint16_t *) &svga->vram[((addr) << 1) & mach64->vram_mask]; \ - else if (width == 2) \ - dat = *(uint32_t *) &svga->vram[((addr) << 2) & mach64->vram_mask]; \ - else if (mach64->dp_pix_width & DP_BYTE_PIX_ORDER) \ - dat = (svga->vram[((addr) >> 3) & mach64->vram_mask] >> ((addr) &7)) & 1; \ - else \ +#define READ(addr, dat, width) \ + if (width == 0) \ + dat = svga->vram[((addr)) & mach64->vram_mask]; \ + else if (width == 1) \ + dat = *(uint16_t *) &svga->vram[((addr) << 1) & mach64->vram_mask]; \ + else if (width == 2) \ + dat = *(uint32_t *) &svga->vram[((addr) << 2) & mach64->vram_mask]; \ + else if (mach64->dp_pix_width & DP_BYTE_PIX_ORDER) \ + dat = (svga->vram[((addr) >> 3) & mach64->vram_mask] >> ((addr) &7)) & 1; \ + else \ dat = (svga->vram[((addr) >> 3) & mach64->vram_mask] >> (7 - ((addr) &7))) & 1; #define MIX \ @@ -1575,29 +1575,29 @@ mach64_start_line(mach64_t *mach64) break; \ } -#define WRITE(addr, width) \ - if (width == 0) { \ - svga->vram[(addr) &mach64->vram_mask] = dest_dat; \ - svga->changedvram[((addr) &mach64->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ - } else if (width == 1) { \ - *(uint16_t *) &svga->vram[((addr) << 1) & mach64->vram_mask] = dest_dat; \ - svga->changedvram[(((addr) << 1) & mach64->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ - } else if (width == 2) { \ - *(uint32_t *) &svga->vram[((addr) << 2) & mach64->vram_mask] = dest_dat; \ - svga->changedvram[(((addr) << 2) & mach64->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ - } else { \ - if (dest_dat & 1) { \ - if (mach64->dp_pix_width & DP_BYTE_PIX_ORDER) \ - svga->vram[((addr) >> 3) & mach64->vram_mask] |= 1 << ((addr) &7); \ - else \ - svga->vram[((addr) >> 3) & mach64->vram_mask] |= 1 << (7 - ((addr) &7)); \ - } else { \ - if (mach64->dp_pix_width & DP_BYTE_PIX_ORDER) \ - svga->vram[((addr) >> 3) & mach64->vram_mask] &= ~(1 << ((addr) &7)); \ - else \ - svga->vram[((addr) >> 3) & mach64->vram_mask] &= ~(1 << (7 - ((addr) &7))); \ - } \ - svga->changedvram[(((addr) >> 3) & mach64->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ +#define WRITE(addr, width) \ + if (width == 0) { \ + svga->vram[(addr) &mach64->vram_mask] = dest_dat; \ + svga->changedvram[((addr) &mach64->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ + } else if (width == 1) { \ + *(uint16_t *) &svga->vram[((addr) << 1) & mach64->vram_mask] = dest_dat; \ + svga->changedvram[(((addr) << 1) & mach64->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ + } else if (width == 2) { \ + *(uint32_t *) &svga->vram[((addr) << 2) & mach64->vram_mask] = dest_dat; \ + svga->changedvram[(((addr) << 2) & mach64->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ + } else { \ + if (dest_dat & 1) { \ + if (mach64->dp_pix_width & DP_BYTE_PIX_ORDER) \ + svga->vram[((addr) >> 3) & mach64->vram_mask] |= 1 << ((addr) &7); \ + else \ + svga->vram[((addr) >> 3) & mach64->vram_mask] |= 1 << (7 - ((addr) &7)); \ + } else { \ + if (mach64->dp_pix_width & DP_BYTE_PIX_ORDER) \ + svga->vram[((addr) >> 3) & mach64->vram_mask] &= ~(1 << ((addr) &7)); \ + else \ + svga->vram[((addr) >> 3) & mach64->vram_mask] &= ~(1 << (7 - ((addr) &7))); \ + } \ + svga->changedvram[(((addr) >> 3) & mach64->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ } void @@ -4711,50 +4711,39 @@ mach64_force_redraw(void *priv) // clang-format off static const device_config_t mach64gx_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 4, - .selection = { - { - .description = "1 MB", - .value = 1 - }, - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1 MB", .value = 1 }, + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t mach64vt2_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 4, - .selection = { - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index a923ea7e2..06a60449f 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -49,10 +49,10 @@ #define BIOS_MACH32_MCA_ROM_PATH "roms/video/mach32/MACH32MCA_Olivetti.BIN" #define BIOS_MACH32_PCI_ROM_PATH "roms/video/mach32/intelopt_00000.rom" -static video_timings_t timing_gfxultra_isa = { .type = VIDEO_ISA, .write_b = 3, .write_w = 3, .write_l = 6, .read_b = 5, .read_w = 5, .read_l = 10 }; -static video_timings_t timing_mach32_vlb = { .type = VIDEO_BUS, .write_b = 2, .write_w = 2, .write_l = 1, .read_b = 20, .read_w = 20, .read_l = 21 }; -static video_timings_t timing_mach32_mca = { .type = VIDEO_MCA, .write_b = 4, .write_w = 5, .write_l = 10, .read_b = 5, .read_w = 5, .read_l = 10 }; -static video_timings_t timing_mach32_pci = { .type = VIDEO_PCI, .write_b = 2, .write_w = 2, .write_l = 1, .read_b = 20, .read_w = 20, .read_l = 21 }; +static video_timings_t timing_gfxultra_isa = { .type = VIDEO_ISA, .write_b = 3, .write_w = 3, .write_l = 6, .read_b = 5, .read_w = 5, .read_l = 10 }; +static video_timings_t timing_mach32_vlb = { .type = VIDEO_BUS, .write_b = 2, .write_w = 2, .write_l = 1, .read_b = 20, .read_w = 20, .read_l = 21 }; +static video_timings_t timing_mach32_mca = { .type = VIDEO_MCA, .write_b = 4, .write_w = 5, .write_l = 10, .read_b = 5, .read_w = 5, .read_l = 10 }; +static video_timings_t timing_mach32_pci = { .type = VIDEO_PCI, .write_b = 2, .write_w = 2, .write_l = 1, .read_b = 20, .read_w = 20, .read_l = 21 }; static void mach_accel_outb(uint16_t port, uint8_t val, void *priv); static void mach_accel_outw(uint16_t port, uint16_t val, void *priv); @@ -88,14 +88,14 @@ mach_log(const char *fmt, ...) # define mach_log(fmt, ...) #endif -#define WRITE8(addr, var, val) \ - switch ((addr) & 1) { \ - case 0: \ - var = (var & 0xff00) | (val); \ - break; \ - case 1: \ - var = (var & 0x00ff) | ((val) << 8); \ - break; \ +#define WRITE8(addr, var, val) \ + switch ((addr) & 1) { \ + case 0: \ + var = (var & 0xff00) | (val); \ + break; \ + case 1: \ + var = (var & 0x00ff) | ((val) << 8); \ + break; \ } #define READ8(addr, var) \ @@ -110,166 +110,164 @@ mach_log(const char *fmt, ...) #define READ_PIXTRANS_BYTE_IO(cx, n) \ if ((mach->accel.cmd_type == 2) || (mach->accel.cmd_type == 5)) { \ - if (dev->bpp) { \ - if (n == 0)\ + if (dev->bpp) { \ + if (n == 0) \ mach->accel.pix_trans[(n)] = vram_w[(dev->accel.dest + (cx) + (n)) & (dev->vram_mask >> 1)] & 0xff; \ - else \ - mach->accel.pix_trans[(n)] = vram_w[(dev->accel.dest + (cx) + (n)) & (dev->vram_mask >> 1)] >> 8; \ - \ - } else \ - mach->accel.pix_trans[(n)] = dev->vram[(dev->accel.dest + (cx) + (n)) & dev->vram_mask]; \ - \ + else \ + mach->accel.pix_trans[(n)] = vram_w[(dev->accel.dest + (cx) + (n)) & (dev->vram_mask >> 1)] >> 8; \ + } else \ + mach->accel.pix_trans[(n)] = dev->vram[(dev->accel.dest + (cx) + (n)) & dev->vram_mask]; \ } -#define READ_PIXTRANS_WORD(cx, n) \ - if ((cmd == 0) || (cmd == 1) || (cmd == 5) || (mach->accel.cmd_type == -1)) { \ - if (dev->bpp) \ - temp = vram_w[((dev->accel.cy * dev->pitch) + (cx) + (n)) & (dev->vram_mask >> 1)]; \ - else { \ - temp = dev->vram[((dev->accel.cy * dev->pitch) + (cx) + (n)) & dev->vram_mask]; \ - temp |= (dev->vram[((dev->accel.cy * dev->pitch) + (cx) + (n + 1)) & dev->vram_mask] << 8); \ - } \ - } else if ((mach->accel.cmd_type == 2) || (mach->accel.cmd_type == 5)) { \ - if (dev->bpp) \ - temp = vram_w[((dev->accel.dest) + (cx) + (n)) & (dev->vram_mask >> 1)]; \ - else { \ - temp = dev->vram[((dev->accel.dest) + (cx) + (n)) & dev->vram_mask]; \ - temp |= (dev->vram[((dev->accel.dest) + (cx) + (n + 1)) & dev->vram_mask] << 8); \ - } \ - } else if ((mach->accel.cmd_type == 3) || (mach->accel.cmd_type == 4)) { \ - if (dev->bpp) \ - temp = vram_w[((mach->accel.ge_offset << 1) + ((dev->accel.cy) * (dev->pitch)) + (cx) + (n)) & (dev->vram_mask >> 1)]; \ - else { \ - temp = dev->vram[((mach->accel.ge_offset << 2) + ((dev->accel.cy) * (dev->pitch)) + (cx) + (n)) & dev->vram_mask]; \ +#define READ_PIXTRANS_WORD(cx, n) \ + if ((cmd == 0) || (cmd == 1) || (cmd == 5) || (mach->accel.cmd_type == -1)) { \ + if (dev->bpp) \ + temp = vram_w[((dev->accel.cy * dev->pitch) + (cx) + (n)) & (dev->vram_mask >> 1)]; \ + else { \ + temp = dev->vram[((dev->accel.cy * dev->pitch) + (cx) + (n)) & dev->vram_mask]; \ + temp |= (dev->vram[((dev->accel.cy * dev->pitch) + (cx) + (n + 1)) & dev->vram_mask] << 8); \ + } \ + } else if ((mach->accel.cmd_type == 2) || (mach->accel.cmd_type == 5)) { \ + if (dev->bpp) \ + temp = vram_w[((dev->accel.dest) + (cx) + (n)) & (dev->vram_mask >> 1)]; \ + else { \ + temp = dev->vram[((dev->accel.dest) + (cx) + (n)) & dev->vram_mask]; \ + temp |= (dev->vram[((dev->accel.dest) + (cx) + (n + 1)) & dev->vram_mask] << 8); \ + } \ + } else if ((mach->accel.cmd_type == 3) || (mach->accel.cmd_type == 4)) { \ + if (dev->bpp) \ + temp = vram_w[((mach->accel.ge_offset << 1) + ((dev->accel.cy) * (dev->pitch)) + (cx) + (n)) & (dev->vram_mask >> 1)]; \ + else { \ + temp = dev->vram[((mach->accel.ge_offset << 2) + ((dev->accel.cy) * (dev->pitch)) + (cx) + (n)) & dev->vram_mask]; \ temp |= (dev->vram[((mach->accel.ge_offset << 2) + ((dev->accel.cy) * (dev->pitch)) + (cx) + (n + 1)) & dev->vram_mask] << 8); \ - } \ + } \ } -#define READ(addr, dat) \ - if (dev->bpp) \ +#define READ(addr, dat) \ + if (dev->bpp) \ dat = vram_w[(addr) & (dev->vram_mask >> 1)]; \ - else \ + else \ dat = (dev->vram[(addr) & (dev->vram_mask)]); -#define READ_HIGH(addr, dat) \ +#define READ_HIGH(addr, dat) \ dat |= (dev->vram[(addr) & (dev->vram_mask)] << 8); -#define MIX(mixmode, dest_dat, src_dat) \ - { \ - switch ((mixmode) ? (dev->accel.frgd_mix & 0x1f) : (dev->accel.bkgd_mix & 0x1f)) { \ - case 0x00: \ - dest_dat = ~dest_dat; \ - break; \ - case 0x01: \ - dest_dat = 0; \ - break; \ - case 0x02: \ - dest_dat = ~0; \ - break; \ - case 0x03: \ - dest_dat = dest_dat; \ - break; \ - case 0x04: \ - dest_dat = ~src_dat; \ - break; \ - case 0x05: \ - dest_dat = src_dat ^ dest_dat; \ - break; \ - case 0x06: \ - dest_dat = ~(src_dat ^ dest_dat); \ - break; \ - case 0x07: \ - dest_dat = src_dat; \ - break; \ - case 0x08: \ - dest_dat = ~(src_dat & dest_dat); \ - break; \ - case 0x09: \ - dest_dat = ~src_dat | dest_dat; \ - break; \ - case 0x0a: \ - dest_dat = src_dat | ~dest_dat; \ - break; \ - case 0x0b: \ - dest_dat = src_dat | dest_dat; \ - break; \ - case 0x0c: \ - dest_dat = src_dat & dest_dat; \ - break; \ - case 0x0d: \ - dest_dat = src_dat & ~dest_dat; \ - break; \ - case 0x0e: \ - dest_dat = ~src_dat & dest_dat; \ - break; \ - case 0x0f: \ - dest_dat = ~(src_dat | dest_dat); \ - break; \ - case 0x10: \ - dest_dat = MIN(src_dat, dest_dat); \ - break; \ - case 0x11: \ - dest_dat = dest_dat - src_dat; \ - break; \ - case 0x12: \ - dest_dat = src_dat - dest_dat; \ - break; \ - case 0x13: \ - dest_dat = src_dat + dest_dat; \ - break; \ - case 0x14: \ - dest_dat = MAX(src_dat, dest_dat); \ - break; \ - case 0x15: \ - dest_dat = (dest_dat - src_dat) / 2; \ - break; \ - case 0x16: \ - dest_dat = (src_dat - dest_dat) / 2; \ - break; \ - case 0x17: \ - dest_dat = (dest_dat + src_dat) / 2; \ - break; \ - case 0x18: \ - dest_dat = MAX(0, (dest_dat - src_dat)); \ - break; \ - case 0x19: \ - dest_dat = MAX(0, (dest_dat - src_dat)); \ - break; \ - case 0x1a: \ - dest_dat = MAX(0, (src_dat - dest_dat)); \ - break; \ - case 0x1b: \ - if (dev->bpp) \ - dest_dat = MIN(0xffff, (dest_dat + src_dat)); \ - else \ - dest_dat = MIN(0xff, (dest_dat + src_dat)); \ - break; \ - case 0x1c: \ - dest_dat = MAX(0, (dest_dat - src_dat)) / 2; \ - break; \ - case 0x1d: \ - dest_dat = MAX(0, (dest_dat - src_dat)) / 2; \ - break; \ - case 0x1e: \ - dest_dat = MAX(0, (src_dat - dest_dat)) / 2; \ - break; \ - case 0x1f: \ - if (dev->bpp) \ +#define MIX(mixmode, dest_dat, src_dat) \ + { \ + switch ((mixmode) ? (dev->accel.frgd_mix & 0x1f) : (dev->accel.bkgd_mix & 0x1f)) { \ + case 0x00: \ + dest_dat = ~dest_dat; \ + break; \ + case 0x01: \ + dest_dat = 0; \ + break; \ + case 0x02: \ + dest_dat = ~0; \ + break; \ + case 0x03: \ + dest_dat = dest_dat; \ + break; \ + case 0x04: \ + dest_dat = ~src_dat; \ + break; \ + case 0x05: \ + dest_dat = src_dat ^ dest_dat; \ + break; \ + case 0x06: \ + dest_dat = ~(src_dat ^ dest_dat); \ + break; \ + case 0x07: \ + dest_dat = src_dat; \ + break; \ + case 0x08: \ + dest_dat = ~(src_dat & dest_dat); \ + break; \ + case 0x09: \ + dest_dat = ~src_dat | dest_dat; \ + break; \ + case 0x0a: \ + dest_dat = src_dat | ~dest_dat; \ + break; \ + case 0x0b: \ + dest_dat = src_dat | dest_dat; \ + break; \ + case 0x0c: \ + dest_dat = src_dat & dest_dat; \ + break; \ + case 0x0d: \ + dest_dat = src_dat & ~dest_dat; \ + break; \ + case 0x0e: \ + dest_dat = ~src_dat & dest_dat; \ + break; \ + case 0x0f: \ + dest_dat = ~(src_dat | dest_dat); \ + break; \ + case 0x10: \ + dest_dat = MIN(src_dat, dest_dat); \ + break; \ + case 0x11: \ + dest_dat = dest_dat - src_dat; \ + break; \ + case 0x12: \ + dest_dat = src_dat - dest_dat; \ + break; \ + case 0x13: \ + dest_dat = src_dat + dest_dat; \ + break; \ + case 0x14: \ + dest_dat = MAX(src_dat, dest_dat); \ + break; \ + case 0x15: \ + dest_dat = (dest_dat - src_dat) / 2; \ + break; \ + case 0x16: \ + dest_dat = (src_dat - dest_dat) / 2; \ + break; \ + case 0x17: \ + dest_dat = (dest_dat + src_dat) / 2; \ + break; \ + case 0x18: \ + dest_dat = MAX(0, (dest_dat - src_dat)); \ + break; \ + case 0x19: \ + dest_dat = MAX(0, (dest_dat - src_dat)); \ + break; \ + case 0x1a: \ + dest_dat = MAX(0, (src_dat - dest_dat)); \ + break; \ + case 0x1b: \ + if (dev->bpp) \ + dest_dat = MIN(0xffff, (dest_dat + src_dat)); \ + else \ + dest_dat = MIN(0xff, (dest_dat + src_dat)); \ + break; \ + case 0x1c: \ + dest_dat = MAX(0, (dest_dat - src_dat)) / 2; \ + break; \ + case 0x1d: \ + dest_dat = MAX(0, (dest_dat - src_dat)) / 2; \ + break; \ + case 0x1e: \ + dest_dat = MAX(0, (src_dat - dest_dat)) / 2; \ + break; \ + case 0x1f: \ + if (dev->bpp) \ dest_dat = (0xffff < (src_dat + dest_dat)) ? 0xffff : ((src_dat + dest_dat) / 2); \ - else \ - dest_dat = (0xff < (src_dat + dest_dat)) ? 0xff : ((src_dat + dest_dat) / 2); \ - break; \ - } \ + else \ + dest_dat = (0xff < (src_dat + dest_dat)) ? 0xff : ((src_dat + dest_dat) / 2); \ + break; \ + } \ } -#define WRITE(addr, dat) \ - if (dev->bpp) { \ - vram_w[((addr)) & (dev->vram_mask >> 1)] = dat; \ +#define WRITE(addr, dat) \ + if (dev->bpp) { \ + vram_w[((addr)) & (dev->vram_mask >> 1)] = dat; \ dev->changedvram[(((addr)) & (dev->vram_mask >> 1)) >> 11] = changeframecount; \ - } else { \ - dev->vram[((addr)) & (dev->vram_mask)] = dat; \ - dev->changedvram[(((addr)) & (dev->vram_mask)) >> 12] = changeframecount; \ + } else { \ + dev->vram[((addr)) & (dev->vram_mask)] = dat; \ + dev->changedvram[(((addr)) & (dev->vram_mask)) >> 12] = changeframecount; \ } static int @@ -338,7 +336,9 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 } if ((dev->accel_bpp == 8) || (dev->accel_bpp == 15) || (dev->accel_bpp == 16) || (dev->accel_bpp == 24)) - mach_log("RdMask=%04x, DPCONFIG=%04x, Clipping: l=%d, r=%d, t=%d, b=%d, LineDrawOpt=%04x, BPP=%d, CMDType = %d, offs=%08x, cnt = %d, input = %d, mono_src = %d, frgdsel = %d, d(%d,%d), dstxend = %d, pitch = %d, extcrt = %d, rw = %x, monpattern = %x.\n", dev->accel.rd_mask, mach->accel.dp_config, clip_l, clip_r, clip_t, clip_b, mach->accel.linedraw_opt, dev->accel_bpp, cmd_type, mach->accel.ge_offset, count, cpu_input, mono_src, frgd_sel, dev->accel.cur_x, dev->accel.cur_y, mach->accel.dest_x_end, dev->ext_pitch, dev->ext_crt_pitch, mach->accel.dp_config & 1, mach->accel.mono_pattern_enable); + mach_log("RdMask=%04x, DPCONFIG=%04x, Clipping: l=%d, r=%d, t=%d, b=%d, LineDrawOpt=%04x, BPP=%d, CMDType = %d, offs=%08x, cnt = %d, input = %d, mono_src = %d, frgdsel = %d, d(%d,%d), dstxend = %d, pitch = %d, extcrt = %d, rw = %x, monpattern = %x.\n", + dev->accel.rd_mask, mach->accel.dp_config, clip_l, clip_r, clip_t, clip_b, mach->accel.linedraw_opt, dev->accel_bpp, cmd_type, mach->accel.ge_offset, count, cpu_input, mono_src, frgd_sel, dev->accel.cur_x, dev->accel.cur_y, + mach->accel.dest_x_end, dev->ext_pitch, dev->ext_crt_pitch, mach->accel.dp_config & 1, mach->accel.mono_pattern_enable); switch (cmd_type) { case 1: /*Extended Raw Linedraw from bres_count register (0x96ee)*/ @@ -366,7 +366,9 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 mach->accel.stepx = (mach->accel.linedraw_opt & 0x20) ? 1 : -1; mach->accel.stepy = (mach->accel.linedraw_opt & 0x80) ? 1 : -1; - mach_log("Extended bresenham, CUR(%d,%d), DEST(%d,%d), width = %d, options = %04x, dpconfig = %04x, opt_ena = %03x.\n", dev->accel.dx, dev->accel.dy, dev->accel.cx, dev->accel.cy, mach->accel.width, mach->accel.linedraw_opt, mach->accel.dp_config, mach->accel.max_waitstates & 0x100); + mach_log("Extended bresenham, CUR(%d,%d), DEST(%d,%d), width = %d, options = %04x, dpconfig = %04x, opt_ena = %03x.\n", + dev->accel.dx, dev->accel.dy, dev->accel.cx, dev->accel.cy, mach->accel.width, mach->accel.linedraw_opt, + mach->accel.dp_config, mach->accel.max_waitstates & 0x100); if ((mono_src == 2) || (bkgd_sel == 2) || (frgd_sel == 2) || mach_pixel_read(mach)) { if (mach_pixel_write(mach)) { @@ -853,11 +855,14 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 mach->accel.stepx = -1; if (dev->accel.dx > 0) dev->accel.dx--; - mach_log("BitBLT: Dst Negative X, dxstart = %d, end = %d, width = %d, dx = %d, dpconfig = %04x.\n", mach->accel.dest_x_start, mach->accel.dest_x_end, mach->accel.width, dev->accel.dx, mach->accel.dp_config); + mach_log("BitBLT: Dst Negative X, dxstart = %d, end = %d, width = %d, dx = %d, dpconfig = %04x.\n", + mach->accel.dest_x_start, mach->accel.dest_x_end, mach->accel.width, dev->accel.dx, + mach->accel.dp_config); } else { mach->accel.stepx = 1; mach->accel.width = 0; - mach_log("BitBLT: Dst Indeterminate X, dpconfig = %04x, destxend = %d, destxstart = %d.\n", mach->accel.dp_config, mach->accel.dest_x_end, mach->accel.dest_x_start); + mach_log("BitBLT: Dst Indeterminate X, dpconfig = %04x, destxend = %d, destxstart = %d.\n", + mach->accel.dp_config, mach->accel.dest_x_end, mach->accel.dest_x_start); } dev->accel.sx = 0; @@ -914,17 +919,23 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 if (mach->accel.sx_end > mach->accel.sx_start) { mach->accel.src_width = (mach->accel.sx_end - mach->accel.sx_start); mach->accel.src_stepx = 1; - mach_log("BitBLT: Src Positive X: wh(%d,%d), srcwidth = %d, coordinates: %d,%d px, start: %d, end: %d px, stepx = %d, dpconfig = %04x, oddwidth = %d.\n", mach->accel.width, mach->accel.height, mach->accel.src_width, dev->accel.cx, dev->accel.cy, mach->accel.src_x_start, mach->accel.src_x_end, mach->accel.src_stepx, mach->accel.dp_config, mach->accel.src_width & 1); + mach_log("BitBLT: Src Positive X: wh(%d,%d), srcwidth = %d, coordinates: %d,%d px, start: %d, end: %d px, stepx = %d, dpconfig = %04x, oddwidth = %d.\n", + mach->accel.width, mach->accel.height, mach->accel.src_width, dev->accel.cx, dev->accel.cy, mach->accel.src_x_start, mach->accel.src_x_end, + mach->accel.src_stepx, mach->accel.dp_config, mach->accel.src_width & 1); } else if (mach->accel.sx_end < mach->accel.sx_start) { mach->accel.src_width = (mach->accel.sx_start - mach->accel.sx_end); mach->accel.src_stepx = -1; if (dev->accel.cx > 0) dev->accel.cx--; - mach_log("BitBLT: Src Negative X: width = %d, coordinates: %d,%d px, end: %d px, stepx = %d, dpconfig = %04x, oddwidth = %d.\n", mach->accel.src_width, dev->accel.cx, dev->accel.cy, mach->accel.src_x_end, mach->accel.src_stepx, mach->accel.dp_config, mach->accel.src_width & 1); + mach_log("BitBLT: Src Negative X: width = %d, coordinates: %d,%d px, end: %d px, stepx = %d, dpconfig = %04x, oddwidth = %d.\n", + mach->accel.src_width, dev->accel.cx, dev->accel.cy, mach->accel.src_x_end, mach->accel.src_stepx, mach->accel.dp_config + mach->accel.src_width & 1); } else { mach->accel.src_stepx = 1; mach->accel.src_width = 0; - mach_log("BitBLT: Src Indeterminate X: width = %d, coordinates: %d,%d px, end: %d px, stepx = %d, dpconfig = %04x, oddwidth = %d.\n", mach->accel.src_width, dev->accel.cx, dev->accel.cy, mach->accel.src_x_end, mach->accel.src_stepx, mach->accel.dp_config, mach->accel.src_width & 1); + mach_log("BitBLT: Src Indeterminate X: width = %d, coordinates: %d,%d px, end: %d px, stepx = %d, dpconfig = %04x, oddwidth = %d.\n", + mach->accel.src_width, dev->accel.cx, dev->accel.cy, mach->accel.src_x_end, mach->accel.src_stepx, + mach->accel.dp_config, mach->accel.src_width & 1); } mach->accel.sx = 0; if (mach->accel.patt_data_idx < 16) @@ -996,7 +1007,8 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 if (cpu_input) { if (mach->accel.dp_config == 0x3251) { - mach_log("DPCONFIG 3251: monosrc=%d, frgdsel=%d, bkgdsel=%d, pitch=%d.\n", mono_src, frgd_sel, bkgd_sel, dev->pitch); + mach_log("DPCONFIG 3251: monosrc=%d, frgdsel=%d, bkgdsel=%d, pitch=%d.\n", + mono_src, frgd_sel, bkgd_sel, dev->pitch); if (dev->accel.sy == mach->accel.height) { mach_log("No Blit on DPCONFIG=3251.\n"); dev->accel.cmd_back = 1; @@ -1156,7 +1168,10 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 cpu_dat >>= 8; if (mach->accel.dp_config == 0x2071 || (mach->accel.dp_config == 0x2011)) - mach_log("FontBlit: SX=%d, C(%d,%d), SRCWidth=%d, frgdmix=%d, bkgdmix=%d, rdmask=%04x, D(%d,%d), geoffset=%x, addr=%08x,.\n", mach->accel.sx, dev->accel.cx, dev->accel.cy, mach->accel.src_width, dev->accel.frgd_mix & 0x1f, dev->accel.bkgd_mix & 0x1f, rd_mask, dev->accel.dx, dev->accel.dy, dev->accel.ge_offset, (dev->accel.src + dev->accel.cx) & dev->vram_mask); + mach_log("FontBlit: SX=%d, C(%d,%d), SRCWidth=%d, frgdmix=%d, bkgdmix=%d, rdmask=%04x, D(%d,%d), geoffset=%x, addr=%08x,.\n", + mach->accel.sx, dev->accel.cx, dev->accel.cy, mach->accel.src_width, dev->accel.frgd_mix & 0x1f, + dev->accel.bkgd_mix & 0x1f, rd_mask, dev->accel.dx, dev->accel.dy, dev->accel.ge_offset, + (dev->accel.src + dev->accel.cx) & dev->vram_mask); if ((mono_src == 3) || (frgd_sel == 3) || (bkgd_sel == 3) || (mach->accel.dp_config & 0x02)) { dev->accel.cx += mach->accel.src_stepx; @@ -1248,7 +1263,9 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 dev->accel.sx = 0; - mach_log("Linedraw: c(%d,%d), d(%d,%d), cend(%d,%d), bounds: l=%d, r=%d, t=%d, b=%d.\n", dev->accel.cur_x, dev->accel.cur_y, dev->accel.dx, dev->accel.dy, mach->accel.cx_end_line, mach->accel.cy_end_line, mach->accel.bleft, mach->accel.bright, mach->accel.btop, mach->accel.bbottom); + mach_log("Linedraw: c(%d,%d), d(%d,%d), cend(%d,%d), bounds: l=%d, r=%d, t=%d, b=%d.\n", + dev->accel.cur_x, dev->accel.cur_y, dev->accel.dx, dev->accel.dy, mach->accel.cx_end_line, + mach->accel.cy_end_line, mach->accel.bleft, mach->accel.bright, mach->accel.btop, mach->accel.bbottom); if ((mono_src == 2) || (bkgd_sel == 2) || (frgd_sel == 2) || mach_pixel_read(mach)) { if (mach_pixel_write(mach)) { @@ -1944,7 +1961,9 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 else dev->accel.src = (mach->accel.ge_offset << 2) + (dev->accel.cy * (dev->pitch)); - mach_log("ScanToX=%04x, MonoSRC=%d, FrgdSel=%d, BkgdSel=%d, Pitch=%d, C(%d,%d), SRCWidth=%d, WH(%d,%d), colorpattidx=%d, pattlen=%d.\n", mach->accel.dp_config, mono_src, frgd_sel, bkgd_sel, dev->ext_pitch, dev->accel.cx, dev->accel.cy, mach->accel.src_width, mach->accel.width, mach->accel.height, mach->accel.color_pattern_idx, mach->accel.patt_len); + mach_log("ScanToX=%04x, MonoSRC=%d, FrgdSel=%d, BkgdSel=%d, Pitch=%d, C(%d,%d), SRCWidth=%d, WH(%d,%d), colorpattidx=%d, pattlen=%d.\n", + mach->accel.dp_config, mono_src, frgd_sel, bkgd_sel, dev->ext_pitch, dev->accel.cx, dev->accel.cy, mach->accel.src_width, + mach->accel.width, mach->accel.height, mach->accel.color_pattern_idx, mach->accel.patt_len); if ((mono_src == 2) || (bkgd_sel == 2) || (frgd_sel == 2) || mach_pixel_read(mach)) { if (mach_pixel_write(mach)) { @@ -2197,9 +2216,11 @@ mach_out(uint16_t addr, uint8_t val, void *priv) if (((dev->disp_cntl & 0x60) == 0x20) && ((dev->local & 0xff) >= 0x02)) { if ((addr >= 0x3c6) && (addr <= 0x3c9)) { - mach_log("VGA DAC write regs=%03x, on=%d, display control=%02x, on1=%x, clocksel=%02x.\n", addr, dev->on, dev->disp_cntl & 0x60, dev->accel.advfunc_cntl & 0x01, mach->accel.clock_sel & 0x01); + mach_log("VGA DAC write regs=%03x, on=%d, display control=%02x, on1=%x, clocksel=%02x.\n", + addr, dev->on, dev->disp_cntl & 0x60, dev->accel.advfunc_cntl & 0x01, mach->accel.clock_sel & 0x01); } else if ((addr >= 0x2ea) && (addr <= 0x2ed)) - mach_log("8514/A DAC write regs=%03x, on=%d, display control=%02x, on1=%x, clocksel=%02x.\n", addr, dev->on, dev->disp_cntl & 0x60, dev->accel.advfunc_cntl & 0x01, mach->accel.clock_sel & 0x01); + mach_log("8514/A DAC write regs=%03x, on=%d, display control=%02x, on1=%x, clocksel=%02x.\n", + addr, dev->on, dev->disp_cntl & 0x60, dev->accel.advfunc_cntl & 0x01, mach->accel.clock_sel & 0x01); } switch (addr) { @@ -2609,7 +2630,8 @@ ati8514_recalctimings(svga_t *svga) dev->accel.ge_offset = (mach->accel.ge_offset_lo | (mach->accel.ge_offset_hi << 16)); mach->accel.ge_offset = dev->accel.ge_offset; - mach_log("HDISP=%d, VDISP=%d, shadowset=%x, 8514/A mode=%x, clocksel=%02x.\n", dev->hdisp, dev->vdisp, mach->shadow_set & 0x03, dev->accel.advfunc_cntl & 0x05, mach->accel.clock_sel & 0x01); + mach_log("HDISP=%d, VDISP=%d, shadowset=%x, 8514/A mode=%x, clocksel=%02x.\n", + dev->hdisp, dev->vdisp, mach->shadow_set & 0x03, dev->accel.advfunc_cntl & 0x05, mach->accel.clock_sel & 0x01); if (mach->accel.clock_sel & 0x01) { dev->h_disp = dev->hdisp; @@ -2637,7 +2659,9 @@ ati8514_recalctimings(svga_t *svga) if (dev->interlace) dev->dispend >>= 1; - mach_log("cntl=%d, hv(%d,%d), pitch=%d, rowoffset=%d, gextconfig=%03x, shadow=%x interlace=%d.\n", dev->accel.advfunc_cntl & 0x04, dev->h_disp, dev->dispend, dev->pitch, dev->rowoffset, mach->accel.ext_ge_config & 0xcec0, mach->shadow_set & 3, dev->interlace); + mach_log("cntl=%d, hv(%d,%d), pitch=%d, rowoffset=%d, gextconfig=%03x, shadow=%x interlace=%d.\n", + dev->accel.advfunc_cntl & 0x04, dev->h_disp, dev->dispend, dev->pitch, dev->rowoffset, + mach->accel.ext_ge_config & 0xcec0, mach->shadow_set & 3, dev->interlace); if (dev->vram_512k_8514) { if (dev->h_disp == 640) { dev->ext_pitch = 640; @@ -2713,7 +2737,9 @@ mach_recalctimings(svga_t *svga) dev->accel.ge_offset = (mach->accel.ge_offset_lo | (mach->accel.ge_offset_hi << 16)); mach->accel.ge_offset = dev->accel.ge_offset; - mach_log("HDISP=%d, VDISP=%d, shadowset=%x, 8514/A mode=%x, clocksel=%02x, interlace=%x.\n", dev->hdisp, dev->vdisp, mach->shadow_set & 0x03, dev->accel.advfunc_cntl & 0x04, mach->accel.clock_sel & 0xfe, dev->interlace); + mach_log("HDISP=%d, VDISP=%d, shadowset=%x, 8514/A mode=%x, clocksel=%02x, interlace=%x.\n", + dev->hdisp, dev->vdisp, mach->shadow_set & 0x03, dev->accel.advfunc_cntl & 0x04, + mach->accel.clock_sel & 0xfe, dev->interlace); if ((dev->local & 0xff) >= 0x02) { if (dev->bpp || ((mach->accel.ext_ge_config & 0x30) == 0x30) || (mach->accel.clock_sel & 0x01)) { dev->h_disp = dev->hdisp; @@ -2788,7 +2814,9 @@ mach_recalctimings(svga_t *svga) } svga->render8514 = ibm8514_render_blank; - mach_log("hv(%d,%d), pitch=%d, rowoffset=%d, gextconfig=%03x, bpp=%d, shadow=%x, vgahdisp=%d.\n", dev->h_disp, dev->dispend, dev->pitch, dev->ext_crt_pitch, mach->accel.ext_ge_config & 0xcec0, dev->accel_bpp, mach->shadow_set & 3, svga->hdisp); + mach_log("hv(%d,%d), pitch=%d, rowoffset=%d, gextconfig=%03x, bpp=%d, shadow=%x, vgahdisp=%d.\n", + dev->h_disp, dev->dispend, dev->pitch, dev->ext_crt_pitch, mach->accel.ext_ge_config & 0xcec0, + dev->accel_bpp, mach->shadow_set & 3, svga->hdisp); switch (dev->accel_bpp) { case 8: svga->render8514 = ibm8514_render_8bpp; @@ -2814,7 +2842,9 @@ mach_recalctimings(svga_t *svga) } } else { svga->render8514 = ibm8514_render_blank; - mach_log("cntl=%d, hv(%d,%d), pitch=%d, rowoffset=%d, gextconfig=%03x, shadow=%x interlace=%d.\n", dev->accel.advfunc_cntl & 0x04, dev->h_disp, dev->dispend, dev->pitch, dev->rowoffset, mach->accel.ext_ge_config & 0xcec0, mach->shadow_set & 3, dev->interlace); + mach_log("cntl=%d, hv(%d,%d), pitch=%d, rowoffset=%d, gextconfig=%03x, shadow=%x interlace=%d.\n", + dev->accel.advfunc_cntl & 0x04, dev->h_disp, dev->dispend, dev->pitch, dev->rowoffset, + mach->accel.ext_ge_config & 0xcec0, mach->shadow_set & 3, dev->interlace); if (dev->vram_512k_8514) { if (dev->h_disp == 640) { dev->ext_pitch = 640; @@ -2829,7 +2859,8 @@ mach_recalctimings(svga_t *svga) } } else { if (!svga->scrblank && (svga->crtc[0x17] & 0x80) && svga->attr_palette_enable) { - mach_log("GDCREG5=%02x, ATTR10=%02x, ATI B0 bit 5=%02x, ON=%d.\n", svga->gdcreg[5] & 0x60, svga->attrregs[0x10] & 0x40, mach->regs[0xb0] & 0x20, dev->on); + mach_log("GDCREG5=%02x, ATTR10=%02x, ATI B0 bit 5=%02x, ON=%d.\n", + svga->gdcreg[5] & 0x60, svga->attrregs[0x10] & 0x40, mach->regs[0xb0] & 0x20, dev->on); if ((svga->gdcreg[6] & 0x01) || (svga->attrregs[0x10] & 0x01)) { if ((svga->gdcreg[5] & 0x40) || (svga->attrregs[0x10] & 0x40) || (mach->regs[0xb0] & 0x20)) { svga->clock = (cpuclock * (double) (1ULL << 32)) / svga->getclock(clock_sel, svga->clock_gen); @@ -3405,7 +3436,8 @@ mach_accel_out_call(uint16_t port, uint8_t val, mach_t *mach, svga_t *svga, ibm8 } else if (((mach->shadow_set & 0x03) == 0x00) && !(mach->accel.clock_sel & 0x01)) dev->hdisp2 = (val + 1) << 3; } - mach_log("[%04X:%08X]: ATI 8514/A: (0x%04x): hdisp=0x%02x, shadowcntl=%02x, shadowset=%02x.\n", CS, cpu_state.pc, port, val, mach->shadow_cntl & 0x08, mach->shadow_set & 0x03); + mach_log("[%04X:%08X]: ATI 8514/A: (0x%04x): hdisp=0x%02x, shadowcntl=%02x, shadowset=%02x.\n", + CS, cpu_state.pc, port, val, mach->shadow_cntl & 0x08, mach->shadow_set & 0x03); svga_recalctimings(svga); break; @@ -3475,7 +3507,8 @@ mach_accel_out_call(uint16_t port, uint8_t val, mach_t *mach, svga_t *svga, ibm8 dev->interlace = !!(dev->disp_cntl & 0x10); } } - mach_log("ATI 8514/A: DISP_CNTL write %04x=%02x, written=%02x, interlace=%d.\n", port, val & 0x70, dev->disp_cntl & 0x70, dev->interlace); + mach_log("ATI 8514/A: DISP_CNTL write %04x=%02x, written=%02x, interlace=%d.\n", + port, val & 0x70, dev->disp_cntl & 0x70, dev->interlace); svga_recalctimings(svga); break; @@ -3483,7 +3516,8 @@ mach_accel_out_call(uint16_t port, uint8_t val, mach_t *mach, svga_t *svga, ibm8 dev->accel.advfunc_cntl = val; dev->on = dev->accel.advfunc_cntl & 0x01; dev->vendor_mode = 0; - mach_log("[%04X:%08X]: ATI 8514/A: (0x%04x): ON=%d, shadow crt=%x, hdisp=%d, vdisp=%d.\n", CS, cpu_state.pc, port, val & 0x01, dev->accel.advfunc_cntl & 0x04, dev->hdisp, dev->vdisp); + mach_log("[%04X:%08X]: ATI 8514/A: (0x%04x): ON=%d, shadow crt=%x, hdisp=%d, vdisp=%d.\n", + CS, cpu_state.pc, port, val & 0x01, dev->accel.advfunc_cntl & 0x04, dev->hdisp, dev->vdisp); if ((dev->local & 0xff) < 0x02) { dev->ext_crt_pitch = 128; @@ -3630,8 +3664,10 @@ mach_accel_out_call(uint16_t port, uint8_t val, mach_t *mach, svga_t *svga, ibm8 WRITE8(port, mach->accel.clock_sel, val); dev->on = mach->accel.clock_sel & 0x01; dev->vendor_mode = 1; - mach_log("ATI 8514/A: (0x%04x): ON=%d, val=%04x, hdisp=%d, vdisp=%d.\n", port, mach->accel.clock_sel & 0x01, val, dev->hdisp, dev->vdisp); - mach_log("Vendor ATI mode set %s resolution.\n", (dev->accel.advfunc_cntl & 0x04) ? "2: 1024x768" : "1: 640x480"); + mach_log("ATI 8514/A: (0x%04x): ON=%d, val=%04x, hdisp=%d, vdisp=%d.\n", + port, mach->accel.clock_sel & 0x01, val, dev->hdisp, dev->vdisp); + mach_log("Vendor ATI mode set %s resolution.\n", + (dev->accel.advfunc_cntl & 0x04) ? "2: 1024x768" : "1: 640x480"); svga_recalctimings(svga); if ((dev->local & 0xff) >= 0x01) mach32_updatemapping(mach, svga); @@ -5160,7 +5196,8 @@ mach32_ap_writeb(uint32_t addr, uint8_t val, void *priv) mach_accel_outb(0x02e8 + (addr & 1) + (port_dword << 8), val, mach); } } else { - mach_log("Linear WORDB Write=%08x, val=%02x, ON=%x, dpconfig=%04x, apsize=%08x.\n", addr & dev->vram_mask, val, dev->on, mach->accel.dp_config, mach->ap_size << 20); + mach_log("Linear WORDB Write=%08x, val=%02x, ON=%x, dpconfig=%04x, apsize=%08x.\n", + addr & dev->vram_mask, val, dev->on, mach->accel.dp_config, mach->ap_size << 20); if (dev->on) mach32_write_common(addr, val, 1, mach, svga); else @@ -5186,7 +5223,8 @@ mach32_ap_writew(uint32_t addr, uint16_t val, void *priv) mach_accel_outw(0x02e8 + (port_dword << 8), val, mach); } } else { - mach_log("Linear WORDW Write=%08x, val=%04x, ON=%x, dpconfig=%04x, apsize=%08x.\n", addr & dev->vram_mask, val, dev->on, mach->accel.dp_config, mach->ap_size << 20); + mach_log("Linear WORDW Write=%08x, val=%04x, ON=%x, dpconfig=%04x, apsize=%08x.\n", + addr & dev->vram_mask, val, dev->on, mach->accel.dp_config, mach->ap_size << 20); if (dev->on) mach32_writew_linear(addr, val, mach); else @@ -5214,7 +5252,8 @@ mach32_ap_writel(uint32_t addr, uint32_t val, void *priv) mach_accel_outw(0x02e8 + (port_dword << 8) + 4, val >> 16, mach); } } else { - mach_log("Linear WORDL Write=%08x, val=%08x, ON=%x, dpconfig=%04x, apsize=%08x.\n", addr & dev->vram_mask, val, dev->on, mach->accel.dp_config, mach->ap_size << 20); + mach_log("Linear WORDL Write=%08x, val=%08x, ON=%x, dpconfig=%04x, apsize=%08x.\n", + addr & dev->vram_mask, val, dev->on, mach->accel.dp_config, mach->ap_size << 20); if (dev->on) mach32_writel_linear(addr, val, mach); else @@ -5354,7 +5393,8 @@ mach32_updatemapping(mach_t *mach, svga_t *svga) } } - mach_log("Linear base = %08x, aperture = %04x, localcntl = %02x svgagdc = %x.\n", mach->linear_base, mach->memory_aperture, mach->local_cntl, svga->gdcreg[6] & 0x0c); + mach_log("Linear base = %08x, aperture = %04x, localcntl = %02x svgagdc = %x.\n", + mach->linear_base, mach->memory_aperture, mach->local_cntl, svga->gdcreg[6] & 0x0c); if (mach->linear_base) { if (((mach->memory_aperture & 3) == 1) && !mach->pci_bus) { /*1 MB aperture*/ @@ -5832,7 +5872,8 @@ mach_mca_write(int port, uint8_t val, void *priv) return; mach->pos_regs[port & 7] = val; - mach_log("[%04X]: MCA write port = %x, val = %02x, biosaddr = %05x.\n", CS, port & 7, mach->pos_regs[port & 7], (((mach->pos_regs[3] & 0x3e) << 0x0c) >> 1) + 0xc0000); + mach_log("[%04X]: MCA write port = %x, val = %02x, biosaddr = %05x.\n", + CS, port & 7, mach->pos_regs[port & 7], (((mach->pos_regs[3] & 0x3e) << 0x0c) >> 1) + 0xc0000); mem_mapping_disable(&mach->bios_rom.mapping); mem_mapping_disable(&mach->bios_rom2.mapping); if (mach->pos_regs[2] & 0x01) { @@ -5882,7 +5923,8 @@ ati8514_mca_write(int port, uint8_t val, void *priv) return; dev->pos_regs[port & 7] = val; - mach_log("[%04X]: MCA write port = %x, val = %02x, biosaddr = %05x.\n", CS, port & 7, dev->pos_regs[port & 7], (((dev->pos_regs[3] & 0x3e) << 0x0c) >> 1) + 0xc0000); + mach_log("[%04X]: MCA write port = %x, val = %02x, biosaddr = %05x.\n", + CS, port & 7, dev->pos_regs[port & 7], (((dev->pos_regs[3] & 0x3e) << 0x0c) >> 1) + 0xc0000); mem_mapping_disable(&dev->bios_rom.mapping); if (dev->pos_regs[2] & 0x01) @@ -6311,104 +6353,76 @@ mach_force_redraw(void *priv) // clang-format off static const device_config_t mach8_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1024, - .selection = { - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t mach32_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 2048, - .selection = { - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "4 MB", - .value = 4096 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2048, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "2 MB", .value = 2048 }, + { .description = "4 MB", .value = 4096 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t mach32_pci_config[] = { { - .name = "ramdac", - .description = "RAMDAC type", - .type = CONFIG_SELECTION, - .default_int = 0, - .selection = { - { - .description = "ATI 68860", - .value = 0 - }, - { - .description = "ATI 68875", - .value = 1 - }, - { - .description = "" - } - } + .name = "ramdac", + .description = "RAMDAC type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "ATI 68860", .value = 0 }, + { .description = "ATI 68875", .value = 1 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 2048, - .selection = { - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "4 MB", - .value = 4096 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2048, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "2 MB", .value = 2048 }, + { .description = "4 MB", .value = 4096 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_bochs_vbe.c b/src/video/vid_bochs_vbe.c index 473b10983..84fb110c6 100644 --- a/src/video/vid_bochs_vbe.c +++ b/src/video/vid_bochs_vbe.c @@ -921,46 +921,35 @@ bochs_vbe_force_redraw(void *priv) static const device_config_t bochs_vbe_config[] = { // clang-format off { - .name = "revision", - .description = "Revision", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "VirtualBox", - .value = VBE_DISPI_ID4 - }, - { - .description = "Bochs latest", - .value = VBE_DISPI_ID5 - }, - { - .description = "" - } + .name = "revision", + .description = "Revision", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = VBE_DISPI_ID5, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "VirtualBox", .value = VBE_DISPI_ID4 }, + { .description = "Bochs latest", .value = VBE_DISPI_ID5 }, + { .description = "" } }, - .default_int = VBE_DISPI_ID5 + .bios = { { 0 } } }, { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "4 MB", - .value = 4 - }, - { - .description = "8 MB", - .value = 8 - }, - { - .description = "16 MB", - .value = 16 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 16, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "4 MB", .value = 4 }, + { .description = "8 MB", .value = 8 }, + { .description = "16 MB", .value = 16 }, + { .description = "" } }, - .default_int = 16 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -974,7 +963,7 @@ const device_t bochs_svga_device = { .init = bochs_vbe_init, .close = bochs_vbe_close, .reset = bochs_vbe_reset, - .available = bochs_vbe_available, + .available = bochs_vbe_available, .speed_changed = bochs_vbe_speed_changed, .force_redraw = bochs_vbe_force_redraw, .config = bochs_vbe_config diff --git a/src/video/vid_cga.c b/src/video/vid_cga.c index d324368ab..f439cb1d8 100644 --- a/src/video/vid_cga.c +++ b/src/video/vid_cga.c @@ -809,110 +809,81 @@ cga_speed_changed(void *priv) // clang-format off const device_config_t cga_config[] = { { - .name = "display_type", - .description = "Display type", - .type = CONFIG_SELECTION, - .default_int = CGA_RGB, - .selection = { - { - .description = "RGB", - .value = CGA_RGB - }, - { - .description = "Composite", - .value = CGA_COMPOSITE - }, - { - .description = "" - } - } + .name = "display_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = CGA_RGB, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "RGB", .value = CGA_RGB }, + { .description = "Composite", .value = CGA_COMPOSITE }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "composite_type", - .description = "Composite type", - .type = CONFIG_SELECTION, - .default_int = COMPOSITE_OLD, - .selection = { - { - .description = "Old", - .value = COMPOSITE_OLD - }, - { - .description = "New", - .value = COMPOSITE_NEW - }, - { - .description = "" - } - } + .name = "composite_type", + .description = "Composite type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = COMPOSITE_OLD, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Old", .value = COMPOSITE_OLD }, + { .description = "New", .value = COMPOSITE_NEW }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "rgb_type", - .description = "RGB type", - .type = CONFIG_SELECTION, - .default_int = 5, - .selection = { - { - .description = "Color (generic)", - .value = 0 - }, - { - .description = "Green Monochrome", - .value = 1 - }, - { - .description = "Amber Monochrome", - .value = 2 - }, - { - .description = "Gray Monochrome", - .value = 3 - }, - { - .description = "Color (no brown)", - .value = 4 - }, - { - .description = "Color (IBM 5153)", - .value = 5 - }, - { - .description = "" - } - } + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 5, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Color (generic)", .value = 0 }, + { .description = "Green Monochrome", .value = 1 }, + { .description = "Amber Monochrome", .value = 2 }, + { .description = "Gray Monochrome", .value = 3 }, + { .description = "Color (no brown)", .value = 4 }, + { .description = "Color (IBM 5153)", .value = 5 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "double_type", - .description = "Line doubling type", - .type = CONFIG_SELECTION, - .default_int = DOUBLE_NONE, - .selection = { - { - .description = "None", - .value = DOUBLE_NONE - }, - { - .description = "Simple doubling", - .value = DOUBLE_SIMPLE - }, - { - .description = "sRGB interpolation", - .value = DOUBLE_INTERPOLATE_SRGB - }, - { - .description = "Linear interpolation", - .value = DOUBLE_INTERPOLATE_LINEAR - }, - { - .description = "" - } - } + .name = "double_type", + .description = "Line doubling type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = DOUBLE_NONE, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "None", .value = DOUBLE_NONE }, + { .description = "Simple doubling", .value = DOUBLE_SIMPLE }, + { .description = "sRGB interpolation", .value = DOUBLE_INTERPOLATE_SRGB }, + { .description = "Linear interpolation", .value = DOUBLE_INTERPOLATE_LINEAR }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "snow_enabled", - .description = "Snow emulation", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "snow_enabled", + .description = "Snow emulation", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_cga_comp.c b/src/video/vid_cga_comp.c index d580f0c06..6ad6a6b0a 100644 --- a/src/video/vid_cga_comp.c +++ b/src/video/vid_cga_comp.c @@ -44,22 +44,22 @@ static const double tau = 6.28318531; /* == 2*pi */ static unsigned char chroma_multiplexer[256] = { // clang-format off - 2, 2, 2, 2, 114,174, 4, 3, 2, 1,133,135, 2,113,150, 4, - 133, 2, 1, 99, 151,152, 2, 1, 3, 2, 96,136, 151,152,151,152, - 2, 56, 62, 4, 111,250,118, 4, 0, 51,207,137, 1,171,209, 5, - 140, 50, 54,100, 133,202, 57, 4, 2, 50,153,149, 128,198,198,135, - 32, 1, 36, 81, 147,158, 1, 42, 33, 1,210,254, 34,109,169, 77, - 177, 2, 0,165, 189,154, 3, 44, 33, 0, 91,197, 178,142,144,192, - 4, 2, 61, 67, 117,151,112, 83, 4, 0,249,255, 3,107,249,117, - 147, 1, 50,162, 143,141, 52, 54, 3, 0,145,206, 124,123,192,193, - 72, 78, 2, 0, 159,208, 4, 0, 53, 58,164,159, 37,159,171, 1, - 248,117, 4, 98, 212,218, 5, 2, 54, 59, 93,121, 176,181,134,130, - 1, 61, 31, 0, 160,255, 34, 1, 1, 58,197,166, 0,177,194, 2, - 162,111, 34, 96, 205,253, 32, 1, 1, 57,123,125, 119,188,150,112, - 78, 4, 0, 75, 166,180, 20, 38, 78, 1,143,246, 42,113,156, 37, - 252, 4, 1,188, 175,129, 1, 37, 118, 4, 88,249, 202,150,145,200, - 61, 59, 60, 60, 228,252,117, 77, 60, 58,248,251, 81,212,254,107, - 198, 59, 58,169, 250,251, 81, 80, 100, 58,154,250, 251,252,252,252 + 2, 2, 2, 2, 114, 174, 4, 3, 2, 1, 133, 135, 2, 113, 150, 4, + 133, 2, 1, 99, 151, 152, 2, 1, 3, 2, 96, 136, 151, 152, 151, 152, + 2, 56, 62, 4, 111, 250, 118, 4, 0, 51, 207, 137, 1, 171, 209, 5, + 140, 50, 54, 100, 133, 202, 57, 4, 2, 50, 153, 149, 128, 198, 198, 135, + 32, 1, 36, 81, 147, 158, 1, 42, 33, 1, 210, 254, 34, 109, 169, 77, + 177, 2, 0, 165, 189, 154, 3, 44, 33, 0, 91, 197, 178, 142, 144, 192, + 4, 2, 61, 67, 117, 151, 112, 83, 4, 0, 249, 255, 3, 107, 249, 117, + 147, 1, 50, 162, 143, 141, 52, 54, 3, 0, 145, 206, 124, 123, 192, 193, + 72, 78, 2, 0, 159, 208, 4, 0, 53, 58, 164, 159, 37, 159, 171, 1, + 248, 117, 4, 98, 212, 218, 5, 2, 54, 59, 93, 121, 176, 181, 134, 130, + 1, 61, 31, 0, 160, 255, 34, 1, 1, 58, 197, 166, 0, 177, 194, 2, + 162, 111, 34, 96, 205, 253, 32, 1, 1, 57, 123, 125, 119, 188, 150, 112, + 78, 4, 0, 75, 166, 180, 20, 38, 78, 1, 143, 246, 42, 113, 156, 37, + 252, 4, 1, 188, 175, 129, 1, 37, 118, 4, 88, 249, 202, 150, 145, 200, + 61, 59, 60, 60, 228, 252, 117, 77, 60, 58, 248, 251, 81, 212, 254, 107, + 198, 59, 58, 169, 250, 251, 81, 80, 100, 58, 154, 250, 251, 252, 252, 252 // clang-format on }; diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 51e4ba335..19f51bd9d 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -4701,200 +4701,156 @@ gd54xx_force_redraw(void *priv) // clang-format off static const device_config_t gd542x_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } }, - .default_int = 512 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t gd5426_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2048, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "2 MB", .value = 2048 }, + { .description = "" } }, - .default_int = 2048 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t gd5428_onboard_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "2 MB", - .value = 2048 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2048, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "2 MB", .value = 2048 }, + { .description = "" } }, - .default_int = 2048 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t gd5429_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1 MB", - .value = 1 - }, - { - .description = "2 MB", - .value = 2 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1 MB", .value = 1 }, + { .description = "2 MB", .value = 2 }, + { .description = "" } }, - .default_int = 2 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t gd5440_onboard_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1 MB", - .value = 1 - }, - { - .description = "2 MB", - .value = 2 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1 MB", .value = 1 }, + { .description = "2 MB", .value = 2 }, + { .description = "" } }, - .default_int = 2 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t gd5434_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1 MB", - .value = 1 - }, - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1 MB", .value = 1 }, + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "" } }, - .default_int = 4 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t gd5434_onboard_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1 MB", - .value = 1 - }, - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1 MB", .value = 1 }, + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "" } }, - .default_int = 4 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t gd5480_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "" } }, - .default_int = 4 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_colorplus.c b/src/video/vid_colorplus.c index 98d6adea7..6c66175c1 100644 --- a/src/video/vid_colorplus.c +++ b/src/video/vid_colorplus.c @@ -14,7 +14,7 @@ * Miran Grca, * * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2016-2025 Miran Grca. */ #include #include @@ -357,7 +357,7 @@ colorplus_standalone_init(UNUSED(const device_t *info)) mem_mapping_add(&colorplus->cga.mapping, 0xb8000, 0x08000, colorplus_read, NULL, NULL, colorplus_write, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, colorplus); io_sethandler(0x03d0, 0x0010, colorplus_in, NULL, NULL, colorplus_out, NULL, NULL, colorplus); - lpt3_init(0x3BC); + lpt3_setup(LPT_MDA_ADDR); return colorplus; } @@ -382,48 +382,45 @@ colorplus_speed_changed(void *priv) static const device_config_t colorplus_config[] = { // clang-format off { - .name = "display_type", - .description = "Display type", - .type = CONFIG_SELECTION, - .default_int = CGA_RGB, - .selection = { - { - .description = "RGB", - .value = CGA_RGB - }, - { - .description = "Composite", - .value = CGA_COMPOSITE - }, - { - .description = "" - } - } + .name = "display_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = CGA_RGB, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "RGB", .value = CGA_RGB }, + { .description = "Composite", .value = CGA_COMPOSITE }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "composite_type", - .description = "Composite type", - .type = CONFIG_SELECTION, - .default_int = COMPOSITE_OLD, - .selection = { - { - .description = "Old", - .value = COMPOSITE_OLD - }, - { - .description = "New", - .value = COMPOSITE_NEW - }, - { - .description = "" - } - } + .name = "composite_type", + .description = "Composite type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = COMPOSITE_OLD, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Old", .value = COMPOSITE_OLD }, + { .description = "New", .value = COMPOSITE_NEW }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "snow_enabled", - .description = "Snow emulation", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "snow_enabled", + .description = "Snow emulation", + .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 diff --git a/src/video/vid_ega.c b/src/video/vid_ega.c index faf4b9066..10df85c79 100644 --- a/src/video/vid_ega.c +++ b/src/video/vid_ega.c @@ -1590,70 +1590,41 @@ ega_speed_changed(void *priv) static const device_config_t ega_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 256, - .selection = { - { - .description = "32 KB", - .value = 32 - }, - { - .description = "64 KB", - .value = 64 - }, - { - .description = "128 KB", - .value = 128 - }, - { - .description = "256 KB", - .value = 256 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 256, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "32 KB", .value = 32 }, + { .description = "64 KB", .value = 64 }, + { .description = "128 KB", .value = 128 }, + { .description = "256 KB", .value = 256 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "monitor_type", - .description = "Monitor type", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "Monochrome (5151/MDA) (white)", - .value = 0x0B | (DISPLAY_WHITE << 4) - }, - { - .description = "Monochrome (5151/MDA) (green)", - .value = 0x0B | (DISPLAY_GREEN << 4) - }, - { - .description = "Monochrome (5151/MDA) (amber)", - .value = 0x0B | (DISPLAY_AMBER << 4) - }, - { - .description = "Color 40x25 (5153/CGA)", - .value = 0x06 - }, - { - .description = "Color 80x25 (5153/CGA)", - .value = 0x07 - }, - { - .description = "Enhanced Color - Normal Mode (5154/ECD)", - .value = 0x08 - }, - { - .description = "Enhanced Color - Enhanced Mode (5154/ECD)", - .value = 0x09 - }, - { - .description = "" - } + .name = "monitor_type", + .description = "Monitor type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 9, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Monochrome (5151/MDA) (white)", .value = 0x0B | (DISPLAY_WHITE << 4) }, + { .description = "Monochrome (5151/MDA) (green)", .value = 0x0B | (DISPLAY_GREEN << 4) }, + { .description = "Monochrome (5151/MDA) (amber)", .value = 0x0B | (DISPLAY_AMBER << 4) }, + { .description = "Color 40x25 (5153/CGA)", .value = 0x06 }, + { .description = "Color 80x25 (5153/CGA)", .value = 0x07 }, + { .description = "Enhanced Color - Normal Mode (5154/ECD)", .value = 0x08 }, + { .description = "Enhanced Color - Enhanced Mode (5154/ECD)", .value = 0x09 }, + { .description = "" } }, - .default_int = 9 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_et3000.c b/src/video/vid_et3000.c index 8585fedff..193fed3c7 100644 --- a/src/video/vid_et3000.c +++ b/src/video/vid_et3000.c @@ -550,15 +550,19 @@ et3000_available(void) static const device_config_t et3000_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { .description = "256 KB", .value = 256 }, - { .description = "512 KB", .value = 512 }, - { .description = "" } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index 169dc659b..064d79230 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -82,8 +82,8 @@ typedef struct { rom_t bios_rom; uint8_t banking; - uint32_t vram_size, - vram_mask; + uint32_t vram_size; + uint32_t vram_mask; uint8_t port_22cb_val; uint8_t port_32cb_val; @@ -943,43 +943,51 @@ et4000_kasan_available(void) static const device_config_t et4000_tc6058af_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "bios_ver", - .description = "BIOS Revision", - .type = CONFIG_BIOS, + .name = "bios_ver", + .description = "BIOS Revision", + .type = CONFIG_BIOS, .default_string = "v1_10", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .bios = { - { .name = "Version 1.10", .internal_name = "v1_10", .bios_type = BIOS_NORMAL, - .files_no = 1, .local = 0, .size = 32768, .files = { TC6058AF_BIOS_ROM_PATH, "" } }, - { .name = "Version 1.21", .internal_name = "v1_21", .bios_type = BIOS_NORMAL, - .files_no = 1, .local = 0, .size = 32768, .files = { V1_21_BIOS_ROM_PATH, "" } }, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { + { + .name = "Version 1.10", + .internal_name = "v1_10", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 32768, + .files = { TC6058AF_BIOS_ROM_PATH, "" } + }, + { + .name = "Version 1.21", + .internal_name = "v1_21", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 32768, + .files = { V1_21_BIOS_ROM_PATH, "" } + }, { .files_no = 0 } - }, + } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -988,43 +996,51 @@ static const device_config_t et4000_tc6058af_config[] = { static const device_config_t et4000_bios_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1024, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "bios_ver", - .description = "BIOS Revision", - .type = CONFIG_BIOS, + .name = "bios_ver", + .description = "BIOS Revision", + .type = CONFIG_BIOS, .default_string = "v8_01", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .bios = { - { .name = "Version 8.01", .internal_name = "v8_01", .bios_type = BIOS_NORMAL, - .files_no = 1, .local = 0, .size = 32768, .files = { BIOS_ROM_PATH, "" } }, - { .name = "Version 8.06", .internal_name = "v8_06", .bios_type = BIOS_NORMAL, - .files_no = 1, .local = 0, .size = 32768, .files = { V8_06_BIOS_ROM_PATH, "" } }, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { + { + .name = "Version 8.01", + .internal_name = "v8_01", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 32768, + .files = { BIOS_ROM_PATH, "" } + }, + { + .name = "Version 8.06", + .internal_name = "v8_06", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 32768, + .files = { V8_06_BIOS_ROM_PATH, "" } + }, { .files_no = 0 } - }, + } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -1033,27 +1049,20 @@ static const device_config_t et4000_bios_config[] = { static const device_config_t et4000_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1024, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index 351dfba5d..6ff34cbb1 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -2943,23 +2943,19 @@ et4000w32p_force_redraw(void *priv) static const device_config_t et4000w32p_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 2, - .selection = { - { - .description = "1 MB", - .value = 1 - }, - { - .description = "2 MB", - .value = 2 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1 MB", .value = 1 }, + { .description = "2 MB", .value = 2 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_hercules.c b/src/video/vid_hercules.c index 8d99e9c7b..00374d08f 100644 --- a/src/video/vid_hercules.c +++ b/src/video/vid_hercules.c @@ -14,7 +14,7 @@ * Miran Grca, * * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2016-2025 Miran Grca. */ #include #include @@ -585,7 +585,7 @@ hercules_init(UNUSED(const device_t *info)) video_inform(VIDEO_FLAG_TYPE_MDA, &timing_hercules); /* Force the LPT3 port to be enabled. */ - lpt3_init(0x3BC); + lpt3_setup(LPT_MDA_ADDR); return dev; } @@ -615,37 +615,32 @@ speed_changed(void *priv) static const device_config_t hercules_config[] = { // clang-format off { - .name = "rgb_type", - .description = "Display type", - .type = CONFIG_SELECTION, - .default_int = 0, - .selection = { - { - .description = "Default", - .value = 0 - }, - { - .description = "Green", - .value = 1 - }, - { - .description = "Amber", - .value = 2 - }, - { - .description = "Gray", - .value = 3 - }, - { - .description = "" - } - } + .name = "rgb_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Default", .value = 0 }, + { .description = "Green", .value = 1 }, + { .description = "Amber", .value = 2 }, + { .description = "Gray", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "blend", - .description = "Blend", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "blend", + .description = "Blend", + .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 diff --git a/src/video/vid_herculesplus.c b/src/video/vid_herculesplus.c index 1b6b74033..fb42c3022 100644 --- a/src/video/vid_herculesplus.c +++ b/src/video/vid_herculesplus.c @@ -14,7 +14,7 @@ * Miran Grca, * * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2016-2025 Miran Grca. */ #include #include @@ -23,8 +23,8 @@ #include #include <86box/86box.h> #include <86box/io.h> -#include <86box/lpt.h> #include <86box/timer.h> +#include <86box/lpt.h> #include <86box/pit.h> #include <86box/mem.h> #include <86box/rom.h> @@ -670,7 +670,7 @@ herculesplus_init(UNUSED(const device_t *info)) video_inform(VIDEO_FLAG_TYPE_MDA, &timing_herculesplus); /* Force the LPT3 port to be enabled. */ - lpt3_init(0x3BC); + lpt3_setup(LPT_MDA_ADDR); return dev; } @@ -700,37 +700,32 @@ speed_changed(void *priv) static const device_config_t herculesplus_config[] = { // clang-format off { - .name = "rgb_type", - .description = "Display type", - .type = CONFIG_SELECTION, - .default_int = 0, - .selection = { - { - .description = "Default", - .value = 0 - }, - { - .description = "Green", - .value = 1 - }, - { - .description = "Amber", - .value = 2 - }, - { - .description = "Gray", - .value = 3 - }, - { - .description = "" - } - } + .name = "rgb_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Default", .value = 0 }, + { .description = "Green", .value = 1 }, + { .description = "Amber", .value = 2 }, + { .description = "Gray", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "blend", - .description = "Blend", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "blend", + .description = "Blend", + .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 diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index 3ed9e2bce..ce756f7d8 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -1721,32 +1721,40 @@ ht216_force_redraw(void *priv) // clang-format off static const device_config_t v7_vga_1024i_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { .description = "256 KB", .value = 256 }, - { .description = "512 KB", .value = 512 }, - { .description = "" } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t ht216_32_standalone_config[] = { { - .name = "monitor_type", - .description = "Monitor type", - .type = CONFIG_SELECTION, - .default_int = 0x18, - .selection = { + .name = "monitor_type", + .description = "Monitor type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0x18, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "Mono Interlaced", .value = 0x00 }, { .description = "Mono Non-Interlaced", .value = 0x08 }, { .description = "Color Interlaced", .value = 0x10 }, { .description = "Color Non-Interlaced", .value = 0x18 }, - { .description = "" } - } + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_incolor.c b/src/video/vid_incolor.c index 0abb4a6c2..d9b48f43a 100644 --- a/src/video/vid_incolor.c +++ b/src/video/vid_incolor.c @@ -14,7 +14,7 @@ * Miran Grca, * * Copyright 2008-2018 Sarah Walker. - * Copyright 2016-2018 Miran Grca. + * Copyright 2016-2025 Miran Grca. */ #include #include @@ -1018,7 +1018,7 @@ incolor_init(UNUSED(const device_t *info)) video_inform(VIDEO_FLAG_TYPE_MDA, &timing_incolor); /* Force the LPT3 port to be enabled. */ - lpt3_init(0x3BC); + lpt3_setup(LPT_MDA_ADDR); return dev; } diff --git a/src/video/vid_mda.c b/src/video/vid_mda.c index edadb4e46..66a0fbb71 100644 --- a/src/video/vid_mda.c +++ b/src/video/vid_mda.c @@ -14,7 +14,7 @@ * Miran Grca, * * Copyright 2008-2019 Sarah Walker. - * Copyright 2016-2019 Miran Grca. + * Copyright 2016-2025 Miran Grca. */ #include #include @@ -322,7 +322,7 @@ mda_standalone_init(UNUSED(const device_t *info)) mda_init(mda); - lpt3_init(0x3BC); + lpt3_setup(LPT_MDA_ADDR); return mda; } @@ -353,31 +353,21 @@ mda_speed_changed(void *priv) static const device_config_t mda_config[] = { // clang-format off { - .name = "rgb_type", - .description = "Display type", - .type = CONFIG_SELECTION, - .default_int = 0, - .selection = { - { - .description = "Default", - .value = 0 - }, - { - .description = "Green", - .value = 1 - }, - { - .description = "Amber", - .value = 2 - }, - { - .description = "Gray", - .value = 3 - }, - { - .description = "" - } - } + .name = "rgb_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Default", .value = 0 }, + { .description = "Green", .value = 1 }, + { .description = "Amber", .value = 2 }, + { .description = "Gray", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index 9ee74f512..3937c2a7d 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -427,8 +427,7 @@ enum { DMA_STATE_SEC }; -typedef struct -{ +typedef struct { uint32_t addr_type; uint32_t val; } fifo_entry_t; @@ -484,13 +483,11 @@ typedef struct mystique_t { event_t *wake_fifo_thread, *fifo_not_full_event; - struct - { + struct { int m, n, p, s; } xpixpll[3]; - struct - { + struct { uint8_t funcnt : 7, stylelen, dmamod; @@ -521,27 +518,23 @@ typedef struct mystique_t { uint64_t extended_dr[4]; - struct - { + struct { int sdydxl, scanleft, sdxl, sdy, sdxr; } sgn; } dwgreg; - struct - { + struct { uint8_t r, g, b; } lut[256]; - struct - { + struct { uint16_t pos_x, pos_y, addr; uint32_t col[3]; } cursor; - struct - { + struct { atomic_int pri_state, sec_state, iload_state, state; atomic_uint primaddress, primend, secaddress, secend, @@ -6852,25 +6845,20 @@ mystique_force_redraw(void *priv) static const device_config_t mystique_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "8 MB", - .value = 8 - }, - { .description = "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 8, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "8 MB", .value = 8 }, + { .description = "" } }, - .default_int = 8 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -6879,25 +6867,20 @@ static const device_config_t mystique_config[] = { static const device_config_t millennium_ii_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "4 MB", - .value = 4 - }, - { - .description = "8 MB", - .value = 8 - }, - { - .description = "16 MB", - .value = 16 - }, - { .description = "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 8, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "4 MB", .value = 4 }, + { .description = "8 MB", .value = 8 }, + { .description = "16 MB", .value = 16 }, + { .description = "" } }, - .default_int = 8 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_nga.c b/src/video/vid_nga.c index 3cb7426b8..3640e5106 100644 --- a/src/video/vid_nga.c +++ b/src/video/vid_nga.c @@ -600,87 +600,65 @@ nga_init(UNUSED(const device_t *info)) const device_config_t nga_config[] = { // clang-format off { - .name = "rgb_type", - .description = "RGB type", - .type = CONFIG_SELECTION, - .default_int = 0, - .selection = { - { - .description = "Color", - .value = 0 - }, - { - .description = "Green Monochrome", - .value = 1 - }, - { - .description = "Amber Monochrome", - .value = 2 - }, - { - .description = "Gray Monochrome", - .value = 3 - }, - { - .description = "Color (no brown)", - .value = 4 - }, - { - .description = "" - } - } + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Color", .value = 0 }, + { .description = "Green Monochrome", .value = 1 }, + { .description = "Amber Monochrome", .value = 2 }, + { .description = "Gray Monochrome", .value = 3 }, + { .description = "Color (no brown)", .value = 4 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "snow_enabled", - .description = "Snow emulation", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "snow_enabled", + .description = "Snow emulation", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 64, - .selection = { - { - .description = "32 KB", - .value = 32 - }, - { - .description = "64 KB", - .value = 64 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 64, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "32 KB", .value = 32 }, + { .description = "64 KB", .value = 64 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "charset", - .description = "Character set", - .type = CONFIG_SELECTION, - .default_int = 0, - .selection = { - { - .description = "U.S. English", - .value = 0 - }, - { - .description = "Scandinavian", - .value = 1 - }, - { - .description = "Other languages", - .value = 2 - }, - { - .description = "E.F. Hutton", - .value = 3 - }, - { - .description = "" - } - } + .name = "charset", + .description = "Character set", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "U.S. English", .value = 0 }, + { .description = "Scandinavian", .value = 1 }, + { .description = "Other languages", .value = 2 }, + { .description = "E.F. Hutton", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_oak_oti.c b/src/video/vid_oak_oti.c index c7d42275d..ce44ef890 100644 --- a/src/video/vid_oak_oti.c +++ b/src/video/vid_oak_oti.c @@ -571,100 +571,78 @@ oti067_m300_available(void) // clang-format off static const device_config_t oti067_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t oti067_ama932j_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 256, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 256, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t oti077_acer100t_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t oti077_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1024, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_ogc.c b/src/video/vid_ogc.c index d430d2e14..7fe5fbbeb 100644 --- a/src/video/vid_ogc.c +++ b/src/video/vid_ogc.c @@ -634,37 +634,32 @@ const device_config_t ogc_m24_config[] = { // clang-format off { /* Olivetti / ATT compatible displays */ - .name = "rgb_type", - .description = "RGB type", - .type = CONFIG_SELECTION, - .default_int = CGA_RGB, - .selection = { - { - .description = "Color", - .value = 0 - }, - { - .description = "Green Monochrome", - .value = 1 - }, - { - .description = "Amber Monochrome", - .value = 2 - }, - { - .description = "Gray Monochrome", - .value = 3 - }, - { - .description = "" - } - } + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = CGA_RGB, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Color", .value = 0 }, + { .description = "Green Monochrome", .value = 1 }, + { .description = "Amber Monochrome", .value = 2 }, + { .description = "Gray Monochrome", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "snow_enabled", - .description = "Snow emulation", - .type = CONFIG_BINARY, - .default_int = 1, + .name = "snow_enabled", + .description = "Snow emulation", + .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 diff --git a/src/video/vid_paradise.c b/src/video/vid_paradise.c index 8e3241efd..d0acaf276 100644 --- a/src/video/vid_paradise.c +++ b/src/video/vid_paradise.c @@ -68,7 +68,7 @@ typedef struct paradise_t { } paradise_t; static video_timings_t timing_paradise_pvga1a = { .type = VIDEO_ISA, .write_b = 6, .write_w = 8, .write_l = 16, .read_b = 6, .read_w = 8, .read_l = 16 }; -static video_timings_t timing_paradise_wd90c = { .type = VIDEO_ISA, .write_b = 3, .write_w = 3, .write_l = 6, .read_b = 5, .read_w = 5, .read_l = 10 }; +static video_timings_t timing_paradise_wd90c = { .type = VIDEO_ISA, .write_b = 3, .write_w = 3, .write_l = 6, .read_b = 5, .read_w = 5, .read_l = 10 }; void paradise_remap(paradise_t *paradise); @@ -735,23 +735,19 @@ const device_t paradise_pvga1a_pc3086_device = { static const device_config_t paradise_pvga1a_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -816,27 +812,20 @@ const device_t paradise_wd90c11_device = { static const device_config_t paradise_wd90c30_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1024, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_rtg310x.c b/src/video/vid_rtg310x.c index b6e0085f8..ae9475d96 100644 --- a/src/video/vid_rtg310x.c +++ b/src/video/vid_rtg310x.c @@ -387,23 +387,19 @@ rtg3106_available(void) static const device_config_t rtg3105_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 512, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -412,27 +408,20 @@ static const device_config_t rtg3105_config[] = { static const device_config_t rtg3106_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1024, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 7e3b7a2ef..aecc898c4 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -537,15 +537,15 @@ static void s3_visionx68_video_engine_op(uint32_t cpu_dat, s3_t *s3); #define READ_PIXTRANS_BYTE_MM \ temp = svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx)) & s3->vram_mask]; -#define READ_PIXTRANS_WORD \ - if ((s3->bpp == 0) && !s3->color_16bit) { \ - temp = svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx)) & s3->vram_mask]; \ - temp |= (svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx + 1)) & s3->vram_mask] << 8); \ - } else \ +#define READ_PIXTRANS_WORD \ + if ((s3->bpp == 0) && !s3->color_16bit) { \ + temp = svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx)) & s3->vram_mask]; \ + temp |= (svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx + 1)) & s3->vram_mask] << 8); \ + } else \ temp = vram_w[dword_remap_w(svga, (s3->accel.dest + s3->accel.cx - s3->accel.minus)) & (s3->vram_mask >> 1)]; #define READ_PIXTRANS_LONG \ - if ((s3->bpp == 0) && !s3->color_16bit) { \ + if ((s3->bpp == 0) && !s3->color_16bit) { \ temp = svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx)) & s3->vram_mask]; \ temp |= (svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx + 1)) & s3->vram_mask] << 8); \ temp |= (svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx + 2)) & s3->vram_mask] << 16); \ @@ -6583,9 +6583,9 @@ polygon_setup(s3_t *s3) #define READ(addr, dat) \ if (((s3->bpp == 0) && !s3->color_16bit) || (s3->bpp == 2)) \ dat = svga->vram[dword_remap(svga, addr) & s3->vram_mask]; \ - else if ((s3->bpp == 1) || s3->color_16bit) \ + else if ((s3->bpp == 1) || s3->color_16bit) \ dat = vram_w[dword_remap_w(svga, addr) & (s3->vram_mask >> 1)]; \ - else \ + else \ dat = vram_l[dword_remap_l(svga, addr) & (s3->vram_mask >> 2)]; #define MIX_READ \ @@ -6642,11 +6642,11 @@ polygon_setup(s3_t *s3) } \ } -#define MIX \ - { \ - old_dest_dat = dest_dat; \ - MIX_READ \ - dest_dat = (dest_dat & wrt_mask) | (old_dest_dat & ~wrt_mask); \ +#define MIX \ + { \ + old_dest_dat = dest_dat; \ + MIX_READ \ + dest_dat = (dest_dat & wrt_mask) | (old_dest_dat & ~wrt_mask); \ } #define ROPMIX_READ(D, P, S) \ @@ -7431,14 +7431,14 @@ polygon_setup(s3_t *s3) } #define WRITE(addr, dat) \ - if (((s3->bpp == 0) && !s3->color_16bit) || (s3->bpp == 2)) { \ - svga->vram[dword_remap(svga, addr) & s3->vram_mask] = dat; \ + if (((s3->bpp == 0) && !s3->color_16bit) || (s3->bpp == 2)) { \ + svga->vram[dword_remap(svga, addr) & s3->vram_mask] = dat; \ svga->changedvram[(dword_remap(svga, addr) & s3->vram_mask) >> 12] = svga->monitor->mon_changeframecount; \ - } else if ((s3->bpp == 1) || s3->color_16bit) { \ + } else if ((s3->bpp == 1) || s3->color_16bit) { \ vram_w[dword_remap_w(svga, addr) & (s3->vram_mask >> 1)] = dat; \ svga->changedvram[(dword_remap_w(svga, addr) & (s3->vram_mask >> 1)) >> 11] = svga->monitor->mon_changeframecount; \ } else { \ - vram_l[dword_remap_l(svga, addr) & (s3->vram_mask >> 2)] = dat; \ + vram_l[dword_remap_l(svga, addr) & (s3->vram_mask >> 2)] = dat; \ svga->changedvram[(dword_remap_l(svga, addr) & (s3->vram_mask >> 2)) >> 10] = svga->monitor->mon_changeframecount; \ } @@ -10543,100 +10543,126 @@ s3_force_redraw(void *priv) s3->svga.fullchange = s3->svga.monitor->mon_changeframecount; } +// clang-format off static const device_config_t s3_orchid_86c911_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1, - .selection = { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "512 KB", .value = 0 }, { .description = "1 MB", .value = 1 }, { .description = "" } - } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t s3_9fx_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 2, - .selection = { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "1 MB", .value = 1 }, { .description = "2 MB", .value = 2 }, /* Trio64 also supports 4 MB, however the Number Nine BIOS does not */ { .description = "" } - } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t s3_phoenix_trio32_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 2, - .selection = { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "512 KB", .value = 0 }, { .description = "1 MB", .value = 1 }, { .description = "2 MB", .value = 2 }, { .description = "" } - } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t s3_standard_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 4, - .selection = { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "1 MB", .value = 1 }, { .description = "2 MB", .value = 2 }, { .description = "4 MB", .value = 4 }, { .description = "" } - } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t s3_968_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 4, - .selection = { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "1 MB", .value = 1 }, { .description = "2 MB", .value = 2 }, { .description = "4 MB", .value = 4 }, { .description = "8 MB", .value = 8 }, { .description = "" } - } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t s3_standard_config2[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 4, - .selection = { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "2 MB", .value = 2 }, { .description = "4 MB", .value = 4 }, { .description = "" } - } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; +// clang-format on const device_t s3_orchid_86c911_isa_device = { .name = "S3 86c911 ISA (Orchid Fahrenheit 1280)", diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index 3c61f3a57..91b186240 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -2088,127 +2088,127 @@ s3_virge_mmio_write_l(uint32_t addr, uint32_t val, void *priv) } } -#define READ(addr, val) \ - do { \ - switch (bpp) { \ - case 0: /*8 bpp*/ \ +#define READ(addr, val) \ + do { \ + switch (bpp) { \ + case 0: /*8 bpp*/ \ val = vram[addr & virge->vram_mask]; \ - break; \ - case 1: /*16 bpp*/ \ + break; \ + case 1: /*16 bpp*/ \ val = *(uint16_t *)&vram[addr & virge->vram_mask]; \ - break; \ - case 2: /*24 bpp*/ \ + break; \ + case 2: /*24 bpp*/ \ val = (*(uint32_t *)&vram[addr & virge->vram_mask]) & 0xffffff; \ - break; \ - } \ + break; \ + } \ } while (0) #define Z_READ(addr) *(uint16_t *)&vram[addr & virge->vram_mask] -#define Z_WRITE(addr, val) \ - if (!(s3d_tri->cmd_set & CMD_SET_ZB_MODE)) \ +#define Z_WRITE(addr, val) \ + if (!(s3d_tri->cmd_set & CMD_SET_ZB_MODE)) \ *(uint16_t *)&vram[addr & virge->vram_mask] = val -#define CLIP(x, y) \ - do { \ - if ((virge->s3d.cmd_set & CMD_SET_HC) && \ - (x < virge->s3d.clip_l || x > virge->s3d.clip_r || \ - y < virge->s3d.clip_t || y > virge->s3d.clip_b)) \ - update = 0; \ +#define CLIP(x, y) \ + do { \ + if ((virge->s3d.cmd_set & CMD_SET_HC) && \ + (x < virge->s3d.clip_l || x > virge->s3d.clip_r || \ + y < virge->s3d.clip_t || y > virge->s3d.clip_b)) \ + update = 0; \ } while (0) -#define CLIP_3D(x, y) \ - do { \ - if ((s3d_tri->cmd_set & CMD_SET_HC) && (x < s3d_tri->clip_l || \ - x > s3d_tri->clip_r || y < s3d_tri->clip_t || \ - y > s3d_tri->clip_b)) \ - update = 0; \ +#define CLIP_3D(x, y) \ + do { \ + if ((s3d_tri->cmd_set & CMD_SET_HC) && (x < s3d_tri->clip_l || \ + x > s3d_tri->clip_r || y < s3d_tri->clip_t || \ + y > s3d_tri->clip_b)) \ + update = 0; \ } while (0) -#define Z_CLIP(Zzb, Zs) \ - do { \ - if (!(s3d_tri->cmd_set & CMD_SET_ZB_MODE)) \ - switch ((s3d_tri->cmd_set >> 20) & 7) { \ - case 0: \ - update = 0; \ - break; \ - case 1: \ - if (Zs <= Zzb) \ - update = 0; \ - else \ - Zzb = Zs; \ - break; \ - case 2: \ - if (Zs != Zzb) \ - update = 0; \ - else \ - Zzb = Zs; \ - break; \ - case 3: \ - if (Zs < Zzb) \ - update = 0; \ - else \ - Zzb = Zs; \ - break; \ - case 4: \ - if (Zs >= Zzb) \ - update = 0; \ - else \ - Zzb = Zs; \ - break; \ - case 5: \ - if (Zs == Zzb) \ - update = 0; \ - else \ - Zzb = Zs; \ - break; \ - case 6: \ - if (Zs > Zzb) \ - update = 0; \ - else \ - Zzb = Zs; \ - break; \ - case 7: \ - update = 1; \ - Zzb = Zs; \ - break; \ - } \ +#define Z_CLIP(Zzb, Zs) \ + do { \ + if (!(s3d_tri->cmd_set & CMD_SET_ZB_MODE)) \ + switch ((s3d_tri->cmd_set >> 20) & 7) { \ + case 0: \ + update = 0; \ + break; \ + case 1: \ + if (Zs <= Zzb) \ + update = 0; \ + else \ + Zzb = Zs; \ + break; \ + case 2: \ + if (Zs != Zzb) \ + update = 0; \ + else \ + Zzb = Zs; \ + break; \ + case 3: \ + if (Zs < Zzb) \ + update = 0; \ + else \ + Zzb = Zs; \ + break; \ + case 4: \ + if (Zs >= Zzb) \ + update = 0; \ + else \ + Zzb = Zs; \ + break; \ + case 5: \ + if (Zs == Zzb) \ + update = 0; \ + else \ + Zzb = Zs; \ + break; \ + case 6: \ + if (Zs > Zzb) \ + update = 0; \ + else \ + Zzb = Zs; \ + break; \ + case 7: \ + update = 1; \ + Zzb = Zs; \ + break; \ + } \ } while (0) -#define MIX() \ - do { \ - int c; \ - for (c = 0; c < 24; c++) { \ - int d = (dest & (1 << c)) ? 1 : 0; \ - if (source & (1 << c)) \ - d |= 2; \ - if (pattern & (1 << c)) \ - d |= 4; \ - if (virge->s3d.rop & (1 << d)) \ - out |= (1 << c); \ - } \ +#define MIX() \ + do { \ + int c; \ + for (c = 0; c < 24; c++) { \ + int d = (dest & (1 << c)) ? 1 : 0; \ + if (source & (1 << c)) \ + d |= 2; \ + if (pattern & (1 << c)) \ + d |= 4; \ + if (virge->s3d.rop & (1 << d)) \ + out |= (1 << c); \ + } \ } while (0) -#define WRITE(addr, val) \ - do { \ - switch (bpp) { \ - case 0: /*8 bpp*/ \ - vram[addr & virge->vram_mask] = val; \ - virge->svga.changedvram[(addr & virge->vram_mask) >> 12] = \ - changeframecount; \ - break; \ - case 1: /*16 bpp*/ \ - *(uint16_t *)&vram[addr & virge->vram_mask] = val; \ - virge->svga.changedvram[(addr & virge->vram_mask) >> 12] = \ - changeframecount; \ - break; \ - case 2: /*24 bpp*/ \ - *(uint32_t *)&vram[addr & virge->vram_mask] = (val & 0xffffff) |\ - (vram[(addr + 3) & virge->vram_mask] << 24); \ - virge->svga.changedvram[(addr & virge->vram_mask) >> 12] = \ - changeframecount; \ - break; \ - } \ +#define WRITE(addr, val) \ + do { \ + switch (bpp) { \ + case 0: /*8 bpp*/ \ + vram[addr & virge->vram_mask] = val; \ + virge->svga.changedvram[(addr & virge->vram_mask) >> 12] = \ + changeframecount; \ + break; \ + case 1: /*16 bpp*/ \ + *(uint16_t *)&vram[addr & virge->vram_mask] = val; \ + virge->svga.changedvram[(addr & virge->vram_mask) >> 12] = \ + changeframecount; \ + break; \ + case 2: /*24 bpp*/ \ + *(uint32_t *)&vram[addr & virge->vram_mask] = (val & 0xffffff) | \ + (vram[(addr + 3) & virge->vram_mask] << 24); \ + virge->svga.changedvram[(addr & virge->vram_mask) >> 12] = \ + changeframecount; \ + break; \ + } \ } while (0) static void @@ -2573,23 +2573,23 @@ skip_line: g = ((val & 0x03e0) >> 2) | ((val & 0x03e0) >> 7); \ r = ((val & 0x7c00) >> 7) | ((val & 0x7c00) >> 12); -#define RGB24_TO_24(val, r, g, b) \ - b = val & 0xff; \ - g = (val & 0xff00) >> 8; \ +#define RGB24_TO_24(val, r, g, b) \ + b = val & 0xff; \ + g = (val & 0xff00) >> 8; \ r = (val & 0xff0000) >> 16 -#define RGB15(r, g, b, dest) \ - if (virge->dithering_enabled) { \ - int add = dither[_y & 3][_x & 3]; \ - int _r = (r > 248) ? 248 : r + add; \ - int _g = (g > 248) ? 248 : g + add; \ - int _b = (b > 248) ? 248 : b + add; \ - dest = ((_b >> 3) & 0x1f) | \ - (((_g >> 3) & 0x1f) << 5) | \ - (((_r >> 3) & 0x1f) << 10); \ - } else \ - dest = ((b >> 3) & 0x1f) | \ - (((g >> 3) & 0x1f) << 5) | \ +#define RGB15(r, g, b, dest) \ + if (virge->dithering_enabled) { \ + int add = dither[_y & 3][_x & 3]; \ + int _r = (r > 248) ? 248 : r + add; \ + int _g = (g > 248) ? 248 : g + add; \ + int _b = (b > 248) ? 248 : b + add; \ + dest = ((_b >> 3) & 0x1f) | \ + (((_g >> 3) & 0x1f) << 5) | \ + (((_r >> 3) & 0x1f) << 10); \ + } else \ + dest = ((b >> 3) & 0x1f) | \ + (((g >> 3) & 0x1f) << 5) | \ (((r >> 3) & 0x1f) << 10) #define RGB24(r, g, b) ((b) | ((g) << 8) | ((r) << 16)) @@ -3753,103 +3753,99 @@ s3_virge_hwcursor_draw(svga_t *svga, int displine) svga->hwcursor_latch.addr += 16; } -#define DECODE_YCbCr() \ - do { \ - int c; \ - \ - for (c = 0; c < 2; c++) { \ - uint8_t y1, y2; \ - int8_t Cr; \ - int8_t Cb; \ - int dR; \ - int dG; \ - int dB; \ - \ - y1 = src[0]; \ - Cr = src[1] - 0x80; \ - y2 = src[2]; \ - Cb = src[3] - 0x80; \ - src += 4; \ - \ - dR = (359 * Cr) >> 8; \ - dG = (88 * Cb + 183 * Cr) >> 8; \ - dB = (453 * Cb) >> 8; \ - \ - r[x_write] = y1 + dR; \ - CLAMP(r[x_write]); \ - g[x_write] = y1 - dG; \ - CLAMP(g[x_write]); \ - b[x_write] = y1 + dB; \ - CLAMP(b[x_write]); \ - \ - r[x_write + 1] = y2 + dR; \ - CLAMP(r[x_write + 1]); \ - g[x_write + 1] = y2 - dG; \ - CLAMP(g[x_write + 1]); \ - b[x_write + 1] = y2 + dB; \ - CLAMP(b[x_write + 1]); \ - \ - x_write = (x_write + 2) & 7; \ - } \ +#define DECODE_YCbCr() \ + do { \ + for (uint8_t c = 0; c < 2; c++) { \ + uint8_t y1, y2; \ + int8_t Cr; \ + int8_t Cb; \ + int dR; \ + int dG; \ + int dB; \ + \ + y1 = src[0]; \ + Cr = src[1] - 0x80; \ + y2 = src[2]; \ + Cb = src[3] - 0x80; \ + src += 4; \ + \ + dR = (359 * Cr) >> 8; \ + dG = (88 * Cb + 183 * Cr) >> 8; \ + dB = (453 * Cb) >> 8; \ + \ + r[x_write] = y1 + dR; \ + CLAMP(r[x_write]); \ + g[x_write] = y1 - dG; \ + CLAMP(g[x_write]); \ + b[x_write] = y1 + dB; \ + CLAMP(b[x_write]); \ + \ + r[x_write + 1] = y2 + dR; \ + CLAMP(r[x_write + 1]); \ + g[x_write + 1] = y2 - dG; \ + CLAMP(g[x_write + 1]); \ + b[x_write + 1] = y2 + dB; \ + CLAMP(b[x_write + 1]); \ + \ + x_write = (x_write + 2) & 7; \ + } \ } while (0) /*Both YUV formats are untested*/ -#define DECODE_YUV211() \ - do { \ - uint8_t y1, y2, y3, y4; \ - int8_t U, V; \ - int dR; \ - int dG; \ - int dB; \ - \ - U = src[0] - 0x80; \ - y1 = (298 * (src[1] - 16)) >> 8; \ - y2 = (298 * (src[2] - 16)) >> 8; \ - V = src[3] - 0x80; \ - y3 = (298 * (src[4] - 16)) >> 8; \ - y4 = (298 * (src[5] - 16)) >> 8; \ - src += 6; \ - \ - dR = (309 * V) >> 8; \ - dG = (100 * U + 208 * V) >> 8; \ - dB = (516 * U) >> 8; \ - \ - r[x_write] = y1 + dR; \ - CLAMP(r[x_write]); \ - g[x_write] = y1 - dG; \ - CLAMP(g[x_write]); \ - b[x_write] = y1 + dB; \ - CLAMP(b[x_write]); \ - \ - r[x_write + 1] = y2 + dR; \ - CLAMP(r[x_write + 1]); \ - g[x_write + 1] = y2 - dG; \ - CLAMP(g[x_write + 1]); \ - b[x_write + 1] = y2 + dB; \ - CLAMP(b[x_write + 1]); \ - \ - r[x_write + 2] = y3 + dR; \ - CLAMP(r[x_write + 2]); \ - g[x_write + 2] = y3 - dG; \ - CLAMP(g[x_write + 2]); \ - b[x_write + 2] = y3 + dB; \ - CLAMP(b[x_write + 2]); \ - \ - r[x_write + 3] = y4 + dR; \ - CLAMP(r[x_write + 3]); \ - g[x_write + 3] = y4 - dG; \ - CLAMP(g[x_write + 3]); \ - b[x_write + 3] = y4 + dB; \ - CLAMP(b[x_write + 3]); \ - \ - x_write = (x_write + 4) & 7; \ +#define DECODE_YUV211() \ + do { \ + uint8_t y1, y2, y3, y4; \ + int8_t U, V; \ + int dR; \ + int dG; \ + int dB; \ + \ + U = src[0] - 0x80; \ + y1 = (298 * (src[1] - 16)) >> 8; \ + y2 = (298 * (src[2] - 16)) >> 8; \ + V = src[3] - 0x80; \ + y3 = (298 * (src[4] - 16)) >> 8; \ + y4 = (298 * (src[5] - 16)) >> 8; \ + src += 6; \ + \ + dR = (309 * V) >> 8; \ + dG = (100 * U + 208 * V) >> 8; \ + dB = (516 * U) >> 8; \ + \ + r[x_write] = y1 + dR; \ + CLAMP(r[x_write]); \ + g[x_write] = y1 - dG; \ + CLAMP(g[x_write]); \ + b[x_write] = y1 + dB; \ + CLAMP(b[x_write]); \ + \ + r[x_write + 1] = y2 + dR; \ + CLAMP(r[x_write + 1]); \ + g[x_write + 1] = y2 - dG; \ + CLAMP(g[x_write + 1]); \ + b[x_write + 1] = y2 + dB; \ + CLAMP(b[x_write + 1]); \ + \ + r[x_write + 2] = y3 + dR; \ + CLAMP(r[x_write + 2]); \ + g[x_write + 2] = y3 - dG; \ + CLAMP(g[x_write + 2]); \ + b[x_write + 2] = y3 + dB; \ + CLAMP(b[x_write + 2]); \ + \ + r[x_write + 3] = y4 + dR; \ + CLAMP(r[x_write + 3]); \ + g[x_write + 3] = y4 - dG; \ + CLAMP(g[x_write + 3]); \ + b[x_write + 3] = y4 + dB; \ + CLAMP(b[x_write + 3]); \ + \ + x_write = (x_write + 4) & 7; \ } while (0) #define DECODE_YUV422() \ do { \ - int c; \ - \ - for (c = 0; c < 2; c++) { \ + for (uint8_t c = 0; c < 2; c++) { \ uint8_t y1; \ uint8_t y2; \ int8_t U; \ @@ -3886,104 +3882,96 @@ s3_virge_hwcursor_draw(svga_t *svga, int displine) } \ } while (0) -#define DECODE_RGB555() \ - do { \ - int c; \ - \ - for (c = 0; c < 4; c++) { \ - uint16_t dat; \ - \ - dat = *(uint16_t *)src; \ - src += 2; \ - \ - r[x_write + c] = \ - ((dat & 0x001f) << 3) | \ - ((dat & 0x001f) >> 2); \ - g[x_write + c] = \ - ((dat & 0x03e0) >> 2) | \ - ((dat & 0x03e0) >> 7); \ - b[x_write + c] = \ - ((dat & 0x7c00) >> 7) | \ - ((dat & 0x7c00) >> 12); \ - } \ - x_write = (x_write + 4) & 7; \ +#define DECODE_RGB555() \ + do { \ + for (uint8_t c = 0; c < 4; c++) { \ + uint16_t dat; \ + \ + dat = *(uint16_t *)src; \ + src += 2; \ + \ + r[x_write + c] = \ + ((dat & 0x001f) << 3) | \ + ((dat & 0x001f) >> 2); \ + g[x_write + c] = \ + ((dat & 0x03e0) >> 2) | \ + ((dat & 0x03e0) >> 7); \ + b[x_write + c] = \ + ((dat & 0x7c00) >> 7) | \ + ((dat & 0x7c00) >> 12); \ + } \ + x_write = (x_write + 4) & 7; \ } while (0) -#define DECODE_RGB565() \ - do { \ - int c; \ - \ - for (c = 0; c < 4; c++) { \ - uint16_t dat; \ - \ - dat = *(uint16_t *)src; \ - src += 2; \ - \ - r[x_write + c] = \ - ((dat & 0x001f) << 3) | \ - ((dat & 0x001f) >> 2); \ - g[x_write + c] = \ - ((dat & 0x07e0) >> 3) | \ - ((dat & 0x07e0) >> 9); \ - b[x_write + c] = \ - ((dat & 0xf800) >> 8) | \ - ((dat & 0xf800) >> 13); \ - } \ - x_write = (x_write + 4) & 7; \ +#define DECODE_RGB565() \ + do { \ + for (uint8_t c = 0; c < 4; c++) { \ + uint16_t dat; \ + \ + dat = *(uint16_t *)src; \ + src += 2; \ + \ + r[x_write + c] = \ + ((dat & 0x001f) << 3) | \ + ((dat & 0x001f) >> 2); \ + g[x_write + c] = \ + ((dat & 0x07e0) >> 3) | \ + ((dat & 0x07e0) >> 9); \ + b[x_write + c] = \ + ((dat & 0xf800) >> 8) | \ + ((dat & 0xf800) >> 13); \ + } \ + x_write = (x_write + 4) & 7; \ } while (0) -#define DECODE_RGB888() \ - do { \ - int c; \ - \ - for (c = 0; c < 4; c++) { \ - r[x_write + c] = src[0]; \ - g[x_write + c] = src[1]; \ - b[x_write + c] = src[2]; \ - src += 3; \ - } \ - x_write = (x_write + 4) & 7; \ +#define DECODE_RGB888() \ + do { \ + for (uint8_t c = 0; c < 4; c++) { \ + r[x_write + c] = src[0]; \ + g[x_write + c] = src[1]; \ + b[x_write + c] = src[2]; \ + src += 3; \ + } \ + x_write = (x_write + 4) & 7; \ } while (0) -#define DECODE_XRGB8888() \ - do { \ - int c; \ - \ - for (c = 0; c < 4; c++) { \ - r[x_write + c] = src[0]; \ - g[x_write + c] = src[1]; \ - b[x_write + c] = src[2]; \ - src += 4; \ - } \ - x_write = (x_write + 4) & 7; \ +#define DECODE_XRGB8888() \ + do { \ + for (uint8_t c = 0; c < 4; c++) { \ + r[x_write + c] = src[0]; \ + g[x_write + c] = src[1]; \ + b[x_write + c] = src[2]; \ + src += 4; \ + } \ + x_write = (x_write + 4) & 7; \ } while (0) -#define OVERLAY_SAMPLE() \ - do { \ - switch (virge->streams.sdif) { \ - case 1: \ - DECODE_YCbCr(); \ - break; \ - case 2: \ - DECODE_YUV422(); \ - break; \ - case 3: \ - DECODE_RGB555(); \ - break; \ - case 4: \ - DECODE_YUV211(); \ - break; \ - case 5: \ - DECODE_RGB565(); \ - break; \ - case 6: \ - DECODE_RGB888(); \ - break; \ - case 7: \ - default: \ - DECODE_XRGB8888(); \ - break; \ - } \ +#define OVERLAY_SAMPLE() \ + do { \ + switch (virge->streams.sdif) { \ + case 1: \ + DECODE_YCbCr(); \ + break; \ + case 2: \ + DECODE_YUV422(); \ + break; \ + case 3: \ + DECODE_RGB555(); \ + break; \ + case 4: \ + DECODE_YUV211(); \ + break; \ + case 5: \ + DECODE_RGB565(); \ + break; \ + case 6: \ + DECODE_RGB888(); \ + break; \ + case 7: \ + default: \ + DECODE_XRGB8888(); \ + break; \ + } \ } while (0) static void @@ -4704,35 +4692,38 @@ s3_virge_force_redraw(void *priv) static const device_config_t s3_virge_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 4, - .selection = { - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "bilinear", - .description = "Bilinear filtering", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "dithering", - .description = "Dithering", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "dithering", + .description = "Dithering", + .type = CONFIG_BINARY, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -4741,39 +4732,39 @@ static const device_config_t s3_virge_config[] = { static const device_config_t s3_virge_stb_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 4, - .selection = { - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "8 MB", - .value = 8 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "8 MB", .value = 8 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "bilinear", - .description = "Bilinear filtering", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "dithering", - .description = "Dithering", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "dithering", + .description = "Dithering", + .type = CONFIG_BINARY, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -4782,16 +4773,24 @@ static const device_config_t s3_virge_stb_config[] = { static const device_config_t s3_virge_357_config[] = { // clang-format off { - .name = "bilinear", - .description = "Bilinear filtering", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "dithering", - .description = "Dithering", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "dithering", + .description = "Dithering", + .type = CONFIG_BINARY, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -4800,35 +4799,41 @@ static const device_config_t s3_virge_357_config[] = { static const device_config_t s3_trio3d2x_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 4, - .selection = { - { - .description = "4 MB", - .value = 4 - }, - { - .description = "8 MB", - .value = 8 - }, - { - .description = "" - } - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "4 MB", .value = 4 }, + { .description = "8 MB", .value = 8 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "bilinear", - .description = "Bilinear filtering", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "dithering", - .description = "Dithering", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "dithering", + .description = "Dithering", + .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 diff --git a/src/video/vid_sigma.c b/src/video/vid_sigma.c index 161331918..d771260ed 100644 --- a/src/video/vid_sigma.c +++ b/src/video/vid_sigma.c @@ -860,96 +860,57 @@ sigma_speed_changed(void *priv) device_config_t sigma_config[] = { // clang-format off { - .name = "rgb_type", - .description = "RGB type", - .type = CONFIG_SELECTION, - .default_int = 0, - .selection = { - { - .description = "Color", - .value = 0 - }, - { - .description = "Green Monochrome", - .value = 1 - }, - { - .description = "Amber Monochrome", - .value = 2 - }, - { - .description = "Gray Monochrome", - .value = 3 - }, - { - .description = "Color (no brown)", - .value = 4 - }, - { - .description = "" - } - } - }, - { - .name = "enable_nmi", - .description = "Enable NMI for CGA emulation", - .type = CONFIG_BINARY, - .default_int = 1 - }, - { - .name = "bios_addr", - .description = "BIOS Address", - .type = CONFIG_HEX20, - .default_int = 0xc0000, - .selection = { - { - .description = "C000H", - .value = 0xc0000 - }, - { - .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 = "E000H", - .value = 0xe0000 - }, - { - .description = "E400H", - .value = 0xe4000 - }, - { - .description = "E800H", - .value = 0xe8000 - }, - { - .description = "EC00H", - .value = 0xec000 - }, - { - .description = "" - } + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Color", .value = 0 }, + { .description = "Green Monochrome", .value = 1 }, + { .description = "Amber Monochrome", .value = 2 }, + { .description = "Gray Monochrome", .value = 3 }, + { .description = "Color (no brown)", .value = 4 }, + { .description = "" } }, + .bios = { { 0 } } + }, + { + .name = "enable_nmi", + .description = "Enable NMI for CGA emulation", + .type = CONFIG_BINARY, + .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 = NULL, + .default_int = 0xc0000, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "C000H", .value = 0xc0000 }, + { .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 = "E000H", .value = 0xe0000 }, + { .description = "E400H", .value = 0xe4000 }, + { .description = "E800H", .value = 0xe8000 }, + { .description = "EC00H", .value = 0xec000 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index e9fbe57f2..d1391f1d1 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -112,8 +112,7 @@ typedef struct tgui_t { uint8_t int_line; uint8_t pci_regs[256]; - struct - { + struct { int16_t src_x, src_y; int16_t src_x_clip, src_y_clip; int16_t dst_x, dst_y; @@ -350,7 +349,9 @@ tgui_out(uint16_t addr, uint8_t val, void *priv) if (tgui->ramdac_state == 4) { tgui->ramdac_state = 0; tgui->ramdac_ctrl = val; - //pclog("TGUI ramdac ctrl=%02x.\n", (tgui->ramdac_ctrl >> 4) & 0x0f); +#if 0 + pclog("TGUI ramdac ctrl=%02x.\n", (tgui->ramdac_ctrl >> 4) & 0x0f); +#endif svga_recalctimings(svga); return; } @@ -718,7 +719,9 @@ tgui_recalctimings(svga_t *svga) if (((svga->crtc[0x29] & 0x30) && (svga->bpp >= 15)) || !svga->rowoffset) svga->rowoffset |= 0x100; - //pclog("BPP=%d, DataWidth=%02x, CRTC29 bit 4-5=%02x, pixbusmode=%02x, rowoffset=%02x, doublerowoffset=%x.\n", svga->bpp, svga->crtc[0x2a] & 0x40, svga->crtc[0x29] & 0x30, svga->crtc[0x38], svga->rowoffset, svga->gdcreg[0x2f] & 4); +#if 0 + pclog("BPP=%d, DataWidth=%02x, CRTC29 bit 4-5=%02x, pixbusmode=%02x, rowoffset=%02x, doublerowoffset=%x.\n", svga->bpp, svga->crtc[0x2a] & 0x40, svga->crtc[0x29] & 0x30, svga->crtc[0x38], svga->rowoffset, svga->gdcreg[0x2f] & 4); +#endif if ((svga->crtc[0x1e] & 0xA0) == 0xA0) svga->ma_latch |= 0x10000; @@ -1468,15 +1471,15 @@ enum { } \ } while (0) -#define WRITE(addr, dat) \ - if (tgui->accel.bpp == 0) { \ - svga->vram[(addr) &tgui->vram_mask] = dat; \ +#define WRITE(addr, dat) \ + if (tgui->accel.bpp == 0) { \ + svga->vram[(addr) &tgui->vram_mask] = dat; \ svga->changedvram[((addr) & (tgui->vram_mask)) >> 12] = svga->monitor->mon_changeframecount; \ - } else if (tgui->accel.bpp == 1) { \ - vram_w[(addr) & (tgui->vram_mask >> 1)] = dat; \ + } else if (tgui->accel.bpp == 1) { \ + vram_w[(addr) & (tgui->vram_mask >> 1)] = dat; \ svga->changedvram[((addr) & (tgui->vram_mask >> 1)) >> 11] = svga->monitor->mon_changeframecount; \ - } else { \ - vram_l[(addr) & (tgui->vram_mask >> 2)] = dat; \ + } else { \ + vram_l[(addr) & (tgui->vram_mask >> 2)] = dat; \ svga->changedvram[((addr) & (tgui->vram_mask >> 2)) >> 10] = svga->monitor->mon_changeframecount; \ } @@ -2115,7 +2118,9 @@ tgui_accel_out(uint16_t addr, uint8_t val, void *priv) case 0x2123: tgui->accel.ger22 = (tgui->accel.ger22 & 0xff) | (val << 8); - //pclog("Pitch IO23: val = %02x, rowoffset = %x.\n", tgui->accel.ger22, svga->crtc[0x13]); +#if 0 + pclog("Pitch IO23: val = %02x, rowoffset = %x.\n", tgui->accel.ger22, svga->crtc[0x13]); +#endif switch (svga->bpp) { case 8: case 24: @@ -3364,50 +3369,39 @@ tgui_force_redraw(void *priv) // clang-format off static const device_config_t tgui9440_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1 MB", - .value = 1 - }, - { - .description = "2 MB", - .value = 2 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1 MB", .value = 1 }, + { .description = "2 MB", .value = 2 }, + { .description = "" } }, - .default_int = 2 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t tgui96xx_config[] = { { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1 MB", - .value = 1 - }, - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "" - } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 4, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1 MB", .value = 1 }, + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "" } }, - .default_int = 4 + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_tvga.c b/src/video/vid_tvga.c index 9f329a604..9dd7e424d 100644 --- a/src/video/vid_tvga.c +++ b/src/video/vid_tvga.c @@ -521,28 +521,21 @@ tvga_force_redraw(void *priv) static const device_config_t tvga_config[] = { // clang-format off { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .default_int = 1024, - .selection = { - { - .description = "256 KB", - .value = 256 - }, - { - .description = "512 KB", - .value = 512 - }, - { - .description = "1 MB", - .value = 1024 - }, + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, /*Chip supports 2mb, but drivers are buggy*/ - { - .description = "" - } - } + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format off diff --git a/src/video/vid_voodoo.c b/src/video/vid_voodoo.c index bf3b63736..e45f112ed 100644 --- a/src/video/vid_voodoo.c +++ b/src/video/vid_voodoo.c @@ -1308,119 +1308,121 @@ voodoo_close(void *priv) static const device_config_t voodoo_config[] = { // clang-format off { - .name = "type", - .description = "Voodoo type", - .type = CONFIG_SELECTION, + .name = "type", + .description = "Voodoo type", + .type = CONFIG_SELECTION, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, .selection = { - { - .description = "3Dfx Voodoo Graphics", - .value = VOODOO_1 - }, - { - .description = "Obsidian SB50 + Amethyst (2 TMUs)", - .value = VOODOO_SB50 - }, - { - .description = "3Dfx Voodoo 2", - .value = VOODOO_2 - }, - { - .description = "" - } + { .description = "3Dfx Voodoo Graphics", .value = VOODOO_1 }, + { .description = "Obsidian SB50 + Amethyst (2 TMUs)", .value = VOODOO_SB50 }, + { .description = "3Dfx Voodoo 2", .value = VOODOO_2 }, + { .description = "" } }, - .default_int = 0 + .bios = { { 0 } } }, { - .name = "framebuffer_memory", - .description = "Framebuffer memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "" - } + .name = "framebuffer_memory", + .description = "Framebuffer memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "" } }, - .default_int = 2 + .bios = { { 0 } } }, { - .name = "texture_memory", - .description = "Texture memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "2 MB", - .value = 2 - }, - { - .description = "4 MB", - .value = 4 - }, - { - .description = "" - } + .name = "texture_memory", + .description = "Texture memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "2 MB", .value = 2 }, + { .description = "4 MB", .value = 4 }, + { .description = "" } }, - .default_int = 2 + .bios = { { 0 } } }, { - .name = "bilinear", - .description = "Bilinear filtering", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "dithersub", - .description = "Dither subtraction", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "dithersub", + .description = "Dither subtraction", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "dacfilter", - .description = "Screen Filter", - .type = CONFIG_BINARY, - .default_int = 0 + .name = "dacfilter", + .description = "Screen Filter", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, { - .name = "render_threads", - .description = "Render threads", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1", - .value = 1 - }, - { - .description = "2", - .value = 2 - }, - { - .description = "4", - .value = 4 - }, - { - .description = "" - } + .name = "render_threads", + .description = "Render threads", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1", .value = 1 }, + { .description = "2", .value = 2 }, + { .description = "4", .value = 4 }, + { .description = "" } }, - .default_int = 2 + .bios = { { 0 } } }, { - .name = "sli", - .description = "SLI", - .type = CONFIG_BINARY, - .default_int = 0 + .name = "sli", + .description = "SLI", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, #ifndef NO_CODEGEN { - .name = "recompiler", - .description = "Dynamic Recompiler", - .type = CONFIG_BINARY, - .default_int = 1 + .name = "recompiler", + .description = "Dynamic Recompiler", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } }, #endif { .name = "", .description = "", .type = CONFIG_END } diff --git a/src/video/vid_voodoo_banshee.c b/src/video/vid_voodoo_banshee.c index ebd92d983..fadd782a5 100644 --- a/src/video/vid_voodoo_banshee.c +++ b/src/video/vid_voodoo_banshee.c @@ -441,7 +441,9 @@ banshee_updatemapping(banshee_t *banshee) svga_t *svga = &banshee->svga; if (!(banshee->pci_regs[PCI_REG_COMMAND] & PCI_COMMAND_MEM)) { - // banshee_log("Update mapping - PCI disabled\n"); +#if 0 + banshee_log("Update mapping - PCI disabled\n"); +#endif mem_mapping_disable(&svga->mapping); mem_mapping_disable(&banshee->linear_mapping); mem_mapping_disable(&banshee->reg_mapping_low); @@ -1082,7 +1084,9 @@ banshee_ext_in(uint16_t addr, void *priv) break; } - // banshee_log("banshee_ext_in: addr=%04x val=%02x\n", addr, ret); +#if 0 + banshee_log("banshee_ext_in: addr=%04x val=%02x\n", addr, ret); +#endif return ret; } @@ -1273,7 +1277,9 @@ banshee_ext_inl(uint16_t addr, void *priv) break; default: - // fatal("bad banshee_ext_inl: addr=%04x\n", addr); +#if 0 + fatal("bad banshee_ext_inl: addr=%04x\n", addr); +#endif break; } @@ -1334,17 +1340,23 @@ banshee_cmd_read(banshee_t *banshee, uint32_t addr) case cmdBaseAddr0: ret = voodoo->cmdfifo_base >> 12; - // banshee_log("Read cmdfifo_base %08x\n", ret); +#if 0 + banshee_log("Read cmdfifo_base %08x\n", ret); +#endif break; case cmdRdPtrL0: ret = voodoo->cmdfifo_rp; - // banshee_log("Read cmdfifo_rp %08x\n", ret); +#if 0 + banshee_log("Read cmdfifo_rp %08x\n", ret); +#endif break; case cmdFifoDepth0: ret = voodoo->cmdfifo_depth_wr - voodoo->cmdfifo_depth_rd; - // banshee_log("Read cmdfifo_depth %08x\n", ret); +#if 0 + banshee_log("Read cmdfifo_depth %08x\n", ret); +#endif break; case cmdStatus0: @@ -1357,17 +1369,23 @@ banshee_cmd_read(banshee_t *banshee, uint32_t addr) case cmdBaseAddr1: ret = voodoo->cmdfifo_base_2 >> 12; - // banshee_log("Read cmdfifo_base %08x\n", ret); +#if 0 + banshee_log("Read cmdfifo_base %08x\n", ret); +#endif break; case cmdRdPtrL1: ret = voodoo->cmdfifo_rp_2; - // banshee_log("Read cmdfifo_rp %08x\n", ret); +#if 0 + banshee_log("Read cmdfifo_rp %08x\n", ret); +#endif break; case cmdFifoDepth1: ret = voodoo->cmdfifo_depth_wr_2 - voodoo->cmdfifo_depth_rd_2; - // banshee_log("Read cmdfifo_depth %08x\n", ret); +#if 0 + banshee_log("Read cmdfifo_depth %08x\n", ret); +#endif break; case cmdStatus1: @@ -2833,7 +2851,9 @@ banshee_pci_read(int func, int addr, void *priv) if (func) return 0xff; - // banshee_log("Banshee PCI read %08X ", addr); +#if 0 + banshee_log("Banshee PCI read %08X ", addr); +#endif switch (addr) { case 0x00: ret = 0x1a; @@ -3158,186 +3178,6 @@ banshee_pci_write(int func, int addr, uint8_t val, void *priv) } } -// clang-format off -static const device_config_t banshee_sgram_config[] = { - { - .name = "memory", - .description = "Memory size", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "8 MB", - .value = 8 - }, - { - .description = "16 MB", - .value = 16 - }, - { - .description = "" - } - }, - .default_int = 16 - }, - { - .name = "bilinear", - .description = "Bilinear filtering", - .type = CONFIG_BINARY, - .default_int = 1 - }, - { - .name = "dithersub", - .description = "Dither subtraction", - .type = CONFIG_BINARY, - .default_int = 1 - }, - { - .name = "dacfilter", - .description = "Screen Filter", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .name = "render_threads", - .description = "Render threads", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1", - .value = 1 - }, - { - .description = "2", - .value = 2 - }, - { - .description = "4", - .value = 4 - }, - { - .description = "" - } - }, - .default_int = 2 - }, -#ifndef NO_CODEGEN - { - .name = "recompiler", - .description = "Dynamic Recompiler", - .type = CONFIG_BINARY, - .default_int = 1 - }, -#endif - { .name = "", .description = "", .type = CONFIG_END } -}; - -static const device_config_t banshee_sgram_16mbonly_config[] = { - { - .name = "bilinear", - .description = "Bilinear filtering", - .type = CONFIG_BINARY, - .default_int = 1 - }, - { - .name = "dithersub", - .description = "Dither subtraction", - .type = CONFIG_BINARY, - .default_int = 1 - }, - { - .name = "dacfilter", - .description = "Screen Filter", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .name = "render_threads", - .description = "Render threads", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1", - .value = 1 - }, - { - .description = "2", - .value = 2 - }, - { - .description = "4", - .value = 4 - }, - { - .description = "" - } - }, - .default_int = 2 - }, -#ifndef NO_CODEGEN - { - .name = "recompiler", - .description = "Dynamic Recompiler", - .type = CONFIG_BINARY, - .default_int = 1 - }, -#endif - { .name = "", .description = "", .type = CONFIG_END } -}; - -static const device_config_t banshee_sdram_config[] = { - { - .name = "bilinear", - .description = "Bilinear filtering", - .type = CONFIG_BINARY, - .default_int = 1 - }, - { - .name = "dithersub", - .description = "Dither subtraction", - .type = CONFIG_BINARY, - .default_int = 1 - }, - { - .name = "dacfilter", - .description = "Screen Filter", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .name = "render_threads", - .description = "Render threads", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "1", - .value = 1 - }, - { - .description = "2", - .value = 2 - }, - { - .description = "4", - .value = 4 - }, - { - .description = "" - } - }, - .default_int = 2 - }, -#ifndef NO_CODEGEN - { - .name = "recompiler", - .description = "Dynamic Recompiler", - .type = CONFIG_BINARY, - .default_int = 1 - }, -#endif - { .name = "", .description = "", .type = CONFIG_END } -}; -// clang-format on - static void * banshee_init_common(const device_t *info, char *fn, int has_sgram, int type, int voodoo_type, int agp) { @@ -3729,6 +3569,221 @@ banshee_force_redraw(void *priv) banshee->svga.fullchange = changeframecount; } +// clang-format off +static const device_config_t banshee_sgram_config[] = { + { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 16, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "8 MB", .value = 8 }, + { .description = "16 MB", .value = 16 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + { + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "dithersub", + .description = "Dither subtraction", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "dacfilter", + .description = "Screen Filter", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "render_threads", + .description = "Render threads", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1", .value = 1 }, + { .description = "2", .value = 2 }, + { .description = "4", .value = 4 }, + { .description = "" } + }, + .bios = { { 0 } } + }, +#ifndef NO_CODEGEN + { + .name = "recompiler", + .description = "Dynamic Recompiler", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, +#endif + { .name = "", .description = "", .type = CONFIG_END } +}; + +static const device_config_t banshee_sgram_16mbonly_config[] = { + { + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "dithersub", + .description = "Dither subtraction", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "dacfilter", + .description = "Screen Filter", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "render_threads", + .description = "Render threads", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1", .value = 1 }, + { .description = "2", .value = 2 }, + { .description = "4", .value = 4 }, + { .description = "" } + }, + .bios = { { 0 } } + }, +#ifndef NO_CODEGEN + { + .name = "recompiler", + .description = "Dynamic Recompiler", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, +#endif + { .name = "", .description = "", .type = CONFIG_END } +}; + +static const device_config_t banshee_sdram_config[] = { + { + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "dithersub", + .description = "Dither subtraction", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "dacfilter", + .description = "Screen Filter", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { + .name = "render_threads", + .description = "Render threads", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "1", .value = 1 }, + { .description = "2", .value = 2 }, + { .description = "4", .value = 4 }, + { .description = "" } + }, + .bios = { { 0 } } + }, +#ifndef NO_CODEGEN + { + .name = "recompiler", + .description = "Dynamic Recompiler", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, +#endif + { .name = "", .description = "", .type = CONFIG_END } +}; +// clang-format on + const device_t voodoo_banshee_device = { .name = "3Dfx Voodoo Banshee", .internal_name = "voodoo_banshee_pci", diff --git a/src/video/vid_voodoo_render.c b/src/video/vid_voodoo_render.c index d8f812f7f..cc52fc61a 100644 --- a/src/video/vid_voodoo_render.c +++ b/src/video/vid_voodoo_render.c @@ -43,8 +43,7 @@ typedef struct voodoo_state_t { int xstart, xend, xdir; uint32_t base_r, base_g, base_b, base_a, base_z; - struct - { + struct { int64_t base_s, base_t, base_w; int lod; } tmu[2]; @@ -1424,11 +1423,14 @@ voodoo_triangle(voodoo_t *voodoo, voodoo_params_t *params, int odd_even) if ((params->vertexAy & 0xf) > 8) dy += 16; - /* voodoo_render_log("voodoo_triangle %i %i %i : vA %f, %f vB %f, %f vC %f, %f f %i,%i %08x %08x %08x,%08x tex=%i,%i fogMode=%08x\n", odd_even, voodoo->params_read_idx[odd_even], voodoo->params_read_idx[odd_even] & PARAM_MASK, (float)params->vertexAx / 16.0, (float)params->vertexAy / 16.0, - (float)params->vertexBx / 16.0, (float)params->vertexBy / 16.0, - (float)params->vertexCx / 16.0, (float)params->vertexCy / 16.0, - (params->fbzColorPath & FBZCP_TEXTURE_ENABLED) ? params->tformat[0] : 0, - (params->fbzColorPath & FBZCP_TEXTURE_ENABLED) ? params->tformat[1] : 0, params->fbzColorPath, params->alphaMode, params->textureMode[0],params->textureMode[1], params->tex_entry[0],params->tex_entry[1], params->fogMode);*/ +#if 0 +voodoo_render_log("voodoo_triangle %i %i %i : vA %f, %f vB %f, %f vC %f, %f f %i,%i %08x %08x %08x,%08x tex=%i,%i fogMode=%08x\n", + odd_even, voodoo->params_read_idx[odd_even], voodoo->params_read_idx[odd_even] & PARAM_MASK, (float)params->vertexAx / 16.0, (float)params->vertexAy / 16.0, + (float)params->vertexBx / 16.0, (float)params->vertexBy / 16.0, + (float)params->vertexCx / 16.0, (float)params->vertexCy / 16.0, + (params->fbzColorPath & FBZCP_TEXTURE_ENABLED) ? params->tformat[0] : 0, + (params->fbzColorPath & FBZCP_TEXTURE_ENABLED) ? params->tformat[1] : 0, params->fbzColorPath, params->alphaMode, params->textureMode[0],params->textureMode[1], params->tex_entry[0],params->tex_entry[1], params->fogMode); +#endif state.base_r = params->startR; state.base_g = params->startG; diff --git a/src/video/vid_voodoo_setup.c b/src/video/vid_voodoo_setup.c index e1d13ba35..11f4ff861 100644 --- a/src/video/vid_voodoo_setup.c +++ b/src/video/vid_voodoo_setup.c @@ -191,8 +191,8 @@ voodoo_triangle_setup(voodoo_t *voodoo) voodoo->params.dWdX = (int64_t) (((verts[va].sWb - verts[vb].sWb) * dyBC - (verts[vb].sWb - verts[vc].sWb) * dyAB) * 4294967296.0f); voodoo->params.dWdY = (int64_t) (((verts[vb].sWb - verts[vc].sWb) * dxAB - (verts[va].sWb - verts[vb].sWb) * dxBC) * 4294967296.0f); voodoo->params.tmu[0].startW = voodoo->params.tmu[1].startW = voodoo->params.startW; - voodoo->params.tmu[0].dWdX = voodoo->params.tmu[1].dWdX = voodoo->params.dWdX; - voodoo->params.tmu[0].dWdY = voodoo->params.tmu[1].dWdY = voodoo->params.dWdY; + voodoo->params.tmu[0].dWdX = voodoo->params.tmu[1].dWdX = voodoo->params.dWdX; + voodoo->params.tmu[0].dWdY = voodoo->params.tmu[1].dWdY = voodoo->params.dWdY; } if (voodoo->sSetupMode & SETUPMODE_W0) { voodoo->params.tmu[0].startW = (int64_t) (verts[va].sW0 * 4294967296.0f); diff --git a/src/video/vid_voodoo_texture.c b/src/video/vid_voodoo_texture.c index 3939db3cd..f6894ec0f 100644 --- a/src/video/vid_voodoo_texture.c +++ b/src/video/vid_voodoo_texture.c @@ -61,10 +61,10 @@ voodoo_texture_log(const char *fmt, ...) void voodoo_recalc_tex12(voodoo_t *voodoo, int tmu) { - int aspect = (voodoo->params.tLOD[tmu] >> 21) & 3; - int width = 256; - int height = 256; - int shift = 8; + int aspect = (voodoo->params.tLOD[tmu] >> 21) & 3; + int width = 256; + int height = 256; + int shift = 8; uint32_t base = voodoo->params.texBaseAddr[tmu]; uint32_t offset = 0; int tex_lod = 0; diff --git a/src/video/vid_xga.c b/src/video/vid_xga.c index fb27b8b2c..a469330af 100644 --- a/src/video/vid_xga.c +++ b/src/video/vid_xga.c @@ -41,7 +41,7 @@ #define XGA2_BIOS_PATH "roms/video/xga/xga2_v300.bin" #define INMOS_XGA_BIOS_PATH "roms/video/xga/InMOS XGA - Fairchild NM27C256Q-150.BIN" -static video_timings_t timing_xga_isa = { .type = VIDEO_ISA, .write_b = 3, .write_w = 3, .write_l = 6, .read_b = 5, .read_w = 5, .read_l = 10 }; +static video_timings_t timing_xga_isa = { .type = VIDEO_ISA, .write_b = 3, .write_w = 3, .write_l = 6, .read_b = 5, .read_w = 5, .read_l = 10 }; static video_timings_t timing_xga_mca = { .type = VIDEO_MCA, .write_b = 4, .write_w = 5, .write_l = 10, .read_b = 5, .read_w = 5, .read_l = 10 }; static void xga_ext_outb(uint16_t addr, uint8_t val, void *priv); @@ -856,18 +856,18 @@ xga_ext_inb(uint16_t addr, void *priv) return ret; } -#define READ(addr, dat) \ +#define READ(addr, dat) \ dat = xga->vram[(addr) & (xga->vram_mask)]; -#define WRITE(addr, dat) \ - xga->vram[((addr)) & (xga->vram_mask)] = dat; \ +#define WRITE(addr, dat) \ + xga->vram[((addr)) & (xga->vram_mask)] = dat; \ xga->changedvram[(((addr)) & (xga->vram_mask)) >> 12] = svga->monitor->mon_changeframecount; -#define READW(addr, dat) \ +#define READW(addr, dat) \ dat = *(uint16_t *) &xga->vram[(addr) & (xga->vram_mask)]; -#define WRITEW(addr, dat) \ - *(uint16_t *) &xga->vram[((addr)) & (xga->vram_mask)] = dat; \ +#define WRITEW(addr, dat) \ + *(uint16_t *) &xga->vram[((addr)) & (xga->vram_mask)] = dat; \ xga->changedvram[(((addr)) & (xga->vram_mask)) >> 12] = svga->monitor->mon_changeframecount; #define ROP(mix, d, s) \ @@ -928,7 +928,7 @@ xga_ext_inb(uint16_t addr, void *priv) d = MIN(s, d); \ break; \ case 0x12: \ - d = MIN(~0, s + d); \ + d = MIN(~0, s + d); \ break; \ case 0x13: \ d = MAX(0, d - s); \ @@ -3660,24 +3660,19 @@ xga_force_redraw(void *priv) static const device_config_t xga_mca_configuration[] = { // clang-format off { - .name = "type", - .description = "XGA type", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "XGA-1", - .value = 0 - }, - { - .description = "XGA-2", - .value = 1 - }, - { .description = "" } - } + .name = "type", + .description = "XGA type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "XGA-1", .value = 0 }, + { .description = "XGA-2", .value = 1 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -3686,34 +3681,29 @@ static const device_config_t xga_mca_configuration[] = { static const device_config_t xga_isa_configuration[] = { // clang-format off { - .name = "type", - .description = "XGA type", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "XGA-1", - .value = 0 - }, - { - .description = "XGA-2", - .value = 1 - }, - { .description = "" } - } + .name = "type", + .description = "XGA type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "XGA-1", .value = 0 }, + { .description = "XGA-2", .value = 1 }, + { .description = "" } + }, + .bios = { { 0 } } }, { - .name = "instance", - .description = "Instance", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 6, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "instance", + .description = "Instance", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 6, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "0 (2100h-210Fh)", .value = 0 }, { .description = "1 (2110h-211Fh)", .value = 1 }, { .description = "2 (2120h-212Fh)", .value = 2 }, @@ -3722,18 +3712,19 @@ static const device_config_t xga_isa_configuration[] = { { .description = "5 (2150h-215Fh)", .value = 5 }, { .description = "6 (2160h-216Fh)", .value = 6 }, { .description = "7 (2170h-217Fh)", .value = 7 }, - { .description = "" } + { .description = "" } }, + .bios = { { 0 } } }, { - .name = "ext_mem_addr", - .description = "MMIO Address", - .type = CONFIG_HEX16, - .default_string = "", - .default_int = 0x00f0, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "ext_mem_addr", + .description = "MMIO Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x00f0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "C800h", .value = 0x0040 }, { .description = "CA00h", .value = 0x0050 }, { .description = "CC00h", .value = 0x0060 }, @@ -3746,23 +3737,25 @@ static const device_config_t xga_isa_configuration[] = { { .description = "DA00h", .value = 0x00d0 }, { .description = "DC00h", .value = 0x00e0 }, { .description = "DE00h", .value = 0x00f0 }, - { .description = "" } + { .description = "" } }, + .bios = { { 0 } } }, { - .name = "dma", - .description = "DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 7, - .file_filter = "", - .spinner = { 0 }, - .selection = { + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 7, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { .description = "Disabled", .value = 0 }, - { .description = "DMA 6", .value = 6 }, - { .description = "DMA 7", .value = 7 }, - { .description = "" } + { .description = "DMA 6", .value = 6 }, + { .description = "DMA 7", .value = 7 }, + { .description = "" } }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on @@ -3771,39 +3764,35 @@ static const device_config_t xga_isa_configuration[] = { static const device_config_t xga_inmos_isa_configuration[] = { // clang-format off { - .name = "type", - .description = "XGA type", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { - .description = "XGA-1", - .value = 0 - }, - { - .description = "XGA-2", - .value = 1 - }, - { .description = "" } - } - }, - { - .name = "dma", - .description = "DMA", - .type = CONFIG_SELECTION, - .default_string = "", - .default_int = 7, - .file_filter = "", - .spinner = { 0 }, - .selection = { - { .description = "Disabled", .value = 0 }, - { .description = "DMA 6", .value = 6 }, - { .description = "DMA 7", .value = 7 }, + .name = "type", + .description = "XGA type", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "XGA-1", .value = 0 }, + { .description = "XGA-2", .value = 1 }, { .description = "" } }, + .bios = { { 0 } } + }, + { + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 7, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "DMA 6", .value = 6 }, + { .description = "DMA 7", .value = 7 }, + { .description = "" } + }, + .bios = { { 0 } } }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on