Make device.c assume CONFIG_BIOS is first in the config struct and make sure any device_t struct containing such follows that, in order to not have to traverse the entirety of every single device_t's config struct in the Settings dialog - should reduce the dialog's loading times further.
This commit is contained in:
@@ -392,9 +392,7 @@ 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) {
|
||||
if ((config != NULL) && (config->type == CONFIG_BIOS)) {
|
||||
int roms_present = 0;
|
||||
const device_config_bios_t *bios = (const device_config_bios_t *) config->bios;
|
||||
|
||||
@@ -413,9 +411,6 @@ device_available(const device_t *dev)
|
||||
|
||||
return (roms_present ? -1 : 0);
|
||||
}
|
||||
config++;
|
||||
}
|
||||
}
|
||||
|
||||
/* No CONFIG_BIOS field present, use the classic available(). */
|
||||
if (dev->available != NULL)
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -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 }
|
||||
};
|
||||
|
||||
|
||||
@@ -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 }
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user