address_map::address_map(device_t &device, address_spacenum spacenum) : m_spacenum(spacenum), m_databits(0xff), m_unmapval(0), m_globalmask(0) { // get our memory interface const device_memory_interface *memintf; if (!device.interface(memintf)) throw emu_fatalerror("No memory interface defined for device '%s'\n", device.tag()); // and then the configuration for the current address space const address_space_config *spaceconfig = memintf->space_config(spacenum); if (!device.interface(memintf)) throw emu_fatalerror("No memory address space configuration found for device '%s', space %d\n", device.tag(), spacenum); // append the internal device map (first so it takes priority) */ if (spaceconfig->m_internal_map != NULL) (*spaceconfig->m_internal_map)(*this, device); // construct the standard map */ if (memintf->address_map(spacenum) != NULL) (*memintf->address_map(spacenum))(*this, *device.owner()); // append the default device map (last so it can be overridden) */ if (spaceconfig->m_default_map != NULL) (*spaceconfig->m_default_map)(*this, device); }
address_map::address_map(device_t &device, address_spacenum spacenum) : m_spacenum(spacenum), m_databits(0xff), m_unmapval(0), m_globalmask(0) { // get our memory interface const device_memory_interface *memintf; if (!device.interface(memintf)) throw emu_fatalerror("No memory interface defined for device '%s'\n", device.tag()); // and then the configuration for the current address space const address_space_config *spaceconfig = memintf->space_config(spacenum); if (!device.interface(memintf)) throw emu_fatalerror("No memory address space configuration found for device '%s', space %d\n", device.tag(), spacenum); // construct the internal device map (first so it takes priority) if (spaceconfig->m_internal_map != NULL) (*spaceconfig->m_internal_map)(*this, device); if (!spaceconfig->m_internal_map_delegate.isnull()) spaceconfig->m_internal_map_delegate(*this, device); // append the map provided by the owner if (memintf->address_map(spacenum) != NULL) (*memintf->address_map(spacenum))(*this, *device.owner()); else { // if the owner didn't provide a map, use the default device map if (spaceconfig->m_default_map != NULL) (*spaceconfig->m_default_map)(*this, device); if (!spaceconfig->m_default_map_delegate.isnull()) spaceconfig->m_default_map_delegate(*this, device); } }
void device_execute_interface::static_set_disable(device_t &device) { device_execute_interface *exec; if (!device.interface(exec)) throw emu_fatalerror("MCFG_DEVICE_DISABLE called on device '%s' with no execute interface", device.tag()); exec->m_disabled = true; }
void device_execute_interface::static_set_irq_acknowledge_callback(device_t &device, device_irq_acknowledge_delegate callback) { device_execute_interface *exec; if (!device.interface(exec)) throw emu_fatalerror("MCFG_DEVICE_IRQ_ACKNOWLEDGE called on device '%s' with no execute interface", device.tag()); exec->m_driver_irq = callback; }
void device_disasm_interface::static_set_dasm_override(device_t &device, dasm_override_delegate dasm_override) { device_disasm_interface *dasm; if (!device.interface(dasm)) throw emu_fatalerror("MCFG_DEVICE_DISASSEMBLE_OVERRIDE called on device '%s' with no disasm interface", device.tag()); dasm->m_dasm_override = dasm_override; }
//------------------------------------------------- // static_set_daisy_config - configuration helper // to set up the daisy chain //------------------------------------------------- void z80_daisy_chain_interface::static_set_daisy_config(device_t &device, const z80_daisy_config *config) { z80_daisy_chain_interface *daisyintf; if (!device.interface(daisyintf)) throw emu_fatalerror("MCFG_Z80_DAISY_CHAIN called on device '%s' with no daisy chain interface", device.tag()); daisyintf->m_daisy_config = config; }
void device_video_interface::static_set_screen(device_t &device, const char *tag) { // find our video interface device_video_interface *video; if (!device.interface(video)) throw emu_fatalerror("MCFG_VIDEO_SET_SCREEN called on device '%s' with no video interface", device.tag()); video->m_screen_tag = tag; }
void device_execute_interface::static_set_periodic_int(device_t &device, device_interrupt_delegate function, const attotime &rate) { device_execute_interface *exec; if (!device.interface(exec)) throw emu_fatalerror("MCFG_DEVICE_PERIODIC_INT called on device '%s' with no execute interface", device.tag()); exec->m_timed_interrupt = function; exec->m_timed_interrupt_period = rate; }
void device_execute_interface::static_set_vblank_int(device_t &device, device_interrupt_delegate function, const char *tag, int rate) { device_execute_interface *exec; if (!device.interface(exec)) throw emu_fatalerror("MCFG_DEVICE_VBLANK_INT called on device '%s' with no execute interface", device.tag()); exec->m_vblank_interrupt = function; exec->m_vblank_interrupt_screen = tag; }
void device_gfx_interface::static_set_info(device_t &device, const gfx_decode_entry *gfxinfo) { device_gfx_interface *gfx; if (!device.interface(gfx)) throw emu_fatalerror("MCFG_GFX_INFO called on device '%s' with no gfx interface\n", device.tag()); gfx->m_gfxdecodeinfo = gfxinfo; }
void device_memory_interface::static_set_addrmap(device_t &device, address_spacenum spacenum, address_map_constructor map) { device_memory_interface *memory; if (!device.interface(memory)) throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called on device '%s' with no memory interface", device.tag()); if (spacenum >= ARRAY_LENGTH(memory->m_address_map)) throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called on device '%s' with out-of-range space number %d", device.tag(), spacenum); memory->m_address_map[spacenum] = map; }
void device_gfx_interface::static_set_palette(device_t &device, const char *tag) { device_gfx_interface *gfx; if (!device.interface(gfx)) throw emu_fatalerror("MCFG_GFX_PALETTE called on device '%s' with no gfx interface\n", device.tag()); gfx->m_palette_tag = tag; gfx->m_palette_is_sibling = true; }
void device_slot_interface::static_set_slot_info(device_t &device, const slot_interface *slots_info, const char *default_card, bool fixed) { device_slot_interface *slot; if (!device.interface(slot)) throw emu_fatalerror("set_default_slot_card called on device '%s' with no slot interface", device.tag()); slot->m_slot_interfaces = slots_info; slot->m_default_card = default_card; slot->m_fixed = fixed; }
void device_sound_interface::static_reset_routes(device_t &device) { // find our sound interface device_sound_interface *sound; if (!device.interface(sound)) throw emu_fatalerror("MCFG_SOUND_ROUTES_RESET called on device '%s' with no sound interface", device.tag()); // reset the routine list sound->m_route_list.reset(); }
void device_slot_interface::static_set_slot_info(device_t &device, const slot_interface *slots_info, const char *default_card,const input_device_default *default_input, const void *default_config, UINT32 default_clock, bool fixed) { device_slot_interface *slot; if (!device.interface(slot)) throw emu_fatalerror("set_default_slot_card called on device '%s' with no slot interface", device.tag()); slot->m_slot_interfaces = slots_info; slot->m_default_card = default_card; slot->m_input_defaults = default_input; slot->m_default_config = default_config; slot->m_default_clock = default_clock; slot->m_fixed = fixed; }