void nubus_mac8390_device::device_start() { uint32_t slotspace; char mac[7]; uint32_t num = rand(); memset(m_prom, 0x57, 16); sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); mac[0] = mac[1] = 0; // avoid gcc warning memcpy(m_prom, mac, 6); m_dp83902->set_mac(mac); // set_nubus_device makes m_slot valid set_nubus_device(); install_declaration_rom(this, MAC8390_ROM_REGION, true); slotspace = get_slotspace(); // printf("[ASNTMC3NB %p] slotspace = %x\n", this, slotspace); // TODO: move 24-bit mirroring down into nubus.c uint32_t ofs_24bit = m_slot<<20; m_nubus->install_device(slotspace+0xd0000, slotspace+0xdffff, read8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_r), this), write8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_w), this)); m_nubus->install_device(slotspace+0xe0000, slotspace+0xe003f, read32_delegate(FUNC(nubus_mac8390_device::en_r), this), write32_delegate(FUNC(nubus_mac8390_device::en_w), this)); m_nubus->install_device(slotspace+0xd0000+ofs_24bit, slotspace+0xdffff+ofs_24bit, read8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_r), this), write8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_w), this)); m_nubus->install_device(slotspace+0xe0000+ofs_24bit, slotspace+0xe003f+ofs_24bit, read32_delegate(FUNC(nubus_mac8390_device::en_r), this), write32_delegate(FUNC(nubus_mac8390_device::en_w), this)); }
DRIVER_INIT_MEMBER(starwars_state,esb) { UINT8 *rom = memregion("maincpu")->base(); /* init the slapstic */ m_slapstic_device->slapstic_init(machine(), 101); m_slapstic_source = &rom[0x14000]; m_slapstic_base = &rom[0x08000]; /* install an opcode base handler */ address_space &space = m_maincpu->space(AS_PROGRAM); space.set_direct_update_handler(direct_update_delegate(FUNC(starwars_state::esb_setdirect), this)); /* install read/write handlers for it */ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x8000, 0x9fff, read8_delegate(FUNC(starwars_state::esb_slapstic_r),this), write8_delegate(FUNC(starwars_state::esb_slapstic_w),this)); /* install additional banking */ m_maincpu->space(AS_PROGRAM).install_read_bank(0xa000, 0xffff, "bank2"); /* prepare the matrix processor */ m_is_esb = 1; starwars_mproc_init(); /* initialize banking */ membank("bank1")->configure_entries(0, 2, rom + 0x6000, 0x10000 - 0x6000); membank("bank1")->set_entry(0); membank("bank2")->configure_entries(0, 2, rom + 0xa000, 0x1c000 - 0xa000); membank("bank2")->set_entry(0); /* additional globals for state saving */ save_item(NAME(m_slapstic_current_bank)); save_item(NAME(m_slapstic_last_pc)); save_item(NAME(m_slapstic_last_address)); }
void isa16_svga_tgui9680_device::device_start() { set_isa_device(); m_vga = subdevice<trident_vga_device>("vga"); m_isa->install_rom(this, 0xc0000, 0xc7fff, "tgui9680", "tgui9680"); m_isa->install_device(0x3b0, 0x3bf, read8_delegate(FUNC(trident_vga_device::port_03b0_r),m_vga), write8_delegate(FUNC(trident_vga_device::port_03b0_w),m_vga)); m_isa->install_device(0x3c0, 0x3cf, read8_delegate(FUNC(trident_vga_device::port_03c0_r),m_vga), write8_delegate(FUNC(trident_vga_device::port_03c0_w),m_vga)); m_isa->install_device(0x3d0, 0x3df, read8_delegate(FUNC(trident_vga_device::port_03d0_r),m_vga), write8_delegate(FUNC(trident_vga_device::port_03d0_w),m_vga)); m_isa->install_device(0x43c4, 0x43cb, read8_delegate(FUNC(trident_vga_device::port_43c6_r),m_vga), write8_delegate(FUNC(trident_vga_device::port_43c6_w),m_vga)); m_isa->install_device(0x83c4, 0x83cb, read8_delegate(FUNC(trident_vga_device::port_83c6_r),m_vga), write8_delegate(FUNC(trident_vga_device::port_83c6_w),m_vga)); m_isa->install_memory(0xa0000, 0xbffff, read8_delegate(FUNC(trident_vga_device::mem_r),m_vga), write8_delegate(FUNC(trident_vga_device::mem_w),m_vga)); // uncomment to test Windows 3.1 TGUI9440AGi driver // m_isa->install_memory(0x4400000, 0x45fffff, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga)); // win95 drivers // m_isa->install_memory(0x4000000, 0x41fffff, read8_delegate(FUNC(trident_vga_device::vram_r),m_vga), write8_delegate(FUNC(trident_vga_device::vram_w),m_vga)); // acceleration ports m_isa->install_device(0x2120, 0x21ff, read8_delegate(FUNC(trident_vga_device::accel_r),m_vga), write8_delegate(FUNC(trident_vga_device::accel_w),m_vga)); }
MACHINE_START_MEMBER(vsnes_state,vsdual) { m_vrom[0] = memregion("gfx1")->base(); m_vrom[1] = memregion("gfx2")->base(); m_vrom_size[0] = memregion("gfx1")->bytes(); m_vrom_size[1] = memregion("gfx2")->bytes(); /* establish nametable ram */ m_nt_ram[0] = std::make_unique<uint8_t[]>(0x1000); m_nt_ram[1] = std::make_unique<uint8_t[]>(0x1000); /* set mirroring */ m_nt_page[0][0] = m_nt_ram[0].get(); m_nt_page[0][1] = m_nt_ram[0].get() + 0x400; m_nt_page[0][2] = m_nt_ram[0].get() + 0x800; m_nt_page[0][3] = m_nt_ram[0].get() + 0xc00; m_nt_page[1][0] = m_nt_ram[1].get(); m_nt_page[1][1] = m_nt_ram[1].get() + 0x400; m_nt_page[1][2] = m_nt_ram[1].get() + 0x800; m_nt_page[1][3] = m_nt_ram[1].get() + 0xc00; machine().device("ppu1")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt0_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt0_w),this)); machine().device("ppu2")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt1_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt1_w),this)); // read only! machine().device("ppu1")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank2"); // read only! machine().device("ppu2")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank3"); membank("bank2")->configure_entries(0, m_vrom_size[0] / 0x2000, m_vrom[0], 0x2000); membank("bank3")->configure_entries(0, m_vrom_size[1] / 0x2000, m_vrom[1], 0x2000); membank("bank2")->set_entry(0); membank("bank3")->set_entry(0); }
DRIVER_INIT_MEMBER(vsnes_state,vsgun) { /* VROM switching is enabled with bit 2 of $4016 */ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x4016, 0x4016, read8_delegate(FUNC(vsnes_state::gun_in0_r),this), write8_delegate(FUNC(vsnes_state::gun_in0_w),this)); m_do_vrom_bank = 1; }
void el2_3c503_device::device_start() { char mac[7]; uint32_t num = machine().rand(); memset(m_prom, 0x57, 16); sprintf(mac, "\x02\x60\x8c%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); memcpy(m_prom, mac, 6); memset(m_rom, 0, 8*1024); // empty m_dp8390->set_mac(mac); set_isa_device(); m_isa->install_device(0x0300, 0x030f, read8_delegate(FUNC(el2_3c503_device::el2_3c503_loport_r), this), write8_delegate(FUNC(el2_3c503_device::el2_3c503_loport_w), this)); m_isa->install_device(0x0700, 0x070f, read8_delegate(FUNC(el2_3c503_device::el2_3c503_hiport_r), this), write8_delegate(FUNC(el2_3c503_device::el2_3c503_hiport_w), this)); // TODO: This is wrong, fix if anything actually uses it // DMA can change in runtime int chan = 0, idcfr = m_regs.idcfr & 0x0f; if((m_regs.streg & 0x08)) { while(idcfr) { chan++; idcfr >>= 1; } m_isa->set_dma_channel(chan, this, false); } }
void tk02_device::device_reset() { io_space().install_device(0x40, 0x4f, *this, &tk02_device::map); io_space().install_readwrite_handler(0x40, 0x47, 0, 0, 0xff00, read8_delegate(FUNC(tk02_device::ram_r), this), write8_delegate(FUNC(tk02_device::ram_w), this)); }
void sc499_device::device_reset() { m_data = 0; m_command = SC499_CMD_NO_COMMAND; m_status = SC499_STAT_RDY; // | SC499_STAT_EXC; m_control = 0; m_first_block_hack = 1; m_nasty_readahead = 0; m_read_block_pending = 0; m_current_command = m_command; m_data_error_counter = 0; m_underrun_counter = 0; m_image_length = 0; check_tape(); m_data_index = 0; m_ctape_block_index = 0; m_tape_pos = 0; irq_state = CLEAR_LINE; dma_drq_state = CLEAR_LINE; if (!m_installed) { int base = m_iobase->read(); m_irq = m_irqdrq->read() & 7; m_drq = m_irqdrq->read()>>4; m_isa->install_device(base, base+7, 0, 0, read8_delegate(FUNC(sc499_device::read), this), write8_delegate(FUNC(sc499_device::write), this)); m_isa->set_dma_channel(m_drq, this, true); }
void v53_base_device::install_peripheral_io() { // unmap everything in I/O space up to the fixed position registers (we avoid overwriting them, it isn't a valid config) space(AS_IO).unmap_readwrite(0x1000, 0xfeff); // todo, we need to have a way to NOT unmap things defined in the drivers, but instead have this act as an overlay mapping / unampping only!! // IOAG determines if the handlers used 8-bit or 16-bit access // the hng64.c games first set everything up in 8-bit mode, then // do the procedure again in 16-bit mode before using them?! int IOAG = m_SCTL & 1; if (m_OPSEL & 0x01) // DMA Unit available { UINT16 base = (m_OPHA << 8) | m_DULA; base &= 0xfffe; if (m_SCTL & 0x02) // uPD71037 mode { if (IOAG) // 8-bit { } else { } } else // uPD71071 mode { space(AS_IO).install_readwrite_handler(base+0x00, base+0x0f, read8_delegate(FUNC(upd71071_v53_device::read), (upd71071_v53_device*)m_v53dmau), write8_delegate(FUNC(upd71071_v53_device::write), (upd71071_v53_device*)m_v53dmau), 0xffff); } } if (m_OPSEL & 0x02) // Interupt Control Unit available { UINT16 base = (m_OPHA << 8) | m_IULA; base &= 0xfffe; if (IOAG) // 8-bit { } else { space(AS_IO).install_readwrite_handler(base+0x00, base+0x03, read8_delegate(FUNC(pic8259_device::read), (pic8259_device*)m_v53icu), write8_delegate(FUNC(pic8259_device::write), (pic8259_device*)m_v53icu), 0x00ff); } } if (m_OPSEL & 0x04) // Timer Control Unit available { UINT16 base = (m_OPHA << 8) | m_TULA; //printf("installing TCU to %04x\n", base); base &= 0xfffe; if (IOAG) // 8-bit { } else { space(AS_IO).install_readwrite_handler(base+0x00, base+0x01, read8_delegate(FUNC(v53_base_device::tmu_tst0_r), this), write8_delegate(FUNC(v53_base_device::tmu_tct0_w), this), 0x00ff); space(AS_IO).install_readwrite_handler(base+0x02, base+0x03, read8_delegate(FUNC(v53_base_device::tmu_tst1_r), this), write8_delegate(FUNC(v53_base_device::tmu_tct1_w), this), 0x00ff); space(AS_IO).install_readwrite_handler(base+0x04, base+0x05, read8_delegate(FUNC(v53_base_device::tmu_tst2_r), this), write8_delegate(FUNC(v53_base_device::tmu_tct2_w), this), 0x00ff); space(AS_IO).install_write_handler(base+0x06, base+0x07, write8_delegate(FUNC(v53_base_device::tmu_tmd_w), this), 0x00ff); } } if (m_OPSEL & 0x08) // Serial Control Unit available { UINT16 base = (m_OPHA << 8) | m_SULA; base &= 0xfffe; if (IOAG) // 8-bit { } else { space(AS_IO).install_readwrite_handler(base+0x00, base+0x01, read8_delegate(FUNC(v53_scu_device::data_r), (v53_scu_device*)m_v53scu), write8_delegate(FUNC(v53_scu_device::data_w), (v53_scu_device*)m_v53scu), 0x00ff); space(AS_IO).install_readwrite_handler(base+0x02, base+0x03, read8_delegate(FUNC(v53_scu_device::status_r), (v53_scu_device*)m_v53scu), write8_delegate(FUNC(v53_scu_device::command_w), (v53_scu_device*)m_v53scu), 0x00ff); space(AS_IO).install_write_handler(base+0x04, base+0x05, write8_delegate(FUNC(v53_scu_device::mode_w), (v53_scu_device*)m_v53scu), 0x00ff); space(AS_IO).install_readwrite_handler(base+0x06, base+0x07, read8_delegate(FUNC(v53_base_device::scu_simk_r), this), write8_delegate(FUNC(v53_base_device::scu_simk_w), this), 0x00ff); } } }
void dmv_k220_device::device_start() { address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO); space.install_readwrite_handler(0x08, 0x0b, 0, 0, read8_delegate(FUNC(pit8253_device::read), &(*m_pit)), write8_delegate(FUNC(pit8253_device::write), &(*m_pit)), 0); space.install_readwrite_handler(0x0c, 0x0f, 0, 0, read8_delegate(FUNC(i8255_device::read), &(*m_ppi)), write8_delegate(FUNC(i8255_device::write), &(*m_ppi)), 0); }
void nascom_avc_device::device_reset() { m_nasbus->m_io->install_write_handler(0xb0, 0xb0, write8_delegate(FUNC(mc6845_device::address_w), m_crtc.target())); m_nasbus->m_io->install_readwrite_handler(0xb1, 0xb1, read8_delegate(FUNC(mc6845_device::register_r), m_crtc.target()), write8_delegate(FUNC(mc6845_device::register_w), m_crtc.target())); m_nasbus->m_io->install_write_handler(0xb2, 0xb2, write8_delegate(FUNC(nascom_avc_device::control_w), this)); }
void isa8_svga_cirrus_device::device_start() { set_isa_device(); m_vga = subdevice<cirrus_vga_device>("vga"); m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "svga", "dm_clgd5430"); m_isa->install_device(0x03b0, 0x03bf, 0, 0, read8_delegate(FUNC(cirrus_vga_device::port_03b0_r),m_vga), write8_delegate(FUNC(cirrus_vga_device::port_03b0_w),m_vga)); m_isa->install_device(0x03c0, 0x03cf, 0, 0, read8_delegate(FUNC(cirrus_vga_device::port_03c0_r),m_vga), write8_delegate(FUNC(cirrus_vga_device::port_03c0_w),m_vga)); m_isa->install_device(0x03d0, 0x03df, 0, 0, read8_delegate(FUNC(cirrus_vga_device::port_03d0_r),m_vga), write8_delegate(FUNC(cirrus_vga_device::port_03d0_w),m_vga)); // m_isa->install_device(0x9ae8, 0x9aeb, 0, 0, read8_delegate(FUNC(cirrus_vga_device::s3_port_9ae8_r),m_vga), write8_delegate(FUNC(cirrus_vga_device::s3_port_9ae8_w),m_vga)); m_isa->install_memory(0xa0000, 0xbffff, 0, 0, read8_delegate(FUNC(cirrus_vga_device::mem_r),m_vga), write8_delegate(FUNC(cirrus_vga_device::mem_w),m_vga)); }
static DRIVER_INIT( scobra ) { scramble_state *state = machine.driver_data<scramble_state>(); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xa803, 0xa803, write8_delegate(FUNC(scramble_state::scrambold_background_enable_w),state)); }
void tiki100_state::bankswitch() { address_space &program = m_maincpu->space(AS_PROGRAM); if (m_vire) { if (!m_rome) { /* reserved */ program.unmap_readwrite(0x0000, 0xffff); } else { /* GFXRAM, GFXRAM, RAM */ program.install_readwrite_handler(0x0000, 0x7fff, read8_delegate(FUNC(tiki100_state::gfxram_r), this), write8_delegate(FUNC(tiki100_state::gfxram_w), this)); program.install_readwrite_bank(0x8000, 0xffff, "bank3"); membank("bank1")->set_entry(BANK_VIDEO_RAM); membank("bank2")->set_entry(BANK_VIDEO_RAM); membank("bank3")->set_entry(BANK_RAM); } } else { if (!m_rome) { /* ROM, RAM, RAM */ program.install_read_bank(0x0000, 0x3fff, "bank1"); program.unmap_write(0x0000, 0x3fff); program.install_readwrite_bank(0x4000, 0x7fff, "bank2"); program.install_readwrite_bank(0x8000, 0xffff, "bank3"); membank("bank1")->set_entry(BANK_ROM); membank("bank2")->set_entry(BANK_RAM); membank("bank3")->set_entry(BANK_RAM); } else { /* RAM, RAM, RAM */ program.install_readwrite_bank(0x0000, 0x3fff, "bank1"); program.install_readwrite_bank(0x4000, 0x7fff, "bank2"); program.install_readwrite_bank(0x8000, 0xffff, "bank3"); membank("bank1")->set_entry(BANK_RAM); membank("bank2")->set_entry(BANK_RAM); membank("bank3")->set_entry(BANK_RAM); } } }
void ne1000_device::device_start() { char mac[7]; UINT32 num = rand(); memset(m_prom, 0x57, 16); sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); mac[0] = 0; mac[1] = 0; // avoid gcc warning memcpy(m_prom, mac, 6); m_dp8390->set_mac(mac); set_isa_device(); m_isa->install_device(0x0300, 0x031f, 0, 0, read8_delegate(FUNC(ne1000_device::ne1000_port_r), this), write8_delegate(FUNC(ne1000_device::ne1000_port_w), this)); }
void isa8_svga_et4k_device::device_start() { set_isa_device(); m_vga = subdevice<tseng_vga_device>("vga"); m_isa->install_rom(this, 0xc0000, 0xc7fff, "et4000", "et4000"); m_isa->install_device(0x3b0, 0x3bf, read8_delegate(FUNC(tseng_vga_device::port_03b0_r),m_vga), write8_delegate(FUNC(tseng_vga_device::port_03b0_w),m_vga)); m_isa->install_device(0x3c0, 0x3cf, read8_delegate(FUNC(tseng_vga_device::port_03c0_r),m_vga), write8_delegate(FUNC(tseng_vga_device::port_03c0_w),m_vga)); m_isa->install_device(0x3d0, 0x3df, read8_delegate(FUNC(tseng_vga_device::port_03d0_r),m_vga), write8_delegate(FUNC(tseng_vga_device::port_03d0_w),m_vga)); m_isa->install_memory(0xa0000, 0xbffff, read8_delegate(FUNC(tseng_vga_device::mem_r),m_vga), write8_delegate(FUNC(tseng_vga_device::mem_w),m_vga)); }
void dmv_k234_device::device_start() { dmv_k230_device::device_start(); m_io->install_readwrite_handler(0xd8, 0xdf, 0, 0, read8_delegate(FUNC(dmv_k234_device::snr_r), this), write8_delegate(FUNC(dmv_k234_device::snr_w), this), 0); }
MACHINE_START_MEMBER(astrocde_mess_state, astrocde) { if (m_cart->exists()) m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x3fff, read8_delegate(FUNC(astrocade_cart_slot_device::read_rom),(astrocade_cart_slot_device*)m_cart)); // if no RAM is mounted and the handlers are installed, the system starts with garbage on screen and a RESET is necessary // thus, install RAM only if an expansion is mounted if (m_exp->get_card_mounted()) m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x5000, 0xffff, read8_delegate(FUNC(astrocade_exp_device::read),(astrocade_exp_device*)m_exp), write8_delegate(FUNC(astrocade_exp_device::write),(astrocade_exp_device*)m_exp)); }
void isa8_gblaster_device::device_start() { set_isa_device(); m_isa->install_device(0x0220, 0x0221, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_gblaster_device::saa1099_1_16_w), this ) ); m_isa->install_device(0x0222, 0x0223, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_gblaster_device::saa1099_2_16_w), this ) ); }
void isa8_lpt_device::device_reset() { m_is_primary = (ioport("DSW")->read() & 1) ? false : true; if (m_is_primary) { m_isa->install_device(0x0378, 0x037b, 0, 0, read8_delegate(FUNC(pc_lpt_device::read), subdevice<pc_lpt_device>("lpt")), write8_delegate(FUNC(pc_lpt_device::write), subdevice<pc_lpt_device>("lpt"))); } else { m_isa->install_device(0x0278, 0x027b, 0, 0, read8_delegate(FUNC(pc_lpt_device::read), subdevice<pc_lpt_device>("lpt")), write8_delegate(FUNC(pc_lpt_device::write), subdevice<pc_lpt_device>("lpt"))); } }
MACHINE_START_MEMBER(vsnes_state,vsnes) { address_space &ppu1_space = machine().device("ppu1")->memory().space(AS_PROGRAM); int i; /* establish nametable ram */ m_nt_ram[0] = std::make_unique<uint8_t[]>(0x1000); /* set mirroring */ m_nt_page[0][0] = m_nt_ram[0].get(); m_nt_page[0][1] = m_nt_ram[0].get() + 0x400; m_nt_page[0][2] = m_nt_ram[0].get() + 0x800; m_nt_page[0][3] = m_nt_ram[0].get() + 0xc00; ppu1_space.install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt0_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt0_w),this)); if (m_gfx1_rom != nullptr) { m_vrom[0] = memregion("gfx1")->base(); m_vrom_size[0] = memregion("gfx1")->bytes(); m_vrom_banks = m_vrom_size[0] / 0x400; } else { m_vrom[0] = nullptr; m_vrom_size[0] = 0; m_vrom_banks = 0; } /* establish chr banks */ /* bank 1 is used already! */ /* DRIVER_INIT is called first - means we can handle this different for VRAM games! */ if (m_vrom[0] != nullptr) { for (i = 0; i < 8; i++) { ppu1_space.install_read_bank(0x0400 * i, 0x0400 * i + 0x03ff, chr_banknames[i]); membank(chr_banknames[i])->configure_entries(0, m_vrom_banks, m_vrom[0], 0x400); } v_set_videorom_bank(0, 8, 0); } else { ppu1_space.install_ram(0x0000, 0x1fff, m_vram.get()); } }
static MACHINE_START( cham24 ) { cham24_state *state = machine.driver_data<cham24_state>(); /* switch PRG rom */ UINT8* dst = state->memregion("maincpu")->base(); UINT8* src = state->memregion("user1")->base(); memcpy(&dst[0x8000], &src[0x0f8000], 0x4000); memcpy(&dst[0xc000], &src[0x0f8000], 0x4000); /* uses 8K swapping, all ROM!*/ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1"); state->membank("bank1")->set_base(state->memregion("gfx1")->base()); /* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */ state->m_nt_ram = auto_alloc_array(machine, UINT8, 0x1000); state->m_nt_page[0] = state->m_nt_ram; state->m_nt_page[1] = state->m_nt_ram + 0x400; state->m_nt_page[2] = state->m_nt_ram + 0x800; state->m_nt_page[3] = state->m_nt_ram + 0xc00; /* and read/write handlers */ machine.device("ppu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2000, 0x3eff,read8_delegate(FUNC(cham24_state::nt_r), state), write8_delegate(FUNC(cham24_state::nt_w), state)); }
DRIVER_INIT_MEMBER(vsnes_state,vsnormal) { /* vrom switching is enabled with bit 2 of $4016 */ m_maincpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsnormal_vrom_banking),this)); }
void a7800_state::machine_reset() { UINT8 *memory; address_space& space = m_maincpu->space(AS_PROGRAM); m_ctrl_lock = 0; m_ctrl_reg = 0; m_maria_flag = 0; /* set banks to default states */ memory = m_region_maincpu->base(); if(m_cart_type & 0x20) //supercart bankram m_bank1->set_base(memory + 0xf0000 ); else m_bank1->set_base(memory + 0x4000 ); m_bank2->set_base(memory + 0x8000 ); m_bank3->set_base(memory + 0xA000 ); m_bank4->set_base(memory + 0xC000 ); /* pokey cartridge */ if (m_cart_type & 0x01) { space.install_readwrite_handler(0x0450, 0x045F, read8_delegate(FUNC(pokey_device::read),(pokey_device*)m_pokey), write8_delegate(FUNC(pokey_device::write),(pokey_device*)m_pokey)); } }
DRIVER_INIT_MEMBER(vsnes_state,vsgshoe) { /* set up the default bank */ uint8_t *prg = memregion("maincpu")->base(); memcpy (&prg[0x08000], &prg[0x12000], 0x2000); /* vrom switching is enabled with bit 2 of $4016 */ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x4016, 0x4016, read8_delegate(FUNC(vsnes_state::gun_in0_r),this), write8_delegate(FUNC(vsnes_state::vsgshoe_gun_in0_w),this)); m_do_vrom_bank = 1; }
ROM_END DRIVER_INIT_MEMBER(naughtyb_state,popflame) { /* install a handler to catch protection checks */ machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x9000, 0x9000, read8_delegate(FUNC(naughtyb_state::popflame_protection_r),this)); machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x9090, 0x9090, read8_delegate(FUNC(naughtyb_state::popflame_protection_r),this)); machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xb000, 0xb0ff, write8_delegate(FUNC(naughtyb_state::popflame_protection_w),this)); }
void cpc_symbiface2_device::device_start() { device_t* cpu = machine().device("maincpu"); address_space& space = cpu->memory().space(AS_IO); m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner()); space.install_readwrite_handler(0xfd00,0xfd07,read8_delegate(FUNC(cpc_symbiface2_device::ide_cs1_r),this),write8_delegate(FUNC(cpc_symbiface2_device::ide_cs1_w),this)); space.install_readwrite_handler(0xfd08,0xfd0f,read8_delegate(FUNC(cpc_symbiface2_device::ide_cs0_r),this),write8_delegate(FUNC(cpc_symbiface2_device::ide_cs0_w),this)); space.install_read_handler(0xfd10,0xfd10,read8_delegate(FUNC(cpc_symbiface2_device::mouse_r),this)); space.install_readwrite_handler(0xfd14,0xfd15,read8_delegate(FUNC(cpc_symbiface2_device::rtc_r),this),write8_delegate(FUNC(cpc_symbiface2_device::rtc_w),this)); space.install_readwrite_handler(0xfd17,0xfd17,read8_delegate(FUNC(cpc_symbiface2_device::rom_rewrite_r),this),write8_delegate(FUNC(cpc_symbiface2_device::rom_rewrite_w),this)); // set up ROM space (these can be writable, when mapped to &4000, or completely disabled, allowing the built-in ROMs to be visible) // 32 banks of 16kB (512kB) m_rom_space.resize(32*16384); m_nvram->set_base(&m_rom_space[0],m_rom_space.size()); save_item(NAME(m_rom_space)); }
DRIVER_INIT_MEMBER(naughtyb_state,trvmstr) { /* install questions' handlers */ machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xc000, 0xc002, read8_delegate(FUNC(naughtyb_state::trvmstr_questions_r),this), write8_delegate(FUNC(naughtyb_state::trvmstr_questions_w),this)); }
void isa16_s3virge_device::device_start() { set_isa_device(); m_vga = subdevice<s3virge_vga_device>("vga"); m_isa->install_rom(this, 0xc0000, 0xc7fff, "svga", "s3virge"); m_isa->install_device(0x03b0, 0x03bf, read8_delegate(FUNC(s3virge_vga_device::port_03b0_r),m_vga), write8_delegate(FUNC(s3virge_vga_device::port_03b0_w),m_vga)); m_isa->install_device(0x03c0, 0x03cf, read8_delegate(FUNC(s3virge_vga_device::port_03c0_r),m_vga), write8_delegate(FUNC(s3virge_vga_device::port_03c0_w),m_vga)); m_isa->install_device(0x03d0, 0x03df, read8_delegate(FUNC(s3virge_vga_device::port_03d0_r),m_vga), write8_delegate(FUNC(s3virge_vga_device::port_03d0_w),m_vga)); m_isa->install_memory(0xa0000, 0xbffff, read8_delegate(FUNC(s3virge_vga_device::mem_r),m_vga), write8_delegate(FUNC(s3virge_vga_device::mem_w),m_vga)); }
void mc1502_fdc_device::device_start() { set_isa_device(); // BIOS 5.0-5.2x m_isa->install_device(0x010c, 0x010f, READ8_DEVICE_DELEGATE(m_fdc, fd1793_t, read), WRITE8_DEVICE_DELEGATE(m_fdc, fd1793_t, write) ); m_isa->install_device(0x0100, 0x010b, read8_delegate( FUNC(mc1502_fdc_device::mc1502_fdc_r), this ), write8_delegate( FUNC(mc1502_fdc_device::mc1502_fdc_w), this ) ); // BIOS 5.3x m_isa->install_device(0x0048, 0x004b, READ8_DEVICE_DELEGATE(m_fdc, fd1793_t, read), WRITE8_DEVICE_DELEGATE(m_fdc, fd1793_t, write) ); m_isa->install_device(0x004c, 0x004f, read8_delegate( FUNC(mc1502_fdc_device::mc1502_fdcv2_r), this ), write8_delegate( FUNC(mc1502_fdc_device::mc1502_fdc_w), this ) ); motor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc1502_fdc_device::motor_callback),this)); motor_on = 0; }