From dfee5d88d328e02a26ebab20351e6ec222f54887 Mon Sep 17 00:00:00 2001 From: win2kgamer <47463859+win2kgamer@users.noreply.github.com> Date: Mon, 16 Feb 2026 20:37:59 -0600 Subject: [PATCH 1/6] Cirrus: Make CL-GD5402 VRAM configurable with options for 256KB and 512KB --- src/video/vid_cl54xx.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 71ded9010..9f33a9d89 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -1330,7 +1330,10 @@ gd54xx_in(uint16_t addr, void *priv) /* Scratch Pad 1 (Memory size for 5402/542x) */ ret = svga->seqregs[0x0a] & ~0x1a; if (svga->crtc[0x27] == CIRRUS_ID_CLGD5402) { - ret |= 0x01; /*512K of memory*/ + if ((gd54xx->vram_size >> 10) == 512) + ret |= 0x01; /*512K of memory*/ + else + ret &= 0xfe; /*256K of memory*/ } else if (svga->crtc[0x27] > CIRRUS_ID_CLGD5402) { switch (gd54xx->vram_size >> 10) { case 512: @@ -4443,8 +4446,6 @@ gd54xx_init(const device_t *info) vram = 1024; else if (id == CIRRUS_ID_CLGD5401) vram = 256; - else if (id == CIRRUS_ID_CLGD5402) - vram = 512; else vram = device_get_config_int("memory"); @@ -4780,6 +4781,25 @@ gd54xx_force_redraw(void *priv) } // clang-format off +static const device_config_t gd5402_config[] = { + { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 512, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + { .name = "", .description = "", .type = CONFIG_END } +}; + static const device_config_t gd542x_config[] = { { .name = "memory", @@ -5027,7 +5047,7 @@ const device_t gd5402_isa_device = { .available = gd5402_available, .speed_changed = gd54xx_speed_changed, .force_redraw = gd54xx_force_redraw, - .config = NULL, + .config = gd5402_config, }; const device_t gd5402_onboard_device = { @@ -5041,7 +5061,7 @@ const device_t gd5402_onboard_device = { .available = NULL, .speed_changed = gd54xx_speed_changed, .force_redraw = gd54xx_force_redraw, - .config = NULL, + .config = gd5402_config, }; const device_t gd5402_onboard_commodore_device = { @@ -5055,7 +5075,7 @@ const device_t gd5402_onboard_commodore_device = { .available = NULL, .speed_changed = gd54xx_speed_changed, .force_redraw = gd54xx_force_redraw, - .config = NULL, + .config = gd5402_config, }; const device_t gd5420_isa_device = { From 9bdfe5cbea2d3c86939a8083ea1c9cba37894d88 Mon Sep 17 00:00:00 2001 From: win2kgamer <47463859+win2kgamer@users.noreply.github.com> Date: Mon, 16 Feb 2026 20:40:39 -0600 Subject: [PATCH 2/6] Cirrus: All machines using the CL-GD5428 ISA as an onboard device only support 512KB/1MB configs --- src/video/vid_cl54xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 9f33a9d89..e7de99863 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -5301,7 +5301,7 @@ const device_t gd5428_onboard_device = { .available = gd5428_isa_available, .speed_changed = gd54xx_speed_changed, .force_redraw = gd54xx_force_redraw, - .config = gd5426_config + .config = gd542x_config }; const device_t gd5428_vlb_onboard_device = { From 3621e0b33500a02200e0bbd19507f6d25a62cf9f Mon Sep 17 00:00:00 2001 From: win2kgamer <47463859+win2kgamer@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:10:55 -0600 Subject: [PATCH 3/6] Move the Intel Monsoon and Tandy Sensation II/3100/MMPC machine over to the 512KB/1MB 5428 VLB variant and rename it since it's no longer specific to a Dell machine --- src/machine/machine_table.c | 4 ++-- src/video/vid_cl54xx.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index fd7f5b1f0..bdc8571a0 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -8620,7 +8620,7 @@ const machine_t machines[] = { .kbd_device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = &gd5428_vlb_onboard_device, + .vid_device = &gd5428_onboard_vlb_device, .snd_device = NULL, .net_device = NULL }, @@ -8708,7 +8708,7 @@ const machine_t machines[] = { .kbd_device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = &gd5428_vlb_onboard_device, + .vid_device = &gd5428_onboard_vlb_device, .snd_device = NULL, .net_device = NULL }, diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index e7de99863..4445def97 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -5319,7 +5319,7 @@ const device_t gd5428_vlb_onboard_device = { }; const device_t gd5428_onboard_vlb_device = { - .name = "Cirrus Logic GD5428 (VLB) (On-Board) (Dell)", + .name = "Cirrus Logic GD5428 (VLB) (On-Board) (1MB)", .internal_name = "cl_gd5428_onboard_vlb", .flags = DEVICE_VLB, .local = CIRRUS_ID_CLGD5428 | 0x200, From 38e5f2a374b4051f943145a9cb1336be0ad86bc4 Mon Sep 17 00:00:00 2001 From: win2kgamer <47463859+win2kgamer@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:12:59 -0600 Subject: [PATCH 4/6] Sensation audio: Initialize ret in sensation_visdac_read, should fix a compiler warning --- src/sound/snd_sensation.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sound/snd_sensation.c b/src/sound/snd_sensation.c index ea87c8391..aeb58fb46 100644 --- a/src/sound/snd_sensation.c +++ b/src/sound/snd_sensation.c @@ -808,6 +808,7 @@ sensation_visdac_read(uint16_t port, void *priv) sensation_t *visdac = (sensation_t *) priv; uint8_t ret; + ret = 0xff; switch (port & 0xF) { case 0x00: From ca9f9d7fc366866b2042aa7251098a4311cc62e3 Mon Sep 17 00:00:00 2001 From: win2kgamer <47463859+win2kgamer@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:19:00 -0600 Subject: [PATCH 5/6] Tandy Sensations: Remove the MACHINE_APM flag since the chipset these machines use lacks SMI functionality --- 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 bdc8571a0..654934e6c 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -7893,7 +7893,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE | MACHINE_SOUND | MACHINE_GAMEPORT | MACHINE_APM, + .flags = MACHINE_IDE | MACHINE_SOUND | MACHINE_GAMEPORT, .ram = { .min = 2048, .max = 32768, @@ -8690,7 +8690,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE | MACHINE_VIDEO | MACHINE_APM, + .flags = MACHINE_IDE | MACHINE_VIDEO, .ram = { .min = 2048, .max = 65536, From 9a5ec04ec51407204de62e2693f90b6c15813e4f Mon Sep 17 00:00:00 2001 From: win2kgamer <47463859+win2kgamer@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:00:19 -0600 Subject: [PATCH 6/6] Tandy Sensation II: After further research the Tandy 3100 and MMPC series have a different BIOS and some board differences so rename the machine to reflect this Also add a new Cirrus 5428 device with a fixed 1MB VRAM config for this machine --- src/include/86box/video.h | 1 + src/machine/machine_table.c | 4 ++-- src/video/vid_cl54xx.c | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/include/86box/video.h b/src/include/86box/video.h index 32e1ace03..d7369af28 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -387,6 +387,7 @@ extern const device_t gd5426_vlb_device; extern const device_t gd5426_onboard_device; extern const device_t gd5428_isa_device; extern const device_t gd5428_vlb_onboard_device; +extern const device_t gd5428_vlb_onboard_tandy_device; extern const device_t gd5428_vlb_device; extern const device_t gd5428_diamond_speedstar_pro_b1_vlb_device; extern const device_t gd5428_boca_isa_device; diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 654934e6c..f1006ffb4 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -8670,7 +8670,7 @@ const machine_t machines[] = { }, /* Has a VLSI VL82C113A SCAMP Combination I/O which holds the KBC. */ { - .name = "[VLSI 82C486] Tandy Sensation! II (25-1651)/3100/MMPC", + .name = "[VLSI 82C486] Tandy Sensation! II (25-1651)", .internal_name = "sensation2", .type = MACHINE_TYPE_486_S2, .chipset = MACHINE_CHIPSET_VLSI_VL82C486, @@ -8708,7 +8708,7 @@ const machine_t machines[] = { .kbd_device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = &gd5428_onboard_vlb_device, + .vid_device = &gd5428_vlb_onboard_tandy_device, .snd_device = NULL, .net_device = NULL }, diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 4445def97..c02f5191a 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -4442,7 +4442,9 @@ gd54xx_init(const device_t *info) gd54xx->vram_size = vram << 10; } else { if (id <= CIRRUS_ID_CLGD5428) { - if ((id == CIRRUS_ID_CLGD5426) && (info->local & 0x200)) + if ((id == CIRRUS_ID_CLGD5428) && (info->local & 0x200) && (info->local & 0x1000)) + vram = 1024; + else if ((id == CIRRUS_ID_CLGD5426) && (info->local & 0x200)) vram = 1024; else if (id == CIRRUS_ID_CLGD5401) vram = 256; @@ -5332,6 +5334,20 @@ const device_t gd5428_onboard_vlb_device = { .config = gd542x_config }; +const device_t gd5428_vlb_onboard_tandy_device = { + .name = "Cirrus Logic GD5428 (VLB) (On-Board) (Tandy)", + .internal_name = "cl_gd5428_vlb_onboard_tandy", + .flags = DEVICE_VLB, + .local = CIRRUS_ID_CLGD5428 | 0x200 | 0x1000, + .init = gd54xx_init, + .close = gd54xx_close, + .reset = gd54xx_reset, + .available = NULL, + .speed_changed = gd54xx_speed_changed, + .force_redraw = gd54xx_force_redraw, + .config = NULL +}; + const device_t gd5429_isa_device = { .name = "Cirrus Logic GD5429 (ISA)", .internal_name = "cl_gd5429_isa",