Cocoa Port:

- Delete the Legacy Cocoa port. (Not only was the Tiger build broken in several ways, but all features from the Legacy port have been subsumed into the main Cocoa port now. Therefore, the Legacy port is no longer necessary.)
- Remove the "Xcode 4" and "Xcode 5" project files. These files have been superseded by the one project file "Xcode (Latest)".
This commit is contained in:
rogerman 2015-01-13 04:15:07 +00:00
parent 3e96459aea
commit 402434fe19
45 changed files with 0 additions and 22761 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:DeSmuME (XCode 4).xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0440"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB796CA415CDCBA200C59155"
BuildableName = "DeSmuME.app"
BlueprintName = "DeSmuME (OS X App)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB796CA415CDCBA200C59155"
BuildableName = "DeSmuME.app"
BlueprintName = "DeSmuME (OS X App)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB796CA415CDCBA200C59155"
BuildableName = "DeSmuME.app"
BlueprintName = "DeSmuME (OS X App)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB796CA415CDCBA200C59155"
BuildableName = "DeSmuME.app"
BlueprintName = "DeSmuME (OS X App)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0460"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB931D0E1A535D9200BFCE0B"
BuildableName = "DeSmuME (dev+).app"
BlueprintName = "DeSmuME (OS X App; dev+)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB931D0E1A535D9200BFCE0B"
BuildableName = "DeSmuME (dev+).app"
BlueprintName = "DeSmuME (OS X App; dev+)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB931D0E1A535D9200BFCE0B"
BuildableName = "DeSmuME (dev+).app"
BlueprintName = "DeSmuME (OS X App; dev+)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB931D0E1A535D9200BFCE0B"
BuildableName = "DeSmuME (dev+).app"
BlueprintName = "DeSmuME (OS X App; dev+)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,85 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "DeSmuME.app"
BlueprintName = "DeSmuME (OS X App; v10.5 Leopard Release Build)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "DeSmuME.app"
BlueprintName = "DeSmuME (OS X App; v10.5 Leopard Release Build)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "DeSmuME.app"
BlueprintName = "DeSmuME (OS X App; v10.5 Leopard Release Build)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "DeSmuME.app"
BlueprintName = "DeSmuME (OS X App; v10.5 Leopard Release Build)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ABB3C6461501BC6D00E0C22E"
BuildableName = "DeSmuME.oecoreplugin"
BlueprintName = "DeSmuME (OpenEmu Plug-in)"
ReferencedContainer = "container:DeSmuME (XCode 4).xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,474 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>nds</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_NintendoDS_ROM.icns</string>
<key>CFBundleTypeName</key>
<string>Nintendo DS ROM</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.nintendo.rom.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ds.gba</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_NintendoGBA_ROM.icns</string>
<key>CFBundleTypeName</key>
<string>Gameboy Advance ROM</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.nintendo.rom.gba</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dst</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_SaveState.icns</string>
<key>CFBundleTypeName</key>
<string>DeSmuME Save State</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.desmume.savestate</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dsv</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_ROMSave.icns</string>
<key>CFBundleTypeName</key>
<string>DeSmuME ROM Save</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.desmume.romsave</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dfc</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_FirmwareConfig.icns</string>
<key>CFBundleTypeName</key>
<string>DeSmuME Firmware Configuration</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.desmume.firmwareconfig</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dct</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_ROMCheats.icns</string>
<key>CFBundleTypeName</key>
<string>DeSmuME ROM Cheats</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.desmume.romcheats</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>sav</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_NoGBA_ROMSave.icns</string>
<key>CFBundleTypeName</key>
<string>No$GBA ROM Save</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>de.emubase.nocash.romsave.gba</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>duc</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_ActionReplaySave.icns</string>
<key>CFBundleTypeName</key>
<string>Action Replay Save</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.codejunkies.actionreplay.save.nintendo.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>bin</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_HWImage_NDS.icns</string>
<key>CFBundleTypeName</key>
<string>Nintendo DS Hardware Image</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.nintendo.hwimage.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>xml</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_ADVANsCEneDatabase.icns</string>
<key>CFBundleTypeName</key>
<string>ADVANsCEne Database</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.advanscene.database.nintendo.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dat</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_R4CheatDatabase.icns</string>
<key>CFBundleTypeName</key>
<string>R4 Cheats Database</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>net.gbatemp.cheats.database.nintendo.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string>AppIcon_DeSmuME</string>
<key>CFBundleIdentifier</key>
<string>org.desmume.DeSmuME</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>v0.9.11 (Debug)</string>
<key>CFBundleSignature</key>
<string>DSmM</string>
<key>CFBundleVersion</key>
<string>0.9.11</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.entertainment</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright ©2007-2014 DeSmuME Team. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu (Legacy)</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>DeSmuME Save State</string>
<key>UTTypeIconFile</key>
<string>AppIcon_SaveState.icns</string>
<key>UTTypeIdentifier</key>
<string>com.desmume.savestate</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dst</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>DeSmuME ROM Save</string>
<key>UTTypeIconFile</key>
<string>AppIcon_ROMSave.icns</string>
<key>UTTypeIdentifier</key>
<string>com.desmume.romsave</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dsv</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>DeSmuME Firmware Configuration</string>
<key>UTTypeIconFile</key>
<string>AppIcon_FirmwareConfig.icns</string>
<key>UTTypeIdentifier</key>
<string>com.desmume.firmwareconfig</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dfc</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>DeSmuME ROM Cheats</string>
<key>UTTypeIconFile</key>
<string>AppIcon_ROMCheats.icns</string>
<key>UTTypeIdentifier</key>
<string>com.desmume.romcheats</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dct</string>
</array>
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Nintendo DS ROM</string>
<key>UTTypeIconFile</key>
<string>AppIcon_NintendoDS_ROM.icns</string>
<key>UTTypeIdentifier</key>
<string>com.nintendo.rom.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>nds</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Gameboy Advance ROM</string>
<key>UTTypeIconFile</key>
<string>AppIcon_NintendoGBA_ROM.icns</string>
<key>UTTypeIdentifier</key>
<string>com.nintendo.rom.gba</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>ds.gba</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>No$GBA ROM Save</string>
<key>UTTypeIconFile</key>
<string>AppIcon_NoGBA_ROMSave.icns</string>
<key>UTTypeIdentifier</key>
<string>de.emubase.nocash.romsave.gba</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>sav</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Action Replay Save</string>
<key>UTTypeIconFile</key>
<string>AppIcon_ActionReplaySave.icns</string>
<key>UTTypeIdentifier</key>
<string>com.codejunkies.actionreplay.save.nintendo.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>duc</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Nintendo DS Hardware Image</string>
<key>UTTypeIconFile</key>
<string>AppIcon_HWImage_NDS.icns</string>
<key>UTTypeIdentifier</key>
<string>com.nintendo.hwimage.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>bin</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>ADVANsCEne Database</string>
<key>UTTypeIconFile</key>
<string>AppIcon_ADVANsCEneDatabase.icns</string>
<key>UTTypeIdentifier</key>
<string>com.advanscene.database.nintendo.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>xml</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>R4 Cheats Database</string>
<key>UTTypeIconFile</key>
<string>AppIcon_R4CheatDatabase.icns</string>
<key>UTTypeIdentifier</key>
<string>net.gbatemp.cheats.database.nintendo.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dat</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>

View File

@ -1,474 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>nds</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_NintendoDS_ROM.icns</string>
<key>CFBundleTypeName</key>
<string>Nintendo DS ROM</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.nintendo.rom.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ds.gba</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_NintendoGBA_ROM.icns</string>
<key>CFBundleTypeName</key>
<string>Gameboy Advance ROM</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.nintendo.rom.gba</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dst</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_SaveState.icns</string>
<key>CFBundleTypeName</key>
<string>DeSmuME Save State</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.desmume.savestate</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dsv</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_ROMSave.icns</string>
<key>CFBundleTypeName</key>
<string>DeSmuME ROM Save</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.desmume.romsave</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dfc</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_FirmwareConfig.icns</string>
<key>CFBundleTypeName</key>
<string>DeSmuME Firmware Configuration</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.desmume.firmwareconfig</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dct</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_ROMCheats.icns</string>
<key>CFBundleTypeName</key>
<string>DeSmuME ROM Cheats</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.desmume.romcheats</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>sav</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_NoGBA_ROMSave.icns</string>
<key>CFBundleTypeName</key>
<string>No$GBA ROM Save</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>de.emubase.nocash.romsave.gba</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>duc</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_ActionReplaySave.icns</string>
<key>CFBundleTypeName</key>
<string>Action Replay Save</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.codejunkies.actionreplay.save.nintendo.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>bin</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_HWImage_NDS.icns</string>
<key>CFBundleTypeName</key>
<string>Nintendo DS Hardware Image</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.nintendo.hwimage.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>xml</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_ADVANsCEneDatabase.icns</string>
<key>CFBundleTypeName</key>
<string>ADVANsCEne Database</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.advanscene.database.nintendo.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>dat</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon_R4CheatDatabase.icns</string>
<key>CFBundleTypeName</key>
<string>R4 Cheats Database</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>net.gbatemp.cheats.database.nintendo.ds</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string>AppIcon_DeSmuME</string>
<key>CFBundleIdentifier</key>
<string>org.desmume.DeSmuME</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>v0.9.11</string>
<key>CFBundleSignature</key>
<string>DSmM</string>
<key>CFBundleVersion</key>
<string>0.9.11</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.entertainment</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright ©2007-2014 DeSmuME Team. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu (Legacy)</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>DeSmuME Save State</string>
<key>UTTypeIconFile</key>
<string>AppIcon_SaveState.icns</string>
<key>UTTypeIdentifier</key>
<string>com.desmume.savestate</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dst</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>DeSmuME ROM Save</string>
<key>UTTypeIconFile</key>
<string>AppIcon_ROMSave.icns</string>
<key>UTTypeIdentifier</key>
<string>com.desmume.romsave</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dsv</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>DeSmuME Firmware Configuration</string>
<key>UTTypeIconFile</key>
<string>AppIcon_FirmwareConfig.icns</string>
<key>UTTypeIdentifier</key>
<string>com.desmume.firmwareconfig</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dfc</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>DeSmuME ROM Cheats</string>
<key>UTTypeIconFile</key>
<string>AppIcon_ROMCheats.icns</string>
<key>UTTypeIdentifier</key>
<string>com.desmume.romcheats</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dct</string>
</array>
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Nintendo DS ROM</string>
<key>UTTypeIconFile</key>
<string>AppIcon_NintendoDS_ROM.icns</string>
<key>UTTypeIdentifier</key>
<string>com.nintendo.rom.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>nds</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Gameboy Advance ROM</string>
<key>UTTypeIconFile</key>
<string>AppIcon_NintendoGBA_ROM.icns</string>
<key>UTTypeIdentifier</key>
<string>com.nintendo.rom.gba</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>ds.gba</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>No$GBA ROM Save</string>
<key>UTTypeIconFile</key>
<string>AppIcon_NoGBA_ROMSave.icns</string>
<key>UTTypeIdentifier</key>
<string>de.emubase.nocash.romsave.gba</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>sav</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Action Replay Save</string>
<key>UTTypeIconFile</key>
<string>AppIcon_ActionReplaySave.icns</string>
<key>UTTypeIdentifier</key>
<string>com.codejunkies.actionreplay.save.nintendo.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>duc</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Nintendo DS Hardware Image</string>
<key>UTTypeIconFile</key>
<string>AppIcon_HWImage_NDS.icns</string>
<key>UTTypeIdentifier</key>
<string>com.nintendo.hwimage.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>bin</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>ADVANsCEne Database</string>
<key>UTTypeIconFile</key>
<string>AppIcon_ADVANsCEneDatabase.icns</string>
<key>UTTypeIdentifier</key>
<string>com.advanscene.database.nintendo.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>xml</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>R4 Cheats Database</string>
<key>UTTypeIconFile</key>
<string>AppIcon_R4CheatDatabase.icns</string>
<key>UTTypeIdentifier</key>
<string>net.gbatemp.cheats.database.nintendo.ds</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>dat</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>

View File

@ -1,185 +0,0 @@
/* Copyright (C) 2011 Roger Manuel
This file is part of DeSmuME
DeSmuME 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.
DeSmuME 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 DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#import <Cocoa/Cocoa.h>
@interface CocoaDSInput : NSObject
{
bool isStateChanged;
NSMutableDictionary *property;
}
- (id) init;
- (void) dealloc;
- (void) setIsStateChanged:(bool)state;
- (bool) isStateChanged;
- (void) setInputTime:(NSDate*)inputTime;
- (NSDate*) getInputTime;
@end
@interface CocoaDSButton : CocoaDSInput
{
}
- (id) init;
- (void) dealloc;
- (void) setPressed:(bool)inputValue;
- (bool) getPressed;
@end
@interface CocoaDSTouch : CocoaDSInput
{
}
- (id) init;
- (void) dealloc;
- (void) setTouching:(bool)inputValue;
- (bool) getTouching;
- (void) setX:(float)inputValue;
- (float) getX;
- (void) setY:(float)inputValue;
- (float) getY;
- (void) setPoint:(NSPoint)inputValue;
- (NSPoint) getPoint;
- (void) setTouchingWithCoords:(bool)isTouching x:(float)xValue y:(float)yValue;
- (void) setTouchingWithPoint:(bool)isTouching point:(NSPoint)inputPoint;
@end
@interface CocoaDSMic : CocoaDSInput
{
}
- (id) init;
- (void) dealloc;
- (void) setPressed:(bool)inputValue;
- (bool) getPressed;
@end
@interface CocoaDSController : NSObject
{
CocoaDSButton *ndsButton_Up;
CocoaDSButton *ndsButton_Down;
CocoaDSButton *ndsButton_Left;
CocoaDSButton *ndsButton_Right;
CocoaDSButton *ndsButton_A;
CocoaDSButton *ndsButton_B;
CocoaDSButton *ndsButton_X;
CocoaDSButton *ndsButton_Y;
CocoaDSButton *ndsButton_Select;
CocoaDSButton *ndsButton_Start;
CocoaDSButton *ndsButton_R;
CocoaDSButton *ndsButton_L;
CocoaDSButton *ndsButton_Debug;
CocoaDSButton *ndsButton_Lid;
CocoaDSTouch *ndsTouch;
CocoaDSMic *ndsMic;
}
- (id) init;
- (void) dealloc;
- (void) setupAllDSInputs;
//touch screen
- (void)touch:(NSPoint)point;
- (void)releaseTouch;
- (bool) getTouching;
- (NSPoint) getTouchPoint;
- (float) getTouchXCoord;
- (float) getTouchYCoord;
//button input
- (void)pressStart;
- (void)liftStart;
- (bool) getStartPressed;
- (void)pressSelect;
- (void)liftSelect;
- (bool) getSelectPressed;
- (void)pressLeft;
- (void)liftLeft;
- (bool) getLeftPressed;
- (void)pressRight;
- (void)liftRight;
- (bool) getRightPressed;
- (void)pressUp;
- (void)liftUp;
- (bool) getUpPressed;
- (void)pressDown;
- (void)liftDown;
- (bool) getDownPressed;
- (void)pressA;
- (void)liftA;
- (bool) getAPressed;
- (void)pressB;
- (void)liftB;
- (bool) getBPressed;
- (void)pressX;
- (void)liftX;
- (bool) getXPressed;
- (void)pressY;
- (void)liftY;
- (bool) getYPressed;
- (void)pressL;
- (void)liftL;
- (bool) getLPressed;
- (void)pressR;
- (void)liftR;
- (bool) getRPressed;
- (void) pressDebug;
- (void) liftDebug;
- (bool) getDebugPressed;
- (void) pressLid;
- (void) liftLid;
- (bool) getLidPressed;
// Nintendo DS Mic
- (void) pressMic;
- (void) liftMic;
- (bool) getMicPressed;
@end

View File

@ -1,596 +0,0 @@
/* Copyright (C) 2011 Roger Manuel
This file is part of DeSmuME
DeSmuME 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.
DeSmuME 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 DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#import "cocoa_input_legacy.h"
#include "../NDSSystem.h"
@implementation CocoaDSInput
- (id) init
{
isStateChanged = false;
property = [[NSMutableDictionary alloc] init];
[property setValue:[NSDate date] forKey:@"inputTime"];
return self;
}
- (void) dealloc
{
[property release];
[super dealloc];
}
- (void) setIsStateChanged:(bool)state
{
isStateChanged = state;
}
- (bool) isStateChanged
{
return isStateChanged;
}
- (void) setInputTime:(NSDate*)inputTime
{
[property setValue:inputTime forKey:@"inputTime"];
}
- (NSDate*) getInputTime
{
return [property objectForKey:@"inputTime"];
}
@end
@implementation CocoaDSButton
- (id) init
{
[super init];
[property setValue:[NSNumber numberWithBool:false] forKey:@"press"];
return self;
}
- (void) dealloc
{
[super dealloc];
}
- (void) setPressed:(bool)inputValue
{
// Check for state change and set the flag appropriately.
if (inputValue != [self getPressed])
{
isStateChanged = true;
}
else
{
isStateChanged = false;
}
[property setValue:[NSDate date] forKey:@"inputTime"];
[property setValue:[NSNumber numberWithBool:inputValue] forKey:@"press"];
}
- (bool) getPressed
{
return [[property objectForKey:@"press"] boolValue];
}
@end
@implementation CocoaDSTouch
- (id) init
{
[super init];
[property setValue:[NSNumber numberWithBool:false] forKey:@"touch"];
[property setValue:[NSNumber numberWithFloat:0.0] forKey:@"x"];
[property setValue:[NSNumber numberWithFloat:0.0] forKey:@"y"];
return self;
}
- (void) dealloc
{
[super dealloc];
}
- (void) setTouching:(bool)inputValue
{
// Check for state change and set the flag appropriately.
if (inputValue != [self getTouching])
{
isStateChanged = true;
}
else
{
isStateChanged = false;
}
[property setValue:[NSDate date] forKey:@"inputTime"];
[property setValue:[NSNumber numberWithBool:inputValue] forKey:@"touch"];
}
- (bool) getTouching
{
return [[property objectForKey:@"touch"] boolValue];
}
- (void) setX:(float)inputValue
{
// Check for state change and set the flag appropriately.
if (inputValue != [self getX])
{
isStateChanged = true;
}
else
{
isStateChanged = false;
}
[property setValue:[NSDate date] forKey:@"inputTime"];
[property setValue:[NSNumber numberWithFloat:inputValue] forKey:@"x"];
}
- (float) getX
{
return [[property objectForKey:@"x"] floatValue];
}
- (void) setY:(float)inputValue
{
// Check for state change and set the flag appropriately.
if (inputValue != [self getY])
{
isStateChanged = true;
}
else
{
isStateChanged = false;
}
[property setValue:[NSDate date] forKey:@"inputTime"];
[property setValue:[NSNumber numberWithFloat:inputValue] forKey:@"y"];
}
- (float) getY
{
return [[property objectForKey:@"y"] floatValue];
}
- (void) setPoint:(NSPoint)inputValue
{
// Check for state change and set the flag appropriately.
if (inputValue.x != [self getX] || inputValue.y != [self getY])
{
isStateChanged = true;
}
else
{
isStateChanged = false;
}
[self setX:inputValue.x];
[self setY:inputValue.y];
}
- (NSPoint) getPoint
{
NSPoint outPoint = {[self getX], [self getY]};
return outPoint;
}
- (void) setTouchingWithCoords:(bool)isTouching x:(float)xValue y:(float)yValue
{
// Check for state change and set the flag appropriately.
if (isTouching != [self getTouching] ||
xValue != [self getX] ||
yValue != [self getY])
{
isStateChanged = true;
}
else
{
isStateChanged = false;
}
[property setValue:[NSDate date] forKey:@"inputTime"];
[property setValue:[NSNumber numberWithBool:isTouching] forKey:@"touch"];
[property setValue:[NSNumber numberWithFloat:xValue] forKey:@"x"];
[property setValue:[NSNumber numberWithFloat:yValue] forKey:@"y"];
}
- (void) setTouchingWithPoint:(bool)isTouching point:(NSPoint)inputPoint
{
[self setTouchingWithCoords:isTouching x:inputPoint.x y:inputPoint.y];
}
@end
@implementation CocoaDSMic
- (id) init
{
[super init];
[property setValue:[NSNumber numberWithBool:false] forKey:@"press"];
return self;
}
- (void) dealloc
{
[super dealloc];
}
- (void) setPressed:(bool)inputValue
{
[property setValue:[NSDate date] forKey:@"inputTime"];
[property setValue:[NSNumber numberWithBool:inputValue] forKey:@"press"];
}
- (bool) getPressed
{
return [[property objectForKey:@"press"] boolValue];
}
@end
@implementation CocoaDSController
- (id) init
{
ndsButton_Up = [[CocoaDSButton alloc] init];
ndsButton_Down = [[CocoaDSButton alloc] init];
ndsButton_Left = [[CocoaDSButton alloc] init];
ndsButton_Right = [[CocoaDSButton alloc] init];
ndsButton_A = [[CocoaDSButton alloc] init];
ndsButton_B = [[CocoaDSButton alloc] init];
ndsButton_X = [[CocoaDSButton alloc] init];
ndsButton_Y = [[CocoaDSButton alloc] init];
ndsButton_Select = [[CocoaDSButton alloc] init];
ndsButton_Start = [[CocoaDSButton alloc] init];
ndsButton_R = [[CocoaDSButton alloc] init];
ndsButton_L = [[CocoaDSButton alloc] init];
ndsButton_Debug = [[CocoaDSButton alloc] init];
ndsButton_Lid = [[CocoaDSButton alloc] init];
ndsTouch = [[CocoaDSTouch alloc] init];
ndsMic = [[CocoaDSMic alloc] init];
return self;
}
- (void) dealloc
{
[ndsButton_Up release];
[ndsButton_Down release];
[ndsButton_Left release];
[ndsButton_Right release];
[ndsButton_A release];
[ndsButton_B release];
[ndsButton_X release];
[ndsButton_Y release];
[ndsButton_Select release];
[ndsButton_Start release];
[ndsButton_R release];
[ndsButton_L release];
[ndsButton_Debug release];
[ndsButton_Lid release];
[ndsTouch release];
[ndsMic release];
[super dealloc];
}
- (void) setupAllDSInputs
{
// Setup the DS pad.
NDS_setPad([self getRightPressed],
[self getLeftPressed],
[self getDownPressed],
[self getUpPressed],
[self getSelectPressed],
[self getStartPressed],
[self getBPressed],
[self getAPressed],
[self getYPressed],
[self getXPressed],
[self getLPressed],
[self getRPressed],
[self getDebugPressed],
[self getLidPressed]);
// Setup the DS touch pad.
if ([self getTouching])
{
NDS_setTouchPos([self getTouchXCoord], [self getTouchYCoord]);
}
else
{
NDS_releaseTouch();
}
// Setup the DS mic.
NDS_setMic([self getMicPressed]);
}
- (void)touch:(NSPoint)point
{
[ndsTouch setTouchingWithPoint:true point:point];
}
- (void)releaseTouch
{
[ndsTouch setTouching:false];
}
- (bool) getTouching
{
return [ndsTouch getTouching];
}
- (NSPoint) getTouchPoint
{
return [ndsTouch getPoint];
}
- (float) getTouchXCoord
{
return [ndsTouch getX];
}
- (float) getTouchYCoord
{
return [ndsTouch getY];
}
- (void)pressStart
{
[ndsButton_Start setPressed:true];
}
- (void)liftStart
{
[ndsButton_Start setPressed:false];
}
- (bool) getStartPressed
{
return [ndsButton_Start getPressed];
}
- (void)pressSelect
{
[ndsButton_Select setPressed:true];
}
- (void)liftSelect
{
[ndsButton_Select setPressed:false];
}
- (bool) getSelectPressed
{
return [ndsButton_Select getPressed];
}
- (void)pressLeft
{
[ndsButton_Left setPressed:true];
}
- (void)liftLeft
{
[ndsButton_Left setPressed:false];
}
- (bool) getLeftPressed
{
return [ndsButton_Left getPressed];
}
- (void)pressRight
{
[ndsButton_Right setPressed:true];
}
- (void)liftRight
{
[ndsButton_Right setPressed:false];
}
- (bool) getRightPressed
{
return [ndsButton_Right getPressed];
}
- (void)pressUp
{
[ndsButton_Up setPressed:true];
}
- (void)liftUp
{
[ndsButton_Up setPressed:false];
}
- (bool) getUpPressed
{
return [ndsButton_Up getPressed];
}
- (void)pressDown
{
[ndsButton_Down setPressed:true];
}
- (void)liftDown
{
[ndsButton_Down setPressed:false];
}
- (bool) getDownPressed
{
return [ndsButton_Down getPressed];
}
- (void)pressA
{
[ndsButton_A setPressed:true];
}
- (void)liftA
{
[ndsButton_A setPressed:false];
}
- (bool) getAPressed
{
return [ndsButton_A getPressed];
}
- (void)pressB
{
[ndsButton_B setPressed:true];
}
- (void)liftB
{
[ndsButton_B setPressed:false];
}
- (bool) getBPressed
{
return [ndsButton_B getPressed];
}
- (void)pressX
{
[ndsButton_X setPressed:true];
}
- (void)liftX
{
[ndsButton_X setPressed:false];
}
- (bool) getXPressed
{
return [ndsButton_X getPressed];
}
- (void)pressY
{
[ndsButton_Y setPressed:true];
}
- (void)liftY
{
[ndsButton_Y setPressed:false];
}
- (bool) getYPressed
{
return [ndsButton_Y getPressed];
}
- (void)pressL
{
[ndsButton_L setPressed:true];
}
- (void)liftL
{
[ndsButton_L setPressed:false];
}
- (bool) getLPressed
{
return [ndsButton_L getPressed];
}
- (void)pressR
{
[ndsButton_R setPressed:true];
}
- (void)liftR
{
[ndsButton_R setPressed:false];
}
- (bool) getRPressed
{
return [ndsButton_R getPressed];
}
- (void) pressDebug
{
[ndsButton_Debug setPressed:true];
}
- (void) liftDebug
{
[ndsButton_Debug setPressed:false];
}
- (bool) getDebugPressed
{
return [ndsButton_Debug getPressed];
}
- (void) pressLid
{
[ndsButton_Lid setPressed:true];
}
- (void) liftLid
{
[ndsButton_Lid setPressed:false];
}
- (bool) getLidPressed
{
return [ndsButton_Lid getPressed];
}
- (void) pressMic
{
[ndsMic setPressed:true];
}
- (void) liftMic
{
[ndsMic setPressed:false];
}
- (bool) getMicPressed
{
return [ndsMic getPressed];
}
@end

View File

@ -1,231 +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 <http://www.gnu.org/licenses/>.
*/
#import "input_legacy.h"
#import "cocoa_input_legacy.h"
#import "preferences_legacy.h"
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 };
//
@implementation ControlsDelegate
+ (id)sharedObject
{
static ControlsDelegate* object = nil;
if(!object)object = [[ControlsDelegate alloc] init];
return object;
}
- (void)bindingForKeyA:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_A]; }
- (void)bindingForKeyB:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_B]; }
- (void)bindingForKeyX:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_X]; }
- (void)bindingForKeyY:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_Y]; }
- (void)bindingForKeyL:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_L]; }
- (void)bindingForKeyR:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_R]; }
- (void)bindingForKeyUp:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_UP]; }
- (void)bindingForKeyDown:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_DOWN]; }
- (void)bindingForKeyLeft:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_LEFT]; }
- (void)bindingForKeyRight:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_RIGHT]; }
- (void)bindingForKeyStart:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_START]; }
- (void)bindingForKeySelect:(id)sender { [[NSUserDefaults standardUserDefaults] setValue:[[sender selectedItem] representedObject] forKey:PREF_KEY_SELECT]; }
@end
//
@implementation InputHandler
//Class functions ---------------------------------
+ (NSView*)createPreferencesView:(float)width
{
NSArray *keys = [NSArray arrayWithObjects:
@"0", @"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9",
@"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", @"J", @"K", @"L",
@"M", @"N", @"O", @"P", @"Q", @"R", @"S", @"T", @"V", @"W", @"X", @"Y", @"Z",
@",", @"<", @".", @">", @"/", @"?", @";", @":", @"'", @"\"", @"[", @"{", @"]", @"}", @"\\", @"|",
@"Up Key" , @"Down Key" , @"Left Key" ,
@"Right Key", @"Space Bar", @"Enter Key",
nil];
NSArray *objects = [NSArray arrayWithObjects:
@"0" , @"1" , @"2" , @"3" , @"4" , @"5" , @"6" , @"7" , @"8" , @"9",
@"aA", @"bB", @"cC", @"dD", @"eE", @"fF", @"gG", @"hH", @"iI", @"jJ", @"kK", @"lL",
@"mM", @"nN", @"oO", @"pP", @"qQ", @"rR", @"sS", @"tT", @"vV", @"wW", @"xX", @"yY", @"zZ",
@",", @"<", @".", @">", @"/", @"?", @";", @":", @"'", @"\"", @"[", @"{", @"]", @"}", @"\\", @"|",
[[[NSString alloc] initWithBytesNoCopy:utf8_up length:3 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease],
[[[NSString alloc] initWithBytesNoCopy:utf8_down length:3 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease],
[[[NSString alloc] initWithBytesNoCopy:utf8_left length:3 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease],
[[[NSString alloc] initWithBytesNoCopy:utf8_right length:3 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease],
@" ",
[[[NSString alloc] initWithBytesNoCopy:&utf8_return length:1 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease],
nil];
NSDictionary *keyboardMap = [[NSDictionary alloc] initWithObjects:objects forKeys:keys];
NSDictionary *controls_options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyA:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_A,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyB:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_B,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyX:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_X,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyY:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_Y,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyL:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_L,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyR:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_R,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyUp:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_UP,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyDown:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_DOWN,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyLeft:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_LEFT,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyRight:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_RIGHT,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeyStart:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_START,
[NSArray arrayWithObjects:@"Dictionary", [NSData dataWithBytes:&@selector(bindingForKeySelect:) length:sizeof(SEL)], keyboardMap , nil] , PREF_KEY_SELECT,
nil];
return createPreferencesView(@"Use the popup buttons on the right to change settings", controls_options, [ControlsDelegate sharedObject]);
}
+ (NSDictionary*)appDefaults
{
return [NSDictionary dictionaryWithObjectsAndKeys:
@"vV", PREF_KEY_A,
@"bB", PREF_KEY_B,
@"gG", PREF_KEY_X,
@"hH", PREF_KEY_Y,
@"cC", PREF_KEY_L,
@"nN", PREF_KEY_R,
@" ", PREF_KEY_SELECT,
[[[NSString alloc] initWithBytesNoCopy:utf8_up length:3 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease], PREF_KEY_UP,
[[[NSString alloc] initWithBytesNoCopy:utf8_down length:3 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease], PREF_KEY_DOWN,
[[[NSString alloc] initWithBytesNoCopy:utf8_left length:3 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease], PREF_KEY_LEFT,
[[[NSString alloc] initWithBytesNoCopy:utf8_right length:3 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease], PREF_KEY_RIGHT,
[[[NSString alloc] initWithBytesNoCopy:&utf8_return length:1 encoding:NSUTF8StringEncoding freeWhenDone:NO] autorelease], PREF_KEY_START,
nil];
}
//Member Functions -----------------------------------
- (id)init
{
//make sure we go through through the designated init function
[self doesNotRecognizeSelector:_cmd];
return nil;
}
- (id) initWithCdsController:(CocoaDSController *)theController
{
self = [super init];
if(self == nil)
{
return nil;
}
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;
NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
NSString *chars = [event characters];
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
{
NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
NSString *chars = [event characters];
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;
}

View File

@ -1,42 +0,0 @@
/*
Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
*/
#ifndef MACOSX_10_4_COMPATIBILITY_H
#define MACOSX_10_4_COMPATIBILITY_H
// Taken from NSObjCRuntime.h of the Mac OS X v10.5 SDK.
// Defines NSInteger and NSUInteger for Mac OS X v10.4 and earlier.
#ifndef NSINTEGER_DEFINED
#define NSINTEGER_DEFINED 1
typedef int NSInteger;
typedef unsigned int NSUInteger;
#define NSIntegerMax LONG_MAX
#define NSIntegerMin LONG_MIN
#define NSUIntegerMax ULONG_MAX
#endif
// Taken from CIVector.h of the Mac OS X v10.5 SDK.
// Defines CGFloat for Mac OS X v10.4 and earlier.
#ifndef CGFLOAT_DEFINED
#define CGFLOAT_DEFINED 1
typedef float CGFloat;
#define CGFLOAT_MIN FLT_MIN
#define CGFLOAT_MAX FLT_MAX
#define CGFLOAT_IS_DOUBLE 0
#endif
#endif // MACOSX_10_4_COMPATIBILITY_H

View File

@ -1,163 +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 <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#include <pthread.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
#include "macosx_10_4_compat.h"
#endif
#ifdef GDB_STUB
#define OBJ_C
#include "../gdbstub.h"
#endif
#define MAX_SLOTS 10
@class CocoaDSController;
@class ScreenState;
//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
//Please only instanciate once.
@interface NintendoDS : NSObject
{
@private
NSOpenGLContext* context; //context where the 3d gets renderered to
NSOpenGLPixelFormat* pixel_format; //pixel format for opengl 3d renderer
NSThread *gui_thread;
SEL display_func; //the function id that gets called when the screen is ready to update
id display_object; //the object that the above function is called on
SEL error_func;
id error_object;
NSLock *execution_lock;
NSLock *sound_lock;
pthread_mutex_t *mutexCoreExecute;
ScreenState * volatile current_screen;
NSLock *video_update_lock;
volatile bool finish; //set to true to make the other thread finish
volatile bool finished; //set to true by the other thread after it finishes
volatile bool run; //set to control execution in other thread
volatile bool paused; //sey by other thread to let us know if its executing
bool muted;
float volume;
volatile int frame_skip;
volatile int speed_limit;
volatile int save_type;
CGFloat speedScalar;
BOOL isSpeedLimitEnabled;
NSTimeInterval calcTimeBudget;
CocoaDSController *cdsController;
#ifdef GDB_STUB
NSInteger arm9_gdb_port;
NSInteger arm7_gdb_port;
gdbstub_handle_t arm9_gdb_stub;
gdbstub_handle_t arm7_gdb_stub;
#endif
unsigned char gpu_buff[256 * 256 * 5]; //this is where the 3D rendering of the NDS is stored
@public
NSURL *loadedRomURL;
NSInteger prevCoreState;
}
//Instanciating, setup, and deconstruction
- (id)init;
- (void)setVideoUpdateCallback:(SEL)callback withObject:(id)object; //this callback should take one ScreenState(below) parameter
- (void)setErrorCallback:(SEL)callback withObject:(id)object;
- (void)dealloc;
// Data accessors
- (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)isRomLoaded;
- (void)closeROM;
//ROM Info
- (NSImage *)romIcon;
- (NSString *) romFileName;
- (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) 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;
- (void) emulateDS;
- (void) drawFrame;
- (void) padTime:(NSTimeInterval)timePad;
- (BOOL) isSubScreenLayerDisplayed:(int)i;
- (BOOL) isMainScreenLayerDisplayed:(int)i;
- (void) toggleMainScreenLayer:(int)i;
- (void) toggleSubScreenLayer:(int)i;
//Sound
- (BOOL)hasSound;
- (void) setVolume:(float)vol; //clamped: 0 to 100
- (float) volume;
- (void)enableMute;
- (void)disableMute;
- (void)toggleMute;
- (BOOL)muted;
- (void) copyToPasteboard;
- (NSBitmapImageRep *) bitmapImageRep;
@end
void RomIconToRGBA8888(uint32_t *bitmapData);
bool OSXOpenGLRendererInit();

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +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 <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
#include "macosx_10_4_compat.h"
#endif
#define PREF_EXECUTE_UPON_LOAD @"Execute Upon Load"
#define PREF_AFTER_LAUNCHED @"When Launching, Load"
#define PREF_AFTER_LAUNCHED_OPTION_NOTHING @"Load Nothing"
#define PREF_AFTER_LAUNCHED_OPTION_LAST_ROM @"Load Last ROM"
#ifdef GDB_STUB
#define PREF_ARM9_GDB_PORT @"arm9gdb"
#define PREF_ARM7_GDB_PORT @"arm7gdb"
#endif
#define PREF_KEY_A @"A Button"
#define PREF_KEY_B @"B Button"
#define PREF_KEY_X @"X Button"
#define PREF_KEY_Y @"Y Button"
#define PREF_KEY_L @"L Button"
#define PREF_KEY_R @"R Button"
#define PREF_KEY_UP @"Up Button"
#define PREF_KEY_DOWN @"Down Button"
#define PREF_KEY_LEFT @"Left Button"
#define PREF_KEY_RIGHT @"Right Button"
#define PREF_KEY_START @"Start Button"
#define PREF_KEY_SELECT @"Select Button"
void setAppDefaults(); //this is defined in preferences.m and should be called at app launch
NSView *createPreferencesView(NSString *helpinfo, NSDictionary *options, id delegate); //utility func for creating a preference panel with a set of options

View File

@ -1,554 +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 <http://www.gnu.org/licenses/>.
*/
#import "preferences_legacy.h"
#import "cocoa_util.h"
#import "input_legacy.h"
/* Preference settings are stored using NSUserDefaults
which should put them in a property list in /Users/username/Library/Preferences
For the keys we use the same strings you see in the preference menu
such as "Execute Upon Load" to keep things simple, of course the unlocalized version
of the strings are used so that when you change language it will still
finds the settings from before. Also theres no guarantee that localized
strings will be unique.
*/
#define INTERFACE_INTERNAL_NAME @"Interface"
#define CONTROLS_INTERNAL_NAME @"Controls"
#define FIRMWARE_INTERNAL_NAME @"Firmware"
const CGFloat PREFERENCES_WIDTH = 365;
///////////////////////////////
NSFont *preferences_font;
NSDictionary *preferences_font_attribs;
NSMutableDictionary *defaults;
///////////////////////////////
//This needs to be called when the program starts
void setAppDefaults()
{
defaults = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
//Interface defaults
@"Yes", PREF_EXECUTE_UPON_LOAD,
PREF_AFTER_LAUNCHED_OPTION_NOTHING, PREF_AFTER_LAUNCHED,
//Firmware defaults
//@"DeSmuME User", PREF_FIRMWARE_PLAYER_NAME,
//@"English", PREF_FIRMWARE_LANGUAGE,
nil];
//Input defaults
[defaults addEntriesFromDictionary:[InputHandler appDefaults]];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
}
///////////////////////////////
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5
@interface PreferencesDelegate : NSObject <NSWindowDelegate>
#else
@interface PreferencesDelegate : NSObject
#endif
{}
@end
@implementation PreferencesDelegate
- (void)windowWillClose:(NSNotification*)aNotification
{
[NSApp stopModal];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (void)textDidChange:(NSNotification*)notification
{
//NSText *text_field = [notification object];
//NSString *text = [text_field string];
}
- (void)executeUponLoad:(id)sender
{
BOOL value = ([sender indexOfSelectedItem] == 0) ? YES : NO;
[[NSUserDefaults standardUserDefaults] setBool:value forKey:@"ExecuteROMOnLoad"];
}
- (void)afterLaunch:(id)sender
{
if([sender indexOfSelectedItem] == 0)
[[NSUserDefaults standardUserDefaults] setObject:PREF_AFTER_LAUNCHED_OPTION_NOTHING forKey:PREF_AFTER_LAUNCHED];
else
[[NSUserDefaults standardUserDefaults] setObject:PREF_AFTER_LAUNCHED_OPTION_LAST_ROM forKey:PREF_AFTER_LAUNCHED];
}
@end
////////////////////////////////////////////////////
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5
@interface ToolbarDelegate : NSObject <NSToolbarDelegate>
#else
@interface ToolbarDelegate : NSObject
#endif
{
NSWindow *window;
NSToolbarItem *interface;
NSView *interface_view;
NSToolbarItem *controls;
NSView *controls_view;
NSToolbarItem *ds_firmware;
NSView *firmware_view;
}
- (id)initWithWindow:(NSWindow*)_window generalView:(NSView*)g controlsView:(NSView*)c firmwareView:(NSView*)f;
- (void)dealloc;
- (NSToolbarItem*)toolbar:(NSToolbar*)toolbar itemForItemIdentifier:(NSString*)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag;
- (NSArray*)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar;
- (NSArray*)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar;
- (NSArray*)toolbarSelectableItemIdentifiers:(NSToolbar*)toolbar;
@end
@implementation ToolbarDelegate
- (id)init
{
//make sure we go through through the designated init function
[self doesNotRecognizeSelector:_cmd];
return nil;
}
- (id)initWithWindow:(NSWindow*)_window generalView:(NSView*)g controlsView:(NSView*)c firmwareView:(NSView*)f;
{
self = [super init];
if(self == nil)return nil;
window = _window;
[window retain];
interface_view = g;
[interface_view retain];
controls_view = c;
[controls_view retain];
firmware_view = f;
[firmware_view retain];
interface = controls = ds_firmware = nil;
return self;
}
- (void)dealloc
{
[interface release];
[interface_view release];
[controls release];
[controls_view release];
[ds_firmware release];
[firmware_view release];
[window release];
[super dealloc];
}
- (NSToolbarItem*)toolbar:(NSToolbar*)toolbar itemForItemIdentifier:(NSString*)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
{
NSToolbarItem *result;
if([itemIdentifier compare:INTERFACE_INTERNAL_NAME] == NSOrderedSame)
{
if(interface == nil)
{
interface = [[NSToolbarItem alloc] initWithItemIdentifier:INTERFACE_INTERNAL_NAME];
[interface setImage:[NSApp applicationIconImage]];
[interface setLabel:NSLocalizedString(@"Interface", nil)];
[interface setTarget:self];
[interface setAction:@selector(toolbarItemClicked:)];
}
result = interface;
} else if([itemIdentifier compare:CONTROLS_INTERNAL_NAME] == NSOrderedSame)
{
if(controls == nil)
{
controls = [[NSToolbarItem alloc] initWithItemIdentifier:CONTROLS_INTERNAL_NAME];
[controls setImage:[NSApp applicationIconImage]];
[controls setLabel:NSLocalizedString(@"Controls", nil)];
[controls setTarget:self];
[controls setAction:@selector(toolbarItemClicked:)];
}
result = controls;
} else if([itemIdentifier compare:FIRMWARE_INTERNAL_NAME] == NSOrderedSame)
{
if(ds_firmware == nil)
{
ds_firmware = [[NSToolbarItem alloc] initWithItemIdentifier:FIRMWARE_INTERNAL_NAME];
[ds_firmware setImage:[NSApp applicationIconImage]];
[ds_firmware setLabel:NSLocalizedString(@"DS Firmware", nil)];
[ds_firmware setTarget:self];
[ds_firmware setAction:@selector(toolbarItemClicked:)];
}
result = ds_firmware;
}
else result = nil;
return result;
}
- (NSArray*)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar
{
return [NSArray arrayWithObjects:INTERFACE_INTERNAL_NAME, CONTROLS_INTERNAL_NAME, FIRMWARE_INTERNAL_NAME, nil];
}
- (NSArray*)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar
{
return [NSArray arrayWithObjects:INTERFACE_INTERNAL_NAME, CONTROLS_INTERNAL_NAME, /*FIRMWARE_INTERNAL_NAME, */nil];
}
- (NSArray*)toolbarSelectableItemIdentifiers:(NSToolbar*)toolbar
{
return [NSArray arrayWithObjects:INTERFACE_INTERNAL_NAME, CONTROLS_INTERNAL_NAME, FIRMWARE_INTERNAL_NAME, nil];
}
- (void)toolbarItemClicked:(id)sender
{
//Check what button was clicked
NSString *item_clicked = [sender itemIdentifier];
NSView *new_view;
if([item_clicked compare:INTERFACE_INTERNAL_NAME] == NSOrderedSame)
{
if([interface_view superview] == [window contentView])return;
new_view = interface_view;
} else if([item_clicked compare:CONTROLS_INTERNAL_NAME] == NSOrderedSame)
{
if([controls_view superview] == [window contentView])return;
new_view = controls_view;
} else if([item_clicked compare:FIRMWARE_INTERNAL_NAME] == NSOrderedSame)
{
if([firmware_view superview] == [window contentView])return;
new_view = firmware_view;
} else return;
//Add/remove views to show only the view we now want to see
NSView *content_view = [window contentView];
if(interface_view == new_view)[content_view addSubview:interface_view];
else [interface_view removeFromSuperview];
if(controls_view == new_view)[content_view addSubview:controls_view];
else [controls_view removeFromSuperview];
if(firmware_view == new_view)[content_view addSubview:firmware_view];
else [firmware_view removeFromSuperview];
//Resize window to fit the new information perfectly
//we must take into account the size of the titlebar and toolbar
//and we also have to recalc the window position to keep the top of the window in the same place,
//since coordinates are based from the bottom left
NSRect old_window_size = [window frame];
NSRect new_window_size = [window frameRectForContentRect:[new_view frame]];
new_window_size.size.width = PREFERENCES_WIDTH;
new_window_size.origin.x = old_window_size.origin.x;
new_window_size.origin.y = old_window_size.origin.y + old_window_size.size.height - new_window_size.size.height;
[window setFrame:new_window_size display:YES animate:YES];
}
@end
////////////////////////////////////////////////////
@implementation NSApplication(custom_extensions)
NSView *createPreferencesView(NSString *helpinfo, NSDictionary *options, id delegate)
{
//create the view
NSView *view = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, PREFERENCES_WIDTH, 10)];
//loop through each option in the options list
//this is done backwards since we build the view upwards
//fixme: because dictionaries lack order, options should not be passed as a dictionary
NSArray* keys = [[options allKeys] sortedArrayUsingSelector:@selector(localizedCompare:)];
NSEnumerator *key_enumerator = [keys reverseObjectEnumerator];
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]))
{
object = [options objectForKey:key_raw];
key = NSLocalizedString(key_raw, nil);
NSString *current_setting = [[NSUserDefaults standardUserDefaults] objectForKey:key_raw];
if([(NSString *)[object objectAtIndex:0] compare:@"Bool"] == NSOrderedSame)
{
//Create the button for this option
NSPopUpButton *button = [[NSPopUpButton alloc] initWithFrame:button_rect pullsDown:NO];
//Setup the button callback
//the items array should have a selector encoded in an NSData
//since we can't stick a selector directly in an NSArray
SEL action;
[[object objectAtIndex:1] getBytes:&action];
[button setAction:action];
[button setTarget:delegate];
[button addItemWithTitle:NSLocalizedString(@"Yes",nil)];
[button addItemWithTitle:NSLocalizedString(@"No",nil)];
[button selectItemAtIndex:([[NSUserDefaults standardUserDefaults] boolForKey:@"ExecuteROMOnLoad"] == YES) ? 0 : 1];
[view addSubview:button];
}
else if([(NSString *)[object objectAtIndex:0] compare:@"Array"] == NSOrderedSame)
{
//Create the button for this option
NSPopUpButton *button = [[NSPopUpButton alloc] initWithFrame:button_rect pullsDown:NO];
//button callback
SEL action;
[[object objectAtIndex:1] getBytes:&action];
[button setAction:action];
[button setTarget:delegate];
int i;
bool found = false;
for(i = 2; i < [object count]; i++)
{
//add the item to the popup buttons list
[button addItemWithTitle:NSLocalizedString([object objectAtIndex:i],nil)];
//if this is the currently selected or default item
if([current_setting compare:[object objectAtIndex:i]] == NSOrderedSame)
{
found = true;
[button selectItemAtIndex:i - 2];
}
}
if(!found)
{ //the user setting for this option was not found
//get the default value
NSString *default_setting = [defaults objectForKey:key_raw];
//show an error
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:[NSString stringWithFormat:@"%@ setting corrupt (%@), resetting to default (%@)", key, NSLocalizedString(current_setting, nil), NSLocalizedString(default_setting, nil)]];
//set the setting to default
[[NSUserDefaults standardUserDefaults] setObject:default_setting forKey:key_raw];
//show the default setting in the button
for(i = 2; i < [object count]; i++)
if([current_setting compare:[object objectAtIndex:i]] == NSOrderedSame)
;//[button selectItemAtIndex:i - 2]; fixme
}
[view addSubview:button];
}
else if ([(NSString *)[object objectAtIndex:0] caseInsensitiveCompare:@"Text"] == NSOrderedSame)
{
//if this preference is a text field
//we will create a text field and add it to the view
NSRect temp = button_rect;
temp.size.height = [current_setting sizeWithAttributes:preferences_font_attribs].height + 2;
temp.origin.y += (26. - temp.size.height) / 2.;
NSText *text = [[NSText alloc] initWithFrame:temp];
[text setMinSize:temp.size];
[text setMaxSize:temp.size];
[text setFont:preferences_font];
[text setString:current_setting];
[text setEditable:YES];
[text setDrawsBackground:YES];
[text setDelegate:delegate];
[view addSubview:text];
}
else if([(NSString *)[object objectAtIndex:0] compare:@"Dictionary"] == NSOrderedSame)
{
//Create the button for this option
NSPopUpButton *button = [[NSPopUpButton alloc] initWithFrame:button_rect pullsDown:NO];
//button callback
SEL action;
[[object objectAtIndex:1] getBytes:&action];
[button setAction:action];
[button setTarget:delegate];
NSDictionary* keymap = [object objectAtIndex:2];
// Sort elements by name
NSArray* keys = [[keymap allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
int i;
for(i = 0; i < [keys count]; i++)
{
//add the item to the popup buttons list
NSString* key = [keys objectAtIndex:i];
[button addItemWithTitle:NSLocalizedString(key,nil)];
[[button lastItem] setRepresentedObject:[keymap objectForKey:key]];
if ( [current_setting compare:[keymap valueForKey:key] ] == NSOrderedSame ) {
[button selectItemAtIndex:i];
}
}
[view addSubview:button];
}
//Create text for this option
text_rect.size.height = [key sizeWithAttributes:preferences_font_attribs].height;
text_rect.origin.y = button_rect.origin.y + (26. - [key sizeWithAttributes:preferences_font_attribs].height) / 2.;
NSText *text = [[NSText alloc] initWithFrame:text_rect];
[text setFont:preferences_font];
[text setString:key];
[text setEditable:NO];
[text setDrawsBackground:NO];
[text setSelectable:NO];
[text setVerticallyResizable:NO];
[view addSubview:text];
//Increase the y
button_rect.origin.y += 29;
}
//add the info text at the top
NSText *help_text = [[NSText alloc] initWithFrame:NSMakeRect(5, button_rect.origin.y, PREFERENCES_WIDTH-10, 25)];
[help_text setDrawsBackground:NO];
[help_text setVerticallyResizable:YES];
[help_text setHorizontallyResizable:NO];
[help_text insertText:helpinfo];
[help_text setSelectable:NO];
[help_text setEditable:NO];
[view addSubview:help_text];
//resize the view to fit the stuff vertically
NSRect temprect = [view frame];
temprect.size.height = button_rect.origin.y + [help_text frame].size.height + 3;
[view setFrame:temprect];
[help_text release];
return [view autorelease];
}
//this is a hack - in the nib we connect preferences to this function name,
//since it's there, and then here we override whatever it's actually supposed to do
//and replace it with the preference panel.
//Incase you were wondering, I actually have no idea what I'm doing.
- (void)orderFrontDataLinkPanel:(id)sender //<- Preferences Display Function
{
//----------------------------------------------------------------------------------------------
//get the applications main bundle
//NSBundle* app_bundle = [NSBundle mainBundle];
//get a font for displaying text
preferences_font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]];
preferences_font_attribs = [NSDictionary dictionaryWithObjectsAndKeys:preferences_font, NSFontAttributeName, nil];
//create our delegate
PreferencesDelegate *delegate = [[PreferencesDelegate alloc] init];
//Create the window ------------------------------------------------------------------------------
//Create interface view
NSDictionary *interface_options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObjects:@"Bool", [NSData dataWithBytes:&@selector(executeUponLoad:) length:sizeof(SEL)], @"Yes", @"No",nil], PREF_EXECUTE_UPON_LOAD,
[NSArray arrayWithObjects:@"Array", [NSData dataWithBytes:&@selector(afterLaunch:) length:sizeof(SEL)], PREF_AFTER_LAUNCHED_OPTION_NOTHING, PREF_AFTER_LAUNCHED_OPTION_LAST_ROM, nil], PREF_AFTER_LAUNCHED,
nil];
NSView *interface_view = createPreferencesView(@"Use the popup buttons on the right to change settings", interface_options, delegate);
//Create the controls view
NSView *controls_view = [InputHandler createPreferencesView:PREFERENCES_WIDTH];
[controls_view setFrame:NSMakeRect(0, 0, PREFERENCES_WIDTH, [controls_view frame].size.height)];
//create the preferences window
NSWindow *preferences_window = [[NSWindow alloc] initWithContentRect:[interface_view frame] styleMask:
NSTitledWindowMask|NSClosableWindowMask backing:NSBackingStoreBuffered defer:NO screen:nil];
[preferences_window setTitle:NSLocalizedString(@"DeSmuME Preferences", nil)];
[preferences_window setDelegate:delegate];
[preferences_window setFrameAutosaveName:@"DeSmuME Preferences Window"];
[preferences_window setFrameOrigin:NSMakePoint(500,500)];
[[preferences_window contentView] addSubview:interface_view];
//create the toolbar delegate
ToolbarDelegate *toolbar_delegate = [[ToolbarDelegate alloc]
initWithWindow:preferences_window
generalView:interface_view
controlsView:controls_view
firmwareView:nil];
//create the toolbar
NSToolbar *toolbar =[[NSToolbar alloc] initWithIdentifier:@"DeSmuMe Preferences"];
[toolbar setDelegate:toolbar_delegate];
[toolbar setSelectedItemIdentifier:INTERFACE_INTERNAL_NAME]; //start with the general tab selected
[preferences_window setToolbar:toolbar];
[toolbar release];
//show the window
NSWindowController *wc = [[NSWindowController alloc] initWithWindow:preferences_window];
[wc setShouldCascadeWindows:NO];
[wc showWindow:nil];
[wc release];
//run the preferences
[NSApp runModalForWindow:preferences_window];
//
[toolbar_delegate release];
[preferences_window release];
}
@end

View File

@ -1,52 +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 <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
#include "macosx_10_4_compat.h"
#endif
#define DS_BPP 2 //bytes per pixel
#define DS_SCREEN_X_RATIO (256.0 / (192.0 * 2.0))
#define DS_SCREEN_Y_RATIO ((192.0 * 2.0) / 256.0)
#define DS_SCREEN_WIDTH 256
#define DS_SCREEN_HEIGHT 192
//This class is used to return screen data at the end of a frame
//we wrap it in a obj-c class so it can be passed to a selector
//and so we get retain/release niftyness
@interface ScreenState : NSObject
{
@private
unsigned char color_data[DS_SCREEN_WIDTH * DS_SCREEN_HEIGHT*2 * DS_BPP];
}
+ (NSInteger)width;
+ (NSInteger)height;
+ (NSSize)size;
+ (ScreenState*)blackScreenState;
+ (ScreenState*)whiteScreenState;
- (id)initWithBlack;
- (id)initWithWhite;
- (id)initWithScreenState:(ScreenState*)state;
- (id)initWithColorData:(const unsigned char*)data;
- (const unsigned char*)colorData;
- (NSImage*)image;
- (NSBitmapImageRep*)imageRep;
@end

View File

@ -1,152 +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 <http://www.gnu.org/licenses/>.
*/
#import "screen_state_legacy.h"
#import "cocoa_util.h"
@implementation ScreenState
+ (NSInteger)width
{
return DS_SCREEN_WIDTH;
}
+ (NSInteger)height
{
return DS_SCREEN_HEIGHT*2;
}
+ (NSSize)size
{
return NSMakeSize(DS_SCREEN_WIDTH, DS_SCREEN_HEIGHT*2);
}
+ (ScreenState*)blackScreenState
{
return [[[ScreenState alloc] initWithBlack] autorelease];
}
+ (ScreenState*)whiteScreenState;
{
return [[[ScreenState alloc] initWithWhite] autorelease];
}
- (id)init
{
//make sure we go through through the designated init function
[self doesNotRecognizeSelector:_cmd];
return nil;
}
- (id)initWithBlack
{
self = [super init];
if(self)memset(color_data, 0, DS_SCREEN_WIDTH * DS_SCREEN_HEIGHT*2 * DS_BPP);
return self;
}
- (id)initWithWhite
{
self = [super init];
if(self)memset(color_data, 255, DS_SCREEN_WIDTH * DS_SCREEN_HEIGHT*2 * DS_BPP);
return self;
}
- (id)initWithScreenState:(ScreenState*)state
{
self = [super init];
if(self)memcpy(color_data, state->color_data, DS_SCREEN_WIDTH * DS_SCREEN_HEIGHT*2 * DS_BPP);
return self;
}
- (id)initWithColorData:(const unsigned char*)data
{
self = [super init];
if(self)memcpy(color_data, data, DS_SCREEN_WIDTH * DS_SCREEN_HEIGHT*2 * DS_BPP);
return self;
}
- (const unsigned char*)colorData
{
return color_data;
}
- (NSImage *)image
{
NSImage *newImage = [[NSImage alloc] initWithSize:[ScreenState size]];
if (newImage == nil)
{
return newImage;
}
// Render the frame in an NSBitmapImageRep
NSBitmapImageRep *newImageRep = [self imageRep];
if (newImageRep == nil)
{
[newImage release];
newImage = nil;
return newImage;
}
// Attach the rendered frame to the NSImageRep
[newImage addRepresentation:newImageRep];
return newImage;
}
- (NSBitmapImageRep *)imageRep
{
if (color_data == nil)
{
return nil;
}
NSUInteger w = DS_SCREEN_WIDTH;
NSUInteger h = DS_SCREEN_HEIGHT * 2;
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:w
pixelsHigh:h
bitsPerSample:8
samplesPerPixel:4
hasAlpha:YES
isPlanar:NO
colorSpaceName:NSCalibratedRGBColorSpace
bytesPerRow:w * 4
bitsPerPixel:32];
if(imageRep == nil)
{
return imageRep;
}
UInt32 *bitmapData = (UInt32 *)[imageRep bitmapData];
RGB555ToRGBA8888Buffer((const uint16_t *)color_data, (uint32_t *)bitmapData, (w * h));
#ifdef __BIG_ENDIAN__
UInt32 *bitmapDataEnd = bitmapData + (w * h);
while (bitmapData < bitmapDataEnd)
{
*bitmapData++ = CFSwapInt32LittleToHost(*bitmapData);
}
#endif
return [imageRep autorelease];
}
@end

View File

@ -1,75 +0,0 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#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 <NSApplicationDelegate>
#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

View File

@ -1,255 +0,0 @@
/*
Copyright (C) 2007 Jeff Bland
Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
*/
#import "appDelegate_legacy.h"
#import "emuWindowDelegate_legacy.h"
#import "cocoa_input_legacy.h"
#import "cocoa_file.h"
#import "cocoa_util.h"
#import "cocoa_globals.h"
#import "nds_control_legacy.h"
#import "input_legacy.h"
#import "preferences_legacy.h"
#include "sndOSX.h"
#undef BOOL
#ifdef GDB_STUB
#include <pthread.h>
#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 fileKindByURL:fileURL];
if ([fileKind isEqualToString:@"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];
//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];
}
- (IBAction) showSupportFolderInFinder:(id)sender
{
NSURL *folderURL = [CocoaDSFile userAppSupportBaseURL];
[[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_REPORT_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

View File

@ -1,123 +0,0 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#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 <NSWindowDelegate>
#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

File diff suppressed because it is too large Load Diff

View File

@ -1,92 +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 <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#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
NSView
#else
NSImageView
#endif
{
#ifdef HAVE_OPENGL
NSOpenGLContext* context;
#endif
ScreenState *screen_buffer;
double viewScale;
double viewRotation;
NSInteger displayMode;
UInt32 gpuStateFlags;
CocoaDSController *cdsController;
}
//init
- (id)initWithFrame:(NSRect)frame;
//image to display
- (void)setScreenState:(ScreenState*)screen;
- (const ScreenState*)screenState;
//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

View File

@ -1,757 +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 <http://www.gnu.org/licenses/>.
*/
#import "video_output_view_legacy.h"
#import "cocoa_globals.h"
#import "cocoa_util.h"
#import "nds_control_legacy.h"
#import "input_legacy.h"
#import "cocoa_input_legacy.h"
#import "preferences_legacy.h"
#import "screen_state_legacy.h"
#include "../GPU.h"
#include "../NDSSystem.h"
#undef BOOL
#define HORIZONTAL(angle) ((angle) == -90 || (angle) == -270)
#define VERTICAL(angle) ((angle) == 0 || (angle) == -180)
#ifdef HAVE_OPENGL
#import <OpenGL/gl.h>
#endif
#ifdef HAVE_OPENGL
//screenstate extended to hold rotated copies
@interface ScreenState(extended)
- (void)rotateTo90;
- (void)rotateTo0;
@end
#endif
@implementation VideoOutputView
- (id)initWithFrame:(NSRect)frame
{
//Initialize the view------------------------------------------------------------------
self = [super initWithFrame:frame];
if(self==nil)
{
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Couldn't create a view for video output", nil)];
return nil;
}
screen_buffer = nil;
viewScale = 1.0;
viewRotation = 0.0;
displayMode = DS_DISPLAY_TYPE_DUAL;
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
[self setImageFrameStyle: NSImageFrameNone];
[self setImageScaling:NSScaleToFit];
[self setEditable:NO];
[self setEnabled:NO];
//Initialize the OpenGL context for displaying the screen -----------------------------------
#else
//Create the pixel format for our video output view
NSOpenGLPixelFormatAttribute attrs[] =
{
//NSOpenGLPFAFullScreen,
NSOpenGLPFAWindow, //need a renderer that can draw to a window
//NSOpenGLPFARendererID, some_number, //this picks a particular renderer, for testing
(NSOpenGLPixelFormatAttribute)0
};
NSOpenGLPixelFormat* pixel_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
if(pixel_format == nil)
{
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Couldn't create OpenGL pixel format for video output", nil)];
context = nil;
[self release];
return nil;
} else
{
context = [[NSOpenGLContext alloc] initWithFormat:pixel_format shareContext:nil];
[pixel_format release];
if(context == nil)
{
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Couldn't create OpenGL context for video output", nil)];
[self release];
return nil;
}
}
//init gl for drawing
[self setFrame:frame];
[self setBoundsRotation:0];
#endif
//init screen buffer
[self setScreenState:[ScreenState blackScreenState]];
cdsController = nil;
return self;
}
- (void)dealloc
{
#ifdef HAVE_OPENGL
[context release];
#endif
[screen_buffer release];
[super dealloc];
}
- (void)setScreenState:(ScreenState*)screen
{
if(screen_buffer == screen)return;
if(screen == nil)
{
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Recieved invalid screen update", nil)];
return;
}
[screen_buffer release]; //get rid of old screen data
screen_buffer = screen;
[screen_buffer retain]; //retain the new screendata since we will need it if we have to redraw before we recieve another update
//rotate the screen
#ifdef HAVE_OPENGL
if(HORIZONTAL([self boundsRotation]))[screen_buffer rotateTo90];
#endif
//redraw
#ifdef HAVE_OPENGL
[self display];
#else
[self setImage:[screen_buffer image]];
#endif
}
- (const ScreenState*)screenState
{
#ifdef HAVE_OPENGL
ScreenState *temp = [[ScreenState alloc] initWithScreenState:screen_buffer];
if(HORIZONTAL([self boundsRotation]))[temp rotateTo0];
return temp;
#else
return screen_buffer;
#endif
}
- (float)screenWidth
{
return DS_SCREEN_WIDTH;
}
- (float)screenHeight
{
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
if(!context)return;
//withdraw from recieving updates on previously window, if any
[[NSNotificationCenter defaultCenter] removeObserver:context];
if([self window] != nil)
{
[context setView:self];
//udpate drawable if the window changed
[[NSNotificationCenter defaultCenter] addObserver:context selector:@selector(update) name:@"NSWindowDidResizeNotification" object:[self window]];
} else [context clearDrawable];
}
#endif
#ifdef HAVE_OPENGL
- (void)drawRect:(NSRect)bounds
{
if(screen_buffer == nil)return; //simply dont draw anything if we dont have a screen data object allocated
[context makeCurrentContext];
if([self boundsRotation] == 0 || [self boundsRotation] == -180)
{
//here we send our corrected video buffer off to OpenGL where it gets pretty much
//directly copied to the frame buffer (and converted to the devices color format)
glDrawPixels(DS_SCREEN_WIDTH, DS_SCREEN_HEIGHT*2, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, (const GLvoid*)[screen_buffer colorData]);
} else
{
glDrawPixels(DS_SCREEN_HEIGHT*2, DS_SCREEN_WIDTH, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, (const GLvoid*)[screen_buffer colorData]);
}
glFlush();
}
#endif
#ifdef HAVE_OPENGL
- (void)setFrame:(NSRect)rect
{
[super setFrame:rect];
[context makeCurrentContext];
[context update];
//set the viewport (so the raster pos will be correct)
glViewport(0, 0, rect.size.width, rect.size.height);
float angle = [self boundsRotation];
if(angle == 0)
{
glRasterPos2f(-1, 1);
glPixelZoom(((float)rect.size.width) / ((float)DS_SCREEN_WIDTH), -((float)rect.size.height) / ((float)DS_SCREEN_HEIGHT*2));
} else if(angle == -90)
{
glRasterPos2f(-1, 1);
glPixelZoom(((float)rect.size.width) / ((float)DS_SCREEN_HEIGHT*2), -((float)rect.size.height) / ((float)DS_SCREEN_WIDTH));
} else if (angle == -180)
{
glRasterPos2f(1, -1);
glPixelZoom(-((float)rect.size.width) / ((float)DS_SCREEN_WIDTH), ((float)rect.size.height) / ((float)DS_SCREEN_HEIGHT*2));
} else if (angle == -270)
{
glRasterPos2f(1, -1);
glPixelZoom(-((float)rect.size.width) / ((float)DS_SCREEN_HEIGHT*2), ((float)rect.size.height) / ((float)DS_SCREEN_WIDTH));
}
}
#endif
#ifdef HAVE_OPENGL
- (BOOL)isOpaque
{
if(screen_buffer)
return YES;
//if there is no screen buffer, then we can't draw anything
//so this view is completely transparent
return NO;
}
#endif
#ifdef HAVE_OPENGL
- (void)setBoundsRotation:(CGFloat)angle
{
int angleInt = (int)angle;
int old_angle = (int)[self boundsRotation];
[super setBoundsRotation:angleInt];
[context makeCurrentContext];
NSSize size = [self frame].size;
if(angleInt == 0)
{
glRasterPos2f(-1, 1);
glPixelZoom(((float)size.width) / ((float)DS_SCREEN_WIDTH), -((float)size.height) / ((float)DS_SCREEN_HEIGHT*2));
} 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 (angleInt == -180)
{
glRasterPos2f(1, -1);
glPixelZoom(-((float)size.width) / ((float)DS_SCREEN_WIDTH), ((float)size.height) / ((float)DS_SCREEN_HEIGHT*2));
} 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(angleInt) && VERTICAL(old_angle))
[screen_buffer rotateTo90];
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
@implementation ScreenState (extended)
- (void)rotateTo90
{
int width = [ScreenState width], height = [ScreenState height];
unsigned char temp_buffer[width * height * DS_BPP];
memcpy(temp_buffer, color_data, width * height * DS_BPP);
int x, y;
for(x = 0; x< width; x++)
for(y = 0; y < height; y++)
{
color_data[(x * height + (height - y - 1)) * 2] = temp_buffer[(y * width + x) * 2];
color_data[(x * height + (height - y - 1)) * 2 + 1] = temp_buffer[(y * width + x) * 2 + 1];
}
}
- (void)rotateTo0
{
int height = [ScreenState width], width = [ScreenState height];
unsigned char temp_buffer[width * height * DS_BPP];
memcpy(temp_buffer, color_data, width * height * DS_BPP);
int x, y;
for(x = 0; x< width; x++)
for(y = 0; y < height; y++)
{
color_data[((width - x - 1) * height + y) * 2] = temp_buffer[(y * width + x) * 2];
color_data[((width - x - 1) * height + y) * 2 + 1] = temp_buffer[(y * width + x) * 2 + 1];
}
}
@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_MAIN_AND_SUB:
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_MAIN_AND_SUB:
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_MAIN_AND_SUB:
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_MAIN_AND_SUB:
result = (CommonSettings.showGpu.sub && CommonSettings.showGpu.main);
break;
default:
break;
}
return result;
}