int pegasus_state::load_cart(device_image_interface &image, generic_slot_device *slot, const char *reg_tag) { UINT32 size = slot->common_get_size(reg_tag); bool any_socket = false; if (size > 0x1000) { image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); return IMAGE_INIT_FAIL; } if (image.software_entry() != NULL && size == 0) { // we might be loading a cart compatible with all sockets! // so try to get region "rom" size = slot->common_get_size("rom"); any_socket = true; if (size == 0) { astring errmsg; errmsg.printf("Attempted to load a file that does not work in this socket.\nPlease check \"Usage\" field in the software list for the correct socket(s) to use."); image.seterror(IMAGE_ERROR_UNSPECIFIED, errmsg.cstr()); return IMAGE_INIT_FAIL; } } slot->rom_alloc(0x1000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // we alloc 0x1000 also for smaller roms! slot->common_load_rom(slot->get_rom_base(), size, any_socket ? "rom" : reg_tag); // raw images have to be decrypted (in particular the ones from softlist) pegasus_decrypt_rom(slot->get_rom_base(), image.software_entry() != NULL); return IMAGE_INIT_PASS; }
DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_5 ) { image.fread(memregion("maincpu")->base() + 0xd000, 0x1000); pegasus_decrypt_rom( 0xd000 ); return IMAGE_INIT_PASS; }
static DEVICE_IMAGE_LOAD( pegasus_cart_5 ) { image.fread( image.device().machine().root_device().memregion("maincpu")->base() + 0xd000, 0x1000); pegasus_decrypt_rom( image.device().machine(), 0xd000 ); return IMAGE_INIT_PASS; }
DRIVER_INIT_MEMBER(pegasus_state, pegasus) { // decrypt monitor UINT8 *base = memregion("maincpu")->base() + 0xf000; pegasus_decrypt_rom(base, FALSE); }
DRIVER_INIT_MEMBER(pegasus_state,pegasus) { pegasus_decrypt_rom( 0xf000 ); }
static DRIVER_INIT( pegasus ) { pegasus_decrypt_rom( machine, 0xf000 ); }