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

1.1       root        1: /*
1.1.1.6   root        2:   Hatari - configuration.c
                      3: 
1.1.1.20  root        4:   This file is distributed under the GNU General Public License, version 2
                      5:   or at 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.14  root       12: const char Configuration_fileid[] = "Hatari configuration.c : " __DATE__ " " __TIME__;
1.1.1.10  root       13: 
1.1.1.21  root       14: #include <SDL_keyboard.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.17  root       20: #include "sound.h"
1.1.1.5   root       21: #include "file.h"
1.1.1.9   root       22: #include "log.h"
                     23: #include "m68000.h"
1.1.1.12  root       24: #include "memorySnapShot.h"
                     25: #include "paths.h"
1.1.1.9   root       26: #include "screen.h"
1.1.1.22! root       27: #include "statusbar.h"
1.1.1.9   root       28: #include "vdi.h"
                     29: #include "video.h"
1.1.1.17  root       30: #include "avi_record.h"
                     31: #include "clocks_timings.h"
1.1.1.20  root       32: #include "68kDisass.h"
1.1.1.21  root       33: #include "fdc.h"
1.1.1.22! root       34: #include "dsp.h"
        !            35: #include "joy.h"
1.1.1.6   root       36: 
                     37: 
                     38: CNF_PARAMS ConfigureParams;                 /* List of configuration for the emulator */
1.1.1.7   root       39: char sConfigFileName[FILENAME_MAX];         /* Stores the name of the configuration file */
1.1.1.6   root       40: 
                     41: 
1.1.1.9   root       42: /* Used to load/save logging options */
                     43: static const struct Config_Tag configs_Log[] =
                     44: {
                     45:        { "sLogFileName", String_Tag, ConfigureParams.Log.sLogFileName },
1.1.1.13  root       46:        { "sTraceFileName", String_Tag, ConfigureParams.Log.sTraceFileName },
1.1.1.21  root       47:        { "nExceptionDebugMask", Int_Tag, &ConfigureParams.Log.nExceptionDebugMask },
1.1.1.9   root       48:        { "nTextLogLevel", Int_Tag, &ConfigureParams.Log.nTextLogLevel },
                     49:        { "nAlertDlgLogLevel", Int_Tag, &ConfigureParams.Log.nAlertDlgLogLevel },
1.1.1.12  root       50:        { "bConfirmQuit", Bool_Tag, &ConfigureParams.Log.bConfirmQuit },
1.1.1.20  root       51:        { "bNatFeats", Bool_Tag, &ConfigureParams.Log.bNatFeats },
                     52:        { "bConsoleWindow", Bool_Tag, &ConfigureParams.Log.bConsoleWindow },
1.1.1.9   root       53:        { NULL , Error_Tag, NULL }
                     54: };
                     55: 
1.1.1.16  root       56: /* Used to load/save debugger options */
                     57: static const struct Config_Tag configs_Debugger[] =
                     58: {
                     59:        { "nNumberBase", Int_Tag, &ConfigureParams.Debugger.nNumberBase },
                     60:        { "nDisasmLines", Int_Tag, &ConfigureParams.Debugger.nDisasmLines },
                     61:        { "nMemdumpLines", Int_Tag, &ConfigureParams.Debugger.nMemdumpLines },
1.1.1.20  root       62:        { "nDisasmOptions", Int_Tag, &ConfigureParams.Debugger.nDisasmOptions },
                     63:        { "bDisasmUAE", Bool_Tag, &ConfigureParams.Debugger.bDisasmUAE },
1.1.1.16  root       64:        { NULL , Error_Tag, NULL }
                     65: };
1.1.1.9   root       66: 
1.1.1.6   root       67: /* Used to load/save screen options */
1.1.1.9   root       68: static const struct Config_Tag configs_Screen[] =
1.1.1.6   root       69: {
1.1.1.13  root       70:        { "nMonitorType", Int_Tag, &ConfigureParams.Screen.nMonitorType },
                     71:        { "nFrameSkips", Int_Tag, &ConfigureParams.Screen.nFrameSkips },
1.1.1.9   root       72:        { "bFullScreen", Bool_Tag, &ConfigureParams.Screen.bFullScreen },
1.1.1.17  root       73:        { "bKeepResolution", Bool_Tag, &ConfigureParams.Screen.bKeepResolution },
1.1.1.18  root       74:        { "bKeepResolutionST", Bool_Tag, &ConfigureParams.Screen.bKeepResolutionST },
1.1.1.9   root       75:        { "bAllowOverscan", Bool_Tag, &ConfigureParams.Screen.bAllowOverscan },
1.1.1.12  root       76:        { "nSpec512Threshold", Int_Tag, &ConfigureParams.Screen.nSpec512Threshold },
                     77:        { "nForceBpp", Int_Tag, &ConfigureParams.Screen.nForceBpp },
1.1.1.16  root       78:        { "bAspectCorrect", Bool_Tag, &ConfigureParams.Screen.bAspectCorrect },
1.1.1.9   root       79:        { "bUseExtVdiResolutions", Bool_Tag, &ConfigureParams.Screen.bUseExtVdiResolutions },
1.1.1.12  root       80:        { "nVdiWidth", Int_Tag, &ConfigureParams.Screen.nVdiWidth },
                     81:        { "nVdiHeight", Int_Tag, &ConfigureParams.Screen.nVdiHeight },
1.1.1.9   root       82:        { "nVdiColors", Int_Tag, &ConfigureParams.Screen.nVdiColors },
1.1.1.22! root       83:        { "bMouseWarp", Bool_Tag, &ConfigureParams.Screen.bMouseWarp },
1.1.1.13  root       84:        { "bShowStatusbar", Bool_Tag, &ConfigureParams.Screen.bShowStatusbar },
                     85:        { "bShowDriveLed", Bool_Tag, &ConfigureParams.Screen.bShowDriveLed },
1.1.1.17  root       86:        { "bCrop", Bool_Tag, &ConfigureParams.Screen.bCrop },
1.1.1.18  root       87:        { "bForceMax", Bool_Tag, &ConfigureParams.Screen.bForceMax },
1.1.1.16  root       88:        { "nMaxWidth", Int_Tag, &ConfigureParams.Screen.nMaxWidth },
                     89:        { "nMaxHeight", Int_Tag, &ConfigureParams.Screen.nMaxHeight },
1.1.1.22! root       90: #if WITH_SDL2
        !            91:        { "nRenderScaleQuality", Int_Tag, &ConfigureParams.Screen.nRenderScaleQuality },
        !            92:        { "bUseVsync", Int_Tag, &ConfigureParams.Screen.bUseVsync },
        !            93: #endif
1.1.1.9   root       94:        { NULL , Error_Tag, NULL }
1.1.1.6   root       95: };
                     96: 
1.1.1.10  root       97: /* Used to load/save joystick 0 options */
1.1.1.9   root       98: static const struct Config_Tag configs_Joystick0[] =
1.1.1.6   root       99: {
1.1.1.10  root      100:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nJoystickMode },
1.1.1.9   root      101:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[0].bEnableAutoFire },
1.1.1.15  root      102:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[0].bEnableJumpOnFire2 },
1.1.1.10  root      103:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nJoyId },
                    104:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeUp },
                    105:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeDown },
                    106:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeLeft },
                    107:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeRight },
                    108:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeFire },
1.1.1.9   root      109:        { NULL , Error_Tag, NULL }
1.1.1.6   root      110: };
1.1.1.10  root      111: 
                    112: /* Used to load/save joystick 1 options */
1.1.1.9   root      113: static const struct Config_Tag configs_Joystick1[] =
1.1.1.6   root      114: {
1.1.1.10  root      115:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nJoystickMode },
1.1.1.9   root      116:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[1].bEnableAutoFire },
1.1.1.15  root      117:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[1].bEnableJumpOnFire2 },
1.1.1.10  root      118:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nJoyId },
                    119:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeUp },
                    120:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeDown },
                    121:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeLeft },
                    122:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeRight },
                    123:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeFire },
                    124:        { NULL , Error_Tag, NULL }
                    125: };
                    126: 
                    127: /* Used to load/save joystick 2 options */
                    128: static const struct Config_Tag configs_Joystick2[] =
                    129: {
                    130:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nJoystickMode },
                    131:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[2].bEnableAutoFire },
1.1.1.15  root      132:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[2].bEnableJumpOnFire2 },
1.1.1.10  root      133:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nJoyId },
                    134:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeUp },
                    135:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeDown },
                    136:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeLeft },
                    137:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeRight },
                    138:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeFire },
                    139:        { NULL , Error_Tag, NULL }
                    140: };
                    141: 
                    142: /* Used to load/save joystick 3 options */
                    143: static const struct Config_Tag configs_Joystick3[] =
                    144: {
                    145:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nJoystickMode },
                    146:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[3].bEnableAutoFire },
1.1.1.15  root      147:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[3].bEnableJumpOnFire2 },
1.1.1.10  root      148:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nJoyId },
                    149:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeUp },
                    150:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeDown },
                    151:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeLeft },
                    152:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeRight },
                    153:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeFire },
                    154:        { NULL , Error_Tag, NULL }
                    155: };
                    156: 
                    157: /* Used to load/save joystick 4 options */
                    158: static const struct Config_Tag configs_Joystick4[] =
                    159: {
                    160:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nJoystickMode },
                    161:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[4].bEnableAutoFire },
1.1.1.15  root      162:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[4].bEnableJumpOnFire2 },
1.1.1.10  root      163:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nJoyId },
                    164:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeUp },
                    165:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeDown },
                    166:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeLeft },
                    167:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeRight },
                    168:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeFire },
                    169:        { NULL , Error_Tag, NULL }
                    170: };
                    171: 
                    172: /* Used to load/save joystick 5 options */
                    173: static const struct Config_Tag configs_Joystick5[] =
                    174: {
                    175:        { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nJoystickMode },
                    176:        { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[5].bEnableAutoFire },
1.1.1.15  root      177:        { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[5].bEnableJumpOnFire2 },
1.1.1.10  root      178:        { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nJoyId },
                    179:        { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeUp },
                    180:        { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeDown },
                    181:        { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeLeft },
                    182:        { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeRight },
                    183:        { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeFire },
1.1.1.9   root      184:        { NULL , Error_Tag, NULL }
1.1.1.6   root      185: };
1.1.1.5   root      186: 
1.1.1.6   root      187: /* Used to load/save keyboard options */
1.1.1.9   root      188: static const struct Config_Tag configs_Keyboard[] =
1.1.1.6   root      189: {
1.1.1.9   root      190:        { "bDisableKeyRepeat", Bool_Tag, &ConfigureParams.Keyboard.bDisableKeyRepeat },
                    191:        { "nKeymapType", Int_Tag, &ConfigureParams.Keyboard.nKeymapType },
                    192:        { "szMappingFileName", String_Tag, ConfigureParams.Keyboard.szMappingFileName },
                    193:        { NULL , Error_Tag, NULL }
1.1.1.6   root      194: };
1.1       root      195: 
1.1.1.11  root      196: /* Used to load/save shortcut key bindings with modifiers options */
                    197: static const struct Config_Tag configs_ShortCutWithMod[] =
                    198: {
                    199:        { "keyOptions",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_OPTIONS] },
                    200:        { "keyFullScreen", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_FULLSCREEN] },
1.1.1.16  root      201:        { "keyMouseMode",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_MOUSEGRAB] },
1.1.1.11  root      202:        { "keyColdReset",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_COLDRESET] },
                    203:        { "keyWarmReset",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_WARMRESET] },
                    204:        { "keyScreenShot", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SCREENSHOT] },
                    205:        { "keyBossKey",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_BOSSKEY] },
                    206:        { "keyCursorEmu",  Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_CURSOREMU] },
1.1.1.13  root      207:        { "keyFastForward",Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_FASTFORWARD] },
1.1.1.11  root      208:        { "keyRecAnim",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_RECANIM] },
                    209:        { "keyRecSound",   Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_RECSOUND] },
                    210:        { "keySound",      Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SOUND] },
1.1.1.15  root      211:        { "keyPause",      Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_PAUSE] },
                    212:        { "keyDebugger",   Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_DEBUG] },
1.1.1.11  root      213:        { "keyQuit",       Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_QUIT] },
1.1.1.12  root      214:        { "keyLoadMem",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_LOADMEM] },
                    215:        { "keySaveMem",    Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SAVEMEM] },
1.1.1.13  root      216:        { "keyInsertDiskA",Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_INSERTDISKA] },
1.1.1.22! root      217:        { "keySwitchJoy0", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_JOY_0] },
        !           218:        { "keySwitchJoy1", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_JOY_1] },
        !           219:        { "keySwitchPadA", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_PAD_A] },
        !           220:        { "keySwitchPadB", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_PAD_B] },
1.1.1.11  root      221:        { NULL , Error_Tag, NULL }
                    222: };
                    223: 
                    224: /* Used to load/save shortcut key bindings without modifiers options */
                    225: static const struct Config_Tag configs_ShortCutWithoutMod[] =
                    226: {
                    227:        { "keyOptions",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_OPTIONS] },
                    228:        { "keyFullScreen", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_FULLSCREEN] },
1.1.1.16  root      229:        { "keyMouseMode",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_MOUSEGRAB] },
1.1.1.11  root      230:        { "keyColdReset",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_COLDRESET] },
                    231:        { "keyWarmReset",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_WARMRESET] },
                    232:        { "keyScreenShot", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SCREENSHOT] },
                    233:        { "keyBossKey",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_BOSSKEY] },
                    234:        { "keyCursorEmu",  Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_CURSOREMU] },
1.1.1.13  root      235:        { "keyFastForward",Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_FASTFORWARD] },
1.1.1.11  root      236:        { "keyRecAnim",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_RECANIM] },
                    237:        { "keyRecSound",   Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_RECSOUND] },
                    238:        { "keySound",      Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SOUND] },
1.1.1.15  root      239:        { "keyPause",      Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_PAUSE] },
                    240:        { "keyDebugger",   Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_DEBUG] },
1.1.1.11  root      241:        { "keyQuit",       Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_QUIT] },
1.1.1.12  root      242:        { "keyLoadMem",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_LOADMEM] },
                    243:        { "keySaveMem",    Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SAVEMEM] },
1.1.1.13  root      244:        { "keyInsertDiskA",Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_INSERTDISKA] },
1.1.1.22! root      245:        { "keySwitchJoy0", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_JOY_0] },
        !           246:        { "keySwitchJoy1", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_JOY_1] },
        !           247:        { "keySwitchPadA", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_PAD_A] },
        !           248:        { "keySwitchPadB", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_PAD_B] },
1.1.1.11  root      249:        { NULL , Error_Tag, NULL }
                    250: };
                    251: 
                    252: 
1.1.1.6   root      253: /* Used to load/save sound options */
1.1.1.9   root      254: static const struct Config_Tag configs_Sound[] =
1.1.1.6   root      255: {
1.1.1.17  root      256:        { "bEnableMicrophone", Bool_Tag, &ConfigureParams.Sound.bEnableMicrophone },
1.1.1.9   root      257:        { "bEnableSound", Bool_Tag, &ConfigureParams.Sound.bEnableSound },
1.1.1.19  root      258:        { "bEnableSoundSync", Bool_Tag, &ConfigureParams.Sound.bEnableSoundSync },
1.1.1.15  root      259:        { "nPlaybackFreq", Int_Tag, &ConfigureParams.Sound.nPlaybackFreq },
1.1.1.16  root      260:        { "nSdlAudioBufferSize", Int_Tag, &ConfigureParams.Sound.SdlAudioBufferSize },
1.1.1.17  root      261:        { "szYMCaptureFileName", String_Tag, ConfigureParams.Sound.szYMCaptureFileName },
                    262:        { "YmVolumeMixing", Int_Tag, &ConfigureParams.Sound.YmVolumeMixing },
1.1.1.9   root      263:        { NULL , Error_Tag, NULL }
1.1.1.6   root      264: };
                    265: 
                    266: /* Used to load/save memory options */
1.1.1.9   root      267: static const struct Config_Tag configs_Memory[] =
1.1.1.6   root      268: {
1.1.1.9   root      269:        { "nMemorySize", Int_Tag, &ConfigureParams.Memory.nMemorySize },
1.1.1.22! root      270:        { "nTTRamSize", Int_Tag, &ConfigureParams.Memory.nTTRamSize },
1.1.1.12  root      271:        { "bAutoSave", Bool_Tag, &ConfigureParams.Memory.bAutoSave },
1.1.1.9   root      272:        { "szMemoryCaptureFileName", String_Tag, ConfigureParams.Memory.szMemoryCaptureFileName },
1.1.1.12  root      273:        { "szAutoSaveFileName", String_Tag, ConfigureParams.Memory.szAutoSaveFileName },
1.1.1.9   root      274:        { NULL , Error_Tag, NULL }
1.1.1.6   root      275: };
                    276: 
                    277: 
                    278: /* Used to load/save floppy options */
1.1.1.9   root      279: static const struct Config_Tag configs_Floppy[] =
1.1.1.6   root      280: {
1.1.1.10  root      281:        { "bAutoInsertDiskB", Bool_Tag, &ConfigureParams.DiskImage.bAutoInsertDiskB },
1.1.1.18  root      282:        { "FastFloppy", Bool_Tag, &ConfigureParams.DiskImage.FastFloppy },
1.1.1.21  root      283:        { "EnableDriveA", Bool_Tag, &ConfigureParams.DiskImage.EnableDriveA },
                    284:        { "DriveA_NumberOfHeads", Int_Tag, &ConfigureParams.DiskImage.DriveA_NumberOfHeads },
                    285:        { "EnableDriveB", Bool_Tag, &ConfigureParams.DiskImage.EnableDriveB },
                    286:        { "DriveB_NumberOfHeads", Int_Tag, &ConfigureParams.DiskImage.DriveB_NumberOfHeads },
1.1.1.10  root      287:        { "nWriteProtection", Int_Tag, &ConfigureParams.DiskImage.nWriteProtection },
1.1.1.13  root      288:        { "szDiskAZipPath", String_Tag, ConfigureParams.DiskImage.szDiskZipPath[0] },
                    289:        { "szDiskAFileName", String_Tag, ConfigureParams.DiskImage.szDiskFileName[0] },
                    290:        { "szDiskBZipPath", String_Tag, ConfigureParams.DiskImage.szDiskZipPath[1] },
                    291:        { "szDiskBFileName", String_Tag, ConfigureParams.DiskImage.szDiskFileName[1] },
1.1.1.10  root      292:        { "szDiskImageDirectory", String_Tag, ConfigureParams.DiskImage.szDiskImageDirectory },
                    293:        { NULL , Error_Tag, NULL }
                    294: };
                    295: 
1.1.1.6   root      296: /* Used to load/save HD options */
1.1.1.10  root      297: static const struct Config_Tag configs_HardDisk[] =
1.1.1.6   root      298: {
1.1.1.22! root      299:        { "nGemdosDrive", Int_Tag, &ConfigureParams.HardDisk.nGemdosDrive },
1.1.1.10  root      300:        { "bBootFromHardDisk", Bool_Tag, &ConfigureParams.HardDisk.bBootFromHardDisk },
                    301:        { "bUseHardDiskDirectory", Bool_Tag, &ConfigureParams.HardDisk.bUseHardDiskDirectories },
                    302:        { "szHardDiskDirectory", String_Tag, ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C] },
1.1.1.20  root      303:        { "nGemdosCase", Int_Tag, &ConfigureParams.HardDisk.nGemdosCase },
1.1.1.16  root      304:        { "nWriteProtection", Int_Tag, &ConfigureParams.HardDisk.nWriteProtection },
1.1.1.22! root      305:        { "bFilenameConversion", Bool_Tag, &ConfigureParams.HardDisk.bFilenameConversion },
1.1.1.21  root      306:        { "bUseHardDiskImage", Bool_Tag, &ConfigureParams.Acsi[0].bUseDevice },
                    307:        { "szHardDiskImage", String_Tag, ConfigureParams.Acsi[0].sDeviceFile },
1.1.1.16  root      308:        { "bUseIdeMasterHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseIdeMasterHardDiskImage },
                    309:        { "bUseIdeSlaveHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseIdeSlaveHardDiskImage },
                    310:        { "szIdeMasterHardDiskImage", String_Tag, ConfigureParams.HardDisk.szIdeMasterHardDiskImage },
                    311:        { "szIdeSlaveHardDiskImage", String_Tag, ConfigureParams.HardDisk.szIdeSlaveHardDiskImage },
1.1.1.10  root      312:        { NULL , Error_Tag, NULL }
                    313: };
                    314: 
1.1.1.21  root      315: /* Used to load/save ACSI options */
                    316: static const struct Config_Tag configs_Acsi[] =
                    317: {
                    318:        // { "bUseDevice0", Bool_Tag, &ConfigureParams.Acsi[0].bUseDevice },
                    319:        // { "sDeviceFile0", String_Tag, ConfigureParams.Acsi[0].sDeviceFile },
                    320:        { "bUseDevice1", Bool_Tag, &ConfigureParams.Acsi[1].bUseDevice },
                    321:        { "sDeviceFile1", String_Tag, ConfigureParams.Acsi[1].sDeviceFile },
                    322:        { "bUseDevice2", Bool_Tag, &ConfigureParams.Acsi[2].bUseDevice },
                    323:        { "sDeviceFile2", String_Tag, ConfigureParams.Acsi[2].sDeviceFile },
                    324:        { "bUseDevice3", Bool_Tag, &ConfigureParams.Acsi[3].bUseDevice },
                    325:        { "sDeviceFile3", String_Tag, ConfigureParams.Acsi[3].sDeviceFile },
                    326:        { "bUseDevice4", Bool_Tag, &ConfigureParams.Acsi[4].bUseDevice },
                    327:        { "sDeviceFile4", String_Tag, ConfigureParams.Acsi[4].sDeviceFile },
                    328:        { "bUseDevice5", Bool_Tag, &ConfigureParams.Acsi[5].bUseDevice },
                    329:        { "sDeviceFile5", String_Tag, ConfigureParams.Acsi[5].sDeviceFile },
                    330:        { "bUseDevice6", Bool_Tag, &ConfigureParams.Acsi[6].bUseDevice },
                    331:        { "sDeviceFile6", String_Tag, ConfigureParams.Acsi[6].sDeviceFile },
                    332:        { "bUseDevice7", Bool_Tag, &ConfigureParams.Acsi[7].bUseDevice },
                    333:        { "sDeviceFile7", String_Tag, ConfigureParams.Acsi[7].sDeviceFile },
                    334:        { NULL , Error_Tag, NULL }
                    335: };
                    336: 
1.1.1.22! root      337: /* Used to load/save SCSI options */
        !           338: static const struct Config_Tag configs_Scsi[] =
        !           339: {
        !           340:        { "bUseDevice1", Bool_Tag, &ConfigureParams.Scsi[1].bUseDevice },
        !           341:        { "sDeviceFile1", String_Tag, ConfigureParams.Scsi[1].sDeviceFile },
        !           342:        { "bUseDevice2", Bool_Tag, &ConfigureParams.Scsi[2].bUseDevice },
        !           343:        { "sDeviceFile2", String_Tag, ConfigureParams.Scsi[2].sDeviceFile },
        !           344:        { "bUseDevice3", Bool_Tag, &ConfigureParams.Scsi[3].bUseDevice },
        !           345:        { "sDeviceFile3", String_Tag, ConfigureParams.Scsi[3].sDeviceFile },
        !           346:        { "bUseDevice4", Bool_Tag, &ConfigureParams.Scsi[4].bUseDevice },
        !           347:        { "sDeviceFile4", String_Tag, ConfigureParams.Scsi[4].sDeviceFile },
        !           348:        { "bUseDevice5", Bool_Tag, &ConfigureParams.Scsi[5].bUseDevice },
        !           349:        { "sDeviceFile5", String_Tag, ConfigureParams.Scsi[5].sDeviceFile },
        !           350:        { "bUseDevice6", Bool_Tag, &ConfigureParams.Scsi[6].bUseDevice },
        !           351:        { "sDeviceFile6", String_Tag, ConfigureParams.Scsi[6].sDeviceFile },
        !           352:        { "bUseDevice7", Bool_Tag, &ConfigureParams.Scsi[7].bUseDevice },
        !           353:        { "sDeviceFile7", String_Tag, ConfigureParams.Scsi[7].sDeviceFile },
        !           354:        { NULL , Error_Tag, NULL }
        !           355: };
        !           356: 
1.1.1.8   root      357: /* Used to load/save ROM options */
1.1.1.9   root      358: static const struct Config_Tag configs_Rom[] =
1.1.1.6   root      359: {
1.1.1.9   root      360:        { "szTosImageFileName", String_Tag, ConfigureParams.Rom.szTosImageFileName },
1.1.1.18  root      361:        { "bPatchTos", Bool_Tag, &ConfigureParams.Rom.bPatchTos },
1.1.1.9   root      362:        { "szCartridgeImageFileName", String_Tag, ConfigureParams.Rom.szCartridgeImageFileName },
                    363:        { NULL , Error_Tag, NULL }
1.1.1.6   root      364: };
                    365: 
                    366: /* Used to load/save RS232 options */
1.1.1.9   root      367: static const struct Config_Tag configs_Rs232[] =
1.1.1.6   root      368: {
1.1.1.9   root      369:        { "bEnableRS232", Bool_Tag, &ConfigureParams.RS232.bEnableRS232 },
                    370:        { "szOutFileName", String_Tag, ConfigureParams.RS232.szOutFileName },
                    371:        { "szInFileName", String_Tag, ConfigureParams.RS232.szInFileName },
                    372:        { NULL , Error_Tag, NULL }
1.1.1.6   root      373: };
                    374: 
                    375: /* Used to load/save printer options */
1.1.1.9   root      376: static const struct Config_Tag configs_Printer[] =
1.1.1.6   root      377: {
1.1.1.9   root      378:        { "bEnablePrinting", Bool_Tag, &ConfigureParams.Printer.bEnablePrinting },
                    379:        { "szPrintToFileName", String_Tag, ConfigureParams.Printer.szPrintToFileName },
                    380:        { NULL , Error_Tag, NULL }
1.1.1.6   root      381: };
                    382: 
1.1.1.7   root      383: /* Used to load/save MIDI options */
1.1.1.9   root      384: static const struct Config_Tag configs_Midi[] =
1.1.1.7   root      385: {
1.1.1.9   root      386:        { "bEnableMidi", Bool_Tag, &ConfigureParams.Midi.bEnableMidi },
1.1.1.14  root      387:        { "sMidiInFileName", String_Tag, ConfigureParams.Midi.sMidiInFileName },
                    388:        { "sMidiOutFileName", String_Tag, ConfigureParams.Midi.sMidiOutFileName },
1.1.1.9   root      389:        { NULL , Error_Tag, NULL }
1.1.1.7   root      390: };
                    391: 
1.1.1.6   root      392: /* Used to load/save system options */
1.1.1.9   root      393: static const struct Config_Tag configs_System[] =
1.1.1.6   root      394: {
1.1.1.9   root      395:        { "nCpuLevel", Int_Tag, &ConfigureParams.System.nCpuLevel },
                    396:        { "nCpuFreq", Int_Tag, &ConfigureParams.System.nCpuFreq },
                    397:        { "bCompatibleCpu", Bool_Tag, &ConfigureParams.System.bCompatibleCpu },
                    398:        { "nMachineType", Int_Tag, &ConfigureParams.System.nMachineType },
                    399:        { "bBlitter", Bool_Tag, &ConfigureParams.System.bBlitter },
1.1.1.12  root      400:        { "nDSPType", Int_Tag, &ConfigureParams.System.nDSPType },
1.1.1.9   root      401:        { "bRealTimeClock", Bool_Tag, &ConfigureParams.System.bRealTimeClock },
                    402:        { "bPatchTimerD", Bool_Tag, &ConfigureParams.System.bPatchTimerD },
1.1.1.18  root      403:        { "bFastBoot", Bool_Tag, &ConfigureParams.System.bFastBoot },
1.1.1.13  root      404:        { "bFastForward", Bool_Tag, &ConfigureParams.System.bFastForward },
1.1.1.22! root      405:        { "bAddressSpace24", Bool_Tag, &ConfigureParams.System.bAddressSpace24 },
1.1.1.17  root      406: 
                    407: #if ENABLE_WINUAE_CPU
                    408:        { "bCycleExactCpu", Bool_Tag, &ConfigureParams.System.bCycleExactCpu },
                    409:        { "n_FPUType", Int_Tag, &ConfigureParams.System.n_FPUType },
                    410:        { "bCompatibleFPU", Bool_Tag, &ConfigureParams.System.bCompatibleFPU },
                    411:        { "bMMU", Bool_Tag, &ConfigureParams.System.bMMU },
                    412: #endif
                    413:        { NULL , Error_Tag, NULL }
                    414: };
                    415: 
                    416: /* Used to load/save video options */
                    417: static const struct Config_Tag configs_Video[] =
                    418: {
                    419:        { "AviRecordVcodec", Int_Tag, &ConfigureParams.Video.AviRecordVcodec },
                    420:        { "AviRecordFps", Int_Tag, &ConfigureParams.Video.AviRecordFps },
                    421:        { "AviRecordFile", String_Tag, ConfigureParams.Video.AviRecordFile },
1.1.1.9   root      422:        { NULL , Error_Tag, NULL }
1.1.1.6   root      423: };
1.1       root      424: 
                    425: 
                    426: /*-----------------------------------------------------------------------*/
1.1.1.12  root      427: /**
                    428:  * Set default configuration values.
                    429:  */
1.1.1.2   root      430: void Configuration_SetDefault(void)
                    431: {
1.1.1.22! root      432:        int i, maxjoy;
1.1.1.12  root      433:        const char *psHomeDir;
                    434:        const char *psWorkingDir;
                    435: 
                    436:        psHomeDir = Paths_GetHatariHome();
                    437:        psWorkingDir = Paths_GetWorkingDir();
1.1.1.4   root      438: 
1.1.1.9   root      439:        /* Clear parameters */
                    440:        memset(&ConfigureParams, 0, sizeof(CNF_PARAMS));
                    441: 
1.1.1.16  root      442:        /* Set defaults for logging and tracing */
1.1.1.9   root      443:        strcpy(ConfigureParams.Log.sLogFileName, "stderr");
1.1.1.13  root      444:        strcpy(ConfigureParams.Log.sTraceFileName, "stderr");
1.1.1.21  root      445:        ConfigureParams.Log.nExceptionDebugMask = DEFAULT_EXCEPTIONS;
1.1.1.13  root      446:        ConfigureParams.Log.nTextLogLevel = LOG_TODO;
                    447:        ConfigureParams.Log.nAlertDlgLogLevel = LOG_ERROR;
1.1.1.15  root      448:        ConfigureParams.Log.bConfirmQuit = true;
1.1.1.20  root      449:        ConfigureParams.Log.bNatFeats = false;
                    450:        ConfigureParams.Log.bConsoleWindow = false;
1.1.1.9   root      451: 
1.1.1.16  root      452:        /* Set defaults for debugger */
                    453:        ConfigureParams.Debugger.nNumberBase = 10;
                    454:        ConfigureParams.Debugger.nDisasmLines = 8;
                    455:        ConfigureParams.Debugger.nMemdumpLines = 8;
1.1.1.20  root      456:        /* external one has nicer output, but isn't as complete as UAE one */
                    457:        ConfigureParams.Debugger.bDisasmUAE = false;
                    458:        ConfigureParams.Debugger.nDisasmOptions = Disasm_GetOptions();
1.1.1.16  root      459: 
1.1.1.10  root      460:        /* Set defaults for floppy disk images */
1.1.1.15  root      461:        ConfigureParams.DiskImage.bAutoInsertDiskB = true;
1.1.1.18  root      462:        ConfigureParams.DiskImage.FastFloppy = false;
1.1.1.10  root      463:        ConfigureParams.DiskImage.nWriteProtection = WRITEPROT_OFF;
1.1.1.21  root      464: 
                    465:        ConfigureParams.DiskImage.EnableDriveA = true;
                    466:        FDC_Drive_Set_Enable ( 0 , ConfigureParams.DiskImage.EnableDriveA );
                    467:        ConfigureParams.DiskImage.DriveA_NumberOfHeads = 2;
                    468:        FDC_Drive_Set_NumberOfHeads ( 0 , ConfigureParams.DiskImage.DriveA_NumberOfHeads );
                    469: 
                    470:        ConfigureParams.DiskImage.EnableDriveB = true;
                    471:        FDC_Drive_Set_Enable ( 1 , ConfigureParams.DiskImage.EnableDriveB );
                    472:        ConfigureParams.DiskImage.DriveB_NumberOfHeads = 2;
                    473:        FDC_Drive_Set_NumberOfHeads ( 1 , ConfigureParams.DiskImage.DriveB_NumberOfHeads );
                    474: 
                    475:        for (i = 0; i < MAX_FLOPPYDRIVES; i++)
1.1.1.13  root      476:        {
                    477:                ConfigureParams.DiskImage.szDiskZipPath[i][0] = '\0';
                    478:                ConfigureParams.DiskImage.szDiskFileName[i][0] = '\0';
                    479:        }
1.1.1.12  root      480:        strcpy(ConfigureParams.DiskImage.szDiskImageDirectory, psWorkingDir);
1.1.1.10  root      481:        File_AddSlashToEndFileName(ConfigureParams.DiskImage.szDiskImageDirectory);
                    482: 
                    483:        /* Set defaults for hard disks */
1.1.1.15  root      484:        ConfigureParams.HardDisk.bBootFromHardDisk = false;
1.1.1.22! root      485:        ConfigureParams.HardDisk.bFilenameConversion = false;
1.1.1.20  root      486:        ConfigureParams.HardDisk.nGemdosCase = GEMDOS_NOP;
1.1.1.16  root      487:        ConfigureParams.HardDisk.nWriteProtection = WRITEPROT_OFF;
1.1.1.22! root      488:        ConfigureParams.HardDisk.nGemdosDrive = DRIVE_C;
1.1.1.15  root      489:        ConfigureParams.HardDisk.bUseHardDiskDirectories = false;
1.1.1.13  root      490:        for (i = 0; i < MAX_HARDDRIVES; i++)
1.1.1.9   root      491:        {
1.1.1.12  root      492:                strcpy(ConfigureParams.HardDisk.szHardDiskDirectories[i], psWorkingDir);
1.1.1.10  root      493:                File_CleanFileName(ConfigureParams.HardDisk.szHardDiskDirectories[i]);
1.1.1.9   root      494:        }
1.1.1.16  root      495:        ConfigureParams.HardDisk.bUseIdeMasterHardDiskImage = false;
                    496:        strcpy(ConfigureParams.HardDisk.szIdeMasterHardDiskImage, psWorkingDir);
                    497:        ConfigureParams.HardDisk.bUseIdeSlaveHardDiskImage = false;
                    498:        strcpy(ConfigureParams.HardDisk.szIdeSlaveHardDiskImage, psWorkingDir);
1.1.1.9   root      499: 
1.1.1.21  root      500:        /* ACSI */
                    501:        for (i = 0; i < MAX_ACSI_DEVS; i++)
                    502:        {
                    503:                ConfigureParams.Acsi[i].bUseDevice = false;
                    504:                strcpy(ConfigureParams.Acsi[i].sDeviceFile, psWorkingDir);
                    505:        }
                    506: 
1.1.1.22! root      507:        /* SCSI */
        !           508:        for (i = 0; i < MAX_SCSI_DEVS; i++)
        !           509:        {
        !           510:                ConfigureParams.Scsi[i].bUseDevice = false;
        !           511:                strcpy(ConfigureParams.Scsi[i].sDeviceFile, psWorkingDir);
        !           512:        }
        !           513: 
1.1.1.9   root      514:        /* Set defaults for Joysticks */
1.1.1.22! root      515:        maxjoy = Joy_GetMaxId();
1.1.1.11  root      516:        for (i = 0; i < JOYSTICK_COUNT; i++)
1.1.1.9   root      517:        {
1.1.1.10  root      518:                ConfigureParams.Joysticks.Joy[i].nJoystickMode = JOYSTICK_DISABLED;
1.1.1.15  root      519:                ConfigureParams.Joysticks.Joy[i].bEnableAutoFire = false;
                    520:                ConfigureParams.Joysticks.Joy[i].bEnableJumpOnFire2 = false;
1.1.1.22! root      521:                ConfigureParams.Joysticks.Joy[i].nJoyId = (i > maxjoy ? maxjoy : i);
1.1.1.10  root      522:                ConfigureParams.Joysticks.Joy[i].nKeyCodeUp = SDLK_UP;
                    523:                ConfigureParams.Joysticks.Joy[i].nKeyCodeDown = SDLK_DOWN;
                    524:                ConfigureParams.Joysticks.Joy[i].nKeyCodeLeft = SDLK_LEFT;
                    525:                ConfigureParams.Joysticks.Joy[i].nKeyCodeRight = SDLK_RIGHT;
                    526:                ConfigureParams.Joysticks.Joy[i].nKeyCodeFire = SDLK_RCTRL;
1.1.1.9   root      527:        }
1.1.1.22! root      528:        if (SDL_NumJoysticks() > 0)
        !           529:        {
        !           530:                /* ST Joystick #1 is default joystick */
        !           531:                ConfigureParams.Joysticks.Joy[1].nJoyId = 0;
        !           532:                ConfigureParams.Joysticks.Joy[0].nJoyId = (maxjoy ? 1 : 0);
        !           533:                ConfigureParams.Joysticks.Joy[1].nJoystickMode = JOYSTICK_REALSTICK;
        !           534:        }
1.1.1.9   root      535: 
                    536:        /* Set defaults for Keyboard */
1.1.1.15  root      537:        ConfigureParams.Keyboard.bDisableKeyRepeat = false;
1.1.1.9   root      538:        ConfigureParams.Keyboard.nKeymapType = KEYMAP_SYMBOLIC;
                    539:        strcpy(ConfigureParams.Keyboard.szMappingFileName, "");
1.1.1.11  root      540:   
1.1.1.12  root      541:        /* Set defaults for Shortcuts */
                    542:        ConfigureParams.Shortcut.withoutModifier[SHORTCUT_OPTIONS] = SDLK_F12;
                    543:        ConfigureParams.Shortcut.withoutModifier[SHORTCUT_FULLSCREEN] = SDLK_F11;
1.1.1.13  root      544:        ConfigureParams.Shortcut.withoutModifier[SHORTCUT_PAUSE] = SDLK_PAUSE;
1.1.1.11  root      545:   
1.1.1.15  root      546:        ConfigureParams.Shortcut.withModifier[SHORTCUT_DEBUG] = SDLK_PAUSE;
1.1.1.12  root      547:        ConfigureParams.Shortcut.withModifier[SHORTCUT_OPTIONS] = SDLK_o;
                    548:        ConfigureParams.Shortcut.withModifier[SHORTCUT_FULLSCREEN] = SDLK_f;
1.1.1.16  root      549:        ConfigureParams.Shortcut.withModifier[SHORTCUT_MOUSEGRAB] = SDLK_m;
1.1.1.12  root      550:        ConfigureParams.Shortcut.withModifier[SHORTCUT_COLDRESET] = SDLK_c;
                    551:        ConfigureParams.Shortcut.withModifier[SHORTCUT_WARMRESET] = SDLK_r;
                    552:        ConfigureParams.Shortcut.withModifier[SHORTCUT_SCREENSHOT] = SDLK_g;
                    553:        ConfigureParams.Shortcut.withModifier[SHORTCUT_BOSSKEY] = SDLK_i;
                    554:        ConfigureParams.Shortcut.withModifier[SHORTCUT_CURSOREMU] = SDLK_j;
1.1.1.13  root      555:        ConfigureParams.Shortcut.withModifier[SHORTCUT_FASTFORWARD] = SDLK_x;
1.1.1.12  root      556:        ConfigureParams.Shortcut.withModifier[SHORTCUT_RECANIM] = SDLK_a;
                    557:        ConfigureParams.Shortcut.withModifier[SHORTCUT_RECSOUND] = SDLK_y;
                    558:        ConfigureParams.Shortcut.withModifier[SHORTCUT_SOUND] = SDLK_s;
                    559:        ConfigureParams.Shortcut.withModifier[SHORTCUT_QUIT] = SDLK_q;
                    560:        ConfigureParams.Shortcut.withModifier[SHORTCUT_LOADMEM] = SDLK_l;
                    561:        ConfigureParams.Shortcut.withModifier[SHORTCUT_SAVEMEM] = SDLK_k;
1.1.1.13  root      562:        ConfigureParams.Shortcut.withModifier[SHORTCUT_INSERTDISKA] = SDLK_d;
1.1.1.22! root      563:        ConfigureParams.Shortcut.withModifier[SHORTCUT_JOY_0] = SDLK_F1;
        !           564:        ConfigureParams.Shortcut.withModifier[SHORTCUT_JOY_1] = SDLK_F2;
        !           565:        ConfigureParams.Shortcut.withModifier[SHORTCUT_PAD_A] = SDLK_F3;
        !           566:        ConfigureParams.Shortcut.withModifier[SHORTCUT_PAD_B] = SDLK_F4;
1.1.1.13  root      567: 
1.1.1.9   root      568:        /* Set defaults for Memory */
1.1.1.10  root      569:        ConfigureParams.Memory.nMemorySize = 1;     /* 1 MiB */
1.1.1.22! root      570:        ConfigureParams.Memory.nTTRamSize = 0;     /* disabled */
1.1.1.15  root      571:        ConfigureParams.Memory.bAutoSave = false;
1.1.1.12  root      572:        sprintf(ConfigureParams.Memory.szMemoryCaptureFileName, "%s%chatari.sav",
                    573:                psHomeDir, PATHSEP);
                    574:        sprintf(ConfigureParams.Memory.szAutoSaveFileName, "%s%cauto.sav",
                    575:                psHomeDir, PATHSEP);
1.1.1.9   root      576: 
                    577:        /* Set defaults for Printer */
1.1.1.15  root      578:        ConfigureParams.Printer.bEnablePrinting = false;
1.1.1.12  root      579:        sprintf(ConfigureParams.Printer.szPrintToFileName, "%s%chatari.prn",
                    580:                psHomeDir, PATHSEP);
1.1.1.9   root      581: 
                    582:        /* Set defaults for RS232 */
1.1.1.15  root      583:        ConfigureParams.RS232.bEnableRS232 = false;
1.1.1.9   root      584:        strcpy(ConfigureParams.RS232.szOutFileName, "/dev/modem");
                    585:        strcpy(ConfigureParams.RS232.szInFileName, "/dev/modem");
                    586: 
                    587:        /* Set defaults for MIDI */
1.1.1.15  root      588:        ConfigureParams.Midi.bEnableMidi = false;
1.1.1.14  root      589:        strcpy(ConfigureParams.Midi.sMidiInFileName, "/dev/snd/midiC1D0");
                    590:        strcpy(ConfigureParams.Midi.sMidiOutFileName, "/dev/snd/midiC1D0");
1.1.1.9   root      591: 
                    592:        /* Set defaults for Screen */
1.1.1.15  root      593:        ConfigureParams.Screen.bFullScreen = false;
1.1.1.17  root      594:        ConfigureParams.Screen.bKeepResolution = true;
1.1.1.18  root      595:        ConfigureParams.Screen.bKeepResolutionST = false;
1.1.1.13  root      596:        ConfigureParams.Screen.nFrameSkips = AUTO_FRAMESKIP_LIMIT;
1.1.1.15  root      597:        ConfigureParams.Screen.bAllowOverscan = true;
1.1.1.21  root      598:        ConfigureParams.Screen.nSpec512Threshold = 1;
1.1.1.12  root      599:        ConfigureParams.Screen.nForceBpp = 0;
1.1.1.16  root      600:        ConfigureParams.Screen.bAspectCorrect = true;
1.1.1.13  root      601:        ConfigureParams.Screen.nMonitorType = MONITOR_TYPE_RGB;
1.1.1.15  root      602:        ConfigureParams.Screen.bUseExtVdiResolutions = false;
1.1.1.12  root      603:        ConfigureParams.Screen.nVdiWidth = 640;
                    604:        ConfigureParams.Screen.nVdiHeight = 480;
                    605:        ConfigureParams.Screen.nVdiColors = GEMCOLOR_16;
1.1.1.22! root      606:        ConfigureParams.Screen.bMouseWarp = true;
1.1.1.15  root      607:        ConfigureParams.Screen.bShowStatusbar = true;
                    608:        ConfigureParams.Screen.bShowDriveLed = true;
1.1.1.17  root      609:        ConfigureParams.Screen.bCrop = false;
1.1.1.19  root      610:        /* gives zoomed Falcon/TT windows about same size as ST/STE windows */
1.1.1.22! root      611:        ConfigureParams.Screen.nMaxWidth = 2*NUM_VISIBLE_LINE_PIXELS;
        !           612:        ConfigureParams.Screen.nMaxHeight = 2*NUM_VISIBLE_LINES+STATUSBAR_MAX_HEIGHT;
1.1.1.18  root      613:        ConfigureParams.Screen.bForceMax = false;
1.1.1.22! root      614: #if WITH_SDL2
        !           615:        ConfigureParams.Screen.nRenderScaleQuality = 0;
        !           616:        ConfigureParams.Screen.bUseVsync = false;
        !           617: #endif
1.1.1.9   root      618: 
                    619:        /* Set defaults for Sound */
1.1.1.17  root      620:        ConfigureParams.Sound.bEnableMicrophone = true;
1.1.1.15  root      621:        ConfigureParams.Sound.bEnableSound = true;
1.1.1.19  root      622:        ConfigureParams.Sound.bEnableSoundSync = false;
1.1.1.15  root      623:        ConfigureParams.Sound.nPlaybackFreq = 44100;
1.1.1.12  root      624:        sprintf(ConfigureParams.Sound.szYMCaptureFileName, "%s%chatari.wav",
                    625:                psWorkingDir, PATHSEP);
1.1.1.16  root      626:        ConfigureParams.Sound.SdlAudioBufferSize = 0;
1.1.1.17  root      627:        ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING;
1.1.1.9   root      628: 
                    629:        /* Set defaults for Rom */
1.1.1.12  root      630:        sprintf(ConfigureParams.Rom.szTosImageFileName, "%s%ctos.img",
                    631:                Paths_GetDataDir(), PATHSEP);
1.1.1.18  root      632:        ConfigureParams.Rom.bPatchTos = true;
1.1.1.9   root      633:        strcpy(ConfigureParams.Rom.szCartridgeImageFileName, "");
                    634: 
                    635:        /* Set defaults for System */
1.1.1.19  root      636: #if ENABLE_WINUAE_CPU
                    637:        /* Default to Falcon with WinUAE CPU core... */
                    638:        ConfigureParams.System.nMachineType = MACHINE_FALCON;
                    639:        ConfigureParams.System.nCpuLevel = 3;
                    640:        ConfigureParams.System.nCpuFreq = 16;
                    641:        ConfigureParams.System.nDSPType = DSP_TYPE_EMU;
                    642:        ConfigureParams.System.bAddressSpace24 = true;
                    643:        ConfigureParams.System.n_FPUType = FPU_NONE;
                    644:        ConfigureParams.System.bCompatibleFPU = true;
                    645:        ConfigureParams.System.bMMU = false;
                    646:        ConfigureParams.System.bCycleExactCpu = true;
                    647: #else
                    648:        /* ...and to ST with old UAE CPU core */
1.1.1.9   root      649:        ConfigureParams.System.nMachineType = MACHINE_ST;
1.1.1.19  root      650:        ConfigureParams.System.nCpuLevel = 0;
                    651:        ConfigureParams.System.nCpuFreq = 8;
1.1.1.12  root      652:        ConfigureParams.System.nDSPType = DSP_TYPE_NONE;
1.1.1.22! root      653:        ConfigureParams.System.bAddressSpace24 = true;
1.1.1.19  root      654: #endif
                    655:        ConfigureParams.System.bCompatibleCpu = true;
                    656:        ConfigureParams.System.bBlitter = false;
1.1.1.15  root      657:        ConfigureParams.System.bPatchTimerD = true;
1.1.1.22! root      658:        ConfigureParams.System.bFastBoot = false;
1.1.1.21  root      659:        ConfigureParams.System.bRealTimeClock = false;
1.1.1.15  root      660:        ConfigureParams.System.bFastForward = false;
1.1.1.17  root      661: 
                    662:        /* Set defaults for Video */
                    663: #if HAVE_LIBPNG
                    664:        ConfigureParams.Video.AviRecordVcodec = AVI_RECORD_VIDEO_CODEC_PNG;
                    665: #else
                    666:        ConfigureParams.Video.AviRecordVcodec = AVI_RECORD_VIDEO_CODEC_BMP;
                    667: #endif
                    668:        ConfigureParams.Video.AviRecordFps = 0;                 /* automatic FPS */
                    669:        sprintf(ConfigureParams.Video.AviRecordFile, "%s%chatari.avi", psWorkingDir, PATHSEP);
1.1.1.9   root      670: 
                    671:        /* Initialize the configuration file name */
1.1.1.12  root      672:        if (strlen(psHomeDir) < sizeof(sConfigFileName)-13)
                    673:                sprintf(sConfigFileName, "%s%chatari.cfg", psHomeDir, PATHSEP);
1.1.1.9   root      674:        else
                    675:                strcpy(sConfigFileName, "hatari.cfg");
1.1.1.12  root      676: 
                    677: #if defined(__AMIGAOS4__)
                    678:        /* Fix default path names on Amiga OS */
                    679:        sprintf(ConfigureParams.Rom.szTosImageFileName, "%stos.img", Paths_GetDataDir());
                    680: #endif
1.1.1.2   root      681: }
                    682: 
                    683: 
                    684: /*-----------------------------------------------------------------------*/
1.1.1.12  root      685: /**
                    686:  * Copy details from configuration structure into global variables for system,
                    687:  * clean file names, etc...  Called from main.c and dialog.c files.
                    688:  */
1.1.1.13  root      689: void Configuration_Apply(bool bReset)
1.1.1.8   root      690: {
1.1.1.21  root      691:        int i;
                    692: 
1.1.1.9   root      693:        if (bReset)
                    694:        {
1.1.1.12  root      695:                /* Set resolution change */
1.1.1.9   root      696:                bUseVDIRes = ConfigureParams.Screen.bUseExtVdiResolutions;
1.1.1.13  root      697:                bUseHighRes = ((!bUseVDIRes) && ConfigureParams.Screen.nMonitorType == MONITOR_TYPE_MONO)
1.1.1.12  root      698:                        || (bUseVDIRes && ConfigureParams.Screen.nVdiColors == GEMCOLOR_2);
                    699:                if (bUseHighRes)
                    700:                {
                    701:                        STRes = ST_HIGH_RES;
                    702:                }
                    703:                if (bUseVDIRes)
                    704:                {
                    705:                        VDI_SetResolution(ConfigureParams.Screen.nVdiColors,
                    706:                                          ConfigureParams.Screen.nVdiWidth,
                    707:                                          ConfigureParams.Screen.nVdiHeight);
1.1.1.17  root      708:                        bVdiAesIntercept = true;
1.1.1.12  root      709:                }
1.1.1.9   root      710:        }
1.1.1.13  root      711:        if (ConfigureParams.Screen.nFrameSkips < AUTO_FRAMESKIP_LIMIT)
                    712:        {
                    713:                nFrameSkips = ConfigureParams.Screen.nFrameSkips;
                    714:        }
1.1.1.15  root      715: 
1.1.1.17  root      716:        /* Init clocks for this machine */
                    717:        ClocksTimings_InitMachine ( ConfigureParams.System.nMachineType );
                    718: 
1.1.1.16  root      719:        /* Sound settings */
                    720:        /* SDL sound buffer in ms */
                    721:        SdlAudioBufferSize = ConfigureParams.Sound.SdlAudioBufferSize;
                    722:        if ( SdlAudioBufferSize == 0 )                  /* use default setting for SDL */
                    723:                ;
                    724:        else if ( SdlAudioBufferSize < 10 )             /* min of 10 ms */
                    725:                SdlAudioBufferSize = 10;
                    726:        else if ( SdlAudioBufferSize > 100 )            /* max of 100 ms */
                    727:                SdlAudioBufferSize = 100;
                    728: 
1.1.1.9   root      729:        /* Set playback frequency */
1.1.1.15  root      730:        Audio_SetOutputAudioFreq(ConfigureParams.Sound.nPlaybackFreq);
                    731: 
1.1.1.17  root      732:        /* YM Mixing */
                    733:        if ( ( ConfigureParams.Sound.YmVolumeMixing != YM_LINEAR_MIXING )
1.1.1.18  root      734:          && ( ConfigureParams.Sound.YmVolumeMixing != YM_TABLE_MIXING  )
                    735:          && ( ConfigureParams.Sound.YmVolumeMixing != YM_MODEL_MIXING ) )
1.1.1.17  root      736:                ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING;
                    737: 
                    738:        YmVolumeMixing = ConfigureParams.Sound.YmVolumeMixing;
                    739:        Sound_SetYmVolumeMixing();
                    740: 
                    741:        /* Check/constrain CPU settings and change corresponding
                    742:         * UAE cpu_level & cpu_compatible variables
                    743:         */
                    744:        M68000_CheckCpuSettings();
1.1.1.9   root      745: 
                    746:        /* Clean file and directory names */
                    747:        File_MakeAbsoluteName(ConfigureParams.Rom.szTosImageFileName);
1.1.1.11  root      748:        if (strlen(ConfigureParams.Rom.szCartridgeImageFileName) > 0)
                    749:                File_MakeAbsoluteName(ConfigureParams.Rom.szCartridgeImageFileName);
1.1.1.10  root      750:        File_CleanFileName(ConfigureParams.HardDisk.szHardDiskDirectories[0]);
                    751:        File_MakeAbsoluteName(ConfigureParams.HardDisk.szHardDiskDirectories[0]);
1.1.1.12  root      752:        File_MakeAbsoluteName(ConfigureParams.Memory.szMemoryCaptureFileName);
                    753:        File_MakeAbsoluteName(ConfigureParams.Sound.szYMCaptureFileName);
                    754:        if (strlen(ConfigureParams.Keyboard.szMappingFileName) > 0)
                    755:                File_MakeAbsoluteName(ConfigureParams.Keyboard.szMappingFileName);
1.1.1.17  root      756:        File_MakeAbsoluteName(ConfigureParams.Video.AviRecordFile);
1.1.1.21  root      757:        for (i = 0; i < MAX_ACSI_DEVS; i++)
                    758:        {
                    759:                File_MakeAbsoluteName(ConfigureParams.Acsi[i].sDeviceFile);
                    760:        }
1.1.1.22! root      761:        for (i = 0; i < MAX_SCSI_DEVS; i++)
        !           762:        {
        !           763:                File_MakeAbsoluteName(ConfigureParams.Scsi[i].sDeviceFile);
        !           764:        }
1.1.1.21  root      765: 
1.1.1.12  root      766:        /* make path names absolute, but handle special file names */
                    767:        File_MakeAbsoluteSpecialName(ConfigureParams.Log.sLogFileName);
1.1.1.13  root      768:        File_MakeAbsoluteSpecialName(ConfigureParams.Log.sTraceFileName);
1.1.1.14  root      769:        File_MakeAbsoluteSpecialName(ConfigureParams.RS232.szInFileName);
                    770:        File_MakeAbsoluteSpecialName(ConfigureParams.RS232.szOutFileName);
                    771:        File_MakeAbsoluteSpecialName(ConfigureParams.Midi.sMidiInFileName);
                    772:        File_MakeAbsoluteSpecialName(ConfigureParams.Midi.sMidiOutFileName);
1.1.1.12  root      773:        File_MakeAbsoluteSpecialName(ConfigureParams.Printer.szPrintToFileName);
1.1.1.21  root      774: 
                    775:        /* Enable/disable floppy drives */
                    776:        FDC_Drive_Set_Enable ( 0 , ConfigureParams.DiskImage.EnableDriveA );
                    777:        FDC_Drive_Set_Enable ( 1 , ConfigureParams.DiskImage.EnableDriveB );
                    778:        FDC_Drive_Set_NumberOfHeads ( 0 , ConfigureParams.DiskImage.DriveA_NumberOfHeads );
                    779:        FDC_Drive_Set_NumberOfHeads ( 1 , ConfigureParams.DiskImage.DriveB_NumberOfHeads );
1.1.1.22! root      780: 
        !           781:         /* Update disassembler */
        !           782: #if ENABLE_WINUAE_CPU
        !           783:         Disasm_SetCPUType ( ConfigureParams.System.nCpuLevel , ConfigureParams.System.n_FPUType );
        !           784: #else
        !           785:         Disasm_SetCPUType ( ConfigureParams.System.nCpuLevel , 0 );
        !           786: #endif
        !           787: 
        !           788: #if ENABLE_DSP_EMU
        !           789:        /* Enable DSP ? */
        !           790:        if ( ConfigureParams.System.nDSPType == DSP_TYPE_EMU )
        !           791:                DSP_Enable ();
        !           792:        else
        !           793:                DSP_Disable ();
        !           794: #endif
1.1.1.8   root      795: }
                    796: 
                    797: 
                    798: /*-----------------------------------------------------------------------*/
1.1.1.12  root      799: /**
                    800:  * Load a settings section from the configuration file.
                    801:  */
1.1.1.9   root      802: static int Configuration_LoadSection(const char *pFilename, const struct Config_Tag configs[], const char *pSection)
1.1       root      803: {
1.1.1.9   root      804:        int ret;
1.1       root      805: 
1.1.1.9   root      806:        ret = input_config(pFilename, configs, pSection);
1.1       root      807: 
1.1.1.9   root      808:        if (ret < 0)
                    809:                fprintf(stderr, "Can not load configuration file %s (section %s).\n",
1.1.1.16  root      810:                        pFilename, pSection);
1.1       root      811: 
1.1.1.9   root      812:        return ret;
1.1       root      813: }
                    814: 
                    815: 
                    816: /*-----------------------------------------------------------------------*/
1.1.1.12  root      817: /**
                    818:  * Load program setting from configuration file. If psFileName is NULL, use
1.1.1.16  root      819:  * the configuration file given in configuration / last selected by user.
1.1.1.12  root      820:  */
1.1.1.9   root      821: void Configuration_Load(const char *psFileName)
1.1       root      822: {
1.1.1.9   root      823:        if (psFileName == NULL)
                    824:                psFileName = sConfigFileName;
                    825: 
                    826:        if (!File_Exists(psFileName))
                    827:        {
1.1.1.17  root      828:                Log_Printf(LOG_DEBUG, "Configuration file %s not found.\n", psFileName);
1.1.1.9   root      829:                return;
                    830:        }
                    831: 
                    832:        Configuration_LoadSection(psFileName, configs_Log, "[Log]");
1.1.1.16  root      833:        Configuration_LoadSection(psFileName, configs_Debugger, "[Debugger]");
1.1.1.9   root      834:        Configuration_LoadSection(psFileName, configs_Screen, "[Screen]");
                    835:        Configuration_LoadSection(psFileName, configs_Joystick0, "[Joystick0]");
                    836:        Configuration_LoadSection(psFileName, configs_Joystick1, "[Joystick1]");
1.1.1.10  root      837:        Configuration_LoadSection(psFileName, configs_Joystick2, "[Joystick2]");
                    838:        Configuration_LoadSection(psFileName, configs_Joystick3, "[Joystick3]");
                    839:        Configuration_LoadSection(psFileName, configs_Joystick4, "[Joystick4]");
                    840:        Configuration_LoadSection(psFileName, configs_Joystick5, "[Joystick5]");
1.1.1.9   root      841:        Configuration_LoadSection(psFileName, configs_Keyboard, "[Keyboard]");
1.1.1.22! root      842: #if WITH_SDL2
        !           843:        Configuration_LoadSection(psFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers2]");
        !           844:        Configuration_LoadSection(psFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers2]");
        !           845: #else
1.1.1.11  root      846:        Configuration_LoadSection(psFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]");
                    847:        Configuration_LoadSection(psFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]");
1.1.1.22! root      848: #endif
1.1.1.9   root      849:        Configuration_LoadSection(psFileName, configs_Sound, "[Sound]");
                    850:        Configuration_LoadSection(psFileName, configs_Memory, "[Memory]");
                    851:        Configuration_LoadSection(psFileName, configs_Floppy, "[Floppy]");
1.1.1.10  root      852:        Configuration_LoadSection(psFileName, configs_HardDisk, "[HardDisk]");
1.1.1.21  root      853:        Configuration_LoadSection(psFileName, configs_Acsi, "[ACSI]");
1.1.1.22! root      854:        Configuration_LoadSection(psFileName, configs_Scsi, "[SCSI]");
1.1.1.9   root      855:        Configuration_LoadSection(psFileName, configs_Rom, "[ROM]");
                    856:        Configuration_LoadSection(psFileName, configs_Rs232, "[RS232]");
                    857:        Configuration_LoadSection(psFileName, configs_Printer, "[Printer]");
                    858:        Configuration_LoadSection(psFileName, configs_Midi, "[Midi]");
                    859:        Configuration_LoadSection(psFileName, configs_System, "[System]");
1.1.1.17  root      860:        Configuration_LoadSection(psFileName, configs_Video, "[Video]");
1.1       root      861: }
                    862: 
                    863: 
                    864: /*-----------------------------------------------------------------------*/
1.1.1.12  root      865: /**
                    866:  * Save a settings section to configuration file
                    867:  */
1.1.1.9   root      868: static int Configuration_SaveSection(const char *pFilename, const struct Config_Tag configs[], const char *pSection)
1.1       root      869: {
1.1.1.9   root      870:        int ret;
1.1       root      871: 
1.1.1.9   root      872:        ret = update_config(pFilename, configs, pSection);
1.1       root      873: 
1.1.1.9   root      874:        if (ret < 0)
1.1.1.16  root      875:                fprintf(stderr, "Error while updating section %s in %s\n", pSection, pFilename);
1.1       root      876: 
1.1.1.9   root      877:        return ret;
1.1       root      878: }
                    879: 
                    880: 
                    881: /*-----------------------------------------------------------------------*/
1.1.1.12  root      882: /**
                    883:  * Save program setting to configuration file
                    884:  */
1.1.1.6   root      885: void Configuration_Save(void)
1.1       root      886: {
1.1.1.9   root      887:        if (Configuration_SaveSection(sConfigFileName, configs_Log, "[Log]") < 0)
                    888:        {
1.1.1.13  root      889:                Log_AlertDlg(LOG_ERROR, "Error saving config file.");
1.1.1.9   root      890:                return;
                    891:        }
1.1.1.16  root      892:        Configuration_SaveSection(sConfigFileName, configs_Debugger, "[Debugger]");
1.1.1.9   root      893:        Configuration_SaveSection(sConfigFileName, configs_Screen, "[Screen]");
                    894:        Configuration_SaveSection(sConfigFileName, configs_Joystick0, "[Joystick0]");
                    895:        Configuration_SaveSection(sConfigFileName, configs_Joystick1, "[Joystick1]");
1.1.1.10  root      896:        Configuration_SaveSection(sConfigFileName, configs_Joystick2, "[Joystick2]");
                    897:        Configuration_SaveSection(sConfigFileName, configs_Joystick3, "[Joystick3]");
                    898:        Configuration_SaveSection(sConfigFileName, configs_Joystick4, "[Joystick4]");
                    899:        Configuration_SaveSection(sConfigFileName, configs_Joystick5, "[Joystick5]");
1.1.1.9   root      900:        Configuration_SaveSection(sConfigFileName, configs_Keyboard, "[Keyboard]");
1.1.1.22! root      901: #if WITH_SDL2
        !           902:        Configuration_SaveSection(sConfigFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers2]");
        !           903:        Configuration_SaveSection(sConfigFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers2]");
        !           904: #else
1.1.1.11  root      905:        Configuration_SaveSection(sConfigFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]");
                    906:        Configuration_SaveSection(sConfigFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]");
1.1.1.22! root      907: #endif
1.1.1.9   root      908:        Configuration_SaveSection(sConfigFileName, configs_Sound, "[Sound]");
                    909:        Configuration_SaveSection(sConfigFileName, configs_Memory, "[Memory]");
                    910:        Configuration_SaveSection(sConfigFileName, configs_Floppy, "[Floppy]");
1.1.1.10  root      911:        Configuration_SaveSection(sConfigFileName, configs_HardDisk, "[HardDisk]");
1.1.1.21  root      912:        /*Configuration_SaveSection(sConfigFileName, configs_Acsi, "[ACSI]");*/
1.1.1.22! root      913:        /*Configuration_SaveSection(sConfigFileName, configs_Scsi, "[SCSI]");*/
1.1.1.9   root      914:        Configuration_SaveSection(sConfigFileName, configs_Rom, "[ROM]");
                    915:        Configuration_SaveSection(sConfigFileName, configs_Rs232, "[RS232]");
                    916:        Configuration_SaveSection(sConfigFileName, configs_Printer, "[Printer]");
                    917:        Configuration_SaveSection(sConfigFileName, configs_Midi, "[Midi]");
                    918:        Configuration_SaveSection(sConfigFileName, configs_System, "[System]");
1.1.1.17  root      919:        Configuration_SaveSection(sConfigFileName, configs_Video, "[Video]");
1.1       root      920: }
1.1.1.6   root      921: 
1.1.1.12  root      922: 
                    923: /*-----------------------------------------------------------------------*/
                    924: /**
                    925:  * Save/restore snapshot of configuration variables
                    926:  * ('MemorySnapShot_Store' handles type)
                    927:  */
1.1.1.13  root      928: void Configuration_MemorySnapShot_Capture(bool bSave)
1.1.1.12  root      929: {
1.1.1.21  root      930:        int i;
                    931: 
1.1.1.12  root      932:        MemorySnapShot_Store(ConfigureParams.Rom.szTosImageFileName, sizeof(ConfigureParams.Rom.szTosImageFileName));
                    933:        MemorySnapShot_Store(ConfigureParams.Rom.szCartridgeImageFileName, sizeof(ConfigureParams.Rom.szCartridgeImageFileName));
                    934: 
                    935:        MemorySnapShot_Store(&ConfigureParams.Memory.nMemorySize, sizeof(ConfigureParams.Memory.nMemorySize));
1.1.1.22! root      936:        MemorySnapShot_Store(&ConfigureParams.Memory.nTTRamSize, sizeof(ConfigureParams.Memory.nTTRamSize));
1.1.1.12  root      937: 
1.1.1.18  root      938:        MemorySnapShot_Store(&ConfigureParams.DiskImage.szDiskFileName[0], sizeof(ConfigureParams.DiskImage.szDiskFileName[0]));
                    939:        MemorySnapShot_Store(&ConfigureParams.DiskImage.szDiskZipPath[0], sizeof(ConfigureParams.DiskImage.szDiskZipPath[0]));
1.1.1.21  root      940:        MemorySnapShot_Store(&ConfigureParams.DiskImage.EnableDriveA, sizeof(ConfigureParams.DiskImage.EnableDriveA));
                    941:        MemorySnapShot_Store(&ConfigureParams.DiskImage.DriveA_NumberOfHeads, sizeof(ConfigureParams.DiskImage.DriveA_NumberOfHeads));
1.1.1.18  root      942:        MemorySnapShot_Store(&ConfigureParams.DiskImage.szDiskFileName[1], sizeof(ConfigureParams.DiskImage.szDiskFileName[1]));
                    943:        MemorySnapShot_Store(&ConfigureParams.DiskImage.szDiskZipPath[1], sizeof(ConfigureParams.DiskImage.szDiskZipPath[1]));
1.1.1.21  root      944:        MemorySnapShot_Store(&ConfigureParams.DiskImage.EnableDriveB, sizeof(ConfigureParams.DiskImage.EnableDriveB));
                    945:        MemorySnapShot_Store(&ConfigureParams.DiskImage.DriveB_NumberOfHeads, sizeof(ConfigureParams.DiskImage.DriveB_NumberOfHeads));
1.1.1.18  root      946: 
1.1.1.12  root      947:        MemorySnapShot_Store(&ConfigureParams.HardDisk.bUseHardDiskDirectories, sizeof(ConfigureParams.HardDisk.bUseHardDiskDirectories));
                    948:        MemorySnapShot_Store(ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C], sizeof(ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C]));
1.1.1.21  root      949:        for (i = 0; i < MAX_ACSI_DEVS; i++)
                    950:        {
                    951:                MemorySnapShot_Store(&ConfigureParams.Acsi[i].bUseDevice, sizeof(ConfigureParams.Acsi[i].bUseDevice));
                    952:                MemorySnapShot_Store(ConfigureParams.Acsi[i].sDeviceFile, sizeof(ConfigureParams.Acsi[i].sDeviceFile));
                    953:        }
1.1.1.22! root      954:        /* for (i = 0; i < MAX_SCSI_DEVS; i++)
        !           955:        {
        !           956:                MemorySnapShot_Store(&ConfigureParams.Scsi[i].bUseDevice, sizeof(ConfigureParams.Scsi[i].bUseDevice));
        !           957:                MemorySnapShot_Store(ConfigureParams.Scsi[i].sDeviceFile, sizeof(ConfigureParams.Scsi[i].sDeviceFile));
        !           958:        }*/
1.1.1.12  root      959: 
1.1.1.13  root      960:        MemorySnapShot_Store(&ConfigureParams.Screen.nMonitorType, sizeof(ConfigureParams.Screen.nMonitorType));
1.1.1.12  root      961:        MemorySnapShot_Store(&ConfigureParams.Screen.bUseExtVdiResolutions, sizeof(ConfigureParams.Screen.bUseExtVdiResolutions));
                    962:        MemorySnapShot_Store(&ConfigureParams.Screen.nVdiWidth, sizeof(ConfigureParams.Screen.nVdiWidth));
                    963:        MemorySnapShot_Store(&ConfigureParams.Screen.nVdiHeight, sizeof(ConfigureParams.Screen.nVdiHeight));
                    964:        MemorySnapShot_Store(&ConfigureParams.Screen.nVdiColors, sizeof(ConfigureParams.Screen.nVdiColors));
                    965: 
                    966:        MemorySnapShot_Store(&ConfigureParams.System.nCpuLevel, sizeof(ConfigureParams.System.nCpuLevel));
                    967:        MemorySnapShot_Store(&ConfigureParams.System.nCpuFreq, sizeof(ConfigureParams.System.nCpuFreq));
                    968:        MemorySnapShot_Store(&ConfigureParams.System.bCompatibleCpu, sizeof(ConfigureParams.System.bCompatibleCpu));
                    969:        MemorySnapShot_Store(&ConfigureParams.System.nMachineType, sizeof(ConfigureParams.System.nMachineType));
                    970:        MemorySnapShot_Store(&ConfigureParams.System.bBlitter, sizeof(ConfigureParams.System.bBlitter));
                    971:        MemorySnapShot_Store(&ConfigureParams.System.nDSPType, sizeof(ConfigureParams.System.nDSPType));
                    972:        MemorySnapShot_Store(&ConfigureParams.System.bRealTimeClock, sizeof(ConfigureParams.System.bRealTimeClock));
                    973:        MemorySnapShot_Store(&ConfigureParams.System.bPatchTimerD, sizeof(ConfigureParams.System.bPatchTimerD));
1.1.1.22! root      974:        MemorySnapShot_Store(&ConfigureParams.System.bAddressSpace24, sizeof(ConfigureParams.System.bAddressSpace24));
1.1.1.17  root      975: 
                    976: #if ENABLE_WINUAE_CPU
                    977:        MemorySnapShot_Store(&ConfigureParams.System.bCycleExactCpu, sizeof(ConfigureParams.System.bCycleExactCpu));
                    978:        MemorySnapShot_Store(&ConfigureParams.System.n_FPUType, sizeof(ConfigureParams.System.n_FPUType));
                    979:        MemorySnapShot_Store(&ConfigureParams.System.bCompatibleFPU, sizeof(ConfigureParams.System.bCompatibleFPU));
                    980:        MemorySnapShot_Store(&ConfigureParams.System.bMMU, sizeof(ConfigureParams.System.bMMU));
                    981: #endif
                    982: 
1.1.1.18  root      983:        MemorySnapShot_Store(&ConfigureParams.DiskImage.FastFloppy, sizeof(ConfigureParams.DiskImage.FastFloppy));
1.1.1.12  root      984: 
                    985:        if (!bSave)
1.1.1.15  root      986:                Configuration_Apply(true);
1.1.1.12  root      987: }

unix.superglobalmegacorp.com

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