-
- settings.setValue("p1k_up", vjs.p1KeyBindings[0]);
- settings.setValue("p1k_down", vjs.p1KeyBindings[1]);
- settings.setValue("p1k_left", vjs.p1KeyBindings[2]);
- settings.setValue("p1k_right", vjs.p1KeyBindings[3]);
- settings.setValue("p1k_c", vjs.p1KeyBindings[4]);
- settings.setValue("p1k_b", vjs.p1KeyBindings[5]);
- settings.setValue("p1k_a", vjs.p1KeyBindings[6]);
- settings.setValue("p1k_option", vjs.p1KeyBindings[7]);
- settings.setValue("p1k_pause", vjs.p1KeyBindings[8]);
- settings.setValue("p1k_0", vjs.p1KeyBindings[9]);
- settings.setValue("p1k_1", vjs.p1KeyBindings[10]);
- settings.setValue("p1k_2", vjs.p1KeyBindings[11]);
- settings.setValue("p1k_3", vjs.p1KeyBindings[12]);
- settings.setValue("p1k_4", vjs.p1KeyBindings[13]);
- settings.setValue("p1k_5", vjs.p1KeyBindings[14]);
- settings.setValue("p1k_6", vjs.p1KeyBindings[15]);
- settings.setValue("p1k_7", vjs.p1KeyBindings[16]);
- settings.setValue("p1k_8", vjs.p1KeyBindings[17]);
- settings.setValue("p1k_9", vjs.p1KeyBindings[18]);
- settings.setValue("p1k_pound", vjs.p1KeyBindings[19]);
- settings.setValue("p1k_star", vjs.p1KeyBindings[20]);
-
- settings.setValue("p2k_up", vjs.p2KeyBindings[0]);
- settings.setValue("p2k_down", vjs.p2KeyBindings[1]);
- settings.setValue("p2k_left", vjs.p2KeyBindings[2]);
- settings.setValue("p2k_right", vjs.p2KeyBindings[3]);
- settings.setValue("p2k_c", vjs.p2KeyBindings[4]);
- settings.setValue("p2k_b", vjs.p2KeyBindings[5]);
- settings.setValue("p2k_a", vjs.p2KeyBindings[6]);
- settings.setValue("p2k_option", vjs.p2KeyBindings[7]);
- settings.setValue("p2k_pause", vjs.p2KeyBindings[8]);
- settings.setValue("p2k_0", vjs.p2KeyBindings[9]);
- settings.setValue("p2k_1", vjs.p2KeyBindings[10]);
- settings.setValue("p2k_2", vjs.p2KeyBindings[11]);
- settings.setValue("p2k_3", vjs.p2KeyBindings[12]);
- settings.setValue("p2k_4", vjs.p2KeyBindings[13]);
- settings.setValue("p2k_5", vjs.p2KeyBindings[14]);
- settings.setValue("p2k_6", vjs.p2KeyBindings[15]);
- settings.setValue("p2k_7", vjs.p2KeyBindings[16]);
- settings.setValue("p2k_8", vjs.p2KeyBindings[17]);
- settings.setValue("p2k_9", vjs.p2KeyBindings[18]);
- settings.setValue("p2k_pound", vjs.p2KeyBindings[19]);
- settings.setValue("p2k_star", vjs.p2KeyBindings[20]);
-}
-
-// Here's how Byuu does it...
-// I think I have it working now... :-)
-#if 0
-void Utility::resizeMainWindow()
-{
- unsigned region = config().video.context->region;
- unsigned multiplier = config().video.context->multiplier;
- unsigned width = 256 * multiplier;
- unsigned height = (region == 0 ? 224 : 239) * multiplier;
-
- if(config().video.context->correctAspectRatio)
- {
- if(region == 0)
- {
- width = (double)width * config().video.ntscAspectRatio + 0.5; //NTSC adjust
- }
- else
- {
- width = (double)width * config().video.palAspectRatio + 0.5; //PAL adjust
- }
- }
-
- if(config().video.isFullscreen == false)
- {
- //get effective desktop work area region (ignore Windows taskbar, OS X dock, etc.)
- QRect deskRect = QApplication::desktop()->availableGeometry(mainWindow);
-
- //ensure window size will not be larger than viewable desktop area
- constrainSize(height, width, deskRect.height()); //- frameHeight);
- constrainSize(width, height, deskRect.width()); //- frameWidth );
-
- mainWindow->canvas->setFixedSize(width, height);
- mainWindow->show();
- }
- else
- {
- for(unsigned i = 0; i < 2; i++)
- {
- unsigned iWidth = width, iHeight = height;
-
- constrainSize(iHeight, iWidth, mainWindow->canvasContainer->size().height());
- constrainSize(iWidth, iHeight, mainWindow->canvasContainer->size().width());
-
- //center canvas onscreen; ensure it is not larger than viewable area
- mainWindow->canvas->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
- mainWindow->canvas->setFixedSize(iWidth, iHeight);
- mainWindow->canvas->setMinimumSize(0, 0);
-
- usleep(2000);
- QApplication::processEvents();
- }
- }
-
- //workaround for Qt/Xlib bug:
- //if window resize occurs with cursor over it, Qt shows Qt::Size*DiagCursor;
- //so force it to show Qt::ArrowCursor, as expected
- mainWindow->setCursor(Qt::ArrowCursor);
- mainWindow->canvasContainer->setCursor(Qt::ArrowCursor);
- mainWindow->canvas->setCursor(Qt::ArrowCursor);
-
- //workaround for DirectSound(?) bug:
- //window resizing sometimes breaks audio sync, this call re-initializes it
- updateAvSync();
+ settings.setValue("DefaultROM", vjs.alpineROMPath);
+ settings.setValue("DefaultABS", vjs.absROMPath);
+
+ settings.setValue("p1k_up", vjs.p1KeyBindings[BUTTON_U]);
+ settings.setValue("p1k_down", vjs.p1KeyBindings[BUTTON_D]);
+ settings.setValue("p1k_left", vjs.p1KeyBindings[BUTTON_L]);
+ settings.setValue("p1k_right", vjs.p1KeyBindings[BUTTON_R]);
+ settings.setValue("p1k_c", vjs.p1KeyBindings[BUTTON_C]);
+ settings.setValue("p1k_b", vjs.p1KeyBindings[BUTTON_B]);
+ settings.setValue("p1k_a", vjs.p1KeyBindings[BUTTON_A]);
+ settings.setValue("p1k_option", vjs.p1KeyBindings[BUTTON_OPTION]);
+ settings.setValue("p1k_pause", vjs.p1KeyBindings[BUTTON_PAUSE]);
+ settings.setValue("p1k_0", vjs.p1KeyBindings[BUTTON_0]);
+ settings.setValue("p1k_1", vjs.p1KeyBindings[BUTTON_1]);
+ settings.setValue("p1k_2", vjs.p1KeyBindings[BUTTON_2]);
+ settings.setValue("p1k_3", vjs.p1KeyBindings[BUTTON_3]);
+ settings.setValue("p1k_4", vjs.p1KeyBindings[BUTTON_4]);
+ settings.setValue("p1k_5", vjs.p1KeyBindings[BUTTON_5]);
+ settings.setValue("p1k_6", vjs.p1KeyBindings[BUTTON_6]);
+ settings.setValue("p1k_7", vjs.p1KeyBindings[BUTTON_7]);
+ settings.setValue("p1k_8", vjs.p1KeyBindings[BUTTON_8]);
+ settings.setValue("p1k_9", vjs.p1KeyBindings[BUTTON_9]);
+ settings.setValue("p1k_pound", vjs.p1KeyBindings[BUTTON_d]);
+ settings.setValue("p1k_star", vjs.p1KeyBindings[BUTTON_s]);
+
+ settings.setValue("p2k_up", vjs.p2KeyBindings[BUTTON_U]);
+ settings.setValue("p2k_down", vjs.p2KeyBindings[BUTTON_D]);
+ settings.setValue("p2k_left", vjs.p2KeyBindings[BUTTON_L]);
+ settings.setValue("p2k_right", vjs.p2KeyBindings[BUTTON_R]);
+ settings.setValue("p2k_c", vjs.p2KeyBindings[BUTTON_C]);
+ settings.setValue("p2k_b", vjs.p2KeyBindings[BUTTON_B]);
+ settings.setValue("p2k_a", vjs.p2KeyBindings[BUTTON_A]);
+ settings.setValue("p2k_option", vjs.p2KeyBindings[BUTTON_OPTION]);
+ settings.setValue("p2k_pause", vjs.p2KeyBindings[BUTTON_PAUSE]);
+ settings.setValue("p2k_0", vjs.p2KeyBindings[BUTTON_0]);
+ settings.setValue("p2k_1", vjs.p2KeyBindings[BUTTON_1]);
+ settings.setValue("p2k_2", vjs.p2KeyBindings[BUTTON_2]);
+ settings.setValue("p2k_3", vjs.p2KeyBindings[BUTTON_3]);
+ settings.setValue("p2k_4", vjs.p2KeyBindings[BUTTON_4]);
+ settings.setValue("p2k_5", vjs.p2KeyBindings[BUTTON_5]);
+ settings.setValue("p2k_6", vjs.p2KeyBindings[BUTTON_6]);
+ settings.setValue("p2k_7", vjs.p2KeyBindings[BUTTON_7]);
+ settings.setValue("p2k_8", vjs.p2KeyBindings[BUTTON_8]);
+ settings.setValue("p2k_9", vjs.p2KeyBindings[BUTTON_9]);
+ settings.setValue("p2k_pound", vjs.p2KeyBindings[BUTTON_d]);
+ settings.setValue("p2k_star", vjs.p2KeyBindings[BUTTON_s]);
+
+ WriteProfiles(&settings);