Previous 15994 Revisions Next

r4890 Sunday 31st May, 2009 at 02:54:48 UTC by Robbbert
[NES] Fixed crash.
[src/mess/drivers]nes.c
[src/mess/machine]nes.c

src/mess/machine/nes.c
r4889r4890
124124         memory_install_read8_handler(space, 0xa000, 0xbfff, 0, 0, SMH_BANK(2));
125125         memory_install_read8_handler(space, 0xc000, 0xdfff, 0, 0, SMH_BANK(3));
126126         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);
127132
128133         memory_install_write8_handler(space, 0x6000, 0x7fff, 0, 0, nes_mid_mapper_w);
129134         memory_install_write8_handler(space, 0x8000, 0xffff, 0, 0, nes_mapper_w);
src/mess/drivers/nes.c
r4889r4890
1111  Todo: Famicom driver has hardcoded famicom disk-system, needs removing and
1212        adding as it's own driver.
1313
14   Most games don't work, possibly an issue with mappers?
15
1416***************************************************************************/
1517
1618#include "driver.h"
r4889r4890
250252   /* basic machine hardware */
251253   MDRV_CPU_ADD("maincpu", N2A03, NTSC_CLOCK)
252254   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
253261   MDRV_SCREEN_ADD("screen", RASTER)
254262   MDRV_SCREEN_REFRESH_RATE(60.098)
255263   // This isn't used so much to calulate the vblank duration (the PPU code tracks that manually) but to determine
r4889r4890
257265   // non-rendering scanlines, we compensate. This ends up being 2500 cycles for the non-rendering portion, 2273
258266   // cycles for the actual vblank period.
259267   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
266268   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
267269   MDRV_SCREEN_SIZE(32*8, 262)
268270   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
r4889r4890
278280   MDRV_SPEAKER_STANDARD_MONO("mono")
279281   MDRV_SOUND_ADD("nessound", NES, NTSC_CLOCK)
280282   MDRV_SOUND_CONFIG(nes_apu_interface)
281   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
283   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
282284   
283285   MDRV_CARTSLOT_ADD("cart")
284286   MDRV_CARTSLOT_EXTENSION_LIST("nes")
r4889r4890
305307    /* sound hardware */
306308   MDRV_SOUND_REPLACE("nessound", NES, PAL_CLOCK)
307309   MDRV_SOUND_CONFIG(nes_apu_interface)
308   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
310   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
309311MACHINE_DRIVER_END
310312
311313static MACHINE_DRIVER_START( dendy )
r4889r4890
326328    /* sound hardware */
327329   MDRV_SOUND_REPLACE("nessound", NES, 26601712/15) /* 26.601712MHz / 15 == 1.77344746666... MHz */
328330   MDRV_SOUND_CONFIG(nes_apu_interface)
329   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
331   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
330332MACHINE_DRIVER_END
331333
332334static MACHINE_DRIVER_START( famicom )
r4889r4890
372374***************************************************************************/
373375
374376/*     YEAR  NAME      PARENT    COMPAT MACHINE   INPUT     INIT      CONFIG    COMPANY      FULLNAME */
375CONS( 1983, famicom,   0,        0,   famicom,  famicom,  0,         famicom,   "Nintendo",   "Famicom" , GAME_NOT_WORKING)
376CONS( 1986, famitwin,  famicom,  0,   famicom,  famicom,  0,         famicom,   "Sharp",   "Famicom Twin" , GAME_NOT_WORKING)
377CONS( 1985, nes,       famicom,  0,   nes,      nes,      0,        0,   "Nintendo",   "Nintendo Entertainment System (NTSC)" , GAME_NOT_WORKING)
378CONS( 1987, nespal,    famicom,  0,   nespal,   nes,      0,         0,   "Nintendo",   "Nintendo Entertainment System (PAL)" , GAME_NOT_WORKING)
379CONS( 199?, dendy,     famicom,  0,   dendy,    nes,      0,        0,   "Steepler",   "Dendy Classic" , GAME_NOT_WORKING)
377CONS( 1983, famicom,   0,        0,   famicom,  famicom,  0,         famicom,   "Nintendo",   "Famicom" , 0 )
378CONS( 1986, famitwin,  famicom,  0,   famicom,  famicom,  0,         famicom,   "Sharp",   "Famicom Twin" , 0 )
379CONS( 1985, nes,       famicom,  0,   nes,      nes,      0,        0,   "Nintendo",   "Nintendo Entertainment System (NTSC)" , 0 )
380CONS( 1987, nespal,    famicom,  0,   nespal,   nes,      0,         0,   "Nintendo",   "Nintendo Entertainment System (PAL)" , 0 )
381CONS( 199?, dendy,     famicom,  0,   dendy,    nes,      0,        0,   "Steepler",   "Dendy Classic" , 0 )
380382

Previous 15994 Revisions Next


© 1998-2018 The MESS Team