diff options
Diffstat (limited to 'src/devices/bus/vcs/dpc.h')
-rw-r--r-- | src/devices/bus/vcs/dpc.h | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/src/devices/bus/vcs/dpc.h b/src/devices/bus/vcs/dpc.h index 358cba6f942..9ce74b57684 100644 --- a/src/devices/bus/vcs/dpc.h +++ b/src/devices/bus/vcs/dpc.h @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Fabio Priuli -#ifndef __VCS_DCP_H -#define __VCS_DCP_H +#ifndef MAME_BUS_VCS_DPC_H +#define MAME_BUS_VCS_DPC_H + +#pragma once #include "rom.h" @@ -11,16 +13,6 @@ // TO DO: DPC should be made a separate device! -struct df_t { - uint8_t top; - uint8_t bottom; - uint8_t low; - uint8_t high; - uint8_t flag; - uint8_t music_mode; /* Only used by data fetchers 5,6, and 7 */ - uint8_t osc_clk; /* Only used by data fetchers 5,6, and 7 */ -}; - // m_dpc.oscillator = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2600_state::modeDPC_timer_callback),this)); class dpc_device : public device_t @@ -29,36 +21,47 @@ public: // construction/destruction dpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - df_t m_df[8]; - uint8_t m_movamt; - uint8_t m_latch_62; - uint8_t m_latch_64; - uint8_t m_dlc; - uint8_t m_shift_reg; - uint8_t *m_displaydata; void set_display_data(uint8_t *data) { m_displaydata = data; } - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + virtual DECLARE_READ8_MEMBER(read); + virtual DECLARE_WRITE8_MEMBER(write); + +protected: + static constexpr device_timer_id TIMER_OSC = 0; + + struct df_t { + uint8_t top; + uint8_t bottom; + uint8_t low; + uint8_t high; + uint8_t flag; + uint8_t music_mode; /* Only used by data fetchers 5,6, and 7 */ + uint8_t osc_clk; /* Only used by data fetchers 5,6, and 7 */ + }; // device-level overrides virtual void device_start() override; virtual void device_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual DECLARE_READ8_MEMBER(read); - virtual DECLARE_WRITE8_MEMBER(write); + df_t m_df[8]; + uint8_t m_movamt; + uint8_t m_latch_62; + uint8_t m_latch_64; + uint8_t m_dlc; + uint8_t m_shift_reg; + uint8_t *m_displaydata; private: - void decrement_counter(uint8_t data_fetcher); void check_flag(uint8_t data_fetcher); - static const device_timer_id TIMER_OSC = 0; emu_timer *m_oscillator; }; // device type definition -extern const device_type ATARI_DPC; +DECLARE_DEVICE_TYPE(ATARI_DPC, dpc_device) @@ -86,6 +89,6 @@ public: // device type definition -extern const device_type A26_ROM_DPC; +DECLARE_DEVICE_TYPE(A26_ROM_DPC, a26_rom_dpc_device) -#endif +#endif // MAME_BUS_VCS_DPC_H |