From 054be5c76cca2ed3820607b3bd0dbc368ec60620 Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Fri, 23 May 2025 22:50:05 +0700 Subject: [PATCH 1/6] Machine table fixes 1. Unblock original i486 and Am486 CPUs and correct minimum RAM on Acer P3 (since it was copied from Soyo 4SAW2 a while ago) 2. Correct RAM step on few machines with SiS chipset 3. Correct minimum RAM on PCChips M579 and M729 respectively 4. Gigabyte GA-5SG100 does support 60MHZ bus speed according to its manual, so change its minimum bus speed to 60MHZ --- src/machine/machine_table.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 9a9cb5cf1..6f004ee78 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -8650,7 +8650,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET3, - .block = CPU_BLOCK(CPU_i486SX, CPU_i486DX, CPU_Am486SX, CPU_Am486DX), + .block = CPU_BLOCK_NONE, .min_bus = 0, .max_bus = 0, .min_voltage = 0, @@ -8661,7 +8661,7 @@ const machine_t machines[] = { .bus_flags = MACHINE_PS2_PCI, .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_VIDEO, .ram = { - .min = 2048, + .min = 1024, .max = 131072, .step = 1024 }, @@ -13838,7 +13838,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -13878,7 +13878,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -13920,7 +13920,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 786432, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -14084,7 +14084,7 @@ const machine_t machines[] = { .bus_flags = MACHINE_PS2_AGP | MACHINE_BUS_USB, .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI | MACHINE_USB, .ram = { - .min = 1024, + .min = 8192, .max = 1572864, .step = 8192 }, @@ -14443,7 +14443,7 @@ const machine_t machines[] = { .cpu = { .package = CPU_PKG_SOCKET5_7, .block = CPU_BLOCK_NONE, - .min_bus = 66666667, + .min_bus = 60000000, .max_bus = 100000000, .min_voltage = 2000, .max_voltage = 3520, @@ -14455,7 +14455,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 786432, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -15027,7 +15027,7 @@ const machine_t machines[] = { .bus_flags = MACHINE_PS2_AGP | MACHINE_BUS_USB, .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI | MACHINE_GAMEPORT | MACHINE_USB, /* Machine has internal sound: C-Media CMI8330 */ .ram = { - .min = 1024, + .min = 8192, .max = 1572864, .step = 8192 }, From 8556d05acd5c64ee531b59806dd9c191a2e96792 Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Fri, 23 May 2025 22:54:27 +0700 Subject: [PATCH 2/6] Revert minimum RAM on Acer P3 --- src/machine/machine_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 6f004ee78..ba24ea742 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -8661,7 +8661,7 @@ const machine_t machines[] = { .bus_flags = MACHINE_PS2_PCI, .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_VIDEO, .ram = { - .min = 1024, + .min = 2048, .max = 131072, .step = 1024 }, From e1a4f3fbaa19be6e6cc694ff1b116a94bbc47148 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 24 May 2025 08:23:28 +0200 Subject: [PATCH 3/6] Forgot the dell_jumper.c. --- src/device/dell_jumper.c | 175 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 src/device/dell_jumper.c diff --git a/src/device/dell_jumper.c b/src/device/dell_jumper.c new file mode 100644 index 000000000..12fc3d13b --- /dev/null +++ b/src/device/dell_jumper.c @@ -0,0 +1,175 @@ +/* + * 86Box A hypervisor and IBM PC system emulator that specializes in + * running old operating systems and software designed for IBM + * PC systems and compatibles from 1981 through fairly recent + * system designs based on the PCI bus. + * + * This file is part of the 86Box distribution. + * + * Implementation of the Dell 486 and 586 Jumper Readout. + * + * Register 0x02: + * - Bit 0: ATX power: 1 = off, 0 = on. + * + * Register 0x05: + * - Appears to be: 0x02 = On-board audio enabled; + * 0x07 = On-board audio disabled. + * + * Register 0x07: + * - Bit 0: On-board NIC: 1 = present, 0 = absent; + * - Bit 1: On-board audio: 1 = present, 0 = absent; + * - Bits 4-2: + * - 0, 0, 0 = GXL; + * - 0, 0, 1 = GL+; + * - 0, 1, 0 = GXMT; + * - 0, 1, 1 = GMT+; + * - 1, 0, 0 = GXM; + * - 1, 0, 1 = GM+; + * - 1, 1, 0 = WS; + * - 1, 1, 1 = GWS+. + * + * Authors: Miran Grca, + * + * Copyright 2025 Miran Grca. + */ +#include +#include +#include +#include +#include +#include +#define HAVE_STDARG_H +#include <86box/86box.h> +#include "cpu.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/machine.h> +#include <86box/sound.h> +#include <86box/chipset.h> +#include <86box/plat.h> +#include <86box/plat_unused.h> + +typedef struct dell_jumper_t { + uint8_t index; + uint8_t regs[256]; +} dell_jumper_t; + +#ifdef ENABLE_DELL_JUMPER_LOG +int dell_jumper_do_log = ENABLE_DELL_JUMPER_LOG; + +static void +dell_jumper_log(const char *fmt, ...) +{ + va_list ap; + + if (dell_jumper_do_log) { + va_start(ap, fmt); + pclog_ex(fmt, ap); + va_end(ap); + } +} +#else +# define dell_jumper_log(fmt, ...) +#endif + +static void +dell_jumper_write(uint16_t addr, uint8_t val, void *priv) +{ + dell_jumper_t *dev = (dell_jumper_t *) priv; + + dell_jumper_log("Dell Jumper: Write %02x\n", val); + + if (addr & 1) switch (dev->index) { + default: + dev->regs[dev->index] = val; + break; + case 0x02: + dev->regs[dev->index] = val; + if (val & 0x04) + /* Soft power off. */ + plat_power_off(); + break; + case 0x05: + dev->regs[dev->index] = (dev->regs[dev->index] & 0x02) | (val & 0xfd); + if (machine_snd != NULL) switch (val & 0x05) { + default: + case 0x05: + sb_vibra16s_onboard_relocate_base(0x0000, machine_snd); + break; + case 0x00: + sb_vibra16s_onboard_relocate_base(0x0220, machine_snd); + break; + } + break; + case 0x07: + break; + } else + dev->index = val; +} + +static uint8_t +dell_jumper_read(uint16_t addr, void *priv) +{ + const dell_jumper_t *dev = (dell_jumper_t *) priv; + uint8_t ret = 0xff; + + dell_jumper_log("Dell Jumper: Read %02x\n", dev->jumper); + + if (addr & 1) + ret = dev->regs[dev->index]; + else + ret = dev->index; + + return ret; +} + +static void +dell_jumper_reset(void *priv) +{ + dell_jumper_t *dev = (dell_jumper_t *) priv; + + dev->index = 0x00; + memset(dev->regs, 0x00, 256); + + if (sound_card_current[0] == SOUND_INTERNAL) + /* GXL, on-board audio present, on-board NIC absent. */ + dev->regs[0x07] = 0x02; + else + /* GXL, on-board audio absent, on-board NIC absent. */ + dev->regs[0x07] = 0x00; +} + +static void +dell_jumper_close(void *priv) +{ + dell_jumper_t *dev = (dell_jumper_t *) priv; + + free(dev); +} + +static void * +dell_jumper_init(const device_t *info) +{ + dell_jumper_t *dev = (dell_jumper_t *) calloc(1, sizeof(dell_jumper_t)); + + dell_jumper_reset(dev); + + io_sethandler(0x00e8, 0x0002, dell_jumper_read, NULL, NULL, dell_jumper_write, NULL, NULL, dev); + + return dev; +} + +const device_t dell_jumper_device = { + .name = "Dell Jumper Readout", + .internal_name = "dell_jumper", + .flags = 0, + .local = 0, + .init = dell_jumper_init, + .close = dell_jumper_close, + .reset = dell_jumper_reset, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; From 121e5f6b60e8579a8d8eaa9ab22db5bf782496da Mon Sep 17 00:00:00 2001 From: Jester Date: Sat, 24 May 2025 14:32:43 +0200 Subject: [PATCH 4/6] Update m_xt_olivetti.c add Olivetti M240 BIOS 2.12 --- src/machine/m_xt_olivetti.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine/m_xt_olivetti.c b/src/machine/m_xt_olivetti.c index 34ca441ec..7cfab9c11 100644 --- a/src/machine/m_xt_olivetti.c +++ b/src/machine/m_xt_olivetti.c @@ -2366,8 +2366,8 @@ machine_xt_m240_init(const machine_t *model) m24_kbd_t *m24_kbd; nvr_t *nvr; - ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pchj_2.11_low.bin", - "roms/machines/m240/olivetti_m240_pchk_2.11_high.bin", + ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pchj_2.12_low.bin", + "roms/machines/m240/olivetti_m240_pchk_2.12_high.bin", 0x000f8000, 32768, 0); if (bios_only || !ret) From dac9f6ee8a26d83ba415d2693f237bfafec707cd Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Sat, 24 May 2025 21:04:10 +0700 Subject: [PATCH 5/6] RAM step corrections for SiS 5600 machines --- src/machine/machine_table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 4bbf7f412..f72da7338 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -16108,7 +16108,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -16148,7 +16148,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -16909,7 +16909,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, From 1754deff4dda4286cc0a091f6c46cdc91f60a49e Mon Sep 17 00:00:00 2001 From: Jester Date: Sat, 24 May 2025 18:00:53 +0200 Subject: [PATCH 6/6] Fix wrong filename used for M240 BIOS I only updated the number, but should have changed the correct filename, oopsie --- src/machine/m_xt_olivetti.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine/m_xt_olivetti.c b/src/machine/m_xt_olivetti.c index 7cfab9c11..acdb77fd1 100644 --- a/src/machine/m_xt_olivetti.c +++ b/src/machine/m_xt_olivetti.c @@ -2366,8 +2366,8 @@ machine_xt_m240_init(const machine_t *model) m24_kbd_t *m24_kbd; nvr_t *nvr; - ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pchj_2.12_low.bin", - "roms/machines/m240/olivetti_m240_pchk_2.12_high.bin", + ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pchm_2.12_low.bin", + "roms/machines/m240/olivetti_m240_pchl_2.12_high.bin", 0x000f8000, 32768, 0); if (bios_only || !ret)