src/mess/drivers/nes.c
| r4895 | r4896 | |
| 8 | 8 | Based in part on the old xNes code, by Nicolas Hamel, Chuck Mason, Brad Oliver, |
| 9 | 9 | Richard Bannister and Jeff Mitchell. |
| 10 | 10 | |
| 11 | | Todo: Famicom driver has hardcoded famicom disk-system, needs removing and |
| 12 | | adding as it's own driver. |
| 13 | | |
| 14 | | Most games don't work, possibly an issue with mappers? |
| 15 | | |
| 16 | 11 | ***************************************************************************/ |
| 17 | 12 | |
| 18 | 13 | #include "driver.h" |
| r4895 | r4896 | |
| 173 | 168 | }; |
| 174 | 169 | |
| 175 | 170 | |
| 176 | | ROM_START( nes ) |
| 177 | | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 178 | | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 179 | | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 180 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 181 | | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 182 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 183 | | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 184 | | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 185 | | ROM_END |
| 186 | | |
| 187 | | ROM_START( nespal ) |
| 188 | | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 189 | | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 190 | | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 191 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 192 | | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 193 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 194 | | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 195 | | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 196 | | ROM_END |
| 197 | | |
| 198 | | ROM_START( famicom ) |
| 199 | | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 200 | | ROM_LOAD_OPTIONAL ("disksys.rom", 0xe000, 0x2000, CRC(5e607dcf) SHA1(57fe1bdee955bb48d357e463ccbf129496930b62)) |
| 201 | | |
| 202 | | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 203 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 204 | | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 205 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 206 | | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 207 | | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 208 | | ROM_END |
| 209 | | |
| 210 | | ROM_START( famitwin ) |
| 211 | | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 212 | | ROM_LOAD_OPTIONAL ("disksyst.rom", 0xe000, 0x2000, CRC(4df24a6c) SHA1(e4e41472c454f928e53eb10e0509bf7d1146ecc1)) |
| 213 | | |
| 214 | | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 215 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 216 | | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 217 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 218 | | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 219 | | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 220 | | ROM_END |
| 221 | | |
| 222 | | ROM_START( dendy ) |
| 223 | | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 224 | | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 225 | | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 226 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 227 | | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 228 | | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 229 | | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 230 | | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 231 | | ROM_END |
| 232 | | |
| 233 | | |
| 234 | 171 | static void ppu_nmi(const device_config *device, int *ppu_regs) |
| 235 | 172 | { |
| 236 | 173 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); |
| r4895 | r4896 | |
| 341 | 278 | MDRV_CARTSLOT_PARTIALHASH(nes_partialhash) |
| 342 | 279 | MACHINE_DRIVER_END |
| 343 | 280 | |
| 281 | |
| 282 | ROM_START( nes ) |
| 283 | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 284 | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 285 | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 286 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 287 | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 288 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 289 | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 290 | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 291 | ROM_END |
| 292 | |
| 293 | ROM_START( nespal ) |
| 294 | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 295 | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 296 | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 297 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 298 | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 299 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 300 | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 301 | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 302 | ROM_END |
| 303 | |
| 304 | ROM_START( famicom ) |
| 305 | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 306 | ROM_LOAD_OPTIONAL ("disksys.rom", 0xe000, 0x2000, CRC(5e607dcf) SHA1(57fe1bdee955bb48d357e463ccbf129496930b62)) |
| 307 | |
| 308 | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 309 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 310 | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 311 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 312 | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 313 | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 314 | ROM_END |
| 315 | |
| 316 | ROM_START( famitwin ) |
| 317 | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 318 | ROM_LOAD_OPTIONAL ("disksyst.rom", 0xe000, 0x2000, CRC(4df24a6c) SHA1(e4e41472c454f928e53eb10e0509bf7d1146ecc1)) |
| 319 | |
| 320 | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 321 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 322 | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 323 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 324 | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 325 | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 326 | ROM_END |
| 327 | |
| 328 | ROM_START( m82 ) |
| 329 | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 330 | ROM_LOAD_OPTIONAL ("m82_v1_0.bin", 0xe000, 0x2000, CRC(7d56840a) SHA1(cbd2d14fa073273ba58367758f40d67fd8a9106d)) |
| 331 | |
| 332 | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 333 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 334 | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 335 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 336 | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 337 | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 338 | ROM_END |
| 339 | |
| 340 | ROM_START( dendy ) |
| 341 | ROM_REGION( 0x10000, "maincpu",0 ) /* Main RAM + program banks */ |
| 342 | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 343 | ROM_REGION( 0x2000, "gfx1",0 ) /* VROM */ |
| 344 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 345 | ROM_REGION( 0x2000, "gfx2",0 ) /* VRAM */ |
| 346 | ROM_FILL( 0x0000, 0x2000, 0x00 ) |
| 347 | ROM_REGION( 0x10000, "user1",0 ) /* WRAM */ |
| 348 | ROM_FILL( 0x0000, 0x10000, 0x00 ) |
| 349 | ROM_END |
| 350 | |
| 351 | |
| 344 | 352 | static void famicom_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 345 | 353 | { |
| 346 | 354 | /* floppy */ |
| r4895 | r4896 | |
| 349 | 357 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 350 | 358 | case MESS_DEVINFO_INT_TYPE: info->i = IO_FLOPPY; break; |
| 351 | 359 | case MESS_DEVINFO_INT_READABLE: info->i = 1; break; |
| 352 | | case MESS_DEVINFO_INT_WRITEABLE: info->i = 0; break; |
| 353 | | case MESS_DEVINFO_INT_CREATABLE: info->i = 0; break; |
| 354 | | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 360 | case MESS_DEVINFO_INT_WRITEABLE: info->i = 0; break; |
| 361 | case MESS_DEVINFO_INT_CREATABLE: info->i = 0; break; |
| 362 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 355 | 363 | |
| 356 | 364 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 357 | | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(nes_disk); break; |
| 365 | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(nes_disk); break; |
| 358 | 366 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(nes_disk); break; |
| 359 | 367 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(nes_disk); break; |
| 360 | 368 | |
| r4895 | r4896 | |
| 373 | 381 | |
| 374 | 382 | ***************************************************************************/ |
| 375 | 383 | |
| 376 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 377 | | CONS( 1983, famicom, 0, 0, famicom, famicom, 0, famicom, "Nintendo", "Famicom" , 0 ) |
| 378 | | CONS( 1986, famitwin, famicom, 0, famicom, famicom, 0, famicom, "Sharp", "Famicom Twin" , 0 ) |
| 379 | | CONS( 1985, nes, famicom, 0, nes, nes, 0, 0, "Nintendo", "Nintendo Entertainment System (NTSC)" , 0 ) |
| 380 | | CONS( 1987, nespal, famicom, 0, nespal, nes, 0, 0, "Nintendo", "Nintendo Entertainment System (PAL)" , 0 ) |
| 381 | | CONS( 199?, dendy, famicom, 0, dendy, nes, 0, 0, "Steepler", "Dendy Classic" , 0 ) |
| 384 | /* Since 0.130u4, most of the games do not show graphics correctly. Conversion of PPU to a device showed some of the |
| 385 | limitations of the previous implementation. Systems regressed to GAME_NOT_WORKING status until a proper fix is found */ |
| 382 | 386 | |
| 387 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 388 | CONS( 1985, nes, 0, 0, nes, nes, 0, 0, "Nintendo", "Nintendo Entertainment System / Famicom (NTSC)", GAME_NOT_WORKING ) |
| 389 | CONS( 1987, nespal, nes, 0, nespal, nes, 0, 0, "Nintendo", "Nintendo Entertainment System (PAL)", GAME_NOT_WORKING ) |
| 390 | CONS( 1983, famicom, nes, 0, famicom, famicom, 0, famicom, "Nintendo", "Famicom Disk System", GAME_NOT_WORKING ) |
| 391 | CONS( 1986, famitwin, nes, 0, famicom, famicom, 0, famicom, "Sharp", "Famicom Twin", GAME_NOT_WORKING ) |
| 392 | CONS( 198?, m82, nes, 0, nes, nes, 0, 0, "Nintendo", "M82 Display Unit", GAME_NOT_WORKING ) |
| 393 | CONS( 199?, dendy, nes, 0, dendy, nes, 0, 0, "Steepler", "Dendy Classic", GAME_NOT_WORKING ) |