As promised, the bulk update of timer calls:

timer_adjust_oneshot(t,...)  => t->adjust(...)
timer_adjust_periodic(t,...) => t->adjust(...)
timer_reset(t,...)           => t->reset(...)
timer_enable(t,...)          => t->enable(...)
timer_enabled(t)             => t->enabled()
timer_get_param(t)           => t->param()
timer_get_ptr(t)             => t->ptr()
timer_set_param(t,...)       => t->set_param(...)
timer_set_ptr(t)             => t->set_ptr(...)
timer_timeelapsed(t)         => t->elapsed()
timer_timeleft(t)            => t->remaining()
timer_starttime(t)           => t->start()
timer_firetime(t)            => t->expire()

Also remove some stray legacy cpuexec* macros that were 
lurking in schedule.h):

cpuexec_describe_context(m)     => m->describe_context()
cpuexec_boost_interleave(m,...) => m->scheduler().boot_interleave(...)
cpuexec_trigger(m,...)          => m->scheduler().trigger(...)
cpuexec_triggertime(m,...)      => m->scheduler().trigger(...)

Specific regex'es used:

timer_adjust_oneshot( *)\(( *)([^,;]+), *
\3->adjust\1\(\2

timer_adjust_periodic( *)\(( *)([^,;]+), *
\3->adjust\1\(\2

(->adjust.*), *0( *)\)
\1\2\)

timer_reset( *)\(( *)([^,;]+), *
\3->reset\1\(\2

(->reset *\(.*)attotime::never
\1

timer_enable( *)\(( *)([^,;]+), *
\3->enable\1\(\2

timer_enabled( *)\(( *)([^,;)]+)\)
\3->enabled\1\(\2\)

timer_get_param( *)\(( *)([^,;)]+)\)
\3->param\1\(\2\)

timer_get_ptr( *)\(( *)([^,;)]+)\)
\3->ptr\1\(\2\)

timer_timeelapsed( *)\(( *)([^,;)]+)\)
\3->elapsed\1\(\2\)

timer_timeleft( *)\(( *)([^,;)]+)\)
\3->remaining\1\(\2\)

timer_starttime( *)\(( *)([^,;)]+)\)
\3->start\1\(\2\)

timer_firetime( *)\(( *)([^,;)]+)\)
\3->expire\1\(\2\)

timer_set_param( *)\(( *)([^,;]+), *
\3->set_param\1\(\2

timer_set_ptr( *)\(( *)([^,;]+), *
\3->set_ptr\1\(\2

cpuexec_describe_context( *)\(( *)([^,;)]+)\)
\3->describe_context\1\(\2\)

\&m_machine->describe_context
m_machine.describe_context

cpuexec_boost_interleave( *)\(( *)([^,;]+), *
\3->scheduler().boost_interleave\1\(\2

cpuexec_trigger( *)\(( *)([^,;]+), *
\3->scheduler().trigger\1\(\2

cpuexec_triggertime( *)\(( *)([^,;]+), *
\3->scheduler().trigger\1\(\2
This commit is contained in:
Aaron Giles 2011-02-06 21:23:00 +00:00
parent ffeaa72e57
commit feb6e77be3
369 changed files with 1504 additions and 1529 deletions

View File

@ -887,14 +887,14 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
/* allocate serial timer */
cpustate->serial_timer = device->machine->scheduler().timer_alloc(FUNC(serial_tick), cpustate);
timer_adjust_periodic(cpustate->serial_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 16));
cpustate->serial_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
/* allocate counter timer */
if (has_counter)
{
cpustate->counter_timer = device->machine->scheduler().timer_alloc(FUNC(counter_tick), cpustate);
timer_adjust_periodic(cpustate->counter_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 16 / 4));
cpustate->counter_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16 / 4));
}
/* allocate IN latch timer */
@ -902,7 +902,7 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
if (has_inil)
{
cpustate->inil_timer = device->machine->scheduler().timer_alloc(FUNC(inil_tick), cpustate);
timer_adjust_periodic(cpustate->inil_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 16));
cpustate->inil_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
}
/* allocate Microbus timer */
@ -910,7 +910,7 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
if (cpustate->intf->microbus == COP400_MICROBUS_ENABLED)
{
cpustate->microbus_timer = device->machine->scheduler().timer_alloc(FUNC(microbus_tick), cpustate);
timer_adjust_periodic(cpustate->microbus_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 16));
cpustate->microbus_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
}
/* register for state saving */

View File

@ -609,7 +609,7 @@ static void adjust_timer_interrupt(hyperstone_state *cpustate)
{
UINT64 clocks_until_int = cpustate->tr_clocks_per_tick - (clocks_since_base % cpustate->tr_clocks_per_tick);
UINT64 cycles_until_int = (clocks_until_int << cpustate->clock_scale) + cycles_until_next_clock;
timer_adjust_oneshot(cpustate->timer, cpustate->device->cycles_to_attotime(cycles_until_int + 1), 1);
cpustate->timer->adjust(cpustate->device->cycles_to_attotime(cycles_until_int + 1), 1);
}
/* else if the timer interrupt is enabled, configure it to fire at the appropriate time */
@ -620,19 +620,19 @@ static void adjust_timer_interrupt(hyperstone_state *cpustate)
if (delta > 0x80000000)
{
if (!cpustate->timer_int_pending)
timer_adjust_oneshot(cpustate->timer, attotime::zero, 0);
cpustate->timer->adjust(attotime::zero);
}
else
{
UINT64 clocks_until_int = mulu_32x32(delta, cpustate->tr_clocks_per_tick);
UINT64 cycles_until_int = (clocks_until_int << cpustate->clock_scale) + cycles_until_next_clock;
timer_adjust_oneshot(cpustate->timer, cpustate->device->cycles_to_attotime(cycles_until_int), 0);
cpustate->timer->adjust(cpustate->device->cycles_to_attotime(cycles_until_int));
}
}
/* otherwise, disable the timer */
else
timer_adjust_oneshot(cpustate->timer, attotime::never, 0);
cpustate->timer->adjust(attotime::never);
}
static TIMER_CALLBACK( e132xs_timer_callback )

View File

@ -410,21 +410,21 @@ static void recalc_8bit_timer(h83xx_state *h8, int t)
// if "no clock source", stop
if (div < 2)
{
timer_adjust_oneshot(h8->timer[(t*2)], attotime::never, 0);
timer_adjust_oneshot(h8->timer[(t*2)+1], attotime::never, 0);
h8->timer[(t*2)]->adjust(attotime::never);
h8->timer[(t*2)+1]->adjust(attotime::never);
return;
}
if (h8->TCORA[t])
{
time = (h8->device->unscaled_clock() / dividers[div]) / (h8->TCORA[t] - h8->TCNT[t]);
timer_adjust_oneshot(h8->timer[(t*2)], attotime::from_hz(time), 0);
h8->timer[(t*2)]->adjust(attotime::from_hz(time));
}
if (h8->TCORB[t])
{
time = (h8->device->unscaled_clock() / dividers[div]) / (h8->TCORB[t] - h8->TCNT[t]);
timer_adjust_oneshot(h8->timer[(t*2)+1], attotime::from_hz(time), 0);
h8->timer[(t*2)+1]->adjust(attotime::from_hz(time));
}
}
@ -433,7 +433,7 @@ static void timer_8bit_expire(h83xx_state *h8, int t, int sel)
{
static const int irqbase[2] = { 19, 22 };
timer_adjust_oneshot(h8->timer[(t*2)+sel], attotime::never, 0);
h8->timer[(t*2)+sel]->adjust(attotime::never);
h8->TCSR[t] |= ((0x40)<<sel);

View File

@ -42,7 +42,7 @@ extern void h8_3002_InterruptRequest(h83xx_state *h8, UINT8 source, UINT8 state)
static void h8itu_timer_expire(h83xx_state *h8, int which)
{
timer_adjust_oneshot(h8->timer[which], attotime::never, 0);
h8->timer[which]->adjust(attotime::never);
h8->h8TCNT[which] = 0;
h8->per_regs[tsr[which]] |= 4;
// interrupt on overflow ?
@ -103,7 +103,7 @@ static void h8_itu_refresh_timer(h83xx_state *h8, int tnum)
logerror("H8/3002: Timer %d is using an external clock. Unsupported!\n", tnum);
}
timer_adjust_oneshot(h8->timer[tnum], period, 0);
h8->timer[tnum]->adjust(period);
}
static void h8_itu_sync_timers(h83xx_state *h8, int tnum)
@ -116,7 +116,7 @@ static void h8_itu_sync_timers(h83xx_state *h8, int tnum)
// get the time per unit
cycle_time = attotime::from_hz(h8->device->unscaled_clock()) * tscales[ourTCR & 3];
cur = timer_timeelapsed(h8->timer[tnum]);
cur = h8->timer[tnum]->elapsed();
ratio = cur.as_double() / cycle_time.as_double();
@ -464,7 +464,7 @@ static void h8_3007_itu_refresh_timer(h83xx_state *h8, int tnum)
logerror("H8/3007: Timer %d is using an external clock. Unsupported!\n", tnum);
}
timer_adjust_oneshot(h8->timer[tnum], period, 0);
h8->timer[tnum]->adjust(period);
}
static void h8itu_3007_timer_expire(h83xx_state *h8, int tnum)
@ -489,7 +489,7 @@ static void h8itu_3007_timer_expire(h83xx_state *h8, int tnum)
else
{
//logerror("h8/3007 timer %d GRA match, stopping\n",tnum);
timer_adjust_oneshot(h8->timer[tnum], attotime::never, 0);
h8->timer[tnum]->adjust(attotime::never);
}
h8->per_regs[0x64] |= 1<<tnum;
@ -511,7 +511,7 @@ static void h8itu_3007_timer_expire(h83xx_state *h8, int tnum)
else
{
//logerror("h8/3007 timer %d GRB match, stopping\n",tnum);
timer_adjust_oneshot(h8->timer[tnum], attotime::never, 0);
h8->timer[tnum]->adjust(attotime::never);
}
h8->per_regs[0x65] |= 1<<tnum;
@ -790,5 +790,5 @@ void h8_itu_reset(h83xx_state *h8)
// stop all the timers
for (i=0; i<5; i++)
timer_adjust_oneshot(h8->timer[i], attotime::never, 0);
h8->timer[i]->adjust(attotime::never);
}

View File

@ -169,7 +169,7 @@ void hd61700_cpu_device::device_start()
m_program = this->space(AS_PROGRAM);
m_sec_timer = timer_alloc(SEC_TIMER);
timer_adjust_periodic(m_sec_timer, attotime::from_seconds(1), 0, attotime::from_seconds(1));
m_sec_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1));
// save state
state_save_register_device_item(this, 0, m_ppc);

View File

@ -266,7 +266,7 @@ static TIMER_CALLBACK( m37710_timer_cb )
int which = param;
int curirq = M37710_LINE_TIMERA0 - which;
timer_adjust_oneshot(cpustate->timers[which], cpustate->reload[which], param);
cpustate->timers[which]->adjust(cpustate->reload[which], param);
cpustate->m37710_regs[m37710_irq_levels[curirq]] |= 0x04;
m37710_set_irq_line(cpustate, curirq, PULSE_LINE);
@ -334,7 +334,7 @@ static void m37710_recalc_timer(m37710i_cpu_struct *cpustate, int timer)
mame_printf_debug("Timer %d in timer mode, %f Hz\n", timer, 1.0 / time.as_double());
#endif
timer_adjust_oneshot(cpustate->timers[timer], time, timer);
cpustate->timers[timer]->adjust(time, timer);
cpustate->reload[timer] = time;
break;
@ -369,7 +369,7 @@ static void m37710_recalc_timer(m37710i_cpu_struct *cpustate, int timer)
mame_printf_debug("Timer %d in timer mode, %f Hz\n", timer, 1.0 / time.as_double());
#endif
timer_adjust_oneshot(cpustate->timers[timer], time, timer);
cpustate->timers[timer]->adjust(time, timer);
cpustate->reload[timer] = time;
break;

View File

@ -735,7 +735,7 @@ INLINE void set_rmcr(m6800_state *cpustate, UINT8 data)
{
case 0:
case 3: // not implemented
timer_enable(cpustate->sci_timer, 0);
cpustate->sci_timer->enable(false);
break;
case 1:
@ -743,7 +743,7 @@ INLINE void set_rmcr(m6800_state *cpustate, UINT8 data)
{
int divisor = M6800_RMCR_SS[cpustate->rmcr & M6800_RMCR_SS_MASK];
timer_adjust_periodic(cpustate->sci_timer, attotime::from_hz(cpustate->clock / divisor), 0, attotime::from_hz(cpustate->clock / divisor));
cpustate->sci_timer->adjust(attotime::from_hz(cpustate->clock / divisor), 0, attotime::from_hz(cpustate->clock / divisor));
}
break;
}

View File

@ -217,7 +217,7 @@ static TIMER_CALLBACK( serial_timer )
/* if we get too many interrupts with no servicing, disable the timer
until somebody does something */
if (cpustate->SBcount >= SERIAL_DISABLE_THRESH)
timer_adjust_oneshot(cpustate->serial, attotime::never, 0);
cpustate->serial->adjust(attotime::never);
/* only read if not full; this is needed by the Namco 52xx to ensure that
the program can write to S and recover the value even if serial is enabled */
@ -261,9 +261,9 @@ static void update_pio_enable( mb88_state *cpustate, UINT8 newpio )
if ((cpustate->pio ^ newpio) & 0x30)
{
if ((newpio & 0x30) == 0)
timer_adjust_oneshot(cpustate->serial, attotime::never, 0);
cpustate->serial->adjust(attotime::never);
else if ((newpio & 0x30) == 0x20)
timer_adjust_periodic(cpustate->serial, attotime::from_hz(cpustate->device->clock() / SERIAL_PRESCALE), 0, attotime::from_hz(cpustate->device->clock() / SERIAL_PRESCALE));
cpustate->serial->adjust(attotime::from_hz(cpustate->device->clock() / SERIAL_PRESCALE), 0, attotime::from_hz(cpustate->device->clock() / SERIAL_PRESCALE));
else
fatalerror("mb88xx: update_pio_enable set serial enable to unsupported value %02X\n", newpio & 0x30);
}
@ -625,7 +625,7 @@ static CPU_EXECUTE( mb88 )
{
/* re-enable the timer if we disabled it previously */
if (cpustate->SBcount >= SERIAL_DISABLE_THRESH)
timer_adjust_periodic(cpustate->serial, attotime::from_hz(cpustate->device->clock() / SERIAL_PRESCALE), 0, attotime::from_hz(cpustate->device->clock() / SERIAL_PRESCALE));
cpustate->serial->adjust(attotime::from_hz(cpustate->device->clock() / SERIAL_PRESCALE), 0, attotime::from_hz(cpustate->device->clock() / SERIAL_PRESCALE));
cpustate->SBcount = 0;
}
cpustate->sf = 0;

View File

@ -205,10 +205,10 @@ void mips3com_update_cycle_counting(mips3_state *mips)
UINT32 compare = mips->cpr[0][COP0_Compare];
UINT32 delta = compare - count;
attotime newtime = mips->device->cycles_to_attotime((UINT64)delta * 2);
timer_adjust_oneshot(mips->compare_int_timer, newtime, 0);
mips->compare_int_timer->adjust(newtime);
return;
}
timer_adjust_oneshot(mips->compare_int_timer, attotime::never, 0);
mips->compare_int_timer->adjust(attotime::never);
}

View File

@ -192,7 +192,7 @@ static void refresh_timer(mn102_info *cpustate, int tmr)
rate /= cpustate->simple_timer[tmr].base;
if (tmr != 8) // HACK: timer 8 is run at 500 kHz by the Taito program for no obvious reason, which kills performance
timer_adjust_oneshot(cpustate->timer_timers[tmr], attotime::from_hz(rate), tmr);
cpustate->timer_timers[tmr]->adjust(attotime::from_hz(rate), tmr);
}
else
{
@ -202,7 +202,7 @@ static void refresh_timer(mn102_info *cpustate, int tmr)
}
else // disabled, so stop it
{
timer_adjust_oneshot(cpustate->timer_timers[tmr], attotime::never, tmr);
cpustate->timer_timers[tmr]->adjust(attotime::never, tmr);
}
}
@ -296,7 +296,7 @@ static CPU_INIT(mn10200)
for (tmr = 0; tmr < NUM_TIMERS_8BIT; tmr++)
{
cpustate->timer_timers[tmr] = device->machine->scheduler().timer_alloc(FUNC(simple_timer_cb), cpustate);
timer_adjust_oneshot(cpustate->timer_timers[tmr], attotime::never, tmr);
cpustate->timer_timers[tmr]->adjust(attotime::never, tmr);
}
}
@ -319,7 +319,7 @@ static CPU_RESET(mn10200)
cpustate->simple_timer[tmr].mode = 0;
cpustate->simple_timer[tmr].cur = 0;
cpustate->simple_timer[tmr].base = 0;
timer_adjust_oneshot(cpustate->timer_timers[tmr], attotime::never, tmr);
cpustate->timer_timers[tmr]->adjust(attotime::never, tmr);
}
// clear all interrupt groups

View File

@ -192,11 +192,11 @@ static CPU_RESET( v25 )
tmp = nec_state->PCK << nec_state->TB;
time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp;
timer_adjust_periodic(nec_state->timers[3], time, INTTB, time);
nec_state->timers[3]->adjust(time, INTTB, time);
timer_adjust_oneshot(nec_state->timers[0], attotime::never, 0);
timer_adjust_oneshot(nec_state->timers[1], attotime::never, 0);
timer_adjust_oneshot(nec_state->timers[2], attotime::never, 0);
nec_state->timers[0]->adjust(attotime::never);
nec_state->timers[1]->adjust(attotime::never);
nec_state->timers[2]->adjust(attotime::never);
SetRB(7);
Sreg(PS) = 0xffff;

View File

@ -194,19 +194,19 @@ static void write_sfr(v25_state_t *nec_state, unsigned o, UINT8 d)
{
tmp = nec_state->TM0 * nec_state->PCK * ((d & 0x40) ? 128 : 12 );
time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp;
timer_adjust_oneshot(nec_state->timers[0], time, INTTU0);
nec_state->timers[0]->adjust(time, INTTU0);
}
else
timer_adjust_oneshot(nec_state->timers[0], attotime::never, 0);
nec_state->timers[0]->adjust(attotime::never);
if(d & 0x20)
{
tmp = nec_state->MD0 * nec_state->PCK * ((d & 0x10) ? 128 : 12 );
time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp;
timer_adjust_oneshot(nec_state->timers[1], time, INTTU1);
nec_state->timers[1]->adjust(time, INTTU1);
}
else
timer_adjust_oneshot(nec_state->timers[1], attotime::never, 0);
nec_state->timers[1]->adjust(attotime::never);
}
else /* interval mode */
{
@ -214,14 +214,14 @@ static void write_sfr(v25_state_t *nec_state, unsigned o, UINT8 d)
{
tmp = nec_state->MD0 * nec_state->PCK * ((d & 0x40) ? 128 : 6 );
time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp;
timer_adjust_periodic(nec_state->timers[0], time, INTTU0, time);
timer_adjust_oneshot(nec_state->timers[1], attotime::never, 0);
nec_state->timers[0]->adjust(time, INTTU0, time);
nec_state->timers[1]->adjust(attotime::never);
nec_state->TM0 = nec_state->MD0;
}
else
{
timer_adjust_oneshot(nec_state->timers[0], attotime::never, 0);
timer_adjust_oneshot(nec_state->timers[1], attotime::never, 0);
nec_state->timers[0]->adjust(attotime::never);
nec_state->timers[1]->adjust(attotime::never);
}
}
break;
@ -231,11 +231,11 @@ static void write_sfr(v25_state_t *nec_state, unsigned o, UINT8 d)
{
tmp = nec_state->MD1 * nec_state->PCK * ((d & 0x40) ? 128 : 6 );
time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp;
timer_adjust_periodic(nec_state->timers[2], time, INTTU2, time);
nec_state->timers[2]->adjust(time, INTTU2, time);
nec_state->TM1 = nec_state->MD1;
}
else
timer_adjust_oneshot(nec_state->timers[2], attotime::never, 0);
nec_state->timers[2]->adjust(attotime::never);
break;
case 0x9C: /* TMIC0 */
write_irqcontrol(nec_state, INTTU0, d);
@ -263,7 +263,7 @@ static void write_sfr(v25_state_t *nec_state, unsigned o, UINT8 d)
}
tmp = nec_state->PCK << nec_state->TB;
time = attotime::from_hz(nec_state->device->unscaled_clock()) * tmp;
timer_adjust_periodic(nec_state->timers[3], time, INTTB, time);
nec_state->timers[3]->adjust(time, INTTB, time);
logerror(" Internal RAM %sabled\n", (nec_state->RAMEN ? "en" : "dis"));
logerror(" Time base set to 2^%d\n", nec_state->TB);
logerror(" Clock divider set to %d\n", nec_state->PCK);

View File

@ -193,7 +193,7 @@ INLINE void set_decrementer(powerpc_state *ppc, UINT32 newdec)
}
ppc->dec_zero_cycles = ppc->device->total_cycles() + cycles_until_done;
timer_adjust_oneshot(ppc->decrementer_int_timer, ppc->device->cycles_to_attotime(cycles_until_done), 0);
ppc->decrementer_int_timer->adjust(ppc->device->cycles_to_attotime(cycles_until_done));
if ((INT32)curdec >= 0 && (INT32)newdec < 0)
ppc->irq_pending |= 0x02;
@ -1538,7 +1538,7 @@ static TIMER_CALLBACK( decrementer_int_callback )
/* advance by another full rev */
ppc->dec_zero_cycles += (UINT64)ppc->tb_divisor << 32;
cycles_until_next = ppc->dec_zero_cycles - ppc->device->total_cycles();
timer_adjust_oneshot(ppc->decrementer_int_timer, ppc->device->cycles_to_attotime(cycles_until_next), 0);
ppc->decrementer_int_timer->adjust(ppc->device->cycles_to_attotime(cycles_until_next));
}
@ -1804,12 +1804,12 @@ static TIMER_CALLBACK( ppc4xx_fit_callback )
UINT32 timebase = get_timebase(ppc);
UINT32 interval = 0x200 << (4 * ((ppc->spr[SPR4XX_TCR] & PPC4XX_TCR_FP_MASK) >> 24));
UINT32 target = (timebase + interval) & ~(interval - 1);
timer_adjust_oneshot(ppc->fit_timer, ppc->device->cycles_to_attotime((target + 1 - timebase) / ppc->tb_divisor), TRUE);
ppc->fit_timer->adjust(ppc->device->cycles_to_attotime((target + 1 - timebase) / ppc->tb_divisor), TRUE);
}
/* otherwise, turn ourself off */
else
timer_adjust_oneshot(ppc->fit_timer, attotime::never, FALSE);
ppc->fit_timer->adjust(attotime::never, FALSE);
}
@ -1835,12 +1835,12 @@ static TIMER_CALLBACK( ppc4xx_pit_callback )
UINT32 timebase = get_timebase(ppc);
UINT32 interval = ppc->pit_reload;
UINT32 target = timebase + interval;
timer_adjust_oneshot(ppc->pit_timer, ppc->device->cycles_to_attotime((target + 1 - timebase) / ppc->tb_divisor), TRUE);
ppc->pit_timer->adjust(ppc->device->cycles_to_attotime((target + 1 - timebase) / ppc->tb_divisor), TRUE);
}
/* otherwise, turn ourself off */
else
timer_adjust_oneshot(ppc->pit_timer, attotime::never, FALSE);
ppc->pit_timer->adjust(attotime::never, FALSE);
}
@ -1912,14 +1912,14 @@ static void ppc4xx_spu_timer_reset(powerpc_state *ppc)
int divisor = ((ppc->spu.regs[SPU4XX_BAUD_DIVISOR_H] * 256 + ppc->spu.regs[SPU4XX_BAUD_DIVISOR_L]) & 0xfff) + 1;
int bpc = 7 + ((ppc->spu.regs[SPU4XX_CONTROL] & 8) >> 3) + 1 + (ppc->spu.regs[SPU4XX_CONTROL] & 1);
attotime charperiod = clockperiod * (divisor * 16 * bpc);
timer_adjust_periodic(ppc->spu.timer, charperiod, 0, charperiod);
ppc->spu.timer->adjust(charperiod, 0, charperiod);
if (PRINTF_SPU)
printf("ppc4xx_spu_timer_reset: baud rate = %.0f\n", ATTOSECONDS_TO_HZ(charperiod.attoseconds) * bpc);
}
/* otherwise, disable the timer */
else
timer_adjust_oneshot(ppc->spu.timer, attotime::never, 0);
ppc->spu.timer->adjust(attotime::never);
}

View File

@ -73,7 +73,7 @@ static void sh2_timer_activate(sh2_state *sh2)
int max_delta = 0xfffff;
UINT16 frc;
timer_adjust_oneshot(sh2->timer, attotime::never, 0);
sh2->timer->adjust(attotime::never);
frc = sh2->frc;
if(!(sh2->m[4] & OCFA)) {
@ -99,7 +99,7 @@ static void sh2_timer_activate(sh2_state *sh2)
if(divider) {
max_delta <<= divider;
sh2->frc_base = sh2->device->total_cycles();
timer_adjust_oneshot(sh2->timer, sh2->device->cycles_to_attotime(max_delta), 0);
sh2->timer->adjust(sh2->device->cycles_to_attotime(max_delta));
} else {
logerror("SH2.%s: Timer event in %d cycles of external clock", sh2->device->tag(), max_delta);
}
@ -172,7 +172,7 @@ void sh2_notify_dma_data_available(device_t *device)
{
// printf("resuming stalled dma\n");
sh2->dma_timer_active[dma]=1;
timer_adjust_oneshot(sh2->dma_current_active_timer[dma], attotime::zero, dma);
sh2->dma_current_active_timer[dma]->adjust(attotime::zero, dma);
}
}
@ -221,7 +221,7 @@ void sh2_do_dma(sh2_state *sh2, int dma)
#ifdef USE_TIMER_FOR_DMA
//schedule next DMA callback
timer_adjust_oneshot(sh2->dma_current_active_timer[dma], sh2->device->cycles_to_attotime(2), dma);
sh2->dma_current_active_timer[dma]->adjust(sh2->device->cycles_to_attotime(2), dma);
#endif
@ -269,7 +269,7 @@ void sh2_do_dma(sh2_state *sh2, int dma)
#ifdef USE_TIMER_FOR_DMA
//schedule next DMA callback
timer_adjust_oneshot(sh2->dma_current_active_timer[dma], sh2->device->cycles_to_attotime(2), dma);
sh2->dma_current_active_timer[dma]->adjust(sh2->device->cycles_to_attotime(2), dma);
#endif
// check: should this really be using read_word_32 / write_word_32?
@ -316,7 +316,7 @@ void sh2_do_dma(sh2_state *sh2, int dma)
#ifdef USE_TIMER_FOR_DMA
//schedule next DMA callback
timer_adjust_oneshot(sh2->dma_current_active_timer[dma], sh2->device->cycles_to_attotime(2), dma);
sh2->dma_current_active_timer[dma]->adjust(sh2->device->cycles_to_attotime(2), dma);
#endif
dmadata = sh2->program->read_dword(tempsrc);
@ -361,7 +361,7 @@ void sh2_do_dma(sh2_state *sh2, int dma)
#ifdef USE_TIMER_FOR_DMA
//schedule next DMA callback
timer_adjust_oneshot(sh2->dma_current_active_timer[dma], sh2->device->cycles_to_attotime(2), dma);
sh2->dma_current_active_timer[dma]->adjust(sh2->device->cycles_to_attotime(2), dma);
#endif
dmadata = sh2->program->read_dword(tempsrc);
@ -483,7 +483,7 @@ static void sh2_dmac_check(sh2_state *sh2, int dma)
sh2->device->suspend(SUSPEND_REASON_HALT, 1 );
}
timer_adjust_oneshot(sh2->dma_current_active_timer[dma], sh2->device->cycles_to_attotime(2), dma);
sh2->dma_current_active_timer[dma]->adjust(sh2->device->cycles_to_attotime(2), dma);
#endif
}
@ -493,8 +493,8 @@ static void sh2_dmac_check(sh2_state *sh2, int dma)
if(sh2->dma_timer_active[dma])
{
logerror("SH2: DMA %d cancelled in-flight\n", dma);
//timer_adjust_oneshot(sh2->dma_complete_timer[dma], attotime::never, 0);
timer_adjust_oneshot(sh2->dma_current_active_timer[dma], attotime::never, 0);
//sh2->dma_complete_timer[dma]->adjust(attotime::never);
sh2->dma_current_active_timer[dma]->adjust(attotime::never);
sh2->dma_timer_active[dma] = 0;
}
@ -924,13 +924,13 @@ void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_callb
int i;
sh2->timer = device->machine->scheduler().timer_alloc(FUNC(sh2_timer_callback), sh2);
timer_adjust_oneshot(sh2->timer, attotime::never, 0);
sh2->timer->adjust(attotime::never);
sh2->dma_current_active_timer[0] = device->machine->scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
timer_adjust_oneshot(sh2->dma_current_active_timer[0], attotime::never, 0);
sh2->dma_current_active_timer[0]->adjust(attotime::never);
sh2->dma_current_active_timer[1] = device->machine->scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
timer_adjust_oneshot(sh2->dma_current_active_timer[1], attotime::never, 0);
sh2->dma_current_active_timer[1]->adjust(attotime::never);
sh2->m = auto_alloc_array(device->machine, UINT32, 0x200/4);

View File

@ -3280,7 +3280,7 @@ static CPU_RESET( sh4 )
sh4_default_exception_priorities(sh4);
memset(sh4->exception_requesting, 0, sizeof(sh4->exception_requesting));
timer_adjust_oneshot(sh4->rtc_timer, attotime::from_hz(128), 0);
sh4->rtc_timer->adjust(attotime::from_hz(128));
sh4->m[RCR2] = 0x09;
sh4->m[TCOR0] = 0xffffffff;
sh4->m[TCNT0] = 0xffffffff;

View File

@ -212,7 +212,7 @@ static UINT32 compute_ticks_refresh_timer(emu_timer *timer, int hertz, int base,
// elapsed:total = x : ticks
// x=elapsed*tics/total -> x=elapsed*(double)100000000/rtcnt_div[(sh4->m[RTCSR] >> 3) & 7]
// ticks/total=ticks / ((rtcnt_div[(sh4->m[RTCSR] >> 3) & 7] * ticks) / 100000000)=1/((rtcnt_div[(sh4->m[RTCSR] >> 3) & 7] / 100000000)=100000000/rtcnt_div[(sh4->m[RTCSR] >> 3) & 7]
return base + (UINT32)((timer_timeelapsed(timer).as_double() * (double)hertz) / (double)divisor);
return base + (UINT32)((timer->elapsed().as_double() * (double)hertz) / (double)divisor);
}
static void sh4_refresh_timer_recompute(sh4_state *sh4)
@ -224,7 +224,7 @@ UINT32 ticks;
ticks = sh4->m[RTCOR]-sh4->m[RTCNT];
if (ticks <= 0)
ticks = 256 + ticks;
timer_adjust_oneshot(sh4->refresh_timer, attotime::from_hz(sh4->bus_clock) * rtcnt_div[(sh4->m[RTCSR] >> 3) & 7] * ticks, 0);
sh4->refresh_timer->adjust(attotime::from_hz(sh4->bus_clock) * rtcnt_div[(sh4->m[RTCSR] >> 3) & 7] * ticks);
sh4->refresh_timer_base = sh4->m[RTCNT];
}
@ -242,7 +242,7 @@ static UINT32 compute_ticks_timer(emu_timer *timer, int hertz, int divisor)
{
double ret;
ret=((timer_timeleft(timer).as_double() * (double)hertz) / (double)divisor) - 1;
ret=((timer->remaining().as_double() * (double)hertz) / (double)divisor) - 1;
return (UINT32)ret;
}
@ -251,7 +251,7 @@ static void sh4_timer_recompute(sh4_state *sh4, int which)
double ticks;
ticks = sh4->m[tcnt[which]];
timer_adjust_oneshot(sh4->timer[which], sh4_scale_up_mame_time(attotime::from_hz(sh4->pm_clock) * tcnt_div[sh4->m[tcr[which]] & 7], ticks), which);
sh4->timer[which]->adjust(sh4_scale_up_mame_time(attotime::from_hz(sh4->pm_clock) * tcnt_div[sh4->m[tcr[which]] & 7], ticks), which);
}
static TIMER_CALLBACK( sh4_refresh_timer_callback )
@ -369,7 +369,7 @@ static TIMER_CALLBACK( sh4_rtc_timer_callback )
{
sh4_state *sh4 = (sh4_state *)ptr;
timer_adjust_oneshot(sh4->rtc_timer, attotime::from_hz(128), 0);
sh4->rtc_timer->adjust(attotime::from_hz(128));
sh4->m[R64CNT] = (sh4->m[R64CNT]+1) & 0x7f;
if (sh4->m[R64CNT] == 64)
{
@ -453,12 +453,12 @@ static int sh4_dma_transfer(sh4_state *sh4, int channel, int timermode, UINT32 c
if (timermode == 1)
{
sh4->dma_timer_active[channel] = 1;
timer_adjust_oneshot(sh4->dma_timer[channel], sh4->device->cycles_to_attotime(2*count+1), channel);
sh4->dma_timer[channel]->adjust(sh4->device->cycles_to_attotime(2*count+1), channel);
}
else if (timermode == 2)
{
sh4->dma_timer_active[channel] = 1;
timer_adjust_oneshot(sh4->dma_timer[channel], attotime::zero, channel);
sh4->dma_timer[channel]->adjust(attotime::zero, channel);
}
src &= AM;
@ -601,7 +601,7 @@ UINT32 dmatcr,chcr,sar,dar;
if (sh4->dma_timer_active[channel])
{
logerror("SH4: DMA %d cancelled in-flight but all data transferred", channel);
timer_adjust_oneshot(sh4->dma_timer[channel], attotime::never, channel);
sh4->dma_timer[channel]->adjust(attotime::never, channel);
sh4->dma_timer_active[channel] = 0;
}
}
@ -617,7 +617,7 @@ int s;
if (sh4->dma_timer_active[s])
{
logerror("SH4: DMA %d cancelled due to NMI but all data transferred", s);
timer_adjust_oneshot(sh4->dma_timer[s], attotime::never, s);
sh4->dma_timer[s]->adjust(attotime::never, s);
sh4->dma_timer_active[s] = 0;
}
}
@ -671,7 +671,7 @@ WRITE32_HANDLER( sh4_internal_w )
}
else
{
timer_adjust_oneshot(sh4->refresh_timer, attotime::never, 0);
sh4->refresh_timer->adjust(attotime::never);
}
break;
@ -717,11 +717,11 @@ WRITE32_HANDLER( sh4_internal_w )
}
if ((sh4->m[RCR2] & 8) && (~old & 8))
{ // 0 -> 1
timer_adjust_oneshot(sh4->rtc_timer, attotime::from_hz(128), 0);
sh4->rtc_timer->adjust(attotime::from_hz(128));
}
else if (~(sh4->m[RCR2]) & 8)
{ // 0
timer_adjust_oneshot(sh4->rtc_timer, attotime::never, 0);
sh4->rtc_timer->adjust(attotime::never);
}
break;
@ -730,21 +730,21 @@ WRITE32_HANDLER( sh4_internal_w )
if (old & 1)
sh4->m[TCNT0] = compute_ticks_timer(sh4->timer[0], sh4->pm_clock, tcnt_div[sh4->m[TCR0] & 7]);
if ((sh4->m[TSTR] & 1) == 0) {
timer_adjust_oneshot(sh4->timer[0], attotime::never, 0);
sh4->timer[0]->adjust(attotime::never);
} else
sh4_timer_recompute(sh4, 0);
if (old & 2)
sh4->m[TCNT1] = compute_ticks_timer(sh4->timer[1], sh4->pm_clock, tcnt_div[sh4->m[TCR1] & 7]);
if ((sh4->m[TSTR] & 2) == 0) {
timer_adjust_oneshot(sh4->timer[1], attotime::never, 0);
sh4->timer[1]->adjust(attotime::never);
} else
sh4_timer_recompute(sh4, 1);
if (old & 4)
sh4->m[TCNT2] = compute_ticks_timer(sh4->timer[2], sh4->pm_clock, tcnt_div[sh4->m[TCR2] & 7]);
if ((sh4->m[TSTR] & 4) == 0) {
timer_adjust_oneshot(sh4->timer[2], attotime::never, 0);
sh4->timer[2]->adjust(attotime::never);
} else
sh4_timer_recompute(sh4, 2);
break;
@ -945,7 +945,7 @@ READ32_HANDLER( sh4_internal_r )
if ((sh4->m[RTCSR] >> 3) & 7)
{ // activated
//((double)rtcnt_div[(sh4->m[RTCSR] >> 3) & 7] / (double)100000000)
//return (refresh_timer_base + (timer_timeelapsed(sh4->refresh_timer) * (double)100000000) / (double)rtcnt_div[(sh4->m[RTCSR] >> 3) & 7]) & 0xff;
//return (refresh_timer_base + (sh4->refresh_timer->elapsed() * (double)100000000) / (double)rtcnt_div[(sh4->m[RTCSR] >> 3) & 7]) & 0xff;
return compute_ticks_refresh_timer(sh4->refresh_timer, sh4->bus_clock, sh4->refresh_timer_base, rtcnt_div[(sh4->m[RTCSR] >> 3) & 7]) & 0xff;
}
else
@ -1161,21 +1161,21 @@ void sh4_common_init(device_t *device)
for (i=0; i<3; i++)
{
sh4->timer[i] = device->machine->scheduler().timer_alloc(FUNC(sh4_timer_callback), sh4);
timer_adjust_oneshot(sh4->timer[i], attotime::never, i);
sh4->timer[i]->adjust(attotime::never, i);
}
for (i=0; i<4; i++)
{
sh4->dma_timer[i] = device->machine->scheduler().timer_alloc(FUNC(sh4_dmac_callback), sh4);
timer_adjust_oneshot(sh4->dma_timer[i], attotime::never, i);
sh4->dma_timer[i]->adjust(attotime::never, i);
}
sh4->refresh_timer = device->machine->scheduler().timer_alloc(FUNC(sh4_refresh_timer_callback), sh4);
timer_adjust_oneshot(sh4->refresh_timer, attotime::never, 0);
sh4->refresh_timer->adjust(attotime::never);
sh4->refresh_timer_base = 0;
sh4->rtc_timer = device->machine->scheduler().timer_alloc(FUNC(sh4_rtc_timer_callback), sh4);
timer_adjust_oneshot(sh4->rtc_timer, attotime::never, 0);
sh4->rtc_timer->adjust(attotime::never);
sh4->m = auto_alloc_array(device->machine, UINT32, 16384);
}

View File

@ -2354,7 +2354,7 @@ static void t90_start_timer(t90_Regs *cpustate, int i)
period = cpustate->timer_period * prescaler;
timer_adjust_periodic(cpustate->timer[i], period, i, period);
cpustate->timer[i]->adjust(period, i, period);
logerror("%04X: CPU Timer %d started at %lf Hz\n", cpustate->pc.w.l, i, 1.0 / period.as_double());
}
@ -2376,7 +2376,7 @@ static void t90_start_timer4(t90_Regs *cpustate)
period = cpustate->timer_period * prescaler;
timer_adjust_periodic(cpustate->timer[4], period, 4, period);
cpustate->timer[4]->adjust(period, 4, period);
logerror("%04X: CPU Timer 4 started at %lf Hz\n", cpustate->pc.w.l, 1.0 / period.as_double());
}
@ -2384,7 +2384,7 @@ static void t90_start_timer4(t90_Regs *cpustate)
static void t90_stop_timer(t90_Regs *cpustate, int i)
{
timer_adjust_oneshot(cpustate->timer[i], attotime::never, i);
cpustate->timer[i]->adjust(attotime::never, i);
logerror("%04X: CPU Timer %d stopped\n", cpustate->pc.w.l, i);
}

View File

@ -653,7 +653,7 @@ static CPU_INIT( tms34010 )
/* allocate a scanline timer and set it to go off at the start */
tms->scantimer = device->machine->scheduler().timer_alloc(FUNC(scanline_callback), tms);
timer_adjust_oneshot(tms->scantimer, attotime::zero, 0);
tms->scantimer->adjust(attotime::zero);
/* allocate the shiftreg */
tms->shiftreg = auto_alloc_array(device->machine, UINT16, SHIFTREG_SIZE/2);
@ -1040,7 +1040,7 @@ static TIMER_CALLBACK( scanline_callback )
/* note that we add !master (0 or 1) as a attoseconds value; this makes no practical difference */
/* but helps ensure that masters are updated first before slaves */
timer_adjust_oneshot(tms->scantimer, tms->screen->time_until_pos(vcount) + attotime(0, !master), vcount);
tms->scantimer->adjust(tms->screen->time_until_pos(vcount) + attotime(0, !master), vcount);
}
@ -1270,7 +1270,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
}
// if (LOG_CONTROL_REGS)
// logerror("%s: %s = %04X (%d)\n", cpuexec_describe_context(tms->device->machine), ioreg_name[offset], IOREG(tms, offset), tms->screen->vpos());
// logerror("%s: %s = %04X (%d)\n", tms->device->machine->describe_context(), ioreg_name[offset], IOREG(tms, offset), tms->screen->vpos());
}
@ -1307,7 +1307,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
IOREG(tms, offset) = data;
// if (LOG_CONTROL_REGS)
// logerror("%s: %s = %04X (%d)\n", cpuexec_describe_context(device->machine), ioreg020_name[offset], IOREG(tms, offset), tms->screen->vpos());
// logerror("%s: %s = %04X (%d)\n", device->machine->describe_context(), ioreg020_name[offset], IOREG(tms, offset), tms->screen->vpos());
switch (offset)
{
@ -1466,7 +1466,7 @@ READ16_HANDLER( tms34010_io_register_r )
int result, total;
// if (LOG_CONTROL_REGS)
// logerror("%s: read %s\n", cpuexec_describe_context(device->machine), ioreg_name[offset]);
// logerror("%s: read %s\n", device->machine->describe_context(), ioreg_name[offset]);
switch (offset)
{
@ -1494,7 +1494,7 @@ READ16_HANDLER( tms34010_io_register_r )
/* have an IRQ handler. For this reason, we return it signalled a bit early in order */
/* to make it past these loops. */
if (SMART_IOREG(tms, VCOUNT) + 1 == SMART_IOREG(tms, DPYINT) &&
timer_timeleft(tms->scantimer) < attotime::from_hz(40000000/8/3))
tms->scantimer->remaining() < attotime::from_hz(40000000/8/3))
result |= TMS34010_DI;
return result;
}
@ -1509,7 +1509,7 @@ READ16_HANDLER( tms34020_io_register_r )
int result, total;
// if (LOG_CONTROL_REGS)
// logerror("%s: read %s\n", cpuexec_describe_context(device->machine), ioreg_name[offset]);
// logerror("%s: read %s\n", device->machine->describe_context(), ioreg_name[offset]);
switch (offset)
{

View File

@ -933,7 +933,7 @@ WRITE8_HANDLER(tms9995_internal2_w)
/* read decrementer */
if (cpustate->decrementer_enabled && !(cpustate->flag & 1))
/* timer mode, timer enabled */
return cpustate->device->attotime_to_cycles(timer_timeleft(cpustate->timer) / 16);
return cpustate->device->attotime_to_cycles(cpustate->timer->remaining() / 16);
else
/* event counter mode or timer mode, timer disabled */
return cpustate->decrementer_count;
@ -997,7 +997,7 @@ WRITE8_HANDLER(tms9995_internal2_w)
if (cpustate->decrementer_enabled && !(cpustate->flag & 1))
/* timer mode, timer enabled */
value = cpustate->device->attotime_to_cycles(timer_timeleft(cpustate->timer) / 16);
value = cpustate->device->attotime_to_cycles(cpustate->timer->remaining() / 16);
else
/* event counter mode or timer mode, timer disabled */
value = cpustate->decrementer_count;
@ -1767,7 +1767,7 @@ static TIMER_CALLBACK( decrementer_callback )
*/
static void reset_decrementer(tms99xx_state *cpustate)
{
timer_adjust_oneshot(cpustate->timer, attotime::never, 0);
cpustate->timer->adjust(attotime::never);
/* reload count */
cpustate->decrementer_count = cpustate->decrementer_interval;
@ -1778,7 +1778,7 @@ static void reset_decrementer(tms99xx_state *cpustate)
if (cpustate->decrementer_enabled && ! (cpustate->flag & 1))
{ /* timer */
attotime period = cpustate->device->cycles_to_attotime(cpustate->decrementer_interval * 16L);
timer_adjust_periodic(cpustate->timer, period, 0, period);
cpustate->timer->adjust(period, 0, period);
}
}

View File

@ -353,18 +353,18 @@ INLINE void register_write(z8_state *cpustate, UINT8 offset, UINT8 data)
if (data & Z8_TMR_LOAD_T0)
{
cpustate->t0 = T0;
timer_adjust_periodic(cpustate->t0_timer, attotime::zero, 0, attotime::from_hz(cpustate->clock / 2 / 4 / ((PRE0 >> 2) + 1)));
cpustate->t0_timer->adjust(attotime::zero, 0, attotime::from_hz(cpustate->clock / 2 / 4 / ((PRE0 >> 2) + 1)));
}
timer_enable(cpustate->t0_timer, data & Z8_TMR_ENABLE_T0);
cpustate->t0_timer->enable(data & Z8_TMR_ENABLE_T0);
if (data & Z8_TMR_LOAD_T1)
{
cpustate->t1 = T1;
timer_adjust_periodic(cpustate->t1_timer, attotime::zero, 0, attotime::from_hz(cpustate->clock / 2 / 4 / ((PRE1 >> 2) + 1)));
cpustate->t1_timer->adjust(attotime::zero, 0, attotime::from_hz(cpustate->clock / 2 / 4 / ((PRE1 >> 2) + 1)));
}
timer_enable(cpustate->t1_timer, data & Z8_TMR_ENABLE_T1);
cpustate->t1_timer->enable(data & Z8_TMR_ENABLE_T1);
break;
case Z8_REGISTER_P2M:
@ -613,8 +613,8 @@ static TIMER_CALLBACK( t0_tick )
if (cpustate->t0 == 0)
{
cpustate->t0 = T0;
timer_adjust_periodic(cpustate->t0_timer, attotime::zero, 0, attotime::from_hz(cpustate->clock / 2 / 4 / ((PRE0 >> 2) + 1)));
timer_enable(cpustate->t0_timer, PRE0 & Z8_PRE0_COUNT_MODULO_N);
cpustate->t0_timer->adjust(attotime::zero, 0, attotime::from_hz(cpustate->clock / 2 / 4 / ((PRE0 >> 2) + 1)));
cpustate->t0_timer->enable(PRE0 & Z8_PRE0_COUNT_MODULO_N);
cpustate->irq[4] = ASSERT_LINE;
}
}
@ -628,8 +628,8 @@ static TIMER_CALLBACK( t1_tick )
if (cpustate->t1 == 0)
{
cpustate->t1 = T1;
timer_adjust_periodic(cpustate->t1_timer, attotime::zero, 0, attotime::from_hz(cpustate->clock / 2 / 4 / ((PRE1 >> 2) + 1)));
timer_enable(cpustate->t1_timer, PRE1 & Z8_PRE0_COUNT_MODULO_N);
cpustate->t1_timer->adjust(attotime::zero, 0, attotime::from_hz(cpustate->clock / 2 / 4 / ((PRE1 >> 2) + 1)));
cpustate->t1_timer->enable(PRE1 & Z8_PRE0_COUNT_MODULO_N);
cpustate->irq[5] = ASSERT_LINE;
}
}

View File

@ -639,7 +639,7 @@ void device_execute_interface::interface_post_reset()
{
attotime timedint_period = m_execute_config.m_timed_interrupt_period;
assert(m_timedint_timer != NULL);
timer_adjust_periodic(m_timedint_timer, timedint_period, 0, timedint_period);
m_timedint_timer->adjust(timedint_period, 0, timedint_period);
}
}
@ -742,7 +742,7 @@ void device_execute_interface::on_vblank_start(screen_device &screen)
if (m_execute_config.m_vblank_interrupts_per_frame > 1 && !suspended(SUSPEND_REASON_DISABLE))
{
m_partial_frame_period = device().machine->primary_screen->frame_period() / m_execute_config.m_vblank_interrupts_per_frame;
timer_adjust_oneshot(m_partial_frame_timer, m_partial_frame_period, 0);
m_partial_frame_timer->adjust(m_partial_frame_period);
}
}
}
@ -773,7 +773,7 @@ void device_execute_interface::trigger_partial_frame_interrupt()
// set up to retrigger if there's more interrupts to generate
if (m_iloops > 1)
timer_adjust_oneshot(m_partial_frame_timer, m_partial_frame_period, 0);
m_partial_frame_timer->adjust(m_partial_frame_period);
}

View File

@ -386,7 +386,7 @@ static TIMER_CALLBACK(bitbanger_output_timer)
else
logerror("Bitbanger: Output framing error.\n" );
timer_reset(bi->bitbanger_output_timer, attotime::never);
bi->bitbanger_output_timer->reset();
}
}
@ -410,7 +410,7 @@ static TIMER_CALLBACK(bitbanger_input_timer)
{
/* no more data, wait and try again */
bi->idle_delay = min(bi->idle_delay + attotime::from_msec(100), attotime::from_seconds(1));
timer_adjust_oneshot(bi->bitbanger_input_timer, bi->idle_delay, 0);
bi->bitbanger_input_timer->adjust(bi->idle_delay);
if( bi->mode == BITBANGER_MODEM )
@ -423,7 +423,7 @@ static TIMER_CALLBACK(bitbanger_input_timer)
else
{
bi->idle_delay = bi->current_baud;
timer_adjust_periodic(bi->bitbanger_input_timer, bi->idle_delay, 0, bi->idle_delay);
bi->bitbanger_input_timer->adjust(bi->idle_delay, 0, bi->idle_delay);
}
}
@ -450,7 +450,7 @@ void bitbanger_output(device_t *device, int value)
bi->build_byte = 0;
one_point_five_baud = bi->current_baud + bi->current_baud / 2;
timer_adjust_periodic(bi->bitbanger_output_timer, one_point_five_baud, 0, bi->current_baud);
bi->bitbanger_output_timer->adjust(one_point_five_baud, 0, bi->current_baud);
}
//fprintf(stderr,"%s, %d\n", device->machine->time().as_string(9), value);
@ -468,8 +468,8 @@ static DEVICE_IMAGE_LOAD( bitbanger )
bitbanger_token *bi;
bi = get_token(device);
timer_enable(bi->bitbanger_input_timer, TRUE);
timer_adjust_periodic(bi->bitbanger_input_timer, attotime::zero, 0, attotime::from_seconds(1));
bi->bitbanger_input_timer->enable(true);
bi->bitbanger_input_timer->adjust(attotime::zero, 0, attotime::from_seconds(1));
/* we don't need to do anything special */
return IMAGE_INIT_PASS;
@ -486,7 +486,7 @@ static DEVICE_IMAGE_UNLOAD( bitbanger )
bitbanger_token *bi;
bi = get_token(device);
timer_enable(bi->bitbanger_input_timer, FALSE);
bi->bitbanger_input_timer->enable(false);
}

View File

@ -70,7 +70,7 @@ struct _floppy_drive
int current_track;
/* index pulse timer */
void *index_timer;
emu_timer *index_timer;
/* index pulse callback */
void (*index_pulse_callback)(device_t *controller,device_t *image, int state);
/* rotation per minute => gives index pulse frequency */
@ -244,12 +244,12 @@ static void floppy_drive_index_func(device_t *img)
if (drive->idx)
{
drive->idx = 0;
timer_adjust_oneshot((emu_timer*)drive->index_timer, attotime::from_double(ms*19/20/1000.0), 0);
drive->index_timer->adjust(attotime::from_double(ms*19/20/1000.0));
}
else
{
drive->idx = 1;
timer_adjust_oneshot((emu_timer*)drive->index_timer, attotime::from_double(ms/20/1000.0), 0);
drive->index_timer->adjust(attotime::from_double(ms/20/1000.0));
}
devcb_call_write_line(&drive->out_idx_func, drive->idx);
@ -843,7 +843,7 @@ WRITE_LINE_DEVICE_HANDLER( floppy_mon_w )
/* on -> off */
else if (drive->mon == CLEAR_LINE && state)
timer_adjust_oneshot((emu_timer*)drive->index_timer, attotime::zero, 0);
drive->index_timer->adjust(attotime::zero);
drive->mon = state;
}

View File

@ -151,8 +151,8 @@ static DEVICE_IMAGE_LOAD( snapquick )
token->load = (snapquick_load_func) reinterpret_cast<snapquick_load_func>(image.get_device_specific_call());
/* adjust the timer */
timer_adjust_oneshot(
token->timer,
token->timer->adjust(
attotime(config->delay_seconds, config->delay_attoseconds),
0);

View File

@ -5060,7 +5060,7 @@ static void internal_post_key(running_machine *machine, unicode_char ch)
/* need to start up the timer? */
if (keybuf->begin_pos == keybuf->end_pos)
{
timer_adjust_oneshot(portdata->inputx_timer, choose_delay(portdata, ch), 0);
portdata->inputx_timer->adjust(choose_delay(portdata, ch));
keybuf->status_keydown = 0;
}
@ -5178,7 +5178,7 @@ static TIMER_CALLBACK(inputx_timerproc)
if (keybuf->begin_pos != keybuf->end_pos)
{
delay = choose_delay(portdata, keybuf->buffer[keybuf->begin_pos]);
timer_adjust_oneshot(portdata->inputx_timer, delay, 0);
portdata->inputx_timer->adjust(delay);
}
}

View File

@ -488,7 +488,7 @@ void running_machine::schedule_hard_reset()
void running_machine::schedule_soft_reset()
{
timer_adjust_oneshot(m_soft_reset_timer, attotime::zero, 0);
m_soft_reset_timer->adjust(attotime::zero);
// we can't be paused since the timer needs to fire
resume();

View File

@ -165,7 +165,7 @@ UINT16 via6522_device::get_counter1_value()
if(m_t1_active)
{
val = time_to_cycles(timer_timeleft(m_t1)) - IFR_DELAY;
val = time_to_cycles(m_t1->remaining()) - IFR_DELAY;
}
else
{
@ -304,7 +304,7 @@ void via6522_device::set_int(int data)
m_ifr |= data;
if (TRACE_VIA)
{
logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(&m_machine), tag(), m_ifr);
logerror("%s:6522VIA chip %s: IFR = %02X\n", m_machine.describe_context(), tag(), m_ifr);
}
if (m_ier & m_ifr)
@ -325,7 +325,7 @@ void via6522_device::clear_int(int data)
if (TRACE_VIA)
{
logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(&m_machine), tag(), m_ifr);
logerror("%s:6522VIA chip %s: IFR = %02X\n", m_machine.describe_context(), tag(), m_ifr);
}
if (m_ifr & m_ier)
@ -363,9 +363,9 @@ void via6522_device::shift()
if (m_shift_counter)
{
if (SO_O2_CONTROL(m_acr)) {
timer_adjust_oneshot(m_shift_timer, cycles_to_time(2), 0);
m_shift_timer->adjust(cycles_to_time(2));
} else {
timer_adjust_oneshot(m_shift_timer, cycles_to_time((m_t2ll + 2)*2), 0);
m_shift_timer->adjust(cycles_to_time((m_t2ll + 2)*2));
}
}
else
@ -432,7 +432,7 @@ void via6522_device::device_timer(emu_timer &timer, device_timer_id id, int para
{
m_out_b ^= 0x80;
}
timer_adjust_oneshot(m_t1, cycles_to_time(TIMER1_VALUE + IFR_DELAY), 0);
m_t1->adjust(cycles_to_time(TIMER1_VALUE + IFR_DELAY));
}
else
{
@ -492,7 +492,7 @@ READ8_MEMBER( via6522_device::read )
}
else
{
logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(&m_machine), tag());
logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", m_machine.describe_context(), tag());
}
}
}
@ -522,7 +522,7 @@ READ8_MEMBER( via6522_device::read )
}
else
{
logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(&m_machine), tag());
logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", m_machine.describe_context(), tag());
}
}
}
@ -558,7 +558,7 @@ READ8_MEMBER( via6522_device::read )
}
else
{
logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(&m_machine), tag());
logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", m_machine.describe_context(), tag());
}
}
@ -595,7 +595,7 @@ READ8_MEMBER( via6522_device::read )
clear_int(INT_T2);
if (m_t2_active)
{
val = time_to_cycles(timer_timeleft(m_t2)) & 0xff;
val = time_to_cycles(m_t2->remaining()) & 0xff;
}
else
{
@ -613,7 +613,7 @@ READ8_MEMBER( via6522_device::read )
case VIA_T2CH:
if (m_t2_active)
{
val = time_to_cycles(timer_timeleft(m_t2)) >> 8;
val = time_to_cycles(m_t2->remaining()) >> 8;
}
else
{
@ -634,11 +634,11 @@ READ8_MEMBER( via6522_device::read )
clear_int(INT_SR);
if (SO_O2_CONTROL(m_acr))
{
timer_adjust_oneshot(m_shift_timer, cycles_to_time(2), 0);
m_shift_timer->adjust(cycles_to_time(2));
}
if (SO_T2_CONTROL(m_acr))
{
timer_adjust_oneshot(m_shift_timer, cycles_to_time((m_t2ll + 2)*2), 0);
m_shift_timer->adjust(cycles_to_time((m_t2ll + 2)*2));
}
break;
@ -802,7 +802,7 @@ WRITE8_MEMBER( via6522_device::write )
devcb_call_write8(&m_out_b_func, 0, write_data);
}
}
timer_adjust_oneshot(m_t1, cycles_to_time(TIMER1_VALUE + IFR_DELAY), 0);
m_t1->adjust(cycles_to_time(TIMER1_VALUE + IFR_DELAY));
m_t1_active = 1;
break;
@ -818,12 +818,12 @@ WRITE8_MEMBER( via6522_device::write )
if (!T2_COUNT_PB6(m_acr))
{
timer_adjust_oneshot(m_t2, cycles_to_time(TIMER2_VALUE + IFR_DELAY), 0);
m_t2->adjust(cycles_to_time(TIMER2_VALUE + IFR_DELAY));
m_t2_active = 1;
}
else
{
timer_adjust_oneshot(m_t2, cycles_to_time(TIMER2_VALUE), 0);
m_t2->adjust(cycles_to_time(TIMER2_VALUE));
m_t2_active = 1;
m_time2 = m_machine.time();
}
@ -835,11 +835,11 @@ WRITE8_MEMBER( via6522_device::write )
clear_int(INT_SR);
if (SO_O2_CONTROL(m_acr))
{
timer_adjust_oneshot(m_shift_timer, cycles_to_time(2), 0);
m_shift_timer->adjust(cycles_to_time(2));
}
if (SO_T2_CONTROL(m_acr))
{
timer_adjust_oneshot(m_shift_timer, cycles_to_time((m_t2ll + 2)*2), 0);
m_shift_timer->adjust(cycles_to_time((m_t2ll + 2)*2));
}
break;
@ -848,7 +848,7 @@ WRITE8_MEMBER( via6522_device::write )
if (TRACE_VIA)
{
logerror("%s:6522VIA chip %s: PCR = %02X\n", cpuexec_describe_context(&m_machine), tag(), data);
logerror("%s:6522VIA chip %s: PCR = %02X\n", m_machine.describe_context(), tag(), data);
}
if (CA2_FIX_OUTPUT(data) && CA2_OUTPUT_LEVEL(data) ^ m_out_ca2)
@ -887,7 +887,7 @@ WRITE8_MEMBER( via6522_device::write )
}
if (T1_CONTINUOUS(data))
{
timer_adjust_oneshot(m_t1, cycles_to_time(counter1 + IFR_DELAY), 0);
m_t1->adjust(cycles_to_time(counter1 + IFR_DELAY));
m_t1_active = 1;
}
}
@ -942,7 +942,7 @@ WRITE_LINE_MEMBER( via6522_device::write_ca1 )
if (state != m_in_ca1)
{
if (TRACE_VIA)
logerror("%s:6522VIA chip %s: CA1 = %02X\n", cpuexec_describe_context(&m_machine), tag(), state);
logerror("%s:6522VIA chip %s: CA1 = %02X\n", m_machine.describe_context(), tag(), state);
if ((CA1_LOW_TO_HIGH(m_pcr) && state) || (CA1_HIGH_TO_LOW(m_pcr) && !state))
{
@ -954,7 +954,7 @@ WRITE_LINE_MEMBER( via6522_device::write_ca1 )
}
else
{
logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(&m_machine), tag());
logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", m_machine.describe_context(), tag());
}
}
@ -1024,7 +1024,7 @@ WRITE_LINE_MEMBER( via6522_device::write_cb1 )
}
else
{
logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(&m_machine), tag());
logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", m_machine.describe_context(), tag());
}
}
if (SO_EXT_CONTROL(m_acr) || SI_EXT_CONTROL(m_acr))

View File

@ -856,7 +856,7 @@ void mos6526_device::reg_w(UINT8 offset, UINT8 data)
static int is_timer_active(emu_timer *timer)
{
attotime t = timer_firetime(timer);
attotime t = timer->expire();
return (t != attotime::never);
}
@ -873,7 +873,7 @@ void mos6526_device::cia_timer::update(int which, INT32 new_count)
/* update the timer count, if necessary */
if ((new_count == -1) && is_timer_active(m_timer))
{
UINT16 current_count = (timer_timeelapsed(m_timer) * m_clock).as_double();
UINT16 current_count = (m_timer->elapsed() * m_clock).as_double();
m_count = m_count - MIN(m_count, current_count);
}
@ -888,12 +888,12 @@ void mos6526_device::cia_timer::update(int which, INT32 new_count)
{
/* timer is on and is connected to clock */
attotime period = attotime::from_hz(m_clock) * (m_count ? m_count : 0x10000);
timer_adjust_oneshot(m_timer, period, which);
m_timer->adjust(period, which);
}
else
{
/* timer is off or not connected to clock */
timer_adjust_oneshot(m_timer, attotime::never, which);
m_timer->adjust(attotime::never, which);
}
}
@ -908,7 +908,7 @@ UINT16 mos6526_device::cia_timer::get_count()
if (is_timer_active(m_timer))
{
UINT16 current_count = (timer_timeelapsed(m_timer) * m_clock).as_double();
UINT16 current_count = (m_timer->elapsed() * m_clock).as_double();
count = m_count - MIN(m_count, current_count);
}
else

View File

@ -121,7 +121,7 @@ void riot6532_device::update_irqstate()
}
else
{
logerror("%s:6532RIOT chip #%d: no irq callback function\n", cpuexec_describe_context(&m_machine), m_index);
logerror("%s:6532RIOT chip #%d: no irq callback function\n", m_machine.describe_context(), m_index);
}
}
@ -171,13 +171,13 @@ UINT8 riot6532_device::get_timer()
/* if counting, return the number of ticks remaining */
else if (m_timerstate == TIMER_COUNTING)
{
return timer_timeleft(m_timer).as_ticks(clock()) >> m_timershift;
return m_timer->remaining().as_ticks(clock()) >> m_timershift;
}
/* if finishing, return the number of ticks without the shift */
else
{
return timer_timeleft(m_timer).as_ticks(clock());
return m_timer->remaining().as_ticks(clock());
}
}
@ -202,7 +202,7 @@ void riot6532_device::timer_end()
if(m_timerstate == TIMER_COUNTING)
{
m_timerstate = TIMER_FINISHING;
timer_adjust_oneshot(m_timer, attotime::from_ticks(256, clock()), 0);
m_timer->adjust(attotime::from_ticks(256, clock()));
/* signal timer IRQ as well */
m_irqstate |= TIMER_FLAG;
@ -212,7 +212,7 @@ void riot6532_device::timer_end()
/* if we finished finishing, keep spinning */
else if (m_timerstate == TIMER_FINISHING)
{
timer_adjust_oneshot(m_timer, attotime::from_ticks(256, clock()), 0);
m_timer->adjust(attotime::from_ticks(256, clock()));
}
}
@ -260,7 +260,7 @@ void riot6532_device::reg_w(UINT8 offset, UINT8 data)
/* update the timer */
m_timerstate = TIMER_COUNTING;
target = curtime.as_ticks(clock()) + 1 + (data << m_timershift);
timer_adjust_oneshot(m_timer, attotime::from_ticks(target, clock()) - curtime, 0);
m_timer->adjust(attotime::from_ticks(target, clock()) - curtime);
}
/* if A4 == 0 and A2 == 1, we are writing to the edge detect control */
@ -302,7 +302,7 @@ void riot6532_device::reg_w(UINT8 offset, UINT8 data)
}
else
{
logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", cpuexec_describe_context(&m_machine), tag(), 'A' + (offset & 1), data);
logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", m_machine.describe_context(), tag(), 'A' + (offset & 1), data);
}
}
@ -390,7 +390,7 @@ UINT8 riot6532_device::reg_r(UINT8 offset)
}
else
{
logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", cpuexec_describe_context(&m_machine), tag(), 'A' + (offset & 1));
logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", m_machine.describe_context(), tag(), 'A' + (offset & 1));
}
/* apply the DDR to the result */
@ -580,5 +580,5 @@ void riot6532_device::device_reset()
/* reset timer states */
m_timershift = 0;
m_timerstate = TIMER_IDLE;
timer_adjust_oneshot(m_timer, attotime::never, 0);
m_timer->adjust(attotime::never);
}

View File

@ -138,7 +138,7 @@ void ptm6840_device::device_start()
for (int i = 0; i < 3; i++)
{
timer_enable(m_timer[i], FALSE);
m_timer[i]->enable(false);
}
devcb_resolve_write_line(&m_irq_func, &m_config.m_irq_func, this);
@ -299,7 +299,7 @@ void ptm6840_device::subtract_from_counter(int counter, int count)
duration *= m_t3_divisor;
}
timer_adjust_oneshot(m_timer[counter], duration, 0);
m_timer[counter]->adjust(duration);
}
}
@ -390,7 +390,7 @@ UINT16 ptm6840_device::compute_counter( int counter )
PLOG(("MC6840 #%s: %d external clock freq %f \n", tag(), counter, clock));
}
/* See how many are left */
int remaining = (timer_timeleft(m_timer[counter]) * clock).as_double();
int remaining = (m_timer[counter]->remaining() * clock).as_double();
/* Adjust the count for dual byte mode */
if (m_control_reg[counter] & 0x04)
@ -468,15 +468,15 @@ void ptm6840_device::reload_count(int idx)
if (!m_external_clock[idx])
{
m_enabled[idx] = 0;
timer_enable(m_timer[idx],FALSE);
m_timer[idx]->enable(false);
}
}
else
#endif
{
m_enabled[idx] = 1;
timer_adjust_oneshot(m_timer[idx], duration, 0);
timer_enable(m_timer[idx], TRUE);
m_timer[idx]->adjust(duration);
m_timer[idx]->enable(true);
}
}
@ -500,7 +500,7 @@ READ8_DEVICE_HANDLER_TRAMPOLINE(ptm6840, ptm6840_read)
case PTM_6840_STATUS:
{
PLOG(("%s: MC6840 #%s: Status read = %04X\n", cpuexec_describe_context(&m_machine), tag(), m_status_reg));
PLOG(("%s: MC6840 #%s: Status read = %04X\n", m_machine.describe_context(), tag(), m_status_reg));
m_status_read_since_int |= m_status_reg & 0x07;
val = m_status_reg;
break;
@ -522,7 +522,7 @@ READ8_DEVICE_HANDLER_TRAMPOLINE(ptm6840, ptm6840_read)
m_lsb_buffer = result & 0xff;
PLOG(("%s: MC6840 #%s: Counter %d read = %04X\n", cpuexec_describe_context(&m_machine), tag(), idx, result >> 8));
PLOG(("%s: MC6840 #%s: Counter %d read = %04X\n", m_machine.describe_context(), tag(), idx, result >> 8));
val = result >> 8;
break;
}
@ -582,7 +582,7 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(ptm6840, ptm6840_write)
PLOG(("MC6840 #%s : Timer reset\n", tag()));
for (int i = 0; i < 3; i++)
{
timer_enable(m_timer[i], FALSE);
m_timer[i]->enable(false);
m_enabled[i] = 0;
}
}
@ -633,7 +633,7 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(ptm6840, ptm6840_write)
reload_count(idx);
}
PLOG(("%s:MC6840 #%s: Counter %d latch = %04X\n", cpuexec_describe_context(&m_machine), tag(), idx, m_latch[idx]));
PLOG(("%s:MC6840 #%s: Counter %d latch = %04X\n", m_machine.describe_context(), tag(), idx, m_latch[idx]));
break;
}
}
@ -813,7 +813,7 @@ void ptm6840_device::ptm6840_set_ext_clock(int counter, double clock)
if (!m_external_clock[counter])
{
m_enabled[counter] = 0;
timer_enable(m_timer[counter], FALSE);
m_timer[counter]->enable(false);
}
}
else
@ -841,8 +841,8 @@ void ptm6840_device::ptm6840_set_ext_clock(int counter, double clock)
}
m_enabled[counter] = 1;
timer_adjust_oneshot(m_timer[counter], duration, 0);
timer_enable(m_timer[counter], TRUE);
m_timer[counter]->adjust(duration);
m_timer[counter]->enable(true);
}
}

View File

@ -122,8 +122,8 @@ void acia6850_device::device_start()
m_status_read = 0;
m_brk = 0;
timer_reset(m_rx_timer, attotime::never);
timer_reset(m_tx_timer, attotime::never);
m_rx_timer->reset();
m_tx_timer->reset();
state_save_register_device_item(this, 0, m_ctrl);
state_save_register_device_item(this, 0, m_status);
@ -292,13 +292,13 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(acia6850, acia6850_ctrl_w )
if (m_rx_clock)
{
attotime rx_period = attotime::from_hz(m_rx_clock) * m_divide;
timer_adjust_periodic(m_rx_timer, rx_period, 0, rx_period);
m_rx_timer->adjust(rx_period, 0, rx_period);
}
if (m_tx_clock)
{
attotime tx_period = attotime::from_hz(m_tx_clock) * m_divide;
timer_adjust_periodic(m_tx_timer, tx_period, 0, tx_period);
m_tx_timer->adjust(tx_period, 0, tx_period);
}
}
}
@ -349,7 +349,7 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(acia6850, acia6850_data_w)
}
else
{
logerror("%s:ACIA %p: Data write while in reset!\n", cpuexec_describe_context(&m_machine), this);
logerror("%s:ACIA %p: Data write while in reset!\n", m_machine.describe_context(), this);
}
}
@ -746,7 +746,7 @@ void acia6850_device::set_rx_clock(int clock)
if (m_rx_clock)
{
attotime rx_period = attotime::from_hz(m_rx_clock) * m_divide;
timer_adjust_periodic(m_rx_timer, rx_period, 0, rx_period);
m_rx_timer->adjust(rx_period, 0, rx_period);
}
}
@ -773,7 +773,7 @@ void acia6850_device::set_tx_clock(int clock)
if (m_tx_clock)
{
attotime tx_period = attotime::from_hz(m_tx_clock) * m_divide;
timer_adjust_periodic(m_tx_timer, tx_period, 0, tx_period);
m_tx_timer->adjust(tx_period, 0, tx_period);
}
}

View File

@ -335,7 +335,7 @@ static void duart68681_write_CR(duart68681_state *duart68681, int ch, UINT8 data
duart68681->ISR &= ~INT_TXRDYA;
else
duart68681->ISR &= ~INT_TXRDYB;
timer_adjust_oneshot(duart68681->channel[ch].tx_timer, attotime::never, ch);
duart68681->channel[ch].tx_timer->adjust(attotime::never, ch);
break;
case 4: /* Reset Error Status */
duart68681->channel[ch].SR &= ~(STATUS_RECEIVED_BREAK | STATUS_FRAMING_ERROR | STATUS_PARITY_ERROR | STATUS_OVERRUN_ERROR);
@ -448,7 +448,7 @@ static TIMER_CALLBACK( tx_timer_callback )
duart68681->ISR |= INT_TXRDYB;
duart68681_update_interrupts(duart68681);
timer_adjust_oneshot(duart68681->channel[ch].tx_timer, attotime::never, ch);
duart68681->channel[ch].tx_timer->adjust(attotime::never, ch);
};
static void duart68681_write_TX(duart68681_state* duart68681, int ch, UINT8 data)
@ -468,7 +468,7 @@ static void duart68681_write_TX(duart68681_state* duart68681, int ch, UINT8 data
duart68681_update_interrupts(duart68681);
period = attotime::from_hz(duart68681->channel[ch].baud_rate / 10 );
timer_adjust_oneshot(duart68681->channel[ch].tx_timer, period, ch);
duart68681->channel[ch].tx_timer->adjust(period, ch);
};
@ -559,13 +559,13 @@ READ8_DEVICE_HANDLER(duart68681_r)
case 0x03: /* Counter, CLK/16 */
{
attotime rate = attotime::from_hz(2*device->clock()/(2*16*16*duart68681->CTR.w.l));
timer_adjust_periodic(duart68681->duart_timer, rate, 0, rate);
duart68681->duart_timer->adjust(rate, 0, rate);
}
break;
case 0x06: /* Timer, CLK/1 */
{
attotime rate = attotime::from_hz(2*device->clock()/(2*16*duart68681->CTR.w.l));
timer_adjust_periodic(duart68681->duart_timer, rate, 0, rate);
duart68681->duart_timer->adjust(rate, 0, rate);
}
break;
case 0x07: /* Timer, CLK/16 */
@ -574,7 +574,7 @@ READ8_DEVICE_HANDLER(duart68681_r)
//attotime rate = attotime::from_hz(duart68681->clock) * (16*duart68681->CTR.w.l);
attotime rate = attotime::from_hz(2*device->clock()/(2*16*16*duart68681->CTR.w.l));
//hz = ATTOSECONDS_TO_HZ(rate.attoseconds);
timer_adjust_periodic(duart68681->duart_timer, rate, 0, rate);
duart68681->duart_timer->adjust(rate, 0, rate);
}
break;
}
@ -582,7 +582,7 @@ READ8_DEVICE_HANDLER(duart68681_r)
case 0x0f: /* Stop counter command */
duart68681->ISR &= ~INT_COUNTER_READY;
if (((duart68681->ACR >>4)& 0x07) < 4) // if in counter mode...
timer_adjust_oneshot(duart68681->duart_timer, attotime::never, 0); // shut down timer
duart68681->duart_timer->adjust(attotime::never); // shut down timer
duart68681_update_interrupts(duart68681);
break;
default:
@ -783,8 +783,8 @@ static DEVICE_RESET(duart68681)
duart68681->duart_config->output_port_write(duart68681->device, duart68681->OPR ^ 0xff);
// reset timers
timer_adjust_oneshot(duart68681->channel[0].tx_timer, attotime::never, 0);
timer_adjust_oneshot(duart68681->channel[1].tx_timer, attotime::never, 1);
duart68681->channel[0].tx_timer->adjust(attotime::never);
duart68681->channel[1].tx_timer->adjust(attotime::never, 1);
}
/*-------------------------------------------------

View File

@ -173,8 +173,8 @@ attotime ttl74123_device::compute_duration()
int ttl74123_device::timer_running()
{
return (timer_timeleft(m_timer) > attotime::zero) &&
(timer_timeleft(m_timer) != attotime::never);
return (m_timer->remaining() > attotime::zero) &&
(m_timer->remaining() != attotime::never);
}
@ -239,9 +239,9 @@ void ttl74123_device::start_pulse()
/* retriggering, but not if we are called to quickly */
attotime delay_time = attotime(0, ATTOSECONDS_PER_SECOND * m_config.m_cap * 220);
if(timer_timeelapsed(m_timer) >= delay_time)
if(m_timer->elapsed() >= delay_time)
{
timer_adjust_oneshot(m_timer, duration, 0);
m_timer->adjust(duration);
if (LOG) logerror("74123 %s: Retriggering pulse. Duration: %f\n", tag(), duration.as_double());
}
@ -253,7 +253,7 @@ void ttl74123_device::start_pulse()
else
{
/* starting */
timer_adjust_oneshot(m_timer, duration, 0);
m_timer->adjust(duration);
set_output();
@ -325,7 +325,7 @@ void ttl74123_device::clear_w(UINT8 data)
}
else if (!data) /* clear the output */
{
timer_adjust_oneshot(m_timer, attotime::zero, 0);
m_timer->adjust(attotime::zero);
if (LOG) logerror("74123 #%s: Cleared\n", tag() );
}

View File

@ -150,7 +150,7 @@ void i8237_device::device_reset()
m_chan[2].m_mode = 0;
m_chan[3].m_mode = 0;
timer_adjust_periodic(m_timer, attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
m_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
}
@ -310,7 +310,7 @@ void i8237_device::i8237_timerproc()
devcb_call_write_line(&m_out_hrq_func, m_hrq);
m_state = DMA8237_S0;
timer_enable( m_timer, 1 );
m_timer->enable( true );
}
else if (m_command == 3 && (m_drq & 1))
{
@ -320,7 +320,7 @@ void i8237_device::i8237_timerproc()
}
else
{
timer_enable( m_timer, 0 );
m_timer->enable( false );
}
break;
}
@ -588,7 +588,7 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(i8237, i8237_w)
case 8:
/* DMA command register */
m_command = data;
timer_enable( m_timer, ( m_command & 0x04 ) ? 0 : 1 );
m_timer->enable( ( m_command & 0x04 ) ? 0 : 1 );
break;
case 9:
@ -598,7 +598,7 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(i8237, i8237_w)
if ( data & 0x04 )
{
m_drq |= 0x01 << channel;
timer_enable( m_timer, ( m_command & 0x04 ) ? 0 : 1 );
m_timer->enable( ( m_command & 0x04 ) ? 0 : 1 );
}
else
{
@ -673,7 +673,7 @@ void i8237_device::i8237_drq_write(int channel, int state)
m_drq &= ~( 0x01 << channel );
}
timer_enable( m_timer, ( m_command & 0x04 ) ? 0 : 1 );
m_timer->enable( ( m_command & 0x04 ) ? 0 : 1 );
}

View File

@ -330,7 +330,7 @@ void i8257_device::i8257_update_status()
if (pending_transfer)
{
next = attotime::from_hz(clock() / 4 );
timer_adjust_periodic(m_timer,
m_timer->adjust(
attotime::zero,
0,
/* 1 byte transferred in 4 clock cycles */
@ -339,7 +339,7 @@ void i8257_device::i8257_update_status()
else
{
/* no transfers active right now */
timer_reset(m_timer, attotime::never);
m_timer->reset();
}
/* set the halt line */
@ -349,7 +349,7 @@ void i8257_device::i8257_update_status()
void i8257_device::i8257_prepare_msb_flip()
{
timer_adjust_oneshot(m_msbflip_timer, attotime::zero, 0);
m_msbflip_timer->adjust(attotime::zero);
}

View File

@ -20,7 +20,7 @@ INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, running_machine *machin
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
logerror( "%s: %s", cpuexec_describe_context( machine ), buf );
logerror( "%s: %s", machine ->describe_context( ), buf );
}
}

View File

@ -233,11 +233,11 @@ void at28c16_device::write( offs_t offset, UINT8 data )
{
if( m_last_write >= 0 )
{
// logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", cpuexec_describe_context(machine), offset, data );
// logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", machine->describe_context(), offset, data );
}
else if( m_oe_12v )
{
// logerror( "%s: AT28C16: write( %04x, %02x ) erase\n", cpuexec_describe_context(machine), offset, data );
// logerror( "%s: AT28C16: write( %04x, %02x ) erase\n", machine->describe_context(), offset, data );
if( m_last_write < 0 )
{
for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
@ -246,7 +246,7 @@ void at28c16_device::write( offs_t offset, UINT8 data )
}
m_last_write = 0xff;
timer_adjust_oneshot( m_write_timer, attotime::from_usec( 200 ), 0 );
m_write_timer->adjust( attotime::from_usec( 200 ) );
}
}
else
@ -256,12 +256,12 @@ void at28c16_device::write( offs_t offset, UINT8 data )
offset += AT28C16_ID_BYTES;
}
// logerror( "%s: AT28C16: write( %04x, %02x )\n", cpuexec_describe_context(machine), offset, data );
// logerror( "%s: AT28C16: write( %04x, %02x )\n", machine->describe_context(), offset, data );
if( m_last_write < 0 && m_addrspace[ 0 ]->read_byte( offset ) != data )
{
m_addrspace[ 0 ]->write_byte( offset, data );
m_last_write = data;
timer_adjust_oneshot( m_write_timer, attotime::from_usec( 200 ), 0 );
m_write_timer->adjust( attotime::from_usec( 200 ) );
}
}
}
@ -277,7 +277,7 @@ UINT8 at28c16_device::read( offs_t offset )
if( m_last_write >= 0 )
{
UINT8 data = m_last_write ^ 0x80;
// logerror( "%s: AT28C16: read( %04x ) write status %02x\n", cpuexec_describe_context(machine), offset, data );
// logerror( "%s: AT28C16: read( %04x ) write status %02x\n", machine->describe_context(), offset, data );
return data;
}
else
@ -288,7 +288,7 @@ UINT8 at28c16_device::read( offs_t offset )
}
UINT8 data = m_addrspace[ 0 ]->read_byte( offset );
// logerror( "%s: AT28C16: read( %04x ) data %02x\n", cpuexec_describe_context(machine), offset, data );
// logerror( "%s: AT28C16: read( %04x ) data %02x\n", machine->describe_context(), offset, data );
return data;
}
}
@ -304,7 +304,7 @@ void at28c16_device::set_a9_12v( int state )
state &= 1;
if( m_a9_12v != state )
{
// logerror( "%s: AT28C16: set_a9_12v( %d )\n", cpuexec_describe_context(machine), state );
// logerror( "%s: AT28C16: set_a9_12v( %d )\n", machine->describe_context(), state );
m_a9_12v = state;
}
}
@ -320,7 +320,7 @@ void at28c16_device::set_oe_12v( int state )
state &= 1;
if( m_oe_12v != state )
{
// logerror( "%s: AT28C16: set_oe_12v( %d )\n", cpuexec_describe_context(machine), state );
// logerror( "%s: AT28C16: set_oe_12v( %d )\n", machine->describe_context(), state );
m_oe_12v = state;
}
}

View File

@ -166,7 +166,7 @@ static DEVICE_START( cdp1852 )
{
/* create the scan timer */
cdp1852->scan_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1852_scan_tick), (void *)device);
timer_adjust_periodic(cdp1852->scan_timer, attotime::zero, 0, attotime::from_hz(device->clock()));
cdp1852->scan_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock()));
}
/* register for state saving */

View File

@ -20,7 +20,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
logerror( "%s: %s", cpuexec_describe_context(machine), buf );
logerror( "%s: %s", machine->describe_context(), buf );
}
}
@ -63,7 +63,7 @@ static TIMER_CALLBACK( ds2401_reset )
verboselog( machine, 1, "ds2401_reset(%d)\n", which );
c->state = STATE_RESET;
timer_adjust_oneshot( c->timer, attotime::never, which );
c->timer->adjust( attotime::never, which );
}
static TIMER_CALLBACK( ds2401_tick )
@ -77,7 +77,7 @@ static TIMER_CALLBACK( ds2401_tick )
verboselog( machine, 2, "ds2401_tick(%d) state_reset1 %d\n", which, c->rx );
c->tx = 0;
c->state = STATE_RESET2;
timer_adjust_oneshot( c->timer, c->t_pdl, which );
c->timer->adjust( c->t_pdl, which );
break;
case STATE_RESET2:
verboselog( machine, 2, "ds2401_tick(%d) state_reset2 %d\n", which, c->rx );
@ -171,7 +171,7 @@ void ds2401_write( running_machine *machine, int which, int data )
break;
case STATE_COMMAND:
verboselog( machine, 2, "ds2401_write(%d) state_command\n", which );
timer_adjust_oneshot( c->timer, c->t_samp, which );
c->timer->adjust( c->t_samp, which );
break;
case STATE_READROM:
if( c->bit == 0 )
@ -188,13 +188,13 @@ void ds2401_write( running_machine *machine, int which, int data )
c->byte++;
}
verboselog( machine, 2, "ds2401_write(%d) state_readrom %d\n", which, c->tx );
timer_adjust_oneshot( c->timer, c->t_rdv, which );
c->timer->adjust( c->t_rdv, which );
break;
default:
verboselog( machine, 0, "ds2401_write(%d) state not handled: %d\n", which, c->state );
break;
}
timer_adjust_oneshot( c->reset_timer, c->t_rstl, which );
c->reset_timer->adjust( c->t_rstl, which );
}
else if( data == 1 && c->rx == 0 )
{
@ -202,10 +202,10 @@ void ds2401_write( running_machine *machine, int which, int data )
{
case STATE_RESET:
c->state = STATE_RESET1;
timer_adjust_oneshot( c->timer, c->t_pdh, which );
c->timer->adjust( c->t_pdh, which );
break;
}
timer_adjust_oneshot( c->reset_timer, attotime::never, which );
c->reset_timer->adjust( attotime::never, which );
}
c->rx = data;
}

View File

@ -130,7 +130,7 @@ void ds2404_device::device_start()
m_rtc[4] = (current_time >> 24) & 0xff;
emu_timer *timer = m_machine.scheduler().timer_alloc(FUNC(ds2404_tick_callback), (void *)this);
timer_adjust_periodic(timer, attotime::from_hz(256), 0, attotime::from_hz(256));
timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256));
}

View File

@ -160,7 +160,7 @@ void f3853_device::device_reset()
m_priority_line = FALSE;
m_external_interrupt_line = TRUE;
timer_enable(m_timer, 0);
m_timer->enable(false);
}
@ -190,7 +190,7 @@ void f3853_device::f3853_timer_start(UINT8 value)
{
attotime period = (value != 0xff) ? attotime::from_hz(clock()) * (m_value_to_cycle[value]*31) : attotime::never;
timer_adjust_oneshot(m_timer, period, 0);
m_timer->adjust(period);
}

View File

@ -47,7 +47,7 @@ INLINE void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level, const
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
logerror( "%s: I2CMEM(%s) %s", cpuexec_describe_context( device->machine ), device->tag(), buf );
logerror( "%s: I2CMEM(%s) %s", device->machine ->describe_context( ), device->tag(), buf );
}
}

View File

@ -1244,7 +1244,7 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* logit */
// if (BANK(bank, offset) != IDE_BANK0_DATA && BANK(bank, offset) != IDE_BANK0_STATUS_COMMAND && BANK(bank, offset) != IDE_BANK1_STATUS_CONTROL)
LOG(("%s:IDE read at %d:%X, size=%d\n", cpuexec_describe_context(device->machine), bank, offset, size));
LOG(("%s:IDE read at %d:%X, size=%d\n", device->machine->describe_context(), bank, offset, size));
switch (BANK(bank, offset))
{
@ -1279,7 +1279,7 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* if we're at the end of the buffer, handle it */
if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE)
{
LOG(("%s:IDE completed PIO read\n", cpuexec_describe_context(device->machine)));
LOG(("%s:IDE completed PIO read\n", device->machine->describe_context()));
continue_read(ide);
}
}
@ -1314,10 +1314,10 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* return the current status but don't clear interrupts */
case IDE_BANK1_STATUS_CONTROL:
result = ide->status;
if (timer_timeelapsed(ide->last_status_timer) > TIME_PER_ROTATION)
if (ide->last_status_timer->elapsed() > TIME_PER_ROTATION)
{
result |= IDE_STATUS_HIT_INDEX;
timer_adjust_oneshot(ide->last_status_timer, attotime::never, 0);
ide->last_status_timer->adjust(attotime::never);
}
/* clear interrutps only when reading the real status */
@ -1330,7 +1330,7 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* log anything else */
default:
logerror("%s:unknown IDE read at %03X, size=%d\n", cpuexec_describe_context(device->machine), offset, size);
logerror("%s:unknown IDE read at %03X, size=%d\n", device->machine->describe_context(), offset, size);
break;
}
@ -1352,7 +1352,7 @@ static void ide_controller_write(device_t *device, int bank, offs_t offset, int
/* logit */
if (BANK(bank, offset) != IDE_BANK0_DATA)
LOG(("%s:IDE write to %d:%X = %08X, size=%d\n", cpuexec_describe_context(device->machine), bank, offset, data, size));
LOG(("%s:IDE write to %d:%X = %08X, size=%d\n", device->machine->describe_context(), bank, offset, data, size));
// fprintf(stderr, "ide write %03x %02x size=%d\n", offset, data, size);
switch (BANK(bank, offset))
{
@ -1389,7 +1389,7 @@ static void ide_controller_write(device_t *device, int bank, offs_t offset, int
/* if we're at the end of the buffer, handle it */
if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE)
{
LOG(("%s:IDE completed PIO write\n", cpuexec_describe_context(device->machine)));
LOG(("%s:IDE completed PIO write\n", device->machine->describe_context()));
if (ide->command == IDE_COMMAND_SECURITY_UNLOCK)
{
if (ide->user_password_enable && memcmp(ide->buffer, ide->user_password, 2 + 32) == 0)
@ -1500,7 +1500,7 @@ static void ide_controller_write(device_t *device, int bank, offs_t offset, int
{
ide->status |= IDE_STATUS_BUSY;
ide->status &= ~IDE_STATUS_DRIVE_READY;
timer_adjust_oneshot(ide->reset_timer, attotime::from_msec(5), 0);
ide->reset_timer->adjust(attotime::from_msec(5));
}
break;
}
@ -1518,7 +1518,7 @@ static UINT32 ide_bus_master_read(device_t *device, offs_t offset, int size)
{
ide_state *ide = get_safe_token(device);
LOG(("%s:ide_bus_master_read(%d, %d)\n", cpuexec_describe_context(device->machine), offset, size));
LOG(("%s:ide_bus_master_read(%d, %d)\n", device->machine->describe_context(), offset, size));
/* command register */
if (offset == 0)
@ -1547,7 +1547,7 @@ static void ide_bus_master_write(device_t *device, offs_t offset, int size, UINT
{
ide_state *ide = get_safe_token(device);
LOG(("%s:ide_bus_master_write(%d, %d, %08X)\n", cpuexec_describe_context(device->machine), offset, size, data));
LOG(("%s:ide_bus_master_write(%d, %d, %08X)\n", device->machine->describe_context(), offset, size, data));
/* command register */
if (offset == 0)

View File

@ -133,7 +133,7 @@ READ8_DEVICE_HANDLER_TRAMPOLINE(ins8154, ins8154_r)
{
if (VERBOSE)
{
logerror("%s: INS8154 '%s' Read from invalid offset %02x!\n", cpuexec_describe_context(&m_machine), tag(), offset);
logerror("%s: INS8154 '%s' Read from invalid offset %02x!\n", m_machine.describe_context(), tag(), offset);
}
return 0xff;
}
@ -207,7 +207,7 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(ins8154, ins8154_w)
{
if (VERBOSE)
{
logerror("%s: INS8154 '%s' Write %02x to invalid offset %02x!\n", cpuexec_describe_context(&m_machine), tag(), data, offset);
logerror("%s: INS8154 '%s' Write %02x to invalid offset %02x!\n", m_machine.describe_context(), tag(), data, offset);
}
return;
}
@ -225,7 +225,7 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(ins8154, ins8154_w)
case 0x22:
if (VERBOSE)
{
logerror("%s: INS8154 '%s' ODRA set to %02x\n", cpuexec_describe_context(&m_machine), tag(), data);
logerror("%s: INS8154 '%s' ODRA set to %02x\n", m_machine.describe_context(), tag(), data);
}
m_odra = data;
@ -234,7 +234,7 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(ins8154, ins8154_w)
case 0x23:
if (VERBOSE)
{
logerror("%s: INS8154 '%s' ODRB set to %02x\n", cpuexec_describe_context(&m_machine), tag(), data);
logerror("%s: INS8154 '%s' ODRB set to %02x\n", m_machine.describe_context(), tag(), data);
}
m_odrb = data;
@ -243,7 +243,7 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(ins8154, ins8154_w)
case 0x24:
if (VERBOSE)
{
logerror("%s: INS8154 '%s' MDR set to %02x\n", cpuexec_describe_context(&m_machine), tag(), data);
logerror("%s: INS8154 '%s' MDR set to %02x\n", m_machine.describe_context(), tag(), data);
}
m_mdr = data;

View File

@ -600,11 +600,11 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
if (m_config.m_sector_is_4k)
{
timer_adjust_oneshot( m_timer, attotime::from_seconds( 1 ), 0 );
m_timer->adjust( attotime::from_seconds( 1 ) );
}
else
{
timer_adjust_oneshot( m_timer, attotime::from_seconds( 16 ), 0 );
m_timer->adjust( attotime::from_seconds( 16 ) );
}
}
else if( ( data & 0xff ) == 0x30 )
@ -617,14 +617,14 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
for (offs_t offs = 0; offs < 4 * 1024; offs++)
m_addrspace[0]->write_byte((base & ~0xfff) + offs, 0xff);
m_erase_sector = address & ((m_config.m_bits == 16) ? ~0x7ff : ~0xfff);
timer_adjust_oneshot( m_timer, attotime::from_msec( 125 ), 0 );
m_timer->adjust( attotime::from_msec( 125 ) );
}
else
{
for (offs_t offs = 0; offs < 64 * 1024; offs++)
m_addrspace[0]->write_byte((base & ~0xffff) + offs, 0xff);
m_erase_sector = address & ((m_config.m_bits == 16) ? ~0x7fff : ~0xffff);
timer_adjust_oneshot( m_timer, attotime::from_seconds( 1 ), 0 );
m_timer->adjust( attotime::from_seconds( 1 ) );
}
m_status = 1 << 3;
@ -680,7 +680,7 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
m_status = 0x00;
m_flash_mode = FM_READSTATUS;
timer_adjust_oneshot( m_timer, attotime::from_seconds( 1 ), 0 );
m_timer->adjust( attotime::from_seconds( 1 ) );
break;
}
else

View File

@ -91,7 +91,7 @@ UINT32 k033906_device::k033906_reg_r(int reg)
case 0x0f: return m_reg[0x0f]; // interrupt_line, interrupt_pin, min_gnt, max_lat
default:
fatalerror("%s: k033906_reg_r: %08X", cpuexec_describe_context(&m_machine), reg);
fatalerror("%s: k033906_reg_r: %08X", m_machine.describe_context(), reg);
}
return 0;
}
@ -139,7 +139,7 @@ void k033906_device::k033906_reg_w(int reg, UINT32 data)
break;
default:
fatalerror("%s:K033906_w: %08X, %08X", cpuexec_describe_context(&m_machine), data, reg);
fatalerror("%s:K033906_w: %08X, %08X", m_machine.describe_context(), data, reg);
}
}

View File

@ -263,7 +263,7 @@ static void ldv1000_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fiel
ld->device->machine->scheduler().timer_set(ld->screen->time_until_pos(19*2), FUNC(vbi_data_fetch), 0, ld);
/* boost interleave for the first 1ms to improve communications */
cpuexec_boost_interleave(ld->device->machine, attotime::zero, attotime::from_msec(1));
ld->device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_msec(1));
}
@ -525,7 +525,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_porta_w )
laserdisc_state *ld = ldcore_get_safe_token(device->owner());
ld->player->counter_start = data;
if (LOG_PORT_IO)
printf("%s:PORTA.0=%02X\n", cpuexec_describe_context(device->machine), data);
printf("%s:PORTA.0=%02X\n", device->machine->describe_context(), data);
}
@ -588,7 +588,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w )
player->portc0 = data;
if (LOG_PORT_IO && ((data ^ prev) & 0x0f) != 0)
{
printf("%s:PORTC.0=%02X", cpuexec_describe_context(device->machine), data);
printf("%s:PORTC.0=%02X", device->machine->describe_context(), data);
if (data & 0x01) printf(" PRELOAD");
if (!(data & 0x02)) printf(" /MULTIJUMP");
if (data & 0x04) printf(" SCANMODE");
@ -684,7 +684,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portb_w )
player->portb1 = data;
if (LOG_PORT_IO && ((data ^ prev) & 0xff) != 0)
{
printf("%s:PORTB.1=%02X:", cpuexec_describe_context(device->machine), data);
printf("%s:PORTB.1=%02X:", device->machine->describe_context(), data);
if (!(data & 0x01)) printf(" FOCSON");
if (!(data & 0x02)) printf(" SPDLRUN");
if (!(data & 0x04)) printf(" JUMPTRIG");
@ -740,7 +740,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portc_w )
player->portc1 = data;
if (LOG_PORT_IO && ((data ^ prev) & 0xcf) != 0)
{
printf("%s:PORTC.1=%02X", cpuexec_describe_context(device->machine), data);
printf("%s:PORTC.1=%02X", device->machine->describe_context(), data);
if (data & 0x01) printf(" AUD1");
if (data & 0x02) printf(" AUD2");
if (data & 0x04) printf(" AUDEN");

View File

@ -282,7 +282,7 @@ static UINT8 vp931_data_r(laserdisc_state *ld)
}
/* also boost interleave for 4 scanlines to ensure proper communications */
cpuexec_boost_interleave(ld->device->machine, attotime::zero, ld->screen->scan_period() * 4);
ld->device->machine->scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
return player->tocontroller;
}
@ -616,7 +616,7 @@ static WRITE8_HANDLER( to_controller_w )
(*player->data_ready_cb)(ld->device, TRUE);
/* also boost interleave for 4 scanlines to ensure proper communications */
cpuexec_boost_interleave(ld->device->machine, attotime::zero, ld->screen->scan_period() * 4);
ld->device->machine->scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
}

View File

@ -151,7 +151,7 @@ void mb3773_device::set_ck( int state )
void mb3773_device::reset_timer()
{
timer_adjust_oneshot( m_watchdog_timer, attotime::from_seconds( 5 ), 0 );
m_watchdog_timer->adjust( attotime::from_seconds( 5 ) );
}
TIMER_CALLBACK( mb3773_device::watchdog_timeout )

View File

@ -187,9 +187,9 @@ void mc146818_device::device_start()
emu_timer *timer = timer_alloc();
if (m_config.m_type == mc146818_device_config::MC146818_UTC) {
// hack: for apollo we increase the update frequency to stay in sync with real time
timer_adjust_periodic(timer, attotime::from_hz(2), 0, attotime::from_hz(2));
timer->adjust(attotime::from_hz(2), 0, attotime::from_hz(2));
} else {
timer_adjust_periodic(timer, attotime::from_hz(1), 0, attotime::from_hz(1));
timer->adjust(attotime::from_hz(1), 0, attotime::from_hz(1));
}
set_base_datetime();
}

View File

@ -727,7 +727,7 @@ inline void mc68901_device::timer_input(int index, int value)
case TCR_TIMER_PULSE_64:
case TCR_TIMER_PULSE_100:
case TCR_TIMER_PULSE_200:
timer_enable(m_timer[index], (value == aer));
m_timer[index]->enable((value == aer));
if (((m_ti[index] ^ aer) == 0) && ((value ^ aer) == 1))
{
@ -809,13 +809,13 @@ void mc68901_device::device_start()
if (m_config.rx_clock > 0)
{
m_rx_timer = timer_alloc(TIMER_RX);
timer_adjust_periodic(m_rx_timer, attotime::zero, 0, attotime::from_hz(m_config.rx_clock));
m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.rx_clock));
}
if (m_config.tx_clock > 0)
{
m_tx_timer = timer_alloc(TIMER_TX);
timer_adjust_periodic(m_tx_timer, attotime::zero, 0, attotime::from_hz(m_config.tx_clock));
m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.tx_clock));
}
/* register for state saving */
@ -1066,7 +1066,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
case TCR_TIMER_STOPPED:
if (LOG) logerror("MC68901 '%s' Timer A Stopped\n", tag());
timer_enable(m_timer[TIMER_A], 0);
m_timer[TIMER_A]->enable(false);
break;
case TCR_TIMER_DELAY_4:
@ -1079,13 +1079,13 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
int divisor = PRESCALER[m_tacr & 0x07];
if (LOG) logerror("MC68901 '%s' Timer A Delay Mode : %u Prescale\n", tag(), divisor);
timer_adjust_periodic(m_timer[TIMER_A], attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
m_timer[TIMER_A]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
}
break;
case TCR_TIMER_EVENT:
if (LOG) logerror("MC68901 '%s' Timer A Event Count Mode\n", tag());
timer_enable(m_timer[TIMER_A], 0);
m_timer[TIMER_A]->enable(false);
break;
case TCR_TIMER_PULSE_4:
@ -1098,8 +1098,8 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
int divisor = PRESCALER[m_tacr & 0x07];
if (LOG) logerror("MC68901 '%s' Timer A Pulse Width Mode : %u Prescale\n", tag(), divisor);
timer_adjust_periodic(m_timer[TIMER_A], attotime::never, 0, attotime::from_hz(m_timer_clock / divisor));
timer_enable(m_timer[TIMER_A], 0);
m_timer[TIMER_A]->adjust(attotime::never, 0, attotime::from_hz(m_timer_clock / divisor));
m_timer[TIMER_A]->enable(false);
}
break;
}
@ -1121,7 +1121,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
case TCR_TIMER_STOPPED:
if (LOG) logerror("MC68901 '%s' Timer B Stopped\n", tag());
timer_enable(m_timer[TIMER_B], 0);
m_timer[TIMER_B]->enable(false);
break;
case TCR_TIMER_DELAY_4:
@ -1134,13 +1134,13 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
int divisor = PRESCALER[m_tbcr & 0x07];
if (LOG) logerror("MC68901 '%s' Timer B Delay Mode : %u Prescale\n", tag(), divisor);
timer_adjust_periodic(m_timer[TIMER_B], attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
m_timer[TIMER_B]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
}
break;
case TCR_TIMER_EVENT:
if (LOG) logerror("MC68901 '%s' Timer B Event Count Mode\n", tag());
timer_enable(m_timer[TIMER_B], 0);
m_timer[TIMER_B]->enable(false);
break;
case TCR_TIMER_PULSE_4:
@ -1153,8 +1153,8 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
int divisor = PRESCALER[m_tbcr & 0x07];
if (LOG) logerror("MC68901 '%s' Timer B Pulse Width Mode : %u Prescale\n", tag(), DIVISOR);
timer_adjust_periodic(m_timer[TIMER_B], attotime::never, 0, attotime::from_hz(m_timer_clock / divisor));
timer_enable(m_timer[TIMER_B], 0);
m_timer[TIMER_B]->adjust(attotime::never, 0, attotime::from_hz(m_timer_clock / divisor));
m_timer[TIMER_B]->enable(false);
}
break;
}
@ -1176,7 +1176,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
case TCR_TIMER_STOPPED:
if (LOG) logerror("MC68901 '%s' Timer D Stopped\n", tag());
timer_enable(m_timer[TIMER_D], 0);
m_timer[TIMER_D]->enable(false);
break;
case TCR_TIMER_DELAY_4:
@ -1189,7 +1189,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
int divisor = PRESCALER[m_tcdcr & 0x07];
if (LOG) logerror("MC68901 '%s' Timer D Delay Mode : %u Prescale\n", tag(), divisor);
timer_adjust_periodic(m_timer[TIMER_D], attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
m_timer[TIMER_D]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
}
break;
}
@ -1198,7 +1198,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
case TCR_TIMER_STOPPED:
if (LOG) logerror("MC68901 '%s' Timer C Stopped\n", tag());
timer_enable(m_timer[TIMER_C], 0);
m_timer[TIMER_C]->enable(false);
break;
case TCR_TIMER_DELAY_4:
@ -1211,7 +1211,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
{
int divisor = PRESCALER[(m_tcdcr >> 4) & 0x07];
if (LOG) logerror("MC68901 '%s' Timer C Delay Mode : %u Prescale\n", tag(), divisor);
timer_adjust_periodic(m_timer[TIMER_C], attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
m_timer[TIMER_C]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor));
}
break;
}
@ -1222,7 +1222,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
m_tdr[TIMER_A] = data;
if (!timer_enabled(m_timer[TIMER_A]))
if (!m_timer[TIMER_A]->enabled())
{
m_tmc[TIMER_A] = data;
}
@ -1233,7 +1233,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
m_tdr[TIMER_B] = data;
if (!timer_enabled(m_timer[TIMER_B]))
if (!m_timer[TIMER_B]->enabled())
{
m_tmc[TIMER_B] = data;
}
@ -1244,7 +1244,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
m_tdr[TIMER_C] = data;
if (!timer_enabled(m_timer[TIMER_C]))
if (!m_timer[TIMER_C]->enabled())
{
m_tmc[TIMER_C] = data;
}
@ -1255,7 +1255,7 @@ void mc68901_device::register_w(offs_t offset, UINT8 data)
m_tdr[TIMER_D] = data;
if (!timer_enabled(m_timer[TIMER_D]))
if (!m_timer[TIMER_D]->enabled())
{
m_tmc[TIMER_D] = data;
}

View File

@ -160,7 +160,7 @@ void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microto
microtouch.touch_callback = touch_cb;
microtouch.timer = machine->scheduler().timer_alloc(FUNC(microtouch_timer_callback));
timer_adjust_periodic(microtouch.timer, attotime::from_hz(167*5), 0, attotime::from_hz(167*5));
microtouch.timer->adjust(attotime::from_hz(167*5), 0, attotime::from_hz(167*5));
state_save_register_item(machine, "microtouch", NULL, 0, microtouch.reset_done);
state_save_register_item(machine, "microtouch", NULL, 0, microtouch.format_tablet);

View File

@ -103,7 +103,7 @@ READ8_DEVICE_HANDLER( msm6242_r )
case MSM6242_REG_CF: return msm6242->reg[2];
}
logerror("%s: MSM6242 unmapped offset %02x read\n", cpuexec_describe_context(device->machine), offset);
logerror("%s: MSM6242 unmapped offset %02x read\n", device->machine->describe_context(), offset);
return 0;
}
@ -146,7 +146,7 @@ WRITE8_DEVICE_HANDLER( msm6242_w )
}
}
logerror("%s: MSM6242 unmapped offset %02x written with %02x\n", cpuexec_describe_context(device->machine), offset, data);
logerror("%s: MSM6242 unmapped offset %02x written with %02x\n", device->machine->describe_context(), offset, data);
}

View File

@ -159,7 +159,7 @@ static TIMER_CALLBACK( tx_fifo_timer_callback )
ch->pending_interrupt |= IRQ_TX_HOLDING_REG_EMPTY;
check_interrupts(machine, chip, channel);
timer_adjust_oneshot(duart[chip].ch[channel].tx_fifo_timer, attotime::never, (chip * 2) + channel);
duart[chip].ch[channel].tx_fifo_timer->adjust(attotime::never, (chip * 2) + channel);
}
static void duart_push_tx_fifo(int chip, int channel, UINT8 data)
@ -172,7 +172,7 @@ static void duart_push_tx_fifo(int chip, int channel, UINT8 data)
period = attotime::from_hz(duart[chip].frequency) * (ch->divisor * 16 * 16 * 8);
timer_adjust_oneshot(duart[chip].ch[channel].tx_fifo_timer, period, (chip * 2) + channel);
duart[chip].ch[channel].tx_fifo_timer->adjust(period, (chip * 2) + channel);
}
#ifdef UNUSED_FUNCTION
@ -401,10 +401,10 @@ void pc16552d_init(running_machine *machine, int chip, int frequency, void (* ir
// allocate transmit timers
duart[chip].ch[0].tx_fifo_timer = machine->scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
timer_adjust_oneshot(duart[chip].ch[0].tx_fifo_timer, attotime::never, (chip * 2) + 0);
duart[chip].ch[0].tx_fifo_timer->adjust(attotime::never, (chip * 2) + 0);
duart[chip].ch[1].tx_fifo_timer = machine->scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
timer_adjust_oneshot(duart[chip].ch[1].tx_fifo_timer, attotime::never, (chip * 2) + 1);
duart[chip].ch[1].tx_fifo_timer->adjust(attotime::never, (chip * 2) + 1);
}
void pc16552d_rx_data(running_machine *machine, int chip, int channel, UINT8 data)

View File

@ -114,7 +114,7 @@ static TIMER_CALLBACK( pic8259_timerproc )
INLINE void pic8259_set_timer(pic8259_t *pic8259)
{
timer_adjust_oneshot(pic8259->timer, attotime::zero, 0);
pic8259->timer->adjust(attotime::zero);
}

View File

@ -608,13 +608,13 @@ static void simulate2(device_t *device, struct pit8253_timer *timer, INT64 elaps
timer->cycles_to_output = cycles_to_output;
if (cycles_to_output == CYCLES_NEVER || timer->clockin == 0)
{
timer_adjust_oneshot(timer->updatetimer, attotime::never, timer->index);
timer->updatetimer->adjust(attotime::never, timer->index);
}
else
{
attotime next_fire_time = timer->last_updated + cycles_to_output * attotime::from_hz( timer->clockin );
timer_adjust_oneshot(timer->updatetimer, next_fire_time - device->machine->time(), timer->index );
timer->updatetimer->adjust(next_fire_time - device->machine->time(), timer->index );
}
LOG2(("pit8253: simulate2(): simulating %d cycles for %d in mode %d, bcd = %d, phase = %d, gate = %d, output %d, value = 0x%04x, cycles_to_output = %04x\n",
@ -645,7 +645,7 @@ static void simulate(device_t *device, struct pit8253_timer *timer, INT64 elapse
simulate2(device, timer, elapsed_cycles);
else
if ( timer->clockin )
timer_adjust_oneshot(timer->updatetimer, attotime::from_hz( timer->clockin ), timer->index );
timer->updatetimer->adjust(attotime::from_hz( timer->clockin ), timer->index );
}
@ -1082,7 +1082,7 @@ static void common_start( device_t *device, int device_type ) {
/* initialize timer */
timer->clockin = pit8253->config->timer[timerno].clockin;
timer->updatetimer = device->machine->scheduler().timer_alloc(FUNC(update_timer_cb), (void *)device);
timer_adjust_oneshot(timer->updatetimer, attotime::never, timerno);
timer->updatetimer->adjust(attotime::never, timerno);
/* resolve callbacks */
devcb_resolve_read_line(&timer->in_gate_func, &pit8253->config->timer[timerno].in_gate_func, device);

View File

@ -410,19 +410,19 @@ void rtc65271_w(device_t *device, int xramsel, offs_t offset, UINT8 data)
{
attotime period = attotime::from_hz(SQW_freq_table[data & reg_A_RS]);
attotime half_period = period / 2;
attotime elapsed = timer_timeelapsed(state->update_timer);
attotime elapsed = state->update_timer->elapsed();
if (half_period > elapsed)
timer_adjust_oneshot(state->SQW_timer, half_period - elapsed, 0);
state->SQW_timer->adjust(half_period - elapsed);
else
timer_adjust_oneshot(state->SQW_timer, half_period, 0);
state->SQW_timer->adjust(half_period);
}
else
{
state->SQW_internal_state = 0; /* right??? */
/* Stop the divider used for SQW and periodic interrupts. */
timer_adjust_oneshot(state->SQW_timer, attotime::never, 0);
state->SQW_timer->adjust(attotime::never);
}
}
/* The UIP bit is read-only */
@ -506,7 +506,7 @@ static TIMER_CALLBACK( rtc_SQW_callback )
}
half_period = attotime::from_hz(SQW_freq_table[state->regs[reg_A] & reg_A_RS]) / 2;
timer_adjust_oneshot(state->SQW_timer, half_period, 0);
state->SQW_timer->adjust(half_period);
}
/*
@ -689,7 +689,7 @@ static DEVICE_START( rtc65271 )
rtc65271_state *state = get_safe_token(device);
state->update_timer = device->machine->scheduler().timer_alloc(FUNC(rtc_begin_update_callback), (void *)device);
timer_adjust_periodic(state->update_timer, attotime::from_seconds(1), 0, attotime::from_seconds(1));
state->update_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1));
state->SQW_timer = device->machine->scheduler().timer_alloc(FUNC(rtc_SQW_callback), (void *)device);
state->interrupt_callback = config->interrupt_callback;

View File

@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt);
vsprintf( buf, s_fmt, v);
va_end( v);
logerror( "%s: %s", cpuexec_describe_context( machine), buf);
logerror( "%s: %s", machine->describe_context( ), buf);
}
}

View File

@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt);
vsprintf( buf, s_fmt, v);
va_end( v);
logerror( "%s: %s", cpuexec_describe_context( machine), buf);
logerror( "%s: %s", machine->describe_context( ), buf);
}
}

View File

@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt);
vsprintf( buf, s_fmt, v);
va_end( v);
logerror( "%s: %s", cpuexec_describe_context( machine), buf);
logerror( "%s: %s", machine->describe_context( ), buf);
}
}

View File

@ -722,7 +722,7 @@ static TIMER_CALLBACK( s3c24xx_lcd_timer_exp )
{
s3c24xx_lcd_render_tpal( device);
}
timer_adjust_oneshot( s3c24xx->lcd.timer, screen->time_until_pos( s3c24xx->lcd.vpos, s3c24xx->lcd.hpos), 0);
s3c24xx->lcd.timer->adjust( screen->time_until_pos( s3c24xx->lcd.vpos, s3c24xx->lcd.hpos));
}
static void s3c24xx_video_start( device_t *device, running_machine *machine)
@ -917,14 +917,14 @@ static void s3c24xx_lcd_start( device_t *device)
verboselog( device->machine, 1, "LCD start\n");
s3c24xx_lcd_configure( device);
s3c24xx_lcd_dma_init( device);
timer_adjust_oneshot( s3c24xx->lcd.timer, screen->time_until_pos( s3c24xx->lcd.vpos_min, s3c24xx->lcd.hpos_min), 0);
s3c24xx->lcd.timer->adjust( screen->time_until_pos( s3c24xx->lcd.vpos_min, s3c24xx->lcd.hpos_min));
}
static void s3c24xx_lcd_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
verboselog( device->machine, 1, "LCD stop\n");
timer_adjust_oneshot( s3c24xx->lcd.timer, attotime::never, 0);
s3c24xx->lcd.timer->adjust( attotime::never);
}
static void s3c24xx_lcd_recalc( device_t *device)
@ -1232,7 +1232,7 @@ static UINT16 s3c24xx_pwm_calc_observation( device_t *device, int ch)
s3c24xx_t *s3c24xx = get_token( device);
double timeleft, x1, x2;
UINT32 cnto;
timeleft = timer_timeleft( s3c24xx->pwm.timer[ch]).as_double();
timeleft = s3c24xx->pwm.timer[ch]->remaining( ).as_double();
// printf( "timeleft %f freq %d cntb %d cmpb %d\n", timeleft, s3c24xx->pwm.freq[ch], s3c24xx->pwm.cnt[ch], s3c24xx->pwm.cmp[ch]);
x1 = 1 / ((double)s3c24xx->pwm.freq[ch] / (s3c24xx->pwm.cnt[ch]- s3c24xx->pwm.cmp[ch] + 1));
x2 = x1 / timeleft;
@ -1357,11 +1357,11 @@ static void s3c24xx_pwm_start( device_t *device, int timer)
s3c24xx->pwm.freq[timer] = freq;
if (auto_reload)
{
timer_adjust_periodic( s3c24xx->pwm.timer[timer], attotime::from_hz( hz), timer, attotime::from_hz( hz));
s3c24xx->pwm.timer[timer]->adjust( attotime::from_hz( hz), timer, attotime::from_hz( hz));
}
else
{
timer_adjust_oneshot( s3c24xx->pwm.timer[timer], attotime::from_hz( hz), timer);
s3c24xx->pwm.timer[timer]->adjust( attotime::from_hz( hz), timer);
}
}
@ -1369,7 +1369,7 @@ static void s3c24xx_pwm_stop( device_t *device, int timer)
{
s3c24xx_t *s3c24xx = get_token( device);
verboselog( device->machine, 1, "PWM %d stop\n", timer);
timer_adjust_oneshot( s3c24xx->pwm.timer[timer], attotime::never, 0);
s3c24xx->pwm.timer[timer]->adjust( attotime::never);
}
static void s3c24xx_pwm_recalc( device_t *device, int timer)
@ -2004,7 +2004,7 @@ static UINT16 s3c24xx_wdt_calc_current_count( device_t *device)
s3c24xx_t *s3c24xx = get_token( device);
double timeleft, x1, x2;
UINT32 cnt;
timeleft = timer_timeleft( s3c24xx->wdt.timer).as_double();
timeleft = s3c24xx->wdt.timer->remaining( ).as_double();
// printf( "timeleft %f freq %d cnt %d\n", timeleft, s3c24xx->wdt.freq, s3c24xx->wdt.cnt);
x1 = 1 / ((double)s3c24xx->wdt.freq / s3c24xx->wdt.cnt);
x2 = x1 / timeleft;
@ -2055,7 +2055,7 @@ static void s3c24xx_wdt_start( device_t *device)
freq = (double)pclk / (prescaler + 1) / clock;
hz = freq / s3c24xx->wdt.regs.wtcnt;
verboselog( device->machine, 5, "WDT pclk %d prescaler %d clock %d freq %f hz %f\n", pclk, prescaler, clock, freq, hz);
timer_adjust_periodic( s3c24xx->wdt.timer, attotime::from_hz( hz), 0, attotime::from_hz( hz));
s3c24xx->wdt.timer->adjust( attotime::from_hz( hz), 0, attotime::from_hz( hz));
#if defined(DEVICE_S3C2410)
s3c24xx->wdt.freq = freq;
s3c24xx->wdt.cnt = s3c24xx->wdt.regs.wtcnt;
@ -2067,7 +2067,7 @@ static void s3c24xx_wdt_stop( device_t *device)
s3c24xx_t *s3c24xx = get_token( device);
verboselog( device->machine, 1, "WDT stop\n");
s3c24xx->wdt.regs.wtcnt = s3c24xx_wdt_calc_current_count( device);
timer_adjust_oneshot( s3c24xx->wdt.timer, attotime::never, 0);
s3c24xx->wdt.timer->adjust( attotime::never);
}
static void s3c24xx_wdt_recalc( device_t *device)
@ -2223,7 +2223,7 @@ static void iic_start( device_t *device)
case 2 : i2c_send_byte( device, s3c24xx->iic.regs.iicds | 0x01); break;
case 3 : i2c_send_byte( device, s3c24xx->iic.regs.iicds & 0xFE); break;
}
timer_adjust_oneshot( s3c24xx->iic.timer, attotime::from_usec( 1), 0);
s3c24xx->iic.timer->adjust( attotime::from_usec( 1));
}
static void iic_stop( device_t *device)
@ -2231,7 +2231,7 @@ static void iic_stop( device_t *device)
s3c24xx_t *s3c24xx = get_token( device);
verboselog( device->machine, 1, "IIC stop\n");
i2c_send_stop( device);
timer_adjust_oneshot( s3c24xx->iic.timer, attotime::never, 0);
s3c24xx->iic.timer->adjust( attotime::never);
}
static void iic_resume( device_t *device)
@ -2245,7 +2245,7 @@ static void iic_resume( device_t *device)
case 2 : s3c24xx->iic.regs.iicds = i2c_receive_byte( device, BIT( s3c24xx->iic.regs.iiccon, 7)); break;
case 3 : i2c_send_byte( device, s3c24xx->iic.regs.iicds & 0xFF); break;
}
timer_adjust_oneshot( s3c24xx->iic.timer, attotime::from_usec( 1), 0);
s3c24xx->iic.timer->adjust( attotime::from_usec( 1));
}
static READ32_DEVICE_HANDLER( s3c24xx_iic_r )
@ -2383,14 +2383,14 @@ static void s3c24xx_iis_start( device_t *device)
pclk = s3c24xx_get_pclk( device);
freq = ((double)pclk / (prescaler_control_a + 1) / codeclk_table[codeclk]) * 2; // why do I have to multiply by two?
verboselog( device->machine, 5, "IIS - pclk %d psc_enable %d psc_a %d psc_b %d codeclk %d freq %f\n", pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk_table[codeclk], freq);
timer_adjust_periodic( s3c24xx->iis.timer, attotime::from_hz( freq), 0, attotime::from_hz( freq));
s3c24xx->iis.timer->adjust( attotime::from_hz( freq), 0, attotime::from_hz( freq));
}
static void s3c24xx_iis_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
verboselog( device->machine, 1, "IIS stop\n");
timer_adjust_oneshot( s3c24xx->iis.timer, attotime::never, 0);
s3c24xx->iis.timer->adjust( attotime::never);
}
static void s3c24xx_iis_recalc( device_t *device)
@ -2500,11 +2500,11 @@ static void s3c24xx_rtc_recalc( device_t *device)
ttc = BITS( s3c24xx->rtc.regs.ticnt, 6, 0);
freq = 128 / (ttc + 1);
// printf( "ttc %d freq %f\n", ttc, freq);
timer_adjust_periodic( s3c24xx->rtc.timer_tick_count, attotime::from_hz( freq), 0, attotime::from_hz( freq));
s3c24xx->rtc.timer_tick_count->adjust( attotime::from_hz( freq), 0, attotime::from_hz( freq));
}
else
{
timer_adjust_oneshot( s3c24xx->rtc.timer_tick_count, attotime::never, 0);
s3c24xx->rtc.timer_tick_count->adjust( attotime::never);
}
}
@ -3176,7 +3176,7 @@ static DEVICE_START( s3c24xx )
s3c24xx->rtc.timer_tick_count = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_tick_count_exp), (void*)device);
s3c24xx->rtc.timer_update = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_update_exp), (void*)device);
s3c24xx->wdt.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_wdt_timer_exp), (void*)device);
timer_adjust_periodic( s3c24xx->rtc.timer_update, attotime::from_msec( 1000), 0, attotime::from_msec( 1000));
s3c24xx->rtc.timer_update->adjust( attotime::from_msec( 1000), 0, attotime::from_msec( 1000));
s3c24xx_rtc_init( device);
}

View File

@ -28,7 +28,7 @@ static int scsidev_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
return 0;
default:
logerror( "%s: SCSIDEV unknown command %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] );
logerror( "%s: SCSIDEV unknown command %02x\n", scsiInstance->machine->describe_context(), command[ 0 ] );
return 0;
}
}
@ -43,7 +43,7 @@ static void scsidev_read_data( SCSIInstance *scsiInstance, UINT8 *data, int data
switch( command[ 0 ] )
{
default:
logerror( "%s: SCSIDEV unknown read %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] );
logerror( "%s: SCSIDEV unknown read %02x\n", scsiInstance->machine->describe_context(), command[ 0 ] );
break;
}
}
@ -58,7 +58,7 @@ static void scsidev_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dat
switch( command[ 0 ] )
{
default:
logerror( "%s: SCSIDEV unknown write %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] );
logerror( "%s: SCSIDEV unknown write %02x\n", scsiInstance->machine->describe_context(), command[ 0 ] );
break;
}
}

View File

@ -376,7 +376,7 @@ READ16_DEVICE_HANDLER( smc91c9x_r )
}
if (LOG_ETHERNET && offset != EREG_BANK)
logerror("%s:smc91c9x_r(%s) = %04X & %04X\n", cpuexec_describe_context(device->machine), ethernet_regname[offset], result, mem_mask);
logerror("%s:smc91c9x_r(%s) = %04X & %04X\n", device->machine->describe_context(), ethernet_regname[offset], result, mem_mask);
return result;
}
@ -401,7 +401,7 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w )
COMBINE_DATA(&smc->reg[offset]);
if (LOG_ETHERNET && offset != 7)
logerror("%s:smc91c9x_w(%s) = %04X & %04X\n", cpuexec_describe_context(device->machine), ethernet_regname[offset], data, mem_mask);
logerror("%s:smc91c9x_w(%s) = %04X & %04X\n", device->machine->describe_context(), ethernet_regname[offset], data, mem_mask);
/* handle it */
switch (offset)

View File

@ -229,7 +229,7 @@ void timekeeper_device::device_start()
timer = m_machine.scheduler().timer_alloc( FUNC(timekeeper_tick_callback), (void *)this );
duration = attotime::from_seconds(1);
timer_adjust_periodic( timer, duration, 0, duration );
timer->adjust( duration, 0, duration );
}
void m48t02_device::device_start()

View File

@ -23,7 +23,7 @@ static void tmp68301_update_timer( running_machine *machine, int i );
static IRQ_CALLBACK(tmp68301_irq_callback)
{
int vector = tmp68301_irq_vector[irqline];
// logerror("%s: irq callback returns %04X for level %x\n",cpuexec_describe_context(machine),vector,int_level);
// logerror("%s: irq callback returns %04X for level %x\n",machine->describe_context(),vector,int_level);
return vector;
}
@ -35,7 +35,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
UINT16 ICR = tmp68301_regs[0x8e/2+i]; // Interrupt Controller Register (ICR7..9)
UINT16 IVNR = tmp68301_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR)
// logerror("s: callback timer %04X, j = %d\n",cpuexec_describe_context(machine),i,tcount);
// logerror("s: callback timer %04X, j = %d\n",machine->describe_context(),i,tcount);
if ( (TCR & 0x0004) && // INT
!(IMR & (0x100<<i))
@ -70,7 +70,7 @@ static void tmp68301_update_timer( running_machine *machine, int i )
int max = 0;
attotime duration = attotime::zero;
timer_adjust_oneshot(tmp68301_timer[i],attotime::never,i);
tmp68301_timer[i]->adjust(attotime::never,i);
// timers 1&2 only
switch( (TCR & 0x0030)>>4 ) // MR2..1
@ -95,14 +95,14 @@ static void tmp68301_update_timer( running_machine *machine, int i )
break;
}
// logerror("%s: TMP68301 Timer %d, duration %lf, max %04X\n",cpuexec_describe_context(machine),i,duration,max);
// logerror("%s: TMP68301 Timer %d, duration %lf, max %04X\n",machine->describe_context(),i,duration,max);
if (!(TCR & 0x0002)) // CS
{
if (duration != attotime::zero)
timer_adjust_oneshot(tmp68301_timer[i],duration,i);
tmp68301_timer[i]->adjust(duration,i);
else
logerror("%s: TMP68301 error, timer %d duration is 0\n",cpuexec_describe_context(machine),i);
logerror("%s: TMP68301 error, timer %d duration is 0\n",machine->describe_context(),i);
}
}

View File

@ -238,7 +238,7 @@ static void wd33c93_read_data(int bytes, UINT8 *pData)
static void wd33c93_complete_immediate( running_machine *machine, int status )
{
/* reset our timer */
timer_reset( scsi_data.cmd_timer, attotime::never );
scsi_data.cmd_timer->reset( );
/* set the new status */
scsi_data.regs[WD_SCSI_STATUS] = status & 0xff;
@ -287,13 +287,13 @@ static TIMER_CALLBACK(wd33c93_deassert_cip)
static void wd33c93_complete_cmd( UINT8 status )
{
/* fire off a timer to complete the command */
timer_adjust_oneshot( scsi_data.cmd_timer, attotime::from_usec(1), status );
scsi_data.cmd_timer->adjust( attotime::from_usec(1), status );
}
/* command handlers */
static CMD_HANDLER( wd33c93_invalid_cmd )
{
logerror( "%s:Unknown/Unimplemented SCSI controller command: %02x\n", cpuexec_describe_context(machine), scsi_data.regs[WD_COMMAND] );
logerror( "%s:Unknown/Unimplemented SCSI controller command: %02x\n", machine->describe_context(), scsi_data.regs[WD_COMMAND] );
/* complete the command */
wd33c93_complete_cmd( CSR_INVALID );

View File

@ -25,7 +25,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
logerror( "%s: %s", cpuexec_describe_context(machine), buf );
logerror( "%s: %s", machine->describe_context(), buf );
}
}

View File

@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
logerror( "%s: %s", cpuexec_describe_context(machine), buf );
logerror( "%s: %s", machine->describe_context(), buf );
}
}

View File

@ -355,7 +355,7 @@ void z80ctc_device::ctc_channel::reset()
{
m_mode = RESET_ACTIVE;
m_tconst = 0x100;
timer_adjust_oneshot(m_timer, attotime::never, 0);
m_timer->adjust(attotime::never);
m_int_state = 0;
}
@ -401,7 +401,7 @@ UINT8 z80ctc_device::ctc_channel::read()
VPRINTF(("CTC clock %f\n",ATTOSECONDS_TO_HZ(period.attoseconds)));
if (m_timer != NULL)
return ((int)(timer_timeleft(m_timer).as_double() / period.as_double()) + 1) & 0xff;
return ((int)(m_timer->remaining().as_double() / period.as_double()) + 1) & 0xff;
else
return 0;
}
@ -437,10 +437,10 @@ void z80ctc_device::ctc_channel::write(UINT8 data)
if (!m_notimer)
{
attotime curperiod = period();
timer_adjust_periodic(m_timer, curperiod, m_index, curperiod);
m_timer->adjust(curperiod, m_index, curperiod);
}
else
timer_adjust_oneshot(m_timer, attotime::never, 0);
m_timer->adjust(attotime::never);
}
// else set the bit indicating that we're waiting for the appropriate trigger
@ -475,7 +475,7 @@ void z80ctc_device::ctc_channel::write(UINT8 data)
// if we're being reset, clear out any pending timers for this channel
if ((data & RESET) == RESET_ACTIVE)
{
timer_adjust_oneshot(m_timer, attotime::never, 0);
m_timer->adjust(attotime::never);
// note that we don't clear the interrupt state here!
}
}
@ -507,12 +507,12 @@ void z80ctc_device::ctc_channel::trigger(UINT8 data)
{
attotime curperiod = period();
VPRINTF(("CTC period %s\n", curperiod.as_string()));
timer_adjust_periodic(m_timer, curperiod, m_index, curperiod);
m_timer->adjust(curperiod, m_index, curperiod);
}
else
{
VPRINTF(("CTC disabled\n"));
timer_adjust_oneshot(m_timer, attotime::never, 0);
m_timer->adjust(attotime::never);
}
}

View File

@ -294,28 +294,28 @@ void z80dart_device::device_start()
{
// allocate channel A receive timer
m_rxca_timer = m_machine.scheduler().timer_alloc(FUNC(dart_channel::static_rxc_tick), (void *)&m_channel[CHANNEL_A]);
timer_adjust_periodic(m_rxca_timer, attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_a));
m_rxca_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_a));
}
if (m_config.m_tx_clock_a != 0)
{
// allocate channel A transmit timer
m_txca_timer = m_machine.scheduler().timer_alloc(FUNC(dart_channel::static_txc_tick), (void *)&m_channel[CHANNEL_A]);
timer_adjust_periodic(m_txca_timer, attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_a));
m_txca_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_a));
}
if (m_config.m_rx_clock_b != 0)
{
// allocate channel B receive timer
m_rxcb_timer = m_machine.scheduler().timer_alloc(FUNC(dart_channel::static_rxc_tick), (void *)&m_channel[CHANNEL_B]);
timer_adjust_periodic(m_rxcb_timer, attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_b));
m_rxcb_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_b));
}
if (m_config.m_tx_clock_b != 0)
{
// allocate channel B transmit timer
m_txcb_timer = m_machine.scheduler().timer_alloc(FUNC(dart_channel::static_txc_tick), (void *)&m_channel[CHANNEL_B]);
timer_adjust_periodic(m_txcb_timer, attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_b));
m_txcb_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_b));
}
state_save_register_device_item_array(this, 0, m_int_state);

View File

@ -607,7 +607,7 @@ void z80dma_device::update_status()
m_is_read = true;
m_cur_cycle = (PORTA_IS_SOURCE ? PORTA_CYCLE_LEN : PORTB_CYCLE_LEN);
next = attotime::from_hz(clock());
timer_adjust_periodic(m_timer,
m_timer->adjust(
attotime::zero,
0,
// 1 byte transferred in 4 clock cycles
@ -618,7 +618,7 @@ void z80dma_device::update_status()
if (m_is_read)
{
// no transfers active right now
timer_reset(m_timer, attotime::never);
m_timer->reset();
}
}

View File

@ -548,7 +548,7 @@ void z80sio_device::sio_channel::reset()
// start the receive timer running
attotime tpc = compute_time_per_character();
timer_adjust_periodic(m_receive_timer, tpc, 0, tpc);
m_receive_timer->adjust(tpc, 0, tpc);
}
@ -561,7 +561,7 @@ void z80sio_device::sio_channel::control_write(UINT8 data)
int regnum = m_regs[0] & 7;
if (regnum != 0 || (regnum & 0xf8) != 0)
VPRINTF(("%s:sio_reg_w(%c,%d) = %02X\n", cpuexec_describe_context(&m_device->m_machine), 'A' + m_index, regnum, data));
VPRINTF(("%s:sio_reg_w(%c,%d) = %02X\n", m_device->m_machine.describe_context(), 'A' + m_index, regnum, data));
// write a new value to the selected register
UINT8 old = m_regs[regnum];
@ -579,7 +579,7 @@ void z80sio_device::sio_channel::control_write(UINT8 data)
switch (data & SIO_WR0_COMMAND_MASK)
{
case SIO_WR0_COMMAND_CH_RESET:
VPRINTF(("%s:SIO reset channel %c\n", cpuexec_describe_context(&m_device->m_machine), 'A' + m_index));
VPRINTF(("%s:SIO reset channel %c\n", m_device->m_machine.describe_context(), 'A' + m_index));
reset();
break;
@ -640,7 +640,7 @@ UINT8 z80sio_device::sio_channel::control_read()
break;
}
VPRINTF(("%s:sio_reg_r(%c,%d) = %02x\n", cpuexec_describe_context(&m_device->m_machine), 'A' + m_index, regnum, m_status[regnum]));
VPRINTF(("%s:sio_reg_r(%c,%d) = %02x\n", m_device->m_machine.describe_context(), 'A' + m_index, regnum, m_status[regnum]));
return m_status[regnum];
}
@ -652,7 +652,7 @@ UINT8 z80sio_device::sio_channel::control_read()
void z80sio_device::sio_channel::data_write(UINT8 data)
{
VPRINTF(("%s:sio_data_w(%c) = %02X\n", cpuexec_describe_context(&m_device->m_machine), 'A' + m_index, data));
VPRINTF(("%s:sio_data_w(%c) = %02X\n", m_device->m_machine.describe_context(), 'A' + m_index, data));
// if tx not enabled, just ignore it
if (!(m_regs[5] & SIO_WR5_TX_ENABLE))
@ -681,7 +681,7 @@ UINT8 z80sio_device::sio_channel::data_read()
// reset the receive interrupt
clear_interrupt(INT_RECEIVE);
VPRINTF(("%s:sio_data_r(%c) = %02X\n", cpuexec_describe_context(&m_device->m_machine), 'A' + m_index, m_inbuf));
VPRINTF(("%s:sio_data_r(%c) = %02X\n", m_device->m_machine.describe_context(), 'A' + m_index, m_inbuf));
return m_inbuf;
}

View File

@ -253,14 +253,14 @@ void z80sti_device::device_start()
if (m_config.m_rx_clock > 0)
{
m_rx_timer = m_machine.scheduler().timer_alloc(FUNC(static_rx_tick), (void *)this);
timer_adjust_periodic(m_rx_timer, attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock));
m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock));
}
// create serial transmit clock timer
if (m_config.m_tx_clock > 0)
{
m_tx_timer = m_machine.scheduler().timer_alloc(FUNC(static_tx_tick), (void *)this);
timer_adjust_periodic(m_tx_timer, attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock));
m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock));
}
// register for state saving
@ -560,14 +560,14 @@ void z80sti_device::write(offs_t offset, UINT8 data)
LOG(("Z80STI '%s' Timer D Prescaler: %u\n", tag(), tdc));
if (tcc)
timer_adjust_periodic(m_timer[TIMER_C], attotime::from_hz(clock() / tcc), TIMER_C, attotime::from_hz(clock() / tcc));
m_timer[TIMER_C]->adjust(attotime::from_hz(clock() / tcc), TIMER_C, attotime::from_hz(clock() / tcc));
else
timer_enable(m_timer[TIMER_C], 0);
m_timer[TIMER_C]->enable(false);
if (tdc)
timer_adjust_periodic(m_timer[TIMER_D], attotime::from_hz(clock() / tdc), TIMER_D, attotime::from_hz(clock() / tdc));
m_timer[TIMER_D]->adjust(attotime::from_hz(clock() / tdc), TIMER_D, attotime::from_hz(clock() / tdc));
else
timer_enable(m_timer[TIMER_D], 0);
m_timer[TIMER_D]->enable(false);
if (BIT(data, 7))
{
@ -666,14 +666,14 @@ void z80sti_device::write(offs_t offset, UINT8 data)
LOG(("Z80STI '%s' Timer B Prescaler: %u\n", tag(), tbc));
if (tac)
timer_adjust_periodic(m_timer[TIMER_A], attotime::from_hz(clock() / tac), TIMER_A, attotime::from_hz(clock() / tac));
m_timer[TIMER_A]->adjust(attotime::from_hz(clock() / tac), TIMER_A, attotime::from_hz(clock() / tac));
else
timer_enable(m_timer[TIMER_A], 0);
m_timer[TIMER_A]->enable(false);
if (tbc)
timer_adjust_periodic(m_timer[TIMER_B], attotime::from_hz(clock() / tbc), TIMER_B, attotime::from_hz(clock() / tbc));
m_timer[TIMER_B]->adjust(attotime::from_hz(clock() / tbc), TIMER_B, attotime::from_hz(clock() / tbc));
else
timer_enable(m_timer[TIMER_B], 0);
m_timer[TIMER_B]->enable(false);
}
break;

View File

@ -790,7 +790,7 @@ private:
{
if (m_space.log_unmap() && !m_space.debugger_access())
logerror("%s: unmapped %s memory read from %s & %s\n",
cpuexec_describe_context(&m_space.m_machine), m_space.name(),
m_space.m_machine.describe_context(), m_space.name(),
core_i64_hex_format(m_space.byte_to_address(offset * sizeof(_UintType)), m_space.addrchars()),
core_i64_hex_format(mask, 2 * sizeof(_UintType)));
return m_space.unmap();
@ -846,7 +846,7 @@ private:
{
if (m_space.log_unmap() && !m_space.debugger_access())
logerror("%s: unmapped %s memory write to %s = %s & %s\n",
cpuexec_describe_context(&m_space.m_machine), m_space.name(),
m_space.m_machine.describe_context(), m_space.name(),
core_i64_hex_format(m_space.byte_to_address(offset * sizeof(_UintType)), m_space.addrchars()),
core_i64_hex_format(data, 2 * sizeof(_UintType)),
core_i64_hex_format(mask, 2 * sizeof(_UintType)));

View File

@ -58,12 +58,6 @@
#define MFUNC(s,c,x) s##_stub<c, &c::x>, #c "::" #x
// these must be macros because we are included before the running_machine
#define cpuexec_describe_context(mach) (mach)->describe_context()
#define cpuexec_boost_interleave(mach, slice, dur) (mach)->scheduler().boost_interleave(slice, dur)
#define cpuexec_trigger(mach, trigid) (mach)->scheduler().trigger(trigid)
#define cpuexec_triggertime(mach, trigid, dur) (mach)->scheduler().trigger(trigid, dur)
// macro for the RC time constant on a 74LS123 with C > 1000pF
// R is in ohms, C is in farads
#define TIME_OF_74LS123(r,c) (0.45 * (double)(r) * (double)(c))
@ -125,7 +119,7 @@ public:
void set_ptr(void *ptr) { m_ptr = ptr; }
// control
void reset(attotime duration) { adjust(duration, m_param, m_period); }
void reset(attotime duration = attotime::never) { adjust(duration, m_param, m_period); }
void adjust(attotime duration, INT32 param = 0, attotime periodicity = attotime::never);
// timing queries
@ -244,23 +238,4 @@ private:
};
// temporary stuff
inline void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param) { which->adjust(duration, param); }
inline void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, attotime period) { which->adjust(start_delay, param, period); }
inline void timer_reset(emu_timer *which, attotime duration) { which->reset(duration); }
inline int timer_enable(emu_timer *which, int enable) { return which->enable(enable); }
inline int timer_enabled(emu_timer *which) { return which->enabled(); }
inline int timer_get_param(emu_timer *which) { return which->param(); }
inline void timer_set_param(emu_timer *which, int param) { which->set_param(param); }
inline void *timer_get_ptr(emu_timer *which) { return which->ptr(); }
inline void timer_set_ptr(emu_timer *which, void *ptr) { which->set_ptr(ptr); }
inline attotime timer_timeelapsed(emu_timer *which) { return which->elapsed(); }
inline attotime timer_timeleft(emu_timer *which) { return which->remaining(); }
inline attotime timer_starttime(emu_timer *which) { return which->start(); }
inline attotime timer_firetime(emu_timer *which) { return which->expire(); }
#endif // __SCHEDULE_H__ */

View File

@ -360,7 +360,7 @@ void screen_device::device_start()
// start the timer to generate per-scanline updates
if ((machine->config->m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
timer_adjust_oneshot(m_scanline_timer, time_until_pos(0), 0);
m_scanline_timer->adjust(time_until_pos(0));
// create burn-in bitmap
if (options_get_int(machine->options(), OPTION_BURNIN) > 0)
@ -447,12 +447,12 @@ void screen_device::configure(int width, int height, const rectangle &visarea, a
// if we are on scanline 0 already, reset the update timer immediately
// otherwise, defer until the next scanline 0
if (vpos() == 0)
timer_adjust_oneshot(m_scanline0_timer, attotime::zero, 0);
m_scanline0_timer->adjust(attotime::zero);
else
timer_adjust_oneshot(m_scanline0_timer, time_until_pos(0), 0);
m_scanline0_timer->adjust(time_until_pos(0));
// start the VBLANK timer
timer_adjust_oneshot(m_vblank_begin_timer, time_until_vblank_start(), 0);
m_vblank_begin_timer->adjust(time_until_vblank_start());
// adjust speed if necessary
m_machine.video().update_refresh_speed();
@ -476,14 +476,14 @@ void screen_device::reset_origin(int beamy, int beamx)
if (beamy == 0 && beamx == 0)
scanline0_callback();
else
timer_adjust_oneshot(m_scanline0_timer, time_until_pos(0), 0);
m_scanline0_timer->adjust(time_until_pos(0));
// if we are resetting relative to (visarea.max_y + 1, 0) == VBLANK start,
// call the VBLANK start timer now; otherwise, adjust it for the future
if (beamy == m_visarea.max_y + 1 && beamx == 0)
vblank_begin_callback();
else
timer_adjust_oneshot(m_vblank_begin_timer, time_until_vblank_start(), 0);
m_vblank_begin_timer->adjust(time_until_vblank_start());
}
@ -799,13 +799,13 @@ void screen_device::vblank_begin_callback()
machine->video().frame_update();
// reset the VBLANK start timer for the next frame
timer_adjust_oneshot(m_vblank_begin_timer, time_until_vblank_start(), 0);
m_vblank_begin_timer->adjust(time_until_vblank_start());
// if no VBLANK period, call the VBLANK end callback immedietely, otherwise reset the timer
if (m_vblank_period == 0)
vblank_end_callback();
else
timer_adjust_oneshot(m_vblank_end_timer, time_until_vblank_end(), 0);
m_vblank_end_timer->adjust(time_until_vblank_end());
}
@ -840,7 +840,7 @@ void screen_device::scanline0_callback()
m_last_partial_scan = 0;
m_partial_updates_this_frame = 0;
timer_adjust_oneshot(m_scanline0_timer, time_until_pos(0), 0);
m_scanline0_timer->adjust(time_until_pos(0));
}
@ -858,7 +858,7 @@ void screen_device::scanline_update_callback(int scanline)
scanline++;
if (scanline > m_visarea.max_y)
scanline = m_visarea.min_y;
timer_adjust_oneshot(m_scanline_timer, time_until_pos(scanline), scanline);
m_scanline_timer->adjust(time_until_pos(scanline), scanline);
}

View File

@ -813,7 +813,7 @@ sound_manager::sound_manager(running_machine &machine)
set_attenuation(options_get_int(machine.options(), OPTION_VOLUME));
// start the periodic update flushing timer
timer_adjust_periodic(m_update_timer, STREAMS_UPDATE_ATTOTIME, 0, STREAMS_UPDATE_ATTOTIME);
m_update_timer->adjust(STREAMS_UPDATE_ATTOTIME, 0, STREAMS_UPDATE_ATTOTIME);
}

View File

@ -89,13 +89,13 @@ static void timer_handler(void *param,int c,int count,int clock)
ym2203_state *info = (ym2203_state *)param;
if( count == 0 )
{ /* Reset FM Timer */
timer_enable(info->timer[c], 0);
info->timer[c]->enable(false);
}
else
{ /* Start FM Timer */
attotime period = attotime::from_hz(clock) * count;
if (!timer_enable(info->timer[c], 1))
timer_adjust_oneshot(info->timer[c], period, 0);
if (!info->timer[c]->enable(true))
info->timer[c]->adjust(period);
}
}

View File

@ -95,13 +95,13 @@ static void timer_handler(void *param,int c,int count,int clock)
ym2608_state *info = (ym2608_state *)param;
if( count == 0 )
{ /* Reset FM Timer */
timer_enable(info->timer[c], 0);
info->timer[c]->enable(false);
}
else
{ /* Start FM Timer */
attotime period = attotime::from_hz(clock) * count;
if (!timer_enable(info->timer[c], 1))
timer_adjust_oneshot(info->timer[c], period, 0);
if (!info->timer[c]->enable(true))
info->timer[c]->adjust(period);
}
}

View File

@ -94,14 +94,14 @@ static void timer_handler(void *param,int c,int count,int clock)
ym2610_state *info = (ym2610_state *)param;
if( count == 0 )
{ /* Reset FM Timer */
timer_enable(info->timer[c], 0);
info->timer[c]->enable(false);
}
else
{ /* Start FM Timer */
attotime period = attotime::from_hz(clock) * count;
if (!timer_enable(info->timer[c], 1))
timer_adjust_oneshot(info->timer[c], period, 0);
if (!info->timer[c]->enable(true))
info->timer[c]->adjust(period);
}
}

View File

@ -62,13 +62,13 @@ static void timer_handler(void *param,int c,int count,int clock)
ym2612_state *info = (ym2612_state *)param;
if( count == 0 )
{ /* Reset FM Timer */
timer_enable(info->timer[c], 0);
info->timer[c]->enable(false);
}
else
{ /* Start FM Timer */
attotime period = attotime::from_hz(clock) * count;
if (!timer_enable(info->timer[c], 1))
timer_adjust_oneshot(info->timer[c], period, 0);
if (!info->timer[c]->enable(1))
info->timer[c]->adjust(period);
}
}

View File

@ -54,11 +54,11 @@ static void timer_handler_262(void *param,int timer, attotime period)
ymf262_state *info = (ymf262_state *)param;
if( period == attotime::zero )
{ /* Reset FM Timer */
timer_enable(info->timer[timer], 0);
info->timer[timer]->enable(false);
}
else
{ /* Start FM Timer */
timer_adjust_oneshot(info->timer[timer], period, 0);
info->timer[timer]->adjust(period);
}
}

View File

@ -64,11 +64,11 @@ static void TimerHandler(void *param,int c,attotime period)
ym3526_state *info = (ym3526_state *)param;
if( period == attotime::zero )
{ /* Reset FM Timer */
timer_enable(info->timer[c], 0);
info->timer[c]->enable(false);
}
else
{ /* Start FM Timer */
timer_adjust_oneshot(info->timer[c], period, 0);
info->timer[c]->adjust(period);
}
}

View File

@ -64,11 +64,11 @@ static void TimerHandler(void *param,int c,attotime period)
ym3812_state *info = (ym3812_state *)param;
if( period == attotime::zero )
{ /* Reset FM Timer */
timer_enable(info->timer[c], 0);
info->timer[c]->enable(false);
}
else
{ /* Start FM Timer */
timer_adjust_oneshot(info->timer[c], period, 0);
info->timer[c]->adjust(period);
}
}

View File

@ -61,11 +61,11 @@ static void TimerHandler(void *param,int c,attotime period)
y8950_state *info = (y8950_state *)param;
if( period == attotime::zero )
{ /* Reset FM Timer */
timer_enable(info->timer[c], 0);
info->timer[c]->enable(false);
}
else
{ /* Start FM Timer */
timer_adjust_oneshot(info->timer[c], period, 0);
info->timer[c]->adjust(period);
}
}

View File

@ -722,7 +722,7 @@ static void AICA_UpdateReg(aica_state *AICA, int reg)
time = (44100 / AICA->TimPris[0]) / (255-(AICA->udata.data[0x90/2]&0xff));
if (time)
{
timer_adjust_oneshot(AICA->timerA, attotime::from_hz(time), 0);
AICA->timerA->adjust(attotime::from_hz(time));
}
}
}
@ -741,7 +741,7 @@ static void AICA_UpdateReg(aica_state *AICA, int reg)
time = (44100 / AICA->TimPris[1]) / (255-(AICA->udata.data[0x94/2]&0xff));
if (time)
{
timer_adjust_oneshot(AICA->timerB, attotime::from_hz(time), 0);
AICA->timerB->adjust(attotime::from_hz(time));
}
}
}
@ -760,7 +760,7 @@ static void AICA_UpdateReg(aica_state *AICA, int reg)
time = (44100 / AICA->TimPris[2]) / (255-(AICA->udata.data[0x98/2]&0xff));
if (time)
{
timer_adjust_oneshot(AICA->timerC, attotime::from_hz(time), 0);
AICA->timerC->adjust(attotime::from_hz(time));
}
}
}

View File

@ -506,11 +506,11 @@ WRITE8_MEMBER( asc_device::write )
if (data != 0)
{
timer_adjust_periodic(m_sync_timer, attotime::zero, 0, attotime::from_hz(22257/4));
m_sync_timer->adjust(attotime::zero, 0, attotime::from_hz(22257/4));
}
else
{
timer_adjust_oneshot(m_sync_timer, attotime::never, 0);
m_sync_timer->adjust(attotime::never);
}
}
break;

View File

@ -887,7 +887,7 @@ int ay8910_read_ym(void *chip)
if (psg->portAread.read)
psg->regs[AY_PORTA] = devcb_call_read8(&psg->portAread, 0);
else
logerror("%s: warning - read 8910 '%s' Port A\n",cpuexec_describe_context(psg->device->machine),psg->device->tag());
logerror("%s: warning - read 8910 '%s' Port A\n",psg->device->machine->describe_context(),psg->device->tag());
break;
case AY_PORTB:
if ((psg->regs[AY_ENABLE] & 0x80) != 0)
@ -895,7 +895,7 @@ int ay8910_read_ym(void *chip)
if (psg->portBread.read)
psg->regs[AY_PORTB] = devcb_call_read8(&psg->portBread, 0);
else
logerror("%s: warning - read 8910 '%s' Port B\n",cpuexec_describe_context(psg->device->machine),psg->device->tag());
logerror("%s: warning - read 8910 '%s' Port B\n",psg->device->machine->describe_context(),psg->device->tag());
break;
}

View File

@ -107,7 +107,7 @@ static TIMER_CALLBACK( cdp1864_int_tick )
devcb_call_write_line(&cdp1864->out_int_func, ASSERT_LINE);
}
timer_adjust_oneshot(cdp1864->int_timer, cdp1864->screen->time_until_pos(CDP1864_SCANLINE_INT_END), 0);
cdp1864->int_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_INT_END));
}
else
{
@ -116,7 +116,7 @@ static TIMER_CALLBACK( cdp1864_int_tick )
devcb_call_write_line(&cdp1864->out_int_func, CLEAR_LINE);
}
timer_adjust_oneshot(cdp1864->int_timer, cdp1864->screen->time_until_pos(CDP1864_SCANLINE_INT_START), 0);
cdp1864->int_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_INT_START));
}
}
@ -135,22 +135,22 @@ static TIMER_CALLBACK( cdp1864_efx_tick )
{
case CDP1864_SCANLINE_EFX_TOP_START:
devcb_call_write_line(&cdp1864->out_efx_func, ASSERT_LINE);
timer_adjust_oneshot(cdp1864->efx_timer, cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_END), 0);
cdp1864->efx_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_END));
break;
case CDP1864_SCANLINE_EFX_TOP_END:
devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE);
timer_adjust_oneshot(cdp1864->efx_timer, cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_BOTTOM_START), 0);
cdp1864->efx_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_BOTTOM_START));
break;
case CDP1864_SCANLINE_EFX_BOTTOM_START:
devcb_call_write_line(&cdp1864->out_efx_func, ASSERT_LINE);
timer_adjust_oneshot(cdp1864->efx_timer, cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_BOTTOM_END), 0);
cdp1864->efx_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_BOTTOM_END));
break;
case CDP1864_SCANLINE_EFX_BOTTOM_END:
devcb_call_write_line(&cdp1864->out_efx_func, CLEAR_LINE);
timer_adjust_oneshot(cdp1864->efx_timer, cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_START), 0);
cdp1864->efx_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_START));
break;
}
}
@ -176,7 +176,7 @@ static TIMER_CALLBACK( cdp1864_dma_tick )
}
}
timer_adjust_oneshot(cdp1864->dma_timer, machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_WAIT), 0);
cdp1864->dma_timer->adjust(machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_WAIT));
cdp1864->dmaout = 0;
}
@ -190,7 +190,7 @@ static TIMER_CALLBACK( cdp1864_dma_tick )
}
}
timer_adjust_oneshot(cdp1864->dma_timer, machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_ACTIVE), 0);
cdp1864->dma_timer->adjust(machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_ACTIVE));
cdp1864->dmaout = 1;
}
@ -475,9 +475,9 @@ static DEVICE_RESET( cdp1864 )
{
cdp1864_t *cdp1864 = get_safe_token(device);
timer_adjust_oneshot(cdp1864->int_timer, cdp1864->screen->time_until_pos(CDP1864_SCANLINE_INT_START), 0);
timer_adjust_oneshot(cdp1864->efx_timer, cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_START), 0);
timer_adjust_oneshot(cdp1864->dma_timer, device->machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_START), 0);
cdp1864->int_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_INT_START));
cdp1864->efx_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_START));
cdp1864->dma_timer->adjust(device->machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_START));
cdp1864->disp = 0;
cdp1864->dmaout = 0;

View File

@ -267,7 +267,7 @@ inline void cdp1869_device::update_prd_changed_timer()
}
attotime duration = m_screen->time_until_pos(next_scanline);
timer_adjust_oneshot(m_prd_timer, duration, next_state);
m_prd_timer->adjust(duration, next_state);
}

View File

@ -446,13 +446,13 @@ WRITE8_DEVICE_HANDLER( es5503_w )
// ok, we run for this long
period = attotime::from_hz(chip->output_rate) * length;
timer_adjust_periodic(chip->oscillators[osc].timer, period, 0, period);
chip->oscillators[osc].timer->adjust(period, 0, period);
}
}
else if (!(chip->oscillators[osc].control & 1) && (data&1))
{
// key off
timer_adjust_oneshot(chip->oscillators[osc].timer, attotime::never, 0);
chip->oscillators[osc].timer->adjust(attotime::never);
}
chip->oscillators[osc].control = data;

View File

@ -1619,7 +1619,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
}
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff);
fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff);
break;
case 0x01: /* FC */
@ -1628,7 +1628,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->freqcount = (voice->freqcount & ~0x1fe00) | ((data & 0xff00) << 1);
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, freq count=%08x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->freqcount);
fprintf(eslog, "%s:voice %d, freq count=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->freqcount);
break;
case 0x02: /* STRT (hi) */
@ -1637,7 +1637,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->start = (voice->start & ~0x7c000000) | ((data & 0x1f00) << 18);
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, loop start=%08x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->start);
fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->start);
break;
case 0x03: /* STRT (lo) */
@ -1646,7 +1646,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->start = (voice->start & ~0x0003fc00) | ((data & 0xff00) << 2);
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, loop start=%08x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->start);
fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->start);
break;
case 0x04: /* END (hi) */
@ -1658,7 +1658,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
voice->control |= CONTROL_STOP0;
#endif
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, loop end=%08x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->end);
fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->end);
break;
case 0x05: /* END (lo) */
@ -1670,7 +1670,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
voice->control |= CONTROL_STOP0;
#endif
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, loop end=%08x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->end);
fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->end);
break;
case 0x06: /* K2 */
@ -1679,7 +1679,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->k2 = (voice->k2 & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, K2=%04x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->k2);
fprintf(eslog, "%s:voice %d, K2=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->k2);
break;
case 0x07: /* K1 */
@ -1688,21 +1688,21 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->k1 = (voice->k1 & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, K1=%04x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->k1);
fprintf(eslog, "%s:voice %d, K1=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->k1);
break;
case 0x08: /* LVOL */
if (ACCESSING_BITS_8_15)
voice->lvol = (voice->lvol & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, left vol=%04x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->lvol);
fprintf(eslog, "%s:voice %d, left vol=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->lvol);
break;
case 0x09: /* RVOL */
if (ACCESSING_BITS_8_15)
voice->rvol = (voice->rvol & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, right vol=%04x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->rvol);
fprintf(eslog, "%s:voice %d, right vol=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->rvol);
break;
case 0x0a: /* ACC (hi) */
@ -1711,7 +1711,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->accum = (voice->accum & ~0x7c000000) | ((data & 0x1f00) << 18);
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, accum=%08x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->accum);
fprintf(eslog, "%s:voice %d, accum=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->accum);
break;
case 0x0b: /* ACC (lo) */
@ -1720,7 +1720,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->accum = (voice->accum & ~0x0003fc00) | ((data & 0xff00) << 2);
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, accum=%08x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->accum);
fprintf(eslog, "%s:voice %d, accum=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->accum);
break;
case 0x0c: /* unused */
@ -1769,7 +1769,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
((data << 2) & (CONTROL_CA0 | CONTROL_CA1));
}
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->control, data, mem_mask);
fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask);
break;
case 0x01: /* O4(n-1) */
@ -1778,7 +1778,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o4n1 = (INT16)((voice->o4n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, O4(n-1)=%05x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff);
fprintf(eslog, "%s:voice %d, O4(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff);
break;
case 0x02: /* O3(n-1) */
@ -1787,7 +1787,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o3n1 = (INT16)((voice->o3n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, O3(n-1)=%05x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff);
fprintf(eslog, "%s:voice %d, O3(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff);
break;
case 0x03: /* O3(n-2) */
@ -1796,7 +1796,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o3n2 = (INT16)((voice->o3n2 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, O3(n-2)=%05x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff);
fprintf(eslog, "%s:voice %d, O3(n-2)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff);
break;
case 0x04: /* O2(n-1) */
@ -1805,7 +1805,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o2n1 = (INT16)((voice->o2n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, O2(n-1)=%05x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff);
fprintf(eslog, "%s:voice %d, O2(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff);
break;
case 0x05: /* O2(n-2) */
@ -1814,7 +1814,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o2n2 = (INT16)((voice->o2n2 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, O2(n-2)=%05x\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff);
fprintf(eslog, "%s:voice %d, O2(n-2)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff);
break;
case 0x06: /* O1(n-1) */
@ -1823,7 +1823,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o1n1 = (INT16)((voice->o1n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
fprintf(eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", cpuexec_describe_context(machine), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum);
fprintf(eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum);
break;
case 0x07:
@ -1906,7 +1906,7 @@ WRITE16_DEVICE_HANDLER( es5505_w )
es5506_state *chip = get_safe_token(device);
es5506_voice *voice = &chip->voice[chip->current_page & 0x1f];
// logerror("%s:ES5505 write %02x/%02x = %04x & %04x\n", cpuexec_describe_context(machine), chip->current_page, offset, data, mem_mask);
// logerror("%s:ES5505 write %02x/%02x = %04x & %04x\n", machine->describe_context(), chip->current_page, offset, data, mem_mask);
/* force an update */
chip->stream->update();

View File

@ -195,7 +195,7 @@ READ16_DEVICE_HANDLER( gaelcosnd_r )
{
gaelco_sound_state *info = get_safe_token(device);
LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", cpuexec_describe_context(device->machine), offset));
LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", device->machine->describe_context(), offset));
return info->sndregs[offset];
}
@ -209,7 +209,7 @@ WRITE16_DEVICE_HANDLER( gaelcosnd_w )
gaelco_sound_state *info = get_safe_token(device);
gaelco_sound_channel *channel = &info->channel[offset >> 3];
LOG_READ_WRITES(("%s: (GAE1): write %04x to %04x\n", cpuexec_describe_context(device->machine), data, offset));
LOG_READ_WRITES(("%s: (GAE1): write %04x to %04x\n", device->machine->describe_context(), data, offset));
/* first update the stream to this point in time */
info->stream->update();

View File

@ -125,8 +125,8 @@ void ics2115_device::device_reset()
m_reg_select = 0;
m_vmode = 0;
memset(m_voice, 0, sizeof(m_voice));
timer_adjust_oneshot(m_timer[0].timer, attotime::never, 0);
timer_adjust_oneshot(m_timer[1].timer, attotime::never, 0);
m_timer[0].timer->adjust(attotime::never);
m_timer[1].timer->adjust(attotime::never);
m_timer[0].period = 0;
m_timer[1].period = 0;
for(int i = 0; i < 32; i++) {
@ -903,8 +903,8 @@ void ics2115_device::recalc_timer(int timer)
m_timer[timer].period = period;
// Adjust the timer lengths
if(period) // Reset the length
timer_adjust_periodic(m_timer[timer].timer, attotime::from_nsec(period), 0, attotime::from_nsec(period));
m_timer[timer].timer->adjust(attotime::from_nsec(period), 0, attotime::from_nsec(period));
else // Kill the timer if length == 0
timer_adjust_oneshot(m_timer[timer].timer, attotime::never, 0);
m_timer[timer].timer->adjust(attotime::never);
}
}

View File

@ -424,7 +424,7 @@ READ8_DEVICE_HANDLER( k053260_r )
ic->channels[0].pos += ( 1 << 16 );
if ( offs > ic->rom_size ) {
logerror("%s: K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", cpuexec_describe_context(device->machine),offs,ic->rom_size );
logerror("%s: K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", device->machine->describe_context(),offs,ic->rom_size );
return 0;
}

View File

@ -147,7 +147,7 @@ static DEVICE_START( k056800 )
k056800->irq_cb = intf->irq_cb;
k056800->sound_cpu_timer = device->machine->scheduler().timer_alloc(FUNC(k056800_sound_cpu_timer_tick), k056800);
timer_adjust_periodic(k056800->sound_cpu_timer, timer_period, 0, timer_period);
k056800->sound_cpu_timer->adjust(timer_period, 0, timer_period);
state_save_register_device_item_array(device, 0, k056800->host_reg);
state_save_register_device_item_array(device, 0, k056800->sound_reg);

View File

@ -275,10 +275,10 @@ static void msm5205_playmode(msm5205_state *voice,int select)
if( prescaler )
{
attotime period = attotime::from_hz(voice->clock) * prescaler;
timer_adjust_periodic(voice->timer, period, 0, period);
voice->timer->adjust(period, 0, period);
}
else
timer_adjust_oneshot(voice->timer, attotime::never, 0);
voice->timer->adjust(attotime::never);
}
if( voice->bitwidth != bitwidth )
@ -305,7 +305,7 @@ void msm5205_change_clock_w(device_t *device, INT32 clock)
voice->clock = clock;
period = attotime::from_hz(voice->clock) * voice->prescaler;
timer_adjust_periodic(voice->timer, period, 0, period);
voice->timer->adjust(period, 0, period);
}

View File

@ -465,7 +465,7 @@ static TIMER_CALLBACK( pokey_pot_trigger );
PROCESS_SAMPLE(chip); \
} \
} \
timer_adjust_oneshot(chip->rtimer, attotime::never, 0)
chip->rtimer->adjust(attotime::never)
#else /* no HEAVY_MACRO_USAGE */
/*
@ -516,7 +516,7 @@ static TIMER_CALLBACK( pokey_pot_trigger );
PROCESS_CHANNEL(chip,channel); \
} \
} \
timer_adjust_oneshot(chip->rtimer, attotime::never, 0)
chip->rtimer->adjust(attotime::never)
#endif
@ -781,7 +781,7 @@ static TIMER_CALLBACK( pokey_pot_trigger )
{
pokey_state *p = (pokey_state *)ptr;
int pot = param;
LOG(("POKEY #%p POT%d triggers after %dus\n", p, pot, (int)(1000000 * timer_timeelapsed(p->ptimer[pot]).as_double())));
LOG(("POKEY #%p POT%d triggers after %dus\n", p, pot, (int)(1000000 * p->ptimer[pot]->elapsed().as_double())));
p->ALLPOT &= ~(1 << pot); /* set the enabled timer irq status bits */
}
@ -810,7 +810,7 @@ static void pokey_potgo(pokey_state *p)
/* final value */
p->POTx[pot] = r;
timer_adjust_oneshot(p->ptimer[pot], AD_TIME * r, pot);
p->ptimer[pot]->adjust(AD_TIME * r, pot);
}
}
}
@ -836,7 +836,7 @@ READ8_DEVICE_HANDLER( pokey_r )
*/
if( p->ALLPOT & (1 << pot) )
{
data = timer_timeelapsed(p->ptimer[pot]).attoseconds / AD_TIME.attoseconds;
data = p->ptimer[pot]->elapsed().attoseconds / AD_TIME.attoseconds;
LOG(("POKEY '%s' read POT%d (interpolated) $%02x\n", p->device->tag(), pot, data));
}
else
@ -846,7 +846,7 @@ READ8_DEVICE_HANDLER( pokey_r )
}
}
else
logerror("%s: warning - read '%s' POT%d\n", cpuexec_describe_context(p->device->machine), p->device->tag(), pot);
logerror("%s: warning - read '%s' POT%d\n", p->device->machine->describe_context(), p->device->tag(), pot);
break;
case ALLPOT_C:
@ -886,7 +886,7 @@ READ8_DEVICE_HANDLER( pokey_r )
****************************************************************/
if( p->SKCTL & SK_RESET )
{
adjust = timer_timeelapsed(p->rtimer).as_double() / p->clock_period.as_double();
adjust = p->rtimer->elapsed().as_double() / p->clock_period.as_double();
p->r9 = (p->r9 + adjust) % 0x001ff;
p->r17 = (p->r17 + adjust) % 0x1ffff;
}
@ -908,7 +908,7 @@ READ8_DEVICE_HANDLER( pokey_r )
LOG_RAND(("POKEY '%s' adjust %u rand17[$%05x]: $%02x\n", p->device->tag(), adjust, p->r17, p->RANDOM));
}
if (adjust > 0)
timer_adjust_oneshot(p->rtimer, attotime::never, 0);
p->rtimer->adjust(attotime::never);
data = p->RANDOM ^ 0xff;
break;
@ -1043,9 +1043,9 @@ WRITE8_DEVICE_HANDLER( pokey_w )
/* first remove any existing timers */
LOG_TIMER(("POKEY '%s' STIMER $%02x\n", p->device->tag(), data));
timer_adjust_oneshot(p->timer[TIMER1], attotime::never, p->timer_param[TIMER1]);
timer_adjust_oneshot(p->timer[TIMER2], attotime::never, p->timer_param[TIMER2]);
timer_adjust_oneshot(p->timer[TIMER4], attotime::never, p->timer_param[TIMER4]);
p->timer[TIMER1]->adjust(attotime::never, p->timer_param[TIMER1]);
p->timer[TIMER2]->adjust(attotime::never, p->timer_param[TIMER2]);
p->timer[TIMER4]->adjust(attotime::never, p->timer_param[TIMER4]);
/* reset all counters to zero (side effect) */
p->polyadjust = 0;
@ -1063,7 +1063,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
/* set timer #1 _and_ #2 event after timer_div clocks of joined CHAN1+CHAN2 */
p->timer_period[TIMER2] = p->clock_period * p->divisor[CHAN2];
p->timer_param[TIMER2] = IRQ_TIMR2|IRQ_TIMR1;
timer_adjust_periodic(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
p->timer[TIMER2]->adjust(p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
}
}
else
@ -1074,7 +1074,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
/* set timer #1 event after timer_div clocks of CHAN1 */
p->timer_period[TIMER1] = p->clock_period * p->divisor[CHAN1];
p->timer_param[TIMER1] = IRQ_TIMR1;
timer_adjust_periodic(p->timer[TIMER1], p->timer_period[TIMER1], p->timer_param[TIMER1], p->timer_period[TIMER1]);
p->timer[TIMER1]->adjust(p->timer_period[TIMER1], p->timer_param[TIMER1], p->timer_period[TIMER1]);
}
if( p->divisor[CHAN2] > 4 )
@ -1083,7 +1083,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
/* set timer #2 event after timer_div clocks of CHAN2 */
p->timer_period[TIMER2] = p->clock_period * p->divisor[CHAN2];
p->timer_param[TIMER2] = IRQ_TIMR2;
timer_adjust_periodic(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
p->timer[TIMER2]->adjust(p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
}
}
@ -1100,7 +1100,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
/* set timer #4 event after timer_div clocks of CHAN4 */
p->timer_period[TIMER4] = p->clock_period * p->divisor[CHAN4];
p->timer_param[TIMER4] = IRQ_TIMR4;
timer_adjust_periodic(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
p->timer[TIMER4]->adjust(p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
}
}
}
@ -1112,13 +1112,13 @@ WRITE8_DEVICE_HANDLER( pokey_w )
/* set timer #4 event after timer_div clocks of CHAN4 */
p->timer_period[TIMER4] = p->clock_period * p->divisor[CHAN4];
p->timer_param[TIMER4] = IRQ_TIMR4;
timer_adjust_periodic(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
p->timer[TIMER4]->adjust(p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
}
}
timer_enable(p->timer[TIMER1], p->IRQEN & IRQ_TIMR1);
timer_enable(p->timer[TIMER2], p->IRQEN & IRQ_TIMR2);
timer_enable(p->timer[TIMER4], p->IRQEN & IRQ_TIMR4);
p->timer[TIMER1]->enable(p->IRQEN & IRQ_TIMR1);
p->timer[TIMER2]->enable(p->IRQEN & IRQ_TIMR2);
p->timer[TIMER4]->enable(p->IRQEN & IRQ_TIMR4);
break;
case SKREST_C:
@ -1160,11 +1160,11 @@ WRITE8_DEVICE_HANDLER( pokey_w )
/* enable/disable timers now to avoid unneeded
breaking of the CPU cores for masked timers */
if( p->timer[TIMER1] && ((p->IRQEN^data) & IRQ_TIMR1) )
timer_enable(p->timer[TIMER1], data & IRQ_TIMR1);
p->timer[TIMER1]->enable(data & IRQ_TIMR1);
if( p->timer[TIMER2] && ((p->IRQEN^data) & IRQ_TIMR2) )
timer_enable(p->timer[TIMER2], data & IRQ_TIMR2);
p->timer[TIMER2]->enable(data & IRQ_TIMR2);
if( p->timer[TIMER4] && ((p->IRQEN^data) & IRQ_TIMR4) )
timer_enable(p->timer[TIMER4], data & IRQ_TIMR4);
p->timer[TIMER4]->enable(data & IRQ_TIMR4);
}
/* store irq enable */
p->IRQEN = data;
@ -1208,7 +1208,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
if( new_val < p->counter[CHAN1] )
p->counter[CHAN1] = new_val;
if( p->interrupt_cb && p->timer[TIMER1] )
timer_adjust_periodic(p->timer[TIMER1], p->clock_period * new_val, p->timer_param[TIMER1], p->timer_period[TIMER1]);
p->timer[TIMER1]->adjust(p->clock_period * new_val, p->timer_param[TIMER1], p->timer_period[TIMER1]);
p->audible[CHAN1] = !(
(p->AUDC[CHAN1] & VOLUME_ONLY) ||
(p->AUDC[CHAN1] & VOLUME_MASK) == 0 ||
@ -1244,7 +1244,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
if( new_val < p->counter[CHAN2] )
p->counter[CHAN2] = new_val;
if( p->interrupt_cb && p->timer[TIMER2] )
timer_adjust_periodic(p->timer[TIMER2], p->clock_period * new_val, p->timer_param[TIMER2], p->timer_period[TIMER2]);
p->timer[TIMER2]->adjust(p->clock_period * new_val, p->timer_param[TIMER2], p->timer_period[TIMER2]);
p->audible[CHAN2] = !(
(p->AUDC[CHAN2] & VOLUME_ONLY) ||
(p->AUDC[CHAN2] & VOLUME_MASK) == 0 ||
@ -1309,7 +1309,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
if( new_val < p->counter[CHAN4] )
p->counter[CHAN4] = new_val;
if( p->interrupt_cb && p->timer[TIMER4] )
timer_adjust_periodic(p->timer[TIMER4], p->clock_period * new_val, p->timer_param[TIMER4], p->timer_period[TIMER4]);
p->timer[TIMER4]->adjust(p->clock_period * new_val, p->timer_param[TIMER4], p->timer_period[TIMER4]);
p->audible[CHAN4] = !(
(p->AUDC[CHAN4] & VOLUME_ONLY) ||
(p->AUDC[CHAN4] & VOLUME_MASK) == 0 ||

View File

@ -22,7 +22,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
logerror( "%s: %s", cpuexec_describe_context(machine), buf );
logerror( "%s: %s", machine->describe_context(), buf );
}
}

View File

@ -187,7 +187,7 @@ WRITE8_DEVICE_HANDLER( qsound_w )
break;
default:
logerror("%s: unexpected qsound write to offset %d == %02X\n", cpuexec_describe_context(device->machine), offset, data);
logerror("%s: unexpected qsound write to offset %d == %02X\n", device->machine->describe_context(), offset, data);
break;
}
}

Some files were not shown because too many files have changed in this diff Show More