|
|
1.1 root 1: /*
1.1.1.3 root 2: Hatari - configuration.h
3:
1.1.1.17 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:
1.1.1.3 root 8: #ifndef HATARI_CONFIGURATION_H
9: #define HATARI_CONFIGURATION_H
10:
1.1.1.19 root 11: /* if header's struct contents depend on configuration options, header must include config.h */
12: #include "config.h"
13:
1.1.1.13 root 14: /* Logging and tracing */
1.1.1.6 root 15: typedef struct
16: {
17: char sLogFileName[FILENAME_MAX];
1.1.1.10 root 18: char sTraceFileName[FILENAME_MAX];
1.1.1.18 root 19: int nExceptionDebugMask;
1.1.1.6 root 20: int nTextLogLevel;
21: int nAlertDlgLogLevel;
1.1.1.10 root 22: bool bConfirmQuit;
1.1.1.17 root 23: bool bNatFeats;
24: bool bConsoleWindow; /* for now, used just for Windows */
1.1.1.6 root 25: } CNF_LOG;
26:
27:
1.1.1.13 root 28: /* debugger */
29: typedef struct
30: {
31: int nNumberBase;
32: int nDisasmLines;
33: int nMemdumpLines;
1.1.1.17 root 34: int nDisasmOptions;
35: bool bDisasmUAE;
1.1.1.13 root 36: } CNF_DEBUGGER;
37:
38:
1.1.1.5 root 39: /* ROM (TOS + cartridge) configuration */
1.1.1.3 root 40: typedef struct
41: {
1.1.1.5 root 42: char szTosImageFileName[FILENAME_MAX];
1.1.1.15 root 43: bool bPatchTos;
1.1.1.5 root 44: char szCartridgeImageFileName[FILENAME_MAX];
45: } CNF_ROM;
1.1.1.3 root 46:
47:
48: /* Sound configuration */
49: typedef struct
50: {
1.1.1.14 root 51: bool bEnableMicrophone;
1.1.1.10 root 52: bool bEnableSound;
1.1.1.16 root 53: bool bEnableSoundSync;
1.1.1.12 root 54: int nPlaybackFreq;
1.1.1.13 root 55: int SdlAudioBufferSize;
1.1.1.14 root 56: char szYMCaptureFileName[FILENAME_MAX];
57: int YmVolumeMixing;
1.1.1.3 root 58: } CNF_SOUND;
59:
60:
61:
1.1.1.4 root 62: /* RS232 configuration */
1.1.1.3 root 63: typedef struct
64: {
1.1.1.10 root 65: bool bEnableRS232;
1.1.1.4 root 66: char szOutFileName[FILENAME_MAX];
67: char szInFileName[FILENAME_MAX];
1.1.1.3 root 68: } CNF_RS232;
69:
70:
71: /* Dialog Keyboard */
72: typedef enum
73: {
74: KEYMAP_SYMBOLIC, /* Use keymapping with symbolic (ASCII) key codes */
75: KEYMAP_SCANCODE, /* Use keymapping with PC keyboard scancodes */
76: KEYMAP_LOADED /* Use keymapping with a map configuration file */
77: } KEYMAPTYPE;
78:
79: typedef struct
80: {
1.1.1.10 root 81: bool bDisableKeyRepeat;
1.1.1.3 root 82: KEYMAPTYPE nKeymapType;
1.1.1.4 root 83: char szMappingFileName[FILENAME_MAX];
1.1.1.3 root 84: } CNF_KEYBOARD;
85:
86:
1.1.1.8 root 87: typedef enum {
88: SHORTCUT_OPTIONS,
89: SHORTCUT_FULLSCREEN,
1.1.1.13 root 90: SHORTCUT_MOUSEGRAB,
1.1.1.8 root 91: SHORTCUT_COLDRESET,
92: SHORTCUT_WARMRESET,
93: SHORTCUT_SCREENSHOT,
94: SHORTCUT_BOSSKEY,
95: SHORTCUT_CURSOREMU,
1.1.1.10 root 96: SHORTCUT_FASTFORWARD,
1.1.1.8 root 97: SHORTCUT_RECANIM,
98: SHORTCUT_RECSOUND,
99: SHORTCUT_SOUND,
1.1.1.12 root 100: SHORTCUT_DEBUG,
1.1.1.10 root 101: SHORTCUT_PAUSE,
1.1.1.8 root 102: SHORTCUT_QUIT,
1.1.1.9 root 103: SHORTCUT_LOADMEM,
104: SHORTCUT_SAVEMEM,
1.1.1.10 root 105: SHORTCUT_INSERTDISKA,
1.1.1.19 root 106: SHORTCUT_JOY_0,
107: SHORTCUT_JOY_1,
108: SHORTCUT_PAD_A,
109: SHORTCUT_PAD_B,
1.1.1.8 root 110: SHORTCUT_KEYS, /* number of shortcuts */
111: SHORTCUT_NONE
112: } SHORTCUTKEYIDX;
113:
114: typedef struct
115: {
116: int withModifier[SHORTCUT_KEYS];
117: int withoutModifier[SHORTCUT_KEYS];
118: } CNF_SHORTCUT;
119:
120:
1.1.1.3 root 121: typedef struct
122: {
1.1.1.7 root 123: int nMemorySize;
1.1.1.19 root 124: int nTTRamSize;
1.1.1.10 root 125: bool bAutoSave;
1.1.1.4 root 126: char szMemoryCaptureFileName[FILENAME_MAX];
1.1.1.9 root 127: char szAutoSaveFileName[FILENAME_MAX];
1.1.1.3 root 128: } CNF_MEMORY;
129:
130:
131: /* Joystick configuration */
1.1.1.7 root 132: typedef enum
133: {
134: JOYSTICK_DISABLED,
135: JOYSTICK_REALSTICK,
136: JOYSTICK_KEYBOARD
137: } JOYSTICKMODE;
1.1.1.19 root 138: #define JOYSTICK_MODES 3
1.1.1.7 root 139:
1.1.1.3 root 140: typedef struct
141: {
1.1.1.7 root 142: JOYSTICKMODE nJoystickMode;
1.1.1.10 root 143: bool bEnableAutoFire;
1.1.1.12 root 144: bool bEnableJumpOnFire2;
1.1.1.7 root 145: int nJoyId;
146: int nKeyCodeUp, nKeyCodeDown, nKeyCodeLeft, nKeyCodeRight, nKeyCodeFire;
1.1.1.3 root 147: } JOYSTICK;
148:
1.1.1.19 root 149: enum
150: {
151: JOYID_JOYSTICK0,
152: JOYID_JOYSTICK1,
153: JOYID_STEPADA,
154: JOYID_STEPADB,
155: JOYID_PARPORT1,
156: JOYID_PARPORT2,
157: JOYSTICK_COUNT
158: };
1.1.1.8 root 159:
1.1.1.3 root 160: typedef struct
161: {
1.1.1.8 root 162: JOYSTICK Joy[JOYSTICK_COUNT];
1.1.1.3 root 163: } CNF_JOYSTICKS;
164:
165:
1.1.1.7 root 166: /* Disk image configuration */
1.1.1.6 root 167:
168: typedef enum
169: {
170: WRITEPROT_OFF,
171: WRITEPROT_ON,
172: WRITEPROT_AUTO
173: } WRITEPROTECTION;
174:
1.1.1.10 root 175: #define MAX_FLOPPYDRIVES 2
176:
1.1.1.3 root 177: typedef struct
178: {
1.1.1.10 root 179: bool bAutoInsertDiskB;
1.1.1.15 root 180: bool FastFloppy; /* true to speed up FDC emulation */
1.1.1.18 root 181: bool EnableDriveA;
182: bool EnableDriveB;
183: int DriveA_NumberOfHeads;
184: int DriveB_NumberOfHeads;
1.1.1.6 root 185: WRITEPROTECTION nWriteProtection;
1.1.1.10 root 186: char szDiskZipPath[MAX_FLOPPYDRIVES][FILENAME_MAX];
187: char szDiskFileName[MAX_FLOPPYDRIVES][FILENAME_MAX];
1.1.1.7 root 188: char szDiskImageDirectory[FILENAME_MAX];
189: } CNF_DISKIMAGE;
1.1.1.3 root 190:
191:
1.1.1.15 root 192: /* Hard drives configuration: C: - Z: */
193: #define MAX_HARDDRIVES 24
194: #define DRIVE_C 0
1.1.1.19 root 195: #define DRIVE_SKIP -1
1.1.1.3 root 196:
1.1.1.17 root 197: typedef enum
198: {
199: GEMDOS_NOP,
200: GEMDOS_UPPER,
201: GEMDOS_LOWER
202: } GEMDOS_CHR_CONV;
203:
1.1.1.3 root 204: typedef struct
205: {
1.1.1.19 root 206: int nGemdosDrive;
1.1.1.10 root 207: bool bUseHardDiskDirectories;
1.1.1.13 root 208: bool bUseIdeMasterHardDiskImage;
209: bool bUseIdeSlaveHardDiskImage;
210: WRITEPROTECTION nWriteProtection;
1.1.1.17 root 211: GEMDOS_CHR_CONV nGemdosCase;
1.1.1.19 root 212: bool bFilenameConversion;
1.1.1.13 root 213: bool bBootFromHardDisk;
1.1.1.7 root 214: char szHardDiskDirectories[MAX_HARDDRIVES][FILENAME_MAX];
1.1.1.13 root 215: char szIdeMasterHardDiskImage[FILENAME_MAX];
216: char szIdeSlaveHardDiskImage[FILENAME_MAX];
1.1.1.7 root 217: } CNF_HARDDISK;
1.1.1.3 root 218:
1.1.1.18 root 219: /* SCSI/ACSI configuration */
220: #define MAX_ACSI_DEVS 8
1.1.1.19 root 221: #define MAX_SCSI_DEVS 8
1.1.1.18 root 222:
223: typedef struct
224: {
225: bool bUseDevice;
226: char sDeviceFile[FILENAME_MAX];
227: } CNF_SCSIDEV;
228:
1.1.1.9 root 229: /* Falcon register $FFFF8006 bits 6 & 7 (mirrored in $FFFF82C0 bits 0 & 1):
230: * 00 Monochrome
231: * 01 RGB - Colormonitor
232: * 10 VGA - Colormonitor
233: * 11 TV
234: */
235: #define FALCON_MONITOR_MONO 0x00 /* SM124 */
236: #define FALCON_MONITOR_RGB 0x40
237: #define FALCON_MONITOR_VGA 0x80
238: #define FALCON_MONITOR_TV 0xC0
239:
240: typedef enum
241: {
242: MONITOR_TYPE_MONO,
243: MONITOR_TYPE_RGB,
244: MONITOR_TYPE_VGA,
245: MONITOR_TYPE_TV
246: } MONITORTYPE;
1.1.1.3 root 247:
248: /* Screen configuration */
249: typedef struct
250: {
1.1.1.10 root 251: MONITORTYPE nMonitorType;
252: int nFrameSkips;
253: bool bFullScreen;
1.1.1.14 root 254: bool bKeepResolution;
1.1.1.20! root 255: #if !WITH_SDL2
1.1.1.15 root 256: bool bKeepResolutionST;
1.1.1.20! root 257: #endif
1.1.1.10 root 258: bool bAllowOverscan;
1.1.1.13 root 259: bool bAspectCorrect;
1.1.1.10 root 260: bool bUseExtVdiResolutions;
1.1.1.9 root 261: int nSpec512Threshold;
262: int nForceBpp;
1.1.1.5 root 263: int nVdiColors;
1.1.1.9 root 264: int nVdiWidth;
265: int nVdiHeight;
1.1.1.19 root 266: bool bMouseWarp;
1.1.1.10 root 267: bool bShowStatusbar;
268: bool bShowDriveLed;
1.1.1.14 root 269: bool bCrop;
1.1.1.15 root 270: bool bForceMax;
1.1.1.13 root 271: int nMaxWidth;
272: int nMaxHeight;
1.1.1.19 root 273: #if WITH_SDL2
274: int nRenderScaleQuality;
275: bool bUseVsync;
276: #endif
1.1.1.3 root 277: } CNF_SCREEN;
278:
279:
280: /* Printer configuration */
281: typedef struct
282: {
1.1.1.10 root 283: bool bEnablePrinting;
1.1.1.4 root 284: char szPrintToFileName[FILENAME_MAX];
1.1.1.3 root 285: } CNF_PRINTER;
286:
287:
1.1.1.4 root 288: /* Midi configuration */
289: typedef struct
290: {
1.1.1.10 root 291: bool bEnableMidi;
1.1.1.11 root 292: char sMidiInFileName[FILENAME_MAX];
293: char sMidiOutFileName[FILENAME_MAX];
1.1.1.4 root 294: } CNF_MIDI;
295:
296:
1.1.1.3 root 297: /* Dialog System */
298: typedef enum
299: {
1.1.1.6 root 300: MACHINE_ST,
1.1.1.20! root 301: MACHINE_MEGA_ST,
1.1.1.8 root 302: MACHINE_STE,
1.1.1.20! root 303: MACHINE_MEGA_STE,
1.1.1.9 root 304: MACHINE_TT,
1.1.1.20! root 305: MACHINE_FALCON
1.1.1.6 root 306: } MACHINETYPE;
307:
1.1.1.9 root 308: typedef enum
309: {
310: DSP_TYPE_NONE,
311: DSP_TYPE_DUMMY,
312: DSP_TYPE_EMU
313: } DSPTYPE;
314:
1.1.1.14 root 315: #if ENABLE_WINUAE_CPU
316: typedef enum
317: {
1.1.1.16 root 318: FPU_NONE = 0,
319: FPU_68881 = 68881,
320: FPU_68882 = 68882,
321: FPU_CPU = 68040
1.1.1.14 root 322: } FPUTYPE;
323: #endif
324:
1.1.1.20! root 325: typedef enum
! 326: {
! 327: VIDEO_TIMING_MODE_RANDOM = 0,
! 328: VIDEO_TIMING_MODE_WS1,
! 329: VIDEO_TIMING_MODE_WS2,
! 330: VIDEO_TIMING_MODE_WS3,
! 331: VIDEO_TIMING_MODE_WS4,
! 332: } VIDEOTIMINGMODE;
! 333:
1.1.1.3 root 334: typedef struct
335: {
336: int nCpuLevel;
1.1.1.6 root 337: int nCpuFreq;
1.1.1.14 root 338: bool bCompatibleCpu; /* Prefetch mode */
1.1.1.6 root 339: MACHINETYPE nMachineType;
1.1.1.10 root 340: bool bBlitter; /* TRUE if Blitter is enabled */
1.1.1.9 root 341: DSPTYPE nDSPType; /* how to "emulate" DSP */
1.1.1.10 root 342: bool bPatchTimerD;
1.1.1.15 root 343: bool bFastBoot; /* Enable to patch TOS for fast boot */
1.1.1.10 root 344: bool bFastForward;
1.1.1.19 root 345: bool bAddressSpace24; /* Always set to true with old UAE cpu */
1.1.1.20! root 346: VIDEOTIMINGMODE VideoTimingMode;
1.1.1.15 root 347:
1.1.1.14 root 348: #if ENABLE_WINUAE_CPU
349: bool bCycleExactCpu;
350: FPUTYPE n_FPUType;
351: bool bCompatibleFPU; /* More compatible FPU */
352: bool bMMU; /* TRUE if MMU is enabled */
353: #endif
1.1.1.3 root 354: } CNF_SYSTEM;
355:
1.1.1.14 root 356: typedef struct
357: {
358: int AviRecordVcodec;
359: int AviRecordFps;
360: char AviRecordFile[FILENAME_MAX];
361: } CNF_VIDEO;
1.1.1.3 root 362:
363: /* State of system is stored in this structure */
364: /* On reset, variables are copied into system globals and used. */
365: typedef struct
366: {
367: /* Configure */
1.1.1.6 root 368: CNF_LOG Log;
1.1.1.13 root 369: CNF_DEBUGGER Debugger;
1.1.1.3 root 370: CNF_SCREEN Screen;
371: CNF_JOYSTICKS Joysticks;
372: CNF_KEYBOARD Keyboard;
1.1.1.8 root 373: CNF_SHORTCUT Shortcut;
1.1.1.3 root 374: CNF_SOUND Sound;
375: CNF_MEMORY Memory;
1.1.1.7 root 376: CNF_DISKIMAGE DiskImage;
377: CNF_HARDDISK HardDisk;
1.1.1.18 root 378: CNF_SCSIDEV Acsi[MAX_ACSI_DEVS];
1.1.1.19 root 379: CNF_SCSIDEV Scsi[MAX_SCSI_DEVS];
1.1.1.5 root 380: CNF_ROM Rom;
1.1.1.3 root 381: CNF_RS232 RS232;
382: CNF_PRINTER Printer;
1.1.1.4 root 383: CNF_MIDI Midi;
1.1.1.3 root 384: CNF_SYSTEM System;
1.1.1.14 root 385: CNF_VIDEO Video;
1.1.1.3 root 386: } CNF_PARAMS;
387:
388:
389: extern CNF_PARAMS ConfigureParams;
1.1.1.4 root 390: extern char sConfigFileName[FILENAME_MAX];
1.1 root 391:
1.1.1.20! root 392: static inline bool Config_IsMachineST(void)
! 393: {
! 394: return ConfigureParams.System.nMachineType == MACHINE_ST ||
! 395: ConfigureParams.System.nMachineType == MACHINE_MEGA_ST;
! 396: }
! 397:
! 398: static inline bool Config_IsMachineSTE(void)
! 399: {
! 400: return ConfigureParams.System.nMachineType == MACHINE_STE ||
! 401: ConfigureParams.System.nMachineType == MACHINE_MEGA_STE;
! 402: }
! 403:
! 404: static inline bool Config_IsMachineTT(void)
! 405: {
! 406: return ConfigureParams.System.nMachineType == MACHINE_TT;
! 407: }
! 408:
! 409: static inline bool Config_IsMachineFalcon(void)
! 410: {
! 411: return ConfigureParams.System.nMachineType == MACHINE_FALCON;
! 412: }
! 413:
1.1.1.2 root 414: extern void Configuration_SetDefault(void);
1.1.1.10 root 415: extern void Configuration_Apply(bool bReset);
1.1.1.6 root 416: extern void Configuration_Load(const char *psFileName);
1.1.1.3 root 417: extern void Configuration_Save(void);
1.1.1.10 root 418: extern void Configuration_MemorySnapShot_Capture(bool bSave);
1.1.1.3 root 419:
420: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.