mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
ng_aes.cpp: converted AES controllers to work through slot devices.
Also, separated more clearly the CD component by the base unit. [Fabio Priuli]
This commit is contained in:
parent
1c80bbd435
commit
af570db2d0
@ -705,7 +705,7 @@ end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/bus/intv/slot.h,BUSES["INTV_CTRL"] = true
|
||||
--@src/devices/bus/intv_ctrl/ctrl.h,BUSES["INTV_CTRL"] = true
|
||||
---------------------------------------------------
|
||||
|
||||
if (BUSES["INTV_CTRL"]~=null) then
|
||||
@ -1949,6 +1949,23 @@ if (BUSES["NEOGEO"]~=null) then
|
||||
end
|
||||
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/bus/neogeo_ctrl/ctrl.h,BUSES["NEOGEO_CTRL"] = true
|
||||
---------------------------------------------------
|
||||
|
||||
if (BUSES["NEOGEO_CTRL"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/bus/neogeo_ctrl/ctrl.cpp",
|
||||
MAME_DIR .. "src/devices/bus/neogeo_ctrl/ctrl.h",
|
||||
MAME_DIR .. "src/devices/bus/neogeo_ctrl/joystick.cpp",
|
||||
MAME_DIR .. "src/devices/bus/neogeo_ctrl/joystick.h",
|
||||
MAME_DIR .. "src/devices/bus/neogeo_ctrl/mahjong.cpp",
|
||||
MAME_DIR .. "src/devices/bus/neogeo_ctrl/mahjong.h",
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/bus/saturn/sat_slot.h,BUSES["SATURN"] = true
|
||||
|
@ -617,6 +617,7 @@ BUSES["MIDI"] = true
|
||||
--BUSES["MEGADRIVE"] = true
|
||||
--BUSES["MSX_SLOT"] = true
|
||||
BUSES["NEOGEO"] = true
|
||||
BUSES["NEOGEO_CTRL"] = true
|
||||
--BUSES["NES"] = true
|
||||
--BUSES["NUBUS"] = true
|
||||
--BUSES["O2"] = true
|
||||
|
@ -631,6 +631,7 @@ BUSES["MEGADRIVE"] = true
|
||||
BUSES["MSX_SLOT"] = true
|
||||
BUSES["NASBUS"] = true
|
||||
BUSES["NEOGEO"] = true
|
||||
BUSES["NEOGEO_CTRL"] = true
|
||||
BUSES["NES"] = true
|
||||
BUSES["NES_CTRL"] = true
|
||||
BUSES["NEWBRAIN"] = true
|
||||
|
112
src/devices/bus/neogeo_ctrl/ctrl.cpp
Normal file
112
src/devices/bus/neogeo_ctrl/ctrl.cpp
Normal file
@ -0,0 +1,112 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Fabio Priuli
|
||||
/**********************************************************************
|
||||
|
||||
SNK Neo Geo Controller Port emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "ctrl.h"
|
||||
// slot devices
|
||||
#include "joystick.h"
|
||||
#include "mahjong.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
const device_type NEOGEO_CONTROL_PORT = &device_creator<neogeo_control_port_device>;
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CARD INTERFACE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_neogeo_control_port_interface - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
device_neogeo_control_port_interface::device_neogeo_control_port_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig,device)
|
||||
{
|
||||
m_port = dynamic_cast<neogeo_control_port_device *>(device.owner());
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ~device_neogeo_control_port_interface - destructor
|
||||
//-------------------------------------------------
|
||||
|
||||
device_neogeo_control_port_interface::~device_neogeo_control_port_interface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// neogeo_control_port_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
neogeo_control_port_device::neogeo_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, NEOGEO_CONTROL_PORT, "SNK Neo Geo control port", tag, owner, clock, "neogeo_control_port", __FILE__),
|
||||
device_slot_interface(mconfig, *this), m_device(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ~neogeo_control_port_device - destructor
|
||||
//-------------------------------------------------
|
||||
|
||||
neogeo_control_port_device::~neogeo_control_port_device()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void neogeo_control_port_device::device_start()
|
||||
{
|
||||
m_device = dynamic_cast<device_neogeo_control_port_interface *>(get_card_device());
|
||||
}
|
||||
|
||||
|
||||
UINT16 neogeo_control_port_device::read_ctrl()
|
||||
{
|
||||
UINT16 data = 0;
|
||||
if (m_device)
|
||||
data |= m_device->read_ctrl();
|
||||
return data;
|
||||
}
|
||||
|
||||
UINT8 neogeo_control_port_device::read_start_sel()
|
||||
{
|
||||
UINT8 data = 0;
|
||||
if (m_device)
|
||||
data |= m_device->read_start_sel();
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
void neogeo_control_port_device::write_ctrlsel(UINT8 data)
|
||||
{
|
||||
if (m_device)
|
||||
m_device->write_ctrlsel(data);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// SLOT_INTERFACE( neogeo_control_port_devices )
|
||||
//-------------------------------------------------
|
||||
|
||||
SLOT_INTERFACE_START( neogeo_controls )
|
||||
SLOT_INTERFACE("joy", NEOGEO_JOYSTICK)
|
||||
SLOT_INTERFACE("mahjong", NEOGEO_MJCTRL)
|
||||
SLOT_INTERFACE_END
|
||||
|
80
src/devices/bus/neogeo_ctrl/ctrl.h
Normal file
80
src/devices/bus/neogeo_ctrl/ctrl.h
Normal file
@ -0,0 +1,80 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Fabio Priuli
|
||||
/**********************************************************************
|
||||
|
||||
SNK Neo Geo controller port emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __NEOGEO_CONTROL_PORT__
|
||||
#define __NEOGEO_CONTROL_PORT__
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
class neogeo_control_port_device;
|
||||
|
||||
// ======================> device_neogeo_control_port_interface
|
||||
|
||||
class device_neogeo_control_port_interface : public device_slot_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
device_neogeo_control_port_interface(const machine_config &mconfig, device_t &device);
|
||||
virtual ~device_neogeo_control_port_interface();
|
||||
|
||||
virtual UINT16 read_ctrl() { return 0xffff; };
|
||||
virtual UINT8 read_start_sel() { return 0xff; };
|
||||
virtual void write_ctrlsel(UINT8 data) { };
|
||||
|
||||
protected:
|
||||
neogeo_control_port_device *m_port;
|
||||
};
|
||||
|
||||
// ======================> neogeo_control_port_device
|
||||
|
||||
class neogeo_control_port_device : public device_t,
|
||||
public device_slot_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
neogeo_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
virtual ~neogeo_control_port_device();
|
||||
|
||||
UINT16 read_ctrl();
|
||||
UINT8 read_start_sel();
|
||||
void write_ctrlsel(UINT8 data);
|
||||
DECLARE_READ16_MEMBER( ctrl_r ) { return read_ctrl(); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
device_neogeo_control_port_interface *m_device;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type NEOGEO_CONTROL_PORT;
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_NEOGEO_CONTROL_PORT_ADD(_tag, _slot_intf, _def_slot) \
|
||||
MCFG_DEVICE_ADD(_tag, NEOGEO_CONTROL_PORT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
||||
|
||||
|
||||
SLOT_INTERFACE_EXTERN( neogeo_controls );
|
||||
|
||||
|
||||
#endif
|
99
src/devices/bus/neogeo_ctrl/joystick.cpp
Normal file
99
src/devices/bus/neogeo_ctrl/joystick.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Fabio Priuli
|
||||
/**********************************************************************
|
||||
|
||||
SNK Neo Geo Joystick emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "joystick.h"
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
const device_type NEOGEO_JOYSTICK = &device_creator<neogeo_joystick_device>;
|
||||
|
||||
|
||||
static INPUT_PORTS_START( neogeo_joy )
|
||||
PORT_START("JOY")
|
||||
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
|
||||
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 )
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 )
|
||||
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 )
|
||||
|
||||
PORT_START("START_SELECT")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SELECT )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// input_ports - device-specific input ports
|
||||
//-------------------------------------------------
|
||||
|
||||
ioport_constructor neogeo_joystick_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( neogeo_joy );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// neogeo_joystick_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
neogeo_joystick_device::neogeo_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, NEOGEO_JOYSTICK, "SNK Neo Geo Joystick", tag, owner, clock, "neogeo_joy", __FILE__),
|
||||
device_neogeo_control_port_interface(mconfig, *this),
|
||||
m_joy(*this, "JOY"),
|
||||
m_ss(*this, "START_SELECT")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void neogeo_joystick_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void neogeo_joystick_device::device_reset()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_ctrl
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT16 neogeo_joystick_device::read_ctrl()
|
||||
{
|
||||
return m_joy->read();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_start_sel
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 neogeo_joystick_device::read_start_sel()
|
||||
{
|
||||
return m_ss->read();
|
||||
}
|
||||
|
79
src/devices/bus/neogeo_ctrl/joystick.h
Normal file
79
src/devices/bus/neogeo_ctrl/joystick.h
Normal file
@ -0,0 +1,79 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Fabio Priuli
|
||||
/**********************************************************************
|
||||
|
||||
SNK Neo Geo Joystick emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __NEOGEO_JOYSTICK__
|
||||
#define __NEOGEO_JOYSTICK__
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "ctrl.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> neogeo_joystick_device
|
||||
|
||||
class neogeo_joystick_device : public device_t,
|
||||
public device_neogeo_control_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
neogeo_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// device_intv_control_port_interface overrides
|
||||
virtual UINT16 read_ctrl() override;
|
||||
virtual UINT8 read_start_sel() override;
|
||||
|
||||
private:
|
||||
required_ioport m_joy;
|
||||
required_ioport m_ss;
|
||||
};
|
||||
|
||||
|
||||
// ======================> neogeo_joy_ac_device
|
||||
|
||||
class neogeo_joy_ac_device : public device_t,
|
||||
public device_neogeo_control_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
neogeo_joy_ac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// device_intv_control_port_interface overrides
|
||||
virtual UINT16 read_ctrl() override;
|
||||
|
||||
private:
|
||||
required_ioport m_joy;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type NEOGEO_JOYSTICK;
|
||||
extern const device_type NEOGEO_JOY_AC;
|
||||
|
||||
|
||||
#endif
|
155
src/devices/bus/neogeo_ctrl/mahjong.cpp
Normal file
155
src/devices/bus/neogeo_ctrl/mahjong.cpp
Normal file
@ -0,0 +1,155 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Fabio Priuli
|
||||
/**********************************************************************
|
||||
|
||||
SNK Neo Geo Mahjong controller emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "mahjong.h"
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
const device_type NEOGEO_MJCTRL = &device_creator<neogeo_mjctrl_device>;
|
||||
|
||||
|
||||
static INPUT_PORTS_START( neogeo_joy )
|
||||
PORT_START("MJ.0")
|
||||
PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_A )
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_B )
|
||||
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_C )
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_D )
|
||||
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_E )
|
||||
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_F )
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_G )
|
||||
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("MJ.1")
|
||||
PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_H )
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_I )
|
||||
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_J )
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_K )
|
||||
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_L )
|
||||
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_M )
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_N )
|
||||
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 )
|
||||
|
||||
// is this actually connected?
|
||||
PORT_START("MJ.2")
|
||||
PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
|
||||
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 )
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 )
|
||||
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 )
|
||||
|
||||
PORT_START("MJ.3")
|
||||
PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
|
||||
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
|
||||
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
|
||||
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("START_SELECT")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SELECT )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// input_ports - device-specific input ports
|
||||
//-------------------------------------------------
|
||||
|
||||
ioport_constructor neogeo_mjctrl_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( neogeo_joy );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// neogeo_joystick_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
neogeo_mjctrl_device::neogeo_mjctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, NEOGEO_MJCTRL, "SNK Neo Geo Mahjong controller", tag, owner, clock, "neogeo_mjctrl", __FILE__),
|
||||
device_neogeo_control_port_interface(mconfig, *this),
|
||||
m_mjpanel(*this, "MJ"),
|
||||
m_ss(*this, "START_SELECT")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void neogeo_mjctrl_device::device_start()
|
||||
{
|
||||
save_item(NAME(m_ctrl_sel));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void neogeo_mjctrl_device::device_reset()
|
||||
{
|
||||
m_ctrl_sel = 0;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_ctrl
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT16 neogeo_mjctrl_device::read_ctrl()
|
||||
{
|
||||
UINT16 res = 0;
|
||||
switch (m_ctrl_sel)
|
||||
{
|
||||
default:
|
||||
case 0x00: res = 0xffff; break;
|
||||
case 0x09: res = m_mjpanel[0]->read(); break;
|
||||
case 0x12: res = m_mjpanel[1]->read(); break;
|
||||
case 0x1b: res = m_mjpanel[2]->read(); break;
|
||||
case 0x24: res = m_mjpanel[3]->read(); break;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_start_sel
|
||||
//-------------------------------------------------
|
||||
|
||||
UINT8 neogeo_mjctrl_device::read_start_sel()
|
||||
{
|
||||
return m_ss->read();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// write_ctrlsel
|
||||
//-------------------------------------------------
|
||||
|
||||
void neogeo_mjctrl_device::write_ctrlsel(UINT8 data)
|
||||
{
|
||||
m_ctrl_sel = data;
|
||||
}
|
||||
|
55
src/devices/bus/neogeo_ctrl/mahjong.h
Normal file
55
src/devices/bus/neogeo_ctrl/mahjong.h
Normal file
@ -0,0 +1,55 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Fabio Priuli
|
||||
/**********************************************************************
|
||||
|
||||
SNK Neo Geo Mahjong controller emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __NEOGEO_MJCTRL__
|
||||
#define __NEOGEO_MJCTRL__
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "ctrl.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> neogeo_mjctrl_device
|
||||
|
||||
class neogeo_mjctrl_device : public device_t,
|
||||
public device_neogeo_control_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
neogeo_mjctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// device_intv_control_port_interface overrides
|
||||
virtual UINT16 read_ctrl() override;
|
||||
virtual UINT8 read_start_sel() override;
|
||||
virtual void write_ctrlsel(UINT8 data) override;
|
||||
|
||||
private:
|
||||
required_ioport_array<4> m_mjpanel;
|
||||
required_ioport m_ss;
|
||||
UINT8 m_ctrl_sel;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type NEOGEO_MJCTRL;
|
||||
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -22,6 +22,8 @@
|
||||
#include "bus/neogeo/sbp_prot.h"
|
||||
#include "bus/neogeo/kog_prot.h"
|
||||
|
||||
#include "bus/neogeo_ctrl/ctrl.h"
|
||||
|
||||
// On scanline 224, /VBLANK goes low 56 mclks (14 pixels) from the rising edge of /HSYNC.
|
||||
// Two mclks after /VBLANK goes low, the hardware sets a pending IRQ1 flip-flop.
|
||||
#define NEOGEO_VBLANK_IRQ_HTIM (attotime::from_ticks(56+2, NEOGEO_MASTER_CLOCK))
|
||||
|
Loading…
Reference in New Issue
Block a user