summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/diexec.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-01-20 21:42:13 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-01-20 21:42:13 +0100
commit4e8e3066f847cc0fa11539f4d9ab8a63f70ca475 (patch)
tree25d48b50f2b89dd5b9e7dbbfeeb85c534ec6852a /src/emu/diexec.cpp
parent3a8ccb89b426509be06089a19c51ecf55567ed1b (diff)
reverting:
SHA-1: 1f90ceab075c4869298e963bf0a14a0aac2f1caa * tags are now strings (nw) fix start project for custom builds in Visual Studio (nw)
Diffstat (limited to 'src/emu/diexec.cpp')
-rw-r--r--src/emu/diexec.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/emu/diexec.cpp b/src/emu/diexec.cpp
index d0434d8638b..7b4b530f75b 100644
--- a/src/emu/diexec.cpp
+++ b/src/emu/diexec.cpp
@@ -44,6 +44,7 @@ const int TRIGGER_SUSPENDTIME = -4000;
device_execute_interface::device_execute_interface(const machine_config &mconfig, device_t &device)
: device_interface(device, "execute"),
m_disabled(false),
+ m_vblank_interrupt_screen(nullptr),
m_timed_interrupt_period(attotime::zero),
m_is_octal(false),
m_nextexec(nullptr),
@@ -89,7 +90,7 @@ void device_execute_interface::static_set_disable(device_t &device)
{
device_execute_interface *exec;
if (!device.interface(exec))
- throw emu_fatalerror("MCFG_DEVICE_DISABLE called on device '%s' with no execute interface", device.tag().c_str());
+ throw emu_fatalerror("MCFG_DEVICE_DISABLE called on device '%s' with no execute interface", device.tag());
exec->m_disabled = true;
}
@@ -99,11 +100,11 @@ void device_execute_interface::static_set_disable(device_t &device)
// to set up VBLANK interrupts on the device
//-------------------------------------------------
-void device_execute_interface::static_set_vblank_int(device_t &device, device_interrupt_delegate function, std::string tag, int rate)
+void device_execute_interface::static_set_vblank_int(device_t &device, device_interrupt_delegate function, const char *tag, int rate)
{
device_execute_interface *exec;
if (!device.interface(exec))
- throw emu_fatalerror("MCFG_DEVICE_VBLANK_INT called on device '%s' with no execute interface", device.tag().c_str());
+ throw emu_fatalerror("MCFG_DEVICE_VBLANK_INT called on device '%s' with no execute interface", device.tag());
exec->m_vblank_interrupt = function;
exec->m_vblank_interrupt_screen = tag;
}
@@ -118,7 +119,7 @@ void device_execute_interface::static_set_periodic_int(device_t &device, device_
{
device_execute_interface *exec;
if (!device.interface(exec))
- throw emu_fatalerror("MCFG_DEVICE_PERIODIC_INT called on device '%s' with no execute interface", device.tag().c_str());
+ throw emu_fatalerror("MCFG_DEVICE_PERIODIC_INT called on device '%s' with no execute interface", device.tag());
exec->m_timed_interrupt = function;
exec->m_timed_interrupt_period = rate;
}
@@ -133,7 +134,7 @@ void device_execute_interface::static_set_irq_acknowledge_callback(device_t &dev
{
device_execute_interface *exec;
if (!device.interface(exec))
- throw emu_fatalerror("MCFG_DEVICE_IRQ_ACKNOWLEDGE called on device '%s' with no execute interface", device.tag().c_str());
+ throw emu_fatalerror("MCFG_DEVICE_IRQ_ACKNOWLEDGE called on device '%s' with no execute interface", device.tag());
exec->m_driver_irq = callback;
}
@@ -237,7 +238,7 @@ void device_execute_interface::suspend_resume_changed()
void device_execute_interface::suspend(UINT32 reason, bool eatcycles)
{
-if (TEMPLOG) printf("suspend %s (%X)\n", device().tag().c_str(), reason);
+if (TEMPLOG) printf("suspend %s (%X)\n", device().tag(), reason);
// set the suspend reason and eat cycles flag
m_nextsuspend |= reason;
m_nexteatcycles = eatcycles;
@@ -252,7 +253,7 @@ if (TEMPLOG) printf("suspend %s (%X)\n", device().tag().c_str(), reason);
void device_execute_interface::resume(UINT32 reason)
{
-if (TEMPLOG) printf("resume %s (%X)\n", device().tag().c_str(), reason);
+if (TEMPLOG) printf("resume %s (%X)\n", device().tag(), reason);
// clear the suspend reason and eat cycles flag
m_nextsuspend &= ~reason;
suspend_resume_changed();
@@ -450,8 +451,8 @@ void device_execute_interface::interface_validity_check(validity_checker &valid)
screen_device_iterator iter(device().mconfig().root_device());
if (iter.first() == nullptr)
osd_printf_error("VBLANK interrupt specified, but the driver is screenless\n");
- else if (!m_vblank_interrupt_screen.empty() && device().siblingdevice(m_vblank_interrupt_screen) == nullptr)
- osd_printf_error("VBLANK interrupt references a non-existant screen tag '%s'\n", m_vblank_interrupt_screen.c_str());
+ else if (m_vblank_interrupt_screen != nullptr && device().siblingdevice(m_vblank_interrupt_screen) == nullptr)
+ osd_printf_error("VBLANK interrupt references a non-existant screen tag '%s'\n", m_vblank_interrupt_screen);
}
if (!m_timed_interrupt.isnull() && m_timed_interrupt_period == attotime::zero)
@@ -543,10 +544,10 @@ void device_execute_interface::interface_post_reset()
elem.reset();
// reconfingure VBLANK interrupts
- if (!m_vblank_interrupt_screen.empty())
+ if (m_vblank_interrupt_screen != nullptr)
{
// get the screen that will trigger the VBLANK
- screen_device *screen = downcast<screen_device *>(device().machine().device(device().siblingtag(m_vblank_interrupt_screen)));
+ screen_device *screen = downcast<screen_device *>(device().machine().device(device().siblingtag(m_vblank_interrupt_screen).c_str()));
assert(screen != nullptr);
screen->register_vblank_callback(vblank_state_delegate(FUNC(device_execute_interface::on_vblank), this));
@@ -615,7 +616,7 @@ int device_execute_interface::standard_irq_callback(int irqline)
// get the default vector and acknowledge the interrupt if needed
int vector = m_input[irqline].default_irq_callback();
- if (VERBOSE) device().logerror("standard_irq_callback('%s', %d) $%04x\n", device().tag().c_str(), irqline, vector);
+ if (VERBOSE) device().logerror("standard_irq_callback('%s', %d) $%04x\n", device().tag(), irqline, vector);
// if there's a driver callback, run it to get the vector
if (!m_driver_irq.isnull())
@@ -759,9 +760,9 @@ void device_execute_interface::device_input::reset()
void device_execute_interface::device_input::set_state_synced(int state, int vector)
{
- LOG(("set_state_synced('%s',%d,%d,%02x)\n", m_execute->device().tag().c_str(), m_linenum, state, vector));
+ LOG(("set_state_synced('%s',%d,%d,%02x)\n", m_execute->device().tag(), m_linenum, state, vector));
-if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag().c_str(), m_linenum, state, (vector == USE_STORED_VECTOR) ? 0 : vector);
+if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag(), m_linenum, state, (vector == USE_STORED_VECTOR) ? 0 : vector);
assert(state == ASSERT_LINE || state == HOLD_LINE || state == CLEAR_LINE || state == PULSE_LINE);
// treat PULSE_LINE as ASSERT+CLEAR
@@ -769,7 +770,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag().c_str(),
{
// catch errors where people use PULSE_LINE for devices that don't support it
if (m_linenum != INPUT_LINE_NMI && m_linenum != INPUT_LINE_RESET)
- throw emu_fatalerror("device '%s': PULSE_LINE can only be used for NMI and RESET lines\n", m_execute->device().tag().c_str());
+ throw emu_fatalerror("device '%s': PULSE_LINE can only be used for NMI and RESET lines\n", m_execute->device().tag());
set_state_synced(ASSERT_LINE, vector);
set_state_synced(CLEAR_LINE, vector);
@@ -783,7 +784,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag().c_str(),
m_qindex--;
empty_event_queue();
event_index = m_qindex++;
- m_execute->device().logerror("Exceeded pending input line event queue on device '%s'!\n", m_execute->device().tag().c_str());
+ m_execute->device().logerror("Exceeded pending input line event queue on device '%s'!\n", m_execute->device().tag());
}
// enqueue the event
@@ -811,7 +812,7 @@ TIMER_CALLBACK( device_execute_interface::device_input::static_empty_event_queue
void device_execute_interface::device_input::empty_event_queue()
{
-if (TEMPLOG) printf("empty_queue(%s,%d,%d)\n", m_execute->device().tag().c_str(), m_linenum, m_qindex);
+if (TEMPLOG) printf("empty_queue(%s,%d,%d)\n", m_execute->device().tag(), m_linenum, m_qindex);
// loop over all events
for (int curevent = 0; curevent < m_qindex; curevent++)
{
@@ -867,7 +868,7 @@ if (TEMPLOG) printf(" (%d,%d)\n", m_curstate, m_curvector);
break;
default:
- m_execute->device().logerror("empty_event_queue device '%s', line %d, unknown state %d\n", m_execute->device().tag().c_str(), m_linenum, m_curstate);
+ m_execute->device().logerror("empty_event_queue device '%s', line %d, unknown state %d\n", m_execute->device().tag(), m_linenum, m_curstate);
break;
}
@@ -894,7 +895,7 @@ int device_execute_interface::device_input::default_irq_callback()
// if the IRQ state is HOLD_LINE, clear it
if (m_curstate == HOLD_LINE)
{
- LOG(("->set_irq_line('%s',%d,%d)\n", m_execute->device().tag().c_str(), m_linenum, CLEAR_LINE));
+ LOG(("->set_irq_line('%s',%d,%d)\n", m_execute->device().tag(), m_linenum, CLEAR_LINE));
m_execute->execute_set_input(m_linenum, CLEAR_LINE);
m_curstate = CLEAR_LINE;
}