Example #1
0
static int AppInit()
{
	int nRet=0;

	// Load config for the application
	nRet=ConfigAppLoad();
	if (nRet!=0)
	{
		ConfigAppSave();    // create initial config file
	}

	// Set the thread priority
	SetThreadPriority(GetCurrentThread(),nAppThreadPriority);

	ComputeGammaLUT();

	BurnLibInit(); // Init the Burn library

	MediaInit();

	//ayeye
	hAccel=LoadAccelerators(hAppInst, MAKEINTRESOURCE(IDR_ACCELERATOR));
	hImm32=LoadLibrary("imm32.dll");

	return 0;
}
Example #2
0
void init_emu(int gamenum)
{
	bBurnUseASMCPUEmulation=0;
 	bCheatsAllowed=false;
	ConfigAppLoad();
	ConfigAppSave();
	DrvInit(gamenum,0);
}
Example #3
0
int main(int argc, char **argv )
{
	char path[MAX_PATH];

	BurnLibInit();		// init Burn core
	BurnPathsInit();	// init paths or create them if needed
/*
	if (argc < 2) {
		int c;
		printf ("Usage: %s <path to rom><shortname>.zip\n"
			"   ie: %s ./uopoko.zip\n"
			" Note: Path and .zip extension are mandatory.\n\n", argv[0], argv[0]);
		printf ("Supported (but not necessarily working) roms:\n\n");

		for(nBurnDrvSelect[0] = 0; nBurnDrvSelect[0] < nBurnDrvCount; nBurnDrvSelect[0]++) {
			nBurnDrvActive = nBurnDrvSelect[0];
			printf("%-20s ", BurnDrvGetTextA(DRV_NAME));
			c++;
			if(c == 3) {
				c = 0;
				printf("\n");
			}
		}
		printf ("\n\n");
		CreateCapexLists(); // generate rominfo.fba and zipname.fba
		return 0;
	}
*/
	ConfigGameDefault();

	// alter cfg if any param is given
	if (argc >= 2)
		parse_cmd(argc, argv, path);

	ConfigAppLoad();

	if((SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE)) < 0) {
		printf("Sdl failed to init\n");
		exit(0);
	}

	if (argc < 2)
		GuiRun();
	else {
		int drv;

		if((drv = FindDrvByFileName(path)) >= 0)
			RunEmulator(drv);
	}

	BurnLibExit();

	if (argc < 2)
		ConfigAppSave();
	SDL_Quit();

	return 0;
}
Example #4
0
int main(int argc, char *argv[]) 
{
	UINT32 i=0;
	
	ConfigAppLoad(); 
	
	CheckFirstTime(); // check for first time run
	
	SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO);

	BurnLibInit(); 

	SDL_WM_SetCaption( "FBA, SDL port.", "FBA, SDL port.");
	SDL_ShowCursor(SDL_DISABLE);

	if (argc == 2)
	{
		for (i = 0; i < nBurnDrvCount; i++) {
			nBurnDrvSelect[0] = i;
			if (strcmp(BurnDrvGetTextA(0), argv[1]) == 0) {
				break;
			}
		}

		if (i == nBurnDrvCount) {
			printf("%s is not supported by FB Alpha.",argv[1]);
			return 1;
		}
	}

	InputInit();
	init_emu(i);
	
	RunMessageLoop();
	InputExit();

	DrvExit();
	ConfigAppSave();
	BurnLibExit();
	SDL_Quit();

	return 0;
}
Example #5
0
static int AppExit()
{

	DrvExit(); // Make sure any game driver is exitted
	MediaExit();
	BurnLibExit(); // Exit the Burn library

	ConfigAppSave(); // Save config for the application

	//ayeye
	if(hAccel!=NULL)
	{
		DestroyAcceleratorTable(hAccel);
		hAccel=NULL;
	}
	if(hImm32!=NULL)
	{
		FreeLibrary(hImm32);
		hImm32=NULL;
	}

	return 0;
}
Example #6
0
static int AppInit()
{

#if defined (_MSC_VER) && defined (_DEBUG)
	_CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF);			// Check for memory corruption
	_CrtSetDbgFlag(_CRTDBG_DELAY_FREE_MEM_DF);			//
	_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);				//
#endif

	OpenDebugLog();

	// Create a handle to the main thread of execution
	DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, 0, false, DUPLICATE_SAME_ACCESS);

	// Load config for the application
	ConfigAppLoad();

	FBALocaliseInit(szLocalisationTemplate);

	kailleraInit();

#if 1 || !defined (FBA_DEBUG)
	// print a warning if we're running for the 1st time
	if (nIniVersion < nBurnVer) {
		ScrnInit();
		//SplashDestroy(1);
		FirstUsageCreate();

		ConfigAppSave();								// Create initial config file
	}
#endif

	// Set the thread priority for the main thread
	SetThreadPriority(GetCurrentThread(), nAppThreadPriority);

	bCheatsAllowed = true;

#ifdef USE_SDL
	SDL_Init(0);
#endif

	// Init the Burn library
	BurnLibInit();

	ComputeGammaLUT();

	if (VidSelect(nVidSelect)) {
		nVidSelect = 0;
		VidSelect(nVidSelect);
	}

	hAccel = LoadAccelerators(hAppInst, MAKEINTRESOURCE(IDR_ACCELERATOR));

	// Build the ROM information
	CreateROMInfo();
	
	// Write a clrmame dat file if we are verifying roms
#if defined (ROM_VERIFY)
	create_datfile(_T("fba.dat"), 0);
#endif

	bNumlockStatus = SetNumLock(false);

	return 0;
}