--- hatari/src/gui-osx/PrefsController.m 2019/04/09 08:48:36 1.1.1.6 +++ hatari/src/gui-osx/PrefsController.m 2019/04/09 08:52:54 1.1.1.10 @@ -1,8 +1,8 @@ /* Hatari - PrefsController.m - 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. Preferences window controller implementation file @@ -26,6 +26,7 @@ #include "screen.h" #include "sdlgui.h" + // Macros to transfer data between Cocoa controls and Hatari data structures #define EXPORT_TEXTFIELD(nstextfield, target) GuiOsx_ExportPathString([nstextfield stringValue], target, sizeof((target))) #define EXPORT_NTEXTFIELD(nstextfield, target) target = [nstextfield intValue] @@ -502,7 +503,7 @@ static const int nSoundFreqs[] = // Commit the new configuration if (applyChanges) { - Change_CopyChangedParamsToConfiguration(&CurrentParams, &ConfigureParams, false); + Change_CopyChangedParamsToConfiguration(&CurrentParams, &ConfigureParams, true); } else { @@ -516,7 +517,7 @@ static const int nSoundFreqs[] = - (void)initKeysDropDown:(NSPopUpButton*)dropDown { [dropDown removeAllItems]; - int i; + unsigned int i; for (i = 0; i < Preferences_cKeysForJoysticks; i++) { SDLKey key = Preferences_KeysForJoysticks[i]; @@ -576,7 +577,16 @@ static const int nSoundFreqs[] = [self setAllControls]; // Display the window - [[ModalWrapper alloc] runModal:window]; + ModalWrapper *mw=[[ModalWrapper alloc] init]; + + [mw runModal:window]; + + [mw release]; + + //GuiOsx_Pause(); + + //[[NSApplication sharedApplication] runModalForWindow:window]; + } @@ -611,7 +621,7 @@ static const int nSoundFreqs[] = IMPORT_SWITCH(autoInsertB, ConfigureParams.DiskImage.bAutoInsertDiskB); IMPORT_SWITCH(blitter, ConfigureParams.System.bBlitter); IMPORT_SWITCH(bootFromHD, ConfigureParams.HardDisk.bBootFromHardDisk); - IMPORT_SWITCH(captureOnChange, ConfigureParams.Screen.bCaptureChange); + IMPORT_SWITCH(captureOnChange, ConfigureParams.Screen.bCrop); IMPORT_TEXTFIELD(cartridgeImage, ConfigureParams.Rom.szCartridgeImageFileName); IMPORT_RADIO(colorDepth, ConfigureParams.Screen.nVdiColors); IMPORT_SWITCH(compatibleCpu, ConfigureParams.System.bCompatibleCpu); @@ -632,12 +642,13 @@ static const int nSoundFreqs[] = IMPORT_RADIO(ramSize, ConfigureParams.Memory.nMemorySize); IMPORT_TEXTFIELD(readRS232FromFile, ConfigureParams.RS232.szInFileName); IMPORT_SWITCH(realTime, ConfigureParams.System.bRealTimeClock); - IMPORT_SWITCH(slowFDC, ConfigureParams.DiskImage.bSlowFloppy); + IMPORT_SWITCH(fastFDC, ConfigureParams.DiskImage.FastFloppy); IMPORT_TEXTFIELD(tosImage, ConfigureParams.Rom.szTosImageFileName); IMPORT_SWITCH(useBorders, ConfigureParams.Screen.bAllowOverscan); IMPORT_SWITCH(useVDIResolution, ConfigureParams.Screen.bUseExtVdiResolutions); IMPORT_TEXTFIELD(writeMidiToFile, ConfigureParams.Midi.sMidiOutFileName); - IMPORT_RADIO(writeProtection, ConfigureParams.DiskImage.nWriteProtection); + IMPORT_RADIO(floppyWriteProtection, ConfigureParams.DiskImage.nWriteProtection); + IMPORT_RADIO(HDWriteProtection, ConfigureParams.HardDisk.nWriteProtection); IMPORT_TEXTFIELD(writeRS232ToFile, ConfigureParams.RS232.szOutFileName); // IMPORT_SWITCH(zoomSTLowRes, ConfigureParams.Screen.bZoomLowRes); IMPORT_SWITCH(showStatusBar, ConfigureParams.Screen.bShowStatusbar); @@ -648,13 +659,18 @@ static const int nSoundFreqs[] = IMPORT_SWITCH(falconTTRatio, ConfigureParams.Screen.bAspectCorrect); IMPORT_SWITCH(fullScreen, ConfigureParams.Screen.bFullScreen); IMPORT_SWITCH(ledDisks, ConfigureParams.Screen.bShowDriveLed); + IMPORT_SWITCH(keepDesktopResolution, ConfigureParams.Screen.bKeepResolution); + + //v1.6.1 + IMPORT_SWITCH(FastBootPatch,ConfigureParams.System.bFastBoot); + IMPORT_RADIO(YMVoicesMixing,ConfigureParams.Sound.YmVolumeMixing); //deal with the Max Zoomed Stepper IMPORT_NTEXTFIELD(maxZoomedWidth, ConfigureParams.Screen.nMaxWidth); IMPORT_NTEXTFIELD(maxZoomedHeight, ConfigureParams.Screen.nMaxHeight); - [widthStepper setIntValue:[maxZoomedWidth intValue]]; - [heightStepper setIntValue:[maxZoomedHeight intValue]]; + [widthStepper setDoubleValue:[maxZoomedWidth intValue]]; + [heightStepper setDoubleValue:[maxZoomedHeight intValue]]; @@ -822,7 +838,7 @@ static const int nSoundFreqs[] = EXPORT_SWITCH(autoInsertB, ConfigureParams.DiskImage.bAutoInsertDiskB); EXPORT_SWITCH(blitter, ConfigureParams.System.bBlitter); EXPORT_SWITCH(bootFromHD, ConfigureParams.HardDisk.bBootFromHardDisk); - EXPORT_SWITCH(captureOnChange, ConfigureParams.Screen.bCaptureChange); + EXPORT_SWITCH(captureOnChange, ConfigureParams.Screen.bCrop); EXPORT_TEXTFIELD(cartridgeImage, ConfigureParams.Rom.szCartridgeImageFileName); EXPORT_RADIO(colorDepth, ConfigureParams.Screen.nVdiColors); EXPORT_SWITCH(compatibleCpu, ConfigureParams.System.bCompatibleCpu); @@ -843,20 +859,26 @@ static const int nSoundFreqs[] = EXPORT_RADIO(ramSize, ConfigureParams.Memory.nMemorySize); EXPORT_TEXTFIELD(readRS232FromFile, ConfigureParams.RS232.szInFileName); EXPORT_SWITCH(realTime, ConfigureParams.System.bRealTimeClock); - EXPORT_SWITCH(slowFDC, ConfigureParams.DiskImage.bSlowFloppy); + EXPORT_SWITCH(fastFDC, ConfigureParams.DiskImage.FastFloppy); EXPORT_TEXTFIELD(tosImage, ConfigureParams.Rom.szTosImageFileName); EXPORT_SWITCH(useBorders, ConfigureParams.Screen.bAllowOverscan); EXPORT_SWITCH(useVDIResolution, ConfigureParams.Screen.bUseExtVdiResolutions); EXPORT_TEXTFIELD(writeMidiToFile, ConfigureParams.Midi.sMidiOutFileName); - EXPORT_RADIO(writeProtection, ConfigureParams.DiskImage.nWriteProtection); - EXPORT_TEXTFIELD(writeRS232ToFile, ConfigureParams.RS232.szOutFileName); + EXPORT_RADIO(floppyWriteProtection, ConfigureParams.DiskImage.nWriteProtection); + EXPORT_RADIO(HDWriteProtection, ConfigureParams.HardDisk.nWriteProtection); + EXPORT_TEXTFIELD(writeRS232ToFile, ConfigureParams.RS232.szOutFileName); // EXPORT_SWITCH(zoomSTLowRes, ConfigureParams.Screen.bZoomLowRes); EXPORT_SWITCH(showStatusBar,ConfigureParams.Screen.bShowStatusbar); EXPORT_DROPDOWN(enableDSP,ConfigureParams.System.nDSPType); EXPORT_SWITCH(falconTTRatio, ConfigureParams.Screen.bAspectCorrect); EXPORT_SWITCH(fullScreen, ConfigureParams.Screen.bFullScreen); - IMPORT_SWITCH(ledDisks, ConfigureParams.Screen.bShowDriveLed); + EXPORT_SWITCH(ledDisks, ConfigureParams.Screen.bShowDriveLed); + EXPORT_SWITCH(keepDesktopResolution, ConfigureParams.Screen.bKeepResolution); + + //v1.6.1 + EXPORT_SWITCH(FastBootPatch,ConfigureParams.System.bFastBoot); + EXPORT_RADIO(YMVoicesMixing,ConfigureParams.Sound.YmVolumeMixing); EXPORT_NTEXTFIELD(maxZoomedWidth, ConfigureParams.Screen.nMaxWidth); EXPORT_NTEXTFIELD(maxZoomedHeight, ConfigureParams.Screen.nMaxHeight); @@ -943,5 +965,15 @@ static const int nSoundFreqs[] = [maxZoomedHeight setIntValue: [sender intValue]]; } ++(PrefsController*)prefs +{ + static PrefsController* prefs = nil; + if (!prefs) + prefs = [[PrefsController alloc] init]; + + return prefs; +} + + @end