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