1 // license:BSD-3-Clause
2 // copyright-holders:smf
3 /**********************************************************************
4 
5     The Digital Excess & Hitmen 4-Player Joystick adapter emulation
6 
7     http://hitmen.c02.at/html/hardware.html
8 
9 **********************************************************************/
10 
11 #include "emu.h"
12 #include "4dxh.h"
13 
14 
15 
16 //**************************************************************************
17 //  DEVICE DEFINITIONS
18 //**************************************************************************
19 
20 DEFINE_DEVICE_TYPE(C64_4DXH, c64_4dxh_device, "c64_4dxh", "C64 DXH 4-Player Adapter")
21 
22 
23 //-------------------------------------------------
24 //  INPUT_PORTS( c64_4dxh )
25 //-------------------------------------------------
26 
INPUT_PORTS_START(c64_4dxh)27 static INPUT_PORTS_START( c64_4dxh )
28 	PORT_START("SP2")
29 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_7)
30 
31 	PORT_START("PB")
32 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_c)
33 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_d)
34 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_e)
35 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_f)
36 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_h)
37 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_j)
38 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_k)
39 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_l)
40 
41 	PORT_START("PA2")
42 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, device_pet_user_port_interface, output_m)
43 INPUT_PORTS_END
44 
45 
46 //-------------------------------------------------
47 //  input_ports - device-specific input ports
48 //-------------------------------------------------
49 
50 ioport_constructor c64_4dxh_device::device_input_ports() const
51 {
52 	return INPUT_PORTS_NAME( c64_4dxh );
53 }
54 
55 
56 
57 //**************************************************************************
58 //  LIVE DEVICE
59 //**************************************************************************
60 
61 //-------------------------------------------------
62 //  c64_4dxh_device - constructor
63 //-------------------------------------------------
64 
c64_4dxh_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)65 c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
66 	device_t(mconfig, C64_4DXH, tag, owner, clock),
67 	device_pet_user_port_interface(mconfig, *this)
68 {
69 }
70 
71 
72 //-------------------------------------------------
73 //  device_start - device-specific startup
74 //-------------------------------------------------
75 
device_start()76 void c64_4dxh_device::device_start()
77 {
78 }
79