Previous 15994 Revisions Next

r6814 Tuesday 29th December, 2009 at 14:57:05 UTC by Miodrag Milanović
[NES] Made famicom disk and twin disk able to use carts again and drpcjr fixed port error
[src/mess/drivers]nes.c
[src/mess/includes]nes.h
[src/mess/machine]nes.c

src/mess/includes/nes.h
r6813r6814
9696MACHINE_START( nes );
9797MACHINE_RESET( nes );
9898
99MACHINE_START( famicom );
10099DRIVER_INIT( famicom );
101100
102101READ8_HANDLER( nes_IN0_r );
src/mess/machine/nes.c
r6813r6814
927927
928928static void nes_load_proc(const device_config *image)
929929{
930   nes_fds.sides = 0;   
931   
930932   image_fseek(image, 0, SEEK_END);
931933   nes_fds.sides = (image_ftell(image) - 16) / 65500;
932   nes_fds.data = image_realloc(image, nes_fds.data, nes_fds.sides * 65500);
934   nes_fds.data = image_malloc(image, nes_fds.sides * 65500);
933935   image_fseek(image, 0x10, SEEK_SET);
934936   image_fread(image, nes_fds.data, 65500 * nes_fds.sides);
935937   return;
r6813r6814
939941{
940942   /* TODO: should write out changes here as well */
941943   nes_fds.sides =  0;
942   nes_fds.data = NULL;
944   image_freeptr(image,nes_fds.data);
943945}
944946
945947DRIVER_INIT( famicom)
946948{   
947   nes_fds.sides = 0;
948   nes_fds.data = NULL;
949   
950   floppy_install_load_proc(floppy_get_device(machine,0), nes_load_proc);
951   floppy_install_unload_proc(floppy_get_device(machine,0), nes_unload_proc);
952}
953
954MACHINE_START( famicom )
955{   
956949   /* clear some of the cart variables we don't use */
957950   nes.trainer = 0;
958951   nes.battery = 0;
r6813r6814
964957   nes.four_screen_vram = 0;
965958   nes.hard_mirroring = 0;
966959
967   nes_fds.sides = 0;   
968   MACHINE_START_CALL( nes );
960   nes_fds.sides = 0;
961   nes_fds.data = NULL;
962   
963   floppy_install_load_proc(floppy_get_device(machine,0), nes_load_proc);
964   floppy_install_unload_proc(floppy_get_device(machine,0), nes_unload_proc);
969965}
src/mess/drivers/nes.c
r6813r6814
282282
283283static MACHINE_DRIVER_START( famicom )
284284   MDRV_IMPORT_FROM( nes )
285   MDRV_MACHINE_START( famicom )
286285
287286   MDRV_CARTSLOT_MODIFY("cart")
288287   MDRV_CARTSLOT_EXTENSION_LIST("nes,unf")
r6813r6814
408407CONS( 1983, famicom,   nes,    0,     famicom,  famicom, famicom,"Nintendo",  "Famicom Disk System", GAME_IMPERFECT_GRAPHICS )
409408CONS( 1986, famitwin,  nes,    0,     famicom,  famicom, famicom,"Sharp",     "Famicom Twin", GAME_IMPERFECT_GRAPHICS )
410409CONS( 198?, m82,       nes,    0,     nes,      nes,     0,      "Nintendo",  "M82 Display Unit", GAME_IMPERFECT_GRAPHICS )
411CONS( 1996, drpcjr,    nes,    0,     famicom,  nes,     0,      "Bung",      "Doctor PC Jr", GAME_IMPERFECT_GRAPHICS )
410CONS( 1996, drpcjr,    nes,    0,     famicom,  famicom, famicom,"Bung",      "Doctor PC Jr", GAME_IMPERFECT_GRAPHICS )
412411CONS( 199?, dendy,     nes,    0,     dendy,    nes,     0,      "Steepler",  "Dendy Classic", GAME_IMPERFECT_GRAPHICS )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team