diff --git a/desmume/src/cocoa/DeSmuME.xcodeproj/project.pbxproj b/desmume/src/cocoa/DeSmuME.xcodeproj/project.pbxproj index 8db87849a..4ad7293d0 100644 --- a/desmume/src/cocoa/DeSmuME.xcodeproj/project.pbxproj +++ b/desmume/src/cocoa/DeSmuME.xcodeproj/project.pbxproj @@ -24,25 +24,21 @@ 7FA912271426523900E2ABDD /* tinyxmlparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FA9121F1426523900E2ABDD /* tinyxmlparser.cpp */; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 956B96C313DF4CF900FCDCD0 /* slot1_retail_nand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 956B96C213DF4CF900FCDCD0 /* slot1_retail_nand.cpp */; }; - AB06CB57135B8A4D00E977B3 /* about.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4B135B8A4D00E977B3 /* about.m */; }; + AB0191D314BD72EC004CB612 /* MainMenu (Legacy).xib in Resources */ = {isa = PBXBuildFile; fileRef = AB0191D214BD72EC004CB612 /* MainMenu (Legacy).xib */; }; + AB0191D414BD72EC004CB612 /* MainMenu (Legacy).xib in Resources */ = {isa = PBXBuildFile; fileRef = AB0191D214BD72EC004CB612 /* MainMenu (Legacy).xib */; }; + AB0191D514BD72EC004CB612 /* MainMenu (Legacy).xib in Resources */ = {isa = PBXBuildFile; fileRef = AB0191D214BD72EC004CB612 /* MainMenu (Legacy).xib */; }; + AB0191D614BD72EC004CB612 /* MainMenu (Legacy).xib in Resources */ = {isa = PBXBuildFile; fileRef = AB0191D214BD72EC004CB612 /* MainMenu (Legacy).xib */; }; AB06CB59135B8A4D00E977B3 /* screen_state.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4D135B8A4D00E977B3 /* screen_state.m */; }; AB06CB5A135B8A4D00E977B3 /* cocoa_input.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4E135B8A4D00E977B3 /* cocoa_input.mm */; }; AB06CB5B135B8A4D00E977B3 /* input.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4F135B8A4D00E977B3 /* input.mm */; }; - AB06CB5C135B8A4D00E977B3 /* main_window.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB50135B8A4D00E977B3 /* main_window.mm */; }; - AB06CB5D135B8A4D00E977B3 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB51135B8A4D00E977B3 /* main.mm */; }; AB06CB5E135B8A4D00E977B3 /* nds_control.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB52135B8A4D00E977B3 /* nds_control.mm */; }; AB06CB5F135B8A4D00E977B3 /* preferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB53135B8A4D00E977B3 /* preferences.mm */; }; - AB06CB60135B8A4D00E977B3 /* screenshot.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB54135B8A4D00E977B3 /* screenshot.mm */; }; AB06CB62135B8A4D00E977B3 /* video_output_view.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB56135B8A4D00E977B3 /* video_output_view.mm */; }; - AB06CB63135B8A4D00E977B3 /* about.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4B135B8A4D00E977B3 /* about.m */; }; AB06CB65135B8A4D00E977B3 /* screen_state.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4D135B8A4D00E977B3 /* screen_state.m */; }; AB06CB66135B8A4D00E977B3 /* cocoa_input.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4E135B8A4D00E977B3 /* cocoa_input.mm */; }; AB06CB67135B8A4D00E977B3 /* input.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4F135B8A4D00E977B3 /* input.mm */; }; - AB06CB68135B8A4D00E977B3 /* main_window.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB50135B8A4D00E977B3 /* main_window.mm */; }; - AB06CB69135B8A4D00E977B3 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB51135B8A4D00E977B3 /* main.mm */; }; AB06CB6A135B8A4D00E977B3 /* nds_control.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB52135B8A4D00E977B3 /* nds_control.mm */; }; AB06CB6B135B8A4D00E977B3 /* preferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB53135B8A4D00E977B3 /* preferences.mm */; }; - AB06CB6C135B8A4D00E977B3 /* screenshot.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB54135B8A4D00E977B3 /* screenshot.mm */; }; AB06CB6E135B8A4D00E977B3 /* video_output_view.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB56135B8A4D00E977B3 /* video_output_view.mm */; }; AB06CCD6135B8AA200E977B3 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97324FDCFA39411CA2CEA /* AppKit.framework */; }; AB06CCD7135B8AA300E977B3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97325FDCFA39411CA2CEA /* Foundation.framework */; }; @@ -223,21 +219,13 @@ AB06CE94135B8AEE00E977B3 /* task.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CE0C135B8AED00E977B3 /* task.cpp */; }; AB06CE95135B8AEE00E977B3 /* vfat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CE0F135B8AED00E977B3 /* vfat.cpp */; }; AB06CE96135B8AEE00E977B3 /* xstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CE11135B8AED00E977B3 /* xstring.cpp */; }; - AB06CEC9135B8E0B00E977B3 /* rom_info.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CEC6135B8E0B00E977B3 /* rom_info.m */; }; - AB06CECA135B8E0B00E977B3 /* speed_limit_selection_window.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CEC8135B8E0B00E977B3 /* speed_limit_selection_window.mm */; }; - AB06CECB135B8E0B00E977B3 /* rom_info.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CEC6135B8E0B00E977B3 /* rom_info.m */; }; - AB06CECC135B8E0B00E977B3 /* speed_limit_selection_window.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CEC8135B8E0B00E977B3 /* speed_limit_selection_window.mm */; }; AB0A0D1E14AACACC00E83E91 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AB0A0D1D14AACACC00E83E91 /* libz.dylib */; }; AB0A0D3714AACE9500E83E91 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1F4B55090F53924500C8B514 /* Localizable.strings */; }; - AB0A0D3A14AACE9500E83E91 /* about.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4B135B8A4D00E977B3 /* about.m */; }; AB0A0D3C14AACE9500E83E91 /* screen_state.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4D135B8A4D00E977B3 /* screen_state.m */; }; AB0A0D3D14AACE9500E83E91 /* cocoa_input.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4E135B8A4D00E977B3 /* cocoa_input.mm */; }; AB0A0D3E14AACE9500E83E91 /* input.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4F135B8A4D00E977B3 /* input.mm */; }; - AB0A0D3F14AACE9500E83E91 /* main_window.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB50135B8A4D00E977B3 /* main_window.mm */; }; - AB0A0D4014AACE9500E83E91 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB51135B8A4D00E977B3 /* main.mm */; }; AB0A0D4114AACE9500E83E91 /* nds_control.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB52135B8A4D00E977B3 /* nds_control.mm */; }; AB0A0D4214AACE9500E83E91 /* preferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB53135B8A4D00E977B3 /* preferences.mm */; }; - AB0A0D4314AACE9500E83E91 /* screenshot.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB54135B8A4D00E977B3 /* screenshot.mm */; }; AB0A0D4514AACE9500E83E91 /* video_output_view.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB56135B8A4D00E977B3 /* video_output_view.mm */; }; AB0A0D4614AACE9500E83E91 /* addons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CD0E135B8ACE00E977B3 /* addons.cpp */; }; AB0A0D4714AACE9500E83E91 /* arm_instructions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CD10135B8ACE00E977B3 /* arm_instructions.cpp */; }; @@ -322,8 +310,6 @@ AB0A0D9614AACE9500E83E91 /* task.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CE0C135B8AED00E977B3 /* task.cpp */; }; AB0A0D9714AACE9500E83E91 /* vfat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CE0F135B8AED00E977B3 /* vfat.cpp */; }; AB0A0D9814AACE9500E83E91 /* xstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CE11135B8AED00E977B3 /* xstring.cpp */; }; - AB0A0D9914AACE9500E83E91 /* rom_info.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CEC6135B8E0B00E977B3 /* rom_info.m */; }; - AB0A0D9A14AACE9500E83E91 /* speed_limit_selection_window.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CEC8135B8E0B00E977B3 /* speed_limit_selection_window.mm */; }; AB0A0D9C14AACE9500E83E91 /* slot1_retail_nand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 956B96C213DF4CF900FCDCD0 /* slot1_retail_nand.cpp */; }; AB0A0D9D14AACE9500E83E91 /* tinystr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FA9121A1426523900E2ABDD /* tinystr.cpp */; }; AB0A0D9E14AACE9500E83E91 /* tinyxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FA9121C1426523900E2ABDD /* tinyxml.cpp */; }; @@ -375,19 +361,59 @@ AB46781714ABD4890002FF94 /* AppIcon_NintendoDS_ROM.icns in Resources */ = {isa = PBXBuildFile; fileRef = AB46780714ABD4890002FF94 /* AppIcon_NintendoDS_ROM.icns */; }; AB46781814ABD4890002FF94 /* AppIcon_ROMSave.icns in Resources */ = {isa = PBXBuildFile; fileRef = AB46780814ABD4890002FF94 /* AppIcon_ROMSave.icns */; }; AB46781914ABD4890002FF94 /* AppIcon_SaveState.icns in Resources */ = {isa = PBXBuildFile; fileRef = AB46780914ABD4890002FF94 /* AppIcon_SaveState.icns */; }; + AB73B12B14BDA01C00F49C92 /* appDelegate_legacy.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB73B12914BDA01C00F49C92 /* appDelegate_legacy.mm */; }; + AB73B12C14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB73B12A14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm */; }; + AB73B12D14BDA01C00F49C92 /* appDelegate_legacy.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB73B12914BDA01C00F49C92 /* appDelegate_legacy.mm */; }; + AB73B12E14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB73B12A14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm */; }; + AB73B12F14BDA01C00F49C92 /* appDelegate_legacy.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB73B12914BDA01C00F49C92 /* appDelegate_legacy.mm */; }; + AB73B13014BDA01C00F49C92 /* emuWindowDelegate_legacy.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB73B12A14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm */; }; + AB73B13114BDA01C00F49C92 /* appDelegate_legacy.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB73B12914BDA01C00F49C92 /* appDelegate_legacy.mm */; }; + AB73B13214BDA01C00F49C92 /* emuWindowDelegate_legacy.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB73B12A14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm */; }; + AB73B1C514BDA94800F49C92 /* Icon_Execute_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C114BDA94800F49C92 /* Icon_Execute_420x420.png */; }; + AB73B1C614BDA94800F49C92 /* Icon_Pause_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C214BDA94800F49C92 /* Icon_Pause_420x420.png */; }; + AB73B1C714BDA94800F49C92 /* Icon_Speed1x_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C314BDA94800F49C92 /* Icon_Speed1x_420x420.png */; }; + AB73B1C814BDA94800F49C92 /* Icon_Speed2x_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C414BDA94800F49C92 /* Icon_Speed2x_420x420.png */; }; + AB73B1C914BDA94800F49C92 /* Icon_Execute_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C114BDA94800F49C92 /* Icon_Execute_420x420.png */; }; + AB73B1CA14BDA94800F49C92 /* Icon_Pause_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C214BDA94800F49C92 /* Icon_Pause_420x420.png */; }; + AB73B1CB14BDA94800F49C92 /* Icon_Speed1x_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C314BDA94800F49C92 /* Icon_Speed1x_420x420.png */; }; + AB73B1CC14BDA94800F49C92 /* Icon_Speed2x_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C414BDA94800F49C92 /* Icon_Speed2x_420x420.png */; }; + AB73B1CD14BDA94800F49C92 /* Icon_Execute_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C114BDA94800F49C92 /* Icon_Execute_420x420.png */; }; + AB73B1CE14BDA94800F49C92 /* Icon_Pause_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C214BDA94800F49C92 /* Icon_Pause_420x420.png */; }; + AB73B1CF14BDA94800F49C92 /* Icon_Speed1x_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C314BDA94800F49C92 /* Icon_Speed1x_420x420.png */; }; + AB73B1D014BDA94800F49C92 /* Icon_Speed2x_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C414BDA94800F49C92 /* Icon_Speed2x_420x420.png */; }; + AB73B1D114BDA94800F49C92 /* Icon_Execute_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C114BDA94800F49C92 /* Icon_Execute_420x420.png */; }; + AB73B1D214BDA94800F49C92 /* Icon_Pause_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C214BDA94800F49C92 /* Icon_Pause_420x420.png */; }; + AB73B1D314BDA94800F49C92 /* Icon_Speed1x_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C314BDA94800F49C92 /* Icon_Speed1x_420x420.png */; }; + AB73B1D414BDA94800F49C92 /* Icon_Speed2x_420x420.png in Resources */ = {isa = PBXBuildFile; fileRef = AB73B1C414BDA94800F49C92 /* Icon_Speed2x_420x420.png */; }; AB8FE37614B652EC009E20B1 /* cocoa_util.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB8FE37514B652EC009E20B1 /* cocoa_util.mm */; }; AB8FE37714B652EC009E20B1 /* cocoa_util.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB8FE37514B652EC009E20B1 /* cocoa_util.mm */; }; AB8FE37814B652EC009E20B1 /* cocoa_util.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB8FE37514B652EC009E20B1 /* cocoa_util.mm */; }; AB8FE37914B652EC009E20B1 /* cocoa_util.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB8FE37514B652EC009E20B1 /* cocoa_util.mm */; }; AB8FE48C14B6657D009E20B1 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AB0A0D1D14AACACC00E83E91 /* libz.dylib */; }; - ABBF04BD14B519A500E505A0 /* MainMenu (Legacy).xib in Resources */ = {isa = PBXBuildFile; fileRef = ABBF04BC14B519A500E505A0 /* MainMenu (Legacy).xib */; }; - ABBF04BE14B519A500E505A0 /* MainMenu (Legacy).xib in Resources */ = {isa = PBXBuildFile; fileRef = ABBF04BC14B519A500E505A0 /* MainMenu (Legacy).xib */; }; - ABBF04BF14B519A500E505A0 /* MainMenu (Legacy).xib in Resources */ = {isa = PBXBuildFile; fileRef = ABBF04BC14B519A500E505A0 /* MainMenu (Legacy).xib */; }; - ABBF04C014B519A500E505A0 /* MainMenu (Legacy).xib in Resources */ = {isa = PBXBuildFile; fileRef = ABBF04BC14B519A500E505A0 /* MainMenu (Legacy).xib */; }; + ABAC890914B7943E001B299F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ABAC890814B7943E001B299F /* main.m */; }; + ABAC890A14B7943E001B299F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ABAC890814B7943E001B299F /* main.m */; }; + ABAC890B14B7943E001B299F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ABAC890814B7943E001B299F /* main.m */; }; + ABAC890C14B7943E001B299F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ABAC890814B7943E001B299F /* main.m */; }; ABBF053014B5436E00E505A0 /* cocoa_file.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABBF052F14B5436E00E505A0 /* cocoa_file.mm */; }; ABBF053114B5436E00E505A0 /* cocoa_file.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABBF052F14B5436E00E505A0 /* cocoa_file.mm */; }; ABBF053214B5436E00E505A0 /* cocoa_file.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABBF052F14B5436E00E505A0 /* cocoa_file.mm */; }; ABBF053314B5436E00E505A0 /* cocoa_file.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABBF052F14B5436E00E505A0 /* cocoa_file.mm */; }; + ABEFD81D14BB9E65004DB9DC /* Icon_VolumeFull_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81914BB9E65004DB9DC /* Icon_VolumeFull_16x16.png */; }; + ABEFD81E14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81A14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png */; }; + ABEFD81F14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81B14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png */; }; + ABEFD82014BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81C14BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png */; }; + ABEFD82114BB9E65004DB9DC /* Icon_VolumeFull_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81914BB9E65004DB9DC /* Icon_VolumeFull_16x16.png */; }; + ABEFD82214BB9E65004DB9DC /* Icon_VolumeMute_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81A14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png */; }; + ABEFD82314BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81B14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png */; }; + ABEFD82414BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81C14BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png */; }; + ABEFD82514BB9E65004DB9DC /* Icon_VolumeFull_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81914BB9E65004DB9DC /* Icon_VolumeFull_16x16.png */; }; + ABEFD82614BB9E65004DB9DC /* Icon_VolumeMute_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81A14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png */; }; + ABEFD82714BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81B14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png */; }; + ABEFD82814BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81C14BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png */; }; + ABEFD82914BB9E65004DB9DC /* Icon_VolumeFull_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81914BB9E65004DB9DC /* Icon_VolumeFull_16x16.png */; }; + ABEFD82A14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81A14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png */; }; + ABEFD82B14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81B14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png */; }; + ABEFD82C14BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png in Resources */ = {isa = PBXBuildFile; fileRef = ABEFD81C14BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png */; }; ABF4007714B4F19200578AE7 /* AppIcon_ROMCheats.icns in Resources */ = {isa = PBXBuildFile; fileRef = ABF4007614B4F19200578AE7 /* AppIcon_ROMCheats.icns */; }; ABF4007814B4F19200578AE7 /* AppIcon_ROMCheats.icns in Resources */ = {isa = PBXBuildFile; fileRef = ABF4007614B4F19200578AE7 /* AppIcon_ROMCheats.icns */; }; ABF4007914B4F19200578AE7 /* AppIcon_ROMCheats.icns in Resources */ = {isa = PBXBuildFile; fileRef = ABF4007614B4F19200578AE7 /* AppIcon_ROMCheats.icns */; }; @@ -397,15 +423,11 @@ ABF4008114B4F1C000578AE7 /* sndOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABF4007E14B4F1C000578AE7 /* sndOSX.cpp */; }; ABF4008214B4F1C000578AE7 /* sndOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABF4007E14B4F1C000578AE7 /* sndOSX.cpp */; }; ABFE4242143E32F0009A3CCE /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1F4B55090F53924500C8B514 /* Localizable.strings */; }; - ABFE4245143E32F0009A3CCE /* about.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4B135B8A4D00E977B3 /* about.m */; }; ABFE4247143E32F0009A3CCE /* screen_state.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4D135B8A4D00E977B3 /* screen_state.m */; }; ABFE4248143E32F0009A3CCE /* cocoa_input.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4E135B8A4D00E977B3 /* cocoa_input.mm */; }; ABFE4249143E32F0009A3CCE /* input.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB4F135B8A4D00E977B3 /* input.mm */; }; - ABFE424A143E32F0009A3CCE /* main_window.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB50135B8A4D00E977B3 /* main_window.mm */; }; - ABFE424B143E32F0009A3CCE /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB51135B8A4D00E977B3 /* main.mm */; }; ABFE424C143E32F0009A3CCE /* nds_control.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB52135B8A4D00E977B3 /* nds_control.mm */; }; ABFE424D143E32F0009A3CCE /* preferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB53135B8A4D00E977B3 /* preferences.mm */; }; - ABFE424E143E32F0009A3CCE /* screenshot.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB54135B8A4D00E977B3 /* screenshot.mm */; }; ABFE4250143E32F0009A3CCE /* video_output_view.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CB56135B8A4D00E977B3 /* video_output_view.mm */; }; ABFE4251143E32F0009A3CCE /* addons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CD0E135B8ACE00E977B3 /* addons.cpp */; }; ABFE4252143E32F0009A3CCE /* arm_instructions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CD10135B8ACE00E977B3 /* arm_instructions.cpp */; }; @@ -490,8 +512,6 @@ ABFE42A1143E32F0009A3CCE /* task.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CE0C135B8AED00E977B3 /* task.cpp */; }; ABFE42A2143E32F0009A3CCE /* vfat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CE0F135B8AED00E977B3 /* vfat.cpp */; }; ABFE42A3143E32F0009A3CCE /* xstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB06CE11135B8AED00E977B3 /* xstring.cpp */; }; - ABFE42A4143E32F0009A3CCE /* rom_info.m in Sources */ = {isa = PBXBuildFile; fileRef = AB06CEC6135B8E0B00E977B3 /* rom_info.m */; }; - ABFE42A5143E32F0009A3CCE /* speed_limit_selection_window.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB06CEC8135B8E0B00E977B3 /* speed_limit_selection_window.mm */; }; ABFE42A7143E32F0009A3CCE /* slot1_retail_nand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 956B96C213DF4CF900FCDCD0 /* slot1_retail_nand.cpp */; }; ABFE42A8143E32F0009A3CCE /* tinystr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FA9121A1426523900E2ABDD /* tinystr.cpp */; }; ABFE42A9143E32F0009A3CCE /* tinyxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7FA9121C1426523900E2ABDD /* tinyxml.cpp */; }; @@ -523,24 +543,24 @@ 7FA9121E1426523900E2ABDD /* tinyxmlerror.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxmlerror.cpp; sourceTree = ""; }; 7FA9121F1426523900E2ABDD /* tinyxmlparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxmlparser.cpp; sourceTree = ""; }; 956B96C213DF4CF900FCDCD0 /* slot1_retail_nand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = slot1_retail_nand.cpp; path = ../addons/slot1_retail_nand.cpp; sourceTree = SOURCE_ROOT; }; + AB0191D714BD72FC004CB612 /* French */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = French; path = "translations/French.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; + AB0191D814BD72FF004CB612 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Italian; path = "translations/Italian.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; + AB0191E614BD741B004CB612 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Japanese; path = "translations/Japanese.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; + AB0191E714BD741F004CB612 /* Chinese */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Chinese; path = "translations/Chinese.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; + AB0191E814BD7423004CB612 /* Norwegian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Norwegian; path = "translations/Norwegian.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; + AB0191E914BD7425004CB612 /* Romanian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Romanian; path = "translations/Romanian.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; AB06CB41135B8A4D00E977B3 /* cocoa_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocoa_input.h; sourceTree = ""; }; AB06CB43135B8A4D00E977B3 /* input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = input.h; sourceTree = ""; }; - AB06CB44135B8A4D00E977B3 /* main_window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = main_window.h; sourceTree = ""; }; AB06CB45135B8A4D00E977B3 /* nds_control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nds_control.h; sourceTree = ""; }; AB06CB46135B8A4D00E977B3 /* preferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = preferences.h; sourceTree = ""; }; AB06CB47135B8A4D00E977B3 /* screen_state.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = screen_state.h; sourceTree = ""; }; - AB06CB48135B8A4D00E977B3 /* screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = screenshot.h; sourceTree = ""; }; AB06CB49135B8A4D00E977B3 /* sndOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sndOSX.h; sourceTree = ""; }; AB06CB4A135B8A4D00E977B3 /* video_output_view.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = video_output_view.h; sourceTree = ""; }; - AB06CB4B135B8A4D00E977B3 /* about.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = about.m; sourceTree = ""; }; AB06CB4D135B8A4D00E977B3 /* screen_state.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = screen_state.m; sourceTree = ""; }; AB06CB4E135B8A4D00E977B3 /* cocoa_input.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = cocoa_input.mm; sourceTree = ""; }; AB06CB4F135B8A4D00E977B3 /* input.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = input.mm; sourceTree = ""; }; - AB06CB50135B8A4D00E977B3 /* main_window.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main_window.mm; sourceTree = ""; }; - AB06CB51135B8A4D00E977B3 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = ""; }; AB06CB52135B8A4D00E977B3 /* nds_control.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = nds_control.mm; sourceTree = ""; }; AB06CB53135B8A4D00E977B3 /* preferences.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = preferences.mm; sourceTree = ""; }; - AB06CB54135B8A4D00E977B3 /* screenshot.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = screenshot.mm; sourceTree = ""; }; AB06CB56135B8A4D00E977B3 /* video_output_view.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = video_output_view.mm; sourceTree = ""; }; AB06CCD5135B8A9B00E977B3 /* DeSmuME_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeSmuME_Prefix.pch; sourceTree = ""; }; AB06CCD8135B8ACE00E977B3 /* addons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = addons.h; path = ../addons.h; sourceTree = SOURCE_ROOT; }; @@ -736,10 +756,6 @@ AB06CE10135B8AED00E977B3 /* vfat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vfat.h; sourceTree = ""; }; AB06CE11135B8AED00E977B3 /* xstring.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xstring.cpp; sourceTree = ""; }; AB06CE12135B8AED00E977B3 /* xstring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xstring.h; sourceTree = ""; }; - AB06CEC5135B8E0B00E977B3 /* rom_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rom_info.h; sourceTree = ""; }; - AB06CEC6135B8E0B00E977B3 /* rom_info.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = rom_info.m; sourceTree = ""; }; - AB06CEC7135B8E0B00E977B3 /* speed_limit_selection_window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = speed_limit_selection_window.h; sourceTree = ""; }; - AB06CEC8135B8E0B00E977B3 /* speed_limit_selection_window.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = speed_limit_selection_window.mm; sourceTree = ""; }; AB0A0D1D14AACACC00E83E91 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; AB0A0DAC14AACE9500E83E91 /* DeSmuME.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DeSmuME.app; sourceTree = BUILT_PRODUCTS_DIR; }; AB0A0DDE14AAD26600E83E91 /* Info (Debug).plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info (Debug).plist"; sourceTree = ""; }; @@ -753,21 +769,28 @@ AB46780714ABD4890002FF94 /* AppIcon_NintendoDS_ROM.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = AppIcon_NintendoDS_ROM.icns; sourceTree = ""; }; AB46780814ABD4890002FF94 /* AppIcon_ROMSave.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = AppIcon_ROMSave.icns; sourceTree = ""; }; AB46780914ABD4890002FF94 /* AppIcon_SaveState.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = AppIcon_SaveState.icns; sourceTree = ""; }; + AB73B12714BDA01C00F49C92 /* appDelegate_legacy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = appDelegate_legacy.h; path = userinterface/appDelegate_legacy.h; sourceTree = ""; }; + AB73B12814BDA01C00F49C92 /* emuWindowDelegate_legacy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = emuWindowDelegate_legacy.h; path = userinterface/emuWindowDelegate_legacy.h; sourceTree = ""; }; + AB73B12914BDA01C00F49C92 /* appDelegate_legacy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = appDelegate_legacy.mm; path = userinterface/appDelegate_legacy.mm; sourceTree = ""; }; + AB73B12A14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = emuWindowDelegate_legacy.mm; path = userinterface/emuWindowDelegate_legacy.mm; sourceTree = ""; }; + AB73B1C114BDA94800F49C92 /* Icon_Execute_420x420.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_Execute_420x420.png; path = images/Icon_Execute_420x420.png; sourceTree = ""; }; + AB73B1C214BDA94800F49C92 /* Icon_Pause_420x420.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_Pause_420x420.png; path = images/Icon_Pause_420x420.png; sourceTree = ""; }; + AB73B1C314BDA94800F49C92 /* Icon_Speed1x_420x420.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_Speed1x_420x420.png; path = images/Icon_Speed1x_420x420.png; sourceTree = ""; }; + AB73B1C414BDA94800F49C92 /* Icon_Speed2x_420x420.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_Speed2x_420x420.png; path = images/Icon_Speed2x_420x420.png; sourceTree = ""; }; AB8FE30A14B647D6009E20B1 /* macosx_10_4_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macosx_10_4_compat.h; sourceTree = ""; }; AB8FE37414B652EC009E20B1 /* cocoa_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocoa_util.h; sourceTree = ""; }; AB8FE37514B652EC009E20B1 /* cocoa_util.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = cocoa_util.mm; sourceTree = ""; }; + ABAC890814B7943E001B299F /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; ABBF045E14B5144D00E505A0 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = "translations/English.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; - ABBF04C114B519CD00E505A0 /* French */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = French; path = "translations/French.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; - ABBF04C314B519DF00E505A0 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Italian; path = "translations/Italian.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; - ABBF04C414B519E400E505A0 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Japanese; path = "translations/Japanese.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; - ABBF04C514B519EA00E505A0 /* Chinese */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Chinese; path = "translations/Chinese.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; - ABBF04C614B519F000E505A0 /* Norwegian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Norwegian; path = "translations/Norwegian.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; - ABBF04C714B519F500E505A0 /* Romanian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Romanian; path = "translations/Romanian.lproj/MainMenu (Legacy).xib"; sourceTree = ""; }; ABBF04CB14B51BBB00E505A0 /* Chinese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Chinese; path = translations/Chinese.lproj/Localizable.strings; sourceTree = ""; }; ABBF04CC14B51BC300E505A0 /* Norwegian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Norwegian; path = translations/Norwegian.lproj/Localizable.strings; sourceTree = ""; }; ABBF04CD14B51BC900E505A0 /* Romanian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Romanian; path = translations/Romanian.lproj/Localizable.strings; sourceTree = ""; }; ABBF052F14B5436E00E505A0 /* cocoa_file.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = cocoa_file.mm; sourceTree = ""; }; ABBF053B14B543B600E505A0 /* cocoa_file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocoa_file.h; sourceTree = ""; }; + ABEFD81914BB9E65004DB9DC /* Icon_VolumeFull_16x16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_VolumeFull_16x16.png; path = images/Icon_VolumeFull_16x16.png; sourceTree = ""; }; + ABEFD81A14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_VolumeMute_16x16.png; path = images/Icon_VolumeMute_16x16.png; sourceTree = ""; }; + ABEFD81B14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_VolumeOneThird_16x16.png; path = images/Icon_VolumeOneThird_16x16.png; sourceTree = ""; }; + ABEFD81C14BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_VolumeTwoThird_16x16.png; path = images/Icon_VolumeTwoThird_16x16.png; sourceTree = ""; }; ABF4007614B4F19200578AE7 /* AppIcon_ROMCheats.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = AppIcon_ROMCheats.icns; sourceTree = ""; }; ABF4007E14B4F1C000578AE7 /* sndOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sndOSX.cpp; sourceTree = ""; }; ABF95B4714B4F4FC007912B8 /* cocoa_globals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocoa_globals.h; sourceTree = ""; }; @@ -832,7 +855,7 @@ 080E96DDFE201D6D7F000001 /* Cocoa Port */ = { isa = PBXGroup; children = ( - AB06CEC4135B8E0B00E977B3 /* dialogs */, + ABC3ADEC14B7DC6E00D5B13D /* userinterface */, ABF4007E14B4F1C000578AE7 /* sndOSX.cpp */, ABBF053B14B543B600E505A0 /* cocoa_file.h */, ABF95B4714B4F4FC007912B8 /* cocoa_globals.h */, @@ -840,24 +863,18 @@ AB8FE37414B652EC009E20B1 /* cocoa_util.h */, AB06CB43135B8A4D00E977B3 /* input.h */, AB8FE30A14B647D6009E20B1 /* macosx_10_4_compat.h */, - AB06CB44135B8A4D00E977B3 /* main_window.h */, AB06CB45135B8A4D00E977B3 /* nds_control.h */, AB06CB46135B8A4D00E977B3 /* preferences.h */, AB06CB47135B8A4D00E977B3 /* screen_state.h */, - AB06CB48135B8A4D00E977B3 /* screenshot.h */, AB06CB49135B8A4D00E977B3 /* sndOSX.h */, AB06CB4A135B8A4D00E977B3 /* video_output_view.h */, - AB06CB4B135B8A4D00E977B3 /* about.m */, AB06CB4D135B8A4D00E977B3 /* screen_state.m */, ABBF052F14B5436E00E505A0 /* cocoa_file.mm */, AB06CB4E135B8A4D00E977B3 /* cocoa_input.mm */, AB8FE37514B652EC009E20B1 /* cocoa_util.mm */, AB06CB4F135B8A4D00E977B3 /* input.mm */, - AB06CB51135B8A4D00E977B3 /* main.mm */, - AB06CB50135B8A4D00E977B3 /* main_window.mm */, AB06CB52135B8A4D00E977B3 /* nds_control.mm */, AB06CB53135B8A4D00E977B3 /* preferences.mm */, - AB06CB54135B8A4D00E977B3 /* screenshot.mm */, AB06CB56135B8A4D00E977B3 /* video_output_view.mm */, ); name = "Cocoa Port"; @@ -899,10 +916,10 @@ children = ( 080E96DDFE201D6D7F000001 /* Cocoa Port */, 29B97315FDCFA39411CA2CEA /* Core */, - 29B97317FDCFA39411CA2CEA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, AB06CB79135B8A7600E977B3 /* Other Sources */, 19C28FACFE9D520D11CA2CBB /* Products */, + 29B97317FDCFA39411CA2CEA /* Resources */, ); name = DeSmuME; sourceTree = ""; @@ -1026,7 +1043,7 @@ children = ( AB4677FA14ABD4790002FF94 /* Images */, 1F4B55090F53924500C8B514 /* Localizable.strings */, - ABBF04BC14B519A500E505A0 /* MainMenu (Legacy).xib */, + AB0191D214BD72EC004CB612 /* MainMenu (Legacy).xib */, 72C000010D9D59E60046B7EA /* Info.plist */, AB0A0DDE14AAD26600E83E91 /* Info (Debug).plist */, 72C000020D9D59E60046B7EA /* InfoPlist.strings */, @@ -1066,6 +1083,7 @@ AB06CB79135B8A7600E977B3 /* Other Sources */ = { isa = PBXGroup; children = ( + ABAC890814B7943E001B299F /* main.m */, AB06CCD5135B8A9B00E977B3 /* DeSmuME_Prefix.pch */, ); name = "Other Sources"; @@ -1228,21 +1246,18 @@ path = libfat; sourceTree = ""; }; - AB06CEC4135B8E0B00E977B3 /* dialogs */ = { - isa = PBXGroup; - children = ( - AB06CEC5135B8E0B00E977B3 /* rom_info.h */, - AB06CEC6135B8E0B00E977B3 /* rom_info.m */, - AB06CEC7135B8E0B00E977B3 /* speed_limit_selection_window.h */, - AB06CEC8135B8E0B00E977B3 /* speed_limit_selection_window.mm */, - ); - path = dialogs; - sourceTree = ""; - }; AB4677FA14ABD4790002FF94 /* Images */ = { isa = PBXGroup; children = ( AB46782914ABD4BF0002FF94 /* App Icons */, + ABEFD81914BB9E65004DB9DC /* Icon_VolumeFull_16x16.png */, + ABEFD81A14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png */, + ABEFD81B14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png */, + ABEFD81C14BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png */, + AB73B1C114BDA94800F49C92 /* Icon_Execute_420x420.png */, + AB73B1C214BDA94800F49C92 /* Icon_Pause_420x420.png */, + AB73B1C314BDA94800F49C92 /* Icon_Speed1x_420x420.png */, + AB73B1C414BDA94800F49C92 /* Icon_Speed2x_420x420.png */, ); name = Images; sourceTree = ""; @@ -1259,6 +1274,17 @@ name = "App Icons"; sourceTree = ""; }; + ABC3ADEC14B7DC6E00D5B13D /* userinterface */ = { + isa = PBXGroup; + children = ( + AB73B12714BDA01C00F49C92 /* appDelegate_legacy.h */, + AB73B12814BDA01C00F49C92 /* emuWindowDelegate_legacy.h */, + AB73B12914BDA01C00F49C92 /* appDelegate_legacy.mm */, + AB73B12A14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm */, + ); + name = userinterface; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -1266,6 +1292,7 @@ isa = PBXNativeTarget; buildConfigurationList = 1EFD51BB0F892B1A00B029BB /* Build configuration list for PBXNativeTarget "DeSmuME_gdbstub" */; buildPhases = ( + AB73B05614BD7A8B00F49C92 /* ShellScript */, 1EFD51780F892B1A00B029BB /* Resources */, 1EFD517C0F892B1A00B029BB /* Sources */, 1EFD51B60F892B1A00B029BB /* Frameworks */, @@ -1284,6 +1311,7 @@ isa = PBXNativeTarget; buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "DeSmuME (v10.5 Leopard)" */; buildPhases = ( + AB73B04F14BD79CB00F49C92 /* ShellScript */, 8D1107290486CEB800E47090 /* Resources */, 8D11072C0486CEB800E47090 /* Sources */, 8D11072E0486CEB800E47090 /* Frameworks */, @@ -1302,6 +1330,7 @@ isa = PBXNativeTarget; buildConfigurationList = AB0A0DA914AACE9500E83E91 /* Build configuration list for PBXNativeTarget "DeSmuME (v10.4 Tiger)" */; buildPhases = ( + AB01918414BD6A0A004CB612 /* ShellScript */, AB0A0D3514AACE9500E83E91 /* Resources */, AB0A0D3914AACE9500E83E91 /* Sources */, AB0A0DA114AACE9500E83E91 /* Frameworks */, @@ -1320,6 +1349,7 @@ isa = PBXNativeTarget; buildConfigurationList = ABFE42B3143E32F0009A3CCE /* Build configuration list for PBXNativeTarget "DeSmuME (v10.6 Snow Leopard)" */; buildPhases = ( + AB73B05114BD79D300F49C92 /* ShellScript */, ABFE4240143E32F0009A3CCE /* Resources */, ABFE4244143E32F0009A3CCE /* Sources */, ABFE42AC143E32F0009A3CCE /* Frameworks */, @@ -1386,7 +1416,15 @@ AB46781014ABD4890002FF94 /* AppIcon_ROMSave.icns in Resources */, AB46781114ABD4890002FF94 /* AppIcon_SaveState.icns in Resources */, ABF4007A14B4F19200578AE7 /* AppIcon_ROMCheats.icns in Resources */, - ABBF04C014B519A500E505A0 /* MainMenu (Legacy).xib in Resources */, + AB0191D614BD72EC004CB612 /* MainMenu (Legacy).xib in Resources */, + ABEFD82514BB9E65004DB9DC /* Icon_VolumeFull_16x16.png in Resources */, + ABEFD82614BB9E65004DB9DC /* Icon_VolumeMute_16x16.png in Resources */, + ABEFD82714BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png in Resources */, + ABEFD82814BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png in Resources */, + AB73B1CD14BDA94800F49C92 /* Icon_Execute_420x420.png in Resources */, + AB73B1CE14BDA94800F49C92 /* Icon_Pause_420x420.png in Resources */, + AB73B1CF14BDA94800F49C92 /* Icon_Speed1x_420x420.png in Resources */, + AB73B1D014BDA94800F49C92 /* Icon_Speed2x_420x420.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1406,7 +1444,15 @@ AB46781814ABD4890002FF94 /* AppIcon_ROMSave.icns in Resources */, AB46781914ABD4890002FF94 /* AppIcon_SaveState.icns in Resources */, ABF4007714B4F19200578AE7 /* AppIcon_ROMCheats.icns in Resources */, - ABBF04BE14B519A500E505A0 /* MainMenu (Legacy).xib in Resources */, + AB0191D414BD72EC004CB612 /* MainMenu (Legacy).xib in Resources */, + ABEFD82914BB9E65004DB9DC /* Icon_VolumeFull_16x16.png in Resources */, + ABEFD82A14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png in Resources */, + ABEFD82B14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png in Resources */, + ABEFD82C14BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png in Resources */, + AB73B1D114BDA94800F49C92 /* Icon_Execute_420x420.png in Resources */, + AB73B1D214BDA94800F49C92 /* Icon_Pause_420x420.png in Resources */, + AB73B1D314BDA94800F49C92 /* Icon_Speed1x_420x420.png in Resources */, + AB73B1D414BDA94800F49C92 /* Icon_Speed2x_420x420.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1426,7 +1472,15 @@ AB46780C14ABD4890002FF94 /* AppIcon_ROMSave.icns in Resources */, AB46780D14ABD4890002FF94 /* AppIcon_SaveState.icns in Resources */, ABF4007814B4F19200578AE7 /* AppIcon_ROMCheats.icns in Resources */, - ABBF04BD14B519A500E505A0 /* MainMenu (Legacy).xib in Resources */, + AB0191D314BD72EC004CB612 /* MainMenu (Legacy).xib in Resources */, + ABEFD81D14BB9E65004DB9DC /* Icon_VolumeFull_16x16.png in Resources */, + ABEFD81E14BB9E65004DB9DC /* Icon_VolumeMute_16x16.png in Resources */, + ABEFD81F14BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png in Resources */, + ABEFD82014BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png in Resources */, + AB73B1C514BDA94800F49C92 /* Icon_Execute_420x420.png in Resources */, + AB73B1C614BDA94800F49C92 /* Icon_Pause_420x420.png in Resources */, + AB73B1C714BDA94800F49C92 /* Icon_Speed1x_420x420.png in Resources */, + AB73B1C814BDA94800F49C92 /* Icon_Speed2x_420x420.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1446,72 +1500,176 @@ AB46781414ABD4890002FF94 /* AppIcon_ROMSave.icns in Resources */, AB46781514ABD4890002FF94 /* AppIcon_SaveState.icns in Resources */, ABF4007914B4F19200578AE7 /* AppIcon_ROMCheats.icns in Resources */, - ABBF04BF14B519A500E505A0 /* MainMenu (Legacy).xib in Resources */, + AB0191D514BD72EC004CB612 /* MainMenu (Legacy).xib in Resources */, + ABEFD82114BB9E65004DB9DC /* Icon_VolumeFull_16x16.png in Resources */, + ABEFD82214BB9E65004DB9DC /* Icon_VolumeMute_16x16.png in Resources */, + ABEFD82314BB9E65004DB9DC /* Icon_VolumeOneThird_16x16.png in Resources */, + ABEFD82414BB9E65004DB9DC /* Icon_VolumeTwoThird_16x16.png in Resources */, + AB73B1C914BDA94800F49C92 /* Icon_Execute_420x420.png in Resources */, + AB73B1CA14BDA94800F49C92 /* Icon_Pause_420x420.png in Resources */, + AB73B1CB14BDA94800F49C92 /* Icon_Speed1x_420x420.png in Resources */, + AB73B1CC14BDA94800F49C92 /* Icon_Speed2x_420x420.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + AB01918414BD6A0A004CB612 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/translations/English.lproj/MainMenu (Legacy).xib", + ); + outputPaths = ( + "$(SRCROOT)/translations/French.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Italian.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Japanese.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Chinese.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Norwegian.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Romanian.lproj/MainMenu (Legacy).xib", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"./translations\"\nibtool --generate-strings-file \"./English.lproj/MainMenu (Legacy).strings\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./French.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./French.lproj/MainMenu (Legacy).strings\" --write \"./French.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Italian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Italian.lproj/MainMenu (Legacy).strings\" --write \"./Italian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Japanese.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Japanese.lproj/MainMenu (Legacy).strings\" --write \"./Japanese.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Chinese.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Chinese.lproj/MainMenu (Legacy).strings\" --write \"./Chinese.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Norwegian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Norwegian.lproj/MainMenu (Legacy).strings\" --write \"./Norwegian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Romanian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Romanian.lproj/MainMenu (Legacy).strings\" --write \"./Romanian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\""; + }; + AB73B04F14BD79CB00F49C92 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/translations/English.lproj/MainMenu (Legacy).xib", + ); + outputPaths = ( + "$(SRCROOT)/translations/French.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Italian.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Japanese.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Chinese.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Norwegian.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Romanian.lproj/MainMenu (Legacy).xib", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"./translations\"\nibtool --generate-strings-file \"./English.lproj/MainMenu (Legacy).strings\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./French.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./French.lproj/MainMenu (Legacy).strings\" --write \"./French.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Italian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Italian.lproj/MainMenu (Legacy).strings\" --write \"./Italian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Japanese.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Japanese.lproj/MainMenu (Legacy).strings\" --write \"./Japanese.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Chinese.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Chinese.lproj/MainMenu (Legacy).strings\" --write \"./Chinese.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Norwegian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Norwegian.lproj/MainMenu (Legacy).strings\" --write \"./Norwegian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Romanian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Romanian.lproj/MainMenu (Legacy).strings\" --write \"./Romanian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\""; + }; + AB73B05114BD79D300F49C92 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/translations/English.lproj/MainMenu (Legacy).xib", + ); + outputPaths = ( + "$(SRCROOT)/translations/French.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Italian.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Japanese.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Chinese.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Norwegian.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Romanian.lproj/MainMenu (Legacy).xib", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"./translations\"\nibtool --generate-strings-file \"./English.lproj/MainMenu (Legacy).strings\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./French.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./French.lproj/MainMenu (Legacy).strings\" --write \"./French.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Italian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Italian.lproj/MainMenu (Legacy).strings\" --write \"./Italian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Japanese.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Japanese.lproj/MainMenu (Legacy).strings\" --write \"./Japanese.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Chinese.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Chinese.lproj/MainMenu (Legacy).strings\" --write \"./Chinese.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Norwegian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Norwegian.lproj/MainMenu (Legacy).strings\" --write \"./Norwegian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Romanian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Romanian.lproj/MainMenu (Legacy).strings\" --write \"./Romanian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\""; + }; + AB73B05614BD7A8B00F49C92 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/translations/English.lproj/MainMenu (Legacy).xib", + ); + outputPaths = ( + "$(SRCROOT)/translations/French.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Italian.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Japanese.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Chinese.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Norwegian.lproj/MainMenu (Legacy).xib", + "$(SRCROOT)/translations/Romanian.lproj/MainMenu (Legacy).xib", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"./translations\"\nibtool --generate-strings-file \"./English.lproj/MainMenu (Legacy).strings\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./French.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./French.lproj/MainMenu (Legacy).strings\" --write \"./French.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Italian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Italian.lproj/MainMenu (Legacy).strings\" --write \"./Italian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Japanese.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Japanese.lproj/MainMenu (Legacy).strings\" --write \"./Japanese.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Chinese.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Chinese.lproj/MainMenu (Legacy).strings\" --write \"./Chinese.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Norwegian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Norwegian.lproj/MainMenu (Legacy).strings\" --write \"./Norwegian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\"\n\nrm \"./Romanian.lproj/MainMenu (Legacy).xib\"\nibtool --strings-file \"./Romanian.lproj/MainMenu (Legacy).strings\" --write \"./Romanian.lproj/MainMenu (Legacy).xib\" \"./English.lproj/MainMenu (Legacy).xib\""; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 1EFD517C0F892B1A00B029BB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - AB06CB63135B8A4D00E977B3 /* about.m in Sources */, - AB06CB65135B8A4D00E977B3 /* screen_state.m in Sources */, - AB06CB66135B8A4D00E977B3 /* cocoa_input.mm in Sources */, - AB06CB67135B8A4D00E977B3 /* input.mm in Sources */, - AB06CB68135B8A4D00E977B3 /* main_window.mm in Sources */, - AB06CB69135B8A4D00E977B3 /* main.mm in Sources */, - AB06CB6A135B8A4D00E977B3 /* nds_control.mm in Sources */, - AB06CB6B135B8A4D00E977B3 /* preferences.mm in Sources */, - AB06CB6C135B8A4D00E977B3 /* screenshot.mm in Sources */, - AB06CB6E135B8A4D00E977B3 /* video_output_view.mm in Sources */, + AB06CE80135B8AEE00E977B3 /* ConvertUTF.c in Sources */, + AB06CE6C135B8AEE00E977B3 /* AAFilter.cpp in Sources */, AB06CD6C135B8ACE00E977B3 /* addons.cpp in Sources */, AB06CD6D135B8ACE00E977B3 /* aggdraw.cpp in Sources */, AB06CD6E135B8ACE00E977B3 /* arm_instructions.cpp in Sources */, AB06CD6F135B8ACE00E977B3 /* armcpu.cpp in Sources */, AB06CD70135B8ACE00E977B3 /* bios.cpp in Sources */, + AB06CE88135B8AEE00E977B3 /* cache.cpp in Sources */, AB06CD71135B8ACE00E977B3 /* cheatSystem.cpp in Sources */, AB06CD72135B8ACE00E977B3 /* commandline.cpp in Sources */, AB06CD73135B8ACE00E977B3 /* common.cpp in Sources */, AB06CD74135B8ACE00E977B3 /* cp15.cpp in Sources */, + AB06CE6F135B8AEE00E977B3 /* cpu_detect_x86_gcc.cpp in Sources */, + AB06CE82135B8AEE00E977B3 /* crc.cpp in Sources */, AB06CD75135B8ACE00E977B3 /* ctrlssdl.cpp in Sources */, + AB06CE81135B8AEE00E977B3 /* datetime.cpp in Sources */, AB06CD76135B8ACE00E977B3 /* debug.cpp in Sources */, + AB06CE83135B8AEE00E977B3 /* decrypt.cpp in Sources */, AB06CD77135B8ACE00E977B3 /* desmume_config.cpp in Sources */, + AB06CE89135B8AEE00E977B3 /* directory.cpp in Sources */, AB06CD78135B8ACE00E977B3 /* Disassembler.cpp in Sources */, + AB06CE8A135B8AEE00E977B3 /* disc.cpp in Sources */, + AB06CE85135B8AEE00E977B3 /* dlditool.cpp in Sources */, AB06CD79135B8ACE00E977B3 /* driver.cpp in Sources */, + AB06CE86135B8AEE00E977B3 /* emufat.cpp in Sources */, AB06CD7A135B8ACE00E977B3 /* emufile.cpp in Sources */, + AB06CE8B135B8AEE00E977B3 /* fatdir.cpp in Sources */, + AB06CE8C135B8AEE00E977B3 /* fatfile.cpp in Sources */, AB06CD7B135B8ACE00E977B3 /* FIFO.cpp in Sources */, + AB06CE72135B8AEE00E977B3 /* FIFOSampleBuffer.cpp in Sources */, + AB06CE8D135B8AEE00E977B3 /* file_allocation_table.cpp in Sources */, + AB06CE8E135B8AEE00E977B3 /* filetime.cpp in Sources */, + AB06CE73135B8AEE00E977B3 /* FIRFilter.cpp in Sources */, AB06CD7C135B8ACE00E977B3 /* firmware.cpp in Sources */, AB06CD7D135B8ACE00E977B3 /* fs-linux.cpp in Sources */, + AB06CE66135B8AEE00E977B3 /* gdbstub.cpp in Sources */, AB06CD7F135B8ACE00E977B3 /* gfx3d.cpp in Sources */, - AB06CD80135B8ACE00E977B3 /* GPU_osd_stub.cpp in Sources */, - AB06CD81135B8ACE00E977B3 /* GPU_osd.cpp in Sources */, AB06CD82135B8ACE00E977B3 /* GPU.cpp in Sources */, + AB06CD81135B8ACE00E977B3 /* GPU_osd.cpp in Sources */, + AB06CD80135B8ACE00E977B3 /* GPU_osd_stub.cpp in Sources */, + AB06CE87135B8AEE00E977B3 /* guid.cpp in Sources */, + AB06CE84135B8AEE00E977B3 /* header.cpp in Sources */, + AB06CE8F135B8AEE00E977B3 /* libfat.cpp in Sources */, + AB06CE90135B8AEE00E977B3 /* libfat_public_api.cpp in Sources */, + AB06CE91135B8AEE00E977B3 /* lock.cpp in Sources */, AB06CD83135B8ACE00E977B3 /* lua-engine.cpp in Sources */, + AB06CE63135B8AEE00E977B3 /* main.cpp in Sources */, AB06CD84135B8ACE00E977B3 /* matrix.cpp in Sources */, AB06CD85135B8ACE00E977B3 /* mc.cpp in Sources */, + AB06CE93135B8AEE00E977B3 /* md5.cpp in Sources */, + AB06CE68135B8AEE00E977B3 /* metaspu.cpp in Sources */, + AB06CD88135B8ACE00E977B3 /* mic.cpp in Sources */, AB06CD86135B8ACE00E977B3 /* mic_alsa.cpp in Sources */, AB06CD87135B8ACE00E977B3 /* mic_openal.cpp in Sources */, - AB06CD88135B8ACE00E977B3 /* mic.cpp in Sources */, AB06CD89135B8ACE00E977B3 /* MMU.cpp in Sources */, + AB06CE77135B8AEE00E977B3 /* mmx_optimized.cpp in Sources */, AB06CD8A135B8ACE00E977B3 /* movie.cpp in Sources */, AB06CD8B135B8ACE00E977B3 /* NDSSystem.cpp in Sources */, + AB06CE92135B8AEE00E977B3 /* partition.cpp in Sources */, AB06CD8D135B8ACE00E977B3 /* path.cpp in Sources */, AB06CD8E135B8ACE00E977B3 /* rasterize.cpp in Sources */, + AB06CE78135B8AEE00E977B3 /* RateTransposer.cpp in Sources */, AB06CD8F135B8ACE00E977B3 /* readwrite.cpp in Sources */, AB06CD90135B8ACE00E977B3 /* render3D.cpp in Sources */, AB06CD91135B8ACE00E977B3 /* ROMReader.cpp in Sources */, AB06CD92135B8ACE00E977B3 /* rtc.cpp in Sources */, AB06CD93135B8ACE00E977B3 /* saves.cpp in Sources */, AB06CD94135B8ACE00E977B3 /* slot1.cpp in Sources */, - AB06CD95135B8ACE00E977B3 /* sndsdl.cpp in Sources */, - AB06CD96135B8ACE00E977B3 /* SPU.cpp in Sources */, - AB06CD97135B8ACE00E977B3 /* texcache.cpp in Sources */, - AB06CD98135B8ACE00E977B3 /* thumb_instructions.cpp in Sources */, - AB06CD99135B8ACE00E977B3 /* version.cpp in Sources */, - AB06CD9A135B8ACE00E977B3 /* wifi.cpp in Sources */, AB06CE55135B8AEE00E977B3 /* slot1_none.cpp in Sources */, AB06CE56135B8AEE00E977B3 /* slot1_r4.cpp in Sources */, AB06CE57135B8AEE00E977B3 /* slot1_retail.cpp in Sources */, @@ -1523,53 +1681,37 @@ AB06CE5D135B8AEE00E977B3 /* slot2_paddle.cpp in Sources */, AB06CE5E135B8AEE00E977B3 /* slot2_piano.cpp in Sources */, AB06CE5F135B8AEE00E977B3 /* slot2_rumblepak.cpp in Sources */, - AB06CE63135B8AEE00E977B3 /* main.cpp in Sources */, - AB06CE66135B8AEE00E977B3 /* gdbstub.cpp in Sources */, - AB06CE68135B8AEE00E977B3 /* metaspu.cpp in Sources */, + ABF4008214B4F1C000578AE7 /* sndOSX.cpp in Sources */, AB06CE6A135B8AEE00E977B3 /* SndOut.cpp in Sources */, - AB06CE6C135B8AEE00E977B3 /* AAFilter.cpp in Sources */, - AB06CE6F135B8AEE00E977B3 /* cpu_detect_x86_gcc.cpp in Sources */, - AB06CE72135B8AEE00E977B3 /* FIFOSampleBuffer.cpp in Sources */, - AB06CE73135B8AEE00E977B3 /* FIRFilter.cpp in Sources */, - AB06CE77135B8AEE00E977B3 /* mmx_optimized.cpp in Sources */, - AB06CE78135B8AEE00E977B3 /* RateTransposer.cpp in Sources */, + AB06CD95135B8ACE00E977B3 /* sndsdl.cpp in Sources */, AB06CE7A135B8AEE00E977B3 /* SoundTouch.cpp in Sources */, + AB06CD96135B8ACE00E977B3 /* SPU.cpp in Sources */, AB06CE7B135B8AEE00E977B3 /* sse_optimized.cpp in Sources */, - AB06CE7C135B8AEE00E977B3 /* TDStretch.cpp in Sources */, - AB06CE7D135B8AEE00E977B3 /* WavFile.cpp in Sources */, - AB06CE7E135B8AEE00E977B3 /* Timestretcher.cpp in Sources */, - AB06CE80135B8AEE00E977B3 /* ConvertUTF.c in Sources */, - AB06CE81135B8AEE00E977B3 /* datetime.cpp in Sources */, - AB06CE82135B8AEE00E977B3 /* crc.cpp in Sources */, - AB06CE83135B8AEE00E977B3 /* decrypt.cpp in Sources */, - AB06CE84135B8AEE00E977B3 /* header.cpp in Sources */, - AB06CE85135B8AEE00E977B3 /* dlditool.cpp in Sources */, - AB06CE86135B8AEE00E977B3 /* emufat.cpp in Sources */, - AB06CE87135B8AEE00E977B3 /* guid.cpp in Sources */, - AB06CE88135B8AEE00E977B3 /* cache.cpp in Sources */, - AB06CE89135B8AEE00E977B3 /* directory.cpp in Sources */, - AB06CE8A135B8AEE00E977B3 /* disc.cpp in Sources */, - AB06CE8B135B8AEE00E977B3 /* fatdir.cpp in Sources */, - AB06CE8C135B8AEE00E977B3 /* fatfile.cpp in Sources */, - AB06CE8D135B8AEE00E977B3 /* file_allocation_table.cpp in Sources */, - AB06CE8E135B8AEE00E977B3 /* filetime.cpp in Sources */, - AB06CE8F135B8AEE00E977B3 /* libfat.cpp in Sources */, - AB06CE90135B8AEE00E977B3 /* libfat_public_api.cpp in Sources */, - AB06CE91135B8AEE00E977B3 /* lock.cpp in Sources */, - AB06CE92135B8AEE00E977B3 /* partition.cpp in Sources */, - AB06CE93135B8AEE00E977B3 /* md5.cpp in Sources */, AB06CE94135B8AEE00E977B3 /* task.cpp in Sources */, - AB06CE95135B8AEE00E977B3 /* vfat.cpp in Sources */, - AB06CE96135B8AEE00E977B3 /* xstring.cpp in Sources */, - AB06CECB135B8E0B00E977B3 /* rom_info.m in Sources */, - AB06CECC135B8E0B00E977B3 /* speed_limit_selection_window.mm in Sources */, + AB06CE7C135B8AEE00E977B3 /* TDStretch.cpp in Sources */, + AB06CD97135B8ACE00E977B3 /* texcache.cpp in Sources */, + AB06CD98135B8ACE00E977B3 /* thumb_instructions.cpp in Sources */, + AB06CE7E135B8AEE00E977B3 /* Timestretcher.cpp in Sources */, 7FA912241426523900E2ABDD /* tinystr.cpp in Sources */, 7FA912251426523900E2ABDD /* tinyxml.cpp in Sources */, 7FA912261426523900E2ABDD /* tinyxmlerror.cpp in Sources */, 7FA912271426523900E2ABDD /* tinyxmlparser.cpp in Sources */, - ABF4008214B4F1C000578AE7 /* sndOSX.cpp in Sources */, + AB06CD99135B8ACE00E977B3 /* version.cpp in Sources */, + AB06CE95135B8AEE00E977B3 /* vfat.cpp in Sources */, + AB06CE7D135B8AEE00E977B3 /* WavFile.cpp in Sources */, + AB06CD9A135B8ACE00E977B3 /* wifi.cpp in Sources */, + AB06CE96135B8AEE00E977B3 /* xstring.cpp in Sources */, + ABAC890C14B7943E001B299F /* main.m in Sources */, + AB06CB65135B8A4D00E977B3 /* screen_state.m in Sources */, + AB73B12F14BDA01C00F49C92 /* appDelegate_legacy.mm in Sources */, ABBF053314B5436E00E505A0 /* cocoa_file.mm in Sources */, + AB06CB66135B8A4D00E977B3 /* cocoa_input.mm in Sources */, AB8FE37914B652EC009E20B1 /* cocoa_util.mm in Sources */, + AB73B13014BDA01C00F49C92 /* emuWindowDelegate_legacy.mm in Sources */, + AB06CB67135B8A4D00E977B3 /* input.mm in Sources */, + AB06CB6A135B8A4D00E977B3 /* nds_control.mm in Sources */, + AB06CB6B135B8A4D00E977B3 /* preferences.mm in Sources */, + AB06CB6E135B8A4D00E977B3 /* video_output_view.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1577,55 +1719,68 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - AB06CB57135B8A4D00E977B3 /* about.m in Sources */, - AB06CB59135B8A4D00E977B3 /* screen_state.m in Sources */, - AB06CB5A135B8A4D00E977B3 /* cocoa_input.mm in Sources */, - AB06CB5B135B8A4D00E977B3 /* input.mm in Sources */, - AB06CB5C135B8A4D00E977B3 /* main_window.mm in Sources */, - AB06CB5D135B8A4D00E977B3 /* main.mm in Sources */, - AB06CB5E135B8A4D00E977B3 /* nds_control.mm in Sources */, - AB06CB5F135B8A4D00E977B3 /* preferences.mm in Sources */, - AB06CB60135B8A4D00E977B3 /* screenshot.mm in Sources */, - AB06CB62135B8A4D00E977B3 /* video_output_view.mm in Sources */, + AB06CE3E135B8AEE00E977B3 /* ConvertUTF.c in Sources */, + AB06CE2A135B8AEE00E977B3 /* AAFilter.cpp in Sources */, AB06CD3D135B8ACE00E977B3 /* addons.cpp in Sources */, AB06CD3F135B8ACE00E977B3 /* arm_instructions.cpp in Sources */, AB06CD40135B8ACE00E977B3 /* armcpu.cpp in Sources */, AB06CD41135B8ACE00E977B3 /* bios.cpp in Sources */, + AB06CE46135B8AEE00E977B3 /* cache.cpp in Sources */, AB06CD42135B8ACE00E977B3 /* cheatSystem.cpp in Sources */, AB06CD44135B8ACE00E977B3 /* common.cpp in Sources */, AB06CD45135B8ACE00E977B3 /* cp15.cpp in Sources */, + AB06CE2D135B8AEE00E977B3 /* cpu_detect_x86_gcc.cpp in Sources */, + AB06CE40135B8AEE00E977B3 /* crc.cpp in Sources */, + AB06CE3F135B8AEE00E977B3 /* datetime.cpp in Sources */, AB06CD47135B8ACE00E977B3 /* debug.cpp in Sources */, + AB06CE41135B8AEE00E977B3 /* decrypt.cpp in Sources */, + AB06CE47135B8AEE00E977B3 /* directory.cpp in Sources */, AB06CD49135B8ACE00E977B3 /* Disassembler.cpp in Sources */, + AB06CE48135B8AEE00E977B3 /* disc.cpp in Sources */, + AB06CE43135B8AEE00E977B3 /* dlditool.cpp in Sources */, AB06CD4A135B8ACE00E977B3 /* driver.cpp in Sources */, + AB06CE44135B8AEE00E977B3 /* emufat.cpp in Sources */, AB06CD4B135B8ACE00E977B3 /* emufile.cpp in Sources */, + AB06CE49135B8AEE00E977B3 /* fatdir.cpp in Sources */, + AB06CE4A135B8AEE00E977B3 /* fatfile.cpp in Sources */, AB06CD4C135B8ACE00E977B3 /* FIFO.cpp in Sources */, + AB06CE30135B8AEE00E977B3 /* FIFOSampleBuffer.cpp in Sources */, + AB06CE4B135B8AEE00E977B3 /* file_allocation_table.cpp in Sources */, + AB06CE4C135B8AEE00E977B3 /* filetime.cpp in Sources */, + AB06CE31135B8AEE00E977B3 /* FIRFilter.cpp in Sources */, AB06CD4D135B8ACE00E977B3 /* firmware.cpp in Sources */, AB06CD4E135B8ACE00E977B3 /* fs-linux.cpp in Sources */, AB06CD50135B8ACE00E977B3 /* gfx3d.cpp in Sources */, - AB06CD51135B8ACE00E977B3 /* GPU_osd_stub.cpp in Sources */, AB06CD53135B8ACE00E977B3 /* GPU.cpp in Sources */, + AB06CD51135B8ACE00E977B3 /* GPU_osd_stub.cpp in Sources */, + AB06CE45135B8AEE00E977B3 /* guid.cpp in Sources */, + AB06CE42135B8AEE00E977B3 /* header.cpp in Sources */, + AB06CE4D135B8AEE00E977B3 /* libfat.cpp in Sources */, + AB06CE4E135B8AEE00E977B3 /* libfat_public_api.cpp in Sources */, + AB06CE4F135B8AEE00E977B3 /* lock.cpp in Sources */, AB06CD55135B8ACE00E977B3 /* matrix.cpp in Sources */, AB06CD56135B8ACE00E977B3 /* mc.cpp in Sources */, + AB06CE51135B8AEE00E977B3 /* md5.cpp in Sources */, + AB06CE26135B8AEE00E977B3 /* metaspu.cpp in Sources */, AB06CD59135B8ACE00E977B3 /* mic.cpp in Sources */, AB06CD5A135B8ACE00E977B3 /* MMU.cpp in Sources */, + AB06CE35135B8AEE00E977B3 /* mmx_optimized.cpp in Sources */, AB06CD5B135B8ACE00E977B3 /* movie.cpp in Sources */, AB06CD5C135B8ACE00E977B3 /* NDSSystem.cpp in Sources */, + AB06CE50135B8AEE00E977B3 /* partition.cpp in Sources */, AB06CD5E135B8ACE00E977B3 /* path.cpp in Sources */, AB06CD5F135B8ACE00E977B3 /* rasterize.cpp in Sources */, + AB06CE36135B8AEE00E977B3 /* RateTransposer.cpp in Sources */, AB06CD60135B8ACE00E977B3 /* readwrite.cpp in Sources */, AB06CD61135B8ACE00E977B3 /* render3D.cpp in Sources */, AB06CD62135B8ACE00E977B3 /* ROMReader.cpp in Sources */, AB06CD63135B8ACE00E977B3 /* rtc.cpp in Sources */, AB06CD64135B8ACE00E977B3 /* saves.cpp in Sources */, AB06CD65135B8ACE00E977B3 /* slot1.cpp in Sources */, - AB06CD67135B8ACE00E977B3 /* SPU.cpp in Sources */, - AB06CD68135B8ACE00E977B3 /* texcache.cpp in Sources */, - AB06CD69135B8ACE00E977B3 /* thumb_instructions.cpp in Sources */, - AB06CD6A135B8ACE00E977B3 /* version.cpp in Sources */, - AB06CD6B135B8ACE00E977B3 /* wifi.cpp in Sources */, AB06CE13135B8AEE00E977B3 /* slot1_none.cpp in Sources */, AB06CE14135B8AEE00E977B3 /* slot1_r4.cpp in Sources */, AB06CE15135B8AEE00E977B3 /* slot1_retail.cpp in Sources */, + 956B96C313DF4CF900FCDCD0 /* slot1_retail_nand.cpp in Sources */, AB06CE16135B8AEE00E977B3 /* slot2_expMemory.cpp in Sources */, AB06CE17135B8AEE00E977B3 /* slot2_gbagame.cpp in Sources */, AB06CE18135B8AEE00E977B3 /* slot2_guitarGrip.cpp in Sources */, @@ -1634,52 +1789,36 @@ AB06CE1B135B8AEE00E977B3 /* slot2_paddle.cpp in Sources */, AB06CE1C135B8AEE00E977B3 /* slot2_piano.cpp in Sources */, AB06CE1D135B8AEE00E977B3 /* slot2_rumblepak.cpp in Sources */, - AB06CE26135B8AEE00E977B3 /* metaspu.cpp in Sources */, + ABF4007F14B4F1C000578AE7 /* sndOSX.cpp in Sources */, AB06CE28135B8AEE00E977B3 /* SndOut.cpp in Sources */, - AB06CE2A135B8AEE00E977B3 /* AAFilter.cpp in Sources */, - AB06CE2D135B8AEE00E977B3 /* cpu_detect_x86_gcc.cpp in Sources */, - AB06CE30135B8AEE00E977B3 /* FIFOSampleBuffer.cpp in Sources */, - AB06CE31135B8AEE00E977B3 /* FIRFilter.cpp in Sources */, - AB06CE35135B8AEE00E977B3 /* mmx_optimized.cpp in Sources */, - AB06CE36135B8AEE00E977B3 /* RateTransposer.cpp in Sources */, AB06CE38135B8AEE00E977B3 /* SoundTouch.cpp in Sources */, + AB06CD67135B8ACE00E977B3 /* SPU.cpp in Sources */, AB06CE39135B8AEE00E977B3 /* sse_optimized.cpp in Sources */, - AB06CE3A135B8AEE00E977B3 /* TDStretch.cpp in Sources */, - AB06CE3B135B8AEE00E977B3 /* WavFile.cpp in Sources */, - AB06CE3C135B8AEE00E977B3 /* Timestretcher.cpp in Sources */, - AB06CE3E135B8AEE00E977B3 /* ConvertUTF.c in Sources */, - AB06CE3F135B8AEE00E977B3 /* datetime.cpp in Sources */, - AB06CE40135B8AEE00E977B3 /* crc.cpp in Sources */, - AB06CE41135B8AEE00E977B3 /* decrypt.cpp in Sources */, - AB06CE42135B8AEE00E977B3 /* header.cpp in Sources */, - AB06CE43135B8AEE00E977B3 /* dlditool.cpp in Sources */, - AB06CE44135B8AEE00E977B3 /* emufat.cpp in Sources */, - AB06CE45135B8AEE00E977B3 /* guid.cpp in Sources */, - AB06CE46135B8AEE00E977B3 /* cache.cpp in Sources */, - AB06CE47135B8AEE00E977B3 /* directory.cpp in Sources */, - AB06CE48135B8AEE00E977B3 /* disc.cpp in Sources */, - AB06CE49135B8AEE00E977B3 /* fatdir.cpp in Sources */, - AB06CE4A135B8AEE00E977B3 /* fatfile.cpp in Sources */, - AB06CE4B135B8AEE00E977B3 /* file_allocation_table.cpp in Sources */, - AB06CE4C135B8AEE00E977B3 /* filetime.cpp in Sources */, - AB06CE4D135B8AEE00E977B3 /* libfat.cpp in Sources */, - AB06CE4E135B8AEE00E977B3 /* libfat_public_api.cpp in Sources */, - AB06CE4F135B8AEE00E977B3 /* lock.cpp in Sources */, - AB06CE50135B8AEE00E977B3 /* partition.cpp in Sources */, - AB06CE51135B8AEE00E977B3 /* md5.cpp in Sources */, AB06CE52135B8AEE00E977B3 /* task.cpp in Sources */, - AB06CE53135B8AEE00E977B3 /* vfat.cpp in Sources */, - AB06CE54135B8AEE00E977B3 /* xstring.cpp in Sources */, - AB06CEC9135B8E0B00E977B3 /* rom_info.m in Sources */, - AB06CECA135B8E0B00E977B3 /* speed_limit_selection_window.mm in Sources */, - 956B96C313DF4CF900FCDCD0 /* slot1_retail_nand.cpp in Sources */, + AB06CE3A135B8AEE00E977B3 /* TDStretch.cpp in Sources */, + AB06CD68135B8ACE00E977B3 /* texcache.cpp in Sources */, + AB06CD69135B8ACE00E977B3 /* thumb_instructions.cpp in Sources */, + AB06CE3C135B8AEE00E977B3 /* Timestretcher.cpp in Sources */, 7FA912201426523900E2ABDD /* tinystr.cpp in Sources */, 7FA912211426523900E2ABDD /* tinyxml.cpp in Sources */, 7FA912221426523900E2ABDD /* tinyxmlerror.cpp in Sources */, 7FA912231426523900E2ABDD /* tinyxmlparser.cpp in Sources */, - ABF4007F14B4F1C000578AE7 /* sndOSX.cpp in Sources */, + AB06CD6A135B8ACE00E977B3 /* version.cpp in Sources */, + AB06CE53135B8AEE00E977B3 /* vfat.cpp in Sources */, + AB06CE3B135B8AEE00E977B3 /* WavFile.cpp in Sources */, + AB06CD6B135B8ACE00E977B3 /* wifi.cpp in Sources */, + AB06CE54135B8AEE00E977B3 /* xstring.cpp in Sources */, + ABAC890914B7943E001B299F /* main.m in Sources */, + AB06CB59135B8A4D00E977B3 /* screen_state.m in Sources */, + AB73B13114BDA01C00F49C92 /* appDelegate_legacy.mm in Sources */, ABBF053014B5436E00E505A0 /* cocoa_file.mm in Sources */, + AB06CB5A135B8A4D00E977B3 /* cocoa_input.mm in Sources */, AB8FE37714B652EC009E20B1 /* cocoa_util.mm in Sources */, + AB73B13214BDA01C00F49C92 /* emuWindowDelegate_legacy.mm in Sources */, + AB06CB5B135B8A4D00E977B3 /* input.mm in Sources */, + AB06CB5E135B8A4D00E977B3 /* nds_control.mm in Sources */, + AB06CB5F135B8A4D00E977B3 /* preferences.mm in Sources */, + AB06CB62135B8A4D00E977B3 /* video_output_view.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1687,55 +1826,68 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - AB0A0D3A14AACE9500E83E91 /* about.m in Sources */, - AB0A0D3C14AACE9500E83E91 /* screen_state.m in Sources */, - AB0A0D3D14AACE9500E83E91 /* cocoa_input.mm in Sources */, - AB0A0D3E14AACE9500E83E91 /* input.mm in Sources */, - AB0A0D3F14AACE9500E83E91 /* main_window.mm in Sources */, - AB0A0D4014AACE9500E83E91 /* main.mm in Sources */, - AB0A0D4114AACE9500E83E91 /* nds_control.mm in Sources */, - AB0A0D4214AACE9500E83E91 /* preferences.mm in Sources */, - AB0A0D4314AACE9500E83E91 /* screenshot.mm in Sources */, - AB0A0D4514AACE9500E83E91 /* video_output_view.mm in Sources */, + AB0A0D8214AACE9500E83E91 /* ConvertUTF.c in Sources */, + AB0A0D7714AACE9500E83E91 /* AAFilter.cpp in Sources */, AB0A0D4614AACE9500E83E91 /* addons.cpp in Sources */, AB0A0D4714AACE9500E83E91 /* arm_instructions.cpp in Sources */, AB0A0D4814AACE9500E83E91 /* armcpu.cpp in Sources */, AB0A0D4914AACE9500E83E91 /* bios.cpp in Sources */, + AB0A0D8A14AACE9500E83E91 /* cache.cpp in Sources */, AB0A0D4A14AACE9500E83E91 /* cheatSystem.cpp in Sources */, AB0A0D4B14AACE9500E83E91 /* common.cpp in Sources */, AB0A0D4C14AACE9500E83E91 /* cp15.cpp in Sources */, + AB0A0D7814AACE9500E83E91 /* cpu_detect_x86_gcc.cpp in Sources */, + AB0A0D8414AACE9500E83E91 /* crc.cpp in Sources */, + AB0A0D8314AACE9500E83E91 /* datetime.cpp in Sources */, AB0A0D4D14AACE9500E83E91 /* debug.cpp in Sources */, + AB0A0D8514AACE9500E83E91 /* decrypt.cpp in Sources */, + AB0A0D8B14AACE9500E83E91 /* directory.cpp in Sources */, AB0A0D4E14AACE9500E83E91 /* Disassembler.cpp in Sources */, + AB0A0D8C14AACE9500E83E91 /* disc.cpp in Sources */, + AB0A0D8714AACE9500E83E91 /* dlditool.cpp in Sources */, AB0A0D4F14AACE9500E83E91 /* driver.cpp in Sources */, + AB0A0D8814AACE9500E83E91 /* emufat.cpp in Sources */, AB0A0D5014AACE9500E83E91 /* emufile.cpp in Sources */, + AB0A0D8D14AACE9500E83E91 /* fatdir.cpp in Sources */, + AB0A0D8E14AACE9500E83E91 /* fatfile.cpp in Sources */, AB0A0D5114AACE9500E83E91 /* FIFO.cpp in Sources */, + AB0A0D7914AACE9500E83E91 /* FIFOSampleBuffer.cpp in Sources */, + AB0A0D8F14AACE9500E83E91 /* file_allocation_table.cpp in Sources */, + AB0A0D9014AACE9500E83E91 /* filetime.cpp in Sources */, + AB0A0D7A14AACE9500E83E91 /* FIRFilter.cpp in Sources */, AB0A0D5214AACE9500E83E91 /* firmware.cpp in Sources */, AB0A0D5314AACE9500E83E91 /* fs-linux.cpp in Sources */, AB0A0D5414AACE9500E83E91 /* gfx3d.cpp in Sources */, - AB0A0D5514AACE9500E83E91 /* GPU_osd_stub.cpp in Sources */, AB0A0D5614AACE9500E83E91 /* GPU.cpp in Sources */, + AB0A0D5514AACE9500E83E91 /* GPU_osd_stub.cpp in Sources */, + AB0A0D8914AACE9500E83E91 /* guid.cpp in Sources */, + AB0A0D8614AACE9500E83E91 /* header.cpp in Sources */, + AB0A0D9114AACE9500E83E91 /* libfat.cpp in Sources */, + AB0A0D9214AACE9500E83E91 /* libfat_public_api.cpp in Sources */, + AB0A0D9314AACE9500E83E91 /* lock.cpp in Sources */, AB0A0D5714AACE9500E83E91 /* matrix.cpp in Sources */, AB0A0D5814AACE9500E83E91 /* mc.cpp in Sources */, + AB0A0D9514AACE9500E83E91 /* md5.cpp in Sources */, + AB0A0D7514AACE9500E83E91 /* metaspu.cpp in Sources */, AB0A0D5914AACE9500E83E91 /* mic.cpp in Sources */, AB0A0D5A14AACE9500E83E91 /* MMU.cpp in Sources */, + AB0A0D7B14AACE9500E83E91 /* mmx_optimized.cpp in Sources */, AB0A0D5B14AACE9500E83E91 /* movie.cpp in Sources */, AB0A0D5C14AACE9500E83E91 /* NDSSystem.cpp in Sources */, + AB0A0D9414AACE9500E83E91 /* partition.cpp in Sources */, AB0A0D5D14AACE9500E83E91 /* path.cpp in Sources */, AB0A0D5E14AACE9500E83E91 /* rasterize.cpp in Sources */, + AB0A0D7C14AACE9500E83E91 /* RateTransposer.cpp in Sources */, AB0A0D5F14AACE9500E83E91 /* readwrite.cpp in Sources */, AB0A0D6014AACE9500E83E91 /* render3D.cpp in Sources */, AB0A0D6114AACE9500E83E91 /* ROMReader.cpp in Sources */, AB0A0D6214AACE9500E83E91 /* rtc.cpp in Sources */, AB0A0D6314AACE9500E83E91 /* saves.cpp in Sources */, AB0A0D6414AACE9500E83E91 /* slot1.cpp in Sources */, - AB0A0D6514AACE9500E83E91 /* SPU.cpp in Sources */, - AB0A0D6614AACE9500E83E91 /* texcache.cpp in Sources */, - AB0A0D6714AACE9500E83E91 /* thumb_instructions.cpp in Sources */, - AB0A0D6814AACE9500E83E91 /* version.cpp in Sources */, - AB0A0D6914AACE9500E83E91 /* wifi.cpp in Sources */, AB0A0D6A14AACE9500E83E91 /* slot1_none.cpp in Sources */, AB0A0D6B14AACE9500E83E91 /* slot1_r4.cpp in Sources */, AB0A0D6C14AACE9500E83E91 /* slot1_retail.cpp in Sources */, + AB0A0D9C14AACE9500E83E91 /* slot1_retail_nand.cpp in Sources */, AB0A0D6D14AACE9500E83E91 /* slot2_expMemory.cpp in Sources */, AB0A0D6E14AACE9500E83E91 /* slot2_gbagame.cpp in Sources */, AB0A0D6F14AACE9500E83E91 /* slot2_guitarGrip.cpp in Sources */, @@ -1744,52 +1896,36 @@ AB0A0D7214AACE9500E83E91 /* slot2_paddle.cpp in Sources */, AB0A0D7314AACE9500E83E91 /* slot2_piano.cpp in Sources */, AB0A0D7414AACE9500E83E91 /* slot2_rumblepak.cpp in Sources */, - AB0A0D7514AACE9500E83E91 /* metaspu.cpp in Sources */, + ABF4008014B4F1C000578AE7 /* sndOSX.cpp in Sources */, AB0A0D7614AACE9500E83E91 /* SndOut.cpp in Sources */, - AB0A0D7714AACE9500E83E91 /* AAFilter.cpp in Sources */, - AB0A0D7814AACE9500E83E91 /* cpu_detect_x86_gcc.cpp in Sources */, - AB0A0D7914AACE9500E83E91 /* FIFOSampleBuffer.cpp in Sources */, - AB0A0D7A14AACE9500E83E91 /* FIRFilter.cpp in Sources */, - AB0A0D7B14AACE9500E83E91 /* mmx_optimized.cpp in Sources */, - AB0A0D7C14AACE9500E83E91 /* RateTransposer.cpp in Sources */, AB0A0D7D14AACE9500E83E91 /* SoundTouch.cpp in Sources */, + AB0A0D6514AACE9500E83E91 /* SPU.cpp in Sources */, AB0A0D7E14AACE9500E83E91 /* sse_optimized.cpp in Sources */, - AB0A0D7F14AACE9500E83E91 /* TDStretch.cpp in Sources */, - AB0A0D8014AACE9500E83E91 /* WavFile.cpp in Sources */, - AB0A0D8114AACE9500E83E91 /* Timestretcher.cpp in Sources */, - AB0A0D8214AACE9500E83E91 /* ConvertUTF.c in Sources */, - AB0A0D8314AACE9500E83E91 /* datetime.cpp in Sources */, - AB0A0D8414AACE9500E83E91 /* crc.cpp in Sources */, - AB0A0D8514AACE9500E83E91 /* decrypt.cpp in Sources */, - AB0A0D8614AACE9500E83E91 /* header.cpp in Sources */, - AB0A0D8714AACE9500E83E91 /* dlditool.cpp in Sources */, - AB0A0D8814AACE9500E83E91 /* emufat.cpp in Sources */, - AB0A0D8914AACE9500E83E91 /* guid.cpp in Sources */, - AB0A0D8A14AACE9500E83E91 /* cache.cpp in Sources */, - AB0A0D8B14AACE9500E83E91 /* directory.cpp in Sources */, - AB0A0D8C14AACE9500E83E91 /* disc.cpp in Sources */, - AB0A0D8D14AACE9500E83E91 /* fatdir.cpp in Sources */, - AB0A0D8E14AACE9500E83E91 /* fatfile.cpp in Sources */, - AB0A0D8F14AACE9500E83E91 /* file_allocation_table.cpp in Sources */, - AB0A0D9014AACE9500E83E91 /* filetime.cpp in Sources */, - AB0A0D9114AACE9500E83E91 /* libfat.cpp in Sources */, - AB0A0D9214AACE9500E83E91 /* libfat_public_api.cpp in Sources */, - AB0A0D9314AACE9500E83E91 /* lock.cpp in Sources */, - AB0A0D9414AACE9500E83E91 /* partition.cpp in Sources */, - AB0A0D9514AACE9500E83E91 /* md5.cpp in Sources */, AB0A0D9614AACE9500E83E91 /* task.cpp in Sources */, - AB0A0D9714AACE9500E83E91 /* vfat.cpp in Sources */, - AB0A0D9814AACE9500E83E91 /* xstring.cpp in Sources */, - AB0A0D9914AACE9500E83E91 /* rom_info.m in Sources */, - AB0A0D9A14AACE9500E83E91 /* speed_limit_selection_window.mm in Sources */, - AB0A0D9C14AACE9500E83E91 /* slot1_retail_nand.cpp in Sources */, + AB0A0D7F14AACE9500E83E91 /* TDStretch.cpp in Sources */, + AB0A0D6614AACE9500E83E91 /* texcache.cpp in Sources */, + AB0A0D6714AACE9500E83E91 /* thumb_instructions.cpp in Sources */, + AB0A0D8114AACE9500E83E91 /* Timestretcher.cpp in Sources */, AB0A0D9D14AACE9500E83E91 /* tinystr.cpp in Sources */, AB0A0D9E14AACE9500E83E91 /* tinyxml.cpp in Sources */, AB0A0D9F14AACE9500E83E91 /* tinyxmlerror.cpp in Sources */, AB0A0DA014AACE9500E83E91 /* tinyxmlparser.cpp in Sources */, - ABF4008014B4F1C000578AE7 /* sndOSX.cpp in Sources */, + AB0A0D6814AACE9500E83E91 /* version.cpp in Sources */, + AB0A0D9714AACE9500E83E91 /* vfat.cpp in Sources */, + AB0A0D8014AACE9500E83E91 /* WavFile.cpp in Sources */, + AB0A0D6914AACE9500E83E91 /* wifi.cpp in Sources */, + AB0A0D9814AACE9500E83E91 /* xstring.cpp in Sources */, + ABAC890B14B7943E001B299F /* main.m in Sources */, + AB0A0D3C14AACE9500E83E91 /* screen_state.m in Sources */, + AB73B12B14BDA01C00F49C92 /* appDelegate_legacy.mm in Sources */, ABBF053114B5436E00E505A0 /* cocoa_file.mm in Sources */, + AB0A0D3D14AACE9500E83E91 /* cocoa_input.mm in Sources */, AB8FE37614B652EC009E20B1 /* cocoa_util.mm in Sources */, + AB73B12C14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm in Sources */, + AB0A0D3E14AACE9500E83E91 /* input.mm in Sources */, + AB0A0D4114AACE9500E83E91 /* nds_control.mm in Sources */, + AB0A0D4214AACE9500E83E91 /* preferences.mm in Sources */, + AB0A0D4514AACE9500E83E91 /* video_output_view.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1797,55 +1933,68 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - ABFE4245143E32F0009A3CCE /* about.m in Sources */, - ABFE4247143E32F0009A3CCE /* screen_state.m in Sources */, - ABFE4248143E32F0009A3CCE /* cocoa_input.mm in Sources */, - ABFE4249143E32F0009A3CCE /* input.mm in Sources */, - ABFE424A143E32F0009A3CCE /* main_window.mm in Sources */, - ABFE424B143E32F0009A3CCE /* main.mm in Sources */, - ABFE424C143E32F0009A3CCE /* nds_control.mm in Sources */, - ABFE424D143E32F0009A3CCE /* preferences.mm in Sources */, - ABFE424E143E32F0009A3CCE /* screenshot.mm in Sources */, - ABFE4250143E32F0009A3CCE /* video_output_view.mm in Sources */, + ABFE428D143E32F0009A3CCE /* ConvertUTF.c in Sources */, + ABFE4282143E32F0009A3CCE /* AAFilter.cpp in Sources */, ABFE4251143E32F0009A3CCE /* addons.cpp in Sources */, ABFE4252143E32F0009A3CCE /* arm_instructions.cpp in Sources */, ABFE4253143E32F0009A3CCE /* armcpu.cpp in Sources */, ABFE4254143E32F0009A3CCE /* bios.cpp in Sources */, + ABFE4295143E32F0009A3CCE /* cache.cpp in Sources */, ABFE4255143E32F0009A3CCE /* cheatSystem.cpp in Sources */, ABFE4256143E32F0009A3CCE /* common.cpp in Sources */, ABFE4257143E32F0009A3CCE /* cp15.cpp in Sources */, + ABFE4283143E32F0009A3CCE /* cpu_detect_x86_gcc.cpp in Sources */, + ABFE428F143E32F0009A3CCE /* crc.cpp in Sources */, + ABFE428E143E32F0009A3CCE /* datetime.cpp in Sources */, ABFE4258143E32F0009A3CCE /* debug.cpp in Sources */, + ABFE4290143E32F0009A3CCE /* decrypt.cpp in Sources */, + ABFE4296143E32F0009A3CCE /* directory.cpp in Sources */, ABFE4259143E32F0009A3CCE /* Disassembler.cpp in Sources */, + ABFE4297143E32F0009A3CCE /* disc.cpp in Sources */, + ABFE4292143E32F0009A3CCE /* dlditool.cpp in Sources */, ABFE425A143E32F0009A3CCE /* driver.cpp in Sources */, + ABFE4293143E32F0009A3CCE /* emufat.cpp in Sources */, ABFE425B143E32F0009A3CCE /* emufile.cpp in Sources */, + ABFE4298143E32F0009A3CCE /* fatdir.cpp in Sources */, + ABFE4299143E32F0009A3CCE /* fatfile.cpp in Sources */, ABFE425C143E32F0009A3CCE /* FIFO.cpp in Sources */, + ABFE4284143E32F0009A3CCE /* FIFOSampleBuffer.cpp in Sources */, + ABFE429A143E32F0009A3CCE /* file_allocation_table.cpp in Sources */, + ABFE429B143E32F0009A3CCE /* filetime.cpp in Sources */, + ABFE4285143E32F0009A3CCE /* FIRFilter.cpp in Sources */, ABFE425D143E32F0009A3CCE /* firmware.cpp in Sources */, ABFE425E143E32F0009A3CCE /* fs-linux.cpp in Sources */, ABFE425F143E32F0009A3CCE /* gfx3d.cpp in Sources */, - ABFE4260143E32F0009A3CCE /* GPU_osd_stub.cpp in Sources */, ABFE4261143E32F0009A3CCE /* GPU.cpp in Sources */, + ABFE4260143E32F0009A3CCE /* GPU_osd_stub.cpp in Sources */, + ABFE4294143E32F0009A3CCE /* guid.cpp in Sources */, + ABFE4291143E32F0009A3CCE /* header.cpp in Sources */, + ABFE429C143E32F0009A3CCE /* libfat.cpp in Sources */, + ABFE429D143E32F0009A3CCE /* libfat_public_api.cpp in Sources */, + ABFE429E143E32F0009A3CCE /* lock.cpp in Sources */, ABFE4262143E32F0009A3CCE /* matrix.cpp in Sources */, ABFE4263143E32F0009A3CCE /* mc.cpp in Sources */, + ABFE42A0143E32F0009A3CCE /* md5.cpp in Sources */, + ABFE4280143E32F0009A3CCE /* metaspu.cpp in Sources */, ABFE4264143E32F0009A3CCE /* mic.cpp in Sources */, ABFE4265143E32F0009A3CCE /* MMU.cpp in Sources */, + ABFE4286143E32F0009A3CCE /* mmx_optimized.cpp in Sources */, ABFE4266143E32F0009A3CCE /* movie.cpp in Sources */, ABFE4267143E32F0009A3CCE /* NDSSystem.cpp in Sources */, + ABFE429F143E32F0009A3CCE /* partition.cpp in Sources */, ABFE4268143E32F0009A3CCE /* path.cpp in Sources */, ABFE4269143E32F0009A3CCE /* rasterize.cpp in Sources */, + ABFE4287143E32F0009A3CCE /* RateTransposer.cpp in Sources */, ABFE426A143E32F0009A3CCE /* readwrite.cpp in Sources */, ABFE426B143E32F0009A3CCE /* render3D.cpp in Sources */, ABFE426C143E32F0009A3CCE /* ROMReader.cpp in Sources */, ABFE426D143E32F0009A3CCE /* rtc.cpp in Sources */, ABFE426E143E32F0009A3CCE /* saves.cpp in Sources */, ABFE426F143E32F0009A3CCE /* slot1.cpp in Sources */, - ABFE4270143E32F0009A3CCE /* SPU.cpp in Sources */, - ABFE4271143E32F0009A3CCE /* texcache.cpp in Sources */, - ABFE4272143E32F0009A3CCE /* thumb_instructions.cpp in Sources */, - ABFE4273143E32F0009A3CCE /* version.cpp in Sources */, - ABFE4274143E32F0009A3CCE /* wifi.cpp in Sources */, ABFE4275143E32F0009A3CCE /* slot1_none.cpp in Sources */, ABFE4276143E32F0009A3CCE /* slot1_r4.cpp in Sources */, ABFE4277143E32F0009A3CCE /* slot1_retail.cpp in Sources */, + ABFE42A7143E32F0009A3CCE /* slot1_retail_nand.cpp in Sources */, ABFE4278143E32F0009A3CCE /* slot2_expMemory.cpp in Sources */, ABFE4279143E32F0009A3CCE /* slot2_gbagame.cpp in Sources */, ABFE427A143E32F0009A3CCE /* slot2_guitarGrip.cpp in Sources */, @@ -1854,52 +2003,36 @@ ABFE427D143E32F0009A3CCE /* slot2_paddle.cpp in Sources */, ABFE427E143E32F0009A3CCE /* slot2_piano.cpp in Sources */, ABFE427F143E32F0009A3CCE /* slot2_rumblepak.cpp in Sources */, - ABFE4280143E32F0009A3CCE /* metaspu.cpp in Sources */, + ABF4008114B4F1C000578AE7 /* sndOSX.cpp in Sources */, ABFE4281143E32F0009A3CCE /* SndOut.cpp in Sources */, - ABFE4282143E32F0009A3CCE /* AAFilter.cpp in Sources */, - ABFE4283143E32F0009A3CCE /* cpu_detect_x86_gcc.cpp in Sources */, - ABFE4284143E32F0009A3CCE /* FIFOSampleBuffer.cpp in Sources */, - ABFE4285143E32F0009A3CCE /* FIRFilter.cpp in Sources */, - ABFE4286143E32F0009A3CCE /* mmx_optimized.cpp in Sources */, - ABFE4287143E32F0009A3CCE /* RateTransposer.cpp in Sources */, ABFE4288143E32F0009A3CCE /* SoundTouch.cpp in Sources */, + ABFE4270143E32F0009A3CCE /* SPU.cpp in Sources */, ABFE4289143E32F0009A3CCE /* sse_optimized.cpp in Sources */, - ABFE428A143E32F0009A3CCE /* TDStretch.cpp in Sources */, - ABFE428B143E32F0009A3CCE /* WavFile.cpp in Sources */, - ABFE428C143E32F0009A3CCE /* Timestretcher.cpp in Sources */, - ABFE428D143E32F0009A3CCE /* ConvertUTF.c in Sources */, - ABFE428E143E32F0009A3CCE /* datetime.cpp in Sources */, - ABFE428F143E32F0009A3CCE /* crc.cpp in Sources */, - ABFE4290143E32F0009A3CCE /* decrypt.cpp in Sources */, - ABFE4291143E32F0009A3CCE /* header.cpp in Sources */, - ABFE4292143E32F0009A3CCE /* dlditool.cpp in Sources */, - ABFE4293143E32F0009A3CCE /* emufat.cpp in Sources */, - ABFE4294143E32F0009A3CCE /* guid.cpp in Sources */, - ABFE4295143E32F0009A3CCE /* cache.cpp in Sources */, - ABFE4296143E32F0009A3CCE /* directory.cpp in Sources */, - ABFE4297143E32F0009A3CCE /* disc.cpp in Sources */, - ABFE4298143E32F0009A3CCE /* fatdir.cpp in Sources */, - ABFE4299143E32F0009A3CCE /* fatfile.cpp in Sources */, - ABFE429A143E32F0009A3CCE /* file_allocation_table.cpp in Sources */, - ABFE429B143E32F0009A3CCE /* filetime.cpp in Sources */, - ABFE429C143E32F0009A3CCE /* libfat.cpp in Sources */, - ABFE429D143E32F0009A3CCE /* libfat_public_api.cpp in Sources */, - ABFE429E143E32F0009A3CCE /* lock.cpp in Sources */, - ABFE429F143E32F0009A3CCE /* partition.cpp in Sources */, - ABFE42A0143E32F0009A3CCE /* md5.cpp in Sources */, ABFE42A1143E32F0009A3CCE /* task.cpp in Sources */, - ABFE42A2143E32F0009A3CCE /* vfat.cpp in Sources */, - ABFE42A3143E32F0009A3CCE /* xstring.cpp in Sources */, - ABFE42A4143E32F0009A3CCE /* rom_info.m in Sources */, - ABFE42A5143E32F0009A3CCE /* speed_limit_selection_window.mm in Sources */, - ABFE42A7143E32F0009A3CCE /* slot1_retail_nand.cpp in Sources */, + ABFE428A143E32F0009A3CCE /* TDStretch.cpp in Sources */, + ABFE4271143E32F0009A3CCE /* texcache.cpp in Sources */, + ABFE4272143E32F0009A3CCE /* thumb_instructions.cpp in Sources */, + ABFE428C143E32F0009A3CCE /* Timestretcher.cpp in Sources */, ABFE42A8143E32F0009A3CCE /* tinystr.cpp in Sources */, ABFE42A9143E32F0009A3CCE /* tinyxml.cpp in Sources */, ABFE42AA143E32F0009A3CCE /* tinyxmlerror.cpp in Sources */, ABFE42AB143E32F0009A3CCE /* tinyxmlparser.cpp in Sources */, - ABF4008114B4F1C000578AE7 /* sndOSX.cpp in Sources */, + ABFE4273143E32F0009A3CCE /* version.cpp in Sources */, + ABFE42A2143E32F0009A3CCE /* vfat.cpp in Sources */, + ABFE428B143E32F0009A3CCE /* WavFile.cpp in Sources */, + ABFE4274143E32F0009A3CCE /* wifi.cpp in Sources */, + ABFE42A3143E32F0009A3CCE /* xstring.cpp in Sources */, + ABAC890A14B7943E001B299F /* main.m in Sources */, + ABFE4247143E32F0009A3CCE /* screen_state.m in Sources */, + AB73B12D14BDA01C00F49C92 /* appDelegate_legacy.mm in Sources */, ABBF053214B5436E00E505A0 /* cocoa_file.mm in Sources */, + ABFE4248143E32F0009A3CCE /* cocoa_input.mm in Sources */, AB8FE37814B652EC009E20B1 /* cocoa_util.mm in Sources */, + AB73B12E14BDA01C00F49C92 /* emuWindowDelegate_legacy.mm in Sources */, + ABFE4249143E32F0009A3CCE /* input.mm in Sources */, + ABFE424C143E32F0009A3CCE /* nds_control.mm in Sources */, + ABFE424D143E32F0009A3CCE /* preferences.mm in Sources */, + ABFE4250143E32F0009A3CCE /* video_output_view.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1920,16 +2053,16 @@ name = Localizable.strings; sourceTree = ""; }; - ABBF04BC14B519A500E505A0 /* MainMenu (Legacy).xib */ = { + AB0191D214BD72EC004CB612 /* MainMenu (Legacy).xib */ = { isa = PBXVariantGroup; children = ( ABBF045E14B5144D00E505A0 /* English */, - ABBF04C114B519CD00E505A0 /* French */, - ABBF04C314B519DF00E505A0 /* Italian */, - ABBF04C414B519E400E505A0 /* Japanese */, - ABBF04C514B519EA00E505A0 /* Chinese */, - ABBF04C614B519F000E505A0 /* Norwegian */, - ABBF04C714B519F500E505A0 /* Romanian */, + AB0191D714BD72FC004CB612 /* French */, + AB0191D814BD72FF004CB612 /* Italian */, + AB0191E614BD741B004CB612 /* Japanese */, + AB0191E714BD741F004CB612 /* Chinese */, + AB0191E814BD7423004CB612 /* Norwegian */, + AB0191E914BD7425004CB612 /* Romanian */, ); name = "MainMenu (Legacy).xib"; sourceTree = ""; diff --git a/desmume/src/cocoa/cocoa_file.h b/desmume/src/cocoa/cocoa_file.h index 557ee3516..67f3bcb20 100644 --- a/desmume/src/cocoa/cocoa_file.h +++ b/desmume/src/cocoa/cocoa_file.h @@ -40,6 +40,7 @@ + (void) setupAllFilePaths; + (BOOL) setupAllAppDirectories; + (NSURL *) saveStateURL; ++ (BOOL) saveScreenshot:(NSURL *)fileURL bitmapData:(NSBitmapImageRep *)bitmapImageRep fileType:(NSBitmapImageFileType)fileType; + (BOOL) saveStateExistsForSlot:(NSURL *)romURL slotNumber:(NSUInteger)slotNumber; + (BOOL) isSaveStateSlotExtension:(NSString *)extension; + (NSString *) getSaveSlotFileName:(NSURL *)romURL slotNumber:(NSUInteger)slotNumber; diff --git a/desmume/src/cocoa/cocoa_file.mm b/desmume/src/cocoa/cocoa_file.mm index 0d484073f..a9efcd93e 100644 --- a/desmume/src/cocoa/cocoa_file.mm +++ b/desmume/src/cocoa/cocoa_file.mm @@ -222,6 +222,53 @@ return [CocoaDSFile getURLUserAppSupport:@STATEKEY appVersion:nil]; } ++ (BOOL) saveScreenshot:(NSURL *)fileURL bitmapData:(NSBitmapImageRep *)bitmapImageRep fileType:(NSBitmapImageFileType)fileType +{ + BOOL result = NO; + + if (fileURL == nil || bitmapImageRep == nil) + { + return result; + } + + NSString *fileExt = nil; + switch (fileType) + { + case NSTIFFFileType: + fileExt = @"tiff"; + break; + + case NSBMPFileType: + fileExt = @"bmp"; + break; + + case NSGIFFileType: + fileExt = @"gif"; + break; + + case NSJPEGFileType: + fileExt = @"jpg"; + break; + + case NSPNGFileType: + fileExt = @"png"; + break; + + case NSJPEG2000FileType: + fileExt = @"jp2"; + break; + + default: + break; + } + + NSURL *saveFileURL = [NSURL fileURLWithPath:[[fileURL path] stringByAppendingPathExtension:fileExt]]; + + result = [[bitmapImageRep representationUsingType:fileType properties:[NSDictionary dictionary]] writeToURL:saveFileURL atomically:NO]; + + return result; +} + /******************************************************************************************** fileKind: diff --git a/desmume/src/cocoa/cocoa_globals.h b/desmume/src/cocoa/cocoa_globals.h index 361dbd472..ec32a26fd 100644 --- a/desmume/src/cocoa/cocoa_globals.h +++ b/desmume/src/cocoa/cocoa_globals.h @@ -41,6 +41,8 @@ #define NSSTRING_TITLE_ENABLE_CHEATS NSLocalizedString(@"Enable Cheats", nil) #define NSSTRING_TITLE_DISABLE_HUD NSLocalizedString(@"Disable HUD", nil) #define NSSTRING_TITLE_ENABLE_HUD NSLocalizedString(@"Enable HUD", nil) +#define NSSTRING_TITLE_HIDE_STATUS_BAR NSLocalizedString(@"Hide Status Bar", nil) +#define NSSTRING_TITLE_SHOW_STATUS_BAR NSLocalizedString(@"Show Status Bar", nil) #define NSSTRING_TITLE_SPEED_1X NSLocalizedString(@"Speed 1x", nil) #define NSSTRING_TITLE_SPEED_2X NSLocalizedString(@"Speed 2x", nil) #define NSSTRING_TITLE_SLOT_NUMBER NSLocalizedString(@"Slot %d", nil) @@ -85,6 +87,27 @@ #define NSSTRING_DISPLAYMODE_TOUCH NSLocalizedString(@"Touch", nil) #define NSSTRING_DISPLAYMODE_COMBO NSLocalizedString(@"Combo", nil) +// LEGACY STRINGS +#define NSSTRING_TITLE_OPEN_ROM_PANEL_LEGACY NSLocalizedString(@"Open ROM...", nil) +#define NSSTRING_TITLE_OPEN_STATE_FILE_PANEL_LEGACY NSLocalizedString(@"Load State From...", nil) +#define NSSTRING_TITLE_SAVE_STATE_FILE_PANEL_LEGACY NSLocalizedString(@"Save State...", nil) +#define NSSTRING_STATUS_ROM_UNLOADED_LEGACY NSLocalizedString(@"No ROM Loaded", nil) +#define NSSTRING_STATUS_ROM_LOADED_LEGACY NSLocalizedString(@"ROM Loaded", nil) +#define NSSTRING_STATUS_ROM_LOADING_FAILED_LEGACY NSLocalizedString(@"Couldn't load ROM", nil) +#define NSSTRING_STATUS_EMULATOR_EXECUTING_LEGACY NSLocalizedString(@"Emulation Executing", nil) +#define NSSTRING_STATUS_EMULATOR_PAUSED_LEGACY NSLocalizedString(@"Emulation Paused", nil) +#define NSSTRING_STATUS_EMULATOR_RESET_LEGACY NSLocalizedString(@"Emulation Reset", nil) +#define NSSTRING_ERROR_TITLE_LEGACY NSLocalizedString(@"Error", nil) +#define NSSTRING_ERROR_GENERIC_LEGACY NSLocalizedString(@"An emulation error occurred", nil) +#define NSSTRING_ERROR_SCREENSHOT_FAILED_LEGACY NSLocalizedString(@"Couldn't create the screenshot image", nil) +#define NSSTRING_MESSAGE_TITLE_LEGACY NSLocalizedString(@"DeSmuME Emulator", nil) +#define NSSTRING_MESSAGE_ASK_CLOSE_LEGACY NSLocalizedString(@"Are you sure you want to close the ROM?", nil) + +#define FILENAME_README "README" +#define FILENAME_COPYING "COPYING" +#define FILENAME_AUTHORS "AUTHORS" +#define FILENAME_CHANGELOG "ChangeLog" + #define PATH_CONFIG_DIRECTORY_0_9_6 "~/.config/desmume" #define FILE_EXT_FIRMWARE_CONFIG "dfc" @@ -113,7 +136,9 @@ #define WINDOW_STATUS_BAR_HEIGHT 24 // Height of an emulation window status bar in pixels. +#define SPEED_SCALAR_QUARTER 0.25 // Speed scalar for quarter execution speed. #define SPEED_SCALAR_HALF 0.5 // Speed scalar for half execution speed. +#define SPEED_SCALAR_THREE_QUARTER 0.75 // Speed scalar for three quarters execution speed. #define SPEED_SCALAR_NORMAL 1.0 // Speed scalar for normal execution speed. #define SPEED_SCALAR_DOUBLE 2.0 // Speed scalar for double execution speed. #define SPEED_SCALAR_MIN 0.005 // Lower limit for the speed multiplier. diff --git a/desmume/src/cocoa/cocoa_util.h b/desmume/src/cocoa/cocoa_util.h index c67ae8cca..30c3a71a2 100644 --- a/desmume/src/cocoa/cocoa_util.h +++ b/desmume/src/cocoa/cocoa_util.h @@ -81,7 +81,7 @@ #ifdef __cplusplus extern "C" { -#endif +#endif uint32_t RGBA5551ToRGBA8888(const uint16_t color16); uint32_t RGBA8888ToRGB888(const uint32_t color24); diff --git a/desmume/src/cocoa/images/Icon_Execute_420x420.png b/desmume/src/cocoa/images/Icon_Execute_420x420.png new file mode 100644 index 000000000..2d577c8c2 Binary files /dev/null and b/desmume/src/cocoa/images/Icon_Execute_420x420.png differ diff --git a/desmume/src/cocoa/images/Icon_Pause_420x420.png b/desmume/src/cocoa/images/Icon_Pause_420x420.png new file mode 100644 index 000000000..9bd6fe285 Binary files /dev/null and b/desmume/src/cocoa/images/Icon_Pause_420x420.png differ diff --git a/desmume/src/cocoa/images/Icon_Speed1x_420x420.png b/desmume/src/cocoa/images/Icon_Speed1x_420x420.png new file mode 100644 index 000000000..df034e348 Binary files /dev/null and b/desmume/src/cocoa/images/Icon_Speed1x_420x420.png differ diff --git a/desmume/src/cocoa/images/Icon_Speed2x_420x420.png b/desmume/src/cocoa/images/Icon_Speed2x_420x420.png new file mode 100644 index 000000000..674ab7de6 Binary files /dev/null and b/desmume/src/cocoa/images/Icon_Speed2x_420x420.png differ diff --git a/desmume/src/cocoa/images/Icon_VolumeFull_16x16.png b/desmume/src/cocoa/images/Icon_VolumeFull_16x16.png new file mode 100644 index 000000000..52b34e81b Binary files /dev/null and b/desmume/src/cocoa/images/Icon_VolumeFull_16x16.png differ diff --git a/desmume/src/cocoa/images/Icon_VolumeMute_16x16.png b/desmume/src/cocoa/images/Icon_VolumeMute_16x16.png new file mode 100644 index 000000000..f7bf5c991 Binary files /dev/null and b/desmume/src/cocoa/images/Icon_VolumeMute_16x16.png differ diff --git a/desmume/src/cocoa/images/Icon_VolumeOneThird_16x16.png b/desmume/src/cocoa/images/Icon_VolumeOneThird_16x16.png new file mode 100644 index 000000000..dbde0e92a Binary files /dev/null and b/desmume/src/cocoa/images/Icon_VolumeOneThird_16x16.png differ diff --git a/desmume/src/cocoa/images/Icon_VolumeTwoThird_16x16.png b/desmume/src/cocoa/images/Icon_VolumeTwoThird_16x16.png new file mode 100644 index 000000000..0486332e3 Binary files /dev/null and b/desmume/src/cocoa/images/Icon_VolumeTwoThird_16x16.png differ diff --git a/desmume/src/cocoa/input.h b/desmume/src/cocoa/input.h index 9399c623b..21d6c5d38 100644 --- a/desmume/src/cocoa/input.h +++ b/desmume/src/cocoa/input.h @@ -27,26 +27,44 @@ @class VideoOutputWindow; @class CocoaDSController; + +@interface ControlsDelegate : NSObject {} + ++ (id)sharedObject; + +@end + @interface InputHandler : NSResponder { @private VideoOutputWindow *my_ds; - CocoaDSController *dsController; + CocoaDSController *cdsController; } //preferences + (NSView*)createPreferencesView:(float)width; + (NSDictionary*)appDefaults; //creation/deletion -- (id)initWithWindow:(VideoOutputWindow*)nds; -- (void)dealloc; +- (id) initWithCdsController:(CocoaDSController *)theController; + +- (void) setCdsController:(CocoaDSController *)theController; +- (CocoaDSController *) cdsController; //keyboard input - (void)keyDown:(NSEvent*)event; - (void)keyUp:(NSEvent*)event; -//mouse input -- (void)mouseDown:(NSEvent*)event; -- (void)mouseDragged:(NSEvent*)event; -- (void)mouseUp:(NSEvent*)event; @end + +#ifdef __cplusplus +extern "C" +{ +#endif + +int testKey(NSString *chars_pressed, NSString *chars_for_key); + +#ifdef __cplusplus +} +#endif + + diff --git a/desmume/src/cocoa/input.mm b/desmume/src/cocoa/input.mm index 051044ad2..18749b785 100644 --- a/desmume/src/cocoa/input.mm +++ b/desmume/src/cocoa/input.mm @@ -19,44 +19,13 @@ #import "input.h" #import "cocoa_input.h" -#import "main_window.h" #import "preferences.h" -unsigned char utf8_return = 0x0D; -unsigned char utf8_right[3] = { 0xEF, 0x9C, 0x83 }; -unsigned char utf8_up[3] = { 0xEF, 0x9C, 0x80 }; -unsigned char utf8_down[3] = { 0xEF, 0x9C, 0x81 }; -unsigned char utf8_left[3] = { 0xEF, 0x9C, 0x82 }; - -@interface ControlsDelegate : NSObject {} -+ (id)sharedObject; -@end - -inline int testKey(NSString *chars_pressed, NSString *chars_for_key) -{ - //Checks for common characters in chars_pressed and chars_for_key - - unichar *buffer1 = (unichar*)malloc([chars_pressed length] * sizeof(unichar)); - unichar *buffer2 = (unichar*)malloc([chars_for_key length] * sizeof(unichar)); - if(!buffer1 || !buffer2)return 0; - - [chars_pressed getCharacters:buffer1]; - [chars_for_key getCharacters:buffer2]; - - int i1, i2; - for(i1 = 0; i1 < [chars_pressed length]; i1++) - for(i2 = 0; i2 < [chars_for_key length]; i2++) - if(buffer1[i1] == buffer2[i2]) - { - free(buffer1); - free(buffer2); - return 1; - } - - free(buffer1); - free(buffer2); - return 0; -} +static unsigned char utf8_return = 0x0D; +static unsigned char utf8_right[3] = { 0xEF, 0x9C, 0x83 }; +static unsigned char utf8_up[3] = { 0xEF, 0x9C, 0x80 }; +static unsigned char utf8_down[3] = { 0xEF, 0x9C, 0x81 }; +static unsigned char utf8_left[3] = { 0xEF, 0x9C, 0x82 }; // @@ -160,24 +129,39 @@ inline int testKey(NSString *chars_pressed, NSString *chars_for_key) return nil; } -- (id)initWithWindow:(VideoOutputWindow*)nds +- (id) initWithCdsController:(CocoaDSController *)theController { self = [super init]; + if(self == nil) + { + return nil; + } - my_ds = nds; - [my_ds retain]; - - dsController = [nds getDSController]; - [dsController retain]; + cdsController = theController; + [cdsController retain]; return self; } - (void)dealloc { + [cdsController release]; + [super dealloc]; } +- (void) setCdsController:(CocoaDSController *)theController +{ + [cdsController release]; + cdsController = theController; + [cdsController retain]; +} + +- (CocoaDSController *) cdsController +{ + return cdsController; +} + - (void)keyDown:(NSEvent*)event { if([event isARepeat])return; @@ -185,18 +169,18 @@ inline int testKey(NSString *chars_pressed, NSString *chars_for_key) NSUserDefaults *settings = [NSUserDefaults standardUserDefaults]; NSString *chars = [event characters]; - if(testKey(chars, [settings stringForKey:PREF_KEY_A ]))[dsController pressA]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_B ]))[dsController pressB]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_SELECT]))[dsController pressSelect]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_START ]))[dsController pressStart]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_RIGHT ]))[dsController pressRight]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_LEFT ]))[dsController pressLeft]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_UP ]))[dsController pressUp]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_DOWN ]))[dsController pressDown]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_R ]))[dsController pressR]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_L ]))[dsController pressL]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_X ]))[dsController pressX]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_Y ]))[dsController pressY]; + if(testKey(chars, [settings stringForKey:PREF_KEY_A ]))[cdsController pressA]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_B ]))[cdsController pressB]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_SELECT]))[cdsController pressSelect]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_START ]))[cdsController pressStart]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_RIGHT ]))[cdsController pressRight]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_LEFT ]))[cdsController pressLeft]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_UP ]))[cdsController pressUp]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_DOWN ]))[cdsController pressDown]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_R ]))[cdsController pressR]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_L ]))[cdsController pressL]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_X ]))[cdsController pressX]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_Y ]))[cdsController pressY]; } - (void)keyUp:(NSEvent*)event @@ -204,39 +188,44 @@ inline int testKey(NSString *chars_pressed, NSString *chars_for_key) NSUserDefaults *settings = [NSUserDefaults standardUserDefaults]; NSString *chars = [event characters]; - if(testKey(chars, [settings stringForKey:PREF_KEY_A ]))[dsController liftA]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_B ]))[dsController liftB]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_SELECT]))[dsController liftSelect]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_START ]))[dsController liftStart]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_RIGHT ]))[dsController liftRight]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_LEFT ]))[dsController liftLeft]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_UP ]))[dsController liftUp]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_DOWN ]))[dsController liftDown]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_R ]))[dsController liftR]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_L ]))[dsController liftL]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_X ]))[dsController liftX]; - else if(testKey(chars, [settings stringForKey:PREF_KEY_Y ]))[dsController liftY]; -} - -- (void)mouseDown:(NSEvent*)event -{ - NSPoint temp = [my_ds windowPointToDSCoords:[event locationInWindow]]; - - if(temp.x >= 0 && temp.y>=0) - { - [dsController touch:temp]; - } -} - -- (void)mouseDragged:(NSEvent*)event -{ - [self mouseDown:event]; -} - -- (void)mouseUp:(NSEvent*)event -{ - [dsController releaseTouch]; + if(testKey(chars, [settings stringForKey:PREF_KEY_A ]))[cdsController liftA]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_B ]))[cdsController liftB]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_SELECT]))[cdsController liftSelect]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_START ]))[cdsController liftStart]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_RIGHT ]))[cdsController liftRight]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_LEFT ]))[cdsController liftLeft]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_UP ]))[cdsController liftUp]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_DOWN ]))[cdsController liftDown]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_R ]))[cdsController liftR]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_L ]))[cdsController liftL]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_X ]))[cdsController liftX]; + else if(testKey(chars, [settings stringForKey:PREF_KEY_Y ]))[cdsController liftY]; } @end +inline int testKey(NSString *chars_pressed, NSString *chars_for_key) +{ + //Checks for common characters in chars_pressed and chars_for_key + + unichar *buffer1 = (unichar*)malloc([chars_pressed length] * sizeof(unichar)); + unichar *buffer2 = (unichar*)malloc([chars_for_key length] * sizeof(unichar)); + if(!buffer1 || !buffer2)return 0; + + [chars_pressed getCharacters:buffer1]; + [chars_for_key getCharacters:buffer2]; + + int i1, i2; + for(i1 = 0; i1 < [chars_pressed length]; i1++) + for(i2 = 0; i2 < [chars_for_key length]; i2++) + if(buffer1[i1] == buffer2[i2]) + { + free(buffer1); + free(buffer2); + return 1; + } + + free(buffer1); + free(buffer2); + return 0; +} diff --git a/desmume/src/cocoa/main.m b/desmume/src/cocoa/main.m new file mode 100644 index 000000000..57db2a804 --- /dev/null +++ b/desmume/src/cocoa/main.m @@ -0,0 +1,25 @@ +/* + Copyright (C) 2007 Jeff Bland + Copyright (C) 2011 Roger Manuel + Copyright (C) 2012 DeSmuME team + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the this software. If not, see . +*/ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **) argv); +} diff --git a/desmume/src/cocoa/main.mm b/desmume/src/cocoa/main.mm deleted file mode 100644 index b60e671a1..000000000 --- a/desmume/src/cocoa/main.mm +++ /dev/null @@ -1,560 +0,0 @@ -/* - Copyright (C) 2007 Jeff Bland - Copyright (C) 2011 Roger Manuel - Copyright (C) 2012 DeSmuME team - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with the this software. If not, see . -*/ - -/* -This file is part of the Cocoa (Mac OS X) port of DeSmuME emulator -By Jeff Bland -Based on work by yopyop and the DeSmuME team! -Mac related questions can go to osx@desmume.org -*/ - -#import -#import "cocoa_file.h" -#import "cocoa_util.h" -#import "main_window.h" -#import "preferences.h" - -#include "sndOSX.h" - -#ifdef GDB_STUB -#include -#endif - -/* -FIXME: .nds.gba support? -*/ - -//Globals---------------------------------------------------------------------------------------- - -//view (defined/managed in main_window.m) -extern NSMenuItem *resize1x; -extern NSMenuItem *resize2x; -extern NSMenuItem *resize3x; -extern NSMenuItem *resize4x; - -extern NSMenuItem *constrain_item; -extern NSMenuItem *min_size_item; -extern NSMenuItem *toggle_status_bar_item; - -extern NSMenuItem *rotation0_item; -extern NSMenuItem *rotation90_item; -extern NSMenuItem *rotation180_item; -extern NSMenuItem *rotation270_item; - -extern NSMenuItem *topBG0_item; -extern NSMenuItem *topBG1_item; -extern NSMenuItem *topBG2_item; -extern NSMenuItem *topBG3_item; -extern NSMenuItem *topOBJ_item; -extern NSMenuItem *subBG0_item; -extern NSMenuItem *subBG1_item; -extern NSMenuItem *subBG2_item; -extern NSMenuItem *subBG3_item; -extern NSMenuItem *subOBJ_item; - -extern NSMenuItem *screenshot_to_file_item; -extern NSMenuItem *screenshot_to_window_item; - -//execution control (defined/managed in nds_control.m) -extern NSMenuItem *close_rom_item; - -extern NSMenuItem *execute_item; -extern NSMenuItem *pause_item; -extern NSMenuItem *reset_item; - -extern NSMenuItem *save_type_item[]; -extern NSString *save_types[]; - -extern NSMenuItem *speed_limit_25_item; -extern NSMenuItem *speed_limit_50_item; -extern NSMenuItem *speed_limit_75_item; -extern NSMenuItem *speed_limit_100_item; -extern NSMenuItem *speed_limit_200_item; -extern NSMenuItem *speed_limit_none_item; -extern NSMenuItem *speed_limit_custom_item; - -extern NSMenuItem *save_state_as_item; -extern NSMenuItem *load_state_from_item; - -//sound (defined/managed in nds_control.m) -extern NSMenuItem *volume_item[]; -extern NSMenuItem *mute_item; - -#define SAVE_SLOTS 10 //this should never be more than NB_SAVES in saves.h -extern NSMenuItem *saveSlot_item[]; -extern NSMenuItem *loadSlot_item[]; - -//extern NSMenuItem *clear_all_saves_item; waiting for more functionality from saves.h - -extern NSMenuItem *rom_info_item; - -//Interfaces-------------------------------------------------------------------------------------- - -@interface AppDelegate : NSObject -{} - -//our methods -- (void)pickROM; - -//delegate methods -- (BOOL)application:(NSApplication*)sender openFile:(NSString*)filename; -- (void)applicationWillFinishLaunching:(NSNotification*)aNotification; -- (void)applicationDidFinishLaunching:(NSNotification*)aNotification; -- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender; -- (void)applicationWillTerminate:(NSNotification*)aNotification; -@end - -// -VideoOutputWindow *main_window; - -/////////////////////////////// - -//This generates and sets the entire menubar (and sets defaults) -void CreateMenu(AppDelegate *delegate) -{ - //Grab the main menu - NSMenu *main_menu = [NSApp mainMenu]; - if(main_menu == nil)return; - - // - int i; - NSMenuItem *temp; - - //File Menu - - temp = [main_menu addItemWithTitle:@"" action:nil keyEquivalent:@""]; - NSMenu *file_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"File", nil)]; - if(file_menu != nil) - { - [main_menu setSubmenu:file_menu forItem:temp]; - - [[file_menu addItemWithTitle:NSLocalizedString(@"Open ROM...", nil) action:@selector(pickROM) keyEquivalent:@"o"] setTarget:delegate]; - - //Recent items menu - // Thanks to Jeff Johnson and the Lap Cat Software Blog for their information on the Open Recent menu in Cocoa - // http://lapcatsoftware.com/blog/ - - temp = [file_menu addItemWithTitle:NSLocalizedString(@"Open Recent", nil) action:nil keyEquivalent:@""]; - - NSMenu *recent_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Open Recent", nil)]; - - if(recent_menu != nil) - { - [recent_menu performSelector:@selector(_setMenuName:) withObject:@"NSRecentDocumentsMenu"]; - [temp setSubmenu:recent_menu]; - - [[recent_menu addItemWithTitle:@"Clear Menu" action:@selector(clearRecentDocuments:) keyEquivalent:@""] setTarget:[NSDocumentController sharedDocumentController]]; - - [recent_menu release]; - } - - [file_menu addItem:[NSMenuItem separatorItem]]; - - rom_info_item = [file_menu addItemWithTitle:NSLocalizedString(@"ROM Info...", nil) action:@selector(showRomInfo) keyEquivalent:@""]; - -#ifdef HAVE_LIBZ //internally, save states only work when zlib is there - - [file_menu addItem:[NSMenuItem separatorItem]]; - - [save_state_as_item = [file_menu addItemWithTitle:NSLocalizedString(@"Save State As...", nil) action:@selector(saveStateAs) keyEquivalent:@""] setEnabled:NO]; - - [load_state_from_item = [file_menu addItemWithTitle:NSLocalizedString(@"Load State From...", nil) action:@selector(loadStateFrom) keyEquivalent:@""] setEnabled:NO]; - - [file_menu addItem:[NSMenuItem separatorItem]]; - - //Save state menu - - [save_state_as_item setEnabled:NO]; - - temp = [file_menu addItemWithTitle:NSLocalizedString(@"Save State", nil) action:nil keyEquivalent:@""]; - - NSMenu *save_state_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Save State", nil)]; - if(save_state_menu != nil) - { - [temp setSubmenu:save_state_menu]; - - for(i = 0; i < SAVE_SLOTS; i++) - { - saveSlot_item[i] = [save_state_menu addItemWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Slot %d", nil), i+1] action:@selector(saveToSlot:) keyEquivalent:[NSString stringWithFormat:@"%d", i<9?i+1:0]]; - [saveSlot_item[i] setKeyEquivalentModifierMask:NSShiftKeyMask]; - } - [save_state_menu release]; - } - - //Load state menu - - temp = [file_menu addItemWithTitle:NSLocalizedString(@"Load State", nil) action:nil keyEquivalent:@""]; - NSMenu *load_state_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Load State", nil)]; - if(load_state_menu != nil) - { - [temp setSubmenu:load_state_menu]; - - for(i = 0; i < SAVE_SLOTS; i++) - { - loadSlot_item[i] = [load_state_menu addItemWithTitle:[saveSlot_item[i] title] action:@selector(loadFromSlot:) keyEquivalent:[NSString stringWithFormat:@"%d", i<9?i+1:0]]; - [loadSlot_item[i] setKeyEquivalentModifierMask:0]; - } - - [load_state_menu release]; - } - -#endif - - [file_menu addItem:[NSMenuItem separatorItem]]; - - close_rom_item = [file_menu addItemWithTitle:NSLocalizedString(@"Close ROM", nil) action:@selector(askAndCloseROM) keyEquivalent:@"w"]; - - [file_menu release]; - } - - //Emulation menu - - temp = [main_menu addItemWithTitle:@"" action:nil keyEquivalent:@""]; - NSMenu *emulation_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Emulation", nil)]; - if(emulation_menu != nil) - { - [main_menu setSubmenu:emulation_menu forItem:temp]; - - execute_item = [emulation_menu addItemWithTitle:NSLocalizedString(@"Execute", nil) action:@selector(execute) keyEquivalent:@"e"]; - pause_item = [emulation_menu addItemWithTitle:NSLocalizedString(@"Pause", nil) action:@selector(pause) keyEquivalent:@"p"]; - reset_item = [emulation_menu addItemWithTitle:NSLocalizedString(@"Reset", nil) action:@selector(reset) keyEquivalent:@"r"]; - - [emulation_menu addItem:[NSMenuItem separatorItem]]; - - //Speed limit menu - - temp = [emulation_menu addItemWithTitle:NSLocalizedString(@"Speed Limit", nil) action:nil keyEquivalent:@""]; - - NSMenu *speed_limit_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Speed Limit", nil)]; - if(speed_limit_menu != nil) - { - [temp setSubmenu:speed_limit_menu]; - - speed_limit_25_item = [speed_limit_menu addItemWithTitle:NSLocalizedString(@"25% Speed Limit", nil) action:@selector(setSpeedLimitFromMenuItem:) keyEquivalent:@""]; - speed_limit_50_item = [speed_limit_menu addItemWithTitle:NSLocalizedString(@"50% Speed Limit", nil) action:@selector(setSpeedLimitFromMenuItem:) keyEquivalent:@""]; - speed_limit_75_item = [speed_limit_menu addItemWithTitle:NSLocalizedString(@"75% Speed Limit", nil) action:@selector(setSpeedLimitFromMenuItem:) keyEquivalent:@""]; - - [speed_limit_menu addItem:[NSMenuItem separatorItem]]; - - speed_limit_100_item = [speed_limit_menu addItemWithTitle:NSLocalizedString(@"100% Speed Limit", nil) action:@selector(setSpeedLimitFromMenuItem:) keyEquivalent:@""]; - - [speed_limit_menu addItem:[NSMenuItem separatorItem]]; - - speed_limit_200_item = [speed_limit_menu addItemWithTitle:NSLocalizedString(@"200% Speed Limit", nil) action:@selector(setSpeedLimitFromMenuItem:) keyEquivalent:@""]; - speed_limit_none_item = [speed_limit_menu addItemWithTitle:NSLocalizedString(@"No Speed Limit" , nil) action:@selector(setSpeedLimitFromMenuItem:) keyEquivalent:@""]; - - [speed_limit_menu addItem:[NSMenuItem separatorItem]]; - - speed_limit_custom_item = [speed_limit_menu addItemWithTitle:NSLocalizedString(@"Custom Speed Limit", nil) action:@selector(setSpeedLimitFromMenuItem:) keyEquivalent:@""]; - - [speed_limit_menu release]; - } - - // Backup media type - temp = [emulation_menu addItemWithTitle:NSLocalizedString(@"Backup Media Type", nil) action:nil keyEquivalent:@""]; - - NSMenu *save_type_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Backup Media Type", nil)]; - if(save_type_menu != nil) - { - [temp setSubmenu:save_type_menu]; - - // Add autodetect apart from the others - save_type_item[0] = [save_type_menu addItemWithTitle:save_types[0] action:@selector(setSaveTypeFromMenuItem:) keyEquivalent:@""]; - [save_type_menu addItem:[NSMenuItem separatorItem]]; - - // Add the rest - for(i = 1; i < MAX_SAVE_TYPE; i++) - { - save_type_item[i] = [save_type_menu addItemWithTitle:save_types[i] action:@selector(setSaveTypeFromMenuItem:) keyEquivalent:@""]; - } - - [save_type_menu release]; - } - - [emulation_menu release]; - } - - //View menu - - temp = [main_menu addItemWithTitle:@"" action:nil keyEquivalent:@""]; - NSMenu *view_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"View", nil)]; - if(view_menu) - { - [main_menu setSubmenu:view_menu forItem:temp]; - - resize1x = [view_menu addItemWithTitle:NSLocalizedString(@"Size 1x", nil) action:@selector(resizeScreen1x) keyEquivalent:@"1"]; - resize2x = [view_menu addItemWithTitle:NSLocalizedString(@"Size 2x", nil) action:@selector(resizeScreen2x) keyEquivalent:@"2"]; - resize3x = [view_menu addItemWithTitle:NSLocalizedString(@"Size 3x", nil) action:@selector(resizeScreen3x) keyEquivalent:@"3"]; - resize4x = [view_menu addItemWithTitle:NSLocalizedString(@"Size 4x", nil) action:@selector(resizeScreen4x) keyEquivalent:@"4"]; - - [view_menu addItem:[NSMenuItem separatorItem]]; - - constrain_item = [view_menu addItemWithTitle:NSLocalizedString(@"Constrain Proportions", nil) action:@selector(toggleConstrainProportions) keyEquivalent:@""]; - min_size_item = [view_menu addItemWithTitle:NSLocalizedString(@"No Smaller Than DS", nil) action:@selector(toggleMinSize) keyEquivalent:@""]; - toggle_status_bar_item = [view_menu addItemWithTitle:NSLocalizedString(@"Show Status Bar", nil) action:@selector(toggleStatusBar) keyEquivalent:@"/"]; - - [view_menu addItem:[NSMenuItem separatorItem]]; - - //Rotation menu - - temp = [view_menu addItemWithTitle:NSLocalizedString(@"Rotation", nil) action:nil keyEquivalent:@""]; - NSMenu *rotation_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Rotation", nil)]; - if(rotation_menu != nil) - { - [temp setSubmenu:rotation_menu]; - - rotation0_item = [rotation_menu addItemWithTitle:NSLocalizedString(@"Rotation 0", nil) action:@selector(setRotation0) keyEquivalent:@""]; - rotation90_item = [rotation_menu addItemWithTitle:NSLocalizedString(@"Rotation 90", nil) action:@selector(setRotation90) keyEquivalent:@""]; - rotation180_item = [rotation_menu addItemWithTitle:NSLocalizedString(@"Rotation 180", nil) action:@selector(setRotation180) keyEquivalent:@""]; - rotation270_item = [rotation_menu addItemWithTitle:NSLocalizedString(@"Rotation 270", nil) action:@selector(setRotation270) keyEquivalent:@""]; - - [rotation_menu release]; - } - - [view_menu addItem:[NSMenuItem separatorItem]]; - - //Layer Menu - - temp = [view_menu addItemWithTitle:NSLocalizedString(@"Layers", nil) action:nil keyEquivalent:@""]; - NSMenu *layer_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Layers", nil)]; - if(layer_menu != nil) - { - [temp setSubmenu: layer_menu]; - - topBG0_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Top BG0", nil) action:@selector(toggleTopBackground0) keyEquivalent:@""]; - topBG1_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Top BG1", nil) action:@selector(toggleTopBackground1) keyEquivalent:@""]; - topBG2_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Top BG2", nil) action:@selector(toggleTopBackground2) keyEquivalent:@""]; - topBG3_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Top BG3", nil) action:@selector(toggleTopBackground3) keyEquivalent:@""]; - topOBJ_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Top OBJ", nil) action:@selector(toggleTopObject) keyEquivalent:@""]; - - [layer_menu addItem:[NSMenuItem separatorItem]]; - - subBG0_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Sub BG0", nil) action:@selector(toggleSubBackground0) keyEquivalent:@""]; - subBG1_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Sub BG1", nil) action:@selector(toggleSubBackground1) keyEquivalent:@""]; - subBG2_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Sub BG2", nil) action:@selector(toggleSubBackground2) keyEquivalent:@""]; - subBG3_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Sub BG3", nil) action:@selector(toggleSubBackground3) keyEquivalent:@""]; - subOBJ_item = [layer_menu addItemWithTitle:NSLocalizedString(@"Sub OBJ", nil) action:@selector(toggleSubObject) keyEquivalent:@""]; - - [layer_menu release]; - } - - [view_menu addItem:[NSMenuItem separatorItem]]; - - screenshot_to_file_item = [view_menu addItemWithTitle:NSLocalizedString(@"Save Screenshot...", nil) action:@selector(saveScreenshot) keyEquivalent:@""]; - - [view_menu release]; - } - - //Sound Menu - - temp = [main_menu addItemWithTitle:@"" action:nil keyEquivalent:@""]; - NSMenu *sound_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Sound", nil)]; - if(sound_menu != nil) - { - [main_menu setSubmenu:sound_menu forItem:temp]; - - [temp = [sound_menu addItemWithTitle:NSLocalizedString(@"Volume", nil) action:nil keyEquivalent:@""] setTarget:[NSApp delegate]]; - - NSMenu *volume_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Volume", nil)]; - if(volume_menu) - { - [sound_menu setSubmenu:volume_menu forItem:temp]; - - for(i = 0; i < 10; i++) - volume_item[i] = [volume_menu addItemWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Volume %d", nil), (i+1)*10] action:@selector(setVolumeFromMenu:) keyEquivalent:@""]; - - [volume_menu release]; - } - - [sound_menu addItem:[NSMenuItem separatorItem]]; - - mute_item = [sound_menu addItemWithTitle:NSLocalizedString(@"Mute", nil) action:@selector(toggleMute) keyEquivalent:@""]; - - [sound_menu release]; - } - - //Create the help menu - - temp = [main_menu addItemWithTitle:@"" action:nil keyEquivalent:@""]; - NSMenu *help_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Help", nil)]; - if(help_menu != nil) - { - [main_menu setSubmenu:help_menu forItem:temp]; - - [[help_menu addItemWithTitle:NSLocalizedString(@"Go to Website", nil) action:@selector(launchWebsite) keyEquivalent: @""] setTarget:NSApp]; - [[help_menu addItemWithTitle:NSLocalizedString(@"Go to Forums", nil) action:@selector(launchForums) keyEquivalent: @""] setTarget:NSApp]; - [[help_menu addItemWithTitle:NSLocalizedString(@"Submit a Bug Report", nil) action:@selector(bugReport) keyEquivalent: @""] setTarget:NSApp]; - - [help_menu release]; - } -} - -#ifdef GDB_STUB -//GDB Stub implementation---------------------------------------------------------------------------- - -void * createThread_gdb(void (*thread_function)( void *data),void *thread_data) -{ - // Create the thread using POSIX routines. - pthread_attr_t attr; - pthread_t* posixThreadID = (pthread_t*)malloc(sizeof(pthread_t)); - - assert(!pthread_attr_init(&attr)); - assert(!pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE)); - - int threadError = pthread_create(posixThreadID, &attr, (void* (*)(void *))thread_function, thread_data); - - assert(!pthread_attr_destroy(&attr)); - - if (threadError != 0) - { - // Report an error. - return NULL; - } - else - { - return posixThreadID; - } -} - -void joinThread_gdb( void *thread_handle) -{ - pthread_join(*((pthread_t*)thread_handle), NULL); - free(thread_handle); -} - -#endif - -//Main Function-------------------------------------------------------------------------------------- - -int main(int argc, char *argv[]) -{ - srand(time(NULL)); - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - [NSApplication sharedApplication]; - [NSApp setDelegate:[[AppDelegate alloc] init]]; - - int result = NSApplicationMain(argc, (const char**)argv); - - [pool release]; - - return result; -} - -//Implementations------------------------------------------------------------------------- - -@implementation AppDelegate - -- (void)pickROM -{ - NSOpenPanel *panel = [NSOpenPanel openPanel]; - - [panel setCanChooseDirectories:NO]; - [panel setCanChooseFiles:YES]; - [panel setResolvesAliases:YES]; - [panel setAllowsMultipleSelection:NO]; - [panel setTitle:NSLocalizedString(@"Open ROM...", nil)]; - - if([panel runModalForDirectory:nil file:nil types:[NSArray arrayWithObjects:@"NDS", @"DS.GBA", nil]] == NSOKButton) - { - NSString* selected_file = [[panel filenames] lastObject]; //hopefully also the first object - - [self application:NSApp openFile:selected_file]; - } -} - -- (BOOL)application:(NSApplication*)sender openFile:(NSString*)filename -{ - BOOL result = NO; - NSURL *fileURL = [NSURL fileURLWithPath:filename]; - - NSString *fileKind = [CocoaDSFile fileKind:fileURL]; - if ([fileKind isEqualToString:@"DS ROM"] || [fileKind isEqualToString:@"GBA ROM"]) - { - result = [main_window loadRom:fileURL]; - } - - return result; -} - -- (void)applicationWillFinishLaunching:(NSNotification*)notification -{ - // Create the needed directories in Application Support if they haven't already - // been created. - if (![CocoaDSFile setupAllAppDirectories]) - { - [CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Could not create the required directories in your Application Support folder. DeSmuME will now quit.", nil)]; - return; - } - - [CocoaDSFile setupAllFilePaths]; - - SNDOSXStartup(); - - //Set default values for all preferences - //(this wont override saved preferences as - //they work in different preference domains) - setAppDefaults(); - - //create the menus - CreateMenu(self); - - //create the video output window (the only window that opens with the app) - main_window = [[VideoOutputWindow alloc] init]; -} - -- (void)applicationDidFinishLaunching:(NSNotification*)notification -{ - //Bring the application to the front - [NSApp activateIgnoringOtherApps:TRUE]; - - //check if it should load something by default - if([[[NSUserDefaults standardUserDefaults] stringForKey:PREF_AFTER_LAUNCHED] compare:PREF_AFTER_LAUNCHED_OPTION_LAST_ROM]==NSOrderedSame) - { - NSArray *recent_documents = [[NSDocumentController sharedDocumentController] recentDocumentURLs]; - - if([recent_documents count] > 0) - { - NSURL *romURL = [recent_documents objectAtIndex:0]; - - [main_window loadRom:romURL]; - } - } -} - -- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender -{ - //Ask user about quitting if a rom is loaded (avoid accidentally quiting with unsaved progress) - if([main_window ROMLoaded]) - if(![CocoaDSUtil quickYesNoDialogUsingTitle:NSLocalizedString(@"DeSmuME Emulator", nil) message:NSLocalizedString(@"Are you sure you want to quit?", nil)]) - return NSTerminateCancel; - - return NSTerminateNow; -} - -- (void)applicationWillTerminate:(NSNotification*)notification -{ - [main_window pause]; - [main_window release]; - - SNDOSXShutdown(); -} - -@end diff --git a/desmume/src/cocoa/nds_control.h b/desmume/src/cocoa/nds_control.h index 3f4375ee3..87b11f3de 100644 --- a/desmume/src/cocoa/nds_control.h +++ b/desmume/src/cocoa/nds_control.h @@ -33,17 +33,6 @@ @class CocoaDSController; @class ScreenState; -@interface CocoaDSStateBuffer : NSObject -{ - @public - int frame_skip; - int speed_limit; -} - -- (id) init; - -@end - //This class is a compelte objective-c wrapper for //the core emulation features, other objective-c code inherit //upon or instanciate this to add interfaces for these features @@ -72,16 +61,15 @@ volatile bool paused; //sey by other thread to let us know if its executing bool muted; - int volume; + float volume; volatile int frame_skip; volatile int speed_limit; volatile int save_type; - - bool doesConfigNeedUpdate; + CGFloat speedScalar; + BOOL isSpeedLimitEnabled; NSTimeInterval calcTimeBudget; - - CocoaDSController *dsController; + CocoaDSController *cdsController; #ifdef GDB_STUB NSInteger arm9_gdb_port; @@ -93,8 +81,8 @@ unsigned char gpu_buff[256 * 256 * 5]; //this is where the 3D rendering of the NDS is stored @public - CocoaDSStateBuffer *dsStateBuffer; NSURL *loadedRomURL; + NSInteger prevCoreState; } //Instanciating, setup, and deconstruction @@ -104,34 +92,44 @@ - (void)dealloc; // Data accessors -- (CocoaDSController*) getDSController; +- (void) setMasterExecute:(BOOL)theState; +- (BOOL) masterExecute; +- (void) setCdsController:(CocoaDSController *)theController; +- (CocoaDSController*) cdsController; //Firmware control - (void)setPlayerName:(NSString*)player_name; //ROM control - (BOOL) loadRom:(NSURL *)romURL; -- (BOOL)ROMLoaded; +- (BOOL)isRomLoaded; - (void)closeROM; //ROM Info -- (NSImage *)ROMIcon; +- (NSImage *)romIcon; - (NSString *) romFileName; -- (NSString *)ROMTitle; -- (NSInteger)ROMMaker; -- (NSInteger)ROMSize; -- (NSInteger)ROMARM9Size; -- (NSInteger)ROMARM7Size; -- (NSInteger)ROMDataSize; +- (NSString *)romTitle; +- (NSInteger)romMaker; +- (NSInteger)romSize; +- (NSInteger)romArm9Size; +- (NSInteger)romArm7Size; +- (NSInteger)romDataSize; +- (NSURL *) loadedRomURL; +- (NSMutableDictionary *) romInfoBindings; ++ (NSMutableDictionary *) romNotLoadedBindings; //execution control +- (void) setCoreState:(NSInteger)coreState; +- (void) restoreCoreState; - (BOOL)executing; - (void)execute; - (BOOL)paused; - (void)pause; - (void)reset; -- (void)setSpeedLimit:(int)percent; //0 is off, 1-1000 is the pertance speed it runs at, anything else does nothing -- (int)speedLimit; +- (void) setSpeedScalar:(CGFloat)scalar; +- (CGFloat) speedScalar; +- (void) setIsSpeedLimitEnabled:(BOOL)theState; +- (BOOL) isSpeedLimitEnabled; - (void)setSaveType:(int)savetype; // see save_types in src/mmu.h - (int)saveType; // default is 0, which is autodetect - (void) updateConfig; @@ -146,10 +144,14 @@ //Sound - (BOOL)hasSound; -- (void)setVolume:(int)volume; //clamped: 0 to 100 -- (int)volume; +- (void) setVolume:(float)vol; //clamped: 0 to 100 +- (float) volume; - (void)enableMute; - (void)disableMute; - (void)toggleMute; - (BOOL)muted; + +- (void) copyToPasteboard; +- (NSBitmapImageRep *) bitmapImageRep; + @end diff --git a/desmume/src/cocoa/nds_control.mm b/desmume/src/cocoa/nds_control.mm index 3eab1625e..52bf2a8d6 100644 --- a/desmume/src/cocoa/nds_control.mm +++ b/desmume/src/cocoa/nds_control.mm @@ -24,11 +24,7 @@ #import "cocoa_util.h" #import "preferences.h" #import "screen_state.h" -#import "main_window.h" - -#ifdef DESMUME_COCOA -#import "sndOSX.h" -#endif +#include "sndOSX.h" #ifdef HAVE_OPENGL #import @@ -54,38 +50,17 @@ volatile bool execute = true; GPU3DInterface *core3DList[] = { &gpu3DNull, &gpu3DRasterize, -#ifdef HAVE_OPENGL -//&gpu3Dgl, -#endif NULL }; SoundInterface_struct *SNDCoreList[] = { &SNDDummy, -#ifdef DESMUME_COCOA &SNDOSX, -#endif NULL }; struct NDS_fw_config_data macDS_firmware; -bool opengl_init() -{ - return true; -} - -@implementation CocoaDSStateBuffer - -- (id) init -{ - frame_skip = -1; //default to auto frame skip - speed_limit = 100; //default to max speed = normal speed - - return self; -} - -@end @implementation NintendoDS - (id)init @@ -97,8 +72,9 @@ bool opengl_init() display_object = nil; error_object = nil; frame_skip = -1; //default to auto frame skip - speed_limit = 100; //default to max speed = normal speed - calcTimeBudget = (NSTimeInterval)(DS_SECONDS_PER_FRAME / ((float)speed_limit / 100.0)); + speedScalar = SPEED_SCALAR_NORMAL; + calcTimeBudget = (NSTimeInterval)(DS_SECONDS_PER_FRAME / speedScalar); + isSpeedLimitEnabled = YES; gui_thread = [NSThread currentThread]; loadedRomURL = nil; execution_lock = [[NSLock alloc] init]; @@ -252,8 +228,7 @@ bool opengl_init() if(context) { [context makeCurrentContext]; - - //oglrender_init = &opengl_init; + NDS_3D_SetDriver(CORE3DLIST_SWRASTERIZE); if(!gpu3D->NDS_3D_Init()) [CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Unable to initialize OpenGL components", nil)]; @@ -269,12 +244,12 @@ bool opengl_init() //Sound Init muted = false; - volume = 100; + volume = 100.0; #ifdef DESMUME_COCOA if(SPU_ChangeSoundCore(SNDCORE_OSX, 735 * 4) != 0) [CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Unable to initialize sound core", nil)]; else - SPU_SetVolume(volume); + SPU_SetVolume((int)volume); #endif //Breakoff a new thread that will execute the ds stuff @@ -282,6 +257,7 @@ bool opengl_init() finished = false; run = false; paused = false; + prevCoreState = CORESTATE_PAUSE; [NSThread detachNewThreadSelector:@selector(run:) toTarget:self withObject:context]; //Start a timer to update the screen @@ -291,8 +267,7 @@ bool opengl_init() [NSTimer scheduledTimerWithTimeInterval:DS_SECONDS_PER_FRAME target:self selector:@selector(videoUpdateTimerHelper) userInfo:nil repeats:YES]; } - dsStateBuffer = [[CocoaDSStateBuffer alloc] init]; - dsController = [[CocoaDSController alloc] init]; + cdsController = nil; return self; } @@ -326,8 +301,7 @@ bool opengl_init() finish = true; while(!finished){} - [dsStateBuffer release]; - [dsController release]; + [cdsController release]; [display_object release]; [error_object release]; @@ -353,9 +327,46 @@ bool opengl_init() [super dealloc]; } -- (CocoaDSController*) getDSController +- (void) setMasterExecute:(BOOL)theState { - return dsController; + //OSSpinLockLock(&spinlockMasterExecute); + + if (theState) + { + execute = true; + } + else + { + execute = false; + } + + //OSSpinLockUnlock(&spinlockMasterExecute); +} + +- (BOOL) masterExecute +{ + BOOL theState = NO; + + //OSSpinLockLock(&spinlockMasterExecute); + + if (execute) + { + theState = YES; + } + + //OSSpinLockUnlock(&spinlockMasterExecute); + + return theState; +} + +- (void) setCdsController:(CocoaDSController *)theController +{ + cdsController = theController; +} + +- (CocoaDSController*) cdsController +{ + return cdsController; } - (void)setPlayerName:(NSString*)player_name @@ -390,16 +401,16 @@ bool opengl_init() //continue playing if load didn't work if(was_paused == NO)[self execute]; - return NO; + return result; } - +/* //clear screen data if(current_screen != nil) { [current_screen release]; current_screen = nil; } - +*/ // Retain a copy of the URL of the currently loaded ROM, since we'll be // using it later. loadedRomURL = romURL; @@ -408,11 +419,13 @@ bool opengl_init() //this is incase emulation stopped from the //emulation core somehow execute = true; - - return YES; + + result = YES; + + return result; } -- (BOOL)ROMLoaded +- (BOOL) isRomLoaded { return (loadedRomURL==nil)?NO:YES; } @@ -420,20 +433,20 @@ bool opengl_init() - (void)closeROM { [self pause]; - +/* if(current_screen != nil) { [current_screen release]; current_screen = nil; } - +*/ NDS_FreeROM(); [loadedRomURL release]; loadedRomURL = nil; } -- (NSImage*)ROMIcon +- (NSImage *) romIcon { NDS_header *header = NDS_getROMHeader(); if(!header)return nil; @@ -512,41 +525,124 @@ bool opengl_init() return result; } -- (NSString*)romFileName +- (NSString *) romFileName { return [[loadedRomURL path] lastPathComponent]; } -- (NSString*)ROMTitle +- (NSString *) romTitle { return [[NSString alloc] initWithCString:(NDS_getROMHeader()->gameTile) encoding:NSUTF8StringEncoding]; } -- (NSInteger)ROMMaker +- (NSInteger) romMaker { return NDS_getROMHeader()->makerCode; } -- (NSInteger)ROMSize +- (NSInteger) romSize { return NDS_getROMHeader()->cardSize; } -- (NSInteger)ROMARM9Size +- (NSInteger) romArm9Size { return NDS_getROMHeader()->ARM9binSize; } -- (NSInteger)ROMARM7Size +- (NSInteger) romArm7Size { return NDS_getROMHeader()->ARM7binSize; } -- (NSInteger)ROMDataSize +- (NSInteger) romDataSize { return NDS_getROMHeader()->ARM7binSize + NDS_getROMHeader()->ARM7src; } +- (NSMutableDictionary *) romInfoBindings +{ + if (![self isRomLoaded]) + { + return [NintendoDS romNotLoadedBindings]; + } + + return [NSMutableDictionary dictionaryWithObjectsAndKeys: + [self romFileName], @"romFileName", + [self romTitle], @"romTitle", + [NSString stringWithFormat:@"%04X", [self romMaker]], @"makerCode", + [NSString stringWithFormat:NSSTRING_STATUS_SIZE_BYTES, [self romSize]], @"romSize", + [NSString stringWithFormat:NSSTRING_STATUS_SIZE_BYTES, [self romArm9Size]], @"arm9BinarySize", + [NSString stringWithFormat:NSSTRING_STATUS_SIZE_BYTES, [self romArm7Size]], @"arm7BinarySize", + [NSString stringWithFormat:NSSTRING_STATUS_SIZE_BYTES, [self romDataSize]], @"dataSize", + [self romIcon], @"iconImage", + nil]; +} + ++ (NSMutableDictionary *) romNotLoadedBindings +{ + NSImage *iconImage = [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"AppIcon_DeSmuME" ofType:@"icns"]] autorelease]; + + return [NSMutableDictionary dictionaryWithObjectsAndKeys: + NSSTRING_STATUS_NO_ROM_LOADED, @"romFileName", + NSSTRING_STATUS_NO_ROM_LOADED, @"romTitle", + NSSTRING_STATUS_NO_ROM_LOADED, @"makerCode", + [NSString stringWithFormat:NSSTRING_STATUS_SIZE_BYTES, 0], @"romSize", + [NSString stringWithFormat:NSSTRING_STATUS_SIZE_BYTES, 0], @"arm9BinarySize", + [NSString stringWithFormat:NSSTRING_STATUS_SIZE_BYTES, 0], @"arm7BinarySize", + [NSString stringWithFormat:NSSTRING_STATUS_SIZE_BYTES, 0], @"dataSize", + iconImage, @"iconImage", + nil]; +} + +- (NSURL *) loadedRomURL +{ + return loadedRomURL; +} + +- (void) setCoreState:(NSInteger)coreState +{ + if ([self paused]) + { + prevCoreState = CORESTATE_PAUSE; + } + else + { + prevCoreState = CORESTATE_EXECUTE; + } + + switch (coreState) + { + case CORESTATE_EXECUTE: + [self execute]; + break; + + case CORESTATE_PAUSE: + [self pause]; + break; + + default: + break; + } +} + +- (void) restoreCoreState +{ + switch (prevCoreState) + { + case CORESTATE_EXECUTE: + [self execute]; + break; + + case CORESTATE_PAUSE: + [self pause]; + break; + + default: + break; + } +} + - (BOOL)executing { return run; @@ -595,21 +691,26 @@ bool opengl_init() execute = true; } -- (void)setSpeedLimit:(int)speedLimit +- (void) setSpeedScalar:(CGFloat)scalar { - if(speedLimit < 0 || speedLimit > 1000) - { - return; - } - - dsStateBuffer->speed_limit = speedLimit; - - doesConfigNeedUpdate = true; + speedScalar = scalar; + [self updateConfig]; } -- (int)speedLimit +- (CGFloat) speedScalar { - return speed_limit; + return speedScalar; +} + +- (void) setIsSpeedLimitEnabled:(BOOL)theState +{ + isSpeedLimitEnabled = theState; + [self updateConfig]; +} + +- (BOOL) isSpeedLimitEnabled +{ + return isSpeedLimitEnabled; } - (void)setSaveType:(int)savetype @@ -742,19 +843,25 @@ bool opengl_init() return core != &SNDDummy; } -- (void)setVolume:(int)new_volume +- (void) setVolume:(float)vol { - if(new_volume < 0)new_volume = 0; - if(new_volume > 100)new_volume = 100; - if(volume == new_volume)return; + if (vol < 0.0f) + { + vol = 0.0f; + } + else if (vol > MAX_VOLUME) + { + vol = MAX_VOLUME; + } - volume = new_volume; + volume = vol; + [sound_lock lock]; - SPU_SetVolume(volume); + SPU_SetVolume((int)vol); [sound_lock unlock]; } -- (int)volume +- (float) volume { if([self hasSound]) return volume; @@ -772,7 +879,7 @@ bool opengl_init() - (void)disableMute { [sound_lock lock]; - SPU_SetVolume(volume); + SPU_SetVolume((int)volume); [sound_lock unlock]; muted = false; } @@ -790,6 +897,38 @@ bool opengl_init() return muted?YES:NO; } +- (void) copyToPasteboard +{ + if (current_screen == nil) + { + return; + } + + NSImage *screenshot = [[current_screen image] autorelease]; + if (screenshot == nil) + { + return; + } + + NSPasteboard *pboard = [NSPasteboard generalPasteboard]; + [pboard declareTypes:[NSArray arrayWithObjects:NSTIFFPboardType, nil] owner:self]; + [pboard setData:[screenshot TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:1.0f] forType:NSTIFFPboardType]; +} + +- (NSBitmapImageRep *) bitmapImageRep +{ + NSBitmapImageRep *currentScreenImageRep = nil; + + if (current_screen == nil) + { + return currentScreenImageRep; + } + + currentScreenImageRep = [current_screen imageRep]; + + return currentScreenImageRep; +} + //---------------------------- //Here's the run function which continuously executes in a separate thread //it's controlled by the run and finish varaiables of the instance @@ -812,20 +951,12 @@ bool opengl_init() - (void)videoUpdateTimerHelper { - if(!run)return; - - [video_update_lock lock]; - ScreenState *screen = current_screen; - [screen retain]; - current_screen = nil; - [video_update_lock unlock]; - - if(screen != nil) + if(!run || current_screen == nil) { - [display_object performSelector:display_func withObject:screen]; - [screen release]; + return; } + [display_object performSelector:display_func withObject:current_screen]; } - (void)run:(NSOpenGLContext*)gl_context @@ -863,18 +994,6 @@ bool opengl_init() */ loopStartDate = [NSDate date]; - /* - Some controls may affect how the loop runs. - - Instead of checking and modifying the NDS config every time through - the loop, only change the config on an as-needed basis. - */ - if(doesConfigNeedUpdate == true) - { - [self updateConfig]; - doesConfigNeedUpdate = false; - } - // Force paused state. paused = false; @@ -904,7 +1023,7 @@ bool opengl_init() The time taken up by this step should be insignificant, so we won't bother calculating this in the time budget. */ - [dsController setupAllDSInputs]; + [cdsController setupAllDSInputs]; NDS_beginProcessingInput(); /* Shouldn't need to do any special processing steps in between. @@ -997,17 +1116,20 @@ bool opengl_init() if(timer_based) { //for tiger compatibility [video_update_lock lock]; - [current_screen release]; + ScreenState *oldScreenData = current_screen; current_screen = new_screen_data; + [oldScreenData release]; [video_update_lock unlock]; } else { //for leopard and later + ScreenState *oldScreenData = current_screen; + current_screen = new_screen_data; //this will generate a warning when compiling on tiger or earlier, but it should //be ok since the purpose of the if statement is to check if this will work - [self performSelector:@selector(videoUpdateHelper:) onThread:gui_thread withObject:new_screen_data waitUntilDone:NO]; - [new_screen_data release]; //performSelector will auto retain the screen data while the other thread displays + [self performSelector:@selector(videoUpdateHelper:) onThread:gui_thread withObject:current_screen waitUntilDone:NO]; + [oldScreenData release]; //performSelector will auto retain the screen data while the other thread displays } } @@ -1026,22 +1148,25 @@ bool opengl_init() - (void) updateConfig { - // Update the Nintendo DS config - frame_skip = dsStateBuffer->frame_skip; - speed_limit = dsStateBuffer->speed_limit; + CGFloat newTimeBudget; - if(speed_limit <= 0) + // Update speed limit + if(!isSpeedLimitEnabled) { - calcTimeBudget = 0; - } - else if(speed_limit > 0 && speed_limit < 1000) - { - calcTimeBudget = (NSTimeInterval)(DS_SECONDS_PER_FRAME / ((float)speed_limit / 100.0)); + newTimeBudget = 0.0; } else { - calcTimeBudget = (NSTimeInterval)(DS_SECONDS_PER_FRAME / ((float)1000.0 / 100.0)); + CGFloat theSpeed = speedScalar; + if(theSpeed <= SPEED_SCALAR_MIN) + { + theSpeed = SPEED_SCALAR_MIN; + } + + newTimeBudget = (NSTimeInterval)(DS_SECONDS_PER_FRAME / theSpeed); } + + calcTimeBudget = newTimeBudget; } @end diff --git a/desmume/src/cocoa/preferences.mm b/desmume/src/cocoa/preferences.mm index eb9b642b0..e3a8a688c 100644 --- a/desmume/src/cocoa/preferences.mm +++ b/desmume/src/cocoa/preferences.mm @@ -93,7 +93,7 @@ void setAppDefaults() { BOOL value = ([sender indexOfSelectedItem] == 0) ? YES : NO; - [[NSUserDefaults standardUserDefaults] setBool:value forKey:PREF_EXECUTE_UPON_LOAD]; + [[NSUserDefaults standardUserDefaults] setBool:value forKey:@"ExecuteROMOnLoad"]; } - (void)afterLaunch:(id)sender @@ -308,7 +308,9 @@ NSView *createPreferencesView(NSString *helpinfo, NSDictionary *options, id dele NSArray* keys = [[options allKeys] sortedArrayUsingSelector:@selector(localizedCompare:)]; NSEnumerator *key_enumerator = [keys reverseObjectEnumerator]; - id key, key_raw, object; + NSString *key; + NSString *key_raw; + NSArray *object; NSRect text_rect = NSMakeRect(5, 5, 220, 29); NSRect button_rect = NSMakeRect(230, 5, PREFERENCES_WIDTH - 235, 26); while ((key_raw = [key_enumerator nextObject])) @@ -319,7 +321,7 @@ NSView *createPreferencesView(NSString *helpinfo, NSDictionary *options, id dele NSString *current_setting = [[NSUserDefaults standardUserDefaults] objectForKey:key_raw]; - if([[object objectAtIndex:0] compare:@"Bool"] == NSOrderedSame) + if([(NSString *)[object objectAtIndex:0] compare:@"Bool"] == NSOrderedSame) { //Create the button for this option NSPopUpButton *button = [[NSPopUpButton alloc] initWithFrame:button_rect pullsDown:NO]; @@ -335,12 +337,12 @@ NSView *createPreferencesView(NSString *helpinfo, NSDictionary *options, id dele [button addItemWithTitle:NSLocalizedString(@"Yes",nil)]; [button addItemWithTitle:NSLocalizedString(@"No",nil)]; - [button selectItemAtIndex:([[NSUserDefaults standardUserDefaults] boolForKey:PREF_EXECUTE_UPON_LOAD] == YES) ? 0 : 1]; + [button selectItemAtIndex:([[NSUserDefaults standardUserDefaults] boolForKey:@"ExecuteROMOnLoad"] == YES) ? 0 : 1]; [view addSubview:button]; } - else if([[object objectAtIndex:0] compare:@"Array"] == NSOrderedSame) + else if([(NSString *)[object objectAtIndex:0] compare:@"Array"] == NSOrderedSame) { //Create the button for this option NSPopUpButton *button = [[NSPopUpButton alloc] initWithFrame:button_rect pullsDown:NO]; @@ -387,7 +389,7 @@ NSView *createPreferencesView(NSString *helpinfo, NSDictionary *options, id dele [view addSubview:button]; } - else if ([[object objectAtIndex:0] caseInsensitiveCompare:@"Text"] == NSOrderedSame) + else if ([(NSString *)[object objectAtIndex:0] caseInsensitiveCompare:@"Text"] == NSOrderedSame) { //if this preference is a text field @@ -406,7 +408,7 @@ NSView *createPreferencesView(NSString *helpinfo, NSDictionary *options, id dele [view addSubview:text]; } - else if([[object objectAtIndex:0] compare:@"Dictionary"] == NSOrderedSame) + else if([(NSString *)[object objectAtIndex:0] compare:@"Dictionary"] == NSOrderedSame) { //Create the button for this option NSPopUpButton *button = [[NSPopUpButton alloc] initWithFrame:button_rect pullsDown:NO]; diff --git a/desmume/src/cocoa/translations/Chinese.lproj/Localizable.strings b/desmume/src/cocoa/translations/Chinese.lproj/Localizable.strings index 6221ad69a..9c4502ac4 100644 Binary files a/desmume/src/cocoa/translations/Chinese.lproj/Localizable.strings and b/desmume/src/cocoa/translations/Chinese.lproj/Localizable.strings differ diff --git a/desmume/src/cocoa/translations/Chinese.lproj/MainMenu (Legacy).strings b/desmume/src/cocoa/translations/Chinese.lproj/MainMenu (Legacy).strings new file mode 100644 index 000000000..0fc4450cb Binary files /dev/null and b/desmume/src/cocoa/translations/Chinese.lproj/MainMenu (Legacy).strings differ diff --git a/desmume/src/cocoa/translations/English.lproj/Localizable.strings b/desmume/src/cocoa/translations/English.lproj/Localizable.strings index 684577be9..b79cc3525 100644 Binary files a/desmume/src/cocoa/translations/English.lproj/Localizable.strings and b/desmume/src/cocoa/translations/English.lproj/Localizable.strings differ diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu (Legacy).strings b/desmume/src/cocoa/translations/English.lproj/MainMenu (Legacy).strings new file mode 100644 index 000000000..c90937c5a Binary files /dev/null and b/desmume/src/cocoa/translations/English.lproj/MainMenu (Legacy).strings differ diff --git a/desmume/src/cocoa/translations/French.lproj/Localizable.strings b/desmume/src/cocoa/translations/French.lproj/Localizable.strings index ddb1f40e9..2701f819b 100644 --- a/desmume/src/cocoa/translations/French.lproj/Localizable.strings +++ b/desmume/src/cocoa/translations/French.lproj/Localizable.strings @@ -6,91 +6,16 @@ //"OK" = ?; //"Cancel" = ?; -/* Menu Headers */ -"File" = "Fichier"; -"Emulation" = "Emulation"; -"View" = "Présentation"; -"Sound" = "Son"; -"Window" = "Fenêtre"; -"Help" = "Aide"; - /* File Menu */ -"Open ROM..." = "Ouvrir une ROM..."; -"Open Recent" = "Fichiers récents"; -"ROM Info..." = "Informations sur la ROM..."; -"Save State As..." = "Enregistrer l'état sous..."; -"Load State From..." = "Charger l'état depuis..."; -"Save State" = "Enregistrer l'état"; -"Load State" = "Charger l'état"; -"Close ROM" = "Fermer la ROM"; "Slot %d" = "Slot %d"; /* Emulation Menu */ "Execute" = "Exécuter"; "Pause" = "Pause"; -"Reset" = "Réinitialiser"; -"Frame Skip" = "Saut d'image"; -"Auto" = "Automatique"; -"Off" = "Off"; -"Skip %d" = "%d"; -//"Speed Limit" = ?; -//"25% Speed Limit" = ?; -//"50% Speed Limit" = ?; -//"75% Speed Limit" = ?; -//"100% Speed Limit" = ?; -//"200% Speed Limit" = ?; -//"No Speed Limit" = ?; -//"Custom Speed Limit" = ?; -//"Custom Speed Limit Window" = ?; -//"Set Max Speed:" = ?; -"Speed %d%%" = "%d%%"; -"Set FAT Image File..." = "Définir le fichier d'image FAT..."; /* View Menu */ -"Size 1x" = "Taille 1x"; -"Size 2x" = "Taille 2x"; -"Size 3x" = "Taille 3x"; -"Size 4x" = "Taille 4x"; -"Full Screen" = "Plein écran"; -"Constrain Proportions" = "Contraindre les proportions"; -"No Smaller Than DS" = "Pas plus petit que la DS"; "Show Status Bar" = "Afficher la barre d'état"; -"Rotation" = "Rotation"; -"Rotation 0" = "0°"; -"Rotation 90" = "90°"; -"Rotation 180" = "180°"; -"Rotation 270" = "270°"; -"Layers" = "Calques"; -"Top BG0" = "Top BG0"; -"Top BG1" = "Top BG1"; -"Top BG2" = "Top BG2"; -"Top BG3" = "Top BG3"; -"Sub BG0" = "Sub BG0"; -"Sub BG1" = "Sub BG1"; -"Sub BG2" = "Sub BG2"; -"Sub BG3" = "Sub BG3"; -"Save Screenshot..." = "Enregistrer une capture d'écran..."; - -/* Sound Menu */ -"Volume" = "Volume"; -"Volume %d" = "%d%"; -"Mute" = "Muet"; - -/* Window Menu */ - -/* Help Menu */ -"Go to Website" = "Aller sur le site web"; -"Go to Forums" = "Aller sur les forums"; -"Submit a Bug Report" = "Envoyer un rapport de bug"; - -/* About panel */ -"DeSmuME" = "DeSmuME"; -"Nintendo DS Emulator" = "Emulateur Nintendo DS"; -"Version %@" = "Version %@"; -"Readme" = "Lisez-moi"; -"License" = "Licence"; -"Authors" = "Auteurs"; -"Change Log" = "Change Log"; +"Hide Status Bar" = "Hide Status Bar"; /* Dialogs */ "Are you sure you want to quit?" = "Etes vous su de vouloir quitter ?"; @@ -136,26 +61,6 @@ //"Space Bar" = ?; //"Enter Key" = ?; -/* ROM Info */ -"ROM File" = "Fichier"; -"ROM Title" = "Titre"; -"ROM Maker" = "Maker"; -"ROM Size" = "Taille de la ROM"; -"ARM9 Size" = "ARM9 Size"; -"ARM7 Size" = "ARM7 Size"; -"Data Size" = "Taille des données"; -"ROM Icon" = "Icône de la ROM"; - -/* Screenshots */ -"Save Screenshot to File..." = "Enregistrer une capture d'écran dans un fichier..."; -"Select Image Format: " = "Sélectionner le format d'image :"; -"Pick by Extension" = "Choisir par extension"; -"BMP" = "BMP"; -"GIF" = "GIF"; -"JPG" = "JPG"; -"PNG" = "PNG"; -"TIFF" = "TIFF"; - /* Status Bar */ "No ROM loaded" = "Aucune ROM chargée"; "ROM Loaded" = "ROM chargée"; @@ -163,9 +68,6 @@ "Emulation Paused" = "En pause"; "Emulation Reset" = "Réinitialiser"; -/* Save States */ -"Save State..." = "Enregistrer l'état..."; - /* Errors */ "Error" = "Erreur"; -"An emulation error occured" = "Une erreur d'émulation est survenue"; +"An emulation error occurred" = "Une erreur d'émulation est survenue"; diff --git a/desmume/src/cocoa/translations/French.lproj/MainMenu (Legacy).strings b/desmume/src/cocoa/translations/French.lproj/MainMenu (Legacy).strings new file mode 100644 index 000000000..b42051f8e Binary files /dev/null and b/desmume/src/cocoa/translations/French.lproj/MainMenu (Legacy).strings differ diff --git a/desmume/src/cocoa/translations/Italian.lproj/Localizable.strings b/desmume/src/cocoa/translations/Italian.lproj/Localizable.strings index b77011922..fc9e418b4 100644 Binary files a/desmume/src/cocoa/translations/Italian.lproj/Localizable.strings and b/desmume/src/cocoa/translations/Italian.lproj/Localizable.strings differ diff --git a/desmume/src/cocoa/translations/Italian.lproj/MainMenu (Legacy).strings b/desmume/src/cocoa/translations/Italian.lproj/MainMenu (Legacy).strings new file mode 100644 index 000000000..a45a97d06 Binary files /dev/null and b/desmume/src/cocoa/translations/Italian.lproj/MainMenu (Legacy).strings differ diff --git a/desmume/src/cocoa/translations/Japanese.lproj/Localizable.strings b/desmume/src/cocoa/translations/Japanese.lproj/Localizable.strings index 539a0b88f..bfdc411b0 100644 Binary files a/desmume/src/cocoa/translations/Japanese.lproj/Localizable.strings and b/desmume/src/cocoa/translations/Japanese.lproj/Localizable.strings differ diff --git a/desmume/src/cocoa/translations/Japanese.lproj/MainMenu (Legacy).strings b/desmume/src/cocoa/translations/Japanese.lproj/MainMenu (Legacy).strings new file mode 100644 index 000000000..a2d756963 Binary files /dev/null and b/desmume/src/cocoa/translations/Japanese.lproj/MainMenu (Legacy).strings differ diff --git a/desmume/src/cocoa/translations/Norwegian.lproj/Localizable.strings b/desmume/src/cocoa/translations/Norwegian.lproj/Localizable.strings index 50e3f78fe..ba442d002 100644 Binary files a/desmume/src/cocoa/translations/Norwegian.lproj/Localizable.strings and b/desmume/src/cocoa/translations/Norwegian.lproj/Localizable.strings differ diff --git a/desmume/src/cocoa/translations/Norwegian.lproj/MainMenu (Legacy).strings b/desmume/src/cocoa/translations/Norwegian.lproj/MainMenu (Legacy).strings new file mode 100644 index 000000000..6c681c9ea Binary files /dev/null and b/desmume/src/cocoa/translations/Norwegian.lproj/MainMenu (Legacy).strings differ diff --git a/desmume/src/cocoa/translations/Romanian.lproj/Localizable.strings b/desmume/src/cocoa/translations/Romanian.lproj/Localizable.strings index 8b4e1262a..f2f53d775 100644 Binary files a/desmume/src/cocoa/translations/Romanian.lproj/Localizable.strings and b/desmume/src/cocoa/translations/Romanian.lproj/Localizable.strings differ diff --git a/desmume/src/cocoa/translations/Romanian.lproj/MainMenu (Legacy).strings b/desmume/src/cocoa/translations/Romanian.lproj/MainMenu (Legacy).strings new file mode 100644 index 000000000..bda776ff6 Binary files /dev/null and b/desmume/src/cocoa/translations/Romanian.lproj/MainMenu (Legacy).strings differ diff --git a/desmume/src/cocoa/userinterface/appDelegate_legacy.h b/desmume/src/cocoa/userinterface/appDelegate_legacy.h new file mode 100644 index 000000000..9f8cbc372 --- /dev/null +++ b/desmume/src/cocoa/userinterface/appDelegate_legacy.h @@ -0,0 +1,75 @@ +/* + Copyright (C) 2007 Jeff Bland + Copyright (C) 2012 DeSmuME team + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the this software. If not, see . +*/ + +#import + +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 + #include "macosx_10_4_compat.h" +#endif + + +@class NintendoDS; +@class InputHandler; +@class VideoOutputWindow; +@compatibility_alias CocoaDSCore NintendoDS; +@compatibility_alias CocoaDSRom NintendoDS; + +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 +@interface AppDelegate : NSObject +#else +@interface AppDelegate : NSObject +#endif +{ + IBOutlet NSWindow *mainWindow; + IBOutlet NSObjectController *aboutWindowController; + IBOutlet NSObjectController *emuWindowController; + IBOutlet NSObjectController *cdsCoreController; + IBOutlet NSObjectController *romInfoPanelController; + IBOutlet NSTextView *readMeTextView; + + IBOutlet NSMenu *mLoadStateSlot; + IBOutlet NSMenu *mSaveStateSlot; + + InputHandler *keyboardHandler; +} + +// Tools Menu +- (IBAction) showSupportFolderInFinder:(id)sender; + +// Help Menu +- (IBAction) launchWebsite:(id)sender; +- (IBAction) launchForums:(id)sender; +- (IBAction) bugReport:(id)sender; + +- (void) setupSlotMenuItems; +- (NSMenuItem *) addSlotMenuItem:(NSMenu *)menu slotNumber:(NSUInteger)slotNumber; + +@end + +#ifdef __cplusplus +extern "C" +{ +#endif + +void* createThread_gdb(void (*thread_function)( void *data),void *thread_data); +void joinThread_gdb(void *thread_handle); + +#ifdef __cplusplus + +} +#endif diff --git a/desmume/src/cocoa/userinterface/appDelegate_legacy.mm b/desmume/src/cocoa/userinterface/appDelegate_legacy.mm new file mode 100644 index 000000000..53f390291 --- /dev/null +++ b/desmume/src/cocoa/userinterface/appDelegate_legacy.mm @@ -0,0 +1,259 @@ +/* + Copyright (C) 2007 Jeff Bland + Copyright (C) 2012 DeSmuME team + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the this software. If not, see . +*/ + +#import "appDelegate_legacy.h" +#import "emuWindowDelegate_legacy.h" +#import "cocoa_input.h" +#import "cocoa_file.h" +#import "cocoa_util.h" +#import "cocoa_globals.h" +#import "nds_control.h" +#import "input.h" +#import "preferences.h" +#include "sndOSX.h" + +#undef BOOL + +#ifdef GDB_STUB +#include +#endif + +#ifdef GDB_STUB +//GDB Stub implementation---------------------------------------------------------------------------- + +void* createThread_gdb(void (*thread_function)( void *data),void *thread_data) +{ + // Create the thread using POSIX routines. + pthread_attr_t attr; + pthread_t* posixThreadID = (pthread_t*)malloc(sizeof(pthread_t)); + + assert(!pthread_attr_init(&attr)); + assert(!pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE)); + + int threadError = pthread_create(posixThreadID, &attr, (void* (*)(void *))thread_function, thread_data); + + assert(!pthread_attr_destroy(&attr)); + + if (threadError != 0) + { + // Report an error. + return NULL; + } + else + { + return posixThreadID; + } +} + +void joinThread_gdb(void *thread_handle) +{ + pthread_join(*((pthread_t*)thread_handle), NULL); + free(thread_handle); +} + +#endif + +@implementation AppDelegate + +- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename +{ + BOOL result = NO; + NSURL *fileURL = [NSURL fileURLWithPath:filename]; + EmuWindowDelegate *mainWindowDelegate = [mainWindow delegate]; + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + + if (cdsCore == nil) + { + return result; + } + + NSString *fileKind = [CocoaDSFile fileKind:fileURL]; + if ([fileKind isEqualToString:@"DS ROM"] || [fileKind isEqualToString:@"GBA ROM"]) + { + result = [mainWindowDelegate handleLoadRom:fileURL]; + } + + return result; +} + +- (void)applicationWillFinishLaunching:(NSNotification *)notification +{ + EmuWindowDelegate *mainWindowDelegate = (EmuWindowDelegate *)[mainWindow delegate]; + + // Create the needed directories in Application Support if they haven't already + // been created. + if (![CocoaDSFile setupAllAppDirectories]) + { + [CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Could not create the required directories in your Application Support folder. DeSmuME will now quit.", nil)]; + return; + } + + [CocoaDSFile setupAllFilePaths]; + + // Setup the About window. + NSMutableDictionary *aboutWindowProperties = [NSMutableDictionary dictionaryWithObjectsAndKeys: + [[NSBundle mainBundle] pathForResource:@FILENAME_README ofType:@""], @"readMePath", + [[NSBundle mainBundle] pathForResource:@FILENAME_COPYING ofType:@""], @"licensePath", + [[NSBundle mainBundle] pathForResource:@FILENAME_AUTHORS ofType:@""], @"authorsPath", + [[NSBundle mainBundle] pathForResource:@FILENAME_CHANGELOG ofType:@""], @"changeLogPath", + [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"], @"versionString", + @__DATE__, @"dateString", + nil]; + + [aboutWindowController setContent:aboutWindowProperties]; + + SNDOSXStartup(); + + //Set default values for all preferences + //(this wont override saved preferences as + //they work in different preference domains) + setAppDefaults(); + + // Setup the slot menu items. We set this up manually instead of through Interface + // Builder because we're assuming an arbitrary number of slot items. + [self setupSlotMenuItems]; + + // Setup the user interface controllers. + [romInfoPanelController setContent:[CocoaDSRom romNotLoadedBindings]]; + [emuWindowController setContent:[mainWindowDelegate bindings]]; + + // Init the DS emulation core. + CocoaDSCore *newCore = [[CocoaDSCore alloc] init]; + [newCore setVideoUpdateCallback:@selector(setScreenState:) withObject:[mainWindowDelegate displayView]]; + [newCore setErrorCallback:@selector(emulationError) withObject:[mainWindow delegate]]; + [cdsCoreController setContent:newCore]; + + // Init the DS controller. + CocoaDSController *newController = [[CocoaDSController alloc] init]; + [newCore setCdsController:newController]; + [[mainWindowDelegate displayView] setCdsController:newController]; + + keyboardHandler = [[InputHandler alloc] initWithCdsController:newController]; + NSResponder *mainNextResponder = [mainWindow nextResponder]; + [mainWindow setNextResponder:keyboardHandler]; + [keyboardHandler setNextResponder:mainNextResponder]; +} + +- (void)applicationDidFinishLaunching:(NSNotification *)notification +{ + EmuWindowDelegate *mainWindowDelegate = [mainWindow delegate]; + + //Bring the application to the front + [NSApp activateIgnoringOtherApps:TRUE]; + + //check if it should load something by default + if([[[NSUserDefaults standardUserDefaults] stringForKey:PREF_AFTER_LAUNCHED] compare:PREF_AFTER_LAUNCHED_OPTION_LAST_ROM]==NSOrderedSame) + { + NSArray *recent_documents = [[NSDocumentController sharedDocumentController] recentDocumentURLs]; + + if([recent_documents count] > 0) + { + NSURL *romURL = [recent_documents objectAtIndex:0]; + + [mainWindowDelegate loadRom:romURL]; + } + } +} + +- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender +{ + EmuWindowDelegate *mainWindowDelegate = [mainWindow delegate]; + + //Ask user about quitting if a rom is loaded (avoid accidentally quitting with unsaved progress) + if([mainWindowDelegate isRomLoaded]) + if(![CocoaDSUtil quickYesNoDialogUsingTitle:NSLocalizedString(@"DeSmuME Emulator", nil) message:NSLocalizedString(@"Are you sure you want to quit?", nil)]) + return NSTerminateCancel; + + return NSTerminateNow; +} + +- (void)applicationWillTerminate:(NSNotification*)notification +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + [cdsCore pause]; + + [keyboardHandler release]; + [[cdsCore cdsController] release]; + + [cdsCore release]; + [cdsCoreController setContent:nil]; + + SNDOSXShutdown(); +} + +- (IBAction) showSupportFolderInFinder:(id)sender +{ + NSURL *folderURL = [CocoaDSFile getBaseURLUserAppSupport]; + + [[NSWorkspace sharedWorkspace] openFile:[folderURL path] withApplication:@"Finder"]; +} + +- (IBAction) launchWebsite:(id)sender +{ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@STRING_DESMUME_WEBSITE]]; +} + +- (IBAction) launchForums:(id)sender +{ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@STRING_DESMUME_FORUM_SITE]]; +} + +- (IBAction) bugReport:(id)sender +{ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@STRING_DESMUME_BUG_SITE]]; +} + +- (void) setupSlotMenuItems +{ + NSInteger i; + NSMenuItem *loadItem = nil; + NSMenuItem *saveItem = nil; + + for(i = 0; i < MAX_SAVESTATE_SLOTS; i++) + { + loadItem = [self addSlotMenuItem:mLoadStateSlot slotNumber:(NSUInteger)(i + 1)]; + [loadItem setKeyEquivalentModifierMask:0]; + [loadItem setTag:i]; + [loadItem setAction:@selector(loadEmuSaveStateSlot:)]; + + saveItem = [self addSlotMenuItem:mSaveStateSlot slotNumber:(NSUInteger)(i + 1)]; + [saveItem setKeyEquivalentModifierMask:NSShiftKeyMask]; + [saveItem setTag:i]; + [saveItem setAction:@selector(saveEmuSaveStateSlot:)]; + } +} + +- (NSMenuItem *) addSlotMenuItem:(NSMenu *)menu slotNumber:(NSUInteger)slotNumber +{ + NSUInteger slotNumberKey = slotNumber; + + if (slotNumber == 10) + { + slotNumberKey = 0; + } + + NSMenuItem *mItem = [menu addItemWithTitle:[NSString stringWithFormat:NSSTRING_TITLE_SLOT_NUMBER, slotNumber] + action:nil + keyEquivalent:[NSString stringWithFormat:@"%d", slotNumberKey]]; + + [mItem setTarget:[mainWindow delegate]]; + + return mItem; +} + +@end diff --git a/desmume/src/cocoa/userinterface/emuWindowDelegate_legacy.h b/desmume/src/cocoa/userinterface/emuWindowDelegate_legacy.h new file mode 100644 index 000000000..3d1c44ec1 --- /dev/null +++ b/desmume/src/cocoa/userinterface/emuWindowDelegate_legacy.h @@ -0,0 +1,123 @@ +/* + Copyright (C) 2007 Jeff Bland + Copyright (C) 2012 DeSmuME team + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the this software. If not, see . +*/ + +#import + +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 + #include "macosx_10_4_compat.h" +#endif + + +@class NintendoDS; +@class VideoOutputView; +@class InputHandler; +@compatibility_alias CocoaDSCore NintendoDS; +@compatibility_alias CocoaDSRom NintendoDS; +@compatibility_alias CocoaDisplayView VideoOutputView; + +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 +@interface EmuWindowDelegate : NSObject +#else +@interface EmuWindowDelegate : NSObject +#endif +{ + NSMutableDictionary *bindings; + NSImage *iconVolumeFull; + NSImage *iconVolumeTwoThird; + NSImage *iconVolumeOneThird; + NSImage *iconVolumeMute; + NSImage *iconExecute; + NSImage *iconPause; + NSImage *iconSpeedNormal; + NSImage *iconSpeedDouble; + + IBOutlet NSWindow *window; + IBOutlet CocoaDisplayView *displayView; + IBOutlet NSView *saveScreenshotPanelAccessoryView; + IBOutlet NSObjectController *emuWindowController; + IBOutlet NSObjectController *cdsCoreController; + IBOutlet NSObjectController *romInfoPanelController; + + BOOL isRomLoading; + NSURL *currentEmuSaveStateURL; + NSUInteger statusBarHeight; + NSSize minDisplayViewSize; + BOOL isSmallestSizeNormal; + BOOL isShowingStatusBar; + NSBitmapImageFileType screenshotFileFormat; +} + +- (NSMutableDictionary *) bindings; +- (CocoaDisplayView *) displayView; +- (void) setContentScalar:(double)s; +- (void) setContentRotation:(double)angleDegrees; +- (double) resizeWithTransform:(NSSize)normalBounds scalar:(double)scalar rotation:(double)angleDegrees; +- (double) maxContentScalar:(NSSize)contentBounds; +- (void) setVolume:(float)vol; +- (float) volume; +- (void) setIsRomLoaded:(BOOL)theState; +- (BOOL) isRomLoaded; +- (void) setStatus:(NSString *)theString; +- (NSString *) status; +- (NSURL *) loadedRomURL; +- (void) emulationError; + +// File Menu +- (IBAction) openRom:(id)sender; +- (IBAction) closeRom:(id)sender; +- (IBAction) openEmuSaveState:(id)sender; +- (IBAction) saveEmuSaveState:(id)sender; +- (IBAction) saveEmuSaveStateAs:(id)sender; +- (IBAction) revertEmuSaveState:(id)sender; +- (IBAction) loadEmuSaveStateSlot:(id)sender; +- (IBAction) saveEmuSaveStateSlot:(id)sender; +- (IBAction) importRomSave:(id)sender; +- (IBAction) exportRomSave:(id)sender; + +// Edit Menu +- (IBAction) copy:(id)sender; + +// Emulation Menu +- (IBAction) speedLimitDisable:(id)sender; +- (IBAction) executeCoreToggle:(id)sender; +- (IBAction) resetCore:(id)sender; +- (IBAction) changeRomSaveType:(id)sender; + +// Window Elements +- (IBAction) changeCoreSpeed:(id)sender; +- (IBAction) changeVolume:(id)sender; +- (IBAction) changeScale:(id)sender; +- (IBAction) changeRotation:(id)sender; +- (IBAction) changeRotationRelative:(id)sender; +- (IBAction) toggleGPUState:(id)sender; + +- (IBAction) toggleMinSize:(id)sender; +- (IBAction) toggleStatusBar:(id)sender; +- (IBAction) changeScreenshotFileFormat:(id)sender; +- (IBAction) saveScreenshotAs:(id)sender; + +- (BOOL) handleLoadRom:(NSURL *)fileURL; +- (BOOL) handleUnloadRom:(NSInteger)reasonID romToLoad:(NSURL *)romURL; +- (BOOL) loadRom:(NSURL *)romURL; +- (BOOL) unloadRom; + +- (void) executeCore; +- (void) pauseCore; +- (void) restoreCoreState; + +@end diff --git a/desmume/src/cocoa/userinterface/emuWindowDelegate_legacy.mm b/desmume/src/cocoa/userinterface/emuWindowDelegate_legacy.mm new file mode 100644 index 000000000..7cb64cd76 --- /dev/null +++ b/desmume/src/cocoa/userinterface/emuWindowDelegate_legacy.mm @@ -0,0 +1,1329 @@ +/* + Copyright (C) 2007 Jeff Bland + Copyright (C) 2012 DeSmuME team + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the this software. If not, see . +*/ + +#import "emuWindowDelegate_legacy.h" +#import "cocoa_file.h" +#import "cocoa_globals.h" +#import "cocoa_util.h" +#import "video_output_view.h" +#import "nds_control.h" +#import "input.h" + + +@implementation EmuWindowDelegate + +- (id)init +{ + self = [super init]; + if(self == nil) + { + return nil; + } + + bindings = [[NSMutableDictionary alloc] init]; + if (bindings == nil) + { + [self release]; + self = nil; + return self; + } + + iconVolumeFull = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_VolumeFull_16x16" ofType:@"png"]]; + iconVolumeTwoThird = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_VolumeTwoThird_16x16" ofType:@"png"]]; + iconVolumeOneThird = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_VolumeOneThird_16x16" ofType:@"png"]]; + iconVolumeMute = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_VolumeMute_16x16" ofType:@"png"]]; + iconExecute = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_Execute_420x420" ofType:@"png"]]; + iconPause = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_Pause_420x420" ofType:@"png"]]; + iconSpeedNormal = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_Speed1x_420x420" ofType:@"png"]]; + iconSpeedDouble = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_Speed2x_420x420" ofType:@"png"]]; + + isRomLoading = NO; + currentEmuSaveStateURL = nil; + statusBarHeight = WINDOW_STATUS_BAR_HEIGHT; + minDisplayViewSize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT * 2); + isSmallestSizeNormal = YES; + isShowingStatusBar = YES; + screenshotFileFormat = NSTIFFFileType; + + [bindings setValue:[NSNumber numberWithBool:NO] forKey:@"isWorking"]; + [bindings setValue:[NSNumber numberWithBool:NO] forKey:@"isRomLoaded"]; + [bindings setValue:[NSNumber numberWithFloat:MAX_VOLUME] forKey:@"volume"]; + [bindings setObject:iconVolumeFull forKey:@"volumeIconImage"]; + [bindings setValue:NSSTRING_STATUS_READY forKey:@"status"]; + + return self; +} + +- (void)dealloc +{ + [iconVolumeFull release]; + [iconVolumeTwoThird release]; + [iconVolumeOneThird release]; + [iconVolumeMute release]; + [iconExecute release]; + [iconPause release]; + [iconSpeedNormal release]; + [iconSpeedDouble release]; + [bindings release]; + + [super dealloc]; +} + +- (NSMutableDictionary *) bindings +{ + return bindings; +} + +- (CocoaDisplayView *) displayView +{ + return displayView; +} + +- (void) setContentScalar:(double)s +{ + [displayView setScale:s]; + + // Resize the window when contentScalar changes. + NSSize drawBounds = [displayView normalSize]; + [self resizeWithTransform:drawBounds scalar:s rotation:[displayView rotation]]; +} + +- (void) setContentRotation:(double)angleDegrees +{ + double newAngleDegrees = fmod(angleDegrees, 360.0); + if (newAngleDegrees < 0.0) + { + newAngleDegrees = 360.0 + newAngleDegrees; + } + + if (newAngleDegrees == 360.0) + { + newAngleDegrees = 0.0; + } + + [displayView setRotation:newAngleDegrees]; + + // Set the minimum content size for the window, since this will change based on rotation. + NSSize drawBounds = minDisplayViewSize; + NSSize minContentSize = GetTransformedBounds(drawBounds, 1.0, CLOCKWISE_DEGREES(newAngleDegrees)); + minContentSize.height += statusBarHeight; + [window setContentMinSize:minContentSize]; + + // Resize the window. + NSSize oldBounds = [window frame].size; + [self resizeWithTransform:[displayView normalSize] scalar:[displayView scale] rotation:newAngleDegrees]; + NSSize newBounds = [window frame].size; + + // If the window size didn't change, it is possible that the old and new rotation angles + // are 180 degrees offset from each other. In this case, we'll need to force the + // display view to update itself. + if (oldBounds.width == newBounds.width && oldBounds.height == newBounds.height) + { + [displayView setFrame:[displayView frame]]; + } +} + +- (double) resizeWithTransform:(NSSize)normalBounds scalar:(double)scalar rotation:(double)angleDegrees +{ + // Convert angle to clockwise-direction degrees. + angleDegrees = CLOCKWISE_DEGREES(angleDegrees); + + // Get the maximum scalar size within drawBounds. Constrain scalar to maxScalar if necessary. + NSSize checkSize = GetTransformedBounds(normalBounds, 1.0, angleDegrees); + double maxScalar = [self maxContentScalar:checkSize]; + if (scalar > maxScalar) + { + scalar = maxScalar; + } + + // Get the new bounds for the window's content view based on the transformed draw bounds. + NSSize transformedBounds = GetTransformedBounds(normalBounds, scalar, angleDegrees); + + // Get the center of the content view in screen coordinates. + NSRect windowContentRect = [[window contentView] bounds]; + double translationX = (windowContentRect.size.width - transformedBounds.width) / 2.0; + double translationY = ((windowContentRect.size.height - statusBarHeight) - transformedBounds.height) / 2.0; + + // Resize the window. + NSRect windowFrame = [window frame]; + NSRect newFrame = [window frameRectForContentRect:NSMakeRect(windowFrame.origin.x + translationX, windowFrame.origin.y + translationY, transformedBounds.width, transformedBounds.height + statusBarHeight)]; + [window setFrame:newFrame display:YES animate:NO]; + + return scalar; +} + +- (double) maxContentScalar:(NSSize)contentBounds +{ + // Determine the maximum scale based on the visible screen size (which + // doesn't include the menu bar or dock). + NSRect screenFrame = [[NSScreen mainScreen] visibleFrame]; + NSRect windowFrame = [window frameRectForContentRect:NSMakeRect(0.0, 0.0, contentBounds.width, contentBounds.height + statusBarHeight)]; + + NSSize visibleScreenBounds = { (screenFrame.size.width - (windowFrame.size.width - contentBounds.width)), (screenFrame.size.height - (windowFrame.size.height - contentBounds.height)) }; + double maxS = GetMaxScalarInBounds(contentBounds.width, contentBounds.height, visibleScreenBounds.width, visibleScreenBounds.height); + + return maxS; +} + +- (void) setVolume:(float)vol +{ + [bindings setValue:[NSNumber numberWithFloat:vol] forKey:@"volume"]; + + // Update the icon. + NSImage *currentImage = [bindings valueForKey:@"volumeIconImage"]; + NSImage *newImage = nil; + if (vol <= 0.0f) + { + newImage = iconVolumeMute; + } + else if (vol > 0.0f && vol <= VOLUME_THRESHOLD_LOW) + { + newImage = iconVolumeOneThird; + } + else if (vol > VOLUME_THRESHOLD_LOW && vol <= VOLUME_THRESHOLD_HIGH) + { + newImage = iconVolumeTwoThird; + } + else + { + newImage = iconVolumeFull; + } + + if (newImage != currentImage) + { + [bindings setObject:newImage forKey:@"volumeIconImage"]; + } +} + +- (float) volume +{ + return [(NSNumber *)[bindings valueForKey:@"volume"] floatValue]; +} + +- (void) setIsRomLoaded:(BOOL)theState +{ + [bindings setValue:[NSNumber numberWithBool:theState] forKey:@"isRomLoaded"]; +} + +- (BOOL) isRomLoaded +{ + return [(NSNumber *)[bindings valueForKey:@"isRomLoaded"] boolValue]; +} + +- (void) setStatus:(NSString *)theString +{ + [bindings setValue:theString forKey:@"status"]; +} + +- (NSString *) status +{ + return (NSString *)[bindings valueForKey:@"status"]; +} + +- (NSURL *) loadedRomURL +{ + NSURL *romURL = nil; + + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + if (cdsCore != nil) + { + romURL = [cdsCore loadedRomURL]; + } + + return romURL; +} + +- (void) emulationError +{ + [CocoaDSUtil quickDialogUsingTitle:NSSTRING_ERROR_TITLE_LEGACY message:NSSTRING_ERROR_GENERIC_LEGACY]; +} + +- (IBAction) openRom:(id)sender +{ + if (isRomLoading) + { + return; + } + + NSURL *selectedFile = nil; + NSInteger buttonClicked = NSFileHandlingPanelCancelButton; + NSOpenPanel *panel = [NSOpenPanel openPanel]; + + [panel setCanChooseDirectories:NO]; + [panel setCanChooseFiles:YES]; + [panel setResolvesAliases:YES]; + [panel setAllowsMultipleSelection:NO]; + [panel setTitle:NSSTRING_TITLE_OPEN_ROM_PANEL]; + NSArray *fileTypes = [NSArray arrayWithObjects:@FILE_EXT_ROM_DS, @FILE_EXT_ROM_GBA, nil]; + + // The NSOpenPanel method -(NSInt)runModalForDirectory:file:types: + // is deprecated in Mac OS X v10.6. +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 + [panel setAllowedFileTypes:fileTypes]; + buttonClicked = [panel runModal]; +#else + buttonClicked = [panel runModalForDirectory:nil file:nil types:fileTypes]; +#endif + + if (buttonClicked == NSFileHandlingPanelOKButton) + { + selectedFile = [[panel URLs] lastObject]; + if(selectedFile == nil) + { + return; + } + } + else + { + return; + } + + [self handleLoadRom:selectedFile]; +} + +- (IBAction) closeRom:(id)sender; +{ + BOOL willClose = [CocoaDSUtil quickYesNoDialogUsingTitle:NSSTRING_MESSAGE_TITLE_LEGACY message:NSSTRING_MESSAGE_ASK_CLOSE_LEGACY]; + if (willClose) + { + [self handleUnloadRom:REASONFORCLOSE_NORMAL romToLoad:nil]; + } +} + +- (IBAction) openEmuSaveState:(id)sender +{ + BOOL result = NO; + NSURL *selectedFile = nil; + NSInteger buttonClicked = NSFileHandlingPanelCancelButton; + NSOpenPanel *panel = [NSOpenPanel openPanel]; + + [panel setCanChooseDirectories:NO]; + [panel setCanChooseFiles:YES]; + [panel setResolvesAliases:YES]; + [panel setAllowsMultipleSelection:NO]; + [panel setTitle:NSSTRING_TITLE_OPEN_STATE_FILE_PANEL]; + NSArray *fileTypes = [NSArray arrayWithObjects:@FILE_EXT_SAVE_STATE, nil]; + + // The NSOpenPanel method -(NSInt)runModalForDirectory:file:types: + // is deprecated in Mac OS X v10.6. +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 + [panel setAllowedFileTypes:fileTypes]; + buttonClicked = [panel runModal]; +#else + buttonClicked = [panel runModalForDirectory:nil file:nil types:fileTypes]; +#endif + + if (buttonClicked == NSFileHandlingPanelOKButton) + { + selectedFile = [[panel URLs] lastObject]; + if(selectedFile == nil) + { + return; + } + } + else + { + return; + } + + [self pauseCore]; + + result = [CocoaDSFile loadState:selectedFile]; + if (result == NO) + { + [self setStatus:NSSTRING_STATUS_SAVESTATE_LOADING_FAILED]; + [self restoreCoreState]; + return; + } + + currentEmuSaveStateURL = selectedFile; + [currentEmuSaveStateURL retain]; + [window setDocumentEdited:YES]; + + [self restoreCoreState]; + [self setStatus:NSSTRING_STATUS_SAVESTATE_LOADED]; +} + +- (IBAction) saveEmuSaveState:(id)sender +{ + BOOL result = NO; + + if ([window isDocumentEdited] && currentEmuSaveStateURL != nil) + { + [self pauseCore]; + + result = [CocoaDSFile saveState:currentEmuSaveStateURL]; + if (result == NO) + { + [self setStatus:NSSTRING_STATUS_SAVESTATE_SAVING_FAILED]; + return; + } + + [window setDocumentEdited:YES]; + + [self restoreCoreState]; + [self setStatus:NSSTRING_STATUS_SAVESTATE_SAVED]; + } + else + { + [self saveEmuSaveStateAs:sender]; + } +} + +- (IBAction) saveEmuSaveStateAs:(id)sender +{ + BOOL result = NO; + NSInteger buttonClicked = NSFileHandlingPanelCancelButton; + NSSavePanel *panel = [NSSavePanel savePanel]; + + [panel setCanCreateDirectories:YES]; + [panel setTitle:NSSTRING_TITLE_SAVE_STATE_FILE_PANEL]; + [panel setRequiredFileType:@FILE_EXT_SAVE_STATE]; + + buttonClicked = [panel runModal]; + if(buttonClicked == NSOKButton) + { + [self pauseCore]; + + NSURL *saveFileURL = [panel URL]; + + result = [CocoaDSFile saveState:saveFileURL]; + if (result == NO) + { + [self setStatus:NSSTRING_STATUS_SAVESTATE_SAVING_FAILED]; + return; + } + + currentEmuSaveStateURL = saveFileURL; + [currentEmuSaveStateURL retain]; + [window setDocumentEdited:YES]; + + [self restoreCoreState]; + [self setStatus:NSSTRING_STATUS_SAVESTATE_SAVED]; + } +} + +- (IBAction) revertEmuSaveState:(id)sender +{ + BOOL result = NO; + + if ([window isDocumentEdited] && currentEmuSaveStateURL != nil) + { + [self pauseCore]; + + result = [CocoaDSFile loadState:currentEmuSaveStateURL]; + if (result == NO) + { + [self setStatus:NSSTRING_STATUS_SAVESTATE_REVERTING_FAILED]; + return; + } + + [window setDocumentEdited:YES]; + + [self restoreCoreState]; + [self setStatus:NSSTRING_STATUS_SAVESTATE_REVERTED]; + } +} + +- (IBAction) loadEmuSaveStateSlot:(id)sender +{ + BOOL result = NO; + NSInteger i = [CocoaDSUtil getIBActionSenderTag:sender]; + + NSString *saveStatePath = [[CocoaDSFile saveStateURL] path]; + if (saveStatePath == nil) + { + return; + } + + if (i < 0 || i > MAX_SAVESTATE_SLOTS) + { + return; + } + + NSString *fileName = [CocoaDSFile getSaveSlotFileName:[self loadedRomURL] slotNumber:(NSUInteger)(i + 1)]; + if (fileName == nil) + { + return; + } + + [self pauseCore]; + + result = [CocoaDSFile loadState:[NSURL fileURLWithPath:[saveStatePath stringByAppendingPathComponent:fileName]]]; + if (result == NO) + { + [self setStatus:NSSTRING_STATUS_SAVESTATE_LOADING_FAILED]; + } + + [self restoreCoreState]; + [self setStatus:NSSTRING_STATUS_SAVESTATE_LOADED]; +} + +- (IBAction) saveEmuSaveStateSlot:(id)sender +{ + BOOL result = NO; + NSInteger i = [CocoaDSUtil getIBActionSenderTag:sender]; + + NSString *saveStatePath = [[CocoaDSFile saveStateURL] path]; + if (saveStatePath == nil) + { + [self setStatus:NSSTRING_STATUS_CANNOT_GENERATE_SAVE_PATH]; + return; + } + + result = [CocoaDSFile createUserAppSupportDirectory:@"States"]; + if (result == NO) + { + [self setStatus:NSSTRING_STATUS_CANNOT_CREATE_SAVE_DIRECTORY]; + return; + } + + if (i < 0 || i > MAX_SAVESTATE_SLOTS) + { + return; + } + + NSString *fileName = [CocoaDSFile getSaveSlotFileName:[self loadedRomURL] slotNumber:(NSUInteger)(i + 1)]; + if (fileName == nil) + { + return; + } + + [self pauseCore]; + + result = [CocoaDSFile saveState:[NSURL fileURLWithPath:[saveStatePath stringByAppendingPathComponent:fileName]]]; + if (result == NO) + { + [self setStatus:NSSTRING_STATUS_SAVESTATE_SAVING_FAILED]; + return; + } + + [self restoreCoreState]; + [self setStatus:NSSTRING_STATUS_SAVESTATE_SAVED]; +} + +- (IBAction) importRomSave:(id)sender +{ + NSURL *selectedFile = nil; + NSInteger buttonClicked = NSFileHandlingPanelCancelButton; + NSOpenPanel *panel = [NSOpenPanel openPanel]; + + [panel setCanChooseDirectories:NO]; + [panel setCanChooseFiles:YES]; + [panel setResolvesAliases:YES]; + [panel setAllowsMultipleSelection:NO]; + [panel setTitle:NSSTRING_TITLE_IMPORT_BACKUP_MEMORY_PANEL]; + NSArray *fileTypes = [NSArray arrayWithObjects:@FILE_EXT_ROM_DS, @FILE_EXT_ROM_GBA, nil]; + + // The NSOpenPanel method -(NSInt)runModalForDirectory:file:types: + // is deprecated in Mac OS X v10.6. +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 + [panel setAllowedFileTypes:fileTypes]; + buttonClicked = [panel runModal]; +#else + buttonClicked = [panel runModalForDirectory:nil file:nil types:fileTypes]; +#endif + + if (buttonClicked == NSFileHandlingPanelOKButton) + { + selectedFile = [[panel URLs] lastObject]; + if(selectedFile == nil) + { + return; + } + } + else + { + return; + } + + BOOL result = [CocoaDSFile importRomSave:selectedFile]; + if (!result) + { + [self setStatus:NSSTRING_STATUS_BATTERY_IMPORT_FAILED]; + return; + } + + [self setStatus:NSSTRING_STATUS_BATTERY_IMPORTED]; +} + +- (IBAction) exportRomSave:(id)sender +{ + BOOL result = NO; + NSInteger buttonClicked; + NSSavePanel *panel = [NSSavePanel savePanel]; + [panel setTitle:NSSTRING_TITLE_EXPORT_BACKUP_MEMORY_PANEL]; + [panel setCanCreateDirectories:YES]; + [panel setRequiredFileType:@FILE_EXT_ROM_SAVE_NOGBA]; + + //save it + buttonClicked = [panel runModal]; + if(buttonClicked == NSOKButton) + { + [self pauseCore]; + + result = [CocoaDSFile exportRomSave:[panel URL]]; + if (result == NO) + { + [self setStatus:NSSTRING_STATUS_BATTERY_EXPORT_FAILED]; + return; + } + + [self restoreCoreState]; + [self setStatus:NSSTRING_STATUS_BATTERY_EXPORTED]; + } +} + +- (IBAction) copy:(id)sender +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + + [cdsCore copyToPasteboard]; +} + +- (IBAction) executeCoreToggle:(id)sender +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + + if ([cdsCore paused]) + { + if ([self isRomLoaded]) + { + [self executeCore]; + } + } + else + { + [self pauseCore]; + } +} + +- (IBAction) resetCore:(id)sender +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + + if ([self isRomLoaded]) + { + [self setStatus:NSSTRING_STATUS_EMULATOR_RESETTING]; + [bindings setValue:[NSNumber numberWithBool:YES] forKey:@"isWorking"]; + [window displayIfNeeded]; + + [cdsCore reset]; + if ([cdsCore paused]) + { + [displayView setViewToWhite]; + } + + [self setStatus:NSSTRING_STATUS_EMULATOR_RESET_LEGACY]; + [bindings setValue:[NSNumber numberWithBool:NO] forKey:@"isWorking"]; + [window displayIfNeeded]; + } +} + +- (IBAction) speedLimitDisable:(id)sender +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + + if ([cdsCore isSpeedLimitEnabled]) + { + [cdsCore setIsSpeedLimitEnabled:NO]; + [self setStatus:NSSTRING_STATUS_SPEED_LIMIT_DISABLED]; + } + else + { + [cdsCore setIsSpeedLimitEnabled:YES]; + [self setStatus:NSSTRING_STATUS_SPEED_LIMIT_ENABLED]; + } +} + +- (IBAction) changeRomSaveType:(id)sender +{ + if (![self isRomLoaded]) + { + return; + } + + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + [cdsCore setSaveType:[CocoaDSUtil getIBActionSenderTag:sender]]; +} + +- (IBAction) changeCoreSpeed:(id)sender +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + + [cdsCore setSpeedScalar:(CGFloat)[CocoaDSUtil getIBActionSenderTag:sender] / 100.0f]; +} + +- (IBAction) changeVolume:(id)sender +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + float vol = [self volume]; + + [self setVolume:vol]; + [self setStatus:[NSString stringWithFormat:NSSTRING_STATUS_VOLUME, vol]]; + [cdsCore setVolume:vol]; +} + +- (IBAction) changeScale:(id)sender +{ + [self setContentScalar:(double)[CocoaDSUtil getIBActionSenderTag:sender] / 100.0]; +} + +- (IBAction) changeRotation:(id)sender +{ + // Get the rotation value from the sender. + if ([sender isMemberOfClass:[NSSlider class]]) + { + [self setContentRotation:[(NSSlider *)sender doubleValue]]; + } + else + { + [self setContentRotation:(double)[CocoaDSUtil getIBActionSenderTag:sender]]; + } +} + +- (IBAction) changeRotationRelative:(id)sender +{ + double angleDegrees = [displayView rotation] + (double)[CocoaDSUtil getIBActionSenderTag:sender]; + [self setContentRotation:angleDegrees]; +} + +- (IBAction) toggleGPUState:(id)sender +{ + NSInteger i = [CocoaDSUtil getIBActionSenderTag:sender]; + UInt32 flags = [displayView gpuStateFlags]; + + flags ^= (1 << i); + + [displayView setGpuStateFlags:flags]; +} + +- (IBAction) toggleMinSize:(id)sender +{ + if (isSmallestSizeNormal) + { + minDisplayViewSize.width /= 4; + minDisplayViewSize.height /= 4; + isSmallestSizeNormal = NO; + } + else + { + minDisplayViewSize.width = GPU_DISPLAY_WIDTH; + minDisplayViewSize.height = GPU_DISPLAY_HEIGHT * 2; + isSmallestSizeNormal = YES; + } + + // Set the minimum content size, keeping the display rotation in mind. + NSSize transformedMinSize = GetTransformedBounds(minDisplayViewSize, 1.0, CLOCKWISE_DEGREES([displayView rotation])); + transformedMinSize.height += statusBarHeight; + [window setContentMinSize:transformedMinSize]; + + // Resize the window if it's smaller than the minimum content size. + NSRect windowContentRect = [window contentRectForFrameRect:[window frame]]; + if (windowContentRect.size.width < transformedMinSize.width || windowContentRect.size.height < transformedMinSize.height) + { + // Prepare to resize. + NSRect oldFrameRect = [window frame]; + windowContentRect.size = transformedMinSize; + NSRect newFrameRect = [window frameRectForContentRect:windowContentRect]; + + // Keep the window centered when expanding the size. + newFrameRect.origin.x = oldFrameRect.origin.x - ((newFrameRect.size.width - oldFrameRect.size.width) / 2); + newFrameRect.origin.y = oldFrameRect.origin.y - ((newFrameRect.size.height - oldFrameRect.size.height) / 2); + + // Set the window size. + [window setFrame:newFrameRect display:YES animate:NO]; + } +} + +- (IBAction) toggleStatusBar:(id)sender +{ + NSRect frameRect = [window frame]; + + if (isShowingStatusBar) + { + isShowingStatusBar = NO; + statusBarHeight = 0; + frameRect.origin.y += WINDOW_STATUS_BAR_HEIGHT; + frameRect.size.height -= WINDOW_STATUS_BAR_HEIGHT; + } + else + { + isShowingStatusBar = YES; + statusBarHeight = WINDOW_STATUS_BAR_HEIGHT; + frameRect.origin.y -= WINDOW_STATUS_BAR_HEIGHT; + frameRect.size.height += WINDOW_STATUS_BAR_HEIGHT; + } + + [window setFrame:frameRect display:YES animate:NO]; +} + +- (IBAction) changeScreenshotFileFormat:(id)sender +{ + screenshotFileFormat = (NSBitmapImageFileType)[CocoaDSUtil getIBActionSenderTag:sender]; +} + +- (IBAction) saveScreenshotAs:(id)sender +{ + [self pauseCore]; + + NSInteger buttonClicked = NSFileHandlingPanelCancelButton; + NSSavePanel *panel = [NSSavePanel savePanel]; + + [panel setCanCreateDirectories:YES]; + [panel setTitle:@"Save Screenshot As"]; + [panel setAccessoryView:saveScreenshotPanelAccessoryView]; + + buttonClicked = [panel runModal]; + if(buttonClicked == NSOKButton) + { + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + + BOOL fileSaved = [CocoaDSFile saveScreenshot:[panel URL] bitmapData:[cdsCore bitmapImageRep] fileType:screenshotFileFormat]; + if (!fileSaved) + { + [CocoaDSUtil quickDialogUsingTitle:NSSTRING_ERROR_TITLE_LEGACY message:NSSTRING_ERROR_SCREENSHOT_FAILED_LEGACY]; + } + } + + [self restoreCoreState]; +} + +- (BOOL) handleLoadRom:(NSURL *)fileURL +{ + BOOL result = NO; + + if (isRomLoading) + { + return result; + } + + result = [self loadRom:fileURL]; + + return result; +} + +- (BOOL) handleUnloadRom:(NSInteger)reasonID romToLoad:(NSURL *)romURL +{ + BOOL result = NO; + + if (isRomLoading || ![self isRomLoaded]) + { + return result; + } + + [self pauseCore]; + result = [self unloadRom]; + + return result; +} + +- (BOOL) loadRom:(NSURL *)romURL +{ + BOOL romLoaded = NO; + + if (romURL == nil) + { + return romLoaded; + } + + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + + [self setStatus:NSSTRING_STATUS_ROM_LOADING]; + [bindings setValue:[NSNumber numberWithBool:YES] forKey:@"isWorking"]; + [window displayIfNeeded]; + + // Need to pause the core before loading the ROM. + [self pauseCore]; + + // Load the ROM. + isRomLoading = YES; + romLoaded = [cdsCore loadRom:romURL]; + if (!romLoaded) + { + // If ROM loading fails, restore the core state, but only if a ROM is already loaded. + if([self isRomLoaded]) + { + [self restoreCoreState]; + } + + [self setStatus:NSSTRING_STATUS_ROM_LOADING_FAILED_LEGACY]; + [bindings setValue:[NSNumber numberWithBool:NO] forKey:@"isWorking"]; + + isRomLoading = NO; + return romLoaded; + } + + [romInfoPanelController setContent:[cdsCore romInfoBindings]]; + + // After the ROM loading is complete, send an execute message to the Cocoa DS per + // user preferences. + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"ExecuteROMOnLoad"]) + { + [self executeCore]; + } + + // Add the last loaded ROM to the Recent ROMs list. + [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:[cdsCore loadedRomURL]]; + + // Update the UI to indicate that a ROM has indeed been loaded. + [displayView setViewToWhite]; + [self setStatus:NSSTRING_STATUS_ROM_LOADED_LEGACY]; + [bindings setValue:[NSNumber numberWithBool:NO] forKey:@"isWorking"]; + [self setIsRomLoaded:YES]; + [window displayIfNeeded]; + isRomLoading = NO; + + romLoaded = YES; + + return romLoaded; +} + +- (BOOL) unloadRom +{ + BOOL result = NO; + + [currentEmuSaveStateURL release]; + currentEmuSaveStateURL = nil; + [window setDocumentEdited:NO]; + + // Update the UI to indicate that the ROM has started the process of unloading. + [self setStatus:NSSTRING_STATUS_ROM_UNLOADING]; + [romInfoPanelController setContent:[CocoaDSRom romNotLoadedBindings]]; + + [bindings setValue:[NSNumber numberWithBool:YES] forKey:@"isWorking"]; + [window displayIfNeeded]; + + // Unload the ROM. + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + [cdsCore closeROM]; + + // Update the UI to indicate that the ROM has finished unloading. + [displayView setViewToBlack]; + [self setStatus:NSSTRING_STATUS_ROM_UNLOADED_LEGACY]; + [bindings setValue:[NSNumber numberWithBool:NO] forKey:@"isWorking"]; + [self setIsRomLoaded:NO]; + [window displayIfNeeded]; + + result = YES; + + return result; +} + +- (void) executeCore +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + [cdsCore setCoreState:CORESTATE_EXECUTE]; + [self setStatus:NSSTRING_STATUS_EMULATOR_EXECUTING_LEGACY]; +} + +- (void) pauseCore +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + [cdsCore setCoreState:CORESTATE_PAUSE]; + [self setStatus:NSSTRING_STATUS_EMULATOR_PAUSED_LEGACY]; +} + +- (void) restoreCoreState +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + [cdsCore restoreCoreState]; +} + +- (BOOL)windowShouldClose:(id)sender +{ + BOOL shouldClose = YES; + + // If no ROM is loaded, terminate the application. + if (![self isRomLoaded]) + { + [NSApp terminate:sender]; + } + // If a ROM is loaded, just close the ROM, but don't terminate. + else + { + shouldClose = NO; + [self closeRom:nil]; + } + + return shouldClose; +} + +- (void)windowDidResize:(NSNotification *)notification +{ + if (displayView == nil) + { + return; + } + + NSSize normalBounds = [displayView normalSize]; + double r = [displayView rotation]; + + // Get the max scalar within the window's current content bounds. + NSSize checkSize = GetTransformedBounds(normalBounds, 1.0, r); + NSSize contentBounds = [[window contentView] bounds].size; + contentBounds.height -= statusBarHeight; + double maxS = GetMaxScalarInBounds(checkSize.width, checkSize.height, contentBounds.width, contentBounds.height); + + // Set the display view's properties. + [displayView setScale:maxS]; + + // Resize the view. + NSRect newContentFrame = [[window contentView] bounds]; + newContentFrame.origin.y = statusBarHeight; + newContentFrame.size.height -= statusBarHeight; + [displayView setFrame:newContentFrame]; +} + +- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize +{ + NSSize finalSize = frameSize; + const NSSize normalBounds = [displayView normalSize]; + + // Get a content Rect so that we can make our comparison. + // This will be based on the proposed frameSize. + const NSRect frameRect = NSMakeRect(0.0f, 0.0f, frameSize.width, frameSize.height); + const NSRect contentRect = [sender contentRectForFrameRect:frameRect]; + + // Find the maximum scalar we can use for the display view, bounded by the + // content Rect. + const NSSize checkSize = GetTransformedBounds(normalBounds, 1.0, [displayView rotation]); + const NSSize contentBounds = NSMakeSize(contentRect.size.width, contentRect.size.height - statusBarHeight); + const double maxS = GetMaxScalarInBounds(checkSize.width, checkSize.height, contentBounds.width, contentBounds.height); + [displayView setScale:maxS]; + + // Make a new content Rect with our max scalar, and convert it back to a frame Rect. + NSRect finalContentRect = NSMakeRect(0.0f, 0.0f, checkSize.width * maxS, (checkSize.height * maxS) + statusBarHeight); + NSRect finalFrameRect = [sender frameRectForContentRect:finalContentRect]; + + // Set the final size based on our new frame Rect. + finalSize.width = finalFrameRect.size.width; + finalSize.height = finalFrameRect.size.height; + + return finalSize; +} + +- (void)windowDidBecomeMain:(NSNotification *)notification +{ + [emuWindowController setContent:bindings]; +} + +- (BOOL)validateUserInterfaceItem:(id )theItem +{ + BOOL enable = YES; + SEL theAction = [theItem action]; + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + + if (theAction == @selector(importRomSave:) || + theAction == @selector(exportRomSave:)) + { + if (![self isRomLoaded]) + { + enable = NO; + } + } + else if (theAction == @selector(executeCoreToggle:)) + { + if (![self isRomLoaded] || + ![cdsCore masterExecute]) + { + enable = NO; + } + + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if ([cdsCore paused]) + { + [(NSMenuItem*)theItem setTitle:NSSTRING_TITLE_EXECUTE_CONTROL]; + } + else + { + [(NSMenuItem*)theItem setTitle:NSSTRING_TITLE_PAUSE_CONTROL]; + } + } + else if ([(id)theItem isMemberOfClass:[NSToolbarItem class]]) + { + if ([cdsCore paused]) + { + [(NSToolbarItem*)theItem setLabel:NSSTRING_TITLE_EXECUTE_CONTROL]; + [(NSToolbarItem*)theItem setImage:iconExecute]; + } + else + { + [(NSToolbarItem*)theItem setLabel:NSSTRING_TITLE_PAUSE_CONTROL]; + [(NSToolbarItem*)theItem setImage:iconPause]; + } + } + } + else if (theAction == @selector(executeCore) || + theAction == @selector(pauseCore)) + { + if (![self isRomLoaded] || + ![cdsCore masterExecute]) + { + enable = NO; + } + } + else if (theAction == @selector(resetCore:)) + { + if (![self isRomLoaded]) + { + enable = NO; + } + } + else if (theAction == @selector(openRom:)) + { + if (isRomLoading) + { + enable = NO; + } + } + else if (theAction == @selector(closeRom:)) + { + if (![self isRomLoaded] || isRomLoading) + { + enable = NO; + } + } + else if (theAction == @selector(loadEmuSaveStateSlot:)) + { + if (![self isRomLoaded]) + { + enable = NO; + } + else if (![CocoaDSFile saveStateExistsForSlot:[self loadedRomURL] slotNumber:[theItem tag] + 1]) + { + enable = NO; + } + } + else if (theAction == @selector(saveEmuSaveStateSlot:)) + { + if (![self isRomLoaded]) + { + enable = NO; + } + + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if ([CocoaDSFile saveStateExistsForSlot:[self loadedRomURL] slotNumber:[theItem tag] + 1]) + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + } + } + else if (theAction == @selector(changeCoreSpeed:)) + { + NSInteger speedScalar = (NSInteger)([cdsCore speedScalar] * 100.0); + + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if ([theItem tag] == -1) + { + if (speedScalar == (NSInteger)(SPEED_SCALAR_QUARTER * 100.0) || + speedScalar == (NSInteger)(SPEED_SCALAR_HALF * 100.0) || + speedScalar == (NSInteger)(SPEED_SCALAR_NORMAL * 100.0) || + speedScalar == (NSInteger)(SPEED_SCALAR_THREE_QUARTER * 100.0) || + speedScalar == (NSInteger)(SPEED_SCALAR_DOUBLE * 100.0)) + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + } + else if (speedScalar == [theItem tag]) + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + } + else if ([(id)theItem isMemberOfClass:[NSToolbarItem class]]) + { + if (speedScalar == (NSInteger)(SPEED_SCALAR_DOUBLE * 100.0)) + { + [(NSToolbarItem*)theItem setLabel:NSSTRING_TITLE_SPEED_1X]; + [(NSToolbarItem*)theItem setTag:100]; + [(NSToolbarItem*)theItem setImage:iconSpeedNormal]; + } + else + { + [(NSToolbarItem*)theItem setLabel:NSSTRING_TITLE_SPEED_2X]; + [(NSToolbarItem*)theItem setTag:200]; + [(NSToolbarItem*)theItem setImage:iconSpeedDouble]; + } + } + } + else if (theAction == @selector(speedLimitDisable:)) + { + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if ([cdsCore isSpeedLimitEnabled]) + { + [(NSMenuItem*)theItem setTitle:NSSTRING_TITLE_DISABLE_SPEED_LIMIT]; + } + else + { + [(NSMenuItem*)theItem setTitle:NSSTRING_TITLE_ENABLE_SPEED_LIMIT]; + } + } + } + else if (theAction == @selector(changeRomSaveType:)) + { + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if ([cdsCore saveType] == [theItem tag]) + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + } + } + else if (theAction == @selector(changeScale:)) + { + NSInteger viewScale = (NSInteger)([displayView scale] * 100.0); + + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if (viewScale == [theItem tag]) + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + } + } + else if (theAction == @selector(changeRotation:)) + { + NSInteger viewRotation = (NSInteger)([displayView rotation]); + + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if ([theItem tag] == -1) + { + if (viewRotation == 0 || + viewRotation == 90 || + viewRotation == 180 || + viewRotation == 270) + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + } + else if (viewRotation == [theItem tag]) + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + } + } + else if (theAction == @selector(changeDisplayMode:)) + { + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if ([displayView displayMode] == [theItem tag]) + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + } + } + else if (theAction == @selector(openEmuSaveState:) || + theAction == @selector(saveEmuSaveState:) || + theAction == @selector(saveEmuSaveStateAs:)) + { + if (![self isRomLoaded]) + { + enable = NO; + } + } + else if (theAction == @selector(revertEmuSaveState:)) + { + if (![self isRomLoaded] || currentEmuSaveStateURL == nil) + { + enable = NO; + } + } + else if (theAction == @selector(toggleGPUState:)) + { + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if ([displayView gpuStateByBit:[theItem tag]]) + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + } + } + else if (theAction == @selector(toggleStatusBar:)) + { + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if (isShowingStatusBar) + { + [(NSMenuItem*)theItem setTitle:NSSTRING_TITLE_HIDE_STATUS_BAR]; + } + else + { + [(NSMenuItem*)theItem setTitle:NSSTRING_TITLE_SHOW_STATUS_BAR]; + } + } + } + else if (theAction == @selector(toggleMinSize:)) + { + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if (isSmallestSizeNormal) + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + } + } + + return enable; +} + +@end diff --git a/desmume/src/cocoa/video_output_view.h b/desmume/src/cocoa/video_output_view.h index 8bfed3239..469a60dc5 100644 --- a/desmume/src/cocoa/video_output_view.h +++ b/desmume/src/cocoa/video_output_view.h @@ -19,10 +19,15 @@ #import +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 + #include "macosx_10_4_compat.h" +#endif + //This class uses OpenGL for drawing for speed //if opengl is not available it uses NSImage @class ScreenState; +@class CocoaDSController; @interface VideoOutputView : #ifdef HAVE_OPENGL @@ -35,6 +40,12 @@ NSImageView NSOpenGLContext* context; #endif ScreenState *screen_buffer; + double viewScale; + double viewRotation; + NSInteger displayMode; + UInt32 gpuStateFlags; + + CocoaDSController *cdsController; } //init - (id)initWithFrame:(NSRect)frame; @@ -46,5 +57,36 @@ NSImageView //size in pixels of screen display (disreguarding rotation of the view) - (float)screenHeight; - (float)screenWidth; + +- (NSSize) normalSize; +- (void) setScale:(double)scalar; +- (double) scale; +- (void) setRotation:(double)angleDegrees; +- (double) rotation; +- (void) setDisplayMode:(NSInteger)theMode; +- (NSInteger) displayMode; +- (void) setGpuStateFlags:(UInt32)flags; +- (UInt32) gpuStateFlags; +- (void) setCdsController:(CocoaDSController *)theController; +- (CocoaDSController*) cdsController; + +- (void) setViewToBlack; +- (void) setViewToWhite; +- (BOOL) gpuStateByBit:(UInt32)stateBit; +- (NSPoint) convertPointToDS:(NSPoint)touchLoc; + @end +#ifdef __cplusplus +extern "C" +{ +#endif + +void SetGPULayerState(int displayType, unsigned int i, bool state); +bool GetGPULayerState(int displayType, unsigned int i); +void SetGPUDisplayState(int displayType, bool state); +bool GetGPUDisplayState(int displayType); + +#ifdef __cplusplus +} +#endif diff --git a/desmume/src/cocoa/video_output_view.mm b/desmume/src/cocoa/video_output_view.mm index ca9960d95..81b3bc4fa 100644 --- a/desmume/src/cocoa/video_output_view.mm +++ b/desmume/src/cocoa/video_output_view.mm @@ -19,8 +19,16 @@ #import "video_output_view.h" #import "nds_control.h" +#import "input.h" +#import "cocoa_input.h" +#import "cocoa_globals.h" #import "cocoa_util.h" +#import "preferences.h" #import "screen_state.h" +#include "../GPU.h" +#include "../NDSSystem.h" + +#undef BOOL #define HORIZONTAL(angle) ((angle) == -90 || (angle) == -270) #define VERTICAL(angle) ((angle) == 0 || (angle) == -180) @@ -52,6 +60,21 @@ } screen_buffer = nil; + viewScale = 1.0; + viewRotation = 0.0; + displayMode = DS_DISPLAY_TYPE_COMBO; + gpuStateFlags = GPUSTATE_MAIN_GPU_MASK | + GPUSTATE_MAIN_BG0_MASK | + GPUSTATE_MAIN_BG1_MASK | + GPUSTATE_MAIN_BG2_MASK | + GPUSTATE_MAIN_BG3_MASK | + GPUSTATE_MAIN_OBJ_MASK | + GPUSTATE_SUB_GPU_MASK | + GPUSTATE_SUB_BG0_MASK | + GPUSTATE_SUB_BG1_MASK | + GPUSTATE_SUB_BG2_MASK | + GPUSTATE_SUB_BG3_MASK | + GPUSTATE_SUB_OBJ_MASK; //Initialize image view if for displaying the screen ---------------------------------------- #ifndef HAVE_OPENGL @@ -98,7 +121,9 @@ //init screen buffer [self setScreenState:[ScreenState blackScreenState]]; - + + cdsController = nil; + return self; } @@ -160,6 +185,193 @@ return DS_SCREEN_HEIGHT*2; } +- (NSSize) normalSize +{ + return [ScreenState size]; +} + +- (void) setScale:(double)scalar +{ + viewScale = scalar; +} + +- (double) scale +{ + return viewScale; +} + +- (void) setRotation:(double)angleDegrees +{ + viewRotation = angleDegrees; + [self setBoundsRotation:-angleDegrees]; +} + +- (double) rotation +{ + return viewRotation; +} + +- (void) setDisplayMode:(NSInteger)theMode +{ + // Do nothing. This is a stub function only. +} + +- (NSInteger) displayMode +{ + return displayMode; +} + +- (void) setGpuStateFlags:(UInt32)flags +{ + gpuStateFlags = flags; + + if (flags & GPUSTATE_MAIN_GPU_MASK) + { + SetGPUDisplayState(DS_GPU_TYPE_MAIN, true); + } + else + { + SetGPUDisplayState(DS_GPU_TYPE_MAIN, false); + } + + if (flags & GPUSTATE_MAIN_BG0_MASK) + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 0, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 0, false); + } + + if (flags & GPUSTATE_MAIN_BG1_MASK) + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 1, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 1, false); + } + + if (flags & GPUSTATE_MAIN_BG2_MASK) + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 2, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 2, false); + } + + if (flags & GPUSTATE_MAIN_BG3_MASK) + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 3, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 3, false); + } + + if (flags & GPUSTATE_MAIN_OBJ_MASK) + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 4, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_MAIN, 4, false); + } + + if (flags & GPUSTATE_SUB_GPU_MASK) + { + SetGPUDisplayState(DS_GPU_TYPE_SUB, true); + } + else + { + SetGPUDisplayState(DS_GPU_TYPE_SUB, false); + } + + if (flags & GPUSTATE_SUB_BG0_MASK) + { + SetGPULayerState(DS_GPU_TYPE_SUB, 0, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_SUB, 0, false); + } + + if (flags & GPUSTATE_SUB_BG1_MASK) + { + SetGPULayerState(DS_GPU_TYPE_SUB, 1, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_SUB, 1, false); + } + + if (flags & GPUSTATE_SUB_BG2_MASK) + { + SetGPULayerState(DS_GPU_TYPE_SUB, 2, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_SUB, 2, false); + } + + if (flags & GPUSTATE_SUB_BG3_MASK) + { + SetGPULayerState(DS_GPU_TYPE_SUB, 3, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_SUB, 3, false); + } + + if (flags & GPUSTATE_SUB_OBJ_MASK) + { + SetGPULayerState(DS_GPU_TYPE_SUB, 4, true); + } + else + { + SetGPULayerState(DS_GPU_TYPE_SUB, 4, false); + } +} + +- (UInt32) gpuStateFlags +{ + return gpuStateFlags; +} + +- (void) setCdsController:(CocoaDSController *)theController +{ + cdsController = theController; +} + +- (CocoaDSController*) cdsController +{ + return cdsController; +} + +- (void) setViewToBlack +{ + [self setScreenState:[ScreenState blackScreenState]]; +} + +- (void) setViewToWhite +{ + [self setScreenState:[ScreenState whiteScreenState]]; +} + +- (BOOL) gpuStateByBit:(UInt32)stateBit +{ + BOOL result = NO; + UInt32 flags = [self gpuStateFlags]; + + if (flags & (1 << stateBit)) + { + result = YES; + } + + return result; +} + #ifdef HAVE_OPENGL - (void)viewDidMoveToWindow {//if the view moves to another window we need to update the drawable object @@ -250,41 +462,133 @@ #ifdef HAVE_OPENGL - (void)setBoundsRotation:(CGFloat)angle { - float old_angle = [self boundsRotation]; + int angleInt = (int)angle; + int old_angle = (int)[self boundsRotation]; - [super setBoundsRotation:angle]; + [super setBoundsRotation:angleInt]; [context makeCurrentContext]; NSSize size = [self frame].size; - if(angle == 0) + if(angleInt == 0) { glRasterPos2f(-1, 1); glPixelZoom(((float)size.width) / ((float)DS_SCREEN_WIDTH), -((float)size.height) / ((float)DS_SCREEN_HEIGHT*2)); - } else if(angle == -90) + } else if(angleInt == -90) { glRasterPos2f(-1, 1); glPixelZoom(((float)size.width) / ((float)DS_SCREEN_HEIGHT*2), -((float)size.height) / ((float)DS_SCREEN_WIDTH)); - } else if (angle == -180) + } else if (angleInt == -180) { glRasterPos2f(1, -1); glPixelZoom(-((float)size.width) / ((float)DS_SCREEN_WIDTH), ((float)size.height) / ((float)DS_SCREEN_HEIGHT*2)); - } else if (angle == -270) + } else if (angleInt == -270) { glRasterPos2f(1, -1); glPixelZoom(-((float)size.width) / ((float)DS_SCREEN_HEIGHT*2), ((float)size.height) / ((float)DS_SCREEN_WIDTH)); } //Rotate the screen buffer - if(HORIZONTAL(angle) && VERTICAL(old_angle)) + if(HORIZONTAL(angleInt) && VERTICAL(old_angle)) [screen_buffer rotateTo90]; - if(VERTICAL(angle) && HORIZONTAL(old_angle)) + if(VERTICAL(angleInt) && HORIZONTAL(old_angle)) [screen_buffer rotateTo0]; } #endif +- (NSPoint) convertPointToDS:(NSPoint)touchLoc +{ + const CGFloat doubleDisplayHeight = (CGFloat)(GPU_DISPLAY_HEIGHT * 2); + const NSInteger rotation = (NSInteger)[self boundsRotation]; + const CGFloat frameWidth = [self frame].size.width; + const CGFloat frameHeight = [self frame].size.height; + + if(rotation == 0) + { + // Scale + touchLoc.x *= (CGFloat)GPU_DISPLAY_WIDTH / frameWidth; + touchLoc.y *= doubleDisplayHeight / frameHeight; + } + else if(rotation == -90) + { + // Normalize + touchLoc.x += frameHeight; + + // Scale + touchLoc.x *= doubleDisplayHeight / frameWidth; + touchLoc.y *= (CGFloat)GPU_DISPLAY_WIDTH / frameHeight; + } + else if(rotation == -180) + { + // Normalize + touchLoc.x += frameWidth; + touchLoc.y += frameHeight; + + // Scale + touchLoc.x *= (CGFloat)GPU_DISPLAY_WIDTH / frameWidth; + touchLoc.y *= doubleDisplayHeight / frameHeight; + } + else if(rotation == -270) + { + // Normalize + touchLoc.y += frameWidth; + + // Scale + touchLoc.x *= doubleDisplayHeight / frameWidth; + touchLoc.y *= (CGFloat)GPU_DISPLAY_WIDTH / frameHeight; + } + + // Normalize the y-coordinate to the DS. + touchLoc.y = GPU_DISPLAY_HEIGHT - touchLoc.y; + + // Constrain the touch point to the DS dimensions. + if (touchLoc.x < 0) + { + touchLoc.x = 0; + } + else if (touchLoc.x > (GPU_DISPLAY_WIDTH - 1)) + { + touchLoc.x = (GPU_DISPLAY_WIDTH - 1); + } + + if (touchLoc.y < 0) + { + touchLoc.y = 0; + } + else if (touchLoc.y > (GPU_DISPLAY_HEIGHT - 1)) + { + touchLoc.y = (GPU_DISPLAY_HEIGHT - 1); + } + + return touchLoc; +} + +- (void)mouseDown:(NSEvent*)event +{ + // Convert the clicked location from window coordinates, to view coordinates, + // and finally to DS touchscreen coordinates. + NSPoint touchLoc = [event locationInWindow]; + touchLoc = [self convertPoint:touchLoc fromView:nil]; + touchLoc = [self convertPointToDS:touchLoc]; + + if(touchLoc.x >= 0 && touchLoc.y >= 0) + { + [cdsController touch:touchLoc]; + } +} + +- (void)mouseDragged:(NSEvent*)event +{ + [self mouseDown:event]; +} + +- (void)mouseUp:(NSEvent*)event +{ + [cdsController releaseTouch]; +} + @end #ifdef HAVE_OPENGL @@ -323,3 +627,131 @@ @end #endif +void SetGPULayerState(int displayType, unsigned int i, bool state) +{ + GPU *theGpu = NULL; + + // Check bounds on the layer index. + if(i > 4) + { + return; + } + + switch (displayType) + { + case DS_GPU_TYPE_MAIN: + theGpu = SubScreen.gpu; + break; + + case DS_GPU_TYPE_SUB: + theGpu = MainScreen.gpu; + break; + + case DS_GPU_TYPE_COMBO: + SetGPULayerState(DS_GPU_TYPE_SUB, i, state); // Recursive call + theGpu = MainScreen.gpu; + break; + + default: + break; + } + + if (theGpu != NULL) + { + if (state) + { + GPU_addBack(theGpu, i); + } + else + { + GPU_remove(theGpu, i); + } + } +} + +bool GetGPULayerState(int displayType, unsigned int i) +{ + bool result = false; + + // Check bounds on the layer index. + if(i > 4) + { + return result; + } + + switch (displayType) + { + case DS_GPU_TYPE_MAIN: + if (SubScreen.gpu != nil) + { + result = CommonSettings.dispLayers[SubScreen.gpu->core][i]; + } + break; + + case DS_GPU_TYPE_SUB: + if (MainScreen.gpu != nil) + { + result = CommonSettings.dispLayers[MainScreen.gpu->core][i]; + } + break; + + case DS_GPU_TYPE_COMBO: + if (SubScreen.gpu != nil && MainScreen.gpu != nil) + { + result = (CommonSettings.dispLayers[SubScreen.gpu->core][i] && CommonSettings.dispLayers[MainScreen.gpu->core][i]); + } + break; + + default: + break; + } + + return result; +} + +void SetGPUDisplayState(int displayType, bool state) +{ + switch (displayType) + { + case DS_GPU_TYPE_MAIN: + CommonSettings.showGpu.sub = state; + break; + + case DS_GPU_TYPE_SUB: + CommonSettings.showGpu.main = state; + break; + + case DS_GPU_TYPE_COMBO: + CommonSettings.showGpu.sub = state; + CommonSettings.showGpu.main = state; + break; + + default: + break; + } +} + +bool GetGPUDisplayState(int displayType) +{ + bool result = false; + + switch (displayType) + { + case DS_GPU_TYPE_MAIN: + result = CommonSettings.showGpu.sub; + break; + + case DS_GPU_TYPE_SUB: + result = CommonSettings.showGpu.main; + break; + + case DS_GPU_TYPE_COMBO: + result = (CommonSettings.showGpu.sub && CommonSettings.showGpu.main); + break; + + default: + break; + } + + return result; +}