260 |
|
|
261 |
|
- (IBAction) ChangeDisableSound: (NSButton *)sender |
262 |
|
{ |
263 |
< |
PrefsReplaceBool("nosound", [disableSound state]); |
263 |
> |
BOOL noSound = [disableSound state]; |
264 |
> |
|
265 |
> |
if ( ! noSound ) |
266 |
> |
WarningSheet(@"Sound is currently unimplemented", panel); |
267 |
> |
|
268 |
> |
PrefsReplaceBool("nosound", noSound); |
269 |
|
edited = YES; |
270 |
|
} |
271 |
|
|
281 |
|
edited = YES; |
282 |
|
} |
283 |
|
|
284 |
< |
// Screen/window changing stuff |
285 |
< |
|
286 |
< |
// This is called when any of the screen/window, width, height or depth is changed |
284 |
> |
// This is called when any of the screen/openGL/window, |
285 |
> |
// width, height or depth is clicked. |
286 |
> |
// |
287 |
> |
// Note that sender may not actually be an NSMatrix. |
288 |
|
|
289 |
|
- (IBAction) ChangeScreen: (NSMatrix *)sender |
290 |
|
{ |
291 |
+ |
NSButton *cell = [sender selectedCell]; |
292 |
+ |
|
293 |
|
short newx = [width intValue]; |
294 |
|
short newy = [height intValue]; |
295 |
|
short newbpp = [depth intValue]; |
296 |
< |
short newtype = DISPLAY_WINDOW; |
296 |
> |
short newtype; |
297 |
|
char str[20]; |
298 |
|
|
299 |
< |
if ( [sender selectedCell] == openGL ) |
299 |
> |
if ( cell == openGL ) |
300 |
|
newtype = DISPLAY_OPENGL; |
301 |
< |
if ( [sender selectedCell] == screen ) |
301 |
> |
else if ( cell == screen ) |
302 |
|
newtype = DISPLAY_SCREEN; |
303 |
+ |
else if ( cell == window ) |
304 |
+ |
newtype = DISPLAY_WINDOW; |
305 |
+ |
else |
306 |
+ |
newtype = display_type; |
307 |
|
|
308 |
|
// Check that a field actually changed |
309 |
|
if ( newbpp == init_depth && newx == init_width && |
310 |
|
newy == init_height && newtype == display_type ) |
311 |
+ |
{ |
312 |
+ |
D(NSLog(@"No changed GUI items in ChangeScreen")); |
313 |
|
return; |
314 |
< |
|
314 |
> |
} |
315 |
|
|
316 |
|
// If we are changing type, supply some sensible defaults |
317 |
|
if ( newtype != display_type ) |
318 |
|
{ |
319 |
+ |
D(NSLog(@"Changing display type in ChangeScreen")); |
320 |
|
if ( newtype == DISPLAY_SCREEN ) // If changing to full screen |
321 |
|
{ |
322 |
|
// supply main screen dimensions as a default |
323 |
< |
NSScreen *s = [NSScreen mainScreen]; |
324 |
< |
NSRect sr = [s frame]; |
310 |
< |
|
311 |
< |
newx = (short) sr.size.width; |
312 |
< |
newy = (short) sr.size.height; |
313 |
< |
// This always returns 24, despite the mode |
314 |
< |
//newbpp = NSBitsPerPixelFromDepth([s depth]); |
323 |
> |
newx = CGDisplayPixelsWide (kCGDirectMainDisplay); |
324 |
> |
newy = CGDisplayPixelsHigh (kCGDirectMainDisplay); |
325 |
|
newbpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay); |
326 |
|
} |
327 |
|
|
370 |
|
edited = YES; |
371 |
|
|
372 |
|
if ( display_type != DISPLAY_SCREEN ) |
373 |
+ |
{ |
374 |
+ |
D(NSLog(@"Display type is not SCREEN (%d), resizing window", |
375 |
+ |
display_type)); |
376 |
|
resizeWinTo(newx, newy); |
377 |
+ |
} |
378 |
|
} |
379 |
|
|
380 |
|
- (IBAction) CreateVolume: (id)sender |
399 |
|
NSString *details = [NSString stringWithFormat: |
400 |
|
@"The dd command failed.\nReturn status %d (%s)", |
401 |
|
retVal, strerror(errno)]; |
402 |
< |
WarningSheet(@"Unable to create volume", details, @"OK", panel); |
402 |
> |
WarningSheet(@"Unable to create volume", details, nil, panel); |
403 |
|
} |
404 |
|
else |
405 |
|
{ |
441 |
|
int B = (int) [bytes floatValue]; |
442 |
|
float M = B / 1024 / 1024; |
443 |
|
|
444 |
< |
NSLog(@"%s = %f %d", __PRETTY_FUNCTION__, M, B); |
444 |
> |
D(NSLog(@"%s = %f %d", __PRETTY_FUNCTION__, M, B)); |
445 |
|
PrefsReplaceInt32("ramsize", B); |
446 |
|
[MB setFloatValue: M]; |
447 |
|
edited = YES; |
485 |
|
float M = [MB floatValue]; |
486 |
|
int B = (int) (M * 1024 * 1024); |
487 |
|
|
488 |
< |
NSLog(@"%s = %f %d", __PRETTY_FUNCTION__, M, B); |
488 |
> |
D(NSLog(@"%s = %f %d", __PRETTY_FUNCTION__, M, B)); |
489 |
|
PrefsReplaceInt32("ramsize", B); |
490 |
|
[bytes setIntValue: B]; |
491 |
|
edited = YES; |
499 |
|
edited = YES; |
500 |
|
} |
501 |
|
|
488 |
– |
- (IBAction) EditRAMsize: (NSTextField *)sender |
489 |
– |
{ |
490 |
– |
int B = [bytes intValue]; |
491 |
– |
float M = B / (1024.0 * 1024.0); |
492 |
– |
|
493 |
– |
NSLog(@"%s = %d %f", __PRETTY_FUNCTION__, B, M); |
494 |
– |
PrefsReplaceInt32("ramsize", B); |
495 |
– |
[MB setFloatValue: M]; |
496 |
– |
edited = YES; |
497 |
– |
} |
498 |
– |
|
502 |
|
- (IBAction) EditROMpath: (NSTextField *)sender |
503 |
|
{ |
504 |
|
NSString *path = [ROMfile stringValue]; |
534 |
|
if ( strcmp(str, path) == 0 ) |
535 |
|
{ |
536 |
|
PrefsRemoveItem("disk", tmp); |
537 |
< |
D(NSLog(@"%s - Deleted prefs entry \"disk\", %d", __PRETTY_FUNCTION__, tmp)); |
537 |
> |
D(NSLog(@"%s - Deleted prefs entry \"disk\", %d", |
538 |
> |
__PRETTY_FUNCTION__, tmp)); |
539 |
|
edited = YES; |
540 |
|
break; |
541 |
|
} |
544 |
|
|
545 |
|
if ( str == NULL ) |
546 |
|
{ |
547 |
< |
NSLog(@"%s - Couldn't find any disk preference to match %s", __PRETTY_FUNCTION__, path); |
547 |
> |
NSLog(@"%s - Couldn't find any disk preference to match %s", |
548 |
> |
__PRETTY_FUNCTION__, path); |
549 |
|
return NULL; |
550 |
|
} |
551 |
|
|
556 |
|
} |
557 |
|
else |
558 |
|
{ |
559 |
< |
WarningSheet(@"Please select a volume first", @"", @"OK", panel); |
559 |
> |
WarningSheet(@"Please select a volume first", panel); |
560 |
|
return NULL; |
561 |
|
} |
562 |
|
} |
664 |
|
// Window already created by NIB file, just display |
665 |
|
[panel makeKeyAndOrderFront:self]; |
666 |
|
WarningSheet(@"Compiled-in memory model does not support 24bit", |
667 |
< |
@"Disabling Mac Classic emulation", @"OK", panel); |
667 |
> |
@"Disabling Mac Classic emulation", nil, panel); |
668 |
|
cpu = [CPU68030 tag]; |
669 |
|
PrefsReplaceInt32("cpu", cpu); |
670 |
|
tmp = [IIci tag]; |