From f67d3947d6b753d5c25828637cead4d6448ca3b8 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Mon, 5 Apr 2021 23:08:43 +0300 Subject: [PATCH] UI Updates --- Cocoa/Document.m | 6 ++++-- Core/gb.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cocoa/Document.m b/Cocoa/Document.m index a5d291e..9d2d7f7 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -770,7 +770,6 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency) [self.view screenSizeChanged]; [self loadROM]; [self reset:nil]; - } - (void) initMemoryView @@ -875,6 +874,9 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency) [[NSBundle mainBundle] loadNibNamed:@"GBS" owner:self topLevelObjects:nil]; [_mainWindow setContentSize:self.gbsPlayerView.bounds.size]; _mainWindow.styleMask &= ~NSWindowStyleMaskResizable; + dispatch_async(dispatch_get_main_queue(), ^{ // Cocoa is weird, no clue why it's needed + [_mainWindow standardWindowButton:NSWindowZoomButton].enabled = false; + }); [_mainWindow.contentView addSubview:self.gbsPlayerView]; self.gbsTitle.stringValue = [NSString stringWithCString:info->title encoding:NSISOLatin1StringEncoding] ?: @"GBS Player"; @@ -913,7 +915,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency) GB_load_battery(&gb, [[self.fileURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"ram"].path.UTF8String); } else if ([[[self.fileType pathExtension] lowercaseString] isEqualToString:@"gbs"]) { - GB_gbs_info_t info; + __block GB_gbs_info_t info; GB_load_gbs(&gb, self.fileURL.path.UTF8String, &info); [self prepareGBSInterface:&info]; } diff --git a/Core/gb.c b/Core/gb.c index 18774d0..fe75b26 100644 --- a/Core/gb.c +++ b/Core/gb.c @@ -412,7 +412,7 @@ int GB_load_gbs(GB_gameboy_t *gb, const char *path, GB_gbs_info_t *info) LE16(gb->gbs_header.play_address), LE16(gb->gbs_header.play_address) >> 8, 0x18, // JR pc ± $XX - -10 // To HALT + -10 // To HALT }, 13); GB_gbs_switch_track(gb, gb->gbs_header.first_track - 1);