--- hatari/src/includes/configuration.h 2019/04/01 07:10:55 1.1.1.3 +++ hatari/src/includes/configuration.h 2019/04/09 08:53:12 1.1.1.17 @@ -1,54 +1,66 @@ /* Hatari - configuration.h - This file is distributed under the GNU Public License, version 2 or at - your option any later version. Read the file gpl.txt for details. + This file is distributed under the GNU General Public License, version 2 + or at your option any later version. Read the file gpl.txt for details. */ #ifndef HATARI_CONFIGURATION_H #define HATARI_CONFIGURATION_H +/* Logging and tracing */ +typedef struct +{ + char sLogFileName[FILENAME_MAX]; + char sTraceFileName[FILENAME_MAX]; + int nTextLogLevel; + int nAlertDlgLogLevel; + bool bConfirmQuit; + bool bNatFeats; + bool bConsoleWindow; /* for now, used just for Windows */ +} CNF_LOG; + -/* TOS/GEM configuration */ +/* debugger */ typedef struct { - char szTOSImageFileName[MAX_FILENAME_LENGTH]; - BOOL bUseExtGEMResolutions; - int nGEMResolution; - int nGEMColours; -} CNF_TOSGEM; + int nNumberBase; + int nDisasmLines; + int nMemdumpLines; + int nDisasmOptions; + bool bDisasmUAE; +} CNF_DEBUGGER; -/* Sound configuration */ -typedef enum +/* ROM (TOS + cartridge) configuration */ +typedef struct { - PLAYBACK_LOW, - PLAYBACK_MEDIUM, - PLAYBACK_HIGH -} SOUND_QUALITIY; + char szTosImageFileName[FILENAME_MAX]; + bool bPatchTos; + char szCartridgeImageFileName[FILENAME_MAX]; +} CNF_ROM; + +/* Sound configuration */ typedef struct { - BOOL bEnableSound; - SOUND_QUALITIY nPlaybackQuality; - char szYMCaptureFileName[MAX_FILENAME_LENGTH]; + bool bEnableMicrophone; + bool bEnableSound; + bool bEnableSoundSync; + int nPlaybackFreq; + int SdlAudioBufferSize; + char szYMCaptureFileName[FILENAME_MAX]; + int YmVolumeMixing; } CNF_SOUND; -/* RS232 configuration - not yet used */ -/* -enum { - COM_PORT_1, - COM_PORT_2, - COM_PORT_3, - COM_PORT_4 -}; -*/ +/* RS232 configuration */ typedef struct { - BOOL bEnableRS232; - int nCOMPort; + bool bEnableRS232; + char szOutFileName[FILENAME_MAX]; + char szInFileName[FILENAME_MAX]; } CNF_RS232; @@ -62,151 +74,273 @@ typedef enum typedef struct { - BOOL bDisableKeyRepeat; + bool bDisableKeyRepeat; KEYMAPTYPE nKeymapType; - char szMappingFileName[MAX_FILENAME_LENGTH]; + char szMappingFileName[FILENAME_MAX]; } CNF_KEYBOARD; -/* Memory configuration */ -typedef enum +typedef enum { + SHORTCUT_OPTIONS, + SHORTCUT_FULLSCREEN, + SHORTCUT_MOUSEGRAB, + SHORTCUT_COLDRESET, + SHORTCUT_WARMRESET, + SHORTCUT_SCREENSHOT, + SHORTCUT_BOSSKEY, + SHORTCUT_CURSOREMU, + SHORTCUT_FASTFORWARD, + SHORTCUT_RECANIM, + SHORTCUT_RECSOUND, + SHORTCUT_SOUND, + SHORTCUT_DEBUG, + SHORTCUT_PAUSE, + SHORTCUT_QUIT, + SHORTCUT_LOADMEM, + SHORTCUT_SAVEMEM, + SHORTCUT_INSERTDISKA, + SHORTCUT_KEYS, /* number of shortcuts */ + SHORTCUT_NONE +} SHORTCUTKEYIDX; + +typedef struct { - MEMORY_SIZE_512Kb, - MEMORY_SIZE_1Mb, - MEMORY_SIZE_2Mb, - MEMORY_SIZE_4Mb -} MEMORY_SIZE; + int withModifier[SHORTCUT_KEYS]; + int withoutModifier[SHORTCUT_KEYS]; +} CNF_SHORTCUT; + typedef struct { - MEMORY_SIZE nMemorySize; - char szMemoryCaptureFileName[MAX_FILENAME_LENGTH]; + int nMemorySize; + bool bAutoSave; + char szMemoryCaptureFileName[FILENAME_MAX]; + char szAutoSaveFileName[FILENAME_MAX]; } CNF_MEMORY; /* Joystick configuration */ -typedef struct +typedef enum { - BOOL bCursorEmulation; - BOOL bEnableAutoFire; -} JOYSTICK; + JOYSTICK_DISABLED, + JOYSTICK_REALSTICK, + JOYSTICK_KEYBOARD +} JOYSTICKMODE; typedef struct { - JOYSTICK Joy[2]; -} CNF_JOYSTICKS; + JOYSTICKMODE nJoystickMode; + bool bEnableAutoFire; + bool bEnableJumpOnFire2; + int nJoyId; + int nKeyCodeUp, nKeyCodeDown, nKeyCodeLeft, nKeyCodeRight, nKeyCodeFire; +} JOYSTICK; +#define JOYSTICK_COUNT 6 -/* Discimage configuration */ typedef struct { - BOOL bAutoInsertDiscB; - char szDiscImageDirectory[MAX_FILENAME_LENGTH]; -} CNF_DISCIMAGE; + JOYSTICK Joy[JOYSTICK_COUNT]; +} CNF_JOYSTICKS; -/* Hard discs configuration */ -#define MAX_HARDDRIVES 1 -#define DRIVELIST_TO_DRIVE_INDEX(DriveList) (DriveList+1) +/* Disk image configuration */ typedef enum { - DRIVELIST_NONE, - DRIVELIST_C, - DRIVELIST_CD, - DRIVELIST_CDE, - DRIVELIST_CDEF -} DRIVELIST; + WRITEPROT_OFF, + WRITEPROT_ON, + WRITEPROT_AUTO +} WRITEPROTECTION; + +#define MAX_FLOPPYDRIVES 2 + +typedef struct +{ + bool bAutoInsertDiskB; + bool FastFloppy; /* true to speed up FDC emulation */ + WRITEPROTECTION nWriteProtection; + char szDiskZipPath[MAX_FLOPPYDRIVES][FILENAME_MAX]; + char szDiskFileName[MAX_FLOPPYDRIVES][FILENAME_MAX]; + char szDiskImageDirectory[FILENAME_MAX]; +} CNF_DISKIMAGE; + + +/* Hard drives configuration: C: - Z: */ +#define MAX_HARDDRIVES 24 +#define DRIVE_C 0 typedef enum { - DRIVE_C, - DRIVE_D, - DRIVE_E, - DRIVE_F -} DRIVELETTER; + GEMDOS_NOP, + GEMDOS_UPPER, + GEMDOS_LOWER +} GEMDOS_CHR_CONV; typedef struct { - int nDriveList; - BOOL bBootFromHardDisc; - int nHardDiscDir; - BOOL bUseHardDiscDirectories; - BOOL bUseHardDiscImage; - char szHardDiscDirectories[MAX_HARDDRIVES][MAX_FILENAME_LENGTH]; - char szHardDiscImage[MAX_FILENAME_LENGTH]; -} CNF_HARDDISC; + int nHardDiskDir; + bool bUseHardDiskDirectories; + bool bUseHardDiskImage; + bool bUseIdeMasterHardDiskImage; + bool bUseIdeSlaveHardDiskImage; + WRITEPROTECTION nWriteProtection; + GEMDOS_CHR_CONV nGemdosCase; + bool bBootFromHardDisk; + char szHardDiskDirectories[MAX_HARDDRIVES][FILENAME_MAX]; + char szHardDiskImage[FILENAME_MAX]; + char szIdeMasterHardDiskImage[FILENAME_MAX]; + char szIdeSlaveHardDiskImage[FILENAME_MAX]; +} CNF_HARDDISK; + +/* Falcon register $FFFF8006 bits 6 & 7 (mirrored in $FFFF82C0 bits 0 & 1): + * 00 Monochrome + * 01 RGB - Colormonitor + * 10 VGA - Colormonitor + * 11 TV + */ +#define FALCON_MONITOR_MONO 0x00 /* SM124 */ +#define FALCON_MONITOR_RGB 0x40 +#define FALCON_MONITOR_VGA 0x80 +#define FALCON_MONITOR_TV 0xC0 +typedef enum +{ + MONITOR_TYPE_MONO, + MONITOR_TYPE_RGB, + MONITOR_TYPE_VGA, + MONITOR_TYPE_TV +} MONITORTYPE; /* Screen configuration */ typedef struct { - BOOL bFullScreen; - BOOL bDoubleSizeWindow; - BOOL bAllowOverscan; - BOOL bInterlacedScreen; - BOOL bSyncToRetrace; - BOOL bFrameSkip; - int ChosenDisplayMode; - BOOL bCaptureChange; - int nFramesPerSecond; - BOOL bUseHighRes; + MONITORTYPE nMonitorType; + int nFrameSkips; + bool bFullScreen; + bool bKeepResolution; + bool bKeepResolutionST; + bool bAllowOverscan; + bool bAspectCorrect; + bool bUseExtVdiResolutions; + int nSpec512Threshold; + int nForceBpp; + int nVdiColors; + int nVdiWidth; + int nVdiHeight; + bool bShowStatusbar; + bool bShowDriveLed; + bool bCrop; + bool bForceMax; + int nMaxWidth; + int nMaxHeight; } CNF_SCREEN; /* Printer configuration */ typedef struct { - BOOL bEnablePrinting; - BOOL bPrintToFile; - char szPrintToFileName[MAX_FILENAME_LENGTH]; + bool bEnablePrinting; + char szPrintToFileName[FILENAME_MAX]; } CNF_PRINTER; +/* Midi configuration */ +typedef struct +{ + bool bEnableMidi; + char sMidiInFileName[FILENAME_MAX]; + char sMidiOutFileName[FILENAME_MAX]; +} CNF_MIDI; + + /* Dialog System */ typedef enum { - MINMAXSPEED_MIN, - MINMAXSPEED_1, - MINMAXSPEED_2, - MINMAXSPEED_3, - MINMAXSPEED_MAX -} MINMAXSPEED_TYPE; + MACHINE_ST, + MACHINE_STE, + MACHINE_TT, + MACHINE_FALCON, + MACHINE_MEGA_STE +} MACHINETYPE; + +typedef enum +{ + DSP_TYPE_NONE, + DSP_TYPE_DUMMY, + DSP_TYPE_EMU +} DSPTYPE; + +#if ENABLE_WINUAE_CPU +typedef enum +{ + FPU_NONE = 0, + FPU_68881 = 68881, + FPU_68882 = 68882, + FPU_CPU = 68040 +} FPUTYPE; +#endif typedef struct { int nCpuLevel; - BOOL bCompatibleCpu; - BOOL bAddressSpace24; - BOOL bBlitter; /* TRUE if blitter is enabled */ - MINMAXSPEED_TYPE nMinMaxSpeed; + int nCpuFreq; + bool bCompatibleCpu; /* Prefetch mode */ + MACHINETYPE nMachineType; + bool bBlitter; /* TRUE if Blitter is enabled */ + DSPTYPE nDSPType; /* how to "emulate" DSP */ + bool bRealTimeClock; + bool bPatchTimerD; + bool bFastBoot; /* Enable to patch TOS for fast boot */ + bool bFastForward; + +#if ENABLE_WINUAE_CPU + bool bAddressSpace24; + bool bCycleExactCpu; + FPUTYPE n_FPUType; + bool bCompatibleFPU; /* More compatible FPU */ + bool bMMU; /* TRUE if MMU is enabled */ +#endif } CNF_SYSTEM; +typedef struct +{ + int AviRecordVcodec; + int AviRecordFps; + char AviRecordFile[FILENAME_MAX]; +} CNF_VIDEO; /* State of system is stored in this structure */ /* On reset, variables are copied into system globals and used. */ typedef struct { /* Configure */ + CNF_LOG Log; + CNF_DEBUGGER Debugger; CNF_SCREEN Screen; CNF_JOYSTICKS Joysticks; CNF_KEYBOARD Keyboard; + CNF_SHORTCUT Shortcut; CNF_SOUND Sound; CNF_MEMORY Memory; - CNF_DISCIMAGE DiscImage; - CNF_HARDDISC HardDisc; - CNF_TOSGEM TOSGEM; + CNF_DISKIMAGE DiskImage; + CNF_HARDDISK HardDisk; + CNF_ROM Rom; CNF_RS232 RS232; CNF_PRINTER Printer; + CNF_MIDI Midi; CNF_SYSTEM System; + CNF_VIDEO Video; } CNF_PARAMS; -extern BOOL bFirstTimeInstall; extern CNF_PARAMS ConfigureParams; +extern char sConfigFileName[FILENAME_MAX]; extern void Configuration_SetDefault(void); -extern void Configuration_Load(void); +extern void Configuration_Apply(bool bReset); +extern void Configuration_Load(const char *psFileName); extern void Configuration_Save(void); +extern void Configuration_MemorySnapShot_Capture(bool bSave); #endif