src/mess/machine/nes.c
| r6813 | r6814 | |
| 927 | 927 | |
| 928 | 928 | static void nes_load_proc(const device_config *image) |
| 929 | 929 | { |
| 930 | nes_fds.sides = 0; |
| 931 | |
| 930 | 932 | image_fseek(image, 0, SEEK_END); |
| 931 | 933 | 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); |
| 933 | 935 | image_fseek(image, 0x10, SEEK_SET); |
| 934 | 936 | image_fread(image, nes_fds.data, 65500 * nes_fds.sides); |
| 935 | 937 | return; |
| r6813 | r6814 | |
| 939 | 941 | { |
| 940 | 942 | /* TODO: should write out changes here as well */ |
| 941 | 943 | nes_fds.sides = 0; |
| 942 | | nes_fds.data = NULL; |
| 944 | image_freeptr(image,nes_fds.data); |
| 943 | 945 | } |
| 944 | 946 | |
| 945 | 947 | DRIVER_INIT( famicom) |
| 946 | 948 | { |
| 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 | | |
| 954 | | MACHINE_START( famicom ) |
| 955 | | { |
| 956 | 949 | /* clear some of the cart variables we don't use */ |
| 957 | 950 | nes.trainer = 0; |
| 958 | 951 | nes.battery = 0; |
| r6813 | r6814 | |
| 964 | 957 | nes.four_screen_vram = 0; |
| 965 | 958 | nes.hard_mirroring = 0; |
| 966 | 959 | |
| 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); |
| 969 | 965 | } |
src/mess/drivers/nes.c
| r6813 | r6814 | |
| 282 | 282 | |
| 283 | 283 | static MACHINE_DRIVER_START( famicom ) |
| 284 | 284 | MDRV_IMPORT_FROM( nes ) |
| 285 | | MDRV_MACHINE_START( famicom ) |
| 286 | 285 | |
| 287 | 286 | MDRV_CARTSLOT_MODIFY("cart") |
| 288 | 287 | MDRV_CARTSLOT_EXTENSION_LIST("nes,unf") |
| r6813 | r6814 | |
| 408 | 407 | CONS( 1983, famicom, nes, 0, famicom, famicom, famicom,"Nintendo", "Famicom Disk System", GAME_IMPERFECT_GRAPHICS ) |
| 409 | 408 | CONS( 1986, famitwin, nes, 0, famicom, famicom, famicom,"Sharp", "Famicom Twin", GAME_IMPERFECT_GRAPHICS ) |
| 410 | 409 | CONS( 198?, m82, nes, 0, nes, nes, 0, "Nintendo", "M82 Display Unit", GAME_IMPERFECT_GRAPHICS ) |
| 411 | | CONS( 1996, drpcjr, nes, 0, famicom, nes, 0, "Bung", "Doctor PC Jr", GAME_IMPERFECT_GRAPHICS ) |
| 410 | CONS( 1996, drpcjr, nes, 0, famicom, famicom, famicom,"Bung", "Doctor PC Jr", GAME_IMPERFECT_GRAPHICS ) |
| 412 | 411 | CONS( 199?, dendy, nes, 0, dendy, nes, 0, "Steepler", "Dendy Classic", GAME_IMPERFECT_GRAPHICS ) |