summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine/vcs_keypad.c
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2013-10-22 15:44:27 +0000
committer Curt Coder <curtcoder@mail.com>2013-10-22 15:44:27 +0000
commit0b91c21b366be4d0c1bcabdbe74e6b9d82a62271 (patch)
tree1804ed0b9de916825d5fc7e1387d33aac256f4c0 /src/mess/machine/vcs_keypad.c
parent47c548e760b6c4447f7b15e7d403060d0051b994 (diff)
(MESS) Moved a bunch of buses under emu/bus. (nw)
Diffstat (limited to 'src/mess/machine/vcs_keypad.c')
-rw-r--r--src/mess/machine/vcs_keypad.c140
1 files changed, 0 insertions, 140 deletions
diff --git a/src/mess/machine/vcs_keypad.c b/src/mess/machine/vcs_keypad.c
deleted file mode 100644
index 7965e38f4da..00000000000
--- a/src/mess/machine/vcs_keypad.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/**********************************************************************
-
- Atari Video Computer System keypad emulation
-
- Copyright MESS Team.
- Visit http://mamedev.org for licensing and usage restrictions.
-
-**********************************************************************/
-
-#include "vcs_keypad.h"
-
-
-
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type VCS_KEYPAD = &device_creator<vcs_keypad_device>;
-
-
-static INPUT_PORTS_START( vcs_keypad )
- PORT_START("KEYPAD")
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 1") PORT_CODE(KEYCODE_7_PAD)
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 2") PORT_CODE(KEYCODE_8_PAD)
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 3") PORT_CODE(KEYCODE_9_PAD)
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 4") PORT_CODE(KEYCODE_4_PAD)
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 5") PORT_CODE(KEYCODE_5_PAD)
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 6") PORT_CODE(KEYCODE_6_PAD)
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 7") PORT_CODE(KEYCODE_1_PAD)
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 8") PORT_CODE(KEYCODE_2_PAD)
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 9") PORT_CODE(KEYCODE_3_PAD)
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad *") PORT_CODE(KEYCODE_0_PAD)
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad 0") PORT_CODE(KEYCODE_DEL_PAD)
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("keypad #") PORT_CODE(KEYCODE_ENTER_PAD)
-INPUT_PORTS_END
-
-
-//-------------------------------------------------
-// input_ports - device-specific input ports
-//-------------------------------------------------
-
-ioport_constructor vcs_keypad_device::device_input_ports() const
-{
- return INPUT_PORTS_NAME( vcs_keypad );
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// vcs_keypad_device - constructor
-//-------------------------------------------------
-
-vcs_keypad_device::vcs_keypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- device_t(mconfig, VCS_KEYPAD, "Keypad", tag, owner, clock, "vcs_keypad", __FILE__),
- device_vcs_control_port_interface(mconfig, *this),
- m_keypad(*this, "KEYPAD")
-{
-}
-
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void vcs_keypad_device::device_start()
-{
- m_column = 0;
- save_item(NAME(m_column));
-}
-
-
-//-------------------------------------------------
-// vcs_joy_w - joystick write
-//-------------------------------------------------
-
-UINT8 vcs_keypad_device::vcs_joy_r()
-{
- for ( int i = 0; i < 4; i++ )
- {
- if ( ! ( ( m_column >> i ) & 0x01 ) )
- {
- if ( ( m_keypad->read() >> 3*i ) & 0x04 )
- {
- return 0xff;
- }
- else
- {
- return 0;
- }
- }
- }
- return 0xff;
-}
-
-void vcs_keypad_device::vcs_joy_w( UINT8 data )
-{
- m_column = data & 0x0F;
-}
-
-UINT8 vcs_keypad_device::vcs_pot_x_r()
-{
- for ( int i = 0; i < 4; i++ )
- {
- if ( ! ( ( m_column >> i ) & 0x01 ) )
- {
- if ( ( m_keypad->read() >> 3*i ) & 0x01 )
- {
- return 0;
- }
- else
- {
- return 0xff;
- }
- }
- }
- return 0;
-}
-
-UINT8 vcs_keypad_device::vcs_pot_y_r()
-{
- for ( int i = 0; i < 4; i++ )
- {
- if ( ! ( ( m_column >> i ) & 0x01 ) )
- {
- if ( ( m_keypad->read() >> 3*i ) & 0x02 )
- {
- return 0;
- }
- else
- {
- return 0xff;
- }
- }
- }
- return 0;
-}