diff options
author | 2019-09-20 02:26:16 +1000 | |
---|---|---|
committer | 2019-09-20 02:26:16 +1000 | |
commit | 8b233839ba630012026321070d77153fdf5a19b2 (patch) | |
tree | 6eaa5e7bdf8bb413a1abbcce95284917d75d1f76 /src/emu/emupal.cpp | |
parent | 37b02ce7de385c5c0a32853e52a861b8ff329077 (diff) |
(nw) get rid of the rest of assert_always - it's better to be explicit about what this thing is supposed to do
Diffstat (limited to 'src/emu/emupal.cpp')
-rw-r--r-- | src/emu/emupal.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/emu/emupal.cpp b/src/emu/emupal.cpp index f401a4b8cb4..d4c8818419c 100644 --- a/src/emu/emupal.cpp +++ b/src/emu/emupal.cpp @@ -506,7 +506,8 @@ void palette_device::device_start() const memory_share *share_ext = memshare(tag_ext.c_str()); // make sure we have specified a format - assert_always(m_raw_to_rgb.bytes_per_entry() > 0, "Palette has memory share but no format specified"); + if (m_raw_to_rgb.bytes_per_entry() <= 0) + throw emu_fatalerror("palette_device(%s): Palette has memory share but no format specified", tag()); // determine bytes per entry and configure int bytes_per_entry = m_raw_to_rgb.bytes_per_entry(); @@ -522,7 +523,8 @@ void palette_device::device_start() if (m_membits_supplied) { // forcing width only makes sense when narrower than the native bus width - assert_always(m_membits < share->bitwidth(), "Improper use of MCFG_PALETTE_MEMBITS"); + if (m_membits >= share->bitwidth()) + throw emu_fatalerror("palette_device(%s): Improper use of MCFG_PALETTE_MEMBITS", tag()); m_paletteram.set_membits(m_membits); if (share_ext != nullptr) m_paletteram_ext.set_membits(m_membits); @@ -532,7 +534,8 @@ void palette_device::device_start() if (m_endianness_supplied) { // forcing endianness only makes sense when the RAM is narrower than the palette format and not split - assert_always((share_ext == nullptr && m_paletteram.membits() / 8 < bytes_per_entry), "Improper use of MCFG_PALETTE_ENDIANNESS"); + if (share_ext || (m_paletteram.membits() / 8) >= bytes_per_entry) + throw emu_fatalerror("palette_device(%s): Improper use of MCFG_PALETTE_ENDIANNESS", tag()); m_paletteram.set_endianness(m_endianness); } } |