mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
apple2: Add support for the 4Play Joystick Card [R. Belmont]
This commit is contained in:
parent
31929898c9
commit
00db3c0c21
@ -2131,6 +2131,8 @@ if (BUSES["A2BUS"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/a2bus/ssbapple.h",
|
||||
MAME_DIR .. "src/devices/bus/a2bus/transwarp.cpp",
|
||||
MAME_DIR .. "src/devices/bus/a2bus/transwarp.h",
|
||||
MAME_DIR .. "src/devices/bus/a2bus/4play.cpp",
|
||||
MAME_DIR .. "src/devices/bus/a2bus/4play.h",
|
||||
}
|
||||
end
|
||||
|
||||
|
125
src/devices/bus/a2bus/4play.cpp
Normal file
125
src/devices/bus/a2bus/4play.cpp
Normal file
@ -0,0 +1,125 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:R. Belmont
|
||||
/*********************************************************************
|
||||
|
||||
a2ssc.c
|
||||
|
||||
4 player digital joystick card for the Apple II by Lukazi
|
||||
http://lukazi.blogspot.com/2016/05/apple-ii-4play-joystick-card-revb.html
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "4play.h"
|
||||
|
||||
/***************************************************************************
|
||||
PARAMETERS
|
||||
***************************************************************************/
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(A2BUS_4PLAY, a2bus_4play_device, "a24play", "4play Joystick Card (rev. B)")
|
||||
|
||||
static INPUT_PORTS_START( a24play )
|
||||
PORT_START("p1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
|
||||
|
||||
PORT_START("p2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
|
||||
PORT_START("p3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3)
|
||||
|
||||
PORT_START("p4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3)
|
||||
INPUT_PORTS_END
|
||||
|
||||
//-------------------------------------------------
|
||||
// input_ports - device-specific input ports
|
||||
//-------------------------------------------------
|
||||
|
||||
ioport_constructor a2bus_4play_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( a24play );
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
a2bus_4play_device::a2bus_4play_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
a2bus_4play_device(mconfig, A2BUS_4PLAY, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
a2bus_4play_device::a2bus_4play_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_a2bus_card_interface(mconfig, *this),
|
||||
m_p1(*this, "p1"),
|
||||
m_p2(*this, "p2"),
|
||||
m_p3(*this, "p3"),
|
||||
m_p4(*this, "p4")
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void a2bus_4play_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
read_c0nx - called for reads from this card's c0nx space
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint8_t a2bus_4play_device::read_c0nx(uint8_t offset)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0:
|
||||
return m_p1->read();
|
||||
case 1:
|
||||
return m_p2->read();
|
||||
case 2:
|
||||
return m_p3->read();
|
||||
case 3:
|
||||
return m_p4->read();
|
||||
|
||||
default:
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
45
src/devices/bus/a2bus/4play.h
Normal file
45
src/devices/bus/a2bus/4play.h
Normal file
@ -0,0 +1,45 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:R. Belmont
|
||||
/*********************************************************************
|
||||
|
||||
4play.h
|
||||
|
||||
4 player digital joystick card for the Apple II by Lukazi
|
||||
http://lukazi.blogspot.com/2016/05/apple-ii-4play-joystick-card-revb.html
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_A2BUS_4PLAY_H
|
||||
#define MAME_BUS_A2BUS_4PLAY_H
|
||||
|
||||
#include "a2bus.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
class a2bus_4play_device:
|
||||
public device_t,
|
||||
public device_a2bus_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
a2bus_4play_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
a2bus_4play_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual void device_start() override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
virtual uint8_t read_c0nx(uint8_t offset) override;
|
||||
|
||||
required_ioport m_p1, m_p2, m_p3, m_p4;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(A2BUS_4PLAY, a2bus_4play_device)
|
||||
|
||||
#endif // MAME_BUS_A2BUS_4PLAY_H
|
@ -86,6 +86,7 @@ II Plus: RAM options reduced to 16/32/48 KB.
|
||||
#include "bus/a2bus/timemasterho.h"
|
||||
#include "bus/a2bus/ssprite.h"
|
||||
#include "bus/a2bus/ssbapple.h"
|
||||
#include "bus/a2bus/4play.h"
|
||||
|
||||
#include "bus/a2gameio/gameio.h"
|
||||
|
||||
@ -1264,6 +1265,7 @@ static void apple2_cards(device_slot_interface &device)
|
||||
device.option_add("ezcgi9958", A2BUS_EZCGI_9958); /* E-Z Color Graphics Interface (TMS9958) */
|
||||
device.option_add("ssprite", A2BUS_SSPRITE); /* Synetix SuperSprite Board */
|
||||
device.option_add("ssbapple", A2BUS_SSBAPPLE); /* SSB Apple speech board */
|
||||
device.option_add("4play", A2BUS_4PLAY); /* 4Play Joystick Card (Rev. B) */
|
||||
// device.option_add("magicmusician", A2BUS_MAGICMUSICIAN); /* Magic Musician Card */
|
||||
}
|
||||
|
||||
|
@ -155,6 +155,7 @@ Address bus A0-A11 is Y0-Y11
|
||||
#include "bus/a2bus/ssbapple.h"
|
||||
#include "bus/a2bus/transwarp.h"
|
||||
#include "bus/a2bus/a2vulcan.h"
|
||||
#include "bus/a2bus/4play.h"
|
||||
|
||||
#include "bus/a2gameio/gameio.h"
|
||||
|
||||
@ -4431,6 +4432,7 @@ static void apple2_cards(device_slot_interface &device)
|
||||
device.option_add("ssbapple", A2BUS_SSBAPPLE); /* SSB Apple speech board */
|
||||
device.option_add("twarp", A2BUS_TRANSWARP); /* AE TransWarp accelerator */
|
||||
device.option_add("vulcan", A2BUS_VULCANIIE); /* Applied Engineering Vulcan IDE drive */
|
||||
device.option_add("4play", A2BUS_4PLAY); /* 4Play Joystick Card (Rev. B) */
|
||||
}
|
||||
|
||||
static void apple2eaux_cards(device_slot_interface &device)
|
||||
|
@ -87,6 +87,7 @@
|
||||
#include "bus/a2bus/mouse.h"
|
||||
#include "bus/a2bus/ezcgi.h"
|
||||
#include "bus/a2bus/a2vulcan.h"
|
||||
#include "bus/a2bus/4play.h"
|
||||
//#include "bus/a2bus/pc_xporter.h"
|
||||
|
||||
#include "bus/a2gameio/gameio.h"
|
||||
@ -4510,6 +4511,7 @@ static void apple2_cards(device_slot_interface &device)
|
||||
device.option_add("ezcgi9958", A2BUS_EZCGI_9958); /* E-Z Color Graphics Interface (TMS9958) */
|
||||
device.option_add("vulcan", A2BUS_VULCAN); /* Applied Engineering Vulcan IDE drive */
|
||||
device.option_add("vulcangold", A2BUS_VULCANGOLD); /* Applied Engineering Vulcan Gold IDE drive */
|
||||
device.option_add("4play", A2BUS_4PLAY); /* 4Play Joystick Card (Rev. B) */
|
||||
// device.option_add("magicmusician", A2BUS_MAGICMUSICIAN); /* Magic Musician Card */
|
||||
// device.option_add("pcxport", A2BUS_PCXPORTER); /* Applied Engineering PC Transporter */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user