src/mess/devices/aescart.c
| r6970 | r6971 | |
| 414 | 414 | static DEVICE_IMAGE_LOAD( aes_cartridge ) |
| 415 | 415 | { |
| 416 | 416 | const device_config *pcbdev = cartslot_get_pcb(image); |
| 417 | | int result; |
| 417 | aes_pcb_t *pcb; |
| 418 | cartslot_t *cart; |
| 419 | multicart_open_error me; |
| 418 | 420 | |
| 419 | | if (pcbdev != NULL) |
| 420 | | { |
| 421 | | /* If we are here, we have a multicart. */ |
| 422 | | aes_pcb_t *pcb = (aes_pcb_t *)pcbdev->token; |
| 423 | | cartslot_t *cart = (cartslot_t *)image->token; |
| 421 | if (pcbdev == NULL) |
| 422 | fatalerror("Error loading multicart: no pcb found.\n"); |
| 424 | 423 | |
| 425 | | /* try opening this as a multicart */ |
| 426 | | /* This line requires that cartslot_t be included in cartslot.h, |
| 427 | | otherwise one cannot make use of multicart handling within such a |
| 428 | | custom LOAD function. */ |
| 429 | | multicart_open_error me = multicart_open(image_filename(image), image->machine->gamedrv->name, MULTICART_FLAGS_LOAD_RESOURCES, &cart->mc); |
| 424 | /* If we are here, we have a multicart. */ |
| 425 | pcb = (aes_pcb_t *)pcbdev->token; |
| 426 | cart = (cartslot_t *)image->token; |
| 430 | 427 | |
| 431 | | /* Now that we have loaded the image files, let the PCB put them all |
| 432 | | together. This means we put the images in a structure which allows |
| 433 | | for a quick access by the memory handlers. Every PCB defines an |
| 434 | | own assembly method. */ |
| 435 | | if (me == MCERR_NONE) |
| 436 | | result = pcb->assemble(pcbdev->machine, image); |
| 437 | | else |
| 438 | | fatalerror("Error loading multicart: %s\n", multicart_error_text(me)); |
| 439 | | } |
| 440 | | else |
| 441 | | { |
| 442 | | fatalerror("Error loading multicart: no pcb found.\n"); |
| 443 | | } |
| 444 | | return result; |
| 428 | /* try opening this as a multicart */ |
| 429 | /* This line requires that cartslot_t be included in cartslot.h, |
| 430 | otherwise one cannot make use of multicart handling within such a |
| 431 | custom LOAD function. */ |
| 432 | me = multicart_open(image_filename(image), image->machine->gamedrv->name, MULTICART_FLAGS_LOAD_RESOURCES, &cart->mc); |
| 433 | |
| 434 | /* Now that we have loaded the image files, let the PCB put them all |
| 435 | together. This means we put the images in a structure which allows |
| 436 | for a quick access by the memory handlers. Every PCB defines an |
| 437 | own assembly method. */ |
| 438 | if (me != MCERR_NONE) |
| 439 | fatalerror("Error loading multicart: %s\n", multicart_error_text(me)); |
| 440 | |
| 441 | return pcb->assemble(pcbdev->machine, image); |
| 445 | 442 | } |
| 446 | 443 | |
| 447 | 444 | /* |
| r6970 | r6971 | |
| 527 | 524 | } |
| 528 | 525 | |
| 529 | 526 | static MACHINE_DRIVER_START(aes_multicart) |
| 530 | | MDRV_CARTSLOT_ADD("cartridge1") |
| 527 | MDRV_CARTSLOT_ADD("cartridge1") |
| 531 | 528 | MDRV_CARTSLOT_EXTENSION_LIST("rpk,bin") |
| 532 | 529 | MDRV_CARTSLOT_PCBTYPE(0, "none", AES_CARTRIDGE_PCB_NONE) |
| 533 | 530 | MDRV_CARTSLOT_PCBTYPE(1, "standard", AES_CARTRIDGE_PCB_STD) |