--- previous/src/configuration.c 2018/04/24 19:25:31 1.1.1.2 +++ previous/src/configuration.c 2018/04/24 19:27:32 1.1.1.3 @@ -42,6 +42,13 @@ static const struct Config_Tag configs_L { NULL , Error_Tag, NULL } }; +/* Used to load/save configuration dialog options */ +static const struct Config_Tag configs_ConfigDialog[] = +{ + { "bShowConfigDialogAtStartup", Bool_Tag, &ConfigureParams.ConfigDialog.bShowConfigDialogAtStartup }, + { NULL , Error_Tag, NULL } +}; + /* Used to load/save debugger options */ static const struct Config_Tag configs_Debugger[] = { @@ -74,96 +81,6 @@ static const struct Config_Tag configs_S { NULL , Error_Tag, NULL } }; -/* Used to load/save joystick 0 options */ -static const struct Config_Tag configs_Joystick0[] = -{ - { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nJoystickMode }, - { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[0].bEnableAutoFire }, - { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[0].bEnableJumpOnFire2 }, - { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nJoyId }, - { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeUp }, - { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeDown }, - { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeLeft }, - { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeRight }, - { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[0].nKeyCodeFire }, - { NULL , Error_Tag, NULL } -}; - -/* Used to load/save joystick 1 options */ -static const struct Config_Tag configs_Joystick1[] = -{ - { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nJoystickMode }, - { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[1].bEnableAutoFire }, - { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[1].bEnableJumpOnFire2 }, - { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nJoyId }, - { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeUp }, - { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeDown }, - { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeLeft }, - { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeRight }, - { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[1].nKeyCodeFire }, - { NULL , Error_Tag, NULL } -}; - -/* Used to load/save joystick 2 options */ -static const struct Config_Tag configs_Joystick2[] = -{ - { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nJoystickMode }, - { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[2].bEnableAutoFire }, - { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[2].bEnableJumpOnFire2 }, - { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nJoyId }, - { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeUp }, - { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeDown }, - { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeLeft }, - { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeRight }, - { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[2].nKeyCodeFire }, - { NULL , Error_Tag, NULL } -}; - -/* Used to load/save joystick 3 options */ -static const struct Config_Tag configs_Joystick3[] = -{ - { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nJoystickMode }, - { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[3].bEnableAutoFire }, - { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[3].bEnableJumpOnFire2 }, - { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nJoyId }, - { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeUp }, - { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeDown }, - { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeLeft }, - { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeRight }, - { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[3].nKeyCodeFire }, - { NULL , Error_Tag, NULL } -}; - -/* Used to load/save joystick 4 options */ -static const struct Config_Tag configs_Joystick4[] = -{ - { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nJoystickMode }, - { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[4].bEnableAutoFire }, - { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[4].bEnableJumpOnFire2 }, - { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nJoyId }, - { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeUp }, - { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeDown }, - { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeLeft }, - { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeRight }, - { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[4].nKeyCodeFire }, - { NULL , Error_Tag, NULL } -}; - -/* Used to load/save joystick 5 options */ -static const struct Config_Tag configs_Joystick5[] = -{ - { "nJoystickMode", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nJoystickMode }, - { "bEnableAutoFire", Bool_Tag, &ConfigureParams.Joysticks.Joy[5].bEnableAutoFire }, - { "bEnableJumpOnFire2", Bool_Tag, &ConfigureParams.Joysticks.Joy[5].bEnableJumpOnFire2 }, - { "nJoyId", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nJoyId }, - { "nKeyCodeUp", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeUp }, - { "nKeyCodeDown", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeDown }, - { "nKeyCodeLeft", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeLeft }, - { "nKeyCodeRight", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeRight }, - { "nKeyCodeFire", Int_Tag, &ConfigureParams.Joysticks.Joy[5].nKeyCodeFire }, - { NULL , Error_Tag, NULL } -}; - /* Used to load/save keyboard options */ static const struct Config_Tag configs_Keyboard[] = { @@ -237,7 +154,11 @@ static const struct Config_Tag configs_S /* Used to load/save memory options */ static const struct Config_Tag configs_Memory[] = { - { "nMemorySize", Int_Tag, &ConfigureParams.Memory.nMemorySize }, + { "nMemoryBankSize0", Int_Tag, &ConfigureParams.Memory.nMemoryBankSize[0] }, + { "nMemoryBankSize1", Int_Tag, &ConfigureParams.Memory.nMemoryBankSize[1] }, + { "nMemoryBankSize2", Int_Tag, &ConfigureParams.Memory.nMemoryBankSize[2] }, + { "nMemoryBankSize3", Int_Tag, &ConfigureParams.Memory.nMemoryBankSize[3] }, + { "nMemorySpeed", Int_Tag, &ConfigureParams.Memory.nMemorySpeed }, { "bAutoSave", Bool_Tag, &ConfigureParams.Memory.bAutoSave }, { "szMemoryCaptureFileName", String_Tag, ConfigureParams.Memory.szMemoryCaptureFileName }, { "szAutoSaveFileName", String_Tag, ConfigureParams.Memory.szAutoSaveFileName }, @@ -259,27 +180,62 @@ static const struct Config_Tag configs_F { NULL , Error_Tag, NULL } }; -/* Used to load/save HD options */ -static const struct Config_Tag configs_HardDisk[] = +/* Used to load/save boot options */ +static const struct Config_Tag configs_Boot[] = { - { "bBootFromHardDisk", Bool_Tag, &ConfigureParams.HardDisk.bBootFromHardDisk }, - { "bUseHardDiskDirectory", Bool_Tag, &ConfigureParams.HardDisk.bUseHardDiskDirectories }, - { "szHardDiskDirectory", String_Tag, ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C] }, - { "nWriteProtection", Int_Tag, &ConfigureParams.HardDisk.nWriteProtection }, - { "bUseHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseHardDiskImage }, - { "szHardDiskImage", String_Tag, ConfigureParams.HardDisk.szHardDiskImage }, - { "bUseIdeMasterHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseIdeMasterHardDiskImage }, - { "bUseIdeSlaveHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseIdeSlaveHardDiskImage }, - { "szIdeMasterHardDiskImage", String_Tag, ConfigureParams.HardDisk.szIdeMasterHardDiskImage }, - { "szIdeSlaveHardDiskImage", String_Tag, ConfigureParams.HardDisk.szIdeSlaveHardDiskImage }, + { "nBootDevice", Int_Tag, &ConfigureParams.Boot.nBootDevice }, + { "bEnableDRAMTest", Bool_Tag, &ConfigureParams.Boot.bEnableDRAMTest }, + { "bEnablePot", Bool_Tag, &ConfigureParams.Boot.bEnablePot }, + { "bEnableSoundTest", Bool_Tag, &ConfigureParams.Boot.bEnableSoundTest }, + { "bEnableSCSITest", Bool_Tag, &ConfigureParams.Boot.bEnableSCSITest }, + { "bLoopPot", Bool_Tag, &ConfigureParams.Boot.bLoopPot }, + { "bVerbose", Bool_Tag, &ConfigureParams.Boot.bVerbose }, + { "bExtendedPot", Bool_Tag, &ConfigureParams.Boot.bExtendedPot }, + { NULL , Error_Tag, NULL } +}; + +/* Used to load/save SCSI options */ +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 }, + + { "szImageName1", String_Tag, ConfigureParams.SCSI.target[1].szImageName }, + { "bAttached1", Bool_Tag, &ConfigureParams.SCSI.target[1].bAttached }, + { "bCDROM1", Bool_Tag, &ConfigureParams.SCSI.target[1].bCDROM }, + + { "szImageName2", String_Tag, ConfigureParams.SCSI.target[2].szImageName }, + { "bAttached2", Bool_Tag, &ConfigureParams.SCSI.target[2].bAttached }, + { "bCDROM2", Bool_Tag, &ConfigureParams.SCSI.target[2].bCDROM }, + + { "szImageName3", String_Tag, ConfigureParams.SCSI.target[3].szImageName }, + { "bAttached3", Bool_Tag, &ConfigureParams.SCSI.target[3].bAttached }, + { "bCDROM3", Bool_Tag, &ConfigureParams.SCSI.target[3].bCDROM }, + + { "szImageName4", String_Tag, ConfigureParams.SCSI.target[4].szImageName }, + { "bAttached4", Bool_Tag, &ConfigureParams.SCSI.target[4].bAttached }, + { "bCDROM4", Bool_Tag, &ConfigureParams.SCSI.target[4].bCDROM }, + + { "szImageName5", String_Tag, ConfigureParams.SCSI.target[5].szImageName }, + { "bAttached5", Bool_Tag, &ConfigureParams.SCSI.target[5].bAttached }, + { "bCDROM5", Bool_Tag, &ConfigureParams.SCSI.target[5].bCDROM }, + + { "szImageName6", String_Tag, ConfigureParams.SCSI.target[6].szImageName }, + { "bAttached6", Bool_Tag, &ConfigureParams.SCSI.target[6].bAttached }, + { "bCDROM6", Bool_Tag, &ConfigureParams.SCSI.target[6].bCDROM }, + + { "bBootFromHardDisk", Bool_Tag, &ConfigureParams.SCSI.bBootFromHardDisk }, + { "nWriteProtection", Int_Tag, &ConfigureParams.SCSI.nWriteProtection }, { NULL , Error_Tag, NULL } }; /* Used to load/save ROM options */ static const struct Config_Tag configs_Rom[] = { - { "szTosImageFileName", String_Tag, ConfigureParams.Rom.szTosImageFileName }, - { "szCartridgeImageFileName", String_Tag, ConfigureParams.Rom.szCartridgeImageFileName }, + { "szRom030FileName", String_Tag, ConfigureParams.Rom.szRom030FileName }, + { "szRom040FileName", String_Tag, ConfigureParams.Rom.szRom040FileName }, + { "szRomTurboFileName", String_Tag, ConfigureParams.Rom.szRomTurboFileName }, { NULL , Error_Tag, NULL } }; @@ -313,10 +269,16 @@ static const struct Config_Tag configs_M /* Used to load/save system options */ static const struct Config_Tag configs_System[] = { + { "nMachineType", Int_Tag, &ConfigureParams.System.nMachineType }, + { "bColor", Bool_Tag, &ConfigureParams.System.bColor }, + { "bTurbo", Bool_Tag, &ConfigureParams.System.bTurbo }, + { "bADB", Bool_Tag, &ConfigureParams.System.bADB }, + { "nSCSI", Bool_Tag, &ConfigureParams.System.nSCSI }, + { "nRTC", Bool_Tag, &ConfigureParams.System.nRTC }, + { "nCpuLevel", Int_Tag, &ConfigureParams.System.nCpuLevel }, { "nCpuFreq", Int_Tag, &ConfigureParams.System.nCpuFreq }, { "bCompatibleCpu", Bool_Tag, &ConfigureParams.System.bCompatibleCpu }, - { "nMachineType", Int_Tag, &ConfigureParams.System.nMachineType }, { "bBlitter", Bool_Tag, &ConfigureParams.System.bBlitter }, { "nDSPType", Int_Tag, &ConfigureParams.System.nDSPType }, { "bRealTimeClock", Bool_Tag, &ConfigureParams.System.bRealTimeClock }, @@ -359,12 +321,16 @@ void Configuration_SetDefault(void) /* Clear parameters */ memset(&ConfigureParams, 0, sizeof(CNF_PARAMS)); + /* Set defaults for logging and tracing */ strcpy(ConfigureParams.Log.sLogFileName, "stderr"); strcpy(ConfigureParams.Log.sTraceFileName, "stderr"); ConfigureParams.Log.nTextLogLevel = LOG_TODO; ConfigureParams.Log.nAlertDlgLogLevel = LOG_ERROR; ConfigureParams.Log.bConfirmQuit = true; + + /* Set defaults for config dialog */ + ConfigureParams.ConfigDialog.bShowConfigDialogAtStartup = true; /* Set defaults for debugger */ ConfigureParams.Debugger.nNumberBase = 10; @@ -383,40 +349,24 @@ void Configuration_SetDefault(void) strcpy(ConfigureParams.DiskImage.szDiskImageDirectory, psWorkingDir); File_AddSlashToEndFileName(ConfigureParams.DiskImage.szDiskImageDirectory); - /* Set defaults for hard disks */ - ConfigureParams.HardDisk.bBootFromHardDisk = false; - ConfigureParams.HardDisk.nWriteProtection = WRITEPROT_OFF; - ConfigureParams.HardDisk.nHardDiskDir = DRIVE_C; - ConfigureParams.HardDisk.bUseHardDiskDirectories = false; - for (i = 0; i < MAX_HARDDRIVES; i++) - { - strcpy(ConfigureParams.HardDisk.szHardDiskDirectories[i], psWorkingDir); - File_CleanFileName(ConfigureParams.HardDisk.szHardDiskDirectories[i]); - } - ConfigureParams.HardDisk.bUseHardDiskImage = false; - strcpy(ConfigureParams.HardDisk.szHardDiskImage, psWorkingDir); - ConfigureParams.HardDisk.bUseIdeMasterHardDiskImage = false; - strcpy(ConfigureParams.HardDisk.szIdeMasterHardDiskImage, psWorkingDir); - ConfigureParams.HardDisk.bUseIdeSlaveHardDiskImage = false; - strcpy(ConfigureParams.HardDisk.szIdeSlaveHardDiskImage, psWorkingDir); - - /* Set defaults for Joysticks */ - for (i = 0; i < JOYSTICK_COUNT; i++) - { - ConfigureParams.Joysticks.Joy[i].nJoystickMode = JOYSTICK_DISABLED; - ConfigureParams.Joysticks.Joy[i].bEnableAutoFire = false; - ConfigureParams.Joysticks.Joy[i].bEnableJumpOnFire2 = false; - ConfigureParams.Joysticks.Joy[i].nJoyId = i; - ConfigureParams.Joysticks.Joy[i].nKeyCodeUp = SDLK_UP; - ConfigureParams.Joysticks.Joy[i].nKeyCodeDown = SDLK_DOWN; - ConfigureParams.Joysticks.Joy[i].nKeyCodeLeft = SDLK_LEFT; - ConfigureParams.Joysticks.Joy[i].nKeyCodeRight = SDLK_RIGHT; - ConfigureParams.Joysticks.Joy[i].nKeyCodeFire = SDLK_RCTRL; - } - ConfigureParams.Joysticks.Joy[1].nJoyId = 0; /* ST Joystick #1 is default joystick */ - ConfigureParams.Joysticks.Joy[0].nJoyId = 1; - ConfigureParams.Joysticks.Joy[1].nJoystickMode = JOYSTICK_REALSTICK; - + /* Set defaults for Boot options */ + ConfigureParams.Boot.nBootDevice = BOOT_ROM; + ConfigureParams.Boot.bEnableDRAMTest = false; + ConfigureParams.Boot.bEnablePot = true; + ConfigureParams.Boot.bEnableSoundTest = true; + ConfigureParams.Boot.bEnableSCSITest = true; + ConfigureParams.Boot.bLoopPot = false; + ConfigureParams.Boot.bVerbose = true; + 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; + } + /* Set defaults for Keyboard */ ConfigureParams.Keyboard.bDisableKeyRepeat = false; ConfigureParams.Keyboard.nKeymapType = KEYMAP_SYMBOLIC; @@ -447,7 +397,9 @@ void Configuration_SetDefault(void) ConfigureParams.Shortcut.withModifier[SHORTCUT_INSERTDISKA] = SDLK_1; /* Set defaults for Memory */ - ConfigureParams.Memory.nMemorySize = 1; /* 1 MiB */ + memset(ConfigureParams.Memory.nMemoryBankSize, 16, + sizeof(ConfigureParams.Memory.nMemoryBankSize)); /* 64 MiB */ + ConfigureParams.Memory.nMemorySpeed = MEMORY_100NS; ConfigureParams.Memory.bAutoSave = false; sprintf(ConfigureParams.Memory.szMemoryCaptureFileName, "%s%chatari.sav", psHomeDir, PATHSEP); @@ -497,15 +449,25 @@ void Configuration_SetDefault(void) // ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING; /* Set defaults for Rom */ - sprintf(ConfigureParams.Rom.szTosImageFileName, "%s%ctos.img", - Paths_GetDataDir(), PATHSEP); - strcpy(ConfigureParams.Rom.szCartridgeImageFileName, ""); + sprintf(ConfigureParams.Rom.szRom030FileName, "%s%cRev_1.0_v41.BIN", + Paths_GetWorkingDir(), PATHSEP); + sprintf(ConfigureParams.Rom.szRom040FileName, "%s%cRev_2.5_v66.BIN", + Paths_GetWorkingDir(), PATHSEP); + sprintf(ConfigureParams.Rom.szRomTurboFileName, "%s%cRev_3.3_v74.BIN", + Paths_GetWorkingDir(), PATHSEP); + /* Set defaults for System */ - ConfigureParams.System.nCpuLevel = 4; - ConfigureParams.System.nCpuFreq = 32; + ConfigureParams.System.nMachineType = NEXT_CUBE030; + ConfigureParams.System.bColor = false; + ConfigureParams.System.bTurbo = false; + ConfigureParams.System.bADB = false; + ConfigureParams.System.nSCSI = NCR53C90; + ConfigureParams.System.nRTC = MC68HC68T1; + + ConfigureParams.System.nCpuLevel = 3; + ConfigureParams.System.nCpuFreq = 25; ConfigureParams.System.bCompatibleCpu = true; - ConfigureParams.System.nMachineType = MACHINE_ST; ConfigureParams.System.bBlitter = false; ConfigureParams.System.nDSPType = DSP_TYPE_NONE; ConfigureParams.System.bPatchTimerD = true; @@ -515,7 +477,7 @@ void Configuration_SetDefault(void) #if ENABLE_WINUAE_CPU ConfigureParams.System.bAddressSpace24 = false; ConfigureParams.System.bCycleExactCpu = false; - ConfigureParams.System.n_FPUType = FPU_CPU; + ConfigureParams.System.n_FPUType = FPU_68882; ConfigureParams.System.bCompatibleFPU = true; ConfigureParams.System.bMMU = true; #endif @@ -538,7 +500,9 @@ void Configuration_SetDefault(void) #if defined(__AMIGAOS4__) /* Fix default path names on Amiga OS */ - sprintf(ConfigureParams.Rom.szTosImageFileName, "%stos.img", Paths_GetDataDir()); + sprintf(ConfigureParams.Rom.szRom030FileName, "%sRev_1.0_v41.BIN", Paths_GetWorkingDir()); + sprintf(ConfigureParams.Rom.szRom040FileName, "%sRev_2.5_v66.BIN", Paths_GetWorkingDir()); + sprintf(ConfigureParams.Rom.szRom040FileName, "%sRev_3.3_v74.BIN", Paths_GetWorkingDir()); #endif } @@ -589,13 +553,19 @@ void Configuration_Apply(bool bReset) */ M68000_CheckCpuSettings(); - /* Clean file and directory names */ - File_MakeAbsoluteName(ConfigureParams.Rom.szTosImageFileName); - if (strlen(ConfigureParams.Rom.szCartridgeImageFileName) > 0) - File_MakeAbsoluteName(ConfigureParams.Rom.szCartridgeImageFileName); - File_MakeAbsoluteName(ConfigureParams.HardDisk.szHardDiskImage); - File_CleanFileName(ConfigureParams.HardDisk.szHardDiskDirectories[0]); - File_MakeAbsoluteName(ConfigureParams.HardDisk.szHardDiskDirectories[0]); + /* Check memory size for each bank and change to supported values */ + Configuration_CheckMemory(ConfigureParams.Memory.nMemoryBankSize); + + /* Clean file and directory names */ + File_MakeAbsoluteName(ConfigureParams.Rom.szRom030FileName); + File_MakeAbsoluteName(ConfigureParams.Rom.szRom040FileName); + File_MakeAbsoluteName(ConfigureParams.Rom.szRomTurboFileName); + + int target; + for (target = 0; target < ESP_MAX_DEVS; target++) { + File_MakeAbsoluteName(ConfigureParams.SCSI.target[target].szImageName); + } + File_MakeAbsoluteName(ConfigureParams.Memory.szMemoryCaptureFileName); File_MakeAbsoluteName(ConfigureParams.Sound.szYMCaptureFileName); if (strlen(ConfigureParams.Keyboard.szMappingFileName) > 0) @@ -615,6 +585,71 @@ void Configuration_Apply(bool bReset) /*-----------------------------------------------------------------------*/ /** + * Check memory bank sizes for compatibility with the selected system. + */ +int Configuration_CheckMemory(int *banksize) { + int i; + +#define RESTRICTIVE_MEMCHECK 0 +#if RESTRICTIVE_MEMCHECK + /* To boot we need at least 4 MB in bank0 */ + if (banksize[0]<4) { + banksize[0]=4; + } + + /* On monochrome non-Turbo NeXTstations only the first + * 2 banks are accessible via memory sockets */ + if (ConfigureParams.System.nMachineType == NEXT_STATION && + !ConfigureParams.System.bTurbo && !ConfigureParams.System.bColor) { + banksize[2]=0; + banksize[3]=0; + } +#endif + + if (ConfigureParams.System.bTurbo) { + for (i=0; i<4; i++) { + if (banksize[i]<=0) + banksize[i]=0; + else if (banksize[i]<=2) + banksize[i]=2; + else if (banksize[i]<=8) + banksize[i]=8; + else if (banksize[i]<=32) + banksize[i]=32; + else + banksize[i]=32; + } + } else if (ConfigureParams.System.bColor) { + for (i=0; i<4; i++) { + if (banksize[i]<=0) + banksize[i]=0; + else if (banksize[i]<=2) + banksize[i]=2; + else if (banksize[i]<=8) + banksize[i]=8; + else + banksize[i]=8; + } + } else { + for (i=0; i<4; i++) { + if (banksize[i]<=0) + banksize[i]=0; + else if (banksize[i]<=1) + banksize[i]=1; + 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]); +} + + +/*-----------------------------------------------------------------------*/ +/** * Load a settings section from the configuration file. */ static int Configuration_LoadSection(const char *pFilename, const struct Config_Tag configs[], const char *pSection) @@ -648,21 +683,17 @@ void Configuration_Load(const char *psFi } Configuration_LoadSection(psFileName, configs_Log, "[Log]"); + Configuration_LoadSection(psFileName, configs_ConfigDialog, "[ConfigDialog]"); Configuration_LoadSection(psFileName, configs_Debugger, "[Debugger]"); Configuration_LoadSection(psFileName, configs_Screen, "[Screen]"); - Configuration_LoadSection(psFileName, configs_Joystick0, "[Joystick0]"); - Configuration_LoadSection(psFileName, configs_Joystick1, "[Joystick1]"); - Configuration_LoadSection(psFileName, configs_Joystick2, "[Joystick2]"); - Configuration_LoadSection(psFileName, configs_Joystick3, "[Joystick3]"); - Configuration_LoadSection(psFileName, configs_Joystick4, "[Joystick4]"); - Configuration_LoadSection(psFileName, configs_Joystick5, "[Joystick5]"); Configuration_LoadSection(psFileName, configs_Keyboard, "[Keyboard]"); Configuration_LoadSection(psFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]"); Configuration_LoadSection(psFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]"); Configuration_LoadSection(psFileName, configs_Sound, "[Sound]"); Configuration_LoadSection(psFileName, configs_Memory, "[Memory]"); Configuration_LoadSection(psFileName, configs_Floppy, "[Floppy]"); - Configuration_LoadSection(psFileName, configs_HardDisk, "[HardDisk]"); + Configuration_LoadSection(psFileName, configs_Boot, "[Boot]"); + Configuration_LoadSection(psFileName, configs_SCSI, "[HardDisk]"); Configuration_LoadSection(psFileName, configs_Rom, "[ROM]"); Configuration_LoadSection(psFileName, configs_Rs232, "[RS232]"); Configuration_LoadSection(psFileName, configs_Printer, "[Printer]"); @@ -700,21 +731,17 @@ void Configuration_Save(void) Log_AlertDlg(LOG_ERROR, "Error saving config file."); return; } + Configuration_SaveSection(sConfigFileName, configs_ConfigDialog, "[ConfigDialog]"); Configuration_SaveSection(sConfigFileName, configs_Debugger, "[Debugger]"); Configuration_SaveSection(sConfigFileName, configs_Screen, "[Screen]"); - Configuration_SaveSection(sConfigFileName, configs_Joystick0, "[Joystick0]"); - Configuration_SaveSection(sConfigFileName, configs_Joystick1, "[Joystick1]"); - Configuration_SaveSection(sConfigFileName, configs_Joystick2, "[Joystick2]"); - Configuration_SaveSection(sConfigFileName, configs_Joystick3, "[Joystick3]"); - Configuration_SaveSection(sConfigFileName, configs_Joystick4, "[Joystick4]"); - Configuration_SaveSection(sConfigFileName, configs_Joystick5, "[Joystick5]"); Configuration_SaveSection(sConfigFileName, configs_Keyboard, "[Keyboard]"); Configuration_SaveSection(sConfigFileName, configs_ShortCutWithMod, "[ShortcutsWithModifiers]"); Configuration_SaveSection(sConfigFileName, configs_ShortCutWithoutMod, "[ShortcutsWithoutModifiers]"); Configuration_SaveSection(sConfigFileName, configs_Sound, "[Sound]"); Configuration_SaveSection(sConfigFileName, configs_Memory, "[Memory]"); Configuration_SaveSection(sConfigFileName, configs_Floppy, "[Floppy]"); - Configuration_SaveSection(sConfigFileName, configs_HardDisk, "[HardDisk]"); + Configuration_SaveSection(sConfigFileName, configs_Boot, "[Boot]"); + Configuration_SaveSection(sConfigFileName, configs_SCSI, "[HardDisk]"); Configuration_SaveSection(sConfigFileName, configs_Rom, "[ROM]"); Configuration_SaveSection(sConfigFileName, configs_Rs232, "[RS232]"); Configuration_SaveSection(sConfigFileName, configs_Printer, "[Printer]"); @@ -730,27 +757,43 @@ void Configuration_Save(void) * ('MemorySnapShot_Store' handles type) */ void Configuration_MemorySnapShot_Capture(bool bSave) -{ - MemorySnapShot_Store(ConfigureParams.Rom.szTosImageFileName, sizeof(ConfigureParams.Rom.szTosImageFileName)); - MemorySnapShot_Store(ConfigureParams.Rom.szCartridgeImageFileName, sizeof(ConfigureParams.Rom.szCartridgeImageFileName)); - - MemorySnapShot_Store(&ConfigureParams.Memory.nMemorySize, sizeof(ConfigureParams.Memory.nMemorySize)); - - MemorySnapShot_Store(&ConfigureParams.HardDisk.bUseHardDiskDirectories, sizeof(ConfigureParams.HardDisk.bUseHardDiskDirectories)); - MemorySnapShot_Store(ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C], sizeof(ConfigureParams.HardDisk.szHardDiskDirectories[DRIVE_C])); - MemorySnapShot_Store(&ConfigureParams.HardDisk.bUseHardDiskImage, sizeof(ConfigureParams.HardDisk.bUseHardDiskImage)); - MemorySnapShot_Store(ConfigureParams.HardDisk.szHardDiskImage, sizeof(ConfigureParams.HardDisk.szHardDiskImage)); +{ + /* ROM files */ + MemorySnapShot_Store(ConfigureParams.Rom.szRom030FileName, sizeof(ConfigureParams.Rom.szRom030FileName)); + MemorySnapShot_Store(ConfigureParams.Rom.szRom040FileName, sizeof(ConfigureParams.Rom.szRom040FileName)); + MemorySnapShot_Store(ConfigureParams.Rom.szRomTurboFileName, sizeof(ConfigureParams.Rom.szRomTurboFileName)); + + /* Memory options */ + MemorySnapShot_Store(ConfigureParams.Memory.nMemoryBankSize, sizeof(ConfigureParams.Memory.nMemoryBankSize)); + MemorySnapShot_Store(&ConfigureParams.Memory.nMemorySpeed, sizeof(ConfigureParams.Memory.nMemorySpeed)); + + /* SCSI disks */ + 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)); + } + /* Monitor options */ MemorySnapShot_Store(&ConfigureParams.Screen.nMonitorType, sizeof(ConfigureParams.Screen.nMonitorType)); MemorySnapShot_Store(&ConfigureParams.Screen.bUseExtVdiResolutions, sizeof(ConfigureParams.Screen.bUseExtVdiResolutions)); MemorySnapShot_Store(&ConfigureParams.Screen.nVdiWidth, sizeof(ConfigureParams.Screen.nVdiWidth)); MemorySnapShot_Store(&ConfigureParams.Screen.nVdiHeight, sizeof(ConfigureParams.Screen.nVdiHeight)); MemorySnapShot_Store(&ConfigureParams.Screen.nVdiColors, sizeof(ConfigureParams.Screen.nVdiColors)); + /* System options */ MemorySnapShot_Store(&ConfigureParams.System.nCpuLevel, sizeof(ConfigureParams.System.nCpuLevel)); MemorySnapShot_Store(&ConfigureParams.System.nCpuFreq, sizeof(ConfigureParams.System.nCpuFreq)); MemorySnapShot_Store(&ConfigureParams.System.bCompatibleCpu, sizeof(ConfigureParams.System.bCompatibleCpu)); - MemorySnapShot_Store(&ConfigureParams.System.nMachineType, sizeof(ConfigureParams.System.nMachineType)); + + 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.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.bRealTimeClock, sizeof(ConfigureParams.System.bRealTimeClock)); @@ -764,6 +807,7 @@ void Configuration_MemorySnapShot_Captur MemorySnapShot_Store(&ConfigureParams.System.bMMU, sizeof(ConfigureParams.System.bMMU)); #endif + /* Other */ MemorySnapShot_Store(&ConfigureParams.DiskImage.bSlowFloppy, sizeof(ConfigureParams.DiskImage.bSlowFloppy)); if (!bSave)