inline void base_c2040_device::initialize(int drives) { // find GCR ROM m_gcr = memregion("gcr")->base(); // install image callbacks m_unit[0].m_image = m_image0; floppy_install_unload_proc(m_image0, base_c2040_device::on_disk0_change); floppy_install_load_proc(m_image0, base_c2040_device::on_disk0_change); if (drives == 2) { m_unit[1].m_image = m_image1; floppy_install_unload_proc(m_image1, base_c2040_device::on_disk1_change); floppy_install_load_proc(m_image1, base_c2040_device::on_disk1_change); } // register for state saving save_item(NAME(m_drive)); save_item(NAME(m_side)); save_item(NAME(m_rfdo)); save_item(NAME(m_daco)); save_item(NAME(m_atna)); save_item(NAME(m_ds)); save_item(NAME(m_bit_count)); save_item(NAME(m_sr)); save_item(NAME(m_pi)); save_item(NAME(m_i)); save_item(NAME(m_e)); save_item(NAME(m_ready)); save_item(NAME(m_mode)); save_item(NAME(m_rw)); save_item(NAME(m_miot_irq)); save_item(NAME(m_unit[0].m_stp)); save_item(NAME(m_unit[0].m_mtr)); save_item(NAME(m_unit[0].m_track_len)); save_item(NAME(m_unit[0].m_buffer_pos)); save_item(NAME(m_unit[0].m_bit_pos)); if (drives == 2) { save_item(NAME(m_unit[1].m_stp)); save_item(NAME(m_unit[1].m_mtr)); save_item(NAME(m_unit[1].m_track_len)); save_item(NAME(m_unit[1].m_buffer_pos)); save_item(NAME(m_unit[1].m_bit_pos)); } }
void c2040_device::device_start() { m_bit_timer = timer_alloc(); // install image callbacks m_unit[0].m_image = m_image0; floppy_install_load_proc(m_image0, c2040_device::on_disk0_change); if (m_image1) { m_unit[1].m_image = m_image1; floppy_install_load_proc(m_image1, c2040_device::on_disk1_change); } // register for state saving save_item(NAME(m_drive)); save_item(NAME(m_side)); save_item(NAME(m_rfdo)); save_item(NAME(m_daco)); save_item(NAME(m_atna)); save_item(NAME(m_ds)); save_item(NAME(m_bit_count)); save_item(NAME(m_sr)); save_item(NAME(m_pi)); save_item(NAME(m_i)); save_item(NAME(m_e)); save_item(NAME(m_ready)); save_item(NAME(m_mode)); save_item(NAME(m_rw)); save_item(NAME(m_miot_irq)); save_item(NAME(m_unit[0].m_stp)); save_item(NAME(m_unit[0].m_mtr)); save_item(NAME(m_unit[0].m_track_len)); save_item(NAME(m_unit[0].m_buffer_pos)); save_item(NAME(m_unit[0].m_bit_pos)); if (m_image1) { save_item(NAME(m_unit[1].m_stp)); save_item(NAME(m_unit[1].m_mtr)); save_item(NAME(m_unit[1].m_track_len)); save_item(NAME(m_unit[1].m_buffer_pos)); save_item(NAME(m_unit[1].m_bit_pos)); } }
static DEVICE_START(atari_fdc) { int id; for(id=0;id<4;id++) { floppy_install_load_proc(atari_floppy_get_device_child(device, id), atari_load_proc); } }
void c1541_device::device_start() { // install image callbacks floppy_install_unload_proc(m_image, c1541_device::on_disk_change); floppy_install_load_proc(m_image, c1541_device::on_disk_change); // register for state saving save_item(NAME(m_data_out)); save_item(NAME(m_via0_irq)); save_item(NAME(m_via1_irq)); }
ROM_END /*------------------------------------------------- DEVICE_START( c1551 ) -------------------------------------------------*/ static DEVICE_START( c1551 ) { c1551_t *c1551 = get_safe_token(device); const c1551_config *config = get_safe_config(device); /* set address */ assert((config->address > 7) && (config->address < 10)); c1551->address = config->address - 8; /* find our CPU */ c1551->cpu = device->subdevice(M6510T_TAG); /* find devices */ c1551->tpi0 = device->subdevice(M6523_0_TAG); c1551->tpi1 = device->subdevice(M6523_1_TAG); c1551->image = device->subdevice(FLOPPY_0); /* install image callbacks */ floppy_install_unload_proc(c1551->image, on_disk_change); floppy_install_load_proc(c1551->image, on_disk_change); /* allocate data timer */ c1551->bit_timer = device->machine().scheduler().timer_alloc(FUNC(bit_tick), (void *)device); /* map TPI1 to host CPU memory space */ address_space *program = device->machine().device(config->cpu_tag)->memory().space(AS_PROGRAM); UINT32 start_address = c1551->address ? 0xfec0 : 0xfef0; program->install_legacy_readwrite_handler(*c1551->tpi1, start_address, start_address + 7, FUNC(tpi6525_r), FUNC(tpi6525_w)); /* register for state saving */ device->save_item(NAME(c1551->tcbm_data)); device->save_item(NAME(c1551->status)); device->save_item(NAME(c1551->dav)); device->save_item(NAME(c1551->ack)); device->save_item(NAME(c1551->stp)); device->save_item(NAME(c1551->mtr)); device->save_item(NAME(c1551->track_len)); device->save_item(NAME(c1551->buffer_pos)); device->save_item(NAME(c1551->bit_pos)); device->save_item(NAME(c1551->bit_count)); device->save_item(NAME(c1551->data)); device->save_item(NAME(c1551->yb)); device->save_item(NAME(c1551->ds)); device->save_item(NAME(c1551->soe)); device->save_item(NAME(c1551->byte)); device->save_item(NAME(c1551->mode)); }
DRIVER_INIT_MEMBER(vtech1_state,vtech1) { address_space &prg = m_maincpu->space(AS_PROGRAM); int id; /* ram */ m_ram_pointer = m_ram->pointer(); m_ram_size = m_ram->size(); /* setup memory banking */ membank("bank1")->set_base(m_ram_pointer); /* 16k memory expansion? */ if (m_ram_size == 18*1024 || m_ram_size == 22*1024 || m_ram_size == 32*1024) { offs_t base = 0x7800 + (m_ram_size - 0x4000); prg.install_readwrite_bank(base, base + 0x3fff, "bank2"); membank("bank2")->set_base(m_ram_pointer + base - 0x7800); } /* 64k expansion? */ if (m_ram_size >= 66*1024) { /* install fixed first bank */ prg.install_readwrite_bank(0x8000, 0xbfff, "bank2"); membank("bank2")->set_base(m_ram_pointer + 0x800); /* install the others, dynamically banked in */ prg.install_readwrite_bank(0xc000, 0xffff, "bank3"); membank("bank3")->configure_entries(0, (m_ram_size - 0x4800) / 0x4000, m_ram_pointer + 0x4800, 0x4000); membank("bank3")->set_entry(0); } /* initialize floppy */ m_drive = -1; m_fdc_track_x2[0] = 80; m_fdc_track_x2[1] = 80; m_fdc_wrprot[0] = 0x80; m_fdc_wrprot[1] = 0x80; m_fdc_status = 0; m_fdc_edge = 0; m_fdc_bits = 8; m_fdc_start = 0; m_fdc_write = 0; m_fdc_offs = 0; m_fdc_latch = 0; for(id=0; id<2; id++) { floppy_install_load_proc(floppy_get_device(machine(), id), vtech1_load_proc); } }
void base_c1571_device::device_start() { // install image callbacks floppy_install_unload_proc(m_image, base_c1571_device::on_disk_change); floppy_install_load_proc(m_image, base_c1571_device::on_disk_change); // register for state saving save_item(NAME(m_1_2mhz)); save_item(NAME(m_data_out)); save_item(NAME(m_ser_dir)); save_item(NAME(m_sp_out)); save_item(NAME(m_cnt_out)); save_item(NAME(m_via0_irq)); save_item(NAME(m_via1_irq)); save_item(NAME(m_cia_irq)); }
void osborne1_state::machine_reset() { int drive; address_space& space = m_maincpu->space(AS_PROGRAM); /* Initialize memory configuration */ osborne1_bankswitch_w( space, 0x00, 0 ); m_pia_0_irq_state = FALSE; m_pia_1_irq_state = FALSE; m_in_irq_handler = 0; m_p_chargen = memregion( "chargen" )->base(); memset( m_ram->pointer() + 0x10000, 0xFF, 0x1000 ); for(drive=0;drive<2;drive++) floppy_install_load_proc(floppy_get_device(machine(), drive), osborne1_load_proc); space.set_direct_update_handler(direct_update_delegate(FUNC(osborne1_state::osborne1_opbase), this)); }