예제 #1
0
int createDatfileWindows(int type)
{
    TCHAR szTitle[MAX_PATH];
    TCHAR szFilter[MAX_PATH];

    _sntprintf(szChoice, sizearray(szChoice), _T(APP_TITLE) _T(" v%.20s (%s).dat"), szAppBurnVer, _T("clrmamepro"));
    _sntprintf(szTitle, sizearray(szTitle), FBALoadStringEx(IDS_DAT_GENERATE), _T("clrmamepro"));

    _stprintf(szFilter, FBALoadStringEx(IDS_DISK_ALL_DAT), _T(APP_TITLE));
    memcpy(szFilter + _tcslen(szFilter), _T(" (*.dat)\0*.dat\0\0"), 16 * sizeof(TCHAR));

    memset(&ofn, 0, sizeof(ofn));
    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner = hScrnWnd;
    ofn.lpstrFilter = szFilter;
    ofn.lpstrFile = szChoice;
    ofn.nMaxFile = sizearray(szChoice);
    ofn.lpstrInitialDir = _T(".");
    ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
    ofn.lpstrDefExt = _T("dat");
    ofn.lpstrTitle = szTitle;

    if (GetSaveFileName(&ofn) == 0)
        return 1;

    return create_datfile(szChoice, type);
}
예제 #2
0
파일: main.cpp 프로젝트: Nebuleon/fba-sdl
void CreateCapexLists()
{
	printf("Create rom lists (%d)\n",nBurnDrvCount);
	FILE *zipf;
	FILE *romf;
	zipf = fopen("zipname.fba","w");
	romf = fopen("rominfo.fba","w");
	char *fullname;
	int j;
	for(int i = 0; i < nBurnDrvCount; i++) {
		nBurnDrvActive = i;
		fullname = (char*)malloc(strlen(BurnDrvGetTextA(DRV_FULLNAME)) + 1);
		strcpy(fullname, BurnDrvGetTextA(DRV_FULLNAME));
		for(j = 0; j < strlen(fullname); j++) {
			if(fullname[j] == ',') fullname[j] = ' ';
		}

		if(BurnDrvGetTextA(DRV_PARENT))
			fprintf(romf,
				"FILENAME( %s %s %s \"%s\" )\n",
				BurnDrvGetTextA(DRV_NAME),
				BurnDrvGetTextA(DRV_PARENT),
				BurnDrvGetTextA(DRV_DATE),
				BurnDrvGetTextA(DRV_MANUFACTURER));
		else
			fprintf(romf,
				"FILENAME( %s fba %s \"%s\" )\n",
				BurnDrvGetTextA(DRV_NAME),
				BurnDrvGetTextA(DRV_DATE),
				BurnDrvGetTextA(DRV_MANUFACTURER));

		fprintf(zipf,
			"%s,%s,%s %s\n",
			BurnDrvGetTextA(DRV_NAME),
			fullname,
			BurnDrvGetTextA(DRV_DATE),
			BurnDrvGetTextA(DRV_MANUFACTURER));
		free(fullname);
	}
	fclose(zipf);
	fclose(romf);
	char temp[24];
	strcpy(temp,"FBA ");
	strcat(temp,szAppBurnVer);
	strcat(temp,".dat");
	create_datfile(temp, 0);
}
예제 #3
0
파일: main.cpp 프로젝트: 0nem4n/ggpofba
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;
}