diff options
Diffstat (limited to 'src/devices/bus/a2gameio/paddles.cpp')
-rw-r--r-- | src/devices/bus/a2gameio/paddles.cpp | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/src/devices/bus/a2gameio/paddles.cpp b/src/devices/bus/a2gameio/paddles.cpp index 95d0199a210..5f0955fba89 100644 --- a/src/devices/bus/a2gameio/paddles.cpp +++ b/src/devices/bus/a2gameio/paddles.cpp @@ -9,12 +9,36 @@ #include "emu.h" #include "bus/a2gameio/paddles.h" -//************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** +namespace { -// device type definition -DEFINE_DEVICE_TYPE(APPLE2_PADDLES, apple2_paddles_device, "a2pdls", "Apple II paddles") +// ======================> apple2_paddles_device + +class apple2_paddles_device : public device_t, public device_a2gameio_interface +{ +public: + // construction/destruction + apple2_paddles_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + + // device_a2gameio_interface overrides + virtual u8 pdl0_r() override; + virtual u8 pdl1_r() override; + virtual u8 pdl2_r() override; + virtual u8 pdl3_r() override; + virtual DECLARE_READ_LINE_MEMBER(sw0_r) override; + virtual DECLARE_READ_LINE_MEMBER(sw1_r) override; + virtual DECLARE_READ_LINE_MEMBER(sw2_r) override; + virtual DECLARE_READ_LINE_MEMBER(sw3_r) override; + +private: + // input ports + required_ioport_array<4> m_pdl; + required_ioport m_buttons; +}; //************************************************************************** // INPUT PORTS @@ -100,3 +124,13 @@ READ_LINE_MEMBER(apple2_paddles_device::sw3_r) { return BIT(m_buttons->read(), 7); } + +} // anonymous namespace + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definition +DEFINE_DEVICE_TYPE_PRIVATE(APPLE2_PADDLES, device_a2gameio_interface, apple2_paddles_device, "a2pdls", "Apple II paddles") |