Beispiel #1
0
void generic_machine_init(running_machine &machine)
{
	generic_machine_private *state;
	int counternum;

	/* allocate our state */
	machine.generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
	state = machine.generic_machine_data;

	/* reset coin counters */
	for (counternum = 0; counternum < COIN_COUNTERS; counternum++)
	{
		state->lastcoin[counternum] = 0;
		state->coinlockedout[counternum] = 0;
	}

	/* register coin save state */
	machine.save().save_item(NAME(state->coin_count));
	machine.save().save_item(NAME(state->coinlockedout));
	machine.save().save_item(NAME(state->lastcoin));

	/* reset memory card info */
	state->memcard_inserted = -1;

	/* register for configuration */
	config_register(machine, "counters", config_saveload_delegate(FUNC(counters_load), &machine), config_saveload_delegate(FUNC(counters_save), &machine));

	/* for memory cards, request save state and an exit callback */
	if (machine.config().m_memcard_handler != NULL)
	{
		machine.save().save_item(NAME(state->memcard_inserted));
		machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(memcard_eject), &machine));
	}
}
void generic_machine_init(running_machine &machine)
{
    generic_machine_private *state;
    int counternum;

    /* allocate our state */
    machine.generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
    state = machine.generic_machine_data;

    /* reset coin counters */
    for (counternum = 0; counternum < COIN_COUNTERS; counternum++)
    {
        state->lastcoin[counternum] = 0;
        state->coinlockedout[counternum] = 0;
    }

    // map devices to the interrupt state
    memset(state->interrupt_device, 0, sizeof(state->interrupt_device));
    device_execute_interface *exec = NULL;
    int index = 0;
    for (bool gotone = machine.devicelist().first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
        state->interrupt_device[index++] = &exec->device();

    /* register coin save state */
    machine.save().save_item(NAME(state->coin_count));
    machine.save().save_item(NAME(state->coinlockedout));
    machine.save().save_item(NAME(state->lastcoin));

    /* reset memory card info */
    state->memcard_inserted = -1;

    /* register a reset callback and save state for interrupt enable */
    machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(interrupt_reset), &machine));
    machine.save().save_item(NAME(state->interrupt_enable));

    /* register for configuration */
    config_register(machine, "counters", config_saveload_delegate(FUNC(counters_load), &machine), config_saveload_delegate(FUNC(counters_save), &machine));

    /* for memory cards, request save state and an exit callback */
    if (machine.config().m_memcard_handler != NULL)
    {
        state_save_register_global(machine, state->memcard_inserted);
        machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(memcard_eject), &machine));
    }
}
void watchdog_init(running_machine &machine)
{
	/* allocate a timer for the watchdog */
	watchdog_timer = machine.scheduler().timer_alloc(FUNC(watchdog_callback));

	machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(watchdog_internal_reset), &machine));

	/* save some stuff in the default tag */
	machine.save().save_item(NAME(watchdog_enabled));
	machine.save().save_item(NAME(watchdog_counter));
}
Beispiel #4
0
device_scheduler::device_scheduler(running_machine &machine) :
	m_machine(machine),
	m_executing_device(NULL),
	m_execute_list(NULL),
	m_basetime(attotime::zero),
	m_timer_list(NULL),
	m_callback_timer(NULL),
	m_callback_timer_modified(false),
	m_callback_timer_expire_time(attotime::zero),
	m_suspend_changes_pending(true),
	m_quantum_minimum(ATTOSECONDS_IN_NSEC(1) / 1000)
{
	// append a single never-expiring timer so there is always one in the list
	m_timer_list = &m_timer_allocator.alloc()->init(machine, timer_expired_delegate(), NULL, true);
	m_timer_list->adjust(attotime::never);

	// register global states
	machine.save().save_item(NAME(m_basetime));
	machine.save().register_presave(save_prepost_delegate(FUNC(device_scheduler::presave), this));
	machine.save().register_postload(save_prepost_delegate(FUNC(device_scheduler::postload), this));
}
Beispiel #5
0
bookkeeping_manager::bookkeeping_manager(running_machine &machine)
	: m_machine(machine),
		m_dispensed_tickets(0)
{
	/* reset coin counters */
	for (int counternum = 0; counternum < COIN_COUNTERS; counternum++)
	{
		m_lastcoin[counternum] = 0;
		m_coinlockedout[counternum] = 0;
		m_coin_count[counternum] = 0;
	}

	// register coin save state
	machine.save().save_item(NAME(m_coin_count));
	machine.save().save_item(NAME(m_coinlockedout));
	machine.save().save_item(NAME(m_lastcoin));
	machine.save().save_item(NAME(m_dispensed_tickets));

	// register for configuration
	machine.configuration().config_register("counters", config_load_delegate(&bookkeeping_manager::config_load, this), config_save_delegate(&bookkeeping_manager::config_save, this));
}
Beispiel #6
0
void generic_machine_init(running_machine &machine)
{
	generic_machine_private *state;
	int counternum;

	/* allocate our state */
	machine.generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
	state = machine.generic_machine_data;

	/* reset coin counters */
	for (counternum = 0; counternum < COIN_COUNTERS; counternum++)
	{
		state->lastcoin[counternum] = 0;
		state->coinlockedout[counternum] = 0;
	}

	/* register coin save state */
	machine.save().save_item(NAME(state->coin_count));
	machine.save().save_item(NAME(state->coinlockedout));
	machine.save().save_item(NAME(state->lastcoin));

	/* register for configuration */
	config_register(machine, "counters", config_saveload_delegate(FUNC(counters_load), &machine), config_saveload_delegate(FUNC(counters_save), &machine));
}
Beispiel #7
0
void tms34061_start(running_machine &machine, const struct tms34061_interface *interface)
{
    /* reset the data */
    memset(&tms34061, 0, sizeof(tms34061));
    tms34061.intf = *interface;
    tms34061.screen = downcast<screen_device *>(machine.device(tms34061.intf.screen_tag));
    tms34061.vrammask = tms34061.intf.vramsize - 1;

    /* allocate memory for VRAM */
    tms34061.vram = auto_alloc_array_clear(machine, UINT8, tms34061.intf.vramsize + 256 * 2);
    /* not really a save state, just there for debugging purposes */
    machine.save().save_pointer(NAME(tms34061.vram), tms34061.intf.vramsize);

    /* allocate memory for latch RAM */
    tms34061.latchram = auto_alloc_array_clear(machine, UINT8, tms34061.intf.vramsize + 256 * 2);

    /* add some buffer space for VRAM and latch RAM */
    tms34061.vram += 256;
    tms34061.latchram += 256;

    /* point the shift register to the base of VRAM for now */
    tms34061.shiftreg = tms34061.vram;

    /* initialize registers to their default values from the manual */
    tms34061.regs[TMS34061_HORENDSYNC]   = 0x0010;
    tms34061.regs[TMS34061_HORENDBLNK]   = 0x0020;
    tms34061.regs[TMS34061_HORSTARTBLNK] = 0x01f0;
    tms34061.regs[TMS34061_HORTOTAL]     = 0x0200;
    tms34061.regs[TMS34061_VERENDSYNC]   = 0x0004;
    tms34061.regs[TMS34061_VERENDBLNK]   = 0x0010;
    tms34061.regs[TMS34061_VERSTARTBLNK] = 0x00f0;
    tms34061.regs[TMS34061_VERTOTAL]     = 0x0100;
    tms34061.regs[TMS34061_DISPUPDATE]   = 0x0000;
    tms34061.regs[TMS34061_DISPSTART]    = 0x0000;
    tms34061.regs[TMS34061_VERINT]       = 0x0000;
    tms34061.regs[TMS34061_CONTROL1]     = 0x7000;
    tms34061.regs[TMS34061_CONTROL2]     = 0x0600;
    tms34061.regs[TMS34061_STATUS]       = 0x0000;
    tms34061.regs[TMS34061_XYOFFSET]     = 0x0010;
    tms34061.regs[TMS34061_XYADDRESS]    = 0x0000;
    tms34061.regs[TMS34061_DISPADDRESS]  = 0x0000;
    tms34061.regs[TMS34061_VERCOUNTER]   = 0x0000;

    /* start vertical interrupt timer */
    tms34061.timer = machine.scheduler().timer_alloc(FUNC(tms34061_interrupt));
}
Beispiel #8
0
save_error save_manager::check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...))
{
	// if we want to validate the signature, compute it
	UINT32 sig = 0;
	sig = machine.save().signature();

	// seek to the beginning and read the header
	file.compress(FCOMPRESS_NONE);
	file.seek(0, SEEK_SET);
	UINT8 header[HEADER_SIZE];
	if (file.read(header, sizeof(header)) != sizeof(header))
	{
		if (errormsg != NULL)
			(*errormsg)("Could not read %s save file header",emulator_info::get_appname());
		return STATERR_READ_ERROR;
	}

	// let the generic header check work out the rest
	return validate_header(header, gamename, sig, errormsg, "");
}
Beispiel #9
0
void atari_machine_start(running_machine &machine)
{
	gtia_interface gtia_intf;

	/* GTIA */
	memset(&gtia_intf, 0, sizeof(gtia_intf));
	if (machine.root_device().ioport("console") != NULL)
		gtia_intf.console_read = console_read;
	if (machine.device<dac_device>("dac") != NULL)
		gtia_intf.console_write = console_write;
	gtia_init(machine, &gtia_intf);

	/* pokey */
	machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(pokey_reset), &machine));

	/* ANTIC */
	machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(_antic_reset), &machine));

	/* save states */
	machine.save().save_pointer(NAME((UINT8 *) &antic.r), sizeof(antic.r));
	machine.save().save_pointer(NAME((UINT8 *) &antic.w), sizeof(antic.w));
}
Beispiel #10
0
video_manager::video_manager(running_machine &machine)
	: m_machine(machine),
		m_screenless_frame_timer(nullptr),
		m_output_changed(false),
		m_throttle_last_ticks(0),
		m_throttle_realtime(attotime::zero),
		m_throttle_emutime(attotime::zero),
		m_throttle_history(0),
		m_speed_last_realtime(0),
		m_speed_last_emutime(attotime::zero),
		m_speed_percent(1.0),
		m_overall_real_seconds(0),
		m_overall_real_ticks(0),
		m_overall_emutime(attotime::zero),
		m_overall_valid_counter(0),
		m_throttled(machine.options().throttle()),
		m_throttle_rate(1.0f),
		m_fastforward(false),
		m_seconds_to_run(machine.options().seconds_to_run()),
		m_auto_frameskip(machine.options().auto_frameskip()),
		m_speed(original_speed_setting()),
		m_empty_skip_count(0),
		m_frameskip_level(machine.options().frameskip()),
		m_frameskip_counter(0),
		m_frameskip_adjust(0),
		m_skipping_this_frame(false),
		m_average_oversleep(0),
		m_snap_target(nullptr),
		m_snap_native(true),
		m_snap_width(0),
		m_snap_height(0),
		m_mng_frame_period(attotime::zero),
		m_mng_next_frame_time(attotime::zero),
		m_mng_frame(0),
		m_avi_file(nullptr),
		m_avi_frame_period(attotime::zero),
		m_avi_next_frame_time(attotime::zero),
		m_avi_frame(0),
		m_dummy_recording(false),
		m_timecode_enabled(false),
		m_timecode_write(false),
		m_timecode_text(""),
		m_timecode_start(attotime::zero),
		m_timecode_total(attotime::zero)

{
	// request a callback upon exiting
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(video_manager::exit), this));
	machine.save().register_postload(save_prepost_delegate(FUNC(video_manager::postload), this));

	// extract initial execution state from global configuration settings
	update_refresh_speed();

	// create a render target for snapshots
	const char *viewname = machine.options().snap_view();
	m_snap_native = (machine.first_screen() != nullptr && (viewname[0] == 0 || strcmp(viewname, "native") == 0));

	// the native target is hard-coded to our internal layout and has all options disabled
	if (m_snap_native)
	{
		m_snap_target = machine.render().target_alloc(layout_snap, RENDER_CREATE_SINGLE_FILE | RENDER_CREATE_HIDDEN);
		m_snap_target->set_backdrops_enabled(false);
		m_snap_target->set_overlays_enabled(false);
		m_snap_target->set_bezels_enabled(false);
		m_snap_target->set_cpanels_enabled(false);
		m_snap_target->set_marquees_enabled(false);
		m_snap_target->set_screen_overlay_enabled(false);
		m_snap_target->set_zoom_to_screen(false);
	}

	// other targets select the specified view and turn off effects
	else
	{
		m_snap_target = machine.render().target_alloc(nullptr, RENDER_CREATE_HIDDEN);
		m_snap_target->set_view(m_snap_target->configured_view(viewname, 0, 1));
		m_snap_target->set_screen_overlay_enabled(false);
	}

	// extract snap resolution if present
	if (sscanf(machine.options().snap_size(), "%dx%d", &m_snap_width, &m_snap_height) != 2)
		m_snap_width = m_snap_height = 0;

	// start recording movie if specified
	const char *filename = machine.options().mng_write();
	if (filename[0] != 0)
		begin_recording(filename, MF_MNG);

	filename = machine.options().avi_write();
	if (filename[0] != 0)
		begin_recording(filename, MF_AVI);

#ifdef MAME_DEBUG
	m_dummy_recording = machine.options().dummy_write();
#endif

	// if no screens, create a periodic timer to drive updates
	if (machine.first_screen() == nullptr)
	{
		m_screenless_frame_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(video_manager::screenless_update_callback), this));
		m_screenless_frame_timer->adjust(screen_device::DEFAULT_FRAME_PERIOD, 0, screen_device::DEFAULT_FRAME_PERIOD);
		machine.output().set_notifier(nullptr, video_notifier_callback, this);
	}
}
Beispiel #11
0
static void gtia_state(running_machine &machine)
{
	machine.save().save_item(NAME(gtia.r.m0pf));
	machine.save().save_item(NAME(gtia.r.m1pf));
	machine.save().save_item(NAME(gtia.r.m2pf));
	machine.save().save_item(NAME(gtia.r.m3pf));
	machine.save().save_item(NAME(gtia.r.p0pf));
	machine.save().save_item(NAME(gtia.r.p1pf));
	machine.save().save_item(NAME(gtia.r.p2pf));
	machine.save().save_item(NAME(gtia.r.p3pf));
	machine.save().save_item(NAME(gtia.r.m0pl));
	machine.save().save_item(NAME(gtia.r.m1pl));
	machine.save().save_item(NAME(gtia.r.m2pl));
	machine.save().save_item(NAME(gtia.r.m3pl));
	machine.save().save_item(NAME(gtia.r.p0pl));
	machine.save().save_item(NAME(gtia.r.p1pl));
	machine.save().save_item(NAME(gtia.r.p2pl));
	machine.save().save_item(NAME(gtia.r.p3pl));
	machine.save().save_item(NAME(gtia.r.but));
	machine.save().save_item(NAME(gtia.r.pal));
	machine.save().save_item(NAME(gtia.r.gtia15));
	machine.save().save_item(NAME(gtia.r.gtia16));
	machine.save().save_item(NAME(gtia.r.gtia17));
	machine.save().save_item(NAME(gtia.r.gtia18));
	machine.save().save_item(NAME(gtia.r.gtia19));
	machine.save().save_item(NAME(gtia.r.gtia1a));
	machine.save().save_item(NAME(gtia.r.gtia1b));
	machine.save().save_item(NAME(gtia.r.gtia1c));
	machine.save().save_item(NAME(gtia.r.gtia1d));
	machine.save().save_item(NAME(gtia.r.gtia1e));
	machine.save().save_item(NAME(gtia.r.cons));
	machine.save().save_item(NAME(gtia.w.hposp0));
	machine.save().save_item(NAME(gtia.w.hposp1));
	machine.save().save_item(NAME(gtia.w.hposp2));
	machine.save().save_item(NAME(gtia.w.hposp3));
	machine.save().save_item(NAME(gtia.w.hposm0));
	machine.save().save_item(NAME(gtia.w.hposm1));
	machine.save().save_item(NAME(gtia.w.hposm2));
	machine.save().save_item(NAME(gtia.w.hposm3));
	machine.save().save_item(NAME(gtia.w.sizep0));
	machine.save().save_item(NAME(gtia.w.sizep1));
	machine.save().save_item(NAME(gtia.w.sizep2));
	machine.save().save_item(NAME(gtia.w.sizep3));
	machine.save().save_item(NAME(gtia.w.sizem));
	machine.save().save_item(NAME(gtia.w.grafp0));
	machine.save().save_item(NAME(gtia.w.grafp1));
	machine.save().save_item(NAME(gtia.w.grafp2));
	machine.save().save_item(NAME(gtia.w.grafp3));
	machine.save().save_item(NAME(gtia.w.grafm));
	machine.save().save_item(NAME(gtia.w.colpm0));
	machine.save().save_item(NAME(gtia.w.colpm1));
	machine.save().save_item(NAME(gtia.w.colpm2));
	machine.save().save_item(NAME(gtia.w.colpm3));
	machine.save().save_item(NAME(gtia.w.colpf0));
	machine.save().save_item(NAME(gtia.w.colpf1));
	machine.save().save_item(NAME(gtia.w.colpf2));
	machine.save().save_item(NAME(gtia.w.colpf3));
	machine.save().save_item(NAME(gtia.w.colbk));
	machine.save().save_item(NAME(gtia.w.prior));
	machine.save().save_item(NAME(gtia.w.vdelay));
	machine.save().save_item(NAME(gtia.w.gractl));
	machine.save().save_item(NAME(gtia.w.hitclr));
	machine.save().save_item(NAME(gtia.w.cons));
	machine.save().register_postload(save_prepost_delegate(FUNC(gtia_state_postload), &machine));
}
Beispiel #12
0
static void gtia_state(running_machine &machine)
{
	state_save_register_global(machine, gtia.r.m0pf);
	state_save_register_global(machine, gtia.r.m1pf);
	state_save_register_global(machine, gtia.r.m2pf);
	state_save_register_global(machine, gtia.r.m3pf);
	state_save_register_global(machine, gtia.r.p0pf);
	state_save_register_global(machine, gtia.r.p1pf);
	state_save_register_global(machine, gtia.r.p2pf);
	state_save_register_global(machine, gtia.r.p3pf);
	state_save_register_global(machine, gtia.r.m0pl);
	state_save_register_global(machine, gtia.r.m1pl);
	state_save_register_global(machine, gtia.r.m2pl);
	state_save_register_global(machine, gtia.r.m3pl);
	state_save_register_global(machine, gtia.r.p0pl);
	state_save_register_global(machine, gtia.r.p1pl);
	state_save_register_global(machine, gtia.r.p2pl);
	state_save_register_global(machine, gtia.r.p3pl);
	state_save_register_global_array(machine, gtia.r.but);
	state_save_register_global(machine, gtia.r.pal);
	state_save_register_global(machine, gtia.r.gtia15);
	state_save_register_global(machine, gtia.r.gtia16);
	state_save_register_global(machine, gtia.r.gtia17);
	state_save_register_global(machine, gtia.r.gtia18);
	state_save_register_global(machine, gtia.r.gtia19);
	state_save_register_global(machine, gtia.r.gtia1a);
	state_save_register_global(machine, gtia.r.gtia1b);
	state_save_register_global(machine, gtia.r.gtia1c);
	state_save_register_global(machine, gtia.r.gtia1d);
	state_save_register_global(machine, gtia.r.gtia1e);
	state_save_register_global(machine, gtia.r.cons);
	state_save_register_global(machine, gtia.w.hposp0);
	state_save_register_global(machine, gtia.w.hposp1);
	state_save_register_global(machine, gtia.w.hposp2);
	state_save_register_global(machine, gtia.w.hposp3);
	state_save_register_global(machine, gtia.w.hposm0);
	state_save_register_global(machine, gtia.w.hposm1);
	state_save_register_global(machine, gtia.w.hposm2);
	state_save_register_global(machine, gtia.w.hposm3);
	state_save_register_global(machine, gtia.w.sizep0);
	state_save_register_global(machine, gtia.w.sizep1);
	state_save_register_global(machine, gtia.w.sizep2);
	state_save_register_global(machine, gtia.w.sizep3);
	state_save_register_global(machine, gtia.w.sizem);
	state_save_register_global_array(machine, gtia.w.grafp0);
	state_save_register_global_array(machine, gtia.w.grafp1);
	state_save_register_global_array(machine, gtia.w.grafp2);
	state_save_register_global_array(machine, gtia.w.grafp3);
	state_save_register_global_array(machine, gtia.w.grafm);
	state_save_register_global(machine, gtia.w.colpm0);
	state_save_register_global(machine, gtia.w.colpm1);
	state_save_register_global(machine, gtia.w.colpm2);
	state_save_register_global(machine, gtia.w.colpm3);
	state_save_register_global(machine, gtia.w.colpf0);
	state_save_register_global(machine, gtia.w.colpf1);
	state_save_register_global(machine, gtia.w.colpf2);
	state_save_register_global(machine, gtia.w.colpf3);
	state_save_register_global(machine, gtia.w.colbk);
	state_save_register_global(machine, gtia.w.prior);
	state_save_register_global(machine, gtia.w.vdelay);
	state_save_register_global(machine, gtia.w.gractl);
	state_save_register_global(machine, gtia.w.hitclr);
	state_save_register_global(machine, gtia.w.cons);
	machine.save().register_postload(save_prepost_delegate(FUNC(gtia_state_postload), &machine));
}
Beispiel #13
0
video_manager::video_manager(running_machine &machine)
	: m_machine(machine)
	, m_screenless_frame_timer(nullptr)
	, m_output_changed(false)
	, m_throttle_last_ticks(0)
	, m_throttle_realtime(attotime::zero)
	, m_throttle_emutime(attotime::zero)
	, m_throttle_history(0)
	, m_speed_last_realtime(0)
	, m_speed_last_emutime(attotime::zero)
	, m_speed_percent(1.0)
	, m_overall_real_seconds(0)
	, m_overall_real_ticks(0)
	, m_overall_emutime(attotime::zero)
	, m_overall_valid_counter(0)
	, m_throttled(machine.options().throttle())
	, m_throttle_rate(1.0f)
	, m_fastforward(false)
	, m_seconds_to_run(machine.options().seconds_to_run())
	, m_auto_frameskip(machine.options().auto_frameskip())
	, m_speed(original_speed_setting())
	, m_empty_skip_count(0)
	, m_frameskip_level(machine.options().frameskip())
	, m_frameskip_counter(0)
	, m_frameskip_adjust(0)
	, m_skipping_this_frame(false)
	, m_average_oversleep(0)
	, m_snap_target(nullptr)
	, m_snap_native(true)
	, m_snap_width(0)
	, m_snap_height(0)
	, m_timecode_enabled(false)
	, m_timecode_write(false)
	, m_timecode_text("")
	, m_timecode_start(attotime::zero)
	, m_timecode_total(attotime::zero)
{
	// request a callback upon exiting
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&video_manager::exit, this));
	machine.save().register_postload(save_prepost_delegate(FUNC(video_manager::postload), this));

	// extract initial execution state from global configuration settings
	update_refresh_speed();

	const unsigned screen_count(screen_device_iterator(machine.root_device()).count());
	const bool no_screens(!screen_count);

	// create a render target for snapshots
	const char *viewname = machine.options().snap_view();
	m_snap_native = !no_screens && (viewname[0] == 0 || strcmp(viewname, "native") == 0);

	if (m_snap_native)
	{
		// the native target is hard-coded to our internal layout and has all options disabled
		util::xml::file::ptr const root(util::xml::file::create());
		if (!root)
			throw emu_fatalerror("Couldn't create XML document??");
		util::xml::data_node *const layoutnode(root->add_child("mamelayout", nullptr));
		if (!layoutnode)
			throw emu_fatalerror("Couldn't create XML node??");
		layoutnode->set_attribute_int("version", 2);

		for (unsigned i = 0; screen_count > i; ++i)
		{
			util::xml::data_node *const viewnode(layoutnode->add_child("view", nullptr));
			if (!viewnode)
				throw emu_fatalerror("Couldn't create XML node??");
			viewnode->set_attribute("name", util::xml::normalize_string(util::string_format("s%1$u", i).c_str()));
			util::xml::data_node *const screennode(viewnode->add_child("screen", nullptr));
			if (!screennode)
				throw emu_fatalerror("Couldn't create XML node??");
			screennode->set_attribute_int("index", i);
			util::xml::data_node *const boundsnode(screennode->add_child("bounds", nullptr));
			if (!boundsnode)
				throw emu_fatalerror("Couldn't create XML node??");
			boundsnode->set_attribute_int("left", 0);
			boundsnode->set_attribute_int("top", 0);
			boundsnode->set_attribute_int("right", 1);
			boundsnode->set_attribute_int("bottom", 1);
		}

		m_snap_target = machine.render().target_alloc(*root, RENDER_CREATE_SINGLE_FILE | RENDER_CREATE_HIDDEN);
		m_snap_target->set_backdrops_enabled(false);
		m_snap_target->set_overlays_enabled(false);
		m_snap_target->set_bezels_enabled(false);
		m_snap_target->set_cpanels_enabled(false);
		m_snap_target->set_marquees_enabled(false);
		m_snap_target->set_screen_overlay_enabled(false);
		m_snap_target->set_zoom_to_screen(false);
	}
	else
	{
		// otherwise, non-default targets select the specified view and turn off effects
		m_snap_target = machine.render().target_alloc(nullptr, RENDER_CREATE_HIDDEN);
		m_snap_target->set_view(m_snap_target->configured_view(viewname, 0, 1));
		m_snap_target->set_screen_overlay_enabled(false);
	}

	// extract snap resolution if present
	if (sscanf(machine.options().snap_size(), "%dx%d", &m_snap_width, &m_snap_height) != 2)
		m_snap_width = m_snap_height = 0;

	// start recording movie if specified
	const char *filename = machine.options().mng_write();
	if (filename[0] != 0)
		begin_recording(filename, MF_MNG);

	filename = machine.options().avi_write();
	if (filename[0] != 0)
		begin_recording(filename, MF_AVI);

	// if no screens, create a periodic timer to drive updates
	if (no_screens)
	{
		m_screenless_frame_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(video_manager::screenless_update_callback), this));
		m_screenless_frame_timer->adjust(screen_device::DEFAULT_FRAME_PERIOD, 0, screen_device::DEFAULT_FRAME_PERIOD);
		machine.output().set_notifier(nullptr, video_notifier_callback, this);
	}
}
Beispiel #14
0
void k055555_device::K055555_vh_start(running_machine &machine)
{
	machine.save().save_item(NAME(m_regs));

	memset(m_regs, 0, 64*sizeof(UINT8));
}