diff options
Diffstat (limited to 'src')
369 files changed, 1504 insertions, 1529 deletions
diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c index 8feb6f5d9cc..bcd9ff6532f 100644 --- a/src/emu/cpu/cop400/cop400.c +++ b/src/emu/cpu/cop400/cop400.c @@ -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 */ diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c index 64543c2ffa4..c8ee775de0e 100644 --- a/src/emu/cpu/e132xs/e132xs.c +++ b/src/emu/cpu/e132xs/e132xs.c @@ -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 ) diff --git a/src/emu/cpu/h83002/h8_8.c b/src/emu/cpu/h83002/h8_8.c index 9f18e077b90..f145e415b34 100644 --- a/src/emu/cpu/h83002/h8_8.c +++ b/src/emu/cpu/h83002/h8_8.c @@ -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); diff --git a/src/emu/cpu/h83002/h8periph.c b/src/emu/cpu/h83002/h8periph.c index b016dee3c9f..50ff0143cb2 100644 --- a/src/emu/cpu/h83002/h8periph.c +++ b/src/emu/cpu/h83002/h8periph.c @@ -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); } diff --git a/src/emu/cpu/hd61700/hd61700.c b/src/emu/cpu/hd61700/hd61700.c index b67b5862eee..db22dbc54f0 100644 --- a/src/emu/cpu/hd61700/hd61700.c +++ b/src/emu/cpu/hd61700/hd61700.c @@ -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); diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c index e29b1ea8433..29de9d00cfe 100644 --- a/src/emu/cpu/m37710/m37710.c +++ b/src/emu/cpu/m37710/m37710.c @@ -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; diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c index bb1c5b24a0f..c0ece25cf8a 100644 --- a/src/emu/cpu/m6800/m6800.c +++ b/src/emu/cpu/m6800/m6800.c @@ -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; } diff --git a/src/emu/cpu/mb88xx/mb88xx.c b/src/emu/cpu/mb88xx/mb88xx.c index 13656e26d8a..54175c4c078 100644 --- a/src/emu/cpu/mb88xx/mb88xx.c +++ b/src/emu/cpu/mb88xx/mb88xx.c @@ -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; diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c index 6c6d9601113..1053014df59 100644 --- a/src/emu/cpu/mips/mips3com.c +++ b/src/emu/cpu/mips/mips3com.c @@ -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); } diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c index af3e1111846..1b7b9123a71 100644 --- a/src/emu/cpu/mn10200/mn10200.c +++ b/src/emu/cpu/mn10200/mn10200.c @@ -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 diff --git a/src/emu/cpu/nec/v25.c b/src/emu/cpu/nec/v25.c index e5291fe7d8e..c485ba55376 100644 --- a/src/emu/cpu/nec/v25.c +++ b/src/emu/cpu/nec/v25.c @@ -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; diff --git a/src/emu/cpu/nec/v25sfr.c b/src/emu/cpu/nec/v25sfr.c index 50e990094f1..95be5a0583f 100644 --- a/src/emu/cpu/nec/v25sfr.c +++ b/src/emu/cpu/nec/v25sfr.c @@ -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); diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c index 9a9e61a4eb6..2e94aca74e8 100644 --- a/src/emu/cpu/powerpc/ppccom.c +++ b/src/emu/cpu/powerpc/ppccom.c @@ -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); } diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c index cf2e6126bf8..f2cbdd06752 100644 --- a/src/emu/cpu/sh2/sh2comn.c +++ b/src/emu/cpu/sh2/sh2comn.c @@ -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); diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c index 175ea913baa..b4c1a3582dd 100644 --- a/src/emu/cpu/sh4/sh4.c +++ b/src/emu/cpu/sh4/sh4.c @@ -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; diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c index 033fed50f33..88434cb5ea3 100644 --- a/src/emu/cpu/sh4/sh4comn.c +++ b/src/emu/cpu/sh4/sh4comn.c @@ -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); } diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c index c0d045dd5d4..90ee80b9fae 100644 --- a/src/emu/cpu/tlcs90/tlcs90.c +++ b/src/emu/cpu/tlcs90/tlcs90.c @@ -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); } diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index d340bd2863e..752ef891ac5 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -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) { diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h index 6925f65c3aa..cb8745f42db 100644 --- a/src/emu/cpu/tms9900/99xxcore.h +++ b/src/emu/cpu/tms9900/99xxcore.h @@ -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); } } diff --git a/src/emu/cpu/z8/z8.c b/src/emu/cpu/z8/z8.c index 9f562c7462f..dde5888c8dd 100644 --- a/src/emu/cpu/z8/z8.c +++ b/src/emu/cpu/z8/z8.c @@ -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; } } diff --git a/src/emu/diexec.c b/src/emu/diexec.c index 872e39ed452..460c1511995 100644 --- a/src/emu/diexec.c +++ b/src/emu/diexec.c @@ -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); } diff --git a/src/emu/imagedev/bitbngr.c b/src/emu/imagedev/bitbngr.c index 1df8b0866f1..591a38d1032 100644 --- a/src/emu/imagedev/bitbngr.c +++ b/src/emu/imagedev/bitbngr.c @@ -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); } diff --git a/src/emu/imagedev/flopdrv.c b/src/emu/imagedev/flopdrv.c index 314743ad731..b31ae72358d 100644 --- a/src/emu/imagedev/flopdrv.c +++ b/src/emu/imagedev/flopdrv.c @@ -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; } diff --git a/src/emu/imagedev/snapquik.c b/src/emu/imagedev/snapquik.c index aa61e9639f8..1640fd6b32e 100644 --- a/src/emu/imagedev/snapquik.c +++ b/src/emu/imagedev/snapquik.c @@ -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); diff --git a/src/emu/inptport.c b/src/emu/inptport.c index 94fb6f351db..6b14e0381c3 100644 --- a/src/emu/inptport.c +++ b/src/emu/inptport.c @@ -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); } } diff --git a/src/emu/machine.c b/src/emu/machine.c index 65fe844d9b1..ffde1b8cc97 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -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(); diff --git a/src/emu/machine/6522via.c b/src/emu/machine/6522via.c index 18428742236..7f6ac84fb7f 100644 --- a/src/emu/machine/6522via.c +++ b/src/emu/machine/6522via.c @@ -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)) diff --git a/src/emu/machine/6526cia.c b/src/emu/machine/6526cia.c index 897bd343343..4273dc5c9fc 100644 --- a/src/emu/machine/6526cia.c +++ b/src/emu/machine/6526cia.c @@ -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 diff --git a/src/emu/machine/6532riot.c b/src/emu/machine/6532riot.c index 107a08de095..539b7ccbe26 100644 --- a/src/emu/machine/6532riot.c +++ b/src/emu/machine/6532riot.c @@ -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); } diff --git a/src/emu/machine/6840ptm.c b/src/emu/machine/6840ptm.c index 26c1ec2c621..132597e36fe 100644 --- a/src/emu/machine/6840ptm.c +++ b/src/emu/machine/6840ptm.c @@ -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); } } diff --git a/src/emu/machine/6850acia.c b/src/emu/machine/6850acia.c index 31c8498e3f0..06fd648e171 100644 --- a/src/emu/machine/6850acia.c +++ b/src/emu/machine/6850acia.c @@ -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); } } diff --git a/src/emu/machine/68681.c b/src/emu/machine/68681.c index 4189e8aaf92..d7b1a74ff5c 100644 --- a/src/emu/machine/68681.c +++ b/src/emu/machine/68681.c @@ -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); } /*------------------------------------------------- diff --git a/src/emu/machine/74123.c b/src/emu/machine/74123.c index 5b90d9610c4..1ce5a435b9b 100644 --- a/src/emu/machine/74123.c +++ b/src/emu/machine/74123.c @@ -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() ); } diff --git a/src/emu/machine/8237dma.c b/src/emu/machine/8237dma.c index 67e83c10e19..9d79da3aa9c 100644 --- a/src/emu/machine/8237dma.c +++ b/src/emu/machine/8237dma.c @@ -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 ); } diff --git a/src/emu/machine/8257dma.c b/src/emu/machine/8257dma.c index d3eeb156bf7..c2cae7ce8d2 100644 --- a/src/emu/machine/8257dma.c +++ b/src/emu/machine/8257dma.c @@ -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); } diff --git a/src/emu/machine/adc083x.c b/src/emu/machine/adc083x.c index 639d8d05b87..f2215c4d0f8 100644 --- a/src/emu/machine/adc083x.c +++ b/src/emu/machine/adc083x.c @@ -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 ); } } diff --git a/src/emu/machine/at28c16.c b/src/emu/machine/at28c16.c index efc73d1bbe7..ba78aa7b053 100644 --- a/src/emu/machine/at28c16.c +++ b/src/emu/machine/at28c16.c @@ -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; } } diff --git a/src/emu/machine/cdp1852.c b/src/emu/machine/cdp1852.c index 192709cbee2..c15a62a7640 100644 --- a/src/emu/machine/cdp1852.c +++ b/src/emu/machine/cdp1852.c @@ -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 */ diff --git a/src/emu/machine/ds2401.c b/src/emu/machine/ds2401.c index 6e52cd8ec21..b70a85329b7 100644 --- a/src/emu/machine/ds2401.c +++ b/src/emu/machine/ds2401.c @@ -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; } diff --git a/src/emu/machine/ds2404.c b/src/emu/machine/ds2404.c index 44de33b16a5..f5a0c7c3bd9 100644 --- a/src/emu/machine/ds2404.c +++ b/src/emu/machine/ds2404.c @@ -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)); } diff --git a/src/emu/machine/f3853.c b/src/emu/machine/f3853.c index ad7d204e60d..72729ef2f82 100644 --- a/src/emu/machine/f3853.c +++ b/src/emu/machine/f3853.c @@ -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); } diff --git a/src/emu/machine/i2cmem.c b/src/emu/machine/i2cmem.c index 95816b61cee..d942aebb86b 100644 --- a/src/emu/machine/i2cmem.c +++ b/src/emu/machine/i2cmem.c @@ -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 ); } } diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c index 13466236a42..04245376535 100644 --- a/src/emu/machine/idectrl.c +++ b/src/emu/machine/idectrl.c @@ -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) diff --git a/src/emu/machine/ins8154.c b/src/emu/machine/ins8154.c index 95fc850d710..741e0ad959a 100644 --- a/src/emu/machine/ins8154.c +++ b/src/emu/machine/ins8154.c @@ -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; diff --git a/src/emu/machine/intelfsh.c b/src/emu/machine/intelfsh.c index 49d16853c5f..d4cd3e36a0a 100644 --- a/src/emu/machine/intelfsh.c +++ b/src/emu/machine/intelfsh.c @@ -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 diff --git a/src/emu/machine/k033906.c b/src/emu/machine/k033906.c index 69638bb3513..a9760713d56 100644 --- a/src/emu/machine/k033906.c +++ b/src/emu/machine/k033906.c @@ -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); } } diff --git a/src/emu/machine/ldv1000.c b/src/emu/machine/ldv1000.c index b3771834872..c905352d2b9 100644 --- a/src/emu/machine/ldv1000.c +++ b/src/emu/machine/ldv1000.c @@ -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"); diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c index 0b2863d1581..65ed3b618c9 100644 --- a/src/emu/machine/ldvp931.c +++ b/src/emu/machine/ldvp931.c @@ -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); } diff --git a/src/emu/machine/mb3773.c b/src/emu/machine/mb3773.c index d488e2b9464..9af9812e0e8 100644 --- a/src/emu/machine/mb3773.c +++ b/src/emu/machine/mb3773.c @@ -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 ) diff --git a/src/emu/machine/mc146818.c b/src/emu/machine/mc146818.c index 3048b462b97..ab6da420424 100644 --- a/src/emu/machine/mc146818.c +++ b/src/emu/machine/mc146818.c @@ -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(); } diff --git a/src/emu/machine/mc68901.c b/src/emu/machine/mc68901.c index b96daa1404d..701209322ac 100644 --- a/src/emu/machine/mc68901.c +++ b/src/emu/machine/mc68901.c @@ -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; } diff --git a/src/emu/machine/microtch.c b/src/emu/machine/microtch.c index 43f5bcd88df..4d07c268216 100644 --- a/src/emu/machine/microtch.c +++ b/src/emu/machine/microtch.c @@ -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); diff --git a/src/emu/machine/msm6242.c b/src/emu/machine/msm6242.c index 86f2332de7d..31bc218740f 100644 --- a/src/emu/machine/msm6242.c +++ b/src/emu/machine/msm6242.c @@ -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); } diff --git a/src/emu/machine/pc16552d.c b/src/emu/machine/pc16552d.c index 4b815d353de..3b9888d040b 100644 --- a/src/emu/machine/pc16552d.c +++ b/src/emu/machine/pc16552d.c @@ -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) diff --git a/src/emu/machine/pic8259.c b/src/emu/machine/pic8259.c index fc8cacca9ca..36e2b87e1b6 100644 --- a/src/emu/machine/pic8259.c +++ b/src/emu/machine/pic8259.c @@ -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); } diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c index ab854eb38ff..050cd38eea0 100644 --- a/src/emu/machine/pit8253.c +++ b/src/emu/machine/pit8253.c @@ -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); diff --git a/src/emu/machine/rtc65271.c b/src/emu/machine/rtc65271.c index 0ed057ebfae..c4be4221f49 100644 --- a/src/emu/machine/rtc65271.c +++ b/src/emu/machine/rtc65271.c @@ -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; diff --git a/src/emu/machine/s3c2400.c b/src/emu/machine/s3c2400.c index 064d65533c9..56567d2b49e 100644 --- a/src/emu/machine/s3c2400.c +++ b/src/emu/machine/s3c2400.c @@ -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); } } diff --git a/src/emu/machine/s3c2410.c b/src/emu/machine/s3c2410.c index 41a3c4dd30f..d3e407563c0 100644 --- a/src/emu/machine/s3c2410.c +++ b/src/emu/machine/s3c2410.c @@ -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); } } diff --git a/src/emu/machine/s3c2440.c b/src/emu/machine/s3c2440.c index 994d2ac85da..046ce4eafec 100644 --- a/src/emu/machine/s3c2440.c +++ b/src/emu/machine/s3c2440.c @@ -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); } } diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c index 72114ab2516..2caf8642028 100644 --- a/src/emu/machine/s3c24xx.c +++ b/src/emu/machine/s3c24xx.c @@ -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); } diff --git a/src/emu/machine/scsidev.c b/src/emu/machine/scsidev.c index 4ab61ac2f6a..0018fa17305 100644 --- a/src/emu/machine/scsidev.c +++ b/src/emu/machine/scsidev.c @@ -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; } } diff --git a/src/emu/machine/smc91c9x.c b/src/emu/machine/smc91c9x.c index 324e8502e85..0d133d7185f 100644 --- a/src/emu/machine/smc91c9x.c +++ b/src/emu/machine/smc91c9x.c @@ -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) diff --git a/src/emu/machine/timekpr.c b/src/emu/machine/timekpr.c index a236ba202d4..a17c86740c8 100644 --- a/src/emu/machine/timekpr.c +++ b/src/emu/machine/timekpr.c @@ -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() diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c index 2c33ba08a45..cd55c153cb2 100644 --- a/src/emu/machine/tmp68301.c +++ b/src/emu/machine/tmp68301.c @@ -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); } } diff --git a/src/emu/machine/wd33c93.c b/src/emu/machine/wd33c93.c index 0c00a6f69ac..3f093a69c64 100644 --- a/src/emu/machine/wd33c93.c +++ b/src/emu/machine/wd33c93.c @@ -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 ); diff --git a/src/emu/machine/x76f041.c b/src/emu/machine/x76f041.c index 612a7dfe5cb..3d27a278425 100644 --- a/src/emu/machine/x76f041.c +++ b/src/emu/machine/x76f041.c @@ -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 ); } } diff --git a/src/emu/machine/x76f100.c b/src/emu/machine/x76f100.c index ccaab8063dc..e30947881ca 100644 --- a/src/emu/machine/x76f100.c +++ b/src/emu/machine/x76f100.c @@ -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 ); } } diff --git a/src/emu/machine/z80ctc.c b/src/emu/machine/z80ctc.c index 9f7f9afb403..243f73c5d62 100644 --- a/src/emu/machine/z80ctc.c +++ b/src/emu/machine/z80ctc.c @@ -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); } } diff --git a/src/emu/machine/z80dart.c b/src/emu/machine/z80dart.c index 200b648565b..91ee6d85068 100644 --- a/src/emu/machine/z80dart.c +++ b/src/emu/machine/z80dart.c @@ -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); diff --git a/src/emu/machine/z80dma.c b/src/emu/machine/z80dma.c index 059703e0d40..5316d1d3adc 100644 --- a/src/emu/machine/z80dma.c +++ b/src/emu/machine/z80dma.c @@ -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(); } } diff --git a/src/emu/machine/z80sio.c b/src/emu/machine/z80sio.c index 8c1bba849c0..cb39ca4c90d 100644 --- a/src/emu/machine/z80sio.c +++ b/src/emu/machine/z80sio.c @@ -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; } diff --git a/src/emu/machine/z80sti.c b/src/emu/machine/z80sti.c index 8b3c2e7b08a..c024ddd9079 100644 --- a/src/emu/machine/z80sti.c +++ b/src/emu/machine/z80sti.c @@ -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; diff --git a/src/emu/memory.c b/src/emu/memory.c index 6f0a840d48c..abf6a424965 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -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))); diff --git a/src/emu/schedule.h b/src/emu/schedule.h index 9704d95287b..28feffb257c 100644 --- a/src/emu/schedule.h +++ b/src/emu/schedule.h @@ -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__ */ diff --git a/src/emu/screen.c b/src/emu/screen.c index 18b20e6489c..41d7d4dfc5f 100644 --- a/src/emu/screen.c +++ b/src/emu/screen.c @@ -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); } diff --git a/src/emu/sound.c b/src/emu/sound.c index 1a7c9f54d88..775bc3efc06 100644 --- a/src/emu/sound.c +++ b/src/emu/sound.c @@ -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); } diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c index fc307c00ca1..2ee37092c24 100644 --- a/src/emu/sound/2203intf.c +++ b/src/emu/sound/2203intf.c @@ -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); } } diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c index ea7c554656f..910207cfd32 100644 --- a/src/emu/sound/2608intf.c +++ b/src/emu/sound/2608intf.c @@ -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); } } diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c index 8f6c53877b7..110d34445d9 100644 --- a/src/emu/sound/2610intf.c +++ b/src/emu/sound/2610intf.c @@ -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); } } diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c index 7495d182bdc..0e6af28184d 100644 --- a/src/emu/sound/2612intf.c +++ b/src/emu/sound/2612intf.c @@ -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); } } diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c index 31ed8fb294a..eeaaf46f6c7 100644 --- a/src/emu/sound/262intf.c +++ b/src/emu/sound/262intf.c @@ -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); } } diff --git a/src/emu/sound/3526intf.c b/src/emu/sound/3526intf.c index 231c12c55a6..0d4b67b0434 100644 --- a/src/emu/sound/3526intf.c +++ b/src/emu/sound/3526intf.c @@ -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); } } diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c index 2fc3f965efc..fd58c7b04e1 100644 --- a/src/emu/sound/3812intf.c +++ b/src/emu/sound/3812intf.c @@ -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); } } diff --git a/src/emu/sound/8950intf.c b/src/emu/sound/8950intf.c index 6a1ebc76d60..19e02b73dc7 100644 --- a/src/emu/sound/8950intf.c +++ b/src/emu/sound/8950intf.c @@ -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); } } diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c index abaa3d72287..35132a657f7 100644 --- a/src/emu/sound/aica.c +++ b/src/emu/sound/aica.c @@ -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)); } } } diff --git a/src/emu/sound/asc.c b/src/emu/sound/asc.c index 06b2bd5770a..23eb887ce46 100644 --- a/src/emu/sound/asc.c +++ b/src/emu/sound/asc.c @@ -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; diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c index 5fab115687a..18b3a48efd8 100644 --- a/src/emu/sound/ay8910.c +++ b/src/emu/sound/ay8910.c @@ -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; } diff --git a/src/emu/sound/cdp1864.c b/src/emu/sound/cdp1864.c index c27ef632f46..67d0f7ee563 100644 --- a/src/emu/sound/cdp1864.c +++ b/src/emu/sound/cdp1864.c @@ -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; diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c index 9ca72b470d9..f80fc3c413f 100644 --- a/src/emu/sound/cdp1869.c +++ b/src/emu/sound/cdp1869.c @@ -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); } diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c index 63d86e5c6cd..2b4e33deda9 100644 --- a/src/emu/sound/es5503.c +++ b/src/emu/sound/es5503.c @@ -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; diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c index 3da4ad0ca02..ca0abc972e7 100644 --- a/src/emu/sound/es5506.c +++ b/src/emu/sound/es5506.c @@ -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(); diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c index 959047a6d89..036590bf837 100644 --- a/src/emu/sound/gaelco.c +++ b/src/emu/sound/gaelco.c @@ -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(); diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c index 82645070acd..914b0b167d9 100644 --- a/src/emu/sound/ics2115.c +++ b/src/emu/sound/ics2115.c @@ -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); } } diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c index 479df201061..25b9f8f2997 100644 --- a/src/emu/sound/k053260.c +++ b/src/emu/sound/k053260.c @@ -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; } diff --git a/src/emu/sound/k056800.c b/src/emu/sound/k056800.c index 8074aa95d6a..f292a7acf06 100644 --- a/src/emu/sound/k056800.c +++ b/src/emu/sound/k056800.c @@ -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); diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c index fe1c41e3194..174e1f74b44 100644 --- a/src/emu/sound/msm5205.c +++ b/src/emu/sound/msm5205.c @@ -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); } diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c index 3c45eee4917..db0d3420b5a 100644 --- a/src/emu/sound/pokey.c +++ b/src/emu/sound/pokey.c @@ -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 || diff --git a/src/emu/sound/psx.c b/src/emu/sound/psx.c index e99c64ee065..ea95c678e8e 100644 --- a/src/emu/sound/psx.c +++ b/src/emu/sound/psx.c @@ -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 ); } } diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c index f257a598ad1..bc590386b23 100644 --- a/src/emu/sound/qsound.c +++ b/src/emu/sound/qsound.c @@ -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; } } diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c index 13c745988e2..62129c5fac0 100644 --- a/src/emu/sound/rf5c400.c +++ b/src/emu/sound/rf5c400.c @@ -448,11 +448,11 @@ WRITE16_DEVICE_HANDLER( rf5c400_w ) default: { - //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X\n", cpuexec_describe_context(device->machine), data, offset, mem_mask); + //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X\n", device->machine->describe_context(), data, offset, mem_mask); break; } } - //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X at %08X\n", cpuexec_describe_context(device->machine), data, offset, mem_mask); + //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X at %08X\n", device->machine->describe_context(), data, offset, mem_mask); } else { diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c index 8906890c944..19054f55327 100644 --- a/src/emu/sound/saa1099.c +++ b/src/emu/sound/saa1099.c @@ -337,7 +337,7 @@ WRITE8_DEVICE_HANDLER( saa1099_control_w ) if ((data & 0xff) > 0x1c) { /* Error! */ - logerror("%s: (SAA1099 '%s') Unknown register selected\n",cpuexec_describe_context(device->machine), device->tag()); + logerror("%s: (SAA1099 '%s') Unknown register selected\n",device->machine->describe_context(), device->tag()); } saa->selected_reg = data & 0x1f; @@ -423,7 +423,7 @@ WRITE8_DEVICE_HANDLER( saa1099_data_w ) int i; /* Synch & Reset generators */ - logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",cpuexec_describe_context(device->machine), device->tag()); + logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",device->machine->describe_context(), device->tag()); for (i = 0; i < 6; i++) { saa->channels[i].level = 0; @@ -432,7 +432,7 @@ WRITE8_DEVICE_HANDLER( saa1099_data_w ) } break; default: /* Error! */ - logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",cpuexec_describe_context(device->machine), device->tag(), reg, data); + logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",device->machine->describe_context(), device->tag(), reg, data); } } diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c index 1ca9e424b60..5f4dd35ac44 100644 --- a/src/emu/sound/scsp.c +++ b/src/emu/sound/scsp.c @@ -739,7 +739,7 @@ static void SCSP_UpdateReg(scsp_state *scsp, int reg) time = (44100 / scsp->TimPris[0]) / (255-(scsp->udata.data[0x18/2]&0xff)); if (time) { - timer_adjust_oneshot(scsp->timerA, attotime::from_hz(time), 0); + scsp->timerA->adjust(attotime::from_hz(time)); } } } @@ -758,7 +758,7 @@ static void SCSP_UpdateReg(scsp_state *scsp, int reg) time = (44100 / scsp->TimPris[1]) / (255-(scsp->udata.data[0x1A/2]&0xff)); if (time) { - timer_adjust_oneshot(scsp->timerB, attotime::from_hz(time), 0); + scsp->timerB->adjust(attotime::from_hz(time)); } } } @@ -777,7 +777,7 @@ static void SCSP_UpdateReg(scsp_state *scsp, int reg) time = (44100 / scsp->TimPris[2]) / (255-(scsp->udata.data[0x1C/2]&0xff)); if (time) { - timer_adjust_oneshot(scsp->timerC, attotime::from_hz(time), 0); + scsp->timerC->adjust(attotime::from_hz(time)); } } } diff --git a/src/emu/sound/sp0250.c b/src/emu/sound/sp0250.c index 322c9977484..fb6110eb67e 100644 --- a/src/emu/sound/sp0250.c +++ b/src/emu/sound/sp0250.c @@ -226,7 +226,7 @@ WRITE8_DEVICE_HANDLER( sp0250_w ) sp->drq(sp->device, CLEAR_LINE); } else - logerror("%s: overflow SP0250 FIFO\n", cpuexec_describe_context(device->machine)); + logerror("%s: overflow SP0250 FIFO\n", device->machine->describe_context()); } diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c index 2a4152132b6..f8accaa18a1 100644 --- a/src/emu/sound/tms5110.c +++ b/src/emu/sound/tms5110.c @@ -1239,7 +1239,7 @@ READ8_DEVICE_HANDLER( tms5110_romclk_hack_r ) if (!tms->romclk_hack_timer_started) { tms->romclk_hack_timer_started = TRUE; - timer_adjust_periodic(tms->romclk_hack_timer, attotime::from_hz(device->clock() / 40), 0, attotime::from_hz(device->clock() / 40)); + tms->romclk_hack_timer->adjust(attotime::from_hz(device->clock() / 40), 0, attotime::from_hz(device->clock() / 40)); } return tms->romclk_hack_state; } @@ -1422,7 +1422,7 @@ static DEVICE_START( tmsprom ) tms->clock = device->clock(); tms->romclk_timer = device->machine->scheduler().timer_alloc(FUNC(tmsprom_step), device); - timer_adjust_periodic(tms->romclk_timer, attotime::zero, 0, attotime::from_hz(tms->clock)); + tms->romclk_timer->adjust(attotime::zero, 0, attotime::from_hz(tms->clock)); tms->bit = 0; tms->base_address = 0; diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c index 4e7846f6d9d..98cc4f0d62d 100644 --- a/src/emu/sound/upd7759.c +++ b/src/emu/sound/upd7759.c @@ -547,7 +547,7 @@ static TIMER_CALLBACK( upd7759_slave_update ) /* set a timer to go off when that is done */ if (chip->state != STATE_IDLE) - timer_adjust_oneshot(chip->timer, chip->clock_period * chip->clocks_left, 0); + chip->timer->adjust(chip->clock_period * chip->clocks_left); } @@ -582,7 +582,7 @@ static void upd7759_reset(upd7759_state *chip) /* turn off any timer */ if (chip->timer) - timer_adjust_oneshot(chip->timer, attotime::never, 0); + chip->timer->adjust(attotime::never); } @@ -712,7 +712,7 @@ void upd7759_start_w(device_t *device, UINT8 data) /* for slave mode, start the timer going */ if (chip->timer) - timer_adjust_oneshot(chip->timer, attotime::zero, 0); + chip->timer->adjust(attotime::zero); } } diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c index abf887cb4e5..2bdc309ffd0 100644 --- a/src/emu/sound/x1_010.c +++ b/src/emu/sound/x1_010.c @@ -255,7 +255,7 @@ WRITE8_DEVICE_HANDLER( seta_sound_w ) info->smp_offset[channel] = 0; info->env_offset[channel] = 0; } - LOG_REGISTER_WRITE(("%s: offset %6X : data %2X\n", cpuexec_describe_context(device->machine), offset, data )); + LOG_REGISTER_WRITE(("%s: offset %6X : data %2X\n", device->machine->describe_context(), offset, data )); info->reg[offset] = data; } @@ -271,7 +271,7 @@ READ16_DEVICE_HANDLER( seta_sound_word_r ) ret = info->HI_WORD_BUF[offset]<<8; ret += (seta_sound_r( device, offset )&0xff); - LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", cpuexec_describe_context(device->machine), offset, ret )); + LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", device->machine->describe_context(), offset, ret )); return ret; } @@ -280,7 +280,7 @@ WRITE16_DEVICE_HANDLER( seta_sound_word_w ) x1_010_state *info = get_safe_token(device); info->HI_WORD_BUF[offset] = (data>>8)&0xff; seta_sound_w( device, offset, data&0xff ); - LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", cpuexec_describe_context(device->machine), offset, data )); + LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", device->machine->describe_context(), offset, data )); } diff --git a/src/emu/sound/ym2151.c b/src/emu/sound/ym2151.c index 582fc4dbc17..b124a16b9fb 100644 --- a/src/emu/sound/ym2151.c +++ b/src/emu/sound/ym2151.c @@ -819,7 +819,7 @@ static TIMER_CALLBACK( irqBoff_callback ) static TIMER_CALLBACK( timer_callback_a ) { YM2151 *chip = (YM2151 *)ptr; - timer_adjust_oneshot(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0); + chip->timer_A->adjust(chip->timer_A_time[ chip->timer_A_index ]); chip->timer_A_index_old = chip->timer_A_index; if (chip->irq_enable & 0x04) { @@ -832,7 +832,7 @@ static TIMER_CALLBACK( timer_callback_a ) static TIMER_CALLBACK( timer_callback_b ) { YM2151 *chip = (YM2151 *)ptr; - timer_adjust_oneshot(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0); + chip->timer_B->adjust(chip->timer_B_time[ chip->timer_B_index ]); chip->timer_B_index_old = chip->timer_B_index; if (chip->irq_enable & 0x08) { @@ -1123,9 +1123,9 @@ void ym2151_write_reg(void *_chip, int r, int v) #ifdef USE_MAME_TIMERS /* ASG 980324: added a real timer */ /* start timer _only_ if it wasn't already started (it will reload time value next round) */ - if (!timer_enable(chip->timer_B, 1)) + if (!chip->timer_B->enable(true)) { - timer_adjust_oneshot(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0); + chip->timer_B->adjust(chip->timer_B_time[ chip->timer_B_index ]); chip->timer_B_index_old = chip->timer_B_index; } #else @@ -1140,7 +1140,7 @@ void ym2151_write_reg(void *_chip, int r, int v) { /* stop timer B */ #ifdef USE_MAME_TIMERS /* ASG 980324: added a real timer */ - timer_enable(chip->timer_B, 0); + chip->timer_B->enable(false); #else chip->tim_B = 0; #endif @@ -1151,9 +1151,9 @@ void ym2151_write_reg(void *_chip, int r, int v) #ifdef USE_MAME_TIMERS /* ASG 980324: added a real timer */ /* start timer _only_ if it wasn't already started (it will reload time value next round) */ - if (!timer_enable(chip->timer_A, 1)) + if (!chip->timer_A->enable(true)) { - timer_adjust_oneshot(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0); + chip->timer_A->adjust(chip->timer_A_time[ chip->timer_A_index ]); chip->timer_A_index_old = chip->timer_A_index; } #else @@ -1168,7 +1168,7 @@ void ym2151_write_reg(void *_chip, int r, int v) { /* stop timer A */ #ifdef USE_MAME_TIMERS /* ASG 980324: added a real timer */ - timer_enable(chip->timer_A, 0); + chip->timer_A->enable(false); #else chip->tim_A = 0; #endif @@ -1617,8 +1617,8 @@ void ym2151_reset_chip(void *_chip) chip->irq_enable = 0; #ifdef USE_MAME_TIMERS /* ASG 980324 -- reset the timers before writing to the registers */ - timer_enable(chip->timer_A, 0); - timer_enable(chip->timer_B, 0); + chip->timer_A->enable(false); + chip->timer_B->enable(false); #else chip->tim_A = 0; chip->tim_B = 0; diff --git a/src/emu/sound/ymf271.c b/src/emu/sound/ymf271.c index f008c6fb705..f0a8cdbe6fc 100644 --- a/src/emu/sound/ymf271.c +++ b/src/emu/sound/ymf271.c @@ -1486,7 +1486,7 @@ static void ymf271_write_timer(YMF271Chip *chip, int data) //period = (double)(256.0 - chip->timerAVal ) * ( 384.0 * 4.0 / (double)CLOCK); period = attotime::from_hz(chip->clock) * (384 * (1024 - chip->timerAVal)); - timer_adjust_periodic(chip->timA, period, 0, period); + chip->timA->adjust(period, 0, period); } if (data & 0x20) { // timer B reset @@ -1497,7 +1497,7 @@ static void ymf271_write_timer(YMF271Chip *chip, int data) period = attotime::from_hz(chip->clock) * (384 * 16 * (256 - chip->timerBVal)); - timer_adjust_periodic(chip->timB, period, 0, period); + chip->timB->adjust(period, 0, period); } break; diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c index 1aa9d46bb2a..afa256c0436 100644 --- a/src/emu/sound/ymf278b.c +++ b/src/emu/sound/ymf278b.c @@ -377,10 +377,10 @@ static void ymf278b_timer_a_reset(YMF278BChip *chip) if (chip->clock != YMF278B_STD_CLOCK) period = (period * chip->clock) / YMF278B_STD_CLOCK; - timer_adjust_periodic(chip->timer_a, period, 0, period); + chip->timer_a->adjust(period, 0, period); } else - timer_adjust_oneshot(chip->timer_a, attotime::never, 0); + chip->timer_a->adjust(attotime::never); } static void ymf278b_timer_b_reset(YMF278BChip *chip) @@ -392,10 +392,10 @@ static void ymf278b_timer_b_reset(YMF278BChip *chip) if (chip->clock != YMF278B_STD_CLOCK) period = (period * chip->clock) / YMF278B_STD_CLOCK; - timer_adjust_periodic(chip->timer_b, period, 0, period); + chip->timer_b->adjust(period, 0, period); } else - timer_adjust_oneshot(chip->timer_b, attotime::never, 0); + chip->timer_b->adjust(attotime::never); } static void ymf278b_A_w(running_machine *machine, YMF278BChip *chip, UINT8 reg, UINT8 data) @@ -620,7 +620,7 @@ READ8_DEVICE_HANDLER( ymf278b_r ) return chip->current_irq | (chip->irq_line == ASSERT_LINE ? 0x80 : 0x00); default: - logerror("%s: unexpected read at offset %X from ymf278b\n", cpuexec_describe_context(device->machine), offset); + logerror("%s: unexpected read at offset %X from ymf278b\n", device->machine->describe_context(), offset); break; } return 0xff; @@ -657,7 +657,7 @@ WRITE8_DEVICE_HANDLER( ymf278b_w ) break; default: - logerror("%s: unexpected write at offset %X to ymf278b = %02X\n", cpuexec_describe_context(device->machine), offset, data); + logerror("%s: unexpected write at offset %X to ymf278b = %02X\n", device->machine->describe_context(), offset, data); break; } } diff --git a/src/emu/timer.c b/src/emu/timer.c index 05f959ee95a..1d0e3af8525 100644 --- a/src/emu/timer.c +++ b/src/emu/timer.c @@ -314,7 +314,7 @@ void timer_device::device_reset() start_delay = m_config.m_start_delay; // allocate and start the backing timer - timer_adjust_periodic(m_timer, start_delay, m_config.m_param, period); + m_timer->adjust(start_delay, m_config.m_param, period); } break; } @@ -325,7 +325,7 @@ void timer_device::device_reset() // set the timer to to fire immediately m_first_time = true; - timer_adjust_oneshot(m_timer, attotime::zero, m_config.m_param); + m_timer->adjust(attotime::zero, m_config.m_param); break; } } @@ -370,7 +370,7 @@ void timer_device::device_timer(emu_timer &timer, device_timer_id id, int param, m_first_time = false; // adjust the timer - timer_adjust_oneshot(m_timer, m_screen->time_until_pos(next_vpos), 0); + m_timer->adjust(m_screen->time_until_pos(next_vpos)); break; } } diff --git a/src/emu/video.c b/src/emu/video.c index d18de3b7711..f73a43aeeb5 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -181,7 +181,7 @@ video_manager::video_manager(running_machine &machine) if (machine.primary_screen == NULL) { m_screenless_frame_timer = machine.scheduler().timer_alloc(FUNC(&screenless_update_callback), this); - timer_adjust_periodic(m_screenless_frame_timer, screen_device::DEFAULT_FRAME_PERIOD, 0, screen_device::DEFAULT_FRAME_PERIOD); + m_screenless_frame_timer->adjust(screen_device::DEFAULT_FRAME_PERIOD, 0, screen_device::DEFAULT_FRAME_PERIOD); } } diff --git a/src/emu/video/hd63484.c b/src/emu/video/hd63484.c index 3eb13b8e462..3f422040155 100644 --- a/src/emu/video/hd63484.c +++ b/src/emu/video/hd63484.c @@ -1037,7 +1037,7 @@ static void hd63484_command_w(device_t *device, UINT16 cmd) #if LOG_COMMANDS int i; - logerror("%s: HD63484 command %s (%04x) ", cpuexec_describe_context(device->machine), instruction_name[hd63484->fifo[0] >> 10], hd63484->fifo[0]); + logerror("%s: HD63484 command %s (%04x) ", device->machine->describe_context(), instruction_name[hd63484->fifo[0] >> 10], hd63484->fifo[0]); for (i = 1; i < hd63484->fifo_counter; i++) logerror("%04x ", hd63484->fifo[i]); logerror("\n"); diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c index 80d34d85256..af178545019 100644 --- a/src/emu/video/mc6845.c +++ b/src/emu/video/mc6845.c @@ -289,7 +289,7 @@ WRITE8_DEVICE_HANDLER( mc6845_register_w ) { mc6845_t *mc6845 = get_safe_token(device); - if (LOG) logerror("%s:M6845 reg 0x%02x = 0x%02x\n", cpuexec_describe_context(device->machine), mc6845->register_address_latch, data); + if (LOG) logerror("%s:M6845 reg 0x%02x = 0x%02x\n", device->machine->describe_context(), mc6845->register_address_latch, data); switch (mc6845->register_address_latch) { @@ -447,11 +447,11 @@ static void recompute_parameters(mc6845_t *mc6845, int postload) INLINE void mc6845_update_counters(mc6845_t *mc6845) { - mc6845->character_counter = timer_timeelapsed( mc6845->line_timer ).as_ticks( mc6845->clock ); + mc6845->character_counter = mc6845->line_timer ->elapsed( ).as_ticks( mc6845->clock ); - if ( timer_enabled( mc6845->hsync_off_timer ) ) + if ( mc6845->hsync_off_timer ->enabled( ) ) { - mc6845->hsync_width_counter = timer_timeelapsed( mc6845->hsync_off_timer ).as_ticks( mc6845->clock ); + mc6845->hsync_width_counter = mc6845->hsync_off_timer ->elapsed( ).as_ticks( mc6845->clock ); } } @@ -465,7 +465,7 @@ INLINE void mc6845_set_de(mc6845_t *mc6845, int state) if ( mc6845->de ) { /* If the upd_adr_timer was running, cancel it */ - timer_adjust_oneshot(mc6845->upd_adr_timer, attotime::never, 0); + mc6845->upd_adr_timer->adjust(attotime::never); } else { @@ -519,7 +519,7 @@ INLINE void mc6845_set_cur(mc6845_t *mc6845, int state) static void update_upd_adr_timer(mc6845_t *mc6845) { if (! mc6845->de && supports_transparent[mc6845->device_type]) - timer_adjust_oneshot(mc6845->upd_adr_timer, mc6845->upd_time, 0); + mc6845->upd_adr_timer->adjust(mc6845->upd_time); } @@ -549,7 +549,7 @@ static TIMER_CALLBACK( cur_on_timer_cb ) mc6845_set_cur( mc6845, TRUE ); /* Schedule CURSOR off signal */ - timer_adjust_oneshot( mc6845->cur_off_timer, attotime::from_ticks( 1, mc6845->clock ), 0 ); + mc6845->cur_off_timer->adjust( attotime::from_ticks( 1, mc6845->clock ) ); } @@ -572,7 +572,7 @@ static TIMER_CALLBACK( hsync_on_timer_cb ) mc6845_set_hsync( mc6845, TRUE ); /* Schedule HSYNC off signal */ - timer_adjust_oneshot( mc6845->hsync_off_timer, attotime::from_ticks( hsync_width, mc6845->clock ), 0 ); + mc6845->hsync_off_timer->adjust( attotime::from_ticks( hsync_width, mc6845->clock ) ); } @@ -668,7 +668,7 @@ static TIMER_CALLBACK( line_timer_cb ) if ( mc6845->line_enable_ff ) { /* Schedule DE off signal change */ - timer_adjust_oneshot(mc6845->de_off_timer, attotime::from_ticks( mc6845->horiz_disp, mc6845->clock ), 0); + mc6845->de_off_timer->adjust(attotime::from_ticks( mc6845->horiz_disp, mc6845->clock )); /* Is cursor visible on this line? */ if ( mc6845->cursor_state && @@ -680,15 +680,15 @@ static TIMER_CALLBACK( line_timer_cb ) mc6845->cursor_x = mc6845->cursor_addr - mc6845->line_address; /* Schedule CURSOR ON signal */ - timer_adjust_oneshot( mc6845->cur_on_timer, attotime::from_ticks( mc6845->cursor_x, mc6845->clock ), 0 ); + mc6845->cur_on_timer->adjust( attotime::from_ticks( mc6845->cursor_x, mc6845->clock ) ); } } /* Schedule HSYNC on signal */ - timer_adjust_oneshot( mc6845->hsync_on_timer, attotime::from_ticks( mc6845->horiz_sync_pos, mc6845->clock ), 0 ); + mc6845->hsync_on_timer->adjust( attotime::from_ticks( mc6845->horiz_sync_pos, mc6845->clock ) ); /* Schedule our next callback */ - timer_adjust_oneshot( mc6845->line_timer, attotime::from_ticks( mc6845->horiz_char_total + 1, mc6845->clock ), 0 ); + mc6845->line_timer->adjust( attotime::from_ticks( mc6845->horiz_char_total + 1, mc6845->clock ) ); /* Set VSYNC and DE signals */ mc6845_set_vsync( mc6845, new_vsync ); @@ -730,7 +730,7 @@ void mc6845_assert_light_pen_input(device_t *device) /* compute the pixel coordinate of the NEXT character -- this is when the light pen latches */ /* set the timer that will latch the display address into the light pen registers */ - timer_adjust_oneshot(mc6845->light_pen_latch_timer, attotime::from_ticks( 1, mc6845->clock ), 0); + mc6845->light_pen_latch_timer->adjust(attotime::from_ticks( 1, mc6845->clock )); } @@ -1009,9 +1009,9 @@ static DEVICE_RESET( mc6845 ) devcb_call_write_line(&mc6845->out_vsync_func, FALSE); } - if ( ! timer_enabled( mc6845->line_timer ) ) + if ( ! mc6845->line_timer ->enabled( ) ) { - timer_adjust_oneshot( mc6845->line_timer, attotime::from_ticks( mc6845->horiz_char_total + 1, mc6845->clock ), 0 ); + mc6845->line_timer->adjust( attotime::from_ticks( mc6845->horiz_char_total + 1, mc6845->clock ) ); } mc6845->light_pen_latched = FALSE; diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c index 7f7beabbc52..e6d754914a1 100644 --- a/src/emu/video/tms34061.c +++ b/src/emu/video/tms34061.c @@ -147,7 +147,7 @@ INLINE void update_interrupts(void) static TIMER_CALLBACK( tms34061_interrupt ) { /* set timer for next frame */ - timer_adjust_oneshot(tms34061.timer, tms34061.screen->frame_period(), 0); + tms34061.timer->adjust(tms34061.screen->frame_period()); /* set the interrupt bit in the status reg */ tms34061.regs[TMS34061_STATUS] |= 1; @@ -184,7 +184,7 @@ static void register_w(address_space *space, offs_t offset, UINT8 data) } /* log it */ - if (VERBOSE) logerror("%s:tms34061 %s = %04x\n", cpuexec_describe_context(space->machine), regnames[regnum], tms34061.regs[regnum]); + if (VERBOSE) logerror("%s:tms34061 %s = %04x\n", space->machine->describe_context(), regnames[regnum], tms34061.regs[regnum]); /* update the state of things */ switch (regnum) @@ -196,7 +196,7 @@ static void register_w(address_space *space, offs_t offset, UINT8 data) if (scanline < 0) scanline += tms34061.regs[TMS34061_VERTOTAL]; - timer_adjust_oneshot(tms34061.timer, tms34061.screen->time_until_pos(scanline, tms34061.regs[TMS34061_HORSTARTBLNK]), 0); + tms34061.timer->adjust(tms34061.screen->time_until_pos(scanline, tms34061.regs[TMS34061_HORSTARTBLNK])); break; /* XY offset: set the X and Y masks */ @@ -262,7 +262,7 @@ static UINT8 register_r(address_space *space, offs_t offset) } /* log it */ - if (VERBOSE) logerror("%s:tms34061 %s read = %04X\n", cpuexec_describe_context(space->machine), regnames[regnum], result); + if (VERBOSE) logerror("%s:tms34061 %s read = %04X\n", space->machine->describe_context(), regnames[regnum], result); return (offset & 0x02) ? (result >> 8) : result; } @@ -369,7 +369,7 @@ static void xypixel_w(address_space *space, int offset, UINT8 data) /* mask to the VRAM size */ pixeloffs &= tms34061.vrammask; - if (VERBOSE) logerror("%s:tms34061 xy (%04x) = %02x/%02x\n", cpuexec_describe_context(space->machine), pixeloffs, data, tms34061.latchdata); + if (VERBOSE) logerror("%s:tms34061 xy (%04x) = %02x/%02x\n", space->machine->describe_context(), pixeloffs, data, tms34061.latchdata); /* set the pixel data */ tms34061.vram[pixeloffs] = data; @@ -425,7 +425,7 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data) offs = ((row << tms34061.intf.rowshift) | col) & tms34061.vrammask; if (tms34061.regs[TMS34061_CONTROL2] & 0x0040) offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16; - if (VERBOSE) logerror("%s:tms34061 direct (%04x) = %02x/%02x\n", cpuexec_describe_context(space->machine), offs, data, tms34061.latchdata); + if (VERBOSE) logerror("%s:tms34061 direct (%04x) = %02x/%02x\n", space->machine->describe_context(), offs, data, tms34061.latchdata); if (tms34061.vram[offs] != data || tms34061.latchram[offs] != tms34061.latchdata) { tms34061.vram[offs] = data; @@ -439,7 +439,7 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data) if (tms34061.regs[TMS34061_CONTROL2] & 0x0040) offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16; offs &= tms34061.vrammask; - if (VERBOSE) logerror("%s:tms34061 shiftreg write (%04x)\n", cpuexec_describe_context(space->machine), offs); + if (VERBOSE) logerror("%s:tms34061 shiftreg write (%04x)\n", space->machine->describe_context(), offs); memcpy(&tms34061.vram[offs], tms34061.shiftreg, (size_t)1 << tms34061.intf.rowshift); memset(&tms34061.latchram[offs], tms34061.latchdata, (size_t)1 << tms34061.intf.rowshift); @@ -451,14 +451,14 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data) if (tms34061.regs[TMS34061_CONTROL2] & 0x0040) offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16; offs &= tms34061.vrammask; - if (VERBOSE) logerror("%s:tms34061 shiftreg read (%04x)\n", cpuexec_describe_context(space->machine), offs); + if (VERBOSE) logerror("%s:tms34061 shiftreg read (%04x)\n", space->machine->describe_context(), offs); tms34061.shiftreg = &tms34061.vram[offs]; break; /* log anything else */ default: - logerror("%s:Unsupported TMS34061 function %d\n", cpuexec_describe_context(space->machine), func); + logerror("%s:Unsupported TMS34061 function %d\n", space->machine->describe_context(), func); break; } } @@ -512,7 +512,7 @@ UINT8 tms34061_r(address_space *space, int col, int row, int func) /* log anything else */ default: - logerror("%s:Unsupported TMS34061 function %d\n", cpuexec_describe_context(space->machine), + logerror("%s:Unsupported TMS34061 function %d\n", space->machine->describe_context(), func); break; } diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c index dd53cb85a83..5b263184107 100644 --- a/src/emu/video/voodoo.c +++ b/src/emu/video/voodoo.c @@ -986,7 +986,7 @@ static void adjust_vblank_timer(voodoo_state *v) /* if zero, adjust to next frame, otherwise we may get stuck in an infinite loop */ if (vblank_period == attotime::zero) vblank_period = v->screen->frame_period(); - timer_adjust_oneshot(v->fbi.vblank_timer, vblank_period, 0); + v->fbi.vblank_timer->adjust(vblank_period); } @@ -2070,13 +2070,13 @@ static void check_stalled_cpu(voodoo_state *v, attotime current_time) if (v->pci.stall_callback) (*v->pci.stall_callback)(v->device, FALSE); else - cpuexec_trigger(v->device->machine, v->trigger); + v->device->machine->scheduler().trigger(v->trigger); } /* if not, set a timer for the next one */ else { - timer_adjust_oneshot(v->pci.continue_timer, v->pci.op_end_time - current_time, 0); + v->pci.continue_timer->adjust(v->pci.op_end_time - current_time); } } @@ -2097,7 +2097,7 @@ static void stall_cpu(voodoo_state *v, int state, attotime current_time) cpu_spinuntil_trigger(v->cpu, v->trigger); /* set a timer to clear the stall */ - timer_adjust_oneshot(v->pci.continue_timer, v->pci.op_end_time - current_time, 0); + v->pci.continue_timer->adjust(v->pci.op_end_time - current_time); } @@ -3967,7 +3967,7 @@ static READ32_DEVICE_HANDLER( banshee_agp_r ) } if (LOG_REGISTERS) - logerror("%s:banshee_r(AGP:%s)\n", cpuexec_describe_context(v->device->machine), banshee_agp_reg_name[offset]); + logerror("%s:banshee_r(AGP:%s)\n", v->device->machine->describe_context(), banshee_agp_reg_name[offset]); return result; } @@ -3986,15 +3986,15 @@ READ32_DEVICE_HANDLER( banshee_r ) else if (offset < 0x100000/4) result = banshee_agp_r(device, offset, mem_mask); else if (offset < 0x200000/4) - logerror("%s:banshee_r(2D:%X)\n", cpuexec_describe_context(device->machine), (offset*4) & 0xfffff); + logerror("%s:banshee_r(2D:%X)\n", device->machine->describe_context(), (offset*4) & 0xfffff); else if (offset < 0x600000/4) result = register_r(v, offset & 0x1fffff/4); else if (offset < 0x800000/4) - logerror("%s:banshee_r(TEX:%X)\n", cpuexec_describe_context(device->machine), (offset*4) & 0x1fffff); + logerror("%s:banshee_r(TEX:%X)\n", device->machine->describe_context(), (offset*4) & 0x1fffff); else if (offset < 0xc00000/4) - logerror("%s:banshee_r(RES:%X)\n", cpuexec_describe_context(device->machine), (offset*4) & 0x3fffff); + logerror("%s:banshee_r(RES:%X)\n", device->machine->describe_context(), (offset*4) & 0x3fffff); else if (offset < 0x1000000/4) - logerror("%s:banshee_r(YUV:%X)\n", cpuexec_describe_context(device->machine), (offset*4) & 0x3fffff); + logerror("%s:banshee_r(YUV:%X)\n", device->machine->describe_context(), (offset*4) & 0x3fffff); else if (offset < 0x2000000/4) { UINT8 temp = v->fbi.lfb_stride; @@ -4017,7 +4017,7 @@ READ32_DEVICE_HANDLER( banshee_fb_r ) if (offset < v->fbi.lfb_base) { - logerror("%s:banshee_fb_r(%X)\n", cpuexec_describe_context(device->machine), offset*4); + logerror("%s:banshee_fb_r(%X)\n", device->machine->describe_context(), offset*4); if (offset*4 <= v->fbi.mask) result = ((UINT32 *)v->fbi.ram)[offset]; } @@ -4042,7 +4042,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att)) result = v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]]; if (LOG_REGISTERS) - logerror("%s:banshee_att_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3c1 & 0x1f]); + logerror("%s:banshee_att_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3c1 & 0x1f]); break; /* Input status 0 */ @@ -4055,7 +4055,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) */ result = 0x00; if (LOG_REGISTERS) - logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset); + logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset); break; /* Sequencer access */ @@ -4063,7 +4063,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq)) result = v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]]; if (LOG_REGISTERS) - logerror("%s:banshee_seq_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3c4 & 0x1f]); + logerror("%s:banshee_seq_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3c4 & 0x1f]); break; /* Feature control */ @@ -4071,14 +4071,14 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) result = v->banshee.vga[0x3da & 0x1f]; v->banshee.attff = 0; if (LOG_REGISTERS) - logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset); + logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset); break; /* Miscellaneous output */ case 0x3cc: result = v->banshee.vga[0x3c2 & 0x1f]; if (LOG_REGISTERS) - logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset); + logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset); break; /* Graphics controller access */ @@ -4086,7 +4086,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc)) result = v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]]; if (LOG_REGISTERS) - logerror("%s:banshee_gc_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3ce & 0x1f]); + logerror("%s:banshee_gc_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3ce & 0x1f]); break; /* CRTC access */ @@ -4094,7 +4094,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc)) result = v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]]; if (LOG_REGISTERS) - logerror("%s:banshee_crtc_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3d4 & 0x1f]); + logerror("%s:banshee_crtc_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3d4 & 0x1f]); break; /* Input status 1 */ @@ -4110,13 +4110,13 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) */ result = 0x04; if (LOG_REGISTERS) - logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset); + logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset); break; default: result = v->banshee.vga[offset]; if (LOG_REGISTERS) - logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset); + logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset); break; } return result; @@ -4140,7 +4140,7 @@ READ32_DEVICE_HANDLER( banshee_io_r ) case io_dacData: result = v->fbi.clut[v->banshee.io[io_dacAddr] & 0x1ff] = v->banshee.io[offset]; if (LOG_REGISTERS) - logerror("%s:banshee_dac_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.io[io_dacAddr] & 0x1ff); + logerror("%s:banshee_dac_r(%X)\n", device->machine->describe_context(), v->banshee.io[io_dacAddr] & 0x1ff); break; case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc: @@ -4160,7 +4160,7 @@ READ32_DEVICE_HANDLER( banshee_io_r ) default: result = v->banshee.io[offset]; if (LOG_REGISTERS) - logerror("%s:banshee_io_r(%s)\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset]); + logerror("%s:banshee_io_r(%s)\n", device->machine->describe_context(), banshee_io_reg_name[offset]); break; } @@ -4170,7 +4170,7 @@ READ32_DEVICE_HANDLER( banshee_io_r ) READ32_DEVICE_HANDLER( banshee_rom_r ) { - logerror("%s:banshee_rom_r(%X)\n", cpuexec_describe_context(device->machine), offset*4); + logerror("%s:banshee_rom_r(%X)\n", device->machine->describe_context(), offset*4); return 0xffffffff; } @@ -4264,7 +4264,7 @@ static WRITE32_DEVICE_HANDLER( banshee_agp_w ) } if (LOG_REGISTERS) - logerror("%s:banshee_w(AGP:%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_agp_reg_name[offset], data, mem_mask); + logerror("%s:banshee_w(AGP:%s) = %08X & %08X\n", device->machine->describe_context(), banshee_agp_reg_name[offset], data, mem_mask); } @@ -4281,15 +4281,15 @@ WRITE32_DEVICE_HANDLER( banshee_w ) else if (offset < 0x100000/4) banshee_agp_w(device, offset, data, mem_mask); else if (offset < 0x200000/4) - logerror("%s:banshee_w(2D:%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), (offset*4) & 0xfffff, data, mem_mask); + logerror("%s:banshee_w(2D:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0xfffff, data, mem_mask); else if (offset < 0x600000/4) register_w(v, offset & 0x1fffff/4, data); else if (offset < 0x800000/4) - logerror("%s:banshee_w(TEX:%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), (offset*4) & 0x1fffff, data, mem_mask); + logerror("%s:banshee_w(TEX:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0x1fffff, data, mem_mask); else if (offset < 0xc00000/4) - logerror("%s:banshee_w(RES:%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), (offset*4) & 0x3fffff, data, mem_mask); + logerror("%s:banshee_w(RES:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0x3fffff, data, mem_mask); else if (offset < 0x1000000/4) - logerror("%s:banshee_w(YUV:%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), (offset*4) & 0x3fffff, data, mem_mask); + logerror("%s:banshee_w(YUV:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0x3fffff, data, mem_mask); else if (offset < 0x2000000/4) { UINT8 temp = v->fbi.lfb_stride; @@ -4319,7 +4319,7 @@ WRITE32_DEVICE_HANDLER( banshee_fb_w ) { if (offset*4 <= v->fbi.mask) COMBINE_DATA(&((UINT32 *)v->fbi.ram)[offset]); - logerror("%s:banshee_fb_w(%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), offset*4, data, mem_mask); + logerror("%s:banshee_fb_w(%X) = %08X & %08X\n", device->machine->describe_context(), offset*4, data, mem_mask); } } else @@ -4342,14 +4342,14 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w ) { v->banshee.vga[0x3c1 & 0x1f] = data; if (LOG_REGISTERS) - logerror("%s:banshee_vga_w(%X) = %02X\n", cpuexec_describe_context(device->machine), 0x3c0+offset, data); + logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine->describe_context(), 0x3c0+offset, data); } else { if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att)) v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]] = data; if (LOG_REGISTERS) - logerror("%s:banshee_att_w(%X) = %02X\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3c1 & 0x1f], data); + logerror("%s:banshee_att_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3c1 & 0x1f], data); } v->banshee.attff ^= 1; break; @@ -4359,7 +4359,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w ) if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq)) v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]] = data; if (LOG_REGISTERS) - logerror("%s:banshee_seq_w(%X) = %02X\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3c4 & 0x1f], data); + logerror("%s:banshee_seq_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3c4 & 0x1f], data); break; /* Graphics controller access */ @@ -4367,7 +4367,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w ) if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc)) v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]] = data; if (LOG_REGISTERS) - logerror("%s:banshee_gc_w(%X) = %02X\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3ce & 0x1f], data); + logerror("%s:banshee_gc_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3ce & 0x1f], data); break; /* CRTC access */ @@ -4375,13 +4375,13 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w ) if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc)) v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]] = data; if (LOG_REGISTERS) - logerror("%s:banshee_crtc_w(%X) = %02X\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3d4 & 0x1f], data); + logerror("%s:banshee_crtc_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3d4 & 0x1f], data); break; default: v->banshee.vga[offset] = data; if (LOG_REGISTERS) - logerror("%s:banshee_vga_w(%X) = %02X\n", cpuexec_describe_context(device->machine), 0x3c0+offset, data); + logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine->describe_context(), 0x3c0+offset, data); break; } } @@ -4403,7 +4403,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w ) if ((v->banshee.io[offset] ^ old) & 0x2800) v->fbi.clut_dirty = TRUE; if (LOG_REGISTERS) - logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask); + logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask); break; case io_dacData: @@ -4414,14 +4414,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w ) v->fbi.clut_dirty = TRUE; } if (LOG_REGISTERS) - logerror("%s:banshee_dac_w(%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask); + logerror("%s:banshee_dac_w(%X) = %08X & %08X\n", device->machine->describe_context(), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask); break; case io_miscInit0: COMBINE_DATA(&v->banshee.io[offset]); v->fbi.yorigin = (data >> 18) & 0xfff; if (LOG_REGISTERS) - logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask); + logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask); break; case io_vidScreenSize: @@ -4435,14 +4435,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w ) v->screen->set_visible_area(0, v->fbi.width - 1, 0, v->fbi.height - 1); adjust_vblank_timer(v); if (LOG_REGISTERS) - logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask); + logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask); break; case io_lfbMemoryConfig: v->fbi.lfb_base = (data & 0x1fff) << 10; v->fbi.lfb_stride = ((data >> 13) & 7) + 9; if (LOG_REGISTERS) - logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask); + logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask); break; case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc: @@ -4461,7 +4461,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w ) default: COMBINE_DATA(&v->banshee.io[offset]); if (LOG_REGISTERS) - logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask); + logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask); break; } } diff --git a/src/emu/watchdog.c b/src/emu/watchdog.c index 6646c8fc60d..a714973ac44 100644 --- a/src/emu/watchdog.c +++ b/src/emu/watchdog.c @@ -109,7 +109,7 @@ void watchdog_reset(running_machine *machine) { /* if we're not enabled, skip it */ if (!watchdog_enabled) - timer_adjust_oneshot(watchdog_timer, attotime::never, 0); + watchdog_timer->adjust(attotime::never); /* VBLANK-based watchdog? */ else if (machine->config->m_watchdog_vblank_count != 0) @@ -123,11 +123,11 @@ void watchdog_reset(running_machine *machine) /* timer-based watchdog? */ else if (machine->config->m_watchdog_time != attotime::zero) - timer_adjust_oneshot(watchdog_timer, machine->config->m_watchdog_time, 0); + watchdog_timer->adjust(machine->config->m_watchdog_time); /* default to an obscene amount of time (3 seconds) */ else - timer_adjust_oneshot(watchdog_timer, attotime::from_seconds(3), 0); + watchdog_timer->adjust(attotime::from_seconds(3)); } diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c index 72abce2c5cb..537faeac455 100644 --- a/src/ldplayer/ldplayer.c +++ b/src/ldplayer/ldplayer.c @@ -317,7 +317,7 @@ static TIMER_CALLBACK( pr8210_bit_callback ) data = pr8210_command_buffer[pr8210_command_buffer_out++ % ARRAY_LENGTH(pr8210_command_buffer)]; bitsleft = 12; } - timer_adjust_oneshot(pr8210_bit_timer, duration, (bitsleft << 16) | data); + pr8210_bit_timer->adjust(duration, (bitsleft << 16) | data); } @@ -332,7 +332,7 @@ static MACHINE_START( pr8210 ) static MACHINE_RESET( pr8210 ) { MACHINE_RESET_CALL(ldplayer); - timer_adjust_oneshot(pr8210_bit_timer, attotime::zero, 0); + pr8210_bit_timer->adjust(attotime::zero); } diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c index eb34c5c6bc3..b5ffe8e07a3 100644 --- a/src/mame/audio/8080bw.c +++ b/src/mame/audio/8080bw.c @@ -815,13 +815,13 @@ WRITE8_HANDLER( schaser_sh_port_1_w ) if (state->schaser_effect_555_time_remain != attotime::zero) { /* timer re-enabled, use up remaining 555 high time */ - timer_adjust_oneshot(state->schaser_effect_555_timer, state->schaser_effect_555_time_remain, effect); + state->schaser_effect_555_timer->adjust(state->schaser_effect_555_time_remain, effect); } else if (!state->schaser_effect_555_is_low) { /* set 555 high time */ attotime new_time = attotime(0, ATTOSECONDS_PER_SECOND * .8873 * schaser_effect_rc[effect]); - timer_adjust_oneshot(state->schaser_effect_555_timer, new_time, effect); + state->schaser_effect_555_timer->adjust(new_time, effect); } } else @@ -829,9 +829,9 @@ WRITE8_HANDLER( schaser_sh_port_1_w ) /* disable effect - stops at end of low cycle */ if (!state->schaser_effect_555_is_low) { - state->schaser_effect_555_time_remain = timer_timeleft(state->schaser_effect_555_timer); + state->schaser_effect_555_time_remain = state->schaser_effect_555_timer->remaining(); state->schaser_effect_555_time_remain_savable = state->schaser_effect_555_time_remain.as_double(); - timer_adjust_oneshot(state->schaser_effect_555_timer, attotime::never, 0); + state->schaser_effect_555_timer->adjust(attotime::never); } } state->schaser_last_effect = effect; @@ -899,7 +899,7 @@ static TIMER_CALLBACK( schaser_effect_555_cb ) else new_time = attotime::never; } - timer_adjust_oneshot(state->schaser_effect_555_timer, new_time, effect); + state->schaser_effect_555_timer->adjust(new_time, effect); sn76477_enable_w(state->sn, !(state->schaser_effect_555_is_low || state->schaser_explosion)); sn76477_one_shot_cap_voltage_w(state->sn, !(state->schaser_effect_555_is_low || state->schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT); } @@ -934,7 +934,7 @@ MACHINE_RESET( schaser_sh ) address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); state->schaser_effect_555_is_low = 0; - timer_adjust_oneshot(state->schaser_effect_555_timer, attotime::never, 0); + state->schaser_effect_555_timer->adjust(attotime::never); schaser_sh_port_1_w(space, 0, 0); schaser_sh_port_2_w(space, 0, 0); state->schaser_effect_555_time_remain = attotime::zero; diff --git a/src/mame/audio/amiga.c b/src/mame/audio/amiga.c index 270e9094aff..3e1eca81697 100644 --- a/src/mame/audio/amiga.c +++ b/src/mame/audio/amiga.c @@ -86,7 +86,7 @@ static void dma_reload(amiga_state *state, audio_channel *chan) { chan->curlocation = CUSTOM_REG_LONG(REG_AUD0LCH + chan->index * 8); chan->curlength = CUSTOM_REG(REG_AUD0LEN + chan->index * 8); - timer_adjust_oneshot(chan->irq_timer, attotime::from_hz(15750), chan->index); + chan->irq_timer->adjust(attotime::from_hz(15750), chan->index); LOG(("dma_reload(%d): offs=%05X len=%04X\n", chan->index, chan->curlocation, chan->curlength)); } diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c index b7bf9020bf0..df537751486 100644 --- a/src/mame/audio/cage.c +++ b/src/mame/audio/cage.c @@ -520,7 +520,7 @@ static READ32_HANDLER( cage_io_status_r ) UINT16 main_from_cage_r(address_space *space) { if (LOG_COMM) - logerror("%s:main read data = %04X\n", cpuexec_describe_context(space->machine), soundlatch_word_r(space, 0, 0)); + logerror("%s:main read data = %04X\n", space->machine->describe_context(), soundlatch_word_r(space, 0, 0)); cage_to_cpu_ready = 0; update_control_lines(space->machine); return soundlatch_word_r(space, 0, 0xffff); @@ -540,7 +540,7 @@ void main_to_cage_w(UINT16 data) { running_machine *machine = cage_cpu->machine; if (LOG_COMM) - logerror("%s:Command to CAGE = %04X\n", cpuexec_describe_context(machine), data); + logerror("%s:Command to CAGE = %04X\n", machine->describe_context(), data); machine->scheduler().synchronize(FUNC(deferred_cage_w), data); } diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c index cd70d0ac6a7..abc666b7a46 100644 --- a/src/mame/audio/dcs.c +++ b/src/mame/audio/dcs.c @@ -1502,7 +1502,7 @@ int dcs_control_r(void) { /* only boost for DCS2 boards */ if (!dcs.auto_ack && !transfer.hle_enabled) - cpuexec_boost_interleave(dcs.cpu->machine, attotime::from_nsec(500), attotime::from_usec(5)); + dcs.cpu->machine->scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5)); return dcs.latch_control; } @@ -1512,7 +1512,7 @@ void dcs_reset_w(int state) /* going high halts the CPU */ if (state) { - logerror("%s: DCS reset = %d\n", cpuexec_describe_context(dcs.cpu->machine), state); + logerror("%s: DCS reset = %d\n", dcs.cpu->machine->describe_context(), state); /* just run through the init code again */ dcs.cpu->machine->scheduler().synchronize(FUNC(dcs_reset)); @@ -1557,10 +1557,10 @@ static READ16_HANDLER( fifo_input_r ) static void dcs_delayed_data_w(running_machine *machine, int data) { if (LOG_DCS_IO) - logerror("%s:dcs_data_w(%04X)\n", cpuexec_describe_context(machine), data); + logerror("%s:dcs_data_w(%04X)\n", machine->describe_context(), data); /* boost the interleave temporarily */ - cpuexec_boost_interleave(machine, attotime::from_nsec(500), attotime::from_usec(5)); + machine->scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5)); /* set the IRQ line on the ADSP */ cpu_set_input_line(dcs.cpu, ADSP2105_IRQ2, ASSERT_LINE); @@ -1663,7 +1663,7 @@ int dcs_data_r(void) delayed_ack_w(); if (LOG_DCS_IO) - logerror("%s:dcs_data_r(%04X)\n", cpuexec_describe_context(dcs.cpu->machine), dcs.output_data); + logerror("%s:dcs_data_r(%04X)\n", dcs.cpu->machine->describe_context(), dcs.output_data); return dcs.output_data; } @@ -2153,7 +2153,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data) if (data == 0x001a) { if (LOG_DCS_TRANSFERS) - logerror("%s:DCS Transfer command %04X\n", cpuexec_describe_context(machine), data); + logerror("%s:DCS Transfer command %04X\n", machine->describe_context(), data); transfer.state++; if (transfer.hle_enabled) return 1; @@ -2163,7 +2163,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data) else if (data == 0x002a) { if (LOG_DCS_TRANSFERS) - logerror("%s:DCS State change %04X\n", cpuexec_describe_context(machine), data); + logerror("%s:DCS State change %04X\n", machine->describe_context(), data); transfer.dcs_state = 1; } @@ -2289,7 +2289,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data) if (data == 0x55d0 || data == 0x55d1) { if (LOG_DCS_TRANSFERS) - logerror("%s:DCS Transfer command %04X\n", cpuexec_describe_context(machine), data); + logerror("%s:DCS Transfer command %04X\n", machine->describe_context(), data); transfer.state++; if (transfer.hle_enabled) return 1; @@ -2299,7 +2299,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data) else { if (LOG_DCS_TRANSFERS) - logerror("%s:Command: %04X\n", cpuexec_describe_context(machine), data); + logerror("%s:Command: %04X\n", machine->describe_context(), data); } break; diff --git a/src/mame/audio/dkong.c b/src/mame/audio/dkong.c index 135936b61ae..556b0e8b03e 100644 --- a/src/mame/audio/dkong.c +++ b/src/mame/audio/dkong.c @@ -1253,7 +1253,7 @@ static READ8_DEVICE_HANDLER( dkong_tune_r ) } else { - /* printf("%s:rom access\n",cpuexec_describe_context(device->machine)); */ + /* printf("%s:rom access\n",device->machine->describe_context()); */ return (state->snd_rom[0x1000 + (page & 7) * 256 + offset]); } } diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c index 7826b5ae9a0..8d9934cf12e 100644 --- a/src/mame/audio/exidy.c +++ b/src/mame/audio/exidy.c @@ -495,7 +495,7 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w ) if (state->tms != NULL) { - logerror("(%f)%s:TMS5220 data write = %02X\n", device->machine->time().as_double(), cpuexec_describe_context(device->machine), riot6532_porta_out_get(state->riot)); + logerror("(%f)%s:TMS5220 data write = %02X\n", device->machine->time().as_double(), device->machine->describe_context(), riot6532_porta_out_get(state->riot)); tms5220_data_w(state->tms, 0, data); } } @@ -505,7 +505,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r ) exidy_sound_state *state = get_safe_token(device); if (state->tms != NULL) { - logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine->time().as_double(), cpuexec_describe_context(device->machine), tms5220_status_r(state->tms, 0)); + logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine->time().as_double(), device->machine->describe_context(), tms5220_status_r(state->tms, 0)); return tms5220_status_r(state->tms, 0); } else @@ -1016,7 +1016,7 @@ static WRITE8_DEVICE_HANDLER( victory_sound_irq_clear_w ) { exidy_sound_state *state = get_safe_token(device); - if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", cpuexec_describe_context(device->machine), data); + if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", device->machine->describe_context(), data); if (!data) pia6821_ca1_w(state->pia1, 1); } @@ -1026,7 +1026,7 @@ static WRITE8_DEVICE_HANDLER( victory_main_ack_w ) { exidy_sound_state *state = get_safe_token(device); - if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", cpuexec_describe_context(device->machine), data); + if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", device->machine->describe_context(), data); if (state->victory_sound_response_ack_clk && !data) pia6821_cb1_w(state->pia1, 1); diff --git a/src/mame/audio/geebee.c b/src/mame/audio/geebee.c index 09ac2765154..41d1c966a67 100644 --- a/src/mame/audio/geebee.c +++ b/src/mame/audio/geebee.c @@ -59,7 +59,7 @@ WRITE8_DEVICE_HANDLER( geebee_sound_w ) * discharge C33 (1uF) through R50 (22k) -> 0.14058s */ attotime period = attotime::from_hz(32768) * 14058 / 100000; - timer_adjust_periodic(state->volume_timer, period, 0, period); + state->volume_timer->adjust(period, 0, period); } else { @@ -71,7 +71,7 @@ WRITE8_DEVICE_HANDLER( geebee_sound_w ) * maybe half as fast? */ attotime period = attotime::from_hz(32768) * 29060 / 100000; - timer_adjust_periodic(state->volume_timer, period, 0, period); + state->volume_timer->adjust(period, 0, period); } } diff --git a/src/mame/audio/gottlieb.c b/src/mame/audio/gottlieb.c index 3e837e843fa..7c50bf18e13 100644 --- a/src/mame/audio/gottlieb.c +++ b/src/mame/audio/gottlieb.c @@ -420,7 +420,7 @@ static WRITE8_HANDLER( signal_audio_nmi_w ) INLINE void nmi_timer_adjust(void) { /* adjust timer to go off in the future based on the current rate */ - timer_adjust_oneshot(nmi_timer, attotime::from_hz(SOUND2_CLOCK/16) * (256 * (256 - nmi_rate)), 0); + nmi_timer->adjust(attotime::from_hz(SOUND2_CLOCK/16) * (256 * (256 - nmi_rate))); } diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c index 1463e0be865..8ce3d73ac0c 100644 --- a/src/mame/audio/leland.c +++ b/src/mame/audio/leland.c @@ -834,7 +834,7 @@ static void handle_eoi(device_t *device, int data) case 0x0d: state->i80186.intr.in_service &= ~0x20; break; case 0x0e: state->i80186.intr.in_service &= ~0x40; break; case 0x0f: state->i80186.intr.in_service &= ~0x80; break; - default: logerror("%s:ERROR - 80186 EOI with unknown vector %02X\n", cpuexec_describe_context(machine), data & 0x1f); + default: logerror("%s:ERROR - 80186 EOI with unknown vector %02X\n", machine->describe_context(), data & 0x1f); } if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", machine->time().as_double(), data & 0x1f); } @@ -906,11 +906,11 @@ static TIMER_CALLBACK( internal_timer_int ) if (t->control & 0x0001) { int count = t->maxA ? t->maxA : 0x10000; - timer_adjust_oneshot(t->int_timer, attotime::from_hz(2000000) * count, which); + t->int_timer->adjust(attotime::from_hz(2000000) * count, which); if (LOG_TIMER) logerror(" Repriming interrupt\n"); } else - timer_adjust_oneshot(t->int_timer, attotime::never, which); + t->int_timer->adjust(attotime::never, which); } @@ -921,7 +921,7 @@ static void internal_timer_sync(leland_sound_state *state, int which) /* if we have a timing timer running, adjust the count */ if (t->time_timer_active) { - attotime current_time = timer_timeelapsed(t->time_timer); + attotime current_time = t->time_timer->elapsed(); int net_clocks = ((current_time - t->last_time) * 2000000).as_double(); t->last_time = current_time; @@ -1024,7 +1024,7 @@ static void internal_timer_update(leland_sound_state *state, int which, int new_ internal_timer_sync(state, which); /* nuke the timer and force the interrupt timer to be recomputed */ - timer_adjust_oneshot(t->time_timer, attotime::never, which); + t->time_timer->adjust(attotime::never, which); t->time_timer_active = 0; update_int_timer = 1; } @@ -1033,7 +1033,7 @@ static void internal_timer_update(leland_sound_state *state, int which, int new_ else if ((diff & 0x8000) && (new_control & 0x8000)) { /* start the timing */ - timer_adjust_oneshot(t->time_timer, attotime::never, which); + t->time_timer->adjust(attotime::never, which); t->time_timer_active = 1; update_int_timer = 1; } @@ -1062,11 +1062,11 @@ static void internal_timer_update(leland_sound_state *state, int which, int new_ { int diff = t->maxA - t->count; if (diff <= 0) diff += 0x10000; - timer_adjust_oneshot(t->int_timer, attotime::from_hz(2000000) * diff, which); + t->int_timer->adjust(attotime::from_hz(2000000) * diff, which); if (LOG_TIMER) logerror("Set interrupt timer for %d\n", which); } else - timer_adjust_oneshot(t->int_timer, attotime::never, which); + t->int_timer->adjust(attotime::never, which); } } @@ -1153,7 +1153,7 @@ static void update_dma_control(leland_sound_state *state, int which, int new_con if (LOG_DMA) logerror("Initiated DMA %d - count = %04X, source = %04X, dest = %04X\n", which, d->count, d->source, d->dest); d->finished = 0; - timer_adjust_oneshot(d->finish_timer, attotime::from_hz(state->dac[dacnum].frequency) * count, which); + d->finish_timer->adjust(attotime::from_hz(state->dac[dacnum].frequency) * count, which); } } @@ -1612,7 +1612,7 @@ INLINE void counter_update_count(struct counter_state *ctr) if (ctr->timer) { /* determine how many 2MHz cycles are remaining */ - int count = (timer_timeleft(ctr->timer) * 2000000).as_double(); + int count = (ctr->timer->remaining() * 2000000).as_double(); ctr->count = (count < 0) ? 0 : count; } } @@ -1696,7 +1696,7 @@ static WRITE16_DEVICE_HANDLER( pit8254_w ) if (ctr->count == 0) ctr->count = 0x10000; /* reset/start the timer */ - timer_adjust_oneshot(ctr->timer, attotime::never, 0); + ctr->timer->adjust(attotime::never); if (LOG_PIT) logerror("PIT counter %d set to %d (%d Hz)\n", which, ctr->count, 4000000 / ctr->count); @@ -1807,7 +1807,7 @@ static TIMER_CALLBACK( command_lo_sync ) { device_t *device = (device_t *)ptr; leland_sound_state *state = get_safe_token(device); - if (LOG_COMM) logerror("%s:Write sound command latch lo = %02X\n", cpuexec_describe_context(machine), param); + if (LOG_COMM) logerror("%s:Write sound command latch lo = %02X\n", machine->describe_context(), param); state->sound_command = (state->sound_command & 0xff00) | param; } diff --git a/src/mame/audio/mcr.c b/src/mame/audio/mcr.c index 867eea2447a..1101a2c2247 100644 --- a/src/mame/audio/mcr.c +++ b/src/mame/audio/mcr.c @@ -521,7 +521,7 @@ static TIMER_CALLBACK( csdeluxe_delayed_data_w ) /* oftentimes games will write one nibble at a time; the sync on this is very */ /* important, so we boost the interleave briefly while this happens */ - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(100)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } static READ16_DEVICE_HANDLER( csdeluxe_pia_r ) @@ -659,7 +659,7 @@ static TIMER_CALLBACK( soundsgood_delayed_data_w ) /* oftentimes games will write one nibble at a time; the sync on this is very */ /* important, so we boost the interleave briefly while this happens */ - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(250)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(250)); } @@ -763,7 +763,7 @@ static TIMER_CALLBACK( turbocs_delayed_data_w ) /* oftentimes games will write one nibble at a time; the sync on this is very */ /* important, so we boost the interleave briefly while this happens */ - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(100)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } diff --git a/src/mame/audio/n8080.c b/src/mame/audio/n8080.c index 7b90840bd83..fafe49f5fa2 100644 --- a/src/mame/audio/n8080.c +++ b/src/mame/audio/n8080.c @@ -142,7 +142,7 @@ static void start_mono_flop( device_t *sn, int n, attotime expire ) update_SN76477_status(sn); - timer_adjust_oneshot(state->sound_timer[n], expire, n); + state->sound_timer[n]->adjust(expire, n); } @@ -153,7 +153,7 @@ static void stop_mono_flop( device_t *sn, int n ) update_SN76477_status(sn); - timer_adjust_oneshot(state->sound_timer[n], attotime::never, n); + state->sound_timer[n]->adjust(attotime::never, n); } @@ -443,7 +443,7 @@ static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer ) if (state->mono_flop[2]) { - voltage = 5 * (1 - exp(- timer_timeelapsed(state->sound_timer[2]).as_double() / 0.22)); + voltage = 5 * (1 - exp(- state->sound_timer[2]->elapsed().as_double() / 0.22)); } sn76477_vco_voltage_w(sn, voltage); diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c index 48916c9573c..5c2094d8fc3 100644 --- a/src/mame/audio/segag80r.c +++ b/src/mame/audio/segag80r.c @@ -520,14 +520,14 @@ INLINE void sega005_update_sound_data(running_machine *machine) if ((diff & 0x20) && !(newval & 0x20)) { //mame_printf_debug("Stopping timer\n"); - timer_adjust_oneshot(sega005_sound_timer, attotime::never, 0); + sega005_sound_timer->adjust(attotime::never); } /* if bit 5 goes low, we start the timer again */ if ((diff & 0x20) && (newval & 0x20)) { //mame_printf_debug("Starting timer\n"); - timer_adjust_periodic(sega005_sound_timer, attotime::from_hz(SEGA005_555_TIMER_FREQ), 0, attotime::from_hz(SEGA005_555_TIMER_FREQ)); + sega005_sound_timer->adjust(attotime::from_hz(SEGA005_555_TIMER_FREQ), 0, attotime::from_hz(SEGA005_555_TIMER_FREQ)); } } @@ -948,7 +948,7 @@ static WRITE8_DEVICE_HANDLER( n7751_command_w ) */ n7751_command = data & 0x07; cputag_set_input_line(device->machine, "audiocpu", 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE); - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(100)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c index 647fd59b7cd..47d390f52bf 100644 --- a/src/mame/audio/segasnd.c +++ b/src/mame/audio/segasnd.c @@ -359,7 +359,7 @@ WRITE8_HANDLER( sega_usb_data_w ) space->machine->scheduler().synchronize(FUNC(delayed_usb_data_w), data); /* boost the interleave so that sequences can be sent */ - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(250)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(250)); } diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c index 653206c8e08..601074c5942 100644 --- a/src/mame/audio/snes_snd.c +++ b/src/mame/audio/snes_snd.c @@ -1151,7 +1151,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w ) } spc700->enabled[i] = BIT(data, i); - timer_enable(spc700->timer[i], spc700->enabled[i]); + spc700->timer[i]->enable(spc700->enabled[i]); } if (BIT(data, 4)) @@ -1186,7 +1186,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w ) case 0x7: /* Port 3 */ // mame_printf_debug("SPC: %02x to APU @ %d (PC=%x)\n", data, offset & 3, cpu_get_pc(space->cpu)); spc700->port_out[offset - 4] = data; - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(20)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(20)); break; case 0xa: /* Timer 0 */ case 0xb: /* Timer 1 */ @@ -1321,14 +1321,14 @@ static DEVICE_START( snes_sound ) /* Initialize the timers */ spc700->timer[0] = machine->scheduler().timer_alloc(FUNC(snes_spc_timer), spc700); - timer_adjust_periodic(spc700->timer[0], attotime::from_hz(8000), 0, attotime::from_hz(8000)); - timer_enable(spc700->timer[0], 0); + spc700->timer[0]->adjust(attotime::from_hz(8000), 0, attotime::from_hz(8000)); + spc700->timer[0]->enable(false); spc700->timer[1] = machine->scheduler().timer_alloc(FUNC(snes_spc_timer), spc700); - timer_adjust_periodic(spc700->timer[1], attotime::from_hz(8000), 1, attotime::from_hz(8000)); - timer_enable(spc700->timer[1], 0); + spc700->timer[1]->adjust(attotime::from_hz(8000), 1, attotime::from_hz(8000)); + spc700->timer[1]->enable(false); spc700->timer[2] = machine->scheduler().timer_alloc(FUNC(snes_spc_timer), spc700); - timer_adjust_periodic(spc700->timer[2], attotime::from_hz(64000), 2, attotime::from_hz(64000)); - timer_enable(spc700->timer[2], 0); + spc700->timer[2]->adjust(attotime::from_hz(64000), 2, attotime::from_hz(64000)); + spc700->timer[2]->enable(false); state_register(device); state_save_register_device_item_pointer(device, 0, spc700->ram, SNES_SPCRAM_SIZE); diff --git a/src/mame/audio/starwars.c b/src/mame/audio/starwars.c index 2fcda85cfc8..48f883f64a9 100644 --- a/src/mame/audio/starwars.c +++ b/src/mame/audio/starwars.c @@ -86,7 +86,7 @@ static TIMER_CALLBACK( sound_callback ) starwars_state *state = machine->driver_data<starwars_state>(); riot6532_porta_in_set(state->riot, 0x40, 0x40); state->main_data = param; - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(100)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } @@ -133,7 +133,7 @@ static TIMER_CALLBACK( main_callback ) riot6532_porta_in_set(state->riot, 0x80, 0x80); state->sound_data = param; - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(100)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } WRITE8_HANDLER( starwars_main_wr_w ) diff --git a/src/mame/audio/vicdual.c b/src/mame/audio/vicdual.c index 03b89263813..0272d1ff9de 100644 --- a/src/mame/audio/vicdual.c +++ b/src/mame/audio/vicdual.c @@ -170,7 +170,7 @@ WRITE8_HANDLER( frogs_audio_w ) if (last_croak) { /* The croak will keep playing until .429s after being disabled */ - timer_adjust_oneshot(frogs_croak_timer, attotime::from_double(1.1 * RES_K(390) * CAP_U(1)), 0); + frogs_croak_timer->adjust(attotime::from_double(1.1 * RES_K(390) * CAP_U(1))); } } if (new_buzzz) diff --git a/src/mame/audio/warpwarp.c b/src/mame/audio/warpwarp.c index e476fc6df97..b9b85267da1 100644 --- a/src/mame/audio/warpwarp.c +++ b/src/mame/audio/warpwarp.c @@ -73,7 +73,7 @@ WRITE8_DEVICE_HANDLER( warpwarp_sound_w ) * 0.639 * 15k * 1uF -> 0.9585s */ attotime period = attotime::from_hz(32768) * 95850 / 100000; - timer_adjust_periodic(state->sound_volume_timer, period, 0, period); + state->sound_volume_timer->adjust(period, 0, period); } else { @@ -86,7 +86,7 @@ WRITE8_DEVICE_HANDLER( warpwarp_sound_w ) */ //attotime period = attotime::from_hz(32768) * 702900 / 100000; attotime period = attotime::from_hz(32768) * 191700 / 100000; - timer_adjust_periodic(state->sound_volume_timer, period, 0, period); + state->sound_volume_timer->adjust(period, 0, period); } } @@ -125,7 +125,7 @@ WRITE8_DEVICE_HANDLER( warpwarp_music2_w ) * ...I'm sure this is off by one number of magnitude :/ */ attotime period = attotime::from_hz(32768) * 95850 / 100000; - timer_adjust_periodic(state->music_volume_timer, period, 0, period); + state->music_volume_timer->adjust(period, 0, period); } else { @@ -136,7 +136,7 @@ WRITE8_DEVICE_HANDLER( warpwarp_music2_w ) */ //attotime period = attotime::from_hz(32768) * 3003300 / 100000; attotime period = attotime::from_hz(32768) * 300330 / 100000; - timer_adjust_periodic(state->music_volume_timer, period, 0, period); + state->music_volume_timer->adjust(period, 0, period); } } diff --git a/src/mame/audio/williams.c b/src/mame/audio/williams.c index c1e3862ed22..684deea1a42 100644 --- a/src/mame/audio/williams.c +++ b/src/mame/audio/williams.c @@ -674,7 +674,7 @@ void williams_adpcm_data_w(int data) { cpu_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE); williams_sound_int_state = 1; - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(100)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } } diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c index facda0376ad..d60d9f401dd 100644 --- a/src/mame/drivers/39in1.c +++ b/src/mame/drivers/39in1.c @@ -95,8 +95,8 @@ 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 ); - //printf( "%s: %s", cpuexec_describe_context(machine), buf ); + logerror( "%s: %s", machine->describe_context(), buf ); + //printf( "%s: %s", machine->describe_context(), buf ); } } @@ -253,9 +253,9 @@ static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int c // Shut down any transfers that are currently going on, software should be smart enough to check if a // transfer is running before starting another one on the same channel. - if (timer_enabled(dma_regs->timer[channel])) + if (dma_regs->timer[channel]->enabled()) { - timer_adjust_oneshot(dma_regs->timer[channel], attotime::never, 0); + dma_regs->timer[channel]->adjust(attotime::never); } // Load the next descriptor @@ -277,7 +277,7 @@ static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int c break; } - timer_adjust_oneshot(dma_regs->timer[channel], period, channel); + dma_regs->timer[channel]->adjust(period, channel); // Interrupt as necessary if(dma_regs->dcmd[channel] & PXA255_DCMD_STARTIRQEN) @@ -627,7 +627,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w ) attotime period = attotime::from_hz(3846400) * (ostimer_regs->osmr[0] - ostimer_regs->oscr); //printf( "Adjusting one-shot timer to 200MHz * %08x\n", ostimer_regs->osmr[0]); - timer_adjust_oneshot(ostimer_regs->timer[0], period, 0); + ostimer_regs->timer[0]->adjust(period); } break; case PXA255_OSMR1: @@ -637,7 +637,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w ) { attotime period = attotime::from_hz(3846400) * (ostimer_regs->osmr[1] - ostimer_regs->oscr); - timer_adjust_oneshot(ostimer_regs->timer[1], period, 1); + ostimer_regs->timer[1]->adjust(period, 1); } break; case PXA255_OSMR2: @@ -647,7 +647,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w ) { attotime period = attotime::from_hz(3846400) * (ostimer_regs->osmr[2] - ostimer_regs->oscr); - timer_adjust_oneshot(ostimer_regs->timer[2], period, 2); + ostimer_regs->timer[2]->adjust(period, 2); } break; case PXA255_OSMR3: @@ -657,7 +657,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w ) { //attotime period = attotime::from_hz(3846400) * (ostimer_regs->osmr[3] - ostimer_regs->oscr); - //timer_adjust_oneshot(ostimer_regs->timer[3], period, 3); + //ostimer_regs->timer[3]->adjust(period, 3); } break; case PXA255_OSCR: @@ -684,7 +684,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w ) { //attotime period = attotime::from_hz(200000000) * ostimer_regs->osmr[index]; - //timer_adjust_oneshot(ostimer_regs->timer[index], period, index); + //ostimer_regs->timer[index]->adjust(period, index); } } @@ -1090,7 +1090,7 @@ static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel) { attotime period = attotime::from_hz(20000000) * (lcd_regs->dma[channel].ldcmd & 0x000fffff); - timer_adjust_oneshot(lcd_regs->dma[channel].eof, period, channel); + lcd_regs->dma[channel].eof->adjust(period, channel); if(lcd_regs->dma[channel].ldcmd & PXA255_LDCMD_SOFINT) { @@ -1263,7 +1263,7 @@ static WRITE32_HANDLER( pxa255_lcd_w ) case PXA255_FBR0: // 0x44000020 verboselog( space->machine, 4l, "pxa255_lcd_w: LCD Frame Branch Register 0: %08x & %08x\n", data, mem_mask ); lcd_regs->fbr[0] = data & 0xfffffff3; - if(!timer_enabled(lcd_regs->dma[0].eof)) + if(!lcd_regs->dma[0].eof->enabled()) { if (0) verboselog( space->machine, 3, "ch0 EOF timer is not enabled, taking branch now\n" ); pxa255_lcd_check_load_next_branch(space->machine, 0); @@ -1273,7 +1273,7 @@ static WRITE32_HANDLER( pxa255_lcd_w ) case PXA255_FBR1: // 0x44000024 verboselog( space->machine, 3, "pxa255_lcd_w: LCD Frame Branch Register 1: %08x & %08x\n", data, mem_mask ); lcd_regs->fbr[1] = data & 0xfffffff3; - if(!timer_enabled(lcd_regs->dma[1].eof)) + if(!lcd_regs->dma[1].eof->enabled()) { verboselog( space->machine, 3, "ch1 EOF timer is not enabled, taking branch now\n" ); pxa255_lcd_check_load_next_branch(space->machine, 1); @@ -1298,7 +1298,7 @@ static WRITE32_HANDLER( pxa255_lcd_w ) break; case PXA255_FDADR0: // 0x44000200 verboselog( space->machine, 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", data, mem_mask ); - if(!timer_enabled(lcd_regs->dma[0].eof)) + if(!lcd_regs->dma[0].eof->enabled()) { pxa255_lcd_load_dma_descriptor(space, data & 0xfffffff0, 0); } @@ -1319,7 +1319,7 @@ static WRITE32_HANDLER( pxa255_lcd_w ) break; case PXA255_FDADR1: // 0x44000210 verboselog( space->machine, 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", data, mem_mask ); - if(!timer_enabled(lcd_regs->dma[1].eof)) + if(!lcd_regs->dma[1].eof->enabled()) { pxa255_lcd_load_dma_descriptor(space, data & 0xfffffff0, 1); } diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c index 830ee0131d0..354dd6e0d9d 100644 --- a/src/mame/drivers/acefruit.c +++ b/src/mame/drivers/acefruit.c @@ -47,7 +47,7 @@ static TIMER_CALLBACK( acefruit_refresh ) vpos = ( ( vpos / 8 ) + 1 ) * 8; - timer_adjust_oneshot( acefruit_refresh_timer, machine->primary_screen->time_until_pos(vpos), 0 ); + acefruit_refresh_timer->adjust( machine->primary_screen->time_until_pos(vpos) ); } static VIDEO_START( acefruit ) @@ -58,7 +58,7 @@ static VIDEO_START( acefruit ) static INTERRUPT_GEN( acefruit_vblank ) { cpu_set_input_line(device, 0, HOLD_LINE ); - timer_adjust_oneshot( acefruit_refresh_timer, attotime::zero, 0 ); + acefruit_refresh_timer->adjust( attotime::zero ); } static VIDEO_UPDATE( acefruit ) diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c index 9a00e6eba76..e97430c1e06 100644 --- a/src/mame/drivers/alg.c +++ b/src/mame/drivers/alg.c @@ -131,7 +131,7 @@ static TIMER_CALLBACK( response_timer ) /* if there's more to come, set another timer */ if (laserdisc_line_r(state->laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE) - timer_adjust_oneshot(state->serial_timer, amiga_get_serial_char_period(machine), 0); + state->serial_timer->adjust(amiga_get_serial_char_period(machine)); else state->serial_timer_active = FALSE; } @@ -144,7 +144,7 @@ static void vsync_callback(running_machine *machine) /* if we have data available, set a timer to read it */ if (!state->serial_timer_active && laserdisc_line_r(state->laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE) { - timer_adjust_oneshot(state->serial_timer, amiga_get_serial_char_period(machine), 0); + state->serial_timer->adjust(amiga_get_serial_char_period(machine)); state->serial_timer_active = TRUE; } } @@ -160,7 +160,7 @@ static void serial_w(running_machine *machine, UINT16 data) /* if we have data available, set a timer to read it */ if (!state->serial_timer_active && laserdisc_line_r(state->laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE) { - timer_adjust_oneshot(state->serial_timer, amiga_get_serial_char_period(machine), 0); + state->serial_timer->adjust(amiga_get_serial_char_period(machine)); state->serial_timer_active = TRUE; } } @@ -245,7 +245,7 @@ static READ8_DEVICE_HANDLER( alg_cia_0_porta_r ) static READ8_DEVICE_HANDLER( alg_cia_0_portb_r ) { - logerror("%s:alg_cia_0_portb_r\n", cpuexec_describe_context(device->machine)); + logerror("%s:alg_cia_0_portb_r\n", device->machine->describe_context()); return 0xff; } @@ -253,20 +253,20 @@ static READ8_DEVICE_HANDLER( alg_cia_0_portb_r ) static WRITE8_DEVICE_HANDLER( alg_cia_0_portb_w ) { /* parallel port */ - logerror("%s:alg_cia_0_portb_w(%02x)\n", cpuexec_describe_context(device->machine), data); + logerror("%s:alg_cia_0_portb_w(%02x)\n", device->machine->describe_context(), data); } static READ8_DEVICE_HANDLER( alg_cia_1_porta_r ) { - logerror("%s:alg_cia_1_porta_r\n", cpuexec_describe_context(device->machine)); + logerror("%s:alg_cia_1_porta_r\n", device->machine->describe_context()); return 0xff; } static WRITE8_DEVICE_HANDLER( alg_cia_1_porta_w ) { - logerror("%s:alg_cia_1_porta_w(%02x)\n", cpuexec_describe_context(device->machine), data); + logerror("%s:alg_cia_1_porta_w(%02x)\n", device->machine->describe_context(), data); } diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c index 39ee57847b7..07e0b7f3a2b 100644 --- a/src/mame/drivers/aquarium.c +++ b/src/mame/drivers/aquarium.c @@ -128,7 +128,7 @@ static READ8_HANDLER( aquarium_oki_r ) static WRITE8_HANDLER( aquarium_oki_w ) { - logerror("%s:Writing %04x to the OKI M6295\n", cpuexec_describe_context(space->machine), aquarium_snd_bitswap(data)); + logerror("%s:Writing %04x to the OKI M6295\n", space->machine->describe_context(), aquarium_snd_bitswap(data)); okim6295_device *oki = space->machine->device<okim6295_device>("oki"); oki->write(*space, offset, (aquarium_snd_bitswap(data))); } diff --git a/src/mame/drivers/aristmk5.c b/src/mame/drivers/aristmk5.c index 8b5d4ac50d5..4a48f744f22 100644 --- a/src/mame/drivers/aristmk5.c +++ b/src/mame/drivers/aristmk5.c @@ -76,7 +76,7 @@ static READ32_HANDLER( ext_timer_latch_r ) { /* reset 2KHz timer */ ioc_regs[IRQ_STATUS_A] &= 0xfe; - timer_adjust_oneshot(mk5_2KHz_timer, attotime::from_hz(2000), 0); + mk5_2KHz_timer->adjust(attotime::from_hz(2000)); return 0xffffffff; //value doesn't matter apparently } @@ -221,7 +221,7 @@ static TIMER_CALLBACK( mk5_2KHz_callback ) { ioc_regs[4] |= 1; - timer_adjust_oneshot(mk5_2KHz_timer, attotime::never, 0); + mk5_2KHz_timer->adjust(attotime::never); } static MACHINE_START( aristmk5 ) @@ -237,7 +237,7 @@ static MACHINE_START( aristmk5 ) static MACHINE_RESET( aristmk5 ) { archimedes_reset(machine); - timer_adjust_oneshot(mk5_2KHz_timer, attotime::from_hz(2000), 0); + mk5_2KHz_timer->adjust(attotime::from_hz(2000)); ioc_regs[IRQ_STATUS_B] |= 0x40; //hack, set keyboard irq empty to be ON diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c index 301763bfe7e..8fd61c3114a 100644 --- a/src/mame/drivers/astinvad.c +++ b/src/mame/drivers/astinvad.c @@ -216,7 +216,7 @@ static TIMER_CALLBACK( kamizake_int_gen ) /* interrupts are asserted on every state change of the 128V line */ cpu_set_input_line(state->maincpu, 0, ASSERT_LINE); param ^= 128; - timer_adjust_oneshot(state->int_timer, machine->primary_screen->time_until_pos(param), param); + state->int_timer->adjust(machine->primary_screen->time_until_pos(param), param); /* an RC circuit turns the interrupt off after a short amount of time */ machine->scheduler().timer_set(attotime::from_double(300 * 0.1e-6), FUNC(kamikaze_int_off)); @@ -233,7 +233,7 @@ static MACHINE_START( kamikaze ) state->samples = machine->device("samples"); state->int_timer = machine->scheduler().timer_alloc(FUNC(kamizake_int_gen)); - timer_adjust_oneshot(state->int_timer, machine->primary_screen->time_until_pos(128), 128); + state->int_timer->adjust(machine->primary_screen->time_until_pos(128), 128); state_save_register_global(machine, state->screen_flip); state_save_register_global(machine, state->screen_red); diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c index 2dc073f369d..664c740df0d 100644 --- a/src/mame/drivers/atetris.c +++ b/src/mame/drivers/atetris.c @@ -78,7 +78,7 @@ static TIMER_CALLBACK( interrupt_gen ) scanline += 32; if (scanline >= 256) scanline -= 256; - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } @@ -133,7 +133,7 @@ static MACHINE_RESET( atetris ) reset_bank(machine); /* start interrupts going (32V clocked by 16V) */ - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(48), 48); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(48), 48); } diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c index 2309d0b341b..eb4fbfc6174 100644 --- a/src/mame/drivers/backfire.c +++ b/src/mame/drivers/backfire.c @@ -242,7 +242,7 @@ static READ32_HANDLER(backfire_control3_r) static WRITE32_DEVICE_HANDLER(backfire_eeprom_w) { - logerror("%s:write eprom %08x (%08x) %08x\n",cpuexec_describe_context(device->machine),offset<<1,mem_mask,data); + logerror("%s:write eprom %08x (%08x) %08x\n",device->machine->describe_context(),offset<<1,mem_mask,data); if (ACCESSING_BITS_0_7) { eeprom_set_clock_line(device, BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c index 43b67294f3a..dc31b50d4e6 100644 --- a/src/mame/drivers/beaminv.c +++ b/src/mame/drivers/beaminv.c @@ -103,7 +103,7 @@ static TIMER_CALLBACK( interrupt_callback ) next_interrupt_number = (interrupt_number + 1) % INTERRUPTS_PER_FRAME; next_vpos = interrupt_lines[next_interrupt_number]; - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(next_vpos), next_interrupt_number); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(next_vpos), next_interrupt_number); } @@ -118,7 +118,7 @@ static void start_interrupt_timer( running_machine *machine ) { beaminv_state *state = machine->driver_data<beaminv_state>(); int vpos = interrupt_lines[0]; - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(vpos), 0); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(vpos)); } diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c index 8ae427a7c20..f176275d61f 100644 --- a/src/mame/drivers/berzerk.c +++ b/src/mame/drivers/berzerk.c @@ -168,7 +168,7 @@ static TIMER_CALLBACK( irq_callback ) next_v256 = irq_trigger_v256s[next_irq_number]; next_vpos = vsync_chain_counter_to_vpos(next_counter, next_v256); - timer_adjust_oneshot(irq_timer, machine->primary_screen->time_until_pos(next_vpos), next_irq_number); + irq_timer->adjust(machine->primary_screen->time_until_pos(next_vpos), next_irq_number); } @@ -181,7 +181,7 @@ static void create_irq_timer(running_machine *machine) static void start_irq_timer(running_machine *machine) { int vpos = vsync_chain_counter_to_vpos(irq_trigger_counts[0], irq_trigger_v256s[0]); - timer_adjust_oneshot(irq_timer, machine->primary_screen->time_until_pos(vpos), 0); + irq_timer->adjust(machine->primary_screen->time_until_pos(vpos)); } @@ -245,7 +245,7 @@ static TIMER_CALLBACK( nmi_callback ) next_v256 = nmi_trigger_v256s[next_nmi_number]; next_vpos = vsync_chain_counter_to_vpos(next_counter, next_v256); - timer_adjust_oneshot(nmi_timer, machine->primary_screen->time_until_pos(next_vpos), next_nmi_number); + nmi_timer->adjust(machine->primary_screen->time_until_pos(next_vpos), next_nmi_number); } @@ -258,7 +258,7 @@ static void create_nmi_timer(running_machine *machine) static void start_nmi_timer(running_machine *machine) { int vpos = vsync_chain_counter_to_vpos(nmi_trigger_counts[0], nmi_trigger_v256s[0]); - timer_adjust_oneshot(nmi_timer, machine->primary_screen->time_until_pos(vpos), 0); + nmi_timer->adjust(machine->primary_screen->time_until_pos(vpos)); } diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c index 69eb5bc009f..ecd37d20526 100644 --- a/src/mame/drivers/bfcobra.c +++ b/src/mame/drivers/bfcobra.c @@ -440,7 +440,7 @@ static void RunBlit(address_space *space) /* This debug is now wrong ! */ if (DEBUG_BLITTER) { - mame_printf_debug("\n%s:Blitter: Running command from 0x%.5x\n\n", cpuexec_describe_context(device->machine), blitter.program.addr - 12); + mame_printf_debug("\n%s:Blitter: Running command from 0x%.5x\n\n", device->machine->describe_context(), blitter.program.addr - 12); mame_printf_debug("Command Reg %.2x", blitter.command); mame_printf_debug(" %s %s %s %s %s %s %s\n", blitter.command & CMD_RUN ? "RUN" : " ", diff --git a/src/mame/drivers/blitz68k.c b/src/mame/drivers/blitz68k.c index de5e5ca6cf1..be165e27094 100644 --- a/src/mame/drivers/blitz68k.c +++ b/src/mame/drivers/blitz68k.c @@ -451,7 +451,7 @@ static WRITE8_HANDLER( blit_draw_w ) int x, y, x_size, y_size; UINT32 src; - logerror("%s: blit x=%02x y=%02x w=%02x h=%02x addr=%02x%02x%02x pens=%02x %02x %02x %02x flag=%02x %02x %02x %02x - %02x %02x %02x %02x\n", cpuexec_describe_context(space->machine), + logerror("%s: blit x=%02x y=%02x w=%02x h=%02x addr=%02x%02x%02x pens=%02x %02x %02x %02x flag=%02x %02x %02x %02x - %02x %02x %02x %02x\n", space->machine->describe_context(), blit.x, blit.y, blit.w, blit.h, blit.addr[2], blit.addr[1], blit.addr[0], blit.pen[0], blit.pen[1], blit.pen[2], blit.pen[3], @@ -645,13 +645,13 @@ ADDRESS_MAP_END static READ8_HANDLER( bankrob_mcu1_r ) { UINT8 ret = 0; // space->machine->rand() gives "interesting" results - logerror("%s: mcu1 reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret); return ret; } static READ8_HANDLER( bankrob_mcu2_r ) { UINT8 ret = 0; // space->machine->rand() gives "interesting" results - logerror("%s: mcu2 reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret); return ret; } @@ -667,11 +667,11 @@ static READ8_HANDLER( bankrob_mcu_status_write_r ) static WRITE8_HANDLER( bankrob_mcu1_w ) { - logerror("%s: mcu1 written with %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data); } static WRITE8_HANDLER( bankrob_mcu2_w ) { - logerror("%s: mcu2 written with %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data); } static ADDRESS_MAP_START( bankrob_map, ADDRESS_SPACE_PROGRAM, 16 ) @@ -728,13 +728,13 @@ ADDRESS_MAP_END static READ8_HANDLER( bankroba_mcu1_r ) { UINT8 ret = space->machine->rand(); // space->machine->rand() gives "interesting" results - logerror("%s: mcu1 reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret); return ret; } static READ8_HANDLER( bankroba_mcu2_r ) { UINT8 ret = space->machine->rand(); // space->machine->rand() gives "interesting" results - logerror("%s: mcu2 reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret); return ret; } @@ -749,11 +749,11 @@ static READ8_HANDLER( bankroba_mcu2_status_write_r ) static WRITE8_HANDLER( bankroba_mcu1_w ) { - logerror("%s: mcu1 written with %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data); } static WRITE8_HANDLER( bankroba_mcu2_w ) { - logerror("%s: mcu2 written with %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data); } static ADDRESS_MAP_START( bankroba_map, ADDRESS_SPACE_PROGRAM, 16 ) @@ -884,13 +884,13 @@ static WRITE16_DEVICE_HANDLER( crtc_lpen_w ) static READ16_HANDLER( cjffruit_mcu_r ) { UINT8 ret = 0x00; // space->machine->rand() gives "interesting" results - logerror("%s: mcu reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu reads %02x\n", space->machine->describe_context(), ret); return ret << 8; } static WRITE16_HANDLER( cjffruit_mcu_w ) { - logerror("%s: mcu written with %02x\n", cpuexec_describe_context(space->machine),data >> 8); + logerror("%s: mcu written with %02x\n", space->machine->describe_context(),data >> 8); } static ADDRESS_MAP_START( cjffruit_map, ADDRESS_SPACE_PROGRAM, 16 ) @@ -935,13 +935,13 @@ ADDRESS_MAP_END static READ16_HANDLER( deucesw2_mcu_r ) { UINT8 ret = 0x00; // space->machine->rand() gives "interesting" results - logerror("%s: mcu reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu reads %02x\n", space->machine->describe_context(), ret); return ret << 8; } static WRITE16_HANDLER( deucesw2_mcu_w ) { - logerror("%s: mcu written with %02x\n", cpuexec_describe_context(space->machine),data >> 8); + logerror("%s: mcu written with %02x\n", space->machine->describe_context(),data >> 8); } static WRITE16_HANDLER( deucesw2_leds1_w ) @@ -1031,13 +1031,13 @@ ADDRESS_MAP_END static READ8_HANDLER( dualgame_mcu1_r ) { UINT8 ret = 0; // space->machine->rand() gives "interesting" results - logerror("%s: mcu1 reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret); return ret; } static READ8_HANDLER( dualgame_mcu2_r ) { UINT8 ret = 0; // space->machine->rand() gives "interesting" results - logerror("%s: mcu2 reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret); return ret; } @@ -1053,11 +1053,11 @@ static READ8_HANDLER( dualgame_mcu_status_write_r ) static WRITE8_HANDLER( dualgame_mcu1_w ) { - logerror("%s: mcu1 written with %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data); } static WRITE8_HANDLER( dualgame_mcu2_w ) { - logerror("%s: mcu2 written with %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data); } static ADDRESS_MAP_START( dualgame_map, ADDRESS_SPACE_PROGRAM, 16 ) @@ -1119,13 +1119,13 @@ ADDRESS_MAP_END static READ16_HANDLER( hermit_mcu_r ) { UINT8 ret = 0x00; // space->machine->rand() gives "interesting" results - logerror("%s: mcu reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu reads %02x\n", space->machine->describe_context(), ret); return ret << 8; } static WRITE16_HANDLER( hermit_mcu_w ) { - logerror("%s: mcu written with %02x\n", cpuexec_describe_context(space->machine),data >> 8); + logerror("%s: mcu written with %02x\n", space->machine->describe_context(),data >> 8); } static WRITE16_HANDLER( hermit_leds1_w ) @@ -1198,13 +1198,13 @@ ADDRESS_MAP_END static READ8_HANDLER( maxidbl_mcu1_r ) { UINT8 ret = 0; // space->machine->rand() gives "interesting" results - logerror("%s: mcu1 reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret); return ret; } static READ8_HANDLER( maxidbl_mcu2_r ) { UINT8 ret = 0; // space->machine->rand() gives "interesting" results - logerror("%s: mcu2 reads %02x\n", cpuexec_describe_context(space->machine), ret); + logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret); return ret; } @@ -1220,11 +1220,11 @@ static READ8_HANDLER( maxidbl_mcu_status_write_r ) static WRITE8_HANDLER( maxidbl_mcu1_w ) { - logerror("%s: mcu1 written with %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data); } static WRITE8_HANDLER( maxidbl_mcu2_w ) { - logerror("%s: mcu2 written with %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data); } static ADDRESS_MAP_START( maxidbl_map, ADDRESS_SPACE_PROGRAM, 16 ) diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c index 0ce02ca6887..062b6105454 100644 --- a/src/mame/drivers/bmcbowl.c +++ b/src/mame/drivers/bmcbowl.c @@ -437,7 +437,7 @@ static READ8_DEVICE_HANDLER(dips1_r) case 0x00: return input_port_read(device->machine, "IN1"); case 0x40: return input_port_read(device->machine, "IN2"); } - logerror("%s:unknown input - %X\n",cpuexec_describe_context(device->machine),bmc_input); + logerror("%s:unknown input - %X\n",device->machine->describe_context(),bmc_input); return 0xff; } diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c index 749a362972a..9c92968fceb 100644 --- a/src/mame/drivers/calchase.c +++ b/src/mame/drivers/calchase.c @@ -316,7 +316,7 @@ static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) { -// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data); +// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data); switch(reg) { @@ -400,7 +400,7 @@ static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) { -// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data); +// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data); piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c index d4021d437af..07dd50508b6 100644 --- a/src/mame/drivers/cave.c +++ b/src/mame/drivers/cave.c @@ -289,7 +289,7 @@ static WRITE8_HANDLER( soundlatch_ack_w ) static WRITE16_DEVICE_HANDLER( cave_eeprom_msb_w ) { if (data & ~0xfe00) - logerror("%s: Unknown EEPROM bit written %04X\n", cpuexec_describe_context(device->machine), data); + logerror("%s: Unknown EEPROM bit written %04X\n", device->machine->describe_context(), data); if (ACCESSING_BITS_8_15) // even address { @@ -333,7 +333,7 @@ static WRITE16_DEVICE_HANDLER( hotdogst_eeprom_msb_w ) static WRITE16_DEVICE_HANDLER( cave_eeprom_lsb_w ) { if (data & ~0x00ef) - logerror("%s: Unknown EEPROM bit written %04X\n",cpuexec_describe_context(device->machine),data); + logerror("%s: Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data); if (ACCESSING_BITS_0_7) // odd address { @@ -368,7 +368,7 @@ static WRITE16_HANDLER( gaia_coin_lsb_w ) static WRITE16_DEVICE_HANDLER( metmqstr_eeprom_msb_w ) { if (data & ~0xff00) - logerror("%s: Unknown EEPROM bit written %04X\n", cpuexec_describe_context(device->machine), data); + logerror("%s: Unknown EEPROM bit written %04X\n", device->machine->describe_context(), data); if (ACCESSING_BITS_8_15) // even address { @@ -684,7 +684,7 @@ static WRITE16_DEVICE_HANDLER( korokoro_eeprom_msb_w ) cave_state *state = device->machine->driver_data<cave_state>(); if (data & ~0x7000) { - logerror("%s: Unknown EEPROM bit written %04X\n",cpuexec_describe_context(device->machine),data); + logerror("%s: Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data); COMBINE_DATA(&state->leds[1]); show_leds(device->machine); } @@ -905,7 +905,7 @@ ADDRESS_MAP_END static WRITE16_DEVICE_HANDLER( tjumpman_eeprom_lsb_w ) { if (data & ~0x0038) - logerror("%s: Unknown EEPROM bit written %04X\n",cpuexec_describe_context(device->machine),data); + logerror("%s: Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data); if (ACCESSING_BITS_0_7) // odd address { diff --git a/src/mame/drivers/ccastles.c b/src/mame/drivers/ccastles.c index 4b15cbb52db..8e933a33504 100644 --- a/src/mame/drivers/ccastles.c +++ b/src/mame/drivers/ccastles.c @@ -148,7 +148,7 @@ INLINE void schedule_next_irq( running_machine *machine, int curscanline ) break; /* next one at the start of this scanline */ - timer_adjust_oneshot(state->irq_timer, machine->primary_screen->time_until_pos(curscanline), curscanline); + state->irq_timer->adjust(machine->primary_screen->time_until_pos(curscanline), curscanline); } diff --git a/src/mame/drivers/chaknpop.c b/src/mame/drivers/chaknpop.c index fbcab1e2393..376ffd65a49 100644 --- a/src/mame/drivers/chaknpop.c +++ b/src/mame/drivers/chaknpop.c @@ -18,12 +18,12 @@ static WRITE8_DEVICE_HANDLER ( unknown_port_1_w ) { - //logerror("%s: write to unknow port 1: 0x%02x\n", cpuexec_describe_context(device->machine), data); + //logerror("%s: write to unknow port 1: 0x%02x\n", device->machine->describe_context(), data); } static WRITE8_DEVICE_HANDLER ( unknown_port_2_w ) { - //logerror("%s: write to unknow port 2: 0x%02x\n", cpuexec_describe_context(device->machine), data); + //logerror("%s: write to unknow port 2: 0x%02x\n", device->machine->describe_context(), data); } static WRITE8_HANDLER ( coinlock_w ) diff --git a/src/mame/drivers/clayshoo.c b/src/mame/drivers/clayshoo.c index dd47e867fb2..371e865f8df 100644 --- a/src/mame/drivers/clayshoo.c +++ b/src/mame/drivers/clayshoo.c @@ -117,8 +117,8 @@ static WRITE8_HANDLER( analog_reset_w ) state->analog_port_val = 0xff; - timer_adjust_oneshot(state->analog_timer_1, compute_duration(space->cpu, input_port_read(space->machine, "AN1")), 0x02); - timer_adjust_oneshot(state->analog_timer_2, compute_duration(space->cpu, input_port_read(space->machine, "AN2")), 0x01); + state->analog_timer_1->adjust(compute_duration(space->cpu, input_port_read(space->machine, "AN1")), 0x02); + state->analog_timer_2->adjust(compute_duration(space->cpu, input_port_read(space->machine, "AN2")), 0x01); } diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c index 4f4a18d61c5..7f72fc10264 100644 --- a/src/mame/drivers/cliffhgr.c +++ b/src/mame/drivers/cliffhgr.c @@ -204,7 +204,7 @@ static TIMER_CALLBACK( cliff_irq_callback ) cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); } - timer_adjust_oneshot(irq_timer, machine->primary_screen->time_until_pos(param * 2), param); + irq_timer->adjust(machine->primary_screen->time_until_pos(param * 2), param); } static void vdp_interrupt(running_machine *machine, int state) @@ -224,7 +224,7 @@ static MACHINE_RESET( cliffhgr ) { port_bank = 0; phillips_code = 0; - timer_adjust_oneshot(irq_timer, machine->primary_screen->time_until_pos(17), 17); + irq_timer->adjust(machine->primary_screen->time_until_pos(17), 17); } /********************************************************/ diff --git a/src/mame/drivers/cloud9.c b/src/mame/drivers/cloud9.c index f494ec692d1..cb682db715d 100644 --- a/src/mame/drivers/cloud9.c +++ b/src/mame/drivers/cloud9.c @@ -118,7 +118,7 @@ INLINE void schedule_next_irq(running_machine *machine, int curscanline) curscanline = (curscanline + 64) & 255; /* next one at the start of this scanline */ - timer_adjust_oneshot(state->irq_timer, machine->primary_screen->time_until_pos(curscanline), curscanline); + state->irq_timer->adjust(machine->primary_screen->time_until_pos(curscanline), curscanline); } diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c index 4ea23b587ae..2f104c3d549 100644 --- a/src/mame/drivers/combatsc.c +++ b/src/mame/drivers/combatsc.c @@ -366,12 +366,12 @@ static READ8_DEVICE_HANDLER ( combatsc_ym2203_r ) if (state->boost) { state->boost = 0; - timer_adjust_periodic(state->interleave_timer, attotime::zero, 0, state->audiocpu->cycles_to_attotime(80)); + state->interleave_timer->adjust(attotime::zero, 0, state->audiocpu->cycles_to_attotime(80)); } else if (status & 2) { state->boost = 1; - timer_adjust_oneshot(state->interleave_timer, attotime::zero, 0); + state->interleave_timer->adjust(attotime::zero); } } diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c index b85b95e9106..e3c25c02b30 100644 --- a/src/mame/drivers/coolpool.c +++ b/src/mame/drivers/coolpool.c @@ -477,7 +477,7 @@ static TIMER_CALLBACK( deferred_iop_w ) cputag_set_input_line(machine, "dsp", 0, HOLD_LINE); /* ??? I have no idea who should generate this! */ /* the DSP polls the status bit so it isn't strictly */ /* necessary to also have an IRQ */ - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(50)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); } diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c index 6d0dd97711a..a422922abe2 100644 --- a/src/mame/drivers/cps3.c +++ b/src/mame/drivers/cps3.c @@ -2422,7 +2422,7 @@ static int cps3_dma_callback(UINT32 src, UINT32 dst, UINT32 data, int size) } else { - //printf("%s :src %08x, dst %08x, returning %08x\n", cpuexec_describe_context(machine), src, dst, data); + //printf("%s :src %08x, dst %08x, returning %08x\n", machine->describe_context(), src, dst, data); } /* I doubt this is endian safe.. needs checking / fixing */ diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c index ec74e71d3d0..dd56ee32508 100644 --- a/src/mame/drivers/crbaloon.c +++ b/src/mame/drivers/crbaloon.c @@ -79,7 +79,7 @@ static CUSTOM_INPUT( pc3092_r ) else ret = 0x00; - if (LOG_PC3092) logerror("%s: read PC3092 = 0x%02x\n", cpuexec_describe_context(field->port->machine), ret); + if (LOG_PC3092) logerror("%s: read PC3092 = 0x%02x\n", field->port->machine->describe_context(), ret); return ret; } diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c index deaa8531b17..980248597f0 100644 --- a/src/mame/drivers/crystal.c +++ b/src/mame/drivers/crystal.c @@ -290,9 +290,9 @@ INLINE void Timer_w( address_space *space, int which, UINT32 data, UINT32 mem_ma attotime period = attotime::from_hz(43000000) * ((PD + 1) * (TCV + 1)); if (state->Timerctrl[which] & 2) - timer_adjust_periodic(state->Timer[which], period, 0, period); + state->Timer[which]->adjust(period, 0, period); else - timer_adjust_oneshot(state->Timer[which], period, 0); + state->Timer[which]->adjust(period); } COMBINE_DATA(&state->Timerctrl[which]); } @@ -609,7 +609,7 @@ static MACHINE_RESET( crystal ) for (i = 0; i < 4; i++) { state->Timerctrl[i] = 0; - timer_adjust_oneshot(state->Timer[i], attotime::never, 0); + state->Timer[i]->adjust(attotime::never); } vr0_snd_set_areas(machine->device("vrender"), state->textureram, state->frameram); diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c index 79a6f23cb25..3c94dee8721 100644 --- a/src/mame/drivers/csplayh5.c +++ b/src/mame/drivers/csplayh5.c @@ -182,7 +182,7 @@ static READ8_HANDLER( tmpz84c011_pio_r ) break; default: - logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", cpuexec_describe_context(space->machine), offset); + logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine->describe_context(), offset); portdata = 0xff; break; } @@ -210,7 +210,7 @@ static WRITE8_HANDLER( tmpz84c011_pio_w) break; default: - logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", cpuexec_describe_context(space->machine), offset, data); + logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine->describe_context(), offset, data); break; } } diff --git a/src/mame/drivers/cubocd32.c b/src/mame/drivers/cubocd32.c index a2e5a7b5afb..725f237fa48 100644 --- a/src/mame/drivers/cubocd32.c +++ b/src/mame/drivers/cubocd32.c @@ -402,14 +402,14 @@ static WRITE8_DEVICE_HANDLER( cd32_cia_0_porta_w ) static READ8_DEVICE_HANDLER( cd32_cia_0_portb_r ) { /* parallel port */ - logerror("%s:CIA0_portb_r\n", cpuexec_describe_context(device->machine)); + logerror("%s:CIA0_portb_r\n", device->machine->describe_context()); return 0xff; } static WRITE8_DEVICE_HANDLER( cd32_cia_0_portb_w ) { /* parallel port */ - logerror("%s:CIA0_portb_w(%02x)\n", cpuexec_describe_context(device->machine), data); + logerror("%s:CIA0_portb_w(%02x)\n", device->machine->describe_context(), data); } static ADDRESS_MAP_START( cd32_map, ADDRESS_SPACE_PROGRAM, 32 ) diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c index c2a789bba7d..635458cbed3 100644 --- a/src/mame/drivers/cvs.c +++ b/src/mame/drivers/cvs.c @@ -322,7 +322,7 @@ static void start_393hz_timer(running_machine *machine) { cvs_state *state = machine->driver_data<cvs_state>(); state->cvs_393hz_timer = machine->scheduler().timer_alloc(FUNC(cvs_393hz_timer_cb)); - timer_adjust_periodic(state->cvs_393hz_timer, attotime::from_hz(30*393), 0, attotime::from_hz(30*393)); + state->cvs_393hz_timer->adjust(attotime::from_hz(30*393), 0, attotime::from_hz(30*393)); } diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c index fced7219495..4fb8db2ff7d 100644 --- a/src/mame/drivers/darkhors.c +++ b/src/mame/drivers/darkhors.c @@ -220,7 +220,7 @@ static const eeprom_interface eeprom_intf = static WRITE32_DEVICE_HANDLER( darkhors_eeprom_w ) { if (data & ~0xff000000) - logerror("%s: Unknown EEPROM bit written %08X\n",cpuexec_describe_context(device->machine),data); + logerror("%s: Unknown EEPROM bit written %08X\n",device->machine->describe_context(),data); if ( ACCESSING_BITS_24_31 ) { diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c index 72d6fc9072c..c42f5885b0a 100644 --- a/src/mame/drivers/ddenlovr.c +++ b/src/mame/drivers/ddenlovr.c @@ -686,7 +686,7 @@ INLINE void log_blit( running_machine *machine, int data ) #if 1 logerror("%s: blit src %06x x %03x y %03x flags %02x layer %02x pen %02x penmode %02x w %03x h %03x linelen %03x flip %02x clip: ctrl %x xy %03x %03x wh %03x %03x\n", - cpuexec_describe_context(machine), + machine->describe_context(), state->ddenlovr_blit_address, state->ddenlovr_blit_x, state->ddenlovr_blit_y, data, state->ddenlovr_dest_layer, state->ddenlovr_blit_pen, state->ddenlovr_blit_pen_mode, state->ddenlovr_rect_width, state->ddenlovr_rect_height, state->ddenlovr_line_length, state->ddenlovr_blit_flip, state->ddenlovr_clip_ctrl, state->ddenlovr_clip_x, state->ddenlovr_clip_y, state->ddenlovr_clip_width, state->ddenlovr_clip_height); @@ -994,7 +994,7 @@ g_profiler.start(PROFILER_VIDEO); ; #ifdef MAME_DEBUG popmessage("unknown blitter command %02x", data); - logerror("%s: unknown blitter command %02x\n", cpuexec_describe_context(machine), data); + logerror("%s: unknown blitter command %02x\n", machine->describe_context(), data); #endif } @@ -1002,7 +1002,7 @@ g_profiler.start(PROFILER_VIDEO); break; default: - logerror("%s: Blitter %d reg %02x = %02x\n", cpuexec_describe_context(machine), blitter, state->ddenlovr_blit_regs[blitter], data); + logerror("%s: Blitter %d reg %02x = %02x\n", machine->describe_context(), blitter, state->ddenlovr_blit_regs[blitter], data); break; } } @@ -2653,7 +2653,7 @@ static void mjchuuka_get_romdata(running_machine *machine) if (address >= size) { - logerror("%s: Error, Blitter address %06X out of range\n", cpuexec_describe_context(machine), address); + logerror("%s: Error, Blitter address %06X out of range\n", machine->describe_context(), address); address %= size; } @@ -2919,7 +2919,7 @@ static READ8_DEVICE_HANDLER( hginga_dsw_r ) if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine, "DSW1"); if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine, "DSW5"); - logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", cpuexec_describe_context(device->machine), state->dsw_sel); + logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", device->machine->describe_context(), state->dsw_sel); return 0xff; } diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c index f8a95ed1935..930fe62abac 100644 --- a/src/mame/drivers/deco32.c +++ b/src/mame/drivers/deco32.c @@ -455,7 +455,7 @@ static WRITE32_DEVICE_HANDLER( dragngun_eeprom_w ) eeprom_set_cs_line(device, (data & 0x4) ? CLEAR_LINE : ASSERT_LINE); return; } - logerror("%s:Write control 1 %08x %08x\n",cpuexec_describe_context(device->machine),offset,data); + logerror("%s:Write control 1 %08x %08x\n",device->machine->describe_context(),offset,data); } /**********************************************************************************/ diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c index d0c28a2bdbb..4838381d300 100644 --- a/src/mame/drivers/deco_mlc.c +++ b/src/mame/drivers/deco_mlc.c @@ -146,7 +146,7 @@ static WRITE32_DEVICE_HANDLER( avengrs_eprom_w ) //volume control todo } else - logerror("%s: eprom_w %08x mask %08x\n",cpuexec_describe_context(device->machine),data,mem_mask); + logerror("%s: eprom_w %08x mask %08x\n",device->machine->describe_context(),data,mem_mask); } static WRITE32_HANDLER( avengrs_palette_w ) diff --git a/src/mame/drivers/dribling.c b/src/mame/drivers/dribling.c index d7bcfa35716..db1cf0f7161 100644 --- a/src/mame/drivers/dribling.c +++ b/src/mame/drivers/dribling.c @@ -105,7 +105,7 @@ static WRITE8_DEVICE_HANDLER( misc_w ) /* bit 1 = (10) = PC1 */ /* bit 0 = (32) = PC0 */ state->input_mux = data & 7; - logerror("%s:misc_w(%02X)\n", cpuexec_describe_context(device->machine), data); + logerror("%s:misc_w(%02X)\n", device->machine->describe_context(), data); } @@ -119,14 +119,14 @@ static WRITE8_DEVICE_HANDLER( sound_w ) /* bit 2 = folla a */ /* bit 1 = folla m */ /* bit 0 = folla b */ - logerror("%s:sound_w(%02X)\n", cpuexec_describe_context(device->machine), data); + logerror("%s:sound_w(%02X)\n", device->machine->describe_context(), data); } static WRITE8_DEVICE_HANDLER( pb_w ) { /* write PB0-7 */ - logerror("%s:pb_w(%02X)\n", cpuexec_describe_context(device->machine), data); + logerror("%s:pb_w(%02X)\n", device->machine->describe_context(), data); } diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c index ee877519ef5..20c54c6fcd3 100644 --- a/src/mame/drivers/dunhuang.c +++ b/src/mame/drivers/dunhuang.c @@ -443,7 +443,7 @@ static READ8_DEVICE_HANDLER( dunhuang_dsw_r ) if (!(state->input & 0x04)) return input_port_read(device->machine, "DSW3"); if (!(state->input & 0x08)) return input_port_read(device->machine, "DSW4"); if (!(state->input & 0x10)) return input_port_read(device->machine, "DSW5"); - logerror("%s: warning, unknown dsw bits read, state->input = %02x\n", cpuexec_describe_context(device->machine), state->input); + logerror("%s: warning, unknown dsw bits read, state->input = %02x\n", device->machine->describe_context(), state->input); return 0xff; } static READ8_HANDLER( dunhuang_input_r ) @@ -454,7 +454,7 @@ static READ8_HANDLER( dunhuang_input_r ) if (!(state->input & 0x04)) return input_port_read(space->machine, "IN2"); if (!(state->input & 0x08)) return input_port_read(space->machine, "IN3"); if (!(state->input & 0x10)) return input_port_read(space->machine, "IN4"); - logerror("%s: warning, unknown input bits read, state->input = %02x\n", cpuexec_describe_context(space->machine), state->input); + logerror("%s: warning, unknown input bits read, state->input = %02x\n", space->machine->describe_context(), state->input); return 0xff; } diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index 9d5a5af134d..a1837aa8bb5 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -1150,7 +1150,7 @@ static READ8_DEVICE_HANDLER( htengoku_dsw_r ) if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW2"); if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine, "DSW3"); if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine, "DSW4"); - logerror("%s: warning, unknown bits read, dsw_sel = %02x\n", cpuexec_describe_context(device->machine), state->dsw_sel); + logerror("%s: warning, unknown bits read, dsw_sel = %02x\n", device->machine->describe_context(), state->dsw_sel); return 0xff; } @@ -1375,7 +1375,7 @@ static READ8_DEVICE_HANDLER( tenkai_dsw_r ) if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW2"); if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine, "DSW3"); if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine, "DSW4"); - logerror("%s: unmapped dsw %02x read\n", cpuexec_describe_context(device->machine), state->dsw_sel); + logerror("%s: unmapped dsw %02x read\n", device->machine->describe_context(), state->dsw_sel); return 0xff; } diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c index 97b19198a0a..89701798990 100644 --- a/src/mame/drivers/enigma2.c +++ b/src/mame/drivers/enigma2.c @@ -127,8 +127,8 @@ static TIMER_CALLBACK( interrupt_assert_callback ) next_counter = INT_TRIGGER_COUNT_1; next_vpos = vysnc_chain_counter_to_vpos(next_counter); - timer_adjust_oneshot(state->interrupt_assert_timer, machine->primary_screen->time_until_pos(next_vpos), 0); - timer_adjust_oneshot(state->interrupt_clear_timer, machine->primary_screen->time_until_pos(vpos + 1), 0); + state->interrupt_assert_timer->adjust(machine->primary_screen->time_until_pos(next_vpos)); + state->interrupt_clear_timer->adjust(machine->primary_screen->time_until_pos(vpos + 1)); } @@ -144,7 +144,7 @@ static void start_interrupt_timers( running_machine *machine ) { enigma2_state *state = machine->driver_data<enigma2_state>(); int vpos = vysnc_chain_counter_to_vpos(INT_TRIGGER_COUNT_1); - timer_adjust_oneshot(state->interrupt_assert_timer, machine->primary_screen->time_until_pos(vpos), 0); + state->interrupt_assert_timer->adjust(machine->primary_screen->time_until_pos(vpos)); } @@ -403,7 +403,7 @@ static READ8_DEVICE_HANDLER( sound_latch_r ) static WRITE8_DEVICE_HANDLER( protection_data_w ) { enigma2_state *state = device->machine->driver_data<enigma2_state>(); - if (LOG_PROT) logerror("%s: Protection Data Write: %x\n", cpuexec_describe_context(device->machine), data); + if (LOG_PROT) logerror("%s: Protection Data Write: %x\n", device->machine->describe_context(), data); state->protection_data = data; } diff --git a/src/mame/drivers/eolithsp.c b/src/mame/drivers/eolithsp.c index 117d2a1a9d3..93892343d73 100644 --- a/src/mame/drivers/eolithsp.c +++ b/src/mame/drivers/eolithsp.c @@ -21,7 +21,7 @@ void eolith_speedup_read(address_space *space) { /* for debug */ //if ((cpu_get_pc(space->cpu)!=eolith_speedup_address) && (eolith_vblank!=1) ) - // printf("%s:eolith speedup_read data %02x\n",cpuexec_describe_context(space->machine), eolith_vblank); + // printf("%s:eolith speedup_read data %02x\n",space->machine->describe_context(), eolith_vblank); if (cpu_get_pc(space->cpu)==eolith_speedup_address && eolith_vblank==0 && eolith_scanline < eolith_speedup_resume_scanline) { @@ -90,7 +90,7 @@ INTERRUPT_GEN( eolith_speedup ) if (eolith_scanline==eolith_speedup_resume_scanline) { - cpuexec_trigger(device->machine, 1000); + device->machine->scheduler().trigger(1000); } if (eolith_scanline==240) diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c index f0fa155e248..b43aa7b459a 100644 --- a/src/mame/drivers/equites.c +++ b/src/mame/drivers/equites.c @@ -422,7 +422,7 @@ static SOUND_START(equites) state->nmi_timer = machine->scheduler().timer_alloc(FUNC(equites_nmi_callback)); state->adjuster_timer = machine->scheduler().timer_alloc(FUNC(equites_frq_adjuster_callback)); - timer_adjust_periodic(state->adjuster_timer, attotime::from_hz(60), 0, attotime::from_hz(60)); + state->adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); } static WRITE8_HANDLER(equites_c0f8_w) @@ -597,7 +597,7 @@ static WRITE8_HANDLER(equites_8155_w) { case 0: //logerror( "8155 Command register write %x, timer command = %x, interrupt enable = %x, ports = %x\n", data, (data >> 6) & 3, (data >> 4) & 3, data & 0xf ); if (((data >> 6) & 3) == 3) - timer_adjust_periodic(state->nmi_timer, attotime::from_hz(XTAL_6_144MHz/2 / state->timer_count), 0, attotime::from_hz(XTAL_6_144MHz/2 / state->timer_count)); + state->nmi_timer->adjust(attotime::from_hz(XTAL_6_144MHz/2 / state->timer_count), 0, attotime::from_hz(XTAL_6_144MHz/2 / state->timer_count)); break; case 1: //logerror( "8155 I/O Port A write %x\n", data ); state->eq8155_port_a = data; diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c index 15b2780f4b4..af235430019 100644 --- a/src/mame/drivers/fantland.c +++ b/src/mame/drivers/fantland.c @@ -317,7 +317,7 @@ static void borntofi_adpcm_start( device_t *device, int voice ) msm5205_reset_w(device, 0); state->adpcm_playing[voice] = 1; state->adpcm_nibble[voice] = 0; -// logerror("%s: adpcm start = %06x, stop = %06x\n", cpuexec_describe_context(device->machine), state->adpcm_addr[0][voice], state->adpcm_addr[1][voice]); +// logerror("%s: adpcm start = %06x, stop = %06x\n", device->machine->describe_context(), state->adpcm_addr[0][voice], state->adpcm_addr[1][voice]); } static void borntofi_adpcm_stop( device_t *device, int voice ) diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c index f14a43a3645..3d104fcbe82 100644 --- a/src/mame/drivers/firebeat.c +++ b/src/mame/drivers/firebeat.c @@ -580,8 +580,8 @@ static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data if (reg != 0x70 && chip == 0) { - //printf("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", cpuexec_describe_context(machine), chip, data, offset, mem_mask); - //logerror("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", ccpuexec_describe_context(machine), hip, data, offset, mem_mask); + //printf("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", machine->describe_context(), chip, data, offset, mem_mask); + //logerror("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", cmachine->describe_context(), hip, data, offset, mem_mask); } switch(reg) @@ -975,7 +975,7 @@ static void atapi_command_reg_w(running_machine *machine, int reg, UINT16 data) if (reg == ATAPI_REG_DATA) { -// printf("%s:ATAPI: packet write %04x\n", cpuexec_describe_context(device->machine), data); +// printf("%s:ATAPI: packet write %04x\n", device->machine->describe_context(), data); atapi_data[atapi_data_ptr] = data; atapi_data_ptr++; @@ -2216,7 +2216,7 @@ static void init_keyboard(running_machine *machine) { // set keyboard timer keyboard_timer = machine->scheduler().timer_alloc(FUNC(keyboard_timer_callback)); - timer_adjust_periodic(keyboard_timer, attotime::from_msec(10), 0, attotime::from_msec(10)); + keyboard_timer->adjust(attotime::from_msec(10), 0, attotime::from_msec(10)); } static DRIVER_INIT(kbm) diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c index 5bab8a42a08..31954dd8664 100644 --- a/src/mame/drivers/fortecar.c +++ b/src/mame/drivers/fortecar.c @@ -70,7 +70,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w ) static READ8_DEVICE_HANDLER( ppi0_portc_r ) { -// popmessage("%s",cpuexec_describe_context(device->machine)); +// popmessage("%s",device->machine->describe_context()); return (~(eeprom_read_bit(device)<<1) & 2); } diff --git a/src/mame/drivers/fuukifg2.c b/src/mame/drivers/fuukifg2.c index 35e5d21a272..ddd84171fb2 100644 --- a/src/mame/drivers/fuukifg2.c +++ b/src/mame/drivers/fuukifg2.c @@ -60,7 +60,7 @@ static WRITE16_HANDLER( fuuki16_vregs_w ) { const rectangle &visarea = space->machine->primary_screen->visible_area(); attotime period = space->machine->primary_screen->frame_period(); - timer_adjust_periodic(state->raster_interrupt_timer, space->machine->primary_screen->time_until_pos(new_data, visarea.max_x + 1), 0, period); + state->raster_interrupt_timer->adjust(space->machine->primary_screen->time_until_pos(new_data, visarea.max_x + 1), 0, period); } } @@ -72,7 +72,7 @@ static WRITE16_HANDLER( fuuki16_sound_command_w ) soundlatch_w(space,0,data & 0xff); cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); // cpu_spinuntil_time(space->cpu, attotime::from_usec(50)); // Allow the other CPU to reply - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(50)); // Fixes glitching in rasters + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); // Fixes glitching in rasters } } @@ -418,7 +418,7 @@ static TIMER_CALLBACK( raster_interrupt_callback ) fuuki16_state *state = machine->driver_data<fuuki16_state>(); cpu_set_input_line(state->maincpu, 5, HOLD_LINE); // Raster Line IRQ machine->primary_screen->update_partial(machine->primary_screen->vpos()); - timer_adjust_oneshot(state->raster_interrupt_timer, machine->primary_screen->frame_period(), 0); + state->raster_interrupt_timer->adjust(machine->primary_screen->frame_period()); } @@ -443,7 +443,7 @@ static MACHINE_RESET( fuuki16 ) machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback)); machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback)); - timer_adjust_oneshot(state->raster_interrupt_timer, machine->primary_screen->time_until_pos(0, visarea.max_x + 1), 0); + state->raster_interrupt_timer->adjust(machine->primary_screen->time_until_pos(0, visarea.max_x + 1)); } diff --git a/src/mame/drivers/fuukifg3.c b/src/mame/drivers/fuukifg3.c index 8c4726cd09c..b1c06739c91 100644 --- a/src/mame/drivers/fuukifg3.c +++ b/src/mame/drivers/fuukifg3.c @@ -221,7 +221,7 @@ static WRITE32_HANDLER( fuuki32_vregs_w ) { const rectangle &visarea = space->machine->primary_screen->visible_area(); attotime period = space->machine->primary_screen->frame_period(); - timer_adjust_periodic(state->raster_interrupt_timer, space->machine->primary_screen->time_until_pos(state->vregs[0x1c / 4] >> 16, visarea.max_x + 1), 0, period); + state->raster_interrupt_timer->adjust(space->machine->primary_screen->time_until_pos(state->vregs[0x1c / 4] >> 16, visarea.max_x + 1), 0, period); } } } @@ -504,7 +504,7 @@ static TIMER_CALLBACK( raster_interrupt_callback ) fuuki32_state *state = machine->driver_data<fuuki32_state>(); cpu_set_input_line(state->maincpu, 5, HOLD_LINE); // Raster Line IRQ machine->primary_screen->update_partial(machine->primary_screen->vpos()); - timer_adjust_oneshot(state->raster_interrupt_timer, machine->primary_screen->frame_period(), 0); + state->raster_interrupt_timer->adjust(machine->primary_screen->frame_period()); } @@ -532,7 +532,7 @@ static MACHINE_RESET( fuuki32 ) machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback)); machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback)); - timer_adjust_oneshot(state->raster_interrupt_timer, machine->primary_screen->time_until_pos(0, visarea.max_x + 1), 0); + state->raster_interrupt_timer->adjust(machine->primary_screen->time_until_pos(0, visarea.max_x + 1)); } diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c index 9dca896cb1d..f03db6e2e01 100644 --- a/src/mame/drivers/galaga.c +++ b/src/mame/drivers/galaga.c @@ -873,7 +873,7 @@ static TIMER_CALLBACK( cpu3_interrupt_callback ) scanline = 64; /* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */ - timer_adjust_oneshot(cpu3_interrupt_timer, machine->primary_screen->time_until_pos(scanline), scanline); + cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } @@ -900,7 +900,7 @@ static MACHINE_RESET( galaga ) /* Reset all latches */ bosco_latch_reset(machine); - timer_adjust_oneshot(cpu3_interrupt_timer, machine->primary_screen->time_until_pos(64), 64); + cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64); } static MACHINE_RESET( battles ) diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index e7dddf332bd..a0bf0a8c309 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -633,13 +633,13 @@ static WRITE8_HANDLER( konami_sound_filter_w ) static WRITE8_DEVICE_HANDLER( konami_portc_0_w ) { - logerror("%s:ppi0_portc_w = %02X\n", cpuexec_describe_context(device->machine), data); + logerror("%s:ppi0_portc_w = %02X\n", device->machine->describe_context(), data); } static WRITE8_DEVICE_HANDLER( konami_portc_1_w ) { - logerror("%s:ppi1_portc_w = %02X\n", cpuexec_describe_context(device->machine), data); + logerror("%s:ppi1_portc_w = %02X\n", device->machine->describe_context(), data); } @@ -1978,7 +1978,7 @@ static MACHINE_CONFIG_START( galaxian_base, galaxian_state ) MCFG_VIDEO_UPDATE(galaxian) /* blinking frequency is determined by 555 counter with Ra=100k, Rb=10k, C=10uF */ - MCFG_TIMER_ADD_PERIODIC("stars", galaxian_stars_blink_timer, attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(100000, 10000, 0.00001))) + MCFG_TIMER_ADD_PERIODIC("stars", galaxian_stars_blink_timer, PERIOD_OF_555_ASTABLE(100000, 10000, 0.00001)) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c index a328b3118be..df735059f30 100644 --- a/src/mame/drivers/galpani2.c +++ b/src/mame/drivers/galpani2.c @@ -77,7 +77,7 @@ static MACHINE_RESET( galpani2 ) kaneko16_sprite_xoffs = 0x10000 - 0x16c0 + 0xc00; kaneko16_sprite_yoffs = 0x000; - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(50)); //initial mcu xchk + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); //initial mcu xchk } static void galpani2_write_kaneko(device_t *device) @@ -143,7 +143,7 @@ static void galpani2_mcu_nmi1(running_machine *machine) if (mcu_command != 0) { logerror("%s : MCU [$%06X] endidx = $%02X / command = $%02X addr = $%04X ? = $%02X.\n", - cpuexec_describe_context(machine), + machine->describe_context(), mcu_list, srcspace->read_byte(0x100020), mcu_command, @@ -166,7 +166,7 @@ static void galpani2_mcu_nmi1(running_machine *machine) mcu_size = (srcspace->read_byte(mcu_address + 8)<<8) + (srcspace->read_byte(mcu_address + 9)<<0) ; - logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",cpuexec_describe_context(machine),mcu_command,mcu_src,mcu_size,mcu_dst); + logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine->describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst); for( ; mcu_size > 0 ; mcu_size-- ) { @@ -191,7 +191,7 @@ static void galpani2_mcu_nmi1(running_machine *machine) mcu_size = (srcspace->read_byte(mcu_address + 8)<<8) + (srcspace->read_byte(mcu_address + 9)<<0) ; - logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",cpuexec_describe_context(machine),mcu_command,mcu_src,mcu_size,mcu_dst); + logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine->describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst); for( ; mcu_size > 0 ; mcu_size-- ) { @@ -219,7 +219,7 @@ static void galpani2_mcu_nmi1(running_machine *machine) srcspace->write_byte(mcu_address+0,0xff); srcspace->write_byte(mcu_address+1,0xff); - logerror("%s : MCU ERROR, unknown command $%02X\n",cpuexec_describe_context(machine),mcu_command); + logerror("%s : MCU ERROR, unknown command $%02X\n",machine->describe_context(),mcu_command); } /* Erase command (so that it won't be processed again)? */ @@ -230,7 +230,7 @@ static void galpani2_mcu_nmi1(running_machine *machine) static void galpani2_mcu_nmi2(running_machine *machine) { galpani2_write_kaneko(machine->device("maincpu")); - //logerror("%s : MCU executes CHECKs synchro\n", cpuexec_describe_context(machine)); + //logerror("%s : MCU executes CHECKs synchro\n", machine->describe_context()); } static WRITE8_HANDLER( galpani2_mcu_nmi1_w ) //driven by CPU1's int5 ISR @@ -276,7 +276,7 @@ static WRITE8_HANDLER( galpani2_coin_lockout_w ) static WRITE8_DEVICE_HANDLER( galpani2_oki1_bank_w ) { UINT8 *ROM = device->machine->region("oki1")->base(); - logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag(),data); + logerror("%s : %s bank %08X\n",device->machine->describe_context(),device->tag(),data); memcpy(ROM + 0x30000, ROM + 0x40000 + 0x10000 * (~data & 0xf), 0x10000); } @@ -284,7 +284,7 @@ static WRITE8_DEVICE_HANDLER( galpani2_oki2_bank_w ) { okim6295_device *oki = downcast<okim6295_device *>(device); oki->set_bank_base(0x40000 * (data & 0xf) ); - logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag(),data); + logerror("%s : %s bank %08X\n",device->machine->describe_context(),device->tag(),data); } diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c index 41b8ff11f49..efd121f3249 100644 --- a/src/mame/drivers/galpani3.c +++ b/src/mame/drivers/galpani3.c @@ -438,7 +438,7 @@ static void galpani3_mcu_run(running_machine *machine) UINT16 mcu_offset = mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */ UINT16 mcu_subcmd = mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */ - logerror("%s: MCU executed command : %04X %04X\n",cpuexec_describe_context(machine),mcu_command,mcu_offset*2); + logerror("%s: MCU executed command : %04X %04X\n",machine->describe_context(),mcu_command,mcu_offset*2); /* the only MCU commands found in program code are: 0x04: protection: provide code/data, @@ -451,7 +451,7 @@ static void galpani3_mcu_run(running_machine *machine) case 0x03: // DSW { mcu_ram[mcu_offset] = input_port_read(machine, "DSW"); - logerror("%s : MCU executed command: %04X %04X (read DSW)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2); + logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine->describe_context(), mcu_command, mcu_offset*2); } break; diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c index 71eacb47aba..6b368405735 100644 --- a/src/mame/drivers/gamecstl.c +++ b/src/mame/drivers/gamecstl.c @@ -184,7 +184,7 @@ static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) { -// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", cpuexec_describe_context(busdevice->machine), function, reg, data); +// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", busdevice->machine->describe_context(), function, reg, data); switch(reg) { @@ -268,7 +268,7 @@ static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) { -// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", cpuexec_describe_context(busdevice->machine), function, reg, data); +// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", busdevice->machine->describe_context(), function, reg, data); piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/gameplan.c b/src/mame/drivers/gameplan.c index e4d949ea952..3002af33a2d 100644 --- a/src/mame/drivers/gameplan.c +++ b/src/mame/drivers/gameplan.c @@ -146,7 +146,7 @@ static WRITE8_DEVICE_HANDLER( audio_reset_w ) if (data == 0) { state->riot->reset(); - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(10)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); } } @@ -188,7 +188,7 @@ static WRITE_LINE_DEVICE_HANDLER( r6532_irq ) cpu_set_input_line(gameplan->audiocpu, 0, state); if (state == ASSERT_LINE) - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(10)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); } diff --git a/src/mame/drivers/gijoe.c b/src/mame/drivers/gijoe.c index c2e86d98e17..f516308efc9 100644 --- a/src/mame/drivers/gijoe.c +++ b/src/mame/drivers/gijoe.c @@ -131,7 +131,7 @@ static INTERRUPT_GEN( gijoe_interrupt ) gijoe_objdma(device->machine); // 42.7us(clr) + 341.3us(xfer) delay at 6Mhz dotclock - timer_adjust_oneshot(state->dmadelay_timer, JOE_DMADELAY, 0); + state->dmadelay_timer->adjust(JOE_DMADELAY); } // trigger V-blank interrupt diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c index 0b95d44b138..1d3b88f8675 100644 --- a/src/mame/drivers/gottlieb.c +++ b/src/mame/drivers/gottlieb.c @@ -309,7 +309,7 @@ static MACHINE_RESET( gottlieb ) { /* if we have a laserdisc, reset our philips code callback for the next line 17 */ if (laserdisc != NULL) - timer_adjust_oneshot(laserdisc_philips_timer, machine->primary_screen->time_until_pos(17), 17); + laserdisc_philips_timer->adjust(machine->primary_screen->time_until_pos(17), 17); } @@ -438,7 +438,7 @@ static WRITE8_HANDLER( laserdisc_command_w ) a sequence of events that sends serial data to the player */ /* set a timer to clock the bits through; a total of 12 bits are clocked */ - timer_adjust_oneshot(laserdisc_bit_timer, LASERDISC_CLOCK * 10, (12 << 16) | data); + laserdisc_bit_timer->adjust(LASERDISC_CLOCK * 10, (12 << 16) | data); /* it also clears bit 4 of the status (will be set when transmission is complete) */ laserdisc_status &= ~0x10; @@ -468,7 +468,7 @@ static TIMER_CALLBACK( laserdisc_philips_callback ) /* toggle to the next one */ param = (param == 17) ? 18 : 17; - timer_adjust_oneshot(laserdisc_philips_timer, machine->primary_screen->time_until_pos(param * 2), param); + laserdisc_philips_timer->adjust(machine->primary_screen->time_until_pos(param * 2), param); } @@ -499,7 +499,7 @@ static TIMER_CALLBACK( laserdisc_bit_callback ) /* if we're not out of bits, set a timer for the next one; else set the ready bit */ if (bitsleft-- != 0) - timer_adjust_oneshot(laserdisc_bit_timer, duration, (bitsleft << 16) | data); + laserdisc_bit_timer->adjust(duration, (bitsleft << 16) | data); else laserdisc_status |= 0x10; } diff --git a/src/mame/drivers/gridlee.c b/src/mame/drivers/gridlee.c index 3b9dcefd7a6..d2b49968b93 100644 --- a/src/mame/drivers/gridlee.c +++ b/src/mame/drivers/gridlee.c @@ -123,15 +123,15 @@ static TIMER_CALLBACK( irq_timer_tick ) { /* next interrupt after scanline 256 is scanline 64 */ if (param == 256) - timer_adjust_oneshot(irq_timer, machine->primary_screen->time_until_pos(64), 64); + irq_timer->adjust(machine->primary_screen->time_until_pos(64), 64); else - timer_adjust_oneshot(irq_timer, machine->primary_screen->time_until_pos(param + 64), param + 64); + irq_timer->adjust(machine->primary_screen->time_until_pos(param + 64), param + 64); /* IRQ starts on scanline 0, 64, 128, etc. */ cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE); /* it will turn off on the next HBLANK */ - timer_adjust_oneshot(irq_off, machine->primary_screen->time_until_pos(param, BALSENTE_HBSTART), 0); + irq_off->adjust(machine->primary_screen->time_until_pos(param, BALSENTE_HBSTART)); } @@ -144,13 +144,13 @@ static TIMER_CALLBACK( firq_off_tick ) static TIMER_CALLBACK( firq_timer_tick ) { /* same time next frame */ - timer_adjust_oneshot(firq_timer, machine->primary_screen->time_until_pos(FIRQ_SCANLINE), 0); + firq_timer->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE)); /* IRQ starts on scanline FIRQ_SCANLINE? */ cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); /* it will turn off on the next HBLANK */ - timer_adjust_oneshot(firq_off, machine->primary_screen->time_until_pos(FIRQ_SCANLINE, BALSENTE_HBSTART), 0); + firq_off->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE, BALSENTE_HBSTART)); } static MACHINE_START( gridlee ) @@ -173,8 +173,8 @@ static MACHINE_START( gridlee ) static MACHINE_RESET( gridlee ) { /* start timers to generate interrupts */ - timer_adjust_oneshot(irq_timer, machine->primary_screen->time_until_pos(0), 0); - timer_adjust_oneshot(firq_timer, machine->primary_screen->time_until_pos(FIRQ_SCANLINE), 0); + irq_timer->adjust(machine->primary_screen->time_until_pos(0)); + firq_timer->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE)); } diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c index 36ed2a31915..6d926e3a6dd 100644 --- a/src/mame/drivers/guab.c +++ b/src/mame/drivers/guab.c @@ -341,7 +341,7 @@ static TIMER_CALLBACK( fdc_data_callback ) if (more_data) { - timer_adjust_oneshot(fdc_timer, attotime::from_usec(USEC_DELAY), 0); + fdc_timer->adjust(attotime::from_usec(USEC_DELAY)); } else { @@ -426,7 +426,7 @@ static WRITE16_HANDLER( wd1770_w ) fdc.sector)); /* Set the data read timer */ - timer_adjust_oneshot(fdc_timer, attotime::from_usec(USEC_DELAY), 0); + fdc_timer->adjust(attotime::from_usec(USEC_DELAY)); break; } @@ -463,7 +463,7 @@ static WRITE16_HANDLER( wd1770_w ) case 13: { /* Stop any operation in progress */ - timer_reset(fdc_timer, attotime::never); + fdc_timer->reset(); fdc.status &= ~BUSY; FDC_LOG(("Force Interrupt\n")); break; @@ -494,7 +494,7 @@ static WRITE16_HANDLER( wd1770_w ) /* Queue an event to write the data if write command was specified */ if (fdc.cmd & 0x20) - timer_adjust_oneshot(fdc_timer, attotime::from_usec(USEC_DELAY), 0); + fdc_timer->adjust(attotime::from_usec(USEC_DELAY)); break; } diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c index 4c70a6552ac..6f168f82223 100644 --- a/src/mame/drivers/halleys.c +++ b/src/mame/drivers/halleys.c @@ -312,7 +312,7 @@ static void blit(int offset) #if HALLEYS_DEBUG if (0) { - logerror("%s:[%04x]", cpuexec_describe_context(machine), offset); + logerror("%s:[%04x]", machine->describe_context(), offset); for (ecx=0; ecx<16; ecx++) logerror(" %02x", param[ecx]); logerror("\n"); } @@ -1014,7 +1014,7 @@ static WRITE8_HANDLER( blitter_w ) else { blitter_busy = 1; - timer_adjust_oneshot(blitter_reset_timer, downcast<cpu_device *>(space->cpu)->cycles_to_attotime(100), 0); // free blitter if no updates in 100 cycles + blitter_reset_timer->adjust(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(100)); // free blitter if no updates in 100 cycles } } } diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c index 4d3b82ba248..55a29cdc88c 100644 --- a/src/mame/drivers/hornet.c +++ b/src/mame/drivers/hornet.c @@ -886,7 +886,7 @@ static void sound_irq_callback( running_machine *machine, int irq ) int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2; cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE); - timer_adjust_oneshot(sound_irq_timer, attotime::from_usec(1), line); + sound_irq_timer->adjust(attotime::from_usec(1), line); } static const k056800_interface hornet_k056800_interface = diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c index 875ca4f3933..2d37b1e84de 100644 --- a/src/mame/drivers/hyprduel.c +++ b/src/mame/drivers/hyprduel.c @@ -138,7 +138,7 @@ static READ16_HANDLER( hyprduel_cpusync_trigger1_r ) hyprduel_state *state = space->machine->driver_data<hyprduel_state>(); if (state->cpu_trigger == 1001) { - cpuexec_trigger(space->machine, 1001); + space->machine->scheduler().trigger(1001); state->cpu_trigger = 0; } @@ -166,7 +166,7 @@ static READ16_HANDLER( hyprduel_cpusync_trigger2_r ) hyprduel_state *state = space->machine->driver_data<hyprduel_state>(); if (state->cpu_trigger == 1002) { - cpuexec_trigger(space->machine, 1002); + space->machine->scheduler().trigger(1002); state->cpu_trigger = 0; } @@ -285,7 +285,7 @@ INLINE void blt_write( address_space *space, const int tmap, const offs_t offs, case 2: hyprduel_vram_1_w(space, offs, data, mask); break; case 3: hyprduel_vram_2_w(space, offs, data, mask); break; } -// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", cpuexec_describe_context(space->machine), tmap, offs, data, mask); +// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine->describe_context(), tmap, offs, data, mask); } @@ -668,7 +668,7 @@ static MACHINE_START( magerror ) hyprduel_state *state = machine->driver_data<hyprduel_state>(); MACHINE_START_CALL(hyprduel); - timer_adjust_periodic(state->magerror_irq_timer, attotime::zero, 0, attotime::from_hz(968)); /* tempo? */ + state->magerror_irq_timer->adjust(attotime::zero, 0, attotime::from_hz(968)); /* tempo? */ } static MACHINE_CONFIG_START( hyprduel, hyprduel_state ) diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c index 009bf7694dc..7f8ead49f0c 100644 --- a/src/mame/drivers/igs011.c +++ b/src/mame/drivers/igs011.c @@ -865,7 +865,7 @@ static WRITE16_HANDLER( igs011_prot1_w ) break; } - logerror("%s: warning, unknown igs011_prot1_w( %04x, %04x )\n", cpuexec_describe_context(space->machine), offset, data); + logerror("%s: warning, unknown igs011_prot1_w( %04x, %04x )\n", space->machine->describe_context(), offset, data); } static READ16_HANDLER( igs011_prot1_r ) { @@ -937,7 +937,7 @@ static WRITE16_HANDLER( igs011_prot2_inc_w ) igs011_prot2++; } // else -// logerror("%s: warning, unknown igs011_prot2_inc_w( %04x, %04x )\n", cpuexec_describe_context(space->machine), offset, data); +// logerror("%s: warning, unknown igs011_prot2_inc_w( %04x, %04x )\n", space->machine->describe_context(), offset, data); } // vbowl (33) @@ -948,7 +948,7 @@ static WRITE16_HANDLER( igs011_prot2_dec_w ) igs011_prot2--; } // else -// logerror("%s: warning, unknown igs011_prot2_dec_w( %04x, %04x )\n", cpuexec_describe_context(space->machine), offset, data); +// logerror("%s: warning, unknown igs011_prot2_dec_w( %04x, %04x )\n", space->machine->describe_context(), offset, data); } @@ -964,7 +964,7 @@ static WRITE16_HANDLER( drgnwrld_igs011_prot2_swap_w ) igs011_prot2 = ((BIT(x,3)&BIT(x,0))<<4) | (BIT(x,2)<<3) | ((BIT(x,0)|BIT(x,1))<<2) | ((BIT(x,2)^BIT(x,4)^1)<<1) | (BIT(x,1)^1^BIT(x,3)); } // else -// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", cpuexec_describe_context(space->machine), offset, data); +// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data); } // lhb, xymg, lhb2 @@ -979,7 +979,7 @@ static WRITE16_HANDLER( lhb_igs011_prot2_swap_w ) igs011_prot2 = (((BIT(x,0)^1)|BIT(x,1))<<2) | (BIT(x,2)<<1) | (BIT(x,0)&BIT(x,1)); } // else -// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", cpuexec_describe_context(space->machine), offset, data); +// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data); } // wlcc @@ -994,7 +994,7 @@ static WRITE16_HANDLER( wlcc_igs011_prot2_swap_w ) igs011_prot2 = ((BIT(x,3)^BIT(x,2))<<4) | ((BIT(x,2)^BIT(x,1))<<3) | ((BIT(x,1)^BIT(x,0))<<2) | ((BIT(x,4)^BIT(x,0)^1)<<1) | (BIT(x,4)^BIT(x,3)^1); } // else -// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", cpuexec_describe_context(space->machine), offset, data); +// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data); } // vbowl @@ -1009,7 +1009,7 @@ static WRITE16_HANDLER( vbowl_igs011_prot2_swap_w ) igs011_prot2 = ((BIT(x,3)^BIT(x,2))<<4) | ((BIT(x,2)^BIT(x,1))<<3) | ((BIT(x,1)^BIT(x,0))<<2) | ((BIT(x,4)^BIT(x,0))<<1) | (BIT(x,4)^BIT(x,3)); } // else -// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", cpuexec_describe_context(space->machine), offset, data); +// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data); } @@ -1128,7 +1128,7 @@ static WRITE16_HANDLER( igs012_prot_mode_w ) igs012_prot_mode = igs012_prot_mode ^ 1; } else - logerror("%s: warning, unknown igs012_prot_mode_w( %04x, %04x ), mode %x\n", cpuexec_describe_context(space->machine), offset, data, igs012_prot_mode); + logerror("%s: warning, unknown igs012_prot_mode_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, igs012_prot_mode); } static WRITE16_HANDLER( igs012_prot_inc_w ) @@ -1138,7 +1138,7 @@ static WRITE16_HANDLER( igs012_prot_inc_w ) igs012_prot = (igs012_prot + 1) & 0x1f; } else - logerror("%s: warning, unknown igs012_prot_inc_w( %04x, %04x ), mode %x\n", cpuexec_describe_context(space->machine), offset, data, igs012_prot_mode); + logerror("%s: warning, unknown igs012_prot_inc_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, igs012_prot_mode); } static WRITE16_HANDLER( igs012_prot_dec_inc_w ) @@ -1152,7 +1152,7 @@ static WRITE16_HANDLER( igs012_prot_dec_inc_w ) igs012_prot = (igs012_prot + 1) & 0x1f; } else - logerror("%s: warning, unknown igs012_prot_dec_inc_w( %04x, %04x ), mode %x\n", cpuexec_describe_context(space->machine), offset, data, igs012_prot_mode); + logerror("%s: warning, unknown igs012_prot_dec_inc_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, igs012_prot_mode); } static WRITE16_HANDLER( igs012_prot_dec_copy_w ) @@ -1166,7 +1166,7 @@ static WRITE16_HANDLER( igs012_prot_dec_copy_w ) igs012_prot = (igs012_prot - 1) & 0x1f; } else - logerror("%s: warning, unknown igs012_prot_dec_copy_w( %04x, %04x ), mode %x\n", cpuexec_describe_context(space->machine), offset, data, igs012_prot_mode); + logerror("%s: warning, unknown igs012_prot_dec_copy_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, igs012_prot_mode); } static WRITE16_HANDLER( igs012_prot_copy_w ) @@ -1176,7 +1176,7 @@ static WRITE16_HANDLER( igs012_prot_copy_w ) igs012_prot = igs012_prot_swap; } else - logerror("%s: warning, unknown igs012_prot_copy_w( %04x, %04x ), mode %x\n", cpuexec_describe_context(space->machine), offset, data, igs012_prot_mode); + logerror("%s: warning, unknown igs012_prot_copy_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, igs012_prot_mode); } static WRITE16_HANDLER( igs012_prot_swap_w ) @@ -1188,7 +1188,7 @@ static WRITE16_HANDLER( igs012_prot_swap_w ) igs012_prot_swap = (((BIT(x,3)|BIT(x,1))^1)<<3) | ((BIT(x,2)&BIT(x,1))<<2) | ((BIT(x,3)^BIT(x,0))<<1) | (BIT(x,2)^1); } else - logerror("%s: warning, unknown igs012_prot_swap_w( %04x, %04x ), mode %x\n", cpuexec_describe_context(space->machine), offset, data, igs012_prot_mode); + logerror("%s: warning, unknown igs012_prot_swap_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, igs012_prot_mode); } static READ16_HANDLER( igs012_prot_r ) @@ -2076,7 +2076,7 @@ static WRITE16_DEVICE_HANDLER( lhb_okibank_w ) } if ( data & (~0x200) ) - logerror("%s: warning, unknown bits written in oki bank = %02x\n", cpuexec_describe_context(device->machine), data); + logerror("%s: warning, unknown bits written in oki bank = %02x\n", device->machine->describe_context(), data); // popmessage("oki %04x",data); } diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c index 3feb379fa5e..be2f8809a49 100644 --- a/src/mame/drivers/igs017.c +++ b/src/mame/drivers/igs017.c @@ -1192,7 +1192,7 @@ static READ8_DEVICE_HANDLER( mgcs_keys_r ) if (~input_select & 0x40) return input_port_read(device->machine, "KEY3"); if (~input_select & 0x80) return input_port_read(device->machine, "KEY4"); - logerror("%s: warning, reading key with input_select = %02x\n", cpuexec_describe_context(device->machine), input_select); + logerror("%s: warning, reading key with input_select = %02x\n", device->machine->describe_context(), input_select); return 0xff; } @@ -1271,7 +1271,7 @@ static READ8_HANDLER( sdmg2_keys_r ) if (input_select == 0x1f) return input_port_read(space->machine, "KEY0"); // in joystick mode - logerror("%s: warning, reading key with input_select = %02x\n", cpuexec_describe_context(space->machine), input_select); + logerror("%s: warning, reading key with input_select = %02x\n", space->machine->describe_context(), input_select); return 0xff; } @@ -1359,7 +1359,7 @@ static READ8_HANDLER( mgdh_keys_r ) if ((input_select & 0xfc) == 0xfc) return input_port_read(space->machine, "DSW1"); - logerror("%s: warning, reading key with input_select = %02x\n", cpuexec_describe_context(space->machine), input_select); + logerror("%s: warning, reading key with input_select = %02x\n", space->machine->describe_context(), input_select); return 0xff; } diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c index 41ecbe5c9f9..93bed5afd7e 100644 --- a/src/mame/drivers/itech32.c +++ b/src/mame/drivers/itech32.c @@ -390,7 +390,7 @@ static UINT32 *tms1_boot; static UINT8 tms_spinning[2]; #define START_TMS_SPINNING(n) do { cpu_spinuntil_trigger(space->cpu, 7351 + n); tms_spinning[n] = 1; } while (0) -#define STOP_TMS_SPINNING(machine, n) do { cpuexec_trigger(machine, 7351 + n); tms_spinning[n] = 0; } while (0) +#define STOP_TMS_SPINNING(machine, n) do { machine->scheduler().trigger(7351 + n); tms_spinning[n] = 0; } while (0) @@ -836,7 +836,7 @@ static WRITE32_HANDLER( tms1_68k_ram_w ) if (offset == 0) COMBINE_DATA(tms1_boot); if (offset == 0x382 && tms_spinning[0]) STOP_TMS_SPINNING(space->machine, 0); if (!tms_spinning[0]) - cpuexec_boost_interleave(space->machine, attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20)); + space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20)); } @@ -845,21 +845,21 @@ static WRITE32_HANDLER( tms2_68k_ram_w ) COMBINE_DATA(&tms2_ram[offset]); if (offset == 0x382 && tms_spinning[1]) STOP_TMS_SPINNING(space->machine, 1); if (!tms_spinning[1]) - cpuexec_boost_interleave(space->machine, attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20)); + space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20)); } static WRITE32_HANDLER( tms1_trigger_w ) { COMBINE_DATA(&tms1_ram[offset]); - cpuexec_boost_interleave(space->machine, attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20)); + space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20)); } static WRITE32_HANDLER( tms2_trigger_w ) { COMBINE_DATA(&tms2_ram[offset]); - cpuexec_boost_interleave(space->machine, attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20)); + space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20)); } diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c index 95261bbd435..3f9519eb26f 100644 --- a/src/mame/drivers/jangou.c +++ b/src/mame/drivers/jangou.c @@ -895,7 +895,7 @@ static SOUND_START( jangou ) /* Create a timer to feed the CVSD DAC with sample bits */ state->cvsd_bit_timer = machine->scheduler().timer_alloc(FUNC(cvsd_bit_timer_callback)); - timer_adjust_periodic(state->cvsd_bit_timer, attotime::from_hz(MASTER_CLOCK / 1024), 0, attotime::from_hz(MASTER_CLOCK / 1024)); + state->cvsd_bit_timer->adjust(attotime::from_hz(MASTER_CLOCK / 1024), 0, attotime::from_hz(MASTER_CLOCK / 1024)); } diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c index e74fec2385a..b57e8c40f55 100644 --- a/src/mame/drivers/jchan.c +++ b/src/mame/drivers/jchan.c @@ -212,7 +212,7 @@ static void jchan_mcu_run(running_machine *machine) UINT16 mcu_offset = mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */ UINT16 mcu_subcmd = mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */ - logerror("%s : MCU executed command: %04X %04X %04X ",cpuexec_describe_context(machine),mcu_command,mcu_offset*2,mcu_subcmd); + logerror("%s : MCU executed command: %04X %04X %04X ",machine->describe_context(),mcu_command,mcu_offset*2,mcu_subcmd); /* the only MCU commands found in program code are: @@ -233,7 +233,7 @@ static void jchan_mcu_run(running_machine *machine) case 0x03: // DSW { mcu_ram[mcu_offset] = input_port_read(machine, "DSW"); - logerror("%s : MCU executed command: %04X %04X (read DSW)\n",cpuexec_describe_context(machine),mcu_command,mcu_offset*2); + logerror("%s : MCU executed command: %04X %04X (read DSW)\n",machine->describe_context(),mcu_command,mcu_offset*2); } break; diff --git a/src/mame/drivers/jedi.c b/src/mame/drivers/jedi.c index 9bca0a67f7c..66fd86ca349 100644 --- a/src/mame/drivers/jedi.c +++ b/src/mame/drivers/jedi.c @@ -136,7 +136,7 @@ static TIMER_CALLBACK( generate_interrupt ) scanline += 32; if (scanline > 256) scanline = 32; - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } @@ -159,7 +159,7 @@ static MACHINE_START( jedi ) /* set a timer to run the interrupts */ state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(generate_interrupt)); - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(32), 32); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(32), 32); /* configure the banks */ memory_configure_bank(machine, "bank1", 0, 3, machine->region("maincpu")->base() + 0x10000, 0x4000); diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c index 28dec3c17b2..225ec071381 100644 --- a/src/mame/drivers/jpmsys5.c +++ b/src/mame/drivers/jpmsys5.c @@ -263,7 +263,7 @@ static WRITE16_DEVICE_HANDLER( jpm_upd7759_w ) } else { - logerror("%s: upd7759: Unknown write to %x with %x\n", cpuexec_describe_context(device->machine), offset, data); + logerror("%s: upd7759: Unknown write to %x with %x\n", device->machine->describe_context(), offset, data); } } @@ -351,7 +351,7 @@ static TIMER_CALLBACK( touch_cb ) if (++touch_data_count == 3) { - timer_reset(touch_timer, attotime::never); + touch_timer->reset(); touch_state = IDLE; } else @@ -378,7 +378,7 @@ static INPUT_CHANGED( touchscreen_press ) /* Start sending the data to the 68000 serially */ touch_data_count = 0; touch_state = START; - timer_adjust_periodic(touch_timer, rx_period, 0, rx_period); + touch_timer->adjust(rx_period, 0, rx_period); } } @@ -582,7 +582,7 @@ static MACHINE_START( jpmsys5v ) static MACHINE_RESET( jpmsys5v ) { - timer_reset(touch_timer, attotime::never); + touch_timer->reset(); touch_state = IDLE; a2_data_in = 1; a2_acia_dcd = 0; diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c index a31bc933d92..7ca5736ffac 100644 --- a/src/mame/drivers/kaneko16.c +++ b/src/mame/drivers/kaneko16.c @@ -400,7 +400,7 @@ static WRITE16_DEVICE_HANDLER( bakubrkr_oki_bank_sw ) if (ACCESSING_BITS_0_7) { okim6295_device *oki = downcast<okim6295_device *>(device); oki->set_bank_base(0x40000 * (data & 0x7) ); - logerror("%s:Selecting OKI bank %02X\n",cpuexec_describe_context(device->machine),data&0xff); + logerror("%s:Selecting OKI bank %02X\n",device->machine->describe_context(),data&0xff); } } @@ -544,7 +544,7 @@ static WRITE16_DEVICE_HANDLER( bonkadv_oki_0_bank_w ) { okim6295_device *oki = downcast<okim6295_device *>(device); oki->set_bank_base(0x40000 * (data & 0xF)); - logerror("%s: OKI0 bank %08X\n",cpuexec_describe_context(device->machine),data); + logerror("%s: OKI0 bank %08X\n",device->machine->describe_context(),data); } } @@ -554,7 +554,7 @@ static WRITE16_DEVICE_HANDLER( bonkadv_oki_1_bank_w ) { okim6295_device *oki = downcast<okim6295_device *>(device); oki->set_bank_base(0x40000 * data ); - logerror("%s: OKI1 bank %08X\n",cpuexec_describe_context(device->machine),data); + logerror("%s: OKI1 bank %08X\n",device->machine->describe_context(),data); } } diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c index 7057030ca39..3dff2e44fb5 100644 --- a/src/mame/drivers/karnov.c +++ b/src/mame/drivers/karnov.c @@ -123,7 +123,7 @@ static void karnov_i8751_w( running_machine *machine, int data ) if (data == 0x401) state->i8751_return = 0x4138; /* ^Whistling wind */ if (data == 0x408) state->i8751_return = 0x4276; /* ^Heavy Gates */ -// if (!state->i8751_return && data != 0x300) logerror("%s - Unknown Write %02x intel\n", cpuexec_describe_context(machine), data); +// if (!state->i8751_return && data != 0x300) logerror("%s - Unknown Write %02x intel\n", machine->describe_context(), data); cpu_set_input_line(state->maincpu, 6, HOLD_LINE); /* Signal main cpu task is complete */ state->i8751_needs_ack = 1; @@ -159,7 +159,7 @@ static void wndrplnt_i8751_w( running_machine *machine, int data ) case 0x18: state->i8751_return = 0x5341; break; } } -// else logerror("%s - Unknown Write %02x intel\n", cpuexec_describe_context(machine), data); +// else logerror("%s - Unknown Write %02x intel\n", machine->describe_context(), data); /* These are 68k function call addresses - different address for each power-up */ if (data == 0x400) state->i8751_return = 0x594; @@ -315,7 +315,7 @@ static void chelnov_i8751_w( running_machine *machine, int data ) } } - // logerror("%s - Unknown Write %02x intel\n", cpuexec_describe_context(machine), data); + // logerror("%s - Unknown Write %02x intel\n", machine->describe_context(), data); cpu_set_input_line(state->maincpu, 6, HOLD_LINE); /* Signal main cpu task is complete */ state->i8751_needs_ack = 1; diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c index d04b0b9335f..8db9f02afdf 100644 --- a/src/mame/drivers/kickgoal.c +++ b/src/mame/drivers/kickgoal.c @@ -206,7 +206,7 @@ WRITE16_DEVICE_HANDLER( kickgoal_snd_w ) static WRITE16_DEVICE_HANDLER( actionhw_snd_w ) { kickgoal_state *state = device->machine->driver_data<kickgoal_state>(); - logerror("%s: Writing %04x to Sound CPU - mask %04x\n",cpuexec_describe_context(device->machine),data,mem_mask); + logerror("%s: Writing %04x to Sound CPU - mask %04x\n",device->machine->describe_context(),data,mem_mask); if (!ACCESSING_BITS_0_7) data >>= 8; diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c index 36598f2b0df..02265ed5a23 100644 --- a/src/mame/drivers/konamigx.c +++ b/src/mame/drivers/konamigx.c @@ -606,7 +606,7 @@ static WRITE32_HANDLER( ccu_w ) static TIMER_CALLBACK( dmaend_callback ) { // foul-proof (CPU0 could be deactivated while we wait) - if (resume_trigger && suspension_active) { suspension_active = 0; cpuexec_trigger(machine, resume_trigger); } + if (resume_trigger && suspension_active) { suspension_active = 0; machine->scheduler().trigger(resume_trigger); } // DMA busy flag must be cleared before triggering IRQ 3 gx_rdport1_3 &= ~2; @@ -635,14 +635,14 @@ static void dmastart_callback(int data) } // simulate DMA delay - timer_adjust_oneshot(dmadelay_timer, attotime::from_usec(120), 0); + dmadelay_timer->adjust(attotime::from_usec(120)); } static INTERRUPT_GEN(konamigx_vbinterrupt) { // lift idle suspension - if (resume_trigger && suspension_active) { suspension_active = 0; cpuexec_trigger(device->machine, resume_trigger); } + if (resume_trigger && suspension_active) { suspension_active = 0; device->machine->scheduler().trigger(resume_trigger); } // IRQ 1 is the main 60hz vblank interrupt if (gx_syncen & 0x20) @@ -662,7 +662,7 @@ static INTERRUPT_GEN(konamigx_vbinterrupt) static INTERRUPT_GEN(konamigx_vbinterrupt_type4) { // lift idle suspension - if (resume_trigger && suspension_active) { suspension_active = 0; cpuexec_trigger(device->machine, resume_trigger); } + if (resume_trigger && suspension_active) { suspension_active = 0; device->machine->scheduler().trigger(resume_trigger); } // IRQ 1 is the main 60hz vblank interrupt // the gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c index b0c390d69ec..74862fb4036 100644 --- a/src/mame/drivers/ksys573.c +++ b/src/mame/drivers/ksys573.c @@ -430,7 +430,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 ); } } @@ -599,7 +599,7 @@ static TIMER_CALLBACK( atapi_xfer_end ) int i, n_this; UINT8 sector_buffer[ 4096 ]; - timer_adjust_oneshot(state->atapi_timer, attotime::never, 0); + state->atapi_timer->adjust(attotime::never); // verboselog( machine, 2, "atapi_xfer_end( %d ) atapi_xferlen = %d, atapi_xfermod=%d\n", x, atapi_xfermod, atapi_xferlen ); @@ -645,7 +645,7 @@ static TIMER_CALLBACK( atapi_xfer_end ) atapi_regs[ATAPI_REG_COUNTLOW] = state->atapi_xferlen & 0xff; atapi_regs[ATAPI_REG_COUNTHIGH] = (state->atapi_xferlen>>8)&0xff; - timer_adjust_oneshot(state->atapi_timer, machine->device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))), 0); + state->atapi_timer->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048)))); } else { @@ -878,7 +878,7 @@ static WRITE32_HANDLER( atapi_w ) case 0x45: // PLAY atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_BSY; - timer_adjust_oneshot( state->atapi_timer, downcast<cpu_device *>(space->cpu)->cycles_to_attotime( ATAPI_CYCLES_PER_SECTOR ), 0 ); + state->atapi_timer->adjust( downcast<cpu_device *>(space->cpu)->cycles_to_attotime( ATAPI_CYCLES_PER_SECTOR ) ); break; } @@ -1052,7 +1052,7 @@ static void atapi_init(running_machine *machine) state->atapi_cdata_wait = 0; state->atapi_timer = machine->scheduler().timer_alloc(FUNC(atapi_xfer_end)); - timer_adjust_oneshot(state->atapi_timer, attotime::never, 0); + state->atapi_timer->adjust(attotime::never); for( i = 0; i < 2; i++ ) { @@ -1124,7 +1124,7 @@ static void cdrom_dma_write( running_machine *machine, UINT32 n_address, INT32 n verboselog( machine, 2, "atapi_xfer_end: %d %d\n", state->atapi_xferlen, state->atapi_xfermod ); // set a transfer complete timer (Note: CYCLES_PER_SECTOR can't be lower than 2000 or the BIOS ends up "out of order") - timer_adjust_oneshot(state->atapi_timer, machine->device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))), 0); + state->atapi_timer->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048)))); } static WRITE32_HANDLER( security_w ) @@ -1324,7 +1324,7 @@ static void root_timer_adjust( running_machine *machine, int n_counter ) if( ( state->m_p_n_root_mode[ n_counter ] & PSX_RC_STOP ) != 0 ) { - timer_adjust_oneshot( state->m_p_timer_root[ n_counter ], attotime::never, n_counter); + state->m_p_timer_root[ n_counter ]->adjust( attotime::never, n_counter); } else { @@ -1338,7 +1338,7 @@ static void root_timer_adjust( running_machine *machine, int n_counter ) n_duration *= root_divider( machine, n_counter ); - timer_adjust_oneshot( state->m_p_timer_root[ n_counter ], attotime::from_hz(33868800) * n_duration, n_counter); + state->m_p_timer_root[ n_counter ]->adjust( attotime::from_hz(33868800) * n_duration, n_counter); } } diff --git a/src/mame/drivers/lgp.c b/src/mame/drivers/lgp.c index 935f76fedd3..5b7a1803c2b 100644 --- a/src/mame/drivers/lgp.c +++ b/src/mame/drivers/lgp.c @@ -329,7 +329,7 @@ static INTERRUPT_GEN( vblank_callback_lgp ) // IRQ cpu_set_input_line(device, 0, ASSERT_LINE); - timer_adjust_oneshot(irq_timer, attotime::from_usec(50), 0); + irq_timer->adjust(attotime::from_usec(50)); } diff --git a/src/mame/drivers/lockon.c b/src/mame/drivers/lockon.c index f5a0a69cfa6..c7779c26660 100644 --- a/src/mame/drivers/lockon.c +++ b/src/mame/drivers/lockon.c @@ -532,7 +532,7 @@ static MACHINE_CONFIG_START( lockon, lockon_state ) MCFG_CPU_PROGRAM_MAP(sound_prg) MCFG_CPU_IO_MAP(sound_io) - MCFG_WATCHDOG_TIME_INIT(attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(10000, 4700, 10000e-12) * 4096)) + MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_ASTABLE(10000, 4700, 10000e-12) * 4096) MCFG_QUANTUM_TIME(attotime::from_hz(600)) MCFG_MACHINE_START(lockon) diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c index 6f2f80ebee8..e32fc639dcb 100644 --- a/src/mame/drivers/lordgun.c +++ b/src/mame/drivers/lordgun.c @@ -151,7 +151,7 @@ static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w ) if (data & ~0xfd) { // popmessage("EE: %02x", data); - logerror("%s: Unknown EEPROM bit written %02X\n",cpuexec_describe_context(device->machine),data); + logerror("%s: Unknown EEPROM bit written %02X\n",device->machine->describe_context(),data); } coin_counter_w(device->machine, 0, data & 0x01); @@ -182,7 +182,7 @@ static WRITE8_DEVICE_HANDLER( aliencha_eeprom_w ) if (~data & ~0xf8) { // popmessage("EE: %02x", data); - logerror("%s: Unknown EEPROM bit written %02X\n",cpuexec_describe_context(device->machine),data); + logerror("%s: Unknown EEPROM bit written %02X\n",device->machine->describe_context(),data); } // bit 1? cleared during screen transitions @@ -212,7 +212,7 @@ static READ8_DEVICE_HANDLER( aliencha_dip_r ) case 0x50: return input_port_read(device->machine, "DIP3"); default: - logerror("%s: dip_r with unknown dip_sel = %02X\n",cpuexec_describe_context(device->machine),aliencha_dip_sel); + logerror("%s: dip_r with unknown dip_sel = %02X\n",device->machine->describe_context(),aliencha_dip_sel); return 0xff; } } @@ -319,7 +319,7 @@ ADDRESS_MAP_END static WRITE8_DEVICE_HANDLER( lordgun_okibank_w ) { downcast<okim6295_device *>(device)->set_bank_base((data & 2) ? 0x40000 : 0); - if (data & ~3) logerror("%s: unknown okibank bits %02x\n", cpuexec_describe_context(device->machine), data); + if (data & ~3) logerror("%s: unknown okibank bits %02x\n", device->machine->describe_context(), data); // popmessage("OKI %x", data); } diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c index a5f758dae3f..a54a349429f 100644 --- a/src/mame/drivers/m107.c +++ b/src/mame/drivers/m107.c @@ -62,7 +62,7 @@ static MACHINE_START( m107 ) static MACHINE_RESET( m107 ) { m107_state *state = machine->driver_data<m107_state>(); - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(0), 0); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0)); } /*****************************************************************************/ @@ -89,7 +89,7 @@ static TIMER_CALLBACK( m107_scanline_interrupt ) /* adjust for next scanline */ if (++scanline >= machine->primary_screen->height()) scanline = 0; - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c index 7bcfb1e37e4..b22a3685025 100644 --- a/src/mame/drivers/m72.c +++ b/src/mame/drivers/m72.c @@ -123,8 +123,8 @@ static MACHINE_START( kengo ) static TIMER_CALLBACK( synch_callback ) { - //cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(8000000)); - cpuexec_boost_interleave(machine, attotime::from_hz(MASTER_CLOCK/4/12), attotime::from_seconds(25)); + //machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(8000000)); + machine->scheduler().boost_interleave(attotime::from_hz(MASTER_CLOCK/4/12), attotime::from_seconds(25)); } static MACHINE_RESET( m72 ) @@ -134,7 +134,7 @@ static MACHINE_RESET( m72 ) state->mcu_sample_addr = 0; state->mcu_snd_cmd_latch = 0; - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(0), 0); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0)); machine->scheduler().synchronize(FUNC(synch_callback)); } @@ -142,13 +142,13 @@ static MACHINE_RESET( xmultipl ) { m72_state *state = machine->driver_data<m72_state>(); state->irq_base = 0x08; - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(0), 0); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0)); } static MACHINE_RESET( kengo ) { m72_state *state = machine->driver_data<m72_state>(); - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(0), 0); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0)); } static TIMER_CALLBACK( m72_scanline_interrupt ) @@ -173,7 +173,7 @@ static TIMER_CALLBACK( m72_scanline_interrupt ) /* adjust for next scanline */ if (++scanline >= machine->primary_screen->height()) scanline = 0; - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } static TIMER_CALLBACK( kengo_scanline_interrupt ) @@ -202,7 +202,7 @@ static TIMER_CALLBACK( kengo_scanline_interrupt ) /* adjust for next scanline */ if (++scanline >= machine->primary_screen->height()) scanline = 0; - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } /*************************************************************************** diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c index 6cb004e7170..095efcf6650 100644 --- a/src/mame/drivers/m92.c +++ b/src/mame/drivers/m92.c @@ -241,7 +241,7 @@ static MACHINE_START( m92 ) static MACHINE_RESET( m92 ) { m92_state *state = machine->driver_data<m92_state>(); - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(0), 0); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0)); } /*****************************************************************************/ @@ -268,7 +268,7 @@ static TIMER_CALLBACK( m92_scanline_interrupt ) /* adjust for next scanline */ if (++scanline >= machine->primary_screen->height()) scanline = 0; - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } /*****************************************************************************/ diff --git a/src/mame/drivers/magmax.c b/src/mame/drivers/magmax.c index 70ee1afcca4..3e4606dadfa 100644 --- a/src/mame/drivers/magmax.c +++ b/src/mame/drivers/magmax.c @@ -77,7 +77,7 @@ static TIMER_CALLBACK( scanline_callback ) scanline += 128; scanline &= 255; - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(scanline), scanline); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } static MACHINE_START( magmax ) @@ -94,7 +94,7 @@ static MACHINE_START( magmax ) static MACHINE_RESET( magmax ) { - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(64), 64); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64); #if 0 { diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c index 51d98924d54..a715c6a0063 100644 --- a/src/mame/drivers/megadriv.c +++ b/src/mame/drivers/megadriv.c @@ -424,7 +424,7 @@ static void mess_md_io_write_data_port(running_machine *machine, int portnum, UI if (((megadrive_io_data_regs[portnum] & 0x40) == 0x00) && ((data & 0x40) == 0x40)) { mess_io_stage[portnum]++; - timer_adjust_oneshot(mess_io_timeout[portnum], machine->device<cpu_device>("maincpu")->cycles_to_attotime(8192), 0); + mess_io_timeout[portnum]->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime(8192)); } } diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c index 7ffd0025ba3..5e974491961 100644 --- a/src/mame/drivers/metro.c +++ b/src/mame/drivers/metro.c @@ -163,7 +163,7 @@ static IRQ_CALLBACK( metro_irq_callback ) { metro_state *state = device->machine->driver_data<metro_state>(); - // logerror("%s: irq callback returns %04X\n", cpuexec_describe_context(device->machine), state->irq_vectors[int_level]); + // logerror("%s: irq callback returns %04X\n", device->machine->describe_context(), state->irq_vectors[int_level]); return state->irq_vectors[irqline] & 0xff; } @@ -281,7 +281,7 @@ static WRITE16_HANDLER( mouja_irq_timer_ctrl_w ) metro_state *state = space->machine->driver_data<metro_state>(); double freq = 58.0 + (0xff - (data & 0xff)) / 2.2; /* 0xff=58Hz, 0x80=116Hz? */ - timer_adjust_periodic(state->mouja_irq_timer, attotime::zero, 0, attotime::from_hz(freq)); + state->mouja_irq_timer->adjust(attotime::zero, 0, attotime::from_hz(freq)); } static INTERRUPT_GEN( mouja_interrupt ) @@ -673,7 +673,7 @@ INLINE void blt_write( address_space *space, const int tmap, const offs_t offs, case 2: metro_vram_1_w(space, offs, data, mask); break; case 3: metro_vram_2_w(space, offs, data, mask); break; } -// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", cpuexec_describe_context(space->machine), tmap, offs, data, mask); +// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine->describe_context(), tmap, offs, data, mask); } diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c index a3b4472e097..c1faf2251d2 100644 --- a/src/mame/drivers/midzeus.c +++ b/src/mame/drivers/midzeus.c @@ -172,7 +172,7 @@ static WRITE32_DEVICE_HANDLER( zeus2_timekeeper_w ) if (bitlatch[2] && !cmos_protected) timekeeper_w(device, offset, data); else - logerror("%s:zeus2_timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", cpuexec_describe_context(device->machine), bitlatch[2], cmos_protected); + logerror("%s:zeus2_timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", device->machine->describe_context(), bitlatch[2], cmos_protected); cmos_protected = TRUE; } @@ -388,7 +388,7 @@ static READ32_HANDLER( tms32031_control_r ) { /* timer is clocked at 100ns */ int which = (offset >> 4) & 1; - INT32 result = (timer_timeelapsed(timer[which]) * 10000000).as_double(); + INT32 result = (timer[which]->elapsed() * 10000000).as_double(); return result; } @@ -413,7 +413,7 @@ static WRITE32_HANDLER( tms32031_control_w ) { int which = (offset >> 4) & 1; if (data & 0x40) - timer_adjust_oneshot(timer[which], attotime::never, 0); + timer[which]->adjust(attotime::never); } else logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(space->cpu), offset, data); @@ -507,7 +507,7 @@ static TIMER_CALLBACK( invasn_gun_callback ) /* generate another interrupt on the next scanline while we are within the BEAM_DY */ beamy++; if (beamy <= machine->primary_screen->visible_area().max_y && beamy <= gun_y[player] + BEAM_DY) - timer_adjust_oneshot(gun_timer[player], machine->primary_screen->time_until_pos(beamy, MAX(0, gun_x[player] - BEAM_DX)), player); + gun_timer[player]->adjust(machine->primary_screen->time_until_pos(beamy, MAX(0, gun_x[player] - BEAM_DX)), player); } @@ -536,7 +536,7 @@ static WRITE32_HANDLER( invasn_gun_w ) }; gun_x[player] = input_port_read(space->machine, names[player][0]) * (visarea.max_x + 1 - visarea.min_x) / 255 + visarea.min_x + BEAM_XOFFS; gun_y[player] = input_port_read(space->machine, names[player][1]) * (visarea.max_y + 1 - visarea.min_y) / 255 + visarea.min_y; - timer_adjust_oneshot(gun_timer[player], space->machine->primary_screen->time_until_pos(MAX(0, gun_y[player] - BEAM_DY), MAX(0, gun_x[player] - BEAM_DX)), player); + gun_timer[player]->adjust(space->machine->primary_screen->time_until_pos(MAX(0, gun_y[player] - BEAM_DY), MAX(0, gun_x[player] - BEAM_DX)), player); } } } diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c index 2da3f309509..1be80f364e9 100644 --- a/src/mame/drivers/missile.c +++ b/src/mame/drivers/missile.c @@ -427,7 +427,7 @@ INLINE void schedule_next_irq(running_machine *machine, int curv) curv = ((curv + 32) & 0xff) & ~0x10; /* next one at the start of this scanline */ - timer_adjust_oneshot(state->irq_timer, machine->primary_screen->time_until_pos(v_to_scanline(state, curv), 0), curv); + state->irq_timer->adjust(machine->primary_screen->time_until_pos(v_to_scanline(state, curv)), curv); } @@ -476,7 +476,7 @@ static TIMER_CALLBACK( adjust_cpu_speed ) /* scanline for the next run */ curv ^= 224; - timer_adjust_oneshot(state->cpu_timer, machine->primary_screen->time_until_pos(v_to_scanline(state, curv), 0), curv); + state->cpu_timer->adjust(machine->primary_screen->time_until_pos(v_to_scanline(state, curv)), curv); } @@ -519,7 +519,7 @@ static MACHINE_START( missile ) /* create a timer to speed/slow the CPU */ state->cpu_timer = machine->scheduler().timer_alloc(FUNC(adjust_cpu_speed)); - timer_adjust_oneshot(state->cpu_timer, machine->primary_screen->time_until_pos(v_to_scanline(state, 0), 0), 0); + state->cpu_timer->adjust(machine->primary_screen->time_until_pos(v_to_scanline(state, 0), 0)); /* create a timer for IRQs and set up the first callback */ state->irq_timer = machine->scheduler().timer_alloc(FUNC(clock_irq)); diff --git a/src/mame/drivers/moo.c b/src/mame/drivers/moo.c index db8f9b7f550..aa58c7c9659 100644 --- a/src/mame/drivers/moo.c +++ b/src/mame/drivers/moo.c @@ -134,7 +134,7 @@ static INTERRUPT_GEN( moo_interrupt ) moo_objdma(device->machine, state->game_type); // schedule DMA end interrupt (delay shortened to catch up with V-blank) - timer_adjust_oneshot(state->dmaend_timer, attotime::from_usec(MOO_DMADELAY), 0); + state->dmaend_timer->adjust(attotime::from_usec(MOO_DMADELAY)); } // trigger V-blank interrupt @@ -148,7 +148,7 @@ static INTERRUPT_GEN( moobl_interrupt ) moo_objdma(device->machine, state->game_type); // schedule DMA end interrupt (delay shortened to catch up with V-blank) - timer_adjust_oneshot(state->dmaend_timer, attotime::from_usec(MOO_DMADELAY), 0); + state->dmaend_timer->adjust(attotime::from_usec(MOO_DMADELAY)); // trigger V-blank interrupt cpu_set_input_line(device, 5, HOLD_LINE); diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c index 8da95b7aee2..24e5e034156 100644 --- a/src/mame/drivers/mpu4.c +++ b/src/mame/drivers/mpu4.c @@ -717,7 +717,7 @@ static const ptm6840_interface ptm_ic2_intf = /* IC3, lamp data lines + alpha numeric display */ static WRITE8_DEVICE_HANDLER( pia_ic3_porta_w ) { - LOG_IC3(("%s: IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", cpuexec_describe_context(device->machine),data)); + LOG_IC3(("%s: IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", device->machine->describe_context(),data)); if(ic23_active) { @@ -728,7 +728,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic3_porta_w ) static WRITE8_DEVICE_HANDLER( pia_ic3_portb_w ) { - LOG_IC3(("%s: IC3 PIA Port B Set to %2x (lamp strobes 10 - 17)\n", cpuexec_describe_context(device->machine),data)); + LOG_IC3(("%s: IC3 PIA Port B Set to %2x (lamp strobes 10 - 17)\n", device->machine->describe_context(),data)); if(ic23_active) { @@ -739,7 +739,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic3_portb_w ) static WRITE_LINE_DEVICE_HANDLER( pia_ic3_ca2_w ) { - LOG_IC3(("%s: IC3 PIA Write CA2 (alpha data), %02X\n", cpuexec_describe_context(device->machine),state)); + LOG_IC3(("%s: IC3 PIA Write CA2 (alpha data), %02X\n", device->machine->describe_context(),state)); alpha_data_line = state; ROC10937_draw_16seg(0); @@ -748,7 +748,7 @@ static WRITE_LINE_DEVICE_HANDLER( pia_ic3_ca2_w ) static WRITE_LINE_DEVICE_HANDLER( pia_ic3_cb2_w ) { - LOG_IC3(("%s: IC3 PIA Write CB (alpha reset), %02X\n",cpuexec_describe_context(device->machine),state)); + LOG_IC3(("%s: IC3 PIA Write CB (alpha reset), %02X\n",device->machine->describe_context(),state)); if ( state ) ROC10937_reset(0); ROC10937_draw_16seg(0); @@ -829,7 +829,7 @@ static void ic24_setup(void) { ic23_active=1; ic24_output(0); - timer_adjust_oneshot(ic24_timer, attotime::from_double(duration), 0); + ic24_timer->adjust(attotime::from_double(duration)); } } } @@ -923,14 +923,14 @@ static READ8_DEVICE_HANDLER( pia_ic4_portb_r ) if ( lamp_undercurrent ) ic4_input_b |= 0x01; #endif - LOG_IC3(("%s: IC4 PIA Read of Port B %x\n",cpuexec_describe_context(device->machine),ic4_input_b)); + LOG_IC3(("%s: IC4 PIA Read of Port B %x\n",device->machine->describe_context(),ic4_input_b)); return ic4_input_b; } static WRITE_LINE_DEVICE_HANDLER( pia_ic4_ca2_w ) { - LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", cpuexec_describe_context(device->machine),state)); + LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", device->machine->describe_context(),state)); IC23GB = state; ic23_update(); @@ -938,7 +938,7 @@ static WRITE_LINE_DEVICE_HANDLER( pia_ic4_ca2_w ) static WRITE_LINE_DEVICE_HANDLER( pia_ic4_cb2_w ) { - LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", cpuexec_describe_context(device->machine),state)); + LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", device->machine->describe_context(),state)); reel_flag=state; } static const pia6821_interface pia_ic4_intf = @@ -982,7 +982,7 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_r ) aux1_input &= ~0x04; }*/ } - LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",cpuexec_describe_context(device->machine))); + LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine->describe_context())); return input_port_read(device->machine, "AUX1")|aux1_input; } @@ -1071,7 +1071,7 @@ static READ8_DEVICE_HANDLER( pia_ic5_portb_r ) }*/ } - LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",cpuexec_describe_context(device->machine))); + LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",device->machine->describe_context())); coin_lockout_w(device->machine, 0, (pia6821_get_output_b(pia_ic5) & 0x01) ); coin_lockout_w(device->machine, 1, (pia6821_get_output_b(pia_ic5) & 0x02) ); coin_lockout_w(device->machine, 2, (pia6821_get_output_b(pia_ic5) & 0x04) ); @@ -1082,7 +1082,7 @@ static READ8_DEVICE_HANDLER( pia_ic5_portb_r ) static WRITE_LINE_DEVICE_HANDLER( pia_ic5_ca2_w ) { - LOG(("%s: IC5 PIA Write CA2 (Serial Tx) %2x\n",cpuexec_describe_context(device->machine),state)); + LOG(("%s: IC5 PIA Write CA2 (Serial Tx) %2x\n",device->machine->describe_context(),state)); serial_data = state; } @@ -1179,7 +1179,7 @@ static const pia6821_interface pia_ic5_intf = /* IC6, Reel A and B and AY registers (MODs below 4 only) */ static WRITE8_DEVICE_HANDLER( pia_ic6_portb_w ) { - LOG(("%s: IC6 PIA Port B Set to %2x (Reel A and B)\n", cpuexec_describe_context(device->machine),data)); + LOG(("%s: IC6 PIA Port B Set to %2x (Reel A and B)\n", device->machine->describe_context(),data)); if (reel_mux == SEVEN_REEL) { @@ -1209,7 +1209,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic6_portb_w ) static WRITE8_DEVICE_HANDLER( pia_ic6_porta_w ) { - LOG(("%s: IC6 PIA Write A %2x\n", cpuexec_describe_context(device->machine),data)); + LOG(("%s: IC6 PIA Write A %2x\n", device->machine->describe_context(),data)); if (mod_number <4) { ay_data = data; @@ -1220,7 +1220,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic6_porta_w ) static WRITE_LINE_DEVICE_HANDLER( pia_ic6_ca2_w ) { - LOG(("%s: IC6 PIA write CA2 %2x (AY8913 BC1)\n", cpuexec_describe_context(device->machine),state)); + LOG(("%s: IC6 PIA write CA2 %2x (AY8913 BC1)\n", device->machine->describe_context(),state)); if (mod_number <4) { if ( state ) ay8913_address |= 0x01; @@ -1232,7 +1232,7 @@ static WRITE_LINE_DEVICE_HANDLER( pia_ic6_ca2_w ) static WRITE_LINE_DEVICE_HANDLER( pia_ic6_cb2_w ) { - LOG(("%s: IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", cpuexec_describe_context(device->machine),state)); + LOG(("%s: IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", device->machine->describe_context(),state)); if (mod_number <4) { if ( state ) ay8913_address |= 0x02; @@ -1262,7 +1262,7 @@ static const pia6821_interface pia_ic6_intf = /* IC7 Reel C and D, mechanical meters/Reel E and F, input strobe bit A */ static WRITE8_DEVICE_HANDLER( pia_ic7_porta_w ) { - LOG(("%s: IC7 PIA Port A Set to %2x (Reel C and D)\n", cpuexec_describe_context(device->machine),data)); + LOG(("%s: IC7 PIA Port A Set to %2x (Reel C and D)\n", device->machine->describe_context(),data)); if (reel_mux == SEVEN_REEL) { stepper_update(5, data&0x0F); @@ -1338,7 +1338,7 @@ all eight meters are driven from this port, giving the 8 line driver chip static WRITE_LINE_DEVICE_HANDLER( pia_ic7_ca2_w ) { - LOG(("%s: IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", cpuexec_describe_context(device->machine),state)); + LOG(("%s: IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", device->machine->describe_context(),state)); IC23GA = state; ic24_setup(); @@ -1373,7 +1373,7 @@ static READ8_DEVICE_HANDLER( pia_ic8_porta_r ) static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" }; device_t *pia_ic5 = device->machine->device("pia_ic5"); - LOG_IC8(("%s: IC8 PIA Read of Port A (MUX input data)\n", cpuexec_describe_context(device->machine))); + LOG_IC8(("%s: IC8 PIA Read of Port A (MUX input data)\n", device->machine->describe_context())); /* The orange inputs are polled twice as often as the black ones, for reasons of efficiency. This is achieved via connecting every input line to an AND gate, thus allowing two strobes to represent each orange input bank (strobes are active low). */ @@ -1393,7 +1393,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic8_portb_w ) // duart.drive_sensor(data & 0x04, data & 0x01, data & 0x04, data & 0x02); } int i; - LOG_IC8(("%s: IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", cpuexec_describe_context(device->machine),data)); + LOG_IC8(("%s: IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", device->machine->describe_context(),data)); for (i = 0; i < 8; i++) { output_set_indexed_value("triac", i, data & (1 << i)); @@ -1402,7 +1402,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic8_portb_w ) static WRITE_LINE_DEVICE_HANDLER( pia_ic8_ca2_w ) { - LOG_IC8(("%s: IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", cpuexec_describe_context(device->machine), state & 0xFF)); + LOG_IC8(("%s: IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", device->machine->describe_context(), state & 0xFF)); IC23GC = state; ic23_update(); @@ -1411,7 +1411,7 @@ static WRITE_LINE_DEVICE_HANDLER( pia_ic8_ca2_w ) static WRITE_LINE_DEVICE_HANDLER( pia_ic8_cb2_w ) { - LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", cpuexec_describe_context(device->machine), state & 0xFF)); + LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", device->machine->describe_context(), state & 0xFF)); if ( !alpha_clock && (state) ) { @@ -1443,7 +1443,7 @@ static const pia6821_interface pia_ic8_intf = static WRITE8_DEVICE_HANDLER( pia_gb_porta_w ) { device_t *msm6376 = device->machine->device("msm6376"); - LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", cpuexec_describe_context(device->machine),data)); + LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", device->machine->describe_context(),data)); okim6376_w(msm6376, 0, data); } @@ -1451,7 +1451,7 @@ static WRITE8_DEVICE_HANDLER( pia_gb_portb_w ) { int changed = expansion_latch^data; - LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", cpuexec_describe_context(device->machine),data)); + LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", device->machine->describe_context(),data)); expansion_latch = data; @@ -1478,7 +1478,7 @@ static WRITE8_DEVICE_HANDLER( pia_gb_portb_w ) static READ8_DEVICE_HANDLER( pia_gb_portb_r ) { device_t *msm6376 = device->machine->device("msm6376"); - LOG_SS(("%s: GAMEBOARD: PIA Read of Port B\n",cpuexec_describe_context(device->machine))); + LOG_SS(("%s: GAMEBOARD: PIA Read of Port B\n",device->machine->describe_context())); // // b7, 1 = OKI ready, 0 = OKI busy // b5, vol clock @@ -1490,7 +1490,7 @@ static READ8_DEVICE_HANDLER( pia_gb_portb_r ) static WRITE_LINE_DEVICE_HANDLER( pia_gb_ca2_w ) { - LOG_SS(("%s: GAMEBOARD: OKI RESET data = %02X\n", cpuexec_describe_context(device->machine), state)); + LOG_SS(("%s: GAMEBOARD: OKI RESET data = %02X\n", device->machine->describe_context(), state)); // reset line } diff --git a/src/mame/drivers/mpu4drvr.c b/src/mame/drivers/mpu4drvr.c index ab0cc47e2ef..099ae4217b3 100644 --- a/src/mame/drivers/mpu4drvr.c +++ b/src/mame/drivers/mpu4drvr.c @@ -1191,7 +1191,7 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r ) We invert the X and Y data at source due to the use of Schmitt triggers in the interface, which clean up the pulses and flip the active phase.*/ - LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",cpuexec_describe_context(device->machine))); + LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine->describe_context())); static INT8 cur[2]; diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c index ebfcf762630..bee99d10739 100644 --- a/src/mame/drivers/mquake.c +++ b/src/mame/drivers/mquake.c @@ -66,14 +66,14 @@ static WRITE8_DEVICE_HANDLER( mquake_cia_0_porta_w ) static READ8_DEVICE_HANDLER( mquake_cia_0_portb_r ) { /* parallel port */ - logerror("%s:CIA0_portb_r\n", cpuexec_describe_context(device->machine)); + logerror("%s:CIA0_portb_r\n", device->machine->describe_context()); return 0xff; } static WRITE8_DEVICE_HANDLER( mquake_cia_0_portb_w ) { /* parallel port */ - logerror("%s:CIA0_portb_w(%02x)\n", cpuexec_describe_context(device->machine), data); + logerror("%s:CIA0_portb_w(%02x)\n", device->machine->describe_context(), data); } diff --git a/src/mame/drivers/mustache.c b/src/mame/drivers/mustache.c index 515225d5e56..3db0e5c5318 100644 --- a/src/mame/drivers/mustache.c +++ b/src/mame/drivers/mustache.c @@ -177,7 +177,7 @@ static INTERRUPT_GEN( assert_irq ) { mustache_state *state = device->machine->driver_data<mustache_state>(); cpu_set_input_line(device, 0, ASSERT_LINE); - timer_adjust_oneshot(state->clear_irq_timer, downcast<cpu_device *>(device)->cycles_to_attotime(14288), 0); + state->clear_irq_timer->adjust(downcast<cpu_device *>(device)->cycles_to_attotime(14288)); /* Timing here is an educated GUESS, Z80 /INT must stay high so the irq fires no less than TWICE per frame, else game doesn't work right. 6000000 / 56.747 = 105732.4616 cycles per frame, we'll call it A diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c index 260bf1dee06..f58c32a45da 100644 --- a/src/mame/drivers/mw8080bw.c +++ b/src/mame/drivers/mw8080bw.c @@ -852,7 +852,7 @@ static MACHINE_CONFIG_DERIVED( zzzap, mw8080bw_root ) /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") MCFG_CPU_IO_MAP(zzzap_io_map) - MCFG_WATCHDOG_TIME_INIT(attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(RES_M(1), CAP_U(1)))) /* 1.1s */ + MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(RES_M(1), CAP_U(1))) /* 1.1s */ /* add shifter */ MCFG_MB14241_ADD("mb14241") @@ -966,7 +966,7 @@ static MACHINE_CONFIG_DERIVED( maze, mw8080bw_root ) MCFG_CPU_MODIFY("maincpu") MCFG_CPU_IO_MAP(maze_io_map) MCFG_MACHINE_START(maze) - MCFG_WATCHDOG_TIME_INIT(attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(RES_K(270), CAP_U(10)))) /* 2.97s */ + MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10))) /* 2.97s */ /* audio hardware */ MCFG_FRAGMENT_ADD(maze_audio) @@ -1058,7 +1058,7 @@ static MACHINE_CONFIG_DERIVED( boothill, mw8080bw_root ) MCFG_CPU_MODIFY("maincpu") MCFG_CPU_IO_MAP(boothill_io_map) MCFG_MACHINE_START(boothill) - MCFG_WATCHDOG_TIME_INIT(attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(RES_K(270), CAP_U(10)))) /* 2.97s */ + MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10))) /* 2.97s */ /* add shifter */ MCFG_MB14241_ADD("mb14241") @@ -1164,7 +1164,7 @@ static MACHINE_CONFIG_DERIVED( checkmat, mw8080bw_root ) /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") MCFG_CPU_IO_MAP(checkmat_io_map) - MCFG_WATCHDOG_TIME_INIT(attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(RES_K(270), CAP_U(10)))) /* 2.97s */ + MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10))) /* 2.97s */ /* audio hardware */ MCFG_FRAGMENT_ADD(checkmat_audio) diff --git a/src/mame/drivers/namcofl.c b/src/mame/drivers/namcofl.c index dc4f344b2ce..24ee34881e6 100644 --- a/src/mame/drivers/namcofl.c +++ b/src/mame/drivers/namcofl.c @@ -216,7 +216,7 @@ static WRITE32_HANDLER( namcofl_paletteram_w ) UINT16 v = space->machine->generic.paletteram.u32[offset] >> 16; UINT16 triggerscanline=(((v>>8)&0xff)|((v&0xff)<<8))-(32+1); - timer_adjust_oneshot(raster_interrupt_timer, space->machine->primary_screen->time_until_pos(triggerscanline), 0); + raster_interrupt_timer->adjust(space->machine->primary_screen->time_until_pos(triggerscanline)); } } @@ -550,7 +550,7 @@ static TIMER_CALLBACK( raster_interrupt_callback ) { machine->primary_screen->update_partial(machine->primary_screen->vpos()); cputag_set_input_line(machine, "maincpu", I960_IRQ1, ASSERT_LINE); - timer_adjust_oneshot(raster_interrupt_timer, machine->primary_screen->frame_period(), 0); + raster_interrupt_timer->adjust(machine->primary_screen->frame_period()); } static INTERRUPT_GEN( mcu_interrupt ) diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c index 31c1b8af8a9..b0547f0cb77 100644 --- a/src/mame/drivers/namcona1.c +++ b/src/mame/drivers/namcona1.c @@ -641,7 +641,7 @@ static void namcona1_blit( running_machine *machine ) (void)src0; /* logerror( "%s: blt(%08x,%08x,numBytes=%04x);src=%04x %04x %04x; dst=%04x %04x %04x; gfx=%04x\n", - cpuexec_describe_context(machine), + machine->describe_context(), dst_baseaddr,src_baseaddr,num_bytes, src0,src1,src2, dst0,dst1,dst2, diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c index eea0a722747..f663af6dd95 100644 --- a/src/mame/drivers/namcos11.c +++ b/src/mame/drivers/namcos11.c @@ -296,7 +296,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 ); } } diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c index 578516407c2..8e6b6dd95fc 100644 --- a/src/mame/drivers/namcos12.c +++ b/src/mame/drivers/namcos12.c @@ -1064,7 +1064,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 ); } } diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c index 1cccb0c8505..3a095102929 100644 --- a/src/mame/drivers/namcos21.c +++ b/src/mame/drivers/namcos21.c @@ -575,7 +575,7 @@ ReadWordFromSlaveInput( address_space *space ) { mpDspState->slaveBytesAdvertised--; } - if (ENABLE_LOGGING) logerror( "%s:-%04x(0x%04x)\n", cpuexec_describe_context(space->machine), data, mpDspState->slaveBytesAvailable ); + if (ENABLE_LOGGING) logerror( "%s:-%04x(0x%04x)\n", space->machine->describe_context(), data, mpDspState->slaveBytesAvailable ); } return data; } /* ReadWordFromSlaveInput */ diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c index 158dcaab1fa..b8e9b4c48c2 100644 --- a/src/mame/drivers/namcos23.c +++ b/src/mame/drivers/namcos23.c @@ -1330,7 +1330,7 @@ static TIMER_CALLBACK( c361_timer_cb ) if (c361_scanline != 511) { cputag_set_input_line(machine, "maincpu", MIPS3_IRQ1, ASSERT_LINE); - timer_adjust_oneshot(c361_timer, attotime::never, 0); + c361_timer->adjust(attotime::never); } } @@ -1350,11 +1350,11 @@ static WRITE16_HANDLER(s23_c361_w) if (data == 0x1ff) { cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ1, CLEAR_LINE); - timer_adjust_oneshot(c361_timer, attotime::never, 0); + c361_timer->adjust(attotime::never); } else { - timer_adjust_oneshot(c361_timer, space->machine->primary_screen->time_until_pos(c361_scanline), 0); + c361_timer->adjust(space->machine->primary_screen->time_until_pos(c361_scanline)); } break; @@ -1808,7 +1808,7 @@ static WRITE32_HANDLER( p3d_w) return; case 0x17: cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ1, CLEAR_LINE); - timer_adjust_oneshot(c361_timer, attotime::never, 0); + c361_timer->adjust(attotime::never); return; } logerror("p3d_w %02x, %08x @ %08x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31)); @@ -2041,7 +2041,7 @@ static INTERRUPT_GEN(s23_interrupt) static MACHINE_START( s23 ) { c361_timer = machine->scheduler().timer_alloc(FUNC(c361_timer_cb)); - timer_adjust_oneshot(c361_timer, attotime::never, 0); + c361_timer->adjust(attotime::never); } static ADDRESS_MAP_START( gorgon_map, ADDRESS_SPACE_PROGRAM, 32 ) diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index 8e96de6467e..323675507b6 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -1652,7 +1652,7 @@ INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_m // non 32-bit accesses have not yet been seen here, we need to know when they are if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff))) { - mame_printf_verbose("%s:Wrong mask!\n", cpuexec_describe_context(machine)); + mame_printf_verbose("%s:Wrong mask!\n", machine->describe_context()); // debugger_break(machine); } diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c index 2d78927ebab..36188dec9ed 100644 --- a/src/mame/drivers/nbmj9195.c +++ b/src/mame/drivers/nbmj9195.c @@ -238,7 +238,7 @@ static READ8_HANDLER( tmpz84c011_pio_r ) break; default: - logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", cpuexec_describe_context(space->machine), offset); + logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine->describe_context(), offset); portdata = 0xff; break; } @@ -323,7 +323,7 @@ static READ8_HANDLER( tmpz84c011_pio_r ) break; default: - logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", cpuexec_describe_context(space->machine), offset); + logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine->describe_context(), offset); portdata = 0xff; break; } @@ -371,7 +371,7 @@ static WRITE8_HANDLER( tmpz84c011_pio_w ) break; default: - logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", cpuexec_describe_context(space->machine), offset, data); + logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine->describe_context(), offset, data); break; } } @@ -409,7 +409,7 @@ static WRITE8_HANDLER( tmpz84c011_pio_w ) break; default: - logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", cpuexec_describe_context(space->machine), offset, data); + logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine->describe_context(), offset, data); break; } } diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c index 7861e4fbc86..aef773d3a6b 100644 --- a/src/mame/drivers/neogeo.c +++ b/src/mame/drivers/neogeo.c @@ -248,7 +248,7 @@ static void adjust_display_position_interrupt_timer( running_machine *machine ) attotime period = attotime::from_hz(NEOGEO_PIXEL_CLOCK) * (state->display_counter + 1); if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer current y: %02x current x: %02x target y: %x target x: %x\n", machine->primary_screen->vpos(), machine->primary_screen->hpos(), (state->display_counter + 1) / NEOGEO_HTOTAL, (state->display_counter + 1) % NEOGEO_HTOTAL); - timer_adjust_oneshot(state->display_position_interrupt_timer, period, 0); + state->display_position_interrupt_timer->adjust(period); } } @@ -344,7 +344,7 @@ static TIMER_CALLBACK( display_position_vblank_callback ) } /* set timer for next screen */ - timer_adjust_oneshot(state->display_position_vblank_timer, machine->primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0); + state->display_position_vblank_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS)); } @@ -362,7 +362,7 @@ static TIMER_CALLBACK( vblank_interrupt_callback ) update_interrupts(machine); /* set timer for next screen */ - timer_adjust_oneshot(state->vblank_interrupt_timer, machine->primary_screen->time_until_pos(NEOGEO_VBSTART), 0); + state->vblank_interrupt_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VBSTART)); } @@ -378,8 +378,8 @@ static void create_interrupt_timers( running_machine *machine ) static void start_interrupt_timers( running_machine *machine ) { neogeo_state *state = machine->driver_data<neogeo_state>(); - timer_adjust_oneshot(state->vblank_interrupt_timer, machine->primary_screen->time_until_pos(NEOGEO_VBSTART), 0); - timer_adjust_oneshot(state->display_position_vblank_timer, machine->primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0); + state->vblank_interrupt_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VBSTART)); + state->display_position_vblank_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS)); } @@ -646,7 +646,7 @@ static WRITE16_HANDLER( audio_command_w ) audio_cpu_assert_nmi(space->machine); /* boost the interleave to let the audio CPU read the command */ - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(50)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", cpu_get_pc(space->cpu), data, mem_mask); } @@ -1023,7 +1023,7 @@ static void set_output_latch( running_machine *machine, UINT8 data ) state->led2_value = ~state->output_data; if (falling_bits & 0xc7) - logerror("%s Unmaped LED write. Data: %x\n", cpuexec_describe_context(machine), falling_bits); + logerror("%s Unmaped LED write. Data: %x\n", machine->describe_context(), falling_bits); state->output_latch = data; diff --git a/src/mame/drivers/neoprint.c b/src/mame/drivers/neoprint.c index 7a3ec3d1fe8..5f0db0077d8 100644 --- a/src/mame/drivers/neoprint.c +++ b/src/mame/drivers/neoprint.c @@ -141,7 +141,7 @@ static WRITE16_HANDLER( audio_command_w ) audio_cpu_assert_nmi(space->machine); /* boost the interleave to let the audio CPU read the command */ - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(50)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); //if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", cpu_get_pc(space->cpu), data, mem_mask); } diff --git a/src/mame/drivers/nitedrvr.c b/src/mame/drivers/nitedrvr.c index c7ad43aa396..688b7d06782 100644 --- a/src/mame/drivers/nitedrvr.c +++ b/src/mame/drivers/nitedrvr.c @@ -145,7 +145,7 @@ static MACHINE_CONFIG_START( nitedrvr, nitedrvr_state ) MCFG_MACHINE_START(nitedrvr) MCFG_MACHINE_RESET(nitedrvr) - MCFG_TIMER_ADD_PERIODIC("crash_timer", nitedrvr_crash_toggle_callback, attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(RES_K(180), 330, CAP_U(1)))) + MCFG_TIMER_ADD_PERIODIC("crash_timer", nitedrvr_crash_toggle_callback, PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1))) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c index 3247ce02f27..cd5fea2d8bc 100644 --- a/src/mame/drivers/niyanpai.c +++ b/src/mame/drivers/niyanpai.c @@ -107,7 +107,7 @@ static READ8_HANDLER( tmpz84c011_pio_r ) break; default: - logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", cpuexec_describe_context(space->machine), offset); + logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine->describe_context(), offset); portdata = 0xff; break; } @@ -135,7 +135,7 @@ static WRITE8_HANDLER( tmpz84c011_pio_w) break; default: - logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", cpuexec_describe_context(space->machine), offset, data); + logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine->describe_context(), offset, data); break; } } diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c index 181086f65cb..786552fef4d 100644 --- a/src/mame/drivers/nmk16.c +++ b/src/mame/drivers/nmk16.c @@ -4730,7 +4730,7 @@ static WRITE8_DEVICE_HANDLER( twinactn_oki_bank_w ) downcast<okim6295_device *>(device)->set_bank_base((data & 3) * 0x40000); if (data & (~3)) - logerror("%s: invalid oki bank %02x\n", cpuexec_describe_context(device->machine), data); + logerror("%s: invalid oki bank %02x\n", device->machine->describe_context(), data); // logerror("%04x: oki bank %02x\n", cpu_get_pc(space->cpu), data); } diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c index 21d75ab24fd..ee2b84fb95b 100644 --- a/src/mame/drivers/othello.c +++ b/src/mame/drivers/othello.c @@ -145,7 +145,7 @@ static WRITE8_HANDLER( unk_8a_w ) state->n7751_command = (data & 0x07); cpu_set_input_line(state->n7751, 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE); //cpu_set_input_line(state->n7751, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(100)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); */ logerror("8a -> %x\n", data); diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c index cc0830a1083..f2400501843 100644 --- a/src/mame/drivers/paradise.c +++ b/src/mame/drivers/paradise.c @@ -58,7 +58,7 @@ static WRITE8_HANDLER( paradise_rombank_w ) static WRITE8_DEVICE_HANDLER( paradise_okibank_w ) { if (data & ~0x02) - logerror("%s: unknown oki bank bits %02X\n", cpuexec_describe_context(device->machine), data); + logerror("%s: unknown oki bank bits %02X\n", device->machine->describe_context(), data); downcast<okim6295_device *>(device)->set_bank_base((data & 0x02) ? 0x40000 : 0); } diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c index 4727b2c7f42..7411a7ae22e 100644 --- a/src/mame/drivers/pgm.c +++ b/src/mame/drivers/pgm.c @@ -390,7 +390,7 @@ static WRITE16_HANDLER( arm7_latch_68k_w ) COMBINE_DATA(&state->kov2_latchdata_68k_w); generic_pulse_irq_line(state->prot, ARM7_FIRQ_LINE); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(200)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(200)); cpu_spinuntil_time(space->cpu, state->prot->cycles_to_attotime(200)); // give the arm time to respond (just boosting the interleave doesn't help) } @@ -930,7 +930,7 @@ static WRITE16_HANDLER( svg_68k_nmi_w ) { pgm_state *state = space->machine->driver_data<pgm_state>(); generic_pulse_irq_line(state->prot, ARM7_FIRQ_LINE); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(200)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(200)); cpu_spinuntil_time(space->cpu, state->prot->cycles_to_attotime(200)); // give the arm time to respond (just boosting the interleave doesn't help) } diff --git a/src/mame/drivers/pipeline.c b/src/mame/drivers/pipeline.c index e7d34087b51..6f8b49fbc1f 100644 --- a/src/mame/drivers/pipeline.c +++ b/src/mame/drivers/pipeline.c @@ -162,7 +162,7 @@ static TIMER_CALLBACK( protection_deferred_w ) static WRITE8_DEVICE_HANDLER(protection_w) { device->machine->scheduler().synchronize(FUNC(protection_deferred_w), data); - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(100)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } static ADDRESS_MAP_START( cpu0_mem, ADDRESS_SPACE_PROGRAM, 8 ) diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c index 4d7e2391f9e..1f696b28019 100644 --- a/src/mame/drivers/pirates.c +++ b/src/mame/drivers/pirates.c @@ -132,7 +132,7 @@ static CUSTOM_INPUT( prot_r ) // offs_t pc; int bit; -// logerror("%s: IN1_r\n",cpuexec_describe_context(field->port->machine)); +// logerror("%s: IN1_r\n",field->port->machine->describe_context()); #if 0 /* Pirates protection workaround. It more complicated than this... see code at diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c index 79f1afd390c..934fd74b5c5 100644 --- a/src/mame/drivers/psikyo.c +++ b/src/mame/drivers/psikyo.c @@ -89,7 +89,7 @@ static CUSTOM_INPUT( z80_nmi_r ) /* main CPU might be waiting for sound CPU to finish NMI, so set a timer to give sound CPU a chance to run */ field->port->machine->scheduler().synchronize(); -// logerror("%s - Read coin port during Z80 NMI\n", cpuexec_describe_context(machine)); +// logerror("%s - Read coin port during Z80 NMI\n", machine->describe_context()); } return ret; diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c index 30dca7eb315..343e20e51d8 100644 --- a/src/mame/drivers/r2dtank.c +++ b/src/mame/drivers/r2dtank.c @@ -142,7 +142,7 @@ static WRITE8_DEVICE_HANDLER( AY8910_select_w ) D5-D7 - not used */ AY8910_selected = data; -if (LOG_AUDIO_COMM) logerror("%s: CPU#1 AY8910_select_w: %x\n", cpuexec_describe_context(device->machine), data); +if (LOG_AUDIO_COMM) logerror("%s: CPU#1 AY8910_select_w: %x\n", device->machine->describe_context(), data); } diff --git a/src/mame/drivers/runaway.c b/src/mame/drivers/runaway.c index a896a4a1b82..e65d5cd55a8 100644 --- a/src/mame/drivers/runaway.c +++ b/src/mame/drivers/runaway.c @@ -30,7 +30,7 @@ static TIMER_CALLBACK( interrupt_callback ) if (scanline >= 263) scanline = 16; - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } static MACHINE_START( runaway ) @@ -42,7 +42,7 @@ static MACHINE_START( runaway ) static MACHINE_RESET( runaway ) { runaway_state *state = machine->driver_data<runaway_state>(); - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(16), 16); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(16), 16); } diff --git a/src/mame/drivers/sbrkout.c b/src/mame/drivers/sbrkout.c index 05570b67b8d..acfe158b95c 100644 --- a/src/mame/drivers/sbrkout.c +++ b/src/mame/drivers/sbrkout.c @@ -100,7 +100,7 @@ static MACHINE_START( sbrkout ) static MACHINE_RESET( sbrkout ) { sbrkout_state *state = machine->driver_data<sbrkout_state>(); - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(0), 0); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0)); } @@ -131,14 +131,14 @@ static TIMER_CALLBACK( scanline_callback ) if (scanline == machine->primary_screen->visible_area().max_y + 1) { UINT8 potvalue = input_port_read(machine, "PADDLE"); - timer_adjust_oneshot(state->pot_timer, machine->primary_screen->time_until_pos(56 + (potvalue / 2), (potvalue % 2) * 128), 0); + state->pot_timer->adjust(machine->primary_screen->time_until_pos(56 + (potvalue / 2), (potvalue % 2) * 128)); } /* call us back in 4 scanlines */ scanline += 4; if (scanline >= machine->primary_screen->height()) scanline = 0; - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c index 617a9f93259..c634ebadea7 100644 --- a/src/mame/drivers/seattle.c +++ b/src/mame/drivers/seattle.c @@ -920,7 +920,7 @@ static TIMER_CALLBACK( galileo_timer_callback ) /* if we're a timer, adjust the timer to fire again */ if (galileo.reg[GREG_TIMER_CONTROL] & (2 << (2 * which))) - timer_adjust_oneshot(timer->timer, TIMER_PERIOD * timer->count, which); + timer->timer->adjust(TIMER_PERIOD * timer->count, which); else timer->active = timer->count = 0; @@ -1100,7 +1100,7 @@ static READ32_HANDLER( galileo_r ) result = timer->count; if (timer->active) { - UINT32 elapsed = (timer_timeelapsed(timer->timer) * SYSTEM_CLOCK).as_double(); + UINT32 elapsed = (timer->timer->elapsed() * SYSTEM_CLOCK).as_double(); result = (result > elapsed) ? (result - elapsed) : 0; } @@ -1231,16 +1231,16 @@ static WRITE32_HANDLER( galileo_w ) if (which != 0) timer->count &= 0xffffff; } - timer_adjust_oneshot(timer->timer, TIMER_PERIOD * timer->count, which); + timer->timer->adjust(TIMER_PERIOD * timer->count, which); if (LOG_TIMERS) logerror("Adjusted timer to fire in %f secs\n", (TIMER_PERIOD * timer->count).as_double()); } else if (timer->active && !(data & mask)) { - UINT32 elapsed = (timer_timeelapsed(timer->timer) * SYSTEM_CLOCK).as_double(); + UINT32 elapsed = (timer->timer->elapsed() * SYSTEM_CLOCK).as_double(); timer->active = 0; timer->count = (timer->count > elapsed) ? (timer->count - elapsed) : 0; - timer_adjust_oneshot(timer->timer, attotime::never, which); + timer->timer->adjust(attotime::never, which); if (LOG_TIMERS) logerror("Disabled timer\n"); } @@ -1380,7 +1380,7 @@ static void voodoo_stall(device_t *device, int stall) /* resume CPU execution */ if (LOG_DMA) logerror("Resuming CPU on voodoo\n"); - cpuexec_trigger(device->machine, 45678); + device->machine->scheduler().trigger(45678); } } } diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c index cc4605b2d99..809b275fd32 100644 --- a/src/mame/drivers/segag80r.c +++ b/src/mame/drivers/segag80r.c @@ -298,7 +298,7 @@ static WRITE8_DEVICE_HANDLER( sindbadm_soundport_w ) address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM); soundlatch_w(space, 0, data); cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(50)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); } diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c index 7841766e840..be67f5fdea7 100644 --- a/src/mame/drivers/segaorun.c +++ b/src/mame/drivers/segaorun.c @@ -447,7 +447,7 @@ static void update_main_irqs(running_machine *machine) cpu_set_input_line(state->maincpu, 6, state->vblank_irq_state && state->irq2_state ? ASSERT_LINE : CLEAR_LINE); if (state->vblank_irq_state || state->irq2_state) - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(100)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c index ffd8bd32675..d07f77210f0 100644 --- a/src/mame/drivers/segas16a.c +++ b/src/mame/drivers/segas16a.c @@ -473,7 +473,7 @@ static WRITE8_DEVICE_HANDLER( n7751_control_w ) cpu_set_input_line(state->n7751, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); cpu_set_input_line(state->n7751, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(100)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } @@ -887,7 +887,7 @@ static WRITE8_HANDLER( mcu_control_w ) segaic16_set_display_enable(space->machine, 1); if ((state->mcu_control ^ data) & 0x40) - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(10)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); state->mcu_control = data; } @@ -991,7 +991,7 @@ static INTERRUPT_GEN( mcu_irq_assert ) cpu_set_input_line(device, MCS51_INT0_LINE, CLEAR_LINE); /* boost interleave to ensure that the MCU can break the M68000 out of a STOP */ - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(100)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c index af5e5f6a742..3777ec62c01 100644 --- a/src/mame/drivers/segas16b.c +++ b/src/mame/drivers/segas16b.c @@ -1110,7 +1110,7 @@ static TIMER_CALLBACK( suspend_i8751 ) static TIMER_CALLBACK( boost_interleave ) { - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_msec(10)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_msec(10)); } diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c index ea30491e64a..991814a5bfc 100644 --- a/src/mame/drivers/segas18.c +++ b/src/mame/drivers/segas18.c @@ -205,7 +205,7 @@ static void system18_generic_init(running_machine *machine, int _rom_board) static TIMER_CALLBACK( boost_interleave ) { - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_msec(10)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_msec(10)); } diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c index 12210d77e97..34c26947811 100644 --- a/src/mame/drivers/segaxbd.c +++ b/src/mame/drivers/segaxbd.c @@ -313,7 +313,7 @@ static void update_main_irqs(running_machine *machine) if (irq) { cpu_set_input_line(state->maincpu, irq, ASSERT_LINE); - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(100)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } } @@ -418,7 +418,7 @@ static void xboard_reset(device_t *device) segas1x_state *state = device->machine->driver_data<segas1x_state>(); cpu_set_input_line(state->subcpu, INPUT_LINE_RESET, PULSE_LINE); - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(100)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } @@ -678,7 +678,7 @@ static WRITE16_HANDLER( loffire_sync0_w ) segas1x_state *state = space->machine->driver_data<segas1x_state>(); COMBINE_DATA(&state->loffire_sync[offset]); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(10)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); } diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index 4fcbb64c5f1..c2cb6fd06d0 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -96,7 +96,7 @@ static void update_main_irqs(running_machine *machine) cpu_set_input_line(state->suby, 6, state->timer_irq_state && state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE); if (state->timer_irq_state || state->vblank_irq_state) - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(50)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); } diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index 5e9ce52b81b..36717254265 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -1334,9 +1334,9 @@ static void uPD71054_update_timer( running_machine *machine, device_t *cpu, int if( max != 0 ) { attotime period = attotime::from_hz(cputag_get_clock(machine, "maincpu")) * (16 * max); - timer_adjust_oneshot( uPD71054->timer[no], period, no ); + uPD71054->timer[no]->adjust( period, no ); } else { - timer_adjust_oneshot( uPD71054->timer[no], attotime::never, no); + uPD71054->timer[no]->adjust( attotime::never, no); logerror( "CPU #0 PC %06X: uPD71054 error, timer %d duration is 0\n", (cpu != NULL) ? cpu_get_pc(cpu) : -1, no ); } diff --git a/src/mame/drivers/sigmab98.c b/src/mame/drivers/sigmab98.c index 0bc5397c0b1..e2d6176611a 100644 --- a/src/mame/drivers/sigmab98.c +++ b/src/mame/drivers/sigmab98.c @@ -180,13 +180,13 @@ static WRITE8_HANDLER( regs_w ) case 0x1f: rombank = data; if (data >= 0x18) - logerror("%s: unknown rom bank = %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: unknown rom bank = %02x\n", space->machine->describe_context(), data); else memory_set_bank(space->machine, "rombank", data); break; default: - logerror("%s: unknown reg written: %02x = %02x\n", cpuexec_describe_context(space->machine), reg, data); + logerror("%s: unknown reg written: %02x = %02x\n", space->machine->describe_context(), reg, data); } } static READ8_HANDLER( regs_r ) @@ -200,7 +200,7 @@ static READ8_HANDLER( regs_r ) return rombank; default: - logerror("%s: unknown reg read: %02x\n", cpuexec_describe_context(space->machine), reg); + logerror("%s: unknown reg read: %02x\n", space->machine->describe_context(), reg); return 0x00; } } @@ -227,12 +227,12 @@ static WRITE8_HANDLER( regs2_w ) memory_set_bank(space->machine, "rambank", 1); break; default: - logerror("%s: unknown ram bank = %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: unknown ram bank = %02x\n", space->machine->describe_context(), data); } break; default: - logerror("%s: unknown reg2 written: %02x = %02x\n", cpuexec_describe_context(space->machine), reg2, data); + logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine->describe_context(), reg2, data); } } static READ8_HANDLER( regs2_r ) @@ -246,7 +246,7 @@ static READ8_HANDLER( regs2_r ) return rambank; default: - logerror("%s: unknown reg2 read: %02x\n", cpuexec_describe_context(space->machine), reg2); + logerror("%s: unknown reg2 read: %02x\n", space->machine->describe_context(), reg2); return 0x00; } } diff --git a/src/mame/drivers/spacefb.c b/src/mame/drivers/spacefb.c index c6035b5cfda..d5f02307ceb 100644 --- a/src/mame/drivers/spacefb.c +++ b/src/mame/drivers/spacefb.c @@ -141,7 +141,7 @@ static TIMER_CALLBACK( interrupt_callback ) else next_vpos = SPACEFB_INT_TRIGGER_COUNT_1; - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(next_vpos), 0); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(next_vpos)); } @@ -153,7 +153,7 @@ static void create_interrupt_timer(running_machine *machine) static void start_interrupt_timer(running_machine *machine) { - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1), 0); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1)); } diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c index 2caf82cca3b..20711875820 100644 --- a/src/mame/drivers/ssfindo.c +++ b/src/mame/drivers/ssfindo.c @@ -266,9 +266,9 @@ static void PS7500_startTimer0(void) int val=((PS7500_IO[T0low]&0xff)|((PS7500_IO[T0high]&0xff)<<8))>>1; if(val==0) - timer_adjust_oneshot(PS7500timer0, attotime::never, 0); + PS7500timer0->adjust(attotime::never); else - timer_adjust_periodic(PS7500timer0, attotime::from_usec(val ), 0, attotime::from_usec(val )); + PS7500timer0->adjust(attotime::from_usec(val ), 0, attotime::from_usec(val )); } static TIMER_CALLBACK( PS7500_Timer1_callback ) @@ -284,9 +284,9 @@ static void PS7500_startTimer1(void) { int val=((PS7500_IO[T1low]&0xff)|((PS7500_IO[T1high]&0xff)<<8))>>1; if(val==0) - timer_adjust_oneshot(PS7500timer1, attotime::never, 0); + PS7500timer1->adjust(attotime::never); else - timer_adjust_periodic(PS7500timer1, attotime::from_usec(val ), 0, attotime::from_usec(val )); + PS7500timer1->adjust(attotime::from_usec(val ), 0, attotime::from_usec(val )); } static INTERRUPT_GEN( ssfindo_interrupt ) @@ -303,8 +303,8 @@ static void PS7500_reset(void) PS7500_IO[IOCR] = 0x3f; PS7500_IO[VIDCR] = 0; - timer_adjust_oneshot( PS7500timer0, attotime::never, 0); - timer_adjust_oneshot( PS7500timer1, attotime::never, 0); + PS7500timer0->adjust( attotime::never); + PS7500timer1->adjust( attotime::never); } static READ32_HANDLER(PS7500_IO_r) diff --git a/src/mame/drivers/sslam.c b/src/mame/drivers/sslam.c index 2be67118333..f40fa4d926f 100644 --- a/src/mame/drivers/sslam.c +++ b/src/mame/drivers/sslam.c @@ -238,7 +238,7 @@ static TIMER_CALLBACK( music_playback ) state->track = 0; state->melody = 0; state->bar = 0; - timer_enable(state->music_timer,0); + state->music_timer->enable(false); } if (pattern) { logerror("Changing bar in music track to pattern %02x\n",pattern); @@ -270,7 +270,7 @@ static void sslam_play(device_t *device, int track, int data) oki->write_command(0x40); oki->write_command((0x80 | data)); oki->write_command(0x81); - timer_adjust_periodic(state->music_timer, attotime::from_msec(4), 0, attotime::from_hz(250)); /* 250Hz for smooth sequencing */ + state->music_timer->adjust(attotime::from_msec(4), 0, attotime::from_hz(250)); /* 250Hz for smooth sequencing */ } } else { @@ -290,7 +290,7 @@ static void sslam_play(device_t *device, int track, int data) } else { /* use above 0x80 to turn off channels */ if (track) { - timer_enable(state->music_timer,0); + state->music_timer->enable(false); state->track = 0; state->melody = 0; state->bar = 0; @@ -306,7 +306,7 @@ static WRITE16_DEVICE_HANDLER( sslam_snd_w ) { sslam_state *state = device->machine->driver_data<sslam_state>(); - logerror("%s Writing %04x to Sound CPU\n",cpuexec_describe_context(device->machine),data); + logerror("%s Writing %04x to Sound CPU\n",device->machine->describe_context(),data); if (data >= 0x40) { if (data == 0xfe) { /* This should reset the sound MCU and stop audio playback, but here, it */ diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c index 309745031c1..76f0db07bcd 100644 --- a/src/mame/drivers/ssv.c +++ b/src/mame/drivers/ssv.c @@ -471,7 +471,7 @@ static WRITE16_DEVICE_HANDLER( gdfs_eeprom_w ) ssv_state *state = device->machine->driver_data<ssv_state>(); if (data & ~0x7b00) - logerror("%s - Unknown EEPROM bit written %04X\n",cpuexec_describe_context(device->machine),data); + logerror("%s - Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data); if ( ACCESSING_BITS_8_15 ) { diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c index 8e62555f92c..be4ef97124b 100644 --- a/src/mame/drivers/statriv2.c +++ b/src/mame/drivers/statriv2.c @@ -1109,13 +1109,13 @@ static READ8_HANDLER( laserdisc_io_r ) UINT8 result = 0x00; if (offset == 1) result = 0x18; - mame_printf_debug("%s:ld read ($%02X) = %02X\n", cpuexec_describe_context(space->machine), 0x28 + offset, result); + mame_printf_debug("%s:ld read ($%02X) = %02X\n", space->machine->describe_context(), 0x28 + offset, result); return result; } static WRITE8_HANDLER( laserdisc_io_w ) { - mame_printf_debug("%s:ld write ($%02X) = %02X\n", cpuexec_describe_context(space->machine), 0x28 + offset, data); + mame_printf_debug("%s:ld write ($%02X) = %02X\n", space->machine->describe_context(), 0x28 + offset, data); } static DRIVER_INIT( laserdisc ) diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c index 6742c83ab67..d42b24d3e80 100644 --- a/src/mame/drivers/stv.c +++ b/src/mame/drivers/stv.c @@ -587,7 +587,7 @@ static void stv_SMPC_w8 (address_space *space, int offset, UINT8 data) if(LOG_SMPC) logerror ("SMPC: Slave OFF\n"); smpc_ram[0x5f]=0x03; stv_enable_slave_sh2 = 0; - cpuexec_trigger(space->machine, 1000); + space->machine->scheduler().trigger(1000); cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, ASSERT_LINE); break; case 0x06: @@ -1969,15 +1969,15 @@ static READ32_HANDLER( stv_sh2_soundram_r ) static WRITE32_HANDLER( minit_w ) { logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data); - cpuexec_boost_interleave(space->machine, minit_boost_timeslice, attotime::from_usec(minit_boost)); - cpuexec_trigger(space->machine, 1000); + space->machine->scheduler().boost_interleave(minit_boost_timeslice, attotime::from_usec(minit_boost)); + space->machine->scheduler().trigger(1000); sh2_set_frt_input(space->machine->device("slave"), PULSE_LINE); } static WRITE32_HANDLER( sinit_w ) { logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data); - cpuexec_boost_interleave(space->machine, sinit_boost_timeslice, attotime::from_usec(sinit_boost)); + space->machine->scheduler().boost_interleave(sinit_boost_timeslice, attotime::from_usec(sinit_boost)); sh2_set_frt_input(space->machine->device("maincpu"), PULSE_LINE); } @@ -2848,7 +2848,7 @@ static MACHINE_RESET( stv ) vblank_out_timer->adjust(machine->primary_screen->time_until_pos(0)); scan_timer->adjust(machine->primary_screen->time_until_pos(224, 352)); - timer_adjust_periodic(stv_rtc_timer, attotime::zero, 0, attotime::from_seconds(1)); + stv_rtc_timer->adjust(attotime::zero, 0, attotime::from_seconds(1)); } diff --git a/src/mame/drivers/subsino2.c b/src/mame/drivers/subsino2.c index 54307ca8db5..a80a29997dd 100644 --- a/src/mame/drivers/subsino2.c +++ b/src/mame/drivers/subsino2.c @@ -312,7 +312,7 @@ static WRITE8_HANDLER( ss9601_tilesize_w ) sizes[0] = TILE_8x8; sizes[1] = TILE_8x8; - logerror("%s: warning, unknown tilesize = %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: warning, unknown tilesize = %02x\n", space->machine->describe_context(), data); popmessage("UNKNOWN TILESIZE %02X", data); break; } @@ -935,7 +935,7 @@ static WRITE8_HANDLER( mtrain_tilesize_w ) sizes[0] = TILE_8x8; sizes[1] = TILE_8x8; - logerror("%s: warning, unknown tilesize = %02x\n", cpuexec_describe_context(space->machine), data); + logerror("%s: warning, unknown tilesize = %02x\n", space->machine->describe_context(), data); popmessage("UNKNOWN TILESIZE %02X", data); break; } diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c index 67499629696..c9766e56ef8 100644 --- a/src/mame/drivers/superqix.c +++ b/src/mame/drivers/superqix.c @@ -385,7 +385,7 @@ logerror("Z80 sends command %02x\n",param); state->from_z80 = param; state->from_mcu_pending = 0; cputag_set_input_line(machine, "mcu", 0, HOLD_LINE); - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(200)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(200)); } static TIMER_CALLBACK( delayed_mcu_z80_w ) diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c index b339fb01a8d..7384f49e132 100644 --- a/src/mame/drivers/system1.c +++ b/src/mame/drivers/system1.c @@ -514,7 +514,7 @@ static WRITE8_HANDLER( soundport_w ) { /* boost interleave when communicating with the sound CPU */ soundlatch_w(space, 0, data); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(100)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } @@ -598,7 +598,7 @@ static INTERRUPT_GEN( mcu_irq_assert ) cpu_set_input_line(device, MCS51_INT0_LINE, CLEAR_LINE); /* boost interleave to ensure that the MCU can break the Z80 out of a HALT */ - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(10)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); } @@ -655,7 +655,7 @@ static WRITE8_HANDLER( nob_maincpu_latch_w ) { nob_maincpu_latch = data; cputag_set_input_line(space->machine, "mcu", MCS51_INT0_LINE, ASSERT_LINE); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(100)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c index a0bc6578dfe..b9e1d6ab37b 100644 --- a/src/mame/drivers/taito_l.c +++ b/src/mame/drivers/taito_l.c @@ -96,7 +96,7 @@ static void palette_notifier(running_machine *machine, int addr) if (addr > 0x200) { - logerror("%s:Large palette ? %03x\n", cpuexec_describe_context(machine), addr); + logerror("%s:Large palette ? %03x\n", machine->describe_context(), addr); } else { diff --git a/src/mame/drivers/taitogn.c b/src/mame/drivers/taitogn.c index 2cc15ab5ef1..6d374cfa707 100644 --- a/src/mame/drivers/taitogn.c +++ b/src/mame/drivers/taitogn.c @@ -362,7 +362,7 @@ public: static void rf5c296_reg_w(ATTR_UNUSED running_machine *machine, UINT8 reg, UINT8 data) { taitogn_state *state = machine->driver_data<taitogn_state>(); - // fprintf(stderr, "rf5c296_reg_w %02x, %02x (%s)\n", reg, data, cpuexec_describe_context(machine)); + // fprintf(stderr, "rf5c296_reg_w %02x, %02x (%s)\n", reg, data, machine->describe_context()); switch (reg) { // Interrupt and General Control Register @@ -383,7 +383,7 @@ static void rf5c296_reg_w(ATTR_UNUSED running_machine *machine, UINT8 reg, UINT8 static UINT8 rf5c296_reg_r(ATTR_UNUSED running_machine *machine, UINT8 reg) { - // fprintf(stderr, "rf5c296_reg_r %02x (%s)\n", reg, cpuexec_describe_context(machine)); + // fprintf(stderr, "rf5c296_reg_r %02x (%s)\n", reg, machine->describe_context()); return 0x00; } @@ -586,7 +586,7 @@ static READ32_HANDLER(control_r) { taitogn_state *state = space->machine->driver_data<taitogn_state>(); - // fprintf(stderr, "gn_r %08x @ %08x (%s)\n", 0x1fb00000+4*offset, mem_mask, cpuexec_describe_context(space->machine)); + // fprintf(stderr, "gn_r %08x @ %08x (%s)\n", 0x1fb00000+4*offset, mem_mask, space->machine->describe_context()); return state->control; } @@ -617,7 +617,7 @@ static WRITE32_HANDLER(control_w) control & 0x04 ? 'f' : '-', control & 0x02 ? '1' : '0', control & 0x01 ? '1' : '0', - cpuexec_describe_context(space->machine)); + space->machine->describe_context()); #endif if((p ^ state->control) & 0x04) @@ -786,7 +786,7 @@ static WRITE32_HANDLER( znsecsel_w ) psx_sio_install_handler( space->machine, 0, sio_dip_handler ); psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 ); - timer_adjust_oneshot( state->dip_timer, downcast<cpu_device *>(space->cpu)->cycles_to_attotime( 100 ), 1 ); + state->dip_timer->adjust( downcast<cpu_device *>(space->cpu)->cycles_to_attotime( 100 ), 1 ); } } @@ -798,7 +798,7 @@ static TIMER_CALLBACK( dip_timer_fired ) if( param ) { - timer_adjust_oneshot(state->dip_timer, machine->device<cpu_device>("maincpu")->cycles_to_attotime(50), 0); + state->dip_timer->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime(50)); } } diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c index 0f510b07f19..20eb9e67a41 100644 --- a/src/mame/drivers/taitowlf.c +++ b/src/mame/drivers/taitowlf.c @@ -146,7 +146,7 @@ static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) { taitowlf_state *state = busdevice->machine->driver_data<taitowlf_state>(); -// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data); +// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data); switch(reg) { @@ -232,7 +232,7 @@ static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) { taitowlf_state *state = busdevice->machine->driver_data<taitowlf_state>(); -// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data); +// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data); state->piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/tetrisp2.c b/src/mame/drivers/tetrisp2.c index 0beeeefe092..efacdc9788b 100644 --- a/src/mame/drivers/tetrisp2.c +++ b/src/mame/drivers/tetrisp2.c @@ -77,7 +77,7 @@ static WRITE16_HANDLER( rockn_systemregs_w ) if (offset == 0x0c) { attotime timer = ROCKN_TIMER_BASE * (4096 - data); - timer_adjust_periodic(rockn_timer_l4, timer, 0, timer); + rockn_timer_l4->adjust(timer, 0, timer); } } } @@ -91,7 +91,7 @@ static WRITE16_HANDLER( rocknms_sub_systemregs_w ) if (offset == 0x0c) { attotime timer = ROCKN_TIMER_BASE * (4096 - data); - timer_adjust_periodic(rockn_timer_sub_l4, timer, 0, timer); + rockn_timer_sub_l4->adjust(timer, 0, timer); } } } diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c index 2c88fa7c1bd..b93918dcb04 100644 --- a/src/mame/drivers/tickee.c +++ b/src/mame/drivers/tickee.c @@ -92,7 +92,7 @@ static TIMER_CALLBACK( setup_gun_interrupts ) int beamx, beamy; /* set a timer to do this again next frame */ - timer_adjust_oneshot(setup_gun_timer, machine->primary_screen->time_until_pos(0), 0); + setup_gun_timer->adjust(machine->primary_screen->time_until_pos(0)); /* only do work if the palette is flashed */ if (tickee_control) @@ -122,7 +122,7 @@ static VIDEO_START( tickee ) { /* start a timer going on the first scanline of every frame */ setup_gun_timer = machine->scheduler().timer_alloc(FUNC(setup_gun_interrupts)); - timer_adjust_oneshot(setup_gun_timer, machine->primary_screen->time_until_pos(0), 0); + setup_gun_timer->adjust(machine->primary_screen->time_until_pos(0)); } diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c index 82bb8a06147..8ce907396d7 100644 --- a/src/mame/drivers/tmaster.c +++ b/src/mame/drivers/tmaster.c @@ -355,7 +355,7 @@ static void tmaster_draw(running_machine *machine) #ifdef MAME_DEBUG #if 0 - logerror("%s: blit w %03x, h %02x, x %03x, y %02x, src %06x, fill/addr %04x, repl/color %04x, mode %02x\n", cpuexec_describe_context(machine), + logerror("%s: blit w %03x, h %02x, x %03x, y %02x, src %06x, fill/addr %04x, repl/color %04x, mode %02x\n", machine->describe_context(), sw,sh,sx,sy, addr, tmaster_addr, tmaster_color, mode ); #endif @@ -380,7 +380,7 @@ static void tmaster_draw(running_machine *machine) case 0x00: // blit with transparency if (addr > tmaster_gfx_size - sw*sh) { - logerror("%s: blit error, addr %06x out of bounds\n", cpuexec_describe_context(machine),addr); + logerror("%s: blit error, addr %06x out of bounds\n", machine->describe_context(),addr); addr = tmaster_gfx_size - sw*sh; } diff --git a/src/mame/drivers/tubep.c b/src/mame/drivers/tubep.c index 83c45d47a46..0f9dbd3df1f 100644 --- a/src/mame/drivers/tubep.c +++ b/src/mame/drivers/tubep.c @@ -325,7 +325,7 @@ static TIMER_CALLBACK( tubep_scanline_callback ) if (scanline >= 264) scanline = 0; - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(scanline), scanline); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } @@ -357,7 +357,7 @@ static MACHINE_START( tubep ) static MACHINE_RESET( tubep ) { - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(0), 0); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(0)); } @@ -505,7 +505,7 @@ static TIMER_CALLBACK( rjammer_scanline_callback ) if (scanline >= 264) scanline = 0; - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(scanline), scanline); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } @@ -519,7 +519,7 @@ static MACHINE_START( rjammer ) static MACHINE_RESET( rjammer ) { - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(0), 0); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(0)); } diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c index 805ca483a1e..bbb84e3e074 100644 --- a/src/mame/drivers/tumbleb.c +++ b/src/mame/drivers/tumbleb.c @@ -785,7 +785,7 @@ static WRITE16_HANDLER( semicom_soundcmd_w ) soundlatch_w(space, 0, data & 0xff); // needed for Super Trio which reads the sound with polling // cpu_spinuntil_time(space->cpu, attotime::from_usec(100)); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(20)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(20)); } } diff --git a/src/mame/drivers/unico.c b/src/mame/drivers/unico.c index 362d1593a5f..4bdb971aacc 100644 --- a/src/mame/drivers/unico.c +++ b/src/mame/drivers/unico.c @@ -213,7 +213,7 @@ static WRITE32_HANDLER( zeropnt2_leds_w ) static WRITE32_DEVICE_HANDLER( zeropnt2_eeprom_w ) { if (data & ~0xfe00000) - logerror("%s - Unknown EEPROM bit written %04X\n",cpuexec_describe_context(device->machine),data); + logerror("%s - Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data); if ( ACCESSING_BITS_24_31 ) { diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c index 53c1c607b0a..c7b7440c577 100644 --- a/src/mame/drivers/vegas.c +++ b/src/mame/drivers/vegas.c @@ -948,7 +948,7 @@ static TIMER_CALLBACK( nile_timer_callback ) if (regs[1] & 2) logerror("Unexpected value: timer %d is prescaled\n", which); if (scale != 0) - timer_adjust_oneshot(timer[which], TIMER_PERIOD * scale, which); + timer[which]->adjust(TIMER_PERIOD * scale, which); } /* trigger the interrupt */ @@ -1031,7 +1031,7 @@ static READ32_HANDLER( nile_r ) { if (nile_regs[offset] & 2) logerror("Unexpected value: timer %d is prescaled\n", which); - result = nile_regs[offset + 1] = timer_timeleft(timer[which]).as_double() * (double)SYSTEM_CLOCK; + result = nile_regs[offset + 1] = timer[which]->remaining().as_double() * (double)SYSTEM_CLOCK; } if (LOG_TIMERS) logerror("%08X:NILE READ: timer %d counter(%03X) = %08X\n", cpu_get_pc(space->cpu), which, offset*4, result); @@ -1161,7 +1161,7 @@ static WRITE32_HANDLER( nile_w ) if (nile_regs[offset] & 2) logerror("Unexpected value: timer %d is prescaled\n", which); if (scale != 0) - timer_adjust_oneshot(timer[which], TIMER_PERIOD * scale, which); + timer[which]->adjust(TIMER_PERIOD * scale, which); if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ((TIMER_PERIOD * (nile_regs[offset + 1] + 1)).attoseconds)); } @@ -1170,8 +1170,8 @@ static WRITE32_HANDLER( nile_w ) { if (nile_regs[offset] & 2) logerror("Unexpected value: timer %d is prescaled\n", which); - nile_regs[offset + 1] = timer_timeleft(timer[which]).as_double() * SYSTEM_CLOCK; - timer_adjust_oneshot(timer[which], attotime::never, which); + nile_regs[offset + 1] = timer[which]->remaining().as_double() * SYSTEM_CLOCK; + timer[which]->adjust(attotime::never, which); } break; @@ -1187,7 +1187,7 @@ static WRITE32_HANDLER( nile_w ) { if (nile_regs[offset - 1] & 2) logerror("Unexpected value: timer %d is prescaled\n", which); - timer_adjust_oneshot(timer[which], TIMER_PERIOD * nile_regs[offset], which); + timer[which]->adjust(TIMER_PERIOD * nile_regs[offset], which); } break; diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c index 884b5c4f163..b0d1fa7708b 100644 --- a/src/mame/drivers/viper.c +++ b/src/mame/drivers/viper.c @@ -197,7 +197,7 @@ static READ64_DEVICE_HANDLER(cf_card_data_r) default: { - fatalerror("%s:cf_card_data_r: IDE reg %02X\n", cpuexec_describe_context(device->machine), offset & 0xf); + fatalerror("%s:cf_card_data_r: IDE reg %02X\n", device->machine->describe_context(), offset & 0xf); } } } @@ -218,7 +218,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_data_w) default: { - fatalerror("%s:cf_card_data_w: IDE reg %02X, %04X\n", cpuexec_describe_context(device->machine), offset & 0xf, (UINT16)(data >> 16)); + fatalerror("%s:cf_card_data_w: IDE reg %02X, %04X\n", device->machine->describe_context(), offset & 0xf, (UINT16)(data >> 16)); } } } @@ -264,7 +264,7 @@ static READ64_DEVICE_HANDLER(cf_card_r) default: { - printf("%s:compact_flash_r: IDE reg %02X\n", cpuexec_describe_context(device->machine), offset & 0xf); + printf("%s:compact_flash_r: IDE reg %02X\n", device->machine->describe_context(), offset & 0xf); } } } @@ -280,7 +280,7 @@ static READ64_DEVICE_HANDLER(cf_card_r) } else { - fatalerror("%s:compact_flash_r: reg %02X\n", cpuexec_describe_context(device->machine), reg); + fatalerror("%s:compact_flash_r: reg %02X\n", device->machine->describe_context(), reg); } } } @@ -290,7 +290,7 @@ static READ64_DEVICE_HANDLER(cf_card_r) static WRITE64_DEVICE_HANDLER(cf_card_w) { #ifdef VIPER_DEBUG_LOG - printf("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", cpuexec_describe_context(device->machine), (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); + printf("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", device->machine->describe_context(), (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); #endif if (ACCESSING_BITS_16_31) @@ -329,7 +329,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_w) default: { - fatalerror("%s:compact_flash_w: IDE reg %02X, data %04X\n", cpuexec_describe_context(device->machine), offset & 0xf, (UINT16)((data >> 16) & 0xffff)); + fatalerror("%s:compact_flash_w: IDE reg %02X, data %04X\n", device->machine->describe_context(), offset & 0xf, (UINT16)((data >> 16) & 0xffff)); } } } @@ -355,7 +355,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_w) } default: { - fatalerror("%s:compact_flash_w: reg %02X, data %04X\n", cpuexec_describe_context(device->machine), offset, (UINT16)((data >> 16) & 0xffff)); + fatalerror("%s:compact_flash_w: reg %02X, data %04X\n", device->machine->describe_context(), offset, (UINT16)((data >> 16) & 0xffff)); } } } diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c index eeaa889663a..0b50cfab429 100644 --- a/src/mame/drivers/vmetal.c +++ b/src/mame/drivers/vmetal.c @@ -158,7 +158,7 @@ static WRITE8_DEVICE_HANDLER( vmetal_control_w ) es8712_set_bank_base(device, 0x000000); if (data & 0xa0) - logerror("%s:Writing unknown bits %04x to $200000\n",cpuexec_describe_context(device->machine),data); + logerror("%s:Writing unknown bits %04x to $200000\n",device->machine->describe_context(),data); } static WRITE8_DEVICE_HANDLER( vmetal_es8712_w ) @@ -194,7 +194,7 @@ static WRITE8_DEVICE_HANDLER( vmetal_es8712_w ) */ es8712_w(device, offset, data); - logerror("%s:Writing %04x to ES8712 offset %02x\n", cpuexec_describe_context(device->machine), data, offset); + logerror("%s:Writing %04x to ES8712 offset %02x\n", device->machine->describe_context(), data, offset); } diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c index 7902a0d8734..76240a08529 100644 --- a/src/mame/drivers/xexex.c +++ b/src/mame/drivers/xexex.c @@ -275,7 +275,7 @@ static TIMER_CALLBACK( dmaend_callback ) if (state->suspension_active) { state->suspension_active = 0; - cpuexec_trigger(machine, state->resume_trigger); + machine->scheduler().trigger(state->resume_trigger); } // IRQ 5 is the "object DMA end interrupt" and shouldn't be triggered @@ -291,7 +291,7 @@ static INTERRUPT_GEN( xexex_interrupt ) if (state->suspension_active) { state->suspension_active = 0; - cpuexec_trigger(device->machine, state->resume_trigger); + device->machine->scheduler().trigger(state->resume_trigger); } switch (cpu_getiloops(device)) @@ -309,7 +309,7 @@ static INTERRUPT_GEN( xexex_interrupt ) xexex_objdma(device->machine, 0); // schedule DMA end interrupt - timer_adjust_oneshot(state->dmadelay_timer, XE_DMADELAY, 0); + state->dmadelay_timer->adjust(XE_DMADELAY); } // IRQ 4 is the V-blank interrupt. It controls color, sound and diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c index 296d7bf7202..5f3cd427bce 100644 --- a/src/mame/drivers/xtheball.c +++ b/src/mame/drivers/xtheball.c @@ -88,7 +88,7 @@ static void xtheball_to_shiftreg(address_space *space, UINT32 address, UINT16 *s else if (address >= 0x02000000 && address <= 0x020fffff) memcpy(shiftreg, &vram_fg[TOWORD(address & 0xff000)], TOBYTE(0x1000)); else - logerror("%s:xtheball_to_shiftreg(%08X)\n", cpuexec_describe_context(space->machine), address); + logerror("%s:xtheball_to_shiftreg(%08X)\n", space->machine->describe_context(), address); } @@ -99,7 +99,7 @@ static void xtheball_from_shiftreg(address_space *space, UINT32 address, UINT16 else if (address >= 0x02000000 && address <= 0x020fffff) memcpy(&vram_fg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000)); else - logerror("%s:xtheball_from_shiftreg(%08X)\n", cpuexec_describe_context(space->machine), address); + logerror("%s:xtheball_from_shiftreg(%08X)\n", space->machine->describe_context(), address); } diff --git a/src/mame/drivers/yunsung8.c b/src/mame/drivers/yunsung8.c index 2678e63ad18..59f7e82102f 100644 --- a/src/mame/drivers/yunsung8.c +++ b/src/mame/drivers/yunsung8.c @@ -102,7 +102,7 @@ static WRITE8_DEVICE_HANDLER( yunsung8_sound_bankswitch_w ) memory_set_bank(device->machine, "bank2", data & 0x07); if (data != (data & (~0x27))) - logerror("%s: Bank %02X\n", cpuexec_describe_context(device->machine), data); + logerror("%s: Bank %02X\n", device->machine->describe_context(), data); } static WRITE8_HANDLER( yunsung8_adpcm_w ) diff --git a/src/mame/drivers/zaccaria.c b/src/mame/drivers/zaccaria.c index d3b45371156..32552f6483c 100644 --- a/src/mame/drivers/zaccaria.c +++ b/src/mame/drivers/zaccaria.c @@ -69,7 +69,7 @@ static WRITE8_DEVICE_HANDLER( zaccaria_dsw_sel_w ) break; default: - logerror("%s: portsel = %02x\n", cpuexec_describe_context(device->machine), data); + logerror("%s: portsel = %02x\n", device->machine->describe_context(), data); break; } } diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c index 8c95c78ed14..bbed82fc495 100644 --- a/src/mame/drivers/zn.c +++ b/src/mame/drivers/zn.c @@ -66,7 +66,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 ); } } @@ -348,7 +348,7 @@ static WRITE32_HANDLER( znsecsel_w ) psx_sio_install_handler( space->machine, 0, sio_dip_handler ); psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 ); - timer_adjust_oneshot( state->dip_timer, downcast<cpu_device *>(space->cpu)->cycles_to_attotime( 100 ), 1 ); + state->dip_timer->adjust( downcast<cpu_device *>(space->cpu)->cycles_to_attotime( 100 ), 1 ); } verboselog( space->machine, 2, "znsecsel_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); @@ -361,7 +361,7 @@ static TIMER_CALLBACK( dip_timer_fired ) if( param ) { - timer_adjust_oneshot( state->dip_timer, machine->device<cpu_device>( "maincpu" )->cycles_to_attotime(50 ), 0 ); + state->dip_timer->adjust( machine->device<cpu_device>( "maincpu" )->cycles_to_attotime(50 ) ); } } diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c index 8ac30b7b2a3..476ba3c43d0 100644 --- a/src/mame/machine/amiga.c +++ b/src/mame/machine/amiga.c @@ -400,7 +400,7 @@ static TIMER_CALLBACK( amiga_irq_proc ) amiga_state *state = machine->driver_data<amiga_state>(); update_irqs(machine); - timer_reset( state->irq_timer, attotime::never); + state->irq_timer->reset( ); } @@ -937,7 +937,7 @@ static TIMER_CALLBACK( amiga_blitter_proc ) amiga_custom_w(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), REG_INTREQ, 0x8000 | INTENA_BLIT, 0xffff); /* reset the blitter timer */ - timer_reset( state->blitter_timer, attotime::never); + state->blitter_timer->reset( ); } @@ -956,7 +956,7 @@ static void blitter_setup(address_space *space) /* is there another blitting in progress? */ if (CUSTOM_REG(REG_DMACON) & 0x4000) { - logerror("%s - This program is playing tricks with the blitter\n", cpuexec_describe_context(space->machine) ); + logerror("%s - This program is playing tricks with the blitter\n", space->machine->describe_context() ); return; } @@ -1002,7 +1002,7 @@ static void blitter_setup(address_space *space) CUSTOM_REG(REG_DMACON) |= 0x4000; /* set a timer */ - timer_adjust_oneshot( state->blitter_timer, downcast<cpu_device *>(space->cpu)->cycles_to_attotime( blittime ), 0); + state->blitter_timer->adjust( downcast<cpu_device *>(space->cpu)->cycles_to_attotime( blittime )); } @@ -1375,7 +1375,7 @@ WRITE16_HANDLER( amiga_custom_w ) /* if 'blitter-nasty' has been turned on and we have a blit pending, reschedule it */ if ( ( data & 0x400 ) && ( CUSTOM_REG(REG_DMACON) & 0x4000 ) ) - timer_adjust_oneshot( state->blitter_timer, downcast<cpu_device *>(space->cpu)->cycles_to_attotime( BLITTER_NASTY_DELAY ), 0); + state->blitter_timer->adjust( downcast<cpu_device *>(space->cpu)->cycles_to_attotime( BLITTER_NASTY_DELAY )); break; @@ -1386,7 +1386,7 @@ WRITE16_HANDLER( amiga_custom_w ) CUSTOM_REG(offset) = data; if ( temp & 0x8000 ) /* if we're enabling irq's, delay a bit */ - timer_adjust_oneshot( state->irq_timer, downcast<cpu_device *>(space->cpu)->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES ), 0); + state->irq_timer->adjust( downcast<cpu_device *>(space->cpu)->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES )); else /* if we're disabling irq's, process right away */ update_irqs(space->machine); break; @@ -1405,7 +1405,7 @@ WRITE16_HANDLER( amiga_custom_w ) CUSTOM_REG(offset) = data; if ( temp & 0x8000 ) /* if we're generating irq's, delay a bit */ - timer_adjust_oneshot( state->irq_timer, space->machine->device<cpu_device>("maincpu")->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES ), 0); + state->irq_timer->adjust( space->machine->device<cpu_device>("maincpu")->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES )); else /* if we're clearing irq's, process right away */ update_irqs(space->machine); break; diff --git a/src/mame/machine/archimds.c b/src/mame/machine/archimds.c index a2f75902f94..058904a30c1 100644 --- a/src/mame/machine/archimds.c +++ b/src/mame/machine/archimds.c @@ -111,7 +111,7 @@ static TIMER_CALLBACK( vidc_vblank ) archimedes_request_irq_a(machine, ARCHIMEDES_IRQA_VBL); // set up for next vbl - timer_adjust_oneshot(vbl_timer, machine->primary_screen->time_until_pos(vidc_regs[0xb4]), 0); + vbl_timer->adjust(machine->primary_screen->time_until_pos(vidc_regs[0xb4])); } /* video DMA */ @@ -128,9 +128,9 @@ static TIMER_CALLBACK( vidc_video_tick ) vram[vidc_vidcur] = (space->read_byte(vidc_vidstart+vidc_vidcur+vidc_vidinit)); if(video_dma_on) - timer_adjust_oneshot(vid_timer, space->machine->primary_screen->time_until_pos(vidc_regs[0xb4]), 0); + vid_timer->adjust(space->machine->primary_screen->time_until_pos(vidc_regs[0xb4])); else - timer_adjust_oneshot(vid_timer, attotime::never, 0); + vid_timer->adjust(attotime::never); } /* audio DMA */ @@ -162,7 +162,7 @@ static TIMER_CALLBACK( vidc_audio_tick ) if(!audio_dma_on) { - timer_adjust_oneshot(snd_timer, attotime::never, 0); + snd_timer->adjust(attotime::never); for(ch=0;ch<8;ch++) dac_signed_data_16_w(space->machine->device(dac_port[ch & 7]), 0x8000); } @@ -177,15 +177,15 @@ static void a310_set_timer(int tmr) { case 0: case 1: - timer_adjust_oneshot(timer[tmr], attotime::from_usec(ioc_timercnt[tmr]/8), tmr); // TODO: ARM timings are quite off there, it should be latch and not latch/8 + timer[tmr]->adjust(attotime::from_usec(ioc_timercnt[tmr]/8), tmr); // TODO: ARM timings are quite off there, it should be latch and not latch/8 break; case 2: freq = 1000000.0 / (double)(ioc_timercnt[tmr]+1); - timer_adjust_oneshot(timer[tmr], attotime::from_hz(freq), tmr); + timer[tmr]->adjust(attotime::from_hz(freq), tmr); break; case 3: freq = 1000000.0 / (double)((ioc_timercnt[tmr]+1)*16); - timer_adjust_oneshot(timer[tmr], attotime::from_hz(freq), tmr); + timer[tmr]->adjust(attotime::from_hz(freq), tmr); break; } } @@ -232,20 +232,20 @@ void archimedes_init(running_machine *machine) memc_pagesize = 0; vbl_timer = machine->scheduler().timer_alloc(FUNC(vidc_vblank)); - timer_adjust_oneshot(vbl_timer, attotime::never, 0); + vbl_timer->adjust(attotime::never); timer[0] = machine->scheduler().timer_alloc(FUNC(ioc_timer)); timer[1] = machine->scheduler().timer_alloc(FUNC(ioc_timer)); timer[2] = machine->scheduler().timer_alloc(FUNC(ioc_timer)); timer[3] = machine->scheduler().timer_alloc(FUNC(ioc_timer)); - timer_adjust_oneshot(timer[0], attotime::never, 0); - timer_adjust_oneshot(timer[1], attotime::never, 0); - timer_adjust_oneshot(timer[2], attotime::never, 0); - timer_adjust_oneshot(timer[3], attotime::never, 0); + timer[0]->adjust(attotime::never); + timer[1]->adjust(attotime::never); + timer[2]->adjust(attotime::never); + timer[3]->adjust(attotime::never); vid_timer = machine->scheduler().timer_alloc(FUNC(vidc_video_tick)); snd_timer = machine->scheduler().timer_alloc(FUNC(vidc_audio_tick)); - timer_adjust_oneshot(snd_timer, attotime::never, 0); + snd_timer->adjust(attotime::never); } READ32_HANDLER(archimedes_memc_logical_r) @@ -381,7 +381,7 @@ static const char *const ioc_regnames[] = static void latch_timer_cnt(int tmr) { - double time = timer_timeelapsed(timer[tmr]).as_double(); + double time = timer[tmr]->elapsed().as_double(); time *= 2000000.0; // find out how many 2 MHz ticks have gone by ioc_timerout[tmr] = ioc_timercnt[tmr] - (UINT32)time; } @@ -490,7 +490,7 @@ static WRITE32_HANDLER( ioc_ctrl_w ) archimedes_request_irq_a(space->machine,ARCHIMEDES_IRQA_FORCE); if(data & 0x08) //set up the VBLANK timer - timer_adjust_oneshot(vbl_timer, space->machine->primary_screen->time_until_pos(vidc_regs[0xb4]), 0); + vbl_timer->adjust(space->machine->primary_screen->time_until_pos(vidc_regs[0xb4])); break; @@ -911,7 +911,7 @@ WRITE32_HANDLER(archimedes_memc_w) if ((data>>10)&1) { vidc_vidcur = 0; - timer_adjust_oneshot(vid_timer, space->machine->primary_screen->time_until_pos(vidc_regs[0xb4]), 0); + vid_timer->adjust(space->machine->primary_screen->time_until_pos(vidc_regs[0xb4])); } if ((data>>11)&1) @@ -923,7 +923,7 @@ WRITE32_HANDLER(archimedes_memc_w) printf("MEMC: Starting audio DMA at %f Hz, buffer from %x to %x\n", sndhz, vidc_sndstart, vidc_sndend); - timer_adjust_periodic(snd_timer, attotime::zero, 0, attotime::from_hz(sndhz)); + snd_timer->adjust(attotime::zero, 0, attotime::from_hz(sndhz)); } break; diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c index 53a40441455..6a773ecaf3f 100644 --- a/src/mame/machine/arkanoid.c +++ b/src/mame/machine/arkanoid.c @@ -36,7 +36,7 @@ WRITE8_HANDLER( arkanoid_Z80_mcu_w ) { space->machine->scheduler().synchronize(FUNC(test), data); /* boost the interleave for a few usecs to make sure it is read successfully */ - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(10)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); } READ8_HANDLER( arkanoid_68705_port_a_r ) diff --git a/src/mame/machine/asic65.c b/src/mame/machine/asic65.c index 4d6955cebed..5b84a490f12 100644 --- a/src/mame/machine/asic65.c +++ b/src/mame/machine/asic65.c @@ -193,7 +193,7 @@ WRITE16_HANDLER( asic65_data_w ) if (asic65.type == ASIC65_ROMBASED) { space->machine->scheduler().synchronize(FUNC(m68k_asic65_deferred_w), data | (offset << 16)); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(20)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(20)); return; } @@ -231,7 +231,7 @@ READ16_HANDLER( asic65_r ) if (asic65.type == ASIC65_ROMBASED) { asic65._68full = 0; - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(5)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(5)); return asic65._68data; } @@ -449,7 +449,7 @@ READ16_HANDLER( asic65_io_r ) /* bit 14 = 68FULL */ /* bit 13 = XFLG */ /* bit 12 = controlled by jumper */ - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(5)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(5)); return (asic65.tfull << 15) | (asic65._68full << 14) | (asic65.xflg << 13) | 0x0000; } else diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c index c464d1ad36d..c2fbfb2e013 100644 --- a/src/mame/machine/atarigen.c +++ b/src/mame/machine/atarigen.c @@ -210,7 +210,7 @@ void atarigen_update_interrupts(running_machine *machine) void atarigen_scanline_int_set(screen_device &screen, int scanline) { emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer; - timer_adjust_oneshot(timer, screen.time_until_pos(scanline), 0); + timer->adjust(screen.time_until_pos(scanline)); } @@ -326,7 +326,7 @@ static TIMER_CALLBACK( scanline_interrupt_callback ) atarigen_scanline_int_gen(machine->device("maincpu")); /* set a new timer to go off at the same scan line next frame */ - timer_adjust_oneshot(timer, screen.frame_period(), 0); + timer->adjust(screen.frame_period()); } @@ -777,7 +777,7 @@ static TIMER_CALLBACK( delayed_sound_reset ) /* allocate a high frequency timer until a response is generated */ /* the main CPU is *very* sensistive to the timing of the response */ - cpuexec_boost_interleave(machine, SOUND_TIMER_RATE, SOUND_TIMER_BOOST); + machine->scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST); } @@ -801,7 +801,7 @@ static TIMER_CALLBACK( delayed_sound_w ) /* allocate a high frequency timer until a response is generated */ /* the main CPU is *very* sensistive to the timing of the response */ - cpuexec_boost_interleave(machine, SOUND_TIMER_RATE, SOUND_TIMER_BOOST); + machine->scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST); } @@ -896,7 +896,7 @@ void atarigen_scanline_timer_reset(screen_device &screen, atarigen_scanline_func if (state->scanline_callback != NULL) { emu_timer *timer = get_screen_timer(screen)->scanline_timer; - timer_adjust_oneshot(timer, screen.time_until_pos(0), 0); + timer->adjust(screen.time_until_pos(0)); } } @@ -921,7 +921,7 @@ static TIMER_CALLBACK( scanline_timer_callback ) scanline += state->scanlines_per_callback; if (scanline >= screen.height()) scanline = 0; - timer_adjust_oneshot(get_screen_timer(screen)->scanline_timer, screen.time_until_pos(scanline), scanline); + get_screen_timer(screen)->scanline_timer->adjust(screen.time_until_pos(scanline), scanline); } } @@ -960,7 +960,7 @@ static TIMER_CALLBACK( atarivc_eof_update ) tilemap_set_scrollx(state->playfield2_tilemap, 0, state->atarivc_state.pf1_xscroll); tilemap_set_scrolly(state->playfield2_tilemap, 0, state->atarivc_state.pf1_yscroll); } - timer_adjust_oneshot(timer, screen.time_until_pos(0), 0); + timer->adjust(screen.time_until_pos(0)); /* use this for debugging the video controller values */ #if 0 @@ -1003,7 +1003,7 @@ void atarivc_reset(screen_device &screen, UINT16 *eof_data, int playfields) if (state->atarivc_eof_data) { emu_timer *timer = get_screen_timer(screen)->atarivc_eof_update_timer; - timer_adjust_oneshot(timer, screen.time_until_pos(0), 0); + timer->adjust(screen.time_until_pos(0)); } } diff --git a/src/mame/machine/cdi070.c b/src/mame/machine/cdi070.c index c89e628da26..c60614fc02b 100644 --- a/src/mame/machine/cdi070.c +++ b/src/mame/machine/cdi070.c @@ -53,7 +53,7 @@ static void scc68070_set_timer_callback(scc68070_regs_t *scc68070, int channel) case 0: compare = 0x10000 - scc68070->timers.timer0; period = attotime::from_hz(CLOCK_A/192) * compare; - timer_adjust_oneshot(scc68070->timers.timer0_timer, period, 0); + scc68070->timers.timer0_timer->adjust(period); break; default: fatalerror( "Unsupported timer channel to scc68070_set_timer_callback!" ); @@ -96,12 +96,12 @@ static void scc68070_uart_rx_check(running_machine *machine, scc68070_regs_t *sc if((scc68070->uart.command_register & 3) == 1) { UINT32 div = 0x10000 >> ((scc68070->uart.clock_select >> 4) & 7); - timer_adjust_oneshot(scc68070->uart.rx_timer, attotime::from_hz((49152000 / div) / 8), 0); + scc68070->uart.rx_timer->adjust(attotime::from_hz((49152000 / div) / 8)); } else { scc68070->uart.status_register &= ~USR_RXRDY; - timer_adjust_oneshot(scc68070->uart.rx_timer, attotime::never, 0); + scc68070->uart.rx_timer->adjust(attotime::never); } } @@ -118,15 +118,15 @@ static void scc68070_uart_tx_check(running_machine *machine, scc68070_regs_t *sc scc68070->uart.status_register |= USR_TXRDY; } - if(timer_timeleft(scc68070->uart.tx_timer) == attotime::never) + if(scc68070->uart.tx_timer->remaining() == attotime::never) { UINT32 div = 0x10000 >> (scc68070->uart.clock_select & 7); - timer_adjust_oneshot(scc68070->uart.tx_timer, attotime::from_hz((49152000 / div) / 8), 0); + scc68070->uart.tx_timer->adjust(attotime::from_hz((49152000 / div) / 8)); } } else { - timer_adjust_oneshot(scc68070->uart.tx_timer, attotime::never, 0); + scc68070->uart.tx_timer->adjust(attotime::never); } } @@ -176,7 +176,7 @@ TIMER_CALLBACK( scc68070_rx_callback ) scc68070->uart.status_register |= USR_RXRDY; UINT32 div = 0x10000 >> ((scc68070->uart.clock_select >> 4) & 7); - timer_adjust_oneshot(scc68070->uart.rx_timer, attotime::from_hz((49152000 / div) / 8), 0); + scc68070->uart.rx_timer->adjust(attotime::from_hz((49152000 / div) / 8)); } else { @@ -389,16 +389,16 @@ TIMER_CALLBACK( scc68070_tx_callback ) scc68070->uart.transmit_pointer--; UINT32 div = 0x10000 >> (scc68070->uart.clock_select & 7); - timer_adjust_oneshot(scc68070->uart.tx_timer, attotime::from_hz((49152000 / div) / 8), 0); + scc68070->uart.tx_timer->adjust(attotime::from_hz((49152000 / div) / 8)); } else { - timer_adjust_oneshot(scc68070->uart.tx_timer, attotime::never, 0); + scc68070->uart.tx_timer->adjust(attotime::never); } } else { - timer_adjust_oneshot(scc68070->uart.tx_timer, attotime::never, 0); + scc68070->uart.tx_timer->adjust(attotime::never); } scc68070_uart_tx_check(machine, scc68070); @@ -1144,13 +1144,13 @@ void scc68070_register_globals(running_machine *machine, scc68070_regs_t *scc680 state_save_register_global(machine, scc68070->mmu.desc[7].base); scc68070->timers.timer0_timer = machine->scheduler().timer_alloc(FUNC(scc68070_timer0_callback)); - timer_adjust_oneshot(scc68070->timers.timer0_timer, attotime::never, 0); + scc68070->timers.timer0_timer->adjust(attotime::never); scc68070->uart.rx_timer = machine->scheduler().timer_alloc(FUNC(scc68070_rx_callback)); - timer_adjust_oneshot(scc68070->uart.rx_timer, attotime::never, 0); + scc68070->uart.rx_timer->adjust(attotime::never); scc68070->uart.tx_timer = machine->scheduler().timer_alloc(FUNC(scc68070_tx_callback)); - timer_adjust_oneshot(scc68070->uart.tx_timer, attotime::never, 0); + scc68070->uart.tx_timer->adjust(attotime::never); } #if ENABLE_UART_PRINTING diff --git a/src/mame/machine/cdicdic.c b/src/mame/machine/cdicdic.c index 9bc3bd7a5ee..fdd91a8d84a 100644 --- a/src/mame/machine/cdicdic.c +++ b/src/mame/machine/cdicdic.c @@ -574,7 +574,7 @@ void cdicdic_device::sample_trigger() if(m_decode_addr == 0xffff) { verboselog(&m_machine, 0, "Decode stop requested, stopping playback\n" ); - timer_adjust_oneshot(m_audio_sample_timer, attotime::never, 0); + m_audio_sample_timer->adjust(attotime::never); return; } @@ -609,7 +609,7 @@ void cdicdic_device::sample_trigger() //// Delay for Frequency * (18*28*2*size in bytes) before requesting more data verboselog(&m_machine, 0, "Data is valid, setting up a new callback\n" ); m_decode_period = attotime::from_hz(CDIC_SAMPLE_BUF_FREQ(m_ram, m_decode_addr & 0x3ffe)) * (18*28*2*CDIC_SAMPLE_BUF_SIZE(m_ram, m_decode_addr & 0x3ffe)); - timer_adjust_oneshot(m_audio_sample_timer, m_decode_period, 0); + m_audio_sample_timer->adjust(m_decode_period); //dmadac_enable(&dmadac[0], 2, 0); } else @@ -619,7 +619,7 @@ void cdicdic_device::sample_trigger() verboselog(&m_machine, 0, "Data is not valid, indicating to shut down on the next audio sample\n" ); m_decode_addr = 0xffff; - timer_adjust_oneshot(m_audio_sample_timer, m_decode_period, 0); + m_audio_sample_timer->adjust(m_decode_period); } } @@ -785,13 +785,13 @@ void cdicdic_device::process_delayed_command() if((buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF) == 0 && m_command != 0x23) { - timer_adjust_oneshot(m_interrupt_timer, attotime::from_hz(75), 0); // 75Hz = 1x CD-ROM speed + m_interrupt_timer->adjust(attotime::from_hz(75)); // 75Hz = 1x CD-ROM speed } else { if(m_command == 0x23) // Mode 1 Reset { - timer_adjust_oneshot(m_interrupt_timer, attotime::never, 0); + m_interrupt_timer->adjust(attotime::never); } } } @@ -800,7 +800,7 @@ void cdicdic_device::process_delayed_command() } case 0x2e: // Abort - timer_adjust_oneshot(m_interrupt_timer, attotime::never, 0); + m_interrupt_timer->adjust(attotime::never); //m_data_buffer &= ~4; break; @@ -863,7 +863,7 @@ void cdicdic_device::process_delayed_command() m_time = next_msf << 8; // the following line BREAKS 'The Apprentice', hangs when you attempt to start the game - //timer_adjust_oneshot(m_interrupt_timer, attotime::from_hz(75), 0); + //m_interrupt_timer->adjust(attotime::from_hz(75)); m_x_buffer |= 0x8000; //m_data_buffer |= 0x4000; @@ -896,7 +896,7 @@ void cdicdic_device::process_delayed_command() }; lba = nybbles[0] + nybbles[1]*10 + ((nybbles[2] + nybbles[3]*10)*75) + ((nybbles[4] + nybbles[5]*10)*75*60); - timer_adjust_oneshot(m_interrupt_timer, attotime::from_hz(75), 0); + m_interrupt_timer->adjust(attotime::from_hz(75)); cdrom_read_data(m_cd, lba, buffer, CD_TRACK_RAW_DONTCARE); @@ -1001,7 +1001,7 @@ UINT16 cdicdic_device::register_read(const UINT32 offset, const UINT16 mem_mask) case 0x3ffa/2: // AUDCTL { - if(timer_timeleft(m_audio_sample_timer).is_never()) + if(m_audio_sample_timer->remaining().is_never()) { m_z_buffer ^= 0x0001; } @@ -1120,18 +1120,18 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons COMBINE_DATA(&m_z_buffer); if(m_z_buffer & 0x2000) { - attotime period = timer_timeleft(m_audio_sample_timer); + attotime period = m_audio_sample_timer->remaining(); if(period.is_never()) { m_decode_addr = m_z_buffer & 0x3a00; m_decode_delay = 1; - timer_adjust_oneshot(m_audio_sample_timer, attotime::from_hz(75), 0); + m_audio_sample_timer->adjust(attotime::from_hz(75)); } } else { m_decode_addr = 0xffff; - timer_adjust_oneshot(m_audio_sample_timer, attotime::never, 0); + m_audio_sample_timer->adjust(attotime::never); } break; } @@ -1150,14 +1150,14 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons //case 0x24: // Reset Mode 2 case 0x2e: // Abort { - timer_adjust_oneshot(m_interrupt_timer, attotime::never, 0); + m_interrupt_timer->adjust(attotime::never); dmadac_enable(&state->dmadac[0], 2, 0); //m_data_buffer &= 0xbfff; break; } case 0x2b: // Stop CDDA cdda_stop_audio(m_machine.device("cdda")); - timer_adjust_oneshot(m_interrupt_timer, attotime::never, 0); + m_interrupt_timer->adjust(attotime::never); break; case 0x23: // Reset Mode 1 case 0x29: // Read Mode 1 @@ -1165,16 +1165,16 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons case 0x28: // Play CDDA case 0x2c: // Seek { - attotime period = timer_timeleft(m_interrupt_timer); + attotime period = m_interrupt_timer->remaining(); if(!period.is_never()) { - timer_adjust_oneshot(m_interrupt_timer, period, 0); + m_interrupt_timer->adjust(period); } else { if(m_command != 0x23 && m_command != 0x24) { - timer_adjust_oneshot(m_interrupt_timer, attotime::from_hz(75), 0); + m_interrupt_timer->adjust(attotime::from_hz(75)); } } break; @@ -1217,10 +1217,10 @@ void cdicdic_device::device_start() register_globals(); m_interrupt_timer = m_machine.scheduler().timer_alloc(FUNC(trigger_readback_int)); - timer_adjust_oneshot(m_interrupt_timer, attotime::never, 0); + m_interrupt_timer->adjust(attotime::never); m_audio_sample_timer = m_machine.scheduler().timer_alloc(FUNC(audio_sample_trigger)); - timer_adjust_oneshot(m_audio_sample_timer, attotime::never, 0); + m_audio_sample_timer->adjust(attotime::never); m_ram = auto_alloc_array(&m_machine, UINT16, 0x3c00/2); } diff --git a/src/mame/machine/cdislave.c b/src/mame/machine/cdislave.c index 60aeb15ae54..e79838015d8 100644 --- a/src/mame/machine/cdislave.c +++ b/src/mame/machine/cdislave.c @@ -93,7 +93,7 @@ void cdislave_device::readback_trigger() verboselog(&m_machine, 0, "Asserting IRQ2\n" ); cpu_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_2, 26); cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_2, ASSERT_LINE); - timer_adjust_oneshot(m_interrupt_timer, attotime::never, 0); + m_interrupt_timer->adjust(attotime::never); } void cdislave_device::prepare_readback(attotime delay, UINT8 channel, UINT8 count, UINT8 data0, UINT8 data1, UINT8 data2, UINT8 data3, UINT8 cmd) @@ -106,7 +106,7 @@ void cdislave_device::prepare_readback(attotime delay, UINT8 channel, UINT8 coun m_channel[channel].m_out_buf[3] = data3; m_channel[channel].m_out_cmd = cmd; - timer_adjust_oneshot(m_interrupt_timer, delay, 0); + m_interrupt_timer->adjust(delay); } void cdislave_device::perform_mouse_update() @@ -344,7 +344,7 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con dmadac_enable(&state->dmadac[0], 2, 0); m_in_index = 0; m_in_count = 0; - //timer_adjust_oneshot(cdic->audio_sample_timer, attotime::never, 0); + //cdic->audio_sample_timer->adjust(attotime::never); break; case 0x83: // Unmute Audio verboselog(&m_machine, 0, "slave_w: Channel %d: Unmute Audio (0x83)\n", offset ); @@ -475,7 +475,7 @@ void cdislave_device::device_start() register_globals(); m_interrupt_timer = m_machine.scheduler().timer_alloc(FUNC(trigger_readback_int)); - timer_adjust_oneshot(m_interrupt_timer, attotime::never, 0); + m_interrupt_timer->adjust(attotime::never); } //------------------------------------------------- diff --git a/src/mame/machine/cubocd32.c b/src/mame/machine/cubocd32.c index 4ea86aeb599..efcda01723b 100644 --- a/src/mame/machine/cubocd32.c +++ b/src/mame/machine/cubocd32.c @@ -325,7 +325,7 @@ static void akiko_cdda_stop(akiko_state *state) if (cdda != NULL) { cdda_stop_audio(cdda); - timer_reset( state->frame_timer, attotime::never ); + state->frame_timer->reset( ); } } @@ -335,7 +335,7 @@ static void akiko_cdda_play(akiko_state *state, UINT32 lba, UINT32 num_blocks) if (cdda != NULL) { cdda_start_audio(cdda, lba, num_blocks); - timer_adjust_oneshot( state->frame_timer, attotime::from_hz( 75 ), 0 ); + state->frame_timer->adjust( attotime::from_hz( 75 ) ); } } @@ -350,11 +350,11 @@ static void akiko_cdda_pause(akiko_state *state, int pause) if ( pause ) { - timer_reset( state->frame_timer, attotime::never ); + state->frame_timer->reset( ); } else { - timer_adjust_oneshot( state->frame_timer, attotime::from_hz( 75 ), 0 ); + state->frame_timer->adjust( attotime::from_hz( 75 ) ); } } } @@ -417,7 +417,7 @@ static TIMER_CALLBACK(akiko_frame_proc) akiko_set_cd_status(state, 0x80000000); /* subcode ready */ } - timer_adjust_oneshot( state->frame_timer, attotime::from_hz( 75 ), 0 ); + state->frame_timer->adjust( attotime::from_hz( 75 ) ); } } @@ -502,7 +502,7 @@ static TIMER_CALLBACK(akiko_dma_proc) if ( state->cdrom_readreqmask == 0 ) akiko_set_cd_status(state, 0x04000000); else - timer_adjust_oneshot( state->dma_timer, attotime::from_usec( CD_SECTOR_TIME / state->cdrom_speed ), 0 ); + state->dma_timer->adjust( attotime::from_usec( CD_SECTOR_TIME / state->cdrom_speed ) ); } static void akiko_start_dma(akiko_state *state) @@ -518,7 +518,7 @@ static void akiko_start_dma(akiko_state *state) state->cdrom_lba_cur = state->cdrom_lba_start; - timer_adjust_oneshot( state->dma_timer, attotime::from_usec( CD_SECTOR_TIME / state->cdrom_speed ), 0 ); + state->dma_timer->adjust( attotime::from_usec( CD_SECTOR_TIME / state->cdrom_speed ) ); } static void akiko_setup_response( akiko_state *state, int len, UINT8 *r1 ) @@ -665,7 +665,7 @@ static void akiko_update_cdrom(akiko_state *state) if ( cmdbuf[7] == 0x80 ) { - if (LOG_AKIKO_CD) logerror( "%s:AKIKO CD: Data read - start lba: %08x - end lba: %08x\n", cpuexec_describe_context(state->machine), startpos, endpos ); + if (LOG_AKIKO_CD) logerror( "%s:AKIKO CD: Data read - start lba: %08x - end lba: %08x\n", state->machine->describe_context(), startpos, endpos ); state->cdrom_speed = (cmdbuf[8] & 0x40) ? 2 : 1; state->cdrom_lba_start = startpos; state->cdrom_lba_end = endpos; diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c index 190586df2c6..223938ac1e3 100644 --- a/src/mame/machine/dc.c +++ b/src/mame/machine/dc.c @@ -318,7 +318,7 @@ INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_m // non 32-bit accesses have not yet been seen here, we need to know when they are if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff))) { - mame_printf_verbose("%s:Wrong mask!\n", cpuexec_describe_context(machine)); + mame_printf_verbose("%s:Wrong mask!\n", machine->describe_context()); // debugger_break(machine); } @@ -342,7 +342,7 @@ INLINE int decode_reg3216_64(running_machine *machine, UINT32 offset, UINT64 mem if ((mem_mask != U64(0x0000ffff00000000)) && (mem_mask != U64(0x000000000000ffff)) && (mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff))) { - mame_printf_verbose("%s:Wrong mask!\n", cpuexec_describe_context(machine)); + mame_printf_verbose("%s:Wrong mask!\n", machine->describe_context()); // debugger_break(machine); } @@ -1556,7 +1556,7 @@ WRITE64_HANDLER( dc_rtc_w ) if (dc_rtcregister[RTC3] == 0) dc_rtcregister[reg] = old; else - timer_adjust_periodic(dc_rtc_timer, attotime::zero, 0, attotime::from_seconds(1)); + dc_rtc_timer->adjust(attotime::zero, 0, attotime::from_seconds(1)); break; case RTC3: dc_rtcregister[RTC3] &= 1; @@ -1626,7 +1626,7 @@ MACHINE_RESET( dc ) memset(maple_regs, 0, sizeof(maple_regs)); memset(dc_coin_counts, 0, sizeof(dc_coin_counts)); - timer_adjust_periodic(dc_rtc_timer, attotime::zero, 0, attotime::from_seconds(1)); + dc_rtc_timer->adjust(attotime::zero, 0, attotime::from_seconds(1)); dc_sysctrl_regs[SB_SBREV] = 0x0b; diff --git a/src/mame/machine/dec0.c b/src/mame/machine/dec0.c index 50ebaccd5d0..6d255085930 100644 --- a/src/mame/machine/dec0.c +++ b/src/mame/machine/dec0.c @@ -388,7 +388,7 @@ static void baddudes_i8751_write(running_machine *machine, int data) case 0x75b: i8751_return=0x70f; break; } - if (!i8751_return) logerror("%s: warning - write unknown command %02x to 8571\n",cpuexec_describe_context(machine),data); + if (!i8751_return) logerror("%s: warning - write unknown command %02x to 8571\n",machine->describe_context(),data); cputag_set_input_line(machine, "maincpu", 5, HOLD_LINE); } @@ -458,7 +458,7 @@ static void birdtry_i8751_write(running_machine *machine, int data) /*These are activated after a shot (???)*/ case 0x6ca: i8751_return = 0xff; break; case 0x7ff: i8751_return = 0x200; break; - default: logerror("%s: warning - write unknown command %02x to 8571\n",cpuexec_describe_context(machine),data); + default: logerror("%s: warning - write unknown command %02x to 8571\n",machine->describe_context(),data); } cputag_set_input_line(machine, "maincpu", 5, HOLD_LINE); } @@ -472,7 +472,7 @@ void dec0_i8751_write(running_machine *machine, int data) if (GAME == 2) baddudes_i8751_write(machine, data); if (GAME == 3) birdtry_i8751_write(machine, data); - //logerror("%s: warning - write %02x to i8751\n",cpuexec_describe_context(machine),data); + //logerror("%s: warning - write %02x to i8751\n",machine->describe_context(),data); } void dec0_i8751_reset(void) diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c index 8209a48d049..15c6029dfec 100644 --- a/src/mame/machine/decocass.c +++ b/src/mame/machine/decocass.c @@ -2156,7 +2156,7 @@ static void tape_change_speed(device_t *device, INT8 newspeed) newperiod = attotime::from_hz(TAPE_CLOCKRATE * absnewspeed); /* set the new speed */ - timer_adjust_periodic(tape->timer, newperiod, 0, newperiod); + tape->timer->adjust(newperiod, 0, newperiod); tape->speed = newspeed; } diff --git a/src/mame/machine/docastle.c b/src/mame/machine/docastle.c index 223a7fec4ed..f066ea1d8f3 100644 --- a/src/mame/machine/docastle.c +++ b/src/mame/machine/docastle.c @@ -55,7 +55,7 @@ WRITE8_HANDLER( docastle_shared0_w ) if (offset == 8) /* awake the master CPU */ - cpuexec_trigger(space->machine, 500); + space->machine->scheduler().trigger(500); } diff --git a/src/mame/machine/gaelco3d.c b/src/mame/machine/gaelco3d.c index 4352229b679..a8ef5d3175f 100644 --- a/src/mame/machine/gaelco3d.c +++ b/src/mame/machine/gaelco3d.c @@ -472,7 +472,7 @@ static DEVICE_START( gaelco_serial ) //state_save_register_device_item(device, 0, earom->data); #ifdef SHARED_MEM_DRIVER - timer_adjust_periodic(state->sync_timer, attotime::zero,0,attotime::from_hz(SYNC_FREQ)); + state->sync_timer->adjust(attotime::zero,0,attotime::from_hz(SYNC_FREQ)); #endif state->os_shmem = osd_sharedmem_alloc(PATH_NAME, 0, sizeof(shmem_t)); diff --git a/src/mame/machine/gaelcrpt.c b/src/mame/machine/gaelcrpt.c index 147c601ad00..807139bc712 100644 --- a/src/mame/machine/gaelcrpt.c +++ b/src/mame/machine/gaelcrpt.c @@ -146,7 +146,7 @@ UINT16 gaelco_decrypt(address_space *space, int offset, int data, int param1, in lastdecword = data; -// logerror("%s : data1 = %4x > %4x @ %8x\n",cpuexec_describe_context(space->machine),savedata,data,lastoffset); +// logerror("%s : data1 = %4x > %4x @ %8x\n",space->machine->describe_context(),savedata,data,lastoffset); } return data; } diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c index d9bfd86ea74..689e4a048cb 100644 --- a/src/mame/machine/harddriv.c +++ b/src/mame/machine/harddriv.c @@ -1181,7 +1181,7 @@ READ16_HANDLER( hd68k_ds3_gdata_r ) /* it is important that all the CPUs be in sync before we continue, so spin a little */ /* while to let everyone else catch up */ cpu_spinuntil_trigger(space->cpu, DS3_TRIGGER); - cpuexec_triggertime(space->machine, DS3_TRIGGER, attotime::from_usec(5)); + space->machine->scheduler().trigger(DS3_TRIGGER, attotime::from_usec(5)); return state->ds3_gdata; } @@ -1277,7 +1277,7 @@ WRITE16_HANDLER( hdds3_special_w ) update_ds3_irq(state); /* once we've written data, trigger the main CPU to wake up again */ - cpuexec_trigger(space->machine, DS3_TRIGGER); + space->machine->scheduler().trigger(DS3_TRIGGER); break; case 1: diff --git a/src/mame/machine/irobot.c b/src/mame/machine/irobot.c index a94c417c3ad..433f18d4c4e 100644 --- a/src/mame/machine/irobot.c +++ b/src/mame/machine/irobot.c @@ -25,7 +25,7 @@ #define IR_CPU_STATE(m) \ logerror(\ - "%s, scanline: %d\n", cpuexec_describe_context(m), (m)->primary_screen->vpos()) + "%s, scanline: %d\n", m->describe_context(), (m)->primary_screen->vpos()) static void irmb_run(running_machine *machine); diff --git a/src/mame/machine/kaneko16.c b/src/mame/machine/kaneko16.c index d417bd26ad0..86242313ad1 100644 --- a/src/mame/machine/kaneko16.c +++ b/src/mame/machine/kaneko16.c @@ -2121,7 +2121,7 @@ void calc3_mcu_run(running_machine *machine) if (mcu_command == 0) return; logerror("%s : MCU executed command at %04X: %04X\n", - cpuexec_describe_context(machine),calc3_mcu_command_offset,mcu_command); + machine->describe_context(),calc3_mcu_command_offset,mcu_command); if (mcu_command>0) @@ -2453,7 +2453,7 @@ void bloodwar_mcu_run(running_machine *machine) mame_fread(f,&kaneko16_mcu_ram[mcu_offset], 128); mame_fclose(f); } - logerror("%s : MCU executed command: %04X %04X (load NVRAM settings)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2); + logerror("%s : MCU executed command: %04X %04X (load NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2); } break; @@ -2465,20 +2465,20 @@ void bloodwar_mcu_run(running_machine *machine) mame_fwrite(f,&kaneko16_mcu_ram[mcu_offset], 128); mame_fclose(f); } - logerror("%s : MCU executed command: %04X %04X (save NVRAM settings)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2); + logerror("%s : MCU executed command: %04X %04X (save NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2); } break; case 0x03: // DSW { kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1"); - logerror("%s : MCU executed command: %04X %04X (read DSW)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2); + logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine->describe_context(), mcu_command, mcu_offset*2); } break; case 0x04: // Protection { - logerror("%s : MCU executed command: %04X %04X %04X\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2, mcu_data); + logerror("%s : MCU executed command: %04X %04X %04X\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data); toxboy_handle_04_subcommand(machine, mcu_data, kaneko16_mcu_ram); @@ -2486,7 +2486,7 @@ void bloodwar_mcu_run(running_machine *machine) break; default: - logerror("%s : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2, mcu_data); + logerror("%s : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data); break; } } @@ -2512,7 +2512,7 @@ void bonkadv_mcu_run(running_machine *machine) mame_fread(f,&kaneko16_mcu_ram[mcu_offset], 128); mame_fclose(f); } - logerror("%s : MCU executed command: %04X %04X (load NVRAM settings)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2); + logerror("%s : MCU executed command: %04X %04X (load NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2); } break; @@ -2524,7 +2524,7 @@ void bonkadv_mcu_run(running_machine *machine) mame_fwrite(f,&kaneko16_mcu_ram[mcu_offset], 128); mame_fclose(f); } - logerror("%s : MCU executed command: %04X %04X (save NVRAM settings)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2); + logerror("%s : MCU executed command: %04X %04X (save NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2); } break; @@ -2536,20 +2536,20 @@ void bonkadv_mcu_run(running_machine *machine) mame_fwrite(f, bonkadv_mcu_43, sizeof(bonkadv_mcu_43)); mame_fclose(f); } - logerror("%s : MCU executed command: %04X %04X (restore default NVRAM settings)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2); + logerror("%s : MCU executed command: %04X %04X (restore default NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2); } break; case 0x03: // DSW { kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1"); - logerror("%s : MCU executed command: %04X %04X (read DSW)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2); + logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine->describe_context(), mcu_command, mcu_offset*2); } break; case 0x04: // Protection { - logerror("%s : MCU executed command: %04X %04X %04X\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2, mcu_data); + logerror("%s : MCU executed command: %04X %04X %04X\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data); switch(mcu_data) @@ -2571,7 +2571,7 @@ void bonkadv_mcu_run(running_machine *machine) break; default: - logerror("%s : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2, mcu_data); + logerror("%s : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data); break; } } @@ -2594,7 +2594,7 @@ void gtmr_mcu_run(running_machine *machine) UINT16 mcu_offset = kaneko16_mcu_ram[0x0012/2] / 2; UINT16 mcu_data = kaneko16_mcu_ram[0x0014/2]; - logerror("%s : MCU executed command: %04X %04X %04X\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2, mcu_data); + logerror("%s : MCU executed command: %04X %04X %04X\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data); switch (mcu_command >> 8) { diff --git a/src/mame/machine/konppc.c b/src/mame/machine/konppc.c index 5e5dada32f0..95fafaaec52 100644 --- a/src/mame/machine/konppc.c +++ b/src/mame/machine/konppc.c @@ -198,7 +198,7 @@ WRITE32_HANDLER( cgboard_dsp_shared_w_ppc ) { if (cgboard_id < MAX_CG_BOARDS) { - cpuexec_trigger(space->machine, 10000); // Remove the timeout (a part of the GTI Club FIFO test workaround) + space->machine->scheduler().trigger(10000); // Remove the timeout (a part of the GTI Club FIFO test workaround) COMBINE_DATA(dsp_shared_ram[cgboard_id] + (offset + (dsp_shared_ram_bank[cgboard_id] * DSP_BANK_SIZE_WORD))); } } @@ -275,7 +275,7 @@ static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32 } } -// printf("%s:cgboard_dsp_comm_w_sharc: %08X, %08X, %08X\n", cpuexec_describe_context(space->machine), data, offset, mem_mask); +// printf("%s:cgboard_dsp_comm_w_sharc: %08X, %08X, %08X\n", space->machine->describe_context(), data, offset, mem_mask); dsp_comm_sharc[board][offset] = data; } diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c index 33060f795ac..be8ae4db39a 100644 --- a/src/mame/machine/leland.c +++ b/src/mame/machine/leland.c @@ -372,7 +372,7 @@ MACHINE_START( leland ) MACHINE_RESET( leland ) { - timer_adjust_oneshot(master_int_timer, machine->primary_screen->time_until_pos(8), 8); + master_int_timer->adjust(machine->primary_screen->time_until_pos(8), 8); /* reset globals */ leland_gfx_control = 0x00; @@ -422,7 +422,7 @@ MACHINE_START( ataxx ) MACHINE_RESET( ataxx ) { memset(extra_tram, 0, ATAXX_EXTRA_TRAM_SIZE); - timer_adjust_oneshot(master_int_timer, machine->primary_screen->time_until_pos(8), 8); + master_int_timer->adjust(machine->primary_screen->time_until_pos(8), 8); /* initialize the XROM */ xrom_length = machine->region("user1")->bytes(); @@ -471,7 +471,7 @@ static TIMER_CALLBACK( leland_interrupt_callback ) scanline += 16; if (scanline > 248) scanline = 8; - timer_adjust_oneshot(master_int_timer, machine->primary_screen->time_until_pos(scanline), scanline); + master_int_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } @@ -483,7 +483,7 @@ static TIMER_CALLBACK( ataxx_interrupt_callback ) cputag_set_input_line(machine, "master", 0, HOLD_LINE); /* set a timer for the next one */ - timer_adjust_oneshot(master_int_timer, machine->primary_screen->time_until_pos(scanline), scanline); + master_int_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } @@ -598,7 +598,7 @@ void viper_bankswitch(running_machine *machine) address = &master_base[bank_list[alternate_bank & 3]]; if (bank_list[alternate_bank & 3] >= master_length) { - logerror("%s:Master bank %02X out of range!\n", cpuexec_describe_context(machine), alternate_bank & 3); + logerror("%s:Master bank %02X out of range!\n", machine->describe_context(), alternate_bank & 3); address = &master_base[bank_list[0]]; } memory_set_bankptr(machine, "bank1", address); @@ -619,7 +619,7 @@ void offroad_bankswitch(running_machine *machine) address = &master_base[bank_list[alternate_bank & 7]]; if (bank_list[alternate_bank & 7] >= master_length) { - logerror("%s:Master bank %02X out of range!\n", cpuexec_describe_context(machine), alternate_bank & 7); + logerror("%s:Master bank %02X out of range!\n", machine->describe_context(), alternate_bank & 7); address = &master_base[bank_list[0]]; } memory_set_bankptr(machine, "bank1", address); @@ -644,7 +644,7 @@ void ataxx_bankswitch(running_machine *machine) address = &master_base[bank_list[master_bank & 15]]; if (bank_list[master_bank & 15] >= master_length) { - logerror("%s:Master bank %02X out of range!\n", cpuexec_describe_context(machine), master_bank & 15); + logerror("%s:Master bank %02X out of range!\n", machine->describe_context(), master_bank & 15); address = &master_base[bank_list[0]]; } memory_set_bankptr(machine, "bank1", address); @@ -856,14 +856,14 @@ void ataxx_init_eeprom(running_machine *machine, const UINT16 *data) READ8_DEVICE_HANDLER( ataxx_eeprom_r ) { int port = input_port_read(device->machine, "IN2"); - if (LOG_EEPROM) logerror("%s:EE read\n", cpuexec_describe_context(device->machine)); + if (LOG_EEPROM) logerror("%s:EE read\n", device->machine->describe_context()); return port; } WRITE8_DEVICE_HANDLER( ataxx_eeprom_w ) { - if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", cpuexec_describe_context(device->machine), + if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", device->machine->describe_context(), (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1); eeprom_write_bit (device, (data & 0x10) >> 4); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); @@ -957,7 +957,7 @@ static int keycard_r(running_machine *machine) { int result = 0; - if (LOG_KEYCARDS_FULL) logerror(" (%s:keycard_r)\n", cpuexec_describe_context(machine)); + if (LOG_KEYCARDS_FULL) logerror(" (%s:keycard_r)\n", machine->describe_context()); /* if we have a valid keycard read state, we're reading from the keycard */ if (keycard_state & 0x80) @@ -981,7 +981,7 @@ static void keycard_w(running_machine *machine, int data) int new_state = data & 0xb0; int new_clock = data & 0x40; - if (LOG_KEYCARDS_FULL) logerror(" (%s:keycard_w=%02X)\n", cpuexec_describe_context(machine), data); + if (LOG_KEYCARDS_FULL) logerror(" (%s:keycard_w=%02X)\n", machine->describe_context(), data); /* check for going active */ if (!keycard_state && new_state) @@ -1244,7 +1244,7 @@ WRITE8_HANDLER( ataxx_master_output_w ) break; case 0x08: /* */ - timer_adjust_oneshot(master_int_timer, space->machine->primary_screen->time_until_pos(data + 1), data + 1); + master_int_timer->adjust(space->machine->primary_screen->time_until_pos(data + 1), data + 1); break; default: @@ -1353,7 +1353,7 @@ WRITE8_DEVICE_HANDLER( leland_sound_port_w ) /* some bankswitching occurs here */ if (LOG_BANKSWITCHING_M) if ((sound_port_bank ^ data) & 0x24) - logerror("%s:sound_port_bank = %02X\n", cpuexec_describe_context(device->machine), data & 0x24); + logerror("%s:sound_port_bank = %02X\n", device->machine->describe_context(), data & 0x24); sound_port_bank = data & 0x24; (*leland_update_master_bank)(device->machine); } diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c index cee11c5963e..42da7ef69bf 100644 --- a/src/mame/machine/mcr.c +++ b/src/mame/machine/mcr.c @@ -335,7 +335,7 @@ READ8_HANDLER( mcr_ipu_watchdog_r ) { /* watchdog counter is clocked by 7.3728MHz crystal / 16 */ /* watchdog is tripped when 14-bit counter overflows => / 32768 = 14.0625Hz*/ - timer_adjust_oneshot(ipu_watchdog_timer, attotime::from_hz(7372800 / 16 / 32768), 0); + ipu_watchdog_timer->adjust(attotime::from_hz(7372800 / 16 / 32768)); return 0xff; } diff --git a/src/mame/machine/mcr68.c b/src/mame/machine/mcr68.c index 647e161ccca..e256bdf9bef 100644 --- a/src/mame/machine/mcr68.c +++ b/src/mame/machine/mcr68.c @@ -206,7 +206,7 @@ static void mcr68_common_init(running_machine *machine) m6840->control = 0x00; m6840->latch = 0xffff; m6840->count = 0xffff; - timer_enable(m6840->timer, FALSE); + m6840->timer->enable(false); m6840->timer_active = 0; m6840->period = m6840_counter_periods[i]; } @@ -460,7 +460,7 @@ static void reload_count(int counter) /* counter 0 is self-updating if clocked externally */ if (counter == 0 && !(m6840_state[counter].control & 0x02)) { - timer_adjust_oneshot(m6840_state[counter].timer, attotime::never, 0); + m6840_state[counter].timer->adjust(attotime::never); m6840_state[counter].timer_active = 0; return; } @@ -481,7 +481,7 @@ static void reload_count(int counter) /* set the timer */ total_period = period * count; LOG(("reload_count(%d): period = %f count = %d\n", counter, period.as_double(), count)); - timer_adjust_oneshot(m6840_state[counter].timer, total_period, (count << 2) + counter); + m6840_state[counter].timer->adjust(total_period, (count << 2) + counter); m6840_state[counter].timer_active = 1; } @@ -502,7 +502,7 @@ static UINT16 compute_counter(int counter) period = m6840_counter_periods[counter]; /* see how many are left */ - remaining = timer_timeleft(m6840_state[counter].timer).as_attoseconds() / period.as_attoseconds(); + remaining = m6840_state[counter].timer->remaining().as_attoseconds() / period.as_attoseconds(); /* adjust the count for dual byte mode */ if (m6840_state[counter].control & 0x04) @@ -544,7 +544,7 @@ static WRITE8_HANDLER( mcr68_6840_w_common ) { for (i = 0; i < 3; i++) { - timer_adjust_oneshot(m6840_state[i].timer, attotime::never, 0); + m6840_state[i].timer->adjust(attotime::never); m6840_state[i].timer_active = 0; } } diff --git a/src/mame/machine/megadriv.c b/src/mame/machine/megadriv.c index 205d9259432..edf51871027 100644 --- a/src/mame/machine/megadriv.c +++ b/src/mame/machine/megadriv.c @@ -815,7 +815,7 @@ static void megadrive_vdp_set_register(running_machine *machine, int regnum, UIN // if (regnum == 0x0a) // mame_printf_debug("Set HINT Reload Register to %d on scanline %d\n",value, genesis_scanline_counter); -// mame_printf_debug("%s: Setting VDP Register #%02x to %02x\n",cpuexec_describe_context(machine), regnum,value); +// mame_printf_debug("%s: Setting VDP Register #%02x to %02x\n",machine->describe_context(), regnum,value); } static void update_megadrive_vdp_code_and_address(void) @@ -1012,7 +1012,7 @@ static void handle_dma_bits(running_machine *machine) UINT16 length; source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8) | ((MEGADRIVE_REG17_DMASOURCE3&0xff)<<16))<<1; length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8))<<1; - // mame_printf_debug("%s 68k DMAtran set source %06x length %04x dest %04x enabled %01x code %02x %02x\n", cpuexec_describe_context(machine), source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE, megadrive_vdp_code,MEGADRIVE_REG0F_AUTO_INC); + // mame_printf_debug("%s 68k DMAtran set source %06x length %04x dest %04x enabled %01x code %02x %02x\n", machine->describe_context(), source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE, megadrive_vdp_code,MEGADRIVE_REG0F_AUTO_INC); } @@ -1622,7 +1622,7 @@ READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read) } else { - logerror("%s: 68000 attempting to access YM2612 (read) without bus\n", cpuexec_describe_context(device->machine)); + logerror("%s: 68000 attempting to access YM2612 (read) without bus\n", device->machine->describe_context()); return 0; } @@ -1640,7 +1640,7 @@ WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write) } else { - logerror("%s: 68000 attempting to access YM2612 (write) without bus\n", cpuexec_describe_context(device->machine)); + logerror("%s: 68000 attempting to access YM2612 (write) without bus\n", device->machine->describe_context()); } } @@ -1999,7 +1999,7 @@ static void megadrive_io_write_data_port_6button(running_machine *machine, int p if (((megadrive_io_data_regs[portnum]&0x40)==0x00) && ((data&0x40) == 0x40)) { io_stage[portnum]++; - timer_adjust_oneshot(io_timeout[portnum], machine->device<cpu_device>("maincpu")->cycles_to_attotime(8192), 0); + io_timeout[portnum]->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime(8192)); } } @@ -3019,14 +3019,14 @@ static void calculate_pwm_timer(void) /* if both RMD and LMD are set to OFF or pwm cycle register is one, then PWM timer ticks doesn't occur */ if(pwm_cycle == 1 || ((pwm_ctrl & 0xf) == 0)) - timer_adjust_oneshot(_32x_pwm_timer, attotime::never, 0); + _32x_pwm_timer->adjust(attotime::never); else { pwm_timer_tick = 0; lch_fifo_state = rch_fifo_state = 0x4000; lch_index_r = rch_index_r = 0; lch_index_w = rch_index_w = 0; - timer_adjust_oneshot(_32x_pwm_timer, attotime::from_hz((PWM_CLOCK) / (pwm_cycle - 1)), 0); + _32x_pwm_timer->adjust(attotime::from_hz((PWM_CLOCK) / (pwm_cycle - 1))); } } @@ -3071,7 +3071,7 @@ static TIMER_CALLBACK( _32x_pwm_callback ) if(sh2_slave_pwmint_enable) { cpu_set_input_line(_32x_slave_cpu, SH2_PINT_IRQ_LEVEL,ASSERT_LINE); } } - timer_adjust_oneshot(_32x_pwm_timer, attotime::from_hz((PWM_CLOCK) / (pwm_cycle - 1)), 0); + _32x_pwm_timer->adjust(attotime::from_hz((PWM_CLOCK) / (pwm_cycle - 1))); } static READ16_HANDLER( _32x_pwm_r ) @@ -3983,13 +3983,13 @@ static WRITE16_HANDLER( scd_a12002_memory_mode_w ) //printf("main cpu dmna set dmna: %d ret: %d\n", segacd_dmna, segacd_ret); if (segacd_ram_mode==0) { - if (!timer_enabled(segacd_dmna_ret_timer)) + if (!segacd_dmna_ret_timer->enabled()) { if (!segacd_dmna) { //printf("main dmna\n"); segacd_dmna = 1; - timer_adjust_oneshot(segacd_dmna_ret_timer, attotime::from_usec(100), 0); + segacd_dmna_ret_timer->adjust(attotime::from_usec(100)); } } } @@ -4051,14 +4051,14 @@ static WRITE16_HANDLER( segacd_sub_memory_mode_w ) if (segacd_ram_mode==0) { - if (!timer_enabled(segacd_dmna_ret_timer)) + if (!segacd_dmna_ret_timer->enabled()) { if (segacd_dmna) { // printf("sub ret\n"); // segacd_ret = 1; // segacd_dmna = 0; - timer_adjust_oneshot(segacd_dmna_ret_timer, attotime::from_usec(100), 0); + segacd_dmna_ret_timer->adjust(attotime::from_usec(100)); } } } @@ -4098,7 +4098,7 @@ static WRITE16_HANDLER( segacd_sub_memory_mode_w ) // reset it flags etc.? segacd_ret = 0; segacd_dmna = 0; - timer_adjust_oneshot(segacd_dmna_ret_timer, attotime::from_usec(100), 0); + segacd_dmna_ret_timer->adjust(attotime::from_usec(100)); } else { @@ -4983,7 +4983,7 @@ static TIMER_CALLBACK( segacd_hock_callback ) hock_cmd = 0; } - timer_adjust_oneshot(segacd_hock_timer, attotime::from_hz(75), 0); + segacd_hock_timer->adjust(attotime::from_hz(75)); } @@ -5022,16 +5022,16 @@ void segacd_init_main_cpu( running_machine* machine ) memory_install_read16_handler (space, 0x0000070, 0x0000073, 0, 0, scd_hint_vector_r ); segacd_gfx_conversion_timer = machine->scheduler().timer_alloc(FUNC(segacd_gfx_conversion_timer_callback)); - timer_adjust_oneshot(segacd_gfx_conversion_timer, attotime::never, 0); + segacd_gfx_conversion_timer->adjust(attotime::never); segacd_dmna_ret_timer = machine->scheduler().timer_alloc(FUNC(segacd_dmna_ret_timer_callback)); - timer_adjust_oneshot(segacd_gfx_conversion_timer, attotime::never, 0); + segacd_gfx_conversion_timer->adjust(attotime::never); segacd_hock_timer = machine->scheduler().timer_alloc(FUNC(segacd_hock_callback)); - timer_adjust_oneshot(segacd_hock_timer, attotime::never, 0); + segacd_hock_timer->adjust(attotime::never); segacd_irq3_timer = machine->scheduler().timer_alloc(FUNC(segacd_irq3_timer_callback)); - timer_adjust_oneshot(segacd_irq3_timer, attotime::never, 0); + segacd_irq3_timer->adjust(attotime::never); @@ -5112,8 +5112,8 @@ static MACHINE_RESET( segacd ) segacd_ram_mode = 0; segacd_ram_mode_old = 0; - timer_adjust_oneshot(segacd_dmna_ret_timer, attotime::zero, 0); - timer_adjust_oneshot(segacd_hock_timer, attotime::zero, 0); + segacd_dmna_ret_timer->adjust(attotime::zero); + segacd_hock_timer->adjust(attotime::zero); hock_cmd = 0; } @@ -5288,9 +5288,9 @@ static WRITE16_HANDLER( segacd_cdd_ctrl_w ) hock_cmd = (data & 4) >> 2; if(data & 4) // enable Hock timer - timer_adjust_oneshot(segacd_hock_timer, attotime::from_hz(75), 0); + segacd_hock_timer->adjust(attotime::from_hz(75)); else - timer_adjust_oneshot(segacd_hock_timer, attotime::never, 0); + segacd_hock_timer->adjust(attotime::never); } /* 68k <- CDD communication comms are 4-bit wide */ @@ -5724,7 +5724,7 @@ WRITE16_HANDLER( segacd_trace_vector_base_address_w ) segacd_conversion_active = 1; // todo: proper time calculation - timer_adjust_oneshot(segacd_gfx_conversion_timer, attotime::from_hz(500), 0); + segacd_gfx_conversion_timer->adjust(attotime::from_hz(500)); int line; @@ -5873,9 +5873,9 @@ static WRITE16_HANDLER( segacd_irq3timer_w ) // time = reg * 30.72 us if (segacd_irq3_timer_reg) - timer_adjust_oneshot(segacd_irq3_timer, SEGACD_IRQ3_TIMER_SPEED, 0); + segacd_irq3_timer->adjust(SEGACD_IRQ3_TIMER_SPEED); else - timer_adjust_oneshot(segacd_irq3_timer, attotime::never, 0); + segacd_irq3_timer->adjust(attotime::never); printf("segacd_irq3timer_w %02x\n", segacd_irq3_timer_reg); } @@ -5886,7 +5886,7 @@ static TIMER_CALLBACK( segacd_irq3_timer_callback ) if (segacd_irq_mask & 0x08) cputag_set_input_line(machine, "segacd_68k", 3, HOLD_LINE); - timer_adjust_oneshot(segacd_irq3_timer, SEGACD_IRQ3_TIMER_SPEED, 0); + segacd_irq3_timer->adjust(SEGACD_IRQ3_TIMER_SPEED); } @@ -8960,7 +8960,7 @@ static void megadriv_init_common(running_machine *machine) if(_32x_is_connected) { _32x_pwm_timer = machine->scheduler().timer_alloc(FUNC(_32x_pwm_callback)); - timer_adjust_oneshot(_32x_pwm_timer, attotime::never, 0); + _32x_pwm_timer->adjust(attotime::never); } sega_cd_connected = 0; diff --git a/src/mame/machine/meters.c b/src/mame/machine/meters.c index bfb3db7e361..c89eca21ac7 100644 --- a/src/mame/machine/meters.c +++ b/src/mame/machine/meters.c @@ -40,7 +40,7 @@ void MechMtr_config(running_machine *machine, int number) meter_info[i].count = 0; meter_info[i].on = 0; meter_info[i].meter_timer = machine->scheduler().timer_alloc(FUNC(meter_callback), (void*)(FPTR)i); - timer_reset(meter_info[i].meter_timer, attotime::never); + meter_info[i].meter_timer->reset(); } number_mtr = number; } @@ -104,12 +104,12 @@ int MechMtr_update(int id, int state) if ( state ) { meter_info[id].on =1; - timer_adjust_oneshot(meter_info[id].meter_timer, attotime::from_seconds(meter_info[id].reacttime), id); + meter_info[id].meter_timer->adjust(attotime::from_seconds(meter_info[id].reacttime), id); } else { meter_info[id].on =0; - timer_adjust_oneshot(meter_info[id].meter_timer, attotime::never, id); + meter_info[id].meter_timer->adjust(attotime::never, id); } } diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c index 2306f379c2b..d4fa1013f09 100644 --- a/src/mame/machine/micro3d.c +++ b/src/mame/machine/micro3d.c @@ -172,7 +172,7 @@ WRITE16_HANDLER( micro3d_mc68901_w ) /* Timer stopped */ if (mode == 0) { - timer_enable(state->mc68901.timer_a, 0); + state->mc68901.timer_a->enable(false); } else if (mode < 8) { @@ -192,7 +192,7 @@ WRITE16_HANDLER( micro3d_mc68901_w ) period = attotime::from_hz(4000000 / divisor) * data; - timer_adjust_periodic(state->mc68901.timer_a, period, 0, period); + state->mc68901.timer_a->adjust(period, 0, period); } else { @@ -701,7 +701,7 @@ WRITE16_HANDLER( micro3d_reset_w ) WRITE16_HANDLER( host_drmath_int_w ) { cputag_set_input_line(space->machine, "drmath", AM29000_INTR2, ASSERT_LINE); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(10)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); } diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c index d007f571e18..e9ad14988b6 100644 --- a/src/mame/machine/midwayic.c +++ b/src/mame/machine/midwayic.c @@ -207,7 +207,7 @@ UINT8 midway_serial_pic_status_r(void) UINT8 midway_serial_pic_r(address_space *space) { - logerror("%s:security R = %04X\n", cpuexec_describe_context(space->machine), serial.buffer); + logerror("%s:security R = %04X\n", space->machine->describe_context(), serial.buffer); serial.status = 1; return serial.buffer; } @@ -215,7 +215,7 @@ UINT8 midway_serial_pic_r(address_space *space) void midway_serial_pic_w(address_space *space, UINT8 data) { - logerror("%s:security W = %04X\n", cpuexec_describe_context(space->machine), data); + logerror("%s:security W = %04X\n", space->machine->describe_context(), data); /* status seems to reflect the clock bit */ serial.status = (data >> 4) & 1; @@ -307,7 +307,7 @@ UINT8 midway_serial_pic2_status_r(address_space *space) result = 1; } - logerror("%s:PIC status %d\n", cpuexec_describe_context(space->machine), result); + logerror("%s:PIC status %d\n", space->machine->describe_context(), result); return result; } @@ -317,7 +317,7 @@ UINT8 midway_serial_pic2_r(address_space *space) UINT8 result = 0; /* PIC data register */ - logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", cpuexec_describe_context(space->machine), pic.index, pic.total, pic.latch); + logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", space->machine->describe_context(), pic.index, pic.total, pic.latch); /* return the current result */ if (pic.latch & 0xf00) @@ -341,9 +341,9 @@ void midway_serial_pic2_w(address_space *space, UINT8 data) /* PIC command register */ if (pic.state == 0) - logerror("%s:PIC command %02X\n", cpuexec_describe_context(machine), data); + logerror("%s:PIC command %02X\n", machine->describe_context(), data); else - logerror("%s:PIC data %02X\n", cpuexec_describe_context(machine), data); + logerror("%s:PIC data %02X\n", machine->describe_context(), data); /* store in the latch, along with a bit to indicate we have data */ pic.latch = (data & 0x00f) | 0x480; @@ -436,7 +436,7 @@ void midway_serial_pic2_w(address_space *space, UINT8 data) /* otherwise, flag the time as having just been written for 1/2 second */ else { - timer_adjust_oneshot(pic.time_write_timer, attotime::from_msec(500), 0); + pic.time_write_timer->adjust(attotime::from_msec(500)); pic.time_just_written = 1; pic.state = 0; } @@ -801,7 +801,7 @@ void midway_ioasic_fifo_reset_w(running_machine *machine, int state) update_ioasic_irq(machine); } if (LOG_FIFO) - logerror("%s:fifo_reset(%d)\n", cpuexec_describe_context(machine), state); + logerror("%s:fifo_reset(%d)\n", machine->describe_context(), state); } diff --git a/src/mame/machine/mw8080bw.c b/src/mame/machine/mw8080bw.c index 381661fcdb1..92a62628b73 100644 --- a/src/mame/machine/mw8080bw.c +++ b/src/mame/machine/mw8080bw.c @@ -68,7 +68,7 @@ static TIMER_CALLBACK( mw8080bw_interrupt_callback ) } next_vpos = vysnc_chain_counter_to_vpos(next_counter, next_vblank); - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(next_vpos), 0); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(next_vpos)); } @@ -83,7 +83,7 @@ static void mw8080bw_start_interrupt_timer( running_machine *machine ) { mw8080bw_state *state = machine->driver_data<mw8080bw_state>(); int vpos = vysnc_chain_counter_to_vpos(MW8080BW_INT_TRIGGER_COUNT_1, MW8080BW_INT_TRIGGER_VBLANK_1); - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(vpos), 0); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(vpos)); } diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c index 4b6aab0c330..991644ed92a 100644 --- a/src/mame/machine/n64.c +++ b/src/mame/machine/n64.c @@ -430,7 +430,7 @@ static void sp_set_status(device_t *device, UINT32 status) { if (status & 0x1) { - //cpuexec_trigger(device->machine, 6789); + //device->machine->scheduler().trigger(6789); cpu_set_input_line(device, INPUT_LINE_HALT, ASSERT_LINE); cpu_set_reg(device, RSP_SR, cpu_get_reg(device, RSP_SR) | RSP_STATUS_HALT); @@ -1125,7 +1125,7 @@ static void start_audio_dma(running_machine *machine) // adjust the timer period = attotime::from_hz(DACRATE_NTSC) * ((ai_dacrate + 1) * (current->length / 4)); - timer_adjust_oneshot(audio_timer, period, 0); + audio_timer->adjust(period); } static TIMER_CALLBACK( audio_timer_callback ) @@ -1156,7 +1156,7 @@ READ32_HANDLER( n64_ai_reg_r ) } else if (ai_status & 0x40000000) { - double secs_left = (timer_firetime(audio_timer) - space->machine->time()).as_double(); + double secs_left = (audio_timer->expire() - space->machine->time()).as_double(); unsigned int samples_left = secs_left * DACRATE_NTSC / (ai_dacrate + 1); return samples_left * 4; } @@ -2077,7 +2077,7 @@ MACHINE_RESET( n64 ) cic_status = 0; - timer_adjust_oneshot(audio_timer, attotime::never, 0); + audio_timer->adjust(attotime::never); cputag_set_input_line(machine, "rsp", INPUT_LINE_HALT, ASSERT_LINE); diff --git a/src/mame/machine/namco06.c b/src/mame/machine/namco06.c index 184923d3d54..9a3712a47f5 100644 --- a/src/mame/machine/namco06.c +++ b/src/mame/machine/namco06.c @@ -136,11 +136,11 @@ READ8_DEVICE_HANDLER( namco_06xx_data_r ) UINT8 result = 0xff; int devnum; - LOG(("%s: 06XX '%s' read offset %d\n",cpuexec_describe_context(device->machine),device->tag(),offset)); + LOG(("%s: 06XX '%s' read offset %d\n",device->machine->describe_context(),device->tag(),offset)); if (!(state->control & 0x10)) { - logerror("%s: 06XX '%s' read in write mode %02x\n",cpuexec_describe_context(device->machine),device->tag(),state->control); + logerror("%s: 06XX '%s' read in write mode %02x\n",device->machine->describe_context(),device->tag(),state->control); return 0; } @@ -157,11 +157,11 @@ WRITE8_DEVICE_HANDLER( namco_06xx_data_w ) namco_06xx_state *state = get_safe_token(device); int devnum; - LOG(("%s: 06XX '%s' write offset %d = %02x\n",cpuexec_describe_context(device->machine),device->tag(),offset,data)); + LOG(("%s: 06XX '%s' write offset %d = %02x\n",device->machine->describe_context(),device->tag(),offset,data)); if (state->control & 0x10) { - logerror("%s: 06XX '%s' write in read mode %02x\n",cpuexec_describe_context(device->machine),device->tag(),state->control); + logerror("%s: 06XX '%s' write in read mode %02x\n",device->machine->describe_context(),device->tag(),state->control); return; } @@ -174,7 +174,7 @@ WRITE8_DEVICE_HANDLER( namco_06xx_data_w ) READ8_DEVICE_HANDLER( namco_06xx_ctrl_r ) { namco_06xx_state *state = get_safe_token(device); - LOG(("%s: 06XX '%s' ctrl_r\n",cpuexec_describe_context(device->machine),device->tag())); + LOG(("%s: 06XX '%s' ctrl_r\n",device->machine->describe_context(),device->tag())); return state->control; } @@ -183,14 +183,14 @@ WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w ) namco_06xx_state *state = get_safe_token(device); int devnum; - LOG(("%s: 06XX '%s' control %02x\n",cpuexec_describe_context(device->machine),device->tag(),data)); + LOG(("%s: 06XX '%s' control %02x\n",device->machine->describe_context(),device->tag(),data)); state->control = data; if ((state->control & 0x0f) == 0) { LOG(("disabling nmi generate timer\n")); - timer_adjust_oneshot(state->nmi_timer, attotime::never, 0); + state->nmi_timer->adjust(attotime::never); } else { @@ -200,7 +200,7 @@ WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w ) // inputs if a transfer terminates at the wrong time. // On the other hand, the time cannot be too short otherwise the 54XX will // not have enough time to process the incoming controls. - timer_adjust_periodic(state->nmi_timer, attotime::from_usec(200), 0, attotime::from_usec(200)); + state->nmi_timer->adjust(attotime::from_usec(200), 0, attotime::from_usec(200)); if (state->control & 0x10) for (devnum = 0; devnum < 4; devnum++) diff --git a/src/mame/machine/namco51.c b/src/mame/machine/namco51.c index 2cd7227bd01..fdecaf6b51c 100644 --- a/src/mame/machine/namco51.c +++ b/src/mame/machine/namco51.c @@ -98,7 +98,7 @@ WRITE8_DEVICE_HANDLER( namco_51xx_write ) data &= 0x07; - LOG(("%s: custom 51XX write %02x\n",cpuexec_describe_context(device->machine),data)); + LOG(("%s: custom 51XX write %02x\n",device->machine->describe_context(),data)); if (state->coincred_mode) { @@ -196,7 +196,7 @@ READ8_DEVICE_HANDLER( namco_51xx_read ) { namco_51xx_state *state = get_safe_token(device); - LOG(("%s: custom 51XX read\n",cpuexec_describe_context(device->machine))); + LOG(("%s: custom 51XX read\n",device->machine->describe_context())); if (state->mode == 0) /* switch mode */ { diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c index 9518c1aeb14..ac0edb4eaa6 100644 --- a/src/mame/machine/namcos1.c +++ b/src/mame/machine/namcos1.c @@ -736,8 +736,8 @@ static void namcos1_bankswitch(running_machine *machine, int cpu, offs_t offset, /* unmapped bank warning */ if( namcos1_active_bank[bank].bank_handler_r == unknown_r) { - logerror("%s:warning unknown chip selected bank %x=$%04x\n", cpuexec_describe_context(machine), bank , chip[bank] ); -// if (chip) popmessage("%s:unknown chip selected bank %x=$%04x", cpu , cpuexec_describe_context(machine), bank , chip[bank] ); + logerror("%s:warning unknown chip selected bank %x=$%04x\n", machine->describe_context(), bank , chip[bank] ); +// if (chip) popmessage("%s:unknown chip selected bank %x=$%04x", cpu , machine->describe_context(), bank , chip[bank] ); } } diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c index 5f310d92a47..1f3f1605678 100644 --- a/src/mame/machine/namcos2.c +++ b/src/mame/machine/namcos2.c @@ -131,7 +131,7 @@ MACHINE_RESET( namcos2 ) InitC148(); /* reset POSIRQ timer */ - timer_adjust_oneshot(namcos2_posirq_timer, attotime::never, 0); + namcos2_posirq_timer->adjust(attotime::never); } /*************************************************************/ @@ -669,7 +669,7 @@ static TIMER_CALLBACK( namcos2_posirq_tick ) void namcos2_adjust_posirq_timer( running_machine *machine, int scanline ) { - timer_adjust_oneshot(namcos2_posirq_timer, machine->primary_screen->time_until_pos(scanline, 80), scanline); + namcos2_posirq_timer->adjust(machine->primary_screen->time_until_pos(scanline, 80), scanline); } INTERRUPT_GEN( namcos2_68k_master_vblank ) diff --git a/src/mame/machine/naomibd.c b/src/mame/machine/naomibd.c index da3deb08d99..9140cdc9b58 100644 --- a/src/mame/machine/naomibd.c +++ b/src/mame/machine/naomibd.c @@ -586,7 +586,7 @@ READ64_DEVICE_HANDLER( naomibd_r ) } else { - //mame_printf_verbose("%s:ROM: read mask %" I64FMT "x @ %x\n", cpuexec_describe_context(machine), mem_mask, offset); + //mame_printf_verbose("%s:ROM: read mask %" I64FMT "x @ %x\n", machine->describe_context(), mem_mask, offset); } return U64(0xffffffffffffffff); @@ -733,7 +733,7 @@ WRITE64_DEVICE_HANDLER( naomibd_w ) v->prot_key = data; #if NAOMIBD_PRINTF_PROTECTION - printf("Protection: set up read @ %x, key %x sum %x (PIO %x DMA %x) [%s]\n", v->prot_offset*2, v->prot_key, v->prot_sum, v->rom_offset, v->dma_offset, cpuexec_describe_context(device->machine)); + printf("Protection: set up read @ %x, key %x sum %x (PIO %x DMA %x) [%s]\n", v->prot_offset*2, v->prot_key, v->prot_sum, v->rom_offset, v->dma_offset, device->machine->describe_context()); v->prot_pio_count = 0; #endif @@ -914,7 +914,7 @@ WRITE64_DEVICE_HANDLER( naomibd_w ) } break; default: - mame_printf_verbose("%s: ROM: write %" I64FMT "x to %x, mask %" I64FMT "x\n", cpuexec_describe_context(device->machine), data, offset, mem_mask); + mame_printf_verbose("%s: ROM: write %" I64FMT "x to %x, mask %" I64FMT "x\n", device->machine->describe_context(), data, offset, mem_mask); break; } } diff --git a/src/mame/machine/pcshare.c b/src/mame/machine/pcshare.c index 79d1ee35795..917a817fe05 100644 --- a/src/mame/machine/pcshare.c +++ b/src/mame/machine/pcshare.c @@ -99,14 +99,14 @@ void pc_keyb_set_clock(int on) if (pc_keyb.on != on) { if (!on) - timer_adjust_oneshot(pc_keyb.timer, attotime::from_msec(5), 0); + pc_keyb.timer->adjust(attotime::from_msec(5)); else { if ( pc_keyb.self_test ) { /* The self test of the keyboard takes some time. 2 msec seems to work. */ /* This still needs to verified against a real keyboard. */ - timer_adjust_oneshot(pc_keyb.timer, attotime::from_msec( 2 ), 0); + pc_keyb.timer->adjust(attotime::from_msec( 2 )); } else { - timer_reset(pc_keyb.timer, attotime::never); + pc_keyb.timer->reset(); pc_keyb.self_test = 0; } } diff --git a/src/mame/machine/pitnrun.c b/src/mame/machine/pitnrun.c index 6807029884f..16a52f6141f 100644 --- a/src/mame/machine/pitnrun.c +++ b/src/mame/machine/pitnrun.c @@ -44,7 +44,7 @@ static TIMER_CALLBACK( pitnrun_mcu_real_data_w ) WRITE8_HANDLER( pitnrun_mcu_data_w ) { space->machine->scheduler().synchronize(FUNC(pitnrun_mcu_real_data_w), data); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(5)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(5)); } READ8_HANDLER( pitnrun_mcu_status_r ) diff --git a/src/mame/machine/psx.c b/src/mame/machine/psx.c index 26607e48ccc..77764f6319a 100644 --- a/src/mame/machine/psx.c +++ b/src/mame/machine/psx.c @@ -137,7 +137,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( psx_machine *p_psx, int n_level, const va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror( "%s: %s", cpuexec_describe_context(p_psx->machine), buf ); + logerror( "%s: %s", p_psx->machine->describe_context(), buf ); } } @@ -245,7 +245,7 @@ static void dma_start_timer( psx_machine *p_psx, int n_channel, UINT32 n_ticks ) { psx_dma_channel *dma = &p_psx->channel[ n_channel ]; - timer_adjust_oneshot( dma->timer, attotime::from_hz(33868800) * n_ticks, n_channel); + dma->timer->adjust( attotime::from_hz(33868800) * n_ticks, n_channel); dma->n_ticks = n_ticks; dma->b_running = 1; } @@ -254,7 +254,7 @@ static void dma_stop_timer( psx_machine *p_psx, int n_channel ) { psx_dma_channel *dma = &p_psx->channel[ n_channel ]; - timer_adjust_oneshot( dma->timer, attotime::never, 0); + dma->timer->adjust( attotime::never); dma->b_running = 0; } @@ -656,7 +656,7 @@ static void root_timer_adjust( psx_machine *p_psx, int n_counter ) if( ( root->n_mode & PSX_RC_STOP ) != 0 ) { - timer_adjust_oneshot( root->timer, attotime::never, n_counter); + root->timer->adjust( attotime::never, n_counter); } else { @@ -670,7 +670,7 @@ static void root_timer_adjust( psx_machine *p_psx, int n_counter ) n_duration *= root_divider( p_psx, n_counter ); - timer_adjust_oneshot( root->timer, attotime::from_hz(33868800) * n_duration, n_counter); + root->timer->adjust( attotime::from_hz(33868800) * n_duration, n_counter); } } @@ -827,7 +827,7 @@ static void sio_timer_adjust( psx_machine *p_psx, int n_port ) n_time = attotime::never; verboselog( p_psx, 2, "sio_timer_adjust( %d ) finished\n", n_port ); } - timer_adjust_oneshot( sio->timer, n_time, n_port); + sio->timer->adjust( n_time, n_port); } static TIMER_CALLBACK( sio_clock ) diff --git a/src/mame/machine/qix.c b/src/mame/machine/qix.c index 95318adf20b..528d365a6a3 100644 --- a/src/mame/machine/qix.c +++ b/src/mame/machine/qix.c @@ -375,7 +375,7 @@ static WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w ) cputag_set_input_line(device->machine, "mcu", M68705_IRQ_LINE, ASSERT_LINE); /* temporarily boost the interleave to sync things up */ /* note: I'm using 50 because 30 is not enough for space dungeon at game over */ - cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(50)); + device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); } else cputag_set_input_line(device->machine, "mcu", M68705_IRQ_LINE, CLEAR_LINE); diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c index 1b01fa9d5d7..1e26d135572 100644 --- a/src/mame/machine/scramble.c +++ b/src/mame/machine/scramble.c @@ -71,7 +71,7 @@ static READ8_DEVICE_HANDLER( scramble_protection_r ) case 0x1ca2: return 0x00; /* I don't think it's checked */ case 0x1d7e: return 0xb0; default: - logerror("%s: read protection\n",cpuexec_describe_context(device->machine)); + logerror("%s: read protection\n",device->machine->describe_context()); return 0; } } diff --git a/src/mame/machine/segamsys.c b/src/mame/machine/segamsys.c index e9b6bb595f9..8ff329fdbd0 100644 --- a/src/mame/machine/segamsys.c +++ b/src/mame/machine/segamsys.c @@ -446,7 +446,7 @@ static void *start_vdp(running_machine *machine, int type) /* stop timer and clear ram.. used on megatech when we switch between genesis and sms mode */ void segae_md_sms_stop_scanline_timer(void) { - timer_adjust_oneshot(md_sms_vdp->sms_scanline_timer, attotime::never, 0); + md_sms_vdp->sms_scanline_timer->adjust(attotime::never); memset(md_sms_vdp->vram,0x00,0x4000); } @@ -1008,7 +1008,7 @@ static TIMER_CALLBACK( sms_scanline_timer_callback ) if (chip->sms_scanline_counter<(chip->sms_total_scanlines-1)) { chip->sms_scanline_counter++; - timer_adjust_oneshot(chip->sms_scanline_timer, attotime::from_hz(chip->sms_framerate * chip->sms_total_scanlines), 0); + chip->sms_scanline_timer->adjust(attotime::from_hz(chip->sms_framerate * chip->sms_total_scanlines)); if (chip->sms_scanline_counter>sms_mode_table[chip->screen_mode].sms2_height) { @@ -1175,7 +1175,7 @@ static void end_of_frame(running_machine *machine, struct sms_vdp *chip) chip->sms_scanline_counter = -1; chip->yscroll = chip->regs[0x9]; // this can't change mid-frame - timer_adjust_oneshot(chip->sms_scanline_timer, attotime::zero, 0); + chip->sms_scanline_timer->adjust(attotime::zero); } @@ -1198,7 +1198,7 @@ VIDEO_START(sms) MACHINE_RESET(sms) { - timer_adjust_oneshot(md_sms_vdp->sms_scanline_timer, attotime::zero, 0); + md_sms_vdp->sms_scanline_timer->adjust(attotime::zero); } @@ -1234,18 +1234,18 @@ void segae_set_vram_banks(UINT8 data) MACHINE_RESET(systeme) { - timer_adjust_oneshot(vdp1->sms_scanline_timer, attotime::zero, 0); - timer_adjust_oneshot(vdp2->sms_scanline_timer, attotime::zero, 0); + vdp1->sms_scanline_timer->adjust(attotime::zero); + vdp2->sms_scanline_timer->adjust(attotime::zero); } MACHINE_RESET(megatech_md_sms) { - timer_adjust_oneshot(md_sms_vdp->sms_scanline_timer, attotime::zero, 0); + md_sms_vdp->sms_scanline_timer->adjust(attotime::zero); } MACHINE_RESET(megatech_bios) { - timer_adjust_oneshot(vdp1->sms_scanline_timer, attotime::zero, 0); + vdp1->sms_scanline_timer->adjust(attotime::zero); } VIDEO_EOF(systeme) diff --git a/src/mame/machine/slapstic.c b/src/mame/machine/slapstic.c index 33785e3e022..af2457f6ef0 100644 --- a/src/mame/machine/slapstic.c +++ b/src/mame/machine/slapstic.c @@ -1149,7 +1149,7 @@ static void slapstic_log(running_machine *machine, offs_t offset) fprintf(slapsticlog, "------------------------------------\n"); last_time = time; - fprintf(slapsticlog, "%s: %04X B=%d ", cpuexec_describe_context(machine), offset, current_bank); + fprintf(slapsticlog, "%s: %04X B=%d ", machine->describe_context(), offset, current_bank); switch (state) { case DISABLED: diff --git a/src/mame/machine/slikshot.c b/src/mame/machine/slikshot.c index c16f2ec2b94..0da4c3e9e2d 100644 --- a/src/mame/machine/slikshot.c +++ b/src/mame/machine/slikshot.c @@ -516,7 +516,7 @@ static TIMER_CALLBACK( delayed_z80_control_w ) } /* boost the interleave whenever this is written to */ - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(100)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); /* stash the new value */ z80_ctrl = data; diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c index 7611a431d70..e590d1a4983 100644 --- a/src/mame/machine/snes.c +++ b/src/mame/machine/snes.c @@ -107,7 +107,7 @@ static TIMER_CALLBACK( snes_nmi_tick ) cpu_set_input_line(state->maincpu, G65816_LINE_NMI, ASSERT_LINE); // don't happen again - timer_adjust_oneshot(state->nmi_timer, attotime::never, 0); + state->nmi_timer->adjust(attotime::never); } static void snes_hirq_tick( running_machine *machine ) @@ -121,7 +121,7 @@ static void snes_hirq_tick( running_machine *machine ) cpu_set_input_line(state->maincpu, G65816_LINE_IRQ, ASSERT_LINE); // don't happen again - timer_adjust_oneshot(state->hirq_timer, attotime::never, 0); + state->hirq_timer->adjust(attotime::never); } static TIMER_CALLBACK( snes_hirq_tick_callback ) @@ -157,7 +157,7 @@ static TIMER_CALLBACK( snes_update_io ) state->io_read(cpu0space->machine); snes_ram[HVBJOY] &= 0xfe; /* Clear busy bit */ - timer_adjust_oneshot(state->io_timer, attotime::never, 0); + state->io_timer->adjust(attotime::never); } static TIMER_CALLBACK( snes_scanline_tick ) @@ -205,7 +205,7 @@ static TIMER_CALLBACK( snes_scanline_tick ) } else { - timer_adjust_oneshot(state->hirq_timer, machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert, pixel * state->htmult), 0); + state->hirq_timer->adjust(machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert, pixel * state->htmult)); } } } @@ -221,11 +221,11 @@ static TIMER_CALLBACK( snes_scanline_tick ) if (snes_ram[NMITIMEN] & 0x80) /* NMI only signaled if this bit set */ { // NMI goes off about 12 cycles after this (otherwise Chrono Trigger, NFL QB Club, etc. lock up) - timer_adjust_oneshot(state->nmi_timer, state->maincpu->cycles_to_attotime(12), 0); + state->nmi_timer->adjust(state->maincpu->cycles_to_attotime(12)); } /* three lines after start of vblank we update the controllers (value from snes9x) */ - timer_adjust_oneshot(state->io_timer, machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert + 2, state->hblank_offset * state->htmult), 0); + state->io_timer->adjust(machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert + 2, state->hblank_offset * state->htmult)); } // hdma reset happens at scanline 0, H=~6 @@ -245,8 +245,8 @@ static TIMER_CALLBACK( snes_scanline_tick ) cpu_set_input_line(state->maincpu, G65816_LINE_NMI, CLEAR_LINE ); } - timer_adjust_oneshot(state->scanline_timer, attotime::never, 0); - timer_adjust_oneshot(state->hblank_timer, machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert, state->hblank_offset * state->htmult), 0); + state->scanline_timer->adjust(attotime::never); + state->hblank_timer->adjust(machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert, state->hblank_offset * state->htmult)); // printf("%02x %d\n",snes_ram[HVBJOY],snes_ppu.beam.current_vert); } @@ -261,7 +261,7 @@ static TIMER_CALLBACK( snes_hblank_tick ) snes_ppu.beam.current_vert = machine->primary_screen->vpos(); /* make sure we halt */ - timer_adjust_oneshot(state->hblank_timer, attotime::never, 0); + state->hblank_timer->adjust(attotime::never); /* draw a scanline */ if (snes_ppu.beam.current_vert <= snes_ppu.beam.last_visible_line) @@ -286,7 +286,7 @@ static TIMER_CALLBACK( snes_hblank_tick ) nextscan = 0; } - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(nextscan), 0); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(nextscan)); } /* FIXME: multiplication should take 8 CPU cycles & division 16 CPU cycles, but @@ -616,7 +616,7 @@ WRITE8_HANDLER( snes_w_io ) { // printf("816: %02x to APU @ %d (PC=%06x)\n", data, offset & 3,cpu_get_pc(space->cpu)); spc_port_in(state->spc700, offset & 0x3, data); - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(20)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(20)); return; } @@ -711,7 +711,7 @@ WRITE8_HANDLER( snes_w_io ) break; case WRMPYB: /* Multiplier B */ snes_ram[WRMPYB] = data; -// timer_adjust_oneshot(state->mult_timer, state->maincpu->cycles_to_attotime(8), 0); +// state->mult_timer->adjust(state->maincpu->cycles_to_attotime(8)); { UINT32 c = snes_ram[WRMPYA] * snes_ram[WRMPYB]; snes_ram[RDMPYL] = c & 0xff; @@ -723,7 +723,7 @@ WRITE8_HANDLER( snes_w_io ) break; case WRDVDD: /* Divisor */ snes_ram[WRDVDD] = data; -// timer_adjust_oneshot(state->div_timer, state->maincpu->cycles_to_attotime(16), 0); +// state->div_timer->adjust(state->maincpu->cycles_to_attotime(16)); { UINT16 value, dividend, remainder; dividend = remainder = 0; @@ -1709,24 +1709,24 @@ static void snes_init_timers( running_machine *machine ) /* init timers and stop them */ state->scanline_timer = machine->scheduler().timer_alloc(FUNC(snes_scanline_tick)); - timer_adjust_oneshot(state->scanline_timer, attotime::never, 0); + state->scanline_timer->adjust(attotime::never); state->hblank_timer = machine->scheduler().timer_alloc(FUNC(snes_hblank_tick)); - timer_adjust_oneshot(state->hblank_timer, attotime::never, 0); + state->hblank_timer->adjust(attotime::never); state->nmi_timer = machine->scheduler().timer_alloc(FUNC(snes_nmi_tick)); - timer_adjust_oneshot(state->nmi_timer, attotime::never, 0); + state->nmi_timer->adjust(attotime::never); state->hirq_timer = machine->scheduler().timer_alloc(FUNC(snes_hirq_tick_callback)); - timer_adjust_oneshot(state->hirq_timer, attotime::never, 0); + state->hirq_timer->adjust(attotime::never); state->div_timer = machine->scheduler().timer_alloc(FUNC(snes_div_callback)); - timer_adjust_oneshot(state->div_timer, attotime::never, 0); + state->div_timer->adjust(attotime::never); state->mult_timer = machine->scheduler().timer_alloc(FUNC(snes_mult_callback)); - timer_adjust_oneshot(state->mult_timer, attotime::never, 0); + state->mult_timer->adjust(attotime::never); state->io_timer = machine->scheduler().timer_alloc(FUNC(snes_update_io)); - timer_adjust_oneshot(state->io_timer, attotime::never, 0); + state->io_timer->adjust(attotime::never); // SNES hcounter has a 0-339 range. hblank starts at counter 260. // clayfighter sets an HIRQ at 260, apparently it wants it to be before hdma kicks off, so we'll delay 2 pixels. state->hblank_offset = 274; - timer_adjust_oneshot(state->hblank_timer, machine->primary_screen->time_until_pos(((snes_ram[STAT78] & 0x10) == SNES_NTSC) ? SNES_VTOTAL_NTSC - 1 : SNES_VTOTAL_PAL - 1, state->hblank_offset), 0); + state->hblank_timer->adjust(machine->primary_screen->time_until_pos(((snes_ram[STAT78] & 0x10) == SNES_NTSC) ? SNES_VTOTAL_NTSC - 1 : SNES_VTOTAL_PAL - 1, state->hblank_offset)); } static void snes_init_ram( running_machine *machine ) diff --git a/src/mame/machine/starwars.c b/src/mame/machine/starwars.c index c402a3cc8f7..b0d98320619 100644 --- a/src/mame/machine/starwars.c +++ b/src/mame/machine/starwars.c @@ -360,7 +360,7 @@ static void run_mproc(running_machine *machine) M_STOP--; /* Decrease count */ } - timer_adjust_oneshot(state->math_timer, attotime::from_hz(MASTER_CLOCK) * mptime, 1); + state->math_timer->adjust(attotime::from_hz(MASTER_CLOCK) * mptime, 1); } diff --git a/src/mame/machine/stvcd.c b/src/mame/machine/stvcd.c index d4b5b1f3a0a..0c0197676ef 100644 --- a/src/mame/machine/stvcd.c +++ b/src/mame/machine/stvcd.c @@ -377,7 +377,7 @@ static UINT16 cd_readWord(UINT32 addr) hirqreg = rv; -// CDROM_LOG(("%s:RW HIRQ: %04x\n", cpuexec_describe_context(Machine), rv)) +// CDROM_LOG(("%s:RW HIRQ: %04x\n", Machine->describe_context(), rv)) return rv; @@ -443,7 +443,7 @@ static UINT16 cd_readWord(UINT32 addr) return rv; default: - CDROM_LOG(("%s:CD: RW %08x\n", cpuexec_describe_context(machine), addr)) + CDROM_LOG(("%s:CD: RW %08x\n", machine->describe_context(), addr)) return 0xffff; } @@ -517,7 +517,7 @@ static UINT32 cd_readLong(UINT32 addr) return rv; default: - CDROM_LOG(("%s:CD: RL %08x\n", cpuexec_describe_context(machine), addr)) + CDROM_LOG(("%s:CD: RL %08x\n", machine->describe_context(), addr)) return 0xffff; } } @@ -530,7 +530,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) { case 0x0008: case 0x000a: -// CDROM_LOG(("%s:WW HIRQ: %04x & %04x => %04x\n", cpuexec_describe_context(machine), hirqreg, data, hirqreg & data)) +// CDROM_LOG(("%s:WW HIRQ: %04x & %04x => %04x\n", machine->describe_context(), hirqreg, data, hirqreg & data)) hirqreg &= data; return; case 0x000c: @@ -573,7 +573,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) switch (cr1 & 0xff00) { case 0x0000: - CDROM_LOG(("%s:CD: Get Status\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get Status\n", machine->describe_context())) // values taken from a US saturn with a disc in and the lid closed hirqreg |= CMOK; @@ -585,7 +585,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x0100: - CDROM_LOG(("%s:CD: Get Hardware Info\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get Hardware Info\n", machine->describe_context())) hirqreg |= CMOK; cr1 = cd_stat; cr2 = 0x0201; @@ -594,7 +594,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x200: // Get TOC - CDROM_LOG(("%s:CD: Get TOC\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get TOC\n", machine->describe_context())) cd_readTOC(); cd_stat = CD_STAT_TRANS|CD_STAT_PAUSE; cr2 = 102*2; // TOC length in words (102 entries @ 2 words/4bytes each) @@ -608,7 +608,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) // bios is interested in returns in cr3 and cr4 // cr3 should be data track # // cr4 must be > 1 and < 100 or bios gets angry. - CDROM_LOG(("%s:CD: Get Session Info\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get Session Info\n", machine->describe_context())) cd_readTOC(); switch (cr1 & 0xff) { @@ -639,7 +639,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) // CR1 & 4 = don't confirm mode 2 subheader // CR1 & 8 = retry reading mode 2 sectors // CR1 & 10 = force single-speed - CDROM_LOG(("%s:CD: Initialize CD system\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Initialize CD system\n", machine->describe_context())) hirqreg |= (CMOK|DRDY|ESEL); cd_stat = CD_STAT_PAUSE; cd_curfad = 150; @@ -653,7 +653,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) case 0x0600: // end data transfer // returns # of bytes transfered (24 bits) in // low byte of cr1 (MSB) and cr2 (middle byte, LSB) - CDROM_LOG(("%s:CD: End data transfer (%d bytes xfer'd)\n", cpuexec_describe_context(machine), xferdnum)) + CDROM_LOG(("%s:CD: End data transfer (%d bytes xfer'd)\n", machine->describe_context(), xferdnum)) // clear the "transfer" flag cd_stat &= ~CD_STAT_TRANS; @@ -730,7 +730,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x1000: // Play Disk. FAD is in lowest 7 bits of cr1 and all of cr2. - CDROM_LOG(("%s:CD: Play Disk\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Play Disk\n", machine->describe_context())) cd_stat = CD_STAT_PLAY; //|0x80; // set "cd-rom" bit? cd_curfad = ((cr1&0xff)<<16) | cr2; fadstoplay = ((cr3&0xff)<<16) | cr4; @@ -768,7 +768,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x1100: // disk seek - CDROM_LOG(("%s:CD: Disk seek\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Disk seek\n", machine->describe_context())) if (cr1 & 0x80) { temp = (cr1&0x7f)<<16; // get FAD to seek to @@ -814,7 +814,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) // get operation parm = cr3>>8; - CDROM_LOG(("%s:CD: Set CD Device Connection filter # %x\n", cpuexec_describe_context(machine), parm)) + CDROM_LOG(("%s:CD: Set CD Device Connection filter # %x\n", machine->describe_context(), parm)) cddevicenum = parm; @@ -840,7 +840,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) { UINT8 fnum = (cr3>>8)&0xff; - CDROM_LOG(("%s:CD: Set Filter Range\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Set Filter Range\n", machine->describe_context())) filters[fnum].fad = ((cr1 & 0xff)<<16) | cr2; filters[fnum].range = ((cr3 & 0xff)<<16) | cr4; @@ -856,7 +856,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) { UINT8 fnum = (cr3>>8)&0xff; - CDROM_LOG(("%s:CD: Set Filter Subheader conditions %x => chan %x masks %x fid %x vals %x\n", cpuexec_describe_context(machine), fnum, cr1&0xff, cr2, cr3&0xff, cr4)) + CDROM_LOG(("%s:CD: Set Filter Subheader conditions %x => chan %x masks %x fid %x vals %x\n", machine->describe_context(), fnum, cr1&0xff, cr2, cr3&0xff, cr4)) filters[fnum].chan = cr1 & 0xff; filters[fnum].smmask = (cr2>>8)&0xff; @@ -887,7 +887,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) filters[fnum].mode = mode; } - CDROM_LOG(("%s:CD: Set Filter Mode filt %x mode %x\n", cpuexec_describe_context(machine), fnum, mode)) + CDROM_LOG(("%s:CD: Set Filter Mode filt %x mode %x\n", machine->describe_context(), fnum, mode)) hirqreg |= (CMOK|ESEL|DRDY); cr2 = 0x4101; // ctrl/adr in hi byte, track # in low byte cr3 = 0x0100|((cd_curfad>>16)&0xff); @@ -899,7 +899,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) { UINT8 fnum = (cr3>>8)&0xff; - CDROM_LOG(("%s:CD: Set Filter Connection %x => mode %x parm %04x\n", cpuexec_describe_context(machine), fnum, cr1 & 0xf, cr2)) + CDROM_LOG(("%s:CD: Set Filter Connection %x => mode %x parm %04x\n", machine->describe_context(), fnum, cr1 & 0xf, cr2)) // set true condition? if (cr1 & 1) @@ -919,7 +919,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x4800: // Reset Selector - CDROM_LOG(("%s:CD: Reset Selector\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Reset Selector\n", machine->describe_context())) hirqreg |= (CMOK|ESEL|DRDY); cr2 = 0x4101; // ctrl/adr in hi byte, track # in low byte cr3 = 0x0100|((cd_curfad>>16)&0xff); @@ -933,7 +933,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) cr3 = 0x1800; cr4 = 200; - CDROM_LOG(("%s:CD: Get Buffer Size = %d\n", cr2, cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get Buffer Size = %d\n", cr2, machine->describe_context())) hirqreg |= (CMOK|ESEL|DRDY); // DRDY is probably wrong break; @@ -951,7 +951,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) cr4 = partitions[bufnum].numblks; } - CDROM_LOG(("%s:CD: Get Sector Number (bufno %d) = %d blocks\n", cpuexec_describe_context(machine), bufnum, cr4)) + CDROM_LOG(("%s:CD: Get Sector Number (bufno %d) = %d blocks\n", machine->describe_context(), bufnum, cr4)) cr2 = 0; cr3 = 0; @@ -965,7 +965,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) UINT32 sectoffs = cr2; UINT32 numsect = cr4; - CDROM_LOG(("%s:CD: Calculate actual size: buf %x offs %x numsect %x\n", cpuexec_describe_context(machine), bufnum, sectoffs, numsect)) + CDROM_LOG(("%s:CD: Calculate actual size: buf %x offs %x numsect %x\n", machine->describe_context(), bufnum, sectoffs, numsect)) calcsize = 0; if (partitions[bufnum].size != -1) @@ -990,7 +990,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x5300: // get actual block size - CDROM_LOG(("%s:CD: Get actual block size\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get actual block size\n", machine->describe_context())) hirqreg |= (CMOK|ESEL); cr1 = cd_stat | ((calcsize>>16)&0xff); cr2 = (calcsize & 0xffff); @@ -999,7 +999,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x6000: // set sector length - CDROM_LOG(("%s:CD: Set sector length\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Set sector length\n", machine->describe_context())) hirqreg |= (CMOK|ESEL|EFLS|SCDQ|DRDY); switch (cr1 & 0xff) @@ -1041,7 +1041,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) UINT32 sectofs = cr2; UINT32 bufnum = cr3>>8; - CDROM_LOG(("%s:CD: Get sector data (SN %d SO %d BN %d)\n", cpuexec_describe_context(machine), sectnum, sectofs, bufnum)) + CDROM_LOG(("%s:CD: Get sector data (SN %d SO %d BN %d)\n", machine->describe_context(), sectnum, sectofs, bufnum)) if (bufnum >= MAX_FILTERS) { @@ -1081,7 +1081,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) UINT32 bufnum = cr3>>8; INT32 i; - CDROM_LOG(("%s:CD: Delete sector data (SN %d SO %d BN %d)\n", cpuexec_describe_context(machine), sectnum, sectofs, bufnum)) + CDROM_LOG(("%s:CD: Delete sector data (SN %d SO %d BN %d)\n", machine->describe_context(), sectnum, sectofs, bufnum)) if (bufnum >= MAX_FILTERS) { @@ -1124,7 +1124,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) UINT32 sectofs = cr2; UINT32 bufnum = cr3>>8; - CDROM_LOG(("%s:CD: Get and delete sector data (SN %d SO %d BN %d)\n", cpuexec_describe_context(machine), sectnum, sectofs, bufnum)) + CDROM_LOG(("%s:CD: Get and delete sector data (SN %d SO %d BN %d)\n", machine->describe_context(), sectnum, sectofs, bufnum)) if (bufnum >= MAX_FILTERS) { @@ -1158,12 +1158,12 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x6700: // get copy error - CDROM_LOG(("%s:CD: Get copy error\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get copy error\n", machine->describe_context())) hirqreg |= (CMOK|ESEL|EFLS|SCDQ|DRDY); break; case 0x7000: // change directory - CDROM_LOG(("%s:CD: Change Directory\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Change Directory\n", machine->describe_context())) hirqreg |= (CMOK|EFLS); temp = (cr3&0xff)<<16; @@ -1172,7 +1172,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x7100: // Read directory entry - CDROM_LOG(("%s:CD: Read Directory Entry\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Read Directory Entry\n", machine->describe_context())) hirqreg |= (CMOK|DRDY); temp = (cr3&0xff)<<16; @@ -1183,7 +1183,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x7200: // Get file system scope - CDROM_LOG(("%s:CD: Get file system scope(PC=%x)\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get file system scope(PC=%x)\n", machine->describe_context())) hirqreg |= (CMOK|DRDY); cr2 = numfiles; // # of files in directory cr3 = 0x0100; // report directory held @@ -1191,7 +1191,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x7300: // Get File Info - CDROM_LOG(("%s:CD: Get File Info\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get File Info\n", machine->describe_context())) cd_stat |= CD_STAT_TRANS; cd_stat &= 0xff00; // clear top byte of return value hirqreg |= (CMOK|DRDY); @@ -1245,7 +1245,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x7400: // Read File - CDROM_LOG(("%s:CD: Read File\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Read File\n", machine->describe_context())) temp = (cr3&0xff)<<16; temp |= cr4; @@ -1276,14 +1276,14 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0x7500: - CDROM_LOG(("%s:CD: Abort File\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Abort File\n", machine->describe_context())) // bios expects "2bc" mask to work against this hirqreg |= (CMOK|EFLS|EHST|ESEL|DCHG|PEND|BFUL|CSCT|DRDY); cd_stat = CD_STAT_PERI|CD_STAT_PAUSE; // force to pause break; case 0xe000: // appears to be copy protection check. needs only to return OK. - CDROM_LOG(("%s:CD: Verify copy protection\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Verify copy protection\n", machine->describe_context())) cd_stat = CD_STAT_PAUSE; cr1 = cd_stat; // necessary to pass cr2 = 0x4; @@ -1293,7 +1293,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; case 0xe100: // get disc region - CDROM_LOG(("%s:CD: Get disc region\n", cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Get disc region\n", machine->describe_context())) cd_stat = CD_STAT_PAUSE; cr1 = cd_stat; // necessary to pass cr2 = 0x4; // (must return this value to pass bios checks) @@ -1301,14 +1301,14 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data) break; default: - CDROM_LOG(("%s:CD: Unknown command %04x\n", cr1, cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: Unknown command %04x\n", cr1, machine->describe_context())) hirqreg |= (CMOK); break; } // CDROM_LOG(("ret: %04x %04x %04x %04x %04x\n", hirqreg, cr1, cr2, cr3, cr4)) break; default: - CDROM_LOG(("%s:CD: WW %08x %04x\n", addr, data, cpuexec_describe_context(machine))) + CDROM_LOG(("%s:CD: WW %08x %04x\n", addr, data, machine->describe_context())) break; } } diff --git a/src/mame/machine/tait8741.c b/src/mame/machine/tait8741.c index 94869b0bbd0..13edc576706 100644 --- a/src/mame/machine/tait8741.c +++ b/src/mame/machine/tait8741.c @@ -277,7 +277,7 @@ static int I8741_status_r(address_space *space, int num) { I8741 *st = &taito8741[num]; taito8741_update(space, num); - LOG(("%s:8741-%d ST Read %02x\n",cpuexec_describe_context(space->machine),num,st->status)); + LOG(("%s:8741-%d ST Read %02x\n",space->machine->describe_context(),num,st->status)); return st->status; } @@ -287,7 +287,7 @@ static int I8741_data_r(address_space *space, int num) I8741 *st = &taito8741[num]; int ret = st->toData; st->status &= 0xfe; - LOG(("%s:8741-%d DATA Read %02x\n",cpuexec_describe_context(space->machine),num,ret)); + LOG(("%s:8741-%d DATA Read %02x\n",space->machine->describe_context(),num,ret)); /* update chip */ taito8741_update(space, num); @@ -305,7 +305,7 @@ static int I8741_data_r(address_space *space, int num) static void I8741_data_w(address_space *space, int num, int data) { I8741 *st = &taito8741[num]; - LOG(("%s:8741-%d DATA Write %02x\n",cpuexec_describe_context(space->machine),num,data)); + LOG(("%s:8741-%d DATA Write %02x\n",space->machine->describe_context(),num,data)); st->fromData = data; st->status |= 0x02; /* update chip */ @@ -316,7 +316,7 @@ static void I8741_data_w(address_space *space, int num, int data) static void I8741_command_w(address_space *space, int num, int data) { I8741 *st = &taito8741[num]; - LOG(("%s:8741-%d CMD Write %02x\n",cpuexec_describe_context(space->machine),num,data)); + LOG(("%s:8741-%d CMD Write %02x\n",space->machine->describe_context(),num,data)); st->fromCmd = data; st->status |= 0x04; /* update chip */ @@ -450,7 +450,7 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data) if(offset==1) { - LOG(("%s:8741[%d] CW %02X\n", cpuexec_describe_context(space->machine), num, data)); + LOG(("%s:8741[%d] CW %02X\n", space->machine->describe_context(), num, data)); /* read pointer */ mcu->cmd = data; @@ -488,7 +488,7 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data) else { /* data */ - LOG(("%s:8741[%d] DW %02X\n", cpuexec_describe_context(space->machine), num, data)); + LOG(("%s:8741[%d] DW %02X\n", space->machine->describe_context(), num, data)); mcu->txd = data ^ 0x40; /* parity reverce ? */ mcu->sts |= 0x02; /* TXD busy */ @@ -517,14 +517,14 @@ static INT8 josvolly_8741_r(address_space *space,int num,int offset) if(mcu->rst) mcu->rxd = input_port_read(space->machine, mcu->initReadPort); /* port in */ ret = mcu->sts; - LOG(("%s:8741[%d] SR %02X\n",cpuexec_describe_context(space->machine),num,ret)); + LOG(("%s:8741[%d] SR %02X\n",space->machine->describe_context(),num,ret)); } else { /* clear status port */ mcu->sts &= ~0x01; /* RD ready */ ret = mcu->rxd; - LOG(("%s:8741[%d] DR %02X\n",cpuexec_describe_context(space->machine),num,ret)); + LOG(("%s:8741[%d] DR %02X\n",space->machine->describe_context(),num,ret)); mcu->rst = 0; } return ret; diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c index ee44493cc44..7264eb0240a 100644 --- a/src/mame/machine/taitosj.c +++ b/src/mame/machine/taitosj.c @@ -118,14 +118,14 @@ WRITE8_HANDLER( taitosj_mcu_data_w ) LOG(("%04x: protection write %02x\n",cpu_get_pc(space->cpu),data)); space->machine->scheduler().synchronize(FUNC(taitosj_mcu_real_data_w), data); /* temporarily boost the interleave to sync things up */ - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(10)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); } READ8_HANDLER( taitosj_mcu_status_r ) { taitosj_state *state = space->machine->driver_data<taitosj_state>(); /* temporarily boost the interleave to sync things up */ - cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(10)); + space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); /* bit 0 = the 68705 has read data from the Z80 */ /* bit 1 = the 68705 has written data for the Z80 */ diff --git a/src/mame/machine/ticket.c b/src/mame/machine/ticket.c index a94cff90897..d224f6cabe1 100644 --- a/src/mame/machine/ticket.c +++ b/src/mame/machine/ticket.c @@ -49,7 +49,7 @@ static TIMER_CALLBACK( ticket_dispenser_toggle ) { state->status ^= state->active_bit; LOG(("Ticket Status Changed to %02X\n", state->status)); - timer_adjust_oneshot(state->timer, attotime::from_msec(state->time_msec), 0); + state->timer->adjust(attotime::from_msec(state->time_msec)); } if (state->status == state->ticketdispensed) @@ -69,7 +69,7 @@ static TIMER_CALLBACK( ticket_dispenser_toggle ) READ8_DEVICE_HANDLER( ticket_dispenser_r ) { ticket_state *state = get_safe_token(device); - LOG(("%s: Ticket Status Read = %02X\n", cpuexec_describe_context(device->machine), state->status)); + LOG(("%s: Ticket Status Read = %02X\n", device->machine->describe_context(), state->status)); return state->status; } @@ -90,8 +90,8 @@ WRITE8_DEVICE_HANDLER( ticket_dispenser_w ) { if (!state->power) { - LOG(("%s: Ticket Power On\n", cpuexec_describe_context(device->machine))); - timer_adjust_oneshot(state->timer, attotime::from_msec(state->time_msec), 0); + LOG(("%s: Ticket Power On\n", device->machine->describe_context())); + state->timer->adjust(attotime::from_msec(state->time_msec)); state->power = 1; state->status = state->ticketnotdispensed; @@ -101,8 +101,8 @@ WRITE8_DEVICE_HANDLER( ticket_dispenser_w ) { if (state->power) { - LOG(("%s: Ticket Power Off\n", cpuexec_describe_context(device->machine))); - timer_adjust_oneshot(state->timer, attotime::never, 0); + LOG(("%s: Ticket Power Off\n", device->machine->describe_context())); + state->timer->adjust(attotime::never); set_led_status(device->machine, 2,0); state->power = 0; } diff --git a/src/mame/machine/twincobr.c b/src/mame/machine/twincobr.c index 0fbd2b86e01..6a3b556af31 100644 --- a/src/mame/machine/twincobr.c +++ b/src/mame/machine/twincobr.c @@ -220,7 +220,7 @@ static STATE_POSTLOAD( twincobr_restore_dsp ) static void toaplan0_control_w(running_machine *machine, int offset, int data) { - LOG(("%s:Writing %08x to %08x.\n",cpuexec_describe_context(machine),data,toaplan_port_type[toaplan_main_cpu] - offset)); + LOG(("%s:Writing %08x to %08x.\n",machine->describe_context(),data,toaplan_port_type[toaplan_main_cpu] - offset)); if (toaplan_main_cpu == 1) { if (data == 0x0c) { data = 0x1c; wardner_sprite_hack=0; } /* Z80 ? */ @@ -274,7 +274,7 @@ WRITE16_HANDLER( twincobr_sharedram_w ) static void toaplan0_coin_dsp_w(address_space *space, int offset, int data) { if (data > 1) - LOG(("%s:Writing %08x to %08x.\n",cpuexec_describe_context(space->machine),data,toaplan_port_type[toaplan_main_cpu] - offset)); + LOG(("%s:Writing %08x to %08x.\n",space->machine->describe_context(),data,toaplan_port_type[toaplan_main_cpu] - offset)); switch (data) { case 0x08: coin_counter_w(space->machine, 0,0); break; case 0x09: coin_counter_w(space->machine, 0,1); break; diff --git a/src/mame/machine/tx1.c b/src/mame/machine/tx1.c index 16ce39ca0a9..6c2967cb7d0 100644 --- a/src/mame/machine/tx1.c +++ b/src/mame/machine/tx1.c @@ -173,7 +173,7 @@ static void sn_divide(running_machine *machine) if (SN74S516.X == 0) { - mame_printf_debug("%s:SN74S516 tried to divide by zero\n", cpuexec_describe_context(machine)); + mame_printf_debug("%s:SN74S516 tried to divide by zero\n", machine->describe_context()); SN74S516.ZW.Z = (INT16)0xffff; SN74S516.ZW.W = 0xffff; SN74S516.ZWfl = 0; @@ -315,7 +315,7 @@ static void kick_sn74s516(running_machine *machine, UINT16 *data, const int ins) if (SN74S516.code == 0x6666) { CLEAR_SEQUENCE; - mame_printf_debug("%s:Code 6666: PROMADDR:%x\n", cpuexec_describe_context(machine), math.promaddr); + mame_printf_debug("%s:Code 6666: PROMADDR:%x\n", machine->describe_context(), math.promaddr); } UPDATE_SEQUENCE; diff --git a/src/mame/machine/vertigo.c b/src/mame/machine/vertigo.c index 2dc6b3fee57..9bcee6a0b6d 100644 --- a/src/mame/machine/vertigo.c +++ b/src/mame/machine/vertigo.c @@ -179,7 +179,7 @@ static TIMER_CALLBACK( sound_command_w ) quickly. Otherwise the main CPU gives up with sound. Boosting the interleave for a while helps. */ - cpuexec_boost_interleave(machine, attotime::zero, attotime::from_usec(100)); + machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c index 71c6a6cd97d..7635214341a 100644 --- a/src/mame/machine/williams.c +++ b/src/mame/machine/williams.c @@ -920,7 +920,7 @@ static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r ) static WRITE8_DEVICE_HANDLER( tshoot_maxvol_w ) { /* something to do with the sound volume */ - logerror("tshoot maxvol = %d (%s)\n", data, cpuexec_describe_context(device->machine)); + logerror("tshoot maxvol = %d (%s)\n", data, device->machine->describe_context()); } diff --git a/src/mame/machine/zs01.c b/src/mame/machine/zs01.c index 2d87487b413..ab07f6c537a 100644 --- a/src/mame/machine/zs01.c +++ b/src/mame/machine/zs01.c @@ -21,7 +21,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 ); } } diff --git a/src/mame/video/artmagic.c b/src/mame/video/artmagic.c index d00ce6218dd..c16afabb386 100644 --- a/src/mame/video/artmagic.c +++ b/src/mame/video/artmagic.c @@ -118,7 +118,7 @@ static void execute_blit(running_machine *machine) static FILE *f; logerror("%s:Blit from %06X to (%d,%d) %dx%d -- %04X %04X %04X %04X %04X %04X %04X %04X\n", - cpuexec_describe_context(machine), offset, x, y, w, h, + machine->describe_context(), offset, x, y, w, h, blitter_data[0], blitter_data[1], blitter_data[2], blitter_data[3], blitter_data[4], blitter_data[5], @@ -136,7 +136,7 @@ static void execute_blit(running_machine *machine) fprintf(f, "----------------------\n" "%s:Blit from %06X to (%d,%d) %dx%d -- %04X %04X %04X %04X %04X %04X %04X %04X\n", - cpuexec_describe_context(machine), offset, x, y, w, h, + machine->describe_context(), offset, x, y, w, h, blitter_data[0], blitter_data[1], blitter_data[2], blitter_data[3], blitter_data[4], blitter_data[5], diff --git a/src/mame/video/astrocde.c b/src/mame/video/astrocde.c index 7298cc2b7ae..f7b6ae61fed 100644 --- a/src/mame/video/astrocde.c +++ b/src/mame/video/astrocde.c @@ -223,7 +223,7 @@ VIDEO_START( astrocde ) { /* allocate a per-scanline timer */ scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback)); - timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(1), 1); + scanline_timer->adjust(machine->primary_screen->time_until_pos(1), 1); /* register for save states */ init_savestate(machine); @@ -238,7 +238,7 @@ VIDEO_START( profpac ) { /* allocate a per-scanline timer */ scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback)); - timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(1), 1); + scanline_timer->adjust(machine->primary_screen->time_until_pos(1), 1); /* allocate videoram */ profpac_videoram = auto_alloc_array(machine, UINT16, 0x4000 * 4); @@ -502,7 +502,7 @@ static TIMER_CALLBACK( scanline_callback ) scanline++; if (scanline >= machine->primary_screen->height()) scanline = 0; - timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(scanline), scanline); + scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c index 24efb03adc8..a6381bd546b 100644 --- a/src/mame/video/atari.c +++ b/src/mame/video/atari.c @@ -1134,13 +1134,13 @@ static TIMER_CALLBACK( antic_line_done ) { LOG((" @cycle #%3d release WSYNC\n", cycle(machine))); /* release the CPU if it was actually waiting for HSYNC */ - cpuexec_trigger(machine, TRIGGER_HSYNC); + machine->scheduler().trigger(TRIGGER_HSYNC); /* and turn off the 'wait for hsync' flag */ antic.w.wsync = 0; } LOG((" @cycle #%3d release CPU\n", cycle(machine))); /* release the CPU (held for emulating cycles stolen by ANTIC DMA) */ - cpuexec_trigger(machine, TRIGGER_STEAL); + machine->scheduler().trigger(TRIGGER_STEAL); /* refresh the display (translate color clocks to pixels) */ antic_linerefresh(machine); diff --git a/src/mame/video/atarimo.c b/src/mame/video/atarimo.c index 56b94b96b21..acb38fa7a59 100644 --- a/src/mame/video/atarimo.c +++ b/src/mame/video/atarimo.c @@ -323,7 +323,7 @@ static TIMER_CALLBACK( force_update ) scanline += 64; if (scanline >= machine->primary_screen->visible_area().max_y) scanline = 0; - timer_adjust_oneshot(force_update_timer, machine->primary_screen->time_until_pos(scanline), scanline); + force_update_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } /*--------------------------------------------------------------- @@ -441,7 +441,7 @@ void atarimo_init(running_machine *machine, int map, const atarimo_desc *desc) /* start a timer to update a few times during refresh */ force_update_timer = machine->scheduler().timer_alloc(FUNC(force_update)); - timer_adjust_oneshot(force_update_timer,machine->primary_screen->time_until_pos(0), 0); + force_update_timer->adjust(machine->primary_screen->time_until_pos(0)); init_savestate(machine, map, mo); diff --git a/src/mame/video/atarisy2.c b/src/mame/video/atarisy2.c index 9b870da100a..2ad066997f6 100644 --- a/src/mame/video/atarisy2.c +++ b/src/mame/video/atarisy2.c @@ -175,7 +175,7 @@ WRITE16_HANDLER( atarisy2_yscroll_w ) if (!(newscroll & 0x10)) tilemap_set_scrolly(state->playfield_tilemap, 0, (newscroll >> 6) - space->machine->primary_screen->vpos()); else - timer_adjust_oneshot(state->yscroll_reset_timer, space->machine->primary_screen->time_until_pos(0), newscroll >> 6); + state->yscroll_reset_timer->adjust(space->machine->primary_screen->time_until_pos(0), newscroll >> 6); /* update the playfield banking */ if (state->playfield_tile_bank[1] != (newscroll & 0x0f) * 0x400) diff --git a/src/mame/video/avgdvg.c b/src/mame/video/avgdvg.c index a2b814ddb8e..4655652867c 100644 --- a/src/mame/video/avgdvg.c +++ b/src/mame/video/avgdvg.c @@ -1223,13 +1223,13 @@ static TIMER_CALLBACK( run_state_machine ) /* If halt flag was set, let CPU catch up before we make halt visible */ if (vg->halt && !(vg->state_latch & 0x10)) - timer_adjust_oneshot(vg_halt_timer, attotime::from_hz(MASTER_CLOCK) * cycles, 1); + vg_halt_timer->adjust(attotime::from_hz(MASTER_CLOCK) * cycles, 1); vg->state_latch = (vg->halt << 4) | (vg->state_latch & 0xf); cycles += 8; } - timer_adjust_oneshot(vg_run_timer, attotime::from_hz(MASTER_CLOCK) * cycles, 0); + vg_run_timer->adjust(attotime::from_hz(MASTER_CLOCK) * cycles); } @@ -1260,7 +1260,7 @@ WRITE8_HANDLER( avgdvg_go_w ) vg_flush(space->machine); vg_set_halt(0); - timer_adjust_oneshot(vg_run_timer, attotime::zero, 0); + vg_run_timer->adjust(attotime::zero); } WRITE16_HANDLER( avgdvg_go_word_w ) diff --git a/src/mame/video/btoads.c b/src/mame/video/btoads.c index f06492c20fa..598f9daa88a 100644 --- a/src/mame/video/btoads.c +++ b/src/mame/video/btoads.c @@ -307,7 +307,7 @@ void btoads_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg) } else - logerror("%s:btoads_to_shiftreg(%08X)\n", cpuexec_describe_context(space->machine), address); + logerror("%s:btoads_to_shiftreg(%08X)\n", space->machine->describe_context(), address); } @@ -332,7 +332,7 @@ void btoads_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg render_sprite_row(shiftreg, address); else - logerror("%s:btoads_from_shiftreg(%08X)\n", cpuexec_describe_context(space->machine), address); + logerror("%s:btoads_from_shiftreg(%08X)\n", space->machine->describe_context(), address); } diff --git a/src/mame/video/changela.c b/src/mame/video/changela.c index ad0806d8a31..e2f1363f160 100644 --- a/src/mame/video/changela.c +++ b/src/mame/video/changela.c @@ -30,7 +30,7 @@ VIDEO_START( changela ) state->tree1_bitmap = machine->primary_screen->alloc_compatible_bitmap(); state->scanline_timer = machine->scheduler().timer_alloc(FUNC(changela_scanline_callback)); - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(30), 30); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(30), 30); state_save_register_global_pointer(machine, state->memory_devices, 4 * 0x800); state_save_register_global_pointer(machine, state->tree_ram, 2 * 0x20); @@ -719,7 +719,7 @@ static TIMER_CALLBACK( changela_scanline_callback ) sy++; if (sy > 256) sy = 30; - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(sy), sy); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(sy), sy); } VIDEO_UPDATE( changela ) diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c index c6230e40fea..824c264b045 100644 --- a/src/mame/video/dc.c +++ b/src/mame/video/dc.c @@ -1092,7 +1092,7 @@ WRITE64_HANDLER( pvr_ta_w ) // this should really be done for each tile! render_to_accumulation_buffer(space->machine,fake_accumulationbuffer_bitmap,&clip); - timer_adjust_oneshot(endofrender_timer_isp, attotime::from_usec(4000) , 0); // hack, make sure render takes some amount of time + endofrender_timer_isp->adjust(attotime::from_usec(4000) ); // hack, make sure render takes some amount of time /* copy the tiles to the framebuffer (really the rendering should be in this loop too) */ if (pvrta_regs[FPU_PARAM_CFG] & 0x200000) @@ -1241,11 +1241,11 @@ WRITE64_HANDLER( pvr_ta_w ) case SPG_VBLANK_INT: /* clear pending irqs and modify them with the updated ones */ - timer_adjust_oneshot(vbin_timer, attotime::never, 0); - timer_adjust_oneshot(vbout_timer, attotime::never, 0); + vbin_timer->adjust(attotime::never); + vbout_timer->adjust(attotime::never); - timer_adjust_oneshot(vbin_timer, space->machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num), 0); - timer_adjust_oneshot(vbout_timer, space->machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num), 0); + vbin_timer->adjust(space->machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num)); + vbout_timer->adjust(space->machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num)); break; /* TODO: timer adjust for SPG_HBLANK_INT too */ case TA_LIST_CONT: @@ -2451,7 +2451,7 @@ static TIMER_CALLBACK(vbin) dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_IN; // V Blank-in interrupt dc_update_interrupt_status(machine); - timer_adjust_oneshot(vbin_timer, machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num), 0); + vbin_timer->adjust(machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num)); } static TIMER_CALLBACK(vbout) @@ -2459,7 +2459,7 @@ static TIMER_CALLBACK(vbout) dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_OUT; // V Blank-out interrupt dc_update_interrupt_status(machine); - timer_adjust_oneshot(vbout_timer, machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num), 0); + vbout_timer->adjust(machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num)); } static TIMER_CALLBACK(hbin) @@ -2489,7 +2489,7 @@ static TIMER_CALLBACK(hbin) next_y = spg_line_comp_val; } - timer_adjust_oneshot(hbin_timer, machine->primary_screen->time_until_pos(scanline, spg_hblank_in_irq-1), 0); + hbin_timer->adjust(machine->primary_screen->time_until_pos(scanline, spg_hblank_in_irq-1)); } @@ -2498,7 +2498,7 @@ static TIMER_CALLBACK(endofrender_video) { dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_VIDEO;// VIDEO end of render dc_update_interrupt_status(machine); - timer_adjust_oneshot(endofrender_timer_video, attotime::never, 0); + endofrender_timer_video->adjust(attotime::never); } static TIMER_CALLBACK(endofrender_tsp) @@ -2506,8 +2506,8 @@ static TIMER_CALLBACK(endofrender_tsp) dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_TSP; // TSP end of render dc_update_interrupt_status(machine); - timer_adjust_oneshot(endofrender_timer_tsp, attotime::never, 0); - timer_adjust_oneshot(endofrender_timer_video, attotime::from_usec(500) , 0); + endofrender_timer_tsp->adjust(attotime::never); + endofrender_timer_video->adjust(attotime::from_usec(500) ); } static TIMER_CALLBACK(endofrender_isp) @@ -2515,8 +2515,8 @@ static TIMER_CALLBACK(endofrender_isp) dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_ISP; // ISP end of render dc_update_interrupt_status(machine); - timer_adjust_oneshot(endofrender_timer_isp, attotime::never, 0); - timer_adjust_oneshot(endofrender_timer_tsp, attotime::from_usec(500) , 0); + endofrender_timer_isp->adjust(attotime::never); + endofrender_timer_tsp->adjust(attotime::from_usec(500) ); } @@ -2552,13 +2552,13 @@ VIDEO_START(dc) computedilated(); vbout_timer = machine->scheduler().timer_alloc(FUNC(vbout)); - timer_adjust_oneshot(vbout_timer, machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num), 0); + vbout_timer->adjust(machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num)); vbin_timer = machine->scheduler().timer_alloc(FUNC(vbin)); - timer_adjust_oneshot(vbin_timer, machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num), 0); + vbin_timer->adjust(machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num)); hbin_timer = machine->scheduler().timer_alloc(FUNC(hbin)); - timer_adjust_oneshot(hbin_timer, machine->primary_screen->time_until_pos(0, spg_hblank_in_irq-1), 0); + hbin_timer->adjust(machine->primary_screen->time_until_pos(0, spg_hblank_in_irq-1)); scanline = 0; next_y = 0; @@ -2567,9 +2567,9 @@ VIDEO_START(dc) endofrender_timer_tsp = machine->scheduler().timer_alloc(FUNC(endofrender_tsp)); endofrender_timer_video = machine->scheduler().timer_alloc(FUNC(endofrender_video)); - timer_adjust_oneshot(endofrender_timer_isp, attotime::never, 0); - timer_adjust_oneshot(endofrender_timer_tsp, attotime::never, 0); - timer_adjust_oneshot(endofrender_timer_video, attotime::never, 0); + endofrender_timer_isp->adjust(attotime::never); + endofrender_timer_tsp->adjust(attotime::never); + endofrender_timer_video->adjust(attotime::never); fake_accumulationbuffer_bitmap = auto_bitmap_alloc(machine,1024,1024,BITMAP_FORMAT_RGB32); diff --git a/src/mame/video/dcheese.c b/src/mame/video/dcheese.c index 5c7dd54a6df..8d7ceea5e68 100644 --- a/src/mame/video/dcheese.c +++ b/src/mame/video/dcheese.c @@ -66,7 +66,7 @@ static void update_scanline_irq( running_machine *machine ) time = machine->primary_screen->time_until_pos(effscan); if (time < machine->primary_screen->scan_period()) time += machine->primary_screen->frame_period(); - timer_adjust_oneshot(state->blitter_timer, time, 0); + state->blitter_timer->adjust(time); } } @@ -212,7 +212,7 @@ static void do_blit( running_machine *machine ) if (state->blitter_xparam[8] != 0 || state->blitter_xparam[9] != 0 || state->blitter_xparam[10] != 0 || state->blitter_xparam[11] != 0 || state->blitter_yparam[8] != 0 || state->blitter_yparam[9] != 0 || state->blitter_yparam[10] != 0 || state->blitter_yparam[11] != 0) { - logerror("%s:blit! (%04X)\n", cpuexec_describe_context(machine), state->blitter_color[0]); + logerror("%s:blit! (%04X)\n", machine->describe_context(), state->blitter_color[0]); logerror(" %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X\n", state->blitter_xparam[0], state->blitter_xparam[1], state->blitter_xparam[2], state->blitter_xparam[3], state->blitter_xparam[4], state->blitter_xparam[5], state->blitter_xparam[6], state->blitter_xparam[7], diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c index fbc643cf8f5..8e4ab0a5671 100644 --- a/src/mame/video/dkong.c +++ b/src/mame/video/dkong.c @@ -885,7 +885,7 @@ static TIMER_CALLBACK( scanline_callback ) scanline = (scanline+1) % VTOTAL; /* come back at the next appropriate scanline */ - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } static void check_palette(running_machine *machine) @@ -945,7 +945,7 @@ VIDEO_START( dkong ) VIDEO_START_CALL(dkong_base); state->scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback)); - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(0), 0); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0)); switch (state->hardware_type) { diff --git a/src/mame/video/esripsys.c b/src/mame/video/esripsys.c index cb8cbbb6fb2..16700fdf89d 100644 --- a/src/mame/video/esripsys.c +++ b/src/mame/video/esripsys.c @@ -73,7 +73,7 @@ static TIMER_CALLBACK( hblank_start_callback ) v = 0; /* Set end of HBLANK timer */ - timer_adjust_oneshot(hblank_end_timer, machine->primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_END), v); + hblank_end_timer->adjust(machine->primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_END), v); esripsys_hblank = 0; } @@ -85,7 +85,7 @@ static TIMER_CALLBACK( hblank_end_callback ) machine->primary_screen->update_partial(v - 1); esripsys__12sel ^= 1; - timer_adjust_oneshot(hblank_start_timer, machine->primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_START), 0); + hblank_start_timer->adjust(machine->primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_START)); esripsys_hblank = 1; } @@ -106,7 +106,7 @@ VIDEO_START( esripsys ) /* Create and initialise the HBLANK timers */ hblank_start_timer = machine->scheduler().timer_alloc(FUNC(hblank_start_callback)); hblank_end_timer = machine->scheduler().timer_alloc(FUNC(hblank_end_callback)); - timer_adjust_oneshot(hblank_start_timer, machine->primary_screen->time_until_pos(0, ESRIPSYS_HBLANK_START), 0); + hblank_start_timer->adjust(machine->primary_screen->time_until_pos(0, ESRIPSYS_HBLANK_START)); /* Create the sprite scaling table */ scale_table = auto_alloc_array(machine, UINT8, 64 * 64); diff --git a/src/mame/video/fromance.c b/src/mame/video/fromance.c index 2385a069a45..ef787cc8923 100644 --- a/src/mame/video/fromance.c +++ b/src/mame/video/fromance.c @@ -266,7 +266,7 @@ static TIMER_CALLBACK( crtc_interrupt_gen ) fromance_state *state = machine->driver_data<fromance_state>(); cpu_set_input_line(state->subcpu, 0, HOLD_LINE); if (param != 0) - timer_adjust_periodic(state->crtc_timer, machine->primary_screen->frame_period() / param, 0, machine->primary_screen->frame_period() / param); + state->crtc_timer->adjust(machine->primary_screen->frame_period() / param, 0, machine->primary_screen->frame_period() / param); } @@ -279,7 +279,7 @@ WRITE8_HANDLER( fromance_crtc_data_w ) { /* only register we know about.... */ case 0x0b: - timer_adjust_oneshot(state->crtc_timer, space->machine->primary_screen->time_until_vblank_start(), (data > 0x80) ? 2 : 1); + state->crtc_timer->adjust(space->machine->primary_screen->time_until_vblank_start(), (data > 0x80) ? 2 : 1); break; default: diff --git a/src/mame/video/galaxold.c b/src/mame/video/galaxold.c index 0ba2cfef2f2..2c3f7cb9c7d 100644 --- a/src/mame/video/galaxold.c +++ b/src/mame/video/galaxold.c @@ -1740,7 +1740,7 @@ static void start_stars_blink_timer(double ra, double rb, double c) int period_in_ms = 693 * (ra + 2.0 * rb) * c; - timer_adjust_periodic(stars_blink_timer, attotime::from_msec(period_in_ms), 0, attotime::from_msec(period_in_ms)); + stars_blink_timer->adjust(attotime::from_msec(period_in_ms), 0, attotime::from_msec(period_in_ms)); } @@ -1754,7 +1754,7 @@ static TIMER_CALLBACK( stars_scroll_callback ) static void start_stars_scroll_timer(running_machine *machine) { - timer_adjust_periodic(stars_scroll_timer, machine->primary_screen->frame_period(), 0, machine->primary_screen->frame_period()); + stars_scroll_timer->adjust(machine->primary_screen->frame_period(), 0, machine->primary_screen->frame_period()); } diff --git a/src/mame/video/gameplan.c b/src/mame/video/gameplan.c index abbcc299eca..da111d8d4c9 100644 --- a/src/mame/video/gameplan.c +++ b/src/mame/video/gameplan.c @@ -272,9 +272,9 @@ static TIMER_CALLBACK( via_0_ca1_timer_callback ) state->via_0->write_ca1(param); if (param) - timer_adjust_oneshot(state->via_0_ca1_timer, machine->primary_screen->time_until_pos(VBSTART), 0); + state->via_0_ca1_timer->adjust(machine->primary_screen->time_until_pos(VBSTART)); else - timer_adjust_oneshot(state->via_0_ca1_timer, machine->primary_screen->time_until_pos(VBEND), 1); + state->via_0_ca1_timer->adjust(machine->primary_screen->time_until_pos(VBEND), 1); } @@ -326,7 +326,7 @@ static VIDEO_START( trvquest ) static VIDEO_RESET( gameplan ) { gameplan_state *state = machine->driver_data<gameplan_state>(); - timer_adjust_oneshot(state->via_0_ca1_timer, machine->primary_screen->time_until_pos(VBSTART), 0); + state->via_0_ca1_timer->adjust(machine->primary_screen->time_until_pos(VBSTART)); } diff --git a/src/mame/video/genesis.c b/src/mame/video/genesis.c index 4008e58c3b9..b2a24256b26 100644 --- a/src/mame/video/genesis.c +++ b/src/mame/video/genesis.c @@ -366,7 +366,7 @@ static int vdp_data_r(running_machine *machine) break; default: /* Illegal read attempt */ - logerror("%s: VDP illegal read type %02x\n", cpuexec_describe_context(machine), vdp_code); + logerror("%s: VDP illegal read type %02x\n", machine->describe_context(), vdp_code); read = 0x00; break; } @@ -427,7 +427,7 @@ static void vdp_data_w(running_machine *machine, int data) break; default: /* Illegal write attempt */ - logerror("%s: VDP illegal write type %02x data %04x\n", cpuexec_describe_context(machine), vdp_code, data); + logerror("%s: VDP illegal write type %02x data %04x\n", machine->describe_context(), vdp_code, data); break; } diff --git a/src/mame/video/itech32.c b/src/mame/video/itech32.c index 6e19d53abfe..da63a895755 100644 --- a/src/mame/video/itech32.c +++ b/src/mame/video/itech32.c @@ -479,7 +479,7 @@ static void update_interrupts(running_machine *machine, int fast) static TIMER_CALLBACK( scanline_interrupt ) { /* set timer for next frame */ - timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(VIDEO_INTSCANLINE), 0); + scanline_timer->adjust(machine->primary_screen->time_until_pos(VIDEO_INTSCANLINE)); /* set the interrupt bit in the status reg */ logerror("-------------- (DISPLAY INT @ %d) ----------------\n", machine->primary_screen->vpos()); @@ -1347,7 +1347,7 @@ WRITE16_HANDLER( itech32_video_w ) break; case 0x2c/2: /* VIDEO_INTSCANLINE */ - timer_adjust_oneshot(scanline_timer, space->machine->primary_screen->time_until_pos(VIDEO_INTSCANLINE), 0); + scanline_timer->adjust(space->machine->primary_screen->time_until_pos(VIDEO_INTSCANLINE)); break; case 0x32/2: /* VIDEO_VTOTAL */ diff --git a/src/mame/video/jagblit.c b/src/mame/video/jagblit.c index 92f45640931..f7bea23fe04 100644 --- a/src/mame/video/jagblit.c +++ b/src/mame/video/jagblit.c @@ -195,7 +195,7 @@ static void FUNCNAME(running_machine *machine, UINT32 command, UINT32 a1flags, U { if (LOG_BAD_BLITS) { - logerror("%s:Blit!\n", cpuexec_describe_context(machine)); + logerror("%s:Blit!\n", machine->describe_context()); logerror(" a1_base = %08X\n", a1_base); logerror(" a2_base = %08X\n", a2_base); } @@ -275,7 +275,7 @@ static void FUNCNAME(running_machine *machine, UINT32 command, UINT32 a1flags, U if (LOG_BLITS) { - logerror("%s:Blit!\n", cpuexec_describe_context(machine)); + logerror("%s:Blit!\n", machine->describe_context()); logerror(" a1_base = %08X\n", a1_base); logerror(" a1_pitch = %d\n", a1_pitch); logerror(" a1_psize = %d\n", 1 << ((A1FIXED >> 3) & 7)); diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c index 8f2f7b1af65..a48d924049a 100644 --- a/src/mame/video/jaguar.c +++ b/src/mame/video/jaguar.c @@ -295,7 +295,7 @@ INLINE int adjust_object_timer(running_machine *machine, int vc) return FALSE; /* adjust the timer */ - timer_adjust_oneshot(object_timer, machine->primary_screen->time_until_pos(vc / 2, hdb), vc | (hdb << 16)); + object_timer->adjust(machine->primary_screen->time_until_pos(vc / 2, hdb), vc | (hdb << 16)); return TRUE; } diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c index 2cf876c86f2..4d2c4ed606e 100644 --- a/src/mame/video/konamiic.c +++ b/src/mame/video/konamiic.c @@ -2572,7 +2572,7 @@ static int K051960_fetchromdata(running_machine *machine, int byte) addr = (code << 7) | (off1 << 2) | byte; addr &= machine->region(K051960_memory_region)->bytes()-1; -// popmessage("%s: addr %06x",cpuexec_describe_context(machine),addr); +// popmessage("%s: addr %06x",machine->describe_context(),addr); return machine->region(K051960_memory_region)->base()[addr]; } @@ -3124,7 +3124,7 @@ static UINT8 K053244_chip_r (running_machine *machine, int chip, int offset) | ((offset & 3) ^ 1); addr &= machine->region(K053245_memory_region[chip])->bytes()-1; -// popmessage("%s: offset %02x addr %06x",cpuexec_describe_context(machine),offset&3,addr); +// popmessage("%s: offset %02x addr %06x",machine->describe_context(),offset&3,addr); return machine->region(K053245_memory_region[chip])->base()[addr]; } @@ -3135,7 +3135,7 @@ static UINT8 K053244_chip_r (running_machine *machine, int chip, int offset) } else { -//logerror("%s: read from unknown 053244 address %x\n",cpuexec_describe_context(machine),offset); +//logerror("%s: read from unknown 053244 address %x\n",machine->describe_context(),offset); return 0; } @@ -3157,7 +3157,7 @@ static void K053244_chip_w(int chip, int offset, int data) // popmessage("053244 reg 05 = %02x",data); /* bit 2 = unknown, Parodius uses it */ /* bit 5 = unknown, Rollergames uses it */ -// logerror("%s: write %02x to 053244 address 5\n",cpuexec_describe_context(machine),data); +// logerror("%s: write %02x to 053244 address 5\n",machine->describe_context(),data); break; } case 0x06: @@ -4815,13 +4815,13 @@ static int K051316_rom_r(running_machine *machine, int chip, int offset) if (K051316_bpp[chip] <= 4) addr /= 2; addr &= machine->region(K051316_memory_region[chip])->bytes()-1; -// popmessage("%s: offset %04x addr %04x",cpuexec_describe_context(machine),offset,addr); +// popmessage("%s: offset %04x addr %04x",machine->describe_context(),offset,addr); return machine->region(K051316_memory_region[chip])->base()[addr]; } else { -//logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n",cpuexec_describe_context(machine),offset); +//logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n",machine->describe_context(),offset); return 0; } } @@ -4846,7 +4846,7 @@ READ8_HANDLER( K051316_rom_2_r ) static void K051316_ctrl_w(int chip,int offset,int data) { K051316_ctrlram[chip][offset] = data; -//if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n",cpuexec_describe_context(machine),data,offset); +//if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n",machine->describe_context(),data,offset); } WRITE8_HANDLER( K051316_ctrl_0_w ) diff --git a/src/mame/video/konicdev.c b/src/mame/video/konicdev.c index bc5fdeec95e..0157f8d5b4f 100644 --- a/src/mame/video/konicdev.c +++ b/src/mame/video/konicdev.c @@ -2837,7 +2837,7 @@ static int k051960_fetchromdata( device_t *device, int byte ) addr = (code << 7) | (off1 << 2) | byte; addr &= device->machine->region(k051960->memory_region)->bytes() - 1; -// popmessage("%s: addr %06x", cpuexec_describe_context(device->machine), addr); +// popmessage("%s: addr %06x", device->machine->describe_context(), addr); return device->machine->region(k051960->memory_region)->base()[addr]; } @@ -3432,7 +3432,7 @@ READ8_DEVICE_HANDLER( k053244_r ) | ((offset & 3) ^ 1); addr &= machine->region(k053244->memory_region)->bytes() - 1; - // popmessage("%s: offset %02x addr %06x", cpuexec_describe_context(machine), offset & 3, addr); + // popmessage("%s: offset %02x addr %06x", machine->describe_context(), offset & 3, addr); return machine->region(k053244->memory_region)->base()[addr]; } @@ -3443,7 +3443,7 @@ READ8_DEVICE_HANDLER( k053244_r ) } else { - //logerror("%s: read from unknown 053244 address %x\n", cpuexec_describe_context(machine), offset); + //logerror("%s: read from unknown 053244 address %x\n", machine->describe_context(), offset); return 0; } } @@ -3461,7 +3461,7 @@ WRITE8_DEVICE_HANDLER( k053244_w ) // popmessage("053244 reg 05 = %02x",data); /* bit 2 = unknown, Parodius uses it */ /* bit 5 = unknown, Rollergames uses it */ -// logerror("%s: write %02x to 053244 address 5\n", cpuexec_describe_context(device->machine), data); +// logerror("%s: write %02x to 053244 address 5\n", device->machine->describe_context(), data); break; case 0x06: @@ -5170,13 +5170,13 @@ READ8_DEVICE_HANDLER( k051316_rom_r ) addr /= 2; addr &= device->machine->region(k051316->memory_region)->bytes() - 1; - // popmessage("%s: offset %04x addr %04x", cpuexec_describe_context(device->machine), offset, addr); + // popmessage("%s: offset %04x addr %04x", device->machine->describe_context(), offset, addr); return device->machine->region(k051316->memory_region)->base()[addr]; } else { - //logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n", cpuexec_describe_context(device->machine), offset); + //logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n", device->machine->describe_context(), offset); return 0; } } @@ -5185,7 +5185,7 @@ WRITE8_DEVICE_HANDLER( k051316_ctrl_w ) { k051316_state *k051316= k051316_get_safe_token(device); k051316->ctrlram[offset] = data; - //if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n", cpuexec_describe_context(device->machine), data, offset); + //if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n", device->machine->describe_context(), data, offset); } // a few games (ajax, rollerg, ultraman, etc.) can enable and disable wraparound after start diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c index 9cac8f2052d..a18068f2290 100644 --- a/src/mame/video/leland.c +++ b/src/mame/video/leland.c @@ -67,7 +67,7 @@ static TIMER_CALLBACK( scanline_callback ) scanline = (scanline+1) % 256; /* come back at the next appropriate scanline */ - timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(scanline), scanline); + scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } @@ -84,7 +84,7 @@ static VIDEO_START( leland ) /* scanline timer */ scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback)); - timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(0), 0); + scanline_timer->adjust(machine->primary_screen->time_until_pos(0)); } @@ -197,14 +197,14 @@ static int leland_vram_port_r(address_space *space, int offset, int num) default: logerror("%s: Warning: Unknown video port %02x read (address=%04x)\n", - cpuexec_describe_context(space->machine), offset, addr); + space->machine->describe_context(), offset, addr); ret = 0; break; } state->addr = addr; if (LOG_COMM && addr >= 0xf000) - logerror("%s:%s comm read %04X = %02X\n", cpuexec_describe_context(space->machine), num ? "slave" : "master", addr, ret); + logerror("%s:%s comm read %04X = %02X\n", space->machine->describe_context(), num ? "slave" : "master", addr, ret); return ret; } @@ -231,7 +231,7 @@ static void leland_vram_port_w(address_space *space, int offset, int data, int n space->machine->primary_screen->update_partial(scanline - 1); if (LOG_COMM && addr >= 0xf000) - logerror("%s:%s comm write %04X = %02X\n", cpuexec_describe_context(space->machine), num ? "slave" : "master", addr, data); + logerror("%s:%s comm write %04X = %02X\n", space->machine->describe_context(), num ? "slave" : "master", addr, data); /* based on the low 3 bits of the offset, update the destination */ switch (offset & 7) @@ -283,7 +283,7 @@ static void leland_vram_port_w(address_space *space, int offset, int data, int n default: logerror("%s:Warning: Unknown video port write (address=%04x value=%02x)\n", - cpuexec_describe_context(space->machine), offset, addr); + space->machine->describe_context(), offset, addr); break; } diff --git a/src/mame/video/lockon.c b/src/mame/video/lockon.c index 8ea6bb0518d..e5a1978081d 100644 --- a/src/mame/video/lockon.c +++ b/src/mame/video/lockon.c @@ -69,7 +69,7 @@ static TIMER_CALLBACK( cursor_callback ) if (state->main_inten) cpu_set_input_line_and_vector(state->maincpu, 0, HOLD_LINE, 0xff); - timer_adjust_oneshot(state->cursor_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); + state->cursor_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); } /************************************* @@ -388,7 +388,7 @@ static void ground_draw( running_machine *machine ) /* End of list marker */ if (state->ground_ram[offs + 2] & 0x8000) { - timer_adjust_oneshot(state->bufend_timer, attotime::from_hz(FRAMEBUFFER_CLOCK) * (FRAMEBUFFER_MAX_X * y), 0); + state->bufend_timer->adjust(attotime::from_hz(FRAMEBUFFER_CLOCK) * (FRAMEBUFFER_MAX_X * y)); } } } @@ -922,7 +922,7 @@ VIDEO_START( lockon ) /* Timer for the CRTC cursor pulse */ state->cursor_timer = machine->scheduler().timer_alloc(FUNC(cursor_callback)); - timer_adjust_oneshot(state->cursor_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); + state->cursor_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); state_save_register_global_bitmap(machine, state->back_buffer); state_save_register_global_bitmap(machine, state->front_buffer); diff --git a/src/mame/video/mcd212.c b/src/mame/video/mcd212.c index e76af4e6610..d7e297ed518 100644 --- a/src/mame/video/mcd212.c +++ b/src/mame/video/mcd212.c @@ -1506,7 +1506,7 @@ TIMER_CALLBACK( mcd212_perform_scan ) } } } - timer_adjust_oneshot(mcd212->scan_timer, machine->primary_screen->time_until_pos(( scanline + 1 ) % 302, 0), 0); + mcd212->scan_timer->adjust(machine->primary_screen->time_until_pos(( scanline + 1 ) % 302, 0)); } void mcd212_init(running_machine *machine, mcd212_regs_t *mcd212) @@ -1656,7 +1656,7 @@ VIDEO_START( cdimono1 ) mcd212_ab_init(&state->mcd212_ab); mcd212_init(machine, &state->mcd212_regs); state->mcd212_regs.scan_timer = machine->scheduler().timer_alloc(FUNC(mcd212_perform_scan)); - timer_adjust_oneshot(state->mcd212_regs.scan_timer, machine->primary_screen->time_until_pos(0, 0), 0); + state->mcd212_regs.scan_timer->adjust(machine->primary_screen->time_until_pos(0, 0)); state->lcdbitmap = downcast<screen_device *>(machine->device("lcd"))->alloc_compatible_bitmap(); } diff --git a/src/mame/video/midvunit.c b/src/mame/video/midvunit.c index f9a4e4f7475..d29209475b4 100644 --- a/src/mame/video/midvunit.c +++ b/src/mame/video/midvunit.c @@ -60,7 +60,7 @@ static TIMER_CALLBACK( scanline_timer_cb ) if (scanline != -1) { cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); - timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(scanline + 1), scanline); + scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline + 1), scanline); machine->scheduler().timer_set(attotime::from_hz(25000000), FUNC(scanline_timer_cb), -1); } else @@ -448,7 +448,7 @@ WRITE32_HANDLER( midvunit_video_control_w ) /* update the scanline timer */ if (offset == 0) - timer_adjust_oneshot(scanline_timer, space->machine->primary_screen->time_until_pos((data & 0x1ff) + 1, 0), data & 0x1ff); + scanline_timer->adjust(space->machine->primary_screen->time_until_pos((data & 0x1ff) + 1), data & 0x1ff); /* if something changed, update our parameters */ if (old != video_regs[offset] && video_regs[6] != 0 && video_regs[11] != 0) diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c index b7a6b6e8476..25ea47846fc 100644 --- a/src/mame/video/midzeus2.c +++ b/src/mame/video/midzeus2.c @@ -541,7 +541,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset, UINT32 zeus_fifo_words = 0; /* set the interrupt signal to indicate we can handle more */ - timer_adjust_oneshot(int_timer, attotime::from_nsec(500), 0); + int_timer->adjust(attotime::from_nsec(500)); break; case 0x20: diff --git a/src/mame/video/mystston.c b/src/mame/video/mystston.c index 52939bd2ca0..a0315b033fd 100644 --- a/src/mame/video/mystston.c +++ b/src/mame/video/mystston.c @@ -57,7 +57,7 @@ static TIMER_CALLBACK( interrupt_callback ) scanline = FIRST_INT_VPOS; /* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */ - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(scanline - 1, INT_HPOS), scanline); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline - 1, INT_HPOS), scanline); } @@ -243,7 +243,7 @@ static VIDEO_RESET( mystston ) { mystston_state *state = machine->driver_data<mystston_state>(); - timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(FIRST_INT_VPOS - 1, INT_HPOS), FIRST_INT_VPOS); + state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(FIRST_INT_VPOS - 1, INT_HPOS), FIRST_INT_VPOS); } diff --git a/src/mame/video/n8080.c b/src/mame/video/n8080.c index 7ae24233316..52d59248cce 100644 --- a/src/mame/video/n8080.c +++ b/src/mame/video/n8080.c @@ -51,7 +51,7 @@ void spacefev_start_red_cannon( running_machine *machine ) n8080_state *state = machine->driver_data<n8080_state>(); state->spacefev_red_cannon = 1; - timer_adjust_oneshot(state->cannon_timer, attotime::from_usec(550 * 68 * 10), 0); + state->cannon_timer->adjust(attotime::from_usec(550 * 68 * 10)); } @@ -60,7 +60,7 @@ static TIMER_CALLBACK( spacefev_stop_red_cannon ) n8080_state *state = machine->driver_data<n8080_state>(); state->spacefev_red_cannon = 0; - timer_adjust_oneshot(state->cannon_timer, attotime::never, 0); + state->cannon_timer->adjust(attotime::never); } diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c index d67e8edefe4..3f56130965e 100644 --- a/src/mame/video/neogeo.c +++ b/src/mame/video/neogeo.c @@ -236,7 +236,7 @@ static TIMER_CALLBACK( auto_animation_timer_callback ) else state->auto_animation_frame_counter = state->auto_animation_frame_counter - 1; - timer_adjust_oneshot(state->auto_animation_timer, machine->primary_screen->time_until_pos(NEOGEO_VSSTART), 0); + state->auto_animation_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VSSTART)); } @@ -250,7 +250,7 @@ static void create_auto_animation_timer( running_machine *machine ) static void start_auto_animation_timer( running_machine *machine ) { neogeo_state *state = machine->driver_data<neogeo_state>(); - timer_adjust_oneshot(state->auto_animation_timer, machine->primary_screen->time_until_pos(NEOGEO_VSSTART), 0); + state->auto_animation_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VSSTART)); } @@ -657,7 +657,7 @@ static TIMER_CALLBACK( sprite_line_timer_callback ) /* let's come back at the beginning of the next line */ scanline = (scanline + 1) % NEOGEO_VTOTAL; - timer_adjust_oneshot(state->sprite_line_timer, machine->primary_screen->time_until_pos(scanline), scanline); + state->sprite_line_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); } @@ -671,7 +671,7 @@ static void create_sprite_line_timer( running_machine *machine ) static void start_sprite_line_timer( running_machine *machine ) { neogeo_state *state = machine->driver_data<neogeo_state>(); - timer_adjust_oneshot(state->sprite_line_timer, machine->primary_screen->time_until_pos(0), 0); + state->sprite_line_timer->adjust(machine->primary_screen->time_until_pos(0)); } @@ -775,7 +775,7 @@ static UINT16 get_video_control( running_machine *machine ) ret = (v_counter << 7) | (neogeo_get_auto_animation_counter(machine) & 0x0007); - if (VERBOSE) logerror("%s: video_control read (%04x)\n", cpuexec_describe_context(machine), ret); + if (VERBOSE) logerror("%s: video_control read (%04x)\n", machine->describe_context(), ret); return ret; } @@ -784,7 +784,7 @@ static UINT16 get_video_control( running_machine *machine ) static void set_video_control( running_machine *machine, UINT16 data ) { /* this does much more than this, but I'm not sure exactly what */ - if (VERBOSE) logerror("%s: video control write %04x\n", cpuexec_describe_context(machine), data); + if (VERBOSE) logerror("%s: video control write %04x\n", machine->describe_context(), data); set_auto_animation_speed(machine, data >> 8); set_auto_animation_disabled(machine, data & 0x0008); diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c index a969e2c3072..fb15aecca28 100644 --- a/src/mame/video/phoenix.c +++ b/src/mame/video/phoenix.c @@ -333,7 +333,7 @@ CUSTOM_INPUT( pleiads_protection_r ) /* Bit 3 is 1 */ return 1; default: - logerror("%s:Unknown protection question %02X\n", cpuexec_describe_context(field->port->machine), pleiads_protection_question); + logerror("%s:Unknown protection question %02X\n", field->port->machine->describe_context(), pleiads_protection_question); return 0; } } diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c index 5177c424210..58763ab07bb 100644 --- a/src/mame/video/ppu2c0x.c +++ b/src/mame/video/ppu2c0x.c @@ -341,7 +341,7 @@ static TIMER_CALLBACK( hblank_callback ) if (ppu2c0x->hblank_callback_proc) (*ppu2c0x->hblank_callback_proc) (device, ppu2c0x->scanline, vblank, blanked); - timer_adjust_oneshot(ppu2c0x->hblank_timer, attotime::never, 0); + ppu2c0x->hblank_timer->adjust(attotime::never); } static TIMER_CALLBACK( nmi_callback ) @@ -354,7 +354,7 @@ static TIMER_CALLBACK( nmi_callback ) if (ppu2c0x->nmi_callback_proc != NULL) (*ppu2c0x->nmi_callback_proc) (device, ppu_regs); - timer_adjust_oneshot(ppu2c0x->nmi_timer, attotime::never, 0); + ppu2c0x->nmi_timer->adjust(attotime::never); } static void draw_background( device_t *device, UINT8 *line_priority ) @@ -867,7 +867,7 @@ static TIMER_CALLBACK( scanline_callback ) // a game can read the high bit of $2002 before the NMI is called (potentially resetting the bit // via a read from $2002 in the NMI handler). // B-Wings is an example game that needs this. - timer_adjust_oneshot(ppu2c0x->nmi_timer, device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(4), 0); + ppu2c0x->nmi_timer->adjust(device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(4)); } } @@ -895,10 +895,10 @@ static TIMER_CALLBACK( scanline_callback ) next_scanline = 0; // Call us back when the hblank starts for this scanline - timer_adjust_oneshot(ppu2c0x->hblank_timer, device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(86.67), 0); // ??? FIXME - hardcoding NTSC, need better calculation + ppu2c0x->hblank_timer->adjust(device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation // trigger again at the start of the next scanline - timer_adjust_oneshot(ppu2c0x->scanline_timer, device->machine->primary_screen->time_until_pos(next_scanline * ppu2c0x->scan_scale), 0); + ppu2c0x->scanline_timer->adjust(device->machine->primary_screen->time_until_pos(next_scanline * ppu2c0x->scan_scale)); } /************************************* @@ -1302,13 +1302,13 @@ static DEVICE_START( ppu2c0x ) /* initialize the scanline handling portion */ ppu2c0x->scanline_timer = device->machine->scheduler().timer_alloc(FUNC(scanline_callback), (void *) device); - timer_adjust_oneshot(ppu2c0x->scanline_timer, device->machine->primary_screen->time_until_pos(1), 0); + ppu2c0x->scanline_timer->adjust(device->machine->primary_screen->time_until_pos(1)); ppu2c0x->hblank_timer = device->machine->scheduler().timer_alloc(FUNC(hblank_callback), (void *) device); - timer_adjust_oneshot(ppu2c0x->hblank_timer, device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(86.67), 0); // ??? FIXME - hardcoding NTSC, need better calculation + ppu2c0x->hblank_timer->adjust(device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation ppu2c0x->nmi_timer = device->machine->scheduler().timer_alloc(FUNC(nmi_callback), (void *) device); - timer_adjust_oneshot(ppu2c0x->nmi_timer, attotime::never, 0); + ppu2c0x->nmi_timer->adjust(attotime::never); ppu2c0x->nmi_callback_proc = intf->nmi_handler; ppu2c0x->color_base = intf->color_base; diff --git a/src/mame/video/psx.c b/src/mame/video/psx.c index bdcf0b747c4..59ec4b191c3 100644 --- a/src/mame/video/psx.c +++ b/src/mame/video/psx.c @@ -270,7 +270,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( psx_gpu *p_psxgpu, int n_level, const c va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror( "%s: %s", cpuexec_describe_context(p_psxgpu->machine), buf ); + logerror( "%s: %s", p_psxgpu->machine->describe_context(), buf ); } } diff --git a/src/mame/video/rpunch.c b/src/mame/video/rpunch.c index 0593decb580..306d3cb6900 100644 --- a/src/mame/video/rpunch.c +++ b/src/mame/video/rpunch.c @@ -83,7 +83,7 @@ static TIMER_CALLBACK( crtc_interrupt_gen ) { cputag_set_input_line(machine, "maincpu", 1, HOLD_LINE); if (param != 0) - timer_adjust_periodic(crtc_timer, machine->primary_screen->frame_period() / param, 0, machine->primary_screen->frame_period() / param); + crtc_timer->adjust(machine->primary_screen->frame_period() / param, 0, machine->primary_screen->frame_period() / param); } @@ -171,7 +171,7 @@ WRITE16_HANDLER( rpunch_crtc_data_w ) { /* only register we know about.... */ case 0x0b: - timer_adjust_oneshot(crtc_timer, space->machine->primary_screen->time_until_vblank_start(), (data == 0xc0) ? 2 : 1); + crtc_timer->adjust(space->machine->primary_screen->time_until_vblank_start(), (data == 0xc0) ? 2 : 1); break; default: diff --git a/src/mame/video/starfire.c b/src/mame/video/starfire.c index d095c8d2af1..2c3b75f622f 100644 --- a/src/mame/video/starfire.c +++ b/src/mame/video/starfire.c @@ -21,7 +21,7 @@ VIDEO_START( starfire ) state->starfire_screen = machine->primary_screen->alloc_compatible_bitmap(); state->scanline_timer = machine->scheduler().timer_alloc(FUNC(starfire_scanline_callback)); - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND); /* register for state saving */ state_save_register_global(machine, state->starfire_vidctrl); @@ -265,7 +265,7 @@ static TIMER_CALLBACK( starfire_scanline_callback ) y++; if (y >= STARFIRE_VBSTART) y = STARFIRE_VBEND; - timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(y), y); + state->scanline_timer->adjust(machine->primary_screen->time_until_pos(y), y); } VIDEO_UPDATE( starfire ) diff --git a/src/mame/video/twin16.c b/src/mame/video/twin16.c index 5f35a40b183..ffa4d97ab74 100644 --- a/src/mame/video/twin16.c +++ b/src/mame/video/twin16.c @@ -156,7 +156,7 @@ static int twin16_set_sprite_timer( running_machine *machine ) // sprite system busy, maybe a dma? time is guessed, assume 4 scanlines twin16_sprite_busy = 1; - timer_adjust_oneshot(twin16_sprite_timer, machine->primary_screen->frame_period() / machine->primary_screen->height() * 4, 0); + twin16_sprite_timer->adjust(machine->primary_screen->frame_period() / machine->primary_screen->height() * 4); return 0; } @@ -505,7 +505,7 @@ VIDEO_START( twin16 ) memset(twin16_sprite_buffer,0xff,0x800*sizeof(UINT16)); twin16_sprite_busy = 0; twin16_sprite_timer = machine->scheduler().timer_alloc(FUNC(twin16_sprite_tick)); - timer_adjust_oneshot(twin16_sprite_timer, attotime::never, 0); + twin16_sprite_timer->adjust(attotime::never); /* register for savestates */ state_save_register_global_array(machine, twin16_sprite_buffer); diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c index af3e8392b4d..45128466ba6 100644 --- a/src/mame/video/tx1.c +++ b/src/mame/video/tx1.c @@ -35,7 +35,7 @@ static emu_timer *interrupt_timer; static TIMER_CALLBACK( interrupt_callback ) { cputag_set_input_line_and_vector(machine, "main_cpu", 0, HOLD_LINE, 0xff); - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); } @@ -1131,7 +1131,7 @@ VIDEO_START( tx1 ) interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback)); /* /CUDISP CRTC interrupt */ - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); } VIDEO_EOF( tx1 ) @@ -3050,7 +3050,7 @@ VIDEO_START( buggyboy ) interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback)); /* /CUDISP CRTC interrupt */ - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); } VIDEO_START( buggybjr ) @@ -3064,7 +3064,7 @@ VIDEO_START( buggybjr ) interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback)); /* /CUDISP CRTC interrupt */ - timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); + interrupt_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); } VIDEO_EOF( buggyboy ) diff --git a/src/mame/video/victory.c b/src/mame/video/victory.c index fc97cd0f8af..1d193a1c265 100644 --- a/src/mame/video/victory.c +++ b/src/mame/video/victory.c @@ -192,7 +192,7 @@ READ8_HANDLER( victory_video_control_r ) // D5 = 5VIRQ // D4 = 5BCIRQ (3B1) // D3 = SL256 - if (micro.timer_active && timer_timeelapsed(micro.timer) < micro.endtime) + if (micro.timer_active && micro.timer->elapsed() < micro.endtime) result |= 0x80; result |= (~fgcoll & 1) << 6; result |= (~vblank_irq & 1) << 5; @@ -530,13 +530,13 @@ INLINE void count_states(int states) if (!micro.timer) { - timer_adjust_oneshot(micro.timer, attotime::never, 0); + micro.timer->adjust(attotime::never); micro.timer_active = 1; micro.endtime = state_time; } - else if (timer_timeelapsed(micro.timer) > micro.endtime) + else if (micro.timer->elapsed() > micro.endtime) { - timer_adjust_oneshot(micro.timer, attotime::never, 0); + micro.timer->adjust(attotime::never); micro.timer_active = 1; micro.endtime = state_time; } diff --git a/src/mame/video/ygv608.c b/src/mame/video/ygv608.c index 62d133d2de0..87c441b3b78 100644 --- a/src/mame/video/ygv608.c +++ b/src/mame/video/ygv608.c @@ -1412,7 +1412,7 @@ static void SetPostShortcuts( running_machine *machine, int reg ) UINT8 yTile = ygv608.regs.s.r0 & r0_pny; if (yTile >= ygv608.page_y) - logerror ("%s:setting pny(%d) >= page_y(%d)\n", cpuexec_describe_context(machine), + logerror ("%s:setting pny(%d) >= page_y(%d)\n", machine->describe_context(), yTile, ygv608.page_y ); yTile &= (ygv608.page_y - 1); ygv608.regs.s.r0 &= ~r0_pny; @@ -1425,7 +1425,7 @@ static void SetPostShortcuts( running_machine *machine, int reg ) UINT8 xTile = ygv608.regs.s.r1 & r1_pnx; if (xTile >= ygv608.page_x) - logerror ("%s:setting pnx(%d) >= page_x(%d)\n", cpuexec_describe_context(machine), + logerror ("%s:setting pnx(%d) >= page_x(%d)\n", machine->describe_context(), xTile, ygv608.page_x ); xTile &= (ygv608.page_x - 1); ygv608.regs.s.r1 &= ~r1_pnx; |