--- Frodo4/Src/Prefs.cpp 2003/07/01 17:09:43 1.1 +++ Frodo4/Src/Prefs.cpp 2005/06/27 19:55:48 1.8 @@ -1,7 +1,7 @@ /* * Prefs.cpp - Global preferences * - * Frodo (C) 1994-1997,2002 Christian Bauer + * Frodo (C) 1994-1997,2002-2005 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,16 +43,13 @@ Prefs::Prefs() BadLineCycles = 23; CIACycles = 63; FloppyCycles = 64; - SkipFrames = 2; + SkipFrames = 1; LatencyMin = 80; LatencyMax = 120; LatencyAvg = 280; ScalingNumerator = 2; ScalingDenominator = 2; - for (int i=0; i<4; i++) - DriveType[i] = DRVTYPE_DIR; - strcpy(DrivePath[0], "64prgs"); strcpy(DrivePath[1], ""); strcpy(DrivePath[2], ""); @@ -61,14 +58,14 @@ Prefs::Prefs() strcpy(ViewPort, "Default"); strcpy(DisplayMode, "Default"); - SIDType = SIDTYPE_NONE; + SIDType = SIDTYPE_DIGITAL; REUSize = REU_NONE; DisplayType = DISPTYPE_WINDOW; + Joystick1Port = 0; + Joystick2Port = 0; SpritesOn = true; SpriteCollisions = true; - Joystick1On = false; - Joystick2On = false; JoystickSwap = false; LimitSpeed = false; FastReset = false; @@ -106,10 +103,6 @@ bool Prefs::operator==(const Prefs &rhs) && LatencyAvg == rhs.LatencyAvg && ScalingNumerator == rhs.ScalingNumerator && ScalingDenominator == rhs.ScalingNumerator - && DriveType[0] == rhs.DriveType[0] - && DriveType[1] == rhs.DriveType[1] - && DriveType[2] == rhs.DriveType[2] - && DriveType[3] == rhs.DriveType[3] && strcmp(DrivePath[0], rhs.DrivePath[0]) == 0 && strcmp(DrivePath[1], rhs.DrivePath[1]) == 0 && strcmp(DrivePath[2], rhs.DrivePath[2]) == 0 @@ -121,8 +114,8 @@ bool Prefs::operator==(const Prefs &rhs) && DisplayType == rhs.DisplayType && SpritesOn == rhs.SpritesOn && SpriteCollisions == rhs.SpriteCollisions - && Joystick1On == rhs.Joystick1On - && Joystick2On == rhs.Joystick2On + && Joystick1Port == rhs.Joystick1Port + && Joystick2Port == rhs.Joystick2Port && JoystickSwap == rhs.JoystickSwap && LimitSpeed == rhs.LimitSpeed && FastReset == rhs.FastReset @@ -165,10 +158,6 @@ void Prefs::Check(void) if (DisplayType < DISPTYPE_WINDOW || DisplayType > DISPTYPE_SCREEN) DisplayType = DISPTYPE_WINDOW; - - for (int i=0; i<4; i++) - if (DriveType[i] < DRVTYPE_DIR || DriveType[i] > DRVTYPE_T64) - DriveType[i] = DRVTYPE_DIR; } @@ -204,34 +193,6 @@ void Prefs::Load(char *filename) ScalingNumerator = atoi(value); else if (!strcmp(keyword, "ScalingDenominator")) ScalingDenominator = atoi(value); - else if (!strcmp(keyword, "DriveType8")) - if (!strcmp(value, "DIR")) - DriveType[0] = DRVTYPE_DIR; - else if (!strcmp(value, "D64")) - DriveType[0] = DRVTYPE_D64; - else - DriveType[0] = DRVTYPE_T64; - else if (!strcmp(keyword, "DriveType9")) - if (!strcmp(value, "DIR")) - DriveType[1] = DRVTYPE_DIR; - else if (!strcmp(value, "D64")) - DriveType[1] = DRVTYPE_D64; - else - DriveType[1] = DRVTYPE_T64; - else if (!strcmp(keyword, "DriveType10")) - if (!strcmp(value, "DIR")) - DriveType[2] = DRVTYPE_DIR; - else if (!strcmp(value, "D64")) - DriveType[2] = DRVTYPE_D64; - else - DriveType[2] = DRVTYPE_T64; - else if (!strcmp(keyword, "DriveType11")) - if (!strcmp(value, "DIR")) - DriveType[3] = DRVTYPE_DIR; - else if (!strcmp(value, "D64")) - DriveType[3] = DRVTYPE_D64; - else - DriveType[3] = DRVTYPE_T64; else if (!strcmp(keyword, "DrivePath8")) strcpy(DrivePath[0], value); else if (!strcmp(keyword, "DrivePath9")) @@ -262,14 +223,14 @@ void Prefs::Load(char *filename) REUSize = REU_NONE; } else if (!strcmp(keyword, "DisplayType")) DisplayType = strcmp(value, "SCREEN") ? DISPTYPE_WINDOW : DISPTYPE_SCREEN; + else if (!strcmp(keyword, "Joystick1Port")) + Joystick1Port = atoi(value); + else if (!strcmp(keyword, "Joystick2Port")) + Joystick2Port = atoi(value); else if (!strcmp(keyword, "SpritesOn")) SpritesOn = !strcmp(value, "TRUE"); else if (!strcmp(keyword, "SpriteCollisions")) SpriteCollisions = !strcmp(value, "TRUE"); - else if (!strcmp(keyword, "Joystick1On")) - Joystick1On = !strcmp(value, "TRUE"); - else if (!strcmp(keyword, "Joystick2On")) - Joystick2On = !strcmp(value, "TRUE"); else if (!strcmp(keyword, "JoystickSwap")) JoystickSwap = !strcmp(value, "TRUE"); else if (!strcmp(keyword, "LimitSpeed")) @@ -334,21 +295,8 @@ bool Prefs::Save(char *filename) fprintf(file, "LatencyAvg = %d\n", LatencyAvg); fprintf(file, "ScalingNumerator = %d\n", ScalingNumerator); fprintf(file, "ScalingDenominator = %d\n", ScalingDenominator); - for (int i=0; i<4; i++) { - fprintf(file, "DriveType%d = ", i+8); - switch (DriveType[i]) { - case DRVTYPE_DIR: - fprintf(file, "DIR\n"); - break; - case DRVTYPE_D64: - fprintf(file, "D64\n"); - break; - case DRVTYPE_T64: - fprintf(file, "T64\n"); - break; - } + for (int i=0; i<4; i++) fprintf(file, "DrivePath%d = %s\n", i+8, DrivePath[i]); - } fprintf(file, "ViewPort = %s\n", ViewPort); fprintf(file, "DisplayMode = %s\n", DisplayMode); fprintf(file, "SIDType = "); @@ -379,10 +327,10 @@ bool Prefs::Save(char *filename) break; }; fprintf(file, "DisplayType = %s\n", DisplayType == DISPTYPE_WINDOW ? "WINDOW" : "SCREEN"); + fprintf(file, "Joystick1Port = %d\n", Joystick1Port); + fprintf(file, "Joystick2Port = %d\n", Joystick2Port); fprintf(file, "SpritesOn = %s\n", SpritesOn ? "TRUE" : "FALSE"); fprintf(file, "SpriteCollisions = %s\n", SpriteCollisions ? "TRUE" : "FALSE"); - fprintf(file, "Joystick1On = %s\n", Joystick1On ? "TRUE" : "FALSE"); - fprintf(file, "Joystick2On = %s\n", Joystick2On ? "TRUE" : "FALSE"); fprintf(file, "JoystickSwap = %s\n", JoystickSwap ? "TRUE" : "FALSE"); fprintf(file, "LimitSpeed = %s\n", LimitSpeed ? "TRUE" : "FALSE"); fprintf(file, "FastReset = %s\n", FastReset ? "TRUE" : "FALSE"); @@ -419,3 +367,7 @@ bool Prefs::Save(char *filename) #ifdef WIN32 #include "Prefs_WIN32.h" #endif + +#ifdef HAVE_GLADE +#include "Prefs_glade.h" +#endif