src/mess/drivers/pv2000.c
| r8530 | r8531 | |
| 372 | 372 | memset(&memory_region(machine, "maincpu")[0x7000], 0xff, 0x1000); // initialize RAM |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | static DEVICE_IMAGE_LOAD( pv2000_cart ) |
| 376 | { |
| 377 | UINT8 *cart = memory_region(image.device().machine, "maincpu") + 0xC000; |
| 378 | UINT32 size; |
| 375 | 379 | |
| 380 | if (image.software_entry() == NULL) |
| 381 | size = image.length(); |
| 382 | else |
| 383 | size = image.get_software_region_length("rom"); |
| 384 | |
| 385 | if (size != 0x2000 && size != 0x4000) |
| 386 | { |
| 387 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); |
| 388 | return IMAGE_INIT_FAIL; |
| 389 | } |
| 390 | |
| 391 | if (image.software_entry() == NULL) |
| 392 | { |
| 393 | if (image.fread( cart, size) != size) |
| 394 | { |
| 395 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file"); |
| 396 | return IMAGE_INIT_FAIL; |
| 397 | } |
| 398 | } |
| 399 | else |
| 400 | memcpy(cart, image.get_software_region("rom"), size); |
| 401 | |
| 402 | return IMAGE_INIT_PASS; |
| 403 | } |
| 404 | |
| 376 | 405 | static const cassette_config pv2000_cassette_config = |
| 377 | 406 | { |
| 378 | 407 | cassette_default_formats, |
| r8530 | r8531 | |
| 413 | 442 | MDRV_CARTSLOT_ADD("cart") |
| 414 | 443 | MDRV_CARTSLOT_EXTENSION_LIST("rom,col,bin") |
| 415 | 444 | MDRV_CARTSLOT_NOT_MANDATORY |
| 445 | MDRV_CARTSLOT_LOAD(pv2000_cart) |
| 446 | MDRV_CARTSLOT_INTERFACE("pv2000_cart") |
| 447 | |
| 448 | /* Software lists */ |
| 449 | MDRV_SOFTWARE_LIST_ADD("cart_list","pv2000") |
| 416 | 450 | MACHINE_DRIVER_END |
| 417 | 451 | |
| 418 | 452 | |