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