summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-03-07 14:45:58 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-03-07 14:45:58 +0100
commit8ea9ff6a7afdcc5ca5e48351feee06e43d7fc4ee (patch)
treed3dfa7422f877f4902ed4e3b3f94a5d15cc41c58 /src
parentfea09343fb83663225a5099f2fb857e264588be9 (diff)
TIMER_CALLBACK to TIMER_CALLBACK_MEMBER (nw)
Diffstat (limited to 'src')
-rw-r--r--src/devices/cpu/m68000/m68000.h3
-rw-r--r--src/devices/cpu/m68000/m68kcpu.cpp20
-rw-r--r--src/devices/cpu/sh4/sh4dmac.h2
-rw-r--r--src/devices/machine/68307tmu.cpp15
-rw-r--r--src/devices/machine/68307tmu.h4
-rw-r--r--src/devices/machine/74123.cpp4
-rw-r--r--src/devices/machine/f3853.cpp10
-rw-r--r--src/devices/machine/f3853.h5
-rw-r--r--src/devices/machine/k056230.cpp9
-rw-r--r--src/devices/machine/k056230.h3
-rw-r--r--src/devices/machine/rtc65271.cpp32
-rw-r--r--src/devices/machine/rtc65271.h10
-rw-r--r--src/devices/machine/rtc9701.cpp9
-rw-r--r--src/devices/machine/rtc9701.h4
-rw-r--r--src/devices/machine/s3520cf.cpp8
-rw-r--r--src/devices/machine/s3520cf.h4
-rw-r--r--src/devices/machine/v3021.cpp9
-rw-r--r--src/devices/machine/v3021.h4
-rw-r--r--src/devices/machine/z80ctc.cpp6
-rw-r--r--src/devices/machine/z80ctc.h5
-rw-r--r--src/devices/machine/z80dma.cpp10
-rw-r--r--src/devices/machine/z80dma.h6
-rw-r--r--src/devices/video/315_5313.cpp32
-rw-r--r--src/devices/video/315_5313.h6
-rw-r--r--src/emu/diexec.cpp29
-rw-r--r--src/emu/diexec.h13
-rw-r--r--src/emu/schedule.h2
-rw-r--r--src/emu/tilemap.cpp46
-rw-r--r--src/emu/tilemap.h16
-rw-r--r--src/mame/includes/kaypro.h12
-rw-r--r--src/mame/includes/mac.h2
-rw-r--r--src/mame/machine/apollo_kbd.cpp9
-rw-r--r--src/mame/machine/apollo_kbd.h3
-rw-r--r--src/mame/machine/kay_kbd.cpp39
-rw-r--r--src/mame/machine/kaypro.cpp6
-rw-r--r--src/mame/machine/mac.cpp7
-rw-r--r--src/mame/machine/macadb.cpp132
-rw-r--r--src/mame/machine/mega32x.cpp13
-rw-r--r--src/mame/machine/mega32x.h2
-rw-r--r--src/mame/machine/rx01.cpp6
-rw-r--r--src/mame/machine/rx01.h3
41 files changed, 215 insertions, 345 deletions
diff --git a/src/devices/cpu/m68000/m68000.h b/src/devices/cpu/m68000/m68000.h
index 013627ac6c0..6dc0c37489c 100644
--- a/src/devices/cpu/m68000/m68000.h
+++ b/src/devices/cpu/m68000/m68000.h
@@ -141,6 +141,9 @@ public:
DECLARE_WRITE_LINE_MEMBER( write_irq6 );
DECLARE_WRITE_LINE_MEMBER( write_irq7 );
+ void presave();
+ void postload();
+
void clear_all(void);
virtual UINT32 disasm_min_opcode_bytes() const override { return 2; };
diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp
index 02809436472..38ff81d57f3 100644
--- a/src/devices/cpu/m68000/m68kcpu.cpp
+++ b/src/devices/cpu/m68000/m68kcpu.cpp
@@ -659,19 +659,19 @@ static void set_irq_line(m68000_base_device *m68k, int irqline, int state)
m68k->nmi_pending = TRUE;
}
-static void m68k_presave(m68000_base_device *m68k)
+void m68000_base_device::presave()
{
- m68k->save_sr = m68ki_get_sr(m68k);
- m68k->save_stopped = (m68k->stopped & STOP_LEVEL_STOP) != 0;
- m68k->save_halted = (m68k->stopped & STOP_LEVEL_HALT) != 0;
+ save_sr = m68ki_get_sr(this);
+ save_stopped = (stopped & STOP_LEVEL_STOP) != 0;
+ save_halted = (stopped & STOP_LEVEL_HALT) != 0;
}
-static void m68k_postload(m68000_base_device *m68k)
+void m68000_base_device::postload()
{
- m68ki_set_sr_noint_nosp(m68k, m68k->save_sr);
+ m68ki_set_sr_noint_nosp(this, save_sr);
//fprintf(stderr, "Reloaded, pc=%x\n", REG_PC(m68k));
- m68k->stopped = (m68k->save_stopped ? STOP_LEVEL_STOP : 0) | (m68k->save_halted ? STOP_LEVEL_HALT : 0);
- m68ki_jump(m68k, REG_PC(m68k));
+ stopped = (save_stopped ? STOP_LEVEL_STOP : 0) | (save_halted ? STOP_LEVEL_HALT : 0);
+ m68ki_jump(this, REG_PC(this));
}
static void m68k_cause_bus_error(m68000_base_device *m68k)
@@ -1025,8 +1025,8 @@ void m68000_base_device::init_cpu_common(void)
save_item(NAME(mmu_atc_data[i]), i);
}
- machine().save().register_presave(save_prepost_delegate(FUNC(m68k_presave), this));
- machine().save().register_postload(save_prepost_delegate(FUNC(m68k_postload), this));
+ machine().save().register_presave(save_prepost_delegate(FUNC(m68000_base_device::presave), this));
+ machine().save().register_postload(save_prepost_delegate(FUNC(m68000_base_device::postload), this));
m_icountptr = &remaining_cycles;
remaining_cycles = 0;
diff --git a/src/devices/cpu/sh4/sh4dmac.h b/src/devices/cpu/sh4/sh4dmac.h
index 60148653c2b..fe0bbc84514 100644
--- a/src/devices/cpu/sh4/sh4dmac.h
+++ b/src/devices/cpu/sh4/sh4dmac.h
@@ -27,8 +27,6 @@
#define DMAOR_NMIF 0x0002
#define DMAOR_DME 0x0001
-TIMER_CALLBACK( sh4_dmac_callback );
-
void sh4_handle_sar0_addr_w(UINT32 data, UINT32 mem_mask);
void sh4_handle_sar1_addr_w(UINT32 data, UINT32 mem_mask);
void sh4_handle_sar2_addr_w(UINT32 data, UINT32 mem_mask);
diff --git a/src/devices/machine/68307tmu.cpp b/src/devices/machine/68307tmu.cpp
index 6f5c33687cd..e3c8e595f7c 100644
--- a/src/devices/machine/68307tmu.cpp
+++ b/src/devices/machine/68307tmu.cpp
@@ -99,7 +99,7 @@ WRITE16_MEMBER( m68307cpu_device::m68307_internal_timer_w )
}
}
-static TIMER_CALLBACK( m68307_timer0_callback )
+TIMER_CALLBACK_MEMBER(m68307_timer::timer0_callback )
{
m68307cpu_device* m68k = (m68307cpu_device *)ptr;
m68307_single_timer* tptr = &m68k->m68307TIMER->singletimer[0];
@@ -110,7 +110,7 @@ static TIMER_CALLBACK( m68307_timer0_callback )
tptr->mametimer->adjust(m68k->cycles_to_attotime(20000));
}
-static TIMER_CALLBACK( m68307_timer1_callback )
+TIMER_CALLBACK_MEMBER(m68307_timer::timer1_callback )
{
m68307cpu_device* m68k = (m68307cpu_device *)ptr;
m68307_single_timer* tptr = &m68k->m68307TIMER->singletimer[1];
@@ -122,7 +122,7 @@ static TIMER_CALLBACK( m68307_timer1_callback )
}
-static TIMER_CALLBACK( m68307_wd_timer_callback )
+TIMER_CALLBACK_MEMBER(m68307_timer::wd_timer_callback )
{
printf("wd timer\n");
}
@@ -134,15 +134,12 @@ void m68307_timer::init(m68307cpu_device *device)
m68307_single_timer* tptr;
tptr = &singletimer[0];
- tptr->mametimer = device->machine().scheduler().timer_alloc(FUNC(m68307_timer0_callback), parent);
+ tptr->mametimer = device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68307_timer::timer0_callback),this), parent);
tptr = &singletimer[1];
- tptr->mametimer = device->machine().scheduler().timer_alloc(FUNC(m68307_timer1_callback), parent);
-
-
- wd_mametimer = device->machine().scheduler().timer_alloc(FUNC(m68307_wd_timer_callback), parent);
-
+ tptr->mametimer = device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68307_timer::timer1_callback),this), parent);
+ wd_mametimer = device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68307_timer::wd_timer_callback),this), parent);
}
UINT16 m68307_timer::read_tcn(UINT16 mem_mask, int which)
diff --git a/src/devices/machine/68307tmu.h b/src/devices/machine/68307tmu.h
index 2c62858b66d..660bdaeeb41 100644
--- a/src/devices/machine/68307tmu.h
+++ b/src/devices/machine/68307tmu.h
@@ -38,4 +38,8 @@ class m68307_timer
void init(m68307cpu_device *device);
void reset(void);
+
+ TIMER_CALLBACK_MEMBER(timer0_callback);
+ TIMER_CALLBACK_MEMBER(timer1_callback);
+ TIMER_CALLBACK_MEMBER(wd_timer_callback);
};
diff --git a/src/devices/machine/74123.cpp b/src/devices/machine/74123.cpp
index d5eddbe91a3..0263ad0eb4b 100644
--- a/src/devices/machine/74123.cpp
+++ b/src/devices/machine/74123.cpp
@@ -116,7 +116,7 @@ int ttl74123_device::timer_running()
/*-------------------------------------------------
- TIMER_CALLBACK( output_callback )
+ TIMER_CALLBACK_MEMBER( output_callback )
-------------------------------------------------*/
TIMER_CALLBACK_MEMBER( ttl74123_device::output_callback )
@@ -140,7 +140,7 @@ void ttl74123_device::set_output()
/*-------------------------------------------------
- TIMER_CALLBACK( clear_callback )
+ TIMER_CALLBACK_MEMBER( clear_callback )
-------------------------------------------------*/
TIMER_CALLBACK_MEMBER( ttl74123_device::clear_callback )
diff --git a/src/devices/machine/f3853.cpp b/src/devices/machine/f3853.cpp
index a37e1b7e59b..49deb99f073 100644
--- a/src/devices/machine/f3853.cpp
+++ b/src/devices/machine/f3853.cpp
@@ -77,7 +77,7 @@ void f3853_device::device_start()
m_interrupt_req_cb.bind_relative_to(*owner());
- m_timer = machine().scheduler().timer_alloc(FUNC(f3853_timer_callback), (void *)this );
+ m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(f3853_device::timer_callback),this));
save_item(NAME(m_high) );
save_item(NAME(m_low) );
@@ -128,13 +128,7 @@ void f3853_device::timer_start(UINT8 value)
m_timer->adjust(period);
}
-
-TIMER_CALLBACK( f3853_device::f3853_timer_callback )
-{
- reinterpret_cast<f3853_device*>(ptr)->timer();
-}
-
-void f3853_device::timer()
+TIMER_CALLBACK_MEMBER(f3853_device::timer_callback)
{
if(m_timer_enable)
{
diff --git a/src/devices/machine/f3853.h b/src/devices/machine/f3853.h
index 82e9610c174..b080b982fc2 100644
--- a/src/devices/machine/f3853.h
+++ b/src/devices/machine/f3853.h
@@ -72,20 +72,17 @@ public:
void set_external_interrupt_in_line(int level);
void set_priority_in_line(int level);
+ TIMER_CALLBACK_MEMBER(timer_callback);
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_post_load() override { }
virtual void device_clock_changed() override { }
-
- static TIMER_CALLBACK( f3853_timer_callback );
-
private:
void set_interrupt_request_line();
void timer_start(UINT8 value);
- void timer();
f3853_interrupt_req_delegate m_interrupt_req_cb;
UINT8 m_high;
diff --git a/src/devices/machine/k056230.cpp b/src/devices/machine/k056230.cpp
index 8d750b66a8a..f641b799147 100644
--- a/src/devices/machine/k056230.cpp
+++ b/src/devices/machine/k056230.cpp
@@ -54,12 +54,7 @@ READ8_MEMBER(k056230_device::read)
return 0;
}
-TIMER_CALLBACK( k056230_device::network_irq_clear_callback )
-{
- reinterpret_cast<k056230_device*>(ptr)->network_irq_clear();
-}
-
-void k056230_device::network_irq_clear()
+TIMER_CALLBACK_MEMBER(k056230_device::network_irq_clear)
{
if (m_cpu)
m_cpu->set_input_line(INPUT_LINE_IRQ2, CLEAR_LINE);
@@ -84,7 +79,7 @@ WRITE8_MEMBER(k056230_device::write)
if (m_cpu)
m_cpu->set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE);
- machine().scheduler().timer_set(attotime::from_usec(10), FUNC(network_irq_clear_callback), 0, (void*)this);
+ machine().scheduler().timer_set(attotime::from_usec(10), timer_expired_delegate(FUNC(k056230_device::network_irq_clear), this));
}
}
// else
diff --git a/src/devices/machine/k056230.h b/src/devices/machine/k056230.h
index 5695261f4c2..4fa8d165fd1 100644
--- a/src/devices/machine/k056230.h
+++ b/src/devices/machine/k056230.h
@@ -47,7 +47,7 @@ public:
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
- static TIMER_CALLBACK( network_irq_clear_callback );
+ TIMER_CALLBACK_MEMBER(network_irq_clear);
protected:
// device-level overrides
@@ -58,7 +58,6 @@ protected:
private:
- void network_irq_clear();
int m_is_thunderh;
required_device<cpu_device> m_cpu;
diff --git a/src/devices/machine/rtc65271.cpp b/src/devices/machine/rtc65271.cpp
index 074b8d87f48..0c02e4fb176 100644
--- a/src/devices/machine/rtc65271.cpp
+++ b/src/devices/machine/rtc65271.cpp
@@ -464,30 +464,10 @@ void rtc65271_device::field_interrupts()
/*
- Timer handlers
-*/
-TIMER_CALLBACK( rtc65271_device::rtc_SQW_callback )
-{
- rtc65271_device *rtc = reinterpret_cast<rtc65271_device *>(ptr);
- rtc->rtc_SQW_cb();
-}
-
-TIMER_CALLBACK( rtc65271_device::rtc_begin_update_callback )
-{
- rtc65271_device *rtc = reinterpret_cast<rtc65271_device *>(ptr);
- rtc->rtc_begin_update_cb();
-}
-
-TIMER_CALLBACK( rtc65271_device::rtc_end_update_callback )
-{
- rtc65271_device *rtc = reinterpret_cast<rtc65271_device *>(ptr);
- rtc->rtc_end_update_cb();
-}
-/*
Update SQW output state each half-period and assert periodic interrupt each
period.
*/
-void rtc65271_device::rtc_SQW_cb()
+TIMER_CALLBACK_MEMBER(rtc65271_device::rtc_SQW_cb)
{
attotime half_period;
@@ -506,14 +486,14 @@ void rtc65271_device::rtc_SQW_cb()
/*
Begin update cycle (called every second)
*/
-void rtc65271_device::rtc_begin_update_cb()
+TIMER_CALLBACK_MEMBER(rtc65271_device::rtc_begin_update_cb)
{
if (((m_regs[reg_A] & reg_A_DV) == 0x20) && ! (m_regs[reg_B] & reg_B_SET))
{
m_regs[reg_A] |= reg_A_UIP;
/* schedule end of update cycle */
- machine().scheduler().timer_set(UPDATE_CYCLE_TIME, FUNC(rtc_end_update_callback), 0, (void *)this);
+ machine().scheduler().timer_set(UPDATE_CYCLE_TIME, timer_expired_delegate(FUNC(rtc65271_device::rtc_end_update_cb), this));
}
}
@@ -521,7 +501,7 @@ void rtc65271_device::rtc_begin_update_cb()
End update cycle (called UPDATE_CYCLE_TIME = 1948us after start of update
cycle)
*/
-void rtc65271_device::rtc_end_update_cb()
+TIMER_CALLBACK_MEMBER(rtc65271_device::rtc_end_update_cb)
{
static const int days_in_month_table[12] =
{
@@ -684,9 +664,9 @@ rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag,
//-------------------------------------------------
void rtc65271_device::device_start()
{
- m_update_timer = machine().scheduler().timer_alloc(FUNC(rtc_begin_update_callback), (void *)this);
+ m_update_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rtc65271_device::rtc_begin_update_cb), this));
m_update_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1));
- m_SQW_timer = machine().scheduler().timer_alloc(FUNC(rtc_SQW_callback), (void *)this);
+ m_SQW_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rtc65271_device::rtc_SQW_cb), this));
m_interrupt_cb.resolve();
save_item(NAME(m_regs));
diff --git a/src/devices/machine/rtc65271.h b/src/devices/machine/rtc65271.h
index c5d554e75fd..903f5fe9a28 100644
--- a/src/devices/machine/rtc65271.h
+++ b/src/devices/machine/rtc65271.h
@@ -43,13 +43,9 @@ private:
void write(int xramsel, offs_t offset, UINT8 data);
void field_interrupts();
- static TIMER_CALLBACK( rtc_SQW_callback );
- static TIMER_CALLBACK( rtc_begin_update_callback );
- static TIMER_CALLBACK( rtc_end_update_callback );
-
- void rtc_SQW_cb();
- void rtc_begin_update_cb();
- void rtc_end_update_cb();
+ TIMER_CALLBACK_MEMBER(rtc_SQW_cb);
+ TIMER_CALLBACK_MEMBER(rtc_begin_update_cb);
+ TIMER_CALLBACK_MEMBER(rtc_end_update_cb);
/* 64 8-bit registers (10 clock registers, 4 control/status registers, and
50 bytes of user RAM) */
UINT8 m_regs[64];
diff --git a/src/devices/machine/rtc9701.cpp b/src/devices/machine/rtc9701.cpp
index 7c92ddc53e7..fc72c76c900 100644
--- a/src/devices/machine/rtc9701.cpp
+++ b/src/devices/machine/rtc9701.cpp
@@ -41,7 +41,7 @@ rtc9701_device::rtc9701_device(const machine_config &mconfig, const char *tag, d
{
}
-void rtc9701_device::timer_callback()
+TIMER_CALLBACK_MEMBER(rtc9701_device::timer_callback)
{
static const UINT8 dpm[12] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 };
int dpm_count;
@@ -72,11 +72,6 @@ void rtc9701_device::timer_callback()
if((m_rtc.year & 0xf0) >= 0xa0) { m_rtc.year = 0; } //2000-2099 possible timeframe
}
-TIMER_CALLBACK( rtc9701_device::rtc_inc_callback )
-{
- reinterpret_cast<rtc9701_device *>(ptr)->timer_callback();
-}
-
//-------------------------------------------------
// device_validity_check - perform validity checks
// on this device
@@ -93,7 +88,7 @@ void rtc9701_device::device_validity_check(validity_checker &valid) const
void rtc9701_device::device_start()
{
/* let's call the timer callback every second */
- machine().scheduler().timer_pulse(attotime::from_hz(clock() / XTAL_32_768kHz), FUNC(rtc_inc_callback), 0, (void *)this);
+ machine().scheduler().timer_pulse(attotime::from_hz(clock() / XTAL_32_768kHz), timer_expired_delegate(FUNC(rtc9701_device::timer_callback), this));
system_time systime;
machine().base_datetime(systime);
diff --git a/src/devices/machine/rtc9701.h b/src/devices/machine/rtc9701.h
index 14407f157ec..c294cb5d9f1 100644
--- a/src/devices/machine/rtc9701.h
+++ b/src/devices/machine/rtc9701.h
@@ -59,7 +59,7 @@ public:
DECLARE_READ_LINE_MEMBER( read_bit );
DECLARE_WRITE_LINE_MEMBER( set_cs_line );
DECLARE_WRITE_LINE_MEMBER( set_clock_line );
- void timer_callback();
+ TIMER_CALLBACK_MEMBER(timer_callback);
protected:
// device-level overrides
@@ -74,8 +74,6 @@ protected:
inline UINT8 rtc_read(UINT8 offset);
inline void rtc_write(UINT8 offset,UINT8 data);
- static TIMER_CALLBACK( rtc_inc_callback );
-
int m_latch;
int m_reset_line;
int m_clock_line;
diff --git a/src/devices/machine/s3520cf.cpp b/src/devices/machine/s3520cf.cpp
index d37a6b2a542..e504e5b9022 100644
--- a/src/devices/machine/s3520cf.cpp
+++ b/src/devices/machine/s3520cf.cpp
@@ -40,7 +40,7 @@ s3520cf_device::s3520cf_device(const machine_config &mconfig, const char *tag, d
{
}
-void s3520cf_device::timer_callback()
+TIMER_CALLBACK_MEMBER(s3520cf_device::timer_callback)
{
static const UINT8 dpm[12] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 };
int dpm_count;
@@ -71,10 +71,6 @@ void s3520cf_device::timer_callback()
if((m_rtc.year & 0xf0) >= 0xa0) { m_rtc.year = 0; } //1901-2000 possible timeframe
}
-TIMER_CALLBACK( s3520cf_device::rtc_inc_callback )
-{
- reinterpret_cast<s3520cf_device *>(ptr)->timer_callback();
-}
//-------------------------------------------------
// device_validity_check - perform validity checks
@@ -93,7 +89,7 @@ void s3520cf_device::device_validity_check(validity_checker &valid) const
void s3520cf_device::device_start()
{
/* let's call the timer callback every second for now */
- machine().scheduler().timer_pulse(attotime::from_hz(clock() / XTAL_32_768kHz), FUNC(rtc_inc_callback), 0, (void *)this);
+ machine().scheduler().timer_pulse(attotime::from_hz(clock() / XTAL_32_768kHz), timer_expired_delegate(FUNC(s3520cf_device::timer_callback), this));
system_time systime;
machine().base_datetime(systime);
diff --git a/src/devices/machine/s3520cf.h b/src/devices/machine/s3520cf.h
index c277c69142a..b2b3fa452a6 100644
--- a/src/devices/machine/s3520cf.h
+++ b/src/devices/machine/s3520cf.h
@@ -50,7 +50,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( set_cs_line );
DECLARE_WRITE_LINE_MEMBER( set_clock_line );
DECLARE_WRITE_LINE_MEMBER( write_bit );
- void timer_callback();
+ TIMER_CALLBACK_MEMBER(timer_callback);
protected:
// device-level overrides
@@ -60,8 +60,6 @@ protected:
inline UINT8 rtc_read(UINT8 offset);
inline void rtc_write(UINT8 offset,UINT8 data);
- static TIMER_CALLBACK( rtc_inc_callback );
-
int m_dir;
int m_latch;
int m_reset_line;
diff --git a/src/devices/machine/v3021.cpp b/src/devices/machine/v3021.cpp
index ab0057d9951..d7caf681c70 100644
--- a/src/devices/machine/v3021.cpp
+++ b/src/devices/machine/v3021.cpp
@@ -38,7 +38,7 @@ v3021_device::v3021_device(const machine_config &mconfig, const char *tag, devic
{
}
-void v3021_device::timer_callback()
+TIMER_CALLBACK_MEMBER(v3021_device::timer_callback)
{
static const UINT8 dpm[12] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 };
int dpm_count;
@@ -69,11 +69,6 @@ void v3021_device::timer_callback()
if((m_rtc.year & 0xf0) >= 0xa0) { m_rtc.year = 0; } //2000-2099 possible timeframe
}
-TIMER_CALLBACK( v3021_device::rtc_inc_callback )
-{
- reinterpret_cast<v3021_device *>(ptr)->timer_callback();
-}
-
//-------------------------------------------------
// device_validity_check - perform validity checks
// on this device
@@ -90,7 +85,7 @@ void v3021_device::device_validity_check(validity_checker &valid) const
void v3021_device::device_start()
{
/* let's call the timer callback every second */
- machine().scheduler().timer_pulse(attotime::from_hz(clock() / XTAL_32_768kHz), FUNC(rtc_inc_callback), 0, (void *)this);
+ machine().scheduler().timer_pulse(attotime::from_hz(clock() / XTAL_32_768kHz), timer_expired_delegate(FUNC(v3021_device::timer_callback),this));
system_time systime;
machine().base_datetime(systime);
diff --git a/src/devices/machine/v3021.h b/src/devices/machine/v3021.h
index 7e4844216c4..ed13501e949 100644
--- a/src/devices/machine/v3021.h
+++ b/src/devices/machine/v3021.h
@@ -45,7 +45,7 @@ public:
// I/O operations
DECLARE_WRITE8_MEMBER( write );
DECLARE_READ8_MEMBER( read );
- void timer_callback();
+ TIMER_CALLBACK_MEMBER(timer_callback);
protected:
// device-level overrides
@@ -53,8 +53,6 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
- static TIMER_CALLBACK( rtc_inc_callback );
-
UINT8 m_cal_mask,m_cal_com,m_cal_cnt,m_cal_val;
rtc_regs_t m_rtc;
diff --git a/src/devices/machine/z80ctc.cpp b/src/devices/machine/z80ctc.cpp
index 276254d96f1..a6cb090e30b 100644
--- a/src/devices/machine/z80ctc.cpp
+++ b/src/devices/machine/z80ctc.cpp
@@ -303,7 +303,7 @@ void z80ctc_device::ctc_channel::start(z80ctc_device *device, int index)
// initialize state
m_device = device;
m_index = index;
- m_timer = m_device->machine().scheduler().timer_alloc(FUNC(static_timer_callback), this);
+ m_timer = m_device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80ctc_device::ctc_channel::timer_callback), this));
// register for save states
m_device->save_item(NAME(m_mode), m_index);
@@ -478,7 +478,7 @@ void z80ctc_device::ctc_channel::trigger(UINT8 data)
{
// if we hit zero, do the same thing as for a timer interrupt
if (--m_down == 0)
- timer_callback();
+ timer_callback(nullptr,0);
}
}
}
@@ -490,7 +490,7 @@ void z80ctc_device::ctc_channel::trigger(UINT8 data)
// side-effects
//-------------------------------------------------
-void z80ctc_device::ctc_channel::timer_callback()
+TIMER_CALLBACK_MEMBER(z80ctc_device::ctc_channel::timer_callback)
{
// down counter has reached zero - see if we should interrupt
if ((m_mode & INTERRUPT) == INTERRUPT_ON)
diff --git a/src/devices/machine/z80ctc.h b/src/devices/machine/z80ctc.h
index 2c3002e1166..a144ff013d4 100644
--- a/src/devices/machine/z80ctc.h
+++ b/src/devices/machine/z80ctc.h
@@ -103,7 +103,7 @@ private:
attotime period() const;
void trigger(UINT8 data);
- void timer_callback();
+ TIMER_CALLBACK_MEMBER(timer_callback);
z80ctc_device * m_device; // pointer back to our device
int m_index; // our channel index
@@ -113,9 +113,6 @@ private:
UINT8 m_extclk; // current signal from the external clock
emu_timer * m_timer; // array of active timers
UINT8 m_int_state; // interrupt status (for daisy chain)
-
- private:
- static TIMER_CALLBACK( static_timer_callback ) { reinterpret_cast<z80ctc_device::ctc_channel *>(ptr)->timer_callback(); }
};
// internal state
diff --git a/src/devices/machine/z80dma.cpp b/src/devices/machine/z80dma.cpp
index c1f3162bebd..bf5c4585234 100644
--- a/src/devices/machine/z80dma.cpp
+++ b/src/devices/machine/z80dma.cpp
@@ -176,7 +176,7 @@ void z80dma_device::device_start()
m_out_iorq_cb.resolve_safe();
// allocate timer
- m_timer = machine().scheduler().timer_alloc(FUNC(static_timerproc), (void *)this);
+ m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80dma_device::timerproc), this));
// register for state saving
save_item(NAME(m_regs));
@@ -488,7 +488,7 @@ int z80dma_device::do_write()
// timerproc
//-------------------------------------------------
-void z80dma_device::timerproc()
+TIMER_CALLBACK_MEMBER(z80dma_device::timerproc)
{
int done;
@@ -837,10 +837,10 @@ void z80dma_device::write(UINT8 data)
// rdy_write_callback - deferred RDY signal write
//-------------------------------------------------
-void z80dma_device::rdy_write_callback(int state)
+TIMER_CALLBACK_MEMBER(z80dma_device::rdy_write_callback)
{
// normalize state
- m_rdy = state;
+ m_rdy = param;
m_status = (m_status & 0xFD) | (!is_ready() << 1);
update_status();
@@ -859,7 +859,7 @@ void z80dma_device::rdy_write_callback(int state)
WRITE_LINE_MEMBER(z80dma_device::rdy_w)
{
if (LOG) logerror("Z80DMA '%s' RDY: %d Active High: %d\n", tag(), state, READY_ACTIVE_HIGH);
- machine().scheduler().synchronize(FUNC(static_rdy_write_callback), state, (void *)this);
+ machine().scheduler().synchronize(timer_expired_delegate(FUNC(z80dma_device::rdy_write_callback),this), state);
}
diff --git a/src/devices/machine/z80dma.h b/src/devices/machine/z80dma.h
index fc1c3c1175c..0b1916c5d5f 100644
--- a/src/devices/machine/z80dma.h
+++ b/src/devices/machine/z80dma.h
@@ -111,13 +111,11 @@ private:
void do_transfer_write();
void do_search();
- static TIMER_CALLBACK( static_timerproc ) { reinterpret_cast<z80dma_device *>(ptr)->timerproc(); }
- void timerproc();
+ TIMER_CALLBACK_MEMBER(timerproc);
void update_status();
- static TIMER_CALLBACK( static_rdy_write_callback ) { reinterpret_cast<z80dma_device *>(ptr)->rdy_write_callback(param); }
- void rdy_write_callback(int state);
+ TIMER_CALLBACK_MEMBER(rdy_write_callback);
// internal state
devcb_write_line m_out_busreq_cb;
diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp
index 22b63f36d5b..f82e63f60b6 100644
--- a/src/devices/video/315_5313.cpp
+++ b/src/devices/video/315_5313.cpp
@@ -56,38 +56,18 @@ machine_config_constructor sega315_5313_device::device_mconfig_additions() const
return MACHINE_CONFIG_NAME( sega_genesis_vdp );
}
-static TIMER_CALLBACK( render_timer_callback )
-{
- sega315_5313_device* vdp = (sega315_5313_device*)ptr;
- vdp->render_scanline();
-}
-
-void sega315_5313_device::vdp_handle_irq6_on_timer_callback(int param)
+TIMER_CALLBACK_MEMBER(sega315_5313_device::irq6_on_timer_callback)
{
// m_irq6_pending = 1;
if (MEGADRIVE_REG01_IRQ6_ENABLE)
m_lv6irqline_callback(true);
}
-static TIMER_CALLBACK( irq6_on_timer_callback )
-{
- sega315_5313_device* vdp = (sega315_5313_device*)ptr;
- vdp->vdp_handle_irq6_on_timer_callback(param);
-}
-
-void sega315_5313_device::vdp_handle_irq4_on_timer_callback(int param)
+TIMER_CALLBACK_MEMBER(sega315_5313_device::irq4_on_timer_callback)
{
m_lv4irqline_callback(true);
}
-static TIMER_CALLBACK( irq4_on_timer_callback )
-{
- sega315_5313_device* vdp = (sega315_5313_device*)ptr;
- vdp->vdp_handle_irq4_on_timer_callback(param);
-}
-
-
-
void sega315_5313_device::set_alt_timing(device_t &device, int use_alt_timing)
{
sega315_5313_device &dev = downcast<sega315_5313_device &>(device);
@@ -189,9 +169,9 @@ void sega315_5313_device::device_start()
if (m_use_alt_timing)
save_pointer(NAME(m_render_line.get()), 320/2);
- m_irq6_on_timer = machine().scheduler().timer_alloc(FUNC(irq6_on_timer_callback), (void*)this);
- m_irq4_on_timer = machine().scheduler().timer_alloc(FUNC(irq4_on_timer_callback), (void*)this);
- m_render_timer = machine().scheduler().timer_alloc(FUNC(render_timer_callback), (void*)this);
+ m_irq6_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega315_5313_device::irq6_on_timer_callback), this));
+ m_irq4_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega315_5313_device::irq4_on_timer_callback), this));
+ m_render_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega315_5313_device::render_scanline), this));
m_space68k = &machine().device<m68000_base_device>(":maincpu")->space();
m_cpu68k = machine().device<m68000_base_device>(":maincpu");
@@ -2598,7 +2578,7 @@ void sega315_5313_device::render_videobuffer_to_screenbuffer(int scanline)
}
}
-void sega315_5313_device::render_scanline()
+TIMER_CALLBACK_MEMBER(sega315_5313_device::render_scanline)
{
int scanline = get_scanline_counter();
diff --git a/src/devices/video/315_5313.h b/src/devices/video/315_5313.h
index d7ca05ee2e6..dc897265009 100644
--- a/src/devices/video/315_5313.h
+++ b/src/devices/video/315_5313.h
@@ -214,10 +214,10 @@ public:
int get_scanline_counter();
- void render_scanline();
+ TIMER_CALLBACK_MEMBER(render_scanline);
void vdp_handle_scanline_callback(int scanline);
- void vdp_handle_irq6_on_timer_callback(int param);
- void vdp_handle_irq4_on_timer_callback(int param);
+ TIMER_CALLBACK_MEMBER(irq6_on_timer_callback);
+ TIMER_CALLBACK_MEMBER(irq4_on_timer_callback);
void vdp_handle_eof();
void device_reset_old();
void vdp_clear_irq6_pending(void) { m_irq6_pending = 0; };
diff --git a/src/emu/diexec.cpp b/src/emu/diexec.cpp
index ac72ce768d7..02684095b04 100644
--- a/src/emu/diexec.cpp
+++ b/src/emu/diexec.cpp
@@ -272,7 +272,7 @@ void device_execute_interface::spin_until_time(const attotime &duration)
suspend_until_trigger(TRIGGER_SUSPENDTIME + timetrig, true);
// then set a timer for it
- m_scheduler->timer_set(duration, FUNC(static_timed_trigger_callback), TRIGGER_SUSPENDTIME + timetrig, this);
+ m_scheduler->timer_set(duration, timer_expired_delegate(FUNC(device_execute_interface::timed_trigger_callback),this), TRIGGER_SUSPENDTIME + timetrig, this);
timetrig = (timetrig + 1) % 256;
}
@@ -484,7 +484,7 @@ void device_execute_interface::interface_pre_start()
// allocate timers if we need them
if (m_timed_interrupt_period != attotime::zero)
- m_timedint_timer = m_scheduler->timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this);
+ m_timedint_timer = m_scheduler->timer_alloc(timer_expired_delegate(FUNC(device_execute_interface::trigger_periodic_interrupt), this));
}
@@ -653,10 +653,9 @@ attoseconds_t device_execute_interface::minimum_quantum() const
// trigger
//-------------------------------------------------
-TIMER_CALLBACK( device_execute_interface::static_timed_trigger_callback )
+TIMER_CALLBACK_MEMBER( device_execute_interface::timed_trigger_callback )
{
- device_execute_interface *device = reinterpret_cast<device_execute_interface *>(ptr);
- device->trigger(param);
+ trigger(param);
}
@@ -681,16 +680,11 @@ void device_execute_interface::on_vblank(screen_device &screen, bool vblank_stat
//-------------------------------------------------
-// static_trigger_periodic_interrupt - timer
+// trigger_periodic_interrupt - timer
// callback for timed interrupts
//-------------------------------------------------
-TIMER_CALLBACK( device_execute_interface::static_trigger_periodic_interrupt )
-{
- reinterpret_cast<device_execute_interface *>(ptr)->trigger_periodic_interrupt();
-}
-
-void device_execute_interface::trigger_periodic_interrupt()
+TIMER_CALLBACK_MEMBER(device_execute_interface::trigger_periodic_interrupt)
{
// bail if there is no routine
if (!suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE | SUSPEND_REASON_CLOCK))
@@ -781,7 +775,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag(), m_linen
if (event_index >= ARRAY_LENGTH(m_queue))
{
m_qindex--;
- empty_event_queue();
+ empty_event_queue(nullptr,0);
event_index = m_qindex++;
m_execute->device().logerror("Exceeded pending input line event queue on device '%s'!\n", m_execute->device().tag());
}
@@ -795,7 +789,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag(), m_linen
// if this is the first one, set the timer
if (event_index == 0)
- m_execute->scheduler().synchronize(FUNC(static_empty_event_queue), 0, (void *)this);
+ m_execute->scheduler().synchronize(timer_expired_delegate(FUNC(device_execute_interface::device_input::empty_event_queue),this), 0, this);
}
}
@@ -804,12 +798,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag(), m_linen
// empty_event_queue - empty our event queue
//-------------------------------------------------
-TIMER_CALLBACK( device_execute_interface::device_input::static_empty_event_queue )
-{
- reinterpret_cast<device_input *>(ptr)->empty_event_queue();
-}
-
-void device_execute_interface::device_input::empty_event_queue()
+TIMER_CALLBACK_MEMBER(device_execute_interface::device_input::empty_event_queue)
{
if (TEMPLOG) printf("empty_queue(%s,%d,%d)\n", m_execute->device().tag(), m_linenum, m_qindex);
// loop over all events
diff --git a/src/emu/diexec.h b/src/emu/diexec.h
index 3a5cc0405f9..4fd379b5dae 100644
--- a/src/emu/diexec.h
+++ b/src/emu/diexec.h
@@ -71,12 +71,13 @@ enum
// MACROS
//**************************************************************************
+#define TIMER_CALLBACK(name) void name(running_machine &machine, void *ptr, int param)
+#define TIMER_CALLBACK_MEMBER(name) void name(void *ptr, INT32 param)
+
// IRQ callback to be called by device implementations when an IRQ is actually taken
-#define IRQ_CALLBACK(func) int func(device_t *device, int irqline)
#define IRQ_CALLBACK_MEMBER(func) int func(device_t &device, int irqline)
// interrupt generator callback called as a VBLANK or periodic interrupt
-#define INTERRUPT_GEN(func) void func(device_t *device)
#define INTERRUPT_GEN_MEMBER(func) void func(device_t &device)
@@ -246,8 +247,7 @@ protected:
int m_qindex; // index within the queue
private:
- static void static_empty_event_queue(running_machine &machine, void *ptr, int param);
- void empty_event_queue();
+ TIMER_CALLBACK_MEMBER(empty_event_queue);
};
// scheduler
@@ -292,12 +292,11 @@ protected:
private:
// callbacks
- static void static_timed_trigger_callback(running_machine &machine, void *ptr, int param);
+ TIMER_CALLBACK_MEMBER(timed_trigger_callback);
void on_vblank(screen_device &screen, bool vblank_state);
- static void static_trigger_periodic_interrupt(running_machine &machine, void *ptr, int param);
- void trigger_periodic_interrupt();
+ TIMER_CALLBACK_MEMBER(trigger_periodic_interrupt);
void suspend_resume_changed();
attoseconds_t minimum_quantum() const;
diff --git a/src/emu/schedule.h b/src/emu/schedule.h
index 2f3a7f8a23a..5ed0c049bdb 100644
--- a/src/emu/schedule.h
+++ b/src/emu/schedule.h
@@ -33,8 +33,6 @@
#define PERIOD_OF_555_MONOSTABLE(r,c) attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(r,c))
#define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c))
-#define TIMER_CALLBACK(name) void name(running_machine &machine, void *ptr, int param)
-#define TIMER_CALLBACK_MEMBER(name) void name(void *ptr, INT32 param)
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp
index 8df29a29e09..807c1b30cf8 100644
--- a/src/emu/tilemap.cpp
+++ b/src/emu/tilemap.cpp
@@ -558,22 +558,22 @@ void tilemap_t::configure_groups(gfx_element &gfx, int transcolor)
// order with optional flipping
//-------------------------------------------------
-tilemap_memory_index tilemap_t::scan_rows(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
+tilemap_memory_index tilemap_t::scan_rows(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
{
return row * num_cols + col;
}
-tilemap_memory_index tilemap_t::scan_rows_flip_x(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
+tilemap_memory_index tilemap_t::scan_rows_flip_x(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
{
return row * num_cols + (num_cols - 1 - col);
}
-tilemap_memory_index tilemap_t::scan_rows_flip_y(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
+tilemap_memory_index tilemap_t::scan_rows_flip_y(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
{
return (num_rows - 1 - row) * num_cols + col;
}
-tilemap_memory_index tilemap_t::scan_rows_flip_xy(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
+tilemap_memory_index tilemap_t::scan_rows_flip_xy(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
{
return (num_rows - 1 - row) * num_cols + (num_cols - 1 - col);
}
@@ -587,22 +587,22 @@ tilemap_memory_index tilemap_t::scan_rows_flip_xy(driver_device &device, UINT32
// major order with optional flipping
//-------------------------------------------------
-tilemap_memory_index tilemap_t::scan_cols(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
+tilemap_memory_index tilemap_t::scan_cols(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
{
return col * num_rows + row;
}
-tilemap_memory_index tilemap_t::scan_cols_flip_x(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
+tilemap_memory_index tilemap_t::scan_cols_flip_x(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
{
return (num_cols - 1 - col) * num_rows + row;
}
-tilemap_memory_index tilemap_t::scan_cols_flip_y(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
+tilemap_memory_index tilemap_t::scan_cols_flip_y(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
{
return col * num_rows + (num_rows - 1 - row);
}
-tilemap_memory_index tilemap_t::scan_cols_flip_xy(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
+tilemap_memory_index tilemap_t::scan_cols_flip_xy(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
{
return (num_cols - 1 - col) * num_rows + (num_rows - 1 - row);
}
@@ -1519,22 +1519,6 @@ tilemap_manager::~tilemap_manager()
// tilemaps
//-------------------------------------------------
-static const struct
-{
- tilemap_memory_index (*func)(driver_device &, UINT32, UINT32, UINT32, UINT32);
- const char *name;
-} s_standard_mappers[TILEMAP_STANDARD_COUNT] =
-{
- { FUNC(tilemap_t::scan_rows) },
- { FUNC(tilemap_t::scan_rows_flip_x) },
- { FUNC(tilemap_t::scan_rows_flip_y) },
- { FUNC(tilemap_t::scan_rows_flip_xy) },
- { FUNC(tilemap_t::scan_cols) },
- { FUNC(tilemap_t::scan_cols_flip_x) },
- { FUNC(tilemap_t::scan_cols_flip_y) },
- { FUNC(tilemap_t::scan_cols_flip_xy) }
-};
-
tilemap_t &tilemap_manager::create(device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, int tilewidth, int tileheight, int cols, int rows, tilemap_t *allocated)
{
if (allocated == nullptr)
@@ -1546,7 +1530,19 @@ tilemap_t &tilemap_manager::create(device_gfx_interface &decoder, tilemap_get_in
{
if (allocated == nullptr)
allocated = global_alloc(tilemap_t);
- return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, tilemap_mapper_delegate(s_standard_mappers[mapper].func, s_standard_mappers[mapper].name, machine().driver_data()), tilewidth, tileheight, cols, rows));
+
+ switch (mapper)
+ {
+ case TILEMAP_SCAN_ROWS :return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, tilemap_mapper_delegate(FUNC(tilemap_t::scan_rows), allocated), tilewidth, tileheight, cols, rows));
+ case TILEMAP_SCAN_ROWS_FLIP_X:return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, tilemap_mapper_delegate(FUNC(tilemap_t::scan_rows_flip_x), allocated), tilewidth, tileheight, cols, rows));
+ case TILEMAP_SCAN_ROWS_FLIP_Y:return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, tilemap_mapper_delegate(FUNC(tilemap_t::scan_rows_flip_y), allocated), tilewidth, tileheight, cols, rows));
+ case TILEMAP_SCAN_ROWS_FLIP_XY:return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, tilemap_mapper_delegate(FUNC(tilemap_t::scan_rows_flip_xy),allocated), tilewidth, tileheight, cols, rows));
+ case TILEMAP_SCAN_COLS:return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, tilemap_mapper_delegate(FUNC(tilemap_t::scan_cols),allocated), tilewidth, tileheight, cols, rows));
+ case TILEMAP_SCAN_COLS_FLIP_X:return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, tilemap_mapper_delegate(FUNC(tilemap_t::scan_cols_flip_x),allocated), tilewidth, tileheight, cols, rows));
+ case TILEMAP_SCAN_COLS_FLIP_Y:return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, tilemap_mapper_delegate(FUNC(tilemap_t::scan_cols_flip_y),allocated), tilewidth, tileheight, cols, rows));
+ case TILEMAP_SCAN_COLS_FLIP_XY:return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, tilemap_mapper_delegate(FUNC(tilemap_t::scan_cols_flip_xy),allocated), tilewidth, tileheight, cols, rows));
+ default: throw emu_fatalerror("Tilemap manager create unknown mapper %d", mapper);
+ }
}
diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h
index 0f7dcf93c1b..6e4308d6052 100644
--- a/src/emu/tilemap.h
+++ b/src/emu/tilemap.h
@@ -550,16 +550,16 @@ public:
// mappers
// scan in row-major order with optional flipping
- static tilemap_memory_index scan_rows(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
- static tilemap_memory_index scan_rows_flip_x(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
- static tilemap_memory_index scan_rows_flip_y(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
- static tilemap_memory_index scan_rows_flip_xy(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
+ tilemap_memory_index scan_rows(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
+ tilemap_memory_index scan_rows_flip_x(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
+ tilemap_memory_index scan_rows_flip_y(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
+ tilemap_memory_index scan_rows_flip_xy(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
// scan in column-major order with optional flipping
- static tilemap_memory_index scan_cols(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
- static tilemap_memory_index scan_cols_flip_x(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
- static tilemap_memory_index scan_cols_flip_y(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
- static tilemap_memory_index scan_cols_flip_xy(driver_device &device, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
+ tilemap_memory_index scan_cols(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
+ tilemap_memory_index scan_cols_flip_x(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
+ tilemap_memory_index scan_cols_flip_y(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
+ tilemap_memory_index scan_cols_flip_xy(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
// optional memory accessors
UINT32 basemem_read(int index) { return m_basemem.read(index); }
diff --git a/src/mame/includes/kaypro.h b/src/mame/includes/kaypro.h
index f2b5cc3df29..1560c96f9d8 100644
--- a/src/mame/includes/kaypro.h
+++ b/src/mame/includes/kaypro.h
@@ -79,6 +79,11 @@ public:
kay_kbd_t *m_kbd;
int m_centronics_busy;
required_device<palette_device> m_palette;
+ void kay_kbd_in(UINT8 data );
+ UINT8 kay_kbd_c_r();
+ UINT8 kay_kbd_d_r();
+ TIMER_CALLBACK_MEMBER( kay_kbd_beepoff );
+ void kay_kbd_d_w( UINT8 data );
private:
bool m_is_motor_off;
@@ -102,11 +107,4 @@ private:
required_device<beep_device> m_beep;
};
-
-/*----------- defined in machine/kay_kbd.c -----------*/
-
-UINT8 kay_kbd_c_r( running_machine &machine );
-UINT8 kay_kbd_d_r( running_machine &machine );
-void kay_kbd_d_w( running_machine &machine, UINT8 data );
-
INPUT_PORTS_EXTERN( kay_kbd );
diff --git a/src/mame/includes/mac.h b/src/mame/includes/mac.h
index 8b093993abc..c8d2e16d05b 100644
--- a/src/mame/includes/mac.h
+++ b/src/mame/includes/mac.h
@@ -520,6 +520,8 @@ public:
TIMER_CALLBACK_MEMBER(mac_scanline_tick);
TIMER_CALLBACK_MEMBER(dafb_vbl_tick);
TIMER_CALLBACK_MEMBER(dafb_cursor_tick);
+ TIMER_CALLBACK_MEMBER(mac_adb_tick); // macadb.c
+ TIMER_CALLBACK_MEMBER(mac_pmu_tick); // macadb.c
DECLARE_WRITE_LINE_MEMBER(mac_via_out_cb2);
DECLARE_WRITE_LINE_MEMBER(mac_adb_via_out_cb2);
DECLARE_READ8_MEMBER(mac_via_in_a);
diff --git a/src/mame/machine/apollo_kbd.cpp b/src/mame/machine/apollo_kbd.cpp
index fbfbe18b94a..a88204a3071 100644
--- a/src/mame/machine/apollo_kbd.cpp
+++ b/src/mame/machine/apollo_kbd.cpp
@@ -174,7 +174,7 @@ void apollo_kbd_device::beeper::start(apollo_kbd_device *device)
m_device = device;
LOG2(("start apollo_kbd::beeper"));
m_beeper = m_device->machine().device<beep_device>("beep");
- m_timer = m_device->machine().scheduler().timer_alloc(FUNC(static_beeper_callback), this);
+ m_timer = m_device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(apollo_kbd_device::beeper::beeper_callback), this));
}
void apollo_kbd_device::beeper::reset()
@@ -202,16 +202,11 @@ int apollo_kbd_device::beeper::keyboard_has_beeper()
return true; // driver has no facility to return false here, so go with it
}
-void apollo_kbd_device::beeper::beeper_callback()
+TIMER_CALLBACK_MEMBER(apollo_kbd_device::beeper::beeper_callback)
{
off();
}
-TIMER_CALLBACK( apollo_kbd_device::beeper::static_beeper_callback )
-{
- reinterpret_cast<beeper*>(ptr)->beeper_callback();
-}
-
//**************************************************************************
// Mouse
//**************************************************************************
diff --git a/src/mame/machine/apollo_kbd.h b/src/mame/machine/apollo_kbd.h
index 4b5cc91a9af..c593af06c85 100644
--- a/src/mame/machine/apollo_kbd.h
+++ b/src/mame/machine/apollo_kbd.h
@@ -93,8 +93,7 @@ private:
void on();
private:
int keyboard_has_beeper();
- void beeper_callback();
- static TIMER_CALLBACK( static_beeper_callback );
+ TIMER_CALLBACK_MEMBER(beeper_callback);
apollo_kbd_device *m_device; // pointer back to our device
beep_device *m_beeper; // the keyboard beeper device
diff --git a/src/mame/machine/kay_kbd.cpp b/src/mame/machine/kay_kbd.cpp
index 736d39d5fd8..617d7636365 100644
--- a/src/mame/machine/kay_kbd.cpp
+++ b/src/mame/machine/kay_kbd.cpp
@@ -181,8 +181,6 @@ INPUT_PORTS_START( kay_kbd )
PORT_BIT(0xf0, 0x00, IPT_UNUSED)
INPUT_PORTS_END
-static void kay_kbd_in( running_machine &machine, UINT8 data );
-
static const UINT8 keyboard[8][10][8] = {
{ /* normal */
{ 27,'1','2','3','4','5','6','7'},
@@ -376,11 +374,11 @@ INTERRUPT_GEN_MEMBER(kaypro_state::kay_kbd_interrupt)
if( kbd->key ) /* normal key */
{
kbd->repeater = 30;
- kay_kbd_in(machine(), kbd->key);
+ kay_kbd_in(kbd->key);
}
else
if( (row == 0) && (chg == 0x04) ) /* Ctrl-@ (NUL) */
- kay_kbd_in(machine(), 0);
+ kay_kbd_in(0);
keyrows[row] |= newval;
}
else
@@ -391,7 +389,7 @@ INTERRUPT_GEN_MEMBER(kaypro_state::kay_kbd_interrupt)
}
else if ( kbd->key && (keyrows[kbd->lastrow] & kbd->mask) && kbd->repeat == 0 )
{
- kay_kbd_in(machine(), kbd->key);
+ kay_kbd_in(kbd->key);
}
}
@@ -415,10 +413,9 @@ static WRITE8_HANDLER ( kaypro2_const_w )
* releases CPU if it was waiting for a key
* sounds bell if buffer would overflow
******************************************************/
-static void kay_kbd_in( running_machine &machine, UINT8 data )
+void kaypro_state::kay_kbd_in(UINT8 data )
{
- kaypro_state *state = machine.driver_data<kaypro_state>();
- kay_kbd_t *kbd = state->m_kbd;
+ kay_kbd_t *kbd = m_kbd;
UINT8 kbd_head_old;
kbd_head_old = kbd->head;
@@ -428,21 +425,20 @@ static void kay_kbd_in( running_machine &machine, UINT8 data )
if (kbd->head == kbd->tail)
{
kbd->head = kbd_head_old;
- kay_kbd_d_w(machine, 4);
+ kay_kbd_d_w(4);
}
else
- kay_kbd_d_w(machine, 1);
+ kay_kbd_d_w(1);
}
-UINT8 kay_kbd_c_r( running_machine &machine )
+UINT8 kaypro_state::kay_kbd_c_r()
{
/* d4 transmit buffer empty - 1=ok to send
d2 appears to be receive buffer empty - 1=ok to receive
d0 keyboard buffer empty - 1=key waiting to be used */
- kaypro_state *state = machine.driver_data<kaypro_state>();
- kay_kbd_t *kbd = state->m_kbd;
+ kay_kbd_t *kbd = m_kbd;
UINT8 data = kbd->control_status;
if( kbd->head != kbd->tail )
@@ -451,12 +447,11 @@ UINT8 kay_kbd_c_r( running_machine &machine )
return data;
}
-UINT8 kay_kbd_d_r( running_machine &machine )
+UINT8 kaypro_state::kay_kbd_d_r()
{
/* return next key in buffer */
- kaypro_state *state = machine.driver_data<kaypro_state>();
- kay_kbd_t *kbd = state->m_kbd;
+ kay_kbd_t *kbd = m_kbd;
UINT8 data = 0;
if (kbd->tail != kbd->head)
@@ -468,15 +463,14 @@ UINT8 kay_kbd_d_r( running_machine &machine )
return data;
}
-static TIMER_CALLBACK( kay_kbd_beepoff )
+TIMER_CALLBACK_MEMBER( kaypro_state::kay_kbd_beepoff )
{
- kaypro_state *state = machine.driver_data<kaypro_state>();
- kay_kbd_t *kbd = state->m_kbd;
+ kay_kbd_t *kbd = m_kbd;
kbd->beeper->set_state(0);
kbd->control_status |= 4;
}
-void kay_kbd_d_w( running_machine &machine, UINT8 data )
+void kaypro_state::kay_kbd_d_w( UINT8 data )
{
/* Beeper control - lengths need verifying
01 - keyclick
@@ -485,8 +479,7 @@ void kay_kbd_d_w( running_machine &machine, UINT8 data )
08 - mute
16 - unmute */
- kaypro_state *state = machine.driver_data<kaypro_state>();
- kay_kbd_t *kbd = state->m_kbd;
+ kay_kbd_t *kbd = m_kbd;
UINT16 length = 0;
if (data & 0x10)
@@ -509,7 +502,7 @@ void kay_kbd_d_w( running_machine &machine, UINT8 data )
if (length)
{
kbd->control_status &= 0xfb;
- machine.scheduler().timer_set(attotime::from_msec(length), FUNC(kay_kbd_beepoff));
+ machine().scheduler().timer_set(attotime::from_msec(length), timer_expired_delegate(FUNC(kaypro_state::kay_kbd_beepoff),this));
kbd->beeper->set_state(1);
}
}
diff --git a/src/mame/machine/kaypro.cpp b/src/mame/machine/kaypro.cpp
index 2339e770307..8c914d01750 100644
--- a/src/mame/machine/kaypro.cpp
+++ b/src/mame/machine/kaypro.cpp
@@ -165,10 +165,10 @@ WRITE8_MEMBER( kaypro_state::kaypro2x_system_port_w )
READ8_MEMBER(kaypro_state::kaypro_sio_r)
{
if (offset == 1)
- return kay_kbd_d_r(machine());
+ return kay_kbd_d_r();
else
if (offset == 3)
- return kay_kbd_c_r(machine());
+ return kay_kbd_c_r();
else
return m_sio->cd_ba_r(space, offset);
}
@@ -176,7 +176,7 @@ READ8_MEMBER(kaypro_state::kaypro_sio_r)
WRITE8_MEMBER(kaypro_state::kaypro_sio_w)
{
if (offset == 1)
- kay_kbd_d_w(machine(), data);
+ kay_kbd_d_w(data);
else
m_sio->cd_ba_w(space, offset, data);
}
diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp
index e62ecd96cc9..bbc0ded1b14 100644
--- a/src/mame/machine/mac.cpp
+++ b/src/mame/machine/mac.cpp
@@ -118,9 +118,6 @@
#define LOG_MEMORY 0
#endif
-extern TIMER_CALLBACK(mac_adb_tick); // macadb.c
-extern TIMER_CALLBACK(mac_pmu_tick); // macadb.c
-
static offs_t mac_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
// returns non-zero if this Mac has ADB
@@ -1837,13 +1834,13 @@ void mac_state::machine_start()
{
if (has_adb())
{
- this->m_adb_timer = machine().scheduler().timer_alloc(FUNC(mac_adb_tick));
+ this->m_adb_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::mac_adb_tick),this));
this->m_adb_timer->adjust(attotime::never);
// also allocate PMU timer
if (ADB_IS_PM_CLASS)
{
- m_pmu_send_timer = machine().scheduler().timer_alloc(FUNC(mac_pmu_tick));
+ m_pmu_send_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::mac_pmu_tick),this));
this->m_adb_timer->adjust(attotime::never);
m_pmu_int_status = 0;
}
diff --git a/src/mame/machine/macadb.cpp b/src/mame/machine/macadb.cpp
index 76a8a010b57..22f0acabf27 100644
--- a/src/mame/machine/macadb.cpp
+++ b/src/mame/machine/macadb.cpp
@@ -528,35 +528,33 @@ void mac_state::adb_talk()
}
}
-TIMER_CALLBACK(mac_adb_tick)
+TIMER_CALLBACK_MEMBER(mac_state::mac_adb_tick)
{
- mac_state *mac = machine.driver_data<mac_state>();
-
- if ((ADB_IS_EGRET_NONCLASS) || (ADB_IS_CUDA_NONCLASS))
+ if ((ADB_IS_EGRET) || (ADB_IS_CUDA))
{
- switch (mac->m_adb_linestate)
+ switch (m_adb_linestate)
{
case LST_SRQNODATA:
- mac->set_adb_line(ASSERT_LINE);
- mac->m_adb_linestate = LST_IDLE;
+ set_adb_line(ASSERT_LINE);
+ m_adb_linestate = LST_IDLE;
break;
case LST_TSTOPSTART:
- mac->set_adb_line(ASSERT_LINE);
- mac->m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
- mac->m_adb_linestate++;
+ set_adb_line(ASSERT_LINE);
+ m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
+ m_adb_linestate++;
break;
case LST_TSTOPSTARTa:
- mac->set_adb_line(CLEAR_LINE);
- mac->m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
- mac->m_adb_linestate++;
+ set_adb_line(CLEAR_LINE);
+ m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
+ m_adb_linestate++;
break;
case LST_STARTBIT:
- mac->set_adb_line(ASSERT_LINE);
- mac->m_adb_timer->adjust(attotime::from_ticks(105, 1000000));
- mac->m_adb_linestate++;
+ set_adb_line(ASSERT_LINE);
+ m_adb_timer->adjust(attotime::from_ticks(105, 1000000));
+ m_adb_linestate++;
break;
case LST_SENDBIT0:
@@ -567,18 +565,18 @@ TIMER_CALLBACK(mac_adb_tick)
case LST_SENDBIT5:
case LST_SENDBIT6:
case LST_SENDBIT7:
- mac->set_adb_line(CLEAR_LINE);
- if (mac->m_adb_buffer[mac->m_adb_stream_ptr] & 0x80)
+ set_adb_line(CLEAR_LINE);
+ if (m_adb_buffer[m_adb_stream_ptr] & 0x80)
{
// printf("1 ");
- mac->m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
+ m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
}
else
{
// printf("0 ");
- mac->m_adb_timer->adjust(attotime::from_ticks(105, 1000000));
+ m_adb_timer->adjust(attotime::from_ticks(105, 1000000));
}
- mac->m_adb_linestate++;
+ m_adb_linestate++;
break;
case LST_SENDBIT0a:
@@ -588,92 +586,92 @@ TIMER_CALLBACK(mac_adb_tick)
case LST_SENDBIT4a:
case LST_SENDBIT5a:
case LST_SENDBIT6a:
- mac->set_adb_line(ASSERT_LINE);
- if (mac->m_adb_buffer[mac->m_adb_stream_ptr] & 0x80)
+ set_adb_line(ASSERT_LINE);
+ if (m_adb_buffer[m_adb_stream_ptr] & 0x80)
{
- mac->m_adb_timer->adjust(attotime::from_ticks(105, 1000000));
+ m_adb_timer->adjust(attotime::from_ticks(105, 1000000));
}
else
{
- mac->m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
+ m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
}
- mac->m_adb_buffer[mac->m_adb_stream_ptr] <<= 1;
- mac->m_adb_linestate++;
+ m_adb_buffer[m_adb_stream_ptr] <<= 1;
+ m_adb_linestate++;
break;
case LST_SENDBIT7a:
- mac->set_adb_line(ASSERT_LINE);
- if (mac->m_adb_buffer[mac->m_adb_stream_ptr] & 0x80)
+ set_adb_line(ASSERT_LINE);
+ if (m_adb_buffer[m_adb_stream_ptr] & 0x80)
{
// printf(" ");
- mac->m_adb_timer->adjust(attotime::from_ticks(105, 1000000));
+ m_adb_timer->adjust(attotime::from_ticks(105, 1000000));
}
else
{
// printf(" ");
- mac->m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
+ m_adb_timer->adjust(attotime::from_ticks(57, 1000000));
}
- mac->m_adb_stream_ptr++;
- if (mac->m_adb_stream_ptr == mac->m_adb_datasize)
+ m_adb_stream_ptr++;
+ if (m_adb_stream_ptr == m_adb_datasize)
{
- mac->m_adb_linestate++;
+ m_adb_linestate++;
}
else
{
- mac->m_adb_linestate = LST_SENDBIT0;
+ m_adb_linestate = LST_SENDBIT0;
}
break;
case LST_SENDSTOP:
- mac->set_adb_line(CLEAR_LINE);
- mac->m_adb_timer->adjust(attotime::from_ticks((57*2), 1000000));
- mac->m_adb_linestate++;
+ set_adb_line(CLEAR_LINE);
+ m_adb_timer->adjust(attotime::from_ticks((57*2), 1000000));
+ m_adb_linestate++;
break;
case LST_SENDSTOPa:
- mac->set_adb_line(ASSERT_LINE);
- mac->m_adb_timer->adjust(attotime::never);
- mac->m_adb_linestate = LST_IDLE;
+ set_adb_line(ASSERT_LINE);
+ m_adb_timer->adjust(attotime::never);
+ m_adb_linestate = LST_IDLE;
break;
}
}
else
{
// do one clock transition on CB1 to advance the VIA shifter
- mac->m_adb_extclock ^= 1;
- mac->m_via1->write_cb1(mac->m_adb_extclock);
+ m_adb_extclock ^= 1;
+ m_via1->write_cb1(m_adb_extclock);
- if (mac->m_adb_direction)
+ if (m_adb_direction)
{
- mac->m_adb_command <<= 1;
+ m_adb_command <<= 1;
}
else
{
- mac->m_via1->write_cb2((mac->m_adb_send & 0x80)>>7);
- mac->m_adb_send <<= 1;
+ m_via1->write_cb2((m_adb_send & 0x80)>>7);
+ m_adb_send <<= 1;
}
- mac->m_adb_extclock ^= 1;
- mac->m_via1->write_cb1(mac->m_adb_extclock);
+ m_adb_extclock ^= 1;
+ m_via1->write_cb1(m_adb_extclock);
- mac->m_adb_timer_ticks--;
- if (!mac->m_adb_timer_ticks)
+ m_adb_timer_ticks--;
+ if (!m_adb_timer_ticks)
{
- mac->m_adb_timer->adjust(attotime::never);
+ m_adb_timer->adjust(attotime::never);
- if ((mac->m_adb_direction) && (ADB_IS_BITBANG))
+ if ((m_adb_direction) && (ADB_IS_BITBANG_CLASS))
{
- mac->adb_talk();
- if((mac->m_adb_last_talk == 2) && mac->m_adb_datasize) {
- mac->m_adb_timer_ticks = 8;
- mac->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
+ adb_talk();
+ if((m_adb_last_talk == 2) && m_adb_datasize) {
+ m_adb_timer_ticks = 8;
+ m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
}
}
}
else
{
- mac->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(200)));
+ m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(200)));
}
}
}
@@ -736,30 +734,28 @@ void mac_state::mac_adb_newaction(int state)
}
}
-TIMER_CALLBACK(mac_pmu_tick)
+TIMER_CALLBACK_MEMBER(mac_state::mac_pmu_tick)
{
- mac_state *mac = machine.driver_data<mac_state>();
-
// state 10 means this is in response to an ADB command
- if (mac->m_pm_state == 10)
+ if (m_pm_state == 10)
{
#if LOG_ADB
printf("PM: was state 10, chunk-chunking CB1\n");
#endif
- mac->m_pm_state = 0;
+ m_pm_state = 0;
// tick CB1, which should cause a PMU interrupt on PMU machines
- mac->m_adb_extclock ^= 1;
- mac->m_via1->write_cb1(mac->m_adb_extclock);
- mac->m_adb_extclock ^= 1;
- mac->m_via1->write_cb1(mac->m_adb_extclock);
+ m_adb_extclock ^= 1;
+ m_via1->write_cb1(m_adb_extclock);
+ m_adb_extclock ^= 1;
+ m_via1->write_cb1(m_adb_extclock);
}
else
{
#if LOG_ADB
printf("PM: timer tick, lowering ACK\n");
#endif
- mac->m_pm_ack &= ~2; // lower ACK to handshake next step
+ m_pm_ack &= ~2; // lower ACK to handshake next step
}
}
diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp
index 864e3d00b0b..d4658b3a662 100644
--- a/src/mame/machine/mega32x.cpp
+++ b/src/mame/machine/mega32x.cpp
@@ -235,9 +235,6 @@ void sega_32x_device::static_set_palette_tag(device_t &device, const char *tag)
downcast<sega_32x_device &>(device).m_palette.set_tag(tag);
}
-TIMER_CALLBACK( _32x_pwm_callback );
-
-
READ16_MEMBER( sega_32x_device::_32x_68k_palette_r )
{
@@ -817,7 +814,7 @@ void sega_32x_device::calculate_pwm_timer()
}
-void sega_32x_device::handle_pwm_callback()
+TIMER_CALLBACK_MEMBER(sega_32x_device::handle_pwm_callback)
{
if(m_lch_index_r < PWM_FIFO_SIZE)
{
@@ -861,12 +858,6 @@ void sega_32x_device::handle_pwm_callback()
m_32x_pwm_timer->adjust(attotime::from_hz((PWM_CLOCK) / (m_pwm_cycle - 1)));
}
-TIMER_CALLBACK( _32x_pwm_callback )
-{
- sega_32x_device* _32xdev = (sega_32x_device*)ptr;
- _32xdev->handle_pwm_callback();
-}
-
READ16_MEMBER( sega_32x_device::_32x_pwm_r )
{
switch(offset)
@@ -1832,7 +1823,7 @@ machine_config_constructor sega_32x_pal_device::device_mconfig_additions() const
void sega_32x_device::device_start()
{
- m_32x_pwm_timer = machine().scheduler().timer_alloc(FUNC(_32x_pwm_callback), (void*)this);
+ m_32x_pwm_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega_32x_device::handle_pwm_callback), this));
m_32x_pwm_timer->adjust(attotime::never);
m_32x_dram0 = std::make_unique<UINT16[]>(0x40000/2);
diff --git a/src/mame/machine/mega32x.h b/src/mame/machine/mega32x.h
index f076b0f7a71..80940755726 100644
--- a/src/mame/machine/mega32x.h
+++ b/src/mame/machine/mega32x.h
@@ -133,7 +133,7 @@ public:
int m_32x_240mode;
UINT16 m_32x_a1518a_reg;
- void handle_pwm_callback();
+ TIMER_CALLBACK_MEMBER(handle_pwm_callback);
void calculate_pwm_timer();
UINT16 m_pwm_ctrl, m_pwm_cycle, m_pwm_tm_reg;
UINT16 m_cur_lch[0x10],m_cur_rch[0x10];
diff --git a/src/mame/machine/rx01.cpp b/src/mame/machine/rx01.cpp
index b4cb85869ea..75b4edb0eab 100644
--- a/src/mame/machine/rx01.cpp
+++ b/src/mame/machine/rx01.cpp
@@ -163,7 +163,7 @@ void rx01_device::command_write(UINT16 data)
break;
}
}
- machine().scheduler().timer_set(attotime::from_msec(100), FUNC(command_execution_callback), 0, this);
+ machine().scheduler().timer_set(attotime::from_msec(100), timer_expired_delegate(FUNC(rx01_device::service_command),this));
}
UINT16 rx01_device::status_read()
@@ -177,7 +177,7 @@ void rx01_device::data_write(UINT16 data)
// printf("data_write %04x\n",data);
// data can be written only if TR is set
if (BIT(m_rxcs,7)) m_rxdb = data;
- machine().scheduler().timer_set(attotime::from_msec(100), FUNC(command_execution_callback), 0, this);
+ machine().scheduler().timer_set(attotime::from_msec(100), timer_expired_delegate(FUNC(rx01_device::service_command),this));
}
UINT16 rx01_device::data_read()
@@ -187,7 +187,7 @@ UINT16 rx01_device::data_read()
return m_rxdb;
}
-void rx01_device::service_command()
+TIMER_CALLBACK_MEMBER(rx01_device::service_command)
{
printf("service_command %d\n",m_state);
m_rxes |= m_image[m_unit]->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY) << 7;
diff --git a/src/mame/machine/rx01.h b/src/mame/machine/rx01.h
index ad55511be41..386a7d983fd 100644
--- a/src/mame/machine/rx01.h
+++ b/src/mame/machine/rx01.h
@@ -48,8 +48,7 @@ protected:
void data_write(UINT16 data);
UINT16 data_read();
- void service_command();
- static TIMER_CALLBACK( command_execution_callback ) { reinterpret_cast<rx01_device *>(ptr)->service_command(); }
+ TIMER_CALLBACK_MEMBER(service_command);
void position_head();
void read_sector();