示例#1
0
static TIMER_CALLBACK( watchdog_callback )
{
	logerror("Reset caused by the watchdog!!!\n");

#ifdef MAME_DEBUG
	popmessage("Reset caused by the watchdog!!!\n");
#endif

	mame_schedule_soft_reset(machine);
}
示例#2
0
static void watchdog_timeout( int unused )
{
	mame_schedule_soft_reset(Machine);
}
示例#3
0
文件: image.c 项目: broftkd/mess-cvs
static int image_load_internal(mess_image *image, const char *path,
	int is_create, int create_format, option_resolution *create_args)
{
	image_error_t err;
	const char *software_path;
	char *software_path_list = NULL;
	const void *buffer;
	const game_driver *gamedrv;
	UINT32 open_plan[4];
	int i;

	/* sanity checks */
	assert_always(image, "image_load(): image is NULL");
	assert_always(path, "image_load(): path is NULL");

	/* we are now loading */
	image->is_loading = 1;

	/* first unload the image */
	image_unload(image);

	/* record the filename */
	image->err = set_image_filename(image, path, NULL);
	if (image->err)
		goto done;

	/* tell the OSD layer that this is changing */
	osd_image_load_status_changed(image, 0);

	/* do we need to reset the CPU? */
	if ((timer_get_time() > 0) && image->dev->reset_on_load)
		mame_schedule_soft_reset(Machine);

	/* determine open plan */
	determine_open_plan(image, is_create, open_plan);

	/* attempt to open the file in various ways */
	for (i = 0; !image->file && open_plan[i]; i++)
	{
		software_path = software_path_list;
		do
		{
			gamedrv = Machine->gamedrv;
			while(!is_loaded(image) && gamedrv)
			{
				/* open the file */
				image->err = load_image_by_path(image, software_path, gamedrv, open_plan[i], path);
				if (image->err && (image->err != IMAGE_ERROR_FILENOTFOUND))
					goto done;

				/* move on to the next driver */
				gamedrv = mess_next_compatible_driver(gamedrv);
			}

			/* move on to the next entry in the software path; if we can */
			if (software_path)
				software_path += strlen(software_path) + 1;
		}
		while(!is_loaded(image) && software_path && *software_path);
	}

	/* did we fail to find the file? */
	if (!is_loaded(image))
	{
		image->err = IMAGE_ERROR_FILENOTFOUND;
		goto done;
	}

	/* if applicable, call device verify */
	if (image->dev->imgverify && !image_has_been_created(image))
	{
		/* access the memory */
		buffer = image_ptr(image);
		if (!buffer)
		{
			image->err = IMAGE_ERROR_OUTOFMEMORY;
			goto done;
		}

		/* verify the file */
		err = image->dev->imgverify(buffer, (size_t) image->length);
		if (err)
		{
			image->err = IMAGE_ERROR_INVALIDIMAGE;
			goto done;
		}
	}

	/* call device load or create */
	if (image_has_been_created(image) && image->dev->create)
	{
		err = image->dev->create(image, create_format, create_args);
		if (err)
		{
			if (!image->err)
				image->err = IMAGE_ERROR_UNSPECIFIED;
			goto done;
		}
	}
	else if (image->dev->load)
	{
		/* using device load */
		err = image->dev->load(image);
		if (err)
		{
			if (!image->err)
				image->err = IMAGE_ERROR_UNSPECIFIED;
			goto done;
		}
	}

	/* success! */

done:
	if (software_path_list)
		free(software_path_list);
	if (image->err)
		image_clear(image);
	image->is_loading = 1;
	return image->err ? INIT_FAIL : INIT_PASS;
}
示例#4
0
static void command_reset(void)
{
	mame_schedule_soft_reset(Machine);
}
示例#5
0
static TIMER_CALLBACK( watchdog_timeout )
{
	mame_schedule_soft_reset(machine);
}
示例#6
0
void on_soft_reset_activate(GtkMenuItem *item, gpointer user_data)
{
	mame_schedule_soft_reset((running_machine *)user_data);
	debug_cpu_go((running_machine *)user_data, ~0);
}