From f542b5a8af2e79d61cbf4bb73889723838d44df0 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sat, 8 Mar 2025 00:13:47 -0500 Subject: [PATCH] Make XT86 diag's and debug roms work --- src/machine/m_xt.c | 124 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 94 insertions(+), 30 deletions(-) diff --git a/src/machine/m_xt.c b/src/machine/m_xt.c index 3941a39d5..eae32ca7b 100644 --- a/src/machine/m_xt.c +++ b/src/machine/m_xt.c @@ -471,42 +471,98 @@ machine_genxt_init(const machine_t *model) static const device_config_t ibmxt86_config[] = { // clang-format off { - .name = "bios", - .description = "BIOS Version", - .type = CONFIG_BIOS, + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, .default_string = "ibm5160_050986", - .default_int = 0, - .file_filter = "", - .spinner = { 0 }, - .bios = { - { .name = "1501512 (05/09/86)", .internal_name = "ibm5160_050986", .bios_type = BIOS_NORMAL, - .files_no = 2, .local = 0, .size = 65536, .files = { "roms/machines/ibmxt86/BIOS_5160_09MAY86_U18_59X7268_62X0890_27256_F800.BIN", "roms/machines/ibmxt86/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN", "" } }, - { .name = "5000026 (01/10/86)", .internal_name = "ibm5160_011086", .bios_type = BIOS_NORMAL, - .files_no = 2, .local = 0, .size = 65536, .files = { "roms/machines/ibmxt86/BIOS_5160_10JAN86_U18_62X0851_27256_F800.BIN", "roms/machines/ibmxt86/BIOS_5160_10JAN86_U19_62X0854_27256_F000.BIN", "" } }, - { .name = "1501512 (01/10/86) (Alt)", .internal_name = "ibm5160_011086_alt", .bios_type = BIOS_NORMAL, - .files_no = 2, .local = 0, .size = 65536, .files = { "roms/machines/ibmxt86/BIOS_5160_10JAN86_U18_62X0852_27256_F800.BIN", "roms/machines/ibmxt86/BIOS_5160_10JAN86_U19_62X0853_27256_F000.BIN", "" } }, -#if 0 + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .bios = { + { + .name = "1501512 (05/09/86)", + .internal_name = "ibm5160_050986", + .bios_type = BIOS_NORMAL, + .files_no = 2, + .local = 0, + .size = 65536, + .files = { "roms/machines/ibmxt86/BIOS_5160_09MAY86_U18_59X7268_62X0890_27256_F800.BIN", "roms/machines/ibmxt86/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN", "" } + }, + { + .name = "5000026 (01/10/86)", + .internal_name = "ibm5160_011086", + .bios_type = BIOS_NORMAL, + .files_no = 2, + .local = 0, + .size = 65536, + .files = { "roms/machines/ibmxt86/BIOS_5160_10JAN86_U18_62X0851_27256_F800.BIN", "roms/machines/ibmxt86/BIOS_5160_10JAN86_U19_62X0854_27256_F000.BIN", "" } + }, + { + .name = "1501512 (01/10/86) (Alt)", + .internal_name = "ibm5160_011086_alt", + .bios_type = BIOS_NORMAL, + .files_no = 2, + .local = 0, + .size = 65536, + .files = { "roms/machines/ibmxt86/BIOS_5160_10JAN86_U18_62X0852_27256_F800.BIN", "roms/machines/ibmxt86/BIOS_5160_10JAN86_U19_62X0853_27256_F000.BIN", "" } + }, + // GlaBIOS for IBM XT - { .name = "GlaBIOS 0.2.5 (8088)", .internal_name = "glabios_025_8088", .bios_type = BIOS_NORMAL, - .files_no = 1, .local = 0, .size = 40960, .files = { "roms/machines/glabios/GLABIOS_0.2.5_8X.ROM", "" } }, - { .name = "GlaBIOS 0.2.5 (V20)", .internal_name = "glabios_025_v20", .bios_type = BIOS_NORMAL, - .files_no = 1, .local = 0, .size = 40960, .files = { "roms/machines/glabios/GLABIOS_0.2.5_VX.ROM", "" } }, + { + .name = "GlaBIOS 0.2.5 (8088)", + .internal_name = "glabios_025_8088", + .bios_type = BIOS_NORMAL, + .files_no = 2, + .local = 1, + .size = 65536, + .files = { "roms/machines/glabios/GLABIOS_0.2.5_8X.ROM", "roms/machines/ibmxt86/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN", "" } + }, + { + .name = "GlaBIOS 0.2.5 (V20)", + .internal_name = "glabios_025_v20", + .bios_type = BIOS_NORMAL, + .files_no = 2, + .local = 1, + .size = 65536, + .files = { "roms/machines/glabios/GLABIOS_0.2.5_VX.ROM", "roms/machines/ibmxt86/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN", "" } + }, // The following are Diagnostic ROMs. - { .name = "Supersoft Diagnostics", .internal_name = "diag_supersoft", .bios_type = BIOS_NORMAL, - .files_no = 1, .local = 0, .size = 65536, .files = { "roms/machines/diagnostic/Supersoft_PCXT_8KB.bin", "" } }, - { .name = "Ruud's Diagnostic Rom", .internal_name = "diag_ruuds", .bios_type = BIOS_NORMAL, - .files_no = 1, .local = 0, .size = 65536, .files = { "roms/machines/diagnostic/ruuds_diagnostic_rom_v5.3_8kb.bin", "" } }, - { .name = "XT RAM Test", .internal_name = "diag_xtramtest", .bios_type = BIOS_NORMAL, - .files_no = 1, .local = 0, .size = 65536, .files = { "roms/machines/diagnostic/xtramtest_8k.bin", "" } }, -#endif + { + .name = "Supersoft Diagnostics", + .internal_name = "diag_supersoft", + .bios_type = BIOS_NORMAL, + .files_no = 2, + .local = 2, + .size = 65536, + .files = { "roms/machines/diagnostic/Supersoft_PCXT_32KB.bin", "roms/machines/ibmxt86/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN", "" } + }, + { + .name = "Ruud's Diagnostic Rom", + .internal_name = "diag_ruuds", + .bios_type = BIOS_NORMAL, + .files_no = 2, + .local = 2, + .size = 65536, + .files = { "roms/machines/diagnostic/ruuds_diagnostic_rom_v5.3_32kb.bin", "roms/machines/ibmxt86/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN", "" } + }, + { + .name = "XT RAM Test", + .internal_name = "diag_xtramtest", + .bios_type = BIOS_NORMAL, + .files_no = 2, + .local = 2, + .size = 65536, + .files = { "roms/machines/diagnostic/xtramtest_32k.bin", "roms/machines/ibmxt86/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN", "" } + }, + { .files_no = 0 } }, }, { - .name = "enable_5161", + .name = "enable_5161", .description = "IBM 5161 Expansion Unit", - .type = CONFIG_BINARY, + .type = CONFIG_BINARY, .default_int = 1 }, { .name = "", .description = "", .type = CONFIG_END } @@ -533,6 +589,8 @@ machine_xt86_init(const machine_t *model) int ret = 0; uint8_t enable_5161; const char *fn; + uint16_t offset = 0; + uint32_t local = 0; /* No ROMs available. */ if (!device_available(model->device)) @@ -541,11 +599,17 @@ machine_xt86_init(const machine_t *model) device_context(model->device); enable_5161 = machine_get_config_int("enable_5161"); fn = device_get_bios_file(model->device, device_get_config_bios("bios"), 0); - ret = bios_load_linear(fn, 0x000fe000, 65536, 0x6000); + local = device_get_bios_local(model->device, device_get_config_bios("bios")); + + if (local == 0) // Offset for stock roms + offset = 0x6000; + ret = bios_load_linear(fn, 0x000fe000, 65536, offset); if (ret) { - fn = device_get_bios_file(model->device, device_get_config_bios("bios"), 0); - (void) bios_load_aux_linear(fn, 0x000f8000, 24576, 0); + if (local == 0) { // needed for stock roms + fn = device_get_bios_file(model->device, device_get_config_bios("bios"), 0); + (void) bios_load_aux_linear(fn, 0x000f8000, 24576, 0); + } fn = device_get_bios_file(model->device, device_get_config_bios("bios"), 1); (void) bios_load_aux_linear(fn, 0x000f0000, 32768, 0); }