summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/pc_joy/pc_joy.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/pc_joy/pc_joy.h')
-rw-r--r--src/devices/bus/pc_joy/pc_joy.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/devices/bus/pc_joy/pc_joy.h b/src/devices/bus/pc_joy/pc_joy.h
index 4b819ddcc09..39a32816a82 100644
--- a/src/devices/bus/pc_joy/pc_joy.h
+++ b/src/devices/bus/pc_joy/pc_joy.h
@@ -8,8 +8,10 @@
*
*************************************************************************/
-#ifndef PC_JOY_H
-#define PC_JOY_H
+#ifndef MAME_BUS_PC_JOY_PC_JOY_H
+#define MAME_BUS_PC_JOY_PC_JOY_H
+
+#pragma once
#define MCFG_PC_JOY_ADD(_tag) \
@@ -18,10 +20,9 @@
SLOT_INTERFACE_EXTERN(pc_joysticks);
-class device_pc_joy_interface: public device_slot_card_interface
+class device_pc_joy_interface : public device_slot_card_interface
{
public:
- device_pc_joy_interface(const machine_config &mconfig, device_t &device);
virtual ~device_pc_joy_interface();
virtual uint8_t x1(int delta) { return 0; }
@@ -30,25 +31,29 @@ public:
virtual uint8_t y2(int delta) { return 0; }
virtual uint8_t btn() { return 0xf; }
virtual void port_write() { }
+
+protected:
+ device_pc_joy_interface(const machine_config &mconfig, device_t &device);
};
-class pc_joy_device : public device_t,
- public device_slot_interface
+class pc_joy_device : public device_t, public device_slot_interface
{
public:
pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_READ8_MEMBER(joy_port_r);
DECLARE_WRITE8_MEMBER(joy_port_w);
+
protected:
virtual void device_start() override { m_stime = machine().time(); }
virtual void device_config_complete() override;
+
private:
attotime m_stime;
device_pc_joy_interface *m_dev;
};
-extern const device_type PC_JOY;
+DECLARE_DEVICE_TYPE(PC_JOY, pc_joy_device)
class pc_basic_joy_device : public device_t,
public device_pc_joy_interface
@@ -64,7 +69,7 @@ public:
virtual uint8_t btn() override { return m_btn->read(); }
protected:
- virtual void device_start() override {}
+ virtual void device_start() override { }
private:
required_ioport m_btn;
@@ -74,4 +79,4 @@ private:
required_ioport m_y2;
};
-#endif /* PC_JOY_H */
+#endif // MAME_BUS_PC_JOY_PC_JOY_H