diff --git a/desmume/src/cocoa/DeSmuME.cbp b/desmume/src/cocoa/DeSmuME.cbp index 195890a37..dd60be004 100644 --- a/desmume/src/cocoa/DeSmuME.cbp +++ b/desmume/src/cocoa/DeSmuME.cbp @@ -70,13 +70,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA]]> - + + diff --git a/desmume/src/cocoa/DeSmuME.xcodeproj/project.pbxproj b/desmume/src/cocoa/DeSmuME.xcodeproj/project.pbxproj index d1f48d2e6..643651bc6 100644 --- a/desmume/src/cocoa/DeSmuME.xcodeproj/project.pbxproj +++ b/desmume/src/cocoa/DeSmuME.xcodeproj/project.pbxproj @@ -465,11 +465,15 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = DESMUME_COCOA; + GCC_PREPROCESSOR_DEFINITIONS = ( + HAVE_LIBZ, + DESMUME_COCOA, + ); GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-lz"; PREBINDING = NO; SDKROOT = macosx10.4; }; @@ -480,10 +484,14 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - GCC_PREPROCESSOR_DEFINITIONS = DESMUME_COCOA; + GCC_PREPROCESSOR_DEFINITIONS = ( + HAVE_LIBZ, + DESMUME_COCOA, + ); GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_LDFLAGS = "-lz"; PREBINDING = NO; SDKROOT = macosx10.4; }; diff --git a/desmume/src/cocoa/main.m b/desmume/src/cocoa/main.m index deec232aa..93962936a 100644 --- a/desmume/src/cocoa/main.m +++ b/desmume/src/cocoa/main.m @@ -174,7 +174,7 @@ void CreateMenu(AppDelegate *delegate) [file addItem:[NSMenuItem separatorItem]]; - temp = [file addItemWithTitle:NSLocalizedString(@"Save State", nil) action:@selector(saveTo:) keyEquivalent:@""]; + temp = [file addItemWithTitle:NSLocalizedString(@"Save State", nil) action:nil keyEquivalent:@""]; NSMenu *save_state_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Save State", nil)]; [temp setSubmenu:save_state_menu]; @@ -185,11 +185,9 @@ void CreateMenu(AppDelegate *delegate) for(i = 0; i < SAVE_SLOTS; i++) { saveSlot_item[i] = [save_state_menu addItemWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Slot %d", nil), i] action:@selector(saveToSlot:) keyEquivalent:@""]; - [saveSlot_item[i] setEnabled:NO]; - loadSlot_item[i] = [load_state_menu addItemWithTitle:[saveSlot_item[i] title] action:@selector(loadFromSlot:) keyEquivalent:@""]; - [loadSlot_item[i] setEnabled:NO]; } + //fixme changed save state item function names /* To be implemented when saves.h provides a way to get the time of a save that's not string/human formatted... @@ -225,6 +223,10 @@ a way to get the time of a save that's not a string / human formatted... temp = [load_state_menu addItemWithTitle:@"View States" action:nil keyEquivalent:@""]; */ + + [save_state_menu release]; + [load_state_menu release]; + #else for(i = 0; i < SAVE_SLOTS; i++) { diff --git a/desmume/src/cocoa/main_window.m b/desmume/src/cocoa/main_window.m index 956da68a2..14aa28d93 100644 --- a/desmume/src/cocoa/main_window.m +++ b/desmume/src/cocoa/main_window.m @@ -1275,7 +1275,6 @@ NSMenuItem *screenshot_to_file_item; [volume_item[i] setTarget:self]; } - //Update the ROM Info window if([self ROMLoaded] == YES) [ROMInfo changeDS:self]; @@ -1288,13 +1287,14 @@ NSMenuItem *screenshot_to_file_item; //This function is called automaticlly by Cocoa //when it needs to know if a menu item should be greyed out + int i; + if([self ROMLoaded] == NO) { //if no rom is loaded, various options are disables if(item == close_rom_item)return NO; if(item == rom_info_item)return NO; if(item == save_state_as_item)return NO; if(item == load_state_from_item)return NO; - int i; for(i = 0; i < MAX_SLOTS; i++) { if(item == saveSlot_item[i])return NO; @@ -1307,6 +1307,13 @@ NSMenuItem *screenshot_to_file_item; if(item == screenshot_to_file_item)return NO; } + + else + + for(i = 0; i < MAX_SLOTS; i++) + if(item == loadSlot_item[i]) + if([self saveStateExists:i]==NO)return NO; + return YES; }