summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorGravatarGravatar Vas Crabb <vas@vastheman.com>2019-09-20 00:28:19 +1000
committerGravatarGravatar Vas Crabb <vas@vastheman.com>2019-09-20 00:28:19 +1000
commitdac7094f3431b8f933497b0c7693e6baeb1bb75c (patch)
tree1c3dc049110c54d23dc31a1e6c1e8b11fd24e299 /src
parentcc25024f791747fa17c1f06bd81c482a86aac91b (diff)
(nw) misc cleanup:
* get rid of most assert_always * get rid of a few MCFG_*_OVERRIDE
Diffstat (limited to 'src')
-rw-r--r--src/devices/cpu/drcbex64.cpp17
-rw-r--r--src/devices/imagedev/diablo.cpp25
-rw-r--r--src/devices/imagedev/harddriv.cpp29
-rw-r--r--src/devices/machine/6532riot.cpp2
-rw-r--r--src/devices/machine/6821pia.cpp263
-rw-r--r--src/devices/machine/ds2404.cpp16
-rw-r--r--src/devices/machine/meters.cpp2
-rw-r--r--src/devices/machine/upd7002.cpp62
-rw-r--r--src/devices/sound/2203intf.cpp3
-rw-r--r--src/devices/sound/2608intf.cpp9
-rw-r--r--src/devices/sound/2610intf.cpp7
-rw-r--r--src/devices/sound/2612intf.cpp3
-rw-r--r--src/devices/sound/262intf.cpp3
-rw-r--r--src/devices/sound/3526intf.cpp3
-rw-r--r--src/devices/sound/3812intf.cpp3
-rw-r--r--src/devices/sound/8950intf.cpp3
-rw-r--r--src/devices/sound/discrete.cpp6
-rw-r--r--src/devices/sound/pokey.cpp2
-rw-r--r--src/devices/sound/tiaintf.cpp3
-rw-r--r--src/devices/sound/upd7759.cpp2
-rw-r--r--src/devices/sound/ymf271.cpp2
-rw-r--r--src/devices/sound/ymf278b.cpp3
-rw-r--r--src/devices/sound/ymz280b.cpp4
-rw-r--r--src/devices/video/gba_lcd.cpp16
-rw-r--r--src/devices/video/voodoo.cpp3
-rw-r--r--src/emu/diimage.cpp9
-rw-r--r--src/emu/diimage.h2
-rw-r--r--src/emu/dipalette.cpp3
-rw-r--r--src/emu/tilemap.cpp3
-rw-r--r--src/emu/tilemap.h4
-rw-r--r--src/mame/audio/geebee.cpp12
-rw-r--r--src/mame/audio/snes_snd.cpp5
-rw-r--r--src/mame/audio/t5182.cpp10
-rw-r--r--src/mame/audio/warpwarp.cpp24
-rw-r--r--src/mame/drivers/2mindril.cpp2
-rw-r--r--src/mame/drivers/acefruit.cpp14
-rw-r--r--src/mame/drivers/amust.cpp2
-rw-r--r--src/mame/drivers/argo.cpp2
-rw-r--r--src/mame/drivers/aristmk4.cpp2
-rw-r--r--src/mame/drivers/artmagic.cpp2
-rw-r--r--src/mame/drivers/asterix.cpp2
-rw-r--r--src/mame/drivers/astinvad.cpp2
-rw-r--r--src/mame/drivers/asuka.cpp2
-rw-r--r--src/mame/drivers/atarist.cpp2
-rw-r--r--src/mame/drivers/beezer.cpp2
-rw-r--r--src/mame/drivers/boxer.cpp2
-rw-r--r--src/mame/drivers/c10.cpp2
-rw-r--r--src/mame/drivers/capbowl.cpp2
-rw-r--r--src/mame/drivers/cat.cpp2
-rw-r--r--src/mame/drivers/cball.cpp2
-rw-r--r--src/mame/drivers/cidelsa.cpp2
-rw-r--r--src/mame/drivers/clpoker.cpp19
-rw-r--r--src/mame/drivers/dec8.cpp2
-rw-r--r--src/mame/drivers/dectalk.cpp2
-rw-r--r--src/mame/drivers/destroyr.cpp2
-rw-r--r--src/mame/drivers/fgoal.cpp2
-rw-r--r--src/mame/drivers/flyball.cpp2
-rw-r--r--src/mame/drivers/fm7.cpp2
-rw-r--r--src/mame/drivers/fuukifg2.cpp2
-rw-r--r--src/mame/drivers/fuukifg3.cpp2
-rw-r--r--src/mame/drivers/gaplus.cpp2
-rw-r--r--src/mame/drivers/gottlieb.cpp2
-rw-r--r--src/mame/drivers/gpworld.cpp2
-rw-r--r--src/mame/drivers/gunbustr.cpp2
-rw-r--r--src/mame/drivers/h19.cpp4
-rw-r--r--src/mame/drivers/intv.cpp2
-rw-r--r--src/mame/drivers/itech8.cpp2
-rw-r--r--src/mame/drivers/jclub2.cpp23
-rw-r--r--src/mame/drivers/kinst.cpp2
-rw-r--r--src/mame/drivers/laserbat.cpp2
-rw-r--r--src/mame/drivers/m10.cpp2
-rw-r--r--src/mame/drivers/mekd2.cpp2
-rw-r--r--src/mame/drivers/metro.cpp2
-rw-r--r--src/mame/drivers/mgolf.cpp2
-rw-r--r--src/mame/drivers/mjsister.cpp2
-rw-r--r--src/mame/drivers/mlanding.cpp10
-rw-r--r--src/mame/drivers/nightmare.cpp2
-rw-r--r--src/mame/drivers/notetaker.cpp2
-rw-r--r--src/mame/drivers/okean240.cpp2
-rw-r--r--src/mame/drivers/osi.cpp2
-rw-r--r--src/mame/drivers/parodius.cpp2
-rw-r--r--src/mame/drivers/pc88va.cpp2
-rw-r--r--src/mame/drivers/pcfx.cpp2
-rw-r--r--src/mame/drivers/pentagon.cpp2
-rw-r--r--src/mame/drivers/plan80.cpp2
-rw-r--r--src/mame/drivers/ptcsol.cpp2
-rw-r--r--src/mame/drivers/rabbit.cpp2
-rw-r--r--src/mame/drivers/rollerg.cpp2
-rw-r--r--src/mame/drivers/samcoupe.cpp2
-rw-r--r--src/mame/drivers/segaorun.cpp2
-rw-r--r--src/mame/drivers/simpsons.cpp2
-rw-r--r--src/mame/drivers/slapshot.cpp2
-rw-r--r--src/mame/drivers/socrates.cpp2
-rw-r--r--src/mame/drivers/spacefb.cpp2
-rw-r--r--src/mame/drivers/spectrum.cpp2
-rw-r--r--src/mame/drivers/sprint4.cpp2
-rw-r--r--src/mame/drivers/swyft.cpp19
-rw-r--r--src/mame/drivers/symbolics.cpp2
-rw-r--r--src/mame/drivers/sys2900.cpp2
-rw-r--r--src/mame/drivers/taito_f2.cpp2
-rw-r--r--src/mame/drivers/taito_f3.cpp2
-rw-r--r--src/mame/drivers/taito_z.cpp2
-rw-r--r--src/mame/drivers/tehkanwc.cpp2
-rw-r--r--src/mame/drivers/thayers.cpp2
-rw-r--r--src/mame/drivers/thunderx.cpp13
-rw-r--r--src/mame/drivers/tickee.cpp2
-rw-r--r--src/mame/drivers/tmc1800.cpp2
-rw-r--r--src/mame/drivers/tmnt.cpp2
-rw-r--r--src/mame/drivers/trucocl.cpp2
-rw-r--r--src/mame/drivers/tubep.cpp2
-rw-r--r--src/mame/drivers/tugboat.cpp2
-rw-r--r--src/mame/drivers/ultratnk.cpp2
-rw-r--r--src/mame/drivers/vegaeo.cpp9
-rw-r--r--src/mame/drivers/vendetta.cpp2
-rw-r--r--src/mame/drivers/videopin.cpp2
-rw-r--r--src/mame/drivers/videopkr.cpp7
-rw-r--r--src/mame/drivers/vk100.cpp2
-rw-r--r--src/mame/drivers/wgp.cpp2
-rw-r--r--src/mame/drivers/wolfpack.cpp2
-rw-r--r--src/mame/drivers/x1.cpp5
-rw-r--r--src/mame/drivers/x1twin.cpp3
-rw-r--r--src/mame/drivers/x68k.cpp2
-rw-r--r--src/mame/drivers/zrt80.cpp2
-rw-r--r--src/mame/etc/opwolf_cchip.txt2
-rw-r--r--src/mame/includes/ut88.h3
-rw-r--r--src/mame/includes/x1.h4
-rw-r--r--src/mame/machine/3dom2.cpp6
-rw-r--r--src/mame/machine/amstrad.cpp2
-rw-r--r--src/mame/machine/asic65.cpp2
-rw-r--r--src/mame/machine/bebox.cpp9
-rw-r--r--src/mame/machine/bublbobl.cpp2
-rw-r--r--src/mame/machine/dai.cpp2
-rw-r--r--src/mame/machine/electron.cpp2
-rw-r--r--src/mame/machine/hpc3.cpp2
-rw-r--r--src/mame/machine/kaneko_calc3.cpp2
-rw-r--r--src/mame/machine/kaypro.cpp2
-rw-r--r--src/mame/machine/lynx.cpp2
-rw-r--r--src/mame/machine/mbee.cpp2
-rw-r--r--src/mame/machine/micro3d.cpp2
-rw-r--r--src/mame/machine/mikro80.cpp2
-rw-r--r--src/mame/machine/nb1412m2.cpp2
-rw-r--r--src/mame/machine/nb1413m3.cpp2
-rw-r--r--src/mame/machine/pmd85.cpp2
-rw-r--r--src/mame/machine/pocketc.cpp2
-rw-r--r--src/mame/machine/radio86.cpp2
-rw-r--r--src/mame/machine/snes.cpp2
-rw-r--r--src/mame/machine/sorcerer.cpp2
-rw-r--r--src/mame/machine/special.cpp4
-rw-r--r--src/mame/machine/stfight.cpp2
-rw-r--r--src/mame/machine/ut88.cpp2
-rw-r--r--src/mame/video/3dom2_te.cpp10
-rw-r--r--src/mame/video/astrocde.cpp2
-rw-r--r--src/mame/video/cchasm.cpp2
-rw-r--r--src/mame/video/cps1.cpp3
-rw-r--r--src/mame/video/dcheese.cpp2
-rw-r--r--src/mame/video/exidy.cpp2
-rw-r--r--src/mame/video/gameplan.cpp2
-rw-r--r--src/mame/video/gp9001.cpp2
-rw-r--r--src/mame/video/hyhoo.cpp2
-rw-r--r--src/mame/video/lethalj.cpp2
-rw-r--r--src/mame/video/m92.cpp2
-rw-r--r--src/mame/video/mcr.cpp2
-rw-r--r--src/mame/video/midtunit.cpp2
-rw-r--r--src/mame/video/midvunit.cpp2
-rw-r--r--src/mame/video/midyunit.cpp2
-rw-r--r--src/mame/video/nbmj8688.cpp2
-rw-r--r--src/mame/video/nbmj8891.cpp2
-rw-r--r--src/mame/video/nbmj8900.cpp2
-rw-r--r--src/mame/video/nbmj8991.cpp2
-rw-r--r--src/mame/video/nbmj9195.cpp2
-rw-r--r--src/mame/video/niyanpai.cpp2
-rw-r--r--src/mame/video/pastelg.cpp2
-rw-r--r--src/mame/video/powervr2.cpp2
-rw-r--r--src/mame/video/segag80r.cpp2
-rw-r--r--src/mame/video/segag80v.cpp3
-rw-r--r--src/mame/video/tank8.cpp2
-rw-r--r--src/mame/video/triplhnt.cpp2
-rw-r--r--src/mame/video/x1.cpp2
-rw-r--r--src/mame/video/zx.cpp2
179 files changed, 453 insertions, 530 deletions
diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp
index 0a32b265bc7..499b0e40ff7 100644
--- a/src/devices/cpu/drcbex64.cpp
+++ b/src/devices/cpu/drcbex64.cpp
@@ -544,9 +544,10 @@ inline void drcbe_x64::normalize_commutative(be_parameter &inner, be_parameter &
inline int32_t drcbe_x64::offset_from_rbp(const void *ptr)
{
- int64_t delta = reinterpret_cast<uint8_t *>(const_cast<void *>(ptr)) - m_rbpvalue;
- assert_always((int32_t)delta == delta, "offset_from_rbp: delta out of range");
- return (int32_t)delta;
+ const int64_t delta = reinterpret_cast<const uint8_t *>(ptr) - m_rbpvalue;
+ if (int32_t(delta) != delta)
+ throw emu_fatalerror("drcbe_x64::offset_from_rbp: delta out of range");
+ return int32_t(delta);
}
@@ -558,7 +559,7 @@ inline int32_t drcbe_x64::offset_from_rbp(const void *ptr)
inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target, uint8_t reg, int32_t &offset)
{
- int64_t delta = (uint8_t *)target - m_rbpvalue;
+ const int64_t delta = reinterpret_cast<uint8_t *>(target) - m_rbpvalue;
if (short_immediate(delta))
{
offset = delta;
@@ -567,7 +568,7 @@ inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target,
else
{
offset = 0;
- emit_mov_r64_imm(dst, reg, (uintptr_t)target); // mov reg,target
+ emit_mov_r64_imm(dst, reg, uintptr_t(target)); // mov reg,target
return reg;
}
}
@@ -580,12 +581,12 @@ inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target,
inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, uint8_t reg)
{
- int64_t delta = target - (dst + 5);
+ const int64_t delta = target - (dst + 5);
if (short_immediate(delta))
emit_call(dst, target); // call target
else
{
- emit_mov_r64_imm(dst, reg, (uintptr_t)target); // mov reg,target
+ emit_mov_r64_imm(dst, reg, uintptr_t(target)); // mov reg,target
emit_call_r64(dst, reg); // call reg
}
}
@@ -598,7 +599,7 @@ inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, uint8
inline void drcbe_x64::emit_smart_call_m64(x86code *&dst, x86code **target)
{
- int64_t delta = *target - (dst + 5);
+ const int64_t delta = *target - (dst + 5);
if (short_immediate(delta))
emit_call(dst, *target); // call *target
else
diff --git a/src/devices/imagedev/diablo.cpp b/src/devices/imagedev/diablo.cpp
index 5e8162ce842..f7da6fa26cb 100644
--- a/src/devices/imagedev/diablo.cpp
+++ b/src/devices/imagedev/diablo.cpp
@@ -110,35 +110,32 @@ image_init_result diablo_image_device::call_load()
image_init_result diablo_image_device::call_create(int create_format, util::option_resolution *create_args)
{
int err;
- uint32_t sectorsize, hunksize;
- uint32_t cylinders, heads, sectors, totalsectors;
- assert_always(create_args != nullptr, "Expected create_args to not be nullptr");
- cylinders = create_args->lookup_int('C');
- heads = create_args->lookup_int('H');
- sectors = create_args->lookup_int('S');
- sectorsize = create_args->lookup_int('L') * sizeof(uint16_t);
- hunksize = create_args->lookup_int('K');
+ if (!create_args)
+ throw emu_fatalerror("diablo_image_device::call_create: Expected create_args to not be nullptr");
- totalsectors = cylinders * heads * sectors;
+ const uint32_t cylinders = create_args->lookup_int('C');
+ const uint32_t heads = create_args->lookup_int('H');
+ const uint32_t sectors = create_args->lookup_int('S');
+ const uint32_t sectorsize = create_args->lookup_int('L') * sizeof(uint16_t);
+ const uint32_t hunksize = create_args->lookup_int('K');
+
+ const uint32_t totalsectors = cylinders * heads * sectors;
/* create the CHD file */
chd_codec_type compression[4] = { CHD_CODEC_NONE };
err = m_origchd.create(image_core_file(), (uint64_t)totalsectors * (uint64_t)sectorsize, hunksize, sectorsize, compression);
if (err != CHDERR_NONE)
- goto error;
+ return image_init_result::FAIL;
/* if we created the image and hence, have metadata to set, set the metadata */
err = m_origchd.write_metadata(HARD_DISK_METADATA_TAG, 0, string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize));
m_origchd.close();
if (err != CHDERR_NONE)
- goto error;
+ return image_init_result::FAIL;
return internal_load_dsk();
-
-error:
- return image_init_result::FAIL;
}
void diablo_image_device::call_unload()
diff --git a/src/devices/imagedev/harddriv.cpp b/src/devices/imagedev/harddriv.cpp
index 7731fb45b30..cdb4f72e098 100644
--- a/src/devices/imagedev/harddriv.cpp
+++ b/src/devices/imagedev/harddriv.cpp
@@ -131,44 +131,39 @@ image_init_result harddisk_image_device::call_load()
image_init_result harddisk_image_device::call_create(int create_format, util::option_resolution *create_args)
{
int err;
- uint32_t sectorsize, hunksize;
- uint32_t cylinders, heads, sectors, totalsectors;
- assert_always(create_args != nullptr, "Expected create_args to not be nullptr");
- cylinders = create_args->lookup_int('C');
- heads = create_args->lookup_int('H');
- sectors = create_args->lookup_int('S');
- sectorsize = create_args->lookup_int('L');
- hunksize = create_args->lookup_int('K');
+ if (!create_args)
+ throw emu_fatalerror("harddisk_image_device::call_create: Expected create_args to not be nullptr");
- totalsectors = cylinders * heads * sectors;
+ const uint32_t cylinders = create_args->lookup_int('C');
+ const uint32_t heads = create_args->lookup_int('H');
+ const uint32_t sectors = create_args->lookup_int('S');
+ const uint32_t sectorsize = create_args->lookup_int('L');
+ const uint32_t hunksize = create_args->lookup_int('K');
+
+ const uint32_t totalsectors = cylinders * heads * sectors;
/* create the CHD file */
chd_codec_type compression[4] = { CHD_CODEC_NONE };
err = m_origchd.create(image_core_file(), (uint64_t)totalsectors * (uint64_t)sectorsize, hunksize, sectorsize, compression);
if (err != CHDERR_NONE)
- goto error;
+ return image_init_result::FAIL;
/* if we created the image and hence, have metadata to set, set the metadata */
err = m_origchd.write_metadata(HARD_DISK_METADATA_TAG, 0, string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize));
m_origchd.close();
if (err != CHDERR_NONE)
- goto error;
+ return image_init_result::FAIL;
return internal_load_hd();
-
-error:
- return image_init_result::FAIL;
}
void harddisk_image_device::call_unload()
{
/* Check if there is an image_unload callback defined */
- if ( !m_device_image_unload.isnull() )
- {
+ if (!m_device_image_unload.isnull())
m_device_image_unload(*this);
- }
if (m_hard_disk_handle != nullptr)
{
diff --git a/src/devices/machine/6532riot.cpp b/src/devices/machine/6532riot.cpp
index 1b619f4e16d..f24b8b1656c 100644
--- a/src/devices/machine/6532riot.cpp
+++ b/src/devices/machine/6532riot.cpp
@@ -510,6 +510,6 @@ void riot6532_device::device_timer(emu_timer &timer, device_timer_id id, int par
timer_end();
break;
default:
- assert_always(false, "Unknown id in riot6532_device::device_timer");
+ throw emu_fatalerror("Unknown id in riot6532_device::device_timer");
}
}
diff --git a/src/devices/machine/6821pia.cpp b/src/devices/machine/6821pia.cpp
index bee109d4d34..88c01234cca 100644
--- a/src/devices/machine/6821pia.cpp
+++ b/src/devices/machine/6821pia.cpp
@@ -347,9 +347,7 @@ void pia6821_device::set_out_ca2(int data)
else
{
if (m_out_ca2_needs_pulled)
- {
logerror("Warning! No port CA2 write handler. Previous value has been lost!\n");
- }
m_out_ca2_needs_pulled = true;
}
@@ -378,9 +376,7 @@ void pia6821_device::set_out_cb2(int data)
else
{
if (m_out_cb2_needs_pulled)
- {
logerror("Warning! No port CB2 write handler. Previous value has been lost!\n");
- }
m_out_cb2_needs_pulled = true;
}
@@ -402,16 +398,14 @@ uint8_t pia6821_device::port_a_r()
update_interrupts();
// CA2 is configured as output and in read strobe mode
- if(c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a))
+ if (c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a))
{
// this will cause a transition low
set_out_ca2(false);
// if the CA2 strobe is cleared by the E, reset it right away
- if(strobe_e_reset(m_ctl_a))
- {
+ if (strobe_e_reset(m_ctl_a))
set_out_ca2(true);
- }
}
LOG("PIA port A read = %02X\n", ret);
@@ -426,7 +420,7 @@ uint8_t pia6821_device::port_a_r()
uint8_t pia6821_device::ddr_a_r()
{
- uint8_t ret = m_ddr_a;
+ const uint8_t ret = m_ddr_a;
LOG("PIA DDR A read = %02X\n", ret);
@@ -440,16 +434,14 @@ uint8_t pia6821_device::ddr_a_r()
uint8_t pia6821_device::port_b_r()
{
- uint8_t ret = get_in_b_value();
+ const uint8_t ret = get_in_b_value();
// This read will implicitly clear the IRQ B1 flag. If CB2 is in write-strobe
// mode with CB1 restore, and a CB1 active transition set the flag,
// clearing it will cause CB2 to go high again. Note that this is different
// from what happens with port A.
- if(m_irq_b1 && c2_strobe_mode(m_ctl_b) && strobe_c1_reset(m_ctl_b))
- {
+ if (m_irq_b1 && c2_strobe_mode(m_ctl_b) && strobe_c1_reset(m_ctl_b))
set_out_cb2(true);
- }
// IRQ flags implicitly cleared by a read
m_irq_b1 = false;
@@ -468,7 +460,7 @@ uint8_t pia6821_device::port_b_r()
uint8_t pia6821_device::ddr_b_r()
{
- uint8_t ret = m_ddr_b;
+ const uint8_t ret = m_ddr_b;
LOG("PIA DDR B read = %02X\n", ret);
@@ -509,15 +501,11 @@ uint8_t pia6821_device::control_a_r()
ret = m_ctl_a;
// set the IRQ flags if we have pending IRQs
- if(m_irq_a1)
- {
+ if (m_irq_a1)
ret |= PIA_IRQ1;
- }
- if(m_irq_a2 && c2_input(m_ctl_a))
- {
+ if (m_irq_a2 && c2_input(m_ctl_a))
ret |= PIA_IRQ2;
- }
LOG("PIA control A read = %02X\n", ret);
@@ -554,15 +542,11 @@ uint8_t pia6821_device::control_b_r()
ret = m_ctl_b;
// set the IRQ flags if we have pending IRQs
- if(m_irq_b1)
- {
+ if (m_irq_b1)
ret |= PIA_IRQ1;
- }
- if(m_irq_b2 && c2_input(m_ctl_b))
- {
+ if (m_irq_b2 && c2_input(m_ctl_b))
ret |= PIA_IRQ2;
- }
LOG("PIA control B read = %02X\n", ret);
@@ -580,36 +564,22 @@ uint8_t pia6821_device::read(offs_t offset)
switch (offset & 0x03)
{
- default: // impossible
- case 0x00:
- if (output_selected(m_ctl_a))
- {
- ret = port_a_r();
- }
- else
- {
- ret = ddr_a_r();
- }
- break;
-
- case 0x01:
- ret = control_a_r();
- break;
-
- case 0x02:
- if (output_selected(m_ctl_b))
- {
- ret = port_b_r();
- }
- else
- {
- ret = ddr_b_r();
- }
- break;
-
- case 0x03:
- ret = control_b_r();
- break;
+ default: // impossible
+ case 0x00:
+ ret = output_selected(m_ctl_a) ? port_a_r() : ddr_a_r();
+ break;
+
+ case 0x01:
+ ret = control_a_r();
+ break;
+
+ case 0x02:
+ ret = output_selected(m_ctl_b) ? port_b_r() : ddr_b_r();
+ break;
+
+ case 0x03:
+ ret = control_b_r();
+ break;
}
return ret;
@@ -624,20 +594,18 @@ uint8_t pia6821_device::read(offs_t offset)
void pia6821_device::send_to_out_a_func(const char* message)
{
// input pins are pulled high
- uint8_t data = get_out_a_value();
+ const uint8_t data = get_out_a_value();
LOG("PIA %s = %02X\n", message, data);
- if(!m_out_a_handler.isnull())
+ if (!m_out_a_handler.isnull())
{
- m_out_a_handler((offs_t) 0, data);
+ m_out_a_handler(offs_t(0), data);
}
else
{
- if(m_out_a_needs_pulled)
- {
+ if (m_out_a_needs_pulled)
logerror("Warning! No port A write handler. Previous value has been lost!\n");
- }
m_out_a_needs_pulled = true;
}
@@ -651,20 +619,18 @@ void pia6821_device::send_to_out_a_func(const char* message)
void pia6821_device::send_to_out_b_func(const char* message)
{
// input pins are high-impedance - we just send them as zeros for backwards compatibility
- uint8_t data = get_out_b_value();
+ const uint8_t data = get_out_b_value();
LOG("PIA %s = %02X\n", message, data);
- if(!m_out_b_handler.isnull())
+ if (!m_out_b_handler.isnull())
{
- m_out_b_handler((offs_t)0, data);
+ m_out_b_handler(offs_t(0), data);
}
else
{
- if(m_out_b_needs_pulled)
- {
+ if (m_out_b_needs_pulled)
logerror("Warning! No port B write handler. Previous value has been lost!\n");
- }
m_out_b_needs_pulled = true;
}
@@ -690,20 +656,9 @@ void pia6821_device::port_a_w(uint8_t data)
void pia6821_device::ddr_a_w(uint8_t data)
{
- if(data == 0x00)
- {
- LOGSETUP("PIA DDR A write = %02X (input mode)\n", data);
- }
- else if(data == 0xff)
- {
- LOGSETUP("PIA DDR A write = %02X (output mode)\n", data);
- }
- else
- {
- LOGSETUP("PIA DDR A write = %02X (mixed mode)\n", data);
- }
+ LOGSETUP("PIA DDR A write = %02X (%s mode)\n", data, (0x00 == data) ? "input" : (0xff == data) ? "output" : "mixed");
- if(m_ddr_a != data)
+ if (m_ddr_a != data)
{
// DDR changed, call the callback again
m_ddr_a = data;
@@ -725,16 +680,14 @@ void pia6821_device::port_b_w(uint8_t data)
send_to_out_b_func("port B write");
// CB2 in write strobe mode
- if(c2_strobe_mode(m_ctl_b))
+ if (c2_strobe_mode(m_ctl_b))
{
// this will cause a transition low
set_out_cb2(false);
// if the CB2 strobe is cleared by the E, reset it right away
- if(strobe_e_reset(m_ctl_b))
- {
+ if (strobe_e_reset(m_ctl_b))
set_out_cb2(true);
- }
}
}
@@ -745,20 +698,9 @@ void pia6821_device::port_b_w(uint8_t data)
void pia6821_device::ddr_b_w(uint8_t data)
{
- if (data == 0x00)
- {
- LOGSETUP("PIA DDR B write = %02X (input mode)\n", data);
- }
- else if (data == 0xff)
- {
- LOGSETUP("PIA DDR B write = %02X (output mode)\n", data);
- }
- else
- {
- LOGSETUP("PIA DDR B write = %02X (mixed mode)\n", data);
- }
+ LOGSETUP("PIA DDR B write = %02X (%s mode)\n", data, (0x00 == data) ? "input" : (0xff == data) ? "output" : "mixed");
- if(m_ddr_b != data)
+ if (m_ddr_b != data)
{
// DDR changed, call the callback again
m_ddr_b = data;
@@ -783,20 +725,13 @@ void pia6821_device::control_a_w(uint8_t data)
m_ctl_a = data;
// CA2 is configured as output
- if(c2_output(m_ctl_a))
+ if (c2_output(m_ctl_a))
{
bool temp;
-
- if(c2_set_mode(m_ctl_a))
- {
- // set/reset mode - bit value determines the new output
- temp = c2_set(m_ctl_a);
- }
+ if (c2_set_mode(m_ctl_a))
+ temp = c2_set(m_ctl_a); // set/reset mode - bit value determines the new output
else
- {
- // strobe mode - output is always high unless strobed
- temp = true;
- }
+ temp = true; // strobe mode - output is always high unless strobed
set_out_ca2(temp);
}
@@ -812,8 +747,6 @@ void pia6821_device::control_a_w(uint8_t data)
void pia6821_device::control_b_w(uint8_t data)
{
- bool temp;
-
// bit 7 and 6 are read only
data &= 0x3f;
@@ -822,16 +755,11 @@ void pia6821_device::control_b_w(uint8_t data)
// update the control register
m_ctl_b = data;
+ bool temp;
if (c2_set_mode(m_ctl_b))
- {
- // set/reset mode - bit value determines the new output
- temp = c2_set(m_ctl_b);
- }
+ temp = c2_set(m_ctl_b); // set/reset mode - bit value determines the new output
else
- {
- // strobe mode - output is always high unless strobed
- temp = true;
- }
+ temp = true; // strobe mode - output is always high unless strobed
set_out_cb2(temp);
@@ -848,36 +776,28 @@ void pia6821_device::write(offs_t offset, uint8_t data)
{
switch (offset & 0x03)
{
- default: // impossible
- case 0x00:
- if (output_selected(m_ctl_a))
- {
- port_a_w(data);
- }
- else
- {
- ddr_a_w(data);
- }
- break;
+ default: // impossible
+ case 0x00:
+ if (output_selected(m_ctl_a))
+ port_a_w(data);
+ else
+ ddr_a_w(data);
+ break;
- case 0x01:
- control_a_w( data);
- break;
+ case 0x01:
+ control_a_w( data);
+ break;
- case 0x02:
- if(output_selected(m_ctl_b))
- {
- port_b_w(data);
- }
- else
- {
- ddr_b_w(data);
- }
- break;
+ case 0x02:
+ if (output_selected(m_ctl_b))
+ port_b_w(data);
+ else
+ ddr_b_w(data);
+ break;
- case 0x03:
- control_b_w(data);
- break;
+ case 0x03:
+ control_b_w(data);
+ break;
}
}
@@ -888,7 +808,8 @@ void pia6821_device::write(offs_t offset, uint8_t data)
void pia6821_device::set_a_input(uint8_t data)
{
- assert_always(m_in_a_handler.isnull(), "pia6821_device::set_a_input() called when m_in_a_handler set");
+ if (!m_in_a_handler.isnull())
+ throw emu_fatalerror("pia6821_device::set_a_input() called when m_in_a_handler set");
LOG("Set PIA input port A = %02X\n", data);
@@ -913,7 +834,7 @@ void pia6821_device::write_porta(uint8_t data)
void pia6821_device::write_porta_line(int line, bool state)
{
- uint8_t mask = 1 << line;
+ const uint8_t mask = 1 << line;
if (state)
set_a_input(m_in_a | mask);
else
@@ -942,7 +863,7 @@ WRITE_LINE_MEMBER( pia6821_device::ca1_w )
LOGCA1("Set PIA input CA1 = %d\n", state);
// the new state has caused a transition
- if((m_in_ca1 != state) && ((state && c1_low_to_high(m_ctl_a)) || (!state && c1_high_to_low(m_ctl_a))))
+ if ((m_in_ca1 != state) && ((state && c1_low_to_high(m_ctl_a)) || (!state && c1_high_to_low(m_ctl_a))))
{
LOGCA1("CA1 triggering\n");
@@ -953,10 +874,8 @@ WRITE_LINE_MEMBER( pia6821_device::ca1_w )
update_interrupts();
// CA2 is configured as output and in read strobe mode and cleared by a CA1 transition
- if(c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a) && strobe_c1_reset(m_ctl_a))
- {
+ if (c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a) && strobe_c1_reset(m_ctl_a))
set_out_ca2(true);
- }
}
// set the new value for CA1
@@ -974,7 +893,7 @@ WRITE_LINE_MEMBER( pia6821_device::ca2_w )
LOG("Set PIA input CA2 = %d\n", state);
// if input mode and the new state has caused a transition
- if(c2_input(m_ctl_a) && (m_in_ca2 != state) && ((state && c2_low_to_high(m_ctl_a)) || (!state && c2_high_to_low(m_ctl_a))))
+ if (c2_input(m_ctl_a) && (m_in_ca2 != state) && ((state && c2_low_to_high(m_ctl_a)) || (!state && c2_high_to_low(m_ctl_a))))
{
LOG("CA2 triggering\n");
@@ -1012,8 +931,7 @@ bool pia6821_device::ca2_output_z()
{
m_out_ca2_needs_pulled = false;
- // If it's an output, output the bit, if it's an input, it's
- // pulled up
+ // If it's an output, output the bit, if it's an input, it's pulled up
return m_out_ca2 | c2_input(m_ctl_a);
}
@@ -1024,7 +942,8 @@ bool pia6821_device::ca2_output_z()
void pia6821_device::write_portb(uint8_t data)
{
- assert_always(m_in_b_handler.isnull(), "pia_set_input_b() called when in_b_func implemented");
+ if (!m_in_b_handler.isnull())
+ throw emu_fatalerror("pia6821_device::write_portb() called when in_b_func implemented");
LOG("Set PIA input port B = %02X\n", data);
@@ -1039,7 +958,7 @@ void pia6821_device::write_portb(uint8_t data)
void pia6821_device::write_portb_line(int line, bool state)
{
- uint8_t mask = 1 << line;
+ const uint8_t mask = 1 << line;
if (state)
write_portb(m_in_b | mask);
@@ -1069,7 +988,7 @@ WRITE_LINE_MEMBER( pia6821_device::cb1_w )
LOG("Set PIA input CB1 = %d\n", state);
// the new state has caused a transition
- if((m_in_cb1 != state) && ((state && c1_low_to_high(m_ctl_b)) || (!state && c1_high_to_low(m_ctl_b))))
+ if ((m_in_cb1 != state) && ((state && c1_low_to_high(m_ctl_b)) || (!state && c1_high_to_low(m_ctl_b))))
{
LOG("CB1 triggering\n");
@@ -1145,17 +1064,17 @@ bool pia6821_device::cb2_output_z()
// control byte wrappers
//-------------------------------------------------
-bool pia6821_device::irq1_enabled(uint8_t c) { return bool((c >> 0) & 0x01); }
-bool pia6821_device::c1_low_to_high(uint8_t c) { return bool((c >> 1) & 0x01); }
-bool pia6821_device::c1_high_to_low(uint8_t c) { return !bool((c >> 1) & 0x01); }
-bool pia6821_device::output_selected(uint8_t c) { return bool((c >> 2) & 0x01); }
-bool pia6821_device::irq2_enabled(uint8_t c) { return bool((c >> 3) & 0x01); }
-bool pia6821_device::strobe_e_reset(uint8_t c) { return bool((c >> 3) & 0x01); }
-bool pia6821_device::strobe_c1_reset(uint8_t c) { return !bool((c >> 3) & 0x01); }
-bool pia6821_device::c2_set(uint8_t c) { return bool((c >> 3) & 0x01); }
-bool pia6821_device::c2_low_to_high(uint8_t c) { return bool((c >> 4) & 0x01); }
-bool pia6821_device::c2_high_to_low(uint8_t c) { return !bool((c >> 4) & 0x01); }
-bool pia6821_device::c2_set_mode(uint8_t c) { return bool((c >> 4) & 0x01); }
-bool pia6821_device::c2_strobe_mode(uint8_t c) { return !bool((c >> 4) & 0x01); }
-bool pia6821_device::c2_output(uint8_t c) { return bool((c >> 5) & 0x01); }
-bool pia6821_device::c2_input(uint8_t c) { return !bool((c >> 5) & 0x01); }
+inline bool pia6821_device::irq1_enabled(uint8_t c) { return bool(BIT(c, 0)); }
+inline bool pia6821_device::c1_low_to_high(uint8_t c) { return bool(BIT(c, 1)); }
+inline bool pia6821_device::c1_high_to_low(uint8_t c) { return !bool(BIT(c, 1)); }
+inline bool pia6821_device::output_selected(uint8_t c) { return bool(BIT(c, 2)); }
+inline bool pia6821_device::irq2_enabled(uint8_t c) { return bool(BIT(c, 3)); }
+inline bool pia6821_device::strobe_e_reset(uint8_t c) { return bool(BIT(c, 3)); }
+inline bool pia6821_device::strobe_c1_reset(uint8_t c) { return !bool(BIT(c, 3)); }
+inline bool pia6821_device::c2_set(uint8_t c) { return bool(BIT(c, 3)); }
+inline bool pia6821_device::c2_low_to_high(uint8_t c) { return bool(BIT(c, 4)); }
+inline bool pia6821_device::c2_high_to_low(uint8_t c) { return !bool(BIT(c, 4)); }
+inline bool pia6821_device::c2_set_mode(uint8_t c) { return bool(BIT(c, 4)); }
+inline bool pia6821_device::c2_strobe_mode(uint8_t c) { return !bool(BIT(c, 4)); }
+inline bool pia6821_device::c2_output(uint8_t c) { return bool(BIT(c, 5)); }
+inline bool pia6821_device::c2_input(uint8_t c) { return !bool(BIT(c, 5)); }
diff --git a/src/devices/machine/ds2404.cpp b/src/devices/machine/ds2404.cpp
index 4a28b7f7d38..4f92a844a45 100644
--- a/src/devices/machine/ds2404.cpp
+++ b/src/devices/machine/ds2404.cpp
@@ -10,7 +10,9 @@
#include "emu.h"
#include "ds2404.h"
-#include <time.h>
+
+#include <algorithm>
+#include <time.h> // FIXME: re-write in terms of device_rtc_interface and remove this
//**************************************************************************
@@ -34,7 +36,7 @@ ds2404_device::ds2404_device(const machine_config &mconfig, const char *tag, dev
m_a2(0),
m_state_ptr(0)
{
- memset(m_ram, 0, sizeof(m_ram));
+ std::fill(std::begin(m_ram), std::end(m_ram), 0);
}
@@ -315,23 +317,17 @@ void ds2404_device::device_timer(emu_timer &timer, device_timer_id id, int param
switch(id)
{
case 0:
- {
// tick
- for(auto & elem : m_rtc)
+ for(auto &elem : m_rtc)
{
elem++;
if(elem != 0)
- {
break;
- }
}
-
break;
- }
default:
- assert_always(false, "Unknown id in ds2404_device::device_timer");
- break;
+ throw emu_fatalerror("Unknown id in ds2404_device::device_timer");
}
}
diff --git a/src/devices/machine/meters.cpp b/src/devices/machine/meters.cpp
index 62a1ca25092..cf36ff75177 100644
--- a/src/devices/machine/meters.cpp
+++ b/src/devices/machine/meters.cpp
@@ -64,7 +64,7 @@ void meters_device::device_reset()
void meters_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
if (id >= m_number_mtr)
- assert_always(false, "Unknown id in meters_device::device_timer");
+ throw emu_fatalerror("Unknown id in meters_device::device_timer");
m_meter_info[param].count++;
}
diff --git a/src/devices/machine/upd7002.cpp b/src/devices/machine/upd7002.cpp
index b00d44066e5..7dd57725147 100644
--- a/src/devices/machine/upd7002.cpp
+++ b/src/devices/machine/upd7002.cpp
@@ -61,7 +61,7 @@ void upd7002_device::device_reset()
READ_LINE_MEMBER( upd7002_device::eoc_r )
{
- return (m_status>>7)&0x01;
+ return BIT(m_status, 7);
}
@@ -71,41 +71,42 @@ void upd7002_device::device_timer(emu_timer &timer, device_timer_id id, int para
{
case TIMER_CONVERSION_COMPLETE:
{
- int counter_value = param;
- if (counter_value==m_conversion_counter)
- {
- // this really always does a 12 bit conversion
- m_data1 = m_digitalvalue>>8;
- m_data0 = m_digitalvalue&0xf0;
-
- // set the status register with top 2 MSB, not busy and conversion complete
- m_status = (m_status & 0x0f)|((m_data1 & 0xc0)>>2)|0x40;
-
- // call the EOC function with EOC from status
- // eoc_r(0) this has just been set to 0
- if (!m_eoc_cb.isnull()) m_eoc_cb(0);
- m_conversion_counter=0;
+ int counter_value = param;
+ if (counter_value == m_conversion_counter)
+ {
+ // this really always does a 12 bit conversion
+ m_data1 = m_digitalvalue >> 8;
+ m_data0 = m_digitalvalue & 0xf0;
+
+ // set the status register with top 2 MSB, not busy and conversion complete
+ m_status = (m_status & 0x0f) | ((m_data1 & 0xc0) >> 2) | 0x40;
+
+ // call the EOC function with EOC from status
+ // eoc_r(0) this has just been set to 0
+ if (!m_eoc_cb.isnull()) m_eoc_cb(0);
+ m_conversion_counter=0;
+ }
}
break;
- }
default:
- assert_always(false, "Unknown id in upd7002_device::device_timer");
+ throw emu_fatalerror("Unknown id in upd7002_device::device_timer");
}
}
uint8_t upd7002_device::read(offs_t offset)
{
- switch(offset&0x03)
+ switch (offset & 0x03)
{
- case 0:
- return m_status;
+ case 0:
+ return m_status;
- case 1:
- return m_data1;
+ case 1:
+ return m_data1;
- case 2: case 3:
- return m_data0;
+ case 2:
+ case 3:
+ return m_data0;
}
return 0;
}
@@ -116,9 +117,9 @@ void upd7002_device::write(offs_t offset, uint8_t data)
{
/* logerror("write to uPD7002 $%02X = $%02X\n",offset,data); */
- switch(offset&0x03)
+ switch (offset & 0x03)
{
- case 0:
+ case 0:
/*
Data Latch/AD start
D0 and D1 together define which one of the four input channels is selected
@@ -152,17 +153,20 @@ void upd7002_device::write(offs_t offset, uint8_t data)
{
// 12 bit conversion takes 10ms
timer_set(attotime::from_msec(10), TIMER_CONVERSION_COMPLETE, m_conversion_counter);
- } else {
+ }
+ else
+ {
// 8 bit conversion takes 4ms
timer_set(attotime::from_msec(4), TIMER_CONVERSION_COMPLETE, m_conversion_counter);
}
break;
- case 1: case 2:
+ case 1:
+ case 2:
/* Nothing */
break;
- case 3:
+ case 3:
/* Test Mode: Used for inspecting the device, The data input-output terminals assume an input
state and are connected to the A/D counter. Therefore, the A/D conversion data
read out after this is meaningless.
diff --git a/src/devices/sound/2203intf.cpp b/src/devices/sound/2203intf.cpp
index 02ad8a41579..9b49479af97 100644
--- a/src/devices/sound/2203intf.cpp
+++ b/src/devices/sound/2203intf.cpp
@@ -91,7 +91,8 @@ void ym2203_device::device_start()
/* Initialize FM emurator */
int rate = clock()/72; /* ??? */
m_chip = ym2203_init(this,clock(),rate,&ym2203_device::static_timer_handler,&ym2203_device::static_irq_handler,&psgintf);
- assert_always(m_chip != nullptr, "Error creating YM2203 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ym2203_device(%s): Error creating YM2203 chip", tag());
}
void ym2203_device::device_clock_changed()
diff --git a/src/devices/sound/2608intf.cpp b/src/devices/sound/2608intf.cpp
index 6c31c2aea0f..e6f24c7fef0 100644
--- a/src/devices/sound/2608intf.cpp
+++ b/src/devices/sound/2608intf.cpp
@@ -97,10 +97,11 @@ void ym2608_device::device_start()
/* initialize YM2608 */
m_chip = ym2608_init(this,clock(),rate,
- &ym2608_device::static_internal_read_byte,
- &ym2608_device::static_external_read_byte, &ym2608_device::static_external_write_byte,
- &ym2608_device::static_timer_handler,&ym2608_device::static_irq_handler,&psgintf);
- assert_always(m_chip != nullptr, "Error creating YM2608 chip");
+ &ym2608_device::static_internal_read_byte,
+ &ym2608_device::static_external_read_byte, &ym2608_device::static_external_write_byte,
+ &ym2608_device::static_timer_handler,&ym2608_device::static_irq_handler,&psgintf);
+ if (!m_chip)
+ throw emu_fatalerror("ym2608_device(%s): Error creating YM2608 chip", tag());
}
//-------------------------------------------------
diff --git a/src/devices/sound/2610intf.cpp b/src/devices/sound/2610intf.cpp
index fe4077b2d40..03c3fc218a2 100644
--- a/src/devices/sound/2610intf.cpp
+++ b/src/devices/sound/2610intf.cpp
@@ -117,9 +117,10 @@ void ym2610_device::device_start()
/**** initialize YM2610 ****/
m_chip = ym2610_init(this, clock(), rate,
- &ym2610_device::static_adpcm_a_read_byte, &ym2610_device::static_adpcm_b_read_byte,
- &ym2610_device::static_timer_handler, &ym2610_device::static_irq_handler, &psgintf);
- assert_always(m_chip != nullptr, "Error creating YM2610 chip");
+ &ym2610_device::static_adpcm_a_read_byte, &ym2610_device::static_adpcm_b_read_byte,
+ &ym2610_device::static_timer_handler, &ym2610_device::static_irq_handler, &psgintf);
+ if (!m_chip)
+ throw emu_fatalerror("ym2610_device(%s): Error creating YM2610 chip", tag());
}
//-------------------------------------------------
diff --git a/src/devices/sound/2612intf.cpp b/src/devices/sound/2612intf.cpp
index b8e440666ec..484d15dde14 100644
--- a/src/devices/sound/2612intf.cpp
+++ b/src/devices/sound/2612intf.cpp
@@ -91,7 +91,8 @@ void ym2612_device::device_start()
/**** initialize YM2612 ****/
m_chip = ym2612_init(this,clock(),rate,&ym2612_device::static_timer_handler,&ym2612_device::static_irq_handler);
- assert_always(m_chip != nullptr, "Error creating YM2612 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ym2612_device(%s): Error creating YM2612 chip", tag());
}
void ym2612_device::device_clock_changed()
diff --git a/src/devices/sound/262intf.cpp b/src/devices/sound/262intf.cpp
index 0de5e274ca9..f2aee977b30 100644
--- a/src/devices/sound/262intf.cpp
+++ b/src/devices/sound/262intf.cpp
@@ -78,7 +78,8 @@ void ymf262_device::device_start()
/* stream system initialize */
m_chip = ymf262_init(this,clock(),rate);
- assert_always(m_chip != nullptr, "Error creating YMF262 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ymf262_device(%s): Error creating YMF262 chip", tag());
m_stream = machine().sound().stream_alloc(*this,0,4,rate);
diff --git a/src/devices/sound/3526intf.cpp b/src/devices/sound/3526intf.cpp
index 2418b9e65a1..dd81b0d7eb0 100644
--- a/src/devices/sound/3526intf.cpp
+++ b/src/devices/sound/3526intf.cpp
@@ -82,7 +82,8 @@ void ym3526_device::device_start()
/* stream system initialize */
m_chip = ym3526_init(this, clock(), rate);
- assert_always(m_chip != nullptr, "Error creating YM3526 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ym3526_device(%s): Error creating YM3526 chip", tag());
calculate_rates();
diff --git a/src/devices/sound/3812intf.cpp b/src/devices/sound/3812intf.cpp
index 9b29af0599d..c5f5aeabb05 100644
--- a/src/devices/sound/3812intf.cpp
+++ b/src/devices/sound/3812intf.cpp
@@ -82,7 +82,8 @@ void ym3812_device::device_start()
/* stream system initialize */
m_chip = ym3812_init(this, clock(), rate);
- assert_always(m_chip != nullptr, "Error creating YM3812 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ym3812_device(%s): Error creating YM3812 chip", tag());
calculate_rates();
diff --git a/src/devices/sound/8950intf.cpp b/src/devices/sound/8950intf.cpp
index 601c9861f33..af981b756be 100644
--- a/src/devices/sound/8950intf.cpp
+++ b/src/devices/sound/8950intf.cpp
@@ -81,7 +81,8 @@ void y8950_device::device_start()
/* stream system initialize */
m_chip = y8950_init(this,clock(),rate);
- assert_always(m_chip != nullptr, "Error creating Y8950 chip");
+ if (!m_chip)
+ throw emu_fatalerror("y8950_device(%s): Error creating Y8950 chip", tag());
/* ADPCM ROM data */
y8950_set_delta_t_memory(m_chip, &y8950_device::static_read_byte, &y8950_device::static_write_byte);
diff --git a/src/devices/sound/discrete.cpp b/src/devices/sound/discrete.cpp
index 2b3a47dbfb8..2e90311ac46 100644
--- a/src/devices/sound/discrete.cpp
+++ b/src/devices/sound/discrete.cpp
@@ -246,13 +246,15 @@ bool discrete_task::process(void)
int avail;
avail = sn->linked_outbuf->ptr - sn->ptr;
- assert_always(avail >= 0, "task_callback: available samples are negative");
+ if (avail < 0)
+ throw emu_fatalerror("discrete_task::process: available samples are negative");
if (avail < samples)
samples = avail;
}
m_samples -= samples;
- assert_always(m_samples >=0, "task_callback: task_samples got negative");
+ if (m_samples < 0)
+ throw emu_fatalerror("discrete_task::process: m_samples got negative");
while (samples > 0)
{
/* step */
diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp
index 7626025e9e9..29baecb352e 100644
--- a/src/devices/sound/pokey.cpp
+++ b/src/devices/sound/pokey.cpp
@@ -417,7 +417,7 @@ void pokey_device::device_timer(emu_timer &timer, device_timer_id id, int param,
m_IRQST |= (param & 0xff);
break;
default:
- assert_always(false, "Unknown id in pokey_device::device_timer");
+ throw emu_fatalerror("Unknown id in pokey_device::device_timer");
}
}
diff --git a/src/devices/sound/tiaintf.cpp b/src/devices/sound/tiaintf.cpp
index 9df0166ca86..da0f0c27759 100644
--- a/src/devices/sound/tiaintf.cpp
+++ b/src/devices/sound/tiaintf.cpp
@@ -33,7 +33,8 @@ void tia_device::device_start()
{
m_channel = stream_alloc(0, 1, clock());
m_chip = tia_sound_init(this, clock(), clock(), 16);
- assert_always(m_chip != nullptr, "Error creating TIA chip");
+ if (!m_chip)
+ throw emu_fatalerror("tia_device(%s): Error creating TIA chip", tag());
}
diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp
index be93f44128f..b800f6a7b0e 100644
--- a/src/devices/sound/upd7759.cpp
+++ b/src/devices/sound/upd7759.cpp
@@ -618,7 +618,7 @@ void upd7759_device::device_timer(emu_timer &timer, device_timer_id id, int para
break;
default:
- assert_always(false, "Unknown id in upd7759_device::device_timer");
+ throw emu_fatalerror("Unknown id in upd7759_device::device_timer");
}
}
diff --git a/src/devices/sound/ymf271.cpp b/src/devices/sound/ymf271.cpp
index c979ea7426e..6b05f390275 100644
--- a/src/devices/sound/ymf271.cpp
+++ b/src/devices/sound/ymf271.cpp
@@ -1346,7 +1346,7 @@ void ymf271_device::device_timer(emu_timer &timer, device_timer_id id, int param
break;
default:
- assert_always(false, "Unknown id in ymf271_device::device_timer");
+ throw emu_fatalerror("Unknown id in ymf271_device::device_timer");
break;
}
}
diff --git a/src/devices/sound/ymf278b.cpp b/src/devices/sound/ymf278b.cpp
index 71baf70aeb9..dc0c4693aab 100644
--- a/src/devices/sound/ymf278b.cpp
+++ b/src/devices/sound/ymf278b.cpp
@@ -1038,7 +1038,8 @@ void ymf278b_device::device_start()
/* stream system initialize */
int ymf262_clock = clock() / (19/8.0);
m_ymf262 = ymf262_init(this, ymf262_clock, ymf262_clock / 288);
- assert_always(m_ymf262 != nullptr, "Error creating YMF262 chip");
+ if (!m_ymf262)
+ throw emu_fatalerror("ymf278b_device(%s): Error creating YMF262 chip", tag());
m_stream_ymf262 = machine().sound().stream_alloc(*this, 0, 4, ymf262_clock / 288);
diff --git a/src/devices/sound/ymz280b.cpp b/src/devices/sound/ymz280b.cpp
index 1ab3cd9b6a9..0b182509fb5 100644
--- a/src/devices/sound/ymz280b.cpp
+++ b/src/devices/sound/ymz280b.cpp
@@ -636,7 +636,7 @@ void ymz280b_device::device_reset()
m_ext_mem_address = 0;
/* clear other voice parameters */
- for (auto & elem : m_voice)
+ for (auto &elem : m_voice)
{
struct YMZ280BVoice *voice = &elem;
@@ -653,7 +653,7 @@ void ymz280b_device::device_timer(emu_timer &timer, device_timer_id id, int para
if (id < 8)
update_irq_state_timer_common( id );
else
- assert_always(false, "Unknown id in ymz280b_device::device_timer");
+ throw emu_fatalerror("Unknown id in ymz280b_device::device_timer");
}
diff --git a/src/devices/video/gba_lcd.cpp b/src/devices/video/gba_lcd.cpp
index 36214bb1ad4..94ee1e49c0d 100644
--- a/src/devices/video/gba_lcd.cpp
+++ b/src/devices/video/gba_lcd.cpp
@@ -1577,16 +1577,14 @@ READ32_MEMBER(gba_lcd_device::video_r)
break;
}
- assert_always(offset < ARRAY_LENGTH(reg_names) / 2, "Not enough register names in gba_lcd_device");
+ if (offset >= ARRAY_LENGTH(reg_names) / 2)
+ throw emu_fatalerror("gba_lcd_device::video_r: Not enough register names in gba_lcd_device");
if (ACCESSING_BITS_0_15)
- {
verboselog(*this, 2, "GBA I/O Read: %s = %04x\n", reg_names[offset * 2], retval & 0x0000ffff);
- }
+
if (ACCESSING_BITS_16_31)
- {
verboselog(*this, 2, "GBA I/O Read: %s = %04x\n", reg_names[offset * 2 + 1], (retval & 0xffff0000) >> 16);
- }
return retval;
}
@@ -1595,16 +1593,14 @@ WRITE32_MEMBER(gba_lcd_device::video_w)
{
COMBINE_DATA(&m_regs[offset]);
- assert_always(offset < ARRAY_LENGTH(reg_names) / 2, "Not enough register names in gba_lcd_device");
+ if (offset >= ARRAY_LENGTH(reg_names) / 2)
+ throw emu_fatalerror("gba_lcd_device::video_w: Not enough register names in gba_lcd_device");
if (ACCESSING_BITS_0_15)
- {
verboselog(*this, 2, "GBA I/O Write: %s = %04x\n", reg_names[offset * 2], data & 0x0000ffff);
- }
+
if (ACCESSING_BITS_16_31)
- {
verboselog(*this, 2, "GBA I/O Write: %s = %04x\n", reg_names[offset * 2 + 1], (data & 0xffff0000) >> 16);
- }
switch (offset)
{
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp
index a38de1d475f..36ac805d218 100644
--- a/src/devices/video/voodoo.cpp
+++ b/src/devices/video/voodoo.cpp
@@ -5751,7 +5751,8 @@ voodoo_device::raster_info *voodoo_device::add_rasterizer(voodoo_device *vd, con
raster_info *info = &vd->rasterizer[vd->next_rasterizer++];
int hash = cinfo->compute_hash();
- assert_always(vd->next_rasterizer <= MAX_RASTERIZERS, "Out of space for new rasterizers!");
+ if (vd->next_rasterizer > MAX_RASTERIZERS)
+ throw emu_fatalerror("voodoo_device::add_rasterizer: Out of space for new rasterizers!");
/* make a copy of the info */
*info = *cinfo;
diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp
index 69417db74db..cdbcbb1edf4 100644
--- a/src/emu/diimage.cpp
+++ b/src/emu/diimage.cpp
@@ -625,7 +625,8 @@ bool device_image_interface::support_command_line_image_creation() const
void device_image_interface::battery_load(void *buffer, int length, int fill)
{
- assert_always(buffer && (length > 0), "Must specify sensical buffer/length");
+ if (!buffer || (length <= 0))
+ throw emu_fatalerror("device_image_interface::battery_load: Must specify sensical buffer/length");
osd_file::error filerr;
int bytes_read = 0;
@@ -643,7 +644,8 @@ void device_image_interface::battery_load(void *buffer, int length, int fill)
void device_image_interface::battery_load(void *buffer, int length, void *def_buffer)
{
- assert_always(buffer && (length > 0), "Must specify sensical buffer/length");
+ if (!buffer || (length <= 0))
+ throw emu_fatalerror("device_image_interface::battery_load: Must specify sensical buffer/length");
osd_file::error filerr;
int bytes_read = 0;
@@ -670,7 +672,8 @@ void device_image_interface::battery_load(void *buffer, int length, void *def_bu
void device_image_interface::battery_save(const void *buffer, int length)
{
- assert_always(buffer && (length > 0), "Must specify sensical buffer/length");
+ if (!buffer || (length <= 0))
+ throw emu_fatalerror("device_image_interface::battery_save: Must specify sensical buffer/length");
if (!device().machine().options().nvram_save())
return;
diff --git a/src/emu/diimage.h b/src/emu/diimage.h
index fb2a317d60a..4a3ed06d6cc 100644
--- a/src/emu/diimage.h
+++ b/src/emu/diimage.h
@@ -243,7 +243,7 @@ protected:
void clear_error();
- void check_for_file() const { assert_always(m_file, "Illegal operation on unmounted image"); }
+ void check_for_file() const { if (!m_file) throw emu_fatalerror("%s(%s): Illegal operation on unmounted image", device().shortname(), device().tag()); }
void setup_working_directory();
bool try_change_working_directory(const std::string &subdir);
diff --git a/src/emu/dipalette.cpp b/src/emu/dipalette.cpp
index 76c0c0f1c82..b5ceeb05d4c 100644
--- a/src/emu/dipalette.cpp
+++ b/src/emu/dipalette.cpp
@@ -345,7 +345,8 @@ void device_palette_interface::allocate_palette(u32 numentries)
m_shadow_group = numgroups++;
if (palette_hilights_enabled())
m_hilight_group = numgroups++;
- assert_always(numentries * numgroups <= 65536, "Palette has more than 65536 colors.");
+ if (numentries * numgroups > 65536)
+ throw emu_fatalerror("%s(%s): Palette has more than 65536 colors.", device().shortname(), device().tag());
// allocate a palette object containing all the colors and groups
m_palette = palette_t::alloc(numentries, numgroups);
diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp
index df63d06c5c8..1e56fa84d20 100644
--- a/src/emu/tilemap.cpp
+++ b/src/emu/tilemap.cpp
@@ -9,9 +9,10 @@
***************************************************************************/
#include "emu.h"
-#include "screen.h"
#include "tilemap.h"
+#include "screen.h"
+
//**************************************************************************
// INLINE FUNCTIONS
diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h
index 185311c389a..a116f019c6c 100644
--- a/src/emu/tilemap.h
+++ b/src/emu/tilemap.h
@@ -298,11 +298,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_EMU_TILEMAP_H
#define MAME_EMU_TILEMAP_H
+#pragma once
+
//**************************************************************************
// CONSTANTS
diff --git a/src/mame/audio/geebee.cpp b/src/mame/audio/geebee.cpp
index 76f79bb1c86..037a398dc3b 100644
--- a/src/mame/audio/geebee.cpp
+++ b/src/mame/audio/geebee.cpp
@@ -58,13 +58,13 @@ void geebee_sound_device::device_timer(emu_timer &timer, device_timer_id id, int
{
switch (id)
{
- case TIMER_VOLUME_DECAY:
- if (--m_volume < 0)
- m_volume = 0;
- break;
+ case TIMER_VOLUME_DECAY:
+ if (--m_volume < 0)
+ m_volume = 0;
+ break;
- default:
- assert_always(false, "Unknown id in geebee_device::device_timer");
+ default:
+ throw emu_fatalerror("Unknown id in geebee_device::device_timer");
}
}
diff --git a/src/mame/audio/snes_snd.cpp b/src/mame/audio/snes_snd.cpp
index e4f1b91a517..2f8a23f48da 100644
--- a/src/mame/audio/snes_snd.cpp
+++ b/src/mame/audio/snes_snd.cpp
@@ -240,10 +240,7 @@ inline void snes_sound_device::update_timer_tick(u8 which)
void snes_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
if (id != TIMER_TICK_ID)
- {
- assert_always(false, "Unknown id in snes_sound_device::device_timer");
- return;
- }
+ throw emu_fatalerror("Unknown id in snes_sound_device::device_timer");
for (int ch = 0; ch < 3; ch++)
update_timer_tick(ch);
diff --git a/src/mame/audio/t5182.cpp b/src/mame/audio/t5182.cpp
index 2cc831bf63d..b867a5777a5 100644
--- a/src/mame/audio/t5182.cpp
+++ b/src/mame/audio/t5182.cpp
@@ -225,11 +225,11 @@ void t5182_device::device_timer(emu_timer &timer, device_timer_id id, int param,
{
switch (id)
{
- case SETIRQ_CB:
- setirq_callback(ptr, param);
- break;
- default:
- assert_always(false, "Unknown id in t5182_device::device_timer");
+ case SETIRQ_CB:
+ setirq_callback(ptr, param);
+ break;
+ default:
+ throw emu_fatalerror("Unknown id in t5182_device::device_timer");
}
}
diff --git a/src/mame/audio/warpwarp.cpp b/src/mame/audio/warpwarp.cpp
index 9e482e3a538..2e4075771ea 100644
--- a/src/mame/audio/warpwarp.cpp
+++ b/src/mame/audio/warpwarp.cpp
@@ -75,18 +75,18 @@ void warpwarp_sound_device::device_timer(emu_timer &timer, device_timer_id id, i
{
switch (id)
{
- case TIMER_SOUND_VOLUME_DECAY:
- if (--m_sound_volume < 0)
- m_sound_volume = 0;
- break;
-
- case TIMER_MUSIC_VOLUME_DECAY:
- if (--m_music_volume < 0)
- m_music_volume = 0;
- break;
-
- default:
- assert_always(false, "Unknown id in warpwarp_sound_device::device_timer");
+ case TIMER_SOUND_VOLUME_DECAY:
+ if (--m_sound_volume < 0)
+ m_sound_volume = 0;
+ break;
+
+ case TIMER_MUSIC_VOLUME_DECAY:
+ if (--m_music_volume < 0)
+ m_music_volume = 0;
+ break;
+
+ default:
+ throw emu_fatalerror("Unknown id in warpwarp_sound_device::device_timer");
}
}
diff --git a/src/mame/drivers/2mindril.cpp b/src/mame/drivers/2mindril.cpp
index ecb9912134e..6301efc8d0f 100644
--- a/src/mame/drivers/2mindril.cpp
+++ b/src/mame/drivers/2mindril.cpp
@@ -143,7 +143,7 @@ void _2mindril_state::device_timer(emu_timer &timer, device_timer_id id, int par
m_defender_sensor = param;
break;
default:
- assert_always(false, "Unknown id in _2mindril_state::device_timer");
+ throw emu_fatalerror("Unknown id in _2mindril_state::device_timer");
}
}
#endif
diff --git a/src/mame/drivers/acefruit.cpp b/src/mame/drivers/acefruit.cpp
index 96d9c1219ef..810937ac4e2 100644
--- a/src/mame/drivers/acefruit.cpp
+++ b/src/mame/drivers/acefruit.cpp
@@ -101,7 +101,7 @@ void acefruit_state::acefruit_update_irq(int vpos)
switch( color )
{
case 0x0c:
- m_maincpu->set_input_line(0, HOLD_LINE );
+ m_maincpu->set_input_line(0, HOLD_LINE);
break;
}
}
@@ -116,15 +116,15 @@ void acefruit_state::device_timer(emu_timer &timer, device_timer_id id, int para
{
case TIMER_ACEFRUIT_REFRESH:
- m_screen->update_partial(vpos );
- acefruit_update_irq(vpos);
+ m_screen->update_partial(vpos);
+ acefruit_update_irq(vpos);
- vpos = ( ( vpos / 8 ) + 1 ) * 8;
+ vpos = ((vpos / 8) + 1) * 8;
- m_refresh_timer->adjust( m_screen->time_until_pos(vpos) );
- break;
+ m_refresh_timer->adjust(m_screen->time_until_pos(vpos));
+ break;
default:
- assert_always(false, "Unknown id in acefruit_state::device_timer");
+ throw emu_fatalerror("Unknown id in acefruit_state::device_timer");
}
}
diff --git a/src/mame/drivers/amust.cpp b/src/mame/drivers/amust.cpp
index 7c8dd90d45c..58cd91fd1ee 100644
--- a/src/mame/drivers/amust.cpp
+++ b/src/mame/drivers/amust.cpp
@@ -168,7 +168,7 @@ void amust_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_beep->set_state(0);
break;
default:
- assert_always(false, "Unknown id in amust_state::device_timer");
+ throw emu_fatalerror("Unknown id in amust_state::device_timer");
}
}
diff --git a/src/mame/drivers/argo.cpp b/src/mame/drivers/argo.cpp
index 869cf2da03b..afb228bed4b 100644
--- a/src/mame/drivers/argo.cpp
+++ b/src/mame/drivers/argo.cpp
@@ -434,7 +434,7 @@ void argo_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in argo_state::device_timer");
+ throw emu_fatalerror("Unknown id in argo_state::device_timer");
}
}
diff --git a/src/mame/drivers/aristmk4.cpp b/src/mame/drivers/aristmk4.cpp
index 434531d1d29..f9faaf5c073 100644
--- a/src/mame/drivers/aristmk4.cpp
+++ b/src/mame/drivers/aristmk4.cpp
@@ -1754,7 +1754,7 @@ void aristmk4_state::device_timer(emu_timer &timer, device_timer_id id, int para
switch (id)
{
case TIMER_POWER_FAIL: power_fail(); break;
- default: assert_always(false, "Unknown id in aristmk4_state::device_timer");
+ default: throw emu_fatalerror("Unknown id in aristmk4_state::device_timer");
}
}
diff --git a/src/mame/drivers/artmagic.cpp b/src/mame/drivers/artmagic.cpp
index 3189eb3d0f0..17f2081eb28 100644
--- a/src/mame/drivers/artmagic.cpp
+++ b/src/mame/drivers/artmagic.cpp
@@ -128,7 +128,7 @@ void artmagic_state::device_timer(emu_timer &timer, device_timer_id id, int para
update_irq_state();
break;
default:
- assert_always(false, "Unknown id in artmagic_state::device_timer");
+ throw emu_fatalerror("Unknown id in artmagic_state::device_timer");
}
}
diff --git a/src/mame/drivers/asterix.cpp b/src/mame/drivers/asterix.cpp
index 9e63c1d90ec..94019c13c53 100644
--- a/src/mame/drivers/asterix.cpp
+++ b/src/mame/drivers/asterix.cpp
@@ -73,7 +73,7 @@ void asterix_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in asterix_state::device_timer");
+ throw emu_fatalerror("Unknown id in asterix_state::device_timer");
}
}
diff --git a/src/mame/drivers/astinvad.cpp b/src/mame/drivers/astinvad.cpp
index 81af8cee125..cdf277b5356 100644
--- a/src/mame/drivers/astinvad.cpp
+++ b/src/mame/drivers/astinvad.cpp
@@ -262,7 +262,7 @@ void astinvad_state::device_timer(emu_timer &timer, device_timer_id id, int para
kamizake_int_gen(ptr, param);
break;
default:
- assert_always(false, "Unknown id in astinvad_state::device_timer");
+ throw emu_fatalerror("Unknown id in astinvad_state::device_timer");
}
}
diff --git a/src/mame/drivers/asuka.cpp b/src/mame/drivers/asuka.cpp
index 871aa31f7b8..1556a996993 100644
--- a/src/mame/drivers/asuka.cpp
+++ b/src/mame/drivers/asuka.cpp
@@ -243,7 +243,7 @@ void asuka_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(5, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in asuka_state::device_timer");
+ throw emu_fatalerror("Unknown id in asuka_state::device_timer");
}
}
diff --git a/src/mame/drivers/atarist.cpp b/src/mame/drivers/atarist.cpp
index 8ef9ff076b9..e9245d092ee 100644
--- a/src/mame/drivers/atarist.cpp
+++ b/src/mame/drivers/atarist.cpp
@@ -69,7 +69,7 @@ void st_state::device_timer(emu_timer &timer, device_timer_id id, int param, voi
blitter_tick();
break;
default:
- assert_always(false, "Unknown id in st_state::device_timer");
+ throw emu_fatalerror("Unknown id in st_state::device_timer");
}
}
diff --git a/src/mame/drivers/beezer.cpp b/src/mame/drivers/beezer.cpp
index 9796313388f..950bd9f2a94 100644
--- a/src/mame/drivers/beezer.cpp
+++ b/src/mame/drivers/beezer.cpp
@@ -302,7 +302,7 @@ void beezer_state::device_timer(emu_timer &timer, device_timer_id id, int param,
{
case TIMER_DAC: dac_update_cb(); break;
case TIMER_SCANLINE: scanline_cb(); break;
- default: assert_always(false, "Unknown id in beezer_state::device_timer");
+ default: throw emu_fatalerror("Unknown id in beezer_state::device_timer");
}
}
diff --git a/src/mame/drivers/boxer.cpp b/src/mame/drivers/boxer.cpp
index 0eccc410514..8a6c13cd1b5 100644
--- a/src/mame/drivers/boxer.cpp
+++ b/src/mame/drivers/boxer.cpp
@@ -103,7 +103,7 @@ void boxer_state::device_timer(emu_timer &timer, device_timer_id id, int param,
periodic_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in boxer_state::device_timer");
+ throw emu_fatalerror("Unknown id in boxer_state::device_timer");
}
}
diff --git a/src/mame/drivers/c10.cpp b/src/mame/drivers/c10.cpp
index 59462dfbea2..511b6741ffe 100644
--- a/src/mame/drivers/c10.cpp
+++ b/src/mame/drivers/c10.cpp
@@ -81,7 +81,7 @@ void c10_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in c10_state::device_timer");
+ throw emu_fatalerror("Unknown id in c10_state::device_timer");
}
}
diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp
index 9fdb8438fb9..96a31ab31ea 100644
--- a/src/mame/drivers/capbowl.cpp
+++ b/src/mame/drivers/capbowl.cpp
@@ -130,7 +130,7 @@ void capbowl_state::device_timer(emu_timer &timer, device_timer_id id, int param
update(ptr, param);
break;
default:
- assert_always(false, "Unknown id in capbowl_state::device_timer");
+ throw emu_fatalerror("Unknown id in capbowl_state::device_timer");
}
}
diff --git a/src/mame/drivers/cat.cpp b/src/mame/drivers/cat.cpp
index 950b7dd2d1b..d1ed24efad5 100644
--- a/src/mame/drivers/cat.cpp
+++ b/src/mame/drivers/cat.cpp
@@ -902,7 +902,7 @@ void cat_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
counter_6ms_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in cat_state::device_timer");
+ throw emu_fatalerror("Unknown id in cat_state::device_timer");
}
}
diff --git a/src/mame/drivers/cball.cpp b/src/mame/drivers/cball.cpp
index b022aeade1a..38d9d82e31c 100644
--- a/src/mame/drivers/cball.cpp
+++ b/src/mame/drivers/cball.cpp
@@ -110,7 +110,7 @@ void cball_state::device_timer(emu_timer &timer, device_timer_id id, int param,
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in cball_state::device_timer");
+ throw emu_fatalerror("Unknown id in cball_state::device_timer");
}
}
diff --git a/src/mame/drivers/cidelsa.cpp b/src/mame/drivers/cidelsa.cpp
index 7a484d6d181..4e998a5bc26 100644
--- a/src/mame/drivers/cidelsa.cpp
+++ b/src/mame/drivers/cidelsa.cpp
@@ -364,7 +364,7 @@ void cidelsa_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_reset = 1;
break;
default:
- assert_always(false, "Unknown id in cidelsa_state::device_timer");
+ throw emu_fatalerror("Unknown id in cidelsa_state::device_timer");
}
}
diff --git a/src/mame/drivers/clpoker.cpp b/src/mame/drivers/clpoker.cpp
index 10a41c9ec71..372c788d257 100644
--- a/src/mame/drivers/clpoker.cpp
+++ b/src/mame/drivers/clpoker.cpp
@@ -27,9 +27,7 @@ There also are unpopulated locations that might fit a YM3812 and YM3014.
*/
#include "emu.h"
-#include "screen.h"
-#include "speaker.h"
-#include "tilemap.h"
+
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
#include "machine/nvram.h"
@@ -37,6 +35,11 @@ There also are unpopulated locations that might fit a YM3812 and YM3014.
#include "sound/ay8910.h"
#include "video/ramdac.h"
+#include "screen.h"
+#include "speaker.h"
+#include "tilemap.h"
+
+
class clpoker_state : public driver_device
{
public:
@@ -49,6 +52,12 @@ public:
{
}
+ void clpoker(machine_config &config);
+
+protected:
+ virtual void video_start() override;
+
+private:
DECLARE_WRITE8_MEMBER(output_a_w);
DECLARE_WRITE8_MEMBER(output_b_w);
DECLARE_WRITE8_MEMBER(output_c_w);
@@ -58,14 +67,10 @@ public:
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void clpoker(machine_config &config);
void io_map(address_map &map);
void prg_map(address_map &map);
void ramdac_map(address_map &map);
-protected:
- virtual void video_start() override;
-private:
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp
index a3d16e67156..dbc7d5f5d02 100644
--- a/src/mame/drivers/dec8.cpp
+++ b/src/mame/drivers/dec8.cpp
@@ -149,7 +149,7 @@ void dec8_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
break;
default:
- assert_always(false, "Unknown id in dec8_state::device_timer");
+ throw emu_fatalerror("Unknown id in dec8_state::device_timer");
}
}
diff --git a/src/mame/drivers/dectalk.cpp b/src/mame/drivers/dectalk.cpp
index 9eec753da43..1f406494e97 100644
--- a/src/mame/drivers/dectalk.cpp
+++ b/src/mame/drivers/dectalk.cpp
@@ -854,7 +854,7 @@ void dectalk_state::device_timer(emu_timer &timer, device_timer_id id, int param
outfifo_read_cb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in dectalk_state::device_timer");
+ throw emu_fatalerror("Unknown id in dectalk_state::device_timer");
}
}
diff --git a/src/mame/drivers/destroyr.cpp b/src/mame/drivers/destroyr.cpp
index 50fd0907ca7..cc1cf82d3b2 100644
--- a/src/mame/drivers/destroyr.cpp
+++ b/src/mame/drivers/destroyr.cpp
@@ -170,7 +170,7 @@ void destroyr_state::device_timer(emu_timer &timer, device_timer_id id, int para
frame_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in destroyr_state::device_timer");
+ throw emu_fatalerror("Unknown id in destroyr_state::device_timer");
}
}
diff --git a/src/mame/drivers/fgoal.cpp b/src/mame/drivers/fgoal.cpp
index b3aca7a63ef..c8031505a03 100644
--- a/src/mame/drivers/fgoal.cpp
+++ b/src/mame/drivers/fgoal.cpp
@@ -72,7 +72,7 @@ void fgoal_state::device_timer(emu_timer &timer, device_timer_id id, int param,
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in fgoal_state::device_timer");
+ throw emu_fatalerror("Unknown id in fgoal_state::device_timer");
}
}
diff --git a/src/mame/drivers/flyball.cpp b/src/mame/drivers/flyball.cpp
index b7f4f04bb05..f9f24738a17 100644
--- a/src/mame/drivers/flyball.cpp
+++ b/src/mame/drivers/flyball.cpp
@@ -186,7 +186,7 @@ void flyball_state::device_timer(emu_timer &timer, device_timer_id id, int param
break;
default:
- assert_always(false, "Unknown id in flyball_state::device_timer");
+ throw emu_fatalerror("Unknown id in flyball_state::device_timer");
}
}
diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp
index ca6703e6b8a..dc6b256e815 100644
--- a/src/mame/drivers/fm7.cpp
+++ b/src/mame/drivers/fm7.cpp
@@ -210,7 +210,7 @@ void fm7_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
fm77av_vsync(ptr, param);
break;
default:
- assert_always(false, "Unknown id in fm7_state::device_timer");
+ throw emu_fatalerror("Unknown id in fm7_state::device_timer");
}
}
diff --git a/src/mame/drivers/fuukifg2.cpp b/src/mame/drivers/fuukifg2.cpp
index d57f965ceec..45ab3b8efd5 100644
--- a/src/mame/drivers/fuukifg2.cpp
+++ b/src/mame/drivers/fuukifg2.cpp
@@ -434,7 +434,7 @@ void fuuki16_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_raster_interrupt_timer->adjust(m_screen->frame_period());
break;
default:
- assert_always(false, "Unknown id in fuuki16_state::device_timer");
+ throw emu_fatalerror("Unknown id in fuuki16_state::device_timer");
}
}
diff --git a/src/mame/drivers/fuukifg3.cpp b/src/mame/drivers/fuukifg3.cpp
index 789f009a704..e81b0077e8e 100644
--- a/src/mame/drivers/fuukifg3.cpp
+++ b/src/mame/drivers/fuukifg3.cpp
@@ -492,7 +492,7 @@ void fuuki32_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_raster_interrupt_timer->adjust(m_screen->frame_period());
break;
default:
- assert_always(false, "Unknown id in fuuki32_state::device_timer");
+ throw emu_fatalerror("Unknown id in fuuki32_state::device_timer");
}
}
diff --git a/src/mame/drivers/gaplus.cpp b/src/mame/drivers/gaplus.cpp
index b40f5b20252..38aa479c683 100644
--- a/src/mame/drivers/gaplus.cpp
+++ b/src/mame/drivers/gaplus.cpp
@@ -221,7 +221,7 @@ void gaplus_base_state::device_timer(emu_timer &timer, device_timer_id id, int p
namcoio1_run(ptr, param);
break;
default:
- assert_always(false, "Unknown id in gaplus_base_state::device_timer");
+ throw emu_fatalerror("Unknown id in gaplus_base_state::device_timer");
}
}
diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp
index 3ae77dcb246..87f168784c1 100644
--- a/src/mame/drivers/gottlieb.cpp
+++ b/src/mame/drivers/gottlieb.cpp
@@ -707,7 +707,7 @@ void gottlieb_state::device_timer(emu_timer &timer, device_timer_id id, int para
nmi_clear(ptr, param);
break;
default:
- assert_always(false, "Unknown id in gottlieb_state::device_timer");
+ throw emu_fatalerror("Unknown id in gottlieb_state::device_timer");
}
}
diff --git a/src/mame/drivers/gpworld.cpp b/src/mame/drivers/gpworld.cpp
index df0edef9ad1..5bafebbd9d9 100644
--- a/src/mame/drivers/gpworld.cpp
+++ b/src/mame/drivers/gpworld.cpp
@@ -462,7 +462,7 @@ void gpworld_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->set_input_line(0, CLEAR_LINE);
break;
default:
- assert_always(false, "Unknown id in gpworld_state::device_timer");
+ throw emu_fatalerror("Unknown id in gpworld_state::device_timer");
}
}
diff --git a/src/mame/drivers/gunbustr.cpp b/src/mame/drivers/gunbustr.cpp
index 6c52edd33f3..4b425dda742 100644
--- a/src/mame/drivers/gunbustr.cpp
+++ b/src/mame/drivers/gunbustr.cpp
@@ -66,7 +66,7 @@ void gunbustr_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(5, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in gunbustr_state::device_timer");
+ throw emu_fatalerror("Unknown id in gunbustr_state::device_timer");
}
}
diff --git a/src/mame/drivers/h19.cpp b/src/mame/drivers/h19.cpp
index d445b869756..bd431361b89 100644
--- a/src/mame/drivers/h19.cpp
+++ b/src/mame/drivers/h19.cpp
@@ -148,13 +148,11 @@ void h19_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
m_bellactive = false;
break;
default:
- assert_always(false, "Unknown id in h19_state::device_timer");
+ throw emu_fatalerror("Unknown id in h19_state::device_timer");
}
if (!m_keyclickactive && !m_bellactive)
- {
m_beep->set_state(0);
- }
}
diff --git a/src/mame/drivers/intv.cpp b/src/mame/drivers/intv.cpp
index 34fdf36526d..90a3ac14a61 100644
--- a/src/mame/drivers/intv.cpp
+++ b/src/mame/drivers/intv.cpp
@@ -438,7 +438,7 @@ void intv_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
intv_btb_fill(ptr, param);
break;
default:
- assert_always(false, "Unknown id in intv_state::device_timer");
+ throw emu_fatalerror("Unknown id in intv_state::device_timer");
}
}
diff --git a/src/mame/drivers/itech8.cpp b/src/mame/drivers/itech8.cpp
index f3ec9da347d..dd1bfe80380 100644
--- a/src/mame/drivers/itech8.cpp
+++ b/src/mame/drivers/itech8.cpp
@@ -692,7 +692,7 @@ void itech8_state::device_timer(emu_timer &timer, device_timer_id id, int param,
delayed_z80_control_w(ptr, param);
break;
default:
- assert_always(false, "Unknown id in itech8_state::device_timer");
+ throw emu_fatalerror("Unknown id in itech8_state::device_timer");
}
}
diff --git a/src/mame/drivers/jclub2.cpp b/src/mame/drivers/jclub2.cpp
index 75a13ac9a58..fbbfde0d7a2 100644
--- a/src/mame/drivers/jclub2.cpp
+++ b/src/mame/drivers/jclub2.cpp
@@ -114,6 +114,8 @@
#include "jclub2o.lh"
#include "jclub2.lh"
+namespace {
+
// Common between all hardware (jclub2o, jclub2 and darkhors)
class common_state : public driver_device
{
@@ -235,6 +237,14 @@ public:
m_gfxdecode(*this, "gfxdecode")
{ }
+ void init_darkhors();
+
+ void darkhors(machine_config &config);
+
+protected:
+ virtual void video_start() override;
+
+private:
DECLARE_WRITE32_MEMBER(input_sel_w);
DECLARE_READ32_MEMBER(input_r);
DECLARE_WRITE32_MEMBER(out1_w);
@@ -248,12 +258,8 @@ public:
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
- void init_darkhors();
- DECLARE_VIDEO_START(darkhors);
-
- void darkhors(machine_config &config);
void darkhors_map(address_map &map);
-private:
+
required_shared_ptr<uint32_t> m_tmapram;
required_shared_ptr<uint32_t> m_tmapscroll;
required_shared_ptr<uint32_t> m_tmapram2;
@@ -391,8 +397,10 @@ void darkhors_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
}
}
-VIDEO_START_MEMBER(darkhors_state,darkhors)
+void darkhors_state::video_start()
{
+ common_state::video_start();
+
m_tmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(darkhors_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS,16,16, 0x40,0x40);
m_tmap2= &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(darkhors_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS,16,16, 0x40,0x40);
m_tmap->set_transparent_pen(0);
@@ -1232,7 +1240,6 @@ void darkhors_state::darkhors(machine_config &config)
PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x10000);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_darkhors);
- MCFG_VIDEO_START_OVERRIDE(darkhors_state, darkhors)
// layout
config.set_default_layout(layout_jclub2);
@@ -1531,6 +1538,8 @@ void darkhors_state::init_darkhors()
}
}
+} // anonymous namespace
+
// Older hardware (ST-0020 + ST-0016)
GAME( 1994, jclub2v100, jclub2v112, jclub2o, jclub2v100, jclub2o_state, init_jclub2o, ROT0, "Seta", "Jockey Club II (v1.00, older hardware)", MACHINE_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/kinst.cpp b/src/mame/drivers/kinst.cpp
index 69b198b2b00..fd03c272bff 100644
--- a/src/mame/drivers/kinst.cpp
+++ b/src/mame/drivers/kinst.cpp
@@ -354,7 +354,7 @@ void kinst_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(0, CLEAR_LINE);
break;
default:
- assert_always(false, "Unknown id in kinst_state::device_timer");
+ throw emu_fatalerror("Unknown id in kinst_state::device_timer");
}
}
diff --git a/src/mame/drivers/laserbat.cpp b/src/mame/drivers/laserbat.cpp
index e0ae530cfe0..ecf2b427351 100644
--- a/src/mame/drivers/laserbat.cpp
+++ b/src/mame/drivers/laserbat.cpp
@@ -457,7 +457,7 @@ void laserbat_state_base::device_timer(emu_timer &timer, device_timer_id id, int
video_line(ptr, param);
break;
default:
- assert_always(false, "Unknown id in laserbat_state_base::device_timer");
+ throw emu_fatalerror("Unknown id in laserbat_state_base::device_timer");
}
}
diff --git a/src/mame/drivers/m10.cpp b/src/mame/drivers/m10.cpp
index 1ad63866911..e7abdf087f7 100644
--- a/src/mame/drivers/m10.cpp
+++ b/src/mame/drivers/m10.cpp
@@ -488,7 +488,7 @@ void m10_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in m10_state::device_timer");
+ throw emu_fatalerror("Unknown id in m10_state::device_timer");
}
}
diff --git a/src/mame/drivers/mekd2.cpp b/src/mame/drivers/mekd2.cpp
index 242de177330..7810c6bbbfb 100644
--- a/src/mame/drivers/mekd2.cpp
+++ b/src/mame/drivers/mekd2.cpp
@@ -211,7 +211,7 @@ void mekd2_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in mekd2_state::device_timer");
+ throw emu_fatalerror("Unknown id in mekd2_state::device_timer");
}
}
diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp
index 41600286900..82c18c784ee 100644
--- a/src/mame/drivers/metro.cpp
+++ b/src/mame/drivers/metro.cpp
@@ -207,7 +207,7 @@ void metro_state::device_timer(emu_timer &timer, device_timer_id id, int param,
update_irq_state();
break;
default:
- assert_always(false, "Unknown id in metro_state::device_timer");
+ throw emu_fatalerror("Unknown id in metro_state::device_timer");
}
}
diff --git a/src/mame/drivers/mgolf.cpp b/src/mame/drivers/mgolf.cpp
index a04d2c47e9e..54bf8ac3854 100644
--- a/src/mame/drivers/mgolf.cpp
+++ b/src/mame/drivers/mgolf.cpp
@@ -154,7 +154,7 @@ void mgolf_state::device_timer(emu_timer &timer, device_timer_id id, int param,
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in mgolf_state::device_timer");
+ throw emu_fatalerror("Unknown id in mgolf_state::device_timer");
}
}
diff --git a/src/mame/drivers/mjsister.cpp b/src/mame/drivers/mjsister.cpp
index 37a2378a550..8ce399fdefd 100644
--- a/src/mame/drivers/mjsister.cpp
+++ b/src/mame/drivers/mjsister.cpp
@@ -212,7 +212,7 @@ void mjsister_state::device_timer(emu_timer &timer, device_timer_id id, int para
dac_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in mjsister_state::device_timer");
+ throw emu_fatalerror("Unknown id in mjsister_state::device_timer");
}
}
diff --git a/src/mame/drivers/mlanding.cpp b/src/mame/drivers/mlanding.cpp
index 4dfb1572506..b4d53d3f304 100644
--- a/src/mame/drivers/mlanding.cpp
+++ b/src/mame/drivers/mlanding.cpp
@@ -425,12 +425,12 @@ void mlanding_state::device_timer(emu_timer &timer, device_timer_id id, int para
{
switch (id)
{
- case TIMER_DMA_COMPLETE:
- m_dma_busy = 0;
- break;
+ case TIMER_DMA_COMPLETE:
+ m_dma_busy = 0;
+ break;
- default:
- assert_always(false, "Unknown id in mlanding_state::device_timer");
+ default:
+ throw emu_fatalerror("Unknown id in mlanding_state::device_timer");
}
}
diff --git a/src/mame/drivers/nightmare.cpp b/src/mame/drivers/nightmare.cpp
index e3b89a4614d..5ec73035356 100644
--- a/src/mame/drivers/nightmare.cpp
+++ b/src/mame/drivers/nightmare.cpp
@@ -271,7 +271,7 @@ void nightmare_state::device_timer(emu_timer &timer, device_timer_id id, int par
m_reset = 1;
break;
default:
- assert_always(false, "Unknown id in nightmare_state::device_timer");
+ throw emu_fatalerror("Unknown id in nightmare_state::device_timer");
}
}
diff --git a/src/mame/drivers/notetaker.cpp b/src/mame/drivers/notetaker.cpp
index e1936339928..26141e200cc 100644
--- a/src/mame/drivers/notetaker.cpp
+++ b/src/mame/drivers/notetaker.cpp
@@ -251,7 +251,7 @@ void notetaker_state::device_timer(emu_timer &timer, device_timer_id id, int par
timer_fifoclk(ptr, param);
break;
default:
- assert_always(false, "Unknown id in notetaker_state::device_timer");
+ throw emu_fatalerror("Unknown id in notetaker_state::device_timer");
}
}
diff --git a/src/mame/drivers/okean240.cpp b/src/mame/drivers/okean240.cpp
index a12bee1167d..8ea2f8b31d5 100644
--- a/src/mame/drivers/okean240.cpp
+++ b/src/mame/drivers/okean240.cpp
@@ -414,7 +414,7 @@ void okean240_state::device_timer(emu_timer &timer, device_timer_id id, int para
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in okean240_state::device_timer");
+ throw emu_fatalerror("Unknown id in okean240_state::device_timer");
}
}
diff --git a/src/mame/drivers/osi.cpp b/src/mame/drivers/osi.cpp
index 2b89d4f3811..cbef219c645 100644
--- a/src/mame/drivers/osi.cpp
+++ b/src/mame/drivers/osi.cpp
@@ -918,7 +918,7 @@ void c1p_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
m_beeper->set_clock(300);
break;
default:
- assert_always(false, "Unknown id in sb2m600_state::device_timer");
+ throw emu_fatalerror("Unknown id in c1p_state::device_timer");
}
}
diff --git a/src/mame/drivers/parodius.cpp b/src/mame/drivers/parodius.cpp
index a79d49cda8d..f450fc04769 100644
--- a/src/mame/drivers/parodius.cpp
+++ b/src/mame/drivers/parodius.cpp
@@ -74,7 +74,7 @@ void parodius_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in parodius_state::device_timer");
+ throw emu_fatalerror("Unknown id in parodius_state::device_timer");
}
}
diff --git a/src/mame/drivers/pc88va.cpp b/src/mame/drivers/pc88va.cpp
index 7ddec08e2c1..aa590135464 100644
--- a/src/mame/drivers/pc88va.cpp
+++ b/src/mame/drivers/pc88va.cpp
@@ -404,7 +404,7 @@ void pc88va_state::device_timer(emu_timer &timer, device_timer_id id, int param,
pc88va_fdc_motor_start_1(ptr, param);
break;
default:
- assert_always(false, "Unknown id in pc88va_state::device_timer");
+ throw emu_fatalerror("Unknown id in pc88va_state::device_timer");
}
}
diff --git a/src/mame/drivers/pcfx.cpp b/src/mame/drivers/pcfx.cpp
index b478d2c5ebd..1a40a8a32a7 100644
--- a/src/mame/drivers/pcfx.cpp
+++ b/src/mame/drivers/pcfx.cpp
@@ -145,7 +145,7 @@ void pcfx_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
pad_func(ptr, param);
break;
default:
- assert_always(false, "Unknown id in pcfx_state::device_timer");
+ throw emu_fatalerror("Unknown id in pcfx_state::device_timer");
}
}
diff --git a/src/mame/drivers/pentagon.cpp b/src/mame/drivers/pentagon.cpp
index d3ac8ce3d3a..83708376c0e 100644
--- a/src/mame/drivers/pentagon.cpp
+++ b/src/mame/drivers/pentagon.cpp
@@ -137,7 +137,7 @@ void pentagon_state::device_timer(emu_timer &timer, device_timer_id id, int para
irq_off(ptr, param);
break;
default:
- assert_always(false, "Unknown id in pentagon_state::device_timer");
+ throw emu_fatalerror("Unknown id in pentagon_state::device_timer");
}
}
diff --git a/src/mame/drivers/plan80.cpp b/src/mame/drivers/plan80.cpp
index b4678cafb24..73cb4580ebe 100644
--- a/src/mame/drivers/plan80.cpp
+++ b/src/mame/drivers/plan80.cpp
@@ -181,7 +181,7 @@ void plan80_state::device_timer(emu_timer &timer, device_timer_id id, int param,
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in plan80_state::device_timer");
+ throw emu_fatalerror("Unknown id in plan80_state::device_timer");
}
}
diff --git a/src/mame/drivers/ptcsol.cpp b/src/mame/drivers/ptcsol.cpp
index 3cb2478fb85..17f7a8055ce 100644
--- a/src/mame/drivers/ptcsol.cpp
+++ b/src/mame/drivers/ptcsol.cpp
@@ -250,7 +250,7 @@ void sol20_state::device_timer(emu_timer &timer, device_timer_id id, int param,
sol20_boot(ptr, param);
break;
default:
- assert_always(false, "Unknown id in sol20_state::device_timer");
+ throw emu_fatalerror("Unknown id in sol20_state::device_timer");
}
}
diff --git a/src/mame/drivers/rabbit.cpp b/src/mame/drivers/rabbit.cpp
index e84e0781c59..ab112f18b34 100644
--- a/src/mame/drivers/rabbit.cpp
+++ b/src/mame/drivers/rabbit.cpp
@@ -590,7 +590,7 @@ void rabbit_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(m_bltirqlevel, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in rabbit_state::device_timer");
+ throw emu_fatalerror("Unknown id in rabbit_state::device_timer");
}
}
diff --git a/src/mame/drivers/rollerg.cpp b/src/mame/drivers/rollerg.cpp
index 528994e61a0..b6aefa297eb 100644
--- a/src/mame/drivers/rollerg.cpp
+++ b/src/mame/drivers/rollerg.cpp
@@ -62,7 +62,7 @@ void rollerg_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in rollerg_state::device_timer");
+ throw emu_fatalerror("Unknown id in rollerg_state::device_timer");
}
}
diff --git a/src/mame/drivers/samcoupe.cpp b/src/mame/drivers/samcoupe.cpp
index 4b7ae972852..9f6d677dccf 100644
--- a/src/mame/drivers/samcoupe.cpp
+++ b/src/mame/drivers/samcoupe.cpp
@@ -65,7 +65,7 @@ void samcoupe_state::device_timer(emu_timer &timer, device_timer_id id, int para
sam_video_update_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in samcoupe_state::device_timer");
+ throw emu_fatalerror("Unknown id in samcoupe_state::device_timer");
}
}
diff --git a/src/mame/drivers/segaorun.cpp b/src/mame/drivers/segaorun.cpp
index b17c0975289..e108111ee1c 100644
--- a/src/mame/drivers/segaorun.cpp
+++ b/src/mame/drivers/segaorun.cpp
@@ -605,7 +605,7 @@ void segaorun_state::device_timer(emu_timer &timer, device_timer_id id, int para
}
default:
- assert_always(false, "Unknown id in segaorun_state::device_timer");
+ throw emu_fatalerror("Unknown id in segaorun_state::device_timer");
}
}
diff --git a/src/mame/drivers/simpsons.cpp b/src/mame/drivers/simpsons.cpp
index 33c3b1ae671..172ef67ad3f 100644
--- a/src/mame/drivers/simpsons.cpp
+++ b/src/mame/drivers/simpsons.cpp
@@ -178,7 +178,7 @@ void simpsons_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in simpsons_state::device_timer");
+ throw emu_fatalerror("Unknown id in simpsons_state::device_timer");
}
}
diff --git a/src/mame/drivers/slapshot.cpp b/src/mame/drivers/slapshot.cpp
index 280c547b272..f9c0708d87a 100644
--- a/src/mame/drivers/slapshot.cpp
+++ b/src/mame/drivers/slapshot.cpp
@@ -157,7 +157,7 @@ void slapshot_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(6, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in slapshot_state::device_timer");
+ throw emu_fatalerror("Unknown id in slapshot_state::device_timer");
}
}
diff --git a/src/mame/drivers/socrates.cpp b/src/mame/drivers/socrates.cpp
index 78a5a1b64df..3ea5d4d7c64 100644
--- a/src/mame/drivers/socrates.cpp
+++ b/src/mame/drivers/socrates.cpp
@@ -399,7 +399,7 @@ void socrates_state::device_timer(emu_timer &timer, device_timer_id id, int para
clear_irq_cb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in socrates_state::device_timer");
+ throw emu_fatalerror("Unknown id in socrates_state::device_timer");
}
}
diff --git a/src/mame/drivers/spacefb.cpp b/src/mame/drivers/spacefb.cpp
index 6049b8876a3..fb22b3b12a7 100644
--- a/src/mame/drivers/spacefb.cpp
+++ b/src/mame/drivers/spacefb.cpp
@@ -136,7 +136,7 @@ void spacefb_state::device_timer(emu_timer &timer, device_timer_id id, int param
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in spacefb_state::device_timer");
+ throw emu_fatalerror("Unknown id in spacefb_state::device_timer");
}
}
diff --git a/src/mame/drivers/spectrum.cpp b/src/mame/drivers/spectrum.cpp
index c3c496109dc..a59235f7904 100644
--- a/src/mame/drivers/spectrum.cpp
+++ b/src/mame/drivers/spectrum.cpp
@@ -689,7 +689,7 @@ void spectrum_state::device_timer(emu_timer &timer, device_timer_id id, int para
spectrum_UpdateScreenBitmap();
break;
default:
- assert_always(false, "Unknown id in spectrum_state::device_timer");
+ throw emu_fatalerror("Unknown id in spectrum_state::device_timer");
}
}
diff --git a/src/mame/drivers/sprint4.cpp b/src/mame/drivers/sprint4.cpp
index 21a43489004..04199682982 100644
--- a/src/mame/drivers/sprint4.cpp
+++ b/src/mame/drivers/sprint4.cpp
@@ -51,7 +51,7 @@ void sprint4_state::device_timer(emu_timer &timer, device_timer_id id, int param
nmi_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in sprint4_state::device_timer");
+ throw emu_fatalerror("Unknown id in sprint4_state::device_timer");
}
}
diff --git a/src/mame/drivers/swyft.cpp b/src/mame/drivers/swyft.cpp
index af132f2be56..f685584eb22 100644
--- a/src/mame/drivers/swyft.cpp
+++ b/src/mame/drivers/swyft.cpp
@@ -326,6 +326,11 @@ public:
void swyft(machine_config &config);
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
private:
required_device<m68008_device> m_maincpu;
optional_device<centronics_device> m_ctx;
@@ -344,10 +349,6 @@ private:
optional_ioport m_y6;
optional_ioport m_y7;*/
- DECLARE_MACHINE_START(swyft);
- DECLARE_MACHINE_RESET(swyft);
- DECLARE_VIDEO_START(swyft);
-
uint32_t screen_update_swyft(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ8_MEMBER(bitlatch_r);
@@ -577,7 +578,7 @@ void swyft_state::swyft_mem(address_map &map)
map(0x0e4000, 0x0e4fff).rw(FUNC(swyft_state::swyft_via1_r), FUNC(swyft_state::swyft_via1_w));
}
-MACHINE_START_MEMBER(swyft_state,swyft)
+void swyft_state::machine_start()
{
for (auto &via : m_via)
{
@@ -588,11 +589,11 @@ MACHINE_START_MEMBER(swyft_state,swyft)
}
}
-MACHINE_RESET_MEMBER(swyft_state,swyft)
+void swyft_state::machine_reset()
{
}
-VIDEO_START_MEMBER(swyft_state,swyft)
+void swyft_state::video_start()
{
}
@@ -757,10 +758,6 @@ void swyft_state::swyft(machine_config &config)
M68008(config, m_maincpu, XTAL(15'897'600)/2); //MC68008P8, Y1=15.8976Mhz, clock GUESSED at Y1 / 2
m_maincpu->set_addrmap(AS_PROGRAM, &swyft_state::swyft_mem);
- MCFG_MACHINE_START_OVERRIDE(swyft_state,swyft)
- MCFG_MACHINE_RESET_OVERRIDE(swyft_state,swyft)
- MCFG_VIDEO_START_OVERRIDE(swyft_state,swyft)
-
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(15.8976_MHz_XTAL / 2, 500, 0, 320, 265, 0, 242); // total guess
diff --git a/src/mame/drivers/symbolics.cpp b/src/mame/drivers/symbolics.cpp
index f5460953f9c..70680a78de1 100644
--- a/src/mame/drivers/symbolics.cpp
+++ b/src/mame/drivers/symbolics.cpp
@@ -289,7 +289,7 @@ INPUT_PORTS_END
outfifo_read_cb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in symbolics_state::device_timer");
+ throw emu_fatalerror("Unknown id in symbolics_state::device_timer");
}
}
diff --git a/src/mame/drivers/sys2900.cpp b/src/mame/drivers/sys2900.cpp
index b4d27a20a64..8e5c8fa390d 100644
--- a/src/mame/drivers/sys2900.cpp
+++ b/src/mame/drivers/sys2900.cpp
@@ -116,7 +116,7 @@ void sys2900_state::device_timer(emu_timer &timer, device_timer_id id, int param
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in sys2900_state::device_timer");
+ throw emu_fatalerror("Unknown id in sys2900_state::device_timer");
}
}
diff --git a/src/mame/drivers/taito_f2.cpp b/src/mame/drivers/taito_f2.cpp
index 5fdd5257d23..9e5964ede5f 100644
--- a/src/mame/drivers/taito_f2.cpp
+++ b/src/mame/drivers/taito_f2.cpp
@@ -537,7 +537,7 @@ void taitof2_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->set_input_line(6, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in taitof2_state::device_timer");
+ throw emu_fatalerror("Unknown id in taitof2_state::device_timer");
}
}
diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp
index c867b19e8f8..6af1a3dd60c 100644
--- a/src/mame/drivers/taito_f3.cpp
+++ b/src/mame/drivers/taito_f3.cpp
@@ -432,7 +432,7 @@ void taito_f3_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(3, HOLD_LINE); // some signal from video hardware?
break;
default:
- assert_always(false, "Unknown id in taito_f3_state::device_timer");
+ throw emu_fatalerror("Unknown id in taito_f3_state::device_timer");
}
}
diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp
index cc024428558..ea00979d01c 100644
--- a/src/mame/drivers/taito_z.cpp
+++ b/src/mame/drivers/taito_z.cpp
@@ -1330,7 +1330,7 @@ void taitoz_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(6, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in taitoz_state::device_timer");
+ throw emu_fatalerror("Unknown id in taitoz_state::device_timer");
}
}
diff --git a/src/mame/drivers/tehkanwc.cpp b/src/mame/drivers/tehkanwc.cpp
index f14ac0b5601..d7270c31dd7 100644
--- a/src/mame/drivers/tehkanwc.cpp
+++ b/src/mame/drivers/tehkanwc.cpp
@@ -169,7 +169,7 @@ void tehkanwc_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_audiocpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero);
break;
default:
- assert_always(false, "Unknown id in tehkanwc_state::device_timer");
+ throw emu_fatalerror("Unknown id in tehkanwc_state::device_timer");
}
}
diff --git a/src/mame/drivers/thayers.cpp b/src/mame/drivers/thayers.cpp
index b0c9c7d7f76..fc1e2ea4ece 100644
--- a/src/mame/drivers/thayers.cpp
+++ b/src/mame/drivers/thayers.cpp
@@ -133,7 +133,7 @@ void thayers_state::device_timer(emu_timer &timer, device_timer_id id, int param
check_interrupt();
break;
default:
- assert_always(false, "Unknown id in thayers_state::device_timer");
+ throw emu_fatalerror("Unknown id in thayers_state::device_timer");
}
}
diff --git a/src/mame/drivers/thunderx.cpp b/src/mame/drivers/thunderx.cpp
index 0358d968d0a..9f50f97de8a 100644
--- a/src/mame/drivers/thunderx.cpp
+++ b/src/mame/drivers/thunderx.cpp
@@ -42,6 +42,9 @@
#include "sound/ym2151.h"
#include "speaker.h"
+//#define VERBOSE 1
+#include "logmacro.h"
+
void thunderx_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
@@ -51,12 +54,10 @@ void thunderx_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in thunderx_state::device_timer");
+ throw emu_fatalerror("Unknown id in thunderx_state::device_timer");
}
}
-#define VERBOSE 0
-#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define PMC_BK (m_1f98_latch & 0x02)
READ8_MEMBER(thunderx_state::pmc_r)
@@ -68,7 +69,7 @@ READ8_MEMBER(thunderx_state::pmc_r)
}
else
{
- LOG(("%04x read pmc internal ram %04x\n",m_audiocpu->pc(),offset));
+ LOG("%04x read pmc internal ram %04x\n",m_audiocpu->pc(),offset);
return 0;
}
}
@@ -77,12 +78,12 @@ WRITE8_MEMBER(thunderx_state::pmc_w)
{
if (PMC_BK)
{
- LOG(("%04x pmcram %04x = %02x\n",m_audiocpu->pc(),offset,data));
+ LOG("%04x pmcram %04x = %02x\n",m_audiocpu->pc(),offset,data);
m_pmcram[offset] = data;
}
else
{
- LOG(("%04x pmc internal ram %04x = %02x\n",m_audiocpu->pc(),offset,data));
+ LOG("%04x pmc internal ram %04x = %02x\n",m_audiocpu->pc(),offset,data);
}
}
diff --git a/src/mame/drivers/tickee.cpp b/src/mame/drivers/tickee.cpp
index 48698080c09..94a9543181b 100644
--- a/src/mame/drivers/tickee.cpp
+++ b/src/mame/drivers/tickee.cpp
@@ -147,7 +147,7 @@ void tickee_state::device_timer(emu_timer &timer, device_timer_id id, int param,
setup_gun_interrupts(ptr, param);
break;
default:
- assert_always(false, "Unknown id in tickee_state::device_timer");
+ throw emu_fatalerror("Unknown id in tickee_state::device_timer");
}
}
diff --git a/src/mame/drivers/tmc1800.cpp b/src/mame/drivers/tmc1800.cpp
index bea8a3a837c..48ae70db106 100644
--- a/src/mame/drivers/tmc1800.cpp
+++ b/src/mame/drivers/tmc1800.cpp
@@ -932,7 +932,7 @@ void tmc1800_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_beeper->set_clock(0);
break;
default:
- assert_always(false, "Unknown id in tmc1800_state::device_timer");
+ throw emu_fatalerror("Unknown id in tmc1800_state::device_timer");
}
}
diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp
index c6491d387da..271ec6a9d97 100644
--- a/src/mame/drivers/tmnt.cpp
+++ b/src/mame/drivers/tmnt.cpp
@@ -268,7 +268,7 @@ void tmnt_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in tmnt_state::device_timer");
+ throw emu_fatalerror("Unknown id in tmnt_state::device_timer");
}
}
diff --git a/src/mame/drivers/trucocl.cpp b/src/mame/drivers/trucocl.cpp
index 94735cdf7f5..b41f03821a4 100644
--- a/src/mame/drivers/trucocl.cpp
+++ b/src/mame/drivers/trucocl.cpp
@@ -59,7 +59,7 @@ void trucocl_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
break;
default:
- assert_always(false, "Unknown id in trucocl_state::device_timer");
+ throw emu_fatalerror("Unknown id in trucocl_state::device_timer");
}
}
diff --git a/src/mame/drivers/tubep.cpp b/src/mame/drivers/tubep.cpp
index f0fd25ade8a..0796a90ba95 100644
--- a/src/mame/drivers/tubep.cpp
+++ b/src/mame/drivers/tubep.cpp
@@ -261,7 +261,7 @@ void tubep_state::device_timer(emu_timer &timer, device_timer_id id, int param,
rjammer_scanline_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in tubep_state::device_timer");
+ throw emu_fatalerror("Unknown id in tubep_state::device_timer");
}
}
diff --git a/src/mame/drivers/tugboat.cpp b/src/mame/drivers/tugboat.cpp
index 93e6e1863d6..aca5d649683 100644
--- a/src/mame/drivers/tugboat.cpp
+++ b/src/mame/drivers/tugboat.cpp
@@ -221,7 +221,7 @@ void tugboat_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_interrupt_timer->adjust(m_screen->frame_period());
break;
default:
- assert_always(false, "Unknown id in tugboat_state::device_timer");
+ throw emu_fatalerror("Unknown id in tugboat_state::device_timer");
}
}
diff --git a/src/mame/drivers/ultratnk.cpp b/src/mame/drivers/ultratnk.cpp
index b4fae269996..d3cf768e5b0 100644
--- a/src/mame/drivers/ultratnk.cpp
+++ b/src/mame/drivers/ultratnk.cpp
@@ -56,7 +56,7 @@ void ultratnk_state::device_timer(emu_timer &timer, device_timer_id id, int para
nmi_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in ultratnk_state::device_timer");
+ throw emu_fatalerror("Unknown id in ultratnk_state::device_timer");
}
}
diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp
index 13e92abd15e..1fa59a8173f 100644
--- a/src/mame/drivers/vegaeo.cpp
+++ b/src/mame/drivers/vegaeo.cpp
@@ -37,6 +37,9 @@ public:
void init_vegaeo();
+protected:
+ void video_start() override;
+
private:
required_device<generic_latch_8_device> m_soundlatch;
required_ioport m_system_io;
@@ -52,8 +55,6 @@ private:
DECLARE_WRITE8_MEMBER(qs1000_p2_w);
DECLARE_WRITE8_MEMBER(qs1000_p3_w);
- DECLARE_VIDEO_START(vega);
-
uint32_t screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void vega_map(address_map &map);
};
@@ -153,7 +154,7 @@ static INPUT_PORTS_START( crazywar )
INPUT_PORTS_END
-VIDEO_START_MEMBER(vegaeo_state,vega)
+void vegaeo_state::video_start()
{
m_vram = std::make_unique<uint8_t[]>(0x14000*2);
save_pointer(NAME(m_vram), 0x14000*2);
@@ -192,8 +193,6 @@ void vegaeo_state::vega(machine_config &config)
PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 256);
m_palette->set_membits(16);
- MCFG_VIDEO_START_OVERRIDE(vegaeo_state,vega)
-
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
diff --git a/src/mame/drivers/vendetta.cpp b/src/mame/drivers/vendetta.cpp
index 79dbe54f851..1fbbff36241 100644
--- a/src/mame/drivers/vendetta.cpp
+++ b/src/mame/drivers/vendetta.cpp
@@ -173,7 +173,7 @@ void vendetta_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in vendetta_state::device_timer");
+ throw emu_fatalerror("Unknown id in vendetta_state::device_timer");
}
}
diff --git a/src/mame/drivers/videopin.cpp b/src/mame/drivers/videopin.cpp
index e93c6154ac8..d10b44855bf 100644
--- a/src/mame/drivers/videopin.cpp
+++ b/src/mame/drivers/videopin.cpp
@@ -57,7 +57,7 @@ void videopin_state::device_timer(emu_timer &timer, device_timer_id id, int para
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in videopin_state::device_timer");
+ throw emu_fatalerror("Unknown id in videopin_state::device_timer");
}
}
diff --git a/src/mame/drivers/videopkr.cpp b/src/mame/drivers/videopkr.cpp
index 45dfbfe6e99..4e536d2988c 100644
--- a/src/mame/drivers/videopkr.cpp
+++ b/src/mame/drivers/videopkr.cpp
@@ -316,11 +316,11 @@ public:
, m_lamps(*this, "lamp%u", 0U)
{ }
- void babypkr(machine_config &config);
- void videodad(machine_config &config);
void videopkr(machine_config &config);
- void fortune1(machine_config &config);
void blckjack(machine_config &config);
+ void videodad(machine_config &config);
+ void babypkr(machine_config &config);
+ void fortune1(machine_config &config);
void bpoker(machine_config &config);
private:
@@ -1339,6 +1339,7 @@ void videopkr_state::fortune1(machine_config &config)
void videopkr_state::bpoker(machine_config &config)
{
babypkr(config);
+
i8751_device &maincpu(I8751(config.replace(), m_maincpu, XTAL(6'000'000)));
maincpu.set_addrmap(AS_PROGRAM, &videopkr_state::i8751_map);
maincpu.set_addrmap(AS_IO, &videopkr_state::i8751_io_port);
diff --git a/src/mame/drivers/vk100.cpp b/src/mame/drivers/vk100.cpp
index 98daff46239..95ed5aaa601 100644
--- a/src/mame/drivers/vk100.cpp
+++ b/src/mame/drivers/vk100.cpp
@@ -342,7 +342,7 @@ void vk100_state::device_timer(emu_timer &timer, device_timer_id id, int param,
execute_vg(ptr, param);
break;
default:
- assert_always(false, "Unknown id in vk100_state::device_timer");
+ throw emu_fatalerror("Unknown id in vk100_state::device_timer");
}
}
diff --git a/src/mame/drivers/wgp.cpp b/src/mame/drivers/wgp.cpp
index 9bfe2c258c5..e60d4adf1ea 100644
--- a/src/mame/drivers/wgp.cpp
+++ b/src/mame/drivers/wgp.cpp
@@ -450,7 +450,7 @@ void wgp_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
m_subcpu->set_input_line(6, HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */
break;
default:
- assert_always(false, "Unknown id in wgp_state::device_timer");
+ throw emu_fatalerror("Unknown id in wgp_state::device_timer");
}
}
diff --git a/src/mame/drivers/wolfpack.cpp b/src/mame/drivers/wolfpack.cpp
index 21d6d76776d..29364110e13 100644
--- a/src/mame/drivers/wolfpack.cpp
+++ b/src/mame/drivers/wolfpack.cpp
@@ -22,7 +22,7 @@ void wolfpack_state::device_timer(emu_timer &timer, device_timer_id id, int para
periodic_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in wolfpack_state::device_timer");
+ throw emu_fatalerror("Unknown id in wolfpack_state::device_timer");
}
}
diff --git a/src/mame/drivers/x1.cpp b/src/mame/drivers/x1.cpp
index 999024d83ce..fe379981f14 100644
--- a/src/mame/drivers/x1.cpp
+++ b/src/mame/drivers/x1.cpp
@@ -2153,7 +2153,7 @@ static const gfx_layout x1_pcg_8x8 =
8*8
};
-MACHINE_START_MEMBER(x1_state,x1)
+void x1_state::machine_start()
{
/* set up RTC */
{
@@ -2217,7 +2217,6 @@ void x1_state::x1(machine_config &config)
ppi.out_pb_callback().set(FUNC(x1_state::x1_portb_w));
ppi.out_pc_callback().set(FUNC(x1_state::x1_portc_w));
- MCFG_MACHINE_START_OVERRIDE(x1_state,x1)
MCFG_MACHINE_RESET_OVERRIDE(x1_state,x1)
/* video hardware */
@@ -2237,8 +2236,6 @@ void x1_state::x1(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_x1);
- MCFG_VIDEO_START_OVERRIDE(x1_state,x1)
-
MB8877(config, m_fdc, MAIN_CLOCK / 16);
// TODO: guesswork, try to implicitly start the motor
m_fdc->hld_wr_callback().set(FUNC(x1_state::hdl_w));
diff --git a/src/mame/drivers/x1twin.cpp b/src/mame/drivers/x1twin.cpp
index 056201271c3..b0a07189520 100644
--- a/src/mame/drivers/x1twin.cpp
+++ b/src/mame/drivers/x1twin.cpp
@@ -436,7 +436,6 @@ void x1twin_state::x1twin(machine_config &config)
ppi.out_pb_callback().set(FUNC(x1_state::x1_portb_w));
ppi.out_pc_callback().set(FUNC(x1_state::x1_portc_w));
- MCFG_MACHINE_START_OVERRIDE(x1twin_state,x1)
MCFG_MACHINE_RESET_OVERRIDE(x1twin_state,x1)
#if 0
@@ -475,8 +474,6 @@ void x1twin_state::x1twin(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_x1);
- MCFG_VIDEO_START_OVERRIDE(x1twin_state,x1)
-
MB8877(config, m_fdc, MAIN_CLOCK / 16);
// TODO: guesswork, try to implicitly start the motor
m_fdc->hld_wr_callback().set(FUNC(x1_state::hdl_w));
diff --git a/src/mame/drivers/x68k.cpp b/src/mame/drivers/x68k.cpp
index 813c15760be..8478428a4c8 100644
--- a/src/mame/drivers/x68k.cpp
+++ b/src/mame/drivers/x68k.cpp
@@ -175,7 +175,7 @@ void x68k_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
m_hd63450->drq3_w(0);
break;
default:
- assert_always(false, "Unknown id in x68k_state::device_timer");
+ throw emu_fatalerror("Unknown id in x68k_state::device_timer");
}
}
diff --git a/src/mame/drivers/zrt80.cpp b/src/mame/drivers/zrt80.cpp
index b8c03b1e6d2..f008e38453f 100644
--- a/src/mame/drivers/zrt80.cpp
+++ b/src/mame/drivers/zrt80.cpp
@@ -86,7 +86,7 @@ void zrt80_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_beep->set_state(0);
break;
default:
- assert_always(false, "Unknown id in zrt80_state::device_timer");
+ throw emu_fatalerror("Unknown id in zrt80_state::device_timer");
}
}
diff --git a/src/mame/etc/opwolf_cchip.txt b/src/mame/etc/opwolf_cchip.txt
index 13904edc920..f56ac5242d7 100644
--- a/src/mame/etc/opwolf_cchip.txt
+++ b/src/mame/etc/opwolf_cchip.txt
@@ -496,7 +496,7 @@ void opwolf_state::device_timer(emu_timer &timer, device_timer_id id, int param,
cchip_timer(ptr, param);
break;
default:
- assert_always(false, "Unknown id in opwolf_state::device_timer");
+ throw emu_fatalerror("Unknown id in opwolf_state::device_timer");
}
}
diff --git a/src/mame/includes/ut88.h b/src/mame/includes/ut88.h
index e4dccb4b721..eb29fc92666 100644
--- a/src/mame/includes/ut88.h
+++ b/src/mame/includes/ut88.h
@@ -5,10 +5,11 @@
* includes/ut88.h
*
****************************************************************************/
-
#ifndef MAME_INCLUDES_UT88_H
#define MAME_INCLUDES_UT88_H
+#pragma once
+
#include "cpu/i8085/i8085.h"
#include "sound/dac.h"
#include "machine/i8255.h"
diff --git a/src/mame/includes/x1.h b/src/mame/includes/x1.h
index 621133ac9b6..f86a47784f5 100644
--- a/src/mame/includes/x1.h
+++ b/src/mame/includes/x1.h
@@ -134,9 +134,9 @@ public:
DECLARE_WRITE8_MEMBER(x1_portb_w);
DECLARE_WRITE8_MEMBER(x1_portc_w);
void init_x1_kanji();
- DECLARE_MACHINE_START(x1);
+ virtual void machine_start() override;
DECLARE_MACHINE_RESET(x1);
- DECLARE_VIDEO_START(x1);
+ virtual void video_start() override;
DECLARE_MACHINE_RESET(x1turbo);
uint32_t screen_update_x1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_INPUT_CHANGED_MEMBER(ipl_reset);
diff --git a/src/mame/machine/3dom2.cpp b/src/mame/machine/3dom2.cpp
index 245117ce0d5..c1bf1cec1c5 100644
--- a/src/mame/machine/3dom2.cpp
+++ b/src/mame/machine/3dom2.cpp
@@ -196,7 +196,7 @@ static void write_m2_reg(uint32_t &reg, uint32_t data, m2_reg_wmode mode)
case REG_SET: reg |= data; break;
case REG_CLEAR: reg &= ~data; break;
default:
- assert_always(false, "Bad register write mode");
+ throw emu_fatalerror("write_m2_reg: Bad register write mode");
}
}
@@ -1605,7 +1605,7 @@ void m2_cde_device::device_timer(emu_timer &timer, device_timer_id id, int param
break;
default:
- assert_always(false, "Unknown CDE timer ID");
+ throw emu_fatalerror("m2_cde_device::device_timer: Unknown CDE timer ID");
}
}
@@ -1947,7 +1947,7 @@ void m2_cde_device::start_dma(uint32_t ch)
if (dma_ch.m_cntl & CDE_DMA_DIRECTION)
{
// PowerBus to BioBus
- assert_always(false, "CDE PowerBus to BioBus DMA currently unsupported");
+ throw emu_fatalerror("m2_cde_device::start_dma: CDE PowerBus to BioBus DMA currently unsupported");
}
else
{
diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp
index 0449b71d391..690183b1583 100644
--- a/src/mame/machine/amstrad.cpp
+++ b/src/mame/machine/amstrad.cpp
@@ -235,7 +235,7 @@ void amstrad_state::device_timer(emu_timer &timer, device_timer_id id, int param
cb_set_resolution(ptr, param);
break;
default:
- assert_always(false, "Unknown id in amstrad_state::device_timer");
+ throw emu_fatalerror("Unknown id in amstrad_state::device_timer");
}
}
diff --git a/src/mame/machine/asic65.cpp b/src/mame/machine/asic65.cpp
index 5a41d76763c..6f9a021edd6 100644
--- a/src/mame/machine/asic65.cpp
+++ b/src/mame/machine/asic65.cpp
@@ -181,7 +181,7 @@ void asic65_device::device_timer(emu_timer &timer, device_timer_id id, int param
m_ourcpu->set_input_line(0, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in asic65_device::device_timer");
+ throw emu_fatalerror("Unknown id in asic65_device::device_timer");
}
}
diff --git a/src/mame/machine/bebox.cpp b/src/mame/machine/bebox.cpp
index f75af07d232..6c0cec83571 100644
--- a/src/mame/machine/bebox.cpp
+++ b/src/mame/machine/bebox.cpp
@@ -306,11 +306,12 @@ void bebox_state::bebox_set_irq_bit(unsigned int interrupt_bit, int val)
if (LOG_INTERRUPTS)
{
/* make sure that we don't shoot ourself in the foot */
- assert_always((interrupt_bit < ARRAY_LENGTH(interrupt_names)) && (interrupt_names[interrupt_bit] != nullptr), "Raising invalid interrupt");
+ if ((interrupt_bit >= ARRAY_LENGTH(interrupt_names)) || !interrupt_names[interrupt_bit])
+ throw emu_fatalerror("bebox_state::bebox_set_irq_bit: Raising invalid interrupt");
logerror("bebox_set_irq_bit(): pc[0]=0x%08x pc[1]=0x%08x %s interrupt #%u (%s)\n",
- (unsigned) m_ppc[0]->pc(),
- (unsigned) m_ppc[1]->pc(),
+ unsigned(m_ppc[0]->pc()),
+ unsigned(m_ppc[1]->pc()),
val ? "Asserting" : "Clearing",
interrupt_bit, interrupt_names[interrupt_bit]);
}
@@ -750,7 +751,7 @@ void bebox_state::device_timer(emu_timer &timer, device_timer_id id, int param,
case TIMER_GET_DEVICES:
break;
default:
- assert_always(false, "Unknown id in bebox_state::device_timer");
+ throw emu_fatalerror("Unknown id in bebox_state::device_timer");
}
}
diff --git a/src/mame/machine/bublbobl.cpp b/src/mame/machine/bublbobl.cpp
index f726f7d3fa9..c9d9f2c9ce2 100644
--- a/src/mame/machine/bublbobl.cpp
+++ b/src/mame/machine/bublbobl.cpp
@@ -135,7 +135,7 @@ void bublbobl_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_mcu->set_input_line(0, CLEAR_LINE);
break;
default:
- assert_always(false, "Unknown id in bublbobl_state::device_timer");
+ throw emu_fatalerror("Unknown id in bublbobl_state::device_timer");
}
}
diff --git a/src/mame/machine/dai.cpp b/src/mame/machine/dai.cpp
index a7864d4c398..a809984d668 100644
--- a/src/mame/machine/dai.cpp
+++ b/src/mame/machine/dai.cpp
@@ -31,7 +31,7 @@ void dai_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
timer_set(attotime::from_hz(100), TIMER_TMS5501);
break;
default:
- assert_always(false, "Unknown id in dai_state::device_timer");
+ throw emu_fatalerror("Unknown id in dai_state::device_timer");
}
}
diff --git a/src/mame/machine/electron.cpp b/src/mame/machine/electron.cpp
index 87d1056fdb4..19862d17e72 100644
--- a/src/mame/machine/electron.cpp
+++ b/src/mame/machine/electron.cpp
@@ -42,7 +42,7 @@ void electron_state::device_timer(emu_timer &timer, device_timer_id id, int para
electron_scanline_interrupt(ptr, param);
break;
default:
- assert_always(false, "Unknown id in electron_state::device_timer");
+ throw emu_fatalerror("Unknown id in electron_state::device_timer");
}
}
diff --git a/src/mame/machine/hpc3.cpp b/src/mame/machine/hpc3.cpp
index d5f0962848f..ca25c0d544b 100644
--- a/src/mame/machine/hpc3.cpp
+++ b/src/mame/machine/hpc3.cpp
@@ -248,7 +248,7 @@ void hpc3_device::device_timer(emu_timer &timer, device_timer_id id, int param,
LOGMASKED(LOG_UNKNOWN, "HPC3: Ignoring active PBUS DMA on channel %d\n", id - TIMER_PBUS_DMA);
break;
default:
- assert_always(false, "Unknown id in hpc3_device::device_timer");
+ throw emu_fatalerror("Unknown id in hpc3_device::device_timer");
}
}
diff --git a/src/mame/machine/kaneko_calc3.cpp b/src/mame/machine/kaneko_calc3.cpp
index 572fa89fdba..54078f5d297 100644
--- a/src/mame/machine/kaneko_calc3.cpp
+++ b/src/mame/machine/kaneko_calc3.cpp
@@ -104,7 +104,7 @@ void kaneko_calc3_device::device_timer(emu_timer &timer, device_timer_id id, int
reset_run_timer();
break;
default:
- assert_always(false, "Unknown id in kaneko_calc3_device::device_timer");
+ throw emu_fatalerror("Unknown id in kaneko_calc3_device::device_timer");
}
}
diff --git a/src/mame/machine/kaypro.cpp b/src/mame/machine/kaypro.cpp
index a2159d3212a..1bef83edaf0 100644
--- a/src/mame/machine/kaypro.cpp
+++ b/src/mame/machine/kaypro.cpp
@@ -201,7 +201,7 @@ void kaypro_state::device_timer(emu_timer &timer, device_timer_id id, int param,
break;
default:
- assert_always(false, "Unknown id in kaypro_state::device_timer");
+ throw emu_fatalerror("Unknown id in kaypro_state::device_timer");
}
}
diff --git a/src/mame/machine/lynx.cpp b/src/mame/machine/lynx.cpp
index 2ed5da8b021..d6fa79da37c 100644
--- a/src/mame/machine/lynx.cpp
+++ b/src/mame/machine/lynx.cpp
@@ -598,7 +598,7 @@ void lynx_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
lynx_uart_timer(ptr, param);
break;
default:
- assert_always(false, "Unknown id in lynx_state::device_timer");
+ throw emu_fatalerror("Unknown id in lynx_state::device_timer");
}
}
diff --git a/src/mame/machine/mbee.cpp b/src/mame/machine/mbee.cpp
index 35f338a8e2f..6a6d4fe49cd 100644
--- a/src/mame/machine/mbee.cpp
+++ b/src/mame/machine/mbee.cpp
@@ -24,7 +24,7 @@ void mbee_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
timer_newkb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in mbee_state::device_timer");
+ throw emu_fatalerror("Unknown id in mbee_state::device_timer");
}
}
diff --git a/src/mame/machine/micro3d.cpp b/src/mame/machine/micro3d.cpp
index 1eb182ea07f..e30e9361b5d 100644
--- a/src/mame/machine/micro3d.cpp
+++ b/src/mame/machine/micro3d.cpp
@@ -133,7 +133,7 @@ void micro3d_state::device_timer(emu_timer &timer, device_timer_id id, int param
mac_done_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in micro3d_state::device_timer");
+ throw emu_fatalerror("Unknown id in micro3d_state::device_timer");
}
}
diff --git a/src/mame/machine/mikro80.cpp b/src/mame/machine/mikro80.cpp
index 633c47481da..ad2d9299f0c 100644
--- a/src/mame/machine/mikro80.cpp
+++ b/src/mame/machine/mikro80.cpp
@@ -66,7 +66,7 @@ void mikro80_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_bank1->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in mikro80_state::device_timer");
+ throw emu_fatalerror("Unknown id in mikro80_state::device_timer");
}
}
diff --git a/src/mame/machine/nb1412m2.cpp b/src/mame/machine/nb1412m2.cpp
index f0216b886ff..ee9e49bc2c0 100644
--- a/src/mame/machine/nb1412m2.cpp
+++ b/src/mame/machine/nb1412m2.cpp
@@ -204,7 +204,7 @@ void nb1412m2_device::device_timer(emu_timer &timer, device_timer_id id, int par
break;
default:
- assert_always(false, "Unknown id in nb1412m2_device::device_timer");
+ throw emu_fatalerror("Unknown id in nb1412m2_device::device_timer");
}
}
diff --git a/src/mame/machine/nb1413m3.cpp b/src/mame/machine/nb1413m3.cpp
index aee884a0d3f..ad6083b0ba3 100644
--- a/src/mame/machine/nb1413m3.cpp
+++ b/src/mame/machine/nb1413m3.cpp
@@ -111,7 +111,7 @@ void nb1413m3_device::device_timer(emu_timer &timer, device_timer_id id, int par
timer_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in nb1413m3_device::device_timer");
+ throw emu_fatalerror("Unknown id in nb1413m3_device::device_timer");
}
}
diff --git a/src/mame/machine/pmd85.cpp b/src/mame/machine/pmd85.cpp
index 37cad7aef89..f3206e7be7e 100644
--- a/src/mame/machine/pmd85.cpp
+++ b/src/mame/machine/pmd85.cpp
@@ -639,7 +639,7 @@ void pmd85_state::device_timer(emu_timer &timer, device_timer_id id, int param,
pmd85_cassette_timer_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in pmd85_state::device_timer");
+ throw emu_fatalerror("Unknown id in pmd85_state::device_timer");
}
}
diff --git a/src/mame/machine/pocketc.cpp b/src/mame/machine/pocketc.cpp
index 6afa6a5c84e..528084a5dbb 100644
--- a/src/mame/machine/pocketc.cpp
+++ b/src/mame/machine/pocketc.cpp
@@ -22,7 +22,7 @@ void pocketc_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_power = 0;
break;
default:
- assert_always(false, "Unknown id in pocketc_state::device_timer");
+ throw emu_fatalerror("Unknown id in pocketc_state::device_timer");
}
}
diff --git a/src/mame/machine/radio86.cpp b/src/mame/machine/radio86.cpp
index f15da84afdc..fb203b68101 100644
--- a/src/mame/machine/radio86.cpp
+++ b/src/mame/machine/radio86.cpp
@@ -137,7 +137,7 @@ void radio86_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_bank1->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in radio86_state::device_timer");
+ throw emu_fatalerror("Unknown id in radio86_state::device_timer");
}
}
diff --git a/src/mame/machine/snes.cpp b/src/mame/machine/snes.cpp
index 0e232318516..b5982d73803 100644
--- a/src/mame/machine/snes.cpp
+++ b/src/mame/machine/snes.cpp
@@ -69,7 +69,7 @@ void snes_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
snes_hblank_tick(ptr, param);
break;
default:
- assert_always(false, "Unknown id in snes_state::device_timer");
+ throw emu_fatalerror("Unknown id in snes_state::device_timer");
}
}
diff --git a/src/mame/machine/sorcerer.cpp b/src/mame/machine/sorcerer.cpp
index 7752f4eba09..65cbdf6e1d7 100644
--- a/src/mame/machine/sorcerer.cpp
+++ b/src/mame/machine/sorcerer.cpp
@@ -42,7 +42,7 @@ void sorcerer_state::device_timer(emu_timer &timer, device_timer_id id, int para
sorcerer_reset(ptr, param);
break;
default:
- assert_always(false, "Unknown id in sorcerer_state::device_timer");
+ throw emu_fatalerror("Unknown id in sorcerer_state::device_timer");
}
}
diff --git a/src/mame/machine/special.cpp b/src/mame/machine/special.cpp
index 92511b9d6a2..bd971917260 100644
--- a/src/mame/machine/special.cpp
+++ b/src/mame/machine/special.cpp
@@ -119,14 +119,12 @@ void special_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_bank1->set_entry(0);
break;
case TIMER_PIT8253_GATES:
- {
m_pit->write_gate0(0);
m_pit->write_gate1(0);
m_pit->write_gate2(0);
break;
- }
default:
- assert_always(false, "Unknown id in special_state::device_timer");
+ throw emu_fatalerror("Unknown id in special_state::device_timer");
}
}
diff --git a/src/mame/machine/stfight.cpp b/src/mame/machine/stfight.cpp
index 18968dcd63e..2b6afd21814 100644
--- a/src/mame/machine/stfight.cpp
+++ b/src/mame/machine/stfight.cpp
@@ -125,7 +125,7 @@ void stfight_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80
break;
default:
- assert_always(false, "Unknown id in stfight_state::device_timer");
+ throw emu_fatalerror("Unknown id in stfight_state::device_timer");
}
}
diff --git a/src/mame/machine/ut88.cpp b/src/mame/machine/ut88.cpp
index 712a2683e57..0f7b2c09d14 100644
--- a/src/mame/machine/ut88.cpp
+++ b/src/mame/machine/ut88.cpp
@@ -48,7 +48,7 @@ void ut88_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
timer_set(attotime::from_hz(60), TIMER_UPDATE_DISPLAY);
break;
default:
- assert_always(false, "Unknown id in ut88_state::device_timer");
+ throw emu_fatalerror("Unknown id in ut88_state::device_timer");
}
}
diff --git a/src/mame/video/3dom2_te.cpp b/src/mame/video/3dom2_te.cpp
index a8a0f33ec56..a75062e144d 100644
--- a/src/mame/video/3dom2_te.cpp
+++ b/src/mame/video/3dom2_te.cpp
@@ -555,22 +555,16 @@ static void write_te_reg(uint32_t &reg, uint32_t data, m2_te_device::te_reg_wmod
switch (mode)
{
case m2_te_device::REG_WRITE:
- {
reg = data;
break;
- }
case m2_te_device::REG_SET:
- {
reg |= data;
break;
- }
case m2_te_device::REG_CLEAR:
- {
reg &= ~data;
break;
- }
default:
- assert_always(false, "Bad register write mode");
+ throw emu_fatalerror("write_te_reg: Bad register write mode");
}
}
@@ -1569,7 +1563,7 @@ void m2_te_device::walk_edges(uint32_t wrange)
if (scan_lr ^ (m_es.x1 < m_es.x2))
{
// TODO: Is this possible?
- assert_always(false, "SPECIAL CASE: WHAT DO?");
+ throw emu_fatalerror("m2_te_device::walk_edges: SPECIAL CASE: WHAT DO?");
r = m_es.r1; // Where do the colors come from?
g = m_es.g1;
b = m_es.b1;
diff --git a/src/mame/video/astrocde.cpp b/src/mame/video/astrocde.cpp
index f1dd0621e99..74a48a24821 100644
--- a/src/mame/video/astrocde.cpp
+++ b/src/mame/video/astrocde.cpp
@@ -391,7 +391,7 @@ void astrocde_state::device_timer(emu_timer &timer, device_timer_id id, int para
scanline_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in astrocde_state::device_timer");
+ throw emu_fatalerror("Unknown id in astrocde_state::device_timer");
}
}
diff --git a/src/mame/video/cchasm.cpp b/src/mame/video/cchasm.cpp
index 9aa48af8bca..e515db965c8 100644
--- a/src/mame/video/cchasm.cpp
+++ b/src/mame/video/cchasm.cpp
@@ -27,7 +27,7 @@ void cchasm_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(2, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in cchasm_state::device_timer");
+ throw emu_fatalerror("Unknown id in cchasm_state::device_timer");
}
}
diff --git a/src/mame/video/cps1.cpp b/src/mame/video/cps1.cpp
index e489a7f925d..e3a033618f2 100644
--- a/src/mame/video/cps1.cpp
+++ b/src/mame/video/cps1.cpp
@@ -2293,7 +2293,8 @@ void cps_state::video_start()
m_cps_a_regs[CPS1_OTHER_BASE] = 0x9100;
/* This should never be hit, since game_config is set in machine_reset */
- assert_always(m_game_config, "state_game_config hasn't been set up yet");
+ if (!m_game_config)
+ throw emu_fatalerror("cps_state::video_start: m_game_config hasn't been set up yet");
/* Set up old base */
diff --git a/src/mame/video/dcheese.cpp b/src/mame/video/dcheese.cpp
index f7a82d589aa..17fc90b3993 100644
--- a/src/mame/video/dcheese.cpp
+++ b/src/mame/video/dcheese.cpp
@@ -75,7 +75,7 @@ void dcheese_state::device_timer(emu_timer &timer, device_timer_id id, int param
signal_irq(param);
break;
default:
- assert_always(false, "Unknown id in dcheese_state::device_timer");
+ throw emu_fatalerror("Unknown id in dcheese_state::device_timer");
}
}
diff --git a/src/mame/video/exidy.cpp b/src/mame/video/exidy.cpp
index 01a7ee98540..1b68ef99838 100644
--- a/src/mame/video/exidy.cpp
+++ b/src/mame/video/exidy.cpp
@@ -270,7 +270,7 @@ void exidy_state::device_timer(emu_timer &timer, device_timer_id id, int param,
break;
default:
- assert_always(false, "Unknown id in exidy_state::device_timer");
+ throw emu_fatalerror("Unknown id in exidy_state::device_timer");
}
}
diff --git a/src/mame/video/gameplan.cpp b/src/mame/video/gameplan.cpp
index b7214ac02e2..aecd079a48c 100644
--- a/src/mame/video/gameplan.cpp
+++ b/src/mame/video/gameplan.cpp
@@ -48,7 +48,7 @@ void gameplan_state::device_timer(emu_timer &timer, device_timer_id id, int para
via_irq_delayed(ptr, param);
break;
default:
- assert_always(false, "Unknown id in gameplan_state::device_timer");
+ throw emu_fatalerror("Unknown id in gameplan_state::device_timer");
}
}
diff --git a/src/mame/video/gp9001.cpp b/src/mame/video/gp9001.cpp
index 8ff056fd14c..78bd3202e8e 100644
--- a/src/mame/video/gp9001.cpp
+++ b/src/mame/video/gp9001.cpp
@@ -883,6 +883,6 @@ void gp9001vdp_device::device_timer(emu_timer &timer, device_timer_id id, int pa
m_vint_out_cb(1);
break;
default:
- assert_always(false, "Unknown id in gp9001vdp_device::device_timer");
+ throw emu_fatalerror("Unknown id in gp9001vdp_device::device_timer");
}
}
diff --git a/src/mame/video/hyhoo.cpp b/src/mame/video/hyhoo.cpp
index 2651ee5f620..9c225f3bbd2 100644
--- a/src/mame/video/hyhoo.cpp
+++ b/src/mame/video/hyhoo.cpp
@@ -61,7 +61,7 @@ void hyhoo_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in hyhoo_state::device_timer");
+ throw emu_fatalerror("Unknown id in hyhoo_state::device_timer");
}
}
diff --git a/src/mame/video/lethalj.cpp b/src/mame/video/lethalj.cpp
index f3b836b7b3e..73e9dad414c 100644
--- a/src/mame/video/lethalj.cpp
+++ b/src/mame/video/lethalj.cpp
@@ -110,7 +110,7 @@ void lethalj_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->set_input_line(0, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in lethalj_state::device_timer");
+ throw emu_fatalerror("Unknown id in lethalj_state::device_timer");
}
}
diff --git a/src/mame/video/m92.cpp b/src/mame/video/m92.cpp
index 3e4c6475ef8..4b3ca83cb40 100644
--- a/src/mame/video/m92.cpp
+++ b/src/mame/video/m92.cpp
@@ -55,7 +55,7 @@ void m92_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
m_upd71059c->ir1_w(1);
break;
default:
- assert_always(false, "Unknown id in m92_state::device_timer");
+ throw emu_fatalerror("Unknown id in m92_state::device_timer");
}
}
diff --git a/src/mame/video/mcr.cpp b/src/mame/video/mcr.cpp
index 46dddafaca5..87c72395cd3 100644
--- a/src/mame/video/mcr.cpp
+++ b/src/mame/video/mcr.cpp
@@ -111,7 +111,7 @@ void mcr_state::video_start()
break;
default:
- assert_always(0, "Unknown mcr board");
+ throw emu_fatalerror("mcr_state::video_start: Unknown mcr board");
break;
}
}
diff --git a/src/mame/video/midtunit.cpp b/src/mame/video/midtunit.cpp
index b307f3f722b..8bf3e3510b7 100644
--- a/src/mame/video/midtunit.cpp
+++ b/src/mame/video/midtunit.cpp
@@ -625,7 +625,7 @@ void midtunit_video_device::device_timer(emu_timer &timer, device_timer_id id, i
m_maincpu->set_input_line(0, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in midtunit_video_device::device_timer");
+ throw emu_fatalerror("Unknown id in midtunit_video_device::device_timer");
}
}
diff --git a/src/mame/video/midvunit.cpp b/src/mame/video/midvunit.cpp
index 03db5f9dc9d..2cc60de8c5e 100644
--- a/src/mame/video/midvunit.cpp
+++ b/src/mame/video/midvunit.cpp
@@ -44,7 +44,7 @@ void midvunit_state::device_timer(emu_timer &timer, device_timer_id id, int para
scanline_timer_cb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in midvunit_state::device_timer");
+ throw emu_fatalerror("Unknown id in midvunit_state::device_timer");
}
}
diff --git a/src/mame/video/midyunit.cpp b/src/mame/video/midyunit.cpp
index 9a6edb55e19..123fef5ca2b 100644
--- a/src/mame/video/midyunit.cpp
+++ b/src/mame/video/midyunit.cpp
@@ -372,7 +372,7 @@ void midyunit_state::device_timer(emu_timer &timer, device_timer_id id, int para
autoerase_line(ptr, param);
break;
default:
- assert_always(false, "Unknown id in midyunit_state::device_timer");
+ throw emu_fatalerror("Unknown id in midyunit_state::device_timer");
}
}
diff --git a/src/mame/video/nbmj8688.cpp b/src/mame/video/nbmj8688.cpp
index 551ca396cbc..95da1eb067d 100644
--- a/src/mame/video/nbmj8688.cpp
+++ b/src/mame/video/nbmj8688.cpp
@@ -269,7 +269,7 @@ void nbmj8688_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in nbmj8688_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj8688_state::device_timer");
}
}
diff --git a/src/mame/video/nbmj8891.cpp b/src/mame/video/nbmj8891.cpp
index ad1311f0171..c1bddc325cb 100644
--- a/src/mame/video/nbmj8891.cpp
+++ b/src/mame/video/nbmj8891.cpp
@@ -313,7 +313,7 @@ void nbmj8891_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in nbmj8891_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj8891_state::device_timer");
}
}
diff --git a/src/mame/video/nbmj8900.cpp b/src/mame/video/nbmj8900.cpp
index 2323c301ce6..ad9c1e021fc 100644
--- a/src/mame/video/nbmj8900.cpp
+++ b/src/mame/video/nbmj8900.cpp
@@ -205,7 +205,7 @@ void nbmj8900_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in nbmj8900_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj8900_state::device_timer");
}
}
diff --git a/src/mame/video/nbmj8991.cpp b/src/mame/video/nbmj8991.cpp
index b0b818eba05..01bf4149d1c 100644
--- a/src/mame/video/nbmj8991.cpp
+++ b/src/mame/video/nbmj8991.cpp
@@ -173,7 +173,7 @@ void nbmj8991_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in nbmj8991_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj8991_state::device_timer");
}
}
diff --git a/src/mame/video/nbmj9195.cpp b/src/mame/video/nbmj9195.cpp
index 06d5cb5c6c8..2478f0eb781 100644
--- a/src/mame/video/nbmj9195.cpp
+++ b/src/mame/video/nbmj9195.cpp
@@ -187,7 +187,7 @@ void nbmj9195_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb19010_busyflag = 1;
break;
default:
- assert_always(false, "Unknown id in nbmj9195_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj9195_state::device_timer");
}
}
diff --git a/src/mame/video/niyanpai.cpp b/src/mame/video/niyanpai.cpp
index a590d466292..5408856dbc1 100644
--- a/src/mame/video/niyanpai.cpp
+++ b/src/mame/video/niyanpai.cpp
@@ -170,7 +170,7 @@ void niyanpai_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb19010_busyflag = 1;
break;
default:
- assert_always(false, "Unknown id in niyanpai_state::device_timer");
+ throw emu_fatalerror("Unknown id in niyanpai_state::device_timer");
}
}
diff --git a/src/mame/video/pastelg.cpp b/src/mame/video/pastelg.cpp
index d7cd8bf77df..c04df9fc244 100644
--- a/src/mame/video/pastelg.cpp
+++ b/src/mame/video/pastelg.cpp
@@ -147,7 +147,7 @@ void pastelg_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in pastelg_state::device_timer");
+ throw emu_fatalerror("Unknown id in pastelg_state::device_timer");
}
}
diff --git a/src/mame/video/powervr2.cpp b/src/mame/video/powervr2.cpp
index 890490c5c64..86a9f038bfc 100644
--- a/src/mame/video/powervr2.cpp
+++ b/src/mame/video/powervr2.cpp
@@ -1486,7 +1486,7 @@ WRITE32_MEMBER( powervr2_device::ta_list_init_w )
}
if (grabsel < 0)
- assert_always(0, "TA grabber error B!\n");
+ throw emu_fatalerror("powervr2_device::ta_list_init_w: TA grabber error B!");
grabsellast=grabsel;
grab[grabsel].ispbase=ta_isp_base;
grab[grabsel].busy=0;
diff --git a/src/mame/video/segag80r.cpp b/src/mame/video/segag80r.cpp
index af00f8240f1..f1af8355cdf 100644
--- a/src/mame/video/segag80r.cpp
+++ b/src/mame/video/segag80r.cpp
@@ -29,7 +29,7 @@ void segag80r_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_vblank_latch = 0;
break;
default:
- assert_always(false, "Unknown id in segag80r_state::device_timer");
+ throw emu_fatalerror("Unknown id in segag80r_state::device_timer");
}
}
diff --git a/src/mame/video/segag80v.cpp b/src/mame/video/segag80v.cpp
index d3731bb37e5..110930e5973 100644
--- a/src/mame/video/segag80v.cpp
+++ b/src/mame/video/segag80v.cpp
@@ -325,7 +325,8 @@ void segag80v_state::sega_generate_vector_list()
void segag80v_state::video_start()
{
- assert_always(m_vectorram.bytes() != 0, "vectorram==0");
+ if (!m_vectorram.bytes())
+ throw emu_fatalerror("segag80v_state::video_start: !vectorram.bytes()");
m_min_x =m_screen->visible_area().min_x;
m_min_y =m_screen->visible_area().min_y;
diff --git a/src/mame/video/tank8.cpp b/src/mame/video/tank8.cpp
index 0507640e84a..e0919d373fd 100644
--- a/src/mame/video/tank8.cpp
+++ b/src/mame/video/tank8.cpp
@@ -175,7 +175,7 @@ void tank8_state::device_timer(emu_timer &timer, device_timer_id id, int param,
set_collision(param);
break;
default:
- assert_always(false, "Unknown id in tank8_state::device_timer");
+ throw emu_fatalerror("Unknown id in tank8_state::device_timer");
}
}
diff --git a/src/mame/video/triplhnt.cpp b/src/mame/video/triplhnt.cpp
index 922ab970b19..b211a167460 100644
--- a/src/mame/video/triplhnt.cpp
+++ b/src/mame/video/triplhnt.cpp
@@ -43,7 +43,7 @@ void triplhnt_state::device_timer(emu_timer &timer, device_timer_id id, int para
set_collision(param);
break;
default:
- assert_always(false, "Unknown id in triplhnt_state::device_timer");
+ throw emu_fatalerror("Unknown id in triplhnt_state::device_timer");
}
}
diff --git a/src/mame/video/x1.cpp b/src/mame/video/x1.cpp
index dc872754dd8..69bc60cc4fa 100644
--- a/src/mame/video/x1.cpp
+++ b/src/mame/video/x1.cpp
@@ -19,7 +19,7 @@
*
*************************************/
-VIDEO_START_MEMBER(x1_state,x1)
+void x1_state::video_start()
{
m_gfx_bitmap_ram = make_unique_clear<uint8_t[]>(0xc000*2);
m_bitmapbank->configure_entries(0, 2, m_gfx_bitmap_ram.get(), 0xc000);
diff --git a/src/mame/video/zx.cpp b/src/mame/video/zx.cpp
index c3c7904861f..755c2eb8b8b 100644
--- a/src/mame/video/zx.cpp
+++ b/src/mame/video/zx.cpp
@@ -33,7 +33,7 @@ void zx_state::device_timer(emu_timer &timer, device_timer_id id, int param, voi
zx_ula_hsync();
break;
default:
- assert_always(false, "Unknown id in zx_state::device_timer");
+ throw emu_fatalerror("Unknown id in zx_state::device_timer");
}
}