From 0b09681c468826942dc1d5a024100280e71bb270 Mon Sep 17 00:00:00 2001 From: win2kgamer <47463859+win2kgamer@users.noreply.github.com> Date: Sun, 5 Oct 2025 14:35:09 -0500 Subject: [PATCH 1/7] Add the Sony Vaio PCV-130/150 (#6282) * Add the Sony Vaio PCV-130/150 as a selectable BIOS for the AN430TX * Add Sony CDU-611 24x CD-ROM drive This may not have been the drive included in the Vaio PCV-130/150 but is contemporary, is the correct speed and satisfies the vendor-locked CD-ROM driver on the recovery CD. --- src/include/86box/cdrom.h | 1 + src/include/86box/machine.h | 5 ++- src/machine/m_at_socket7.c | 59 ++++++++++++++++++++---- src/machine/machine_table.c | 90 ++++++++++++++++++------------------- 4 files changed, 100 insertions(+), 55 deletions(-) diff --git a/src/include/86box/cdrom.h b/src/include/86box/cdrom.h index 85e5a0f0b..3fcf278af 100644 --- a/src/include/86box/cdrom.h +++ b/src/include/86box/cdrom.h @@ -174,6 +174,7 @@ static const struct cdrom_drive_types_s { { "PHILIPS", "CD-ROM PCA403CD", "U31P", "philips_403", BUS_TYPE_IDE, 0, 40, 36, 0, 0, { 4, 2, 2, -1 } }, { "SONY", "CD-ROM CDU76", "1.0i", "sony_76", BUS_TYPE_IDE, 0, 4, 36, 0, 0, { 2, -1, -1, -1 } }, { "SONY", "CD-ROM CDU311", "3.0h", "sony_311", BUS_TYPE_IDE, 0, 8, 36, 0, 0, { 3, 2, 1, -1 } }, + { "SONY", "CD-ROM CDU611", "2.2c", "sony_611", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 3, 2, 2, -1 } }, { "SONY", "CD-ROM CDU5225", "NYS4", "sony_5225", BUS_TYPE_IDE, 0, 52, 36, 0, 0, { 4, 2, 2, 4 } }, { "TEAC", "CD-516E", "1.0G", "teac_516e", BUS_TYPE_IDE, 0, 16, 36, 0, 0, { 3, 2, 2, -1 } }, { "TEAC", "CD-524EA", "3.0D", "teac_524ea", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 3, 2, 2, -1 } }, diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 7c4f9f653..ab4cfaebd 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -1043,10 +1043,13 @@ extern int machine_at_tx97_init(const machine_t *); extern void machine_at_optiplex_21152_init(void); extern int machine_at_optiplexgn_init(const machine_t *); extern int machine_at_tomahawk_init(const machine_t *); +#ifdef EMU_DEVICE_H +extern const device_t an430tx_device; +#endif +extern int machine_at_an430tx_init(const machine_t *); extern int machine_at_ym430tx_init(const machine_t *); extern int machine_at_thunderbolt_init(const machine_t *); extern int machine_at_ma23c_init(const machine_t *); -extern int machine_at_an430tx_init(const machine_t *); extern int machine_at_mb540n_init(const machine_t *); extern int machine_at_56a5_init(const machine_t *); extern int machine_at_p5mms98_init(const machine_t *); diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 75f94f82e..cfe615551 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -1419,21 +1419,62 @@ machine_at_ma23c_init(const machine_t *model) return ret; } +static const device_config_t an430tx_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "an430tx", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .bios = { + { .name = "Packard Bell PB79x", .internal_name = "an430tx", .bios_type = BIOS_NORMAL, + .files_no = 5, .local = 0, .size = 262144, .files = { "roms/machines/an430tx/ANP0911A.BIO", "roms/machines/an430tx/ANP0911A.BI1", + "roms/machines/an430tx/ANP0911A.BI2", "roms/machines/an430tx/ANP0911A.BI3", + "roms/machines/an430tx/ANP0911A.RCV", "" } }, + { .name = "Sony Vaio PCV-130/150", .internal_name = "vaio150", .bios_type = BIOS_NORMAL, + .files_no = 5, .local = 0, .size = 262144, .files = { "roms/machines/an430tx/P02-0011.BIO", "roms/machines/an430tx/P02-0011.BI1", + "roms/machines/an430tx/P02-0011.BI2", "roms/machines/an430tx/P02-0011.BI3", + "roms/machines/an430tx/P02-0011.RCV", "" } }, + { .files_no = 0 } + }, + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t an430tx_device = { + .name = "Intel AN430TX (Anchorage)", + .internal_name = "an430tx_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = an430tx_config +}; + int machine_at_an430tx_init(const machine_t *model) { - int ret; + int ret = 0; + const char* fn[5]; - ret = bios_load_linear_combined2("roms/machines/an430tx/ANP0911A.BIO", - "roms/machines/an430tx/ANP0911A.BI1", - "roms/machines/an430tx/ANP0911A.BI2", - "roms/machines/an430tx/ANP0911A.BI3", - "roms/machines/an430tx/ANP0911A.RCV", - 0x3a000, 160); - - if (bios_only || !ret) + /* No ROMs available */ + if (!device_available(model->device)) return ret; + device_context(model->device); + for (int i = 0; i < 5; i++) + fn[i] = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), i); + ret = bios_load_linear_combined2(fn[0], fn[1], fn[2], fn[3], fn[4], 0x3a000, 160); + device_context_restore(); + machine_at_common_init_ex(model, 2); pci_init(PCI_CONFIG_TYPE_1); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 5264b1cf8..9bd5e771f 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -15508,6 +15508,51 @@ const machine_t machines[] = { .snd_device = &cs4236b_device, .net_device = &pcnet_am79c973_onboard_device }, + /* This has the Phoenix MultiKey KBC firmware on the NSC Super I/O chip. */ + { + .name = "[i430TX] Intel AN430TX (Anchorage)", + .internal_name = "an430tx", + .type = MACHINE_TYPE_SOCKET7, + .chipset = MACHINE_CHIPSET_INTEL_430TX, + .init = machine_at_an430tx_init, + .p1_handler = machine_generic_p1_handler, + .gpio_handler = NULL, + .available_flag = MACHINE_AVAILABLE, + .gpio_acpi_handler = NULL, + .cpu = { + .package = CPU_PKG_SOCKET5_7, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_K6, CPU_K6_2, CPU_K6_2C, CPU_K6_3, CPU_K6_2P, + CPU_K6_3P, CPU_Cx6x86, CPU_Cx6x86MX, CPU_Cx6x86L), + .min_bus = 60000000, + .max_bus = 66666667, + .min_voltage = 2800, + .max_voltage = 3520, + .min_multi = 1.5, + .max_multi = 3.5 + }, + .bus_flags = MACHINE_PS2_PCI, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI | MACHINE_SOUND | MACHINE_GAMEPORT, /* Machine has internal video: ATI Mach64GT-B 3D Rage II */ + .ram = { + .min = 8192, + .max = 262144, + .step = 8192 + }, + .nvrmask = 255, + .jumpered_ecp_dma = 0, + .default_jumpered_ecp_dma = -1, + .kbc_device = NULL, + .kbc_params = 0x00000000, + .kbc_p1 = 0x000044f0, + .gpio = 0xffffffff, + .gpio_acpi = 0xffffffff, + .device = &an430tx_device, + .kbd_device = NULL, + .fdc_device = NULL, + .sio_device = NULL, + .vid_device = NULL, + .snd_device = &ymf715_onboard_device, + .net_device = NULL + }, /* This has the Winbond W83977 Super I/O Chip with AMIKey-2 KBC firmware, which is type 'H'. */ { .name = "[i430TX] Intel YM430TX (Yamamoto)", @@ -15649,51 +15694,6 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, - /* This has the Phoenix MultiKey KBC firmware on the NSC Super I/O chip. */ - { - .name = "[i430TX] Packard Bell PB790", - .internal_name = "an430tx", - .type = MACHINE_TYPE_SOCKET7, - .chipset = MACHINE_CHIPSET_INTEL_430TX, - .init = machine_at_an430tx_init, - .p1_handler = machine_generic_p1_handler, - .gpio_handler = NULL, - .available_flag = MACHINE_AVAILABLE, - .gpio_acpi_handler = NULL, - .cpu = { - .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_K6, CPU_K6_2, CPU_K6_2C, CPU_K6_3, CPU_K6_2P, - CPU_K6_3P, CPU_Cx6x86, CPU_Cx6x86MX, CPU_Cx6x86L), - .min_bus = 60000000, - .max_bus = 66666667, - .min_voltage = 2800, - .max_voltage = 3520, - .min_multi = 1.5, - .max_multi = 3.5 - }, - .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI | MACHINE_SOUND | MACHINE_GAMEPORT, /* Machine has internal video: ATI Mach64GT-B 3D Rage II */ - .ram = { - .min = 8192, - .max = 262144, - .step = 8192 - }, - .nvrmask = 255, - .jumpered_ecp_dma = 0, - .default_jumpered_ecp_dma = -1, - .kbc_device = NULL, - .kbc_params = 0x00000000, - .kbc_p1 = 0x000044f0, - .gpio = 0xffffffff, - .gpio_acpi = 0xffffffff, - .device = NULL, - .kbd_device = NULL, - .fdc_device = NULL, - .sio_device = NULL, - .vid_device = NULL, - .snd_device = &ymf715_onboard_device, - .net_device = NULL - }, /* The BIOS sends KBC command BB and expects it to output a byte, which is AMI KBC behavior. A picture shows a VIA VT82C42N KBC though, so it could be a case of that KBC with AMI firmware. */ { From 774a1a7f08b1120a9ae74df4be100f0aeb87506d Mon Sep 17 00:00:00 2001 From: Verloren50000 <110334428+Verloren50000@users.noreply.github.com> Date: Mon, 6 Oct 2025 09:26:58 +0800 Subject: [PATCH 2/7] Add the MSI MS-6147 Machine (#6270) * machine.h: MSI MS-6147 added. * m_at_slot1.c: MSI MS-6147 added. * machine_table.c: MSI MS-6147 added. --- src/include/86box/machine.h | 4 ++ src/machine/m_at_slot1.c | 90 +++++++++++++++++++++++++++++++++++++ src/machine/machine_table.c | 44 ++++++++++++++++++ 3 files changed, 138 insertions(+) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index ab4cfaebd..fadd19f7f 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -1167,6 +1167,10 @@ extern int machine_at_ga686_init(const machine_t *); extern const device_t ms6119_device; #endif extern int machine_at_ms6119_init(const machine_t *); +#ifdef EMU_DEVICE_H +extern const device_t ms6147_device; +#endif +extern int machine_at_ms6147_init(const machine_t *); extern int machine_at_p6sba_init(const machine_t *); extern int machine_at_s1846_init(const machine_t *); diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index c9fd9b6fb..995c943b9 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -800,6 +800,96 @@ machine_at_ms6119_init(const machine_t *model) return ret; } +static const device_config_t ms6147_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "ms6147", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { + { + .name = "Award Modular BIOS v4.51PG - Revision 1.8", + .internal_name = "ms6147", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 262144, + .files = { "roms/machines/ms6147/W647MS18.BIN", "" } + }, + { + .name = "Award Modular BIOS v4.51PG - Revision 2.1 (Packard Bell Tempest)", + .internal_name = "pbtempest", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 262144, + .files = { "roms/machines/ms6147/w647p221.pbc", "" } + }, + { .files_no = 0 } + } + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t ms6147_device = { + .name = "MSI MS-6147", + .internal_name = "ms6147_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ms6147_config +}; + +int +machine_at_ms6147_init(const machine_t *model) +{ + int ret = 0; + const char *fn; + + /* No ROMs available */ + if (!device_available(model->device)) + return ret; + + device_context(model->device); + fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), 0); + ret = bios_load_linear(fn, 0x000c0000, 262144, 0); + device_context_restore(); + + machine_at_common_init_ex(model, 2); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x14, PCI_CARD_SOUND, 3, 4, 1, 2); + pci_register_slot(0x0E, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); + pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); + device_add(&i440bx_device); + device_add(&piix4e_device); + device_add_params(&w83977_device, (void *) (W83977TF | W83977_AMI | W83977_NO_NVR)); + device_add(&winbond_flash_w29c020_device); + spd_register(SPD_TYPE_SDRAM, 0x7, 256); + + if (sound_card_current[0] == SOUND_INTERNAL) { + device_add(machine_get_snd_device(machine)); + device_add(&es1371_onboard_device); + } + + return ret; +} + int machine_at_p6sba_init(const machine_t *model) { diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 9bd5e771f..9b7b30354 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -18043,6 +18043,50 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ + { + .name = "[i440BX] MSI MS-6147", + .internal_name = "ms6147", + .type = MACHINE_TYPE_SLOT1, + .chipset = MACHINE_CHIPSET_INTEL_440BX, + .init = machine_at_ms6147_init, + .p1_handler = machine_generic_p1_handler, + .gpio_handler = NULL, + .available_flag = MACHINE_AVAILABLE, + .gpio_acpi_handler = NULL, + .cpu = { + .package = CPU_PKG_SLOT1, + .block = CPU_BLOCK_NONE, + .min_bus = 66666667, + .max_bus = 116666667, + .min_voltage = 1800, + .max_voltage = 3500, + .min_multi = 1.5, + .max_multi = 8.0 + }, + .bus_flags = MACHINE_PS2_AGP | MACHINE_BUS_USB, /* Has internal video: ATI 3D Rage Pro PCI */ + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI | MACHINE_GAMEPORT | MACHINE_USB, + .ram = { + .min = 8192, + .max = 524288, + .step = 8192 + }, + .nvrmask = 255, + .jumpered_ecp_dma = 0, + .default_jumpered_ecp_dma = -1, + .kbc_device = NULL, + .kbc_params = 0x00000000, + .kbc_p1 = 0x00000cf0, + .gpio = 0xffffffff, + .gpio_acpi = 0xffffffff, + .device = &ms6147_device, + .kbd_device = NULL, + .fdc_device = NULL, + .sio_device = NULL, + .vid_device = NULL, + .snd_device = &es1371_onboard_device, + .net_device = NULL + }, /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ { From 39b249fedfb4051f4a2d78d92af40f4631b7c027 Mon Sep 17 00:00:00 2001 From: bozoscum Date: Mon, 6 Oct 2025 09:28:00 +0800 Subject: [PATCH 3/7] Some modifications for Multitech machines (#6258) * add alternative OEM model names for Multitech machines * add Multitech PC-700 BIOS 3.30 * add Multitech PC-900 / Commodore PC-40 BIOS v2.07a.xc * add Multitech PC-500+ BIOS 4.03 and 4.06 * correcting display name of Multitech BIOS 3.10 to 3.1 * merge with origin/master * fix github-advanced-security check error 'uninitialized local variable' * implement the Multitech onboard ISA RTC device --- src/device/isartc.c | 162 +++++++++++++++++++-- src/include/86box/machine.h | 9 ++ src/machine/m_at_286.c | 62 +++++++- src/machine/m_xt.c | 273 +++++++++++++++++++++++++++++++----- src/machine/machine_table.c | 12 +- 5 files changed, 457 insertions(+), 61 deletions(-) diff --git a/src/device/isartc.c b/src/device/isartc.c index 06b7767c8..bdf057b4b 100644 --- a/src/device/isartc.c +++ b/src/device/isartc.c @@ -82,13 +82,14 @@ #include <86box/pic.h> #include <86box/isartc.h> -#define ISARTC_EV170 0 -#define ISARTC_DTK 1 -#define ISARTC_P5PAK 2 -#define ISARTC_A6PAK 3 -#define ISARTC_VENDEX 4 -#define ISARTC_MPLUS2 5 -#define ISARTC_MM58167 10 +#define ISARTC_EV170 0 +#define ISARTC_DTK 1 +#define ISARTC_P5PAK 2 +#define ISARTC_A6PAK 3 +#define ISARTC_VENDEX 4 +#define ISARTC_MPLUS2 5 +#define ISARTC_RTC58167 6 +#define ISARTC_MM58167 10 #define ISARTC_ROM_MM58167_1 "roms/rtc/glatick/GLaTICK_0.8.8_NS_86B.ROM" /* Generic 58167, AST or EV-170 */ #define ISARTC_ROM_MM58167_2 "roms/rtc/glatick/GLaTICK_0.8.8_NS_86B2.ROM" /* PII-147 */ @@ -509,6 +510,73 @@ mm67_write(uint16_t port, uint8_t val, void *priv) } } +/* Multitech PC-500/PC-500+ onboard RTC 58167 device disigned to use I/O port + * base+0 as register index and base+1 as register data read/write window, + * according to the official RTC utilities SDATE.EXE, STIME.EXE, and TODAY.EXE + * + * the RTC utilities check the RTC millisecond counter first to deteminate the + * presence of the RTC 58167 IC, so here implement the bogus_msec to fool them + */ +static uint8_t rtc58167_index = 0x00; + +static uint8_t +rtc58167_read(uint16_t port, void *priv) +{ + uint8_t ret = 0xff; + uint16_t bogus_msec = (uint16_t)((tsc * 1000) / cpu_s->rspeed); + + switch (port) + { + case 0x2c0: + case 0x300: + ret = rtc58167_index; + break; + + case 0x2c1: + case 0x301: + switch (rtc58167_index) + { + case MM67_MSEC: + ret = (uint8_t)(bogus_msec % 10) << 4; + break; + + case MM67_HUNTEN: + ret = RTC_BCD((uint8_t)((bogus_msec / 10) % 100)); + break; + + default: + ret = mm67_read(((port - 1) + rtc58167_index), priv); + break; + } + break; + + default: + break; + } + + return ret; +} + +static void +rtc58167_write(uint16_t port, uint8_t val, void *priv) +{ + switch (port) + { + case 0x2c0: + case 0x300: + rtc58167_index = val; + break; + + case 0x2c1: + case 0x301: + mm67_write(((port - 1) + rtc58167_index), val, priv); + break; + + default: + break; + } +} + /************************************************************************ * * * Generic code for all supported chips. * @@ -594,6 +662,19 @@ isartc_init(const device_t *info) dev->year = MM67_AL_DOM; /* year, NON STANDARD */ break; + case ISARTC_RTC58167: /* Multitech PC-500/PC-500+ onboard RTC */ + dev->flags |= FLAG_YEARBCD; + dev->base_addr = device_get_config_hex16("base"); + dev->base_addrsz = 8; + dev->irq = device_get_config_int("irq"); + dev->f_rd = rtc58167_read; + dev->f_wr = rtc58167_write; + dev->nvr.reset = mm67_reset; + dev->nvr.start = mm67_start; + dev->nvr.tick = mm67_tick; + dev->year = MM67_AL_HUNTEN; /* year, NON STANDARD */ + break; + default: break; } @@ -929,18 +1010,69 @@ const device_t vendex_xt_rtc_onboard_device = { .config = NULL }; +static const device_config_t rtc58167_config[] = { + // clang-format off + { + .name = "irq", + .description = "IRQ2", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = -1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = -1 }, + { .description = "Enabled", .value = 2 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x2C0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "2C0H", .value = 0x2c0 }, + { .description = "300H", .value = 0x300 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + { .name = "", .description = "", .type = CONFIG_END} + // clang-format on +}; + +const device_t rtc58167_device = { + .name = "RTC 58167 IC (Multitech)", + .internal_name = "rtc58167_xt_rtc", + .flags = DEVICE_ISA, + .local = ISARTC_RTC58167, + .init = isartc_init, + .close = isartc_close, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = rtc58167_config +}; + static const struct { const device_t *dev; } boards[] = { // clang-format off - { &device_none }, - { &ev170_device }, - { &pii147_device }, - { &p5pak_device }, - { &a6pak_device }, - { &mplus2_device }, - { &mm58167_device }, - { NULL } + { &device_none }, + { &ev170_device }, + { &pii147_device }, + { &p5pak_device }, + { &a6pak_device }, + { &mplus2_device }, + //{ &rtc58167_device }, /* Multitech onboard ISA RTC */ + { &mm58167_device }, + { NULL } // clang-format on }; diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index fadd19f7f..98d9fbd45 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -496,6 +496,9 @@ extern int machine_at_portableii_init(const machine_t *); extern int machine_at_portableiii_init(const machine_t *); extern int machine_at_grid1520_init(const machine_t *); extern int machine_at_pc900_init(const machine_t *); +#ifdef EMU_DEVICE_H +extern const device_t pc900_device; +#endif extern int machine_at_mr286_init(const machine_t *); extern int machine_at_pc8_init(const machine_t *); extern int machine_at_m290_init(const machine_t *); @@ -1361,7 +1364,13 @@ extern int machine_xt_micoms_xl7turbo_init(const machine_t *); extern const device_t pc500_device; #endif extern int machine_xt_pc500_init(const machine_t *); +#ifdef EMU_DEVICE_H +extern const device_t pc500plus_device; +#endif extern int machine_xt_pc500plus_init(const machine_t *); +#ifdef EMU_DEVICE_H +extern const device_t pc700_device; +#endif extern int machine_xt_pc700_init(const machine_t *); extern int machine_xt_pc4i_init(const machine_t *); extern int machine_xt_openxt_init(const machine_t *); diff --git a/src/machine/m_at_286.c b/src/machine/m_at_286.c index 7f6442940..20baec312 100644 --- a/src/machine/m_at_286.c +++ b/src/machine/m_at_286.c @@ -339,13 +339,69 @@ machine_at_grid1520_init(const machine_t *model) return ret; } +static const device_config_t pc900_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "pc900_v207a", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .bios = { + { + .name = "BIOS V2.07A", + .internal_name = "pc900_v207a", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 32768, + .files = { "roms/machines/pc900/mpf_pc900_v207a.bin", "" } + }, + { + .name = "BIOS V2.07A.XC", + .internal_name = "pc900_v207a_xc", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 32768, + .files = { "roms/machines/pc900/cbm_pc40_v207a_xc.bin", "" } + } + }, + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t pc900_device = { + .name = "Multitech PC-900", + .internal_name = "pc900", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pc900_config +}; + int machine_at_pc900_init(const machine_t *model) { - int ret = 0; + int ret = 0; + const char *fn; - ret = bios_load_linear("roms/machines/pc900/mpf_pc900_v207a.bin", - 0x000f8000, 32768, 0); + /* No ROMs available. */ + if (!device_available(model->device)) + return ret; + + device_context(model->device); + fn = device_get_bios_file(model->device, device_get_config_bios("bios"), 0); + ret = bios_load_linear(fn, 0x000f8000, 32768, 0); + device_context_restore(); if (bios_only || !ret) return ret; diff --git a/src/machine/m_xt.c b/src/machine/m_xt.c index c59b4ef37..550d336a2 100644 --- a/src/machine/m_xt.c +++ b/src/machine/m_xt.c @@ -46,6 +46,7 @@ #include <86box/video.h> extern const device_t vendex_xt_rtc_onboard_device; +extern const device_t rtc58167_device; /* 8088 */ static void @@ -1171,7 +1172,7 @@ static const device_config_t pc500_config[] = { .files = { "roms/machines/pc500/rom330.bin", "" } }, { - .name = "3.10", + .name = "3.1", .internal_name = "pc500_310", .bios_type = BIOS_NORMAL, .files_no = 1, @@ -1182,6 +1183,37 @@ static const device_config_t pc500_config[] = { { .files_no = 0 } } }, + { + .name = "rtc_irq", + .description = "RTC IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = -1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = -1 }, + { .description = "Enabled", .value = 2 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + { + .name = "rtc_port", + .description = "RTC Port Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "2C0H", .value = 0x2c0 }, + { .description = "300H", .value = 0x300 }, + { .description = "" } + }, + .bios = { { 0 } } + }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -1202,6 +1234,209 @@ const device_t pc500_device = { int machine_xt_pc500_init(const machine_t *model) +{ + int ret = 0; + int rtc_irq = -1; + int rtc_port = 0; + const char *fn; + + /* No ROMs available. */ + if (!device_available(model->device)) + return ret; + + device_context(model->device); + rtc_irq = machine_get_config_int("rtc_irq"); + rtc_port = machine_get_config_int("rtc_port"); + fn = device_get_bios_file(model->device, device_get_config_bios("bios"), 0); + ret = bios_load_linear(fn, 0x000fe000, 8192, 0); + device_context_restore(); + + if (bios_only || !ret) + return ret; + + device_add(&kbc_pc_device); + + machine_xt_common_init(model, 0); + + if (rtc_port != 0) + device_add(&rtc58167_device); + + return ret; +} + +static const device_config_t pc500plus_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "pc500plus_404", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .bios = { + { + .name = "4.06", + .internal_name = "pc500plus_406", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 16384, + .files = { "roms/machines/pc500/rom406.bin", "" } + }, + { + .name = "4.04", + .internal_name = "pc500plus_404", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 16384, + .files = { "roms/machines/pc500/rom404.bin", "" } + }, + { + .name = "4.03", + .internal_name = "pc500plus_403", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 16384, + .files = { "roms/machines/pc500/rom403.bin", "" } + }, + { .files_no = 0 } + }, + }, + { + .name = "rtc_irq", + .description = "RTC IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = -1, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = -1 }, + { .description = "Enabled", .value = 2 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + { + .name = "rtc_port", + .description = "Onboard RTC", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "Enabled", .value = 0x2c0 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t pc500plus_device = { + .name = "Multitech PC-500 plus", + .internal_name = "pc500plus_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pc500plus_config +}; + +int +machine_xt_pc500plus_init(const machine_t *model) +{ + int ret = 0; + int rtc_irq = -1; + int rtc_port = 0; + const char *fn; + + /* No ROMs available. */ + if (!device_available(model->device)) + return ret; + + device_context(model->device); + rtc_irq = machine_get_config_int("rtc_irq"); + rtc_port = machine_get_config_int("rtc_port"); + fn = device_get_bios_file(model->device, device_get_config_bios("bios"), 0); + ret = bios_load_linear(fn, 0x000fc000, 16384, 0); + device_context_restore(); + + if (bios_only || !ret) + return ret; + + device_add(&kbc_pc_device); + + machine_xt_common_init(model, 0); + + if (rtc_port != 0) + device_add(&rtc58167_device); + + return ret; +} + +static const device_config_t pc700_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "pc700_330", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .bios = { + { + .name = "3.30", + .internal_name = "pc700_330", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 8192, + .files = { "roms/machines/pc700/multitech pc-700 3.30.bin", "" } + }, + { + .name = "3.1", + .internal_name = "pc700_31", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 8192, + .files = { "roms/machines/pc700/multitech pc-700 3.1.bin", "" } + }, + { .files_no = 0 } + }, + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t pc700_device = { + .name = "Multitech PC-700", + .internal_name = "pc700_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pc700_config +}; + +int +machine_xt_pc700_init(const machine_t *model) { int ret = 0; const char *fn; @@ -1225,42 +1460,6 @@ machine_xt_pc500_init(const machine_t *model) return ret; } -int -machine_xt_pc500plus_init(const machine_t *model) -{ - int ret; - - ret = bios_load_linear("roms/machines/pc500/rom404.bin", - 0x000fc000, 16384, 0); - - if (bios_only || !ret) - return ret; - - device_add(&kbc_pc_device); - - machine_xt_common_init(model, 0); - - return ret; -} - -int -machine_xt_pc700_init(const machine_t *model) -{ - int ret; - - ret = bios_load_linear("roms/machines/pc700/multitech pc-700 3.1.bin", - 0x000fe000, 8192, 0); - - if (bios_only || !ret) - return ret; - - device_add(&kbc_pc_device); - - machine_xt_common_init(model, 0); - - return ret; -} - int machine_xt_pc4i_init(const machine_t *model) { diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 9b7b30354..f0672a743 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -1097,7 +1097,7 @@ const machine_t machines[] = { .net_device = NULL }, { - .name = "[8088] Multitech PC-500", + .name = "[8088] Multitech PC-500 / Franklin PC 8000", .internal_name = "pc500", .type = MACHINE_TYPE_8088, .chipset = MACHINE_CHIPSET_DISCRETE, @@ -1174,7 +1174,7 @@ const machine_t machines[] = { .kbc_p1 = 0xff, .gpio = 0xffffffff, .gpio_acpi = 0xffffffff, - .device = NULL, + .device = &pc500plus_device, .kbd_device = &keyboard_pc_xt_device, .fdc_device = NULL, .sio_device = NULL, @@ -1183,7 +1183,7 @@ const machine_t machines[] = { .net_device = NULL }, { - .name = "[8088] Multitech PC-700", + .name = "[8088] Multitech PC-700 / Siemens SICOMP PC 16 05", .internal_name = "pc700", .type = MACHINE_TYPE_8088, .chipset = MACHINE_CHIPSET_DISCRETE, @@ -1217,7 +1217,7 @@ const machine_t machines[] = { .kbc_p1 = 0xff, .gpio = 0xffffffff, .gpio_acpi = 0xffffffff, - .device = NULL, + .device = &pc700_device, .kbd_device = &keyboard_pc_xt_device, .fdc_device = NULL, .sio_device = NULL, @@ -3346,7 +3346,7 @@ const machine_t machines[] = { }, /* Has IBM AT KBC firmware. */ { - .name = "[ISA] Multitech PC-900", + .name = "[ISA] Multitech PC-900 / Commodore PC 40 / NBI 4200", .internal_name = "pc900", .type = MACHINE_TYPE_286, .chipset = MACHINE_CHIPSET_DISCRETE, @@ -3380,7 +3380,7 @@ const machine_t machines[] = { .kbc_p1 = 0x000004f0, .gpio = 0xffffffff, .gpio_acpi = 0xffffffff, - .device = NULL, + .device = &pc900_device, .kbd_device = NULL, .fdc_device = NULL, .sio_device = NULL, From 2193938266bf41a4df104bf47bea94ce2f61568f Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 5 Oct 2025 23:49:16 -0400 Subject: [PATCH 4/7] A little more progress towards dual gameport support (#6284) --- src/config.c | 30 ++++--- src/game/joystick_ch_flightstick_pro.c | 43 +++++---- src/game/joystick_standard.c | 120 ++++++++++++++----------- src/game/joystick_sw_pad.c | 24 +++-- src/game/joystick_tm_fcs.c | 51 ++++++----- 5 files changed, 153 insertions(+), 115 deletions(-) diff --git a/src/config.c b/src/config.c index 102f9de97..a06d9e8b4 100644 --- a/src/config.c +++ b/src/config.c @@ -639,25 +639,27 @@ load_input_devices(void) } else joystick_type[joy_insn] = JS_TYPE_NONE; + uint8_t gp = 0; + for (int js = 0; js < joystick_get_max_joysticks(joystick_type[joy_insn]); js++) { sprintf(temp, "joystick_%i_nr", js); - joystick_state[0][js].plat_joystick_nr = ini_section_get_int(cat, temp, 0); + joystick_state[gp][js].plat_joystick_nr = ini_section_get_int(cat, temp, 0); - if (joystick_state[0][js].plat_joystick_nr) { + if (joystick_state[gp][js].plat_joystick_nr) { for (int axis_nr = 0; axis_nr < joystick_get_axis_count(joystick_type[joy_insn]); axis_nr++) { sprintf(temp, "joystick_%i_axis_%i", js, axis_nr); - joystick_state[0][js].axis_mapping[axis_nr] = ini_section_get_int(cat, temp, axis_nr); + joystick_state[gp][js].axis_mapping[axis_nr] = ini_section_get_int(cat, temp, axis_nr); } for (int button_nr = 0; button_nr < joystick_get_button_count(joystick_type[joy_insn]); button_nr++) { sprintf(temp, "joystick_%i_button_%i", js, button_nr); - joystick_state[0][js].button_mapping[button_nr] = ini_section_get_int(cat, temp, button_nr); + joystick_state[gp][js].button_mapping[button_nr] = ini_section_get_int(cat, temp, button_nr); } for (int pov_nr = 0; pov_nr < joystick_get_pov_count(joystick_type[joy_insn]); pov_nr++) { sprintf(temp, "joystick_%i_pov_%i", js, pov_nr); p = ini_section_get_string(cat, temp, "0, 0"); - joystick_state[0][js].pov_mapping[pov_nr][0] = joystick_state[0][js].pov_mapping[pov_nr][1] = 0; - sscanf(p, "%i, %i", &joystick_state[0][js].pov_mapping[pov_nr][0], - &joystick_state[0][js].pov_mapping[pov_nr][1]); + joystick_state[gp][js].pov_mapping[pov_nr][0] = joystick_state[gp][js].pov_mapping[pov_nr][1] = 0; + sscanf(p, "%i, %i", &joystick_state[gp][js].pov_mapping[pov_nr][0], + &joystick_state[gp][js].pov_mapping[pov_nr][1]); } } } @@ -2728,25 +2730,27 @@ save_input_devices(void) } } } else { + uint8_t gp = 0; + ini_section_set_string(cat, "joystick_type", joystick_get_internal_name(joystick_type[joy_insn])); for (int js = 0; js < joystick_get_max_joysticks(joystick_type[joy_insn]); js++) { sprintf(tmp2, "joystick_%i_nr", js); - ini_section_set_int(cat, tmp2, joystick_state[0][js].plat_joystick_nr); + ini_section_set_int(cat, tmp2, joystick_state[gp][js].plat_joystick_nr); - if (joystick_state[0][js].plat_joystick_nr) { + if (joystick_state[gp][js].plat_joystick_nr) { for (int axis_nr = 0; axis_nr < joystick_get_axis_count(joystick_type[joy_insn]); axis_nr++) { sprintf(tmp2, "joystick_%i_axis_%i", js, axis_nr); - ini_section_set_int(cat, tmp2, joystick_state[0][js].axis_mapping[axis_nr]); + ini_section_set_int(cat, tmp2, joystick_state[gp][js].axis_mapping[axis_nr]); } for (int button_nr = 0; button_nr < joystick_get_button_count(joystick_type[joy_insn]); button_nr++) { sprintf(tmp2, "joystick_%i_button_%i", js, button_nr); - ini_section_set_int(cat, tmp2, joystick_state[0][js].button_mapping[button_nr]); + ini_section_set_int(cat, tmp2, joystick_state[gp][js].button_mapping[button_nr]); } for (int pov_nr = 0; pov_nr < joystick_get_pov_count(joystick_type[joy_insn]); pov_nr++) { sprintf(tmp2, "joystick_%i_pov_%i", js, pov_nr); - sprintf(temp, "%i, %i", joystick_state[0][js].pov_mapping[pov_nr][0], - joystick_state[0][js].pov_mapping[pov_nr][1]); + sprintf(temp, "%i, %i", joystick_state[gp][js].pov_mapping[pov_nr][0], + joystick_state[gp][js].pov_mapping[pov_nr][1]); ini_section_set_string(cat, tmp2, temp); } } diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index b3d4e0ef5..834aa8a99 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -58,25 +58,26 @@ ch_flightstick_pro_close(UNUSED(void *priv)) static uint8_t ch_flightstick_pro_read(UNUSED(void *priv)) { + uint8_t gp = 0; uint8_t ret = 0xf0; - if (JOYSTICK_PRESENT(0, 0)) { - if (joystick_state[0][0].button[0]) + if (JOYSTICK_PRESENT(gp, 0)) { + if (joystick_state[gp][0].button[0]) ret &= ~0x10; - if (joystick_state[0][0].button[1]) + if (joystick_state[gp][0].button[1]) ret &= ~0x20; - if (joystick_state[0][0].button[2]) + if (joystick_state[gp][0].button[2]) ret &= ~0x40; - if (joystick_state[0][0].button[3]) + if (joystick_state[gp][0].button[3]) ret &= ~0x80; - if (joystick_state[0][0].pov[0] != -1) { - if (joystick_state[0][0].pov[0] > 315 || joystick_state[0][0].pov[0] < 45) + if (joystick_state[gp][0].pov[0] != -1) { + if (joystick_state[gp][0].pov[0] > 315 || joystick_state[gp][0].pov[0] < 45) ret &= ~0xf0; - else if (joystick_state[0][0].pov[0] >= 45 && joystick_state[0][0].pov[0] < 135) + else if (joystick_state[gp][0].pov[0] >= 45 && joystick_state[gp][0].pov[0] < 135) ret &= ~0xb0; - else if (joystick_state[0][0].pov[0] >= 135 && joystick_state[0][0].pov[0] < 225) + else if (joystick_state[gp][0].pov[0] >= 135 && joystick_state[gp][0].pov[0] < 225) ret &= ~0x70; - else if (joystick_state[0][0].pov[0] >= 225 && joystick_state[0][0].pov[0] < 315) + else if (joystick_state[gp][0].pov[0] >= 225 && joystick_state[gp][0].pov[0] < 315) ret &= ~0x30; } } @@ -93,18 +94,20 @@ ch_flightstick_pro_write(UNUSED(void *priv)) static int ch_flightstick_pro_read_axis(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: return 0; case 3: - return joystick_state[0][0].axis[2]; + return joystick_state[gp][0].axis[2]; default: return 0; } @@ -113,18 +116,20 @@ ch_flightstick_pro_read_axis(UNUSED(void *priv), int axis) static int ch_flightstick_pro_ch_pedals_read_axis(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: - return joystick_state[0][0].axis[3]; + return joystick_state[gp][0].axis[3]; case 3: - return joystick_state[0][0].axis[2]; + return joystick_state[gp][0].axis[2]; default: return 0; } diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index fa83826da..5e0268d6b 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -10,7 +10,6 @@ * * Authors: Miran Grca, * Sarah Walker, - * Miran Grca, * Jasmine Iwanek, * * Copyright 2016-2018 Miran Grca. @@ -61,19 +60,20 @@ joystick_standard_close(UNUSED(void *priv)) static uint8_t joystick_standard_read(UNUSED(void *priv)) { + uint8_t gp = 0; uint8_t ret = 0xf0; - if (JOYSTICK_PRESENT(0, 0)) { - if (joystick_state[0][0].button[0]) + if (JOYSTICK_PRESENT(gp, 0)) { + if (joystick_state[gp][0].button[0]) ret &= ~0x10; - if (joystick_state[0][0].button[1]) + if (joystick_state[gp][0].button[1]) ret &= ~0x20; } - if (JOYSTICK_PRESENT(0, 1)) { - if (joystick_state[0][1].button[0]) + if (JOYSTICK_PRESENT(gp, 1)) { + if (joystick_state[gp][1].button[0]) ret &= ~0x40; - if (joystick_state[0][1].button[1]) + if (joystick_state[gp][1].button[1]) ret &= ~0x80; } @@ -83,16 +83,17 @@ joystick_standard_read(UNUSED(void *priv)) static uint8_t joystick_standard_read_4button(UNUSED(void *priv)) { + uint8_t gp = 0; uint8_t ret = 0xf0; - if (JOYSTICK_PRESENT(0, 0)) { - if (joystick_state[0][0].button[0]) + if (JOYSTICK_PRESENT(gp, 0)) { + if (joystick_state[gp][0].button[0]) ret &= ~0x10; - if (joystick_state[0][0].button[1]) + if (joystick_state[gp][0].button[1]) ret &= ~0x20; - if (joystick_state[0][0].button[2]) + if (joystick_state[gp][0].button[2]) ret &= ~0x40; - if (joystick_state[0][0].button[3]) + if (joystick_state[gp][0].button[3]) ret &= ~0x80; } @@ -108,23 +109,25 @@ joystick_standard_write(UNUSED(void *priv)) static int joystick_standard_read_axis(UNUSED(void *priv), int axis) { + uint8_t gp = 0; + switch (axis) { case 0: - if (!JOYSTICK_PRESENT(0, 0)) + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - if (!JOYSTICK_PRESENT(0, 0)) + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: - if (!JOYSTICK_PRESENT(0, 1)) + if (!JOYSTICK_PRESENT(gp, 1)) return AXIS_NOT_PRESENT; - return joystick_state[0][1].axis[0]; + return joystick_state[gp][1].axis[0]; case 3: - if (!JOYSTICK_PRESENT(0, 1)) + if (!JOYSTICK_PRESENT(gp, 1)) return AXIS_NOT_PRESENT; - return joystick_state[0][1].axis[1]; + return joystick_state[gp][1].axis[1]; default: return 0; } @@ -133,14 +136,16 @@ joystick_standard_read_axis(UNUSED(void *priv), int axis) static int joystick_standard_read_axis_4button(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: case 3: default: @@ -153,24 +158,26 @@ joystick_standard_read_axis_4button(UNUSED(void *priv), int axis) static int joystick_standard_read_axis_with_pov(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: // X-axis - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: // Y-axis - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: // POV Hat (mapped to the 3rd logical axis, index 2) - if (joystick_state[0][0].pov[0] == -1) + if (joystick_state[gp][0].pov[0] == -1) return 32767; // Centered/No input (as per tm_fcs_rcs_read_axis example) - if (joystick_state[0][0].pov[0] > 315 || joystick_state[0][0].pov[0] < 45) + if (joystick_state[gp][0].pov[0] > 315 || joystick_state[gp][0].pov[0] < 45) return -32768; // Up - if (joystick_state[0][0].pov[0] >= 45 && joystick_state[0][0].pov[0] < 135) + if (joystick_state[gp][0].pov[0] >= 45 && joystick_state[gp][0].pov[0] < 135) return -16384; // Up-Right (example value, matches tm_fcs_rcs_read_axis) - if (joystick_state[0][0].pov[0] >= 135 && joystick_state[0][0].pov[0] < 225) + if (joystick_state[gp][0].pov[0] >= 135 && joystick_state[gp][0].pov[0] < 225) return 0; // Right/Left (example, matches tm_fcs_rcs_read_axis) - if (joystick_state[0][0].pov[0] >= 225 && joystick_state[0][0].pov[0] < 315) + if (joystick_state[gp][0].pov[0] >= 225 && joystick_state[gp][0].pov[0] < 315) return 16384; // Down-Left (example value, matches tm_fcs_rcs_read_axis) return 0; // Fallback case 3: // This case might be used for a Z-axis if present, or can return 0 if not. @@ -185,16 +192,19 @@ joystick_standard_read_axis_with_pov(UNUSED(void *priv), int axis) static int joystick_standard_read_axis_3axis(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + uint8_t js = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: - return joystick_state[0][0].axis[2]; + return joystick_state[gp][0].axis[2]; case 3: default: return 0; @@ -204,18 +214,20 @@ joystick_standard_read_axis_3axis(UNUSED(void *priv), int axis) static int joystick_standard_read_axis_4axis(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: - return joystick_state[0][0].axis[2]; + return joystick_state[gp][0].axis[2]; case 3: - return joystick_state[0][0].axis[3]; + return joystick_state[gp][0].axis[3]; default: return 0; } @@ -224,18 +236,20 @@ joystick_standard_read_axis_4axis(UNUSED(void *priv), int axis) static int joystick_standard_read_axis_6button(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: - return joystick_state[0][0].button[4] ? -32767 : 32768; + return joystick_state[gp][0].button[4] ? -32767 : 32768; case 3: - return joystick_state[0][0].button[5] ? -32767 : 32768; + return joystick_state[gp][0].button[5] ? -32767 : 32768; default: return 0; } @@ -243,24 +257,26 @@ joystick_standard_read_axis_6button(UNUSED(void *priv), int axis) static int joystick_standard_read_axis_8button(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: - if (joystick_state[0][0].button[4]) + if (joystick_state[gp][0].button[4]) return -32767; - if (joystick_state[0][0].button[6]) + if (joystick_state[gp][0].button[6]) return 32768; return 0; case 3: - if (joystick_state[0][0].button[5]) + if (joystick_state[gp][0].button[5]) return -32767; - if (joystick_state[0][0].button[7]) + if (joystick_state[gp][0].button[7]) return 32768; return 0; default: diff --git a/src/game/joystick_sw_pad.c b/src/game/joystick_sw_pad.c index 7c1d4910b..c0d280de1 100644 --- a/src/game/joystick_sw_pad.c +++ b/src/game/joystick_sw_pad.c @@ -31,9 +31,11 @@ * * Authors: Miran Grca, * Sarah Walker, + * Jasmine Iwanek, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. + * Copyright 2021-2025 Jasmine Iwanek. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -136,10 +138,11 @@ sw_close(void *priv) static uint8_t sw_read(void *priv) { + uint8_t gp = 0; sw_data *sw = (sw_data *) priv; uint8_t temp = 0; - if (!JOYSTICK_PRESENT(0, 0)) + if (!JOYSTICK_PRESENT(gp, 0)) return 0xff; if (timer_is_enabled(&sw->poll_timer)) { @@ -162,10 +165,11 @@ sw_read(void *priv) static void sw_write(void *priv) { + uint8_t gp = 0; sw_data *sw = (sw_data *) priv; int64_t time_since_last = timer_get_remaining_us(&sw->trigger_timer); - if (!JOYSTICK_PRESENT(0, 0)) + if (!JOYSTICK_PRESENT(gp, 0)) return; if (!sw->poll_left) { @@ -191,20 +195,20 @@ sw_write(void *priv) for (uint8_t js = 0; js < 4; js++) { uint16_t data = 0x3fff; - if (!JOYSTICK_PRESENT(0, js)) + if (!JOYSTICK_PRESENT(gp, js)) break; - if (joystick_state[0][js].axis[1] < -16383) + if (joystick_state[gp][js].axis[1] < -16383) data &= ~1; - if (joystick_state[0][js].axis[1] > 16383) + if (joystick_state[gp][js].axis[1] > 16383) data &= ~2; - if (joystick_state[0][js].axis[0] > 16383) + if (joystick_state[gp][js].axis[0] > 16383) data &= ~4; - if (joystick_state[0][js].axis[0] < -16383) + if (joystick_state[gp][js].axis[0] < -16383) data &= ~8; for (uint8_t button_nr = 0; button_nr < 10; button_nr++) { - if (joystick_state[0][js].button[button_nr]) + if (joystick_state[gp][js].button[button_nr]) data &= ~(1 << (button_nr + 4)); } @@ -228,7 +232,9 @@ sw_write(void *priv) static int sw_read_axis(UNUSED(void *priv), UNUSED(int axis)) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; return 0; /*No analogue support on Sidewinder game pad*/ diff --git a/src/game/joystick_tm_fcs.c b/src/game/joystick_tm_fcs.c index 6c1176a42..c8368612d 100644 --- a/src/game/joystick_tm_fcs.c +++ b/src/game/joystick_tm_fcs.c @@ -10,9 +10,11 @@ * * Authors: Miran Grca, * Sarah Walker, + * Jasmine Iwanek, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. + * Copyright 2021-2025 Jasmine IWanek. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,16 +60,17 @@ tm_fcs_close(UNUSED(void *priv)) static uint8_t tm_fcs_read(UNUSED(void *priv)) { + uint8_t gp = 0; uint8_t ret = 0xf0; - if (JOYSTICK_PRESENT(0, 0)) { - if (joystick_state[0][0].button[0]) + if (JOYSTICK_PRESENT(gp, 0)) { + if (joystick_state[gp][0].button[0]) ret &= ~0x10; - if (joystick_state[0][0].button[1]) + if (joystick_state[gp][0].button[1]) ret &= ~0x20; - if (joystick_state[0][0].button[2]) + if (joystick_state[gp][0].button[2]) ret &= ~0x40; - if (joystick_state[0][0].button[3]) + if (joystick_state[gp][0].button[3]) ret &= ~0x80; } @@ -83,26 +86,28 @@ tm_fcs_write(UNUSED(void *priv)) static int tm_fcs_read_axis(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp= 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: return 0; case 3: - if (joystick_state[0][0].pov[0] == -1) + if (joystick_state[gp][0].pov[0] == -1) return 32767; - if (joystick_state[0][0].pov[0] > 315 || joystick_state[0][0].pov[0] < 45) + if (joystick_state[gp][0].pov[0] > 315 || joystick_state[gp][0].pov[0] < 45) return -32768; - if (joystick_state[0][0].pov[0] >= 45 && joystick_state[0][0].pov[0] < 135) + if (joystick_state[gp][0].pov[0] >= 45 && joystick_state[gp][0].pov[0] < 135) return -16384; - if (joystick_state[0][0].pov[0] >= 135 && joystick_state[0][0].pov[0] < 225) + if (joystick_state[gp][0].pov[0] >= 135 && joystick_state[gp][0].pov[0] < 225) return 0; - if (joystick_state[0][0].pov[0] >= 225 && joystick_state[0][0].pov[0] < 315) + if (joystick_state[gp][0].pov[0] >= 225 && joystick_state[gp][0].pov[0] < 315) return 16384; return 0; default: @@ -113,26 +118,28 @@ tm_fcs_read_axis(UNUSED(void *priv), int axis) static int tm_fcs_rcs_read_axis(UNUSED(void *priv), int axis) { - if (!JOYSTICK_PRESENT(0, 0)) + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; switch (axis) { case 0: - return joystick_state[0][0].axis[0]; + return joystick_state[gp][0].axis[0]; case 1: - return joystick_state[0][0].axis[1]; + return joystick_state[gp][0].axis[1]; case 2: - return joystick_state[0][0].axis[2]; + return joystick_state[gp][0].axis[2]; case 3: - if (joystick_state[0][0].pov[0] == -1) + if (joystick_state[gp][0].pov[0] == -1) return 32767; - if (joystick_state[0][0].pov[0] > 315 || joystick_state[0][0].pov[0] < 45) + if (joystick_state[gp][0].pov[0] > 315 || joystick_state[gp][0].pov[0] < 45) return -32768; - if (joystick_state[0][0].pov[0] >= 45 && joystick_state[0][0].pov[0] < 135) + if (joystick_state[gp][0].pov[0] >= 45 && joystick_state[gp][0].pov[0] < 135) return -16384; - if (joystick_state[0][0].pov[0] >= 135 && joystick_state[0][0].pov[0] < 225) + if (joystick_state[gp][0].pov[0] >= 135 && joystick_state[gp][0].pov[0] < 225) return 0; - if (joystick_state[0][0].pov[0] >= 225 && joystick_state[0][0].pov[0] < 315) + if (joystick_state[gp][0].pov[0] >= 225 && joystick_state[gp][0].pov[0] < 315) return 16384; return 0; default: From 65cf2649f110ed390dd6c800fa76578d8937a3c9 Mon Sep 17 00:00:00 2001 From: mw308 <34479591+mw308@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:16:42 +0100 Subject: [PATCH 5/7] Added HDD model tag capability and extra MS-6119 BIOS (#6287) * Added HDD version tag capability * Added additional PB MS-6119 BIOS --- src/disk/hdc_ide.c | 5 ++++- src/disk/hdd.c | 3 +++ src/include/86box/hdd.h | 3 +++ src/machine/m_at_slot1.c | 9 +++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 566f255e9..6b116697f 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -552,7 +552,10 @@ ide_hd_identify(const ide_t *ide) /* Serial Number */ ide_padstr((char *) (ide->buffer + 10), "", 20); /* Firmware */ - ide_padstr((char *) (ide->buffer + 23), EMU_VERSION_EX, 8); + if (hdd[ide->hdd_num].version_ex) + ide_padstr((char *) (ide->buffer + 23), hdd[ide->hdd_num].version_ex, 8); + else + ide_padstr((char *) (ide->buffer + 23), EMU_VERSION_EX, 8); /* Model */ if (hdd[ide->hdd_num].model) ide_padstr((char *) (ide->buffer + 27), hdd[ide->hdd_num].model, 40); diff --git a/src/disk/hdd.c b/src/disk/hdd.c index af4411ab0..3c94bfa65 100644 --- a/src/disk/hdd.c +++ b/src/disk/hdd.c @@ -621,6 +621,9 @@ hdd_preset_apply(int hdd_id) if (preset->model) hd->model = preset->model; + if (preset->version_ex) + hd->version_ex = preset->version_ex; + if (!hd->speed_preset) return; diff --git a/src/include/86box/hdd.h b/src/include/86box/hdd.h index 1457efcae..e471cb54e 100644 --- a/src/include/86box/hdd.h +++ b/src/include/86box/hdd.h @@ -99,6 +99,7 @@ typedef struct hdd_preset_t { uint32_t max_multiple; double full_stroke_ms; double track_seek_ms; + const char *version_ex; } hdd_preset_t; typedef struct hdd_cache_seg_t { @@ -186,6 +187,8 @@ typedef struct hard_disk_t { const char *model; + const char *version_ex; + hdd_zone_t zones[HDD_MAX_ZONES]; hdd_cache_t cache; diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index 995c943b9..db014587e 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -708,6 +708,15 @@ static const device_config_t ms6119_config[] = { .spinner = { 0 }, .selection = { { 0 } }, .bios = { + { + .name = "AMIBIOS 6 (071595) - Revision 1.72 (Packard Bell Tacoma with logo)", + .internal_name = "tacoma_logo", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 262144, + .files = { "roms/machines/ms6119/A19P2172.ROM", "" } + }, { .name = "AMIBIOS 6 (071595) - Revision 1.90 (Packard Bell Tacoma)", .internal_name = "tacoma", From ec86595d5da8b64fb223334bf4fc1bc2124f9fdc Mon Sep 17 00:00:00 2001 From: Verloren50000 <110334428+Verloren50000@users.noreply.github.com> Date: Mon, 6 Oct 2025 23:17:16 +0800 Subject: [PATCH 6/7] machine_table.c: Sony Vaio PCV-90 -> Sony Vaio PCV-70/90/100/120 (#6286) Change the machine name. Old name: "Sony Vaio PCV-90" New name: "Sony Vaio PCV-70/90/100/120" --- src/machine/machine_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index f0672a743..3a8e12e44 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -14511,7 +14511,7 @@ const machine_t machines[] = { Command 0xA0 copyright string: (C)1994 AMI . Yes, this is an Intel AMI BIOS with a fancy splash screen. */ { - .name = "[i430HX] Sony Vaio PCV-90", + .name = "[i430HX] Sony Vaio PCV-70/90/100/120", .internal_name = "pcv90", .type = MACHINE_TYPE_SOCKET7, .chipset = MACHINE_CHIPSET_INTEL_430HX, From 3f5b88ac8fb8afa72cd98fd3476e4815b42c1491 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Mon, 6 Oct 2025 11:17:30 -0400 Subject: [PATCH 7/7] More Joystick/gameport related changes (#6285) Fix a warning, correct a device name, formatting --- src/game/gameport.c | 2 +- src/game/joystick_ch_flightstick_pro.c | 19 +++++++++++++------ src/game/joystick_standard.c | 7 +++---- src/include/86box/gameport.h | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/game/gameport.c b/src/game/gameport.c index f17e39efe..88ff5cc8a 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -100,7 +100,7 @@ static const struct { { &joystick_3axis_2button }, { &joystick_2button_yoke_throttle }, { &joystick_3axis_4button }, - { &joystick_win95_steering_wheel }, + { &joystick_steering_wheel_4_button }, { &joystick_4button_yoke_throttle }, { &joystick_4axis_4button }, { &joystick_ch_flightstick_pro }, diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index 834aa8a99..84dc5a380 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -10,9 +10,11 @@ * * Authors: Miran Grca, * Sarah Walker, + * Jasmine Iwanek, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. + * Copyright 2021-2025 Jasmine Iwanek. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,14 +72,19 @@ ch_flightstick_pro_read(UNUSED(void *priv)) ret &= ~0x40; if (joystick_state[gp][0].button[3]) ret &= ~0x80; + // POV Hat if (joystick_state[gp][0].pov[0] != -1) { - if (joystick_state[gp][0].pov[0] > 315 || joystick_state[gp][0].pov[0] < 45) + // POV Up + if ((joystick_state[gp][0].pov[0] > 315) || (joystick_state[gp][0].pov[0] < 45)) ret &= ~0xf0; - else if (joystick_state[gp][0].pov[0] >= 45 && joystick_state[gp][0].pov[0] < 135) + // POV Right + else if ((joystick_state[gp][0].pov[0]) >= 45 && (joystick_state[gp][0].pov[0] < 135)) ret &= ~0xb0; - else if (joystick_state[gp][0].pov[0] >= 135 && joystick_state[gp][0].pov[0] < 225) + // POV Down + else if ((joystick_state[gp][0].pov[0]) >= 135 && (joystick_state[gp][0].pov[0] < 225)) ret &= ~0x70; - else if (joystick_state[gp][0].pov[0] >= 225 && joystick_state[gp][0].pov[0] < 315) + // POV Left + else if ((joystick_state[gp][0].pov[0]) >= 225 && (joystick_state[gp][0].pov[0] < 315)) ret &= ~0x30; } } @@ -94,7 +101,7 @@ ch_flightstick_pro_write(UNUSED(void *priv)) static int ch_flightstick_pro_read_axis(UNUSED(void *priv), int axis) { - uint8_t gp = 0; + uint8_t gp = 0; if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; @@ -116,7 +123,7 @@ ch_flightstick_pro_read_axis(UNUSED(void *priv), int axis) static int ch_flightstick_pro_ch_pedals_read_axis(UNUSED(void *priv), int axis) { - uint8_t gp = 0; + uint8_t gp = 0; if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index 5e0268d6b..60ea4b57d 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -193,7 +193,6 @@ static int joystick_standard_read_axis_3axis(UNUSED(void *priv), int axis) { uint8_t gp = 0; - uint8_t js = 0; if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; @@ -470,9 +469,9 @@ const joystick_t joystick_4button_yoke_throttle = { .pov_names = { NULL } }; -const joystick_t joystick_win95_steering_wheel = { - .name = "Win95 Steering Wheel (3-axis, 4-button)", - .internal_name = "win95_steering_wheel", +const joystick_t joystick_steering_wheel_4_button = { + .name = "Steering Wheel (3-axis, 4-button)", + .internal_name = "steering_wheel_4_button", .init = joystick_standard_init, .close = joystick_standard_close, .read = joystick_standard_read_4button, diff --git a/src/include/86box/gameport.h b/src/include/86box/gameport.h index f9d7810e0..1b86c0567 100644 --- a/src/include/86box/gameport.h +++ b/src/include/86box/gameport.h @@ -182,7 +182,7 @@ extern const joystick_t joystick_3axis_2button; extern const joystick_t joystick_2button_yoke_throttle; extern const joystick_t joystick_3axis_4button; extern const joystick_t joystick_4button_yoke_throttle; -extern const joystick_t joystick_win95_steering_wheel; +extern const joystick_t joystick_steering_wheel_4_button; extern const joystick_t joystick_4axis_4button; extern const joystick_t joystick_2axis_6button; extern const joystick_t joystick_2axis_8button;