diff --git a/src/device.c b/src/device.c index 25f0b55de..ecd523274 100644 --- a/src/device.c +++ b/src/device.c @@ -392,29 +392,24 @@ device_available(const device_t *dev) { if (dev != NULL) { const device_config_t *config = dev->config; - if (config != NULL) { - while (config->type != CONFIG_END) { - if (config->type == CONFIG_BIOS) { - int roms_present = 0; - const device_config_bios_t *bios = (const device_config_bios_t *) config->bios; + if ((config != NULL) && (config->type == CONFIG_BIOS)) { + int roms_present = 0; + const device_config_bios_t *bios = (const device_config_bios_t *) config->bios; - /* Go through the ROM's in the device configuration. */ - while ((bios != NULL) && - (bios->name != NULL) && - (bios->internal_name != NULL) && - (bios->files_no != 0)) { - int i = 0; - for (uint8_t bf = 0; bf < bios->files_no; bf++) - i += !!rom_present(bios->files[bf]); - if (i == bios->files_no) - roms_present++; - bios++; - } - - return (roms_present ? -1 : 0); - } - config++; + /* Go through the ROM's in the device configuration. */ + while ((bios != NULL) && + (bios->name != NULL) && + (bios->internal_name != NULL) && + (bios->files_no != 0)) { + int i = 0; + for (uint8_t bf = 0; bf < bios->files_no; bf++) + i += !!rom_present(bios->files[bf]); + if (i == bios->files_no) + roms_present++; + bios++; } + + return (roms_present ? -1 : 0); } /* No CONFIG_BIOS field present, use the classic available(). */ diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index 85581af2d..d54f6ab0c 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -1106,6 +1106,36 @@ xta_close(void *priv) static const device_config_t wdxt150_config[] = { // clang-format off + { + .name = "bios_rev", + .description = "BIOS Revision", + .type = CONFIG_BIOS, + .default_string = "rev_1", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .bios = { + { + .name = "Revision 1.0", + .internal_name = "rev_1", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 8192, + .files = { WD_REV_1_BIOS_FILE, "" } + }, + { + .name = "Revision 2.0", + .internal_name = "rev_2", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 8192, + .files = { WD_REV_2_BIOS_FILE, "" } + }, + { .files_no = 0 } + }, + }, { .name = "base", .description = "Address", @@ -1151,36 +1181,6 @@ static const device_config_t wdxt150_config[] = { }, .bios = { { 0 } } }, - { - .name = "bios_rev", - .description = "BIOS Revision", - .type = CONFIG_BIOS, - .default_string = "rev_1", - .default_int = 0, - .file_filter = NULL, - .spinner = { 0 }, - .bios = { - { - .name = "Revision 1.0", - .internal_name = "rev_1", - .bios_type = BIOS_NORMAL, - .files_no = 1, - .local = 0, - .size = 8192, - .files = { WD_REV_1_BIOS_FILE, "" } - }, - { - .name = "Revision 2.0", - .internal_name = "rev_2", - .bios_type = BIOS_NORMAL, - .files_no = 1, - .local = 0, - .size = 8192, - .files = { WD_REV_2_BIOS_FILE, "" } - }, - { .files_no = 0 } - }, - }, { .name = "", .description = "", .type = CONFIG_END } // clang-format off }; diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 154a28cec..1c8e2c8da 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -252,6 +252,37 @@ xtide_at_close(void *priv) // clang-format off static const device_config_t xtide_config[] = { + { + .name = "bios", + .description = "BIOS Revision", + .type = CONFIG_BIOS, + .default_string = "xt", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { + { + .name = "Regular XT", + .internal_name = "xt", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 8192, + .files = { ROM_PATH_XT, "" } + }, + { + .name = "XT+ (V20/V30/8018x)", + .internal_name = "xt_plus", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 8192, + .files = { ROM_PATH_XTP, "" } + }, + { .files_no = 0 } + }, + }, { .name = "base", .description = "Address", @@ -348,37 +379,6 @@ static const device_config_t xtide_config[] = { }, .bios = { { 0 } } }, - { - .name = "bios", - .description = "BIOS Revision", - .type = CONFIG_BIOS, - .default_string = "xt", - .default_int = 0, - .file_filter = NULL, - .spinner = { 0 }, - .selection = { { 0 } }, - .bios = { - { - .name = "Regular XT", - .internal_name = "xt", - .bios_type = BIOS_NORMAL, - .files_no = 1, - .local = 0, - .size = 8192, - .files = { ROM_PATH_XT, "" } - }, - { - .name = "XT+ (V20/V30/8018x)", - .internal_name = "xt_plus", - .bios_type = BIOS_NORMAL, - .files_no = 1, - .local = 0, - .size = 8192, - .files = { ROM_PATH_XTP, "" } - }, - { .files_no = 0 } - }, - }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/scsi/scsi_ncr53c400.c b/src/scsi/scsi_ncr53c400.c index f91dc83a9..0e04e0b5e 100644 --- a/src/scsi/scsi_ncr53c400.c +++ b/src/scsi/scsi_ncr53c400.c @@ -859,6 +859,37 @@ static const device_config_t ncr53c400_mmio_config[] = { }; static const device_config_t rt1000b_config[] = { + { + .name = "bios_ver", + .description = "BIOS Revision", + .type = CONFIG_BIOS, + .default_string = "v8_10r", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { + { + .name = "Version 8.10R", + .internal_name = "v8_10r", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 8192, + .files = { RT1000B_810R_ROM, "" } + }, + { + .name = "Version 8.20R", + .internal_name = "v8_20r", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 8192, + .files = { RT1000B_820R_ROM, "" } + }, + { .files_no = 0 } + }, + }, { .name = "bios_addr", .description = "BIOS Address", @@ -895,37 +926,6 @@ static const device_config_t rt1000b_config[] = { }, .bios = { { 0 } } }, - { - .name = "bios_ver", - .description = "BIOS Revision", - .type = CONFIG_BIOS, - .default_string = "v8_10r", - .default_int = 0, - .file_filter = NULL, - .spinner = { 0 }, - .selection = { { 0 } }, - .bios = { - { - .name = "Version 8.10R", - .internal_name = "v8_10r", - .bios_type = BIOS_NORMAL, - .files_no = 1, - .local = 0, - .size = 8192, - .files = { RT1000B_810R_ROM, "" } - }, - { - .name = "Version 8.20R", - .internal_name = "v8_20r", - .bios_type = BIOS_NORMAL, - .files_no = 1, - .local = 0, - .size = 8192, - .files = { RT1000B_820R_ROM, "" } - }, - { .files_no = 0 } - }, - }, { .name = "", .description = "", .type = CONFIG_END } }; diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index 064d79230..1929d1d16 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -942,22 +942,6 @@ et4000_kasan_available(void) static const device_config_t et4000_tc6058af_config[] = { // clang-format off - { - .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 = "1 MB", .value = 1024 }, - { .description = "" } - }, - .bios = { { 0 } } - }, { .name = "bios_ver", .description = "BIOS Revision", @@ -989,18 +973,12 @@ static const device_config_t et4000_tc6058af_config[] = { { .files_no = 0 } } }, - { .name = "", .description = "", .type = CONFIG_END } -// clang-format on -}; - -static const device_config_t et4000_bios_config[] = { - // clang-format off { .name = "memory", .description = "Memory size", .type = CONFIG_SELECTION, .default_string = NULL, - .default_int = 1024, + .default_int = 512, .file_filter = NULL, .spinner = { 0 }, .selection = { @@ -1011,6 +989,12 @@ static const device_config_t et4000_bios_config[] = { }, .bios = { { 0 } } }, + { .name = "", .description = "", .type = CONFIG_END } +// clang-format on +}; + +static const device_config_t et4000_bios_config[] = { + // clang-format off { .name = "bios_ver", .description = "BIOS Revision", @@ -1042,6 +1026,22 @@ static const device_config_t et4000_bios_config[] = { { .files_no = 0 } } }, + { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 1024, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "256 KB", .value = 256 }, + { .description = "512 KB", .value = 512 }, + { .description = "1 MB", .value = 1024 }, + { .description = "" } + }, + .bios = { { 0 } } + }, { .name = "", .description = "", .type = CONFIG_END } // clang-format on };