Ejemplo n.º 1
0
Archivo: osint.c Proyecto: 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;
}
Ejemplo n.º 2
0
int main(int argc, char *argv[]){
#ifndef _WIN32
    SDL_putenv("DINGOO_IGNORE_OS_EVENTS=1");  //HACK to fix "push long time on X" problem
#endif
	if (SDL_Init(SDL_INIT_VIDEO) < 0)
    {
	    fprintf(stderr, "Failed to initialize video: %s\n", SDL_GetError());
	    exit(-1);
    }
    atexit(SDL_Quit);

#ifdef _WIN32
    SDL_putenv("SDL_VIDEO_WINDOW_POS=300,200");
    SDL_WM_SetCaption("Vectrex SDL", "Vectrex SDL");

    resize(240, 320, 0);
#else
    resize(320, 240, 1);
#endif

#ifdef _WIN32
    if (argc > 1) cartfilename = argv[1];
#else
    if (stricmp(argv[0], "ROM.VECX") != 0)  // If user selected ROM.VECX cartridge then don't use any cartridge
    {
	    cartfilename = argv[0];  // In SIM files argv[0] contains the target to be loaded.
    }
#endif

	init();
    e8910_init_sound();

	osint_emuloop();

    e8910_done_sound();
    SDL_Quit();

	return 0;
}
Ejemplo n.º 3
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;
}
Ejemplo n.º 4
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!!!

}