diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 4431590a6..101ed2934 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -992,6 +992,9 @@ extern int machine_at_cu430hx_init(const machine_t *); extern const device_t tc430hx_device; #endif extern int machine_at_tc430hx_init(const machine_t *); +#ifdef EMU_DEVICE_H +extern const device_t m7shi_device; +#endif extern int machine_at_m7shi_init(const machine_t *); extern int machine_at_epc2102_init(const machine_t *); extern int machine_at_pcv90_init(const machine_t *); diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index b82f54905..ee276566a 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -368,17 +368,57 @@ machine_at_tc430hx_init(const machine_t *model) return ret; } +static const device_config_t m7shi_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "m7shi", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .bios = { + { .name = "PhoenixBIOS 4.0 Release 6.0 - Revision 05/20/97", .internal_name = "m7shi", .bios_type = BIOS_NORMAL, + .files_no = 1, .local = 0, .size = 262144, .files = { "roms/machines/m7shi/m7shi2n.rom", "" } }, + { .name = "PhoenixBIOS 4.0 Release 6.0 - Revision 01/21/98", .internal_name = "m7shi_4", .bios_type = BIOS_NORMAL, + .files_no = 1, .local = 0, .size = 262144, .files = { "roms/machines/m7shi/M7ns04.rom", "" } }, + { .files_no = 0 } + }, + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t m7shi_device = { + .name = "Micronics M7S-Hi", + .internal_name = "m7shi_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = m7shi_config +}; + int machine_at_m7shi_init(const machine_t *model) { - int ret; + int ret = 0; + const char* fn; - ret = bios_load_linear("roms/machines/m7shi/m7shi2n.rom", - 0x000c0000, 262144, 0); - - if (bios_only || !ret) + /* No ROMs available */ + if (!device_available(model->device)) return ret; + device_context(model->device); + fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), 0); + ret = bios_load_linear(fn, 0x000c0000, 262144, 0); + device_context_restore(); + machine_at_common_init_ex(model, 2); pci_init(PCI_CONFIG_TYPE_1); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 1740947bc..3d241401d 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -14134,7 +14134,7 @@ const machine_t machines[] = { .kbc_p1 = 0x00000cf0, .gpio = 0xffffffff, .gpio_acpi = 0xffffffff, - .device = NULL, + .device = &m7shi_device, .kbd_device = NULL, .fdc_device = NULL, .sio_device = NULL,