Annotation of previous/src/configuration.c, revision 1.1.1.2

1.1       root        1: /*
                      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.
                      6: 
                      7:   Configuration File
                      8: 
                      9:   The configuration file is now stored in an ASCII format to allow the user
                     10:   to edit the file manually.
                     11: */
                     12: const char Configuration_fileid[] = "Hatari configuration.c : " __DATE__ " " __TIME__;
                     13: 
                     14: #include <SDL_keysym.h>
                     15: 
                     16: #include "main.h"
                     17: #include "configuration.h"
                     18: #include "cfgopts.h"
                     19: #include "file.h"
                     20: #include "log.h"
                     21: #include "m68000.h"
                     22: #include "memorySnapShot.h"
                     23: #include "paths.h"
                     24: #include "screen.h"
                     25: #include "video.h"
1.1.1.2 ! root       26: #include "avi_record.h"
        !            27: #include "clocks_timings.h"
1.1       root       28: 
                     29: 
                     30: CNF_PARAMS ConfigureParams;                 /* List of configuration for the emulator */
                     31: char sConfigFileName[FILENAME_MAX];         /* Stores the name of the configuration file */
                     32: 
                     33: 
                     34: /* Used to load/save logging options */
                     35: static const struct Config_Tag configs_Log[] =
                     36: {
                     37:        { "sLogFileName", String_Tag, ConfigureParams.Log.sLogFileName },
                     38:        { "sTraceFileName", String_Tag, ConfigureParams.Log.sTraceFileName },
                     39:        { "nTextLogLevel", Int_Tag, &ConfigureParams.Log.nTextLogLevel },
                     40:        { "nAlertDlgLogLevel", Int_Tag, &ConfigureParams.Log.nAlertDlgLogLevel },
                     41:        { "bConfirmQuit", Bool_Tag, &ConfigureParams.Log.bConfirmQuit },
                     42:        { NULL , Error_Tag, NULL }
                     43: };
                     44: 
                     45: /* Used to load/save debugger options */
                     46: static const struct Config_Tag configs_Debugger[] =
                     47: {
                     48:        { "nNumberBase", Int_Tag, &ConfigureParams.Debugger.nNumberBase },
                     49:        { "nDisasmLines", Int_Tag, &ConfigureParams.Debugger.nDisasmLines },
                     50:        { "nMemdumpLines", Int_Tag, &ConfigureParams.Debugger.nMemdumpLines },
                     51:        { NULL , Error_Tag, NULL }
                     52: };
                     53: 
                     54: /* Used to load/save screen options */
                     55: static const struct Config_Tag configs_Screen[] =
                     56: {
                     57:        { "nMonitorType", Int_Tag, &ConfigureParams.Screen.nMonitorType },
1.1.1.2 ! root       58: //     { "nFrameSkips", Int_Tag, &ConfigureParams.Screen.nFrameSkips },
1.1       root       59:        { "bFullScreen", Bool_Tag, &ConfigureParams.Screen.bFullScreen },
1.1.1.2 ! root       60:     { "bKeepResolution", Bool_Tag, &ConfigureParams.Screen.bKeepResolution },
1.1       root       61:        { "bAllowOverscan", Bool_Tag, &ConfigureParams.Screen.bAllowOverscan },
                     62:        { "nSpec512Threshold", Int_Tag, &ConfigureParams.Screen.nSpec512Threshold },
                     63:        { "nForceBpp", Int_Tag, &ConfigureParams.Screen.nForceBpp },
                     64:        { "bAspectCorrect", Bool_Tag, &ConfigureParams.Screen.bAspectCorrect },
                     65:        { "bUseExtVdiResolutions", Bool_Tag, &ConfigureParams.Screen.bUseExtVdiResolutions },
                     66:        { "nVdiWidth", Int_Tag, &ConfigureParams.Screen.nVdiWidth },
                     67:        { "nVdiHeight", Int_Tag, &ConfigureParams.Screen.nVdiHeight },
                     68:        { "nVdiColors", Int_Tag, &ConfigureParams.Screen.nVdiColors },
                     69:        { "bShowStatusbar", Bool_Tag, &ConfigureParams.Screen.bShowStatusbar },
                     70:        { "bShowDriveLed", Bool_Tag, &ConfigureParams.Screen.bShowDriveLed },
1.1.1.2 ! root       71:        { "bCrop", Bool_Tag, &ConfigureParams.Screen.bCrop },
1.1       root       72:        { "nMaxWidth", Int_Tag, &ConfigureParams.Screen.nMaxWidth },
                     73:        { "nMaxHeight", Int_Tag, &ConfigureParams.Screen.nMaxHeight },
                     74:        { NULL , Error_Tag, NULL }
                     75: };
                     76: 
                     77: /* Used to load/save joystick 0 options */
                     78: static const struct Config_Tag configs_Joystick0[] =
                     79: {
                     80:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nJoystickMode },
                     81:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[0].bEnableAutoFire },
                     82:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[0].bEnableJumpOnFire2 },
                     83:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nJoyId },
                     84:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeUp },
                     85:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeDown },
                     86:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeLeft },
                     87:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeRight },
                     88:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeFire },
                     89:        { NULL , Error_Tag, NULL }
                     90: };
                     91: 
                     92: /* Used to load/save joystick 1 options */
                     93: static const struct Config_Tag configs_Joystick1[] =
                     94: {
                     95:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nJoystickMode },
                     96:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[1].bEnableAutoFire },
                     97:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[1].bEnableJumpOnFire2 },
                     98:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nJoyId },
                     99:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeUp },
                    100:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeDown },
                    101:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeLeft },
                    102:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeRight },
                    103:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeFire },
                    104:        { NULL , Error_Tag, NULL }
                    105: };
                    106: 
                    107: /* Used to load/save joystick 2 options */
                    108: static const struct Config_Tag configs_Joystick2[] =
                    109: {
                    110:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nJoystickMode },
                    111:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[2].bEnableAutoFire },
                    112:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[2].bEnableJumpOnFire2 },
                    113:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nJoyId },
                    114:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeUp },
                    115:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeDown },
                    116:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeLeft },
                    117:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeRight },
                    118:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeFire },
                    119:        { NULL , Error_Tag, NULL }
                    120: };
                    121: 
                    122: /* Used to load/save joystick 3 options */
                    123: static const struct Config_Tag configs_Joystick3[] =
                    124: {
                    125:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nJoystickMode },
                    126:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[3].bEnableAutoFire },
                    127:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[3].bEnableJumpOnFire2 },
                    128:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nJoyId },
                    129:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeUp },
                    130:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeDown },
                    131:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeLeft },
                    132:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeRight },
                    133:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeFire },
                    134:        { NULL , Error_Tag, NULL }
                    135: };
                    136: 
                    137: /* Used to load/save joystick 4 options */
                    138: static const struct Config_Tag configs_Joystick4[] =
                    139: {
                    140:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nJoystickMode },
                    141:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[4].bEnableAutoFire },
                    142:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[4].bEnableJumpOnFire2 },
                    143:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nJoyId },
                    144:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeUp },
                    145:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeDown },
                    146:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeLeft },
                    147:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeRight },
                    148:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeFire },
                    149:        { NULL , Error_Tag, NULL }
                    150: };
                    151: 
                    152: /* Used to load/save joystick 5 options */
                    153: static const struct Config_Tag configs_Joystick5[] =
                    154: {
                    155:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nJoystickMode },
                    156:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[5].bEnableAutoFire },
                    157:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[5].bEnableJumpOnFire2 },
                    158:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nJoyId },
                    159:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeUp },
                    160:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeDown },
                    161:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeLeft },
                    162:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeRight },
                    163:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeFire },
                    164:        { NULL , Error_Tag, NULL }
                    165: };
                    166: 
                    167: /* Used to load/save keyboard options */
                    168: static const struct Config_Tag configs_Keyboard[] =
                    169: {
                    170:        { "bDisableKeyRepeat", Bool_Tag, &ConfigureParams.Keyboard.bDisableKeyRepeat },
                    171:        { "nKeymapType", Int_Tag, &ConfigureParams.Keyboard.nKeymapType },
                    172:        { "szMappingFileName", String_Tag, ConfigureParams.Keyboard.szMappingFileName },
                    173:        { NULL , Error_Tag, NULL }
                    174: };
                    175: 
                    176: /* Used to load/save shortcut key bindings with modifiers options */
                    177: static const struct Config_Tag configs_ShortCutWithMod[] =
                    178: {
                    179:        { "keyOptions",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_OPTIONS] },
                    180:        { "keyFullScreen", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_FULLSCREEN] },
                    181:        { "keyMouseMode",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_MOUSEGRAB] },
                    182:        { "keyColdReset",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_COLDRESET] },
                    183:        { "keyWarmReset",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_WARMRESET] },
                    184:        { "keyScreenShot", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SCREENSHOT] },
                    185:        { "keyBossKey",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_BOSSKEY] },
                    186:        { "keyCursorEmu",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_CURSOREMU] },
                    187:        { "keyFastForward",Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_FASTFORWARD] },
                    188:        { "keyRecAnim",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_RECANIM] },
                    189:        { "keyRecSound",   Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_RECSOUND] },
                    190:        { "keySound",      Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SOUND] },
                    191:        { "keyPause",      Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_PAUSE] },
                    192:        { "keyDebugger",   Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_DEBUG] },
                    193:        { "keyQuit",       Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_QUIT] },
                    194:        { "keyLoadMem",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_LOADMEM] },
                    195:        { "keySaveMem",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SAVEMEM] },
                    196:        { "keyInsertDiskA",Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_INSERTDISKA] },
                    197:        { NULL , Error_Tag, NULL }
                    198: };
                    199: 
                    200: /* Used to load/save shortcut key bindings without modifiers options */
                    201: static const struct Config_Tag configs_ShortCutWithoutMod[] =
                    202: {
                    203:        { "keyOptions",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_OPTIONS] },
                    204:        { "keyFullScreen", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_FULLSCREEN] },
                    205:        { "keyMouseMode",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_MOUSEGRAB] },
                    206:        { "keyColdReset",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_COLDRESET] },
                    207:        { "keyWarmReset",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_WARMRESET] },
                    208:        { "keyScreenShot", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SCREENSHOT] },
                    209:        { "keyBossKey",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_BOSSKEY] },
                    210:        { "keyCursorEmu",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_CURSOREMU] },
                    211:        { "keyFastForward",Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_FASTFORWARD] },
                    212:        { "keyRecAnim",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_RECANIM] },
                    213:        { "keyRecSound",   Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_RECSOUND] },
                    214:        { "keySound",      Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SOUND] },
                    215:        { "keyPause",      Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_PAUSE] },
                    216:        { "keyDebugger",   Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_DEBUG] },
                    217:        { "keyQuit",       Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_QUIT] },
                    218:        { "keyLoadMem",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_LOADMEM] },
                    219:        { "keySaveMem",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SAVEMEM] },
                    220:        { "keyInsertDiskA",Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_INSERTDISKA] },
                    221:        { NULL , Error_Tag, NULL }
                    222: };
                    223: 
                    224: 
                    225: /* Used to load/save sound options */
                    226: static const struct Config_Tag configs_Sound[] =
                    227: {
1.1.1.2 ! root      228:     { "bEnableMicrophone", Bool_Tag, &ConfigureParams.Sound.bEnableMicrophone },
        !           229:        { "bEnableSound", Bool_Tag, &ConfigureParams.Sound.bEnableSound },
        !           230:        { "nPlaybackFreq", Int_Tag, &ConfigureParams.Sound.nPlaybackFreq },
        !           231:        { "nSdlAudioBufferSize", Int_Tag, &ConfigureParams.Sound.SdlAudioBufferSize },
        !           232:     { "szYMCaptureFileName", String_Tag, ConfigureParams.Sound.szYMCaptureFileName },
        !           233: //    { "YmVolumeMixing", Int_Tag, &ConfigureParams.Sound.YmVolumeMixing },
1.1       root      234:        { NULL , Error_Tag, NULL }
                    235: };
                    236: 
                    237: /* Used to load/save memory options */
                    238: static const struct Config_Tag configs_Memory[] =
                    239: {
                    240:        { "nMemorySize", Int_Tag, &ConfigureParams.Memory.nMemorySize },
                    241:        { "bAutoSave", Bool_Tag, &ConfigureParams.Memory.bAutoSave },
                    242:        { "szMemoryCaptureFileName", String_Tag, ConfigureParams.Memory.szMemoryCaptureFileName },
                    243:        { "szAutoSaveFileName", String_Tag, ConfigureParams.Memory.szAutoSaveFileName },
                    244:        { NULL , Error_Tag, NULL }
                    245: };
                    246: 
                    247: 
                    248: /* Used to load/save floppy options */
                    249: static const struct Config_Tag configs_Floppy[] =
                    250: {
                    251:        { "bAutoInsertDiskB", Bool_Tag, &ConfigureParams.DiskImage.bAutoInsertDiskB },
                    252:        { "bSlowFloppy", Bool_Tag, &ConfigureParams.DiskImage.bSlowFloppy },
                    253:        { "nWriteProtection", Int_Tag, &ConfigureParams.DiskImage.nWriteProtection },
                    254:        { "szDiskAZipPath", String_Tag, ConfigureParams.DiskImage.szDiskZipPath[0] },
                    255:        { "szDiskAFileName", String_Tag, ConfigureParams.DiskImage.szDiskFileName[0] },
                    256:        { "szDiskBZipPath", String_Tag, ConfigureParams.DiskImage.szDiskZipPath[1] },
                    257:        { "szDiskBFileName", String_Tag, ConfigureParams.DiskImage.szDiskFileName[1] },
                    258:        { "szDiskImageDirectory", String_Tag, ConfigureParams.DiskImage.szDiskImageDirectory },
                    259:        { NULL , Error_Tag, NULL }
                    260: };
                    261: 
                    262: /* Used to load/save HD options */
                    263: static const struct Config_Tag configs_HardDisk[] =
                    264: {
                    265:        { "bBootFromHardDisk", Bool_Tag, &ConfigureParams.HardDisk.bBootFromHardDisk },
                    266:        { "bUseHardDiskDirectory", Bool_Tag, &ConfigureParams.HardDisk.bUseHardDiskDirectories },
                    267:        { "szHardDiskDirectory", String_Tag, ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C] },
                    268:        { "nWriteProtection", Int_Tag, &ConfigureParams.HardDisk.nWriteProtection },
                    269:        { "bUseHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseHardDiskImage },
                    270:        { "szHardDiskImage", String_Tag, ConfigureParams.HardDisk.szHardDiskImage },
                    271:        { "bUseIdeMasterHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseIdeMasterHardDiskImage },
                    272:        { "bUseIdeSlaveHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseIdeSlaveHardDiskImage },
                    273:        { "szIdeMasterHardDiskImage", String_Tag, ConfigureParams.HardDisk.szIdeMasterHardDiskImage },
                    274:        { "szIdeSlaveHardDiskImage", String_Tag, ConfigureParams.HardDisk.szIdeSlaveHardDiskImage },
                    275:        { NULL , Error_Tag, NULL }
                    276: };
                    277: 
                    278: /* Used to load/save ROM options */
                    279: static const struct Config_Tag configs_Rom[] =
                    280: {
                    281:        { "szTosImageFileName", String_Tag, ConfigureParams.Rom.szTosImageFileName },
                    282:        { "szCartridgeImageFileName", String_Tag, ConfigureParams.Rom.szCartridgeImageFileName },
                    283:        { NULL , Error_Tag, NULL }
                    284: };
                    285: 
                    286: /* Used to load/save RS232 options */
                    287: static const struct Config_Tag configs_Rs232[] =
                    288: {
                    289:        { "bEnableRS232", Bool_Tag, &ConfigureParams.RS232.bEnableRS232 },
                    290:        { "szOutFileName", String_Tag, ConfigureParams.RS232.szOutFileName },
                    291:        { "szInFileName", String_Tag, ConfigureParams.RS232.szInFileName },
                    292:        { NULL , Error_Tag, NULL }
                    293: };
                    294: 
                    295: /* Used to load/save printer options */
                    296: static const struct Config_Tag configs_Printer[] =
                    297: {
                    298:        { "bEnablePrinting", Bool_Tag, &ConfigureParams.Printer.bEnablePrinting },
                    299:        { "bPrintToFile", Bool_Tag, &ConfigureParams.Printer.bPrintToFile },
                    300:        { "szPrintToFileName", String_Tag, ConfigureParams.Printer.szPrintToFileName },
                    301:        { NULL , Error_Tag, NULL }
                    302: };
                    303: 
                    304: /* Used to load/save MIDI options */
                    305: static const struct Config_Tag configs_Midi[] =
                    306: {
                    307:        { "bEnableMidi", Bool_Tag, &ConfigureParams.Midi.bEnableMidi },
                    308:        { "sMidiInFileName", String_Tag, ConfigureParams.Midi.sMidiInFileName },
                    309:        { "sMidiOutFileName", String_Tag, ConfigureParams.Midi.sMidiOutFileName },
                    310:        { NULL , Error_Tag, NULL }
                    311: };
                    312: 
                    313: /* Used to load/save system options */
                    314: static const struct Config_Tag configs_System[] =
                    315: {
                    316:        { "nCpuLevel", Int_Tag, &ConfigureParams.System.nCpuLevel },
                    317:        { "nCpuFreq", Int_Tag, &ConfigureParams.System.nCpuFreq },
                    318:        { "bCompatibleCpu", Bool_Tag, &ConfigureParams.System.bCompatibleCpu },
                    319:        { "nMachineType", Int_Tag, &ConfigureParams.System.nMachineType },
                    320:        { "bBlitter", Bool_Tag, &ConfigureParams.System.bBlitter },
                    321:        { "nDSPType", Int_Tag, &ConfigureParams.System.nDSPType },
                    322:        { "bRealTimeClock", Bool_Tag, &ConfigureParams.System.bRealTimeClock },
                    323:        { "bPatchTimerD", Bool_Tag, &ConfigureParams.System.bPatchTimerD },
                    324:        { "bFastForward", Bool_Tag, &ConfigureParams.System.bFastForward },
1.1.1.2 ! root      325:     
        !           326: #if ENABLE_WINUAE_CPU
        !           327:     { "bAddressSpace24", Bool_Tag, &ConfigureParams.System.bAddressSpace24 },
        !           328:     { "bCycleExactCpu", Bool_Tag, &ConfigureParams.System.bCycleExactCpu },
        !           329:     { "n_FPUType", Int_Tag, &ConfigureParams.System.n_FPUType },
        !           330:     { "bCompatibleFPU", Bool_Tag, &ConfigureParams.System.bCompatibleFPU },
        !           331:     { "bMMU", Bool_Tag, &ConfigureParams.System.bMMU },
        !           332: #endif
        !           333:     { NULL , Error_Tag, NULL }
        !           334:     };
        !           335: 
        !           336: /* Used to load/save video options */
        !           337: static const struct Config_Tag configs_Video[] =
        !           338: {
        !           339:     { "AviRecordVcodec", Int_Tag, &ConfigureParams.Video.AviRecordVcodec },
        !           340:     { "AviRecordFps", Int_Tag, &ConfigureParams.Video.AviRecordFps },
        !           341:     { "AviRecordFile", String_Tag, ConfigureParams.Video.AviRecordFile },
1.1       root      342:        { NULL , Error_Tag, NULL }
                    343: };
                    344: 
                    345: 
                    346: /*-----------------------------------------------------------------------*/
                    347: /**
                    348:  * Set default configuration values.
                    349:  */
                    350: void Configuration_SetDefault(void)
                    351: {
                    352:        int i;
                    353:        const char *psHomeDir;
                    354:        const char *psWorkingDir;
                    355: 
                    356:        psHomeDir = Paths_GetHatariHome();
                    357:        psWorkingDir = Paths_GetWorkingDir();
                    358: 
                    359:        /* Clear parameters */
                    360:        memset(&ConfigureParams, 0, sizeof(CNF_PARAMS));
                    361: 
                    362:        /* Set defaults for logging and tracing */
                    363:        strcpy(ConfigureParams.Log.sLogFileName, "stderr");
                    364:        strcpy(ConfigureParams.Log.sTraceFileName, "stderr");
                    365:        ConfigureParams.Log.nTextLogLevel = LOG_TODO;
                    366:        ConfigureParams.Log.nAlertDlgLogLevel = LOG_ERROR;
                    367:        ConfigureParams.Log.bConfirmQuit = true;
                    368: 
                    369:        /* Set defaults for debugger */
                    370:        ConfigureParams.Debugger.nNumberBase = 10;
                    371:        ConfigureParams.Debugger.nDisasmLines = 8;
                    372:        ConfigureParams.Debugger.nMemdumpLines = 8;
                    373: 
                    374:        /* Set defaults for floppy disk images */
                    375:        ConfigureParams.DiskImage.bAutoInsertDiskB = true;
                    376:        ConfigureParams.DiskImage.bSlowFloppy = false;
                    377:        ConfigureParams.DiskImage.nWriteProtection = WRITEPROT_OFF;
                    378:        for (i = 0; i < 2; i++)
                    379:        {
                    380:                ConfigureParams.DiskImage.szDiskZipPath[i][0] = '\0';
                    381:                ConfigureParams.DiskImage.szDiskFileName[i][0] = '\0';
                    382:        }
                    383:        strcpy(ConfigureParams.DiskImage.szDiskImageDirectory, psWorkingDir);
                    384:        File_AddSlashToEndFileName(ConfigureParams.DiskImage.szDiskImageDirectory);
                    385: 
                    386:        /* Set defaults for hard disks */
                    387:        ConfigureParams.HardDisk.bBootFromHardDisk = false;
                    388:        ConfigureParams.HardDisk.nWriteProtection = WRITEPROT_OFF;
                    389:        ConfigureParams.HardDisk.nHardDiskDir = DRIVE_C;
                    390:        ConfigureParams.HardDisk.bUseHardDiskDirectories = false;
                    391:        for (i = 0; i < MAX_HARDDRIVES; i++)
                    392:        {
                    393:                strcpy(ConfigureParams.HardDisk.szHardDiskDirectories[i], psWorkingDir);
                    394:                File_CleanFileName(ConfigureParams.HardDisk.szHardDiskDirectories[i]);
                    395:        }
                    396:        ConfigureParams.HardDisk.bUseHardDiskImage = false;
                    397:        strcpy(ConfigureParams.HardDisk.szHardDiskImage, psWorkingDir);
                    398:        ConfigureParams.HardDisk.bUseIdeMasterHardDiskImage = false;
                    399:        strcpy(ConfigureParams.HardDisk.szIdeMasterHardDiskImage, psWorkingDir);
                    400:        ConfigureParams.HardDisk.bUseIdeSlaveHardDiskImage = false;
                    401:        strcpy(ConfigureParams.HardDisk.szIdeSlaveHardDiskImage, psWorkingDir);
                    402: 
                    403:        /* Set defaults for Joysticks */
                    404:        for (i = 0; i < JOYSTICK_COUNT; i++)
                    405:        {
                    406:                ConfigureParams.Joysticks.Joy[i].nJoystickMode = JOYSTICK_DISABLED;
                    407:                ConfigureParams.Joysticks.Joy[i].bEnableAutoFire = false;
                    408:                ConfigureParams.Joysticks.Joy[i].bEnableJumpOnFire2 = false;
                    409:                ConfigureParams.Joysticks.Joy[i].nJoyId = i;
                    410:                ConfigureParams.Joysticks.Joy[i].nKeyCodeUp = SDLK_UP;
                    411:                ConfigureParams.Joysticks.Joy[i].nKeyCodeDown = SDLK_DOWN;
                    412:                ConfigureParams.Joysticks.Joy[i].nKeyCodeLeft = SDLK_LEFT;
                    413:                ConfigureParams.Joysticks.Joy[i].nKeyCodeRight = SDLK_RIGHT;
                    414:                ConfigureParams.Joysticks.Joy[i].nKeyCodeFire = SDLK_RCTRL;
                    415:        }
                    416:        ConfigureParams.Joysticks.Joy[1].nJoyId = 0;    /* ST Joystick #1 is default joystick */
                    417:        ConfigureParams.Joysticks.Joy[0].nJoyId = 1;
                    418:        ConfigureParams.Joysticks.Joy[1].nJoystickMode = JOYSTICK_REALSTICK;
                    419: 
                    420:        /* Set defaults for Keyboard */
                    421:        ConfigureParams.Keyboard.bDisableKeyRepeat = false;
                    422:        ConfigureParams.Keyboard.nKeymapType = KEYMAP_SYMBOLIC;
                    423:        strcpy(ConfigureParams.Keyboard.szMappingFileName, "");
                    424:   
                    425:        /* Set defaults for Shortcuts */
                    426:        ConfigureParams.Shortcut.withoutModifier[SHORTCUT_OPTIONS] = SDLK_F12;
                    427:        ConfigureParams.Shortcut.withoutModifier[SHORTCUT_FULLSCREEN] = SDLK_F11;
1.1.1.2 ! root      428:     
        !           429:        ConfigureParams.Shortcut.withModifier[SHORTCUT_PAUSE] = SDLK_p;
        !           430:        ConfigureParams.Shortcut.withModifier[SHORTCUT_DEBUG] = SDLK_d;
        !           431:     
1.1       root      432:        ConfigureParams.Shortcut.withModifier[SHORTCUT_OPTIONS] = SDLK_o;
                    433:        ConfigureParams.Shortcut.withModifier[SHORTCUT_FULLSCREEN] = SDLK_f;
                    434:        ConfigureParams.Shortcut.withModifier[SHORTCUT_MOUSEGRAB] = SDLK_m;
                    435:        ConfigureParams.Shortcut.withModifier[SHORTCUT_COLDRESET] = SDLK_c;
                    436:        ConfigureParams.Shortcut.withModifier[SHORTCUT_WARMRESET] = SDLK_r;
                    437:        ConfigureParams.Shortcut.withModifier[SHORTCUT_SCREENSHOT] = SDLK_g;
                    438:        ConfigureParams.Shortcut.withModifier[SHORTCUT_BOSSKEY] = SDLK_i;
                    439:        ConfigureParams.Shortcut.withModifier[SHORTCUT_CURSOREMU] = SDLK_j;
                    440:        ConfigureParams.Shortcut.withModifier[SHORTCUT_FASTFORWARD] = SDLK_x;
                    441:        ConfigureParams.Shortcut.withModifier[SHORTCUT_RECANIM] = SDLK_a;
                    442:        ConfigureParams.Shortcut.withModifier[SHORTCUT_RECSOUND] = SDLK_y;
                    443:        ConfigureParams.Shortcut.withModifier[SHORTCUT_SOUND] = SDLK_s;
                    444:        ConfigureParams.Shortcut.withModifier[SHORTCUT_QUIT] = SDLK_q;
                    445:        ConfigureParams.Shortcut.withModifier[SHORTCUT_LOADMEM] = SDLK_l;
                    446:        ConfigureParams.Shortcut.withModifier[SHORTCUT_SAVEMEM] = SDLK_k;
1.1.1.2 ! root      447:        ConfigureParams.Shortcut.withModifier[SHORTCUT_INSERTDISKA] = SDLK_1;
1.1       root      448: 
                    449:        /* Set defaults for Memory */
                    450:        ConfigureParams.Memory.nMemorySize = 1;     /* 1 MiB */
                    451:        ConfigureParams.Memory.bAutoSave = false;
                    452:        sprintf(ConfigureParams.Memory.szMemoryCaptureFileName, "%s%chatari.sav",
                    453:                psHomeDir, PATHSEP);
                    454:        sprintf(ConfigureParams.Memory.szAutoSaveFileName, "%s%cauto.sav",
                    455:                psHomeDir, PATHSEP);
                    456: 
                    457:        /* Set defaults for Printer */
                    458:        ConfigureParams.Printer.bEnablePrinting = false;
                    459:        ConfigureParams.Printer.bPrintToFile = true;
                    460:        sprintf(ConfigureParams.Printer.szPrintToFileName, "%s%chatari.prn",
                    461:                psHomeDir, PATHSEP);
                    462: 
                    463:        /* Set defaults for RS232 */
                    464:        ConfigureParams.RS232.bEnableRS232 = false;
                    465:        strcpy(ConfigureParams.RS232.szOutFileName, "/dev/modem");
                    466:        strcpy(ConfigureParams.RS232.szInFileName, "/dev/modem");
                    467: 
                    468:        /* Set defaults for MIDI */
                    469:        ConfigureParams.Midi.bEnableMidi = false;
                    470:        strcpy(ConfigureParams.Midi.sMidiInFileName, "/dev/snd/midiC1D0");
                    471:        strcpy(ConfigureParams.Midi.sMidiOutFileName, "/dev/snd/midiC1D0");
                    472: 
                    473:        /* Set defaults for Screen */
                    474:        ConfigureParams.Screen.bFullScreen = false;
1.1.1.2 ! root      475:     ConfigureParams.Screen.bKeepResolution = true;
        !           476: //     ConfigureParams.Screen.nFrameSkips = AUTO_FRAMESKIP_LIMIT;
1.1       root      477:        ConfigureParams.Screen.bAllowOverscan = true;
                    478:        ConfigureParams.Screen.nSpec512Threshold = 16;
                    479:        ConfigureParams.Screen.nForceBpp = 0;
                    480:        ConfigureParams.Screen.bAspectCorrect = true;
                    481:        ConfigureParams.Screen.nMonitorType = MONITOR_TYPE_RGB;
                    482:        ConfigureParams.Screen.bUseExtVdiResolutions = false;
                    483:        ConfigureParams.Screen.bShowStatusbar = true;
                    484:        ConfigureParams.Screen.bShowDriveLed = true;
1.1.1.2 ! root      485:        ConfigureParams.Screen.bCrop = false;
1.1       root      486:        /* target 800x600 screen with statusbar out of screen */
1.1.1.2 ! root      487:        ConfigureParams.Screen.nMaxWidth = 0;
        !           488:        ConfigureParams.Screen.nMaxHeight = 0;
1.1       root      489: 
                    490:        /* Set defaults for Sound */
1.1.1.2 ! root      491:     ConfigureParams.Sound.bEnableMicrophone = true;
1.1       root      492:        ConfigureParams.Sound.bEnableSound = true;
                    493:        ConfigureParams.Sound.nPlaybackFreq = 44100;
                    494:        sprintf(ConfigureParams.Sound.szYMCaptureFileName, "%s%chatari.wav",
                    495:                psWorkingDir, PATHSEP);
                    496:        ConfigureParams.Sound.SdlAudioBufferSize = 0;
1.1.1.2 ! root      497: //  ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING;
1.1       root      498: 
                    499:        /* Set defaults for Rom */
                    500:        sprintf(ConfigureParams.Rom.szTosImageFileName, "%s%ctos.img",
                    501:                Paths_GetDataDir(), PATHSEP);
                    502:        strcpy(ConfigureParams.Rom.szCartridgeImageFileName, "");
                    503: 
                    504:        /* Set defaults for System */
                    505:        ConfigureParams.System.nCpuLevel = 4;
1.1.1.2 ! root      506:        ConfigureParams.System.nCpuFreq = 32;
1.1       root      507:        ConfigureParams.System.bCompatibleCpu = true;
                    508:        ConfigureParams.System.nMachineType = MACHINE_ST;
                    509:        ConfigureParams.System.bBlitter = false;
                    510:        ConfigureParams.System.nDSPType = DSP_TYPE_NONE;
                    511:        ConfigureParams.System.bPatchTimerD = true;
                    512:        ConfigureParams.System.bRealTimeClock = true;
                    513:        ConfigureParams.System.bFastForward = false;
1.1.1.2 ! root      514:     
        !           515: #if ENABLE_WINUAE_CPU
        !           516:     ConfigureParams.System.bAddressSpace24 = false;
        !           517:     ConfigureParams.System.bCycleExactCpu = false;
        !           518:     ConfigureParams.System.n_FPUType = FPU_CPU;
        !           519:     ConfigureParams.System.bCompatibleFPU = true;
        !           520:     ConfigureParams.System.bMMU = true;
        !           521: #endif
        !           522: 
        !           523:     /* Set defaults for Video */
        !           524: #if HAVE_LIBPNG
        !           525:     ConfigureParams.Video.AviRecordVcodec = AVI_RECORD_VIDEO_CODEC_PNG;
        !           526: #else
        !           527:     ConfigureParams.Video.AviRecordVcodec = AVI_RECORD_VIDEO_CODEC_BMP;
        !           528: #endif
        !           529:     ConfigureParams.Video.AviRecordFps = 0;                    /* automatic FPS */
        !           530:     sprintf(ConfigureParams.Video.AviRecordFile, "%s%chatari.avi", psWorkingDir, PATHSEP);
        !           531: 
1.1       root      532: 
                    533:        /* Initialize the configuration file name */
                    534:        if (strlen(psHomeDir) < sizeof(sConfigFileName)-13)
1.1.1.2 ! root      535:                sprintf(sConfigFileName, "%s%cprevious.cfg", psHomeDir, PATHSEP);
1.1       root      536:        else
1.1.1.2 ! root      537:                strcpy(sConfigFileName, "previous.cfg");
1.1       root      538: 
                    539: #if defined(__AMIGAOS4__)
                    540:        /* Fix default path names on Amiga OS */
                    541:        sprintf(ConfigureParams.Rom.szTosImageFileName, "%stos.img", Paths_GetDataDir());
                    542: #endif
                    543: }
                    544: 
                    545: 
                    546: /*-----------------------------------------------------------------------*/
                    547: /**
                    548:  * Copy details from configuration structure into global variables for system,
                    549:  * clean file names, etc...  Called from main.c and dialog.c files.
                    550:  */
                    551: void Configuration_Apply(bool bReset)
                    552: {
                    553:        if (bReset)
                    554:        {
                    555:                /* Set resolution change */
                    556:        }
1.1.1.2 ! root      557: //     if (ConfigureParams.Screen.nFrameSkips < AUTO_FRAMESKIP_LIMIT)
        !           558: //     {
        !           559: //        nFrameSkips = ConfigureParams.Screen.nFrameSkips;
        !           560: //     }
        !           561: 
        !           562:     /* Init clocks for this machine */
        !           563:     ClocksTimings_InitMachine ( ConfigureParams.System.nMachineType );
        !           564:     
        !           565:     
1.1       root      566:        /* Sound settings */
                    567:        /* SDL sound buffer in ms */
                    568: //     SdlAudioBufferSize = ConfigureParams.Sound.SdlAudioBufferSize;
                    569: //     if ( SdlAudioBufferSize == 0 )                  /* use default setting for SDL */
                    570: //             ;
                    571: //     else if ( SdlAudioBufferSize < 10 )             /* min of 10 ms */
                    572: //             SdlAudioBufferSize = 10;
                    573: //     else if ( SdlAudioBufferSize > 100 )            /* max of 100 ms */
                    574: //             SdlAudioBufferSize = 100;
                    575: 
                    576:        /* Set playback frequency */
                    577: //     Audio_SetOutputAudioFreq(ConfigureParams.Sound.nPlaybackFreq);
                    578: 
1.1.1.2 ! root      579:        /* YM Mixing */
        !           580: //    if ( ( ConfigureParams.Sound.YmVolumeMixing != YM_LINEAR_MIXING )
        !           581: //            && ( ConfigureParams.Sound.YmVolumeMixing != YM_TABLE_MIXING ) )
        !           582: //        ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING;
        !           583: 
        !           584: //    YmVolumeMixing = ConfigureParams.Sound.YmVolumeMixing;
        !           585: //    Sound_SetYmVolumeMixing();
        !           586:     
        !           587:     /* Check/constrain CPU settings and change corresponding
        !           588:     * UAE cpu_level & cpu_compatible variables
        !           589:     */
        !           590:     M68000_CheckCpuSettings();
        !           591:     
1.1       root      592:        /* Clean file and directory names */
                    593:        File_MakeAbsoluteName(ConfigureParams.Rom.szTosImageFileName);
                    594:        if (strlen(ConfigureParams.Rom.szCartridgeImageFileName) > 0)
                    595:                File_MakeAbsoluteName(ConfigureParams.Rom.szCartridgeImageFileName);
                    596:        File_MakeAbsoluteName(ConfigureParams.HardDisk.szHardDiskImage);
                    597:        File_CleanFileName(ConfigureParams.HardDisk.szHardDiskDirectories[0]);
                    598:        File_MakeAbsoluteName(ConfigureParams.HardDisk.szHardDiskDirectories[0]);
                    599:        File_MakeAbsoluteName(ConfigureParams.Memory.szMemoryCaptureFileName);
                    600:        File_MakeAbsoluteName(ConfigureParams.Sound.szYMCaptureFileName);
                    601:        if (strlen(ConfigureParams.Keyboard.szMappingFileName) > 0)
                    602:                File_MakeAbsoluteName(ConfigureParams.Keyboard.szMappingFileName);
1.1.1.2 ! root      603:     File_MakeAbsoluteName(ConfigureParams.Video.AviRecordFile);
1.1       root      604:        
                    605:        /* make path names absolute, but handle special file names */
                    606:        File_MakeAbsoluteSpecialName(ConfigureParams.Log.sLogFileName);
                    607:        File_MakeAbsoluteSpecialName(ConfigureParams.Log.sTraceFileName);
                    608:        File_MakeAbsoluteSpecialName(ConfigureParams.RS232.szInFileName);
                    609:        File_MakeAbsoluteSpecialName(ConfigureParams.RS232.szOutFileName);
                    610:        File_MakeAbsoluteSpecialName(ConfigureParams.Midi.sMidiInFileName);
                    611:        File_MakeAbsoluteSpecialName(ConfigureParams.Midi.sMidiOutFileName);
                    612:        File_MakeAbsoluteSpecialName(ConfigureParams.Printer.szPrintToFileName);
                    613: }
                    614: 
                    615: 
                    616: /*-----------------------------------------------------------------------*/
                    617: /**
                    618:  * Load a settings section from the configuration file.
                    619:  */
                    620: static int Configuration_LoadSection(const char *pFilename, const struct Config_Tag configs[], const char *pSection)
                    621: {
                    622:        int ret;
                    623: 
                    624:        ret = input_config(pFilename, configs, pSection);
                    625: 
                    626:        if (ret < 0)
                    627:                fprintf(stderr, "Can not load configuration file %s (section %s).\n",
                    628:                        pFilename, pSection);
                    629: 
                    630:        return ret;
                    631: }
                    632: 
                    633: 
                    634: /*-----------------------------------------------------------------------*/
                    635: /**
                    636:  * Load program setting from configuration file. If psFileName is NULL, use
                    637:  * the configuration file given in configuration / last selected by user.
                    638:  */
                    639: void Configuration_Load(const char *psFileName)
                    640: {
                    641:        if (psFileName == NULL)
                    642:                psFileName = sConfigFileName;
                    643: 
                    644:        if (!File_Exists(psFileName))
                    645:        {
1.1.1.2 ! root      646:                Log_Printf(LOG_DEBUG, "Configuration file %s not found.\n", psFileName);
1.1       root      647:                return;
                    648:        }
                    649: 
                    650:        Configuration_LoadSection(psFileName, configs_Log, "[Log]");
                    651:        Configuration_LoadSection(psFileName, configs_Debugger, "[Debugger]");
                    652:        Configuration_LoadSection(psFileName, configs_Screen, "[Screen]");
                    653:        Configuration_LoadSection(psFileName, configs_Joystick0, "[Joystick0]");
                    654:        Configuration_LoadSection(psFileName, configs_Joystick1, "[Joystick1]");
                    655:        Configuration_LoadSection(psFileName, configs_Joystick2, "[Joystick2]");
                    656:        Configuration_LoadSection(psFileName, configs_Joystick3, "[Joystick3]");
                    657:        Configuration_LoadSection(psFileName, configs_Joystick4, "[Joystick4]");
                    658:        Configuration_LoadSection(psFileName, configs_Joystick5, "[Joystick5]");
                    659:        Configuration_LoadSection(psFileName, configs_Keyboard, "[Keyboard]");
                    660:        Configuration_LoadSection(psFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]");
                    661:        Configuration_LoadSection(psFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]");
                    662:        Configuration_LoadSection(psFileName, configs_Sound, "[Sound]");
                    663:        Configuration_LoadSection(psFileName, configs_Memory, "[Memory]");
                    664:        Configuration_LoadSection(psFileName, configs_Floppy, "[Floppy]");
                    665:        Configuration_LoadSection(psFileName, configs_HardDisk, "[HardDisk]");
                    666:        Configuration_LoadSection(psFileName, configs_Rom, "[ROM]");
                    667:        Configuration_LoadSection(psFileName, configs_Rs232, "[RS232]");
                    668:        Configuration_LoadSection(psFileName, configs_Printer, "[Printer]");
                    669:        Configuration_LoadSection(psFileName, configs_Midi, "[Midi]");
                    670:        Configuration_LoadSection(psFileName, configs_System, "[System]");
1.1.1.2 ! root      671:     Configuration_LoadSection(psFileName, configs_Video, "[Video]");
1.1       root      672: }
                    673: 
                    674: 
                    675: /*-----------------------------------------------------------------------*/
                    676: /**
                    677:  * Save a settings section to configuration file
                    678:  */
                    679: static int Configuration_SaveSection(const char *pFilename, const struct Config_Tag configs[], const char *pSection)
                    680: {
                    681:        int ret;
                    682: 
                    683:        ret = update_config(pFilename, configs, pSection);
                    684: 
                    685:        if (ret < 0)
                    686:                fprintf(stderr, "Error while updating section %s in %s\n", pSection, pFilename);
                    687: 
                    688:        return ret;
                    689: }
                    690: 
                    691: 
                    692: /*-----------------------------------------------------------------------*/
                    693: /**
                    694:  * Save program setting to configuration file
                    695:  */
                    696: void Configuration_Save(void)
                    697: {
                    698:        if (Configuration_SaveSection(sConfigFileName, configs_Log, "[Log]") < 0)
                    699:        {
                    700:                Log_AlertDlg(LOG_ERROR, "Error saving config file.");
                    701:                return;
                    702:        }
                    703:        Configuration_SaveSection(sConfigFileName, configs_Debugger, "[Debugger]");
                    704:        Configuration_SaveSection(sConfigFileName, configs_Screen, "[Screen]");
                    705:        Configuration_SaveSection(sConfigFileName, configs_Joystick0, "[Joystick0]");
                    706:        Configuration_SaveSection(sConfigFileName, configs_Joystick1, "[Joystick1]");
                    707:        Configuration_SaveSection(sConfigFileName, configs_Joystick2, "[Joystick2]");
                    708:        Configuration_SaveSection(sConfigFileName, configs_Joystick3, "[Joystick3]");
                    709:        Configuration_SaveSection(sConfigFileName, configs_Joystick4, "[Joystick4]");
                    710:        Configuration_SaveSection(sConfigFileName, configs_Joystick5, "[Joystick5]");
                    711:        Configuration_SaveSection(sConfigFileName, configs_Keyboard, "[Keyboard]");
                    712:        Configuration_SaveSection(sConfigFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]");
                    713:        Configuration_SaveSection(sConfigFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]");
                    714:        Configuration_SaveSection(sConfigFileName, configs_Sound, "[Sound]");
                    715:        Configuration_SaveSection(sConfigFileName, configs_Memory, "[Memory]");
                    716:        Configuration_SaveSection(sConfigFileName, configs_Floppy, "[Floppy]");
                    717:        Configuration_SaveSection(sConfigFileName, configs_HardDisk, "[HardDisk]");
                    718:        Configuration_SaveSection(sConfigFileName, configs_Rom, "[ROM]");
                    719:        Configuration_SaveSection(sConfigFileName, configs_Rs232, "[RS232]");
                    720:        Configuration_SaveSection(sConfigFileName, configs_Printer, "[Printer]");
                    721:        Configuration_SaveSection(sConfigFileName, configs_Midi, "[Midi]");
                    722:        Configuration_SaveSection(sConfigFileName, configs_System, "[System]");
1.1.1.2 ! root      723:     Configuration_SaveSection(sConfigFileName, configs_Video, "[Video]");
1.1       root      724: }
                    725: 
                    726: 
                    727: /*-----------------------------------------------------------------------*/
                    728: /**
                    729:  * Save/restore snapshot of configuration variables
                    730:  * ('MemorySnapShot_Store' handles type)
                    731:  */
                    732: void Configuration_MemorySnapShot_Capture(bool bSave)
                    733: {
                    734:        MemorySnapShot_Store(ConfigureParams.Rom.szTosImageFileName, sizeof(ConfigureParams.Rom.szTosImageFileName));
                    735:        MemorySnapShot_Store(ConfigureParams.Rom.szCartridgeImageFileName, sizeof(ConfigureParams.Rom.szCartridgeImageFileName));
                    736: 
                    737:        MemorySnapShot_Store(&ConfigureParams.Memory.nMemorySize, sizeof(ConfigureParams.Memory.nMemorySize));
                    738: 
                    739:        MemorySnapShot_Store(&ConfigureParams.HardDisk.bUseHardDiskDirectories, sizeof(ConfigureParams.HardDisk.bUseHardDiskDirectories));
                    740:        MemorySnapShot_Store(ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C], sizeof(ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C]));
                    741:        MemorySnapShot_Store(&ConfigureParams.HardDisk.bUseHardDiskImage, sizeof(ConfigureParams.HardDisk.bUseHardDiskImage));
                    742:        MemorySnapShot_Store(ConfigureParams.HardDisk.szHardDiskImage, sizeof(ConfigureParams.HardDisk.szHardDiskImage));
                    743: 
                    744:        MemorySnapShot_Store(&ConfigureParams.Screen.nMonitorType, sizeof(ConfigureParams.Screen.nMonitorType));
                    745:        MemorySnapShot_Store(&ConfigureParams.Screen.bUseExtVdiResolutions, sizeof(ConfigureParams.Screen.bUseExtVdiResolutions));
                    746:        MemorySnapShot_Store(&ConfigureParams.Screen.nVdiWidth, sizeof(ConfigureParams.Screen.nVdiWidth));
                    747:        MemorySnapShot_Store(&ConfigureParams.Screen.nVdiHeight, sizeof(ConfigureParams.Screen.nVdiHeight));
                    748:        MemorySnapShot_Store(&ConfigureParams.Screen.nVdiColors, sizeof(ConfigureParams.Screen.nVdiColors));
                    749: 
                    750:        MemorySnapShot_Store(&ConfigureParams.System.nCpuLevel, sizeof(ConfigureParams.System.nCpuLevel));
                    751:        MemorySnapShot_Store(&ConfigureParams.System.nCpuFreq, sizeof(ConfigureParams.System.nCpuFreq));
                    752:        MemorySnapShot_Store(&ConfigureParams.System.bCompatibleCpu, sizeof(ConfigureParams.System.bCompatibleCpu));
                    753:        MemorySnapShot_Store(&ConfigureParams.System.nMachineType, sizeof(ConfigureParams.System.nMachineType));
                    754:        MemorySnapShot_Store(&ConfigureParams.System.bBlitter, sizeof(ConfigureParams.System.bBlitter));
                    755:        MemorySnapShot_Store(&ConfigureParams.System.nDSPType, sizeof(ConfigureParams.System.nDSPType));
                    756:        MemorySnapShot_Store(&ConfigureParams.System.bRealTimeClock, sizeof(ConfigureParams.System.bRealTimeClock));
                    757:        MemorySnapShot_Store(&ConfigureParams.System.bPatchTimerD, sizeof(ConfigureParams.System.bPatchTimerD));
1.1.1.2 ! root      758:     
        !           759: #if ENABLE_WINUAE_CPU
        !           760:     MemorySnapShot_Store(&ConfigureParams.System.bAddressSpace24, sizeof(ConfigureParams.System.bAddressSpace24));
        !           761:     MemorySnapShot_Store(&ConfigureParams.System.bCycleExactCpu, sizeof(ConfigureParams.System.bCycleExactCpu));
        !           762:     MemorySnapShot_Store(&ConfigureParams.System.n_FPUType, sizeof(ConfigureParams.System.n_FPUType));
        !           763:     MemorySnapShot_Store(&ConfigureParams.System.bCompatibleFPU, sizeof(ConfigureParams.System.bCompatibleFPU));
        !           764:     MemorySnapShot_Store(&ConfigureParams.System.bMMU, sizeof(ConfigureParams.System.bMMU));
        !           765: #endif
        !           766:     
1.1       root      767:        MemorySnapShot_Store(&ConfigureParams.DiskImage.bSlowFloppy, sizeof(ConfigureParams.DiskImage.bSlowFloppy));
                    768: 
                    769:        if (!bSave)
                    770:                Configuration_Apply(true);
                    771: }
                    772: 

unix.superglobalmegacorp.com

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