Drop BOOLs

This commit is contained in:
Lior Halphon 2021-10-23 13:36:58 +03:00
parent fc10a90dec
commit 5808d4485f
18 changed files with 75 additions and 75 deletions

View File

@ -86,7 +86,7 @@ static uint32_t color_to_int(NSColor *color)
} }
if ([[NSProcessInfo processInfo].arguments containsObject:@"--update-launch"]) { if ([[NSProcessInfo processInfo].arguments containsObject:@"--update-launch"]) {
[NSApp activateIgnoringOtherApps:YES]; [NSApp activateIgnoringOtherApps:true];
} }
} }
@ -106,7 +106,7 @@ static uint32_t color_to_int(NSColor *color)
NSRect new = [_preferencesWindow frameRectForContentRect:tab.frame]; NSRect new = [_preferencesWindow frameRectForContentRect:tab.frame];
new.origin.x = old.origin.x; new.origin.x = old.origin.x;
new.origin.y = old.origin.y + (old.size.height - new.size.height); new.origin.y = old.origin.y + (old.size.height - new.size.height);
[_preferencesWindow setFrame:new display:YES animate:_preferencesWindow.visible]; [_preferencesWindow setFrame:new display:true animate:_preferencesWindow.visible];
[_preferencesWindow.contentView addSubview:tab]; [_preferencesWindow.contentView addSubview:tab];
} }
@ -171,7 +171,7 @@ static uint32_t color_to_int(NSColor *color)
- (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification - (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
{ {
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:notification.identifier display:YES]; [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:notification.identifier display:true];
} }
- (void)updateFound - (void)updateFound
@ -242,7 +242,7 @@ static uint32_t color_to_int(NSColor *color)
[[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@UPDATE_SERVER "/latest_version"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { [[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@UPDATE_SERVER "/latest_version"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self.updatesSpinner stopAnimation:nil]; [self.updatesSpinner stopAnimation:nil];
[self.updatesButton setEnabled:YES]; [self.updatesButton setEnabled:true];
}); });
if ([(NSHTTPURLResponse *)response statusCode] == 200) { if ([(NSHTTPURLResponse *)response statusCode] == 200) {
NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
@ -312,7 +312,7 @@ static uint32_t color_to_int(NSColor *color)
_downloadDirectory = [[[NSFileManager defaultManager] URLForDirectory:NSItemReplacementDirectory _downloadDirectory = [[[NSFileManager defaultManager] URLForDirectory:NSItemReplacementDirectory
inDomain:NSUserDomainMask inDomain:NSUserDomainMask
appropriateForURL:[[NSBundle mainBundle] bundleURL] appropriateForURL:[[NSBundle mainBundle] bundleURL]
create:YES create:true
error:nil] path]; error:nil] path];
NSTask *unzipTask; NSTask *unzipTask;
if (!_downloadDirectory) { if (!_downloadDirectory) {

View File

@ -321,7 +321,7 @@ static void infraredStateChanged(GB_gameboy_t *gb, bool on)
{ {
if (_gbsVisualizer) { if (_gbsVisualizer) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[_gbsVisualizer setNeedsDisplay:YES]; [_gbsVisualizer setNeedsDisplay:true];
}); });
} }
[self.view flip]; [self.view flip];
@ -422,7 +422,7 @@ static void infraredStateChanged(GB_gameboy_t *gb, bool on)
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"Mute"]) { if (![[NSUserDefaults standardUserDefaults] boolForKey:@"Mute"]) {
[self.audioClient start]; [self.audioClient start];
} }
hex_timer = [NSTimer timerWithTimeInterval:0.25 target:self selector:@selector(reloadMemoryView) userInfo:nil repeats:YES]; hex_timer = [NSTimer timerWithTimeInterval:0.25 target:self selector:@selector(reloadMemoryView) userInfo:nil repeats:true];
[[NSRunLoop mainRunLoop] addTimer:hex_timer forMode:NSDefaultRunLoopMode]; [[NSRunLoop mainRunLoop] addTimer:hex_timer forMode:NSDefaultRunLoopMode];
/* Clear pending alarms, don't play alarms while playing */ /* Clear pending alarms, don't play alarms while playing */
@ -502,7 +502,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
[audioLock unlock]; [audioLock unlock];
[self.audioClient stop]; [self.audioClient stop];
self.audioClient = nil; self.audioClient = nil;
self.view.mouseHidingEnabled = NO; self.view.mouseHidingEnabled = false;
GB_save_battery(&gb, [[[self.fileURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"sav"].path UTF8String]); GB_save_battery(&gb, [[[self.fileURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"sav"].path UTF8String]);
GB_save_cheats(&gb, [[[self.fileURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"cht"].path UTF8String]); GB_save_cheats(&gb, [[[self.fileURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"cht"].path UTF8String]);
unsigned time_to_alarm = GB_time_to_alarm(&gb); unsigned time_to_alarm = GB_time_to_alarm(&gb);
@ -684,13 +684,13 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
window_frame.size.width); window_frame.size.width);
window_frame.size.height = MAX([[NSUserDefaults standardUserDefaults] integerForKey:@"LastWindowHeight"], window_frame.size.height = MAX([[NSUserDefaults standardUserDefaults] integerForKey:@"LastWindowHeight"],
window_frame.size.height); window_frame.size.height);
[self.mainWindow setFrame:window_frame display:YES]; [self.mainWindow setFrame:window_frame display:true];
self.vramStatusLabel.cell.backgroundStyle = NSBackgroundStyleRaised; self.vramStatusLabel.cell.backgroundStyle = NSBackgroundStyleRaised;
NSUInteger height_diff = self.vramWindow.frame.size.height - self.vramWindow.contentView.frame.size.height; NSUInteger height_diff = self.vramWindow.frame.size.height - self.vramWindow.contentView.frame.size.height;
CGRect vram_window_rect = self.vramWindow.frame; CGRect vram_window_rect = self.vramWindow.frame;
vram_window_rect.size.height = 384 + height_diff + 48; vram_window_rect.size.height = 384 + height_diff + 48;
[self.vramWindow setFrame:vram_window_rect display:YES animate:NO]; [self.vramWindow setFrame:vram_window_rect display:true animate:false];
self.consoleWindow.title = [NSString stringWithFormat:@"Debug Console %@", [self.fileURL.path lastPathComponent]]; self.consoleWindow.title = [NSString stringWithFormat:@"Debug Console %@", [self.fileURL.path lastPathComponent]];
@ -846,7 +846,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
+ (BOOL)autosavesInPlace + (BOOL)autosavesInPlace
{ {
return YES; return true;
} }
- (NSString *)windowNibName - (NSString *)windowNibName
@ -858,7 +858,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type - (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type
{ {
return YES; return true;
} }
- (IBAction)changeGBSTrack:(id)sender - (IBAction)changeGBSTrack:(id)sender
@ -1061,7 +1061,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
- (void) windowWillExitFullScreen:(NSNotification *)notification - (void) windowWillExitFullScreen:(NSNotification *)notification
{ {
fullScreen = false; fullScreen = false;
self.view.mouseHidingEnabled = NO; self.view.mouseHidingEnabled = false;
} }
- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)newFrame - (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)newFrame
@ -1156,14 +1156,14 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
} }
if (![console_output_timer isValid]) { if (![console_output_timer isValid]) {
console_output_timer = [NSTimer timerWithTimeInterval:(NSTimeInterval)0.05 target:self selector:@selector(appendPendingOutput) userInfo:nil repeats:NO]; console_output_timer = [NSTimer timerWithTimeInterval:(NSTimeInterval)0.05 target:self selector:@selector(appendPendingOutput) userInfo:nil repeats:false];
[[NSRunLoop mainRunLoop] addTimer:console_output_timer forMode:NSDefaultRunLoopMode]; [[NSRunLoop mainRunLoop] addTimer:console_output_timer forMode:NSDefaultRunLoopMode];
} }
[console_output_lock unlock]; [console_output_lock unlock];
/* Make sure mouse is not hidden while debugging */ /* Make sure mouse is not hidden while debugging */
self.view.mouseHidingEnabled = NO; self.view.mouseHidingEnabled = false;
} }
- (IBAction)showConsoleWindow:(id)sender - (IBAction)showConsoleWindow:(id)sender
@ -1390,7 +1390,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
bitmapInfo, bitmapInfo,
provider, provider,
NULL, NULL,
YES, true,
renderingIntent); renderingIntent);
CGDataProviderRelease(provider); CGDataProviderRelease(provider);
CGColorSpaceRelease(colorSpaceRef); CGColorSpaceRelease(colorSpaceRef);
@ -1598,7 +1598,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
} }
[self.memoryBankInput setStringValue:[NSString stringWithFormat:@"$%x", byteArray.selectedBank]]; [self.memoryBankInput setStringValue:[NSString stringWithFormat:@"$%x", byteArray.selectedBank]];
[hex_controller reloadData]; [hex_controller reloadData];
[self.memoryView setNeedsDisplay:YES]; [self.memoryView setNeedsDisplay:true];
} }
- (GB_gameboy_t *) gameboy - (GB_gameboy_t *) gameboy
@ -1608,7 +1608,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
+ (BOOL)canConcurrentlyReadDocumentsOfType:(NSString *)typeName + (BOOL)canConcurrentlyReadDocumentsOfType:(NSString *)typeName
{ {
return YES; return true;
} }
- (void)cameraRequestUpdate - (void)cameraRequestUpdate
@ -1756,7 +1756,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
break; break;
} }
window_rect.origin.y -= window_rect.size.height; window_rect.origin.y -= window_rect.size.height;
[self.vramWindow setFrame:window_rect display:YES animate:YES]; [self.vramWindow setFrame:window_rect display:true animate:true];
} }
- (void)mouseDidLeaveImageView:(GBImageView *)view - (void)mouseDidLeaveImageView:(GBImageView *)view
@ -1851,7 +1851,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
case 0: case 0:
return [Document imageFromData:[NSData dataWithBytesNoCopy:oamInfo[row].image return [Document imageFromData:[NSData dataWithBytesNoCopy:oamInfo[row].image
length:64 * 4 * 2 length:64 * 4 * 2
freeWhenDone:NO] freeWhenDone:false]
width:8 width:8
height:oamHeight height:oamHeight
scale:16.0/oamHeight]; scale:16.0/oamHeight];
@ -1894,7 +1894,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
- (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row - (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row
{ {
return NO; return false;
} }
- (IBAction)showVRAMViewer:(id)sender - (IBAction)showVRAMViewer:(id)sender
@ -1924,7 +1924,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
frame.size = self.feedImageView.image.size; frame.size = self.feedImageView.image.size;
[self.printerFeedWindow setContentMaxSize:frame.size]; [self.printerFeedWindow setContentMaxSize:frame.size];
frame.size.height += self.printerFeedWindow.frame.size.height - self.printerFeedWindow.contentView.frame.size.height; frame.size.height += self.printerFeedWindow.frame.size.height - self.printerFeedWindow.contentView.frame.size.height;
[self.printerFeedWindow setFrame:frame display:NO animate: self.printerFeedWindow.isVisible]; [self.printerFeedWindow setFrame:frame display:false animate: self.printerFeedWindow.isVisible];
[self.printerFeedWindow orderFront:NULL]; [self.printerFeedWindow orderFront:NULL];
}); });
@ -1955,8 +1955,8 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgRef]; NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgRef];
[imageRep setSize:(NSSize){160, self.feedImageView.image.size.height / 2}]; [imageRep setSize:(NSSize){160, self.feedImageView.image.size.height / 2}];
NSData *data = [imageRep representationUsingType:NSBitmapImageFileTypePNG properties:@{}]; NSData *data = [imageRep representationUsingType:NSBitmapImageFileTypePNG properties:@{}];
[data writeToURL:savePanel.URL atomically:NO]; [data writeToURL:savePanel.URL atomically:false];
[self.printerFeedWindow setIsVisible:NO]; [self.printerFeedWindow setIsVisible:false];
} }
if (shouldResume) { if (shouldResume) {
[self start]; [self start];
@ -2077,9 +2077,9 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
- (BOOL)splitView:(GBSplitView *)splitView canCollapseSubview:(NSView *)subview; - (BOOL)splitView:(GBSplitView *)splitView canCollapseSubview:(NSView *)subview;
{ {
if ([[splitView arrangedSubviews] lastObject] == subview) { if ([[splitView arrangedSubviews] lastObject] == subview) {
return YES; return true;
} }
return NO; return false;
} }
- (CGFloat)splitView:(GBSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex - (CGFloat)splitView:(GBSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex
@ -2095,9 +2095,9 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
- (BOOL)splitView:(GBSplitView *)splitView shouldAdjustSizeOfSubview:(NSView *)view - (BOOL)splitView:(GBSplitView *)splitView shouldAdjustSizeOfSubview:(NSView *)view
{ {
if ([[splitView arrangedSubviews] lastObject] == view) { if ([[splitView arrangedSubviews] lastObject] == view) {
return NO; return false;
} }
return YES; return true;
} }
- (void)splitViewDidResizeSubviews:(NSNotification *)notification - (void)splitViewDidResizeSubviews:(NSNotification *)notification
@ -2277,7 +2277,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
NSBitmapImageRep *imageRep = (NSBitmapImageRep *)image.representations.firstObject; NSBitmapImageRep *imageRep = (NSBitmapImageRep *)image.representations.firstObject;
NSData *data = [imageRep representationUsingType:NSBitmapImageFileTypePNG properties:@{}]; NSData *data = [imageRep representationUsingType:NSBitmapImageFileTypePNG properties:@{}];
[data writeToFile:filename atomically:NO]; [data writeToFile:filename atomically:false];
[self.osdView displayText:@"Screenshot saved"]; [self.osdView displayText:@"Screenshot saved"];
} }
@ -2293,7 +2293,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
[savePanel orderOut:self]; [savePanel orderOut:self];
NSBitmapImageRep *imageRep = (NSBitmapImageRep *)image.representations.firstObject; NSBitmapImageRep *imageRep = (NSBitmapImageRep *)image.representations.firstObject;
NSData *data = [imageRep representationUsingType:NSBitmapImageFileTypePNG properties:@{}]; NSData *data = [imageRep representationUsingType:NSBitmapImageFileTypePNG properties:@{}];
[data writeToURL:savePanel.URL atomically:NO]; [data writeToURL:savePanel.URL atomically:false];
[[NSUserDefaults standardUserDefaults] setObject:savePanel.URL.path.stringByDeletingLastPathComponent [[NSUserDefaults standardUserDefaults] setObject:savePanel.URL.path.stringByDeletingLastPathComponent
forKey:@"GBScreenshotFolder"]; forKey:@"GBScreenshotFolder"];
} }

View File

@ -90,7 +90,7 @@ static OSStatus render(
{ {
OSErr err = AudioOutputUnitStart(audioUnit); OSErr err = AudioOutputUnitStart(audioUnit);
NSAssert1(err == noErr, @"Error starting unit: %hd", err); NSAssert1(err == noErr, @"Error starting unit: %hd", err);
_playing = YES; _playing = true;
} }
@ -98,7 +98,7 @@ static OSStatus render(
-(void) stop -(void) stop
{ {
AudioOutputUnitStop(audioUnit); AudioOutputUnitStop(audioUnit);
_playing = NO; _playing = false;
} }
-(void) dealloc -(void) dealloc

View File

@ -5,12 +5,12 @@
- (void)awakeFromNib - (void)awakeFromNib
{ {
self.wantsLayer = YES; self.wantsLayer = true;
} }
- (BOOL)wantsUpdateLayer - (BOOL)wantsUpdateLayer
{ {
return YES; return true;
} }
- (void)updateLayer - (void)updateLayer

View File

@ -114,7 +114,7 @@
return _fieldEditor; return _fieldEditor;
} }
_fieldEditor = [[GBCheatTextView alloc] initWithFrame:controlView.frame]; _fieldEditor = [[GBCheatTextView alloc] initWithFrame:controlView.frame];
_fieldEditor.fieldEditor = YES; _fieldEditor.fieldEditor = true;
_fieldEditor.usesAddressFormat = self.usesAddressFormat; _fieldEditor.usesAddressFormat = self.usesAddressFormat;
return _fieldEditor; return _fieldEditor;
} }

View File

@ -52,7 +52,7 @@
if (row >= cheatCount) { if (row >= cheatCount) {
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
return @(YES); return @YES;
case 1: case 1:
return @NO; return @NO;
@ -67,7 +67,7 @@
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
return @(NO); return @NO;
case 1: case 1:
return @(cheats[row]->enabled); return @(cheats[row]->enabled);

View File

@ -42,7 +42,7 @@ static inline double scale_channel(uint8_t x)
- (BOOL)drawsBackground - (BOOL)drawsBackground
{ {
return YES; return true;
} }
@end @end

View File

@ -34,6 +34,6 @@
- (void) filterChanged - (void) filterChanged
{ {
self.shader = nil; self.shader = nil;
[self setNeedsDisplay:YES]; [self setNeedsDisplay:true];
} }
@end @end

View File

@ -69,8 +69,8 @@
- (void)close - (void)close
{ {
joystick_configuration_state = -1; joystick_configuration_state = -1;
[self.configureJoypadButton setEnabled:YES]; [self.configureJoypadButton setEnabled:true];
[self.skipButton setEnabled:NO]; [self.skipButton setEnabled:false];
[self.configureJoypadButton setTitle:@"Configure Controller"]; [self.configureJoypadButton setTitle:@"Configure Controller"];
[super close]; [super close];
} }
@ -268,12 +268,12 @@
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
is_button_being_modified = true; is_button_being_modified = true;
button_being_modified = row; button_being_modified = row;
tableView.enabled = NO; tableView.enabled = false;
self.playerListButton.enabled = NO; self.playerListButton.enabled = false;
[tableView reloadData]; [tableView reloadData];
[self makeFirstResponder:self]; [self makeFirstResponder:self];
}); });
return NO; return false;
} }
-(void)keyDown:(NSEvent *)theEvent -(void)keyDown:(NSEvent *)theEvent
@ -289,8 +289,8 @@
[[NSUserDefaults standardUserDefaults] setInteger:theEvent.keyCode [[NSUserDefaults standardUserDefaults] setInteger:theEvent.keyCode
forKey:button_to_preference_name(button_being_modified, self.playerListButton.selectedTag)]; forKey:button_to_preference_name(button_being_modified, self.playerListButton.selectedTag)];
self.controlsTableView.enabled = YES; self.controlsTableView.enabled = true;
self.playerListButton.enabled = YES; self.playerListButton.enabled = true;
[self.controlsTableView reloadData]; [self.controlsTableView reloadData];
[self makeFirstResponder:self.controlsTableView]; [self makeFirstResponder:self.controlsTableView];
} }
@ -410,8 +410,8 @@
- (IBAction) configureJoypad:(id)sender - (IBAction) configureJoypad:(id)sender
{ {
[self.configureJoypadButton setEnabled:NO]; [self.configureJoypadButton setEnabled:false];
[self.skipButton setEnabled:YES]; [self.skipButton setEnabled:true];
joystick_being_configured = nil; joystick_being_configured = nil;
[self advanceConfigurationStateMachine]; [self advanceConfigurationStateMachine];
} }
@ -432,8 +432,8 @@
} }
else { else {
joystick_configuration_state = -1; joystick_configuration_state = -1;
[self.configureJoypadButton setEnabled:YES]; [self.configureJoypadButton setEnabled:true];
[self.skipButton setEnabled:NO]; [self.skipButton setEnabled:false];
[self.configureJoypadButton setTitle:@"Configure Joypad"]; [self.configureJoypadButton setTitle:@"Configure Joypad"];
} }
} }
@ -565,8 +565,8 @@
- (IBAction)selectOtherBootROMFolder:(id)sender - (IBAction)selectOtherBootROMFolder:(id)sender
{ {
NSOpenPanel *panel = [[NSOpenPanel alloc] init]; NSOpenPanel *panel = [[NSOpenPanel alloc] init];
[panel setCanChooseDirectories:YES]; [panel setCanChooseDirectories:true];
[panel setCanChooseFiles:NO]; [panel setCanChooseFiles:false];
[panel setPrompt:@"Select"]; [panel setPrompt:@"Select"];
[panel setDirectoryURL:[[NSUserDefaults standardUserDefaults] URLForKey:@"GBBootROMsFolder"]]; [panel setDirectoryURL:[[NSUserDefaults standardUserDefaults] URLForKey:@"GBBootROMsFolder"]];
[panel beginSheetModalForWindow:self completionHandler:^(NSModalResponse result) { [panel beginSheetModalForWindow:self completionHandler:^(NSModalResponse result) {
@ -590,12 +590,12 @@
[self.bootROMsFolderItem setTitle:[url lastPathComponent]]; [self.bootROMsFolderItem setTitle:[url lastPathComponent]];
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:[url path]]; NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:[url path]];
[icon setSize:NSMakeSize(16, 16)]; [icon setSize:NSMakeSize(16, 16)];
[self.bootROMsFolderItem setHidden:NO]; [self.bootROMsFolderItem setHidden:false];
[self.bootROMsFolderItem setImage:icon]; [self.bootROMsFolderItem setImage:icon];
[self.bootROMsButton selectItemAtIndex:1]; [self.bootROMsButton selectItemAtIndex:1];
} }
else { else {
[self.bootROMsFolderItem setHidden:YES]; [self.bootROMsFolderItem setHidden:true];
[self.bootROMsButton selectItemAtIndex:0]; [self.bootROMsButton selectItemAtIndex:0];
} }
} }

View File

@ -8,7 +8,7 @@
- (void)setDividerColor:(NSColor *)color - (void)setDividerColor:(NSColor *)color
{ {
_dividerColor = color; _dividerColor = color;
[self setNeedsDisplay:YES]; [self setNeedsDisplay:true];
} }
- (NSColor *)dividerColor - (NSColor *)dividerColor

View File

@ -17,7 +17,7 @@
return field_editor; return field_editor;
} }
field_editor = [[GBTerminalTextView alloc] init]; field_editor = [[GBTerminalTextView alloc] init];
[field_editor setFieldEditor:YES]; [field_editor setFieldEditor:true];
field_editor.gb = self.gb; field_editor.gb = self.gb;
return field_editor; return field_editor;
} }
@ -109,7 +109,7 @@
[self updateReverseSearch]; [self updateReverseSearch];
} }
else { else {
[self setNeedsDisplay:YES]; [self setNeedsDisplay:true];
reverse_search_mode = true; reverse_search_mode = true;
} }

View File

@ -18,7 +18,7 @@ typedef enum {
@property (nonatomic, weak) IBOutlet Document *document; @property (nonatomic, weak) IBOutlet Document *document;
@property (nonatomic) GB_gameboy_t *gb; @property (nonatomic) GB_gameboy_t *gb;
@property (nonatomic) GB_frame_blending_mode_t frameBlendingMode; @property (nonatomic) GB_frame_blending_mode_t frameBlendingMode;
@property (nonatomic, getter=isMouseHidingEnabled) BOOL mouseHidingEnabled; @property (nonatomic, getter=isMouseHidingEnabled) bool mouseHidingEnabled;
@property (nonatomic) bool isRewinding; @property (nonatomic) bool isRewinding;
@property (nonatomic, strong) NSView *internalView; @property (nonatomic, strong) NSView *internalView;
@property (weak) GBOSDView *osdView; @property (weak) GBOSDView *osdView;

View File

@ -106,9 +106,9 @@ static const uint8_t workboy_vk_to_key[] = {
{ {
uint32_t *image_buffers[3]; uint32_t *image_buffers[3];
unsigned char current_buffer; unsigned char current_buffer;
BOOL mouse_hidden; bool mouse_hidden;
NSTrackingArea *tracking_area; NSTrackingArea *tracking_area;
BOOL _mouseHidingEnabled; bool _mouseHidingEnabled;
bool axisActive[2]; bool axisActive[2];
bool underclockKeyDown; bool underclockKeyDown;
double clockMultiplier; double clockMultiplier;
@ -183,7 +183,7 @@ static const uint8_t workboy_vk_to_key[] = {
- (void) setFrameBlendingMode:(GB_frame_blending_mode_t)frameBlendingMode - (void) setFrameBlendingMode:(GB_frame_blending_mode_t)frameBlendingMode
{ {
_frameBlendingMode = frameBlendingMode; _frameBlendingMode = frameBlendingMode;
[self setNeedsDisplay:YES]; [self setNeedsDisplay:true];
} }
@ -585,7 +585,7 @@ static const uint8_t workboy_vk_to_key[] = {
- (BOOL)acceptsFirstResponder - (BOOL)acceptsFirstResponder
{ {
return YES; return true;
} }
- (void)mouseEntered:(NSEvent *)theEvent - (void)mouseEntered:(NSEvent *)theEvent
@ -610,7 +610,7 @@ static const uint8_t workboy_vk_to_key[] = {
[super mouseExited:theEvent]; [super mouseExited:theEvent];
} }
- (void)setMouseHidingEnabled:(BOOL)mouseHidingEnabled - (void)setMouseHidingEnabled:(bool)mouseHidingEnabled
{ {
if (mouseHidingEnabled == _mouseHidingEnabled) return; if (mouseHidingEnabled == _mouseHidingEnabled) return;
@ -625,7 +625,7 @@ static const uint8_t workboy_vk_to_key[] = {
} }
} }
- (BOOL)isMouseHidingEnabled - (bool)isMouseHidingEnabled
{ {
return _mouseHidingEnabled; return _mouseHidingEnabled;
} }

View File

@ -19,7 +19,7 @@
NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pf shareContext:nil]; NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pf shareContext:nil];
self.internalView = [[GBOpenGLView alloc] initWithFrame:self.frame pixelFormat:pf]; self.internalView = [[GBOpenGLView alloc] initWithFrame:self.frame pixelFormat:pf];
((GBOpenGLView *)self.internalView).wantsBestResolutionOpenGLSurface = YES; ((GBOpenGLView *)self.internalView).wantsBestResolutionOpenGLSurface = true;
((GBOpenGLView *)self.internalView).openGLContext = context; ((GBOpenGLView *)self.internalView).openGLContext = context;
} }
@ -27,8 +27,8 @@
{ {
[super flip]; [super flip];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self.internalView setNeedsDisplay:YES]; [self.internalView setNeedsDisplay:true];
[self setNeedsDisplay:YES]; [self setNeedsDisplay:true];
}); });
} }

View File

@ -94,7 +94,7 @@ static const vector_float2 rect[] =
withString:scaler_source]; withString:scaler_source];
MTLCompileOptions *options = [[MTLCompileOptions alloc] init]; MTLCompileOptions *options = [[MTLCompileOptions alloc] init];
options.fastMathEnabled = YES; options.fastMathEnabled = true;
id<MTLLibrary> library = [device newLibraryWithSource:shader_source id<MTLLibrary> library = [device newLibraryWithSource:shader_source
options:options options:options
error:&error]; error:&error];
@ -210,7 +210,7 @@ static const vector_float2 rect[] =
{ {
[super flip]; [super flip];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[(MTKView *)self.internalView setNeedsDisplay:YES]; [(MTKView *)self.internalView setNeedsDisplay:true];
}); });
} }

View File

@ -10,7 +10,7 @@ static GBWarningPopover *lastPopover;
lastPopover = [[self alloc] init]; lastPopover = [[self alloc] init];
[lastPopover setBehavior:NSPopoverBehaviorApplicationDefined]; [lastPopover setBehavior:NSPopoverBehaviorApplicationDefined];
[lastPopover setAnimates:YES]; [lastPopover setAnimates:true];
lastPopover.contentViewController = [[NSViewController alloc] initWithNibName:@"PopoverView" bundle:nil]; lastPopover.contentViewController = [[NSViewController alloc] initWithNibName:@"PopoverView" bundle:nil];
NSTextField *field = (NSTextField *)lastPopover.contentViewController.view; NSTextField *field = (NSTextField *)lastPopover.contentViewController.view;
[field setStringValue:contents]; [field setStringValue:contents];
@ -20,7 +20,7 @@ static GBWarningPopover *lastPopover;
[lastPopover setContentSize:textSize]; [lastPopover setContentSize:textSize];
if (!view.window.isVisible) { if (!view.window.isVisible) {
[view.window setIsVisible:YES]; [view.window setIsVisible:true];
} }
[lastPopover showRelativeToRect:view.bounds [lastPopover showRelativeToRect:view.bounds

View File

@ -98,7 +98,7 @@ static void HIDReport(void *context, IOReturn result, void *sender, IOHIDReportT
uint32_t reportID, uint8_t *report, CFIndex reportLength) uint32_t reportID, uint8_t *report, CFIndex reportLength)
{ {
if (reportLength) { if (reportLength) {
[(__bridge JOYController *)context gotReport:[[NSData alloc] initWithBytesNoCopy:report length:reportLength freeWhenDone:NO]]; [(__bridge JOYController *)context gotReport:[[NSData alloc] initWithBytesNoCopy:report length:reportLength freeWhenDone:false]];
} }
} }

View File

@ -43,10 +43,10 @@ static OSStatus render(CGContextRef cgContext, CFURLRef url, bool showBorder)
bitmapInfo, bitmapInfo,
provider, provider,
NULL, NULL,
YES, true,
renderingIntent); renderingIntent);
CGContextSetInterpolationQuality(cgContext, kCGInterpolationNone); CGContextSetInterpolationQuality(cgContext, kCGInterpolationNone);
NSGraphicsContext *context = [NSGraphicsContext graphicsContextWithGraphicsPort:(void *)cgContext flipped:NO]; NSGraphicsContext *context = [NSGraphicsContext graphicsContextWithGraphicsPort:(void *)cgContext flipped:false];
[NSGraphicsContext setCurrentContext:context]; [NSGraphicsContext setCurrentContext:context];