summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-06-14 07:40:06 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-06-14 07:40:06 +0000
commit8c2c643a7ec0e0f3acc3657abc2a1103fa847c0e (patch)
treed5d4764753be3611554c592630fee4be34848444
parentc06fe0e3f71db0b8682a142e4e4f4792f0f68d5d (diff)
Regression fixes:
atarijsa.c: just use a generic device for the tms5220 to handle variants until we have a proper base class (fixes eprom, eprom2 - eprom.c "assert: src/emu/emucore.h:328: dynamic_cast<_Dest>(src) == src") decocass.c: invert sense of reset line to MCU (fixes All sets in decocass.c - Games no longer begin loading (countdown)) metro.c: use generic device for the YM sound since multiple YM chips are used. (fixes 3kokushi, blzntrnd, dharma, dharmak, dokyusei, dokyusp, gstrik2, gstrik2j, karatour, ladykill, lastfort, lastforte, lastforte, lastfortg, lastfortk, skyalert, toride2g, toride2gg, toride2j - metro.c "assert: src/emu/emucore.h:328: dynamic_cast<_Dest>(src) == src") mitchell.c: when swapping the OKIM6295 for an MSM5205, use a different tag. (fixes pangba, spangbl - mitchell.c "assert: src/emu/emucore.h:328: dynamic_cast<_Dest>(src) == src") deco32.c: use a proper EEPROM device to fetch the space from. (fixes tattass, tattassa - deco32.c - Crash while checking "Jack Ram" before start "assert: src/emu/emucore.h:328: dynamic_cast<_Dest>(src) == src") system1.c: use a proper z80pio_device (cleanup) vconv.c: support -g* options for MSVC builds (cleanup) m377101.c/g65816.c: fix fault logic for mapping icount (fixes All sets in namcofl.c, namcona1.c, namconb1.c, nss.c, sfcbox.c, snesb.c airco22b, cybrcycc, dirtdash, rrf, timecrs, timecrsa - namcos22.c Hanging immediately or shortly after start. "assert: src/emu/schedule.c:189: ran >= *exec->m_icount") schedule.c/diexec.c/timer.c: add temporary logging to permit direct comparisons with earlier games timing (cleanup) generic.c: fix computation of time for turning off the IRQ when using generic_pulse_irq() to account for CPU-local time (fixes Any sets in bublbobl.c which use the which use m6801 - Frequent/Random watchdog resets.) z80pio.c: convert internal line states to bool, and fix typo (control_write should have been data_write in one place) (fixes Any system1.c games which use z80pio - No sound)
-rw-r--r--src/emu/cpu/g65816/g65816.c3
-rw-r--r--src/emu/cpu/m37710/m37710.c3
-rw-r--r--src/emu/diexec.c7
-rw-r--r--src/emu/machine/generic.c9
-rw-r--r--src/emu/machine/z80pio.c115
-rw-r--r--src/emu/machine/z80pio.h25
-rw-r--r--src/emu/schedule.c23
-rw-r--r--src/emu/timer.c8
-rw-r--r--src/mame/audio/atarijsa.c4
-rw-r--r--src/mame/drivers/deco32.c3
-rw-r--r--src/mame/drivers/mitchell.c6
-rw-r--r--src/mame/drivers/system1.c10
-rw-r--r--src/mame/includes/metro.h4
-rw-r--r--src/mame/machine/decocass.c2
-rw-r--r--src/osd/windows/vconv.c2
15 files changed, 136 insertions, 88 deletions
diff --git a/src/emu/cpu/g65816/g65816.c b/src/emu/cpu/g65816/g65816.c
index 75dadb40e9d..5d641075998 100644
--- a/src/emu/cpu/g65816/g65816.c
+++ b/src/emu/cpu/g65816/g65816.c
@@ -249,7 +249,8 @@ static CPU_EXECUTE( g65816 )
{
g65816i_cpu_struct *cpustate = get_safe_token(device);
- cpustate->ICount = FTABLE_EXECUTE(cpustate, cpustate->ICount);
+ int clocks = cpustate->ICount;
+ cpustate->ICount = clocks - FTABLE_EXECUTE(cpustate, cpustate->ICount);
}
diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c
index 4475c548c0b..9ad5a8b4a35 100644
--- a/src/emu/cpu/m37710/m37710.c
+++ b/src/emu/cpu/m37710/m37710.c
@@ -817,7 +817,8 @@ static CPU_EXECUTE( m37710 )
m37710i_update_irqs(m37710);
- m37710->ICount = m37710->execute(m37710, m37710->ICount);
+ int clocks = m37710->ICount;
+ m37710->ICount = clocks - m37710->execute(m37710, m37710->ICount);
}
diff --git a/src/emu/diexec.c b/src/emu/diexec.c
index 147f04b357d..731fa4d6eef 100644
--- a/src/emu/diexec.c
+++ b/src/emu/diexec.c
@@ -50,6 +50,8 @@
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
+#define TEMPLOG 0
+
//**************************************************************************
@@ -390,6 +392,7 @@ void device_execute_interface::set_irq_callback(device_irq_callback callback)
void device_execute_interface::suspend(UINT32 reason, bool eatcycles)
{
+if (TEMPLOG) printf("suspend %s (%X)\n", device().tag(), reason);
// set the suspend reason and eat cycles flag
m_nextsuspend |= reason;
m_nexteatcycles = eatcycles;
@@ -406,6 +409,7 @@ void device_execute_interface::suspend(UINT32 reason, bool eatcycles)
void device_execute_interface::resume(UINT32 reason)
{
+if (TEMPLOG) printf("resume %s (%X)\n", device().tag(), reason);
// clear the suspend reason and eat cycles flag
m_nextsuspend &= ~reason;
@@ -868,6 +872,7 @@ void device_execute_interface::device_input::set_state_synced(int state, int vec
{
LOG(("set_state_synced('%s',%d,%d,%02x)\n", m_device->tag(), m_linenum, state, vector));
+if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_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
@@ -917,6 +922,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_device->tag(), m_linenum, m_qindex);
// loop over all events
for (int curevent = 0; curevent < m_qindex; curevent++)
{
@@ -925,6 +931,7 @@ void device_execute_interface::device_input::empty_event_queue()
// set the input line state and vector
m_curstate = input_event & 0xff;
m_curvector = input_event >> 8;
+if (TEMPLOG) printf(" (%d,%d)\n", m_curstate, m_curvector);
assert(m_curstate == ASSERT_LINE || m_curstate == HOLD_LINE || m_curstate == CLEAR_LINE);
diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c
index 806a2b29264..25cfd8f37ab 100644
--- a/src/emu/machine/generic.c
+++ b/src/emu/machine/generic.c
@@ -674,7 +674,8 @@ void generic_pulse_irq_line(running_device *device, int irqline)
cpu_device *cpudevice = downcast<cpu_device *>(device);
int clocks = cpudevice->cycles_to_clocks(cpudevice->min_cycles());
- timer_set(device->machine, cpudevice->clocks_to_attotime(MAX(clocks, 1)), (void *)device, irqline, irq_pulse_clear);
+ attotime target_time = attotime_add(cpudevice->local_time(), cpudevice->clocks_to_attotime(MAX(clocks, 1)));
+ timer_set(device->machine, attotime_sub(target_time, timer_get_time(device->machine)), (void *)device, irqline, irq_pulse_clear);
}
@@ -688,7 +689,11 @@ void generic_pulse_irq_line_and_vector(running_device *device, int irqline, int
{
assert(irqline != INPUT_LINE_NMI && irqline != INPUT_LINE_RESET);
cpu_set_input_line_and_vector(device, irqline, ASSERT_LINE, vector);
- timer_set(device->machine, cpu_clocks_to_attotime(device, 1), (void *)device, irqline, irq_pulse_clear);
+
+ cpu_device *cpudevice = downcast<cpu_device *>(device);
+ int clocks = cpudevice->cycles_to_clocks(cpudevice->min_cycles());
+ attotime target_time = attotime_add(cpudevice->local_time(), cpudevice->clocks_to_attotime(MAX(clocks, 1)));
+ timer_set(device->machine, attotime_sub(target_time, timer_get_time(device->machine)), (void *)device, irqline, irq_pulse_clear);
}
diff --git a/src/emu/machine/z80pio.c b/src/emu/machine/z80pio.c
index 0e1740bae2a..4e179255d54 100644
--- a/src/emu/machine/z80pio.c
+++ b/src/emu/machine/z80pio.c
@@ -21,13 +21,6 @@
enum
{
- PORT_A = 0,
- PORT_B,
- PORT_COUNT
-};
-
-enum
-{
MODE_OUTPUT = 0,
MODE_INPUT,
MODE_BIDIRECTIONAL,
@@ -208,10 +201,10 @@ int z80pio_device::z80daisy_irq_ack()
if (LOG) logerror("Z80PIO '%s' Interrupt Acknowledge\n", tag());
// clear interrupt pending flag
- port.m_ip = 0;
+ port.m_ip = false;
// set interrupt under service flag
- port.m_ius = 1;
+ port.m_ius = true;
check_interrupts();
@@ -241,7 +234,7 @@ void z80pio_device::z80daisy_irq_reti()
if (LOG) logerror("Z80PIO '%s' Return from Interrupt\n", tag());
// clear interrupt under service flag
- port.m_ius = 0;
+ port.m_ius = false;
check_interrupts();
return;
@@ -301,15 +294,15 @@ z80pio_device::pio_port::pio_port()
m_input(0),
m_output(0),
m_ior(0),
- m_rdy(0),
- m_stb(0),
- m_ie(0),
- m_ip(0),
- m_ius(0),
+ m_rdy(false),
+ m_stb(false),
+ m_ie(false),
+ m_ip(false),
+ m_ius(false),
m_icw(0),
m_vector(0),
m_mask(0),
- m_match(0)
+ m_match(false)
{
memset(&m_in_p_func, 0, sizeof(m_in_p_func));
memset(&m_out_p_func, 0, sizeof(m_out_p_func));
@@ -360,10 +353,10 @@ void z80pio_device::pio_port::reset()
// reset interrupt enable flip-flops
m_icw &= ~ICW_ENABLE_INT;
- m_ie = 0;
- m_ip = 0;
- m_ius = 0;
- m_match = 0;
+ m_ie = false;
+ m_ip = false;
+ m_ius = false;
+ m_match = false;
// reset all bits of the data I/O register
m_ior = 0;
@@ -375,7 +368,7 @@ void z80pio_device::pio_port::reset()
m_output = 0;
// clear ready line
- set_rdy(0);
+ set_rdy(false);
}
@@ -391,19 +384,19 @@ bool z80pio_device::pio_port::interrupt_signalled()
// fetch input data (ignore output lines)
UINT8 data = (m_input & m_ior) | (m_output & ~m_ior);
UINT8 mask = ~m_mask;
- int match = 0;
+ bool match = false;
data &= mask;
- if ((m_icw & 0x60) == 0 && data != mask) match = 1;
- else if ((m_icw & 0x60) == 0x20 && data != 0) match = 1;
- else if ((m_icw & 0x60) == 0x40 && data == 0) match = 1;
- else if ((m_icw & 0x60) == 0x60 && data == mask) match = 1;
+ if ((m_icw & 0x60) == 0 && data != mask) match = true;
+ else if ((m_icw & 0x60) == 0x20 && data != 0) match = true;
+ else if ((m_icw & 0x60) == 0x40 && data == 0) match = true;
+ else if ((m_icw & 0x60) == 0x60 && data == mask) match = true;
if (!m_match && match)
{
// trigger interrupt
- m_ip = 1;
+ m_ip = true;
if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Pending\n", m_device->tag(), 'A' + m_index);
}
@@ -421,7 +414,7 @@ bool z80pio_device::pio_port::interrupt_signalled()
void z80pio_device::pio_port::trigger_interrupt()
{
- m_ip = 1;
+ m_ip = true;
if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Pending\n", m_device->tag(), 'A' + m_index);
check_interrupts();
@@ -432,7 +425,7 @@ void z80pio_device::pio_port::trigger_interrupt()
// set_rdy - set the port's RDY line
//-------------------------------------------------
-void z80pio_device::pio_port::set_rdy(int state)
+void z80pio_device::pio_port::set_rdy(bool state)
{
if (m_rdy == state) return;
@@ -458,7 +451,7 @@ void z80pio_device::pio_port::set_mode(int mode)
devcb_call_write8(&m_out_p_func, 0, m_output);
// assert ready line
- set_rdy(1);
+ set_rdy(true);
// set mode register
m_mode = mode;
@@ -485,15 +478,15 @@ void z80pio_device::pio_port::set_mode(int mode)
if ((m_index == PORT_A) || (m_device->m_port[PORT_A].m_mode != MODE_BIDIRECTIONAL))
{
// clear ready line
- set_rdy(0);
+ set_rdy(false);
}
// disable interrupts until IOR is written
- m_ie = 0;
+ m_ie = false;
check_interrupts();
// set logic equation to false
- m_match = 0;
+ m_match = false;
// next word is I/O register
m_next_control_word = IOR;
@@ -509,7 +502,7 @@ void z80pio_device::pio_port::set_mode(int mode)
// strobe - strobe data in/out of the port
//-------------------------------------------------
-void z80pio_device::pio_port::strobe(int state)
+void z80pio_device::pio_port::strobe(bool state)
{
if (LOG) logerror("Z80PIO '%s' Port %c Strobe: %u\n", m_device->tag(), 'A' + m_index, state);
@@ -529,7 +522,7 @@ void z80pio_device::pio_port::strobe(int state)
trigger_interrupt();
// clear ready line
- set_rdy(0);
+ set_rdy(false);
}
}
}
@@ -545,7 +538,7 @@ void z80pio_device::pio_port::strobe(int state)
trigger_interrupt();
// clear ready line
- set_rdy(0);
+ set_rdy(false);
}
}
break;
@@ -561,7 +554,7 @@ void z80pio_device::pio_port::strobe(int state)
trigger_interrupt();
// clear ready line
- set_rdy(0);
+ set_rdy(false);
}
break;
}
@@ -631,7 +624,7 @@ void z80pio_device::pio_port::control_write(UINT8 data)
// set interrupt enable
m_icw |= ICW_ENABLE_INT;
- m_ie = 1;
+ m_ie = true;
check_interrupts();
}
else
@@ -656,14 +649,14 @@ void z80pio_device::pio_port::control_write(UINT8 data)
if (m_icw & ICW_MASK_FOLLOWS)
{
// disable interrupts until mask is written
- m_ie = 0;
+ m_ie = false;
// reset pending interrupts
- m_ip = 0;
+ m_ip = false;
check_interrupts();
// set logic equation to false
- m_match = 0;
+ m_match = false;
// next word is mask control
m_next_control_word = MASK;
@@ -675,7 +668,7 @@ void z80pio_device::pio_port::control_write(UINT8 data)
if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Enable: %u\n", m_device->tag(), 'A' + m_index, BIT(data, 7));
// set interrupt enable
- m_ie = BIT(m_icw, 7);
+ m_ie = BIT(m_icw, 7) ? true : false;
check_interrupts();
break;
@@ -690,7 +683,7 @@ void z80pio_device::pio_port::control_write(UINT8 data)
if (LOG) logerror("Z80PIO '%s' Port %c IOR: %02x\n", m_device->tag(), 'A' + m_index, data);
// set interrupt enable
- m_ie = BIT(m_icw, 7);
+ m_ie = BIT(m_icw, 7) ? true : false;
check_interrupts();
// next word is any
@@ -702,7 +695,7 @@ void z80pio_device::pio_port::control_write(UINT8 data)
if (LOG) logerror("Z80PIO '%s' Port %c Mask: %02x\n", m_device->tag(), 'A' + m_index, data);
// set interrupt enable
- m_ie = BIT(m_icw, 7);
+ m_ie = BIT(m_icw, 7) ? true : false;
check_interrupts();
// next word is any
@@ -736,20 +729,20 @@ UINT8 z80pio_device::pio_port::data_read()
data = m_input;
// clear ready line
- set_rdy(0);
+ set_rdy(false);
// assert ready line
- set_rdy(1);
+ set_rdy(true);
break;
case MODE_BIDIRECTIONAL:
data = m_input;
// clear ready line
- m_device->m_port[PORT_B].set_rdy(0);
+ m_device->m_port[PORT_B].set_rdy(false);
// assert ready line
- m_device->m_port[PORT_B].set_rdy(1);
+ m_device->m_port[PORT_B].set_rdy(true);
break;
case MODE_BIT_CONTROL:
@@ -774,7 +767,7 @@ void z80pio_device::pio_port::data_write(UINT8 data)
{
case MODE_OUTPUT:
// clear ready line
- set_rdy(0);
+ set_rdy(false);
// latch output data
m_output = data;
@@ -783,7 +776,7 @@ void z80pio_device::pio_port::data_write(UINT8 data)
devcb_call_write8(&m_out_p_func, 0, data);
// assert ready line
- set_rdy(1);
+ set_rdy(true);
break;
case MODE_INPUT:
@@ -793,7 +786,7 @@ void z80pio_device::pio_port::data_write(UINT8 data)
case MODE_BIDIRECTIONAL:
// clear ready line
- set_rdy(0);
+ set_rdy(false);
// latch output data
m_output = data;
@@ -805,7 +798,7 @@ void z80pio_device::pio_port::data_write(UINT8 data)
}
// assert ready line
- set_rdy(1);
+ set_rdy(true);
break;
case MODE_BIT_CONTROL:
@@ -828,19 +821,19 @@ READ8_DEVICE_HANDLER( z80pio_c_r ) { return downcast<z80pio_device *>(device)->c
WRITE8_DEVICE_HANDLER( z80pio_c_w ) { downcast<z80pio_device *>(device)->control_write(offset & 1, data); }
READ8_DEVICE_HANDLER( z80pio_d_r ) { return downcast<z80pio_device *>(device)->data_read(offset & 1); }
-WRITE8_DEVICE_HANDLER( z80pio_d_w ) { downcast<z80pio_device *>(device)->control_write(offset & 1, data); }
+WRITE8_DEVICE_HANDLER( z80pio_d_w ) { downcast<z80pio_device *>(device)->data_write(offset & 1, data); }
-READ_LINE_DEVICE_HANDLER( z80pio_ardy_r ) { return downcast<z80pio_device *>(device)->rdy(PORT_A); }
-READ_LINE_DEVICE_HANDLER( z80pio_brdy_r ) { return downcast<z80pio_device *>(device)->rdy(PORT_B); }
+READ_LINE_DEVICE_HANDLER( z80pio_ardy_r ) { return downcast<z80pio_device *>(device)->rdy(z80pio_device::PORT_A); }
+READ_LINE_DEVICE_HANDLER( z80pio_brdy_r ) { return downcast<z80pio_device *>(device)->rdy(z80pio_device::PORT_B); }
-WRITE_LINE_DEVICE_HANDLER( z80pio_astb_w ) { downcast<z80pio_device *>(device)->strobe(PORT_A, state); }
-WRITE_LINE_DEVICE_HANDLER( z80pio_bstb_w ) { downcast<z80pio_device *>(device)->strobe(PORT_B, state); }
+WRITE_LINE_DEVICE_HANDLER( z80pio_astb_w ) { downcast<z80pio_device *>(device)->strobe(z80pio_device::PORT_A, state ? true : false); }
+WRITE_LINE_DEVICE_HANDLER( z80pio_bstb_w ) { downcast<z80pio_device *>(device)->strobe(z80pio_device::PORT_B, state ? true : false); }
-READ8_DEVICE_HANDLER( z80pio_pa_r ) { return downcast<z80pio_device *>(device)->port_read(PORT_A); }
-READ8_DEVICE_HANDLER( z80pio_pb_r ) { return downcast<z80pio_device *>(device)->port_read(PORT_B); }
+READ8_DEVICE_HANDLER( z80pio_pa_r ) { return downcast<z80pio_device *>(device)->port_read(z80pio_device::PORT_A); }
+READ8_DEVICE_HANDLER( z80pio_pb_r ) { return downcast<z80pio_device *>(device)->port_read(z80pio_device::PORT_B); }
-WRITE8_DEVICE_HANDLER( z80pio_pa_w ) { downcast<z80pio_device *>(device)->port_write(PORT_A, data); }
-WRITE8_DEVICE_HANDLER( z80pio_pb_w ) { downcast<z80pio_device *>(device)->port_write(PORT_B, data); }
+WRITE8_DEVICE_HANDLER( z80pio_pa_w ) { downcast<z80pio_device *>(device)->port_write(z80pio_device::PORT_A, data); }
+WRITE8_DEVICE_HANDLER( z80pio_pb_w ) { downcast<z80pio_device *>(device)->port_write(z80pio_device::PORT_B, data); }
//-------------------------------------------------
// z80pio_cd_ba_r - register read
diff --git a/src/emu/machine/z80pio.h b/src/emu/machine/z80pio.h
index 526e1d673aa..f97f7397e32 100644
--- a/src/emu/machine/z80pio.h
+++ b/src/emu/machine/z80pio.h
@@ -108,9 +108,16 @@ class z80pio_device : public device_t,
z80pio_device(running_machine &_machine, const z80pio_device_config &config);
public:
+ enum
+ {
+ PORT_A = 0,
+ PORT_B,
+ PORT_COUNT
+ };
+
// I/O line access
int rdy(int which) { return m_port[which].rdy(); }
- void strobe(int which, int state) { m_port[which].strobe(state); }
+ void strobe(int which, bool state) { m_port[which].strobe(state); }
// control register I/O
UINT8 control_read();
@@ -152,9 +159,9 @@ private:
void trigger_interrupt();
int rdy() const { return m_rdy; }
- void set_rdy(int state);
+ void set_rdy(bool state);
void set_mode(int mode);
- void strobe(int state);
+ void strobe(bool state);
UINT8 read();
void write(UINT8 data);
@@ -179,17 +186,17 @@ private:
UINT8 m_input; // input latch
UINT8 m_output; // output latch
UINT8 m_ior; // input/output register
- int m_rdy; // ready
- int m_stb; // strobe
+ bool m_rdy; // ready
+ bool m_stb; // strobe
// interrupts
- int m_ie; // interrupt enabled
- int m_ip; // interrupt pending
- int m_ius; // interrupt under service
+ bool m_ie; // interrupt enabled
+ bool m_ip; // interrupt pending
+ bool m_ius; // interrupt under service
UINT8 m_icw; // interrupt control word
UINT8 m_vector; // interrupt vector
UINT8 m_mask; // interrupt mask
- int m_match; // logic equation match
+ bool m_match; // logic equation match
};
// internal state
diff --git a/src/emu/schedule.c b/src/emu/schedule.c
index c1e9ca0b3fe..f61825f464c 100644
--- a/src/emu/schedule.c
+++ b/src/emu/schedule.c
@@ -50,6 +50,8 @@
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
+#define TEMPLOG 0
+
//**************************************************************************
@@ -111,6 +113,7 @@ void device_scheduler::timeslice()
{
bool call_debugger = ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0);
timer_execution_state *timerexec = timer_get_execution_state(&m_machine);
+if (TEMPLOG) printf("Timeslice start\n");
// build the execution list if we don't have one yet
if (m_execute_list == NULL)
@@ -119,6 +122,14 @@ void device_scheduler::timeslice()
// loop until we hit the next timer
while (ATTOTIME_LT(timerexec->basetime, timerexec->nextfire))
{
+if (TEMPLOG)
+{
+ void timer_print_first_timer(running_machine *machine);
+ printf("Timeslice loop: basetime=%15.6f\n", attotime_to_double(timerexec->basetime));
+ timer_print_first_timer(&m_machine);
+}
+
+
// by default, assume our target is the end of the next quantum
attotime target;
target.seconds = timerexec->basetime.seconds;
@@ -174,6 +185,7 @@ void device_scheduler::timeslice()
// note that this global variable cycles_stolen can be modified
// via the call to cpu_execute
exec->m_cycles_stolen = 0;
+if (TEMPLOG) printf("Executing %s for %d cycles\n", exec->device().tag(), ran);
m_executing_device = exec;
*exec->m_icount = exec->m_cycles_running;
if (!call_debugger)
@@ -192,6 +204,8 @@ void device_scheduler::timeslice()
ran -= exec->m_cycles_stolen;
profiler_mark_end();
}
+else
+if (TEMPLOG) printf("Skipping %s for %d cycles\n", exec->device().tag(), ran);
// account for these cycles
exec->m_totalcycles += ran;
@@ -224,6 +238,7 @@ void device_scheduler::timeslice()
// update the base time
timerexec->basetime = target;
}
+if (TEMPLOG) printf("Timeslice end\n");
// execute timers
timer_execute_timers(&m_machine);
@@ -382,6 +397,7 @@ void device_scheduler::rebuild_execute_list()
// inform the timer system of our decision
assert(min_quantum.seconds == 0);
timer_add_scheduling_quantum(&m_machine, min_quantum.attoseconds, attotime_never);
+if (TEMPLOG) printf("Setting quantum: %08X%08X\n", (UINT32)(min_quantum.attoseconds >> 32), (UINT32)min_quantum.attoseconds);
m_quantum_set = true;
}
@@ -413,4 +429,11 @@ void device_scheduler::rebuild_execute_list()
// append the suspend list to the end of the active list
*active_tailptr = suspend_list;
+if (TEMPLOG)
+{
+ printf("Execute list:");
+ for (exec = m_execute_list; exec != NULL; exec = exec->m_nextexec)
+ printf(" %s", exec->device().tag());
+ printf("\n");
+}
}
diff --git a/src/emu/timer.c b/src/emu/timer.c
index 9084170c3f2..3c8c81f608a 100644
--- a/src/emu/timer.c
+++ b/src/emu/timer.c
@@ -921,6 +921,14 @@ static void timer_logtimers(running_machine *machine)
}
+void timer_print_first_timer(running_machine *machine)
+{
+ timer_private *global = machine->timer_data;
+ emu_timer *t = global->activelist;
+ printf(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s)\n",
+ attotime_to_double(t->start), attotime_to_double(t->expire), attotime_to_double(t->period), t->enabled, t->temporary, t->func);
+}
+
//**************************************************************************
// TIMER DEVICE CONFIGURATION
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index 59dcbce35b1..159fddda10f 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -59,7 +59,7 @@ static UINT16 test_mask;
static pokey_sound_device *pokey;
static ym2151_sound_device *ym2151;
-static tms5220_sound_device *tms5220;
+static device_t *tms5220;
static okim6295_device *oki6295;
static okim6295_device *oki6295_l, *oki6295_r;
@@ -138,7 +138,7 @@ void atarijsa_init(running_machine *machine, const char *testport, int testmask)
bank_source_data = &rgn[0x10000];
/* determine which sound hardware is installed */
- tms5220 = machine->device<tms5220_sound_device>("tms");
+ tms5220 = machine->device("tms");
ym2151 = machine->device<ym2151_sound_device>("ymsnd");
pokey = machine->device<pokey_sound_device>("pokey");
oki6295 = machine->device<okim6295_device>("adpcm");
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index af882efe631..9a97253c3be 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -494,7 +494,8 @@ static WRITE32_HANDLER( tattass_control_w )
static int pendingCommand=0; /* 1 = read, 2 = write */
static int readBitCount=0;
static int byteAddr=0;
- const address_space *eeprom_space = cputag_get_address_space(space->machine, "eeprom", ADDRESS_SPACE_0);
+ eeprom_device *eeprom = space->machine->device<eeprom_device>("eeprom");
+ const address_space *eeprom_space = eeprom->space();
/* Eprom in low byte */
if (mem_mask==0x000000ff) { /* Byte write to low byte only (different from word writing including low byte) */
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index 8e8465a99de..11b63028ced 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -387,7 +387,8 @@ ADDRESS_MAP_END
/**** Monsters World ****/
static WRITE8_DEVICE_HANDLER( oki_banking_w )
{
- downcast<okim6295_device *>(device)->set_bank_base(0x40000 * (data & 3));
+ mitchell_state *state = (mitchell_state *)device->machine->driver_data;
+ state->oki->set_bank_base(0x40000 * (data & 3));
}
static ADDRESS_MAP_START( mstworld_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
@@ -1239,7 +1240,8 @@ static MACHINE_DRIVER_START( spangbl )
MDRV_GFXDECODE(spangbl)
- MDRV_SOUND_REPLACE("oki", MSM5205, 384000)
+ MDRV_DEVICE_REMOVE("oki")
+ MDRV_SOUND_ADD("msm", MSM5205, 384000)
MDRV_SOUND_CONFIG(msm5205_config)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_DRIVER_END
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index a0bfbff9fbc..958c99bc4f2 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -484,8 +484,8 @@ static WRITE8_DEVICE_HANDLER( sound_control_w )
static READ8_HANDLER( sound_data_r )
{
- running_device *ppi = devtag_get_device(space->machine, "ppi");
- running_device *pio = devtag_get_device(space->machine, "pio");
+ ppi8255_device *ppi = space->machine->device<ppi8255_device>("ppi");
+ z80pio_device *pio = space->machine->device<z80pio_device>("pio");
/* if we have an 8255 PPI, get the data from the port and toggle the ack */
if (ppi != NULL)
@@ -499,9 +499,9 @@ static READ8_HANDLER( sound_data_r )
/* if we have a Z80 PIO, get the data from the port and toggle the strobe */
else if (pio != NULL)
{
- UINT8 data = z80pio_pa_r(pio, 0);
- z80pio_astb_w(pio, 0);
- z80pio_astb_w(pio, 1);
+ UINT8 data = pio->port_read(z80pio_device::PORT_A);
+ pio->strobe(z80pio_device::PORT_A, false);
+ pio->strobe(z80pio_device::PORT_A, true);
return data;
}
diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h
index c7e7efa8da3..840b16fc4c2 100644
--- a/src/mame/includes/metro.h
+++ b/src/mame/includes/metro.h
@@ -17,7 +17,7 @@ public:
: maincpu(machine.device<cpu_device>("maincpu")),
audiocpu(machine.device<cpu_device>("audiocpu")),
oki(machine.device<okim6295_device>("oki")),
- ymsnd(machine.device<ym2151_sound_device>("ymsnd")),
+ ymsnd(machine.device("ymsnd")),
k053936(machine.device<k053936_device>("k053936")) { }
/* memory pointers */
@@ -84,7 +84,7 @@ public:
cpu_device *maincpu;
cpu_device *audiocpu;
okim6295_device *oki;
- ym2151_sound_device *ymsnd;
+ device_t *ymsnd;
k053936_device *k053936;
};
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index 568bc648be5..846697c89ab 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -222,7 +222,7 @@ WRITE8_HANDLER( decocass_reset_w )
}
/* 8041 active low reset */
- cpu_set_input_line(state->mcu, INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
+ cpu_set_input_line(state->mcu, INPUT_LINE_RESET, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/osd/windows/vconv.c b/src/osd/windows/vconv.c
index f0c0b6f7693..098eae56137 100644
--- a/src/osd/windows/vconv.c
+++ b/src/osd/windows/vconv.c
@@ -95,7 +95,7 @@ static const translation_info gcc_translate[] =
{ 0, "-O2", "/O2" },
{ 0, "-O3", "/O2" },
{ 0, "-Os", "/O1" },
- { 0, "-g", "/Zi" },
+ { 0, "-g*", "/Zi" },
{ VS2005, "-fno-strict-aliasing", "" }, // deprecated in VS2005
{ 0, "-fno-strict-aliasing", "/Oa" },
{ 0, "-fno-omit-frame-pointer", "" },