Example #1
0
File: osint.c Project: visy/vecx
int main(int argc, char *argv[]){
	if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0){
		fprintf(stderr, "Failed to initialize SDL: %s\n", SDL_GetError());
		exit(-1);
	}

	resize(330*3/2, 410*3/2);

	if(argc > 1)
		cartfilename = argv[1];
	if(argc > 2)
		load_overlay(argv[2]);

	init();

	e8910_init_sound();
	osint_emuloop();
#ifdef EMSCRIPTEN
	emscripten_set_main_loop(mainloop, 60, 1);
#else
	for(;;)mainloop();
#endif
	e8910_done_sound();
	SDL_Quit();

	return 0;
}
Example #2
0
qload_overlay()
{
int how;
char buf1[30];
char buf2[30];
char *iname;

iname = ink_word();
sprintf(buf1, overlay_107 /* "Overlay %s" */, iname);
sprintf(buf2, overlay_108 /* "Underlay %s" */, iname);
overlay_options[0] = buf1;
overlay_options[1] = buf2;
how = qchoice(overlay_109 /* "Composite functions" */, 
	overlay_options, Array_els(overlay_options) );
if (how != 0)
	{
	unzoom();
	push_inks();
	ink_push_cel();
	load_overlay(how-1);
	ink_pop_cel();
	pop_inks();
	rezoom();
	}
}
Example #3
0
NatePixTable::Frame::Frame(
        Rect bounds, const PixMap& image, int16_t id, int frame, const PixMap& overlay,
        uint8_t color)
        : _bounds(bounds), _pix_map(bounds.width(), bounds.height()) {
    load_image(image);
    load_overlay(overlay, color);
    build(id, frame);
}
Example #4
0
void qload_overlay(void)
{
int how;

	how = soft_qchoice(NULL, "!%s", "composit_mu", vl.ink->ot.name );
	
	if (how >= 0)
	{
		unzoom();
		push_inks();
		ink_push_cel();
		load_overlay(how);
		ink_pop_cel();
		pop_inks();
		rezoom();
	}
}
Example #5
0
int main(int argc, char *argv[]){
	if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0){
		fprintf(stderr, "Failed to initialize SDL: %s\n", SDL_GetError());
		exit(-1);
	}

	resize(330*3/2, 410*3/2);

	if(argc > 1)
		cartfilename = argv[1];
	if(argc > 2)
		load_overlay(argv[2]);

	init();

	e8910_init_sound();
	osint_emuloop();
	e8910_done_sound();
	SDL_Quit();

	return 0;
}
Example #6
0
int main(int argc, char *argv[] )
{
	char msg[1024];
	FILE *cartfile;


    /* Information about the current video settings. */
    const SDL_VideoInfo* info = NULL;

	// get defaults and parse command-line params
	if (osint_defaults ()) {
		return 1;
	}

	osint_parse_cmdline (argc, argv);

	cartfile = fopen (cartname, "rb");

	if (cartfile != NULL) {
		fread (cart, 1, sizeof (cart), cartfile);
		fclose (cartfile);
	} else {
		sprintf (msg, "cannot open '%s'", cartname);
		fprintf(stderr, msg);
	}

    // Initialize SDL's video subsystem
	info = init_sdl();
    //setup_opengl( width, height );

	/* determine a set of colors to use based */
	osint_gencolors ();

#ifdef ENABLE_OVERLAY
	// Load overlay if neccessary (TGA 24-bit uncompressed)
	g_overlay.width = 0;
	if (overlayname)
		load_overlay(overlayname);
#endif

	// set up audio buffering
	reqSpec.freq = 22050;						// Audio frequency in samples per second
	reqSpec.format = AUDIO_U8;					// Audio data format
	reqSpec.channels = 1;						// Number of channels: 1 mono, 2 stereo
	reqSpec.samples = 441;						// Audio buffer size in samples
	reqSpec.callback = fillsoundbuffer;			// Callback function for filling the audio buffer
	reqSpec.userdata = NULL;
	usedSpec = &givenSpec;
	/* Open the audio device */
	if ( SDL_OpenAudio(&reqSpec, usedSpec) < 0 ){
	  fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
	  exit(-1);
	}

	if(usedSpec == NULL)
		usedSpec = &reqSpec;

	// Start playing audio
	SDL_PauseAudio(0);

	/* message loop handler and emulator code */

	osint_emuloop ();

    /*
     * Quit SDL so we can release the fullscreen
     * mode and restore the previous video settings,
     * etc.
     */
    SDL_Quit( );

    /* Exit program. */
    exit( 0 );

	return 0;
// END OF MAIN!!!

}