From f3016bc93eb3361cc389a30be71cd274da5382e7 Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Mon, 13 Jan 2025 22:48:44 +0700 Subject: [PATCH 01/45] Added onboard sound to 4 machines --- src/machine/m_at_socket7.c | 4 ++++ src/machine/m_at_socket7_3v.c | 4 ++++ src/machine/m_at_socket8.c | 8 ++++++++ src/machine/machine_table.c | 8 ++++---- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index f80d2d421..52b16c212 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -849,6 +849,10 @@ machine_at_gw2kte_init(const machine_t *model) pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); + + if ((sound_card_current[0] == SOUND_INTERNAL) && machine_get_snd_device(machine)->available()) + machine_snd = device_add(machine_get_snd_device(machine)); + device_add(&i430vx_device); device_add(&piix3_device); device_add(&fdc37c932fr_device); diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 40ae221a0..4b980f2b0 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -694,6 +694,10 @@ machine_at_gw2kma_init(const machine_t *model) pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); + + if ((sound_card_current[0] == SOUND_INTERNAL) && machine_get_snd_device(machine)->available()) + machine_snd = device_add(machine_get_snd_device(machine)); + device_add(&i430vx_device); device_add(&piix3_device); device_add(&fdc37c932fr_device); diff --git a/src/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index e6f78f6a2..59c412447 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -249,6 +249,10 @@ machine_at_vs440fx_init(const machine_t *model) pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + + if (sound_card_current[0] == SOUND_INTERNAL) + device_add(machine_get_snd_device(machine)); + device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_intel_ami_pci_device); @@ -283,6 +287,10 @@ machine_at_gw2kvenus_init(const machine_t *model) pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + + if (sound_card_current[0] == SOUND_INTERNAL) + device_add(machine_get_snd_device(machine)); + device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_intel_ami_pci_device); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 330b7d52a..b9ee8af40 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -13989,7 +13989,7 @@ const machine_t machines[] = { .max_multi = 3.5 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 524288, @@ -14004,7 +14004,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = NULL, + .snd_device = &cs4236b_device, .net_device = NULL }, /* Has the AMIKey-2 (updated 'H') KBC firmware. */ @@ -14113,7 +14113,7 @@ const machine_t machines[] = { .max_multi = 3.5 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 524288, @@ -14128,7 +14128,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = NULL, + .snd_device = &cs4236b_device, .net_device = NULL }, /* Has the AMIKey-2 (updated 'H') KBC firmware. */ From a7472005ba746d9522e8b45657bd728f72577edb Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Mon, 13 Jan 2025 23:00:29 +0700 Subject: [PATCH 02/45] Added Maxtium Computer SmartBX --- src/include/86box/machine.h | 1 + src/machine/m_at_socket370.c | 32 ++++++++++++++++++++++++++++ src/machine/machine_table.c | 41 ++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 0cd3564ee..6edcb6ac4 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -839,6 +839,7 @@ extern int machine_at_atc7020bxii_init(const machine_t *); extern int machine_at_m773_init(const machine_t *); extern int machine_at_ambx133_init(const machine_t *); extern int machine_at_awo671r_init(const machine_t *); +extern int machine_at_smartbx_init(const machine_t *); extern int machine_at_63a1_init(const machine_t *); extern int machine_at_s370sba_init(const machine_t *); extern int machine_at_apas3_init(const machine_t *); diff --git a/src/machine/m_at_socket370.c b/src/machine/m_at_socket370.c index 9be2d45b8..3513859cb 100644 --- a/src/machine/m_at_socket370.c +++ b/src/machine/m_at_socket370.c @@ -402,6 +402,38 @@ machine_at_awo671r_init(const machine_t *model) return ret; } +int +machine_at_smartbx_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/smartbx/sbx107.bin", + 0x000c0000, 262144, 0); + + if (bios_only || !ret) + return ret; + + 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(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); + device_add(&i440bx_device); + device_add(&piix4e_device); + device_add(&keyboard_ps2_ami_pci_device); + device_add(&w83977ef_device); + device_add(&sst_flash_39sf020_device); + spd_register(SPD_TYPE_SDRAM, 0x7, 256); + + return ret; +} + int machine_at_63a1_init(const machine_t *model) { diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index b9ee8af40..d3dcd47f4 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -15758,6 +15758,47 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC + firmware. */ + { + .name = "[i440BX] Maxtium Computer SmartBX", + .internal_name = "smartbx", + .type = MACHINE_TYPE_SOCKET370, + .chipset = MACHINE_CHIPSET_INTEL_440BX, + .init = machine_at_smartbx_init, + .p1_handler = NULL, + .gpio_handler = NULL, + .available_flag = MACHINE_AVAILABLE, + .gpio_acpi_handler = NULL, + .cpu = { + .package = CPU_PKG_SOCKET370, + .block = CPU_BLOCK_NONE, + .min_bus = 66666667, + .max_bus = 100000000, + .min_voltage = 1300, + .max_voltage = 3500, + .min_multi = 1.5, + .max_multi = 8.0 + }, + .bus_flags = MACHINE_PS2_A97 | MACHINE_BUS_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI | MACHINE_USB, + .ram = { + .min = 8192, + .max = 393216, + .step = 8192 + }, + .nvrmask = 255, + .kbc_device = NULL, + .kbc_p1 = 0xff, + .gpio = 0xffffffff, + .gpio_acpi = 0xffffffff, + .device = NULL, + .fdc_device = NULL, + .sio_device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* 440ZX */ /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC From 49aa0edd2256a5adcad2cace7067281bf5f1b951 Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Mon, 13 Jan 2025 23:14:11 +0700 Subject: [PATCH 03/45] Added Dell Dimension X30 --- src/include/86box/machine.h | 1 + src/machine/m_at_386dx_486.c | 22 ++++++++++++++++++++ src/machine/machine_table.c | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 6edcb6ac4..4e4b2e558 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -519,6 +519,7 @@ extern int machine_at_cs4031_init(const machine_t *); extern int machine_at_pb410a_init(const machine_t *); extern int machine_at_decpclpv_init(const machine_t *); +extern int machine_at_dellx30_init(const machine_t *); extern int machine_at_acerv10_init(const machine_t *); extern int machine_at_acera1g_init(const machine_t *); diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index d3c7a21d2..dbe91de51 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -482,6 +482,28 @@ machine_at_decpclpv_init(const machine_t *model) return ret; } +int +machine_at_dellx30_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/dellx30/shk2a03.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + device_add(&sis_85c461_device); + device_add(&keyboard_ps2_acer_pci_device); + device_add(&fdc37c665_ide_device); + device_add(&ide_opti611_vlb_device); + device_add(&intel_flash_bxt_device); + + return ret; +} + static void machine_at_ali1429_common_init(const machine_t *model, int is_green) { diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index d3dcd47f4..75198b3e3 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -6936,6 +6936,46 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* Has FDC37C665 SIO with OPTi 82c611 IDE onboard */ + { + .name = "[SiS 461] Dell Dimension X30", + .internal_name = "dellx30", + .type = MACHINE_TYPE_486_S3, + .chipset = MACHINE_CHIPSET_SIS_461, /* Chipset relabeled as Micronics MIC 471 */ + .init = machine_at_dellx30_init, + .p1_handler = NULL, + .gpio_handler = NULL, + .available_flag = MACHINE_AVAILABLE, + .gpio_acpi_handler = NULL, + .cpu = { + .package = CPU_PKG_SOCKET3, + .block = CPU_BLOCK_NONE, + .min_bus = 0, + .max_bus = 0, + .min_voltage = 0, + .max_voltage = 0, + .min_multi = 0, + .max_multi = 0 + }, + .bus_flags = MACHINE_PS2_VLB, + .flags = MACHINE_IDE | MACHINE_APM, + .ram = { + .min = 1024, + .max = 65536, + .step = 1024 + }, + .nvrmask = 127, + .kbc_device = NULL, + .kbc_p1 = 0xff, + .gpio = 0xffffffff, + .gpio_acpi = 0xffffffff, + .device = NULL, + .fdc_device = NULL, + .sio_device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* The BIOS string ends in -U, unless command 0xA1 (AMIKey get version) returns an 'F', in which case, it ends in -F, so it has an AMIKey F KBC firmware. The photo of the board shows an AMIKey KBC which is indeed F. */ From 3b4d6d1f9e708b3599c756c33db238ab33021a7b Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Mon, 13 Jan 2025 23:33:20 +0700 Subject: [PATCH 04/45] Forgotten one change --- src/machine/machine_table.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 75198b3e3..cac50fbcf 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -11240,7 +11240,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 131072, @@ -11255,7 +11255,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = NULL, + .snd_device = &sb_vibra16c_onboard_device, .net_device = NULL }, @@ -12263,7 +12263,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 131072, @@ -12278,7 +12278,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = NULL, + .snd_device = &sb_vibra16c_onboard_device, .net_device = NULL }, /* Has a SM(S)C FDC37C935 Super I/O chip with on-chip KBC with Phoenix From c924a60be7abb1b74644fb7fb375632fc375824f Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Tue, 14 Jan 2025 00:06:25 +0700 Subject: [PATCH 05/45] Removed flash device from X30 Fixes BootBlock error --- src/machine/m_at_386dx_486.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index dbe91de51..28e5c8549 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -499,7 +499,6 @@ machine_at_dellx30_init(const machine_t *model) device_add(&keyboard_ps2_acer_pci_device); device_add(&fdc37c665_ide_device); device_add(&ide_opti611_vlb_device); - device_add(&intel_flash_bxt_device); return ret; } From b002fed6023890e0056ea5e54aff74260547938a Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Tue, 14 Jan 2025 00:13:54 +0700 Subject: [PATCH 06/45] Removed non-working SmartBX --- src/include/86box/machine.h | 1 - src/machine/m_at_socket370.c | 32 ---------------------------- src/machine/machine_table.c | 41 ------------------------------------ 3 files changed, 74 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 4e4b2e558..48e9be1c3 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -840,7 +840,6 @@ extern int machine_at_atc7020bxii_init(const machine_t *); extern int machine_at_m773_init(const machine_t *); extern int machine_at_ambx133_init(const machine_t *); extern int machine_at_awo671r_init(const machine_t *); -extern int machine_at_smartbx_init(const machine_t *); extern int machine_at_63a1_init(const machine_t *); extern int machine_at_s370sba_init(const machine_t *); extern int machine_at_apas3_init(const machine_t *); diff --git a/src/machine/m_at_socket370.c b/src/machine/m_at_socket370.c index 3513859cb..9be2d45b8 100644 --- a/src/machine/m_at_socket370.c +++ b/src/machine/m_at_socket370.c @@ -402,38 +402,6 @@ machine_at_awo671r_init(const machine_t *model) return ret; } -int -machine_at_smartbx_init(const machine_t *model) -{ - int ret; - - ret = bios_load_linear("roms/machines/smartbx/sbx107.bin", - 0x000c0000, 262144, 0); - - if (bios_only || !ret) - return ret; - - 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(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 3, 4); - pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); - pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1); - pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); - device_add(&i440bx_device); - device_add(&piix4e_device); - device_add(&keyboard_ps2_ami_pci_device); - device_add(&w83977ef_device); - device_add(&sst_flash_39sf020_device); - spd_register(SPD_TYPE_SDRAM, 0x7, 256); - - return ret; -} - int machine_at_63a1_init(const machine_t *model) { diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index cac50fbcf..1aeb28526 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -15798,47 +15798,6 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, - /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC - firmware. */ - { - .name = "[i440BX] Maxtium Computer SmartBX", - .internal_name = "smartbx", - .type = MACHINE_TYPE_SOCKET370, - .chipset = MACHINE_CHIPSET_INTEL_440BX, - .init = machine_at_smartbx_init, - .p1_handler = NULL, - .gpio_handler = NULL, - .available_flag = MACHINE_AVAILABLE, - .gpio_acpi_handler = NULL, - .cpu = { - .package = CPU_PKG_SOCKET370, - .block = CPU_BLOCK_NONE, - .min_bus = 66666667, - .max_bus = 100000000, - .min_voltage = 1300, - .max_voltage = 3500, - .min_multi = 1.5, - .max_multi = 8.0 - }, - .bus_flags = MACHINE_PS2_A97 | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI | MACHINE_USB, - .ram = { - .min = 8192, - .max = 393216, - .step = 8192 - }, - .nvrmask = 255, - .kbc_device = NULL, - .kbc_p1 = 0xff, - .gpio = 0xffffffff, - .gpio_acpi = 0xffffffff, - .device = NULL, - .fdc_device = NULL, - .sio_device = NULL, - .vid_device = NULL, - .snd_device = NULL, - .net_device = NULL - }, /* 440ZX */ /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC From ffe6af94cfaa48e16cd6e5921705b58091fc6790 Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Tue, 14 Jan 2025 00:26:05 +0700 Subject: [PATCH 07/45] Removed non-working X30 --- src/include/86box/machine.h | 1 - src/machine/m_at_386dx_486.c | 21 ------------------- src/machine/machine_table.c | 40 ------------------------------------ 3 files changed, 62 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 48e9be1c3..0cd3564ee 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -519,7 +519,6 @@ extern int machine_at_cs4031_init(const machine_t *); extern int machine_at_pb410a_init(const machine_t *); extern int machine_at_decpclpv_init(const machine_t *); -extern int machine_at_dellx30_init(const machine_t *); extern int machine_at_acerv10_init(const machine_t *); extern int machine_at_acera1g_init(const machine_t *); diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 28e5c8549..d3c7a21d2 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -482,27 +482,6 @@ machine_at_decpclpv_init(const machine_t *model) return ret; } -int -machine_at_dellx30_init(const machine_t *model) -{ - int ret; - - ret = bios_load_linear("roms/machines/dellx30/shk2a03.bin", - 0x000e0000, 131072, 0); - - if (bios_only || !ret) - return ret; - - machine_at_common_init(model); - - device_add(&sis_85c461_device); - device_add(&keyboard_ps2_acer_pci_device); - device_add(&fdc37c665_ide_device); - device_add(&ide_opti611_vlb_device); - - return ret; -} - static void machine_at_ali1429_common_init(const machine_t *model, int is_green) { diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 1aeb28526..baba2723c 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -6936,46 +6936,6 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, - /* Has FDC37C665 SIO with OPTi 82c611 IDE onboard */ - { - .name = "[SiS 461] Dell Dimension X30", - .internal_name = "dellx30", - .type = MACHINE_TYPE_486_S3, - .chipset = MACHINE_CHIPSET_SIS_461, /* Chipset relabeled as Micronics MIC 471 */ - .init = machine_at_dellx30_init, - .p1_handler = NULL, - .gpio_handler = NULL, - .available_flag = MACHINE_AVAILABLE, - .gpio_acpi_handler = NULL, - .cpu = { - .package = CPU_PKG_SOCKET3, - .block = CPU_BLOCK_NONE, - .min_bus = 0, - .max_bus = 0, - .min_voltage = 0, - .max_voltage = 0, - .min_multi = 0, - .max_multi = 0 - }, - .bus_flags = MACHINE_PS2_VLB, - .flags = MACHINE_IDE | MACHINE_APM, - .ram = { - .min = 1024, - .max = 65536, - .step = 1024 - }, - .nvrmask = 127, - .kbc_device = NULL, - .kbc_p1 = 0xff, - .gpio = 0xffffffff, - .gpio_acpi = 0xffffffff, - .device = NULL, - .fdc_device = NULL, - .sio_device = NULL, - .vid_device = NULL, - .snd_device = NULL, - .net_device = NULL - }, /* The BIOS string ends in -U, unless command 0xA1 (AMIKey get version) returns an 'F', in which case, it ends in -F, so it has an AMIKey F KBC firmware. The photo of the board shows an AMIKey KBC which is indeed F. */ From 9b7d5198d7f80e955756522079b642a8137c4aa1 Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Sat, 18 Jan 2025 04:14:23 +0700 Subject: [PATCH 08/45] Removed onboard sound from three machines Per richardg867 --- src/machine/m_at_socket7_3v.c | 3 --- src/machine/m_at_socket8.c | 6 ------ src/machine/machine_table.c | 12 ++++++------ 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 4b980f2b0..262169010 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -695,9 +695,6 @@ machine_at_gw2kma_init(const machine_t *model) pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); - if ((sound_card_current[0] == SOUND_INTERNAL) && machine_get_snd_device(machine)->available()) - machine_snd = device_add(machine_get_snd_device(machine)); - device_add(&i430vx_device); device_add(&piix3_device); device_add(&fdc37c932fr_device); diff --git a/src/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index 59c412447..6d4776637 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -250,9 +250,6 @@ machine_at_vs440fx_init(const machine_t *model) pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - if (sound_card_current[0] == SOUND_INTERNAL) - device_add(machine_get_snd_device(machine)); - device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_intel_ami_pci_device); @@ -288,9 +285,6 @@ machine_at_gw2kvenus_init(const machine_t *model) pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - if (sound_card_current[0] == SOUND_INTERNAL) - device_add(machine_get_snd_device(machine)); - device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_intel_ami_pci_device); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index baba2723c..bd31a58b1 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -11200,7 +11200,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 131072, @@ -11215,7 +11215,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = &sb_vibra16c_onboard_device, + .snd_device = NULL, .net_device = NULL }, @@ -13989,7 +13989,7 @@ const machine_t machines[] = { .max_multi = 3.5 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 524288, @@ -14004,7 +14004,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = &cs4236b_device, + .snd_device = NULL, .net_device = NULL }, /* Has the AMIKey-2 (updated 'H') KBC firmware. */ @@ -14113,7 +14113,7 @@ const machine_t machines[] = { .max_multi = 3.5 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 524288, @@ -14128,7 +14128,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = &cs4236b_device, + .snd_device = NULL, .net_device = NULL }, /* Has the AMIKey-2 (updated 'H') KBC firmware. */ From c20c211e29c1150bb88076221b72075be7509af2 Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Sat, 18 Jan 2025 04:17:27 +0700 Subject: [PATCH 09/45] Line fixes --- src/machine/m_at_socket7_3v.c | 1 - src/machine/m_at_socket8.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 262169010..40ae221a0 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -694,7 +694,6 @@ machine_at_gw2kma_init(const machine_t *model) pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); - device_add(&i430vx_device); device_add(&piix3_device); device_add(&fdc37c932fr_device); diff --git a/src/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index 6d4776637..e6f78f6a2 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -249,7 +249,6 @@ machine_at_vs440fx_init(const machine_t *model) pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_intel_ami_pci_device); @@ -284,7 +283,6 @@ machine_at_gw2kvenus_init(const machine_t *model) pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); - device_add(&i440fx_device); device_add(&piix3_device); device_add(&keyboard_ps2_intel_ami_pci_device); From f89d960b7e499d1544b9301e30e7dec222e58ff4 Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Sat, 18 Jan 2025 04:29:05 +0700 Subject: [PATCH 10/45] Added back onboard sound to Mailman Per richardg867 --- src/machine/m_at_socket7_3v.c | 4 ++++ src/machine/machine_table.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/machine/m_at_socket7_3v.c b/src/machine/m_at_socket7_3v.c index 40ae221a0..4b980f2b0 100644 --- a/src/machine/m_at_socket7_3v.c +++ b/src/machine/m_at_socket7_3v.c @@ -694,6 +694,10 @@ machine_at_gw2kma_init(const machine_t *model) pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); + + if ((sound_card_current[0] == SOUND_INTERNAL) && machine_get_snd_device(machine)->available()) + machine_snd = device_add(machine_get_snd_device(machine)); + device_add(&i430vx_device); device_add(&piix3_device); device_add(&fdc37c932fr_device); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index bd31a58b1..7b0de9805 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -11200,7 +11200,7 @@ const machine_t machines[] = { .max_multi = 3.0 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 131072, @@ -11215,7 +11215,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = NULL, + .snd_device = &sb_vibra16c_onboard_device, .net_device = NULL }, From ab3d849c76c5e6a29a5615ddd02833c39deaa937 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 10 Feb 2025 13:58:22 -0300 Subject: [PATCH 11/45] Jenkins: Revise MacPorts OpenAL hack for 1.24.2 and hopefully later updates, fixes #5218 --- .ci/build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 From 109a913bf58cedae4c4010b0dca4953fed4ea430 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Tue, 11 Feb 2025 12:02:47 -0500 Subject: [PATCH 12/45] Remove duplicate .close in scsi_t228_device --- src/scsi/scsi_t128.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/scsi/scsi_t128.c b/src/scsi/scsi_t128.c index 77c2302cc..a40d803f1 100644 --- a/src/scsi/scsi_t128.c +++ b/src/scsi/scsi_t128.c @@ -616,7 +616,6 @@ const device_t scsi_t128_device = { .config = t128_config }; - const device_t scsi_t228_device = { .name = "Trantor T228", .internal_name = "t228", @@ -624,7 +623,6 @@ const device_t scsi_t228_device = { .local = 0, .init = t128_init, .close = t128_close, - .close = t128_close, .reset = NULL, .available = t128_available, .speed_changed = NULL, From d075d0d3c9c9976798c5ed9b6eee6daf9fa23773 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 12 Feb 2025 03:20:12 +0100 Subject: [PATCH 13/45] Default host_serial_path to empty string instead of NULL, fixes segmentation fault on initilization of serial passthrough with non-initialized string. --- src/device/serial_passthrough.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device/serial_passthrough.c b/src/device/serial_passthrough.c index 256f9eaa9..3da2e09ff 100644 --- a/src/device/serial_passthrough.c +++ b/src/device/serial_passthrough.c @@ -260,7 +260,7 @@ static const device_config_t serial_passthrough_config[] = { .name = "host_serial_path", .description = "Host Serial Device", .type = CONFIG_SERPORT, - .default_string = NULL, + .default_string = "", .default_int = 0, .file_filter = NULL, .spinner = { 0 }, From 90ba9eda084b942c28a7ffe631819dafd1a09f55 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 12 Feb 2025 05:18:12 +0100 Subject: [PATCH 14/45] Fixes to the device and machine configuration string getters and accordingly reverted the serial passthrough fix as well as it's no longer needed. --- src/device.c | 47 +++++++++++++++++++++------------ src/device/serial_passthrough.c | 2 +- src/include/86box/device.h | 33 ++++++++--------------- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/device.c b/src/device.c index d7c80be7a..fa7378c1a 100644 --- a/src/device.c +++ b/src/device.c @@ -637,16 +637,24 @@ device_get_instance(void) const char * device_get_config_string(const char *str) { - const device_config_t *cfg = device_current.dev->config; + const char *ret = ""; - while (cfg && cfg->type != CONFIG_END) { - if (!strcmp(str, cfg->name)) - return (config_get_string((char *) device_current.name, (char *) str, (char *) cfg->default_string)); + if (device_current.dev != NULL) { + const device_config_t *cfg = device_current.dev->config; - cfg++; + while ((cfg != NULL) && (cfg->type != CONFIG_END)) { + if (!strcmp(str, cfg->name)) { + const char *s = (config_get_string((char *) device_current.name, + (char *) str, (char *) cfg->default_string)); + ret = (s == NULL) ? "" : s; + break; + } + + cfg++; + } } - return (NULL); + return ret; } int @@ -870,24 +878,29 @@ machine_get_config_int(char *str) return 0; } -char * +const char * machine_get_config_string(char *str) { - const device_t *dev = machine_get_device(machine); - const device_config_t *cfg; + const device_t *dev = machine_get_device(machine); + const char *ret = ""; - if (dev == NULL) - return 0; + if (dev != NULL) { + const device_config_t *cfg; - cfg = dev->config; - while (cfg && cfg->type != CONFIG_END) { - if (!strcmp(str, cfg->name)) - return (config_get_string((char *) dev->name, str, (char *) cfg->default_string)); + cfg = dev->config; + while ((cfg != NULL) && (cfg->type != CONFIG_END)) { + if (!strcmp(str, cfg->name)) { + const char *s = config_get_string((char *) dev->name, str, + (char *) cfg->default_string); + ret = (s == NULL) ? "" : s; + break; + } - cfg++; + cfg++; + } } - return NULL; + return ret; } const device_t * diff --git a/src/device/serial_passthrough.c b/src/device/serial_passthrough.c index 3da2e09ff..256f9eaa9 100644 --- a/src/device/serial_passthrough.c +++ b/src/device/serial_passthrough.c @@ -260,7 +260,7 @@ static const device_config_t serial_passthrough_config[] = { .name = "host_serial_path", .description = "Host Serial Device", .type = CONFIG_SERPORT, - .default_string = "", + .default_string = NULL, .default_int = 0, .file_filter = NULL, .spinner = { 0 }, diff --git a/src/include/86box/device.h b/src/include/86box/device.h index 1c2ec5203..b5a4c1925 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -118,16 +118,6 @@ enum { #define BIOS_INTERLEAVED_INVERT 8 #define BIOS_HIGH_BIT_INVERT 16 -#define device_common_config_t \ - const char *name; \ - const char *description; \ - int type; \ - const char *default_string; \ - int default_int; \ - const char *file_filter; \ - const device_config_spinner_t spinner; \ - const device_config_selection_t selection[32] - typedef struct device_config_selection_t { const char *description; int value; @@ -139,10 +129,6 @@ typedef struct device_config_spinner_t { int16_t step; } device_config_spinner_t; -typedef struct _device_dep_config_ { - device_common_config_t; -} device_dep_config_t; - typedef struct device_config_bios_t { const char *name; const char *internal_name; @@ -153,15 +139,18 @@ typedef struct device_config_bios_t { void *dev1; void *dev2; const char *files[9]; - /* Configuration options that depend on the device variant. - To prevent excessive nesting, there is no CONFIG_BIOS - option a dep_config struct */ - const device_dep_config_t *dep_config; } device_config_bios_t; typedef struct _device_config_ { - device_common_config_t; - const device_config_bios_t bios[32]; + const char *name; + const char *description; + int type; + const char *default_string; + int default_int; + const char *file_filter; + const device_config_spinner_t spinner; + const device_config_selection_t selection[32]; + const device_config_bios_t bios[32]; } device_config_t; typedef struct _device_ { @@ -242,8 +231,8 @@ extern int device_get_instance(void); extern const char *device_get_internal_name(const device_t *dev); -extern int machine_get_config_int(char *str); -extern char *machine_get_config_string(char *str); +extern int machine_get_config_int(char *str); +extern const char *machine_get_config_string(char *str); extern const device_t device_none; extern const device_t device_internal; From af476f957c4c109927eaff390c83fb31598e1ff7 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 13 Feb 2025 00:09:03 +0100 Subject: [PATCH 15/45] Some const changes in the FDD code. --- src/floppy/fdd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/floppy/fdd.c b/src/floppy/fdd.c index a381f67f1..f0a32df75 100644 --- a/src/floppy/fdd.c +++ b/src/floppy/fdd.c @@ -100,10 +100,10 @@ d86f_handler_t d86f_handler[FDD_NUM]; static const struct { - char *ext; - void (*load)(int drive, char *fn); - void (*close)(int drive); - int size; + const char *ext; + void (*load)(int drive, char *fn); + void (*close)(int drive); + int size; } loaders[] = { { "001", img_load, img_close, -1}, { "002", img_load, img_close, -1}, From 48065193884b075f68edecd3dfc7e05c11556f6e Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 13 Feb 2025 00:23:35 +0100 Subject: [PATCH 16/45] The device_t available/poll union is now gone, mouse poll is now set using mouse_set_poll(), and mouse_curr is now also gone. --- src/cdrom/cdrom.c | 2 +- src/device/mouse.c | 32 +++++------------------ src/device/mouse_bus.c | 8 +++--- src/device/mouse_microtouch_touchscreen.c | 3 ++- src/device/mouse_ps2.c | 4 ++- src/device/mouse_serial.c | 8 +++--- src/device/mouse_wacom_tablet.c | 10 ++++--- src/device/serial_passthrough.c | 2 +- src/include/86box/device.h | 6 ++--- src/network/net_modem.c | 2 +- 10 files changed, 33 insertions(+), 44 deletions(-) diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index 2cdcc5a22..8ebcfea1f 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -103,7 +103,7 @@ static const device_t cdrom_interface_none_device = { .init = NULL, .close = NULL, .reset = NULL, - { .available = NULL }, + .available = NULL, .speed_changed = NULL, .force_redraw = NULL, .config = NULL diff --git a/src/device/mouse.c b/src/device/mouse.c index 604109668..f0446d781 100644 --- a/src/device/mouse.c +++ b/src/device/mouse.c @@ -61,7 +61,7 @@ static const device_t mouse_none_device = { .init = NULL, .close = NULL, .reset = NULL, - { .poll = NULL }, + .available = NULL, .speed_changed = NULL, .force_redraw = NULL, .config = NULL @@ -75,7 +75,7 @@ static const device_t mouse_internal_device = { .init = NULL, .close = NULL, .reset = NULL, - { .poll = NULL }, + .available = NULL, .speed_changed = NULL, .force_redraw = NULL, .config = NULL @@ -111,7 +111,6 @@ static atomic_int mouse_buttons; static int mouse_delta_b; static int mouse_old_b; -static const device_t *mouse_curr; static void *mouse_priv; static int mouse_nbut; static int mouse_raw; @@ -537,17 +536,10 @@ mouse_get_abs_coords(double *x_abs, double *y_abs) void mouse_process(void) { - if (mouse_curr == NULL) - return; - if ((mouse_input_mode >= 1) && mouse_poll_ex) mouse_poll_ex(); - else if ((mouse_input_mode == 0) && ((mouse_dev_poll != NULL) || (mouse_curr->poll != NULL))) { - if (mouse_curr->poll != NULL) - mouse_curr->poll(mouse_priv); - else - mouse_dev_poll(mouse_priv); - } + else if ((mouse_input_mode == 0) && (mouse_dev_poll != NULL)) + mouse_dev_poll(mouse_priv); } void @@ -559,9 +551,6 @@ mouse_set_poll_ex(void (*poll_ex)(void)) void mouse_set_poll(int (*func)(void *), void *arg) { - if (mouse_type != MOUSE_TYPE_INTERNAL) - return; - mouse_dev_poll = func; mouse_priv = arg; } @@ -629,7 +618,7 @@ mouse_set_raw(int raw) void mouse_reset(void) { - if (mouse_curr != NULL) + if (mouse_priv != NULL) return; /* Mouse already initialized. */ mouse_log("MOUSE: reset(type=%d, '%s')\n", @@ -651,19 +640,13 @@ mouse_reset(void) sample_rate = 100.0; timer_on_auto(&mouse_timer, 1000000.0 / sample_rate); - mouse_curr = mouse_devices[mouse_type].device; - - if ((mouse_type > 1) && (mouse_curr != NULL)) - mouse_priv = device_add(mouse_curr); + if ((mouse_type > 1) && (mouse_devices[mouse_type].device != NULL)) + mouse_priv = device_add(mouse_devices[mouse_type].device); } void mouse_close(void) { - if (mouse_curr == NULL) - return; - - mouse_curr = NULL; mouse_priv = NULL; mouse_nbut = 0; mouse_dev_poll = NULL; @@ -680,7 +663,6 @@ mouse_init(void) mouse_clear_buttons(); mouse_type = MOUSE_TYPE_NONE; - mouse_curr = NULL; mouse_priv = NULL; mouse_nbut = 0; mouse_dev_poll = NULL; diff --git a/src/device/mouse_bus.c b/src/device/mouse_bus.c index c0f161dbd..7074a71ac 100644 --- a/src/device/mouse_bus.c +++ b/src/device/mouse_bus.c @@ -680,6 +680,8 @@ bm_init(const device_t *info) mouse_set_sample_rate(0.0); + mouse_set_poll(bm_poll, dev); + return dev; } @@ -818,7 +820,7 @@ const device_t mouse_logibus_device = { .init = bm_init, .close = bm_close, .reset = NULL, - .poll = bm_poll, + .available = NULL, .speed_changed = NULL, .force_redraw = NULL, .config = lt_config @@ -832,7 +834,7 @@ const device_t mouse_logibus_onboard_device = { .init = bm_init, .close = bm_close, .reset = NULL, - .poll = bm_poll, + .available = NULL, .speed_changed = NULL, .force_redraw = NULL, .config = NULL @@ -846,7 +848,7 @@ const device_t mouse_msinport_device = { .init = bm_init, .close = bm_close, .reset = NULL, - .poll = bm_poll, + .available = NULL, .speed_changed = NULL, .force_redraw = NULL, .config = ms_config diff --git a/src/device/mouse_microtouch_touchscreen.c b/src/device/mouse_microtouch_touchscreen.c index 15b42bfdd..512fcc0df 100644 --- a/src/device/mouse_microtouch_touchscreen.c +++ b/src/device/mouse_microtouch_touchscreen.c @@ -525,6 +525,7 @@ mtouch_init(UNUSED(const device_t *info)) mouse_input_mode = device_get_config_int("crosshair") + 1; mouse_set_buttons(2); + mouse_set_poll(mtouch_poll, dev); mouse_set_poll_ex(mtouch_poll_global); mtouch_inst = dev; @@ -605,7 +606,7 @@ const device_t mouse_mtouch_device = { .init = mtouch_init, .close = mtouch_close, .reset = NULL, - .poll = mtouch_poll, + .available = NULL, .speed_changed = NULL, .force_redraw = NULL, .config = mtouch_config diff --git a/src/device/mouse_ps2.c b/src/device/mouse_ps2.c index 9afc75410..8d98b07ce 100644 --- a/src/device/mouse_ps2.c +++ b/src/device/mouse_ps2.c @@ -352,6 +352,8 @@ mouse_ps2_init(const device_t *info) if (dev->port != NULL) kbc_at_dev_reset(dev, 0); + mouse_set_poll(ps2_poll, dev); + /* Return our private data to the I/O layer. */ return dev; } @@ -397,7 +399,7 @@ const device_t mouse_ps2_device = { .init = mouse_ps2_init, .close = ps2_close, .reset = NULL, - .poll = ps2_poll, + .available = NULL, .speed_changed = NULL, .force_redraw = NULL, .config = ps2_config diff --git a/src/device/mouse_serial.c b/src/device/mouse_serial.c index be9bc62e1..96d3a867c 100644 --- a/src/device/mouse_serial.c +++ b/src/device/mouse_serial.c @@ -909,6 +909,8 @@ sermouse_init(const device_t *info) /* Tell them how many buttons we have. */ mouse_set_buttons(dev->but); + mouse_set_poll(sermouse_poll, dev); + /* Return our private data to the I/O layer. */ return dev; } @@ -1075,7 +1077,7 @@ const device_t mouse_mssystems_device = { .init = sermouse_init, .close = sermouse_close, .reset = NULL, - .poll = sermouse_poll, + .available = NULL, .speed_changed = sermouse_speed_changed, .force_redraw = NULL, .config = msssermouse_config @@ -1089,7 +1091,7 @@ const device_t mouse_msserial_device = { .init = sermouse_init, .close = sermouse_close, .reset = NULL, - .poll = sermouse_poll, + .available = NULL, .speed_changed = sermouse_speed_changed, .force_redraw = NULL, .config = mssermouse_config @@ -1103,7 +1105,7 @@ const device_t mouse_ltserial_device = { .init = sermouse_init, .close = sermouse_close, .reset = NULL, - .poll = sermouse_poll, + .available = NULL, .speed_changed = sermouse_speed_changed, .force_redraw = NULL, .config = ltsermouse_config diff --git a/src/device/mouse_wacom_tablet.c b/src/device/mouse_wacom_tablet.c index 79b674e07..3b50882ab 100644 --- a/src/device/mouse_wacom_tablet.c +++ b/src/device/mouse_wacom_tablet.c @@ -662,8 +662,10 @@ wacom_init(const device_t *info) if (dev->tablet_type->type == WACOM_TYPE_IV) { wacom_reset_artpad(dev); wacom_process_settings_dword(dev, 0xE2018000); - } - else wacom_reset(dev); + } else + wacom_reset(dev); + + mouse_set_poll(wacom_poll, dev); return dev; } @@ -721,7 +723,7 @@ const device_t mouse_wacom_device = { .init = wacom_init, .close = wacom_close, .reset = NULL, - .poll = wacom_poll, + .available = NULL, .speed_changed = wacom_speed_changed, .force_redraw = NULL, .config = wacom_config @@ -735,7 +737,7 @@ const device_t mouse_wacom_artpad_device = { .init = wacom_init, .close = wacom_close, .reset = NULL, - .poll = wacom_poll, + .available = NULL, .speed_changed = wacom_speed_changed, .force_redraw = NULL, .config = wacom_config diff --git a/src/device/serial_passthrough.c b/src/device/serial_passthrough.c index 256f9eaa9..3ad969006 100644 --- a/src/device/serial_passthrough.c +++ b/src/device/serial_passthrough.c @@ -366,7 +366,7 @@ const device_t serial_passthrough_device = { .init = serial_passthrough_dev_init, .close = serial_passthrough_dev_close, .reset = NULL, - .poll = NULL, + .available = NULL, .speed_changed = serial_passthrough_speed_changed, .force_redraw = NULL, .config = serial_passthrough_config diff --git a/src/include/86box/device.h b/src/include/86box/device.h index b5a4c1925..479e4cbb6 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -165,10 +165,8 @@ typedef struct _device_ { }; void (*close)(void *priv); void (*reset)(void *priv); - union { - int (*available)(void); - int (*poll)(void *priv); - }; + int (*available)(void); + int (*poll)(void *priv); void (*speed_changed)(void *priv); void (*force_redraw)(void *priv); diff --git a/src/network/net_modem.c b/src/network/net_modem.c index 62621391c..a8eab4290 100644 --- a/src/network/net_modem.c +++ b/src/network/net_modem.c @@ -1621,7 +1621,7 @@ const device_t modem_device = { .init = modem_init, .close = modem_close, .reset = NULL, - .poll = NULL, + .available = NULL, .speed_changed = modem_speed_changed, .force_redraw = NULL, .config = modem_config From 187a1ca416eb49673cc7a56442d70cb9c992ac68 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 13 Feb 2025 00:45:10 +0100 Subject: [PATCH 17/45] The NVR name is now obtained from the selected machine BIOS type if applicable. --- src/86box.c | 6 +++--- src/chipset/sis_5513_p2i.c | 4 ++-- src/device/hwm_lm78.c | 4 ++-- src/include/86box/machine.h | 2 ++ src/machine/m_at_386dx_486.c | 2 +- src/machine/machine_table.c | 23 +++++++++++++++++++++++ src/mem/catalyst_flash.c | 2 +- src/mem/intel_flash.c | 2 +- src/mem/sst_flash.c | 2 +- src/nvr.c | 4 ++-- src/nvr_ps2.c | 4 ++-- 11 files changed, 40 insertions(+), 15 deletions(-) diff --git a/src/86box.c b/src/86box.c index 246d06b16..3ade3c4e2 100644 --- a/src/86box.c +++ b/src/86box.c @@ -457,7 +457,7 @@ delete_nvr_file(uint8_t flash) int c; /* Set up the NVR file's name. */ - c = strlen(machine_get_internal_name()) + 5; + c = strlen(machine_get_nvr_name()) + 5; fn = (char *) malloc(c + 1); if (fn == NULL) @@ -465,9 +465,9 @@ delete_nvr_file(uint8_t flash) flash ? "BIOS flash" : "CMOS"); if (flash) - sprintf(fn, "%s.bin", machine_get_internal_name()); + sprintf(fn, "%s.bin", machine_get_nvr_name()); else - sprintf(fn, "%s.nvr", machine_get_internal_name()); + sprintf(fn, "%s.nvr", machine_get_nvr_name()); remove(nvr_path(fn)); diff --git a/src/chipset/sis_5513_p2i.c b/src/chipset/sis_5513_p2i.c index 3655ccc3f..95a890fcf 100644 --- a/src/chipset/sis_5513_p2i.c +++ b/src/chipset/sis_5513_p2i.c @@ -1287,9 +1287,9 @@ sis_5513_pci_to_isa_init(UNUSED(const device_t *info)) acpi_set_nvr(dev->sis->acpi, dev->nvr); /* Set up the NVR file's name. */ - c = strlen(machine_get_internal_name()) + 9; + c = strlen(machine_get_nvr_name()) + 9; dev->fn = (char *) malloc(c + 1); - sprintf(dev->fn, "%s_apc.nvr", machine_get_internal_name()); + sprintf(dev->fn, "%s_apc.nvr", machine_get_nvr_name()); fp = nvr_fopen(dev->fn, "rb"); diff --git a/src/device/hwm_lm78.c b/src/device/hwm_lm78.c index 1e61168ac..909713833 100644 --- a/src/device/hwm_lm78.c +++ b/src/device/hwm_lm78.c @@ -102,9 +102,9 @@ lm78_log(const char *fmt, ...) void lm78_nvram(lm78_t *dev, uint8_t save) { - size_t l = strlen(machine_get_internal_name_ex(machine)) + 14; + size_t l = strlen(machine_get_nvr_name_ex(machine)) + 14; char *nvr_path = (char *) malloc(l); - sprintf(nvr_path, "%s_as99127f.nvr", machine_get_internal_name_ex(machine)); + sprintf(nvr_path, "%s_as99127f.nvr", machine_get_nvr_name_ex(machine)); FILE *fp = nvr_fopen(nvr_path, save ? "wb" : "rb"); if (fp) { diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index f39187dd9..1ce46de9b 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -361,6 +361,7 @@ extern int machine_available(int m); extern const char *machine_getname(void); extern const char *machine_getname_ex(int m); extern const char *machine_get_internal_name(void); +extern const char *machine_get_nvr_name(void); extern int machine_get_machine_from_internal_name(const char *s); extern void machine_init(void); #ifdef EMU_DEVICE_H @@ -373,6 +374,7 @@ extern const device_t *machine_get_snd_device(int m); extern const device_t *machine_get_net_device(int m); #endif extern const char *machine_get_internal_name_ex(int m); +extern const char *machine_get_nvr_name_ex(int m); extern int machine_get_nvrmask(int m); extern int machine_has_flags(int m, int flags); extern int machine_has_bus(int m, int bus_flags); diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 3d152065b..19c4b535e 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -696,7 +696,7 @@ static const device_config_t pb450_config[] = { .file_filter = "", .spinner = { 0 }, .bios = { - { .name = "PCI 1.0A", .internal_name = "pci10a", .bios_type = BIOS_NORMAL, + { .name = "PCI 1.0A", .internal_name = "pb450" /*"pci10a"*/, .bios_type = BIOS_NORMAL, .files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/pb450/OPTI802.bin", "" } }, { .name = "PNP 1.1A", .internal_name = "pnp11a", .bios_type = BIOS_NORMAL, .files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/pb450/PNP11A.bin", "" } }, diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 458b54013..e6198541e 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -16565,3 +16565,26 @@ machine_is_sony(void) { return (!strcmp(machines[machine].internal_name, "pcv90")); } + +const char * +machine_get_nvr_name_ex(int m) +{ + const char *ret = machines[m].internal_name; + const device_t *dev = machine_get_device(m); + + if (dev != NULL) { + device_context(dev); + const char *bios = device_get_config_string("bios"); + if ((bios != NULL) && (strcmp(bios, "") != 0)) + ret = bios; + device_context_restore(); + } + + return ret; +} + +const char * +machine_get_nvr_name(void) +{ + return machine_get_nvr_name_ex(machine); +} diff --git a/src/mem/catalyst_flash.c b/src/mem/catalyst_flash.c index fd2bb739f..00e2422a3 100644 --- a/src/mem/catalyst_flash.c +++ b/src/mem/catalyst_flash.c @@ -194,7 +194,7 @@ catalyst_flash_init(UNUSED(const device_t *info)) dev = calloc(1, sizeof(flash_t)); - sprintf(flash_path, "%s.bin", machine_get_internal_name_ex(machine)); + sprintf(flash_path, "%s.bin", machine_get_nvr_name_ex(machine)); mem_mapping_disable(&bios_mapping); mem_mapping_disable(&bios_high_mapping); diff --git a/src/mem/intel_flash.c b/src/mem/intel_flash.c index 7375b1f42..e193f3545 100644 --- a/src/mem/intel_flash.c +++ b/src/mem/intel_flash.c @@ -353,7 +353,7 @@ intel_flash_init(const device_t *info) dev = calloc(1, sizeof(flash_t)); - sprintf(flash_path, "%s.bin", machine_get_internal_name_ex(machine)); + sprintf(flash_path, "%s.bin", machine_get_nvr_name_ex(machine)); dev->flags = info->local & 0xff; diff --git a/src/mem/sst_flash.c b/src/mem/sst_flash.c index 5a9c9c877..b41e0f2e2 100644 --- a/src/mem/sst_flash.c +++ b/src/mem/sst_flash.c @@ -507,7 +507,7 @@ sst_init(const device_t *info) FILE *fp; sst_t *dev = calloc(1, sizeof(sst_t)); - sprintf(flash_path, "%s.bin", machine_get_internal_name_ex(machine)); + sprintf(flash_path, "%s.bin", machine_get_nvr_name_ex(machine)); mem_mapping_disable(&bios_mapping); mem_mapping_disable(&bios_high_mapping); diff --git a/src/nvr.c b/src/nvr.c index d0b05b93a..7f43a76c1 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -161,9 +161,9 @@ nvr_init(nvr_t *nvr) int c; /* Set up the NVR file's name. */ - c = strlen(machine_get_internal_name()) + 5; + c = strlen(machine_get_nvr_name()) + 5; nvr->fn = (char *) malloc(c + 1); - sprintf(nvr->fn, "%s.nvr", machine_get_internal_name()); + sprintf(nvr->fn, "%s.nvr", machine_get_nvr_name()); /* Initialize the internal clock as needed. */ memset(&intclk, 0x00, sizeof(intclk)); diff --git a/src/nvr_ps2.c b/src/nvr_ps2.c index 3ca0b0ba5..febf6c165 100644 --- a/src/nvr_ps2.c +++ b/src/nvr_ps2.c @@ -122,9 +122,9 @@ ps2_nvr_init(const device_t *info) nvr->size = 8192; /* Set up the NVR file's name. */ - c = strlen(machine_get_internal_name()) + 9; + c = strlen(machine_get_nvr_name()) + 9; nvr->fn = (char *) malloc(c + 1); - sprintf(nvr->fn, "%s_sec.nvr", machine_get_internal_name()); + sprintf(nvr->fn, "%s_sec.nvr", machine_get_nvr_name()); io_sethandler(0x0074, 3, ps2_nvr_read, NULL, NULL, ps2_nvr_write, NULL, NULL, nvr); From 8ffdff2bd4825f2a09c53d23d9e1778b80eb7812 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 13 Feb 2025 00:52:34 +0100 Subject: [PATCH 18/45] Generic Xt memory expansion: Allow starting at 640k. --- src/device/isamem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device/isamem.c b/src/device/isamem.c index 45a0413be..62fb96f5d 100644 --- a/src/device/isamem.c +++ b/src/device/isamem.c @@ -1024,7 +1024,7 @@ static const device_config_t genericxt_config[] = { .file_filter = NULL, .spinner = { .min = 0, - .max = 624, + .max = 640, .step = 16 }, .selection = { { 0 } }, From 30ca057519af1995cfc07c81d28cf5676f7d2ad8 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 13 Feb 2025 01:06:40 +0100 Subject: [PATCH 19/45] Removed the last remnants of device_t.poll(). --- src/device.c | 15 --------------- src/device/keyboard_at.c | 2 +- src/include/86box/device.h | 2 -- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/device.c b/src/device.c index fa7378c1a..dad583cdc 100644 --- a/src/device.c +++ b/src/device.c @@ -484,21 +484,6 @@ device_has_config(const device_t *dev) return (c > 0) ? 1 : 0; } -int -device_poll(const device_t *dev) -{ - for (uint16_t c = 0; c < DEVICE_MAX; c++) { - if (devices[c] != NULL) { - if (devices[c] == dev) { - if (devices[c]->poll) - return (devices[c]->poll(device_priv[c])); - } - } - } - - return 0; -} - void device_get_name(const device_t *dev, int bus, char *name) { diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index 9b3f06098..589ec7ded 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -2221,7 +2221,7 @@ const device_t keyboard_at_generic_device = { .init = keyboard_at_init, .close = keyboard_at_close, .reset = NULL, - .poll = NULL, + .available = NULL, .speed_changed = NULL, .force_redraw = NULL, .config = keyboard_at_config diff --git a/src/include/86box/device.h b/src/include/86box/device.h index 479e4cbb6..d92a387e9 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -166,7 +166,6 @@ typedef struct _device_ { void (*close)(void *priv); void (*reset)(void *priv); int (*available)(void); - int (*poll)(void *priv); void (*speed_changed)(void *priv); void (*force_redraw)(void *priv); @@ -203,7 +202,6 @@ extern void device_reset_all(uint32_t match_flags); extern void *device_find_first_priv(uint32_t match_flags); extern void *device_get_priv(const device_t *dev); extern int device_available(const device_t *dev); -extern int device_poll(const device_t *dev); extern void device_speed_changed(void); extern void device_force_redraw(void); extern void device_get_name(const device_t *dev, int bus, char *name); From 91ba20fbd08355de79e601040646d5f70d09d501 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 13 Feb 2025 05:10:55 +0100 Subject: [PATCH 20/45] Added the test mode entry point requested by gloriouscow. --- src/86box.c | 24 ++++++++++++++++++++++++ src/cpu/808x.c | 42 ++++++++++++++++++++++++++++++++++++++++++ src/cpu/cpu.h | 8 ++++++++ 3 files changed, 74 insertions(+) diff --git a/src/86box.c b/src/86box.c index 3ade3c4e2..e1cf61b64 100644 --- a/src/86box.c +++ b/src/86box.c @@ -210,6 +210,7 @@ int video_fullscreen_scale_maximized = 0; /* (C) Whether int do_auto_pause = 0; /* (C) Auto-pause the emulator on focus loss */ int hook_enabled = 1; /* (C) Keyboard hook is enabled */ +int test_mode = 0; /* (C) Test mode */ char uuid[MAX_UUID_LEN] = { '\0' }; /* (C) UUID or machine identifier */ int other_ide_present = 0; /* IDE controllers from non-IDE cards are @@ -585,6 +586,7 @@ usage: #ifndef USE_SDL_UI printf("-S or --settings - show only the settings dialog\n"); #endif + printf("-T or --testmode - test mode: execute the test mode entry point on init/hard reset\n"); printf("-V or --vmname name - overrides the name of the running VM\n"); printf("-W or --nohook - disables keyboard hook (compatibility-only outside Windows)\n"); printf("-X or --clear what - clears the 'what' (cmos/flash/both)\n"); @@ -656,6 +658,8 @@ usage: } else if (!strcasecmp(argv[c], "--settings") || !strcasecmp(argv[c], "-S")) { settings_only = 1; #endif + } else if (!strcasecmp(argv[c], "--testmode") || !strcasecmp(argv[c], "-T")) { + test_mode = 1; } else if (!strcasecmp(argv[c], "--noconfirm") || !strcasecmp(argv[c], "-N")) { confirm_exit_cmdl = 0; } else if (!strcasecmp(argv[c], "--missing") || !strcasecmp(argv[c], "-M")) { @@ -1112,6 +1116,23 @@ pc_send_cae(void) pc_send_ca(1); } +/* + Currently available API: + + extern void prefetch_queue_set_pos(int pos); + extern void prefetch_queue_set_ip(uint16_t ip); + extern void prefetch_queue_set_prefetching(int p); + extern int prefetch_queue_get_pos(void); + extern uint16_t prefetch_queue_get_ip(void); + extern int prefetch_queue_get_prefetching(void); + extern int prefetch_queue_get_size(void); + */ +static void +pc_test_mode_entry_point(void) +{ + pclog("Test mode entry point\n=====================\n"); +} + void pc_reset_hard_close(void) { @@ -1313,6 +1334,9 @@ pc_reset_hard_init(void) update_mouse_msg(); + if (test_mode) + pc_test_mode_entry_point(); + ui_hard_reset_completed(); } diff --git a/src/cpu/808x.c b/src/cpu/808x.c index a74cf84ab..e3a326503 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -154,6 +154,48 @@ x808x_log(const char *fmt, ...) static void pfq_add(int c, int add); static void set_pzs(int bits); +void +prefetch_queue_set_pos(int pos) +{ + pfq_pos = pos; +} + +void +prefetch_queue_set_ip(uint16_t ip) +{ + pfq_ip = ip; +} + +void +prefetch_queue_set_prefetching(int p) +{ + prefetching = p; +} + +int +prefetch_queue_get_pos(void) +{ + return pfq_pos; +} + +uint16_t +prefetch_queue_get_ip(void) +{ + return pfq_ip; +} + +int +prefetch_queue_get_prefetching(void) +{ + return prefetching; +} + +int +prefetch_queue_get_size(void) +{ + return pfq_size; +} + uint16_t get_last_addr(void) { diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index bd841ccc6..ab4bad8b0 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -821,4 +821,12 @@ extern int cpu_override_interpreter; extern int is_lock_legal(uint32_t fetchdat); +extern void prefetch_queue_set_pos(int pos); +extern void prefetch_queue_set_ip(uint16_t ip); +extern void prefetch_queue_set_prefetching(int p); +extern int prefetch_queue_get_pos(void); +extern uint16_t prefetch_queue_get_ip(void); +extern int prefetch_queue_get_prefetching(void); +extern int prefetch_queue_get_size(void); + #endif /*EMU_CPU_H*/ From 63fbe6ab4faab499a1bdb04d92f41f3d1a14b8d8 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 13 Feb 2025 05:27:10 +0100 Subject: [PATCH 21/45] Documented three more functions. --- src/86box.c | 4 ++++ src/cpu/cpu.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/86box.c b/src/86box.c index e1cf61b64..f8d632e11 100644 --- a/src/86box.c +++ b/src/86box.c @@ -1119,6 +1119,10 @@ pc_send_cae(void) /* Currently available API: + extern void resetx86(void); + extern void softresetx86(void); + extern void hardresetx86(void); + extern void prefetch_queue_set_pos(int pos); extern void prefetch_queue_set_ip(uint16_t ip); extern void prefetch_queue_set_prefetching(int p); diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index ab4bad8b0..1d003ddc9 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -829,4 +829,7 @@ extern uint16_t prefetch_queue_get_ip(void); extern int prefetch_queue_get_prefetching(void); extern int prefetch_queue_get_size(void); +#define prefetch_queue_set_suspended(s) prefetch_queue_set_prefetching(!s) +#define prefetch_queue_get_suspended !prefetch_queue_get_prefetching + #endif /*EMU_CPU_H*/ From 7c422a4d507222b00c8f1edc1ce1cdff77dd9a88 Mon Sep 17 00:00:00 2001 From: rushieda <185547947+rushieda@users.noreply.github.com> Date: Thu, 13 Feb 2025 12:07:13 +0300 Subject: [PATCH 22/45] Block AMD and Cyrix CPUs from Intel Socket 5/7 motherboards with stock BIOS --- src/machine/machine_table.c | 48 ++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index e6198541e..e55d9b494 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -9762,7 +9762,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_Cx6x86), .min_bus = 50000000, .max_bus = 66666667, .min_voltage = 3520, @@ -9802,7 +9802,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_Cx6x86), .min_bus = 50000000, .max_bus = 66666667, .min_voltage = 3520, @@ -9843,7 +9843,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_Cx6x86), .min_bus = 50000000, .max_bus = 66666667, .min_voltage = 3380, @@ -10087,7 +10087,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_Cx6x86), .min_bus = 50000000, .max_bus = 66666667, .min_voltage = 3380, @@ -10741,7 +10741,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_Cx6x86), .min_bus = 50000000, .max_bus = 66666667, .min_voltage = 3380, @@ -10824,7 +10824,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_Cx6x86), .min_bus = 50000000, .max_bus = 66666667, .min_voltage = 3380, @@ -10908,7 +10908,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_Cx6x86), .min_bus = 50000000, .max_bus = 66666667, .min_voltage = 3380, @@ -10989,7 +10989,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_Cx6x86), .min_bus = 50000000, .max_bus = 66666667, .min_voltage = 3380, @@ -11236,7 +11236,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_K5, CPU_5K86, CPU_Cx6x86), .min_bus = 50000000, .max_bus = 66666667, .min_voltage = 3380, @@ -11647,7 +11647,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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 = 50000000, .max_bus = 66666667, .min_voltage = 2800, @@ -11687,7 +11688,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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 = 50000000, .max_bus = 66666667, .min_voltage = 2800, @@ -11727,7 +11729,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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 = 50000000, .max_bus = 66666667, .min_voltage = 2800, @@ -11767,7 +11770,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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 = 50000000, .max_bus = 66666667, .min_voltage = 2800, @@ -11850,7 +11854,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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 = 50000000, .max_bus = 66666667, .min_voltage = 2800, @@ -12177,7 +12182,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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 = 50000000, .max_bus = 66666667, .min_voltage = 2500, @@ -12299,7 +12305,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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 = 50000000, .max_bus = 66666667, .min_voltage = 2200, @@ -12382,7 +12389,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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 = 50000000, .max_bus = 66666667, .min_voltage = 2800, @@ -12668,7 +12676,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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, @@ -12709,7 +12718,8 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET5_7, - .block = CPU_BLOCK_NONE, + .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, From 6362351987b3170a7a5f84de81211b38dd6c9f09 Mon Sep 17 00:00:00 2001 From: pankozaC++ <77279607+pankoza2-pl@users.noreply.github.com> Date: Thu, 13 Feb 2025 19:14:36 +0100 Subject: [PATCH 23/45] bring back the Slot 1 to Socket 8 adapter --- src/cpu/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 808f603b5..0802fa3ac 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -372,7 +372,7 @@ cpu_is_eligible(const cpu_family_t *cpu_family, int cpu, int machine) if (packages & CPU_PKG_SOCKET3) packages |= CPU_PKG_SOCKET1; else if (packages & CPU_PKG_SLOT1) - packages |= CPU_PKG_SOCKET370; + packages |= CPU_PKG_SOCKET370 | CPU_PKG_SOCKET8; /* Package type. */ if (!(cpu_family->package & packages)) From f5d65f2e66da32e335b3032b58ce164ccb882e63 Mon Sep 17 00:00:00 2001 From: pankozaC++ <77279607+pankoza2-pl@users.noreply.github.com> Date: Thu, 13 Feb 2025 19:21:19 +0100 Subject: [PATCH 24/45] Just block Pentium Pro on incompatibile machines, instead of removing the Slot 1-to-Socket 8 adapter altogether (part 2) --- src/machine/machine_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index e55d9b494..72271ee7e 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -15278,7 +15278,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SLOT1, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_PENTIUMPRO), .min_bus = 66666667, .max_bus = 150000000, .min_voltage = 1300, @@ -16163,7 +16163,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SLOT1, - .block = CPU_BLOCK(CPU_PENTIUM2, CPU_CYRIX3S), + .block = CPU_BLOCK(CPU_PENTIUMPRO, CPU_PENTIUM2, CPU_CYRIX3S), .min_bus = 0, .max_bus = 66666667, .min_voltage = 0, From 5b6a965900fe49f1cfb96104d983a279d15680e3 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 14 Feb 2025 07:10:55 +0100 Subject: [PATCH 25/45] Bring machine flags on par with device flag and clean up device_is_valid() accordingly. --- src/device.c | 84 ++++++++++--------------------------- src/device/kbc_at.c | 31 +++++--------- src/include/86box/device.h | 26 ++++++++---- src/include/86box/machine.h | 64 ++++++++++++++-------------- src/machine/machine_table.c | 42 ++++++++++++++----- src/pic.c | 2 +- 6 files changed, 112 insertions(+), 137 deletions(-) diff --git a/src/device.c b/src/device.c index dad583cdc..7cfa1d70e 100644 --- a/src/device.c +++ b/src/device.c @@ -490,7 +490,7 @@ device_get_name(const device_t *dev, int bus, char *name) const char *sbus = NULL; const char *fbus; char *tname; - char pbus[8] = { 0 }; + char pbus[11] = { 0 }; if (dev == NULL) return; @@ -498,8 +498,21 @@ device_get_name(const device_t *dev, int bus, char *name) name[0] = 0x00; if (bus) { - if (dev->flags & DEVICE_ISA) - sbus = (dev->flags & DEVICE_AT) ? "ISA16" : "ISA"; + if ((dev->flags & (DEVICE_PCJR | DEVICE_ISA)) == + (DEVICE_PCJR | DEVICE_ISA)) + sbus = "ISA/PCJR"; + else if (dev->flags & DEVICE_SIDECAR) + sbus = "Sidecar"; + else if (dev->flags & DEVICE_XT_KBC) + sbus = "XT KBC"; + else if (dev->flags & DEVICE_ISA16) + sbus = "ISA16"; + else if (dev->flags & DEVICE_AT_KBC) + sbus = "AT KBC"; + else if (dev->flags & DEVICE_PS2_KBC) + sbus = "PS/2 KBC"; + else if (dev->flags & DEVICE_ISA) + sbus = "ISA"; else if (dev->flags & DEVICE_CBUS) sbus = "C-BUS"; else if (dev->flags & DEVICE_PCMCIA) @@ -519,7 +532,7 @@ device_get_name(const device_t *dev, int bus, char *name) else if (dev->flags & DEVICE_PCI) sbus = "PCI"; else if (dev->flags & DEVICE_CARDBUS) - sbus = "CARDBUS"; + sbus = "CardBus"; else if (dev->flags & DEVICE_USB) sbus = "USB"; else if (dev->flags & DEVICE_AGP) @@ -780,67 +793,12 @@ device_set_config_mac(const char *str, int val) int device_is_valid(const device_t *device, int mch) { - if (device == NULL) - return 1; + int ret = 1; - if ((device->flags & DEVICE_PCJR) && !machine_has_bus(mch, MACHINE_BUS_PCJR)) - return 0; + if (device != NULL) + ret = machine_has_bus(mch, device->flags & DEVICE_BUS); - if ((device->flags & DEVICE_XTKBC) && machine_has_bus(mch, MACHINE_BUS_ISA16) && !machine_has_bus(mch, MACHINE_BUS_DM_KBC)) - return 0; - - if ((device->flags & DEVICE_AT) && !machine_has_bus(mch, MACHINE_BUS_ISA16)) - return 0; - - if ((device->flags & DEVICE_ATKBC) && !machine_has_bus(mch, MACHINE_BUS_ISA16) && !machine_has_bus(mch, MACHINE_BUS_DM_KBC)) - return 0; - - if ((device->flags & DEVICE_PS2) && !machine_has_bus(mch, MACHINE_BUS_PS2_PORTS)) - return 0; - - if ((device->flags & DEVICE_ISA) && !machine_has_bus(mch, MACHINE_BUS_ISA)) - return 0; - - if ((device->flags & DEVICE_CBUS) && !machine_has_bus(mch, MACHINE_BUS_CBUS)) - return 0; - - if ((device->flags & DEVICE_PCMCIA) && !machine_has_bus(mch, MACHINE_BUS_PCMCIA) && !machine_has_bus(mch, MACHINE_BUS_ISA)) - return 0; - - if ((device->flags & DEVICE_MCA) && !machine_has_bus(mch, MACHINE_BUS_MCA)) - return 0; - - if ((device->flags & DEVICE_HIL) && !machine_has_bus(mch, MACHINE_BUS_HIL)) - return 0; - - if ((device->flags & DEVICE_EISA) && !machine_has_bus(mch, MACHINE_BUS_EISA)) - return 0; - - if ((device->flags & DEVICE_AT32) && !machine_has_bus(mch, MACHINE_BUS_AT32)) - return 0; - - if ((device->flags & DEVICE_OLB) && !machine_has_bus(mch, MACHINE_BUS_OLB)) - return 0; - - if ((device->flags & DEVICE_VLB) && !machine_has_bus(mch, MACHINE_BUS_VLB)) - return 0; - - if ((device->flags & DEVICE_PCI) && !machine_has_bus(mch, MACHINE_BUS_PCI)) - return 0; - - if ((device->flags & DEVICE_CARDBUS) && !machine_has_bus(mch, MACHINE_BUS_CARDBUS) && !machine_has_bus(mch, MACHINE_BUS_PCI)) - return 0; - - if ((device->flags & DEVICE_USB) && !machine_has_bus(mch, MACHINE_BUS_USB)) - return 0; - - if ((device->flags & DEVICE_AGP) && !machine_has_bus(mch, MACHINE_BUS_AGP)) - return 0; - - if ((device->flags & DEVICE_AC97) && !machine_has_bus(mch, MACHINE_BUS_AC97)) - return 0; - - return 1; + return ret; } int diff --git a/src/device/kbc_at.c b/src/device/kbc_at.c index ad1625873..09855a387 100644 --- a/src/device/kbc_at.c +++ b/src/device/kbc_at.c @@ -810,27 +810,18 @@ write_p2(atkbc_t *dev, uint8_t val) if (!(val & 0x01)) { /* Pin 0 selected. */ /* Pin 0 selected. */ kbc_at_log("write_p2(): Pulse reset!\n"); - if (machines[machine].flags & MACHINE_COREBOOT) { - /* The SeaBIOS hard reset code attempts a KBC reset if ACPI RESET_REG - is not available. However, the KBC reset is normally a soft reset, so - SeaBIOS gets caught in a soft reset loop as it tries to hard reset the - machine. Hack around this by making the KBC reset a hard reset only on - coreboot machines. */ - pc_reset_hard(); - } else { - softresetx86(); /* Pulse reset! */ - cpu_set_edx(); - flushmmucache(); - if ((kbc_ven == KBC_VEN_ALI) || !strcmp(machine_get_internal_name(), "spc7700plw")) - smbase = 0x00030000; + softresetx86(); /* Pulse reset! */ + cpu_set_edx(); + flushmmucache(); + if ((kbc_ven == KBC_VEN_ALI) || !strcmp(machine_get_internal_name(), "spc7700plw")) + smbase = 0x00030000; - /* Yes, this is a hack, but until someone gets ahold of the real PCD-2L - and can find out what they actually did to make it boot from FFFFF0 - correctly despite A20 being gated when the CPU is reset, this will - have to do. */ - if ((kbc_ven == KBC_VEN_SIEMENS) || !strcmp(machine_get_internal_name(), "acera1g")) - is486 ? loadcs(0xf000) : loadcs_2386(0xf000); - } + /* Yes, this is a hack, but until someone gets ahold of the real PCD-2L + and can find out what they actually did to make it boot from FFFFF0 + correctly despite A20 being gated when the CPU is reset, this will + have to do. */ + if ((kbc_ven == KBC_VEN_SIEMENS) || !strcmp(machine_get_internal_name(), "acera1g")) + is486 ? loadcs(0xf000) : loadcs_2386(0xf000); } } diff --git a/src/include/86box/device.h b/src/include/86box/device.h index d92a387e9..d074cc2fc 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -79,15 +79,15 @@ // #define CONFIG_STANDALONE 257 /* not available on the on-board variant */ enum { - DEVICE_PCJR = 2, /* requires an IBM PCjr */ - DEVICE_XTKBC = 4, /* requires an XT-compatible keyboard controller */ - DEVICE_AT = 8, /* requires an AT-compatible system */ - DEVICE_ATKBC = 0x10, /* requires an AT-compatible keyboard controller */ - DEVICE_PS2 = 0x20, /* requires a PS/1 or PS/2 system */ - DEVICE_ISA = 0x40, /* requires the ISA bus */ - DEVICE_CBUS = 0x80, /* requires the C-BUS bus */ - DEVICE_PCMCIA = 0x100, /* requires the PCMCIA bus */ - DEVICE_MCA = 0x200, /* requires the MCA bus */ + DEVICE_SIDECAR = 2, /* requires an IBM PCjr */ + DEVICE_ISA = 4, /* requires the ISA bus */ + DEVICE_XT_KBC = 8, /* requires an XT-compatible keyboard controller */ + DEVICE_CBUS = 0x10, /* requires the C-BUS bus */ + DEVICE_ISA16 = 0x20, /* requires an AT-compatible system */ + DEVICE_AT_KBC = 0x40, /* requires an AT-compatible keyboard controller */ + DEVICE_MCA = 0x80, /* requires the MCA bus */ + DEVICE_PS2_KBC = 0x100, /* requires a PS/1 or PS/2 system */ + DEVICE_PCMCIA = 0x200, /* requires the PCMCIA bus */ DEVICE_HIL = 0x400, /* requires the HP HIL bus */ DEVICE_EISA = 0x800, /* requires the EISA bus */ DEVICE_AT32 = 0x1000, /* requires the Mylex AT/32 local bus */ @@ -98,8 +98,11 @@ enum { DEVICE_USB = 0x20000, /* requires the USB bus */ DEVICE_AGP = 0x40000, /* requires the AGP bus */ DEVICE_AC97 = 0x80000, /* requires the AC'97 bus */ + DEVICE_BUS = 0xfffff, /* requires a machine bus */ + DEVICE_COM = 0x100000, /* requires a serial port */ DEVICE_LPT = 0x200000, /* requires a parallel port */ + DEVICE_KBC = 0x400000, /* is a keyboard controller */ DEVICE_SOFTRESET = 0x800000, /* requires to be reset on soft reset */ @@ -109,6 +112,11 @@ enum { DEVICE_ALL = 0xffffffff /* match all devices */ }; +/* TODO: Remove this once all the devices' flags have been updated. */ +#define DEVICE_AT DEVICE_ISA16 +#define DEVICE_PCJR DEVICE_SIDECAR +#define DEVICE_PS2 DEVICE_PS2_KBC + #define BIOS_NORMAL 0 #define BIOS_INTERLEAVED 1 #define BIOS_INTERLEAVED_SINGLEFILE 2 diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 1ce46de9b..2c5440438 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -23,34 +23,31 @@ #define EMU_MACHINE_H /* Machine feature flags. */ -#define MACHINE_BUS_NONE 0x00000000 /* sys has no bus */ +#define MACHINE_BUS_NONE 0x00000000 /* sys has no bus */ /* Feature flags for BUS'es. */ -#define MACHINE_BUS_ISA 0x00000001 /* sys has ISA bus */ -#define MACHINE_BUS_CASSETTE 0x00000002 /* sys has cassette port */ -#define MACHINE_BUS_CARTRIDGE 0x00000004 /* sys has two cartridge bays */ -#define MACHINE_BUS_PCJR 0x00000008 /* sys has PCjr sidecar bus */ -#define MACHINE_BUS_DM_KBC 0x00000010 /* system has keyboard controller that supports - both XT and AT keyboards */ +#define MACHINE_BUS_CASSETTE 0x00000001 /* sys has cassette port */ +#define MACHINE_BUS_ISA 0x00000002 /* sys has ISA bus */ +#define MACHINE_BUS_SIDECAR 0x00000004 /* sys has PCjr sidecar bus */ +#define MACHINE_BUS_XT_KBD 0x00000008 /* sys has an XT keyboard port */ +#define MACHINE_BUS_CBUS 0x00000010 /* sys has C-BUS bus */ #define MACHINE_BUS_ISA16 0x00000020 /* sys has ISA16 bus - PC/AT architecture */ -#define MACHINE_BUS_CBUS 0x00000040 /* sys has C-BUS bus */ -#define MACHINE_BUS_PCMCIA 0x00000080 /* sys has PCMCIA bus */ -#define MACHINE_BUS_PS2_LATCH 0x00000100 /* system has PS/2 keyboard controller IRQ latch */ -#define MACHINE_BUS_PS2_PORTS 0x00000200 /* system has PS/2 keyboard and mouse ports */ -#define MACHINE_BUS_PS2 (MACHINE_BUS_PS2_LATCH | MACHINE_BUS_PS2_PORTS) +#define MACHINE_BUS_AT_KBD 0x00000040 /* sys has an AT keyboard port */ +#define MACHINE_BUS_MCA 0x00000080 /* sys has MCA bus */ +#define MACHINE_BUS_PS2_PORTS 0x00000100 /* system has PS/2 keyboard and mouse ports */ +#define MACHINE_BUS_PS2 MACHINE_BUS_PS2_PORTS +#define MACHINE_BUS_PCMCIA 0x00000200 /* sys has PCMCIA bus */ #define MACHINE_BUS_HIL 0x00000400 /* system has HP HIL keyboard and mouse ports */ #define MACHINE_BUS_EISA 0x00000800 /* sys has EISA bus */ #define MACHINE_BUS_AT32 0x00001000 /* sys has Mylex AT/32 local bus */ #define MACHINE_BUS_OLB 0x00002000 /* sys has OPTi local bus */ #define MACHINE_BUS_VLB 0x00004000 /* sys has VL bus */ -#define MACHINE_BUS_MCA 0x00008000 /* sys has MCA bus */ -#define MACHINE_BUS_PCI 0x00010000 /* sys has PCI bus */ -#define MACHINE_BUS_CARDBUS 0x00020000 /* sys has CardBus bus */ -#define MACHINE_BUS_USB 0x00040000 /* sys has USB bus */ -#define MACHINE_BUS_AGP 0x00080000 /* sys has AGP bus */ -#define MACHINE_BUS_AC97 0x00100000 /* sys has AC97 bus (ACR/AMR/CNR slot) */ +#define MACHINE_BUS_PCI 0x00008000 /* sys has PCI bus */ +#define MACHINE_BUS_CARDBUS 0x00010000 /* sys has CardBus bus */ +#define MACHINE_BUS_USB 0x00020000 /* sys has USB bus */ +#define MACHINE_BUS_AGP 0x00040000 /* sys has AGP bus */ +#define MACHINE_BUS_AC97 0x00080000 /* sys has AC97 bus (ACR/AMR/CNR slot) */ /* Aliases. */ #define MACHINE_CASSETTE (MACHINE_BUS_CASSETTE) /* sys has cassette port */ -#define MACHINE_CARTRIDGE (MACHINE_BUS_CARTRIDGE) /* sys has two cartridge bays */ /* Combined flags. */ #define MACHINE_PC (MACHINE_BUS_ISA) /* sys is PC/XT-compatible (ISA) */ #define MACHINE_AT (MACHINE_BUS_ISA | MACHINE_BUS_ISA16) /* sys is AT-compatible (ISA + ISA16) */ @@ -69,18 +66,18 @@ #define MACHINE_AGP (MACHINE_BUS_AGP | MACHINE_PCI) /* sys is AT-compatible with AGP */ #define MACHINE_AGP98 (MACHINE_BUS_AGP | MACHINE_PCI98) /* sys is NEC PC-98x1 series with AGP (did that even exist?) */ -#define MACHINE_PC5150 (MACHINE_PC | MACHINE_CASSETTE) /* sys is IBM PC 5150 */ -#define MACHINE_PCJR (MACHINE_PC | MACHINE_CASSETTE | MACHINE_CARTRIDGE) /* sys is PCjr */ -#define MACHINE_PS2 (MACHINE_AT | MACHINE_BUS_PS2) /* sys is PS/2 */ -#define MACHINE_PS2_MCA (MACHINE_MCA | MACHINE_BUS_PS2) /* sys is MCA PS/2 */ -#define MACHINE_PS2_VLB (MACHINE_VLB | MACHINE_BUS_PS2) /* sys is VLB PS/2 */ -#define MACHINE_PS2_PCI (MACHINE_PCI | MACHINE_BUS_PS2) /* sys is PCI PS/2 */ -#define MACHINE_PS2_PCIV (MACHINE_PCIV | MACHINE_BUS_PS2) /* sys is VLB/PCI PS/2 */ -#define MACHINE_PS2_AGP (MACHINE_AGP | MACHINE_BUS_PS2) /* sys is AGP PS/2 */ -#define MACHINE_PS2_A97 (MACHINE_PS2_AGP | MACHINE_BUS_AC97) /* sys is AGP/AC97 PS/2 */ -#define MACHINE_PS2_NOISA (MACHINE_PS2_AGP & ~MACHINE_AT) /* sys is AGP PS/2 without ISA */ -#define MACHINE_PS2_PCIONLY (MACHINE_PS2_NOISA & ~MACHINE_BUS_AGP) /* sys is PCI PS/2 without ISA */ -#define MACHINE_PS2_NOI97 (MACHINE_PS2_A97 & ~MACHINE_AT) /* sys is AGP/AC97 PS/2 without ISA */ +#define MACHINE_PC5150 (MACHINE_PC | MACHINE_CASSETTE) /* sys is IBM PC 5150 */ +#define MACHINE_PCJR (MACHINE_PC | MACHINE_CASSETTE | MACHINE_BUS_SIDECAR) /* sys is PCjr */ +#define MACHINE_PS2 (MACHINE_AT | MACHINE_BUS_PS2) /* sys is PS/2 */ +#define MACHINE_PS2_MCA (MACHINE_MCA | MACHINE_BUS_PS2) /* sys is MCA PS/2 */ +#define MACHINE_PS2_VLB (MACHINE_VLB | MACHINE_BUS_PS2) /* sys is VLB PS/2 */ +#define MACHINE_PS2_PCI (MACHINE_PCI | MACHINE_BUS_PS2) /* sys is PCI PS/2 */ +#define MACHINE_PS2_PCIV (MACHINE_PCIV | MACHINE_BUS_PS2) /* sys is VLB/PCI PS/2 */ +#define MACHINE_PS2_AGP (MACHINE_AGP | MACHINE_BUS_PS2) /* sys is AGP PS/2 */ +#define MACHINE_PS2_A97 (MACHINE_PS2_AGP | MACHINE_BUS_AC97) /* sys is AGP/AC97 PS/2 */ +#define MACHINE_PS2_NOISA (MACHINE_PS2_AGP & ~MACHINE_AT) /* sys is AGP PS/2 without ISA */ +#define MACHINE_PS2_PCIONLY (MACHINE_PS2_NOISA & ~MACHINE_BUS_AGP) /* sys is PCI PS/2 without ISA */ +#define MACHINE_PS2_NOI97 (MACHINE_PS2_A97 & ~MACHINE_AT) /* sys is AGP/AC97 PS/2 without ISA */ /* Feature flags for miscellaneous internal devices. */ #define MACHINE_FLAGS_NONE 0x00000000 /* sys has no int devices */ #define MACHINE_SOFTFLOAT_ONLY 0x00000001 /* sys requires SoftFloat FPU */ @@ -93,7 +90,8 @@ #define MACHINE_LPT_PRI 0x00000080 /* sys has int pri LPT */ #define MACHINE_LPT_SEC 0x00000100 /* sys has int sec LPT */ #define MACHINE_LPT_TER 0x00000200 /* sys has int ter LPT */ -#define MACHINE_LPT_QUA 0x00000400 /* sys has int qua LPT */ +#define MACHINE_PS2_KBC 0x00000400 /* sys has a PS/2 keyboard controller */ + /* this is separate from having PS/2 ports */ #define MACHINE_UART_PRI 0x00000800 /* sys has int pri UART */ #define MACHINE_UART_SEC 0x00001000 /* sys has int sec UART */ #define MACHINE_UART_TER 0x00002000 /* sys has int ter UART */ @@ -106,7 +104,7 @@ #define MACHINE_APM 0x00080000 /* sys has APM */ #define MACHINE_ACPI 0x00100000 /* sys has ACPI */ #define MACHINE_HWM 0x00200000 /* sys has hw monitor */ -#define MACHINE_COREBOOT 0x00400000 /* sys has coreboot BIOS */ +#define MACHINE_CARTRIDGE 0x00400000 /* sys has cartridge bays */ /* Feature flags for internal storage controllers. */ #define MACHINE_MFM 0x00800000 /* sys has int MFM/RLL */ #define MACHINE_XTA 0x01000000 /* sys has int XTA */ diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index e6198541e..765943fba 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -8257,8 +8257,8 @@ const machine_t machines[] = { .min_multi = 0, .max_multi = 0 }, - .bus_flags = MACHINE_BUS_PS2_LATCH | MACHINE_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_PS2_KBC | MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -8337,8 +8337,8 @@ const machine_t machines[] = { .min_multi = 0, .max_multi = 0 }, - .bus_flags = MACHINE_BUS_PS2_LATCH | MACHINE_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_PS2_KBC | MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 261120, @@ -8539,8 +8539,8 @@ const machine_t machines[] = { .min_multi = 0, .max_multi = 0 }, - .bus_flags = MACHINE_PCI | MACHINE_BUS_PS2_LATCH, - .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_PS2_KBC | MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -9198,8 +9198,8 @@ const machine_t machines[] = { .min_multi = MACHINE_MULTIPLIER_FIXED, .max_multi = MACHINE_MULTIPLIER_FIXED }, - .bus_flags = MACHINE_BUS_PS2_LATCH | MACHINE_PCI, - .flags = MACHINE_APM, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_PS2_KBC | MACHINE_APM, .ram = { .min = 2048, .max = 196608, @@ -16497,19 +16497,39 @@ machine_get_nvrmask(int m) int machine_has_flags(int m, int flags) { - return (machines[m].flags & flags); + int ret = machines[m].flags & flags; + + /* Can't have PS/2 ports with an AT KBC. */ + if ((flags & MACHINE_PS2_KBC) && + (machines[m].bus_flags & MACHINE_BUS_PS2_PORTS)) + ret |= MACHINE_PS2_KBC; + + return ret; } int machine_has_bus(int m, int bus_flags) { - return (machines[m].bus_flags & bus_flags); + int ret = machines[m].bus_flags & bus_flags; + + /* TODO: Move the KBD flags to the machine table! */ + if ((bus_flags & MACHINE_BUS_XT_KBD) && + !(machines[m].bus_flags & MACHINE_BUS_ISA16) && + !(machines[m].bus_flags & MACHINE_BUS_PS2_PORTS)) + ret |= MACHINE_BUS_XT_KBD; + + if ((bus_flags & MACHINE_BUS_AT_KBD) && + (IS_AT(m)) && + !(machines[m].bus_flags & MACHINE_BUS_PS2_PORTS)) + ret |= MACHINE_BUS_AT_KBD; + + return ret; } int machine_has_cartridge(int m) { - return (machine_has_bus(m, MACHINE_CARTRIDGE) ? 1 : 0); + return (machine_has_flags(m, MACHINE_CARTRIDGE) ? 1 : 0); } int diff --git a/src/pic.c b/src/pic.c index 7f6eda40d..cf17e8205 100644 --- a/src/pic.c +++ b/src/pic.c @@ -629,7 +629,7 @@ pic_reset_hard(void) /* The situation is as follows: There is a giant mess when it comes to these latches on real hardware, to the point that there's even boards with board-level latched that get used in place of the latches on the chipset, therefore, I'm just doing this here for the sake of simplicity. */ - if (machine_has_bus(machine, MACHINE_BUS_PS2_LATCH)) { + if (machine_has_flags(machine, MACHINE_PS2_KBC)) { pic_kbd_latch(0x01); pic_mouse_latch(0x01); } else { From a72b3884b578bcb8d304ceac3da77c7fc30420a3 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 14 Feb 2025 07:26:22 +0100 Subject: [PATCH 26/45] Fixed (S)VGA memory access bitness stuff. --- src/video/vid_svga.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index e68e4c1a0..7c674e00a 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -1528,7 +1528,11 @@ svga_init(const device_t *info, svga_t *svga, void *priv, int memsize, svga->translate_address = NULL; svga->ksc5601_english_font_type = 0; - if ((info->flags & DEVICE_PCI) || (info->flags & DEVICE_VLB) || (info->flags & DEVICE_MCA)) { + /* TODO: Move DEVICE_MCA to 16-bit once the device flags have been appropriately corrected. */ + if ((info->flags & DEVICE_MCA) || (info->flags & DEVICE_MCA32) || + (info->flags & DEVICE_EISA) || (info->flags & DEVICE_AT32) || + (info->flags & DEVICE_OLB) || (info->flags & DEVICE_VLB) || + (info->flags & DEVICE_PCI) || (info->flags & DEVICE_AGP)) { svga->read = svga_read; svga->readw = svga_readw; svga->readl = svga_readl; @@ -1539,7 +1543,8 @@ svga_init(const device_t *info, svga_t *svga, void *priv, int memsize, svga_read, svga_readw, svga_readl, svga_write, svga_writew, svga_writel, NULL, MEM_MAPPING_EXTERNAL, svga); - } else if ((info->flags & DEVICE_ISA) && (info->flags & DEVICE_AT)) { + /* The chances of ever seeing a C-BUS (S)VGA card are approximately zero, but you never know. */ + } else if ((info->flags & DEVICE_CBUS) || (info->flags & DEVICE_ISA16)) { svga->read = svga_read; svga->readw = svga_readw; svga->readl = NULL; From 2c197000ea78f0f6a20043febf89ea93e5ee34c4 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 14 Feb 2025 07:39:21 +0100 Subject: [PATCH 27/45] Removed the legacy #defines in device.h. --- src/cdrom/cdrom_mitsumi.c | 2 +- src/chipset/ali6117.c | 4 ++-- src/device.c | 10 +++++---- src/device/bugger.c | 2 +- src/device/keyboard_at.c | 2 +- src/device/mouse_ps2.c | 2 +- src/device/serial.c | 4 ++-- src/device/smbus_ali7101.c | 2 +- src/device/smbus_piix4.c | 4 ++-- src/device/smbus_sis5595.c | 2 +- src/disk/hdc_esdi_at.c | 2 +- src/disk/hdc_ide.c | 26 +++++++++++----------- src/disk/hdc_st506_at.c | 2 +- src/disk/hdc_xtide.c | 4 ++-- src/disk/lba_enhancer.c | 2 +- src/include/86box/device.h | 32 ++++++++++++--------------- src/include/86box/machine.h | 25 +++++++++++---------- src/ioapic.c | 2 +- src/machine/m_ps1_hdc.c | 2 +- src/mem/row.c | 2 +- src/network/net_ne2000.c | 8 +++---- src/network/net_pcnet.c | 8 +++---- src/nvr_at.c | 30 ++++++++++++------------- src/scsi/scsi_aha154x.c | 10 ++++----- src/scsi/scsi_buslogic.c | 8 +++---- src/sound/snd_azt2316a.c | 4 ++-- src/sound/snd_cs423x.c | 14 ++++++------ src/sound/snd_gus.c | 2 +- src/sound/snd_optimc.c | 4 ++-- src/sound/snd_pas16.c | 4 ++-- src/sound/snd_sb.c | 44 ++++++++++++++++++------------------- src/sound/snd_wss.c | 2 +- src/video/vid_8514a.c | 2 +- src/video/vid_ati_mach64.c | 2 +- src/video/vid_cl54xx.c | 22 +++++++++---------- src/video/vid_et4000w32.c | 6 ++--- src/video/vid_ht216.c | 2 +- src/video/vid_s3.c | 12 +++++----- src/video/vid_xga.c | 4 ++-- 39 files changed, 160 insertions(+), 161 deletions(-) diff --git a/src/cdrom/cdrom_mitsumi.c b/src/cdrom/cdrom_mitsumi.c index 7ef8a04b2..e27faab94 100644 --- a/src/cdrom/cdrom_mitsumi.c +++ b/src/cdrom/cdrom_mitsumi.c @@ -459,7 +459,7 @@ mitsumi_cdrom_close(void *priv) const device_t mitsumi_cdrom_device = { .name = "Mitsumi CD-ROM interface", .internal_name = "mcd", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = mitsumi_cdrom_init, .close = mitsumi_cdrom_close, diff --git a/src/chipset/ali6117.c b/src/chipset/ali6117.c index c351a0cfa..707b528b2 100644 --- a/src/chipset/ali6117.c +++ b/src/chipset/ali6117.c @@ -493,7 +493,7 @@ ali6117_init(const device_t *info) const device_t ali1217_device = { .name = "ALi M1217", .internal_name = "ali1217", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x8, .init = ali6117_init, .close = ali6117_close, @@ -507,7 +507,7 @@ const device_t ali1217_device = { const device_t ali6117d_device = { .name = "ALi M6117D", .internal_name = "ali6117d", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x2, .init = ali6117_init, .close = ali6117_close, diff --git a/src/device.c b/src/device.c index 7cfa1d70e..ff81fe5e5 100644 --- a/src/device.c +++ b/src/device.c @@ -490,7 +490,7 @@ device_get_name(const device_t *dev, int bus, char *name) const char *sbus = NULL; const char *fbus; char *tname; - char pbus[11] = { 0 }; + char pbus[12] = { 0 }; if (dev == NULL) return; @@ -498,9 +498,9 @@ device_get_name(const device_t *dev, int bus, char *name) name[0] = 0x00; if (bus) { - if ((dev->flags & (DEVICE_PCJR | DEVICE_ISA)) == - (DEVICE_PCJR | DEVICE_ISA)) - sbus = "ISA/PCJR"; + if ((dev->flags & (DEVICE_SIDECAR | DEVICE_ISA)) == + (DEVICE_SIDECAR | DEVICE_ISA)) + sbus = "ISA/Sidecar"; else if (dev->flags & DEVICE_SIDECAR) sbus = "Sidecar"; else if (dev->flags & DEVICE_XT_KBC) @@ -519,6 +519,8 @@ device_get_name(const device_t *dev, int bus, char *name) sbus = "PCMCIA"; else if (dev->flags & DEVICE_MCA) sbus = "MCA"; + else if (dev->flags & DEVICE_MCA32) + sbus = "MCA32"; else if (dev->flags & DEVICE_HIL) sbus = "HP HIL"; else if (dev->flags & DEVICE_EISA) diff --git a/src/device/bugger.c b/src/device/bugger.c index 56cac91bc..b56937a43 100644 --- a/src/device/bugger.c +++ b/src/device/bugger.c @@ -346,7 +346,7 @@ bug_close(UNUSED(void *priv)) const device_t bugger_device = { .name = "ISA/PCI Bus Bugger", .internal_name = "bugger", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = bug_init, .close = bug_close, diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index 589ec7ded..c3cc29b78 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -2216,7 +2216,7 @@ static const device_config_t keyboard_at_config[] = { const device_t keyboard_at_generic_device = { .name = "Standard AT or PS/2 Keyboard", .internal_name = "ps2", - .flags = DEVICE_PS2, + .flags = DEVICE_PS2_KBC, .local = 0, .init = keyboard_at_init, .close = keyboard_at_close, diff --git a/src/device/mouse_ps2.c b/src/device/mouse_ps2.c index 8d98b07ce..79d7afc96 100644 --- a/src/device/mouse_ps2.c +++ b/src/device/mouse_ps2.c @@ -394,7 +394,7 @@ static const device_config_t ps2_config[] = { const device_t mouse_ps2_device = { .name = "PS/2 Mouse", .internal_name = "ps2", - .flags = DEVICE_PS2, + .flags = DEVICE_PS2_KBC, .local = MOUSE_TYPE_PS2, .init = mouse_ps2_init, .close = ps2_close, diff --git a/src/device/serial.c b/src/device/serial.c index 823d07c1f..c25da0070 100644 --- a/src/device/serial.c +++ b/src/device/serial.c @@ -948,7 +948,7 @@ serial_init(const device_t *info) serial_setup(dev, COM4_ADDR, COM4_IRQ); else if (next_inst == 2) serial_setup(dev, COM3_ADDR, COM3_IRQ); - else if ((next_inst == 1) || (info->flags & DEVICE_PCJR)) + else if ((next_inst == 1) || (info->local == SERIAL_8250_PCJR)) serial_setup(dev, COM2_ADDR, COM2_IRQ); else if (next_inst == 0) serial_setup(dev, COM1_ADDR, COM1_IRQ); @@ -1018,7 +1018,7 @@ const device_t ns8250_device = { const device_t ns8250_pcjr_device = { .name = "National Semiconductor 8250(-compatible) UART for PCjr", .internal_name = "ns8250_pcjr", - .flags = DEVICE_PCJR, + .flags = 0, .local = SERIAL_8250_PCJR, .init = serial_init, .close = serial_close, diff --git a/src/device/smbus_ali7101.c b/src/device/smbus_ali7101.c index 3907a065e..49eb44bc6 100644 --- a/src/device/smbus_ali7101.c +++ b/src/device/smbus_ali7101.c @@ -302,7 +302,7 @@ smbus_ali7101_close(void *priv) const device_t ali7101_smbus_device = { .name = "ALi M7101-compatible SMBus Host Controller", .internal_name = "ali7101_smbus", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = smbus_ali7101_init, .close = smbus_ali7101_close, diff --git a/src/device/smbus_piix4.c b/src/device/smbus_piix4.c index a9ffcd847..ae37c72c4 100644 --- a/src/device/smbus_piix4.c +++ b/src/device/smbus_piix4.c @@ -386,7 +386,7 @@ smbus_piix4_close(void *priv) const device_t piix4_smbus_device = { .name = "PIIX4-compatible SMBus Host Controller", .internal_name = "piix4_smbus", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = SMBUS_PIIX4, .init = smbus_piix4_init, .close = smbus_piix4_close, @@ -400,7 +400,7 @@ const device_t piix4_smbus_device = { const device_t via_smbus_device = { .name = "VIA VT82C686B SMBus Host Controller", .internal_name = "via_smbus", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = SMBUS_VIA, .init = smbus_piix4_init, .close = smbus_piix4_close, diff --git a/src/device/smbus_sis5595.c b/src/device/smbus_sis5595.c index 0a24d2355..42d1452ad 100644 --- a/src/device/smbus_sis5595.c +++ b/src/device/smbus_sis5595.c @@ -373,7 +373,7 @@ smbus_sis5595_close(void *priv) const device_t sis5595_smbus_device = { .name = "SiS 5595-compatible SMBus Host Controller", .internal_name = "sis5595_smbus", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = smbus_sis5595_init, .close = smbus_sis5595_close, diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index adc39d509..ab24aa6fa 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -984,7 +984,7 @@ wd1007vse1_available(void) const device_t esdi_at_wd1007vse1_device = { .name = "Western Digital WD1007V-SE1 (ESDI)", .internal_name = "esdi_at", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = wd1007vse1_init, .close = wd1007vse1_close, diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 3683c8671..b69ddf128 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -3282,7 +3282,7 @@ mcide_close(void *priv) const device_t ide_isa_device = { .name = "ISA PC/AT IDE Controller", .internal_name = "ide_isa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ide_init, .close = ide_close, @@ -3296,7 +3296,7 @@ const device_t ide_isa_device = { const device_t ide_isa_sec_device = { .name = "ISA PC/AT IDE Controller (Secondary)", .internal_name = "ide_isa_sec", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ide_sec_init, .close = ide_sec_close, @@ -3310,7 +3310,7 @@ const device_t ide_isa_sec_device = { const device_t ide_isa_2ch_device = { .name = "ISA PC/AT IDE Controller (Dual-Channel)", .internal_name = "ide_isa_2ch", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = ide_init, .close = ide_close, @@ -3324,7 +3324,7 @@ const device_t ide_isa_2ch_device = { const device_t ide_vlb_device = { .name = "VLB IDE Controller", .internal_name = "ide_vlb", - .flags = DEVICE_VLB | DEVICE_AT, + .flags = DEVICE_VLB | DEVICE_ISA16, .local = 2, .init = ide_init, .close = ide_close, @@ -3338,7 +3338,7 @@ const device_t ide_vlb_device = { const device_t ide_vlb_sec_device = { .name = "VLB IDE Controller (Secondary)", .internal_name = "ide_vlb_sec", - .flags = DEVICE_VLB | DEVICE_AT, + .flags = DEVICE_VLB | DEVICE_ISA16, .local = 2, .init = ide_sec_init, .close = ide_sec_close, @@ -3352,7 +3352,7 @@ const device_t ide_vlb_sec_device = { const device_t ide_vlb_2ch_device = { .name = "VLB IDE Controller (Dual-Channel)", .internal_name = "ide_vlb_2ch", - .flags = DEVICE_VLB | DEVICE_AT, + .flags = DEVICE_VLB | DEVICE_ISA16, .local = 3, .init = ide_init, .close = ide_close, @@ -3366,7 +3366,7 @@ const device_t ide_vlb_2ch_device = { const device_t ide_pci_device = { .name = "PCI IDE Controller", .internal_name = "ide_pci", - .flags = DEVICE_PCI | DEVICE_AT, + .flags = DEVICE_PCI | DEVICE_ISA16, .local = 4, .init = ide_init, .close = ide_close, @@ -3380,7 +3380,7 @@ const device_t ide_pci_device = { const device_t ide_pci_sec_device = { .name = "PCI IDE Controller (Secondary)", .internal_name = "ide_pci_sec", - .flags = DEVICE_PCI | DEVICE_AT, + .flags = DEVICE_PCI | DEVICE_ISA16, .local = 4, .init = ide_sec_init, .close = ide_sec_close, @@ -3394,7 +3394,7 @@ const device_t ide_pci_sec_device = { const device_t ide_pci_2ch_device = { .name = "PCI IDE Controller (Dual-Channel)", .internal_name = "ide_pci_2ch", - .flags = DEVICE_PCI | DEVICE_AT, + .flags = DEVICE_PCI | DEVICE_ISA16, .local = 5, .init = ide_init, .close = ide_close, @@ -3478,7 +3478,7 @@ static const device_config_t ide_qua_config[] = { const device_t ide_ter_device = { .name = "Tertiary IDE Controller", .internal_name = "ide_ter", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ide_ter_init, .close = ide_ter_close, @@ -3492,7 +3492,7 @@ const device_t ide_ter_device = { const device_t ide_ter_pnp_device = { .name = "Tertiary IDE Controller (Plug and Play only)", .internal_name = "ide_ter_pnp", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = ide_ter_init, .close = ide_ter_close, @@ -3506,7 +3506,7 @@ const device_t ide_ter_pnp_device = { const device_t ide_qua_device = { .name = "Quaternary IDE Controller", .internal_name = "ide_qua", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ide_qua_init, .close = ide_qua_close, @@ -3520,7 +3520,7 @@ const device_t ide_qua_device = { const device_t ide_qua_pnp_device = { .name = "Quaternary IDE Controller (Plug and Play only)", .internal_name = "ide_qua_pnp", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = ide_qua_init, .close = ide_qua_close, diff --git a/src/disk/hdc_st506_at.c b/src/disk/hdc_st506_at.c index eeb242a94..07c57b2ca 100644 --- a/src/disk/hdc_st506_at.c +++ b/src/disk/hdc_st506_at.c @@ -795,7 +795,7 @@ mfm_close(void *priv) const device_t st506_at_wd1003_device = { .name = "WD1003 AT MFM/RLL Controller", .internal_name = "st506_at", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = mfm_init, .close = mfm_close, diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 4c071e596..c18a24c4e 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -312,7 +312,7 @@ const device_t xtide_device = { const device_t xtide_at_device = { .name = "PC/AT XTIDE", .internal_name = "xtide_at", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = xtide_at_init, .close = xtide_at_close, @@ -340,7 +340,7 @@ const device_t xtide_acculogic_device = { const device_t xtide_at_ps2_device = { .name = "PS/2 AT XTIDE (1.1.5)", .internal_name = "xtide_at_ps2", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = xtide_at_ps2_init, .close = xtide_at_close, diff --git a/src/disk/lba_enhancer.c b/src/disk/lba_enhancer.c index 429611b2d..ef9e167d3 100644 --- a/src/disk/lba_enhancer.c +++ b/src/disk/lba_enhancer.c @@ -88,7 +88,7 @@ static const device_config_t lba_enhancer_config[] = { const device_t lba_enhancer_device = { .name = "Vision Systems LBA Enhancer", .internal_name = "lba_enhancer", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = lba_enhancer_init, .close = lba_enhancer_close, diff --git a/src/include/86box/device.h b/src/include/86box/device.h index d074cc2fc..584f0f069 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -86,19 +86,20 @@ enum { DEVICE_ISA16 = 0x20, /* requires an AT-compatible system */ DEVICE_AT_KBC = 0x40, /* requires an AT-compatible keyboard controller */ DEVICE_MCA = 0x80, /* requires the MCA bus */ - DEVICE_PS2_KBC = 0x100, /* requires a PS/1 or PS/2 system */ - DEVICE_PCMCIA = 0x200, /* requires the PCMCIA bus */ - DEVICE_HIL = 0x400, /* requires the HP HIL bus */ - DEVICE_EISA = 0x800, /* requires the EISA bus */ - DEVICE_AT32 = 0x1000, /* requires the Mylex AT/32 local bus */ - DEVICE_OLB = 0x2000, /* requires the OPTi local bus */ - DEVICE_VLB = 0x4000, /* requires the VLB bus */ - DEVICE_PCI = 0x8000, /* requires the PCI bus */ - DEVICE_CARDBUS = 0x10000, /* requires the CardBus bus */ - DEVICE_USB = 0x20000, /* requires the USB bus */ - DEVICE_AGP = 0x40000, /* requires the AGP bus */ - DEVICE_AC97 = 0x80000, /* requires the AC'97 bus */ - DEVICE_BUS = 0xfffff, /* requires a machine bus */ + DEVICE_MCA32 = 0x100, /* requires the MCA bus */ + DEVICE_PS2_KBC = 0x200, /* requires a PS/1 or PS/2 system */ + DEVICE_PCMCIA = 0x400, /* requires the PCMCIA bus */ + DEVICE_HIL = 0x800, /* requires the HP HIL bus */ + DEVICE_EISA = 0x1000, /* requires the EISA bus */ + DEVICE_AT32 = 0x2000, /* requires the Mylex AT/32 local bus */ + DEVICE_OLB = 0x4000, /* requires the OPTi local bus */ + DEVICE_VLB = 0x8000, /* requires the VLB bus */ + DEVICE_PCI = 0x10000, /* requires the PCI bus */ + DEVICE_CARDBUS = 0x20000, /* requires the CardBus bus */ + DEVICE_USB = 0x40000, /* requires the USB bus */ + DEVICE_AGP = 0x80000, /* requires the AGP bus */ + DEVICE_AC97 = 0x100000, /* requires the AC'97 bus */ + DEVICE_BUS = 0xffffff, /* requires a machine bus */ DEVICE_COM = 0x100000, /* requires a serial port */ DEVICE_LPT = 0x200000, /* requires a parallel port */ @@ -112,11 +113,6 @@ enum { DEVICE_ALL = 0xffffffff /* match all devices */ }; -/* TODO: Remove this once all the devices' flags have been updated. */ -#define DEVICE_AT DEVICE_ISA16 -#define DEVICE_PCJR DEVICE_SIDECAR -#define DEVICE_PS2 DEVICE_PS2_KBC - #define BIOS_NORMAL 0 #define BIOS_INTERLEAVED 1 #define BIOS_INTERLEAVED_SINGLEFILE 2 diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 2c5440438..bf4954ae9 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -33,19 +33,20 @@ #define MACHINE_BUS_ISA16 0x00000020 /* sys has ISA16 bus - PC/AT architecture */ #define MACHINE_BUS_AT_KBD 0x00000040 /* sys has an AT keyboard port */ #define MACHINE_BUS_MCA 0x00000080 /* sys has MCA bus */ -#define MACHINE_BUS_PS2_PORTS 0x00000100 /* system has PS/2 keyboard and mouse ports */ +#define MACHINE_BUS_MCA32 0x00000100 /* sys has MCA32 bus */ +#define MACHINE_BUS_PS2_PORTS 0x00000200 /* system has PS/2 keyboard and mouse ports */ #define MACHINE_BUS_PS2 MACHINE_BUS_PS2_PORTS -#define MACHINE_BUS_PCMCIA 0x00000200 /* sys has PCMCIA bus */ -#define MACHINE_BUS_HIL 0x00000400 /* system has HP HIL keyboard and mouse ports */ -#define MACHINE_BUS_EISA 0x00000800 /* sys has EISA bus */ -#define MACHINE_BUS_AT32 0x00001000 /* sys has Mylex AT/32 local bus */ -#define MACHINE_BUS_OLB 0x00002000 /* sys has OPTi local bus */ -#define MACHINE_BUS_VLB 0x00004000 /* sys has VL bus */ -#define MACHINE_BUS_PCI 0x00008000 /* sys has PCI bus */ -#define MACHINE_BUS_CARDBUS 0x00010000 /* sys has CardBus bus */ -#define MACHINE_BUS_USB 0x00020000 /* sys has USB bus */ -#define MACHINE_BUS_AGP 0x00040000 /* sys has AGP bus */ -#define MACHINE_BUS_AC97 0x00080000 /* sys has AC97 bus (ACR/AMR/CNR slot) */ +#define MACHINE_BUS_PCMCIA 0x00000400 /* sys has PCMCIA bus */ +#define MACHINE_BUS_HIL 0x00000800 /* system has HP HIL keyboard and mouse ports */ +#define MACHINE_BUS_EISA 0x00001000 /* sys has EISA bus */ +#define MACHINE_BUS_AT32 0x00002000 /* sys has Mylex AT/32 local bus */ +#define MACHINE_BUS_OLB 0x00004000 /* sys has OPTi local bus */ +#define MACHINE_BUS_VLB 0x00008000 /* sys has VL bus */ +#define MACHINE_BUS_PCI 0x00010000 /* sys has PCI bus */ +#define MACHINE_BUS_CARDBUS 0x00020000 /* sys has CardBus bus */ +#define MACHINE_BUS_USB 0x00040000 /* sys has USB bus */ +#define MACHINE_BUS_AGP 0x00080000 /* sys has AGP bus */ +#define MACHINE_BUS_AC97 0x00100000 /* sys has AC97 bus (ACR/AMR/CNR slot) */ /* Aliases. */ #define MACHINE_CASSETTE (MACHINE_BUS_CASSETTE) /* sys has cassette port */ /* Combined flags. */ diff --git a/src/ioapic.c b/src/ioapic.c index b5ca4c7a7..ea0811f91 100644 --- a/src/ioapic.c +++ b/src/ioapic.c @@ -117,7 +117,7 @@ ioapic_init(UNUSED(const device_t *info)) const device_t ioapic_device = { .name = "I/O Advanced Programmable Interrupt Controller", .internal_name = "ioapic", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ioapic_init, .close = ioapic_close, diff --git a/src/machine/m_ps1_hdc.c b/src/machine/m_ps1_hdc.c index d407953b4..18792ded7 100644 --- a/src/machine/m_ps1_hdc.c +++ b/src/machine/m_ps1_hdc.c @@ -1380,7 +1380,7 @@ ps1_hdc_close(void *priv) const device_t ps1_hdc_device = { .name = "PS/1 2011 Fixed Disk Controller", .internal_name = "ps1_hdc", - .flags = DEVICE_ISA | DEVICE_PS2, + .flags = DEVICE_ISA, .local = 0, .init = ps1_hdc_init, .close = ps1_hdc_close, diff --git a/src/mem/row.c b/src/mem/row.c index 633d0e31a..c3e10841f 100644 --- a/src/mem/row.c +++ b/src/mem/row.c @@ -336,7 +336,7 @@ row_init(const device_t *info) device_t row_device = { .name = "DRAM Rows", .internal_name = "dram_rows", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x0000, .init = row_init, .close = row_close, diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index dd3a12047..71e5c2ca7 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -1714,7 +1714,7 @@ const device_t ne1000_compat_device = { const device_t ne2000_device = { .name = "Novell NE2000", .internal_name = "novell_ne2k", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = NE2K_NE2000, .init = nic_init, .close = nic_close, @@ -1728,7 +1728,7 @@ const device_t ne2000_device = { const device_t ne2000_compat_device = { .name = "NE2000 Compatible", .internal_name = "ne2k", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = NE2K_NE2000_COMPAT, .init = nic_init, .close = nic_close, @@ -1770,7 +1770,7 @@ const device_t ethernext_mc_device = { const device_t rtl8019as_pnp_device = { .name = "Realtek RTL8019AS", .internal_name = "ne2kpnp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = NE2K_RTL8019AS_PNP, .init = nic_init, .close = nic_close, @@ -1784,7 +1784,7 @@ const device_t rtl8019as_pnp_device = { const device_t de220p_device = { .name = "D-Link DE-220P", .internal_name = "de220p", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = NE2K_DE220P, .init = nic_init, .close = nic_close, diff --git a/src/network/net_pcnet.c b/src/network/net_pcnet.c index 3272033cf..b13fd8438 100644 --- a/src/network/net_pcnet.c +++ b/src/network/net_pcnet.c @@ -2922,7 +2922,7 @@ pcnet_init(const device_t *info) dev->is_pci = !!(info->flags & DEVICE_PCI); dev->is_vlb = !!(info->flags & DEVICE_VLB); - dev->is_isa = !!(info->flags & (DEVICE_ISA | DEVICE_AT)); + dev->is_isa = !!(info->flags & (DEVICE_ISA16)); if (dev->is_pci || dev->is_vlb) dev->transfer_size = 4; @@ -3231,7 +3231,7 @@ static const device_config_t pcnet_vlb_config[] = { const device_t pcnet_am79c960_device = { .name = "AMD PCnet-ISA", .internal_name = "pcnetisa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = DEV_AM79C960, .init = pcnet_init, .close = pcnet_close, @@ -3245,7 +3245,7 @@ const device_t pcnet_am79c960_device = { const device_t pcnet_am79c960_eb_device = { .name = "Racal Interlan EtherBlaster", .internal_name = "pcnetracal", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = DEV_AM79C960_EB, .init = pcnet_init, .close = pcnet_close, @@ -3273,7 +3273,7 @@ const device_t pcnet_am79c960_vlb_device = { const device_t pcnet_am79c961_device = { .name = "AMD PCnet-ISA+", .internal_name = "pcnetisaplus", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = DEV_AM79C961, .init = pcnet_init, .close = pcnet_close, diff --git a/src/nvr_at.c b/src/nvr_at.c index 147795f8e..bde80b434 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -1219,7 +1219,7 @@ nvr_at_close(void *priv) const device_t at_nvr_old_device = { .name = "PC/AT NVRAM (No century)", .internal_name = "at_nvr_old", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = nvr_at_init, .close = nvr_at_close, @@ -1233,7 +1233,7 @@ const device_t at_nvr_old_device = { const device_t at_nvr_device = { .name = "PC/AT NVRAM", .internal_name = "at_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = nvr_at_init, .close = nvr_at_close, @@ -1247,7 +1247,7 @@ const device_t at_nvr_device = { const device_t at_mb_nvr_device = { .name = "PC/AT NVRAM", .internal_name = "at_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x40 | 0x20 | 1, .init = nvr_at_init, .close = nvr_at_close, @@ -1261,7 +1261,7 @@ const device_t at_mb_nvr_device = { const device_t ps_nvr_device = { .name = "PS/1 or PS/2 NVRAM", .internal_name = "ps_nvr", - .flags = DEVICE_PS2, + .flags = DEVICE_ISA16, .local = 2, .init = nvr_at_init, .close = nvr_at_close, @@ -1275,7 +1275,7 @@ const device_t ps_nvr_device = { const device_t amstrad_nvr_device = { .name = "Amstrad NVRAM", .internal_name = "amstrad_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 3, .init = nvr_at_init, .close = nvr_at_close, @@ -1289,7 +1289,7 @@ const device_t amstrad_nvr_device = { const device_t ibmat_nvr_device = { .name = "IBM AT NVRAM", .internal_name = "ibmat_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 4, .init = nvr_at_init, .close = nvr_at_close, @@ -1303,7 +1303,7 @@ const device_t ibmat_nvr_device = { const device_t piix4_nvr_device = { .name = "Intel PIIX4 PC/AT NVRAM", .internal_name = "piix4_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 1, .init = nvr_at_init, .close = nvr_at_close, @@ -1317,7 +1317,7 @@ const device_t piix4_nvr_device = { const device_t ps_no_nmi_nvr_device = { .name = "PS/1 or PS/2 NVRAM (No NMI)", .internal_name = "ps1_nvr", - .flags = DEVICE_PS2, + .flags = DEVICE_ISA16, .local = 0x10 | 2, .init = nvr_at_init, .close = nvr_at_close, @@ -1331,7 +1331,7 @@ const device_t ps_no_nmi_nvr_device = { const device_t amstrad_no_nmi_nvr_device = { .name = "Amstrad NVRAM (No NMI)", .internal_name = "amstrad_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 3, .init = nvr_at_init, .close = nvr_at_close, @@ -1345,7 +1345,7 @@ const device_t amstrad_no_nmi_nvr_device = { const device_t ami_1992_nvr_device = { .name = "AMI Color 1992 PC/AT NVRAM", .internal_name = "ami_1992_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 4, .init = nvr_at_init, .close = nvr_at_close, @@ -1359,7 +1359,7 @@ const device_t ami_1992_nvr_device = { const device_t ami_1994_nvr_device = { .name = "AMI WinBIOS 1994 PC/AT NVRAM", .internal_name = "ami_1994_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 5, .init = nvr_at_init, .close = nvr_at_close, @@ -1373,7 +1373,7 @@ const device_t ami_1994_nvr_device = { const device_t ami_1995_nvr_device = { .name = "AMI WinBIOS 1995 PC/AT NVRAM", .internal_name = "ami_1995_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 6, .init = nvr_at_init, .close = nvr_at_close, @@ -1387,7 +1387,7 @@ const device_t ami_1995_nvr_device = { const device_t via_nvr_device = { .name = "VIA PC/AT NVRAM", .internal_name = "via_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 7, .init = nvr_at_init, .close = nvr_at_close, @@ -1401,7 +1401,7 @@ const device_t via_nvr_device = { const device_t p6rp4_nvr_device = { .name = "ASUS P/I-P6RP4 PC/AT NVRAM", .internal_name = "p6rp4_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 32, .init = nvr_at_init, .close = nvr_at_close, @@ -1415,7 +1415,7 @@ const device_t p6rp4_nvr_device = { const device_t amstrad_megapc_nvr_device = { .name = "Amstrad MegaPC NVRAM", .internal_name = "amstrad_megapc_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 36, .init = nvr_at_init, .close = nvr_at_close, diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index 4f3d1d1e7..7c887e28b 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -1473,7 +1473,7 @@ static const device_config_t aha_154xcp_config[] = { const device_t aha154xa_device = { .name = "Adaptec AHA-154xA", .internal_name = "aha154xa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xA, .init = aha_init, .close = x54x_close, @@ -1487,7 +1487,7 @@ const device_t aha154xa_device = { const device_t aha154xb_device = { .name = "Adaptec AHA-154xB", .internal_name = "aha154xb", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xB, .init = aha_init, .close = x54x_close, @@ -1501,7 +1501,7 @@ const device_t aha154xb_device = { const device_t aha154xc_device = { .name = "Adaptec AHA-154xC", .internal_name = "aha154xc", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xC, .init = aha_init, .close = x54x_close, @@ -1515,7 +1515,7 @@ const device_t aha154xc_device = { const device_t aha154xcf_device = { .name = "Adaptec AHA-154xCF", .internal_name = "aha154xcf", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xCF, .init = aha_init, .close = x54x_close, @@ -1529,7 +1529,7 @@ const device_t aha154xcf_device = { const device_t aha154xcp_device = { .name = "Adaptec AHA-154xCP", .internal_name = "aha154xcp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xCP, .init = aha_init, .close = aha1542cp_close, diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index c4745e2df..9fe34380b 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -1872,7 +1872,7 @@ static const device_config_t BT958D_Config[] = { const device_t buslogic_542b_device = { .name = "BusLogic BT-542B ISA", .internal_name = "bt542b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CHIP_BUSLOGIC_ISA_542B_1991_12_14, .init = buslogic_init, .close = x54x_close, @@ -1886,7 +1886,7 @@ const device_t buslogic_542b_device = { const device_t buslogic_545s_device = { .name = "BusLogic BT-545S ISA", .internal_name = "bt545s", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CHIP_BUSLOGIC_ISA_545S_1992_10_05, .init = buslogic_init, .close = x54x_close, @@ -1900,7 +1900,7 @@ const device_t buslogic_545s_device = { const device_t buslogic_542bh_device = { .name = "BusLogic BT-542BH ISA", .internal_name = "bt542bh", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CHIP_BUSLOGIC_ISA_542BH_1993_05_23, .init = buslogic_init, .close = x54x_close, @@ -1914,7 +1914,7 @@ const device_t buslogic_542bh_device = { const device_t buslogic_545c_device = { .name = "BusLogic BT-545C ISA", .internal_name = "bt545c", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CHIP_BUSLOGIC_ISA_545C_1994_12_01, .init = buslogic_init, .close = x54x_close, diff --git a/src/sound/snd_azt2316a.c b/src/sound/snd_azt2316a.c index ea682a82c..76bf1b24f 100644 --- a/src/sound/snd_azt2316a.c +++ b/src/sound/snd_azt2316a.c @@ -1557,7 +1557,7 @@ static const device_config_t azt2316a_config[] = { const device_t azt2316a_device = { .name = "Aztech Sound Galaxy Pro 16 AB (Washington)", .internal_name = "azt2316a", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_SUBTYPE_CLONE_AZT2316A_0X11, .init = azt_init, .close = azt_close, @@ -1571,7 +1571,7 @@ const device_t azt2316a_device = { const device_t azt1605_device = { .name = "Aztech Sound Galaxy Nova 16 Extra (Clinton)", .internal_name = "azt1605", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_SUBTYPE_CLONE_AZT1605_0X0C, .init = azt_init, .close = azt_close, diff --git a/src/sound/snd_cs423x.c b/src/sound/snd_cs423x.c index f5458eaf0..17ea48dd3 100644 --- a/src/sound/snd_cs423x.c +++ b/src/sound/snd_cs423x.c @@ -1061,7 +1061,7 @@ cs423x_speed_changed(void *priv) const device_t cs4235_device = { .name = "Crystal CS4235", .internal_name = "cs4235", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4235, .init = cs423x_init, .close = cs423x_close, @@ -1075,7 +1075,7 @@ const device_t cs4235_device = { const device_t cs4235_onboard_device = { .name = "Crystal CS4235 (On-Board)", .internal_name = "cs4235_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4235 | CRYSTAL_NOEEPROM, .init = cs423x_init, .close = cs423x_close, @@ -1089,7 +1089,7 @@ const device_t cs4235_onboard_device = { const device_t cs4236_onboard_device = { .name = "Crystal CS4236 (On-Board)", .internal_name = "cs4236_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4236 | CRYSTAL_NOEEPROM, .init = cs423x_init, .close = cs423x_close, @@ -1103,7 +1103,7 @@ const device_t cs4236_onboard_device = { const device_t cs4236b_device = { .name = "Crystal CS4236B", .internal_name = "cs4236b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4236B, .init = cs423x_init, .close = cs423x_close, @@ -1117,7 +1117,7 @@ const device_t cs4236b_device = { const device_t cs4236b_onboard_device = { .name = "Crystal CS4236B", .internal_name = "cs4236b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4236B | CRYSTAL_NOEEPROM, .init = cs423x_init, .close = cs423x_close, @@ -1131,7 +1131,7 @@ const device_t cs4236b_onboard_device = { const device_t cs4237b_device = { .name = "Crystal CS4237B", .internal_name = "cs4237b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4237B, .init = cs423x_init, .close = cs423x_close, @@ -1145,7 +1145,7 @@ const device_t cs4237b_device = { const device_t cs4238b_device = { .name = "Crystal CS4238B", .internal_name = "cs4238b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4238B, .init = cs423x_init, .close = cs423x_close, diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index f2651c72f..43638473c 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -1500,7 +1500,7 @@ static const device_config_t gus_config[] = { const device_t gus_device = { .name = "Gravis UltraSound", .internal_name = "gus", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = gus_init, .close = gus_close, diff --git a/src/sound/snd_optimc.c b/src/sound/snd_optimc.c index d5c01dbaf..d0b05741a 100644 --- a/src/sound/snd_optimc.c +++ b/src/sound/snd_optimc.c @@ -484,7 +484,7 @@ static const device_config_t optimc_config[] = { const device_t acermagic_s20_device = { .name = "AcerMagic S20", .internal_name = "acermagic_s20", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0xE3 | OPTIMC_CS4231, .init = optimc_init, .close = optimc_close, @@ -498,7 +498,7 @@ const device_t acermagic_s20_device = { const device_t mirosound_pcm10_device = { .name = "miroSOUND PCM10", .internal_name = "mirosound_pcm10", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0xE3 | OPTIMC_OPL4, .init = optimc_init, .close = optimc_close, diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index ddb135357..353f9a3d5 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -2453,7 +2453,7 @@ const device_t pasplus_device = { const device_t pas16_device = { .name = "Pro Audio Spectrum 16", .internal_name = "pas16", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x0f, .init = pas16_init, .close = pas16_close, @@ -2467,7 +2467,7 @@ const device_t pas16_device = { const device_t pas16d_device = { .name = "Pro Audio Spectrum 16D", .internal_name = "pas16d", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x0c, .init = pas16_init, .close = pas16_close, diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index ca233b252..4f8b8a0bd 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -5476,7 +5476,7 @@ const device_t sb_pro_mcv_device = { const device_t sb_pro_compat_device = { .name = "Sound Blaster Pro (Compatibility)", .internal_name = "sbpro_compat", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = sb_pro_compat_init, .close = sb_close, @@ -5490,7 +5490,7 @@ const device_t sb_pro_compat_device = { const device_t sb_16_device = { .name = "Sound Blaster 16", .internal_name = "sb16", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = FM_YMF262, .init = sb_16_init, .close = sb_close, @@ -5504,7 +5504,7 @@ const device_t sb_16_device = { const device_t sb_vibra16c_onboard_device = { .name = "Sound Blaster ViBRA 16C (On-Board)", .internal_name = "sb_vibra16c_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16C, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5518,7 +5518,7 @@ const device_t sb_vibra16c_onboard_device = { const device_t sb_vibra16c_device = { .name = "Sound Blaster ViBRA 16C", .internal_name = "sb_vibra16c", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16C, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5532,7 +5532,7 @@ const device_t sb_vibra16c_device = { const device_t sb_vibra16cl_onboard_device = { .name = "Sound Blaster ViBRA 16CL (On-Board)", .internal_name = "sb_vibra16cl_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16CL, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5546,7 +5546,7 @@ const device_t sb_vibra16cl_onboard_device = { const device_t sb_vibra16cl_device = { .name = "Sound Blaster ViBRA 16CL", .internal_name = "sb_vibra16cl", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16CL, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5560,7 +5560,7 @@ const device_t sb_vibra16cl_device = { const device_t sb_vibra16s_onboard_device = { .name = "Sound Blaster ViBRA 16S (On-Board)", .internal_name = "sb_vibra16s_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = FM_YMF289B, .init = sb_16_init, .close = sb_close, @@ -5574,7 +5574,7 @@ const device_t sb_vibra16s_onboard_device = { const device_t sb_vibra16s_device = { .name = "Sound Blaster ViBRA 16S", .internal_name = "sb_vibra16s", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = FM_YMF289B, .init = sb_16_init, .close = sb_close, @@ -5588,7 +5588,7 @@ const device_t sb_vibra16s_device = { const device_t sb_vibra16xv_onboard_device = { .name = "Sound Blaster ViBRA 16XV (On-Board)", .internal_name = "sb_vibra16xv_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16XV, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5602,7 +5602,7 @@ const device_t sb_vibra16xv_onboard_device = { const device_t sb_vibra16xv_device = { .name = "Sound Blaster ViBRA 16XV", .internal_name = "sb_vibra16xv", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16XV, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5630,7 +5630,7 @@ const device_t sb_16_reply_mca_device = { const device_t sb_16_pnp_device = { .name = "Sound Blaster 16 PnP", .internal_name = "sb16_pnp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_16_PNP_NOIDE, .init = sb_16_pnp_init, .close = sb_close, @@ -5644,7 +5644,7 @@ const device_t sb_16_pnp_device = { const device_t sb_16_pnp_ide_device = { .name = "Sound Blaster 16 PnP (IDE)", .internal_name = "sb16_pnp_ide", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_16_PNP_IDE, .init = sb_16_pnp_init, .close = sb_close, @@ -5658,7 +5658,7 @@ const device_t sb_16_pnp_ide_device = { const device_t sb_16_compat_device = { .name = "Sound Blaster 16 (Compatibility)", .internal_name = "sb16_compat", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = sb_16_compat_init, .close = sb_close, @@ -5672,7 +5672,7 @@ const device_t sb_16_compat_device = { const device_t sb_16_compat_nompu_device = { .name = "Sound Blaster 16 (Compatibility - MPU-401 Off)", .internal_name = "sb16_compat", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = sb_16_compat_init, .close = sb_close, @@ -5686,7 +5686,7 @@ const device_t sb_16_compat_nompu_device = { const device_t sb_goldfinch_device = { .name = "Creative EMU8000 PnP (Goldfinch)", .internal_name = "sb_goldfinch", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = sb_goldfinch_init, .close = sb_goldfinch_close, @@ -5700,7 +5700,7 @@ const device_t sb_goldfinch_device = { const device_t sb_32_pnp_device = { .name = "Sound Blaster 32 PnP", .internal_name = "sb32_pnp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_32_PNP, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5714,7 +5714,7 @@ const device_t sb_32_pnp_device = { const device_t sb_awe32_device = { .name = "Sound Blaster AWE32", .internal_name = "sbawe32", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = sb_awe32_init, .close = sb_awe32_close, @@ -5728,7 +5728,7 @@ const device_t sb_awe32_device = { const device_t sb_awe32_pnp_device = { .name = "Sound Blaster AWE32 PnP", .internal_name = "sbawe32_pnp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE32_PNP, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5742,7 +5742,7 @@ const device_t sb_awe32_pnp_device = { const device_t sb_awe64_value_device = { .name = "Sound Blaster AWE64 Value", .internal_name = "sbawe64_value", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE64_VALUE, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5756,7 +5756,7 @@ const device_t sb_awe64_value_device = { const device_t sb_awe64_device = { .name = "Sound Blaster AWE64", .internal_name = "sbawe64", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE64_NOIDE, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5770,7 +5770,7 @@ const device_t sb_awe64_device = { const device_t sb_awe64_ide_device = { .name = "Sound Blaster AWE64 (IDE)", .internal_name = "sbawe64_ide", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE64_IDE, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5784,7 +5784,7 @@ const device_t sb_awe64_ide_device = { const device_t sb_awe64_gold_device = { .name = "Sound Blaster AWE64 Gold", .internal_name = "sbawe64_gold", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE64_GOLD, .init = sb_awe32_pnp_init, .close = sb_awe32_close, diff --git a/src/sound/snd_wss.c b/src/sound/snd_wss.c index c55e5f57b..874638a80 100644 --- a/src/sound/snd_wss.c +++ b/src/sound/snd_wss.c @@ -279,7 +279,7 @@ static const device_config_t wss_config[] = { const device_t wss_device = { .name = "Windows Sound System", .internal_name = "wss", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = wss_init, .close = wss_close, diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index 09b054895..379772820 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -4072,7 +4072,7 @@ static const device_config_t mca_ext8514_config[] = { const device_t gen8514_isa_device = { .name = "IBM 8514/A clone (ISA)", .internal_name = "8514_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = 0, .init = ibm8514_init, .close = ibm8514_close, diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index 9b7a67f31..9499f4ecc 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -4752,7 +4752,7 @@ static const device_config_t mach64vt2_config[] = { const device_t mach64gx_isa_device = { .name = "ATI Mach64GX ISA", .internal_name = "mach64gx_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = 0, .init = mach64gx_init, .close = mach64_close, diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 19f51bd9d..73be7cd76 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -4887,7 +4887,7 @@ const device_t gd5402_isa_device = { const device_t gd5402_onboard_device = { .name = "Cirrus Logic GD5402 (ISA) (ACUMOS AVGA2) (On-Board)", .internal_name = "cl_gd5402_onboard", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5402 | 0x200, .init = gd54xx_init, .close = gd54xx_close, @@ -4901,7 +4901,7 @@ const device_t gd5402_onboard_device = { const device_t gd5420_isa_device = { .name = "Cirrus Logic GD5420 (ISA)", .internal_name = "cl_gd5420_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5420, .init = gd54xx_init, .close = gd54xx_close, @@ -4915,7 +4915,7 @@ const device_t gd5420_isa_device = { const device_t gd5422_isa_device = { .name = "Cirrus Logic GD5422 (ISA)", .internal_name = "cl_gd5422_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5422, .init = gd54xx_init, .close = gd54xx_close, @@ -4943,7 +4943,7 @@ const device_t gd5424_vlb_device = { const device_t gd5426_isa_device = { .name = "Cirrus Logic GD5426 (ISA)", .internal_name = "cl_gd5426_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5426, .init = gd54xx_init, .close = gd54xx_close, @@ -4958,7 +4958,7 @@ const device_t gd5426_isa_device = { const device_t gd5426_diamond_speedstar_pro_a1_isa_device = { .name = "Cirrus Logic GD5426 (ISA) (Diamond SpeedStar Pro Rev. A1)", .internal_name = "cl_gd5426_diamond_a1_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5426 | 0x100, .init = gd54xx_init, .close = gd54xx_close, @@ -5000,7 +5000,7 @@ const device_t gd5426_onboard_device = { const device_t gd5428_isa_device = { .name = "Cirrus Logic GD5428 (ISA)", .internal_name = "cl_gd5428_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5428, .init = gd54xx_init, .close = gd54xx_close, @@ -5043,7 +5043,7 @@ const device_t gd5428_diamond_speedstar_pro_b1_vlb_device = { const device_t gd5428_boca_isa_device = { .name = "Cirrus Logic GD5428 (ISA) (BOCA Research 4610)", .internal_name = "cl_gd5428_boca_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5428 | 0x100, .init = gd54xx_init, .close = gd54xx_close, @@ -5085,7 +5085,7 @@ const device_t gd5426_mca_device = { const device_t gd5428_onboard_device = { .name = "Cirrus Logic GD5428 (ISA) (On-Board)", .internal_name = "cl_gd5428_onboard", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5428, .init = gd54xx_init, .close = gd54xx_close, @@ -5113,7 +5113,7 @@ const device_t gd5428_vlb_onboard_device = { const device_t gd5429_isa_device = { .name = "Cirrus Logic GD5429 (ISA)", .internal_name = "cl_gd5429_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5429, .init = gd54xx_init, .close = gd54xx_close, @@ -5212,7 +5212,7 @@ const device_t gd5430_onboard_pci_device = { const device_t gd5434_isa_device = { .name = "Cirrus Logic GD5434 (ISA)", .internal_name = "cl_gd5434_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5434, .init = gd54xx_init, .close = gd54xx_close, @@ -5227,7 +5227,7 @@ const device_t gd5434_isa_device = { const device_t gd5434_diamond_speedstar_64_a3_isa_device = { .name = "Cirrus Logic GD5434 (ISA) (Diamond SpeedStar 64 Rev. A3)", .internal_name = "cl_gd5434_diamond_a3_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5434 | 0x100, .init = gd54xx_init, .close = gd54xx_close, diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index 6ff34cbb1..246decb9c 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -2964,7 +2964,7 @@ static const device_config_t et4000w32p_config[] = { const device_t et4000w32_device = { .name = "Tseng Labs ET4000/w32 ISA", .internal_name = "et4000w32", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = ET4000W32, .init = et4000w32p_init, .close = et4000w32p_close, @@ -2978,7 +2978,7 @@ const device_t et4000w32_device = { const device_t et4000w32_onboard_device = { .name = "Tseng Labs ET4000/w32 (ISA) (On-Board)", .internal_name = "et4000w32_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = ET4000W32, .init = et4000w32p_init, .close = et4000w32p_close, @@ -2992,7 +2992,7 @@ const device_t et4000w32_onboard_device = { const device_t et4000w32i_isa_device = { .name = "Tseng Labs ET4000/w32i Rev. B ISA", .internal_name = "et4000w32i", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = ET4000W32I, .init = et4000w32p_init, .close = et4000w32p_close, diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index ce756f7d8..57b0f303c 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -1819,7 +1819,7 @@ const device_t ht216_32_standalone_device = { const device_t radius_svga_multiview_isa_device = { .name = "Radius SVGA Multiview ISA (HT209)", .internal_name = "radius_isa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x7152, /*HT209*/ .init = radius_svga_multiview_init, .close = ht216_close, diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index aecc898c4..769cd0001 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -10667,7 +10667,7 @@ static const device_config_t s3_standard_config2[] = { const device_t s3_orchid_86c911_isa_device = { .name = "S3 86c911 ISA (Orchid Fahrenheit 1280)", .internal_name = "orchid_s3_911", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_ORCHID_86C911, .init = s3_init, .close = s3_close, @@ -10681,7 +10681,7 @@ const device_t s3_orchid_86c911_isa_device = { const device_t s3_diamond_stealth_vram_isa_device = { .name = "S3 86c911 ISA (Diamond Stealth VRAM)", .internal_name = "stealthvram_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_DIAMOND_STEALTH_VRAM, .init = s3_init, .close = s3_close, @@ -10695,7 +10695,7 @@ const device_t s3_diamond_stealth_vram_isa_device = { const device_t s3_ami_86c924_isa_device = { .name = "S3 86c924 ISA (AMI)", .internal_name = "ami_s3_924", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_AMI_86C924, .init = s3_init, .close = s3_close, @@ -10709,7 +10709,7 @@ const device_t s3_ami_86c924_isa_device = { const device_t s3_spea_mirage_86c801_isa_device = { .name = "S3 86c801 ISA (SPEA Mirage ISA)", .internal_name = "px_s3_v7_801_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_SPEA_MIRAGE_86C801, .init = s3_init, .close = s3_close, @@ -10779,7 +10779,7 @@ const device_t s3_mirocrystal_10sd_805_vlb_device = { const device_t s3_phoenix_86c801_isa_device = { .name = "S3 86c801 ISA (Phoenix)", .internal_name = "px_86c801_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_PHOENIX_86C801, .init = s3_init, .close = s3_close, @@ -10807,7 +10807,7 @@ const device_t s3_phoenix_86c805_vlb_device = { const device_t s3_metheus_86c928_isa_device = { .name = "S3 86c928 ISA (Metheus Premier 928)", .internal_name = "metheus928_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_METHEUS_86C928, .init = s3_init, .close = s3_close, diff --git a/src/video/vid_xga.c b/src/video/vid_xga.c index a469330af..2cc20044a 100644 --- a/src/video/vid_xga.c +++ b/src/video/vid_xga.c @@ -3815,7 +3815,7 @@ const device_t xga_device = { const device_t xga_isa_device = { .name = "XGA (ISA)", .internal_name = "xga_isa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = xga_init, .close = xga_close, @@ -3829,7 +3829,7 @@ const device_t xga_isa_device = { const device_t inmos_isa_device = { .name = "INMOS XGA (ISA)", .internal_name = "inmos_xga_isa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = svga_xga_init, .close = xga_close, From a8cbb4deef63495159f28045ad95125353721011 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 14 Feb 2025 08:03:15 +0100 Subject: [PATCH 28/45] Corrected the ISA and Sidecar flags. --- src/include/86box/machine.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index bf4954ae9..8676fa5f1 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -26,8 +26,8 @@ #define MACHINE_BUS_NONE 0x00000000 /* sys has no bus */ /* Feature flags for BUS'es. */ #define MACHINE_BUS_CASSETTE 0x00000001 /* sys has cassette port */ -#define MACHINE_BUS_ISA 0x00000002 /* sys has ISA bus */ -#define MACHINE_BUS_SIDECAR 0x00000004 /* sys has PCjr sidecar bus */ +#define MACHINE_BUS_SIDECAR 0x00000002 /* sys has PCjr sidecar bus */ +#define MACHINE_BUS_ISA 0x00000004 /* sys has ISA bus */ #define MACHINE_BUS_XT_KBD 0x00000008 /* sys has an XT keyboard port */ #define MACHINE_BUS_CBUS 0x00000010 /* sys has C-BUS bus */ #define MACHINE_BUS_ISA16 0x00000020 /* sys has ISA16 bus - PC/AT architecture */ From 32f2153f56dada8531df0eb20a771cae95edc15d Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 14 Feb 2025 08:57:30 +0100 Subject: [PATCH 29/45] Assume device valid if it has no bus flags set. --- src/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index ff81fe5e5..8b2ddf35e 100644 --- a/src/device.c +++ b/src/device.c @@ -797,7 +797,7 @@ device_is_valid(const device_t *device, int mch) { int ret = 1; - if (device != NULL) + if ((device != NULL) && ((device->flags & DEVICE_BUS) != 0)) ret = machine_has_bus(mch, device->flags & DEVICE_BUS); return ret; From 58089997a4a2e845052cbdeb3109f9cd8cb537a0 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 14 Feb 2025 09:03:57 +0100 Subject: [PATCH 30/45] Machine status: initialize it for the two cartridge bays as well. --- src/machine_status.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/machine_status.c b/src/machine_status.c index 16976fa83..3eb2762bc 100644 --- a/src/machine_status.c +++ b/src/machine_status.c @@ -45,11 +45,13 @@ machine_status_init(void) machine_status.mo[i].active = false; } + for (size_t i = 0; i < 2; i++) + machine_status.cartridge[i].empty = (strlen(cart_fns[i]) == 0); + machine_status.cassette.empty = (strlen(cassette_fname) == 0); - for (size_t i = 0; i < HDD_BUS_USB; i++) { + for (size_t i = 0; i < HDD_BUS_USB; i++) machine_status.hdd[i].active = false; - } for (size_t i = 0; i < NET_CARD_MAX; i++) { machine_status.net[i].active = false; From 549df9af7f841f99285ba9ccd882e3f2daf757fd Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 14 Feb 2025 09:09:51 +0100 Subject: [PATCH 31/45] Updated a header. --- src/include/86box/fdd_86f.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/include/86box/fdd_86f.h b/src/include/86box/fdd_86f.h index cc8035965..de7bb7dcb 100644 --- a/src/include/86box/fdd_86f.h +++ b/src/include/86box/fdd_86f.h @@ -8,13 +8,11 @@ * * Definitions for the 86F floppy image format. * - * - * * Authors: Miran Grca, * Fred N. van Kempen, * - * Copyright 2016-2019 Miran Grca. - * Copyright 2018-2019 Fred N. van Kempen. + * Copyright 2016-2025 Miran Grca. + * Copyright 2018-2025 Fred N. van Kempen. */ #ifndef EMU_FLOPPY_86F_H #define EMU_FLOPPY_86F_H From 9236856ad5131ee9c70fdc66af6d0606c1ff68c7 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 14 Feb 2025 16:39:42 +0100 Subject: [PATCH 32/45] Fixed the DEVICE_COM flags onwards, should fix serial mice. --- src/include/86box/device.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/86box/device.h b/src/include/86box/device.h index 584f0f069..af546c64d 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -101,11 +101,11 @@ enum { DEVICE_AC97 = 0x100000, /* requires the AC'97 bus */ DEVICE_BUS = 0xffffff, /* requires a machine bus */ - DEVICE_COM = 0x100000, /* requires a serial port */ - DEVICE_LPT = 0x200000, /* requires a parallel port */ + DEVICE_COM = 0x200000, /* requires a serial port */ + DEVICE_LPT = 0x400000, /* requires a parallel port */ - DEVICE_KBC = 0x400000, /* is a keyboard controller */ - DEVICE_SOFTRESET = 0x800000, /* requires to be reset on soft reset */ + DEVICE_KBC = 0x800000, /* is a keyboard controller */ + DEVICE_SOFTRESET = 0x1000000, /* requires to be reset on soft reset */ DEVICE_ONBOARD = 0x40000000, /* is on-board */ DEVICE_PIT = 0x80000000, /* device is a PIT */ From 1d87a200e1f685e307c913f1ba5bc619ecab7132 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 14 Feb 2025 16:42:53 +0100 Subject: [PATCH 33/45] Fixed DEVICE_BUS as well. --- src/include/86box/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/86box/device.h b/src/include/86box/device.h index af546c64d..1c3ef1ef3 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -99,7 +99,7 @@ enum { DEVICE_USB = 0x40000, /* requires the USB bus */ DEVICE_AGP = 0x80000, /* requires the AGP bus */ DEVICE_AC97 = 0x100000, /* requires the AC'97 bus */ - DEVICE_BUS = 0xffffff, /* requires a machine bus */ + DEVICE_BUS = 0x1fffff, /* requires a machine bus */ DEVICE_COM = 0x200000, /* requires a serial port */ DEVICE_LPT = 0x400000, /* requires a parallel port */ From 4768b3b6fbbc49c5a006524af32c13b86ddd4a1f Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 15 Feb 2025 20:02:05 +0100 Subject: [PATCH 34/45] Fixed some bus checks in some (S)VGA graphics cards, fixes #5229. --- src/video/vid_ati_mach64.c | 4 ++-- src/video/vid_cl54xx.c | 2 +- src/video/vid_ht216.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index 9499f4ecc..2df7782ff 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -4595,7 +4595,7 @@ mach64gx_init(const device_t *info) { mach64_t *mach64 = mach64_common_init(info); - if (info->flags & DEVICE_ISA) + if (info->flags & DEVICE_ISA16) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_mach64_isa); else if (info->flags & DEVICE_PCI) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_mach64_pci); @@ -4617,7 +4617,7 @@ mach64gx_init(const device_t *info) mach64->config_stat0 |= 6; /*VLB, 256Kx16 DRAM*/ ati_eeprom_load(&mach64->eeprom, "mach64_vlb.nvr", 1); rom_init(&mach64->bios_rom, BIOS_VLB_ROM_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); - } else if (info->flags & DEVICE_ISA) { + } else if (info->flags & DEVICE_ISA16) { mach64->config_stat0 |= 0; /*ISA 16-bit, 256k16 DRAM*/ ati_eeprom_load(&mach64->eeprom, "mach64.nvr", 1); rom_init(&mach64->bios_rom, BIOS_ISA_ROM_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 73be7cd76..21d9b21d8 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -4382,7 +4382,7 @@ gd54xx_init(const device_t *info) rom_init_interleaved(&gd54xx->bios_rom, BIOS_GD5428_BOCA_ISA_PATH_1, BIOS_GD5428_BOCA_ISA_PATH_2, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); - if (info->flags & DEVICE_ISA) + if ((info->flags & DEVICE_ISA) || (info->flags & DEVICE_ISA16)) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_gd54xx_isa); else if (info->flags & DEVICE_PCI) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_gd54xx_pci); diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index 57b0f303c..b650cb53b 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -1604,7 +1604,7 @@ ht216_init(const device_t *info, uint32_t mem_size, int has_rom) mem_mapping_disable(&ht216->linear_mapping); ht216->id = info->local; - ht216->isabus = (info->flags & DEVICE_ISA); + ht216->isabus = (info->flags & DEVICE_ISA) || (info->flags & DEVICE_ISA16); ht216->mca = (info->flags & DEVICE_MCA); io_sethandler(0x03c0, 0x0020, ht216_in, NULL, NULL, ht216_out, NULL, NULL, ht216); From 32c040f8fa6e58feaf288cded6a003e42a383f57 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 16 Feb 2025 05:57:28 +0100 Subject: [PATCH 35/45] NEAT: Fix alternate A20 gate, fixes #5168. --- src/chipset/neat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chipset/neat.c b/src/chipset/neat.c index 069fa87e4..c1c2e827a 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -845,7 +845,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) dev->ems_size); } - mem_a20_key = val & RB12_GA20; + mem_a20_alt = val & RB12_GA20; mem_a20_recalc(); break; From f4df7491b0ae16ed5c272b19ff36bce7a4ecc0f2 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 16 Feb 2025 14:45:12 +0100 Subject: [PATCH 36/45] The Commodore 386SX-16 now correctly has a PS/2 keyboard controller. --- src/machine/m_at_286_386sx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index cb2a04d07..362f035e0 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -628,7 +628,7 @@ machine_at_cmdsl386sx16_init(const machine_t *model) machine_at_common_ide_init(model); - device_add(&keyboard_at_device); + device_add(&keyboard_ps2_device); if (fdc_current[0] == FDC_INTERNAL) device_add(&fdc_at_device); From 8d54e6adf08746bdf463067abac69b88dcec8479 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 16 Feb 2025 15:38:02 +0100 Subject: [PATCH 37/45] NEAT: Fixed chipset A20 gate toggle. --- src/chipset/neat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chipset/neat.c b/src/chipset/neat.c index c1c2e827a..2990b5216 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -845,7 +845,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) dev->ems_size); } - mem_a20_alt = val & RB12_GA20; + mem_a20_key = !(val & RB12_GA20); mem_a20_recalc(); break; From 4b92bb62cbc97bc342b24060e7a6e63223f92aa6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 17 Feb 2025 00:41:34 +0100 Subject: [PATCH 38/45] Commodore SL386SX-16: Remove internal IDE controller, sicne the real board has none. --- src/machine/m_at_286_386sx.c | 2 +- src/machine/machine_table.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index 362f035e0..24cb88f09 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -626,7 +626,7 @@ machine_at_cmdsl386sx16_init(const machine_t *model) if (bios_only || !ret) return ret; - machine_at_common_ide_init(model); + machine_at_common_init(model); device_add(&keyboard_ps2_device); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 5010f984c..cb6bc964e 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -4688,7 +4688,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE, + .flags = MACHINE_FLAGS_NONE, .ram = { .min = 1024, .max = 8192, From 3d8bc797725fe49adaeb9ba26e3d16fa55e354d6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 17 Feb 2025 01:17:21 +0100 Subject: [PATCH 39/45] NEAT: Fix EMS memory space allocation to correctly take RAM from the bottom rather than from the top. --- src/chipset/neat.c | 71 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/src/chipset/neat.c b/src/chipset/neat.c index 2990b5216..696f48d20 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -27,6 +27,7 @@ #include #define HAVE_STDARG_H #include <86box/86box.h> +#include "cpu.h" #include <86box/device.h> #include <86box/io.h> #include <86box/mem.h> @@ -263,6 +264,64 @@ neat_log(const char *fmt, ...) # define neat_log(fmt, ...) #endif +static uint8_t +neat_read_ram(uint32_t addr, void *priv) +{ + neat_t *dev = (neat_t *) priv; + + if (dev->regs[REG_RB7] & RB7_EMSEN) + addr += (dev->ems_size << 10); + + if (cpu_use_exec) + addreadlookup(mem_logical_addr, addr); + + return ram[addr]; +} + +static uint16_t +neat_read_ramw(uint32_t addr, void *priv) +{ + neat_t *dev = (neat_t *) priv; + + if (dev->regs[REG_RB7] & RB7_EMSEN) + addr += (dev->ems_size << 10); + + if (cpu_use_exec) + addreadlookup(mem_logical_addr, addr); + + return *(uint16_t *) &ram[addr]; +} + +static void +neat_write_ram(uint32_t addr, uint8_t val, void *priv) +{ + neat_t *dev = (neat_t *) priv; + + if (dev->regs[REG_RB7] & RB7_EMSEN) + addr += (dev->ems_size << 10); + + if (cpu_use_exec) { + addwritelookup(mem_logical_addr, addr); + mem_write_ramb_page(addr, val, &pages[addr >> 12]); + } else + ram[addr] = val; +} + +static void +neat_write_ramw(uint32_t addr, uint16_t val, void *priv) +{ + neat_t *dev = (neat_t *) priv; + + if (dev->regs[REG_RB7] & RB7_EMSEN) + addr += (dev->ems_size << 10); + + if (cpu_use_exec) { + addwritelookup(mem_logical_addr, addr); + mem_write_ramw_page(addr, val, &pages[addr >> 12]); + } else + *(uint16_t *) &ram[addr] = val; +} + /* Read one byte from paged RAM. */ static uint8_t ems_readb(uint32_t addr, void *priv) @@ -603,9 +662,11 @@ remap_update(neat_t *dev, uint8_t val) else mem_mapping_set_addr(&ram_low_mapping, 0x00000000, dev->remap_base << 10); - if (dev->remap_base > 1024) + if (dev->remap_base > 1024) { mem_mapping_set_addr(&ram_high_mapping, 0x00100000, (dev->remap_base << 10) - 0x00100000); - else + mem_mapping_set_exec(&ram_high_mapping, &(ram[(val & RB7_EMSEN) ? 0x00100000 : + (0x00100000 + (dev->ems_size << 10))])); + } else mem_mapping_disable(&ram_high_mapping); if (val & RB7_UMAREL) { @@ -908,6 +969,12 @@ neat_init(UNUSED(const device_t *info)) /* Create an instance. */ dev = (neat_t *) calloc(1, sizeof(neat_t)); + if (mem_size > 1024) { + mem_mapping_set_handler(&ram_high_mapping, neat_read_ram, neat_read_ramw, NULL, + neat_write_ram, neat_write_ramw, NULL); + mem_mapping_set_p(&ram_high_mapping, dev); + } + /* Get configured I/O address. */ j = (dev->regs[REG_RB9] & RB9_BASE) >> RB9_BASE_SH; dev->ems_base = 0x0208 + (0x10 * j); From 63b223973c63828862ee25184d064b573087b0bd Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 17 Feb 2025 01:27:40 +0100 Subject: [PATCH 40/45] NEAT: Mirror EMS port 2x8h on port 2x9h for reads as well, fixes EMS detection by Chips Expanded Manager version 2.2.0. --- src/chipset/neat.c | 59 ++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/src/chipset/neat.c b/src/chipset/neat.c index 696f48d20..d4eb3ec7f 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -34,8 +34,6 @@ #include <86box/plat_unused.h> #include <86box/chipset.h> -#define NEAT_DEBUG 0 - #define EMS_MAXPAGE 4 #define EMS_PGSIZE 16384 #define EMS_PGMASK 16383 @@ -328,7 +326,7 @@ ems_readb(uint32_t addr, void *priv) { ram_page_t *dev = (ram_page_t *) priv; uint8_t ret = 0xff; -#ifdef ENABLE_NEAT_LOG +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) uint32_t old = addr; #endif @@ -338,7 +336,9 @@ ems_readb(uint32_t addr, void *priv) if (addr < (mem_size << 10)) ret = *(uint8_t *) &(ram[addr]); +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) neat_log("[R08] %08X -> %08X (%08X): ret = %02X\n", old, addr, (mem_size << 10), ret); +#endif return ret; } @@ -348,7 +348,7 @@ ems_readw(uint32_t addr, void *priv) { ram_page_t *dev = (ram_page_t *) priv; uint16_t ret = 0xffff; -#ifdef ENABLE_NEAT_LOG +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) uint32_t old = addr; #endif @@ -358,7 +358,9 @@ ems_readw(uint32_t addr, void *priv) if (addr < (mem_size << 10)) ret = *(uint16_t *) &(ram[addr]); +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) neat_log("[R16] %08X -> %08X (%08X): ret = %04X\n", old, addr, (mem_size << 10), ret); +#endif return ret; } @@ -367,13 +369,15 @@ static void ems_writeb(uint32_t addr, uint8_t val, void *priv) { ram_page_t *dev = (ram_page_t *) priv; -#ifdef ENABLE_NEAT_LOG +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) uint32_t old = addr; #endif /* Write the data. */ addr = addr - dev->virt_base + dev->phys_base; +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) neat_log("[W08] %08X -> %08X (%08X): val = %02X\n", old, addr, (mem_size << 10), val); +#endif if (addr < (mem_size << 10)) *(uint8_t *) &(ram[addr]) = val; @@ -384,13 +388,15 @@ static void ems_writew(uint32_t addr, uint16_t val, void *priv) { ram_page_t *dev = (ram_page_t *) priv; -#ifdef ENABLE_NEAT_LOG +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) uint32_t old = addr; #endif /* Write the data. */ addr = addr - dev->virt_base + dev->phys_base; +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) neat_log("[W16] %08X -> %08X (%08X): val = %04X\n", old, addr, (mem_size << 10), val); +#endif if (addr < (mem_size << 10)) *(uint16_t *) &(ram[addr]) = val; @@ -505,7 +511,7 @@ ems_recalc(neat_t *dev, ram_page_t *ems) neat_mem_update_state(dev, ems->virt_base, EMS_PGSIZE, MEM_FLAG_EMS, MEM_FMASK_EMS); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT EMS: page %d set to %08lx, %sabled)\n", ems->page, ems->addr - ram, ems->enabled ? "en" : "dis"); #endif @@ -528,7 +534,7 @@ ems_write(uint16_t port, uint8_t val, void *priv) int8_t new_enabled; uint32_t new_phys_base; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: ems_write(%04x, %02x)\n", port, val); #endif @@ -577,6 +583,7 @@ ems_read(uint16_t port, void *priv) switch (port & 0x000f) { case 0x0008: /* page number register */ + case 0x0009: ret = (dev->ems[vpage].phys_base / EMS_PGSIZE) & 0x7f; if (dev->ems[vpage].enabled) ret |= 0x80; @@ -587,7 +594,7 @@ ems_read(uint16_t port, void *priv) neat_log("Port: %04X, ret: %02X\n", port, ret); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: ems_read(%04x) = %02x\n", port, ret); #endif @@ -686,7 +693,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) uint8_t *reg; int i; -#if NEAT_DEBUG > 2 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: write(%04x, %02x)\n", port, val); #endif @@ -704,7 +711,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) *reg = (*reg & ~RA0_MASK) | val | (RA0_REV_ID << RA0_REV_SH); if ((xval & 0x20) && (val & 0x20)) outb(0x64, 0xfe); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RA0=%02x(%02x)\n", val, *reg); #endif break; @@ -712,7 +719,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RA1: val &= RA1_MASK; *reg = (*reg & ~RA1_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RA1=%02x(%02x)\n", val, *reg); #endif break; @@ -720,7 +727,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RA2: val &= RA2_MASK; *reg = (*reg & ~RA2_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RA2=%02x(%02x)\n", val, *reg); #endif break; @@ -728,7 +735,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB0: val &= RB0_MASK; *reg = (*reg & ~RB0_MASK) | val | (RB0_REV_ID << RB0_REV_SH); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB0=%02x(%02x)\n", val, *reg); #endif break; @@ -737,7 +744,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) val &= RB1_MASK; *reg = (*reg & ~RB1_MASK) | val; shadow_recalc(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB1=%02x(%02x)\n", val, *reg); #endif break; @@ -749,7 +756,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) neat_mem_update_state(dev, 0x00080000, 0x00020000, MEM_FLAG_READ | MEM_FLAG_WRITE, MEM_FMASK_SHADOW); else neat_mem_update_state(dev, 0x00080000, 0x00020000, 0x00, MEM_FMASK_SHADOW); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB2=%02x(%02x)\n", val, *reg); #endif break; @@ -758,7 +765,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) val &= RB3_MASK; *reg = (*reg & ~RB3_MASK) | val; shadow_recalc(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB3=%02x(%02x)\n", val, *reg); #endif break; @@ -767,7 +774,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) val &= RB4_MASK; *reg = (*reg & ~RB4_MASK) | val; shadow_recalc(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB4=%02x(%02x)\n", val, *reg); #endif break; @@ -776,7 +783,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) val &= RB5_MASK; *reg = (*reg & ~RB5_MASK) | val; shadow_recalc(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB5=%02x(%02x)\n", val, *reg); #endif break; @@ -784,7 +791,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB6: val &= RB6_MASK; *reg = (*reg & ~RB6_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB6=%02x(%02x)\n", val, *reg); #endif break; @@ -803,7 +810,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) if ((xval & RB7_EMSEN) && (val & RB7_EMSEN)) ems_set_handlers(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB7=%02x(%02x)\n", val, *reg); #endif break; @@ -811,7 +818,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB8: val &= RB8_MASK; *reg = (*reg & ~RB8_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB8=%02x(%02x)\n", val, *reg); #endif break; @@ -819,7 +826,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB9: val &= RB9_MASK; *reg = (*reg & ~RB9_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB9=%02x(%02x)\n", val, *reg); #endif @@ -842,7 +849,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB10: val &= RB10_MASK; *reg = (*reg & ~RB10_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB10=%02x(%02x)\n", val, *reg); #endif @@ -877,7 +884,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB12: val &= RB12_MASK; *reg = (*reg & ~RB12_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB12=%02x(%02x)\n", val, *reg); #endif i = (val & RB12_EMSLEN) >> RB12_EMSLEN_SH; @@ -944,7 +951,7 @@ neat_read(uint16_t port, void *priv) break; } -#if NEAT_DEBUG > 2 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: read(%04x) = %02x\n", port, ret); #endif From 5c4fcfaf8525768dccaad201ad7e7911f475c1b9 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 17 Feb 2025 04:49:43 +0100 Subject: [PATCH 41/45] ESC/P Printer: No longer assume roms/ is where the binary is, fixes #5221. --- src/include/86box/plat.h | 4 +- src/include/86box/rom.h | 1 + src/io.c | 104 ++++++++++++++++++++++++++++++++++--- src/mem/rom.c | 42 +++++++++++++++ src/printer/prt_escp.c | 10 ++-- src/qt/languages/86box.pot | 6 +++ src/qt/languages/ca-ES.po | 6 +++ src/qt/languages/cs-CZ.po | 6 +++ src/qt/languages/de-DE.po | 6 +++ src/qt/languages/es-ES.po | 6 +++ src/qt/languages/fi-FI.po | 6 +++ src/qt/languages/fr-FR.po | 6 +++ src/qt/languages/hr-HR.po | 10 +++- src/qt/languages/hu-HU.po | 6 +++ src/qt/languages/it-IT.po | 8 ++- src/qt/languages/ja-JP.po | 6 +++ src/qt/languages/ko-KR.po | 6 +++ src/qt/languages/nl-NL.po | 6 +++ src/qt/languages/pl-PL.po | 6 +++ src/qt/languages/pt-BR.po | 6 +++ src/qt/languages/pt-PT.po | 6 +++ src/qt/languages/ru-RU.po | 6 +++ src/qt/languages/sk-SK.po | 6 +++ src/qt/languages/sl-SI.po | 10 +++- src/qt/languages/tr-TR.po | 6 +++ src/qt/languages/uk-UA.po | 6 +++ src/qt/languages/vi-VN.po | 6 +++ src/qt/languages/zh-CN.po | 6 +++ src/qt/languages/zh-TW.po | 8 ++- src/qt/qt_platform.cpp | 2 + 30 files changed, 300 insertions(+), 19 deletions(-) diff --git a/src/include/86box/plat.h b/src/include/86box/plat.h index f39f6ba51..81874685e 100644 --- a/src/include/86box/plat.h +++ b/src/include/86box/plat.h @@ -50,7 +50,9 @@ enum { STRING_HW_NOT_AVAILABLE_DEVICE, /* "Device \"%hs\" is not available..." */ STRING_MONITOR_SLEEP, /* "Monitor in sleep mode" */ STRING_GHOSTPCL_ERROR_TITLE, /* "Unable to initialize GhostPCL" */ - STRING_GHOSTPCL_ERROR_DESC /* "gpcl6dll32.dll/gpcl6dll64.dll/libgpcl6 is required..." */ + STRING_GHOSTPCL_ERROR_DESC, /* "gpcl6dll32.dll/gpcl6dll64.dll/libgpcl6 is required..." */ + STRING_ESCP_ERROR_TITLE, /* "Unable to find Dot-Matrix fonts" */ + STRING_ESCP_ERROR_DESC /* "TrueType fonts in the \"roms/printer/fonts\" directory..." */ }; /* The Win32 API uses _wcsicmp. */ diff --git a/src/include/86box/rom.h b/src/include/86box/rom.h index 1f6e611b1..83fd7cf90 100644 --- a/src/include/86box/rom.h +++ b/src/include/86box/rom.h @@ -52,6 +52,7 @@ extern uint8_t rom_read(uint32_t addr, void *priv); extern uint16_t rom_readw(uint32_t addr, void *priv); extern uint32_t rom_readl(uint32_t addr, void *priv); +extern void rom_get_full_path(char *dest, const char *fn); extern FILE *rom_fopen(const char *fn, char *mode); extern int rom_getfile(char *fn, char *s, int size); extern int rom_present(const char *fn); diff --git a/src/io.c b/src/io.c index 27f8503b0..2565ac537 100644 --- a/src/io.c +++ b/src/io.c @@ -30,6 +30,7 @@ #include "cpu.h" #include <86box/m_amstrad.h> #include <86box/pci.h> +#include <86box/mem.h> #define NPORTS 65536 /* PC/AT supports 64K ports */ @@ -59,6 +60,7 @@ int initialized = 0; io_t *io[NPORTS]; io_t *io_last[NPORTS]; +// #define ENABLE_IO_LOG 1 #ifdef ENABLE_IO_LOG int io_do_log = ENABLE_IO_LOG; @@ -69,7 +71,8 @@ io_log(const char *fmt, ...) if (io_do_log) { va_start(ap, fmt); - pclog_ex(fmt, ap); + if (CS == 0xf000) + pclog_ex(fmt, ap); va_end(ap); } } @@ -77,6 +80,18 @@ io_log(const char *fmt, ...) # define io_log(fmt, ...) #endif +uint16_t last_port_read = 0xffff; + +static void +print_lpr(void) +{ + FILE *f = fopen("d:\\86boxnew\\ndiags.dmp", "wb"); + fwrite(&(ram[0x24c30]), 1, 65536, f); + fclose(f); + + pclog("last_port_read = %04X\n", last_port_read); +} + void io_init(void) { @@ -106,6 +121,8 @@ io_init(void) /* io[c] should be NULL. */ io[c] = io_last[c] = NULL; } + + atexit(print_lpr); } void @@ -333,6 +350,11 @@ io_debug_check_addr(uint16_t addr) } #endif +#include <86box/random.h> + +uint8_t post_code = 0xc6; +uint8_t action = 0x00; + uint8_t inb(uint16_t port) { @@ -393,7 +415,33 @@ inb(uint16_t port) ret = 0xfe; #endif - io_log("[%04X:%08X] (%i, %i, %04i) in b(%04X) = %02X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); +#if 0 + if (port == 0x5f7) + ret = 0xaf; +#endif + + if (port == 0x379) + ret &= 0xf8; + + // io_log("[%04X:%08X] (%i, %i, %04i) in b(%04X) = %02X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); + + // if (CS == 0xc000) + // pclog("[%04X:%08X] [R] %04X = %02X\n", CS, cpu_state.pc, port, ret); + + // if (port == 0x62) + // ret = 0xf2; + + // if (port == 0x62) + // ret |= random_generate() & 0x80; + + // if ((port >= 0x60) && (port <= 0x66)) + // pclog("[%04X:%04X] [R] %04X = %02X\n", CS, cpu_state.pc, port, ret); + + if ((port != 0x0061) && (port != 0x0177) && (port != 0x01f7) && (port != 0x0376) && (port != 0x03c7) && (port != 0x03c8) && (port != 0x03c9) && (port != 0x03f6) && (port != 0x03da)) { + io_log("[%04X:%08X] (%i, %i, %04i) in b(%04X) = %02X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); + } + + last_port_read = port; return ret; } @@ -447,7 +495,20 @@ outb(uint16_t port, uint8_t val) #endif } - io_log("[%04X:%08X] (%i, %i, %04i) outb(%04X, %02X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); + // io_log("[%04X:%08X] (%i, %i, %04i) outb(%04X, %02X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); + + if (port == 0x0068) + action = val; + + if (port == 0x0080) + post_code = val; + + // if (port == 0x3db) + // pclog("[%04X:%04X] [W] %04X = %02X\n", CS, cpu_state.pc, port, val); + + if ((port != 0x0061) && (port != 0x00ed) && (port != 0x03c7) && (port != 0x03c8) && (port != 0x03c9)) { + io_log("[%04X:%08X] (%i, %i, %04i) outb(%04X, %02X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); + } return; } @@ -525,7 +586,9 @@ inw(uint16_t port) if (!found) cycles -= io_delay; - io_log("[%04X:%08X] (%i, %i, %04i) in w(%04X) = %04X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); + if (1) { + io_log("[%04X:%08X] (%i, %i, %04i) in w(%04X) = %04X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); + } return ret; } @@ -594,7 +657,21 @@ outw(uint16_t port, uint16_t val) #endif } - io_log("[%04X:%08X] (%i, %i, %04i) outw(%04X, %04X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); + if (port == 0x0080) + post_code = val; + +#if 0 + if (port == 0x0c02) { + if (val) + mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_EXTANY); + else + mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL); + } +#endif + + if (1) { + io_log("[%04X:%08X] (%i, %i, %04i) outw(%04X, %04X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); + } return; } @@ -704,7 +781,9 @@ inl(uint16_t port) if (!found) cycles -= io_delay; - io_log("[%04X:%08X] (%i, %i, %04i) in l(%04X) = %08X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); + if (1) { + io_log("[%04X:%08X] (%i, %i, %04i) in l(%04X) = %08X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); + } return ret; } @@ -791,7 +870,9 @@ outl(uint16_t port, uint32_t val) #endif } - io_log("[%04X:%08X] (%i, %i, %04i) outl(%04X, %08X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); + if (1) { + io_log("[%04X:%08X] (%i, %i, %04i) outl(%04X, %08X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); + } return; } @@ -801,6 +882,7 @@ io_trap_readb(uint16_t addr, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(1, addr, 0, 0, trap->priv); + pclog("[%04X:%08X] io_trap_readb(%04X)\n", CS, cpu_state.pc, addr); return 0xff; } @@ -809,6 +891,7 @@ io_trap_readw(uint16_t addr, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(2, addr, 0, 0, trap->priv); + pclog("[%04X:%08X] io_trap_readw(%04X)\n", CS, cpu_state.pc, addr); return 0xffff; } @@ -817,6 +900,7 @@ io_trap_readl(uint16_t addr, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(4, addr, 0, 0, trap->priv); + pclog("[%04X:%08X] io_trap_readl(%04X)\n", CS, cpu_state.pc, addr); return 0xffffffff; } @@ -825,6 +909,7 @@ io_trap_writeb(uint16_t addr, uint8_t val, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(1, addr, 1, val, trap->priv); + pclog("[%04X:%08X] io_trap_writeb(%04X)\n", CS, cpu_state.pc, addr); } static void @@ -832,6 +917,7 @@ io_trap_writew(uint16_t addr, uint16_t val, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(2, addr, 1, val, trap->priv); + pclog("[%04X:%08X] io_trap_writew(%04X)\n", CS, cpu_state.pc, addr); } static void @@ -839,6 +925,7 @@ io_trap_writel(uint16_t addr, uint32_t val, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(4, addr, 1, val, trap->priv); + pclog("[%04X:%08X] io_trap_writel(%04X)\n", CS, cpu_state.pc, addr); } void * @@ -885,6 +972,9 @@ io_trap_remap(void *handle, int enable, uint16_t addr, uint16_t size) io_trap_writeb, io_trap_writew, io_trap_writel, trap); } + + if ((addr == 0x0170) || (addr == 0x0376) || (addr == 0x01f0) || (addr == 0x03f6)) + pclog("io_trap_remape(%04X) = %i\n", addr, trap->enable); } void diff --git a/src/mem/rom.c b/src/mem/rom.c index f9718b7ce..8b2308402 100644 --- a/src/mem/rom.c +++ b/src/mem/rom.c @@ -86,6 +86,48 @@ rom_add_path(const char *path) path_slash(rom_path->path); } +static int +rom_check(const char *fn) +{ + FILE *fp = NULL; + int ret = 0; + + if ((fn[strlen(fn) - 1] == '/') || (fn[strlen(fn) - 1] == '\\')) + ret = plat_dir_check((char *) fn); + else { + fp = fopen(fn, "rb"); + ret = (fp != NULL); + fclose(fp); + } + + return ret; +} + +void +rom_get_full_path(char *dest, const char *fn) +{ + char temp[1024] = { 0 }; + + dest[0] = 0x00; + + if (strstr(fn, "roms/") == fn) { + /* Relative path */ + for (rom_path_t *rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) { + path_append_filename(temp, rom_path->path, fn + 5); + + if (rom_check(temp)) { + strcpy(dest, temp); + return; + } + } + + return; + } else { + /* Absolute path */ + strcpy(dest, fn); + } +} + FILE * rom_fopen(const char *fn, char *mode) { diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index 0198444a0..d0836e5f2 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -1968,16 +1968,16 @@ escp_init(void *lpt) dev->ctrl = 0x04; dev->lpt = lpt; + rom_get_full_path(dev->fontpath, "roms/printer/fonts/"); + /* Create a full pathname for the font files. */ - if (strlen(exe_path) >= sizeof(dev->fontpath)) { + if (strlen(dev->fontpath) == 0) { + ui_msgbox_header(MBX_ERROR, plat_get_string(STRING_ESCP_ERROR_TITLE), + plat_get_string(STRING_ESCP_ERROR_DESC)); free(dev); return (NULL); } - strcpy(dev->fontpath, exe_path); - path_slash(dev->fontpath); - strcat(dev->fontpath, "roms/printer/fonts/"); - /* Create the full path for the page images. */ path_append_filename(dev->pagepath, usr_path, "printer"); if (!plat_dir_check(dev->pagepath)) diff --git a/src/qt/languages/86box.pot b/src/qt/languages/86box.pot index ac2db7d07..65cc32f85 100644 --- a/src/qt/languages/86box.pot +++ b/src/qt/languages/86box.pot @@ -2135,3 +2135,9 @@ msgstr "" msgid "Generic PC/AT Memory Expansion" msgstr "" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "" diff --git a/src/qt/languages/ca-ES.po b/src/qt/languages/ca-ES.po index e49ab3223..cf3d5c7f7 100644 --- a/src/qt/languages/ca-ES.po +++ b/src/qt/languages/ca-ES.po @@ -2129,3 +2129,9 @@ msgstr "Expansió de memòria genèrica PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Expansió de memòria genèrica PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "No es pot trobar tipus de lletra de matriu de punts" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Els tipus de lletra TrueType al directori \"roms/printer/fonts\" són necessaris per a l'emulació de la impressora de matriu de punts ESC/P genèrica." diff --git a/src/qt/languages/cs-CZ.po b/src/qt/languages/cs-CZ.po index cafadd63b..e3d85dd09 100644 --- a/src/qt/languages/cs-CZ.po +++ b/src/qt/languages/cs-CZ.po @@ -2129,3 +2129,9 @@ msgstr "Obecné rozšíření paměti PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Obecné rozšíření paměti PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Nastala chyba při nachození jehličkových písem" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Pro emulaci obecné jehličkové tiskárny ESC/P jsou vyžadována písma TrueType ve složce \"roms/printer/fonts\"." diff --git a/src/qt/languages/de-DE.po b/src/qt/languages/de-DE.po index aa666cc48..c904cad0d 100644 --- a/src/qt/languages/de-DE.po +++ b/src/qt/languages/de-DE.po @@ -2132,3 +2132,9 @@ msgstr "Generische PC/XT-Speichererweiterung" msgid "Generic PC/AT Memory Expansion" msgstr "Generische PC/AT-Speichererweiterung" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Nadel-Schriften konnten nicht gefunden werden" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "TrueType-Schriften in das \"roms/printer/fonts\"-Verzeichnis sind für die Allgemeines ESC/P Nadel-Druckers erforderlich." diff --git a/src/qt/languages/es-ES.po b/src/qt/languages/es-ES.po index 5cac8968f..ca7a3ad53 100644 --- a/src/qt/languages/es-ES.po +++ b/src/qt/languages/es-ES.po @@ -2128,3 +2128,9 @@ msgstr "Expansión de Memoria Generica PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Expansión de Memoria Generica PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "No fué posible encontrar las fuentes matriciales" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Las fuentes TrueType en el directorio \"roms/printer/fonts\" son necesarias para la emulación de la impresora matricial ESC/P genérica." diff --git a/src/qt/languages/fi-FI.po b/src/qt/languages/fi-FI.po index 21dcfd1bc..f044365f0 100644 --- a/src/qt/languages/fi-FI.po +++ b/src/qt/languages/fi-FI.po @@ -2129,3 +2129,9 @@ msgstr "Yleinen PC/XT-muistilaajennus" msgid "Generic PC/AT Memory Expansion" msgstr "Yleinen PC/AT-muistilaajennus" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Pistematriisifontteja ei löydy" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "TrueType-fontteja kansiossa \"roms/printer/fonts\"-hakemistoon yleinen ESC/P pistematriisitulostin emulointiin." diff --git a/src/qt/languages/fr-FR.po b/src/qt/languages/fr-FR.po index ff8a5168f..3b283b3dd 100644 --- a/src/qt/languages/fr-FR.po +++ b/src/qt/languages/fr-FR.po @@ -2129,3 +2129,9 @@ msgstr "Expansion de la mémoire générique PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Expansion de la mémoire générique PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Impossible de trouver les polices à matrice à points" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Les polices TrueType dans le répertoire \"roms/printer/fonts\" sont nécessaires à l'émulation de l'imprimante générique ESC/P à matrice à points." diff --git a/src/qt/languages/hr-HR.po b/src/qt/languages/hr-HR.po index 9d242f8e0..ed4fdf621 100644 --- a/src/qt/languages/hr-HR.po +++ b/src/qt/languages/hr-HR.po @@ -655,7 +655,7 @@ msgid "ZIP images" msgstr "ZIP slike" msgid "86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory." -msgstr "86Box nije mogao pronaći upotrebljive ROM datoteke.\n\nMolimte posjetite sknite paket s ROM datotekama i ekstrahirajte paket u \"roms\" mapu." +msgstr "86Box nije mogao pronaći upotrebljive ROM datoteke.\n\nMolimte posjetite sknite paket s ROM datotekama i ekstrahirajte paket u mapu \"roms\"." msgid "(empty)" msgstr "(prazno)" @@ -2062,7 +2062,7 @@ msgid "Generic Text Printer" msgstr "Generični tekstovni pisač" msgid "Generic ESC/P Dot-Matrix Printer" -msgstr "Generični pisač matrični ESC/P" +msgstr "Generični matrični pisač ESC/P" msgid "Generic PostScript Printer" msgstr "Generični pisač PostScript" @@ -2129,3 +2129,9 @@ msgstr "Generičko proširenje memorije PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Generičko proširenje memorije PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Nije moguće pronaći matrične fontove" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "TrueType fontovi u mapi \"roms/printer/fonts\" potrebni su za emulaciju generičnog matričnog pisača ESC/P." diff --git a/src/qt/languages/hu-HU.po b/src/qt/languages/hu-HU.po index 2b5adacf4..b4afd8010 100644 --- a/src/qt/languages/hu-HU.po +++ b/src/qt/languages/hu-HU.po @@ -2129,3 +2129,9 @@ msgstr "Általános PC/XT memóriabővítők" msgid "Generic PC/AT Memory Expansion" msgstr "Általános PC/AT memóriabővítők" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Nem találja a Dot-Matrix betűtípusokat" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Az általános ESC/P pontmátrixnyomtató emulációjához a \"roms/printer/fonts\" könyvtárban található TrueType betűtípusok szükségesek." diff --git a/src/qt/languages/it-IT.po b/src/qt/languages/it-IT.po index c9af80127..73ec57ec0 100644 --- a/src/qt/languages/it-IT.po +++ b/src/qt/languages/it-IT.po @@ -655,7 +655,7 @@ msgid "ZIP images" msgstr "Immagini ZIP" msgid "86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory." -msgstr "86Box non può trovare immagini ROM utilizzabili.\n\nPlease download a ROM set and extract it into the \"roms\" directory." +msgstr "86Box non può trovare immagini ROM utilizzabili.\n\nSi prega di scaricare un set di ROM ed estrarlo nella directory \"roms\"." msgid "(empty)" msgstr "(empty)" @@ -2129,3 +2129,9 @@ msgstr "Espansione di memoria generica PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Espansione di memoria generica PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Impossibile trovare i font a matrice di punti" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "I font TrueType presenti nella directory \"roms/printer/fonts\" sono necessari per l'emulazione della stampante a matrice di punti ESC/P generica." diff --git a/src/qt/languages/ja-JP.po b/src/qt/languages/ja-JP.po index 9a3289b51..9c6fa66e7 100644 --- a/src/qt/languages/ja-JP.po +++ b/src/qt/languages/ja-JP.po @@ -2129,3 +2129,9 @@ msgstr "汎用PC/XTメモリ拡張カード" msgid "Generic PC/AT Memory Expansion" msgstr "汎用PC/ATメモリ拡張カード" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "ドットマトリクスフォントが見つかりません" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "汎用ESC/Pドットマトリクスプリンタのエミュレーションには、roms/printer/fontsディレクトリ内のTrueTypeフォントが必要です。" diff --git a/src/qt/languages/ko-KR.po b/src/qt/languages/ko-KR.po index c6928ad43..ec4b20d0d 100644 --- a/src/qt/languages/ko-KR.po +++ b/src/qt/languages/ko-KR.po @@ -2129,3 +2129,9 @@ msgstr "일반 PC/XT 메모리 확장 카드" msgid "Generic PC/AT Memory Expansion" msgstr "일반 PC/AT 메모리 확장 카드" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "도트 매트릭스 글꼴을 찾을 수 없습니다" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "일반 ESC/P 도트 매트릭스 프린터의 에뮬레이션을 사용하려면 \"roms/printer/fonts\" 디렉터리에 있는 트루타입 글꼴이 필요합니다." diff --git a/src/qt/languages/nl-NL.po b/src/qt/languages/nl-NL.po index 27870db90..c601197ac 100644 --- a/src/qt/languages/nl-NL.po +++ b/src/qt/languages/nl-NL.po @@ -2129,3 +2129,9 @@ msgstr "Generieke PC/XT geheugenuitbreiding" msgid "Generic PC/AT Memory Expansion" msgstr "Generieke PC/AT geheugenuitbreiding" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Dot-matrix-lettertypen niet gevonden" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "TrueType lettertypen in de map \"roms/printer/fonts\" zijn nodig voor de emulatie van de generieke ESC/P dot-matrix-printer." diff --git a/src/qt/languages/pl-PL.po b/src/qt/languages/pl-PL.po index e42904458..78ded239f 100644 --- a/src/qt/languages/pl-PL.po +++ b/src/qt/languages/pl-PL.po @@ -2129,3 +2129,9 @@ msgstr "Generyczne rozszerzenie pamięci PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Generyczne rozszerzenie pamięci PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Nie można znaleźć czcionek igłowych" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Czcionki TrueType w katalogu \"roms/printer/fonts\" są wymagane do emulacji generyczniej drukarki igłowej ESC/P." diff --git a/src/qt/languages/pt-BR.po b/src/qt/languages/pt-BR.po index de1bcd544..1594e30ab 100644 --- a/src/qt/languages/pt-BR.po +++ b/src/qt/languages/pt-BR.po @@ -2129,3 +2129,9 @@ msgstr "Expansão de memória genérica PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Expansão de memória genérica PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Não foi possível localizar os fontes matriciais de pontos" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "As fontes TrueType no diretório \"roms/printer/fonts\" são necessárias para a emulação da impressora matricial de pontos ESC/P genérica." diff --git a/src/qt/languages/pt-PT.po b/src/qt/languages/pt-PT.po index d4c8bf170..b31f020d4 100644 --- a/src/qt/languages/pt-PT.po +++ b/src/qt/languages/pt-PT.po @@ -2129,3 +2129,9 @@ msgstr "Expansão de memória genérica PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Expansão de memória genérica PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Não foi possível encontrar os fontes matriciais de pontos" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "As fontes TrueType no diretório \"roms/printer/fonts\" são necessárias para a emulação da impressora matricial de pontos ESC/P genérica" diff --git a/src/qt/languages/ru-RU.po b/src/qt/languages/ru-RU.po index a2e352faa..a8a4b7794 100644 --- a/src/qt/languages/ru-RU.po +++ b/src/qt/languages/ru-RU.po @@ -2135,3 +2135,9 @@ msgstr "Стандартное расширение памяти PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Стандартное расширение памяти PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Невозможно найти матричные шрифты" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Шрифты TrueType в каталоге \"roms/printer/fonts\" необходимы для эмуляции стандартного матричного принтера ESC/P." diff --git a/src/qt/languages/sk-SK.po b/src/qt/languages/sk-SK.po index 6b2074d47..e789d9ef9 100644 --- a/src/qt/languages/sk-SK.po +++ b/src/qt/languages/sk-SK.po @@ -2129,3 +2129,9 @@ msgstr "Všeobecné rozšírenie pamäte PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Všeobecné rozšírenie pamäte PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Nastala chyba pri hľadaní ihličkových písem" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Písma TrueType v adresári \"roms/printer/fonts\" sú potrebné na emuláciu generickej ihličkovej tlačiarne ESC/P." diff --git a/src/qt/languages/sl-SI.po b/src/qt/languages/sl-SI.po index 9d8ccaaf9..1394a3635 100644 --- a/src/qt/languages/sl-SI.po +++ b/src/qt/languages/sl-SI.po @@ -823,10 +823,10 @@ msgid "Are you sure you want to exit 86Box?" msgstr "Ste prepričani, da želite zapreti 86Box?" msgid "Unable to initialize Ghostscript" -msgstr "Ne morem inicializirati Ghostscript" +msgstr "Ghostscript-a ni bilo mogoče inicializirati" msgid "Unable to initialize GhostPCL" -msgstr "Ne morem inicializirati GhostPCL" +msgstr "GhostPCL-ja ni bilo mogoče inicializirati" msgid "MO %i (%ls): %ls" msgstr "MO %i (%ls): %ls" @@ -2129,3 +2129,9 @@ msgstr "Generična razširitev pomnilnika PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Generična razširitev pomnilnika PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Matričnih pisav ni bilo mogoče najti" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Matrične pisave v imeniku \"roms/printer/fonts\" so potrebne za emulacijo generičnega matričnega tiskalnika ESC/P." diff --git a/src/qt/languages/tr-TR.po b/src/qt/languages/tr-TR.po index 288412154..81866b3ce 100644 --- a/src/qt/languages/tr-TR.po +++ b/src/qt/languages/tr-TR.po @@ -2129,3 +2129,9 @@ msgstr "Sıradan PC/XT bellek artırma" msgid "Generic PC/AT Memory Expansion" msgstr "Sıradan PC/AT bellek artırma" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Dot Matrix yazı tipleri bulunamıyor" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Sıradan ESC/P Dot Matrix Yazıcının emülasyonu için \"roms/printer/fonts\" dizinindeki TrueType yazı tipleri gereklidir." diff --git a/src/qt/languages/uk-UA.po b/src/qt/languages/uk-UA.po index 5ce59be01..9b57ac03e 100644 --- a/src/qt/languages/uk-UA.po +++ b/src/qt/languages/uk-UA.po @@ -2135,3 +2135,9 @@ msgstr "Загальне розширення пам'яті PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Загальне розширення пам'яті PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Неможливо знайти матричні шрифти" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Шрифти TrueType у каталозі \"roms/printer/fonts\" потрібні для емуляції загального матричного принтера Generic ESC/P." diff --git a/src/qt/languages/vi-VN.po b/src/qt/languages/vi-VN.po index 707c7ae7f..fafbbc160 100644 --- a/src/qt/languages/vi-VN.po +++ b/src/qt/languages/vi-VN.po @@ -2129,3 +2129,9 @@ msgstr "Chung mở rộng bộ nhớ qua PC/XT" msgid "Generic PC/AT Memory Expansion" msgstr "Chung mở rộng bộ nhớ qua PC/AT" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "Không tìm thấy phông chữ ma trận chấm" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "Cần có phông chữ TrueType trong thư mục \"roms/printer/fonts\" để mô phỏng máy in generic ESC/P ma trận chấm." diff --git a/src/qt/languages/zh-CN.po b/src/qt/languages/zh-CN.po index 81451b2b3..ec5d2c252 100644 --- a/src/qt/languages/zh-CN.po +++ b/src/qt/languages/zh-CN.po @@ -2129,3 +2129,9 @@ msgstr "通用 PC/XT 内存扩展" msgid "Generic PC/AT Memory Expansion" msgstr "通用 PC/AT 内存扩展" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "无法找到点阵字体" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "仿真通用 ESC/P 点阵打印机需要使用 \"roms/printer/fonts\" 目录中的 TrueType 字体。" diff --git a/src/qt/languages/zh-TW.po b/src/qt/languages/zh-TW.po index 9bf8edfc6..b0d8163cb 100644 --- a/src/qt/languages/zh-TW.po +++ b/src/qt/languages/zh-TW.po @@ -2062,7 +2062,7 @@ msgid "Generic Text Printer" msgstr "通用文字印表機" msgid "Generic ESC/P Dot-Matrix Printer" -msgstr "通用 ESC/P 點矩陣" +msgstr "通用 ESC/P 點矩陣印表機" msgid "Generic PostScript Printer" msgstr "通用 PostScript 印表機" @@ -2129,3 +2129,9 @@ msgstr "通用 PC/XT 記憶體擴充" msgid "Generic PC/AT Memory Expansion" msgstr "通用 PC/AT 記憶體擴充" + +msgid "Unable to find Dot-Matrix fonts" +msgstr "無法找到點矩陣字型" + +msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P Dot-Matrix Printer." +msgstr "通用 ESC/P 點矩陣印表機的模擬需要 \"roms/printer/fonts\" 目錄中的 TrueType 字體。" diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index dd6c34efc..561c94d8a 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -639,6 +639,8 @@ ProgSettings::reloadStrings() translatedstrings[STRING_MONITOR_SLEEP] = QCoreApplication::translate("", "Monitor in sleep mode").toStdWString(); translatedstrings[STRING_NET_ERROR] = QCoreApplication::translate("", "Failed to initialize network driver").toStdWString(); translatedstrings[STRING_NET_ERROR_DESC] = QCoreApplication::translate("", "The network configuration will be switched to the null driver").toStdWString(); + translatedstrings[STRING_ESCP_ERROR_TITLE] = QCoreApplication::translate("", "Unable to find Dot-Matrix fonts").toStdWString(); + translatedstrings[STRING_ESCP_ERROR_DESC] = QCoreApplication::translate("", "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulatio of the Generic ESC/P Dot-Matrix Printer.").toStdWString(); } wchar_t * From a6a377757f3098eeb38ec3a71c725d31a897de53 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 17 Feb 2025 04:57:49 +0100 Subject: [PATCH 42/45] Paradise VGA: Override the horizontal skew handling, fixes #5228. --- src/video/vid_paradise.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/vid_paradise.c b/src/video/vid_paradise.c index d0acaf276..da8bb9aa6 100644 --- a/src/video/vid_paradise.c +++ b/src/video/vid_paradise.c @@ -571,6 +571,8 @@ paradise_init(const device_t *info, uint32_t memory) paradise->type = info->local; + svga->hoverride = 1; + return paradise; } From f68810b2777ccfa749efe89bc815648fa8651a73 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 17 Feb 2025 15:20:16 +0100 Subject: [PATCH 43/45] Reverted the io.c changes that should not have been committed. --- src/io.c | 104 ++++--------------------------------------------------- 1 file changed, 7 insertions(+), 97 deletions(-) diff --git a/src/io.c b/src/io.c index 2565ac537..27f8503b0 100644 --- a/src/io.c +++ b/src/io.c @@ -30,7 +30,6 @@ #include "cpu.h" #include <86box/m_amstrad.h> #include <86box/pci.h> -#include <86box/mem.h> #define NPORTS 65536 /* PC/AT supports 64K ports */ @@ -60,7 +59,6 @@ int initialized = 0; io_t *io[NPORTS]; io_t *io_last[NPORTS]; -// #define ENABLE_IO_LOG 1 #ifdef ENABLE_IO_LOG int io_do_log = ENABLE_IO_LOG; @@ -71,8 +69,7 @@ io_log(const char *fmt, ...) if (io_do_log) { va_start(ap, fmt); - if (CS == 0xf000) - pclog_ex(fmt, ap); + pclog_ex(fmt, ap); va_end(ap); } } @@ -80,18 +77,6 @@ io_log(const char *fmt, ...) # define io_log(fmt, ...) #endif -uint16_t last_port_read = 0xffff; - -static void -print_lpr(void) -{ - FILE *f = fopen("d:\\86boxnew\\ndiags.dmp", "wb"); - fwrite(&(ram[0x24c30]), 1, 65536, f); - fclose(f); - - pclog("last_port_read = %04X\n", last_port_read); -} - void io_init(void) { @@ -121,8 +106,6 @@ io_init(void) /* io[c] should be NULL. */ io[c] = io_last[c] = NULL; } - - atexit(print_lpr); } void @@ -350,11 +333,6 @@ io_debug_check_addr(uint16_t addr) } #endif -#include <86box/random.h> - -uint8_t post_code = 0xc6; -uint8_t action = 0x00; - uint8_t inb(uint16_t port) { @@ -415,33 +393,7 @@ inb(uint16_t port) ret = 0xfe; #endif -#if 0 - if (port == 0x5f7) - ret = 0xaf; -#endif - - if (port == 0x379) - ret &= 0xf8; - - // io_log("[%04X:%08X] (%i, %i, %04i) in b(%04X) = %02X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); - - // if (CS == 0xc000) - // pclog("[%04X:%08X] [R] %04X = %02X\n", CS, cpu_state.pc, port, ret); - - // if (port == 0x62) - // ret = 0xf2; - - // if (port == 0x62) - // ret |= random_generate() & 0x80; - - // if ((port >= 0x60) && (port <= 0x66)) - // pclog("[%04X:%04X] [R] %04X = %02X\n", CS, cpu_state.pc, port, ret); - - if ((port != 0x0061) && (port != 0x0177) && (port != 0x01f7) && (port != 0x0376) && (port != 0x03c7) && (port != 0x03c8) && (port != 0x03c9) && (port != 0x03f6) && (port != 0x03da)) { - io_log("[%04X:%08X] (%i, %i, %04i) in b(%04X) = %02X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); - } - - last_port_read = port; + io_log("[%04X:%08X] (%i, %i, %04i) in b(%04X) = %02X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); return ret; } @@ -495,20 +447,7 @@ outb(uint16_t port, uint8_t val) #endif } - // io_log("[%04X:%08X] (%i, %i, %04i) outb(%04X, %02X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); - - if (port == 0x0068) - action = val; - - if (port == 0x0080) - post_code = val; - - // if (port == 0x3db) - // pclog("[%04X:%04X] [W] %04X = %02X\n", CS, cpu_state.pc, port, val); - - if ((port != 0x0061) && (port != 0x00ed) && (port != 0x03c7) && (port != 0x03c8) && (port != 0x03c9)) { - io_log("[%04X:%08X] (%i, %i, %04i) outb(%04X, %02X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); - } + io_log("[%04X:%08X] (%i, %i, %04i) outb(%04X, %02X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); return; } @@ -586,9 +525,7 @@ inw(uint16_t port) if (!found) cycles -= io_delay; - if (1) { - io_log("[%04X:%08X] (%i, %i, %04i) in w(%04X) = %04X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); - } + io_log("[%04X:%08X] (%i, %i, %04i) in w(%04X) = %04X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); return ret; } @@ -657,21 +594,7 @@ outw(uint16_t port, uint16_t val) #endif } - if (port == 0x0080) - post_code = val; - -#if 0 - if (port == 0x0c02) { - if (val) - mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_EXTANY); - else - mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL); - } -#endif - - if (1) { - io_log("[%04X:%08X] (%i, %i, %04i) outw(%04X, %04X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); - } + io_log("[%04X:%08X] (%i, %i, %04i) outw(%04X, %04X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); return; } @@ -781,9 +704,7 @@ inl(uint16_t port) if (!found) cycles -= io_delay; - if (1) { - io_log("[%04X:%08X] (%i, %i, %04i) in l(%04X) = %08X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); - } + io_log("[%04X:%08X] (%i, %i, %04i) in l(%04X) = %08X\n", CS, cpu_state.pc, in_smm, found, qfound, port, ret); return ret; } @@ -870,9 +791,7 @@ outl(uint16_t port, uint32_t val) #endif } - if (1) { - io_log("[%04X:%08X] (%i, %i, %04i) outl(%04X, %08X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); - } + io_log("[%04X:%08X] (%i, %i, %04i) outl(%04X, %08X)\n", CS, cpu_state.pc, in_smm, found, qfound, port, val); return; } @@ -882,7 +801,6 @@ io_trap_readb(uint16_t addr, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(1, addr, 0, 0, trap->priv); - pclog("[%04X:%08X] io_trap_readb(%04X)\n", CS, cpu_state.pc, addr); return 0xff; } @@ -891,7 +809,6 @@ io_trap_readw(uint16_t addr, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(2, addr, 0, 0, trap->priv); - pclog("[%04X:%08X] io_trap_readw(%04X)\n", CS, cpu_state.pc, addr); return 0xffff; } @@ -900,7 +817,6 @@ io_trap_readl(uint16_t addr, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(4, addr, 0, 0, trap->priv); - pclog("[%04X:%08X] io_trap_readl(%04X)\n", CS, cpu_state.pc, addr); return 0xffffffff; } @@ -909,7 +825,6 @@ io_trap_writeb(uint16_t addr, uint8_t val, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(1, addr, 1, val, trap->priv); - pclog("[%04X:%08X] io_trap_writeb(%04X)\n", CS, cpu_state.pc, addr); } static void @@ -917,7 +832,6 @@ io_trap_writew(uint16_t addr, uint16_t val, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(2, addr, 1, val, trap->priv); - pclog("[%04X:%08X] io_trap_writew(%04X)\n", CS, cpu_state.pc, addr); } static void @@ -925,7 +839,6 @@ io_trap_writel(uint16_t addr, uint32_t val, void *priv) { io_trap_t *trap = (io_trap_t *) priv; trap->func(4, addr, 1, val, trap->priv); - pclog("[%04X:%08X] io_trap_writel(%04X)\n", CS, cpu_state.pc, addr); } void * @@ -972,9 +885,6 @@ io_trap_remap(void *handle, int enable, uint16_t addr, uint16_t size) io_trap_writeb, io_trap_writew, io_trap_writel, trap); } - - if ((addr == 0x0170) || (addr == 0x0376) || (addr == 0x01f0) || (addr == 0x03f6)) - pclog("io_trap_remape(%04X) = %i\n", addr, trap->enable); } void From 464253a8cd4dcbfd3c857ace6dfabe3be2a315ef Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 17 Feb 2025 19:48:31 +0100 Subject: [PATCH 44/45] IDE: Fix device bus flags. --- src/disk/hdc_ide.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index b69ddf128..fb95bef28 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -3338,7 +3338,7 @@ const device_t ide_vlb_device = { const device_t ide_vlb_sec_device = { .name = "VLB IDE Controller (Secondary)", .internal_name = "ide_vlb_sec", - .flags = DEVICE_VLB | DEVICE_ISA16, + .flags = DEVICE_VLB, .local = 2, .init = ide_sec_init, .close = ide_sec_close, @@ -3352,7 +3352,7 @@ const device_t ide_vlb_sec_device = { const device_t ide_vlb_2ch_device = { .name = "VLB IDE Controller (Dual-Channel)", .internal_name = "ide_vlb_2ch", - .flags = DEVICE_VLB | DEVICE_ISA16, + .flags = DEVICE_VLB, .local = 3, .init = ide_init, .close = ide_close, @@ -3366,7 +3366,7 @@ const device_t ide_vlb_2ch_device = { const device_t ide_pci_device = { .name = "PCI IDE Controller", .internal_name = "ide_pci", - .flags = DEVICE_PCI | DEVICE_ISA16, + .flags = DEVICE_PCI, .local = 4, .init = ide_init, .close = ide_close, @@ -3380,7 +3380,7 @@ const device_t ide_pci_device = { const device_t ide_pci_sec_device = { .name = "PCI IDE Controller (Secondary)", .internal_name = "ide_pci_sec", - .flags = DEVICE_PCI | DEVICE_ISA16, + .flags = DEVICE_PCI, .local = 4, .init = ide_sec_init, .close = ide_sec_close, @@ -3394,7 +3394,7 @@ const device_t ide_pci_sec_device = { const device_t ide_pci_2ch_device = { .name = "PCI IDE Controller (Dual-Channel)", .internal_name = "ide_pci_2ch", - .flags = DEVICE_PCI | DEVICE_ISA16, + .flags = DEVICE_PCI, .local = 5, .init = ide_init, .close = ide_close, From 45dc381251e5769fccc0fe4f0575ae77a8bf3a40 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 17 Feb 2025 19:50:53 +0100 Subject: [PATCH 45/45] Forgot the single-channel VLB controller. --- src/disk/hdc_ide.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index fb95bef28..125cd806d 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -3324,7 +3324,7 @@ const device_t ide_isa_2ch_device = { const device_t ide_vlb_device = { .name = "VLB IDE Controller", .internal_name = "ide_vlb", - .flags = DEVICE_VLB | DEVICE_ISA16, + .flags = DEVICE_VLB, .local = 2, .init = ide_init, .close = ide_close,