Esempio n. 1
0
File: osd.c Progetto: iolo/liteamp
static void osd_instance_finalize(GObject * gobject)
{
    Osd *self = OSD(gobject);

    g_object_unref(self->mask);
    g_object_unref(self->layout);
}
Esempio n. 2
0
int main (int argc, char *argv[])
{
	const char *snapshot;
	atexit(shutdown_sdl);
	if (SDL_Init(
#ifdef __EMSCRIPTEN__
		// It seems there is an issue with emscripten SDL2: SDL_Init does not work if TIMER and/or HAPTIC is tried to be intialized or just "EVERYTHING" is used!!
		SDL_INIT_EVERYTHING & ~(SDL_INIT_TIMER | SDL_INIT_HAPTIC)
#else
		SDL_INIT_EVERYTHING
#endif
	) != 0) {
		ERROR_WINDOW("Fatal SDL initialization problem: %s", SDL_GetError());
		return 1;
	}
	if (config_init(argc, argv)) {
#ifdef __EMSCRIPTEN__
		ERROR_WINDOW("Error with config parsing. Please check the (javascript) console of your browser to learn about the error.");
#endif
		return 1;
	}
	guarded_exit = 1;	// turn on guarded exit, with custom de-init stuffs
	DEBUGPRINT("EMU: sleeping = \"%s\", timing = \"%s\"" NL,
		__SLEEP_METHOD_DESC, __TIMING_METHOD_DESC
	);
	fileio_init(
#ifdef __EMSCRIPTEN__
		"/",
#else
		app_pref_path,
#endif
	"files");
	if (screen_init())
		return 1;
	if (xepgui_init())
		return 1;
	audio_init(config_getopt_int("audio"));
	z80ex_init();
	set_ep_cpu(CPU_Z80);
	ep_pixels = nick_init();
	if (ep_pixels == NULL)
		return 1;
	snapshot = config_getopt_str("snapshot");
	if (strcmp(snapshot, "none")) {
		if (ep128snap_load(snapshot))
			snapshot = NULL;
	} else
		snapshot = NULL;
	if (!snapshot) {
		if (roms_load())
			return 1;
		primo_rom_seg = primo_search_rom();
		ep_set_ram_config(config_getopt_str("ram"));
	}
	mouse_setup(config_getopt_int("mousemode"));
	ep_reset();
	kbd_matrix_reset();
	joy_sdl_event(NULL); // this simply inits joy layer ...
#ifdef CONFIG_SDEXT_SUPPORT
	if (!snapshot)
		sdext_init();
#endif
#ifdef CONFIG_EXDOS_SUPPORT
	wd_exdos_reset();
	wd_attach_disk_image(config_getopt_str("wdimg"));
#endif
#ifdef CONFIG_W5300_SUPPORT
	w5300_init(NULL);
#endif
	ticks = SDL_GetTicks();
	balancer = 0;
	set_cpu_clock(DEFAULT_CPU_CLOCK);
	emu_timekeeping_start();
	audio_start();
	if (config_getopt_int("fullscreen"))
		screen_set_fullscreen(1);
	DEBUGPRINT(NL "EMU: entering into main emulation loop" NL);
	sram_ready = 1;
	if (strcmp(config_getopt_str("primo"), "none") && !snapshot) {
		// TODO: da stuff ...
		primo_emulator_execute();
		OSD("Primo Emulator Mode");
	}
	if (snapshot)
		ep128snap_set_cpu_and_io();
	console_monitor_ready();	// OK to run monitor on console now!
#ifdef __EMSCRIPTEN__
	emscripten_set_main_loop(xep128_emulation, 50, 1);
#else
	for (;;)
		xep128_emulation();
#endif
	printf("EXITING FROM main()?!" NL);
	return 0;
}
Esempio n. 3
0
int set_cpu_clock_with_osd ( int hz )
{
	hz = set_cpu_clock(hz);
	OSD("CPU speed: %.2f MHz", hz / 1000000.0);
	return hz;
}