static void prefVideoExit() { if (!hVideoDlg) { return; } int mode = SendDlgItemMessage(hVideoDlg, IDC_PREF_VIDEOMODE, CB_GETCURSEL, 0, 0); VidSelect(mode); nVidAdapter = SendDlgItemMessage(hVideoDlg, IDC_PREF_DISPADAPTER, CB_GETCURSEL, 0, 0); // fullscreen resolution long resItem = SendDlgItemMessage(hVideoDlg, IDC_PREF_FULLSCREENRES, CB_GETCURSEL, 0, 0); long itemValue = SendDlgItemMessage(hVideoDlg, IDC_PREF_FULLSCREENRES, CB_GETITEMDATA, resItem, 0); nVidWidth = itemValue >> 16; nVidHeight = itemValue & 0xFFFF; if (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_16BIT)) { nVidDepth = 16; } else if (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_32BIT)) { nVidDepth = 32; } vidMotionBlur = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_MOTIONBLUR)) ? 1 : 0; nVidDXTextureManager = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_TEXTUREMANAGE)) ? 1 : 0; bVidForce16bit = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_FORCE_16BIT)) ? 1 : 0; vidHardwareVertex = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_HARDWAREVERTEX)) ? 1 : 0; nVid3DProjection = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_3DPROJECTION)) ? 1 : 0; bcolorAdjust = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_COLOR_ADJUST)) ? 1 : 0; bVidTripleBuffer = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_TRIPLE)) ? 1 : 0; bVidVSync = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_VSYNC)) ? 1 : 0; bForce60Hz = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_FORCE60HZ)) ? 1 : 0; autoFrameSkip = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_AUTOFRAMESKIP)) ? 1 : 0; bVidUsePlaceholder = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_BLITTERPREVIEW)) ? 1 : 0; autoVidScrnAspect = (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_AUTOMONITORASPECT)) ? 1 : 0; if (nVidRotationAdjust & 1) { if (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_ROTATEVERTICAL)) { nVidRotationAdjust ^= 1; } } else { if (BST_CHECKED != IsDlgButtonChecked(hVideoDlg, IDC_PREF_ROTATEVERTICAL)) { nVidRotationAdjust ^= 1; } } if (!(nVidRotationAdjust & 2)) { nVidRotationAdjust |= (BST_CHECKED == IsDlgButtonChecked(hVideoDlg, IDC_PREF_MONITORMIRRORVERT)) ? 2 : 0; } else { if (BST_CHECKED != IsDlgButtonChecked(hVideoDlg, IDC_PREF_MONITORMIRRORVERT)) { nVidRotationAdjust ^= 2; } } }
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; }