src/mess/machine/nes.c
| r4889 | r4890 | |
| 124 | 124 | memory_install_read8_handler(space, 0xa000, 0xbfff, 0, 0, SMH_BANK(2)); |
| 125 | 125 | memory_install_read8_handler(space, 0xc000, 0xdfff, 0, 0, SMH_BANK(3)); |
| 126 | 126 | memory_install_read8_handler(space, 0xe000, 0xffff, 0, 0, SMH_BANK(4)); |
| 127 | memory_set_bankptr(machine, 1, memory_region(machine, "maincpu") + 0x6000); |
| 128 | memory_set_bankptr(machine, 2, memory_region(machine, "maincpu") + 0x8000); |
| 129 | memory_set_bankptr(machine, 3, memory_region(machine, "maincpu") + 0xa000); |
| 130 | memory_set_bankptr(machine, 4, memory_region(machine, "maincpu") + 0xc000); |
| 131 | memory_set_bankptr(machine, 5, memory_region(machine, "maincpu") + 0xe000); |
| 127 | 132 | |
| 128 | 133 | memory_install_write8_handler(space, 0x6000, 0x7fff, 0, 0, nes_mid_mapper_w); |
| 129 | 134 | memory_install_write8_handler(space, 0x8000, 0xffff, 0, 0, nes_mapper_w); |
src/mess/drivers/nes.c
| r4889 | r4890 | |
| 11 | 11 | Todo: Famicom driver has hardcoded famicom disk-system, needs removing and |
| 12 | 12 | adding as it's own driver. |
| 13 | 13 | |
| 14 | Most games don't work, possibly an issue with mappers? |
| 15 | |
| 14 | 16 | ***************************************************************************/ |
| 15 | 17 | |
| 16 | 18 | #include "driver.h" |
| r4889 | r4890 | |
| 250 | 252 | /* basic machine hardware */ |
| 251 | 253 | MDRV_CPU_ADD("maincpu", N2A03, NTSC_CLOCK) |
| 252 | 254 | MDRV_CPU_PROGRAM_MAP(nes_map) |
| 255 | |
| 256 | MDRV_DRIVER_DATA( nes_state ) |
| 257 | |
| 258 | MDRV_MACHINE_START( nes ) |
| 259 | MDRV_MACHINE_RESET( nes ) |
| 260 | |
| 253 | 261 | MDRV_SCREEN_ADD("screen", RASTER) |
| 254 | 262 | MDRV_SCREEN_REFRESH_RATE(60.098) |
| 255 | 263 | // This isn't used so much to calulate the vblank duration (the PPU code tracks that manually) but to determine |
| r4889 | r4890 | |
| 257 | 265 | // non-rendering scanlines, we compensate. This ends up being 2500 cycles for the non-rendering portion, 2273 |
| 258 | 266 | // cycles for the actual vblank period. |
| 259 | 267 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((113.66/(NTSC_CLOCK/1000000)) * (PPU_VBLANK_LAST_SCANLINE_NTSC-PPU_VBLANK_FIRST_SCANLINE+1+2))) |
| 260 | | |
| 261 | | MDRV_DRIVER_DATA( nes_state ) |
| 262 | | |
| 263 | | MDRV_MACHINE_START( nes ) |
| 264 | | MDRV_MACHINE_RESET( nes ) |
| 265 | | |
| 266 | 268 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 267 | 269 | MDRV_SCREEN_SIZE(32*8, 262) |
| 268 | 270 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) |
| r4889 | r4890 | |
| 278 | 280 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 279 | 281 | MDRV_SOUND_ADD("nessound", NES, NTSC_CLOCK) |
| 280 | 282 | MDRV_SOUND_CONFIG(nes_apu_interface) |
| 281 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 283 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) |
| 282 | 284 | |
| 283 | 285 | MDRV_CARTSLOT_ADD("cart") |
| 284 | 286 | MDRV_CARTSLOT_EXTENSION_LIST("nes") |
| r4889 | r4890 | |
| 305 | 307 | /* sound hardware */ |
| 306 | 308 | MDRV_SOUND_REPLACE("nessound", NES, PAL_CLOCK) |
| 307 | 309 | MDRV_SOUND_CONFIG(nes_apu_interface) |
| 308 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 310 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) |
| 309 | 311 | MACHINE_DRIVER_END |
| 310 | 312 | |
| 311 | 313 | static MACHINE_DRIVER_START( dendy ) |
| r4889 | r4890 | |
| 326 | 328 | /* sound hardware */ |
| 327 | 329 | MDRV_SOUND_REPLACE("nessound", NES, 26601712/15) /* 26.601712MHz / 15 == 1.77344746666... MHz */ |
| 328 | 330 | MDRV_SOUND_CONFIG(nes_apu_interface) |
| 329 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 331 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) |
| 330 | 332 | MACHINE_DRIVER_END |
| 331 | 333 | |
| 332 | 334 | static MACHINE_DRIVER_START( famicom ) |
| r4889 | r4890 | |
| 372 | 374 | ***************************************************************************/ |
| 373 | 375 | |
| 374 | 376 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 375 | | CONS( 1983, famicom, 0, 0, famicom, famicom, 0, famicom, "Nintendo", "Famicom" , GAME_NOT_WORKING) |
| 376 | | CONS( 1986, famitwin, famicom, 0, famicom, famicom, 0, famicom, "Sharp", "Famicom Twin" , GAME_NOT_WORKING) |
| 377 | | CONS( 1985, nes, famicom, 0, nes, nes, 0, 0, "Nintendo", "Nintendo Entertainment System (NTSC)" , GAME_NOT_WORKING) |
| 378 | | CONS( 1987, nespal, famicom, 0, nespal, nes, 0, 0, "Nintendo", "Nintendo Entertainment System (PAL)" , GAME_NOT_WORKING) |
| 379 | | CONS( 199?, dendy, famicom, 0, dendy, nes, 0, 0, "Steepler", "Dendy Classic" , GAME_NOT_WORKING) |
| 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 ) |
| 380 | 382 | |