diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index b3dc4cdfa..b7702e55b 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -569,6 +569,7 @@ extern int machine_at_acer100t_init(const machine_t *); /* HT18 */ extern int machine_at_ama932j_init(const machine_t *); +extern int machine_at_tandy1000rsx_init(const machine_t *); /* Intel 82335 */ extern int machine_at_adi386sx_init(const machine_t *); diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index 71cd65e5a..5cf11bc3c 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -245,6 +245,7 @@ extern const device_t soundman_device; /* Tandy PSSJ */ extern const device_t pssj_device; extern const device_t pssj_isa_device; +extern const device_t pssj_1e0_device; /* Tandy PSG */ extern const device_t tndy_device; diff --git a/src/machine/m_at_386sx.c b/src/machine/m_at_386sx.c index 9ad29e2e8..6b5c4414c 100644 --- a/src/machine/m_at_386sx.c +++ b/src/machine/m_at_386sx.c @@ -42,6 +42,7 @@ #include <86box/vid_cga.h> #include <86box/flash.h> #include <86box/machine.h> +#include <86box/sound.h> /* ISA */ /* @@ -369,6 +370,32 @@ machine_at_ama932j_init(const machine_t *model) return ret; } +int +machine_at_tandy1000rsx_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear("roms/machines/tandy1000rsx/tandy-1000rsx-1-10.00.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_ide_init(model); + + device_add(&headland_ht18c_device); + device_add_params(machine_get_kbc_device(machine), (void *) model->kbc_params); + device_add(&pssj_1e0_device); + + if (fdc_current[0] == FDC_INTERNAL) + device_add(&fdc_at_device); + + if (gfxcard[0] == VID_INTERNAL) + device_add(machine_get_vid_device(machine)); + + return ret; +} + /* Intel 82335 */ int machine_at_adi386sx_init(const machine_t *model) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 4b3c22615..c67a22c04 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -5511,6 +5511,50 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* Has unknown KBC firmware */ + { + .name = "[HT18] Tandy 1000 RSX", + .internal_name = "tandy1000rsx", + .type = MACHINE_TYPE_386SX, + .chipset = MACHINE_CHIPSET_HT18, + .init = machine_at_tandy1000rsx_init, + .p1_handler = machine_generic_p1_handler, + .gpio_handler = NULL, + .available_flag = MACHINE_AVAILABLE, + .gpio_acpi_handler = NULL, + .cpu = { + .package = CPU_PKG_386SX, + .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, + .flags = MACHINE_IDE | MACHINE_VIDEO | MACHINE_GAMEPORT, + .ram = { + .min = 1024, + .max = 9216, + .step = 512 + }, + .nvrmask = 127, + .jumpered_ecp_dma = 0, + .default_jumpered_ecp_dma = -1, + .kbc_device = &kbc_at_device, + .kbc_params = 0x00000000, + .kbc_p1 = 0x000004f0, + .gpio = 0xffffffff, + .gpio_acpi = 0xffffffff, + .device = NULL, + .kbd_device = NULL, + .fdc_device = NULL, + .sio_device = NULL, + .vid_device = &gd5402_onboard_device, + .snd_device = NULL, + .net_device = NULL + }, /* Most likely has a Phoenix MultiKey/42 keyboard controller. */ { .name = "[Intel 82335] ADI 386SX", diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 7de8ec824..1b10fdd8d 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -55,8 +55,10 @@ pssj_write(uint16_t port, uint8_t val, void *priv) if (!pssj->enable) timer_disable(&pssj->timer_count); sn74689_set_extra_divide(&pssj->sn76489, val & 0x40); - if (!(val & 8)) + if (!(val & 8)) { pssj->irq = 0; + picintc(1 << 7); + } pssj_update_irq(pssj); break; case 1: @@ -78,7 +80,7 @@ pssj_write(uint16_t port, uint8_t val, void *priv) break; case 3: pssj->freq = (pssj->freq & 0x0ff) | ((val & 0xf) << 8); - pssj->amplitude = val >> 4; + pssj->amplitude = (val & 0xef) >> 4; break; default: