Example #1
0
void bfm_dm01_device::device_start()
{
	if(!m_screen->started())
		throw device_missing_dependencies();

	if(!m_palette->started())
		throw device_missing_dependencies();

	m_busy_cb.resolve_safe();

	save_item(NAME(m_data_avail));
	save_item(NAME(m_control));
	save_item(NAME(m_xcounter));
	save_item(NAME(m_busy));
	save_item(NAME(m_comdata));

	for (int i = 0; i < 65; i++)
	save_item(NAME(m_segbuffer), i);

	for (int i = 0; i < BYTES_PER_ROW; i++)
	save_item(NAME(m_scanline), i);

	m_screen->register_screen_bitmap(m_tmpbitmap);
	m_palette->set_pen_color(0, rgb_t(0, 0, 0));        // background
	m_palette->set_pen_color(1, rgb_t(15, 1, 1));       // off dot
	m_palette->set_pen_color(2, rgb_t(255, 31, 31));    // on dot
}
Example #2
0
void driver_device::device_start()
{
	// reschedule ourselves to be last
	for (device_t &test : device_iterator(*this))
		if (&test != this && !test.started())
			throw device_missing_dependencies();

	// call the game-specific init
	m_system->driver_init(*this);

	// finish image devices init process
	machine().image().postdevice_init();

	// start the various pieces
	driver_start();

	if (!m_callbacks[CB_MACHINE_START].isnull())
		m_callbacks[CB_MACHINE_START]();
	else
		machine_start();

	if (!m_callbacks[CB_SOUND_START].isnull())
		m_callbacks[CB_SOUND_START]();
	else
		sound_start();

	if (!m_callbacks[CB_VIDEO_START].isnull())
		m_callbacks[CB_VIDEO_START]();
	else
		video_start();

	// save generic states
	save_item(NAME(m_flip_screen_x));
	save_item(NAME(m_flip_screen_y));
}
Example #3
0
void deco_irq_device::device_start()
{
	// make sure our screen is started
	if (!m_screen->started())
		throw device_missing_dependencies();

	// resolve callbacks
	m_lightgun1_cb.resolve_safe(0);
	m_lightgun2_cb.resolve_safe(0);
	m_lightgun_irq_cb.resolve_safe();
	m_raster1_irq_cb.resolve_safe();
	m_raster2_irq_cb.resolve_safe();
	m_vblank_irq_cb.resolve_safe();

	// allocate scanline timer and start it
	m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(deco_irq_device::scanline_callback), this));
	m_scanline_timer->adjust(m_screen->time_until_pos(0));

	// register for save states
	save_item(NAME(m_lightgun_irq));
	save_item(NAME(m_raster_irq));
	save_item(NAME(m_vblank_irq));
	save_item(NAME(m_raster_irq_target));
	save_item(NAME(m_raster_irq_masked));
	save_item(NAME(m_raster_irq_scanline));
	save_item(NAME(m_lightgun_latch));
}
Example #4
0
void cs4031_device::device_start()
{
    ram_device *ram_dev = machine().device<ram_device>(RAM_TAG);

    // make sure the ram device is already running
    if (!ram_dev->started())
        throw device_missing_dependencies();

    device_t *cpu = machine().device(m_cputag);
    m_space = &cpu->memory().space(AS_PROGRAM);
    m_isa = machine().root_device().memregion(m_isatag)->base();
    m_bios = machine().root_device().memregion(m_biostag)->base();

    m_ram = ram_dev->pointer();
    UINT32 ram_size = ram_dev->size();

    // install base memory
    m_space->install_ram(0x000000, 0x09ffff, m_ram);

    // install extended memory
    if (ram_size > 0x100000) {
        m_space->install_ram(0x100000, ram_size - 1, m_ram + 0x100000);
    }

    // install bios rom at cpu inital pc
    m_space->install_rom(0xffff0000, 0xffffffff, m_bios + 0xf0000);
}
Example #5
0
void dooyong_rom_tilemap_device::device_start()
{
	if (!m_gfxdecode->started())
		throw device_missing_dependencies();

	m_tilemap = &machine().tilemap().create(
			*m_gfxdecode,
			tilemap_get_info_delegate(FUNC(dooyong_rom_tilemap_device::tile_info), this),
			TILEMAP_SCAN_COLS,
			gfx().width(),
			gfx().height(),
			1024 / gfx().width(),
			m_rows);
	if (~m_transparent_pen)
		m_tilemap->set_transparent_pen(m_transparent_pen);

	if (0 > m_tilerom_offset)
		m_tilerom_offset = m_tilerom.length() + m_tilerom_offset;

	std::fill(std::begin(m_registers), std::end(m_registers), 0U);
	m_palette_bank = 0U;

	save_item(NAME(m_registers));
	save_item(NAME(m_palette_bank));
}
Example #6
0
void vt100_keyboard_device::device_start()
{
	if (!m_uart->started())
		throw device_missing_dependencies();

	m_uart->write_tsb(0);
	m_uart->write_eps(1);
	m_uart->write_np(1);
	m_uart->write_nb1(1);
	m_uart->write_nb2(1);
	m_uart->write_cs(1);
	m_uart->write_swe(0);

	m_online_led.resolve();
	m_local_led.resolve();
	m_locked_led.resolve();
	m_ln_led.resolve();

	m_online_led = 0;
	m_local_led = 1;
	m_locked_led = 1;
	for (int n = 0; n < 4; n++)
		m_ln_led[n] = 1;

	save_item(NAME(m_signal_line));
	save_item(NAME(m_last_signal_change));
	save_item(NAME(m_last_scan));
}
Example #7
0
void k05324x_device::device_start()
{
	if (!palette().device().started())
		throw device_missing_dependencies();

	/* decode the graphics */
	decode_gfx();
	gfx(0)->set_colors(palette().entries() / gfx(0)->depth());

	if (VERBOSE && !(palette().shadows_enabled()))
		popmessage("driver should use VIDEO_HAS_SHADOWS");

	m_ramsize = 0x800;

	m_z_rejection = -1;
	m_ram = make_unique_clear<uint16_t[]>(m_ramsize / 2);
	m_buffer = make_unique_clear<uint16_t[]>(m_ramsize / 2);

	// bind callbacks
	m_k05324x_cb.bind_relative_to(*owner());

	save_pointer(NAME(m_ram), m_ramsize / 2);
	save_pointer(NAME(m_buffer), m_ramsize / 2);
	save_item(NAME(m_rombank));
	save_item(NAME(m_z_rejection));
	save_item(NAME(m_regs));
}
Example #8
0
void k052109_device::device_start()
{
	if (m_screen_tag != nullptr)
	{
		// make sure our screen is started
		screen_device *screen = m_owner->subdevice<screen_device>(m_screen_tag);
		if (!screen->started())
			throw device_missing_dependencies();

		// and register a callback for vblank state
		screen->register_vblank_callback(vblank_state_delegate(FUNC(k052109_device::vblank_callback), this));
	}

	if (region() != nullptr)
	{
		m_char_rom = region()->base();
		m_char_size = region()->bytes();
	}

	decode_gfx();
	gfx(0)->set_colors(palette().entries() / gfx(0)->depth());

	m_ram = make_unique_clear<UINT8[]>(0x6000);

	m_colorram_F = &m_ram[0x0000];
	m_colorram_A = &m_ram[0x0800];
	m_colorram_B = &m_ram[0x1000];
	m_videoram_F = &m_ram[0x2000];
	m_videoram_A = &m_ram[0x2800];
	m_videoram_B = &m_ram[0x3000];
	m_videoram2_F = &m_ram[0x4000];
	m_videoram2_A = &m_ram[0x4800];
	m_videoram2_B = &m_ram[0x5000];

	m_tilemap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
	m_tilemap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
	m_tilemap[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);

	m_tilemap[0]->set_transparent_pen(0);
	m_tilemap[1]->set_transparent_pen(0);
	m_tilemap[2]->set_transparent_pen(0);

	// bind callbacks
	m_k052109_cb.bind_relative_to(*owner());

	// resolve callbacks
	m_irq_handler.resolve_safe();
	m_firq_handler.resolve_safe();
	m_nmi_handler.resolve_safe();

	save_pointer(NAME(m_ram.get()), 0x6000);
	save_item(NAME(m_rmrd_line));
	save_item(NAME(m_romsubbank));
	save_item(NAME(m_scrollctrl));
	save_item(NAME(m_irq_enabled));
	save_item(NAME(m_charrombank));
	save_item(NAME(m_charrombank_2));
	save_item(NAME(m_has_extra_video_ram));
	machine().save().register_postload(save_prepost_delegate(FUNC(k052109_device::tileflip_reset), this));
}
Example #9
0
File: pgc.cpp Project: Enverex/mame
void isa8_pgc_device::device_start()
{
	address_space &space = m_cpu->space( AS_PROGRAM );
	int width = PGC_DISP_HORZ;
	int height = PGC_DISP_VERT;

	if (m_palette != nullptr && !m_palette->started())
		throw device_missing_dependencies();

	set_isa_device();

	for (int i = 0; i < 256; i++ )
	{
		m_palette->set_pen_color( i, 0, 0, 0 );
	}

	m_bitmap = std::make_unique<bitmap_ind16>(width, height);
	m_bitmap->fill(0);

	m_vram = std::make_unique<uint8_t[]>(0x78000);
	space.install_readwrite_bank(0x80000, 0xf7fff, "vram");
	membank("vram")->set_base(m_vram.get());

	m_eram = std::make_unique<uint8_t[]>(0x8000);

	machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(&isa8_pgc_device::reset_common, this));
}
Example #10
0
void device_video_interface::interface_pre_start()
{
	// only look up screens if we haven't explicitly requested no screen
	if (m_screen_tag != NULL)
	{
		// find the screen device if explicitly configured
		if (strcmp(m_screen_tag, s_unconfigured_screen_tag) != 0)
		{
			m_screen = device().siblingdevice<screen_device>(m_screen_tag);
			if (m_screen == NULL)
				throw emu_fatalerror("Screen '%s' not found, explicitly set for device '%s'", m_screen_tag, device().tag());
		}

		// otherwise, look for a single match
		else
		{
			screen_device_iterator iter(device().machine().root_device());
			m_screen = iter.first();
			if (iter.next() != NULL)
				throw emu_fatalerror("No screen specified for device '%s', but multiple screens found", device().tag());
		}
	}

	// fatal error if no screen is found
	if (m_screen == NULL && m_screen_required)
		throw emu_fatalerror("Device '%s' requires a screen", device().tag());

	// if we have a screen and it's not started, wait for it
	if (m_screen != NULL && !m_screen->started())
		throw device_missing_dependencies();
}
Example #11
0
void device_sound_interface::interface_pre_start()
{
	// scan all the sound devices
	device_sound_interface *sound = NULL;
	for (bool gotone = m_device.machine().devicelist().first(sound); gotone; gotone = sound->next(sound))
	{
		// scan each route on the device
		for (const sound_route *route = sound->first_route(); route != NULL; route = route->next())
		{
			// see if we are the target of this route; if we are, make sure the source device is started
			device_t *target_device = m_device.machine().device(route->m_target);
			if (target_device == &m_device && !sound->device().started())
				throw device_missing_dependencies();
		}
	}

	// now iterate through devices again and assign any auto-allocated inputs
	m_auto_allocated_inputs = 0;
	for (bool gotone = m_device.machine().devicelist().first(sound); gotone; gotone = sound->next(sound))
	{
		// scan each route on the device
		for (const sound_route *route = sound->first_route(); route != NULL; route = route->next())
		{
			// see if we are the target of this route
			device_t *target_device = m_device.machine().device(route->m_target);
			if (target_device == &m_device && route->m_input == AUTO_ALLOC_INPUT)
			{
				const_cast<sound_route *>(route)->m_input = m_auto_allocated_inputs;
				m_auto_allocated_inputs += (route->m_output == ALL_OUTPUTS) ? sound->outputs() : 1;
			}
		}
	}
}
Example #12
0
void device_sound_interface::interface_pre_start()
{
	// scan all the sound devices
	sound_interface_iterator iter(m_device.machine().root_device());
	for (device_sound_interface const &sound : iter)
	{
		// scan each route on the device
		for (sound_route const &route : sound.routes())
		{
			// see if we are the target of this route; if we are, make sure the source device is started
			device_t *const target_device = route.m_base.get().subdevice(route.m_target.c_str());
			if ((target_device == &m_device) && !sound.device().started())
				throw device_missing_dependencies();
		}
	}

	// now iterate through devices again and assign any auto-allocated inputs
	m_auto_allocated_inputs = 0;
	for (device_sound_interface &sound : iter)
	{
		// scan each route on the device
		for (sound_route &route : sound.routes())
		{
			// see if we are the target of this route
			device_t *const target_device = route.m_base.get().subdevice(route.m_target.c_str());
			if ((target_device == &m_device) && (route.m_input == AUTO_ALLOC_INPUT))
			{
				route.m_input = m_auto_allocated_inputs;
				m_auto_allocated_inputs += (route.m_output == ALL_OUTPUTS) ? sound.outputs() : 1;
			}
		}
	}
}
Example #13
0
void deco16ic_device::device_start()
{
	if(!m_gfxdecode->started())
		throw device_missing_dependencies();

	m_bank1_cb.bind_relative_to(*owner());
	m_bank2_cb.bind_relative_to(*owner());

	int fullheight = 0;
	int fullwidth = 0;

	if (m_full_width12&2)
		fullheight = 1;

	if (m_full_width12&1)
		fullwidth = 1;

	m_pf1_tilemap_16x16 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32);
//  m_pf1_tilemap_8x8 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, m_full_width12 ? 64 : 32, 32);
	m_pf1_tilemap_8x8 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, 64 , 32); // nitroball

	if (m_split)
		m_pf2_tilemap_16x16 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
	else
		m_pf2_tilemap_16x16 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);

	m_pf2_tilemap_8x8 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32);

	m_pf1_tilemap_8x8->set_transparent_pen(0);
	m_pf2_tilemap_8x8->set_transparent_pen(0);
	m_pf1_tilemap_16x16->set_transparent_pen(0);
	m_pf2_tilemap_16x16->set_transparent_pen(0);

	if (m_split) /* Caveman Ninja only */
		m_pf2_tilemap_16x16->set_transmask(0, 0x00ff, 0xff01);

	m_pf1_8bpp_mode = 0;

	m_pf1_data = make_unique_clear<UINT16[]>(0x2000 / 2);
	m_pf2_data = make_unique_clear<UINT16[]>(0x2000 / 2);
	m_pf12_control = make_unique_clear<UINT16[]>(0x10 / 2);


	save_item(NAME(m_use_custom_pf1));
	save_item(NAME(m_use_custom_pf2));
	save_item(NAME(m_pf1_bank));
	save_item(NAME(m_pf2_bank));
	save_item(NAME(m_pf12_8x8_gfx_bank));
	save_item(NAME(m_pf12_16x16_gfx_bank));
	save_item(NAME(m_pf12_last_small));
	save_item(NAME(m_pf12_last_big));

	save_item(NAME(m_pf1_8bpp_mode));

	save_pointer(NAME(m_pf1_data.get()), 0x2000 / 2);
	save_pointer(NAME(m_pf2_data.get()), 0x2000 / 2);
	save_pointer(NAME(m_pf12_control.get()), 0x10 / 2);
}
Example #14
0
void segaic16_video_device::device_start()
{
	if(!m_gfxdecode->started())
		throw device_missing_dependencies();

	save_item(NAME(m_display_enable));

	m_pagelatch_cb.bind_relative_to(*owner());
}
Example #15
0
void device_gio64_card_interface::interface_pre_start()
{
	device_slot_card_interface::interface_pre_start();

	if (!m_gio64)
	{
		fatalerror("Can't find SGI GIO64 device\n");
	}

	if (!m_gio64->started())
		throw device_missing_dependencies();
}
Example #16
0
void k052109_device::device_start()
{
	if (m_screen.found())
	{
		// make sure our screen is started
		if (!m_screen->started())
			throw device_missing_dependencies();

		// and register a callback for vblank state
		m_screen->register_vblank_callback(vblank_state_delegate(&k052109_device::vblank_callback, this));
	}

	decode_gfx();
	gfx(0)->set_colors(palette().entries() / gfx(0)->depth());

	m_ram = make_unique_clear<uint8_t[]>(0x6000);

	m_colorram_F = &m_ram[0x0000];
	m_colorram_A = &m_ram[0x0800];
	m_colorram_B = &m_ram[0x1000];
	m_videoram_F = &m_ram[0x2000];
	m_videoram_A = &m_ram[0x2800];
	m_videoram_B = &m_ram[0x3000];
	m_videoram2_F = &m_ram[0x4000];
	m_videoram2_A = &m_ram[0x4800];
	m_videoram2_B = &m_ram[0x5000];

	m_tilemap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
	m_tilemap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
	m_tilemap[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);

	m_tilemap[0]->set_transparent_pen(0);
	m_tilemap[1]->set_transparent_pen(0);
	m_tilemap[2]->set_transparent_pen(0);

	// bind callbacks
	m_k052109_cb.bind_relative_to(*owner());

	// resolve callbacks
	m_irq_handler.resolve_safe();
	m_firq_handler.resolve_safe();
	m_nmi_handler.resolve_safe();

	save_pointer(NAME(m_ram), 0x6000);
	save_item(NAME(m_rmrd_line));
	save_item(NAME(m_romsubbank));
	save_item(NAME(m_scrollctrl));
	save_item(NAME(m_irq_enabled));
	save_item(NAME(m_charrombank));
	save_item(NAME(m_charrombank_2));
	save_item(NAME(m_has_extra_video_ram));
}
Example #17
0
void tc0280grd_device::device_start()
{
	if(!m_gfxdecode->started())
		throw device_missing_dependencies();

	m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0280grd_device::tc0280grd_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
	m_tilemap->set_transparent_pen(0);

	m_ram = make_unique_clear<UINT16[]>(TC0280GRD_RAM_SIZE / 2);

	save_pointer(NAME(m_ram.get()), TC0280GRD_RAM_SIZE / 2);
	save_item(NAME(m_ctrl));
}
Example #18
0
void vs920a_text_tilemap_device::device_start()
{
	if(!m_gfxdecode->started())
		throw device_missing_dependencies();

	m_vram = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x1000/2);
	save_pointer(NAME(m_vram), 0x1000/2);
	save_item(NAME(m_pal_base));


	m_tmap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(vs920a_text_tilemap_device::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
	m_tmap->set_transparent_pen(0);
}
Example #19
0
void vs920a_text_tilemap_device::device_start()
{
	if(!m_gfxdecode->started())
		throw device_missing_dependencies();

	m_vram = make_unique_clear<uint16_t[]>(0x1000/2);
	save_pointer(NAME(m_vram.get()), 0x1000/2);
	save_item(NAME(m_pal_base));


	m_tmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(vs920a_text_tilemap_device::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
	m_tmap->set_transparent_pen(0);
}
Example #20
0
void isa8_mda_device::device_start()
{
	if (m_palette != NULL && !m_palette->started())
		throw device_missing_dependencies();

	set_isa_device();
	m_videoram.resize(0x1000);
	m_isa->install_device(0x3b0, 0x3bf, 0, 0, read8_delegate( FUNC(isa8_mda_device::io_read), this ), write8_delegate( FUNC(isa8_mda_device::io_write), this ) );
	m_isa->install_bank(0xb0000, 0xb0fff, 0, 0x07000, "bank_mda", m_videoram);

	/* Initialise the mda palette */
	for(int i = 0; i < 4; i++)
		m_palette->set_pen_color(i, rgb_t(mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]));
}
Example #21
0
void laserdisc_device::device_start()
{
	// if we have a palette and it's not started, wait for it
	if (m_overlay_palette != nullptr && !m_overlay_palette->started())
		throw device_missing_dependencies();

	// initialize the various pieces
	init_disc();
	init_video();
	init_audio();

	// register callbacks
	machine().configuration().config_register("laserdisc", config_saveload_delegate(FUNC(laserdisc_device::config_load), this), config_saveload_delegate(FUNC(laserdisc_device::config_save), this));
}
Example #22
0
void isa8_hercules_device::device_start()
{
	if (m_palette != nullptr && !m_palette->started())
		throw device_missing_dependencies();

	m_videoram.resize(0x10000);
	set_isa_device();
	m_isa->install_device(0x3b0, 0x3bf, 0, 0, read8_delegate( FUNC(isa8_hercules_device::io_read), this ), write8_delegate( FUNC(isa8_hercules_device::io_write), this ) );
	m_isa->install_bank(0xb0000, 0xbffff, 0, 0, "bank_hercules", &m_videoram[0]);

	/* Initialise the mda palette */
	for(int i = 0; i < (sizeof(mda_palette) / 3); i++)
		m_palette->set_pen_color(i, mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]);
}
void driver_device::device_start()
{
	// bind our legacy callbacks
	for (int index = 0; index < ARRAY_LENGTH(m_legacy_callbacks); index++)
		if (m_legacy_callbacks[index] != NULL)
			m_callbacks[index] = driver_callback_delegate(m_legacy_callbacks[index], "legacy_callback", &machine());

	// reschedule ourselves to be last
	device_iterator iter(*this);
	for (device_t *test = iter.first(); test != NULL; test = iter.next())
		if (test != this && !test->started())
			throw device_missing_dependencies();

	// call the game-specific init
	if (m_system->driver_init != NULL)
		(*m_system->driver_init)(machine());

	// finish image devices init process
	image_postdevice_init(machine());

	// call palette_init if present
	if (!m_callbacks[CB_PALETTE_INIT].isnull())
		m_callbacks[CB_PALETTE_INIT]();
	else
		palette_init();

	// start the various pieces
	driver_start();

	if (!m_callbacks[CB_MACHINE_START].isnull())
		m_callbacks[CB_MACHINE_START]();
	else
		machine_start();

	if (!m_callbacks[CB_SOUND_START].isnull())
		m_callbacks[CB_SOUND_START]();
	else
		sound_start();

	if (!m_callbacks[CB_VIDEO_START].isnull())
		m_callbacks[CB_VIDEO_START]();
	else
		video_start();

	// save generic states
	save_item(NAME(m_flip_screen_x));
	save_item(NAME(m_flip_screen_y));
}
Example #24
0
void device_sound_interface::interface_pre_start()
{
	// scan all the sound devices
	device_sound_interface *sound = NULL;
	for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
	{
		// scan each route on the device
		for (const device_config_sound_interface::sound_route *route = sound->sound_config().m_route_list; route != NULL; route = route->m_next)
		{
			// if we are the target of this route but the source hasn't yet started, defer our start for later
			device_t *target_device = m_device.machine->device(route->m_target);
			if (target_device == &m_device && !sound->device().started())
				throw device_missing_dependencies();
		}
	}
}
Example #25
0
void laserdisc_device::device_start()
{
	// ensure that our screen is started first
	m_screen = machine().device<screen_device>(m_screen_name);
	assert(m_screen != NULL);
	if (!m_screen->started())
		throw device_missing_dependencies();

	// initialize the various pieces
	init_disc();
	init_video();
	init_audio();

	// register callbacks
	config_register(machine(), "laserdisc", config_saveload_delegate(FUNC(laserdisc_device::config_load), this), config_saveload_delegate(FUNC(laserdisc_device::config_save), this));
}
Example #26
0
void epson_tf20_device::device_start()
{
	// make sure the ram device is already running
	if (!m_ram->started())
		throw device_missing_dependencies();

	m_timer_serial = timer_alloc(0, nullptr);
	m_timer_tc = timer_alloc(1, nullptr);

	m_fd0 = subdevice<floppy_connector>("5a:0")->get_device();
	m_fd1 = subdevice<floppy_connector>("5a:1")->get_device();

	// enable second half of ram
	m_cpu->space(AS_PROGRAM).install_ram(0x8000, 0xffff, m_ram->pointer() + 0x8000);

}
Example #27
0
static DEVICE_START(coco_cartridge)
{
	device_t *cartslot;
	coco_cartridge_t *cococart = get_token(device);
	const cococart_config *config = (const cococart_config *) downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
   int i;

	/* initialize */
	memset(cococart, 0, sizeof(*cococart));

	/* access the PCB, and get the read/write handlers */
	cartslot = device->subdevice(CARTSLOT_TAG);
	if (cartslot != NULL)
	{
		cococart->pcb = cartslot_get_pcb(cartslot);
		if (cococart->pcb == NULL)
		{
			throw device_missing_dependencies();
		}

      cococart->pcb_r = (read8_device_func)downcast<const legacy_cart_slot_device_config_base *>(&cococart->pcb->baseconfig())->get_config_fct(COCOCARTINFO_FCT_FF40_R);
      cococart->pcb_w = (write8_device_func)downcast<const legacy_cart_slot_device_config_base *>(&cococart->pcb->baseconfig())->get_config_fct(COCOCARTINFO_FCT_FF40_W);
	}

	/* finish setup */

	for( i=0; i<TIMER_POOL; i++ )
	{
	   cococart->cart_line.timer[i]		= device->machine().scheduler().timer_alloc(FUNC(cart_timer_callback), (void *) device);
	   cococart->nmi_line.timer[i]		= device->machine().scheduler().timer_alloc(FUNC(nmi_timer_callback), (void *) device);
	   cococart->halt_line.timer[i]		= device->machine().scheduler().timer_alloc(FUNC(halt_timer_callback), (void *) device);
	}

	cococart->cart_line.timer_index     = 0;
	cococart->cart_line.delay		      = 0;
	cococart->cart_line.callback        = config->cart_callback;

	cococart->nmi_line.timer_index      = 0;
	/* 12 allowed one more instruction to finished after the line is pulled */
	cococart->nmi_line.delay		      = 12;
	cococart->nmi_line.callback         = config->nmi_callback;

	cococart->halt_line.timer_index     = 0;
	/* 6 allowed one more instruction to finished after the line is pulled */
	cococart->halt_line.delay		      = 6;
	cococart->halt_line.callback        = config->halt_callback;
}
Example #28
0
void isa8_ega_device::device_start()
{
	if (m_palette != nullptr && !m_palette->started())
		throw device_missing_dependencies();

	set_isa_device();

	for (int i = 0; i < 64; i++ )
	{
		uint8_t r = ( ( i & 0x04 ) ? 0xAA : 0x00 ) + ( ( i & 0x20 ) ? 0x55 : 0x00 );
		uint8_t g = ( ( i & 0x02 ) ? 0xAA : 0x00 ) + ( ( i & 0x10 ) ? 0x55 : 0x00 );
		uint8_t b = ( ( i & 0x01 ) ? 0xAA : 0x00 ) + ( ( i & 0x08 ) ? 0x55 : 0x00 );

		m_palette->set_pen_color( i, r, g, b );
	}

	if(m_default_bios_tag != "iskr3104")
	{
		uint8_t   *dst = memregion(subtag("user2").c_str())->base() + 0x0000;
		uint8_t   *src = memregion(subtag("user1").c_str())->base() + 0x3fff;
		int     i;

		/* Perform the EGA bios address line swaps */
		for( i = 0; i < 0x4000; i++ )
		{
			*dst++ = *src--;
		}
	}
	else
		memcpy(memregion(subtag("user2").c_str())->base(), memregion(subtag("user1").c_str())->base(), 0x4000);

	/* Install 256KB Video ram on our EGA card */
	m_vram = make_unique_clear<uint8_t[]>(256 * 1024);

	m_videoram = m_vram.get();
	m_plane[0] = m_videoram + 0x00000;
	m_plane[1] = m_videoram + 0x10000;
	m_plane[2] = m_videoram + 0x20000;
	m_plane[3] = m_videoram + 0x30000;

	m_isa->install_rom(this, 0xc0000, 0xc3fff, "ega", "user2");
	m_isa->install_device(0x3b0, 0x3bf, read8_delegate(FUNC(isa8_ega_device::pc_ega8_3b0_r), this), write8_delegate(FUNC(isa8_ega_device::pc_ega8_3b0_w), this));
	m_isa->install_device(0x3c0, 0x3cf, read8_delegate(FUNC(isa8_ega_device::pc_ega8_3c0_r), this), write8_delegate(FUNC(isa8_ega_device::pc_ega8_3c0_w), this));
	m_isa->install_device(0x3d0, 0x3df, read8_delegate(FUNC(isa8_ega_device::pc_ega8_3d0_r), this), write8_delegate(FUNC(isa8_ega_device::pc_ega8_3d0_w), this));
}
Example #29
0
void pc080sn_device::device_start()
{
	if(!m_gfxdecode->started())
		throw device_missing_dependencies();

	/* use the given gfx set for bg tiles */
	if (!m_dblwidth) /* standard tilemaps */
	{
		m_tilemap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pc080sn_device::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
		m_tilemap[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pc080sn_device::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
	}
	else    /* double width tilemaps */
	{
		m_tilemap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pc080sn_device::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
		m_tilemap[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pc080sn_device::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
	}

	m_tilemap[0]->set_transparent_pen(0);
	m_tilemap[1]->set_transparent_pen(0);

	m_tilemap[0]->set_scrolldx(-16 + m_x_offset, -16 - m_x_offset);
	m_tilemap[0]->set_scrolldy(m_y_offset, -m_y_offset);
	m_tilemap[1]->set_scrolldx(-16 + m_x_offset, -16 - m_x_offset);
	m_tilemap[1]->set_scrolldy(m_y_offset, -m_y_offset);

	if (!m_dblwidth)
	{
		m_tilemap[0]->set_scroll_rows(512);
		m_tilemap[1]->set_scroll_rows(512);
	}

	m_ram = auto_alloc_array_clear(machine(), UINT16, PC080SN_RAM_SIZE / 2);

	m_bg_ram[0]       = m_ram + 0x0000 /2;
	m_bg_ram[1]       = m_ram + 0x8000 /2;
	m_bgscroll_ram[0] = m_ram + 0x4000 /2;
	m_bgscroll_ram[1] = m_ram + 0xc000 /2;

	save_pointer(NAME(m_ram), PC080SN_RAM_SIZE / 2);
	save_item(NAME(m_ctrl));
	machine().save().register_postload(save_prepost_delegate(FUNC(pc080sn_device::restore_scroll), this));

}
Example #30
0
void epson_tf20_device::device_start()
{
	// make sure the ram device is already running
	if (!m_ram->started())
		throw device_missing_dependencies();

	m_timer_serial = timer_alloc(0, NULL);
	m_timer_tc = timer_alloc(1, NULL);

	m_cpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(epson_tf20_device::irq_callback),this));

	m_fd0 = subdevice<floppy_connector>("5a:0")->get_device();
	m_fd1 = subdevice<floppy_connector>("5a:1")->get_device();

	m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(epson_tf20_device::fdc_irq), this));

	// enable second half of ram
	m_cpu->space(AS_PROGRAM).install_ram(0x8000, 0xffff, m_ram->pointer() + 0x8000);

}