Previous 15994 Revisions Next

r8997 Wednesday 1st September, 2010 at 14:15:58 UTC by Angelo Salese
[PCE]: Hooked up player 2/3/4/5 inputs
[src/mess/drivers]pce.c
[src/mess/machine]pce.c

src/mess/machine/pce.c
r8996r8997
279279
280280READ8_HANDLER ( pce_joystick_r )
281281{
282   static const char *const joyname[] = { "JOY_P1", "JOY_P2", "JOY_P3", "JOY_P4", "JOY_P5" };
282283   UINT8 ret;
283   int data = input_port_read(space->machine, "JOY");
284   int data;
285
286   if(joystick_port_select <= 4)
287      data = input_port_read(space->machine, joyname[joystick_port_select]);
288   else
289      data = 0xff;
290
284291   if(joystick_data_select) data >>= 4;
285292   ret = (data & 0x0F) | pce.io_port_options;
286293#ifdef UNIFIED_PCE
287294   ret &= ~0x40;
288295#endif
296
289297   return (ret);
290298}
291299
src/mess/drivers/pce.c
r8996r8997
118118/* todo: alternate forms of input (multitap, mouse, etc.) */
119119static INPUT_PORTS_START( pce )
120120
121    PORT_START("JOY")  /* Player 1 controls */
121    PORT_START("JOY_P1")  /* Player 1 controls */
122122    /* II is left of I on the original pad so we map them in reverse order */
123    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button I")
124    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button II")
125    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  )
126    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P1 Run")
127    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
128    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
129    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
130    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
123    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button I") PORT_PLAYER(1)
124    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button II") PORT_PLAYER(1)
125    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_PLAYER(1)
126    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P1 Run") PORT_PLAYER(1)
127    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
128    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
129    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
130    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
131
132    PORT_START("JOY_P2")  /* Player 2 controls */
133    /* II is left of I on the original pad so we map them in reverse order */
134    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Button I") PORT_PLAYER(2)
135    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Button II") PORT_PLAYER(2)
136    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_PLAYER(2)
137    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P2 Run") PORT_PLAYER(2)
138    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
139    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
140    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
141    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
142
143    PORT_START("JOY_P3")  /* Player 3 controls */
144    /* II is left of I on the original pad so we map them in reverse order */
145    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Button I") PORT_PLAYER(3)
146    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Button II") PORT_PLAYER(3)
147    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_PLAYER(3)
148    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P3 Run") PORT_PLAYER(3)
149    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
150    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
151    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
152    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
153
154    PORT_START("JOY_P4")  /* Player 1 controls */
155    /* II is left of I on the original pad so we map them in reverse order */
156    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P4 Button I") PORT_PLAYER(4)
157    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P4 Button II") PORT_PLAYER(4)
158    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_PLAYER(4)
159    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P4 Run") PORT_PLAYER(4)
160    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
161    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
162    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
163    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
164
165    PORT_START("JOY_P5")  /* Player 1 controls */
166    /* II is left of I on the original pad so we map them in reverse order */
167    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P5 Button I") PORT_PLAYER(5)
168    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P5 Button II") PORT_PLAYER(5)
169    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SELECT  ) PORT_PLAYER(5)
170    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START   ) PORT_NAME("P5 Run") PORT_PLAYER(5)
171    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(5)
172    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(5)
173    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(5)
174    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(5)
131175#if 0
132176    PORT_START  /* Fake dipswitches for system config */
133177    PORT_DIPNAME( 0x01, 0x01, "Console type")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team