Previous 15994 Revisions Next

r6596 Wednesday 9th December, 2009 at 17:28:12 UTC by Angelo Salese
[N64]: Implemented player 2 inputs
[src/mame/machine]n64.c
[src/mess/drivers]n64.c

src/mame/machine/n64.c
r6595r6596
156156   }
157157}
158158
159UINT8 is64_buffer[0x10000];
159static UINT8 is64_buffer[0x10000];
160160
161161READ32_HANDLER( n64_is64_r )
162162{
r6595r6596
13841384}
13851385
13861386// RDRAM Interface
1387UINT32 ri_mode = 0;
1388UINT32 ri_config = 0;
1389UINT32 ri_current_load = 0;
1390UINT32 ri_select = 0;
1391UINT32 ri_count = 0;
1392UINT32 ri_latency = 0;
1393UINT32 ri_rerror = 0;
1394UINT32 ri_werror = 0;
1387static UINT32 ri_mode = 0;
1388static UINT32 ri_config = 0;
1389static UINT32 ri_current_load = 0;
1390static UINT32 ri_select = 0;
1391static UINT32 ri_count = 0;
1392static UINT32 ri_latency = 0;
1393static UINT32 ri_rerror = 0;
1394static UINT32 ri_werror = 0;
13951395
13961396READ32_HANDLER( n64_ri_reg_r )
13971397{
r6595r6596
15421542         switch (channel)
15431543         {
15441544            case 0:
1545            case 1:
15451546            {
15461547               rdata[0] = 0x05;
15471548               rdata[1] = 0x00;
15481549               rdata[2] = 0x02;
15491550               return 0;
15501551            }
1551            case 1:
15521552            case 2:
15531553            case 3:
15541554            {
r6595r6596
15801580      {
15811581         UINT16 buttons = 0;
15821582         INT8 x = 0, y = 0;
1583         /* add here tags for P2, P3 and P4 when implemented */
1584         static const char *const portnames[] = { "P1", "P1_ANALOG_X", "P1_ANALOG_Y" };
1583         /* add here tags for P3 and P4 when implemented */
1584         static const char *const portnames[] = { "P1", "P1_ANALOG_X", "P1_ANALOG_Y", "P2", "P2_ANALOG_X", "P2_ANALOG_Y" };
15851585
15861586         if (slength != 1 || rlength != 4)
15871587         {
r6595r6596
15901590
15911591         switch (channel)
15921592         {
1593            case 0:
1593            case 0: //p1 inputs
1594            case 1: //p2 inputs
15941595            {
15951596                    buttons = input_port_read(machine, portnames[(channel*3) + 0]);
15961597                    x = input_port_read(machine, portnames[(channel*3) + 1]) - 128;
r6595r6596
16021603               rdata[3] = (UINT8)(y);
16031604               return 0;
16041605            }
1605            case 1:
16061606            case 2:
16071607            case 3:
16081608            {
src/mess/drivers/n64.c
r6595r6596
6060
6161   PORT_START("P1_ANALOG_Y")
6262      PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1) PORT_REVERSE
63
64   PORT_START("P2")
65      PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 )        PORT_PLAYER(2) PORT_NAME("Button A")
66      PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON2 )        PORT_PLAYER(2) PORT_NAME("Button B")
67      PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON3 )        PORT_PLAYER(2) PORT_NAME("Button Z")
68      PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START )          PORT_PLAYER(2) PORT_NAME("Start")
69      PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x91") /* Up */
70      PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x93") /* Down */
71      PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x90") /* Left */
72      PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x92") /* Right */
73      PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED )
74      PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON4 )        PORT_PLAYER(2) PORT_NAME("Button L")
75      PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 )        PORT_PLAYER(2) PORT_NAME("Button R")
76      PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON6 )        PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x91") /* Up */
77      PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON7 )        PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x93") /* Down */
78      PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON8 )        PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x90") /* Left */
79      PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON9 )        PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x92") /* Right */
80
81   PORT_START("P2_ANALOG_X")
82      PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2)
83
84   PORT_START("P2_ANALOG_Y")
85      PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2) PORT_REVERSE
86
6387INPUT_PORTS_END
6488
6589/* ?? */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team