From ff66041afb18c6288d250b17f5b298742ec0e53e Mon Sep 17 00:00:00 2001 From: angelosa Date: Thu, 21 Sep 2023 20:30:48 +0200 Subject: bus/pc_joy: implement Interact Magnum 6 Game Controller New working software list items ------------------------------- ibm5170.xml: Interact Magnum 6 Game Controller Driver for Windows 95 [archive.org] --- hash/ibm5170.xml | 16 +++++++++++- scripts/src/bus.lua | 2 ++ src/devices/bus/pc_joy/pc_joy.cpp | 15 ++++++++--- src/devices/bus/pc_joy/pc_joy.h | 5 +++- src/devices/bus/pc_joy/pc_joy_magnum6.cpp | 41 +++++++++++++++++++++++++++++++ src/devices/bus/pc_joy/pc_joy_magnum6.h | 22 +++++++++++++++++ 6 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 src/devices/bus/pc_joy/pc_joy_magnum6.cpp create mode 100644 src/devices/bus/pc_joy/pc_joy_magnum6.h diff --git a/hash/ibm5170.xml b/hash/ibm5170.xml index 960efec4ead..4448241f6ef 100644 --- a/hash/ibm5170.xml +++ b/hash/ibm5170.xml @@ -6386,7 +6386,7 @@ license:CC0-1.0 - + Iomega Zip-drive Tools (Version 5.1) 1996 Iomega @@ -6413,6 +6413,20 @@ license:CC0-1.0 + + Interact Magnum 6 Game Controller Driver for Windows 95 + 1996 + Interact Multimedia Products + + + + + + + + Magic S20 Sound Card diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 355619392bc..99a682f5e8f 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -2115,6 +2115,8 @@ if (BUSES["PC_JOY"]~=null) then files { MAME_DIR .. "src/devices/bus/pc_joy/pc_joy.cpp", MAME_DIR .. "src/devices/bus/pc_joy/pc_joy.h", + MAME_DIR .. "src/devices/bus/pc_joy/pc_joy_magnum6.cpp", + MAME_DIR .. "src/devices/bus/pc_joy/pc_joy_magnum6.h", MAME_DIR .. "src/devices/bus/pc_joy/pc_joy_sw.cpp", MAME_DIR .. "src/devices/bus/pc_joy/pc_joy_sw.h", } diff --git a/src/devices/bus/pc_joy/pc_joy.cpp b/src/devices/bus/pc_joy/pc_joy.cpp index 2171a9ddbf7..98bd20deaef 100644 --- a/src/devices/bus/pc_joy/pc_joy.cpp +++ b/src/devices/bus/pc_joy/pc_joy.cpp @@ -10,6 +10,7 @@ #include "emu.h" #include "pc_joy.h" +#include "pc_joy_magnum6.h" #include "pc_joy_sw.h" DEFINE_DEVICE_TYPE(PC_JOY, pc_joy_device, "pc_joy", "PC joystick port") @@ -84,8 +85,8 @@ ioport_constructor pc_basic_joy_device::device_input_ports() const DEFINE_DEVICE_TYPE(PC_BASIC_JOY, pc_basic_joy_device, "pc_basic_joy", "PC basic joystick") -pc_basic_joy_device::pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, PC_BASIC_JOY, tag, owner, clock), +pc_basic_joy_device::pc_basic_joy_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), device_pc_joy_interface(mconfig, *this), m_btn(*this, "btn"), m_x1(*this, "x1"), @@ -95,8 +96,14 @@ pc_basic_joy_device::pc_basic_joy_device(const machine_config &mconfig, const ch { } +pc_basic_joy_device::pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + pc_basic_joy_device(mconfig, PC_BASIC_JOY, tag, owner, clock) +{ +} + void pc_joysticks(device_slot_interface &device) { - device.option_add("basic_joy", PC_BASIC_JOY); - device.option_add("mssw_pad", PC_MSSW_PAD); + device.option_add("basic_joy", PC_BASIC_JOY); + device.option_add("magnum6_pad", PC_MAGNUM6_PAD); + device.option_add("mssw_pad", PC_MSSW_PAD); } diff --git a/src/devices/bus/pc_joy/pc_joy.h b/src/devices/bus/pc_joy/pc_joy.h index e09520f6436..7ad13fa97f6 100644 --- a/src/devices/bus/pc_joy/pc_joy.h +++ b/src/devices/bus/pc_joy/pc_joy.h @@ -65,10 +65,13 @@ public: virtual uint8_t btn() override { return m_btn->read(); } protected: + pc_basic_joy_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock = 0); + virtual void device_start() override { } -private: required_ioport m_btn; + +private: required_ioport m_x1; required_ioport m_y1; required_ioport m_x2; diff --git a/src/devices/bus/pc_joy/pc_joy_magnum6.cpp b/src/devices/bus/pc_joy/pc_joy_magnum6.cpp new file mode 100644 index 00000000000..578f97701e0 --- /dev/null +++ b/src/devices/bus/pc_joy/pc_joy_magnum6.cpp @@ -0,0 +1,41 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese + +#include "emu.h" +#include "pc_joy_magnum6.h" + +DEFINE_DEVICE_TYPE(PC_MAGNUM6_PAD, pc_joy_magnum6_device, "magnum6_pad", "Interact Magnum 6 Game Controller") + + +pc_joy_magnum6_device::pc_joy_magnum6_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) + : pc_basic_joy_device(mconfig, PC_MAGNUM6_PAD, tag, owner, clock) +{ +} + +static INPUT_PORTS_START( magnum6 ) + // TODO: input modes (4-button with throttle and 4-way view) + PORT_START("btn") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Joystick 1 Button A") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Joystick 1 Button B") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Joystick 1 Button C") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Joystick 1 Button D") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Joystick 1 Button R") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Joystick 1 Button L") + + PORT_START("x1") + PORT_BIT(0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_MINMAX(1,0xff) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) + + PORT_START("y1") + PORT_BIT(0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_MINMAX(1,0xff) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) + + PORT_START("x2") + PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("y2") + PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END + +ioport_constructor pc_joy_magnum6_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( magnum6 ); +} diff --git a/src/devices/bus/pc_joy/pc_joy_magnum6.h b/src/devices/bus/pc_joy/pc_joy_magnum6.h new file mode 100644 index 00000000000..20f4fd0a4c1 --- /dev/null +++ b/src/devices/bus/pc_joy/pc_joy_magnum6.h @@ -0,0 +1,22 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese + +#ifndef MAME_BUS_PC_JOY_MAGNUM6_H +#define MAME_BUS_PC_JOY_MAGNUM6_H + +#include "pc_joy.h" + +class pc_joy_magnum6_device : public pc_basic_joy_device +{ +public: + pc_joy_magnum6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + virtual uint8_t x2(int delta) override { return BIT(m_btn->read(), 4); } + virtual uint8_t y2(int delta) override { return BIT(m_btn->read(), 5); } + + virtual ioport_constructor device_input_ports() const override; +}; + +DECLARE_DEVICE_TYPE(PC_MAGNUM6_PAD, pc_joy_magnum6_device) + +#endif // MAME_BUS_PC_JOY_MAGNUM6_H -- cgit v1.2.3