--- previous/src/gui-osx/PrefsController.m 2018/04/24 19:30:04 1.1.1.4 +++ previous/src/gui-osx/PrefsController.m 2018/04/24 19:31:40 1.1.1.5 @@ -197,19 +197,6 @@ size_t Preferences_cKeysForJoysticks = s #define DLGSOUND_48KHZ 7 #define DLGSOUND_50KHZ 8 -static const int nSoundFreqs[] = -{ - 11025, - 12517, - 16000, - 22050, - 25033, - 32000, - 44100, - 48000, - 50066 -}; - @implementation PrefsController @@ -220,6 +207,7 @@ static const int nSoundFreqs[] = */ - (BOOL)choosePathForControl:(NSTextField*)textField chooseDirectories:(bool)chooseDirectories defaultInitialDir:(NSString*)defaultInitialDir { + /* // Create and configure an OpenPanel NSOpenPanel *openPanel = [NSOpenPanel openPanel]; [openPanel setCanChooseDirectories: chooseDirectories]; @@ -242,11 +230,11 @@ static const int nSoundFreqs[] = } // Run the OpenPanel, then check if the user clicked OK and selected at least one file - if ( (NSOKButton == [openPanel runModalForDirectory:directoryToOpen file:fileToPreselect types:nil] ) - && ([[openPanel filenames] count] > 0) ) + if ( (NSModalResponseOK == [openPanel runModalForDirectory:directoryToOpen file:fileToPreselect types:nil] ) + && ([[openPanel URLs] count] > 0) ) { // Get the path to the selected file - NSString *path = [[openPanel filenames] objectAtIndex:0]; + NSString *path = [[[openPanel URLs] objectAtIndex:0] path]; // Set the control to it (abbreviated if possible) [textField setStringValue:[path stringByAbbreviatingWithTildeInPath]]; @@ -256,6 +244,7 @@ static const int nSoundFreqs[] = } // Signal that the selection was aborted + */ return FALSE; } @@ -410,6 +399,7 @@ static const int nSoundFreqs[] = - (IBAction)loadConfigFrom:(id)sender { + /* NSString *ConfigFile = [NSString stringWithCString:(sConfigFileName) encoding:NSASCIIStringEncoding]; NSOpenPanel *openPanel = [ NSOpenPanel openPanel ]; @@ -436,6 +426,7 @@ static const int nSoundFreqs[] = // Refresh all the controls to match ConfigureParams [self setAllControls]; } + */ } /** @@ -443,6 +434,7 @@ static const int nSoundFreqs[] = */ - (IBAction)saveConfigAs:(id)sender { + /* char splitpath[FILENAME_MAX], splitname[FILENAME_MAX]; // Update the ConfigureParams from the controls @@ -474,6 +466,7 @@ static const int nSoundFreqs[] = strcpy(sConfigFileName, szPath); Configuration_Save(); } + */ } @@ -483,6 +476,7 @@ static const int nSoundFreqs[] = */ - (IBAction)commitAndClose:(id)sender { + /* BOOL applyChanges = true; // The user clicked OK @@ -510,6 +504,7 @@ static const int nSoundFreqs[] = // Close the window [window close]; + */ } - (void)initKeysDropDown:(NSPopUpButton*)dropDown @@ -553,7 +548,7 @@ static const int nSoundFreqs[] = int i; for (i = 0; i < cRealJoysticks; i++) { - const char* szJoystickName = SDL_JoystickName(i); + const char* szJoystickName = SDL_JoystickNameForIndex(i); [realJoystick addItemWithTitle:[[NSString stringWithCString:szJoystickName encoding:NSASCIIStringEncoding] capitalizedString]]; [[realJoystick lastItem] setTag:i]; } @@ -602,63 +597,29 @@ static const int nSoundFreqs[] = */ - (void)setAllControls { - // Import the floppy paths into their controls. -// IMPORT_TEXTFIELD(floppyImageA, ConfigureParams.DiskImage.szDiskFileName[0]); -// IMPORT_TEXTFIELD(floppyImageB, ConfigureParams.DiskImage.szDiskFileName[1]); - // Import all the preferences into their controls -// IMPORT_SWITCH(autoInsertB, ConfigureParams.DiskImage.bAutoInsertDiskB); - IMPORT_SWITCH(blitter, ConfigureParams.System.bBlitter); -// IMPORT_SWITCH(bootFromHD, ConfigureParams.SCSI.bBootFromHardDisk); -// IMPORT_SWITCH(captureOnChange, ConfigureParams.Screen.bCrop); -// IMPORT_TEXTFIELD(cartridgeImage, ConfigureParams.Rom.szCartridgeImageFileName); - IMPORT_RADIO(colorDepth, ConfigureParams.Screen.nVdiColors); + IMPORT_SWITCH(realtime, ConfigureParams.System.bRealtime); IMPORT_SWITCH(compatibleCpu, ConfigureParams.System.bCompatibleCpu); IMPORT_RADIO(cpuClock, ConfigureParams.System.nCpuFreq); IMPORT_RADIO(cpuType, ConfigureParams.System.nCpuLevel); -// IMPORT_TEXTFIELD(defaultImagesLocation, ConfigureParams.DiskImage.szDiskImageDirectory); - IMPORT_SWITCH(enableMidi, ConfigureParams.Midi.bEnableMidi); IMPORT_SWITCH(enablePrinter, ConfigureParams.Printer.bPrinterConnected); - IMPORT_SWITCH(enableRS232, ConfigureParams.RS232.bEnableRS232); IMPORT_SWITCH(enableSound, ConfigureParams.Sound.bEnableSound); - IMPORT_DROPDOWN(frameSkip, ConfigureParams.Screen.nFrameSkips); IMPORT_RADIO(keyboardMapping, ConfigureParams.Keyboard.nKeymapType); IMPORT_TEXTFIELD(keyboardMappingFile, ConfigureParams.Keyboard.szMappingFileName); IMPORT_RADIO(machineType, ConfigureParams.System.nMachineType); IMPORT_RADIO(monitor, ConfigureParams.Screen.nMonitorType); - IMPORT_SWITCH(patchTimerD, ConfigureParams.System.bPatchTimerD); IMPORT_TEXTFIELD(printToFile, ConfigureParams.Printer.szPrintToFileName); -// 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_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_TEXTFIELD(writeRS232ToFile, ConfigureParams.RS232.szOutFileName); - // IMPORT_SWITCH(zoomSTLowRes, ConfigureParams.Screen.bZoomLowRes); IMPORT_SWITCH(showStatusBar, ConfigureParams.Screen.bShowStatusbar); IMPORT_DROPDOWN(enableDSP,ConfigureParams.System.nDSPType); IMPORT_TEXTFIELD(configFile, sConfigFileName); // 12/04/2010 - IMPORT_SWITCH(falconTTRatio, ConfigureParams.Screen.bAspectCorrect); IMPORT_SWITCH(fullScreen, ConfigureParams.Screen.bFullScreen); IMPORT_SWITCH(ledDisks, ConfigureParams.Screen.bShowDriveLed); - - //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]]; - - - - - [(force8bpp) setState:((ConfigureParams.Screen.nForceBpp==8))? NSOnState : NSOffState]; int i; @@ -674,12 +635,7 @@ static const int nSoundFreqs[] = } - if (ConfigureParams.Screen.nVdiWidth >= 1024) [resolution selectCellWithTag:(2)]; - else if (ConfigureParams.Screen.nVdiWidth >= 768) - [resolution selectCellWithTag:(1)]; - else - [resolution selectCellWithTag:(0)]; // If the HD flag is set, load the HD path, otherwise make it blank // if (ConfigureParams.HardDisk.bUseHardDiskImage) @@ -818,68 +774,24 @@ static const int nSoundFreqs[] = - (void)saveAllControls { // Export the preference controls into their vars -// EXPORT_SWITCH(autoInsertB, ConfigureParams.DiskImage.bAutoInsertDiskB); - EXPORT_SWITCH(blitter, ConfigureParams.System.bBlitter); -// EXPORT_SWITCH(bootFromHD, ConfigureParams.SCSI.bBootFromHardDisk); -// EXPORT_SWITCH(captureOnChange, ConfigureParams.Screen.bCrop); -// EXPORT_TEXTFIELD(cartridgeImage, ConfigureParams.Rom.szCartridgeImageFileName); - EXPORT_RADIO(colorDepth, ConfigureParams.Screen.nVdiColors); + EXPORT_SWITCH(realtime, ConfigureParams.System.bRealtime); EXPORT_SWITCH(compatibleCpu, ConfigureParams.System.bCompatibleCpu); EXPORT_RADIO(cpuClock, ConfigureParams.System.nCpuFreq); EXPORT_RADIO(cpuType, ConfigureParams.System.nCpuLevel); -// EXPORT_TEXTFIELD(defaultImagesLocation, ConfigureParams.DiskImage.szDiskImageDirectory); - EXPORT_SWITCH(enableMidi, ConfigureParams.Midi.bEnableMidi); EXPORT_SWITCH(enablePrinter, ConfigureParams.Printer.bPrinterConnected); - EXPORT_SWITCH(enableRS232, ConfigureParams.RS232.bEnableRS232); EXPORT_SWITCH(enableSound, ConfigureParams.Sound.bEnableSound); - EXPORT_DROPDOWN(frameSkip, ConfigureParams.Screen.nFrameSkips); EXPORT_RADIO(keyboardMapping, ConfigureParams.Keyboard.nKeymapType); EXPORT_TEXTFIELD(keyboardMappingFile, ConfigureParams.Keyboard.szMappingFileName); EXPORT_RADIO(machineType, ConfigureParams.System.nMachineType); EXPORT_RADIO(monitor, ConfigureParams.Screen.nMonitorType); - EXPORT_SWITCH(patchTimerD, ConfigureParams.System.bPatchTimerD); EXPORT_TEXTFIELD(printToFile, ConfigureParams.Printer.szPrintToFileName); -// 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_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_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_NTEXTFIELD(maxZoomedWidth, ConfigureParams.Screen.nMaxWidth); - EXPORT_NTEXTFIELD(maxZoomedHeight, ConfigureParams.Screen.nMaxHeight); - - ConfigureParams.Screen.nForceBpp = ([force8bpp state] == NSOnState) ? 8 : 0; - -// ConfigureParams.Sound.nPlaybackFreq = nSoundFreqs[[[playbackQuality selectedCell] tag]]; - - switch ([[resolution selectedCell] tag]) - { - case 0: - ConfigureParams.Screen.nVdiWidth = 640; - ConfigureParams.Screen.nVdiHeight = 480; - break; - case 1: - ConfigureParams.Screen.nVdiWidth = 800; - ConfigureParams.Screen.nVdiHeight = 600; - break; - case 2: - ConfigureParams.Screen.nVdiWidth = 1024; - ConfigureParams.Screen.nVdiHeight = 768; - break; - } - + // Define the HD flag, and export the HD path if one is selected if ([[hdImage stringValue] length] > 0) { @@ -932,13 +844,13 @@ static const int nSoundFreqs[] = - (IBAction) setWidth:(id)sender; { - NSLog(@"Change Max Zoom width: %ld", [sender intValue]); + NSLog(@"Change Max Zoom width: %d", [sender intValue]); [maxZoomedWidth setIntValue: [sender intValue]]; } - (IBAction) setHeight:(id)sender; { - NSLog(@"Change Max Zoom height: %ld", [sender intValue]); + NSLog(@"Change Max Zoom height: %d", [sender intValue]); [maxZoomedHeight setIntValue: [sender intValue]]; }