Annotation of hatari/src/configuration.c, revision 1.1.1.12

1.1       root        1: /*
1.1.1.6   root        2:   Hatari - configuration.c
                      3: 
                      4:   This file is distributed under the GNU Public License, version 2 or at
                      5:   your option any later version. Read the file gpl.txt for details.
1.1       root        6: 
                      7:   Configuration File
                      8: 
1.1.1.6   root        9:   The configuration file is now stored in an ASCII format to allow the user
                     10:   to edit the file manually.
1.1       root       11: */
1.1.1.12! root       12: const char Configuration_rcsid[] = "Hatari $Id: configuration.c,v 1.84 2008/03/11 20:11:08 eerot Exp $";
1.1.1.10  root       13: 
                     14: #include <SDL_keysym.h>
1.1       root       15: 
                     16: #include "main.h"
                     17: #include "configuration.h"
1.1.1.9   root       18: #include "cfgopts.h"
1.1.1.8   root       19: #include "audio.h"
1.1.1.5   root       20: #include "file.h"
1.1.1.9   root       21: #include "log.h"
                     22: #include "m68000.h"
1.1.1.12! root       23: #include "memorySnapShot.h"
        !            24: #include "paths.h"
1.1.1.9   root       25: #include "screen.h"
                     26: #include "vdi.h"
                     27: #include "video.h"
1.1.1.6   root       28: 
                     29: 
                     30: BOOL bFirstTimeInstall = FALSE;             /* Has been run before? Used to set default joysticks etc... */
                     31: CNF_PARAMS ConfigureParams;                 /* List of configuration for the emulator */
1.1.1.7   root       32: char sConfigFileName[FILENAME_MAX];         /* Stores the name of the configuration file */
1.1.1.6   root       33: 
                     34: 
1.1.1.9   root       35: /* Used to load/save logging options */
                     36: static const struct Config_Tag configs_Log[] =
                     37: {
                     38:        { "sLogFileName", String_Tag, ConfigureParams.Log.sLogFileName },
                     39:        { "nTextLogLevel", Int_Tag, &ConfigureParams.Log.nTextLogLevel },
                     40:        { "nAlertDlgLogLevel", Int_Tag, &ConfigureParams.Log.nAlertDlgLogLevel },
1.1.1.12! root       41:        { "bConfirmQuit", Bool_Tag, &ConfigureParams.Log.bConfirmQuit },
1.1.1.9   root       42:        { NULL , Error_Tag, NULL }
                     43: };
                     44: 
                     45: 
1.1.1.6   root       46: /* Used to load/save screen options */
1.1.1.9   root       47: static const struct Config_Tag configs_Screen[] =
1.1.1.6   root       48: {
1.1.1.12! root       49:        { "MonitorType", Int_Tag, &ConfigureParams.Screen.MonitorType },
        !            50:        { "FrameSkips", Int_Tag, &ConfigureParams.Screen.FrameSkips },
1.1.1.9   root       51:        { "bFullScreen", Bool_Tag, &ConfigureParams.Screen.bFullScreen },
                     52:        { "bAllowOverscan", Bool_Tag, &ConfigureParams.Screen.bAllowOverscan },
1.1.1.12! root       53:        { "nSpec512Threshold", Int_Tag, &ConfigureParams.Screen.nSpec512Threshold },
        !            54:        { "nForceBpp", Int_Tag, &ConfigureParams.Screen.nForceBpp },
        !            55:        { "bZoomLowRes", Bool_Tag, &ConfigureParams.Screen.bZoomLowRes },
1.1.1.9   root       56:        { "bUseExtVdiResolutions", Bool_Tag, &ConfigureParams.Screen.bUseExtVdiResolutions },
1.1.1.12! root       57:        { "nVdiWidth", Int_Tag, &ConfigureParams.Screen.nVdiWidth },
        !            58:        { "nVdiHeight", Int_Tag, &ConfigureParams.Screen.nVdiHeight },
1.1.1.9   root       59:        { "nVdiColors", Int_Tag, &ConfigureParams.Screen.nVdiColors },
                     60:        { "bCaptureChange", Bool_Tag, &ConfigureParams.Screen.bCaptureChange },
                     61:        { "nFramesPerSecond", Int_Tag, &ConfigureParams.Screen.nFramesPerSecond },
1.1.1.12! root       62:        { "nWindowBorderPixelsLeft", Int_Tag, &ConfigureParams.Screen.nWindowBorderPixelsLeft },
        !            63:        { "nWindowBorderPixelsRight", Int_Tag, &ConfigureParams.Screen.nWindowBorderPixelsRight },
        !            64:        { "nWindowBorderPixelsBottom", Int_Tag, &ConfigureParams.Screen.nWindowBorderPixelsBottom },
        !            65:        { "nFullScreenBorderPixelsLeft", Int_Tag, &ConfigureParams.Screen.nFullScreenBorderPixelsLeft },
        !            66:        { "nFullScreenBorderPixelsRight", Int_Tag, &ConfigureParams.Screen.nFullScreenBorderPixelsRight },
        !            67:        { "nFullScreenBorderPixelsBottom", Int_Tag, &ConfigureParams.Screen.nFullScreenBorderPixelsBottom },
1.1.1.9   root       68:        { NULL , Error_Tag, NULL }
1.1.1.6   root       69: };
                     70: 
1.1.1.10  root       71: /* Used to load/save joystick 0 options */
1.1.1.9   root       72: static const struct Config_Tag configs_Joystick0[] =
1.1.1.6   root       73: {
1.1.1.10  root       74:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nJoystickMode },
1.1.1.9   root       75:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[0].bEnableAutoFire },
1.1.1.10  root       76:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nJoyId },
                     77:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeUp },
                     78:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeDown },
                     79:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeLeft },
                     80:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeRight },
                     81:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeFire },
1.1.1.9   root       82:        { NULL , Error_Tag, NULL }
1.1.1.6   root       83: };
1.1.1.10  root       84: 
                     85: /* Used to load/save joystick 1 options */
1.1.1.9   root       86: static const struct Config_Tag configs_Joystick1[] =
1.1.1.6   root       87: {
1.1.1.10  root       88:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nJoystickMode },
1.1.1.9   root       89:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[1].bEnableAutoFire },
1.1.1.10  root       90:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nJoyId },
                     91:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeUp },
                     92:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeDown },
                     93:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeLeft },
                     94:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeRight },
                     95:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeFire },
                     96:        { NULL , Error_Tag, NULL }
                     97: };
                     98: 
                     99: /* Used to load/save joystick 2 options */
                    100: static const struct Config_Tag configs_Joystick2[] =
                    101: {
                    102:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nJoystickMode },
                    103:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[2].bEnableAutoFire },
                    104:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nJoyId },
                    105:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeUp },
                    106:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeDown },
                    107:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeLeft },
                    108:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeRight },
                    109:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeFire },
                    110:        { NULL , Error_Tag, NULL }
                    111: };
                    112: 
                    113: /* Used to load/save joystick 3 options */
                    114: static const struct Config_Tag configs_Joystick3[] =
                    115: {
                    116:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nJoystickMode },
                    117:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[3].bEnableAutoFire },
                    118:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nJoyId },
                    119:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeUp },
                    120:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeDown },
                    121:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeLeft },
                    122:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeRight },
                    123:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeFire },
                    124:        { NULL , Error_Tag, NULL }
                    125: };
                    126: 
                    127: /* Used to load/save joystick 4 options */
                    128: static const struct Config_Tag configs_Joystick4[] =
                    129: {
                    130:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nJoystickMode },
                    131:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[4].bEnableAutoFire },
                    132:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nJoyId },
                    133:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeUp },
                    134:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeDown },
                    135:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeLeft },
                    136:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeRight },
                    137:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeFire },
                    138:        { NULL , Error_Tag, NULL }
                    139: };
                    140: 
                    141: /* Used to load/save joystick 5 options */
                    142: static const struct Config_Tag configs_Joystick5[] =
                    143: {
                    144:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nJoystickMode },
                    145:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[5].bEnableAutoFire },
                    146:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nJoyId },
                    147:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeUp },
                    148:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeDown },
                    149:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeLeft },
                    150:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeRight },
                    151:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeFire },
1.1.1.9   root      152:        { NULL , Error_Tag, NULL }
1.1.1.6   root      153: };
1.1.1.5   root      154: 
1.1.1.6   root      155: /* Used to load/save keyboard options */
1.1.1.9   root      156: static const struct Config_Tag configs_Keyboard[] =
1.1.1.6   root      157: {
1.1.1.9   root      158:        { "bDisableKeyRepeat", Bool_Tag, &ConfigureParams.Keyboard.bDisableKeyRepeat },
                    159:        { "nKeymapType", Int_Tag, &ConfigureParams.Keyboard.nKeymapType },
                    160:        { "szMappingFileName", String_Tag, ConfigureParams.Keyboard.szMappingFileName },
                    161:        { NULL , Error_Tag, NULL }
1.1.1.6   root      162: };
1.1       root      163: 
1.1.1.11  root      164: /* Used to load/save shortcut key bindings with modifiers options */
                    165: static const struct Config_Tag configs_ShortCutWithMod[] =
                    166: {
                    167:        { "keyOptions",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_OPTIONS] },
                    168:        { "keyFullScreen", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_FULLSCREEN] },
                    169:        { "keyMouseMode",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_MOUSEMODE] },
                    170:        { "keyColdReset",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_COLDRESET] },
                    171:        { "keyWarmReset",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_WARMRESET] },
                    172:        { "keyScreenShot", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SCREENSHOT] },
                    173:        { "keyBossKey",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_BOSSKEY] },
                    174:        { "keyCursorEmu",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_CURSOREMU] },
                    175:        { "keyMaxSpeed",   Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_MAXSPEED] },
                    176:        { "keyRecAnim",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_RECANIM] },
                    177:        { "keyRecSound",   Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_RECSOUND] },
                    178:        { "keySound",      Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SOUND] },
                    179:        { "keyQuit",       Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_QUIT] },
1.1.1.12! root      180:        { "keyLoadMem",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_LOADMEM] },
        !           181:        { "keySaveMem",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SAVEMEM] },
1.1.1.11  root      182:        { NULL , Error_Tag, NULL }
                    183: };
                    184: 
                    185: /* Used to load/save shortcut key bindings without modifiers options */
                    186: static const struct Config_Tag configs_ShortCutWithoutMod[] =
                    187: {
                    188:        { "keyOptions",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_OPTIONS] },
                    189:        { "keyFullScreen", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_FULLSCREEN] },
                    190:        { "keyMouseMode",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_MOUSEMODE] },
                    191:        { "keyColdReset",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_COLDRESET] },
                    192:        { "keyWarmReset",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_WARMRESET] },
                    193:        { "keyScreenShot", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SCREENSHOT] },
                    194:        { "keyBossKey",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_BOSSKEY] },
                    195:        { "keyCursorEmu",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_CURSOREMU] },
                    196:        { "keyMaxSpeed",   Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_MAXSPEED] },
                    197:        { "keyRecAnim",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_RECANIM] },
                    198:        { "keyRecSound",   Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_RECSOUND] },
                    199:        { "keySound",      Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SOUND] },
                    200:        { "keyQuit",       Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_QUIT] },
1.1.1.12! root      201:        { "keyLoadMem",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_LOADMEM] },
        !           202:        { "keySaveMem",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SAVEMEM] },
1.1.1.11  root      203:        { NULL , Error_Tag, NULL }
                    204: };
                    205: 
                    206: 
1.1.1.6   root      207: /* Used to load/save sound options */
1.1.1.9   root      208: static const struct Config_Tag configs_Sound[] =
1.1.1.6   root      209: {
1.1.1.9   root      210:        { "bEnableSound", Bool_Tag, &ConfigureParams.Sound.bEnableSound },
                    211:        { "nPlaybackQuality", Int_Tag, &ConfigureParams.Sound.nPlaybackQuality },
                    212:        { "szYMCaptureFileName", String_Tag, ConfigureParams.Sound.szYMCaptureFileName },
                    213:        { NULL , Error_Tag, NULL }
1.1.1.6   root      214: };
                    215: 
                    216: /* Used to load/save memory options */
1.1.1.9   root      217: static const struct Config_Tag configs_Memory[] =
1.1.1.6   root      218: {
1.1.1.9   root      219:        { "nMemorySize", Int_Tag, &ConfigureParams.Memory.nMemorySize },
1.1.1.12! root      220:        { "bAutoSave", Bool_Tag, &ConfigureParams.Memory.bAutoSave },
1.1.1.9   root      221:        { "szMemoryCaptureFileName", String_Tag, ConfigureParams.Memory.szMemoryCaptureFileName },
1.1.1.12! root      222:        { "szAutoSaveFileName", String_Tag, ConfigureParams.Memory.szAutoSaveFileName },
1.1.1.9   root      223:        { NULL , Error_Tag, NULL }
1.1.1.6   root      224: };
                    225: 
                    226: 
                    227: /* Used to load/save floppy options */
1.1.1.9   root      228: static const struct Config_Tag configs_Floppy[] =
1.1.1.6   root      229: {
1.1.1.10  root      230:        { "bAutoInsertDiskB", Bool_Tag, &ConfigureParams.DiskImage.bAutoInsertDiskB },
                    231:        { "nWriteProtection", Int_Tag, &ConfigureParams.DiskImage.nWriteProtection },
                    232:        { "szDiskImageDirectory", String_Tag, ConfigureParams.DiskImage.szDiskImageDirectory },
                    233:        { NULL , Error_Tag, NULL }
                    234: };
                    235: 
1.1.1.6   root      236: /* Used to load/save HD options */
1.1.1.10  root      237: static const struct Config_Tag configs_HardDisk[] =
1.1.1.6   root      238: {
1.1.1.10  root      239:        { "bBootFromHardDisk", Bool_Tag, &ConfigureParams.HardDisk.bBootFromHardDisk },
                    240:        { "bUseHardDiskDirectory", Bool_Tag, &ConfigureParams.HardDisk.bUseHardDiskDirectories },
                    241:        { "szHardDiskDirectory", String_Tag, ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C] },
                    242:        /*{ "szHardDiskDirD", String_Tag, ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_D] },*/
                    243:        /*{ "szHardDiskDirE", String_Tag, ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_E] },*/
                    244:        /*{ "szHardDiskDirF", String_Tag, ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_F] },*/
                    245:        { "bUseHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseHardDiskImage },
                    246:        { "szHardDiskImage", String_Tag, ConfigureParams.HardDisk.szHardDiskImage },
                    247:        { NULL , Error_Tag, NULL }
                    248: };
                    249: 
1.1.1.8   root      250: /* Used to load/save ROM options */
1.1.1.9   root      251: static const struct Config_Tag configs_Rom[] =
1.1.1.6   root      252: {
1.1.1.9   root      253:        { "szTosImageFileName", String_Tag, ConfigureParams.Rom.szTosImageFileName },
                    254:        { "szCartridgeImageFileName", String_Tag, ConfigureParams.Rom.szCartridgeImageFileName },
                    255:        { NULL , Error_Tag, NULL }
1.1.1.6   root      256: };
                    257: 
                    258: /* Used to load/save RS232 options */
1.1.1.9   root      259: static const struct Config_Tag configs_Rs232[] =
1.1.1.6   root      260: {
1.1.1.9   root      261:        { "bEnableRS232", Bool_Tag, &ConfigureParams.RS232.bEnableRS232 },
                    262:        { "szOutFileName", String_Tag, ConfigureParams.RS232.szOutFileName },
                    263:        { "szInFileName", String_Tag, ConfigureParams.RS232.szInFileName },
                    264:        { NULL , Error_Tag, NULL }
1.1.1.6   root      265: };
                    266: 
                    267: /* Used to load/save printer options */
1.1.1.9   root      268: static const struct Config_Tag configs_Printer[] =
1.1.1.6   root      269: {
1.1.1.9   root      270:        { "bEnablePrinting", Bool_Tag, &ConfigureParams.Printer.bEnablePrinting },
                    271:        { "bPrintToFile", Bool_Tag, &ConfigureParams.Printer.bPrintToFile },
                    272:        { "szPrintToFileName", String_Tag, ConfigureParams.Printer.szPrintToFileName },
                    273:        { NULL , Error_Tag, NULL }
1.1.1.6   root      274: };
                    275: 
1.1.1.7   root      276: /* Used to load/save MIDI options */
1.1.1.9   root      277: static const struct Config_Tag configs_Midi[] =
1.1.1.7   root      278: {
1.1.1.9   root      279:        { "bEnableMidi", Bool_Tag, &ConfigureParams.Midi.bEnableMidi },
                    280:        { "szMidiOutFileName", String_Tag, ConfigureParams.Midi.szMidiOutFileName },
                    281:        { NULL , Error_Tag, NULL }
1.1.1.7   root      282: };
                    283: 
1.1.1.6   root      284: /* Used to load/save system options */
1.1.1.9   root      285: static const struct Config_Tag configs_System[] =
1.1.1.6   root      286: {
1.1.1.9   root      287:        { "nCpuLevel", Int_Tag, &ConfigureParams.System.nCpuLevel },
                    288:        { "nCpuFreq", Int_Tag, &ConfigureParams.System.nCpuFreq },
                    289:        { "bCompatibleCpu", Bool_Tag, &ConfigureParams.System.bCompatibleCpu },
                    290:        { "nMachineType", Int_Tag, &ConfigureParams.System.nMachineType },
                    291:        { "bBlitter", Bool_Tag, &ConfigureParams.System.bBlitter },
1.1.1.12! root      292:        { "nDSPType", Int_Tag, &ConfigureParams.System.nDSPType },
1.1.1.9   root      293:        { "bRealTimeClock", Bool_Tag, &ConfigureParams.System.bRealTimeClock },
                    294:        { "bPatchTimerD", Bool_Tag, &ConfigureParams.System.bPatchTimerD },
                    295:        { "bSlowFDC", Bool_Tag, &ConfigureParams.System.bSlowFDC },
1.1.1.12! root      296:        { "nMinMaxSpeed", Int_Tag, &ConfigureParams.System.nMinMaxSpeed },
1.1.1.9   root      297:        { NULL , Error_Tag, NULL }
1.1.1.6   root      298: };
1.1       root      299: 
                    300: 
                    301: /*-----------------------------------------------------------------------*/
1.1.1.12! root      302: /**
        !           303:  * Set default configuration values.
        !           304:  */
1.1.1.2   root      305: void Configuration_SetDefault(void)
                    306: {
1.1.1.9   root      307:        int i;
1.1.1.12! root      308:        const char *psHomeDir;
        !           309:        const char *psWorkingDir;
        !           310: 
        !           311:        psHomeDir = Paths_GetHatariHome();
        !           312:        psWorkingDir = Paths_GetWorkingDir();
1.1.1.4   root      313: 
1.1.1.9   root      314:        /* Assume first-time install */
                    315:        bFirstTimeInstall = TRUE;
1.1.1.4   root      316: 
1.1.1.9   root      317:        /* Clear parameters */
                    318:        memset(&ConfigureParams, 0, sizeof(CNF_PARAMS));
                    319: 
                    320:        /* Set defaults for logging */
                    321:        strcpy(ConfigureParams.Log.sLogFileName, "stderr");
                    322:        ConfigureParams.Log.nTextLogLevel = LOG_INFO;
                    323:        ConfigureParams.Log.nAlertDlgLogLevel = LOG_INFO;
1.1.1.12! root      324:        ConfigureParams.Log.bConfirmQuit = TRUE;
1.1.1.9   root      325: 
1.1.1.10  root      326:        /* Set defaults for floppy disk images */
                    327:        ConfigureParams.DiskImage.bAutoInsertDiskB = TRUE;
                    328:        ConfigureParams.DiskImage.nWriteProtection = WRITEPROT_OFF;
1.1.1.12! root      329:        strcpy(ConfigureParams.DiskImage.szDiskImageDirectory, psWorkingDir);
1.1.1.10  root      330:        File_AddSlashToEndFileName(ConfigureParams.DiskImage.szDiskImageDirectory);
                    331: 
                    332:        /* Set defaults for hard disks */
                    333:        ConfigureParams.HardDisk.bBootFromHardDisk = FALSE;
                    334:        ConfigureParams.HardDisk.nHardDiskDir = DRIVE_C;
                    335:        ConfigureParams.HardDisk.bUseHardDiskDirectories = FALSE;
1.1.1.9   root      336:        for (i=0; i<MAX_HARDDRIVES; i++)
                    337:        {
1.1.1.12! root      338:                strcpy(ConfigureParams.HardDisk.szHardDiskDirectories[i], psWorkingDir);
1.1.1.10  root      339:                File_CleanFileName(ConfigureParams.HardDisk.szHardDiskDirectories[i]);
1.1.1.9   root      340:        }
1.1.1.10  root      341:        ConfigureParams.HardDisk.bUseHardDiskImage = FALSE;
1.1.1.12! root      342:        strcpy(ConfigureParams.HardDisk.szHardDiskImage, psWorkingDir);
        !           343:        ConfigureParams.HardDisk.bUseIdeHardDiskImage = FALSE;
        !           344:        strcpy(ConfigureParams.HardDisk.szIdeHardDiskImage, psWorkingDir);
1.1.1.9   root      345: 
                    346:        /* Set defaults for Joysticks */
1.1.1.11  root      347:        for (i = 0; i < JOYSTICK_COUNT; i++)
1.1.1.9   root      348:        {
1.1.1.10  root      349:                ConfigureParams.Joysticks.Joy[i].nJoystickMode = JOYSTICK_DISABLED;
1.1.1.9   root      350:                ConfigureParams.Joysticks.Joy[i].bEnableAutoFire = FALSE;
1.1.1.10  root      351:                ConfigureParams.Joysticks.Joy[i].nJoyId = i;
                    352:                ConfigureParams.Joysticks.Joy[i].nKeyCodeUp = SDLK_UP;
                    353:                ConfigureParams.Joysticks.Joy[i].nKeyCodeDown = SDLK_DOWN;
                    354:                ConfigureParams.Joysticks.Joy[i].nKeyCodeLeft = SDLK_LEFT;
                    355:                ConfigureParams.Joysticks.Joy[i].nKeyCodeRight = SDLK_RIGHT;
                    356:                ConfigureParams.Joysticks.Joy[i].nKeyCodeFire = SDLK_RCTRL;
1.1.1.9   root      357:        }
1.1.1.10  root      358:        ConfigureParams.Joysticks.Joy[1].nJoyId = 0;    /* ST Joystick #1 is default joystick */
                    359:        ConfigureParams.Joysticks.Joy[0].nJoyId = 1;
1.1.1.9   root      360: 
                    361:        /* Set defaults for Keyboard */
                    362:        ConfigureParams.Keyboard.bDisableKeyRepeat = TRUE;
                    363:        ConfigureParams.Keyboard.nKeymapType = KEYMAP_SYMBOLIC;
                    364:        strcpy(ConfigureParams.Keyboard.szMappingFileName, "");
1.1.1.11  root      365:   
1.1.1.12! root      366:        /* Set defaults for Shortcuts */
        !           367:        ConfigureParams.Shortcut.withoutModifier[SHORTCUT_OPTIONS] = SDLK_F12;
        !           368:        ConfigureParams.Shortcut.withoutModifier[SHORTCUT_FULLSCREEN] = SDLK_F11;
1.1.1.11  root      369:   
1.1.1.12! root      370:        ConfigureParams.Shortcut.withModifier[SHORTCUT_OPTIONS] = SDLK_o;
        !           371:        ConfigureParams.Shortcut.withModifier[SHORTCUT_FULLSCREEN] = SDLK_f;
        !           372:        ConfigureParams.Shortcut.withModifier[SHORTCUT_MOUSEMODE] = SDLK_m;
        !           373:        ConfigureParams.Shortcut.withModifier[SHORTCUT_COLDRESET] = SDLK_c;
        !           374:        ConfigureParams.Shortcut.withModifier[SHORTCUT_WARMRESET] = SDLK_r;
        !           375:        ConfigureParams.Shortcut.withModifier[SHORTCUT_SCREENSHOT] = SDLK_g;
        !           376:        ConfigureParams.Shortcut.withModifier[SHORTCUT_BOSSKEY] = SDLK_i;
        !           377:        ConfigureParams.Shortcut.withModifier[SHORTCUT_CURSOREMU] = SDLK_j;
        !           378:        ConfigureParams.Shortcut.withModifier[SHORTCUT_MAXSPEED] = SDLK_x;
        !           379:        ConfigureParams.Shortcut.withModifier[SHORTCUT_RECANIM] = SDLK_a;
        !           380:        ConfigureParams.Shortcut.withModifier[SHORTCUT_RECSOUND] = SDLK_y;
        !           381:        ConfigureParams.Shortcut.withModifier[SHORTCUT_SOUND] = SDLK_s;
        !           382:        ConfigureParams.Shortcut.withModifier[SHORTCUT_QUIT] = SDLK_q;
        !           383:        ConfigureParams.Shortcut.withModifier[SHORTCUT_LOADMEM] = SDLK_l;
        !           384:        ConfigureParams.Shortcut.withModifier[SHORTCUT_SAVEMEM] = SDLK_k;
        !           385:        
1.1.1.9   root      386:        /* Set defaults for Memory */
1.1.1.10  root      387:        ConfigureParams.Memory.nMemorySize = 1;     /* 1 MiB */
1.1.1.12! root      388:        ConfigureParams.Memory.bAutoSave = FALSE;
        !           389:        sprintf(ConfigureParams.Memory.szMemoryCaptureFileName, "%s%chatari.sav",
        !           390:                psHomeDir, PATHSEP);
        !           391:        sprintf(ConfigureParams.Memory.szAutoSaveFileName, "%s%cauto.sav",
        !           392:                psHomeDir, PATHSEP);
1.1.1.9   root      393: 
                    394:        /* Set defaults for Printer */
                    395:        ConfigureParams.Printer.bEnablePrinting = FALSE;
                    396:        ConfigureParams.Printer.bPrintToFile = TRUE;
1.1.1.12! root      397:        sprintf(ConfigureParams.Printer.szPrintToFileName, "%s%chatari.prn",
        !           398:                psHomeDir, PATHSEP);
1.1.1.9   root      399: 
                    400:        /* Set defaults for RS232 */
                    401:        ConfigureParams.RS232.bEnableRS232 = FALSE;
                    402:        strcpy(ConfigureParams.RS232.szOutFileName, "/dev/modem");
                    403:        strcpy(ConfigureParams.RS232.szInFileName, "/dev/modem");
                    404: 
                    405:        /* Set defaults for MIDI */
                    406:        ConfigureParams.Midi.bEnableMidi = FALSE;
                    407:        strcpy(ConfigureParams.Midi.szMidiOutFileName, "/dev/midi00");
                    408: 
                    409:        /* Set defaults for Screen */
                    410:        ConfigureParams.Screen.bFullScreen = FALSE;
1.1.1.12! root      411:        ConfigureParams.Screen.FrameSkips = 0;
1.1.1.9   root      412:        ConfigureParams.Screen.bAllowOverscan = TRUE;
1.1.1.12! root      413:        ConfigureParams.Screen.nSpec512Threshold = 16;
        !           414:        ConfigureParams.Screen.nForceBpp = 0;
        !           415:        ConfigureParams.Screen.bZoomLowRes = FALSE;
        !           416:        ConfigureParams.Screen.MonitorType = MONITOR_TYPE_RGB;
1.1.1.9   root      417:        ConfigureParams.Screen.bUseExtVdiResolutions = FALSE;
1.1.1.12! root      418:        ConfigureParams.Screen.nVdiWidth = 640;
        !           419:        ConfigureParams.Screen.nVdiHeight = 480;
        !           420:        ConfigureParams.Screen.nVdiColors = GEMCOLOR_16;
1.1.1.9   root      421:        ConfigureParams.Screen.bCaptureChange = FALSE;
                    422:        ConfigureParams.Screen.nFramesPerSecond = 25;
1.1.1.12! root      423:        ConfigureParams.Screen.nWindowBorderPixelsLeft = 48;
        !           424:        ConfigureParams.Screen.nWindowBorderPixelsRight = 48;
        !           425:        ConfigureParams.Screen.nWindowBorderPixelsBottom = OVERSCAN_BOTTOM;
        !           426:        ConfigureParams.Screen.nFullScreenBorderPixelsLeft = 32;
        !           427:        ConfigureParams.Screen.nFullScreenBorderPixelsRight = 32;
        !           428:        ConfigureParams.Screen.nFullScreenBorderPixelsBottom = OVERSCAN_BOTTOM;
1.1.1.9   root      429: 
                    430:        /* Set defaults for Sound */
                    431:        ConfigureParams.Sound.bEnableSound = TRUE;
1.1.1.12! root      432:        ConfigureParams.Sound.nPlaybackQuality = PLAYBACK_HIGH;
        !           433:        sprintf(ConfigureParams.Sound.szYMCaptureFileName, "%s%chatari.wav",
        !           434:                psWorkingDir, PATHSEP);
1.1.1.9   root      435: 
                    436:        /* Set defaults for Rom */
1.1.1.12! root      437:        sprintf(ConfigureParams.Rom.szTosImageFileName, "%s%ctos.img",
        !           438:                Paths_GetDataDir(), PATHSEP);
1.1.1.9   root      439:        strcpy(ConfigureParams.Rom.szCartridgeImageFileName, "");
                    440: 
                    441:        /* Set defaults for System */
                    442:        ConfigureParams.System.nCpuLevel = 0;
                    443:        ConfigureParams.System.nCpuFreq = 8;
1.1.1.12! root      444:        ConfigureParams.System.bCompatibleCpu = TRUE;
1.1.1.9   root      445:        /*ConfigureParams.System.bAddressSpace24 = TRUE;*/
                    446:        ConfigureParams.System.nMachineType = MACHINE_ST;
                    447:        ConfigureParams.System.bBlitter = FALSE;
1.1.1.12! root      448:        ConfigureParams.System.nDSPType = DSP_TYPE_NONE;
1.1.1.9   root      449:        ConfigureParams.System.bPatchTimerD = TRUE;
                    450:        ConfigureParams.System.bRealTimeClock = TRUE;
                    451:        ConfigureParams.System.nMinMaxSpeed = MINMAXSPEED_MIN;
                    452:        ConfigureParams.System.bSlowFDC = FALSE;
                    453: 
                    454:        /* Initialize the configuration file name */
1.1.1.12! root      455:        if (strlen(psHomeDir) < sizeof(sConfigFileName)-13)
        !           456:                sprintf(sConfigFileName, "%s%chatari.cfg", psHomeDir, PATHSEP);
1.1.1.9   root      457:        else
                    458:                strcpy(sConfigFileName, "hatari.cfg");
1.1.1.12! root      459: 
        !           460: #if defined(__AMIGAOS4__)
        !           461:        /* Fix default path names on Amiga OS */
        !           462:        sprintf(ConfigureParams.Rom.szTosImageFileName, "%stos.img", Paths_GetDataDir());
        !           463: #endif
1.1.1.2   root      464: }
                    465: 
                    466: 
                    467: /*-----------------------------------------------------------------------*/
1.1.1.12! root      468: /**
        !           469:  * Copy details from configuration structure into global variables for system,
        !           470:  * clean file names, etc...  Called from main.c and dialog.c files.
        !           471:  */
        !           472: void Configuration_Apply(BOOL bReset)
1.1.1.8   root      473: {
1.1.1.9   root      474:        if (bReset)
                    475:        {
1.1.1.12! root      476:                /* Set resolution change */
1.1.1.9   root      477:                bUseVDIRes = ConfigureParams.Screen.bUseExtVdiResolutions;
1.1.1.12! root      478:                bUseHighRes = ((!bUseVDIRes) && ConfigureParams.Screen.MonitorType == MONITOR_TYPE_MONO)
        !           479:                        || (bUseVDIRes && ConfigureParams.Screen.nVdiColors == GEMCOLOR_2);
        !           480:                if (bUseHighRes)
        !           481:                {
        !           482:                        STRes = ST_HIGH_RES;
        !           483:                }
        !           484:                if (bUseVDIRes)
        !           485:                {
        !           486:                        VDI_SetResolution(ConfigureParams.Screen.nVdiColors,
        !           487:                                          ConfigureParams.Screen.nVdiWidth,
        !           488:                                          ConfigureParams.Screen.nVdiHeight);
        !           489:                }
1.1.1.9   root      490:        }
                    491: 
                    492:        /* Set playback frequency */
                    493:        if (ConfigureParams.Sound.bEnableSound)
                    494:                Audio_SetOutputAudioFreq(ConfigureParams.Sound.nPlaybackQuality);
                    495: 
                    496:        /* CPU settings */
                    497:        if (ConfigureParams.System.nCpuFreq < 12)
                    498:        {
                    499:                ConfigureParams.System.nCpuFreq = 8;
                    500:                nCpuFreqShift = 0;
                    501:        }
                    502:        else if (ConfigureParams.System.nCpuFreq > 26)
                    503:        {
                    504:                ConfigureParams.System.nCpuFreq = 32;
                    505:                nCpuFreqShift = 2;
                    506:        }
                    507:        else
                    508:        {
                    509:                ConfigureParams.System.nCpuFreq = 16;
                    510:                nCpuFreqShift = 1;
                    511:        }
1.1.1.12! root      512:        /* Change UAE cpu_level and cpu_compatible accordingly */
        !           513:        M68000_CheckCpuLevel();
1.1.1.9   root      514: 
                    515:        /* Clean file and directory names */
                    516:        File_MakeAbsoluteName(ConfigureParams.Rom.szTosImageFileName);
1.1.1.11  root      517:        if (strlen(ConfigureParams.Rom.szCartridgeImageFileName) > 0)
                    518:                File_MakeAbsoluteName(ConfigureParams.Rom.szCartridgeImageFileName);
1.1.1.10  root      519:        File_MakeAbsoluteName(ConfigureParams.HardDisk.szHardDiskImage);
                    520:        File_CleanFileName(ConfigureParams.HardDisk.szHardDiskDirectories[0]);
                    521:        File_MakeAbsoluteName(ConfigureParams.HardDisk.szHardDiskDirectories[0]);
1.1.1.12! root      522:        File_MakeAbsoluteName(ConfigureParams.Memory.szMemoryCaptureFileName);
        !           523:        File_MakeAbsoluteName(ConfigureParams.Sound.szYMCaptureFileName);
        !           524:        if (strlen(ConfigureParams.Keyboard.szMappingFileName) > 0)
        !           525:                File_MakeAbsoluteName(ConfigureParams.Keyboard.szMappingFileName);
1.1.1.9   root      526:        File_MakeAbsoluteName(ConfigureParams.RS232.szOutFileName);
                    527:        File_MakeAbsoluteName(ConfigureParams.RS232.szInFileName);
1.1.1.12! root      528:        
        !           529:        /* make path names absolute, but handle special file names */
        !           530:        File_MakeAbsoluteSpecialName(ConfigureParams.Log.sLogFileName);
        !           531:        File_MakeAbsoluteSpecialName(ConfigureParams.Midi.szMidiOutFileName);
        !           532:        File_MakeAbsoluteSpecialName(ConfigureParams.Printer.szPrintToFileName);
1.1.1.8   root      533: }
                    534: 
                    535: 
                    536: /*-----------------------------------------------------------------------*/
1.1.1.12! root      537: /**
        !           538:  * Load a settings section from the configuration file.
        !           539:  */
1.1.1.9   root      540: static int Configuration_LoadSection(const char *pFilename, const struct Config_Tag configs[], const char *pSection)
1.1       root      541: {
1.1.1.9   root      542:        int ret;
1.1       root      543: 
1.1.1.9   root      544:        ret = input_config(pFilename, configs, pSection);
1.1       root      545: 
1.1.1.9   root      546:        if (ret < 0)
                    547:                fprintf(stderr, "Can not load configuration file %s (section %s).\n",
                    548:                        sConfigFileName, pSection);
1.1       root      549: 
1.1.1.9   root      550:        return ret;
1.1       root      551: }
                    552: 
                    553: 
                    554: /*-----------------------------------------------------------------------*/
1.1.1.12! root      555: /**
        !           556:  * Load program setting from configuration file. If psFileName is NULL, use
        !           557:  * the default (i.e. the users) configuration file.
        !           558:  */
1.1.1.9   root      559: void Configuration_Load(const char *psFileName)
1.1       root      560: {
1.1.1.9   root      561:        if (psFileName == NULL)
                    562:                psFileName = sConfigFileName;
                    563: 
                    564:        if (!File_Exists(psFileName))
                    565:        {
                    566:                fprintf(stderr, "Configuration file %s not found.\n", psFileName);
                    567:                return;
                    568:        }
                    569: 
                    570:        bFirstTimeInstall = FALSE;
                    571: 
                    572:        Configuration_LoadSection(psFileName, configs_Log, "[Log]");
                    573:        Configuration_LoadSection(psFileName, configs_Screen, "[Screen]");
                    574:        Configuration_LoadSection(psFileName, configs_Joystick0, "[Joystick0]");
                    575:        Configuration_LoadSection(psFileName, configs_Joystick1, "[Joystick1]");
1.1.1.10  root      576:        Configuration_LoadSection(psFileName, configs_Joystick2, "[Joystick2]");
                    577:        Configuration_LoadSection(psFileName, configs_Joystick3, "[Joystick3]");
                    578:        Configuration_LoadSection(psFileName, configs_Joystick4, "[Joystick4]");
                    579:        Configuration_LoadSection(psFileName, configs_Joystick5, "[Joystick5]");
1.1.1.9   root      580:        Configuration_LoadSection(psFileName, configs_Keyboard, "[Keyboard]");
1.1.1.11  root      581:        Configuration_LoadSection(psFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]");
                    582:        Configuration_LoadSection(psFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]");
1.1.1.9   root      583:        Configuration_LoadSection(psFileName, configs_Sound, "[Sound]");
                    584:        Configuration_LoadSection(psFileName, configs_Memory, "[Memory]");
                    585:        Configuration_LoadSection(psFileName, configs_Floppy, "[Floppy]");
1.1.1.10  root      586:        Configuration_LoadSection(psFileName, configs_HardDisk, "[HardDisk]");
1.1.1.9   root      587:        Configuration_LoadSection(psFileName, configs_Rom, "[ROM]");
                    588:        Configuration_LoadSection(psFileName, configs_Rs232, "[RS232]");
                    589:        Configuration_LoadSection(psFileName, configs_Printer, "[Printer]");
                    590:        Configuration_LoadSection(psFileName, configs_Midi, "[Midi]");
                    591:        Configuration_LoadSection(psFileName, configs_System, "[System]");
1.1       root      592: }
                    593: 
                    594: 
                    595: /*-----------------------------------------------------------------------*/
1.1.1.12! root      596: /**
        !           597:  * Save a settings section to configuration file
        !           598:  */
1.1.1.9   root      599: static int Configuration_SaveSection(const char *pFilename, const struct Config_Tag configs[], const char *pSection)
1.1       root      600: {
1.1.1.9   root      601:        int ret;
1.1       root      602: 
1.1.1.9   root      603:        ret = update_config(pFilename, configs, pSection);
1.1       root      604: 
1.1.1.9   root      605:        if (ret < 0)
                    606:                fprintf(stderr, "Error while updating section %s\n", pSection);
1.1       root      607: 
1.1.1.9   root      608:        return ret;
1.1       root      609: }
                    610: 
                    611: 
                    612: /*-----------------------------------------------------------------------*/
1.1.1.12! root      613: /**
        !           614:  * Save program setting to configuration file
        !           615:  */
1.1.1.6   root      616: void Configuration_Save(void)
1.1       root      617: {
1.1.1.9   root      618:        if (Configuration_SaveSection(sConfigFileName, configs_Log, "[Log]") < 0)
                    619:        {
                    620:                fprintf(stderr, "Error saving config file.\n");
                    621:                return;
                    622:        }
                    623:        Configuration_SaveSection(sConfigFileName, configs_Screen, "[Screen]");
                    624:        Configuration_SaveSection(sConfigFileName, configs_Joystick0, "[Joystick0]");
                    625:        Configuration_SaveSection(sConfigFileName, configs_Joystick1, "[Joystick1]");
1.1.1.10  root      626:        Configuration_SaveSection(sConfigFileName, configs_Joystick2, "[Joystick2]");
                    627:        Configuration_SaveSection(sConfigFileName, configs_Joystick3, "[Joystick3]");
                    628:        Configuration_SaveSection(sConfigFileName, configs_Joystick4, "[Joystick4]");
                    629:        Configuration_SaveSection(sConfigFileName, configs_Joystick5, "[Joystick5]");
1.1.1.9   root      630:        Configuration_SaveSection(sConfigFileName, configs_Keyboard, "[Keyboard]");
1.1.1.11  root      631:        Configuration_SaveSection(sConfigFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]");
                    632:        Configuration_SaveSection(sConfigFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]");
1.1.1.9   root      633:        Configuration_SaveSection(sConfigFileName, configs_Sound, "[Sound]");
                    634:        Configuration_SaveSection(sConfigFileName, configs_Memory, "[Memory]");
                    635:        Configuration_SaveSection(sConfigFileName, configs_Floppy, "[Floppy]");
1.1.1.10  root      636:        Configuration_SaveSection(sConfigFileName, configs_HardDisk, "[HardDisk]");
1.1.1.9   root      637:        Configuration_SaveSection(sConfigFileName, configs_Rom, "[ROM]");
                    638:        Configuration_SaveSection(sConfigFileName, configs_Rs232, "[RS232]");
                    639:        Configuration_SaveSection(sConfigFileName, configs_Printer, "[Printer]");
                    640:        Configuration_SaveSection(sConfigFileName, configs_Midi, "[Midi]");
                    641:        Configuration_SaveSection(sConfigFileName, configs_System, "[System]");
1.1       root      642: }
1.1.1.6   root      643: 
1.1.1.12! root      644: 
        !           645: /*-----------------------------------------------------------------------*/
        !           646: /**
        !           647:  * Save/restore snapshot of configuration variables
        !           648:  * ('MemorySnapShot_Store' handles type)
        !           649:  */
        !           650: void Configuration_MemorySnapShot_Capture(BOOL bSave)
        !           651: {
        !           652:        MemorySnapShot_Store(ConfigureParams.Rom.szTosImageFileName, sizeof(ConfigureParams.Rom.szTosImageFileName));
        !           653:        MemorySnapShot_Store(ConfigureParams.Rom.szCartridgeImageFileName, sizeof(ConfigureParams.Rom.szCartridgeImageFileName));
        !           654: 
        !           655:        MemorySnapShot_Store(&ConfigureParams.Memory.nMemorySize, sizeof(ConfigureParams.Memory.nMemorySize));
        !           656: 
        !           657:        MemorySnapShot_Store(&ConfigureParams.HardDisk.bUseHardDiskDirectories, sizeof(ConfigureParams.HardDisk.bUseHardDiskDirectories));
        !           658:        MemorySnapShot_Store(ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C], sizeof(ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C]));
        !           659:        MemorySnapShot_Store(&ConfigureParams.HardDisk.bUseHardDiskImage, sizeof(ConfigureParams.HardDisk.bUseHardDiskImage));
        !           660:        MemorySnapShot_Store(ConfigureParams.HardDisk.szHardDiskImage, sizeof(ConfigureParams.HardDisk.szHardDiskImage));
        !           661: 
        !           662:        MemorySnapShot_Store(&ConfigureParams.Screen.MonitorType, sizeof(ConfigureParams.Screen.MonitorType));
        !           663:        MemorySnapShot_Store(&ConfigureParams.Screen.bUseExtVdiResolutions, sizeof(ConfigureParams.Screen.bUseExtVdiResolutions));
        !           664:        MemorySnapShot_Store(&ConfigureParams.Screen.nVdiWidth, sizeof(ConfigureParams.Screen.nVdiWidth));
        !           665:        MemorySnapShot_Store(&ConfigureParams.Screen.nVdiHeight, sizeof(ConfigureParams.Screen.nVdiHeight));
        !           666:        MemorySnapShot_Store(&ConfigureParams.Screen.nVdiColors, sizeof(ConfigureParams.Screen.nVdiColors));
        !           667: 
        !           668:        MemorySnapShot_Store(&ConfigureParams.System.nCpuLevel, sizeof(ConfigureParams.System.nCpuLevel));
        !           669:        MemorySnapShot_Store(&ConfigureParams.System.nCpuFreq, sizeof(ConfigureParams.System.nCpuFreq));
        !           670:        MemorySnapShot_Store(&ConfigureParams.System.bCompatibleCpu, sizeof(ConfigureParams.System.bCompatibleCpu));
        !           671:        MemorySnapShot_Store(&ConfigureParams.System.nMachineType, sizeof(ConfigureParams.System.nMachineType));
        !           672:        MemorySnapShot_Store(&ConfigureParams.System.bBlitter, sizeof(ConfigureParams.System.bBlitter));
        !           673:        MemorySnapShot_Store(&ConfigureParams.System.nDSPType, sizeof(ConfigureParams.System.nDSPType));
        !           674:        MemorySnapShot_Store(&ConfigureParams.System.bRealTimeClock, sizeof(ConfigureParams.System.bRealTimeClock));
        !           675:        MemorySnapShot_Store(&ConfigureParams.System.bPatchTimerD, sizeof(ConfigureParams.System.bPatchTimerD));
        !           676:        MemorySnapShot_Store(&ConfigureParams.System.bSlowFDC, sizeof(ConfigureParams.System.bSlowFDC));
        !           677: 
        !           678:        if (!bSave)
        !           679:                Configuration_Apply(TRUE);
        !           680: }
        !           681: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.