diff options
Diffstat (limited to 'src/mame/drivers/dpb7000.cpp')
-rw-r--r-- | src/mame/drivers/dpb7000.cpp | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/src/mame/drivers/dpb7000.cpp b/src/mame/drivers/dpb7000.cpp index 2e5f59c96f5..d56bf759739 100644 --- a/src/mame/drivers/dpb7000.cpp +++ b/src/mame/drivers/dpb7000.cpp @@ -111,16 +111,9 @@ public: private: virtual void machine_start() override; virtual void machine_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; template <int StoreNum> uint32_t store_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - static constexpr device_timer_id TIMER_DISKSEQ_COMPLETE = 0; - static constexpr device_timer_id TIMER_FIELD_IN = 1; - static constexpr device_timer_id TIMER_FIELD_OUT = 2; - static constexpr device_timer_id TIMER_TABLET_TX = 3; - static constexpr device_timer_id TIMER_TABLET_IRQ = 4; - void main_map(address_map &map); void fddcpu_map(address_map &map); void keybcpu_map(address_map &map); @@ -152,6 +145,10 @@ private: void store_address_w(uint8_t card, uint16_t data); void combiner_reg_w(uint16_t data); + TIMER_CALLBACK_MEMBER(diskseq_complete); + TIMER_CALLBACK_MEMBER(field_in); + TIMER_CALLBACK_MEMBER(field_out); + enum : uint16_t { SYSCTRL_AUTO_START = 0x0001, @@ -361,7 +358,7 @@ private: uint8_t tds_adc_r(); uint8_t tds_pen_switches_r(); DECLARE_WRITE_LINE_MEMBER(duart_b_w); - void tablet_tx_tick(); + TIMER_CALLBACK_MEMBER(tablet_tx_tick); uint8_t m_tds_dac_value; uint8_t m_tds_adc_value; uint8_t m_tds_p1_data; @@ -376,7 +373,7 @@ private: void tablet_p2_w(offs_t offset, uint8_t data, uint8_t mem_mask); uint8_t tablet_p3_r(offs_t offset, uint8_t mem_mask); void tablet_p3_w(offs_t offset, uint8_t data, uint8_t mem_mask); - void tablet_irq_tick(); + TIMER_CALLBACK_MEMBER(tablet_irq_tick); uint8_t tablet_rdl_r(); uint8_t tablet_rdh_r(); uint8_t m_tablet_p2_data; @@ -757,10 +754,10 @@ void dpb7000_state::machine_start() save_item(NAME(m_csr)); save_item(NAME(m_sys_ctrl)); - m_field_in_clk = timer_alloc(TIMER_FIELD_IN); + m_field_in_clk = timer_alloc(FUNC(dpb7000_state::field_in), this); m_field_in_clk->adjust(attotime::never); - m_field_out_clk = timer_alloc(TIMER_FIELD_OUT); + m_field_out_clk = timer_alloc(FUNC(dpb7000_state::field_out), this); m_field_out_clk->adjust(attotime::never); // Disc Sequencer Card @@ -780,7 +777,7 @@ void dpb7000_state::machine_start() save_item(NAME(m_diskseq_ucode_latch)); save_item(NAME(m_diskseq_cc_inputs)); save_item(NAME(m_diskseq_cyl_read_pending)); - m_diskseq_complete_clk = timer_alloc(TIMER_DISKSEQ_COMPLETE); + m_diskseq_complete_clk = timer_alloc(FUNC(dpb7000_state::diskseq_complete), this); m_diskseq_complete_clk->adjust(attotime::never); // Floppy Disc Controller Card @@ -894,9 +891,9 @@ void dpb7000_state::machine_start() save_item(NAME(m_tablet_tx_bit)); save_item(NAME(m_tablet_pen_in_proximity)); save_item(NAME(m_tablet_state)); - m_tablet_tx_timer = timer_alloc(TIMER_TABLET_TX); + m_tablet_tx_timer = timer_alloc(FUNC(dpb7000_state::tablet_tx_tick), this); m_tablet_tx_timer->adjust(attotime::never); - m_tablet_irq_timer = timer_alloc(TIMER_TABLET_IRQ); + m_tablet_irq_timer = timer_alloc(FUNC(dpb7000_state::tablet_irq_tick), this); m_tablet_irq_timer->adjust(attotime::never); m_yuv_lut = std::make_unique<uint32_t[]>(0x1000000); @@ -1062,18 +1059,19 @@ void dpb7000_state::machine_reset() m_tablet_state = 0; } -void dpb7000_state::device_timer(emu_timer &timer, device_timer_id id, int param) +TIMER_CALLBACK_MEMBER(dpb7000_state::diskseq_complete) { - if (id == TIMER_DISKSEQ_COMPLETE) - req_b_w(1); - else if (id == TIMER_FIELD_IN) - req_a_w(1); - else if (id == TIMER_FIELD_OUT) - req_a_w(0); - else if (id == TIMER_TABLET_TX) - tablet_tx_tick(); - else if (id == TIMER_TABLET_IRQ) - tablet_irq_tick(); + req_b_w(1); +} + +TIMER_CALLBACK_MEMBER(dpb7000_state::field_in) +{ + req_a_w(1); +} + +TIMER_CALLBACK_MEMBER(dpb7000_state::field_out) +{ + req_a_w(0); } MC6845_UPDATE_ROW(dpb7000_state::crtc_update_row) @@ -2243,7 +2241,7 @@ uint8_t dpb7000_state::tds_pen_switches_r() return data; } -void dpb7000_state::tablet_tx_tick() +TIMER_CALLBACK_MEMBER(dpb7000_state::tablet_tx_tick) { m_tds_duart->rx_b_w(m_tablet_tx_bit); } @@ -2345,7 +2343,7 @@ void dpb7000_state::tablet_p2_w(offs_t offset, uint8_t data, uint8_t mem_mask) } } -void dpb7000_state::tablet_irq_tick() +TIMER_CALLBACK_MEMBER(dpb7000_state::tablet_irq_tick) { LOGMASKED(LOG_TABLET, "Triggering tablet CPU IRQ\n"); m_tablet_cpu->set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE); |