Previous 15994 Revisions Next

r6895 Sunday 3rd January, 2010 at 10:35:24 UTC by Wilbert Pol
[SCV] Started hooking inputs.
[src/mess/drivers]scv.c

src/mess/drivers/scv.c
r6894r6895
1010#include "devices/cartslot.h"
1111
1212
13static READ8_HANDLER( scv_porta_r );
1413static WRITE8_HANDLER( scv_porta_w );
1514static READ8_HANDLER( scv_portb_r );
1615static READ8_HANDLER( scv_portc_r );
r6894r6895
3433
3534
3635static ADDRESS_MAP_START( scv_io, ADDRESS_SPACE_IO, 8 )
37   AM_RANGE( 0x00, 0x00 ) AM_READWRITE( scv_porta_r, scv_porta_w )
36   AM_RANGE( 0x00, 0x00 ) AM_WRITE( scv_porta_w )
3837   AM_RANGE( 0x01, 0x01 ) AM_READ( scv_portb_r )
3938   AM_RANGE( 0x02, 0x02 ) AM_READWRITE( scv_portc_r, scv_portc_w )
4039ADDRESS_MAP_END
r6894r6895
4847   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY
4948   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY
5049   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
50   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
51   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
5152
5253   PORT_START( "PA1" )
5354   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY
r6894r6895
5657   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY
5758   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY
5859   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
60   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
61   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
5962
6063   PORT_START( "PA2" )
64   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
65   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
66   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
67   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
68   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
69   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
6170   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0") PORT_CODE(KEYCODE_0)
6271   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("1") PORT_CODE(KEYCODE_1)
6372
6473   PORT_START( "PA3" )
74   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
75   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
76   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
77   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
78   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
79   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
6580   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2") PORT_CODE(KEYCODE_2)
6681   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("3") PORT_CODE(KEYCODE_3)
6782
6883   PORT_START( "PA4" )
84   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
85   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
86   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
87   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
88   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
89   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
6990   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4") PORT_CODE(KEYCODE_4)
7091   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5") PORT_CODE(KEYCODE_5)
7192
7293   PORT_START( "PA5" )
94   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
95   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
96   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
97   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
98   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
99   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
73100   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6") PORT_CODE(KEYCODE_6)
74101   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7") PORT_CODE(KEYCODE_7)
75102
76103   PORT_START( "PA6" )
104   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
105   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
106   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
107   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
108   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
109   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
77110   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8") PORT_CODE(KEYCODE_8)
78111   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("9") PORT_CODE(KEYCODE_9)
79112
80113   PORT_START( "PA7" )
114   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
115   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
116   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
117   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
118   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
81119   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Cl") PORT_CODE(KEYCODE_BACKSPACE)
82120   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("En") PORT_CODE(KEYCODE_ENTER)
83121
r6894r6895
86124INPUT_PORTS_END
87125
88126
89static READ8_HANDLER( scv_porta_r )
90{
91   return 0xff;
92}
93
94
95127static WRITE8_HANDLER( scv_porta_w )
96128{
97129   scv_porta = data;
98130}
99131
132
100133static READ8_HANDLER( scv_portb_r )
101134{
102   return 0xff;
135   UINT8 data = 0xff;
136
137   if ( scv_porta & 0x01 )
138      data &= input_port_read( space->machine, "PA0" );
139
140   if ( scv_porta & 0x02 )
141      data &= input_port_read( space->machine, "PA1" );
142
143   if ( scv_porta & 0x04 )
144      data &= input_port_read( space->machine, "PA2" );
145
146   if ( scv_porta & 0x08 )
147      data &= input_port_read( space->machine, "PA3" );
148
149   if ( scv_porta & 0x10 )
150      data &= input_port_read( space->machine, "PA4" );
151
152   if ( scv_porta & 0x20 )
153      data &= input_port_read( space->machine, "PA5" );
154
155   if ( scv_porta & 0x40 )
156      data &= input_port_read( space->machine, "PA6" );
157
158   if ( scv_porta & 0x80 )
159      data &= input_port_read( space->machine, "PA7" );
160
161   return data;
103162}
104163
105164
106165static READ8_HANDLER( scv_portc_r )
107166{
108   return 0xff;
167   UINT8 data = 0xff;
168
169   data = ( data & 0xfe ) | ( input_port_read( space->machine, "PC0" ) & 0x01 );
170
171   return data;
109172}
110173
111174

Previous 15994 Revisions Next


© 1998-2018 The MESS Team