summaryrefslogtreecommitdiffstats
path: root/docs/release/src/emu/validity.cpp
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2018-03-28 12:33:19 +1100
committer Robbbert <Robbbert@users.noreply.github.com>2018-03-28 12:33:19 +1100
commit08f806096d2c383b1c08a7384414e93d95b3e4a9 (patch)
treea62b0e342fd1549b4753b2effcbf7e2ec6218746 /docs/release/src/emu/validity.cpp
parentbb3a9f91a33420859e27e2116d53b7be0aae0928 (diff)
0.196 Release filestag196
Diffstat (limited to 'docs/release/src/emu/validity.cpp')
-rw-r--r--docs/release/src/emu/validity.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/docs/release/src/emu/validity.cpp b/docs/release/src/emu/validity.cpp
index 065df1ccc07..5d57a8120d2 100644
--- a/docs/release/src/emu/validity.cpp
+++ b/docs/release/src/emu/validity.cpp
@@ -511,16 +511,18 @@ void validity_checker::validate_inlines()
if (fabsf(recip_approx(100.0f) - 0.01f) > 0.0001f)
osd_printf_error("Error testing recip_approx\n");
- testi32a = (testi32a & 0x0000ffff) | 0x400000;
- if (count_leading_zeros(testi32a) != 9)
- osd_printf_error("Error testing count_leading_zeros\n");
- if (count_leading_zeros(0) != 32)
- osd_printf_error("Error testing count_leading_zeros\n");
- testi32a = (testi32a | 0xffff0000) & ~0x400000;
- if (count_leading_ones(testi32a) != 9)
- osd_printf_error("Error testing count_leading_ones\n");
- if (count_leading_ones(0xffffffff) != 32)
- osd_printf_error("Error testing count_leading_ones\n");
+ for (int i = 0; i <= 32; i++)
+ {
+ u32 t = i < 32 ? (1 << (31 - i) | testu32a >> i) : 0;
+ u8 resultu8 = count_leading_zeros(t);
+ if (resultu8 != i)
+ osd_printf_error("Error testing count_leading_zeros %08x=%02x (expected %02x)\n", t, resultu8, i);
+
+ t ^= 0xffffffff;
+ resultu8 = count_leading_ones(t);
+ if (resultu8 != i)
+ osd_printf_error("Error testing count_leading_ones %08x=%02x (expected %02x)\n", t, resultu8, i);
+ }
}
@@ -1588,6 +1590,18 @@ void validity_checker::validate_roms(device_t &root)
last_name = romp->name;
total_files++;
+ // validate the name
+ if (strlen(last_name) > 127)
+ osd_printf_error("ROM label %s exceeds maximum 127 characters\n", last_name);
+ for (char const *s = last_name; *s; ++s)
+ {
+ if (((*s < '0') || (*s > '9')) && ((*s < 'a') || (*s > 'z')) && (*s != ' ') && (*s != '@') && (*s != '.') && (*s != ',') && (*s != '_') && (*s != '-') && (*s != '+') && (*s != '='))
+ {
+ osd_printf_error("ROM label %s contains invalid characters\n", last_name);
+ break;
+ }
+ }
+
// make sure the hash is valid
util::hash_collection hashes;
if (!hashes.from_internal_string(romp->hashdata))
@@ -1598,7 +1612,7 @@ void validity_checker::validate_roms(device_t &root)
if (!ROMENTRY_ISREGIONEND(romp) && current_length > 0 && !ROMENTRY_ISIGNORE(romp)) // HBMAME
{
items_since_region++;
- if (ROM_GETOFFSET(romp) + ROM_GETLENGTH(romp) > current_length)
+ if (!ROMENTRY_ISIGNORE(romp) && (ROM_GETOFFSET(romp) + ROM_GETLENGTH(romp) > current_length))
osd_printf_error("ROM '%s' extends past the defined memory region\n", last_name);
}
}
@@ -1956,7 +1970,7 @@ void validity_checker::validate_devices()
const char *const def_bios = option.second->default_bios();
if (def_bios)
- device_t::static_set_default_bios_tag(*card, def_bios);
+ card->set_default_bios_tag(def_bios);
auto additions = option.second->machine_config();
if (additions)
additions(card);
@@ -1971,7 +1985,7 @@ void validity_checker::validate_devices()
device_t *const sub_card = m_current_config->device_add(&subslot.device(), suboption->name(), suboption->devtype(), suboption->clock());
const char *const sub_bios = suboption->default_bios();
if (sub_bios)
- device_t::static_set_default_bios_tag(*sub_card, sub_bios);
+ sub_card->set_default_bios_tag(sub_bios);
auto sub_additions = suboption->machine_config();
if (sub_additions)
sub_additions(sub_card);