|
|
1.1 ! root 1: /* ! 2: Hatari - configuration.h ! 3: ! 4: This file is distributed under the GNU Public License, version 2 or at ! 5: your option any later version. Read the file gpl.txt for details. ! 6: */ ! 7: ! 8: #pragma once ! 9: ! 10: #ifndef HATARI_CONFIGURATION_H ! 11: #define HATARI_CONFIGURATION_H ! 12: ! 13: ! 14: #include <stdio.h> ! 15: ! 16: #ifdef __cplusplus ! 17: extern "C" { ! 18: #endif /* __cplusplus */ ! 19: ! 20: #define ENABLE_TESTING 0 ! 21: ! 22: /* Configuration Dialog */ ! 23: typedef struct ! 24: { ! 25: bool bShowConfigDialogAtStartup; ! 26: } CNF_CONFIGDLG; ! 27: ! 28: /* Logging and tracing */ ! 29: typedef struct ! 30: { ! 31: char sLogFileName[FILENAME_MAX]; ! 32: char sTraceFileName[FILENAME_MAX]; ! 33: int nTextLogLevel; ! 34: int nAlertDlgLogLevel; ! 35: bool bConfirmQuit; ! 36: } CNF_LOG; ! 37: ! 38: ! 39: /* Debugger */ ! 40: typedef struct ! 41: { ! 42: int nNumberBase; ! 43: int nDisasmLines; ! 44: int nMemdumpLines; ! 45: } CNF_DEBUGGER; ! 46: ! 47: ! 48: /* ROM configuration */ ! 49: typedef struct ! 50: { ! 51: char szRom030FileName[FILENAME_MAX]; ! 52: char szRom040FileName[FILENAME_MAX]; ! 53: char szRomTurboFileName[FILENAME_MAX]; ! 54: } CNF_ROM; ! 55: ! 56: ! 57: /* Sound configuration */ ! 58: typedef struct ! 59: { ! 60: bool bEnableMicrophone; ! 61: bool bEnableSound; ! 62: } CNF_SOUND; ! 63: ! 64: /* Dialog Keyboard */ ! 65: typedef enum ! 66: { ! 67: KEYMAP_SYMBOLIC, /* Use keymapping with symbolic (ASCII) key codes */ ! 68: KEYMAP_SCANCODE, /* Use keymapping with PC keyboard scancodes */ ! 69: KEYMAP_LOADED /* Use keymapping with a map configuration file */ ! 70: } KEYMAPTYPE; ! 71: ! 72: typedef struct ! 73: { ! 74: bool bSwapCmdAlt; ! 75: KEYMAPTYPE nKeymapType; ! 76: char szMappingFileName[FILENAME_MAX]; ! 77: } CNF_KEYBOARD; ! 78: ! 79: ! 80: typedef enum { ! 81: SHORTCUT_OPTIONS, ! 82: SHORTCUT_FULLSCREEN, ! 83: SHORTCUT_MOUSEGRAB, ! 84: SHORTCUT_COLDRESET, ! 85: SHORTCUT_WARMRESET, ! 86: SHORTCUT_CURSOREMU, ! 87: SHORTCUT_SOUND, ! 88: SHORTCUT_DEBUG_M68K, ! 89: SHORTCUT_DEBUG_I860, ! 90: SHORTCUT_PAUSE, ! 91: SHORTCUT_QUIT, ! 92: SHORTCUT_DIMENSION, ! 93: SHORTCUT_KEYS, /* number of shortcuts */ ! 94: SHORTCUT_NONE ! 95: } SHORTCUTKEYIDX; ! 96: ! 97: typedef struct ! 98: { ! 99: int withModifier[SHORTCUT_KEYS]; ! 100: int withoutModifier[SHORTCUT_KEYS]; ! 101: } CNF_SHORTCUT; ! 102: ! 103: ! 104: /* Dialog Mouse */ ! 105: #define MOUSE_LIN_MIN 0.1 ! 106: #define MOUSE_LIN_MAX 10.0 ! 107: #define MOUSE_EXP_MIN 0.5 ! 108: #define MOUSE_EXP_MAX 1.0 ! 109: typedef struct ! 110: { ! 111: bool bEnableAutoGrab; ! 112: float fLinSpeedNormal; ! 113: float fLinSpeedLocked; ! 114: float fExpSpeedNormal; ! 115: float fExpSpeedLocked; ! 116: } CNF_MOUSE; ! 117: ! 118: ! 119: /* Memory configuration */ ! 120: ! 121: typedef enum ! 122: { ! 123: MEMORY_120NS, ! 124: MEMORY_100NS, ! 125: MEMORY_80NS, ! 126: MEMORY_60NS ! 127: } MEMORY_SPEED; ! 128: ! 129: typedef struct ! 130: { ! 131: int nMemoryBankSize[4]; ! 132: MEMORY_SPEED nMemorySpeed; ! 133: } CNF_MEMORY; ! 134: ! 135: ! 136: /* Dialog Boot options */ ! 137: ! 138: typedef enum ! 139: { ! 140: BOOT_ROM, ! 141: BOOT_SCSI, ! 142: BOOT_ETHERNET, ! 143: BOOT_MO, ! 144: BOOT_FLOPPY ! 145: } BOOT_DEVICE; ! 146: ! 147: typedef struct ! 148: { ! 149: BOOT_DEVICE nBootDevice; ! 150: bool bEnableDRAMTest; ! 151: bool bEnablePot; ! 152: bool bExtendedPot; ! 153: bool bEnableSoundTest; ! 154: bool bEnableSCSITest; ! 155: bool bLoopPot; ! 156: bool bVerbose; ! 157: } CNF_BOOT; ! 158: ! 159: ! 160: /* Hard drives configuration */ ! 161: #define ESP_MAX_DEVS 7 ! 162: typedef enum { ! 163: DEVTYPE_NONE, ! 164: DEVTYPE_HARDDISK, ! 165: DEVTYPE_CD, ! 166: DEVTYPE_FLOPPY, ! 167: NUM_DEVTYPES ! 168: } SCSI_DEVTYPE; ! 169: ! 170: typedef struct { ! 171: char szImageName[FILENAME_MAX]; ! 172: SCSI_DEVTYPE nDeviceType; ! 173: bool bDiskInserted; ! 174: bool bWriteProtected; ! 175: } SCSIDISK; ! 176: ! 177: typedef enum ! 178: { ! 179: WRITEPROT_OFF, ! 180: WRITEPROT_ON, ! 181: WRITEPROT_AUTO ! 182: } WRITEPROTECTION; ! 183: ! 184: typedef struct { ! 185: SCSIDISK target[ESP_MAX_DEVS]; ! 186: int nWriteProtection; ! 187: } CNF_SCSI; ! 188: ! 189: ! 190: /* Magneto-optical drives configuration */ ! 191: #define MO_MAX_DRIVES 2 ! 192: typedef struct { ! 193: char szImageName[FILENAME_MAX]; ! 194: bool bDriveConnected; ! 195: bool bDiskInserted; ! 196: bool bWriteProtected; ! 197: } MODISK; ! 198: ! 199: typedef struct { ! 200: MODISK drive[MO_MAX_DRIVES]; ! 201: } CNF_MO; ! 202: ! 203: ! 204: /* Floppy disk drives configuration */ ! 205: #define FLP_MAX_DRIVES 2 ! 206: typedef struct { ! 207: char szImageName[FILENAME_MAX]; ! 208: bool bDriveConnected; ! 209: bool bDiskInserted; ! 210: bool bWriteProtected; ! 211: } FLPDISK; ! 212: ! 213: typedef struct { ! 214: FLPDISK drive[FLP_MAX_DRIVES]; ! 215: } CNF_FLOPPY; ! 216: ! 217: ! 218: /* Ethernet configuration */ ! 219: typedef enum ! 220: { ! 221: ENET_SLIRP, ! 222: ENET_PCAP ! 223: } ENET_INTERFACE; ! 224: ! 225: typedef struct { ! 226: bool bEthernetConnected; ! 227: bool bTwistedPair; ! 228: ENET_INTERFACE nHostInterface; ! 229: char szInterfaceName[FILENAME_MAX]; ! 230: } CNF_ENET; ! 231: ! 232: typedef enum ! 233: { ! 234: MONITOR_TYPE_DUAL, ! 235: MONITOR_TYPE_CPU, ! 236: MONITOR_TYPE_DIMENSION, ! 237: } MONITORTYPE; ! 238: ! 239: /* Screen configuration */ ! 240: typedef struct ! 241: { ! 242: MONITORTYPE nMonitorType; ! 243: int nMonitorNum; ! 244: bool bFullScreen; ! 245: bool bShowStatusbar; ! 246: bool bShowDriveLed; ! 247: } CNF_SCREEN; ! 248: ! 249: ! 250: /* Printer configuration */ ! 251: typedef enum ! 252: { ! 253: PAPER_A4, ! 254: PAPER_LETTER, ! 255: PAPER_B5, ! 256: PAPER_LEGAL ! 257: } PAPER_SIZE; ! 258: ! 259: typedef struct ! 260: { ! 261: bool bPrinterConnected; ! 262: PAPER_SIZE nPaperSize; ! 263: char szPrintToFileName[FILENAME_MAX]; ! 264: } CNF_PRINTER; ! 265: ! 266: /* Dialog System */ ! 267: typedef enum ! 268: { ! 269: NEXT_CUBE030, ! 270: NEXT_CUBE040, ! 271: NEXT_STATION ! 272: } MACHINETYPE; ! 273: ! 274: typedef enum ! 275: { ! 276: NCR53C90, ! 277: NCR53C90A ! 278: } SCSICHIP; ! 279: ! 280: typedef enum ! 281: { ! 282: MC68HC68T1, ! 283: MCCS1850 ! 284: } RTCCHIP; ! 285: ! 286: typedef enum ! 287: { ! 288: DSP_TYPE_NONE, ! 289: DSP_TYPE_DUMMY, ! 290: DSP_TYPE_EMU ! 291: } DSPTYPE; ! 292: ! 293: typedef enum ! 294: { ! 295: FPU_NONE = 0, ! 296: FPU_68881 = 68881, ! 297: FPU_68882 = 68882, ! 298: FPU_CPU = 68040 ! 299: } FPUTYPE; ! 300: ! 301: typedef struct ! 302: { ! 303: bool bColor; ! 304: bool bTurbo; ! 305: bool bNBIC; ! 306: SCSICHIP nSCSI; ! 307: RTCCHIP nRTC; ! 308: int nCpuLevel; ! 309: int nCpuFreq; ! 310: bool bCompatibleCpu; /* Prefetch mode */ ! 311: MACHINETYPE nMachineType; ! 312: bool bRealtime; /* TRUE if realtime sources shoud be used */ ! 313: DSPTYPE nDSPType; /* how to "emulate" DSP */ ! 314: bool bDSPMemoryExpansion; ! 315: bool bRealTimeClock; ! 316: FPUTYPE n_FPUType; ! 317: bool bCompatibleFPU; /* More compatible FPU */ ! 318: bool bMMU; /* TRUE if MMU is enabled */ ! 319: } CNF_SYSTEM; ! 320: ! 321: /* Floppy disk drives configuration */ ! 322: #define ND_MAX_BOARDS 3 ! 323: typedef struct ! 324: { ! 325: bool bEnabled; ! 326: int nMemoryBankSize[4]; ! 327: char szRomFileName[FILENAME_MAX]; ! 328: } NDBOARD; ! 329: ! 330: typedef struct { ! 331: bool bI860Thread; ! 332: bool bMainDisplay; ! 333: int nMainDisplay; ! 334: NDBOARD board[ND_MAX_BOARDS]; ! 335: } CNF_ND; ! 336: ! 337: /* State of system is stored in this structure */ ! 338: /* On reset, variables are copied into system globals and used. */ ! 339: typedef struct ! 340: { ! 341: /* Configure */ ! 342: CNF_CONFIGDLG ConfigDialog; ! 343: CNF_LOG Log; ! 344: CNF_DEBUGGER Debugger; ! 345: CNF_SCREEN Screen; ! 346: CNF_KEYBOARD Keyboard; ! 347: CNF_SHORTCUT Shortcut; ! 348: CNF_MOUSE Mouse; ! 349: CNF_SOUND Sound; ! 350: CNF_MEMORY Memory; ! 351: CNF_BOOT Boot; ! 352: CNF_SCSI SCSI; ! 353: CNF_MO MO; ! 354: CNF_FLOPPY Floppy; ! 355: CNF_ENET Ethernet; ! 356: CNF_ROM Rom; ! 357: CNF_PRINTER Printer; ! 358: CNF_SYSTEM System; ! 359: CNF_ND Dimension; ! 360: } CNF_PARAMS; ! 361: ! 362: ! 363: extern CNF_PARAMS ConfigureParams; ! 364: extern char sConfigFileName[FILENAME_MAX]; ! 365: ! 366: void Configuration_SetDefault(void); ! 367: void Configuration_SetSystemDefaults(void); ! 368: void Configuration_Apply(bool bReset); ! 369: int Configuration_CheckMemory(int *banksize); ! 370: int Configuration_CheckDimensionMemory(int *banksize); ! 371: void Configuration_CheckDimensionSettings(void); ! 372: void Configuration_CheckEthernetSettings(void); ! 373: void Configuration_Load(const char *psFileName); ! 374: void Configuration_Save(void); ! 375: void Configuration_MemorySnapShot_Capture(bool bSave); ! 376: ! 377: #ifdef __cplusplus ! 378: } ! 379: #endif /* __cplusplus */ ! 380: ! 381: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.