src/mess/drivers/n64.c
| r7226 | r7227 | |
| 14 | 14 | #include "devices/cartslot.h" |
| 15 | 15 | #include "includes/n64.h" |
| 16 | 16 | |
| 17 | | /* |
| 18 | | static READ32_HANDLER(rsp_dmem_r) |
| 19 | | { |
| 20 | | return rsp_dmem[offset]; |
| 21 | | } |
| 22 | 17 | |
| 23 | | static WRITE32_HANDLER(rsp_dmem_w) |
| 24 | | { |
| 25 | | COMBINE_DATA(&rsp_dmem[offset]); |
| 26 | | } |
| 27 | | |
| 28 | | static READ32_HANDLER(rsp_imem_r) |
| 29 | | { |
| 30 | | return rsp_imem[offset]; |
| 31 | | } |
| 32 | | |
| 33 | | static WRITE32_HANDLER(rsp_imem_w) |
| 34 | | { |
| 35 | | COMBINE_DATA(&rsp_imem[offset]); |
| 36 | | } |
| 37 | | */ |
| 38 | | |
| 39 | 18 | static ADDRESS_MAP_START( n64_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 40 | 19 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE(&rdram) // RDRAM |
| 41 | 20 | AM_RANGE(0x03f00000, 0x03f00027) AM_READWRITE(n64_rdram_reg_r, n64_rdram_reg_w) |
| 42 | | AM_RANGE(0x04000000, 0x04000fff) AM_RAM AM_BASE(&rsp_dmem) AM_SHARE("dmem") // RSP DMEM |
| 43 | | AM_RANGE(0x04001000, 0x04001fff) AM_RAM AM_BASE(&rsp_imem) AM_SHARE("imem") // RSP IMEM |
| 44 | | AM_RANGE(0x04040000, 0x040fffff) AM_READWRITE(n64_sp_reg_r, n64_sp_reg_w) // RSP |
| 45 | | AM_RANGE(0x04100000, 0x041fffff) AM_READWRITE(n64_dp_reg_r, n64_dp_reg_w) // RDP |
| 21 | AM_RANGE(0x04000000, 0x04000fff) AM_RAM AM_SHARE("dmem") // RSP DMEM |
| 22 | AM_RANGE(0x04001000, 0x04001fff) AM_RAM AM_SHARE("imem") // RSP IMEM |
| 23 | AM_RANGE(0x04040000, 0x040fffff) AM_DEVREADWRITE("rsp", n64_sp_reg_r, n64_sp_reg_w) // RSP |
| 24 | AM_RANGE(0x04100000, 0x041fffff) AM_DEVREADWRITE("rsp", n64_dp_reg_r, n64_dp_reg_w) // RDP |
| 46 | 25 | AM_RANGE(0x04300000, 0x043fffff) AM_READWRITE(n64_mi_reg_r, n64_mi_reg_w) // MIPS Interface |
| 47 | 26 | AM_RANGE(0x04400000, 0x044fffff) AM_READWRITE(n64_vi_reg_r, n64_vi_reg_w) // Video Interface |
| 48 | 27 | AM_RANGE(0x04500000, 0x045fffff) AM_READWRITE(n64_ai_reg_r, n64_ai_reg_w) // Audio Interface |
| r7226 | r7227 | |
| 58 | 37 | static ADDRESS_MAP_START( rsp_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 59 | 38 | AM_RANGE(0x00000000, 0x00000fff) AM_RAM AM_SHARE("dmem") |
| 60 | 39 | AM_RANGE(0x00001000, 0x00001fff) AM_RAM AM_SHARE("imem") |
| 61 | | AM_RANGE(0x04000000, 0x04000fff) AM_RAM AM_SHARE("dmem") |
| 62 | | AM_RANGE(0x04001000, 0x04001fff) AM_RAM AM_SHARE("imem") |
| 40 | AM_RANGE(0x04000000, 0x04000fff) AM_RAM AM_BASE(&rsp_dmem) AM_SHARE("dmem") |
| 41 | AM_RANGE(0x04001000, 0x04001fff) AM_RAM AM_BASE(&rsp_imem) AM_SHARE("imem") |
| 63 | 42 | ADDRESS_MAP_END |
| 64 | 43 | |
| 65 | 44 | static INPUT_PORTS_START( n64 ) |
| 66 | 45 | PORT_START("P1") |
| 67 | | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Button A") |
| 68 | | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Button B") |
| 69 | | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Button Z") |
| 70 | | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) PORT_NAME("Start") |
| 71 | | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad \xE2\x86\x91") /* Up */ |
| 72 | | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad \xE2\x86\x93") /* Down */ |
| 73 | | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad \xE2\x86\x90") /* Left */ |
| 74 | | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad \xE2\x86\x92") /* Right */ |
| 75 | | PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 76 | | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Button L") |
| 77 | | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("Button R") |
| 78 | | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME("Button C \xE2\x86\x91") /* Up */ |
| 79 | | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_PLAYER(1) PORT_NAME("Button C \xE2\x86\x93") /* Down */ |
| 80 | | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_PLAYER(1) PORT_NAME("Button C \xE2\x86\x90") /* Left */ |
| 81 | | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_PLAYER(1) PORT_NAME("Button C \xE2\x86\x92") /* Right */ |
| 46 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Button A") |
| 47 | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Button B") |
| 48 | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Button Z") |
| 49 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) PORT_NAME("Start") |
| 50 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Joypad \xE2\x86\x91") /* Up */ |
| 51 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Joypad \xE2\x86\x93") /* Down */ |
| 52 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Joypad \xE2\x86\x90") /* Left */ |
| 53 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Joypad \xE2\x86\x92") /* Right */ |
| 54 | PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 55 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Button L") |
| 56 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("Button R") |
| 57 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME("Button C \xE2\x86\x91") /* Up */ |
| 58 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_PLAYER(1) PORT_NAME("Button C \xE2\x86\x93") /* Down */ |
| 59 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_PLAYER(1) PORT_NAME("Button C \xE2\x86\x90") /* Left */ |
| 60 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_PLAYER(1) PORT_NAME("Button C \xE2\x86\x92") /* Right */ |
| 82 | 61 | |
| 83 | 62 | PORT_START("P1_ANALOG_X") |
| 84 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1) |
| 63 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1) |
| 85 | 64 | |
| 86 | 65 | PORT_START("P1_ANALOG_Y") |
| 87 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1) PORT_REVERSE |
| 66 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1) PORT_REVERSE |
| 88 | 67 | |
| 89 | 68 | PORT_START("P2") |
| 90 | | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("Button A") |
| 91 | | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("Button B") |
| 92 | | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Button Z") |
| 93 | | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2) PORT_NAME("Start") |
| 94 | | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x91") /* Up */ |
| 95 | | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x93") /* Down */ |
| 96 | | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x90") /* Left */ |
| 97 | | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x92") /* Right */ |
| 98 | | PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 99 | | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Button L") |
| 100 | | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("Button R") |
| 101 | | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x91") /* Up */ |
| 102 | | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x93") /* Down */ |
| 103 | | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x90") /* Left */ |
| 104 | | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x92") /* Right */ |
| 69 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("Button A") |
| 70 | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("Button B") |
| 71 | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Button Z") |
| 72 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2) PORT_NAME("Start") |
| 73 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x91") /* Up */ |
| 74 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x93") /* Down */ |
| 75 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x90") /* Left */ |
| 76 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_NAME("Joypad \xE2\x86\x92") /* Right */ |
| 77 | PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 78 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Button L") |
| 79 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("Button R") |
| 80 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x91") /* Up */ |
| 81 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x93") /* Down */ |
| 82 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x90") /* Left */ |
| 83 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_PLAYER(2) PORT_NAME("Button C \xE2\x86\x92") /* Right */ |
| 105 | 84 | |
| 106 | 85 | PORT_START("P2_ANALOG_X") |
| 107 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2) |
| 86 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2) |
| 108 | 87 | |
| 109 | 88 | PORT_START("P2_ANALOG_Y") |
| 110 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2) PORT_REVERSE |
| 89 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2) PORT_REVERSE |
| 111 | 90 | |
| 112 | 91 | INPUT_PORTS_END |
| 113 | 92 | |
| r7226 | r7227 | |
| 206 | 185 | MACHINE_DRIVER_END |
| 207 | 186 | |
| 208 | 187 | ROM_START( n64 ) |
| 209 | | ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASEFF ) /* dummy region for R4300 */ |
| 188 | ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASEFF ) /* dummy region for R4300 */ |
| 210 | 189 | |
| 211 | | ROM_REGION32_BE( 0x800, "user1", 0 ) |
| 212 | | ROM_LOAD( "pifdata.bin", 0x0000, 0x0800, CRC(5ec82be9) SHA1(9174eadc0f0ea2654c95fd941406ab46b9dc9bdd) ) |
| 190 | ROM_REGION32_BE( 0x800, "user1", 0 ) |
| 191 | ROM_LOAD( "pifdata.bin", 0x0000, 0x0800, CRC(5ec82be9) SHA1(9174eadc0f0ea2654c95fd941406ab46b9dc9bdd) ) |
| 213 | 192 | |
| 214 | | ROM_REGION32_BE( 0x4000000, "user2", ROMREGION_ERASEFF) |
| 193 | ROM_REGION32_BE( 0x4000000, "user2", ROMREGION_ERASEFF) |
| 215 | 194 | |
| 216 | 195 | ROM_REGION16_BE( 0x80, "normpoint", 0 ) |
| 217 | | ROM_LOAD( "normpnt.rom", 0x00, 0x80, CRC(e7f2a005) SHA1(c27b4a364a24daeee6e99fd286753fd6216362b4) ) |
| 196 | ROM_LOAD( "normpnt.rom", 0x00, 0x80, CRC(e7f2a005) SHA1(c27b4a364a24daeee6e99fd286753fd6216362b4) ) |
| 218 | 197 | |
| 219 | 198 | ROM_REGION16_BE( 0x80, "normslope", 0 ) |
| 220 | | ROM_LOAD( "normslp.rom", 0x00, 0x80, CRC(4f2ae525) SHA1(eab43f8cc52c8551d9cff6fced18ef80eaba6f05) ) |
| 199 | ROM_LOAD( "normslp.rom", 0x00, 0x80, CRC(4f2ae525) SHA1(eab43f8cc52c8551d9cff6fced18ef80eaba6f05) ) |
| 221 | 200 | ROM_END |
| 222 | 201 | |
| 223 | 202 | CONS(1996, n64, 0, 0, n64, n64, 0, "Nintendo", "Nintendo 64", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |