--- previous/src/configuration.c 2018/04/24 19:27:32 1.1.1.3 +++ previous/src/configuration.c 2018/04/24 19:29:49 1.1.1.4 @@ -11,7 +11,7 @@ */ const char Configuration_fileid[] = "Hatari configuration.c : " __DATE__ " " __TIME__; -#include +#include #include "main.h" #include "configuration.h" @@ -85,11 +85,23 @@ static const struct Config_Tag configs_S static const struct Config_Tag configs_Keyboard[] = { { "bDisableKeyRepeat", Bool_Tag, &ConfigureParams.Keyboard.bDisableKeyRepeat }, + { "bSwapCmdAlt", Bool_Tag, &ConfigureParams.Keyboard.bSwapCmdAlt }, { "nKeymapType", Int_Tag, &ConfigureParams.Keyboard.nKeymapType }, { "szMappingFileName", String_Tag, ConfigureParams.Keyboard.szMappingFileName }, { NULL , Error_Tag, NULL } }; +/* Used to load/save mouse options */ +static const struct Config_Tag configs_Mouse[] = +{ + { "bEnableAutoGrab", Bool_Tag, &ConfigureParams.Mouse.bEnableAutoGrab }, + { "fLinSpeedNormal", Float_Tag, &ConfigureParams.Mouse.fLinSpeedNormal }, + { "fLinSpeedLocked", Float_Tag, &ConfigureParams.Mouse.fLinSpeedLocked }, + { "fExpSpeedNormal", Float_Tag, &ConfigureParams.Mouse.fExpSpeedNormal }, + { "fExpSpeedLocked", Float_Tag, &ConfigureParams.Mouse.fExpSpeedLocked }, + { NULL , Error_Tag, NULL } +}; + /* Used to load/save shortcut key bindings with modifiers options */ static const struct Config_Tag configs_ShortCutWithMod[] = { @@ -110,7 +122,7 @@ static const struct Config_Tag configs_S { "keyQuit", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_QUIT] }, { "keyLoadMem", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_LOADMEM] }, { "keySaveMem", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_SAVEMEM] }, - { "keyInsertDiskA",Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_INSERTDISKA] }, + { "keyDimension", Int_Tag, &ConfigureParams.Shortcut.withModifier[SHORTCUT_DIMENSION] }, { NULL , Error_Tag, NULL } }; @@ -134,7 +146,7 @@ static const struct Config_Tag configs_S { "keyQuit", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_QUIT] }, { "keyLoadMem", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_LOADMEM] }, { "keySaveMem", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_SAVEMEM] }, - { "keyInsertDiskA",Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_INSERTDISKA] }, + { "keyDimension", Int_Tag, &ConfigureParams.Shortcut.withoutModifier[SHORTCUT_DIMENSION] }, { NULL , Error_Tag, NULL } }; @@ -144,10 +156,6 @@ static const struct Config_Tag configs_S { { "bEnableMicrophone", Bool_Tag, &ConfigureParams.Sound.bEnableMicrophone }, { "bEnableSound", Bool_Tag, &ConfigureParams.Sound.bEnableSound }, - { "nPlaybackFreq", Int_Tag, &ConfigureParams.Sound.nPlaybackFreq }, - { "nSdlAudioBufferSize", Int_Tag, &ConfigureParams.Sound.SdlAudioBufferSize }, - { "szYMCaptureFileName", String_Tag, ConfigureParams.Sound.szYMCaptureFileName }, -// { "YmVolumeMixing", Int_Tag, &ConfigureParams.Sound.YmVolumeMixing }, { NULL , Error_Tag, NULL } }; @@ -165,21 +173,6 @@ static const struct Config_Tag configs_M { NULL , Error_Tag, NULL } }; - -/* Used to load/save floppy options */ -static const struct Config_Tag configs_Floppy[] = -{ - { "bAutoInsertDiskB", Bool_Tag, &ConfigureParams.DiskImage.bAutoInsertDiskB }, - { "bSlowFloppy", Bool_Tag, &ConfigureParams.DiskImage.bSlowFloppy }, - { "nWriteProtection", Int_Tag, &ConfigureParams.DiskImage.nWriteProtection }, - { "szDiskAZipPath", String_Tag, ConfigureParams.DiskImage.szDiskZipPath[0] }, - { "szDiskAFileName", String_Tag, ConfigureParams.DiskImage.szDiskFileName[0] }, - { "szDiskBZipPath", String_Tag, ConfigureParams.DiskImage.szDiskZipPath[1] }, - { "szDiskBFileName", String_Tag, ConfigureParams.DiskImage.szDiskFileName[1] }, - { "szDiskImageDirectory", String_Tag, ConfigureParams.DiskImage.szDiskImageDirectory }, - { NULL , Error_Tag, NULL } -}; - /* Used to load/save boot options */ static const struct Config_Tag configs_Boot[] = { @@ -198,38 +191,83 @@ static const struct Config_Tag configs_B static const struct Config_Tag configs_SCSI[] = { { "szImageName0", String_Tag, ConfigureParams.SCSI.target[0].szImageName }, - { "bAttached0", Bool_Tag, &ConfigureParams.SCSI.target[0].bAttached }, - { "bCDROM0", Bool_Tag, &ConfigureParams.SCSI.target[0].bCDROM }, + { "nDeviceType0", Int_Tag, &ConfigureParams.SCSI.target[0].nDeviceType }, + { "bDiskInserted0", Bool_Tag, &ConfigureParams.SCSI.target[0].bDiskInserted }, + { "bWriteProtected0", Bool_Tag, &ConfigureParams.SCSI.target[0].bWriteProtected }, { "szImageName1", String_Tag, ConfigureParams.SCSI.target[1].szImageName }, - { "bAttached1", Bool_Tag, &ConfigureParams.SCSI.target[1].bAttached }, - { "bCDROM1", Bool_Tag, &ConfigureParams.SCSI.target[1].bCDROM }, + { "nDeviceType1", Int_Tag, &ConfigureParams.SCSI.target[1].nDeviceType }, + { "bDiskInserted1", Bool_Tag, &ConfigureParams.SCSI.target[1].bDiskInserted }, + { "bWriteProtected1", Bool_Tag, &ConfigureParams.SCSI.target[1].bWriteProtected }, { "szImageName2", String_Tag, ConfigureParams.SCSI.target[2].szImageName }, - { "bAttached2", Bool_Tag, &ConfigureParams.SCSI.target[2].bAttached }, - { "bCDROM2", Bool_Tag, &ConfigureParams.SCSI.target[2].bCDROM }, + { "nDeviceType2", Int_Tag, &ConfigureParams.SCSI.target[2].nDeviceType }, + { "bDiskInserted2", Bool_Tag, &ConfigureParams.SCSI.target[2].bDiskInserted }, + { "bWriteProtected2", Bool_Tag, &ConfigureParams.SCSI.target[2].bWriteProtected }, { "szImageName3", String_Tag, ConfigureParams.SCSI.target[3].szImageName }, - { "bAttached3", Bool_Tag, &ConfigureParams.SCSI.target[3].bAttached }, - { "bCDROM3", Bool_Tag, &ConfigureParams.SCSI.target[3].bCDROM }, + { "nDeviceType3", Int_Tag, &ConfigureParams.SCSI.target[3].nDeviceType }, + { "bDiskInserted3", Bool_Tag, &ConfigureParams.SCSI.target[3].bDiskInserted }, + { "bWriteProtected3", Bool_Tag, &ConfigureParams.SCSI.target[3].bWriteProtected }, { "szImageName4", String_Tag, ConfigureParams.SCSI.target[4].szImageName }, - { "bAttached4", Bool_Tag, &ConfigureParams.SCSI.target[4].bAttached }, - { "bCDROM4", Bool_Tag, &ConfigureParams.SCSI.target[4].bCDROM }, + { "nDeviceType4", Int_Tag, &ConfigureParams.SCSI.target[4].nDeviceType }, + { "bDiskInserted4", Bool_Tag, &ConfigureParams.SCSI.target[4].bDiskInserted }, + { "bWriteProtected4", Bool_Tag, &ConfigureParams.SCSI.target[4].bWriteProtected }, { "szImageName5", String_Tag, ConfigureParams.SCSI.target[5].szImageName }, - { "bAttached5", Bool_Tag, &ConfigureParams.SCSI.target[5].bAttached }, - { "bCDROM5", Bool_Tag, &ConfigureParams.SCSI.target[5].bCDROM }, + { "nDeviceType5", Int_Tag, &ConfigureParams.SCSI.target[5].nDeviceType }, + { "bDiskInserted5", Bool_Tag, &ConfigureParams.SCSI.target[5].bDiskInserted }, + { "bWriteProtected5", Bool_Tag, &ConfigureParams.SCSI.target[5].bWriteProtected }, { "szImageName6", String_Tag, ConfigureParams.SCSI.target[6].szImageName }, - { "bAttached6", Bool_Tag, &ConfigureParams.SCSI.target[6].bAttached }, - { "bCDROM6", Bool_Tag, &ConfigureParams.SCSI.target[6].bCDROM }, + { "nDeviceType6", Int_Tag, &ConfigureParams.SCSI.target[6].nDeviceType }, + { "bDiskInserted6", Bool_Tag, &ConfigureParams.SCSI.target[6].bDiskInserted }, + { "bWriteProtected6", Bool_Tag, &ConfigureParams.SCSI.target[6].bWriteProtected }, + + { NULL , Error_Tag, NULL } +}; + +/* Used to load/save MO options */ +static const struct Config_Tag configs_MO[] = +{ + { "szImageName0", String_Tag, ConfigureParams.MO.drive[0].szImageName }, + { "bDriveConnected0", Bool_Tag, &ConfigureParams.MO.drive[0].bDriveConnected }, + { "bDiskInserted0", Bool_Tag, &ConfigureParams.MO.drive[0].bDiskInserted }, + { "bWriteProtected0", Bool_Tag, &ConfigureParams.MO.drive[0].bWriteProtected }, + + { "szImageName1", String_Tag, ConfigureParams.MO.drive[1].szImageName }, + { "bDriveConnected1", Bool_Tag, &ConfigureParams.MO.drive[1].bDriveConnected }, + { "bDiskInserted1", Bool_Tag, &ConfigureParams.MO.drive[1].bDiskInserted }, + { "bWriteProtected1", Bool_Tag, &ConfigureParams.MO.drive[1].bWriteProtected }, - { "bBootFromHardDisk", Bool_Tag, &ConfigureParams.SCSI.bBootFromHardDisk }, - { "nWriteProtection", Int_Tag, &ConfigureParams.SCSI.nWriteProtection }, { NULL , Error_Tag, NULL } }; +/* Used to load/save floppy options */ +static const struct Config_Tag configs_Floppy[] = +{ + { "szImageName0", String_Tag, ConfigureParams.Floppy.drive[0].szImageName }, + { "bDriveConnected0", Bool_Tag, &ConfigureParams.Floppy.drive[0].bDriveConnected }, + { "bDiskInserted0", Bool_Tag, &ConfigureParams.Floppy.drive[0].bDiskInserted }, + { "bWriteProtected0", Bool_Tag, &ConfigureParams.Floppy.drive[0].bWriteProtected }, + + { "szImageName1", String_Tag, ConfigureParams.Floppy.drive[1].szImageName }, + { "bDriveConnected1", Bool_Tag, &ConfigureParams.Floppy.drive[1].bDriveConnected }, + { "bDiskInserted1", Bool_Tag, &ConfigureParams.Floppy.drive[1].bDiskInserted }, + { "bWriteProtected1", Bool_Tag, &ConfigureParams.Floppy.drive[1].bWriteProtected }, + + { NULL , Error_Tag, NULL } +}; + +/* Used to load/save Ethernet options */ +static const struct Config_Tag configs_Ethernet[] = +{ + { "bEthernetConnected", Bool_Tag, &ConfigureParams.Ethernet.bEthernetConnected }, + + { NULL , Error_Tag, NULL } +}; + /* Used to load/save ROM options */ static const struct Config_Tag configs_Rom[] = { @@ -251,8 +289,8 @@ static const struct Config_Tag configs_R /* Used to load/save printer options */ static const struct Config_Tag configs_Printer[] = { - { "bEnablePrinting", Bool_Tag, &ConfigureParams.Printer.bEnablePrinting }, - { "bPrintToFile", Bool_Tag, &ConfigureParams.Printer.bPrintToFile }, + { "bPrinterConnected", Bool_Tag, &ConfigureParams.Printer.bPrinterConnected }, + { "nPaperSize", Int_Tag, &ConfigureParams.Printer.nPaperSize }, { "szPrintToFileName", String_Tag, ConfigureParams.Printer.szPrintToFileName }, { NULL , Error_Tag, NULL } }; @@ -272,7 +310,7 @@ static const struct Config_Tag configs_S { "nMachineType", Int_Tag, &ConfigureParams.System.nMachineType }, { "bColor", Bool_Tag, &ConfigureParams.System.bColor }, { "bTurbo", Bool_Tag, &ConfigureParams.System.bTurbo }, - { "bADB", Bool_Tag, &ConfigureParams.System.bADB }, + { "bNBIC", Bool_Tag, &ConfigureParams.System.bNBIC }, { "nSCSI", Bool_Tag, &ConfigureParams.System.nSCSI }, { "nRTC", Bool_Tag, &ConfigureParams.System.nRTC }, @@ -281,19 +319,30 @@ static const struct Config_Tag configs_S { "bCompatibleCpu", Bool_Tag, &ConfigureParams.System.bCompatibleCpu }, { "bBlitter", Bool_Tag, &ConfigureParams.System.bBlitter }, { "nDSPType", Int_Tag, &ConfigureParams.System.nDSPType }, + { "bDSPMemoryExpansion", Bool_Tag, &ConfigureParams.System.bDSPMemoryExpansion }, { "bRealTimeClock", Bool_Tag, &ConfigureParams.System.bRealTimeClock }, { "bPatchTimerD", Bool_Tag, &ConfigureParams.System.bPatchTimerD }, { "bFastForward", Bool_Tag, &ConfigureParams.System.bFastForward }, -#if ENABLE_WINUAE_CPU { "bAddressSpace24", Bool_Tag, &ConfigureParams.System.bAddressSpace24 }, { "bCycleExactCpu", Bool_Tag, &ConfigureParams.System.bCycleExactCpu }, { "n_FPUType", Int_Tag, &ConfigureParams.System.n_FPUType }, { "bCompatibleFPU", Bool_Tag, &ConfigureParams.System.bCompatibleFPU }, { "bMMU", Bool_Tag, &ConfigureParams.System.bMMU }, -#endif { NULL , Error_Tag, NULL } - }; +}; + +/* Used to load/save nextdimension options */ +static const struct Config_Tag configs_Dimension[] = +{ + { "bEnabled", Bool_Tag, &ConfigureParams.Dimension.bEnabled }, + { "nMemoryBankSize0", Int_Tag, &ConfigureParams.Dimension.nMemoryBankSize[0] }, + { "nMemoryBankSize1", Int_Tag, &ConfigureParams.Dimension.nMemoryBankSize[1] }, + { "nMemoryBankSize2", Int_Tag, &ConfigureParams.Dimension.nMemoryBankSize[2] }, + { "nMemoryBankSize3", Int_Tag, &ConfigureParams.Dimension.nMemoryBankSize[3] }, + { "szRomFileName", String_Tag, ConfigureParams.Dimension.szRomFileName }, + { NULL , Error_Tag, NULL } +}; /* Used to load/save video options */ static const struct Config_Tag configs_Video[] = @@ -337,18 +386,6 @@ void Configuration_SetDefault(void) ConfigureParams.Debugger.nDisasmLines = 8; ConfigureParams.Debugger.nMemdumpLines = 8; - /* Set defaults for floppy disk images */ - ConfigureParams.DiskImage.bAutoInsertDiskB = true; - ConfigureParams.DiskImage.bSlowFloppy = false; - ConfigureParams.DiskImage.nWriteProtection = WRITEPROT_OFF; - for (i = 0; i < 2; i++) - { - ConfigureParams.DiskImage.szDiskZipPath[i][0] = '\0'; - ConfigureParams.DiskImage.szDiskFileName[i][0] = '\0'; - } - strcpy(ConfigureParams.DiskImage.szDiskImageDirectory, psWorkingDir); - File_AddSlashToEndFileName(ConfigureParams.DiskImage.szDiskImageDirectory); - /* Set defaults for Boot options */ ConfigureParams.Boot.nBootDevice = BOOT_ROM; ConfigureParams.Boot.bEnableDRAMTest = false; @@ -360,18 +397,45 @@ void Configuration_SetDefault(void) ConfigureParams.Boot.bExtendedPot = false; /* Set defaults for SCSI disks */ - int target; - for (target = 0; target < ESP_MAX_DEVS; target++) { - strcpy(ConfigureParams.SCSI.target[target].szImageName, psWorkingDir); - ConfigureParams.SCSI.target[target].bAttached = false; - ConfigureParams.SCSI.target[target].bCDROM = false; + for (i = 0; i < ESP_MAX_DEVS; i++) { + strcpy(ConfigureParams.SCSI.target[i].szImageName, psWorkingDir); + ConfigureParams.SCSI.target[i].nDeviceType = DEVTYPE_NONE; + ConfigureParams.SCSI.target[i].bDiskInserted = false; + ConfigureParams.SCSI.target[i].bWriteProtected = false; } + /* Set defaults for MO drives */ + for (i = 0; i < MO_MAX_DRIVES; i++) { + strcpy(ConfigureParams.MO.drive[i].szImageName, psWorkingDir); + ConfigureParams.MO.drive[i].bDriveConnected = false; + ConfigureParams.MO.drive[i].bDiskInserted = false; + ConfigureParams.MO.drive[i].bWriteProtected = false; + } + + /* Set defaults for floppy drives */ + for (i = 0; i < FLP_MAX_DRIVES; i++) { + strcpy(ConfigureParams.Floppy.drive[i].szImageName, psWorkingDir); + ConfigureParams.Floppy.drive[i].bDriveConnected = false; + ConfigureParams.Floppy.drive[i].bDiskInserted = false; + ConfigureParams.Floppy.drive[i].bWriteProtected = false; + } + + /* Set defaults for Ethernet */ + ConfigureParams.Ethernet.bEthernetConnected = false; + /* Set defaults for Keyboard */ ConfigureParams.Keyboard.bDisableKeyRepeat = false; - ConfigureParams.Keyboard.nKeymapType = KEYMAP_SYMBOLIC; + ConfigureParams.Keyboard.bSwapCmdAlt = false; + ConfigureParams.Keyboard.nKeymapType = KEYMAP_SCANCODE; strcpy(ConfigureParams.Keyboard.szMappingFileName, ""); - + + /* Set defaults for Mouse */ + ConfigureParams.Mouse.fLinSpeedNormal = 1.0; + ConfigureParams.Mouse.fLinSpeedLocked = 1.0; + ConfigureParams.Mouse.fExpSpeedNormal = 1.0; + ConfigureParams.Mouse.fExpSpeedLocked = 1.0; + ConfigureParams.Mouse.bEnableAutoGrab = true; + /* Set defaults for Shortcuts */ ConfigureParams.Shortcut.withoutModifier[SHORTCUT_OPTIONS] = SDLK_F12; ConfigureParams.Shortcut.withoutModifier[SHORTCUT_FULLSCREEN] = SDLK_F11; @@ -394,7 +458,7 @@ void Configuration_SetDefault(void) ConfigureParams.Shortcut.withModifier[SHORTCUT_QUIT] = SDLK_q; ConfigureParams.Shortcut.withModifier[SHORTCUT_LOADMEM] = SDLK_l; ConfigureParams.Shortcut.withModifier[SHORTCUT_SAVEMEM] = SDLK_k; - ConfigureParams.Shortcut.withModifier[SHORTCUT_INSERTDISKA] = SDLK_1; + ConfigureParams.Shortcut.withModifier[SHORTCUT_DIMENSION] = SDLK_n; /* Set defaults for Memory */ memset(ConfigureParams.Memory.nMemoryBankSize, 16, @@ -407,9 +471,9 @@ void Configuration_SetDefault(void) psHomeDir, PATHSEP); /* Set defaults for Printer */ - ConfigureParams.Printer.bEnablePrinting = false; - ConfigureParams.Printer.bPrintToFile = true; - sprintf(ConfigureParams.Printer.szPrintToFileName, "%s%chatari.prn", + ConfigureParams.Printer.bPrinterConnected = false; + ConfigureParams.Printer.nPaperSize = PAPER_A4; + sprintf(ConfigureParams.Printer.szPrintToFileName, "%s%c", psHomeDir, PATHSEP); /* Set defaults for RS232 */ @@ -430,7 +494,7 @@ void Configuration_SetDefault(void) ConfigureParams.Screen.nSpec512Threshold = 16; ConfigureParams.Screen.nForceBpp = 0; ConfigureParams.Screen.bAspectCorrect = true; - ConfigureParams.Screen.nMonitorType = MONITOR_TYPE_RGB; + ConfigureParams.Screen.nMonitorType = MONITOR_TYPE_CPU; ConfigureParams.Screen.bUseExtVdiResolutions = false; ConfigureParams.Screen.bShowStatusbar = true; ConfigureParams.Screen.bShowDriveLed = true; @@ -442,11 +506,6 @@ void Configuration_SetDefault(void) /* Set defaults for Sound */ ConfigureParams.Sound.bEnableMicrophone = true; ConfigureParams.Sound.bEnableSound = true; - ConfigureParams.Sound.nPlaybackFreq = 44100; - sprintf(ConfigureParams.Sound.szYMCaptureFileName, "%s%chatari.wav", - psWorkingDir, PATHSEP); - ConfigureParams.Sound.SdlAudioBufferSize = 0; -// ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING; /* Set defaults for Rom */ sprintf(ConfigureParams.Rom.szRom030FileName, "%s%cRev_1.0_v41.BIN", @@ -461,7 +520,7 @@ void Configuration_SetDefault(void) ConfigureParams.System.nMachineType = NEXT_CUBE030; ConfigureParams.System.bColor = false; ConfigureParams.System.bTurbo = false; - ConfigureParams.System.bADB = false; + ConfigureParams.System.bNBIC = true; ConfigureParams.System.nSCSI = NCR53C90; ConfigureParams.System.nRTC = MC68HC68T1; @@ -469,18 +528,26 @@ void Configuration_SetDefault(void) ConfigureParams.System.nCpuFreq = 25; ConfigureParams.System.bCompatibleCpu = true; ConfigureParams.System.bBlitter = false; - ConfigureParams.System.nDSPType = DSP_TYPE_NONE; + ConfigureParams.System.nDSPType = DSP_TYPE_EMU; + ConfigureParams.System.bDSPMemoryExpansion = false; ConfigureParams.System.bPatchTimerD = true; ConfigureParams.System.bRealTimeClock = true; ConfigureParams.System.bFastForward = false; -#if ENABLE_WINUAE_CPU ConfigureParams.System.bAddressSpace24 = false; ConfigureParams.System.bCycleExactCpu = false; ConfigureParams.System.n_FPUType = FPU_68882; ConfigureParams.System.bCompatibleFPU = true; ConfigureParams.System.bMMU = true; -#endif + + /* Set defaults for Dimension */ + ConfigureParams.Dimension.bEnabled = false; + ConfigureParams.Dimension.nMemoryBankSize[0] = 4; + ConfigureParams.Dimension.nMemoryBankSize[1] = 4; + ConfigureParams.Dimension.nMemoryBankSize[2] = 4; + ConfigureParams.Dimension.nMemoryBankSize[3] = 4; + sprintf(ConfigureParams.Dimension.szRomFileName, "%s%cdimension_eeprom.bin", + Paths_GetWorkingDir(), PATHSEP); /* Set defaults for Video */ #if HAVE_LIBPNG @@ -509,6 +576,20 @@ void Configuration_SetDefault(void) /*-----------------------------------------------------------------------*/ /** + * Helper function for Configuration_Apply, check mouse speed settings + * to be in the valid range between minimum and maximum value. + */ +void Configuration_CheckFloatMinMax(float *val, float min, float max) +{ + if (*valmax) + *val=max; +} + + +/*-----------------------------------------------------------------------*/ +/** * Copy details from configuration structure into global variables for system, * clean file names, etc... Called from main.c and dialog.c files. */ @@ -518,56 +599,48 @@ void Configuration_Apply(bool bReset) { /* Set resolution change */ } -// if (ConfigureParams.Screen.nFrameSkips < AUTO_FRAMESKIP_LIMIT) -// { -// nFrameSkips = ConfigureParams.Screen.nFrameSkips; -// } /* Init clocks for this machine */ ClocksTimings_InitMachine ( ConfigureParams.System.nMachineType ); - - /* Sound settings */ - /* SDL sound buffer in ms */ -// SdlAudioBufferSize = ConfigureParams.Sound.SdlAudioBufferSize; -// if ( SdlAudioBufferSize == 0 ) /* use default setting for SDL */ -// ; -// else if ( SdlAudioBufferSize < 10 ) /* min of 10 ms */ -// SdlAudioBufferSize = 10; -// else if ( SdlAudioBufferSize > 100 ) /* max of 100 ms */ -// SdlAudioBufferSize = 100; - - /* Set playback frequency */ -// Audio_SetOutputAudioFreq(ConfigureParams.Sound.nPlaybackFreq); - - /* YM Mixing */ -// if ( ( ConfigureParams.Sound.YmVolumeMixing != YM_LINEAR_MIXING ) -// && ( ConfigureParams.Sound.YmVolumeMixing != YM_TABLE_MIXING ) ) -// ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING; - -// YmVolumeMixing = ConfigureParams.Sound.YmVolumeMixing; -// Sound_SetYmVolumeMixing(); + /* Mouse settings */ + Configuration_CheckFloatMinMax(&ConfigureParams.Mouse.fLinSpeedNormal,MOUSE_LIN_MIN,MOUSE_LIN_MAX); + Configuration_CheckFloatMinMax(&ConfigureParams.Mouse.fLinSpeedLocked,MOUSE_LIN_MIN,MOUSE_LIN_MAX); + Configuration_CheckFloatMinMax(&ConfigureParams.Mouse.fExpSpeedNormal,MOUSE_EXP_MIN,MOUSE_EXP_MAX); + Configuration_CheckFloatMinMax(&ConfigureParams.Mouse.fExpSpeedLocked,MOUSE_EXP_MIN,MOUSE_EXP_MAX); /* Check/constrain CPU settings and change corresponding - * UAE cpu_level & cpu_compatible variables - */ + * UAE cpu_level & cpu_compatible variables */ M68000_CheckCpuSettings(); /* Check memory size for each bank and change to supported values */ Configuration_CheckMemory(ConfigureParams.Memory.nMemoryBankSize); - + + /* Check nextdimension memory size and screen options */ + Configuration_CheckDimensionMemory(ConfigureParams.Dimension.nMemoryBankSize); + Configuration_CheckDimensionSettings(); + /* Clean file and directory names */ File_MakeAbsoluteName(ConfigureParams.Rom.szRom030FileName); File_MakeAbsoluteName(ConfigureParams.Rom.szRom040FileName); File_MakeAbsoluteName(ConfigureParams.Rom.szRomTurboFileName); + File_MakeAbsoluteName(ConfigureParams.Dimension.szRomFileName); + File_MakeAbsoluteName(ConfigureParams.Printer.szPrintToFileName); + + int i; + for (i = 0; i < ESP_MAX_DEVS; i++) { + File_MakeAbsoluteName(ConfigureParams.SCSI.target[i].szImageName); + } - int target; - for (target = 0; target < ESP_MAX_DEVS; target++) { - File_MakeAbsoluteName(ConfigureParams.SCSI.target[target].szImageName); + for (i = 0; i < MO_MAX_DRIVES; i++) { + File_MakeAbsoluteName(ConfigureParams.MO.drive[i].szImageName); + } + + for (i = 0; i < FLP_MAX_DRIVES; i++) { + File_MakeAbsoluteName(ConfigureParams.Floppy.drive[i].szImageName); } File_MakeAbsoluteName(ConfigureParams.Memory.szMemoryCaptureFileName); - File_MakeAbsoluteName(ConfigureParams.Sound.szYMCaptureFileName); if (strlen(ConfigureParams.Keyboard.szMappingFileName) > 0) File_MakeAbsoluteName(ConfigureParams.Keyboard.szMappingFileName); File_MakeAbsoluteName(ConfigureParams.Video.AviRecordFile); @@ -579,7 +652,83 @@ void Configuration_Apply(bool bReset) File_MakeAbsoluteSpecialName(ConfigureParams.RS232.szOutFileName); File_MakeAbsoluteSpecialName(ConfigureParams.Midi.sMidiInFileName); File_MakeAbsoluteSpecialName(ConfigureParams.Midi.sMidiOutFileName); - File_MakeAbsoluteSpecialName(ConfigureParams.Printer.szPrintToFileName); +} + + +/*-----------------------------------------------------------------------*/ +/** + * Set defaults depending on selected machine type. + */ +void Configuration_SetSystemDefaults(void) { + switch (ConfigureParams.System.nMachineType) { + case NEXT_CUBE030: + ConfigureParams.System.bTurbo = false; + ConfigureParams.System.bColor = false; + ConfigureParams.System.nCpuLevel = 3; + ConfigureParams.System.nCpuFreq = 25; + ConfigureParams.System.n_FPUType = FPU_68882; + ConfigureParams.System.nDSPType = DSP_TYPE_EMU; + ConfigureParams.System.bDSPMemoryExpansion = false; + ConfigureParams.System.nSCSI = NCR53C90; + ConfigureParams.System.nRTC = MC68HC68T1; + ConfigureParams.System.bNBIC = true; + break; + + case NEXT_CUBE040: + ConfigureParams.System.bColor = false; + ConfigureParams.System.nCpuLevel = 4; + if (ConfigureParams.System.bTurbo) { + ConfigureParams.System.nCpuFreq = 33; + ConfigureParams.System.nRTC = MCCS1850; + } else { + ConfigureParams.System.nCpuFreq = 25; + ConfigureParams.System.nRTC = MC68HC68T1; + } + ConfigureParams.System.n_FPUType = FPU_CPU; + ConfigureParams.System.nDSPType = DSP_TYPE_EMU; + ConfigureParams.System.bDSPMemoryExpansion = true; + ConfigureParams.System.nSCSI = NCR53C90A; + ConfigureParams.System.bNBIC = true; + break; + + case NEXT_STATION: + ConfigureParams.System.nCpuLevel = 4; + if (ConfigureParams.System.bTurbo) { + ConfigureParams.System.nCpuFreq = 33; + ConfigureParams.System.nRTC = MCCS1850; + } else if (ConfigureParams.System.bColor) { + ConfigureParams.System.nCpuFreq = 25; + ConfigureParams.System.nRTC = MCCS1850; + } else { + ConfigureParams.System.nCpuFreq = 25; + ConfigureParams.System.nRTC = MC68HC68T1; + } + ConfigureParams.System.n_FPUType = FPU_CPU; + ConfigureParams.System.nDSPType = DSP_TYPE_EMU; + ConfigureParams.System.bDSPMemoryExpansion = true; + ConfigureParams.System.nSCSI = NCR53C90A; + ConfigureParams.System.bNBIC = false; + break; + default: + break; + } + + if (ConfigureParams.System.bTurbo) { + ConfigureParams.Memory.nMemoryBankSize[0] = 32; + ConfigureParams.Memory.nMemoryBankSize[1] = 32; + ConfigureParams.Memory.nMemoryBankSize[2] = 32; + ConfigureParams.Memory.nMemoryBankSize[3] = 32; + } else if (ConfigureParams.System.bColor) { + ConfigureParams.Memory.nMemoryBankSize[0] = 8; + ConfigureParams.Memory.nMemoryBankSize[1] = 8; + ConfigureParams.Memory.nMemoryBankSize[2] = 8; + ConfigureParams.Memory.nMemoryBankSize[3] = 8; + } else { + ConfigureParams.Memory.nMemoryBankSize[0] = 16; + ConfigureParams.Memory.nMemoryBankSize[1] = 16; + ConfigureParams.Memory.nMemoryBankSize[2] = 16; + ConfigureParams.Memory.nMemoryBankSize[3] = 16; + } } @@ -647,6 +796,34 @@ int Configuration_CheckMemory(int *banks return (banksize[0]+banksize[1]+banksize[2]+banksize[3]); } +int Configuration_CheckDimensionMemory(int *banksize) { + int i; + +#if RESTRICTIVE_MEMCHECK + /* To boot we need at least 4 MB in bank0 */ + if (banksize[0]<4) { + banksize[0]=4; + } +#endif + for (i=0; i<4; i++) { + if (banksize[i]<=0) + banksize[i]=0; + else if (banksize[i]<=4) + banksize[i]=4; + else if (banksize[i]<=16) + banksize[i]=16; + else + banksize[i]=16; + } + return (banksize[0]+banksize[1]+banksize[2]+banksize[3]); +} + +void Configuration_CheckDimensionSettings(void) { + if (ConfigureParams.System.nMachineType==NEXT_STATION) { + ConfigureParams.Screen.nMonitorType = MONITOR_TYPE_CPU; + } +} + /*-----------------------------------------------------------------------*/ /** @@ -689,16 +866,20 @@ void Configuration_Load(const char *psFi Configuration_LoadSection(psFileName, configs_Keyboard, "[Keyboard]"); Configuration_LoadSection(psFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]"); Configuration_LoadSection(psFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]"); + Configuration_LoadSection(psFileName, configs_Mouse, "[Mouse]"); Configuration_LoadSection(psFileName, configs_Sound, "[Sound]"); Configuration_LoadSection(psFileName, configs_Memory, "[Memory]"); - Configuration_LoadSection(psFileName, configs_Floppy, "[Floppy]"); Configuration_LoadSection(psFileName, configs_Boot, "[Boot]"); Configuration_LoadSection(psFileName, configs_SCSI, "[HardDisk]"); + Configuration_LoadSection(psFileName, configs_MO, "[MagnetoOptical]"); + Configuration_LoadSection(psFileName, configs_Floppy, "[Floppy]"); + Configuration_LoadSection(psFileName, configs_Ethernet, "[Ethernet]"); Configuration_LoadSection(psFileName, configs_Rom, "[ROM]"); Configuration_LoadSection(psFileName, configs_Rs232, "[RS232]"); Configuration_LoadSection(psFileName, configs_Printer, "[Printer]"); Configuration_LoadSection(psFileName, configs_Midi, "[Midi]"); Configuration_LoadSection(psFileName, configs_System, "[System]"); + Configuration_LoadSection(psFileName, configs_Dimension, "[Dimension]"); Configuration_LoadSection(psFileName, configs_Video, "[Video]"); } @@ -737,16 +918,20 @@ void Configuration_Save(void) Configuration_SaveSection(sConfigFileName, configs_Keyboard, "[Keyboard]"); Configuration_SaveSection(sConfigFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]"); Configuration_SaveSection(sConfigFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]"); + Configuration_SaveSection(sConfigFileName, configs_Mouse, "[Mouse]"); Configuration_SaveSection(sConfigFileName, configs_Sound, "[Sound]"); Configuration_SaveSection(sConfigFileName, configs_Memory, "[Memory]"); - Configuration_SaveSection(sConfigFileName, configs_Floppy, "[Floppy]"); Configuration_SaveSection(sConfigFileName, configs_Boot, "[Boot]"); Configuration_SaveSection(sConfigFileName, configs_SCSI, "[HardDisk]"); + Configuration_SaveSection(sConfigFileName, configs_MO, "[MagnetoOptical]"); + Configuration_SaveSection(sConfigFileName, configs_Floppy, "[Floppy]"); + Configuration_SaveSection(sConfigFileName, configs_Ethernet, "[Ethernet]"); Configuration_SaveSection(sConfigFileName, configs_Rom, "[ROM]"); Configuration_SaveSection(sConfigFileName, configs_Rs232, "[RS232]"); Configuration_SaveSection(sConfigFileName, configs_Printer, "[Printer]"); Configuration_SaveSection(sConfigFileName, configs_Midi, "[Midi]"); Configuration_SaveSection(sConfigFileName, configs_System, "[System]"); + Configuration_SaveSection(sConfigFileName, configs_Dimension, "[Dimension]"); Configuration_SaveSection(sConfigFileName, configs_Video, "[Video]"); } @@ -771,10 +956,36 @@ void Configuration_MemorySnapShot_Captur int target; for (target = 0; target < ESP_MAX_DEVS; target++) { MemorySnapShot_Store(ConfigureParams.SCSI.target[target].szImageName, sizeof(ConfigureParams.SCSI.target[target].szImageName)); - MemorySnapShot_Store(&ConfigureParams.SCSI.target[target].bAttached, sizeof(ConfigureParams.SCSI.target[target].bAttached)); - MemorySnapShot_Store(&ConfigureParams.SCSI.target[target].bCDROM, sizeof(ConfigureParams.SCSI.target[target].bCDROM)); + MemorySnapShot_Store(&ConfigureParams.SCSI.target[target].nDeviceType, sizeof(ConfigureParams.SCSI.target[target].nDeviceType)); + MemorySnapShot_Store(&ConfigureParams.SCSI.target[target].bDiskInserted, sizeof(ConfigureParams.SCSI.target[target].bDiskInserted)); + MemorySnapShot_Store(&ConfigureParams.SCSI.target[target].bWriteProtected, sizeof(ConfigureParams.SCSI.target[target].bWriteProtected)); + + } + + /* MO drives */ + int drive; + for (drive = 0; drive < MO_MAX_DRIVES; drive++) { + MemorySnapShot_Store(ConfigureParams.MO.drive[drive].szImageName, sizeof(ConfigureParams.MO.drive[drive].szImageName)); + MemorySnapShot_Store(&ConfigureParams.MO.drive[drive].bDriveConnected, sizeof(ConfigureParams.MO.drive[drive].bDriveConnected)); + MemorySnapShot_Store(&ConfigureParams.MO.drive[drive].bDiskInserted, sizeof(ConfigureParams.MO.drive[drive].bDiskInserted)); + MemorySnapShot_Store(&ConfigureParams.MO.drive[drive].bWriteProtected, sizeof(ConfigureParams.MO.drive[drive].bWriteProtected)); + } + + /* Floppy drives */ + for (drive = 0; drive < FLP_MAX_DRIVES; drive++) { + MemorySnapShot_Store(ConfigureParams.Floppy.drive[drive].szImageName, sizeof(ConfigureParams.Floppy.drive[drive].szImageName)); + MemorySnapShot_Store(&ConfigureParams.Floppy.drive[drive].bDriveConnected, sizeof(ConfigureParams.Floppy.drive[drive].bDriveConnected)); + MemorySnapShot_Store(&ConfigureParams.Floppy.drive[drive].bDiskInserted, sizeof(ConfigureParams.Floppy.drive[drive].bDiskInserted)); + MemorySnapShot_Store(&ConfigureParams.Floppy.drive[drive].bWriteProtected, sizeof(ConfigureParams.Floppy.drive[drive].bWriteProtected)); } + + /* Ethernet options */ + MemorySnapShot_Store(&ConfigureParams.Ethernet.bEthernetConnected, sizeof(ConfigureParams.Ethernet.bEthernetConnected)); + /* Sound options */ + MemorySnapShot_Store(&ConfigureParams.Sound.bEnableSound, sizeof(ConfigureParams.Sound.bEnableSound)); + MemorySnapShot_Store(&ConfigureParams.Sound.bEnableMicrophone, sizeof(ConfigureParams.Sound.bEnableMicrophone)); + /* Monitor options */ MemorySnapShot_Store(&ConfigureParams.Screen.nMonitorType, sizeof(ConfigureParams.Screen.nMonitorType)); MemorySnapShot_Store(&ConfigureParams.Screen.bUseExtVdiResolutions, sizeof(ConfigureParams.Screen.bUseExtVdiResolutions)); @@ -790,25 +1001,26 @@ void Configuration_MemorySnapShot_Captur MemorySnapShot_Store(&ConfigureParams.System.nMachineType, sizeof(ConfigureParams.System.nMachineType)); MemorySnapShot_Store(&ConfigureParams.System.bColor, sizeof(ConfigureParams.System.bColor)); MemorySnapShot_Store(&ConfigureParams.System.bTurbo, sizeof(ConfigureParams.System.bTurbo)); - MemorySnapShot_Store(&ConfigureParams.System.bADB, sizeof(ConfigureParams.System.bADB)); + MemorySnapShot_Store(&ConfigureParams.System.bNBIC, sizeof(ConfigureParams.System.bNBIC)); MemorySnapShot_Store(&ConfigureParams.System.nSCSI, sizeof(ConfigureParams.System.nSCSI)); MemorySnapShot_Store(&ConfigureParams.System.nRTC, sizeof(ConfigureParams.System.nRTC)); MemorySnapShot_Store(&ConfigureParams.System.bBlitter, sizeof(ConfigureParams.System.bBlitter)); MemorySnapShot_Store(&ConfigureParams.System.nDSPType, sizeof(ConfigureParams.System.nDSPType)); + MemorySnapShot_Store(&ConfigureParams.System.bDSPMemoryExpansion, sizeof(ConfigureParams.System.bDSPMemoryExpansion)); MemorySnapShot_Store(&ConfigureParams.System.bRealTimeClock, sizeof(ConfigureParams.System.bRealTimeClock)); MemorySnapShot_Store(&ConfigureParams.System.bPatchTimerD, sizeof(ConfigureParams.System.bPatchTimerD)); -#if ENABLE_WINUAE_CPU MemorySnapShot_Store(&ConfigureParams.System.bAddressSpace24, sizeof(ConfigureParams.System.bAddressSpace24)); MemorySnapShot_Store(&ConfigureParams.System.bCycleExactCpu, sizeof(ConfigureParams.System.bCycleExactCpu)); MemorySnapShot_Store(&ConfigureParams.System.n_FPUType, sizeof(ConfigureParams.System.n_FPUType)); MemorySnapShot_Store(&ConfigureParams.System.bCompatibleFPU, sizeof(ConfigureParams.System.bCompatibleFPU)); MemorySnapShot_Store(&ConfigureParams.System.bMMU, sizeof(ConfigureParams.System.bMMU)); -#endif - /* Other */ - MemorySnapShot_Store(&ConfigureParams.DiskImage.bSlowFloppy, sizeof(ConfigureParams.DiskImage.bSlowFloppy)); + /* Dimension options */ + MemorySnapShot_Store(&ConfigureParams.Dimension.bEnabled, sizeof(ConfigureParams.Dimension.bEnabled)); + MemorySnapShot_Store(ConfigureParams.Dimension.nMemoryBankSize, sizeof(ConfigureParams.Dimension.nMemoryBankSize)); + MemorySnapShot_Store(ConfigureParams.Dimension.szRomFileName, sizeof(ConfigureParams.Dimension.szRomFileName)); if (!bSave) Configuration_Apply(true);